<?php include_once('includes.php'); ?>
<?php
if(isset($_GET['submitList']))
{
//unset($_SESSION['registration']['customer']);
foreach($_GET as $key => $val)
{
$_SESSION['registration']['customer'][$key] = $val;
}
?>
document.getElementById('emailFrame').src = 'http://ar.absoluteresults.com/digital2013/rodeoEmail.php?regID=<?= urlencode(serialize($_SESSION['registration'])) ?>';
<?php
exit;
}
if(isset($_GET['complete'])) $_SESSION['offers'][$currentPage]['complete'] = true;
?>
<?php include_once('header.php'); ?>
<script src="scripts/ajax.js" language="javascript"></script>
<script>
function submitList()
{
htmlStr = 'rodeo.php?submitList=';
var arrRequired = new Array('fullname','email','postalCode','mobilePhone');
var arr = new Array('fullname','email','postalCode','mobilePhone');
for (var i = 0; i < arrRequired.length; i++)
{
if(document.getElementById(arrRequired[i]).value == "")
{
alert('Please complete all the required fields to see your offer.\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);
}
function emailSent()
{
if(document.getElementById('emailFrame').src != "")
{
alert('Thank you for your submission.\nPlease check your email for details.');
location.href = 'rodeo.php?complete';
//document.getElementById('submitButton').disabled = false;
//document.getElementById('submitButton').value = 'See Offer';
}
}
</script>
<style>
.formTbl th,.formTbl td {text-align:left;padding-right:10px}
</style>
<table cellspacing="0" cellpadding="0" style="width:100%">
<tr>
<td style="width:530px;padding:20px 0px 0px 40px;font-size:15pt;text-align:left;vertical-align:top">
<?php if(!isset($_GET['complete'])) { ?>
<font style="font-weight:bold;font-size:18pt">Fill out the information below<br>and be entered to Win a Trip to Las Vegas.</font>
<br><br>
<form method="POST">
<table cellspacing="0" cellpadding="0" class="formTbl">
<tr>
<th>First & Last Name</th>
<td><input type="text" style="width:200px" id="fullname" name="fullname" value="<?= $_SESSION['registration']['customer']['fullname'] ?>"></td>
</tr>
<tr>
<th>Email</th>
<td><input type="text" style="width:200px" id="email" name="email" value="<?= $_SESSION['registration']['customer']['email'] ?>"></td>
</tr>
<tr>
<th>Mobile Phone</th>
<td><input type="text" style="width:200px" id="mobilePhone" name="mobilePhone" value="<?= $_SESSION['registration']['customer']['mobilePhone'] ?>"></td>
</tr>
<tr>
<th>Postal Code</th>
<td><input type="text" style="width:200px" id="postalCode" name="postalCode" value="<?= $_SESSION['registration']['customer']['postalCode'] ?>"></td>
</tr>
<tr><td colspan="2" style="height:20px"></td></tr>
</table>
<br>
<input type="button" id="submitButton" value="Enter To Win" onClick="submitList()" style="font-weight:bold;font-size:16pt;background-color:#efd23b;width:330px">
</form>
<?php } else { ?>
<font style="font-weight:bold;font-size:25pt">
Thank You.
</font>
<br>
<br>
<font style="font-weight:bold;font-size:18pt">
You are now entered to<br>win tickets to the National Finals Rodeo.
</font>
<br><br>
<?php if($nextOffer != "") { ?>
<div style="font-size:12pt"><i>Want another offer?</i></div>
<a href="<?= $nextOffer ?>.php"><img src="images/<?= $nextOffer ?>Button.png" border="0"></a>
<?php } ?>
<?php } ?>
</td>
<td style="color:white;padding-top:50px;text-align:left;font-size:15pt;vertical-align:top">
The largest Rodeo in the world is the National
Finals in Las Vegas, Nevada. Enter
below to get your chance to go with a
friend for free!*
<br><br>
<div style="width:400px;text-align:right;font-size:9pt">*Cash Value of this trip: $3,500 CDN. Paid by certified bank draft</div>
<br>
<img src="images/<?= $currentPage ?>Image.png">
</td>
</tr>
</table>
<iframe id="emailFrame" height="0" width="0" frameborder="0" onload="emailSent()"></iframe>
<?php include_once('footer.php'); ?>