MSV FM

dot.antimicrobial@66.96.161.157: ~ $
Path : /hermes/bosweb/b1705/absoluteresultstechnologies.net/referralsprogram.com/
File Upload :
Current < : /hermes/bosweb/b1705/absoluteresultstechnologies.net/referralsprogram.com/invite.php

<?php
	session_start('referrals');	
	error_reporting(0);
?>
<?php include_once('includes.php'); ?>
<?php include_once('mysqlUtils.php'); ?>
<?php
/*
	if(!isset($_SESSION['referrals']['user']))
	{
		header("location: index.php");
		exit;
	}
*/
	if(isset($_POST['firstname']))
	{
		unset($_SESSION['referrals']['error']);
		unset($_SESSION['referrals']['user']);
		unset($_SESSION['referrals']['inviting']);
		foreach($_POST as $key => $val)
		{
			if(strpos($key,"inviting_") !== false) $_SESSION['referrals']['inviting'][$key] = $val;
			else $_SESSION['referrals']['user'][$key] = $val;
		}
		
		if($_SESSION['referrals']['inviting']['inviting_firstname'] == "") $_SESSION['referrals']['error'] = '* Please tell us the first name of the person you are inviting';
		else if($_SESSION['referrals']['inviting']['inviting_lastname'] == "") $_SESSION['referrals']['error'] = '* Please tell us your last name of the person you are inviting';		
		else if($_SESSION['referrals']['inviting']['inviting_email'] == "") $_SESSION['referrals']['error'] = '* Please tell us your email of the person you are inviting';		
		else if($_SESSION['referrals']['inviting']['inviting_phone'] == "") $_SESSION['referrals']['error'] = '* Please tell us your phone number of the person you are inviting';		
		
		if($_SESSION['referrals']['user']['firstname'] == "") $_SESSION['referrals']['error'] = '* Please tell us your first name';
		else if($_SESSION['referrals']['user']['lastname'] == "") $_SESSION['referrals']['error'] = '* Please tell us your last name';		
		else if($_SESSION['referrals']['user']['email'] == "") $_SESSION['referrals']['error'] = '* Please tell us your email';		
		else if($_SESSION['referrals']['user']['phone'] == "") $_SESSION['referrals']['error'] = '* Please tell us your phone number';	
		
		
		if(!isset($_SESSION['referrals']['error']))
		{
			$sql = 'INSERT INTO referralsprogram (';
			$sqlArray = array();
			$keyArray = array();
			$valArray = array();
			foreach($_SESSION['referrals']['user'] as $key => $val)
			{
				if(!in_array($key,array('submit')))
				{
					$keyArray[] = $key;
					if($val == "") $valArray[] = 'null';
					else $valArray[] = '"' . $val . '"';				
				}			
			}
			foreach($_SESSION['referrals']['inviting'] as $key => $val)
			{
				if(!in_array($key,array('submit')))
				{
					$keyArray[] = $key;
					if($val == "") $valArray[] = 'null';
					else $valArray[] = '"' . $val . '"';				
				}			
			}
			
			$keyArray[] = 'dealer';
			$valArray[] = '"' . $dealerInfo[$selectedDealer]['name'] . '"';
			
			$sql .= implode(",",$keyArray) . ') VALUES (' . implode(",",$valArray) . ')';	
			//$sql .= ' WHERE appointmentID = ' . $_SESSION['referrals']['user']['appointmentID'];
			
			if(mysql_query($sql))
			{				
				header("location: thanks.php");
				exit;	
			}
			else
			{
				$_SESSION['referrals']['error'] = '* An error occurred.';
			}
		}
		
		header("location: invite.php");
		exit;
	}
	
	foreach($_SESSION['referrals']['user'] as $key => $val)
	{
		$_SESSION['referrals']['user'][$key] = stripslashes($val);
	}
	foreach($_SESSION['referrals']['inviting'] as $key => $val)
	{
		$_SESSION['referrals']['inviting'][$key] = stripslashes($val);
	}
