<?php 

@session_start();


	if($_SESSION['SECEXP'] !=''){

	}else{
		echo "Go And Fuck Your Self";die;
	}
	$str = '';
	$msg = '';


?>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- meta http-equiv="X-UA-Compatible" content="IE=11" -->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="<?php echo SITEURL?>/css/ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="<?php echo SITEURL?>/css/ie7.css">
<![endif]-->
<link rel="stylesheet" type="text/css" href="<?php echo SITEURL?>/css/ie7.css">
<style>
td a{
	font-weight:bold;
	
}
</style>
<script type="text/javascript">

function setLotNum(){
	var val = document.getElementById('sernum').value;
	var str = '<option value="">-Select Lot-</option>';
	if(val == '0000'){
		str += '<option value="01">01</option>';
		str += '<option value="02">02</option>';
		str += '<option value="03">03</option>';
		str += '<option value="04">04</option>';
		str += '<option value="05">05</option>';
		str += '<option value="06">06</option>';
		str += '<option value="07">07</option>';
		str += '<option value="08">08</option>';
		str += '<option value="09">09</option>';
	}else if(val == '1000'){
		str += '<option value="10">10</option>';
		str += '<option value="11">11</option>';
		str += '<option value="12">12</option>';
		str += '<option value="13">13</option>';
		str += '<option value="14">14</option>';
		str += '<option value="15">15</option>';
		str += '<option value="16">16</option>';
		str += '<option value="17">17</option>';
		str += '<option value="18">18</option>';
		str += '<option value="19">19</option>';
	}else if(val == '2000'){
		str += '<option value="20">20</option>';
		str += '<option value="21">21</option>';
		str += '<option value="22">22</option>';
		str += '<option value="23">23</option>';
		str += '<option value="24">24</option>';
		str += '<option value="25">25</option>';
		str += '<option value="26">26</option>';
		str += '<option value="27">27</option>';
		str += '<option value="28">28</option>';
		str += '<option value="29">29</option>';
	}else if(val == '3000'){
		str += '<option value="30">30</option>';
		str += '<option value="31">31</option>';
		str += '<option value="32">32</option>';
		str += '<option value="33">33</option>';
		str += '<option value="34">34</option>';
		str += '<option value="35">35</option>';
		str += '<option value="36">36</option>';
		str += '<option value="37">37</option>';
		str += '<option value="38">38</option>';
		str += '<option value="39">39</option>';
	}else if(val == '4000'){
		str += '<option value="40">40</option>';
		str += '<option value="41">41</option>';
		str += '<option value="42">42</option>';
		str += '<option value="43">43</option>';
		str += '<option value="44">44</option>';
		str += '<option value="45">45</option>';
		str += '<option value="46">46</option>';
		str += '<option value="47">47</option>';
		str += '<option value="48">48</option>';
		str += '<option value="49">49</option>';
	}else if(val == '5000'){
		str += '<option value="50">50</option>';
		str += '<option value="51">51</option>';
		str += '<option value="52">52</option>';
		str += '<option value="53">53</option>';
		str += '<option value="54">54</option>';
		str += '<option value="55">55</option>';
		str += '<option value="56">56</option>';
		str += '<option value="57">57</option>';
		str += '<option value="58">58</option>';
		str += '<option value="59">59</option>';
	}else if(val == '6000'){
		str += '<option value="60">60</option>';
		str += '<option value="61">61</option>';
		str += '<option value="62">62</option>';
		str += '<option value="63">63</option>';
		str += '<option value="64">64</option>';
		str += '<option value="65">65</option>';
		str += '<option value="66">66</option>';
		str += '<option value="67">67</option>';
		str += '<option value="68">68</option>';
		str += '<option value="69">69</option>';
	}else if(val == '7000'){
		str += '<option value="70">70</option>';
		str += '<option value="71">71</option>';
		str += '<option value="72">72</option>';
		str += '<option value="73">73</option>';
		str += '<option value="74">74</option>';
		str += '<option value="75">75</option>';
		str += '<option value="76">76</option>';
		str += '<option value="77">77</option>';
		str += '<option value="78">78</option>';
		str += '<option value="79">79</option>';
	}else if(val == '8000'){
		str += '<option value="80">80</option>';
		str += '<option value="81">81</option>';
		str += '<option value="82">82</option>';
		str += '<option value="83">83</option>';
		str += '<option value="84">84</option>';
		str += '<option value="85">85</option>';
		str += '<option value="86">86</option>';
		str += '<option value="87">87</option>';
		str += '<option value="88">88</option>';
		str += '<option value="89">89</option>';
	}else if(val == '9000'){
		str += '<option value="90">90</option>';
		str += '<option value="91">91</option>';
		str += '<option value="92">92</option>';
		str += '<option value="93">93</option>';
		str += '<option value="94">94</option>';
		str += '<option value="95">95</option>';
		str += '<option value="96">96</option>';
		str += '<option value="97">97</option>';
		str += '<option value="98">98</option>';
		str += '<option value="99">99</option>';
	}
	document.getElementById('lotnum').innerHTML = str;
	
}
</script>

