MSV FM

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

<?php 
	include_once('includes.php');
	
	if($dealerInfo[$_SESSION['registration']['selectedDealer']]['eventID'] == "")
	{
		header("location: index.php");
		exit;
	}
	
	if(isset($_GET['playNextVideo']))
	{
		$key = array_search($_SESSION['currentVideo'],$dealerInfo[$_SESSION['registration']['selectedDealer']]['videos']);
		$key++;
		if($dealerInfo[$_SESSION['registration']['selectedDealer']]['videos'][$key] == "") $key = 0;
		$_SESSION['currentVideo'] = $dealerInfo[$_SESSION['registration']['selectedDealer']]['videos'][$key];
		
		$html = ' <video id="myvideo" class="video-js vjs-default-skin" style="width:340px;height:192px" controls autoplay preload="auto">
					  <source src="videos/' . $_SESSION['currentVideo'] . '.mp4" type="video/mp4">
					  <source src="videos/' . $_SESSION['currentVideo'] . '.webm" type="video/webm">
					  <object>
					     <embed src="videos/' . $_SESSION['currentVideo'] . '.mp4" type= "application/x-shockwave-flash" allowfullscreen="false" allowscriptaccess="always" />
					  </object> 
					</video>';
					
		$html = '<video style="width:100%;height:100%;min-height: 100%; min-width: 100%;" controls preload="auto">
				    <source type="video/mp4" src="videos/' . $_SESSION['currentVideo'] . '.mp4" />
				    <source type="video/webm" src="videos/' . $_SESSION['currentVideo'] . '.webm" />
				    <object style="width:100%;height:100%;min-height: 100%; min-width: 100%;" type="application/x-shockwave-flash" data="videos/build/flashmediaelement.swf">
				        <param name="movie" value="videos/build/flashmediaelement.swf" />
				        <param name="flashvars" value="controls=true&file=videos/' . $_SESSION['currentVideo'] . '.mp4" />
				    </object>
				</video>';			
		?>
		
		document.getElementById('videodiv').innerHTML = '<?= ajaxHTML($html) ?>';
		$('video,audio').mediaelementplayer({alwaysShowControls: false,
											 enableAutosize: false,
											 success: function (mediaElement, domObject) 
											 		  {
											 				mediaElement.addEventListener('canplay', function(e) 
											 		  		{
			             										mediaElement.play();
										             
										        			}, false);
										        			
											 				mediaElement.addEventListener('ended', function(e) 
											 		  		{
			             										playNextVideo();
										             
										        			}, false);										        			
											 		  }
											});
		<?php
		exit;
		
	}
	
	if(isset($_GET['submitList']))
	{
		//unset($_SESSION['registration']['customer']);		
		foreach($_GET as $key => $val)
		{
			if(in_array($key,array('firstname','lastname','email','mainPhone','postalCode','apptDate'))) $_SESSION['registration']['customer'][$key] = $val;
			else $_SESSION['registration']['tradeIn'][$key] = $val;
		}
			
		?>
		document.getElementById('emailFrame').src = 'http://ar.absoluteresults.com/salesevent2013/pullAheadEmail.php?regID=<?= urlencode(serialize($_SESSION['registration'])) ?>&setLang=<?=$_SESSION['registration']['myLang']?>';
		<?php
		exit;		
	}
	
	if(isset($_GET['sendSMS']))
	{
		$message = urlencode(str_replace(array(" ","&"),array("%20","%26"),$lang['smsConfirm']));
		$replyMessage = urlencode(str_replace(array(" ","&"),array("%20","%26"),$lang['smsThanks'] . $dealerInfo[$_SESSION['registration']['selectedDealer']]['name'] . "."));
		$smsAPI = 'https://x1.taarga.com/sms/create?mobile_number=1' . trim(preg_replace("/[^0-9]/","", $_SESSION['registration']['customer']['mainPhone'])) . '&message=' . $message . '&access_token=e9ef6aacc17289b5238fe42a56a697fe&contact_name=' . urlencode($_SESSION['registration']['customer']['firstname'] . ' ' . $_SESSION['registration']['customer']['lastname']) . '&email_addr=' . urlencode($_SESSION['registration']['customer']['email']) . '&reply_msg=' . $replyMessage . '&sender_ref=' . $_SESSION['registration']['selectedDealer'];
					
		?>
		document.getElementById('smsFrame').src = '<?= $smsAPI ?>';
		<?php
		exit;		
	}
	
	include_once('header.php'); 
