MSV FM

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

<?php include_once('includes.php'); ?>
<?php
	include_once('displayUtils.php');
	$bbLink = 'http://xml.canadianblackbook.com/XMLWebServices/service?&account=absolute_xml&key=Dgje48Sw39&schemaVersion=3.0&';
	
	$lists = array('years','makes','models','trims','styles');
	
	if(isset($_GET['getList']))
	{
		$curKey = array_search($_GET['getList'],$lists);
 		
   		if($_GET['getList'] == 'years')
   		{
			$xml = simplexml_load_file($bbLink . 'command=' . $_GET['getList']);
   			$list = $xml->response->years->year;
   			
   			if($list == '') exit;
   		}
   		else if($_GET['getList'] == 'makes')
   		{
			$xml = simplexml_load_file($bbLink . 'year=' . $_GET['year'] . '&command=' . $_GET['getList']);
			$list = $xml->response->makes->make;
   			if($list == '') exit;
		}
   		else if($_GET['getList'] == 'models')
   		{
			$xml = simplexml_load_file($bbLink . 'year=' . $_GET['year'] . '&make=' . urlencode($_GET['make']) . '&command=' . $_GET['getList']);
			$list = $xml->response->models->model;
   			if($list == '') exit;
		}
   		else if($_GET['getList'] == 'trims')
   		{
			$xml = simplexml_load_file($bbLink . 'year=' . $_GET['year'] . '&make=' . urlencode($_GET['make']) . '&model=' . urlencode($_GET['model']) . '&command=' . $_GET['getList']);
			$list = $xml->response->trims->trim;
		}
   		else if($_GET['getList'] == 'styles')
   		{
			$xml = simplexml_load_file($bbLink . 'year=' . $_GET['year'] . '&make=' . urlencode($_GET['make']) . '&model=' . urlencode($_GET['model']) . '&trim=' . urlencode($_GET['trim']) . '&command=' . $_GET['getList']);
			$list = $xml->response->styles->style;
		}
   		
   		$html = '<select id="' . $_GET['getList'] . '" name="' . $_GET['getList'] . '"' . ($curKey < (count($lists)-1) ? ' onChange="getList(\'' .  $lists[$curKey+1] . '\')"' : '') . '>';
   		
   		if(count($list) > 1) $html .= '<option value=""></option>';
   		if($list == '') $html .= '<option value="">None</option>';
   		
   		foreach($list as $item)
   		{
   			$html .= '<option value="' . $item . '">' . $item . '</option>';
   		}
   		$html .= '</select>';
   		?>
   		document.getElementById('<?= $_GET['getList'] ?>Div').innerHTML = '<?= ajaxHTML($html) ?>';
   		<?php
   		
   		for($i = ($curKey+1); $i < count($lists); $i++)
   		{
	   		?>
	   		document.getElementById('<?= $lists[$i] ?>Div').innerHTML = '';
	   		<?php
   		}
   		
   		if(($curKey < (count($lists)-1)) && count($list) == 1)
   		{
	   		?>
	   		getList('<?= $lists[$curKey+1]?>');
	   		<?php   			
   		}
   		
   		exit;
	}
	
	if(isset($_POST['firstname']))
	{
		unset($_SESSION['tradeup']);
		$_SESSION['tradeup'] = $_POST;
		
		$xml = simplexml_load_file($bbLink . 'kilometers=' . ereg_replace("[^0-9]", "", $_SESSION['tradeup']['kilometers']) . '&year=' . $_SESSION['tradeup']['years'] . '&make=' . urlencode($_SESSION['tradeup']['makes']) . '&model=' . urlencode($_SESSION['tradeup']['models']) . '&trim=' . urlencode($_SESSION['tradeup']['trims']) . '&style=' . urlencode($_SESSION['tradeup']['styles']) . '&command=priceVehicle');
		$list = $xml->response->vehicles->vehicle->values;
		$_SESSION['tradeup']['values'] = get_object_vars ($list);
			
		header("location: success.php");
		exit;		
	}