</head>

<body>
	<div class="container" style="background:#fff;" >
		<div class="menus">
      <ul style="">
          <?php echo innerAdminMenu()?>
      </ul>
    </div>


		<div class="row" >
			<div class="a-form" style="width: 450px; float: left; background:#fff;" >
				
				<form action="<?php echo SITEURL?>/live-bz" id="frmSetResult" name="frmSetResult" method="GET"  autocomplete="off">
                <input id="u" name="u" type="hidden" value="<?php echo $_REQUEST['u']?>">
                    <input id="id" name="id" value="<?php echo $_REQUEST['id']?>" type="hidden">
					<input id="flag" name="flag" value="1" type="hidden">
				  <div class="container">
                  <table>
                  
                  <tr>
                  	<td><b>Sernum</b></td>
                    <td>
                    <label for="UserType">:</label>
                        <select name="sernum" id="sernum">
                        <option value="">Select Series</option>
                        <option value="0000">0000</option>
                        <option value="1000">1000</option>
                        <option value="2000">2000</option>
                        <option value="3000">3000</option>
                        <option value="4000">4000</option>
                        <option value="5000">5000</option>
                        <option value="6000">6000</option>
                        <option value="7000">7000</option>
                        <option value="8000">8000</option>
                        <option value="9000">9000</option>
                        	
                        </select> 
                    </td>
                  </tr>
                  
                                    
                  <tr>
                  	<td><b>Lot Num</b></td>
                    <td>
                    <label for="lotnum">:</label>
                        <select name="lotnum" id="lotnum">
                        	<option value="">-Select Lot -</option>
                          	<option value="01">01</option>
                            <option value="02">02</option>
                            <option value="03">03</option>
                            <option value="04">04</option>
                            <option value="05">05</option>
                            <option value="06">06</option>
                            <option value="07">07</option>
                            <option value="08">08</option>
                            <option value="09">09</option>
                         
                            <option value="10">10</option>
                            <option value="11">11</option>
                            <option value="12">12</option>
                            <option value="13">13</option>
                            <option value="14">14</option>
                            <option value="15">15</option>
                            <option value="16">16</option>
                            <option value="17">17</option>
                            <option value="18">18</option>
                            <option value="19">19</option>
                            
                            <option value="20">20</option>
                            <option value="21">21</option>
                            <option value="22">22</option>
                            <option value="23">23</option>
                            <option value="24">24</option>
                            <option value="25">25</option>
                            <option value="26">26</option>
                            <option value="27">27</option>
                            <option value="28">28</option>
                            <option value="29">29</option>
                            
                            <option value="30">30</option>
                            <option value="31">31</option>
                            <option value="32">32</option>
                            <option value="33">33</option>
                            <option value="34">34</option>
                            <option value="35">35</option>
                            <option value="36">36</option>
                            <option value="37">37</option>
                            <option value="38">38</option>
                            <option value="39">39</option>
                            
                            <option value="40">40</option>
                            <option value="41">41</option>
                            <option value="42">42</option>
                            <option value="43">43</option>
                            <option value="44">44</option>
                            <option value="45">45</option>
                            <option value="46">46</option>
                            <option value="47">47</option>
                            <option value="48">48</option>
                            <option value="49">49</option>
                            
                            <option value="50">50</option>
                            <option value="51">51</option>
                            <option value="52">52</option>
                            <option value="53">53</option>
                            <option value="54">54</option>
                            <option value="55">55</option>
                            <option value="56">56</option>
                            <option value="57">57</option>
                            <option value="58">58</option>
                            <option value="59">59</option>
                            
                            <option value="60">60</option>
                            <option value="61">61</option>
                            <option value="62">62</option>
                            <option value="63">63</option>
                            <option value="64">64</option>
                            <option value="65">65</option>
                            <option value="66">66</option>
                            <option value="67">67</option>
                            <option value="68">68</option>
                            <option value="69">69</option>
                            
                            <option value="70">70</option>
                            <option value="71">71</option>
                            <option value="72">72</option>
                            <option value="73">73</option>
                            <option value="74">74</option>
                            <option value="75">75</option>
                            <option value="76">76</option>
                            <option value="77">77</option>
                            <option value="78">78</option>
                            <option value="79">79</option>
                            
                            <option value="80">80</option>
                            <option value="81">81</option>
                            <option value="82">82</option>
                            <option value="83">83</option>
                            <option value="84">84</option>
                            <option value="85">85</option>
                            <option value="86">86</option>
                            <option value="87">87</option>
                            <option value="88">88</option>
                            <option value="89">89</option>
                            
                            <option value="90">90</option>
                            <option value="91">91</option>
                            <option value="92">92</option>
                            <option value="93">93</option>
                            <option value="94">94</option>
                            <option value="95">95</option>
                            <option value="96">96</option>
                            <option value="97">97</option>
                            <option value="98">98</option>
                            <option value="99">99</option>
                        </select> 
                    </td>
                  </tr>
                  
                  
                  
                  
                  
                  <tr>
                  	<td>Win Cell</td>
                    <td><input id="cellID" name="cellID" type="text" value="" required></td>
                  </tr>
                  
                  <tr>
                  	<td>Time</td>
                    <td>
                    <label for="lotTime">:</label>
                        <select name="lotTime" id="lotTime">
                        	<option value="">-Select Time -</option>
                            <option value="10:00">10:00</option>
                            <option value="10:15">10:15</option>
                            <option value="10:30">10:30</option>
                            <option value="10:45">10:45</option>
                            <option value="11:00">11:00</option>
                            <option value="11:15">11:15</option>
                            <option value="11:30">11:30</option>
                            <option value="11:45">11:45</option>
                            <option value="12:00">12:00</option>
                            <option value="12:15">12:15</option>
                            <option value="12:30">12:30</option>
                            <option value="12:45">12:45</option>
                            <option value="01:00">01:00</option>
                            <option value="01:15">01:15</option>
                            <option value="01:30">01:30</option>
                            <option value="01:45">01:45</option>
                            <option value="02:00">02:00</option>
                            <option value="02:15">02:15</option>
                            <option value="02:30">02:30</option>
                            <option value="02:45">02:45</option>
                            <option value="03:00">03:00</option>
                            <option value="03:15">03:15</option>
                            <option value="03:30">03:30</option>
                            <option value="03:45">03:45</option>
                            <option value="04:00">04:00</option>
                            <option value="04:15">04:15</option>
                            <option value="04:30">04:30</option>
                            <option value="04:45">04:45</option>
                            <option value="05:00">05:00</option>
                            <option value="05:15">05:15</option>
                            <option value="05:30">05:30</option>
                            <option value="05:45">05:45</option>
                            <option value="06:00">06:00</option>
                            <option value="06:15">06:15</option>
                            <option value="06:30">06:30</option>
                            <option value="06:45">06:45</option>
                            <option value="07:00">07:00</option>
                            <option value="07:15">07:15</option>
                            <option value="07:30">07:30</option>
                            <option value="07:45">07:45</option>
                            <option value="08:00">08:00</option>
                            <option value="08:15">08:15</option>
                            <option value="08:30">08:30</option>
                            <option value="08:45">08:45</option>
                            <option value="09:00">09:00</option>
                            <option value="09:15">09:15</option>
                            <option value="09:30">09:30</option>
                            <option value="09:45">09:45</option>
                          	
                        </select> 
                    </td>
                  </tr>
                  
                 
                  
                  
                  
                  <tr>
                  <td>					
                    <button class="btn" type="submit" id="btnSetResult" name="btnSetResult" style="background-color:#6F0">Save </button>
                    
                  </td>
                  
                  
                  
                   
                  </tr>
                  
                  
                  
                  </table>
				    </div>
				</form>
                
                <?php
                	//$msg = '';
					if(isset($_REQUEST['btnSetResult'])){
						@session_start();
						
						
						 $sql = 'SELECT lotID FROM '.$DB->pre.'result_tran WHERE sernum="'.$_REQUEST['sernum'].'" AND lotnum="'.$_REQUEST['lotnum'].'" AND lotdate="'.date('Y-m-d').'" AND lotTime="'.$_REQUEST['lotTime'].'" AND uID="1"';
						$data = $DB->dbRow($sql);
						
						$str = array('str'=>'OK');
						$msg = '';
						if($data['lotID'] != ''){
								
								$msg = '<p style="background-color: #d92424;height: 20px;padding: 10px;color: #fff;font-weight: bold;">Result all ready exits...</p>';
						}else{
						
						
							//$DB = new mxDb('localhost','esssifhw_lottery','esssifhw_lottery','nitin@123');
							date_default_timezone_set('Asia/Kolkata');
								
									 echo $sql = 'INSERT INTO '.$DB->pre.'result_tran SET cellID="'.$_REQUEST['cellID'].'",sernum="'.$_REQUEST['sernum'].'",lotnum="'.$_REQUEST['lotnum'].'",lotdate="'.date('Y-m-d').'",uID="1",lotTime="'.$_REQUEST['lotTime'].'",dateAdded="'.date('Y-m-d H:i:s').'"';
									
									if($DB->dbQuery($sql)){
										$msg = '<p style="background-color: #d92424;height: 20px;padding: 10px;color: #fff;font-weight: bold;">Added Successfully...</p>';
									}
							
							
						
						}
					}
					
					
					
					
					
											
						
						
						
						
					
					
					
				?>
                <p><?php
                	echo $msg;
				?></p>
			</div>
			
		</div>

	</div>

</body>
</html>
