Restaurant Signup
query($q); $row = $r->fetch_array(); $_SESSION["intro"] = stripslashes(urldecode($row["zone"])); $_SESSION["thanks"] = stripslashes(urldecode($row["content"])); // get prix fixe box content & Verify blurb $bq = "select content,zone from cms_site_content where alias='form_footer'"; $br = $etomite_db->query($bq); $brow = $br->fetch_array(); $_SESSION["box_text"] = stripslashes(urldecode($brow["content"])); $_SESSION["verify_blurb"] = stripslashes(urldecode($brow["zone"])); $cuisineq = "select * from cuisines order by cuisine"; $cuisiner = $etomite_db->query($cuisineq); $n = $cuisiner->num_rows; for ($i=0; $i<$n; $i++) { $rw = $cuisiner->fetch_array(); $cuisines[] = $rw["cuisine"]; } $_SESSION["cuisines"] = $cuisines; if (!isset($_POST["submitted"])) $_POST["submitted"] = false; // for blank checkboxes, create a value to prevent PHP warnings later $bundles = array("bundle_social", "bundle_lirn", "bundle_lirw", "bundle_all", "add_lirn_dir", "add_lirn_e_dir", "add_enhanced", "add_enhanced_map", "add_lirn_fb", "add_lirn_fbs", "add_lirn_ig", "add_lirn_igs", "add_lirw_fb", "add_lirw_fbs", "add_lirw_ig", "add_lirw_igs", "add_eblast_group", "add_lirn_group_article", "add_lirn_ad", "add_eblast_solo", "add_marketing", "add_lirn_article", "spotlight"); foreach($bundles as $this_bundle) { if (!isset($_POST[$this_bundle])) $_POST[$this_bundle] = ''; } if ($_POST["submitted"]=="Continue") { $amt = 550; if ($_POST["bundle_social"]=="Yes") $amt += 114.95; if ($_POST["bundle_lirn"]=="Yes") $amt += 169.95; if ($_POST["bundle_lirw"]=="Yes") $amt += 79.95; if ($_POST["bundle_all"]=="Yes") $amt += 624.95; if ($_POST["add_lirn_dir"]=="Yes") $amt += 31.95; if ($_POST["add_lirn_e_dir"]=="Yes") $amt += 49.95; if ($_POST["add_enhanced"]=="Yes") $amt += 34.95; if ($_POST["add_enhanced_map"]=="Yes") $amt += 31.95; if ($_POST["add_lirn_fb"]=="Yes") $amt += 31.95; if ($_POST["add_lirn_fbs"]=="Yes") $amt += 26.95; if ($_POST["add_lirn_ig"]=="Yes") $amt += 26.95; if ($_POST["add_lirn_igs"]=="Yes") $amt += 28.95; if ($_POST["add_lirw_fb"]=="Yes") $amt += 31.95; if ($_POST["add_lirw_fbs"]=="Yes") $amt += 26.95; if ($_POST["add_lirw_ig"]=="Yes") $amt += 26.95; if ($_POST["add_lirw_igs"]=="Yes") $amt += 28.95; if ($_POST["add_eblast_group"]=="Yes") $amt += 125; if ($_POST["add_lirn_group_article"]=="Yes") $amt += 175; /* new fall 2023 */ if ($_POST["add_lirn_ad"]=="Yes") $amt += 125; if ($_POST["add_eblast_solo"]=="Yes") $amt += 375; if ($_POST["add_marketing"]=="Yes") $amt += 199; if ($_POST["add_lirn_article"]=="Yes") $amt += 295; if ($_POST["spotlight"]=="Yes") $amt += 160; $_POST["tx_amt"] = $amt; $_SESSION["tx_amt"] = $amt; } // fields in form/table $c = 0; $fields = array( $c++ => array("field_name" => "first_name", "field_label" => "First Name", "req" => true), $c++ => array("field_name" => "last_name", "field_label" => "Last Name", "req" => true), $c++ => array("field_name" => "title", "field_label" => "Title", "req" => false), $c++ => array("field_name" => "contact_person", "field_label" => "Contact person for LIRW (if different from name above)", "req" => false), $c++ => array("field_name" => "company", "field_label" => "Name of Long Island Restaurant", "req" => true), $c++ => array("field_name" => "address", "field_label" => "Restaurant Address", "req" => true), $c++ => array("field_name" => "city", "field_label" => "City", "req" => true), $c++ => array("field_name" => "county", "field_label" => "County", "req" => true), $c++ => array("field_name" => "state", "field_label" => "State", "req" => true), $c++ => array("field_name" => "zip", "field_label" => "Zip", "req" => true), $c++ => array("field_name" => "areacode", "field_label" => "Area Code", "req" => true), $c++ => array("field_name" => "phone_first3", "field_label" => "Phone (first half)", "req" => true), $c++ => array("field_name" => "phone_last4", "field_label" => "Phone (last half)", "req" => true), $c++ => array("field_name" => "cell", "field_label" => "Cell Phone (if applicable)", "req" => false), $c++ => array("field_name" => "email", "field_label" => "Contact Email", "req" => true), $c++ => array("field_name" => "url", "field_label" => "Website Address (if applicable)", "req" => false), $c++ => array("field_name" => "lirw_alum", "field_label" => "Have you participated in LIRW before?", "req" => false), $c++ => array("field_name" => "howheard_signups_open", "field_label" => "Where you heard it was time to sign up", "req" => true), $c++ => array("field_name" => "cuisine_std", "field_label" => "Type of Cuisine", "req" => true), $c++ => array("field_name" => "userfile", "field_label" => "Uploaded menu file", "req" => false), $c++ => array("field_name" => "userfile_new", "field_label" => "Uploaded menu file (unique file name)", "req" => false), $c++ => array("field_name" => "offerings", "field_label" => "Prix Fixe Offerings", "req" => true), $c++ => array("field_name" => "spotlight", "field_label" => "Be in the Spotlight", "req" => false), $c++ => array("field_name" => "bundle_social", "field_label" => "Social Marketing Bundle", "req" => false), $c++ => array("field_name" => "bundle_lirn", "field_label" => "Long Island Restaurant News Marketing Bundle", "req" => false), $c++ => array("field_name" => "bundle_lirw", "field_label" => "Long Island Restaurant Week Marketing Bundle", "req" => false), $c++ => array("field_name" => "bundle_all", "field_label" => 'All-In Marketing Bundle', "req" => false), $c++ => array("field_name" => "add_lirn_dir", "field_label" => "Directory listing on Long Island Restaurant News website", "req" => false), $c++ => array("field_name" => "add_lirn_e_dir", "field_label" => "Featured directory listing on Long Island Restaurant News website", "req" => false), $c++ => array("field_name" => "add_enhanced", "field_label" => "Enhanced listing on Long Island Restaurant Week website", "req" => false), $c++ => array("field_name" => "add_enhanced_map", "field_label" => "Enhanced listing on Long Island Restaurant Week map", "req" => false), $c++ => array("field_name" => "add_lirn_fb", "field_label" => "Long Island Restaurant News sponsored Facebook post", "req" => false), $c++ => array("field_name" => "add_lirn_fbs", "field_label" => "Long Island Restaurant News sponsored Facebook story", "req" => false), $c++ => array("field_name" => "add_lirn_ig", "field_label" => "Long Island Restaurant News Collaborative Instagram post", "req" => false), $c++ => array("field_name" => "add_lirn_igs", "field_label" => "Long Island Restaurant News sponsored Instagram story", "req" => false), $c++ => array("field_name" => "add_lirw_fb", "field_label" => "Long Island Restaurant Week sponsored Facebook post", "req" => false), $c++ => array("field_name" => "add_lirw_fbs", "field_label" => "Long Island Restaurant Week sponsored Facebook story", "req" => false), $c++ => array("field_name" => "add_lirw_ig", "field_label" => "Long Island Restaurant Week Collaborative Instagram post", "req" => false), $c++ => array("field_name" => "add_lirw_igs", "field_label" => "Long Island Restaurant Week sponsored Instagram story", "req" => false), $c++ => array("field_name" => "add_eblast_group", "field_label" => "Inclusion in group email blast", "req" => false), $c++ => array("field_name" => "add_lirn_group_article", "field_label" => "Inclusion in group article on Long Island Restaurant News website", "req" => false), $c++ => array("field_name" => "add_lirn_ad", "field_label" => "Ad on Long Island Restaurant News website", "req" => false), $c++ => array("field_name" => "add_eblast_solo", "field_label" => "Dedicated email blast", "req" => false), $c++ => array("field_name" => "add_lirn_article", "field_label" => "Feature article on Long Island Restaurant News website", "req" => false), $c++ => array("field_name" => "add_marketing", "field_label" => "Marketing Consultation", "req" => false), $c++ => array("field_name" => "bill_first_name", "field_label" => "First Name on Credit Card", "req" => true), $c++ => array("field_name" => "bill_last_name", "field_label" => "Last Name on Credit Card", "req" => true), $c++ => array("field_name" => "bill_address", "field_label" => "Billing Address", "req" => true), $c++ => array("field_name" => "bill_city", "field_label" => "Billing City", "req" => true), $c++ => array("field_name" => "bill_state", "field_label" => "Billing State", "req" => true), $c++ => array("field_name" => "bill_zip", "field_label" => "Billing Zip", "req" => true), $c++ => array("field_name" => "bill_phone", "field_label" => "Billing Phone", "req" => true), $c++ => array("field_name" => "cc_type", "field_label" => "Credit Card Type", "req" => true), $c++ => array("field_name" => "cc_num", "field_label" => "Credit Card Number", "req" => true), $c++ => array("field_name" => "cc_code", "field_label" => "Credit Card Security Code", "req" => true), $c++ => array("field_name" => "cc_month", "field_label" => "Expiration Month", "req" => true), $c++ => array("field_name" => "cc_year", "field_label" => "Expiration Year", "req" => true), $c++ => array("field_name" => "agree_rules", "field_label" => "You must agree to the rules of participation:", "req" => true), $c++ => array("field_name" => "info_correct", "field_label" => "This information is correct:", "req" => true), $c++ => array("field_name" => "code", "field_label" => "6-digit Validation Code", "req" => true), $c++ => array("field_name" => "authnet_result", "field_label" => "authnet_result", "req" => false), $c++ => array("field_name" => "authnet_message", "field_label" => "authnet_message", "req" => false), $c++ => array("field_name" => "authnet_response", "field_label" => "authnet_response", "req" => false), $c++ => array("field_name" => "authnet_tx_id", "field_label" => "authnet_tx_id", "req" => false), $c++ => array("field_name" => "tx_amt", "field_label" => "Transaction Amount", "req" => false) ); // LOGIC: if ($_POST["submitted"]=="Continue") { // this submission may be a resubmit. see if menu exists from prior submission // if so, add saved menu name to POST prior to serialization if (isset($_SESSION["menuname"])) { // menu already exists on server; add to POST $_POST["userfile"] = $_SESSION["menuname"]; $_POST["userfile_new"] = $_SESSION["menuname_new"]; } else { // fcn returns filename or FALSE, writes to file_error string, populates POST with userfile and userfile_new, populates SESSION varialbles $file_error = ""; $uploaded_file = true; $uploaded_file = manage_file(); // creates POST and SESSION vars, file error string //if ($uploaded_file) $_SESSION["menu"] = $uploaded_file; } $_SESSION["screen1"] = serialize($_POST); $is_valid = validate_form($fields); //returns TRUE/FALSE and writes to error string // test the hidden captcha fields if ($_POST["other"]<>"") $trap1=true; else $trap1=false; if ($_POST["captcha"]<>"") $trap2=true; else $trap2=false; /* $ip = $_SERVER['REMOTE_ADDR']; $details = json_decode(file_get_contents("http://ipinfo.io/".$ip."/json")); $co = $details->country; if ($trap1 || $trap2 || $co != 'US') { */ if ($trap1 || $trap2) { $_SESSION["scammer"] = "itsascam"; } else { $_SESSION["scammer"] = "itsok"; } if (!$is_valid) { echo $error; include "form_signup.php"; } else { echo $_SESSION["verify_blurb"]; echo 'Contact Information
';
for ($i=0; $i
";
echo '
"; include "form_signup.php"; // save authnet error message to logfile $handle = fopen("inc/declined_transaction_log.txt", "a"); fwrite($handle, date("Y-m-d H:i:s")." ".$_POST["authnet_response"]."\n\n"); fclose($handle); } else { // transaction went through -- // clear CC num and v-code out of global array before inserting/emailing $_POST["cc_num"] = "last four: ".substr($_POST["cc_num"],-4); $_POST["cc_code"] = "xxx"; $mailmsg = generate_msg($fields); $query_arrays = generate_arrays_object($fields); $all_fields = $query_arrays->all_fields; $all_values = $query_arrays->all_values; $mailintro = $season." Participation Form Submitted from LIRW Site\n\n"; $subject = "LIRW ".$season." Participation Form Submission"; $from = "From: LIRW Participation Form\r\n";
$mailintro_client = "This is your receipt for Long Island Restaurant Week sign-up\n\n";
$subject_client = "LIRW Participation Receipt";
$from_client = "From: Long Island Restaurant Week \r\n";
mail("marketing@longislandrestaurantweek.com", $subject, $mailintro.$mailmsg, $from);
mail("popcorn@gmail.com", $subject, $mailintro.$mailmsg, $from);
mail("press@longislandrestaurantweek.com", $subject, $mailintro.$mailmsg, $from);
mail("jenn@wordhampton.com", $subject, $mailintro.$mailmsg, $from);
$insert_fields = implode(",",$all_fields);
$insert_values = implode(",",$all_values);
$stamp = date("Y-m-d H:i:s");
if ($_POST["bundle_lirw"]=="Yes" || $_POST["bundle_all"]=="Yes" || $_POST["add_enhanced"]=="Yes") {
$insert_fields .= ",enhance";
$insert_values .= ",'Yes'";
}
$query="insert into participation_form (".$insert_fields.", stamp, season) values (".$insert_values.", '".$stamp."', '".$dbseason."')";
mail("popcorn@gmail.com", $subject, $query."\n\nQUERY HAS NOT RUN YET\n\n".$mailintro.$mailmsg, $from);
$etomite_db->query($query);
if ($_POST["bundle_lirn"]=="Yes" || $_POST["add_lirn_dir"]=="Yes" || $_POST["add_lirn_e_dir"]=="Yes" || $_POST["bundle_all"]=="Yes") {
include "inc/import_to_LIRN_directory.inc";
$dir_info = " \n\n List on LIRN/all in bundle? ".$_POST["bundle_all"]." \n\nList on LIRN/LIRN bundle? ".$_POST["bundle_lirn"]." \n\nList on LIRN/a la carte? ".$_POST["add_lirn_dir"]." \n\nList on LIRN-Featured/a la carte? ".$_POST["add_lirn_e_dir"]." \n\n".$cuisine_id_query."\n\n" .$directory_insert. " \n\n LIRN insert result: ".$insert_res;
mail("popcorn@gmail.com", "LIRW directory bundle", $dir_info, $from);
} else {
$dir_info = "";
}
$thanks_txt = strip_tags($_SESSION["thanks"]);
$thanks_html = $_SESSION["thanks"];
$subject_client = "Welcome to Long Island Restaurant Week";
echo $_SESSION["thanks"];
# SEND AS HTML TO CLIENT; SEND NOTIFICATIONS TO GMAIL ADDRESSES
//send_html_conf($_POST["email"], $thanks_html, $thanks_txt);
include("inc/smtp.php");
unset($_POST);
unset($_SESSION);
$_SESSION = array();
session_unset();
session_destroy();
session_write_close();
}
} else {
echo $_SESSION["intro"];
include "form_signup.php";
}
$etomite_db->close();
?>
Restaurant Details
';
if ($fields[$i]["field_name"]=="cuisine_std") echo '
Cuisine and Menu
';
if ($fields[$i]["field_name"]=="spotlight") echo '
Additional Exposure
';
if ($fields[$i]["field_name"]=="bill_first_name") echo '
Billing Address
';
if ($fields[$i]["field_name"]=="cc_type") echo '
Credit Card Details
';
if ($fields[$i]["field_name"]=="agree_rules") echo '
Terms of Service
';
if ( (substr($fields[$i]["field_label"],0,7) != "authnet") && ($fields[$i]["field_name"] != "userfile_new") && ($fields[$i]["field_name"] != "tx_amt") && ($fields[$i]["field_name"] != "code") ) {
echo '\n";
}
}
echo '
'.$fields[$i]["field_label"] . "
\n";
echo '';
if (isset($_POST[$fields[$i]["field_name"]])) {
if (is_array($_POST[$fields[$i]["field_name"]])) {
echo implode(", ",$_POST[$fields[$i]["field_name"]]) ;
} else {
echo ($_POST[$fields[$i]["field_name"]]=="1") ? "Yes" : $_POST[$fields[$i]["field_name"]];
}
}
echo "
\nCost
Transaction Amount
$'.$_SESSION["tx_amt"]."
Please click the button only ONE time when registering.
More than once may result in more than one registration/payment!
".$_POST["authnet_result"].": ";
echo $_POST["authnet_message"]."
Code: ".$results[0].". Subcode: ".$_POST["authnet_response_subcode"].". Reason code: ".$_POST["authnet_response_reason_code"].".
";
echo "Please review the payment fields and resubmit the form.
If you continue to have problems, please email this information to info@longislandrestaurantweek.com:
".$_POST["authnet_message"]."
"; include "form_signup.php"; // save authnet error message to logfile $handle = fopen("inc/declined_transaction_log.txt", "a"); fwrite($handle, date("Y-m-d H:i:s")." ".$_POST["authnet_response"]."\n\n"); fclose($handle); } else { // transaction went through -- // clear CC num and v-code out of global array before inserting/emailing $_POST["cc_num"] = "last four: ".substr($_POST["cc_num"],-4); $_POST["cc_code"] = "xxx"; $mailmsg = generate_msg($fields); $query_arrays = generate_arrays_object($fields); $all_fields = $query_arrays->all_fields; $all_values = $query_arrays->all_values; $mailintro = $season." Participation Form Submitted from LIRW Site\n\n"; $subject = "LIRW ".$season." Participation Form Submission"; $from = "From: LIRW Participation Form