############# V 1.1
sub check_permissions_reg{
my $login_id = shift;
my $org_id = shift;
my $league_id = shift;
my $info_id = shift;
my $page = shift;
my $access = 0;
my $tempaccess = 1;
if(!(defined($info_id))){ # On control panel, this is getting passed in as nothing, so double check it
$info_id = -9999;
}
# print "\n";
#######################################
## Check if they have permissions at
## hometeamz
#######################################
my $dbh = get_dbh();
my $query = "SELECT * FROM `Permissions_Info` WHERE `Login_ID` = '$login_id' AND `Access_Type`= 'HT' AND `Access_ID` = '80'";
my $sth = $dbh->prepare($query);
#print "\n";
$sth->execute();
$sth->bind_columns(\$Key, \$Login_ID, \$Access_Type,
\$Access_ID, \$Access_Level);
while($sth->fetch()) {
if($Access_Level eq "HT"){$access = 80;}
}
#######################################
## Check if they have permissions at
## organizational level
#######################################
$query = "SELECT * FROM `Permissions_Info` WHERE `Login_ID` = '$login_id' AND (`Access_Type`= 'REG' OR `Access_Type`= 'ORG') AND `Access_ID` = '$org_id'";
$sth = $dbh->prepare($query);
#print "\n";
$sth->execute();
$sth->bind_columns(\$Key, \$Login_ID, \$Access_Type,
\$Access_ID, \$Access_Level);
while($sth->fetch()) {
#print "\n";
#if($Access_Level eq "R"){$tempaccess = 1;}
if($Access_Level eq "REG2"){$tempaccess = 2;}
if($Access_Level eq "RW") {$tempaccess = 3;}
if($Access_Level eq "REG3"){$tempaccess = 3;}
if($tempaccess > $access){
$access = $tempaccess;
}
}
#if(uc($page) eq "LEAGUE"){
# $league_info_id = $league_id;
#}else{
# $league_info_id = $info_id;
#}
########################################
## Check if they have permissions at
## page level
#######################################
#$query = "SELECT * FROM `Permissions_Info` WHERE `Login_ID` = '$login_id' AND `Access_Type`= '$page' AND `Access_ID` = '$league_info_id'";
##print "QUERY: $query\n";
#$sth = $dbh->prepare($query);
# #print "\n";
#$sth->execute();
#$sth->bind_columns(\$Key, \$Login_ID, \$Access_Type,
# \$Access_ID, \$Access_Level);
#while($sth->fetch()) {
# if($Access_Level eq "R"){$tempaccess = 1;}
# if($Access_Level eq "RW"){$tempaccess = 2;}
# if($tempaccess > $access){
# $access = $tempaccess;
# }
#
# }
return $access;
}
#########################################
# Get the org ID from the League ID
#########################################
sub get_email_info_from_session_and_id{
my $session_id = shift;
my $user_key = shift;
my $dbh = get_dbh();
my $return_email = "";
################################################################
# Query DB to verify Session
################################################################
my $query = "SELECT email FROM `Account_Info` WHERE `Last_Access_ID` = '$session_id' AND `Key` = '$user_key'";
#print "QUERY: $query
\n";
my $sth = $dbh->prepare($query);
$sth->execute();
$sth->bind_columns(\$email);
while($sth->fetch()) {
$return_email = $email;
}
# disconnect from database
$dbh->disconnect;
$sth->finish();
return $return_email;
}
############################################
# Get The status options into a hash
# Change this part to get data from DB
############################################
sub get_status_hash{
my $org_id = shift;
my $reg_year = shift;
my $dbh = get_dbh();
my %tmp_status_hash;
my $query = "SELECT `State_ID`, `State_Desc`, `Accepted_State` FROM `Reg_Confirmation_States` WHERE `Org_ID`='$org_id' AND `Reg_Year`='$reg_year' ORDER BY `Order`";
my $sth = $dbh->prepare($query);
$sth->execute();
while (my $hash_ref = $sth->fetchrow_hashref) {
my $state_id = $hash_ref->{State_ID};
my $state_desc = $hash_ref->{State_ID};
$tmp_status_hash{$state_id}{"DESC"} = $hash_ref->{State_Desc};
$tmp_status_hash{$state_id}{"ACCEPTED_STATE"} = $hash_ref->{Accepted_State};
}
$dbh->disconnect;
$sth->finish();
return %tmp_status_hash;
}
sub print_pay_by_check{
$active_id{"pay"} = "id=current";
my $user_key = param('userkey');
my %user_info = get_account_info($user_key);
my %player_info = get_player_info($user_key);
my ($user_table, $pay_pal) = get_checkout_table($user_key, 1);
my $account_table = get_account_table($user_key);
print_steps();
print "
| \n";
print " Step 5 : Pay by Check Please verify your registration prior to sending the check. " . $user_table, " "; print " |
| ";
$html .= " Step 6 : Order Complete \n";
$html .= $pay_complete_message . " \n"; if($org_id == 167){ # Plymouth required forms $html .= "Print Registration Confirmation and Player Forms\n"; } $html .= "\n"; $html .= " |
Step 5:Verify Partial Payment Please enter the partial payment amount you wish to pay below.$min_pay_message \n"; print " | |
"; print $verify_form; print $pay_by_check_form; print $pay_pal; print " | |
Step 5: Enter Partial Payment Amount Please enter the partial payment amount you wish to pay below. \n"; print " | |
"; print $verify_form; print $pay_by_check_form; print $pay_pal; print " | |
| \n";
print " Step 5:Verify Order Please verify your registration prior to checkout. "; print $verify_form; print $pay_by_check_form; print $pay_pal; print " |
| Name | Division | edit | remove | Paid |
| Name | Edit | Remove | ||
| $player_info{$user_number}{\"FIRSTNAME\"} $player_info{$user_number}{\"LASTNAME\"} | \n"; $user_table .= "\n"; $user_table .= " | \n"; #$user_table .= " | \$$amount_paid | |
| $account_table | $user_table |
|
Step 3:Update Registration Please complete the information listed below...
* Required Fields
| |
|
Step 4:Verify Program Registration Please verify the player information listed below. |