?>
<?php include_once('header.php'); ?>
<script src="scripts/ajax.js" language="javascript"></script>
<script>
	function getList(val)
	{
		year = '';
		make = '';
		model = '';
		trim = '';
		styleVal = '';
		if(document.getElementById('years') != undefined) year=document.getElementById('years').value;
		if(document.getElementById('makes') != undefined) make=document.getElementById('makes').value;
		if(document.getElementById('models') != undefined) model=document.getElementById('models').value;
		if(document.getElementById('trims') != undefined) trim=document.getElementById('trims').value;
		if(document.getElementById('styles') != undefined) styleVal=document.getElementById('styles').value;
		
		htmlStr = 'index.php?getList=' + val + '&year=' + year.replace(/&/,"%26") + '&make=' + make.replace(/&/,"%26") + '&model=' + model.replace(/&/,"%26") + '&trim=' + trim.replace(/&/,"%26") + '&style=' + styleVal.replace(/&/,"%26");
		//htmlStr = 'index.php?getList=' + val + '&year=' + year + '&make=' + make + '&model=' + model + '&trim=' + trim + '&style=' + styleVal;
		//alert(htmlStr);
		ajax_do(htmlStr);
	}
	
	function checkForm()
	{
		if(document.getElementById('firstname').value == "")
		{
			alert('Please tell us your first name.');
			return false;
		}
		else if(document.getElementById('lastname').value == "")
		{
			alert('Please tell us your last name.');
			return false;
		}
		else if(document.getElementById('mobile').value == "")
		{
			alert('Please tell us your mobile phone.');
			return false;
		}
		else if(document.getElementById('email').value == "")
		{
			alert('Please tell us your email address.');
			return false;
		}
		else if(false && document.getElementById('kilometers').value == "")
		{
			alert('Please tell us the kilometers of your trade in.');
			return false;
		}
		else if(false && (document.getElementById('styles') == undefined || document.getElementById('styles').value == ""))
		{
			alert('Please tell us information about your current vehicle.');
			return false;
		}
		else
		{
			return true;
		}
		
	}
</script>
<style>
	.formTbl td {padding-bottom:2px;height:25px}
	.formTbl td input {width:160px}
