$eq = mysql_query ("SELECT * FROM golf_events WHERE ge_id = '$_REQUEST[id]' ");
$erow = mysql_fetch_assoc($eq);
$num = mysql_num_rows($eq);
if ($num == 0) {
echo "No matching event";
} else {
?>
Registration for the echo $erow['ge_name']?>
// Set session cookie so we don't resubmit on a backup
if ($_REQUEST['step5']) {
require("authorize_credit_golf.php");
}
else if ($_REQUEST['step4']) {
// Get the payment.
$price = $_REQUEST['r_cost'];
include("golf_paymentform.php");
} else if ($_REQUEST['step3']) {
// Enter the info into the db
if ($_REQUEST['signuptype'] == 1) {
$cur = 1;
while ($cur <= $_REQUEST['numplayers']) {
$fname = "fname".$cur;
$lname = "lname".$cur;
$org = "organization".$cur;
//echo $_REQUEST[$fname]." ".$_REQUEST[$lname]." ".$_REQUEST[$org]."
";
$cur++;
$data['rg_fname'] = $_REQUEST[$fname];
$data['rg_lname'] = $_REQUEST[$lname];
$data['rg_org'] = $_REQUEST[$org];
$data['r_id'] = $_REQUEST['registrantid'];
$data['ge_id'] = $_REQUEST['id'];
add_record(golf_registrantsguests,$data);
}
} else if ($_REQUEST['signuptype'] == 2) {
// echo $_REQUEST['numplayers']." foursomes found
";
$curfoursome = 1;
while ($curfoursome <= $_REQUEST['numplayers']) {
$cur = 1;
while ($cur <= 4) {
$fname = "fname".$curfoursome."_".$cur;
$lname = "lname".$curfoursome."_".$cur;
$org = "organization".$curfoursome."_".$cur;
// Debug Stuff
// echo $fname;
// echo "-".$_REQUEST[$fname]." ".$_REQUEST[$lname]." ".$_REQUEST[$org]."
";
$data['rg_fname'] = $_REQUEST[$fname];
$data['rg_lname'] = $_REQUEST[$lname];
$data['rg_org'] = $_REQUEST[$org];
$data['r_id'] = $_REQUEST['registrantid'];
$data['rg_foursomeid'] = $curfoursome;
$data['ge_id'] = $_REQUEST['id'];
add_record(golf_registrantsguests,$data);
$cur++;
}
$curfoursome++;
}
} else if ($_REQUEST['signuptype'] == 3) {
// echo $_REQUEST['numplayers']." foursomes found
";
$curfoursome = 1;
while ($curfoursome <= $_REQUEST['numplayers']) {
$cur = 1;
while ($cur <= 4) {
$fname = "fname".$curfoursome."_".$cur;
$lname = "lname".$curfoursome."_".$cur;
$org = "organization".$curfoursome."_".$cur;
// Debug Stuff
// echo $fname;
// echo "-".$_REQUEST[$fname]." ".$_REQUEST[$lname]." ".$_REQUEST[$org]."
";
$data['rg_fname'] = $_REQUEST[$fname];
$data['rg_lname'] = $_REQUEST[$lname];
$data['rg_org'] = $_REQUEST[$org];
$data['r_id'] = $_REQUEST['registrantid'];
$data['rg_foursomeid'] = $curfoursome;
$data['ge_id'] = $_REQUEST['id'];
add_record(golf_registrantsguests,$data);
$cur++;
}
$curfoursome++;
}
} else if ($_REQUEST['signuptype'] == 4) {
$cur = 1;
while ($cur <= $_REQUEST['numplayers']) {
$fname = "fname".$cur;
$lname = "lname".$cur;
$org = "organization".$cur;
//echo $_REQUEST[$fname]." ".$_REQUEST[$lname]." ".$_REQUEST[$org]."
";
$cur++;
$data['rg_fname'] = $_REQUEST[$fname];
$data['rg_lname'] = $_REQUEST[$lname];
$data['rg_org'] = $_REQUEST[$org];
$data['r_id'] = $_REQUEST['registrantid'];
$data['ge_id'] = $_REQUEST['id'];
add_record(golf_registrantsguests,$data);
}
} else if ($_REQUEST['signuptype'] == 5) {
$cur = 1;
while ($cur <= $_REQUEST['numplayers']) {
$fname = "fname".$cur;
$lname = "lname".$cur;
$org = "organization".$cur;
//echo $_REQUEST[$fname]." ".$_REQUEST[$lname]." ".$_REQUEST[$org]."
";
$cur++;
$data['rg_fname'] = $_REQUEST[$fname];
$data['rg_lname'] = $_REQUEST[$lname];
$data['rg_org'] = $_REQUEST[$org];
$data['r_id'] = $_REQUEST['registrantid'];
$data['ge_id'] = $_REQUEST['id'];
add_record(golf_registrantsguests,$data);
}
}
// Now get the registrant info:
$rq = mysql_query ("SELECT * FROM golf_registrants WHERE r_id = '$_REQUEST[registrantid]' ");
$rinfo = mysql_fetch_assoc($rq);
// Add registrant to the guest list
/*$datar['r_id'] = $_REQUEST['registrantid'];
$datar['rg_fname'] = $rinfo['r_fname'];
$datar['rg_lname'] = $rinfo['r_lname'];
$datar['rg_org'] = $rinfo['r_organization'];
add_record(golf_registrantsguests,$datar);
*/
// Figure out cost
$total = 0;
$desc = "";
$uq = mysql_query ("SELECT * FROM golf_registrants WHERE r_id = '$_REQUEST[registrantid]' ");
$uinfo = mysql_fetch_assoc($uq);
if ($uinfo['r_playeroptions'] == 1) {
$num = $uinfo['r_playernum'];
$subtotal = $num * 130;
$total = $total + $subtotal;
$desc .= $num." x Single Player
";
} else if ($uinfo['r_playeroptions'] == 2) {
$num = $uinfo['r_playernum'];
$subtotal = $num * 500;
$total = $total + $subtotal;
$desc .= $num." x Foursomes
";
} else if ($uinfo['r_playeroptions'] == 3) {
$num = $uinfo['r_playernum'];
$subtotal = $num * 625;
$total = $total + $subtotal;
$desc .= $num." x Foursomes w/Hole Sponsorship
";
} else if ($uinfo['r_playeroptions'] == 4) {
$num = 1;
$subtotal = $num * 60;
$total = $total + $subtotal;
$desc .= $num." x Lesson and Lunch
";
} else if ($uinfo['r_playeroptions'] == 5) {
$num = 1;
$subtotal = $num * 35;
$total = $total + $subtotal;
$desc .= $num." x Lunch Only
";
}
// Check for sponsorship and add to total if there is any
if ($uinfo['r_sponsorship'] == 1) {
$snum = $uinfo['r_numsponsorship'];
$subtotal = $snum * 150;
$total = $total + $subtotal;
$desc .= $snum." x Hole Sponsorship
";
}
if ($uinfo['r_sponsorship'] == 2) {
$snum = $uinfo['r_numsponsorship'];
$subtotal = $snum * 250;
$total = $total + $subtotal;
$desc .= $snum." x Gift Bag Sponsorship
";
}
if ($uinfo['r_sponsorship'] == 3) {
$snum = $uinfo['r_numsponsorship'];
$subtotal = $snum * 250;
$total = $total + $subtotal;
$desc .= $snum." x Breakfast/Lunch Sponsorship
";
}
# if ($uinfo['r_sponsorship'] == 4) {
# $snum = $uinfo['r_numsponsorship'];
# $subtotal = $snum * 250;
# $total = $total + $subtotal;
# $desc .= $snum." x Breakfast Sponsorship
";
# }
// Add notes & cost & desc
$datarr['r_notes'] = $_REQUEST['r_notes'];
$datarr['r_cost'] = $total;
$datarr['r_desc'] = $desc;
$where = "r_id = ".$_REQUEST['registrantid'];
modify_record(golf_registrants,$datarr,$where);
?>
Please review your registration details below:
} else if ($_REQUEST['step2']) {
foreach ($_POST as $key => $value ) {
// Debug Code - Dump the variables.
if (($key == "step2") || ($key == "r_playernum") || ($key == "r_playernum2") || ($key == "r_playernum3") || ($key == "r_numsponsorship") || ($key == "r_sponsorship")) { }
else {
$data[$key] = $value;
//print $key . " " . "=" . " " . $value."
";
}
// Get player stats
if ($_REQUEST['r_playeroptions'] == 1) { $data['r_playernum'] = $_REQUEST['r_playernum']; }
else if ($_REQUEST['r_playeroptions'] == 2) { $data['r_playernum'] = $_REQUEST['r_playernum2']; }
else if ($_REQUEST['r_playeroptions'] == 3) { $data['r_playernum'] = $_REQUEST['r_playernum3']; }
else if ($_REQUEST['r_playeroptions'] == 4) { $data['r_playernum'] = $_REQUEST['r_playernum4']; }
else if ($_REQUEST['r_playeroptions'] == 5) { $data['r_playernum'] = $_REQUEST['r_playernum5']; }
}
// Event ID
$data['r_geid'] = $_REQUEST['id'];
//var_dump($data);
// Sponsorship stuff
if ($_REQUEST['r_sponsorship'] == 1) {
$data['r_sponsorship'] = $_REQUEST['r_sponsorship'];
$data['r_numsponsorship'] = $_REQUEST['r_numsponsorship'];
}
if ($_REQUEST['r_sponsorship'] == 2) {
$data['r_sponsorship'] = $_REQUEST['r_sponsorship'];
$data['r_numsponsorship'] = $_REQUEST['r_numsponsorship'];
}
if ($_REQUEST['r_sponsorship'] == 3) {
$data['r_sponsorship'] = $_REQUEST['r_sponsorship'];
$data['r_numsponsorship'] = $_REQUEST['r_numsponsorship'];
}
if ($_REQUEST['r_sponsorship'] == 4) {
$data['r_sponsorship'] = $_REQUEST['r_sponsorship'];
$data['r_numsponsorship'] = $_REQUEST['r_numsponsorship'];
}
if ($_REQUEST['r_sponsorship'] == 6) {
$data['r_sponsorship'] = $_REQUEST['r_sponsorship'];
$data['r_numsponsorship'] = $_REQUEST['r_numsponsorship'];
}
add_record(golf_registrants,$data);
$registrantid = mysql_insert_id();
// 1-3 players
if ($_REQUEST['r_playeroptions'] == 1) {
?>
Please provide your guest information below:
// Write the record to the DB:
//echo $_REQUEST['r_playernum']." players
";
$cur = 1;
?>
} else if ($_REQUEST['r_playeroptions'] == 4) {
?>
Please provide your guest information below:
// Write the record to the DB:
//echo $_REQUEST['r_playernum']." players
";
$cur = 1;
?>
} else if ($_REQUEST['r_playeroptions'] == 5) {
?>
Please provide your guest information below:
// Write the record to the DB:
//echo $_REQUEST['r_playernum']." players
";
$cur = 1;
?>
} else if ($_REQUEST['r_playeroptions'] == 2) {
?>
Please provide your guest information below:
$cur = 1;
?>
} else if ($_REQUEST['r_playeroptions'] == 3) {
?>
Please provide your guest information below:
$cur = 1;
?>
}
} else { ?>
Please complete the form below to register:
} ?>
} ?>
require("registration_footer.htm");
require("functions.php");