?>

		<script src="scripts/ajax.js" language="javascript"></script>
		<script>								
			function submitList()
			{				
				htmlStr = 'pullAheadForm.php?submitList=';
				var arrRequired = new Array('firstname','lastname','email','postalCode','mainPhone','model');
				var arr = new Array('firstname','lastname','email','postalCode','mainPhone','model','apptDate');
				for (var i = 0; i < arrRequired.length; i++) 
				{			
					if(document.getElementById(arrRequired[i]).value == "") 
					{
						alert('<?= $lang['validationRSVP'] ?>');
						return false;
					}
				}
				
				var emailStr = document.getElementById('email').value;
				var atpos=emailStr.indexOf("@");
				var dotpos=emailStr.lastIndexOf(".");
				if (atpos<1 || dotpos<atpos+2 || dotpos+2>=emailStr.length)
				{
					alert("<?= $lang['validationEmail'] ?>");
				   	return false;
				}
				
				
				for (var i = 0; i < arr.length; i++) 
				{			
					var temp = '';
					if(document.getElementById(arr[i]) != undefined)  temp=encodeURIComponent(document.getElementById(arr[i]).value);
					htmlStr = htmlStr + '&' + arr[i] + '=' + temp;
				}
				
				document.getElementById('submitButton').value = '<?= $lang['submitting'] ?>';
				document.getElementById('submitButton').disabled = true;
				
				ajax_do(htmlStr);
				return false;
			}
			
			
			function emailSent()
			{
				if(document.getElementById('emailFrame').src != "")
				{
					document.getElementById('emailFrame').onload = function() {};
					document.getElementById('emailFrame').src = "";
					
					alert('<?= $lang['alertThx'] ?>');
					location.href = 'pullAheadForm.php?complete';
					
					//ajax_do('pullAheadForm.php?sendSMS=');
				}
			}
			
			function smsSent()
			{
				if(document.getElementById('smsFrame').src != "")
				{
					document.getElementById('smsFrame').onload = function() {};
					document.getElementById('smsFrame').src = "";
					
					alert('<?= $lang['alertThx'] ?>');
					location.href = 'pullAheadForm.php?complete';
				}
			}
			
			function playNextVideo()
			{
				ajax_do('pullAheadForm.php?playNextVideo=');
			}
		</script>	
		
	<div class="container" style="background-image:url('images/layout/transparentBG.png');padding:10px">
		<form method="POST" style="margin:0px" onSubmit="return submitList();">	
			<div class="ten columns" style="background-color:#bbb;">		