</style>
<table cellspacing="0" cellpadding="0" style="width:100%">
	<tr>
		<td style="padding-left:40px;text-align:left;">
			<center>
			<img src="images/title.jpg">	
			<div style="color:white;background-color:#111;padding-top:10px;text-align:left;padding-left:20px;padding-right:20px">
				<br>
				<form method="POST" onSubmit="return checkForm()">
					<table cellspacing="0" cellpadding="0" style="width:100%">
						<tr>
							<td style="padding:5px 0px;width:270px">
								<table cellspacing="0" cellpadding="0" class="formTbl">
									<tr>
										<td colspan="2" style="padding-bottom:15px;font-size:12pt;color:yellow;font-weight:bold;text-align:center">How can we contact you?</td>
									</tr>
									<tr>
										<td style="width:100px">First Name</td>
										<td><input type="text" id="firstname" name="firstname" value="<?= $_SESSION['tradeup']['firstname'] ?>"></td>
									</tr>
									<tr>
										<td>Last Name</td>
										<td><input type="text" id="lastname" name="lastname" value="<?= $_SESSION['tradeup']['lastname'] ?>"></td>
									</tr>
									<tr>
										<td>Mobile Phone</td>
										<td><input type="text" id="mobile" name="mobile" value="<?= $_SESSION['tradeup']['mobile'] ?>"></td>
									</tr>
									<tr>
										<td>Email</td>
										<td><input type="text" id="email" name="email" value="<?= $_SESSION['tradeup']['email'] ?>"></td>
									</tr>
									<tr>
										<td>Address</td>
										<td><input type="text" id="address" name="address" value="<?= $_SESSION['tradeup']['address'] ?>"></td>
									</tr>
									<tr>
										<td>Postal Code</td>
										<td><input type="text" id="postalCode" name="postalCode" value="<?= $_SESSION['tradeup']['postalCode'] ?>"></td>
									</tr>
								</table>	
							</td>
							<td style="padding:5px 10px;padding-bottom:10px;width:250px;background-color:#222">
								<table cellspacing="0" cellpadding="0" class="formTbl" style="width:100%">
									<tr>
										<td colspan="2" style="padding-bottom:15px;font-size:18pt;color:yellow;text-align:center">
											<b>GET YOUR TRADE VALUE NOW!</b>
											<br>
											<font style="color:#777;font-size:9pt">Canadian Black Book appraisal</font>
										</td>
									</tr>
									<tr>
										<td style="width:50px">Year</td>
										<td style=""><div id="yearsDiv" style="display:inline"></div></td>
									</tr>
									<tr>
										<td>Make</td>
										<td><div id="makesDiv" style="display:inline"></div></td>
									</tr>
									<tr>
										<td>Model</td>
										<td><div id="modelsDiv" style="display:inline"></div></td>
									</tr>
									<tr>
										<td>Trim</td>
										<td><div id="trimsDiv" style="display:inline"></div></td>
									</tr>
									<tr>
										<td>Style</td>
										<td><div id="stylesDiv" style="display:inline"></div></td>
									</tr>
									<tr>
										<td>KM</td>
										<td><input type="text" style="width:100px" id="kilometers" name="kilometers" value="<?= $_SESSION['tradeup']['kilometers'] ?>"></td>
									</tr>
								</table>	
							</td>
							<td style="padding:5px 15px;width:250px;">
								<table cellspacing="0" cellpadding="0" class="formTbl">
									<tr>
										<td colspan="2" style="padding-bottom:5px;font-size:16pt;color:yellow;font-weight:bold;text-align:center"><b>GET A BETTER PAYMENT ON A NEWER VEHICLE</b></td>
									</tr>
									<tr>
										<td colspan="2" style="padding-bottom:2px;font-size:11pt;vertical-align:bottom">What is your current payment?</td>
									</tr>
									<tr>
										<td colspan="2"><input type="text" style="width:260px" id="payment" name="payment" value="<?= $_SESSION['tradeup']['payment'] ?>"></td>
									</tr>
									<tr>
										<td colspan="2" style="padding-bottom:2px;font-size:11pt;vertical-align:bottom">Months remaining in your finance/lease?</td>
									</tr>
									<tr>
										<td colspan="2"><input type="text" style="width:260px" id="monthsRemaining" name="monthsRemaining" value="<?= $_SESSION['tradeup']['monthsRemaining'] ?>"></td>
									</tr>
									<tr>
										<td colspan="2" style="padding-bottom:2px;font-size:11pt;vertical-align:bottom">What vehicle are you interested in?</td>
									</tr>
									<tr>
										<td colspan="2"><input type="text" style="width:260px" id="nextVehicle" name="nextVehicle" value="<?= $_SESSION['tradeup']['nextVehicle'] ?>"></td>
									</tr>
								</table>	
							</td>
						</tr>
						<tr>
							<td colspan="2" style="padding-top:0px;">
	<?php
		if($_SESSION['tradeup']['selectedDealer'] == 'nelson')
		{
	?>
								<table cellspacing="0" cellpadding="0">
									<tr>
										<td><img src="images/lasVegas.png"></td>
										<td style="padding-top:20px;font-size:11pt;padding-left:10px">Plus be entered to win a trip to Las Vegas!<br>No purchase necessary.</td>
									</tr>
								</table>
	<?php
		}
		else if($_SESSION['tradeup']['selectedDealer'] == 'islington')
		{
	?>
								<table cellspacing="0" cellpadding="0">
									<tr>
										<td><img src="images/walmart.png"></td>
										<td style="padding-top:20px;font-size:11pt;padding-left:10px">Plus get a Walmart gift card!<br>No purchase necessary.</td>
									</tr>
								</table>
	<?php
		}
		else if(in_array($_SESSION['tradeup']['selectedDealer'],array('willowbrook')))
		{
	?>								
								<table cellspacing="0" cellpadding="0">
									<tr>
										<td><img src="images/timHortons.png"></td>
										<td style="padding-top:20px;font-size:11pt;padding-left:10px">Plus get a $15 Tim Horton's gift card!<br>No purchase necessary.</td>
									</tr>
								</table>
	<?php
		}
		else if(in_array($_SESSION['tradeup']['selectedDealer'],array('atlantic','blaikies')))
		{
	?>								
								<table cellspacing="0" cellpadding="0">
									<tr>
										<td><img src="images/timHortons.png"></td>
										<td style="padding-top:20px;font-size:11pt;padding-left:10px">Plus a chance to win one of five $100 Tim Hortons Tim Cards!<br>No purchase necessary.</td>
									</tr>
								</table>
	<?php
		}
		else if(in_array($_SESSION['tradeup']['selectedDealer'],array('abbotsford','langley','kawarthachrysler','comoxvalley','vernon','unique')))
		{
	?>								
								<table cellspacing="0" cellpadding="0">
									<tr>
										<td><img src="images/timHortons.png"></td>
										<td style="padding-top:20px;font-size:11pt;padding-left:10px">Plus get a $10 Tim Horton's gift card!<br>No purchase necessary.</td>
									</tr>
								</table>
	<?php
		}
		else if(in_array($_SESSION['tradeup']['selectedDealer'],array('valalbert')))
		{
	?>								
								<table cellspacing="0" cellpadding="0">
									<tr>
										<td><img src="images/aw.png"></td>
										<td style="padding-top:20px;font-size:11pt;padding-left:10px">Plus get a $25 A&W Gift Card!<br>No purchase necessary.</td>
									</tr>
								</table>
	<?php
		}
		else if(in_array($_SESSION['tradeup']['selectedDealer'],array('brampton')))
		{
	?>								
								<table cellspacing="0" cellpadding="0">
									<tr>
										<!--<td><img src="images/timHortons.png"></td>-->
										<td style="padding-top:20px;font-size:13pt;padding-left:10px">Receive a FREE BBQ with every purchase!<br>Plus get a up to $25 Tim Horton's gift card!</td>
									</tr>
								</table>
	<?php
		}
		else if(in_array($_SESSION['tradeup']['selectedDealer'],array('mazzuca')))
		{
	?>								
								<table cellspacing="0" cellpadding="0">
									<tr>
										<!--<td><img src="images/timHortons.png"></td>-->
										<td style="padding-top:20px;font-size:11pt;padding-left:10px">Plus get a Country Style Gift Card!<br>No purchase necessary.</td>
									</tr>
								</table>
	<?php
		}
		else if(in_array($_SESSION['tradeup']['selectedDealer'],array('villageaaaaaa')))
		{
	?>								
								<table cellspacing="0" cellpadding="0">
									<tr>
										<td><img src="images/esso.png"></td>
										<td style="padding-top:20px;font-size:11pt;padding-left:10px">Plus get a $25 Esso Gas Card!<br>No purchase necessary.</td>
									</tr>
								</table>
	<?php
		}
		else if(in_array($_SESSION['tradeup']['selectedDealer'],array('raceway')))
		{
	?>								
								<table cellspacing="0" cellpadding="0">
									<tr>
										<td><img src="images/timHortons.png"></td>
										<td style="padding-top:20px;font-size:11pt;padding-left:10px">Plus get a $20 Tim Horton's gift card!<br>No purchase necessary.</td>
									</tr>
								</table>
	<?php
		}
		else if(in_array($_SESSION['tradeup']['selectedDealer'],array('western')))
		{
	?>								
								<table cellspacing="0" cellpadding="0">
									<tr>
										<td><img src="images/giftBox.png"></td>
										<td style="padding-top:20px;font-size:11pt;padding-left:10px">Plus get a Free Gift!<br>No purchase necessary.</td>
									</tr>
								</table>
	<?php
		}
		else if(in_array($_SESSION['tradeup']['selectedDealer'],array('estevan')))
		{
	?>								
								<table cellspacing="0" cellpadding="0">
									<tr>
										<td><img src="images/giftBox.png"></td>
										<td style="padding-top:20px;font-size:11pt;padding-left:10px">Plus be entered to WIN DOOR PRIZES!<br>No purchase necessary.</td>
									</tr>
								</table>
	<?php
		}
		else if(in_array($_SESSION['tradeup']['selectedDealer'],array('devon','thompson','village','bowmel')))
		{
	?>								
								<table cellspacing="0" cellpadding="0">
									<tr>
										<td><img src="images/giftBox.png"></td>
										<td style="padding-top:20px;font-size:11pt;padding-left:10px">Plus get a $50 Gift Card!<br>No purchase necessary.</td>
									</tr>
								</table>
	<?php
		}
		else if(in_array($_SESSION['tradeup']['selectedDealer'],array('peel')))
		{
	?>								
								<table cellspacing="0" cellpadding="0">
									<tr>
										<td><img src="images/giftBox.png"></td>
										<td style="padding-top:20px;font-size:11pt;padding-left:10px">Plus get a $25 Gift Card!<br>No purchase necessary.</td>
									</tr>
								</table>
	<?php
		}
		else if(in_array($_SESSION['tradeup']['selectedDealer'],array('hunt')))
		{
	?>								
								<table cellspacing="0" cellpadding="0">
									<tr>
										<td><img src="images/giftBox.png"></td>
										<td style="padding-top:20px;font-size:11pt;padding-left:10px">Plus be entered to win a 32" TV & Gift Cards!<br>No purchase necessary.</td>
									</tr>
								</table>
	<?php
		}
		else if(in_array($_SESSION['tradeup']['selectedDealer'],array('reliable','southside','carter','stpaul','downsview','stonyplain','eichenberg','bustard','leduc','greatwest','martin','airdrie','edson','dixie','maclangorillia','kelowna')))
		{
	?>								
								<table cellspacing="0" cellpadding="0">
									<tr>
										<td></td>
									</tr>
								</table>
	<?php
		}
		else if(in_array($_SESSION['tradeup']['selectedDealer'],array('fairview')))
		{
	?>								
								<table cellspacing="0" cellpadding="0">
									<tr>
										<td></td>
										<td style="padding-top:20px;font-size:15pt;padding-left:10px">Plus get a $250 GAS CARD with every new vehicle purchase!</td>
									</tr>
								</table>
	<?php
		}
		else if(in_array($_SESSION['tradeup']['selectedDealer'],array('fox')))
		{
	?>								
								<table cellspacing="0" cellpadding="0">
									<tr>
										<td><img src="images/timHortons.png"></td>
										<td style="padding-top:20px;font-size:11pt;padding-left:10px">Get a $500 GAS CARD with every new vehicle purchase!<br>Plus a Tim Horton's Gift Card with your test drive!</td>
									</tr>
								</table>
	<?php
		}
		else if(in_array($_SESSION['tradeup']['selectedDealer'],array('okanagan','amherst','pioneer','rainbow','galt','moncton','maclangsundridge')))
		{
	?>								
								<table cellspacing="0" cellpadding="0">
									<tr>
										<td><img src="images/timHortons.png"></td>
										<td style="padding-top:20px;font-size:11pt;padding-left:10px">Plus get a Tim Horton's gift card!<br>No purchase necessary.</td>
									</tr>
								</table>
	<?php
		}
		else if(in_array($_SESSION['tradeup']['selectedDealer'],array('chatham')))
		{
	?>								
								<table cellspacing="0" cellpadding="0">
									<tr>
										<td><img src="images/timHortons.png"></td>
										<td style="padding-top:20px;font-size:11pt;padding-left:10px">Plus get a $5 Tim Horton's gift card!<br>No purchase necessary.</td>
									</tr>
								</table>
	<?php
		}
		else if($_SESSION['tradeup']['selectedDealer'] == 'northbay')
		{
	?>								
								<table cellspacing="0" cellpadding="0">
									<tr>
										<td><img src="images/oilChange.png"></td>
										<td style="padding-top:20px;font-size:11pt;padding-left:10px">Plus get a $50 Maintenance Card!<br>No purchase necessary.</td>
									</tr>
								</table>
	<?php
		}
		else if($_SESSION['tradeup']['selectedDealer'] == 'derrick')
		{
	?>								
								<table cellspacing="0" cellpadding="0">
									<tr>
										<td><img src="images/oilChange.png"></td>
										<td style="padding-top:20px;font-size:11pt;padding-left:10px">Plus get a Free Derrick Dodge Oil Change!<br>No purchase necessary.</td>
									</tr>
								</table>
	<?php
		}
		else
		{
	?>								
								<table cellspacing="0" cellpadding="0">
									<tr>
										<td><img src="images/timHortons.png"></td>
										<td style="padding-top:20px;font-size:11pt;padding-left:10px">Plus get a Tim Horton's gift card!<br>No purchase necessary.</td>
									</tr>
								</table>
	<?php
		}
	?>								
							</td>
							<td  style="padding-top:10px;">
								<center>
									<input type="image" src="images/submit.png">
								</center>
							</td>
						</tr>
					</table>			
				</form>
			</div>
			<img src="images/roundBottom.jpg">	
			</center>
		</td>
	</tr>
</table>
<?php
	if(!isset($_SESSION['webhit']))
	{
		$_SESSION['webhit'] = true;
?>
		<iframe height="0" width="0" src="http://96.53.92.6:8080/misc/webHits.php?url=<?= str_replace(array('www.'),'',$_SERVER['HTTP_HOST']);	?>&dealer=<?= $_SESSION['tradeup']['selectedDealer'] ?>&eventID=<?= $dealerInfo[$_SESSION['tradeup']['selectedDealer']]['eventID'] ?>" frameborder="0"></iframe>  
<?php
	}
?>		
<script>
	getList('years');
</script>
<?php include_once('footer.php'); ?>