<?php
include_once('includes.php');
if(isset($_GET['submitList']))
{
unset($_SESSION['registration']['customer']);
foreach($_GET as $key => $val)
{
$_SESSION['registration']['customer'][$key] = $val;
}
$info = unserialize(stripslashes(urldecode(file_get_contents('http://ar.absoluteresults.com/rsvpquant/code.php?e=' . $dealerInfo[$_SESSION['registration']['selectedDealer']]['eventID'] . '&code=' . str_replace(' ','',$_GET['code'])))));
if($info['error'] != "")
{
?>
alert('Invalid Code');
<?php
}
else
{
foreach($info as $key => $val)
{
$_SESSION['registration']['customer'][$key] = $val;
}
?>
location.href='appraisal.php';
<?php
}
exit;
}
include_once('header.php');
?>
<script src="scripts/ajax.js" language="javascript"></script>
<script>
function submitList()
{
htmlStr = 'index.php?submitList=';
var arr = new Array('code');
var arrRequired = new Array('code');
for (var i = 0; i < arrRequired.length; i++)
{
if(document.getElementById(arrRequired[i]).value == "")
{
alert('Please tell us your invitation code to see our offers.\nThank you.');
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 = 'Please wait...';
//document.getElementById('submitButton').disabled = true;
ajax_do(htmlStr);
return false;
}
</script>
<div class="container" style="background-color:#163359;padding:10px">
<form method="POST" style="margin:0px" onSubmit="return submitList();">
<div class="sixteen columns" style="background-color:#efefef;">
<div style="padding:20px">
<center>
<label for="postalCode" style="font-size:1.5em;margin-bottom:10px">Please tell us your Invitation Code to get started.</label>
<input type="text" id="code" name="code" style="font-size:2em">
<input type="submit" id="submitButton" value="Get Started" style="font-weight:bold;font-size:1.5em;background-color:#efd23b;width:220px;margin-top:10px">
</center>
</div>
</div>
</form>
</div>
<?php include_once('footer.php'); ?>