<?php if(isset($_GET['complete'])) { ?>	
				<div style="padding:20px;height:550px;font-size:1.5em;line-height:1.2em">
					<?= $lang['pullAheadComplete'] ?>
					<br><br>
					<img src="images/vehicles/chryslerLineup.png">
				</div>
<?php } else { ?>		
					<div style="padding:10px 20px 0px 20px">
						<h4 style="font-weight:bold">
							<?= $lang['pullAheadTitle'] ?>
						</h4>
						
					</div>
				<div class="four columns alpha">
					<div style="padding:20px 0px 20px 20px">
						<label for="firstname"><?= $lang['firstname'] ?></label>
						<input type="text" id="firstname" name="firstname" value="<?= $_SESSION['registration']['customer']['firstname'] ?>">
						
						<label for="lastname"><?= $lang['lastname'] ?></label>
						<input type="text" id="lastname" name="lastname" value="<?= $_SESSION['registration']['customer']['lastname'] ?>">
						
						<label for="postalCode"><?= $lang['postalcode_CA'] ?></label>
						<input type="text" id="postalCode" name="postalCode" value="<?= $_SESSION['registration']['customer']['postalCode'] ?>">						
					</div>							
				</div>
				<div class="five columns alpha">
					<div style="padding:20px 0px 20px 20px">						
						<label for="mainPhone"><?= $lang['phone'] ?></label>
						<input type="text" id="mainPhone" name="mainPhone" value="<?= $_SESSION['registration']['customer']['mainPhone'] ?>">
						
						<label for="email"><?= $lang['email'] ?></label>
						<input type="text" id="email" name="email" value="<?= $_SESSION['registration']['customer']['email'] ?>">			
						
						<label for="model"><?= $lang['vehicle'] ?></label>
						<input type="text" id="model" name="model" value="<?= $_SESSION['registration']['tradeIn']['model'] ?>">				
						
					</div>							
				</div>
				<br class="clear">
				
				<div style="padding:0px 0px 20px 20px">	
					<label style="font-size:1.5em;line-height:1.5em"><?= $lang['appointmentDate'] ?></label>
					<div style="width:90%">
						<table cellspacing="0" cellpadding="0">
							<tr>
								<td style="font-size:1.5em;font-weight:bold"><?= strtoupper(date("F")) ?></td>
								<td style="padding:0px 10px">
									<select id="apptDate" name="apptDate" style="font-size:2em;width:100px">
										<option></option>
									<?php for($i=1;$i<=31;$i++) { ?>
										<option value="2014-<?= date("m") ?>-<?= $i ?>"><?= $i ?></option>
									<?php } ?>
									</select>
								</td>
								<td style="font-size:1.5em;font-weight:bold">2014</td>
							</tr>
						</table>
					</div>
				</div>
				<center>
					<input type="submit" id="submitButton" value="<?= $lang['pullAheadSubmit'] ?>" style="font-weight:bold;font-size:1.5em;background-color:#efd23b;">		
				</center>
				<br>		
				<div class="nine columns">
					<center>
						<script>
						function toogleOptIn() {
					        if ($('#optin').css('display') == 'none') {
					            $('#optin-read-more').css('display', 'none');
					            $('#optin').css('display', 'inline');
					        } else {
					            $('#optin-read-more').css('display', 'inline');
					            $('#optin').css('display', 'none');
					        }
					    }
					   </script>
						<div style="width:90%;font-size:9pt;color:#333">
								<?= $lang['disclaimer'] ?>
									<a href="" 
					        id="optin-read-more" onclick="toogleOptIn(); return false;">
					        <?= $lang['readmore'] ?></a> 
					        <div style="display:none" id="optin">
					        	<?= $lang['disclaimer2'] ?>
								 </div>   
					    </div>  
					    <br>        	
					</center>
				</div>
<?php } ?>		
				<br class="clear">
			</div>	
			<div class="six columns" style="color:white;">
				<?php if(count($dealerInfo[$_SESSION['registration']['selectedDealer']]['videos']) > 0) { ?>
						 <div id="videodiv">
						 </div>
						 <script> 
				        	playNextVideo();
						 </script>
				<?php } ?>
				<div style="padding:10px">
					<div style="color:white;font-weight:bold;">
					<?= $lang['pullAheadBlurb'] ?>
					<br>
					<div style="font-size:1.1em;padding:20px">
						<center>
							<font style="font-size:1.4em;font-weight:bold;color:#ccc"><?= $dealerInfo[$_SESSION['registration']['selectedDealer']]['name'] ?></font>
							<br>
							<?= $dealerInfo[$_SESSION['registration']['selectedDealer']]['address'] ?>
							<br>
							<?= $dealerInfo[$_SESSION['registration']['selectedDealer']]['phone'] ?>
							<br>
<?php if($dealerInfo[$_SESSION['registration']['selectedDealer']]['name'] == "Suburban of Garden City") { ?>							
							<a href="http://<?= $dealerInfo[$_SESSION['registration']['selectedDealer']]['website'] ?>" target="_blank" style="color:yellow"><?= $lang['urlAltTxt'] ?></a>
<?php } else {?>
							<a href="http://<?= $dealerInfo[$_SESSION['registration']['selectedDealer']]['website'] ?>" target="_blank" style="color:yellow"><?= $dealerInfo[$_SESSION['registration']['selectedDealer']]['website'] ?></a>
<?php } ?>		
							
					<?php if($dealerInfo[$_SESSION['registration']['selectedDealer']]['bilingual'] != "") { ?>
							<br /><br />
							<?php
								if($_SESSION['registration']['myLang'] == 'fr'){
									$translateURL = '?setLang=en';
								} else {
									$translateURL = '?setLang=fr';
								}
							?>
							<a href="<?= $translateURL ?>" target="_self" style="color:red;text-decoration:none;font-weight:bold"><?= $lang['bilingual'] ?></a>
					<?php } ?>			
						</center>
					</div>
				</div>
			</div>
		</form>	
	</div>
<?php include_once('footer.php'); ?>