<?php 

@session_start();


	if($_REQUEST['id'] !=''){

	}else{
		//die;
	}
?>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link rel="stylesheet" type="text/css" href="<?php echo SITEURL?>/css/style.css">
<script type="text/x-javascript" src="<?php echo SITEURL?>/js/jquery.min1.js"></script>
<script type="text/x-javascript" src="<?php echo SITEURL?>/mod/page/x-page.inc.js"></script>

</head>

<body style="background-color:#9BDC74">
	<div class="container">
		<div class="row inline">
			<div class="navstyle">
			<div class="row">
        <form id="frmDate" name="frmDate" method="POST" action="<?php echo SITEURL?>/lottery-agent/result">
			<table>
            <tr>
            	<td>From Date</td>
                <td><input id="fromDate" name="fromDate" type="date" required></td>
                <td>To</td>
                <td><input id="toDate" name="toDate" type="date" required></td>
                <td><input id="btnSubmit" name="btnSubmi" type="submit" value="Submit"></td>
            </tr>
            </table>
            </form>
        </div>

				
			</div>
			<div class="menus">
			<ul>
				 <?php echo innerAdminMenu()?>
			</ul>
		</div>

		</div>


		<p><?php echo date('d-M-Y')?> To <?php echo date('d-M-Y')?></p>	       
	</div>

	
	<div class="total_menus">
		
        
	</div>
    <hr>
	<div class="container-float" style="border: 1px solid black;margin-top:10px;">

		<!-- SECTION REPIT START -->
		
		<div class="total_ten_section">
			
            <?php
				$where = '';
				if($_REQUEST['sernum'] !=''){
					$where = ' AND sernum="'.$_REQUEST['sernum'].'"';
				}
				$adminID = 1;
			//	echo $_REQUEST['fromDate'];
				$_REQUEST['frmdate'] = ($_REQUEST['fromDate']==''?date('Y-m-d'):$_REQUEST['frmDate']);
				//$_REQUEST['todate'] = date('Y-m-d');
            	$sql = 'SELECT lotTime FROM '.$DB->pre.'result_tran WHERE uID="'.$adminID.'" AND lotdate="'.$_REQUEST['frmdate'].'" AND lotTime <> "'.drawTime().'" '.$where.' GROUP BY lotTime ORDER BY lotID DESC';
				$R = $DB->dbRows($sql);
			//	print_r($R);die;
				foreach($R as $R){
			?>
            <div class="total_time" style="margin:0px auto;">
				<h2><?php echo $R['lotTime']?></h2>
			</div>
            <div style="width:100%; border:0px solid blue; display:inline">
            <?php
            	$sqlW = 'SELECT * FROM '.$DB->pre.'result_tran WHERE uID="'.$adminID.'" AND lotdate="'.$_REQUEST['frmdate'].'" AND lotTime="'.$R['lotTime'].'"  '.$where.' ORDER BY cellID';
				$W = $DB->dbRows($sqlW);	

				foreach($W as $k=>$W){
			?>
            
                <div style="width:18%; display:inline; border:0px solid red; padding:33px; font-weight:bold; font-size:25px;">
                <?php
                	echo $W['cellID'];
				?>
                </div>
            
            
            
            
            <?php }?>
            </div>
			<?php } ?>
		</div>

		<!-- END OF SECTION -->	
        
	</div>

</body>
</html>
