rendered paste body<?
Include("includes/functions.inc.php");
$PageTitle = "Group Reservations - Free Group Quote";
$MetaDescription = "";
$MetaKeywords = "";
$HeaderAltText = "";
$PageTopperText = "";
Include("includes/templates/header.php");
Include("includes/templates/search_form.php");
?>
<div id="contentsmall">
<h1>Free Group Quote Request</h1>
<?
$departure_1 = $_POST['destination_1'];
//$departure_1 = substr($departure_1, 0, -4);
//$departure_1 = explode("-", $departure_1);
//$departure_1 = substr_replace($departure_1[0], strtoupper(substr($departure_1[0], 0, 1)), 0, 1) . ' ' . substr_replace($departure_1[1], strtoupper(substr($departure_1[1], 0, 1)), 0, 1) . ' ' . substr_replace($departure_1[2], strtoupper(substr($departure_1[2], 0, 1)), 0, 1);
$departure_2 = $_POST['destination_2'];
$query = "SELECT id,region,main_location,specific_location FROM locations WHERE id='".mysql_escape_string($departure_2)."'");
$result = mysql_query($query, $link);
while($row=mysql_fetch_array($result)) {
if ($row['specific_location']) { $departure_2_text = $row['specific_location']; }
if (($row['main_location']) && (!$row['specific_location'])) { $departure_2_text = $row['main_location']; }
if (($row['region']) && (!$row['main_location']) && (!$row['specific_location'])) { $departure_2_text = $row['region']; }
}
//$departure_2 = mysql_query("SELECT id, region, main_location, specific_location FROM locations WHERE id='$departure_2'");
//$departure_2 = substr($departure_2, 0, -4);
//$departure_2 = explode("-", $departure_2);
//$departure_2 = substr_replace($departure_2[0], strtoupper(substr($departure_2[0], 0, 1)), 0, 1) . ' ' . substr_replace($departure_2[1], strtoupper(substr($departure_2[1], 0, 1)), 0, 1) . ' ' . substr_replace($departure_2[2], strtoupper(substr($departure_2[2], 0, 1)), 0, 1);
$people = htmlspecialchars($_POST['people'], ENT_QUOTES);
$nights = htmlspecialchars($_POST['nights'], ENT_QUOTES);
$accommodations = $_POST['accommodations'];
$departure_date = htmlspecialchars($_POST['departure_dt'], ENT_QUOTES);
$second_departure_date = htmlspecialchars($_POST['second_departure_dt'], ENT_QUOTES);
$discount_air = $_POST['air'];
$midweek = $_POST['midweek'];
$accommodations_category = $_POST['accommodations_category'];
$same_city = $_POST['samecity'];
$departure_city = htmlspecialchars($_POST['departure_city'], ENT_QUOTES);
$group_details = htmlspecialchars($_POST['group_details'], ENT_QUOTES);
$email = htmlspecialchars($_POST['email'], ENT_QUOTES);
$first_name = htmlspecialchars($_POST['first_name'], ENT_QUOTES);
$last_name = htmlspecialchars($_POST['last_name'], ENT_QUOTES);
$phone = htmlspecialchars($_POST['phone'], ENT_QUOTES);
$address = htmlspecialchars($_POST['address'], ENT_QUOTES);
$city = htmlspecialchars($_POST['city'], ENT_QUOTES);
$state = htmlspecialchars($_POST['state'], ENT_QUOTES);
$zip_code = htmlspecialchars($_POST['zip_code'], ENT_QUOTES);
$group_name = htmlspecialchars($_POST['group'], ENT_QUOTES);
$website = htmlspecialchars($_POST['website'], ENT_QUOTES);
$group_type = $_POST['grouptype'];
$run_before = $_POST['runbefore'];
//$comp_ratio = htmlspecialchars($_POST['comp_ratio'], ENT_QUOTES);
//$comp_other = htmlspecialchars($_POST['comp_other'], ENT_QUOTES);
//$resort = htmlspecialchars($_POST['resort'], ENT_QUOTES);
//$property = htmlspecialchars($_POST['property'], ENT_QUOTES);
//$prev_people = htmlspecialchars($_POST['prev_people'], ENT_QUOTES);
//$other_company = htmlspecialchars($_POST['othercompany'], ENT_QUOTES);
$email_list = $_POST['email_list'];
$date = date;
if ($group_type == 34) { $group_type_name = "Conference Planning"; }
if ($group_type == 3) { $group_type_name = "Collegiate Club"; }
if ($group_type == 1) { $group_type_name = "Corporate Travel"; }
if ($group_type == 9) { $group_type_name = "Families & Reunions"; }
if ($group_type == 33) { $group_type_name = "Gay Travel"; }
if ($group_type == 14) { $group_type_name = "Singles Travel"; }
if ($group_type == 2) { $group_type_name = "Ski Club"; }
if ($group_type == 29) { $group_type_name = "Sports Team"; }
if ($group_type == 22) { $group_type_name = "Wedding Travel"; }
if ($group_type == 21) { $group_type_name = "Other"; }
$body .= 'Destination: ' . $departure_1 . '<br>';
$body .= 'Second Choice Destination: ' . $departure_2 . '<br>';
$body .= 'People: ' . $people . '<br>';
$body .= 'Nights: ' . $nights . '<br>';
$body .= 'Accommodations: ' . $accommodations . '<br>';
$body .= 'Departure Date:' . $departure_date . '<br>';
$body .= 'Second Departure Date: ' . $second_departure_date . '<br>';
$body .= 'Discount Air: ' . $discount_air . '<br>';
$body .= 'Midweek Travel: ' . $midweek . '<br>';
$body .= 'Accommodations Category: ' . $accommodations_category . '<br>';
$body .= 'Departing from Same City: ' . $same_city . '<br>';
$body .= 'Departure City: ' . $departure_city . '<br>';
$body .= 'Group Details: ' . $group_details . '<br>';
$body .= 'Email: ' . $email . '<br>';
$body .= 'First Name: ' . $first_name . '<br>';
$body .= 'Last Name: ' . $last_name . '<br>';
$body .= 'Phone: ' . $phone . '<br>';
$body .= 'Address: ' . $address . '<br>';
$body .= 'City: ' . $city . '<br>';
$body .= 'State: ' . $state . '<br>';
$body .= 'Zip Code:' . $zip_code . '<br>';
$body .= 'Group Name: ' . $group_name . '<br>';
$body .= 'Website: ' . $website . '<br>';
$body .= 'Group Type: ' . $group_type_name . '<br>';
$body .= 'Run Group Before: ' . $run_before . '<br>';
$body .= 'Email List: ' . $email_list . '<br>';
if ((!$people) || (!$departure_date) || (!$accommodations) || (!$accommodations_category) ||
(!$first_name) || (!$last_name) || (!$phone) || (!$email))
{
echo '<h2>Please go back and fill out the following required information:</h2>';
}
?>
<p>
<?
if (!$people) { echo "• Number of people <br>"; }
if (!$departure_date) { echo "• Departure date <br>"; }
if (!$accommodations) { echo "• Type of accomodations <br>"; }
if (!$accommodations_category) { echo "• Category of accomodations <br>"; }
if (!$first_name) { echo "• First name <br>"; }
if (!$last_name) { echo "• Last name <br>"; }
if (!$phone) { echo "• Phone number<br>"; }
if (!$email) { echo "• Email address <br>"; }
if (($people) && ($departure_date) && ($accommodations) && ($accommodations_category) &&
($first_name) && ($last_name) && ($phone) && ($email))
{
$insert = "INSERT INTO groups (group_name,group_created,group_address,group_email,group_website,group_type,number_of_members,group_notes)
VALUES ('$group_name', CURDATE(), '$address $city $state $zip_code', '$email', '$website', '$group_type', '$people',
'Destination: $destination_1
Second Choice Destination: $destination_2_text
Nights: $nights
Accommodations: $accommodations
Departure Date: $departure_date
Second Choice Departure Date: $second_departure_date
Discount Airfare: $discount_air
Midweek Travel: $midweek
All Departing From Same City: $same_city
Departure City/Cities: $departure_city
Group Details: $group_details
First Name: $first_name
Last Name: $last_name
Phone: $phone
Run a Group Before: $run_before
Email List: $email_list ')";
mysql_query($insert) or die ("Could not add any data to specified table...");
$id = mysql_insert_id();
$insert = "INSERT INTO group_proposal (group_id,location_id,web_site_id,status)
VALUES ('$id', '$departure_1', '20', '108')";
mysql_query($insert) or die ("Could not add any data to specified table...");
$booking_id = mysql_insert_id();
$r_body .= "REQ".$booking_id."<br>";
$r_body .= "IP Address: ".$_SERVER["REMOTE_ADDR"]."<br>";
$r_body .= "Campaign: ".GetCampaignName($campaign_id)."<br>";
$r_body .= "Referer Page: ".$_SERVER["HTTP_REFERER"]."<br>";
$EMail = strip_tags($email);
echo "Thank you. A group reservation agent will process your quote request and get back to you shortly.";
$free_group_quote_template = file_get_contents("includes/templates/".str_replace("www.", "", $_SERVER["HTTP_HOST"])."/email/free_group_quote.php");
$free_group_quote_template = str_replace("GROUPQUOTE", $groupinfo, $free_group_quote_template);
$free_group_quote_template = str_replace("DEPARTURE_1", $departure_1, $free_group_quote_template );
$free_group_quote_template = str_replace("DEPARTURE_2", $departure_2, $free_group_quote_template );
$free_group_quote_template = str_replace("PEOPLE", $people, $free_group_quote_template );
$free_group_quote_template = str_replace("NIGHTS", $nights, $free_group_quote_template );
$free_group_quote_template = str_replace("ACCOMMODATIONS", $accommodations, $free_group_quote_template );
$free_group_quote_template = str_replace("DEPARTURE_DATE", $departure_date, $free_group_quote_template );
$free_group_quote_template = str_replace("SECONDDEPARTUREDATE", $second_departure_date, $free_group_quote_template );
$free_group_quote_template = str_replace("DISCOUNT_AIR", $discount_air, $free_group_quote_template );
$free_group_quote_template = str_replace("MIDWEEK", $midweek, $free_group_quote_template );
$free_group_quote_template = str_replace("ACCOMMODATIONCATEGORY", $accommodations_category, $free_group_quote_template );
$free_group_quote_template = str_replace("SAME_CITY", $same_city, $free_group_quote_template );
$free_group_quote_template = str_replace("DEPARTURE_CITY", $departure_city, $free_group_quote_template );
$free_group_quote_template = str_replace("GROUP_DETAILS", $group_details, $free_group_quote_template );
$free_group_quote_template = str_replace("EMAIL", $email, $free_group_quote_template );
$free_group_quote_template = str_replace("FIRST_NAME", $first_name, $free_group_quote_template );
$free_group_quote_template = str_replace("LAST_NAME", $last_name, $free_group_quote_template );
$free_group_quote_template = str_replace("PHONE", $phone, $free_group_quote_template );
$free_group_quote_template = str_replace("ADDRESS", $address, $free_group_quote_template );
$free_group_quote_template = str_replace("CITY", $city, $free_group_quote_template );
$free_group_quote_template = str_replace("STATE", $state, $free_group_quote_template );
$free_group_quote_template = str_replace("ZIP_CODE", $zip_code, $free_group_quote_template );
$free_group_quote_template = str_replace("GROUP_NAME", $group_name, $free_group_quote_template );
$free_group_quote_template = str_replace("WEBSITE", $website, $free_group_quote_template );
$free_group_quote_template = str_replace("GROUP_TYPE", $group_type_name, $free_group_quote_template );
$free_group_quote_template = str_replace("RUN_BEFORE", $run_before, $free_group_quote_template );
$free_group_quote_template = str_replace("LIST", $email_list, $free_group_quote_template );
$free_group_quote_template = str_replace("DATE", $date, $free_group_quote_template );
SendMail('info@resortdestinationmarketing.com', GetWebSiteTitle(GetCurrentWebSiteID()), $EMail, $Name, 'Free Group Quote Request', $free_group_quote_template, strip_tags($free_group_quote_template));
SendMail($email, $first_name, "swilliford@skicolorado.com", $Name, 'Group Reservations Free Group Quote Lead', '---Request Info---<br>' . $r_body . '<br>---Group Info:---<br>' . $body, 'test');
SendMail($email, $first_name, "bpannell@skicolorado.com", $Name, 'Group Reservations Free Group Quote Lead', '---Request Info---<br>' . $r_body . '<br>---Group Info:---<br>' . $body, 'test');
SendMail($email, $first_name, "shea@skicolorado.com", $Name, 'Group Reservations Free Group Quote Lead', '---Request Info---<br>' . $r_body . '<br>---Group Info:---<br>' . $body, 'test');
}
?>
</p>
</div>
<?
Include("includes/templates/footer.php");
?>