File: /home/awaldron/www/archive/5a_orig/nye2005.php
<?php
session_start();
error_reporting(0);
if(phpversion() >= "4.2.0") {
$postvars = $HTTP_POST_VARS;
$getvars = $HTTP_GET_VARS;
extract($HTTP_POST_VARS);
extract($HTTP_GET_VARS);
}
require("_header.php");
echo "<P><center><img src=\"images/nye05title.gif\"></center>\n";
if ($stage == 1) {
echo "<form action=\"nye2005.php\" method=\"post\" onSubmit=\"MM_validateForm('Purchaser','','R','Email','','RisEmail'";
if ($qty == 1) {
// do nothing
} else {
for ($h=1; $h < $qty; $h++) {
echo ",'Guest_" . $h . "','','R'";
}
}
echo ");return document.MM_returnValue\">\n";
echo "<input type=\"hidden\" name=\"stage\" value=\"2\">\n";
echo "<input type=\"hidden\" name=\"qty\" value=\"" . $qty . "\">\n";
echo "<center>\n";
echo "<b>Please enter the names of all the guests attending,<br>starting with the purchaser of the tickets. All fields are required.</b>\n";
echo "<P><table border=0><tr><td class=\"text\" align=\"right\"><b>Purchaser : </b></td><td><input type=\"text\" name=\"Purchaser\" size=35 maxlength=100></td></tr>";
echo "<tr><td class=\"text\" align=\"right\"><b>Email : </b></td><td><input type=\"text\" name=\"Email\" size=35 maxlength=75></td></tr></table>\n\n";
echo "<P><table border=0>\n";
for ($i=1; $i < $qty; $i++) {
echo "<tr><td class=\"text\">Additional Guest " . $i . " : </td>";
echo "<td class=\"text\"><input type=\"text\" name=\"Guest_" . $i . "\" size=35 maxlength=100></td></tr>\n";
}
echo "</table>\n\n";
echo "<P><input type=\"checkbox\" name=\"of_age\" value=\"1\"> <b>I certify that all guests listed are at least 21 years of age.</b>\n";
echo "<br><br><br><br><img src=\"http://www.paypal.com/images/paypal_logo.gif\">\n";
echo "<br>All transactions are handled securely via PayPal</b>\n";
//echo "<P>If you do not have a PayPal account, you will be prompted to create one before purchasing.\n";
echo "<P><input type=\"submit\" value=\" Purchase Tickets with PayPal >> \">\n";
echo "</form></center>\n";
} else if ($stage == 2) {
if ($Purchaser) { $_SESSION['purchaser'] = $Purchaser; }
if ($Email) { $_SESSION['email'] = $Email; }
if ($Guest_1) { $_SESSION['guest_1'] = $Guest_1; }
if ($Guest_2) { $_SESSION['guest_2'] = $Guest_2; }
if ($Guest_3) { $_SESSION['guest_3'] = $Guest_3; }
if ($Guest_4) { $_SESSION['guest_4'] = $Guest_4; }
if ($Guest_5) { $_SESSION['guest_5'] = $Guest_5; }
if ($Guest_6) { $_SESSION['guest_6'] = $Guest_6; }
if ($Guest_7) { $_SESSION['guest_7'] = $Guest_7; }
if ($Guest_8) { $_SESSION['guest_8'] = $Guest_8; }
if ($Guest_9) { $_SESSION['guest_9'] = $Guest_9; }
if ($of_age != 1) {
echo "<form action=\"nye2005.php\" method=\"post\">\n";
echo "<input type=\"hidden\" name=\"stage\" value=\"2\">\n";
echo "<input type=\"hidden\" name=\"qty\" value=\"" . $qty . "\">\n";
if ($Purchaser) { echo "<input type=\"hidden\" name=\"Purchaser\" value=\"" . $Purchaser . "\"><P>Purchaser: " . $Purchaser . "\n"; }
if ($Email) { echo "<input type=\"hidden\" name=\"Email\" value=\"" . $Email . "\"><br>Email: " . $Email . "\n"; }
if ($Guest_1) { echo "<input type=\"hidden\" name=\"Guest_1\" value=\"" . $Guest_1 . "\"><P>Guest 1: " . $Guest_1 . "\n"; }
if ($Guest_2) { echo "<input type=\"hidden\" name=\"Guest_2\" value=\"" . $Guest_2 . "\"><br>Guest 2: " . $Guest_2 . "\n"; }
if ($Guest_3) { echo "<input type=\"hidden\" name=\"Guest_3\" value=\"" . $Guest_3 . "\"><br>Guest 3: " . $Guest_3 . "\n"; }
if ($Guest_4) { echo "<input type=\"hidden\" name=\"Guest_4\" value=\"" . $Guest_4 . "\"><br>Guest 4: " . $Guest_4 . "\n"; }
if ($Guest_5) { echo "<input type=\"hidden\" name=\"Guest_5\" value=\"" . $Guest_5 . "\"><br>Guest 5: " . $Guest_5 . "\n"; }
if ($Guest_6) { echo "<input type=\"hidden\" name=\"Guest_6\" value=\"" . $Guest_6 . "\"><br>Guest 6: " . $Guest_6 . "\n"; }
if ($Guest_7) { echo "<input type=\"hidden\" name=\"Guest_7\" value=\"" . $Guest_7 . "\"><br>Guest 7: " . $Guest_7 . "\n"; }
if ($Guest_8) { echo "<input type=\"hidden\" name=\"Guest_8\" value=\"" . $Guest_8 . "\"><br>Guest 8: " . $Guest_8 . "\n"; }
if ($Guest_9) { echo "<input type=\"hidden\" name=\"Guest_9\" value=\"" . $Guest_9 . "\"><br>Guest 9: " . $Guest_9 . "\n"; }
echo "<P><font color=\"ff0000\">** Please check below if all guests are at least 21 years of age. **</font>\n";
echo "<br><input type=\"checkbox\" name=\"of_age\" value=\"1\"> <b>I certify that all guests listed are at least 21 years of age.</b>\n";
echo "<P><input type=\"submit\" value=\"Submit\">\n";
echo "</form>\n";
} else {
$confirm_num = date(mdGis);
$_SESSION['confirm_num'] = $confirm_num;
$_SESSION['qty'] = $qty;
// Check for data file, if doesn't exist, create:
$ext = ".txt";
$filename = $confirm_num;
$filepath = "cgi-bin/guestlist/" . $filename . $ext;
@ $fp = fopen($filepath,"r");
if (!$fp) { // CREATE FILE
touch($filepath);
$fp = fopen($filepath,"w");
$new_file = "Confirmation Number:" . $confirm_num . "\n\n";
if ($Purchaser) { $new_file .= "Purchaser: " . $Purchaser . "\n"; }
if ($Email) { $new_file .= "Email: " . $Email . "\n\n"; }
if ($Guest_1) { $new_file .= "Guest 1: " . $Guest_1 . "\n"; }
if ($Guest_2) { $new_file .= "Guest 2: " . $Guest_2 . "\n"; }
if ($Guest_3) { $new_file .= "Guest 3: " . $Guest_3 . "\n"; }
if ($Guest_4) { $new_file .= "Guest 4: " . $Guest_4 . "\n"; }
if ($Guest_5) { $new_file .= "Guest 5: " . $Guest_5 . "\n"; }
if ($Guest_6) { $new_file .= "Guest 6: " . $Guest_6 . "\n"; }
if ($Guest_7) { $new_file .= "Guest 7: " . $Guest_7 . "\n"; }
if ($Guest_8) { $new_file .= "Guest 8: " . $Guest_8 . "\n"; }
if ($Guest_9) { $new_file .= "Guest 9: " . $Guest_9 . "\n"; }
fwrite($fp,$new_file);
fclose($fp);
} else {
fclose($fp);
}
$masterlist = "cgi-bin/guestlist/master_list.txt";
$fp = fopen($masterlist,"a");
$purchaser_line = "$Purchaser / $confirm_num / \n";
fwrite($fp,$purchaser_line);
if ($Guest_1) { $guest_line = "$Guest_1 / $confirm_num / \n"; fwrite($fp,$guest_line); }
if ($Guest_2) { $guest_line = "$Guest_2 / $confirm_num / \n"; fwrite($fp,$guest_line); }
if ($Guest_3) { $guest_line = "$Guest_3 / $confirm_num / \n"; fwrite($fp,$guest_line); }
if ($Guest_4) { $guest_line = "$Guest_4 / $confirm_num / \n"; fwrite($fp,$guest_line); }
if ($Guest_5) { $guest_line = "$Guest_5 / $confirm_num / \n"; fwrite($fp,$guest_line); }
if ($Guest_6) { $guest_line = "$Guest_6 / $confirm_num / \n"; fwrite($fp,$guest_line); }
if ($Guest_7) { $guest_line = "$Guest_7 / $confirm_num / \n"; fwrite($fp,$guest_line); }
if ($Guest_8) { $guest_line = "$Guest_8 / $confirm_num / \n"; fwrite($fp,$guest_line); }
if ($Guest_9) { $guest_line = "$Guest_9 / $confirm_num / \n"; fwrite($fp,$guest_line); }
fclose($fp);
echo "<form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\" name=\"paypal\">\n";
echo "<input type=\"hidden\" name=\"cmd\" value=\"_xclick\">\n";
echo "<input type=\"hidden\" name=\"business\" value=\"dkoch@5thAce.com\">\n";
echo "<input type=\"hidden\" name=\"item_name\" value=\"5AE 2005 New Year's Eve Bash (Admission)\">\n";
echo "<input type=\"hidden\" name=\"item_number\" value=\"5AEnye2005\">\n";
echo "<input type=\"hidden\" name=\"amount\" value=\"70.00\">\n";
echo "<input type=\"hidden\" name=\"no_shipping\" value=\"1\">\n";
echo "<input type=\"hidden\" name=\"return\" value=\"http://www.5thace.com/nye2005.php?stage=3\">\n";
echo "<input type=\"hidden\" name=\"rm\" value=\"2\">\n";
echo "<input type=\"hidden\" name=\"cancel_return\" value=\"http://www.5thace.com\">\n";
echo "<input type=\"hidden\" name=\"quantity\" value=\"" . $qty . "\">\n";
echo "<input type=\"hidden\" name=\"no_note\" value=\"1\">\n";
echo "<input type=\"hidden\" name=\"custom\" value=\"" . $confirm_num . "\">\n";
echo "<input type=\"hidden\" name=\"currency_code\" value=\"USD\">\n";
echo "<input type=\"hidden\" name=\"lc\" value=\"US\">\n";
echo "<input type=\"image\" src=\"https://www.paypal.com/images/x-click-but23.gif\" border=\"0\" name=\"submit\" alt=\"Make payments with PayPal - it's fast, free and secure!\">\n";
echo "</form>\n";
echo "<script>document.paypal.submit();</script>\n";
}
} else if ($stage == 3) {
// Confirm in file
$ext = ".txt";
$filename = $custom;
$filepath = "cgi-bin/guestlist/" . $filename . $ext;
// READ IN DATA
$data = file($filepath);
$datalen = count($data);
// WRITE DATA TO FILE
$fp = fopen($filepath,"w");
for ($l=0; $l < $datalen; $l++) {
$data[$l] = trim($data[$l]);
$line = $data[$l] . "\n";
fwrite($fp,$line);
}
$newline = "\n\n\n-----------------------------------------------------\n\nThe following information was passed from PayPal to 5thace.com following the completion of the transaction:\n\nConfirmed: YES\nPayment Date: $payment_date\nBuyer's Name: $last_name, $first_name\nBuyer's Email: $payer_email\n\nQuantity: $quantity\nTotal Payment: $payment_gross\nPayment Fee: $payment_fee\n\nConfirmation Number: $custom";
fwrite($fp,$newline);
fclose($fp);
// CONFIRM MASTER LIST
$masterlist = "cgi-bin/guestlist/master_list.txt";
$mlist = file($masterlist);
$mlistlen = count($mlist);
for ($y=0; $y < $mlistlen; $y++) {
$mlist[$y] = trim($mlist[$y]);
if (strstr($mlist[$y],$custom)) { // IF A CURRENT USER
$mlist[$y] = $mlist[$y] . "Paid";
}
}
$ml = fopen($masterlist,"w");
for ($x=0; $x < $mlistlen; $x++) {
$ml_line = $mlist[$x] . "\n";
fwrite($ml,$ml_line);
}
fclose($ml);
// Explode PayPal Variables
explode($postvars);
// Build list of guests
$guests = "";
if (isset($_SESSION['purchaser'])) { $guests .= $_SESSION['purchaser'] . "\n"; }
if (isset($_SESSION['guest_1'])) { $guests .= $_SESSION['guest_1'] . "\n"; }
if (isset($_SESSION['guest_2'])) { $guests .= $_SESSION['guest_2'] . "\n"; }
if (isset($_SESSION['guest_3'])) { $guests .= $_SESSION['guest_3'] . "\n"; }
if (isset($_SESSION['guest_4'])) { $guests .= $_SESSION['guest_4'] . "\n"; }
if (isset($_SESSION['guest_5'])) { $guests .= $_SESSION['guest_5'] . "\n"; }
if (isset($_SESSION['guest_6'])) { $guests .= $_SESSION['guest_6'] . "\n"; }
if (isset($_SESSION['guest_7'])) { $guests .= $_SESSION['guest_7'] . "\n"; }
if (isset($_SESSION['guest_8'])) { $guests .= $_SESSION['guest_8'] . "\n"; }
if (isset($_SESSION['guest_9'])) { $guests .= $_SESSION['guest_9'] . "\n"; }
// Email User
$message = "Thank you for reserving your spot at the Fifth Ace Entertainment 2005 New Year's Eve Bash! The following names have been added to our guest list:\n\n";
$message .= $guests;
$message .= "\nYour confirmation number: " . $custom;
$message .= "\nAlthough you have been placed on the guest list, you will need your confirmation number if there are any disputes or discrepancies at the door. Of course we do not anticipate this happening but it's still a good idea to have it with you!";
$message .= "\n\nDon't forget to reserve your room at the Wyndham Airport Hotel for the low rate of $59.00 by calling 1-800-328-9297 and mentioning The Fifth Ace Entertainment New Year's Eve Celebration.";
$message .= "\n\nCheck the website for party updates at http://www.5thace.com/nye2005.php";
$home_email = "dkoch@5thace.com";
$subject = "2005 New Year's Eve Bash : Your Confirmation Number";
$additional_headers = "From: Fifth Ace Entertainment <$home_email>\n" . "Reply-To: $home_email";
mail($payer_email, $subject, $message, $additional_headers);
// Email Fifth Ace
$message2 = "The following $quantity guests have purchased tickets and must be added to the Master Guest list:\n\n";
$message2 .= $guests;
$message2 .="\n\nThe confirmation attached to these reservations is " . $custom;
$home_email = "dkoch@5thace.com";
$subject = "Reservations for 2005 New Year's Eve Bash";
$additional_headers = "From: " . $first_name . " " . $last_name . "<$payer_email>\n" . "Reply-To: $payer_email";
mail($home_email, $subject, $message2, $additional_headers);
// Post Thank You
echo "<P><center><b>Thank You " . $first_name . "!</b></center>\n";
echo "<P>Your payment has been processed and you" . ($quantity > 1 ? " and your " . ($quantity-1) . " guests " : " ") . "have been successfully added to our guest list! We can't wait to see you at the party!\n";
echo "<center><br><br><br><b>Your Confirmation Number: </b>" . $custom . "</center>\n";
echo "<P>Although you have been placed on the guest list, you will need your confirmation number if there are any disputes or discrepancies at the door. Of course we do not anticipate this happening but it's still a good idea to have it with you! For your convenience, your confirmation number has been emailed to you at '" . $payer_email . "'\n";
} else {
// Enter Text For Page.
echo "<P><table width=250 border=0 cellspacing=0 cellpadding=0 align=\"right\" style=\"margin:0px 0px 10px 10px;\">\n";
echo "<tr><td width=4 height=4><img src=\"images/box_top_left.gif\" width=4 height=4></td>\n";
echo " <td width=* height=4><img src=\"images/box_top.gif\" width=100% height=4></td>\n";
echo " <td width=4 height=4><img src=\"images/box_top_right.gif\" width=4 height=4></td>\n";
echo "</tr>\n";
echo "<tr><td width=4 background=\"images/box_right.gif\"><img src=\"images/clear.gif\" width=1 height=1></td>\n";
echo " <td align=\"center\" valign=\"middle\" class=\"text\">\n";
echo "<form action=\"nye2005.php\" method=\"post\">\n";
echo "<input type=\"hidden\" name=\"stage\" value=\"1\">\n";
echo "<div style=\"width:90%\">\n";
echo "<br><b><font color=CC0000 size=3>Buy Tickets Online!</font></b>\n";
echo "<P align=\"left\"><b>To reserve a spot for you and your friends, please begin by selecting the number of tickets you require:</b></P>\n";
echo "<center><b>Qty:</b> <SELECT name=\"qty\"><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option><option>6</option><option>7</option><option>8</option><option>9</option><option>10</option></SELECT>\n";
echo "<input type=\"submit\" value=\" Continue >> \"></center><br>\n";
echo "</div>\n";
echo " </td>\n";
echo " <td width=4 background=\"images/box_left.gif\"><img src=\"images/clear.gif\" width=1 height=1></td>\n";
echo "</tr>\n";
echo "<tr><td width=4 height=4><img src=\"images/box_bot_left.gif\" width=4 height=4></td>\n";
echo " <td width=* height=4><img src=\"images/box_bottom.gif\" width=100% height=4></td>\n";
echo " <td width=4 height=4><img src=\"images/box_bot_right.gif\" width=4 height=4></td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "<P>Yes, we're doing it again! The <b>3rd Annual 5AE New Year's Bash</b> is in full effect! Those of you who were in attendance last year, get ready, because we will be topping last year! And for those of you hearing about it for the first time, believe us when we say that there \"ain't no party like a Fifth Ace party, 'cause a Fifth Ace party don't stop!\"\n";
//echo "<P><b>MORE DETAILS COMING SOON!</b><br><br><br><br><br><br>\n";
echo "<P><b>When and Where is the party?</b><br>This year's bash is being held at the wonderful Wyndham Pittsburgh Airport Hotel Grand Ballroom located near Pittsburgh International Airport. Doors open at 8:00pm, dinner will start around 8:30. The Bash officially ends at 1:00am, but the party continues at the hotel until dawn! \n";
echo "<P><b>What's Included?</b><br>Each ticket to the party includes an all-you-can-eat grand buffet, open bar, party hats, noisemakers, door prizes and dancing with the best in dance music spun by the one and only DJ 5th Ace! Also, we'll be holding a 50/50 raffle giving you a chance to win your ticket money back!\n";
echo "<P><b>How much does it cost?</b><br>Tickets are only $70.00 each.\n";
echo "<P><b>Where do I go afterward?</b><br>Why not reserve a room at the Wyndham so you don't have to worry about driving home after all the fun! Reserve your room at the fantastic rate of only $65 (half off normal rates!) by calling 1-800-328-9297 and mention that you are attending \"The Fifth Ace Entertainment New Year's Eve Celebration\".\n";
echo "<P><b>Where can I get more information?</b><br>Any questions can be answered by contacting Fifth Ace Entertainment at (412) 916-3988\n";
}
require("_footer.php");
?>