<?php
session_start();
include_once('mysqlUtils.php');
$eventIDs = array(3963,3969,3966,3970,3968,3947,3980,3975,3971,3976,3983,4057,4068,4064,4036,4066,4030,4061,4046,4071,4072,4035,4070,4065,4069,4033,4029,4074,4073,4067,4020,4063,4047,4075,4076,4077,4078,4079,4080,4081,4082,4083,4084,4085,4086,4087,4088,4089,4090,4091,4092,4093);
//$eventIDs = array(2463);
//$_GET['events'] = implode(',',$eventIDs);
//$apptTbl = 'ps_appointments_0712';
$event = mysql_fetch_assoc(mysql_query('SELECT eventID,numSalesman,saleStartDate FROM ps_dealerevents where eventID in (' . implode(',',$eventIDs) . ') ORDER BY eventID'));
$apptTbl = 'ps_appointments_' . date("my",strtotime($event['saleStartDate']));
$totalSales = 0;
for($i=1;$i<=3;$i++)
{
$sql = 'SELECT count(*) as cnt FROM ' . $apptTbl . ' WHERE eventID in (' . implode(',',$eventIDs) . ') AND (sold' . $i . ' is not null AND sold' . $i . ' != "") AND challengeSalesrep != ""';
$sales1Results = mysql_fetch_assoc(mysql_query($sql));
//$totalSales += mysql_num_rows($sales1Results);
$totalSales += $sales1Results['cnt'];
}
//echo $sql;
$flashVar = 'TotalSold=' . $totalSales;
include_once('header.php');
?>
<style>
.formTbl th {color:#eeeeee;text-align:left;font-size:10pt;vertical-align:middle;padding:5px 5px;font-weight:normal}
.formTbl input {font-size:8pt}
.headerTbl {}
.headerTbl a{color:white;text-decoration:none;}
.pageTbl a,.listTbl a {color:white;text-decoration:none;font-weight:bold}
.pageTbl td {width:20px;text-align:center;font-weight:bold}
.listTbl {width:800px;;}
.listTbl th {color:#eeeeee;background-image:url('images/thBG.jpg');font-size:9pt;height:20px;vertical-align:middle}
.listTbl td {color:white;border-bottom:1px solid #cccccc;height:30px;vertical-align:middle;text-align:center}
.addTbl td {padding:5px 10px 5px 0px;text-align:left}
.addTbl td input {width:200px}
</style>
<script>
function move()
{
window.location.reload();
}
</script>
<body onload="timer=setTimeout('move()',60000)">
<table cellspacing="0" cellpadding="0" class="contentTbl">
<tr>
<td style="">
<table cellspacing="0" cellpadding="0" style="width:100%">
<tr>
<td style="text-align:center;float:center;">
<!--
<br><br>
<img src="images/challenger.jpg" usemap="#arlink" border="0">
<map name="arlink">
<area shape="rect" coords="201,59,349,110" href="http://www.absoluteresults.com" alt="Sun" />
</map>
<br><br>
-->
<script language="JavaScript" type="text/javascript">
AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0',
'width', '900',
'height', '400',
'src', 'scoreboard2',
'quality', 'high',
'pluginspage', 'http://www.adobe.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'window',
'devicefont', 'false',
'id', 'scoreboard2',
'bgcolor', '#000000',
'name', 'scoreboard',
'menu', 'true',
'allowFullScreen', 'false',
'allowScriptAccess','sameDomain',
'movie', 'scoreboard2',
'salign', '',
'FlashVars', '<?= $flashVar ?>'
); //end AC code
</script>
<noscript>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="900" height="400" id="scoreboard2" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="scoreboard2.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /> <embed src="scoreboard2.swf" quality="high" bgcolor="#000000" width="900" height="400" name="scoreboard" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
</object>
</noscript>
</div>
</td>
</tr>
</table>
<center>
<table cellspacing="0" cellpadding="0" style="padding-top:20px">
<tr>
<td style="text-align:center;padding-right:10px">
<a href="r1/" style="color:white;text-decoration:none;font-weight:bold">Round 1</a>
</td>
<td style="text-align:center;padding-right:10px">
<a href="#" style="color:white;text-decoration:none;font-weight:bold">Round 2</a>
</td>
</tr>
</table>
</center>
</td>
</tr>
</table>
<?php
include_once('footer.php');
?>