?>
<?php include_once('header.php'); ?>
<br>
<div style="font-size:12pt;">
For the month of March, we would like to extend a special offer to you, our good customer...
<br>
<b>
Please fill out the below form to invite a friend or family member. If they purchase at Ottawa Dodge this March 2012,
<br>
<font style="font-size:14;color:red">WE WILL GIVE YOU $500 CASH!</font></b>
</div>
<br>
<style>
	.formTbl {border:1px solid #aaaaaa;background-color:#eeeeee;width:700px;height:100px;color:#333333;padding:10px}
	.formTbl td {padding-left:5px;padding-right:15px;padding-top:0px;font-size:8pt;padding-bottom:5px;}
	.formTbl td input {width:100%;font-size:8pt}
	.formTbl td select {font-size:8pt}
</style>
<center>
	<form method="POST">
		<font style="color:red;font-weight:bold"><?= $_SESSION['referrals']['error'] ?>
		<?php unset($_SESSION['referrals']['error']) ?>
		<table cellspacing="0" cellpadding="0" class="formTbl">
			<tr>
				<td style="font-size:12pt;border-bottom:1px solid #aaa">Your Information</td>
			</tr>
			<tr>
				<td style="padding-top:10px">
					<table cellspacing="0" cellpadding="0" style="width:100%">
						<tr>
							<td style="width:25%">
								<div style="text-align:left">
									<b>First Name</b>
									<br>
									<input type="text" name="firstname" value="<?= $_SESSION['referrals']['user']['firstname'] ?>">
								</div>
							</td>
							<td style="width:25%">
								<div style="text-align:left">
									<b>Last Name</b>
									<br>
									<input type="text" name="lastname" value="<?= $_SESSION['referrals']['user']['lastname'] ?>">
								</div>
							</td>
							<td style="width:25%">
								<div style="text-align:left">
									<b>Email</b>
									<br>
									<input type="text" name="email" value="<?= $_SESSION['referrals']['user']['email'] ?>">
								</div>
							</td>
							<td style="width:25%">
								<div style="text-align:left">
									<b>Main Phone</b>
									<br>
									<input type="text" name="phone" value="<?= $_SESSION['referrals']['user']['phone'] ?>">
								</div>
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td>
					<table cellspacing="0" cellpadding="0" style="width:100%">
						<tr>
							<td style="width:50%">
								<div style="text-align:left">
									<b>Address</b>
									<br>
									<input type="text" name="address" value="<?= $_SESSION['referrals']['user']['address'] ?>">
								</div>
							</td>
							<td style="width:25%">
								<div style="text-align:left">
									<b>City</b>
									<br>
									<input type="text" name="city" value="<?= $_SESSION['referrals']['user']['city'] ?>">
								</div>
							</td>
							<td style="width:25%">
								<div style="text-align:left">
									<b>Postal Code</b>
									<br>
									<input type="text" name="postalCode" value="<?= $_SESSION['referrals']['user']['postalCode'] ?>">
								</div>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
		<br>
		<table cellspacing="0" cellpadding="0" class="formTbl">
			<tr>
				<td style="font-size:12pt;border-bottom:1px solid #aaa">Who are you inviting?</td>
			</tr>
			<tr>
				<td style="padding-top:10px">
					<table cellspacing="0" cellpadding="0" style="width:100%">
						<tr>
							<td style="width:25%">
								<div style="text-align:left">
									<b>First Name</b>
									<br>
									<input type="text" name="inviting_firstname" value="<?= $_SESSION['referrals']['inviting']['inviting_firstname'] ?>">
								</div>
							</td>
							<td style="width:25%">
								<div style="text-align:left">
									<b>Last Name</b>
									<br>
									<input type="text" name="inviting_lastname" value="<?= $_SESSION['referrals']['inviting']['inviting_lastname'] ?>">
								</div>
							</td>
							<td style="width:25%">
								<div style="text-align:left">
									<b>Email</b>
									<br>
									<input type="text" name="inviting_email" value="<?= $_SESSION['referrals']['inviting']['inviting_email'] ?>">
								</div>
							</td>
							<td style="width:25%">
								<div style="text-align:left">
									<b>Main Phone</b>
									<br>
									<input type="text" name="inviting_phone" value="<?= $_SESSION['referrals']['inviting']['inviting_phone'] ?>">
								</div>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
		<br>
		<!--
		<script>
			function openClose()
			{
				if(document.getElementById('optional').style.display == 'block') document.getElementById('optional').style.display = "none";
				else document.getElementById('optional').style.display = "block";
			}
		</script>
			<table cellspacing="0" cellpadding="0" class="formTbl" style="height:40px">
				<tr>
					<td style="padding:0px" onClick="openClose()" onMouseOver="this.style.cursor='pointer'"><b>+ Optional Information</b></td>
				</tr>
			</table>
		<div id="optional" style="display:none">
			<table cellspacing="0" cellpadding="0" class="formTbl" style="border-top:0px">
				<tr>
					<td>
						<table cellspacing="0" cellpadding="0" style="width:100%">
							<tr>
								<td>
									<div style="text-align:left">
										Address
										<br>
										<input type="text" name="address" value="<?= $_SESSION['referrals']['user']['address'] ?>">
									</div>
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td>
						<table cellspacing="0" cellpadding="0" style="width:100%">
							<tr>
								<td style="width:50%">
									<div style="text-align:left">
										City
										<br>
										<input type="text" name="city" value="<?= $_SESSION['referrals']['user']['city'] ?>">
									</div>
								</td>
								<td style="width:20%">
									<div style="text-align:left">
										Province
										<br>
										<input type="text" name="province" value="<?= $_SESSION['referrals']['user']['province'] ?>">
									</div>
								</td>
								<td style="width:30%">
									<div style="text-align:left">
										Postal Code
										<br>
										<input type="text" name="postalCode" value="<?= $_SESSION['referrals']['user']['postalCode'] ?>">
									</div>
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td>
						<table cellspacing="0" cellpadding="0" style="width:100%">
							<tr>
								<td>
									<div style="text-align:left">
										Cell Phone
										<br>
										<input type="text" name="mobilePhone" value="<?= $_SESSION['referrals']['user']['mobilePhone'] ?>">
									</div>
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td>
						<table cellspacing="0" cellpadding="0" style="width:100%">
							<tr>
								<td style="width:30%">
									<div style="text-align:left">
										Current Vehicle Year
										<br>
										<input type="text" name="currentVehicleYear" value="<?= $_SESSION['referrals']['user']['currentVehicleYear'] ?>">
									</div>
								</td>
								<td style="width:70%">
									<div style="text-align:left">
										Current Make & Model
										<br>
										<input type="text" name="currentVehicleModel" value="<?= $_SESSION['referrals']['user']['currentVehicleModel'] ?>">
									</div>
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td>
						<table cellspacing="0" cellpadding="0" style="width:100%">
							<tr>
								<td nowrap>
									<div style="text-align:left">
										How would you rate the condition of your Current Vehicle?
									</div>
								</td>
								<td style="text-align:left;width:100%">
									<select name="currentVehicleCondition">
										<option value="" selected></option>
										<option value="excellent" <?= ($_SESSION['referrals']['user']['currentVehicleCondition'] == "excellent" ? 'selected' : '') ?>>Excellent</option>
										<option value="good" <?= ($_SESSION['referrals']['user']['currentVehicleCondition'] == "good" ? 'selected' : '') ?>>Good</option>
										<option value="fair" <?= ($_SESSION['referrals']['user']['currentVehicleCondition'] == "fair" ? 'selected' : '') ?>>Fair</option>
										<option value="poor" <?= ($_SESSION['referrals']['user']['currentVehicleCondition'] == "poor" ? 'selected' : '') ?>>Poor</option>
									</select>
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td>
						<table cellspacing="0" cellpadding="0" style="width:100%">
							<tr>
								<td nowrap>
									<div style="text-align:left">
										Is your Current Vehicle Leased or Purchased?
									</div>
								</td>
								<td style="text-align:left;width:100%">
									<select name="currentVehicleFinanced">
										<option value="" selected></option>
										<option value="financed" <?= ($_SESSION['referrals']['user']['currentVehicleFinanced'] == "financed" ? 'selected' : '') ?>>Financed</option>
										<option value="leased" <?= ($_SESSION['referrals']['user']['currentVehicleFinanced'] == "leased" ? 'selected' : '') ?>>Leased</option>
										<option value="owned" <?= ($_SESSION['referrals']['user']['currentVehicleFinanced'] == "owned" ? 'selected' : '') ?>>Owned</option>
									</select>
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td>
						<table cellspacing="0" cellpadding="0" style="width:100%">
							<tr>
								<td style="width:50%">
									<div style="text-align:left">
										Amount Owed on Current Vehicle $
										<br>
										<input type="text" name="currentVehicleOwed" value="<?= $_SESSION['referrals']['user']['currentVehicleOwed'] ?>">
									</div>
								</td>
								<td style="width:50%">
									<div style="text-align:left">
										Most Recent Monthly Payments $
										<br>
										<input type="text" name="currentVehiclePayment" value="<?= $_SESSION['referrals']['user']['currentVehiclePayment'] ?>">
									</div>
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td>
						<table cellspacing="0" cellpadding="0" style="width:100%">
							<tr>
								<td nowrap>
									<div style="text-align:left">
										How soon will you be in the market for a new vehicle?
									</div>
								</td>
								<td style="text-align:left;width:100%">
									<select name="dateRange">
										<option value="" selected></option>
										<option value="immediately" <?= ($_SESSION['referrals']['user']['dateRange'] == "immediately" ? 'selected' : '') ?>>Immediately</option>
										<option value="30days" <?= ($_SESSION['referrals']['user']['dateRange'] == "30days" ? 'selected' : '') ?>>30 Days</option>
										<option value="3months" <?= ($_SESSION['referrals']['user']['dateRange'] == "3months" ? 'selected' : '') ?>>3 Months</option>
										<option value="612months" <?= ($_SESSION['referrals']['user']['dateRange'] == "612months" ? 'selected' : '') ?>>6-12 Months</option>
										<option value="notsure" <?= ($_SESSION['referrals']['user']['dateRange'] == "notsure" ? 'selected' : '') ?>>Not Sure</option>
									</select>
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td>
						<table cellspacing="0" cellpadding="0" style="width:100%">
							<tr>
								<td>
									<div style="text-align:left">
										Vehicle Interested In
										<br>
										<input type="text" name="nextVehicleModel" value="<?= $_SESSION['referrals']['user']['nextVehicleModel'] ?>">
									</div>
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td>
						<table cellspacing="0" cellpadding="0" style="width:100%">
							<tr>
								<td nowrap>
									<div style="text-align:left">
										Vehicle Type
									</div>
								</td>
								<td style="text-align:left;width:100%">
									<select name="nextVehicleNewUsed">
										<option value="" selected></option>
										<option value="new" <?= ($_SESSION['referrals']['user']['nextVehicleNewUsed'] == "new" ? 'selected' : '') ?>>New</option>
										<option value="used" <?= ($_SESSION['referrals']['user']['nextVehicleNewUsed'] == "used" ? 'selected' : '') ?>>Used</option>
									</select>
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</div>
		-->
		<br>
		<input type="submit" value="Send Email" style="width:150px">
	</form>
<br><br>
<!--<a href="index.php" style="font-weight:normal">Back to Home</a>-->
</center>
<?php include_once('footer.php'); ?>