<?php 	
            include_once('../../config.php');    
			if(isset($_POST['submit']))
			{    
                
                
                $type = $_SESSION['type'];
                $adminId = $_SESSION['adminId'];
                $Time = $_POST['open1'].":".$_POST['open2'];
                $Time1 = $_POST['close1'].":".$_POST['close2']; 
                mysql_query("update live_result set  ProUser = $_POST[ProUser] , tim='$_POST[tim]',open_time='$Time',close_time='$Time1'  where id=$_REQUEST[id]"); 
                header("Location:  d-buber.php "); 
                $msg = "Product has been added successfully..";			
			} 

			$rst = mysql_query("select * from live_result where id=$_REQUEST[id]");
			$value  = mysql_fetch_object($rst);
			
			$exp1 = explode(":",$value->open_time);
			$open1 = $exp1[0];
			$open2 = $exp1[1];
			
			
	 
			 
			
			
			$exp2 = explode(":",$value->close_time);
			$close1 = $exp2[0];
			$close2 = $exp2[1];
		 
			        
?>  
<?php  include ABS_PATH.'/admin/header.php';	?>  


 <script>
	$(function() {
		$( "#datepicker" ).datepicker(); 
	}); 
  
	$(document).ready(function()
	{   

	
	$("#product_frm").validate({
		
		errorElement:'div',
		rules:{ 
			city:{
				required:true				 
			} 
			
			
			
		},
		messages:{				
			 
			 city:{
				required:"Enter city name"				 
			} 
		}
	});


	});
 


</script>
		 
		 <div class="col-md-10">

	  			<div class="row">
	  				<div class="col-md-12">
	  					<div class="content-box-large">
							<div class="panel-heading">
								<div class="panel-title"> <h3> <?php //echo $val;?> </h3></div>    
								
								<div class="panel-options"> 

								   <input type="button"  class="btn btn-warning" name="btnback" id="btnback" value=" Back " onClick="javascript:location.href='d-buber.php';" />
								  
								</div>
							  
								 
							</div>
							
							
			  				<div class="panel-body">
							
							
								
								 
			  					<form class="form-horizontal" role="form" method="post" enctype="multipart/form-data" id="product_frm">
								
								<div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">Name</label>
								    <div class="col-sm-10">
								      <input name="Lname" class="form-control"   placeholder="Value" value="<?php echo $value->name;?>"  >
								    </div>
								 </div>
								 <hr>  
								 
							     

								<div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">Time</label>
								    <div class="col-sm-10">
								      <input name="tim" class="form-control"   placeholder="Time" value="<?php echo $value->tim;?>"  >
								    </div>
								 </div>
								 
								 <div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">Open Time</label>
								    <div class="col-sm-3"> 
								      <select  class="form-control" name="open1"> 
								            <option value="" selected>Select Hour</option> 
								            <?php 
								                for($i=0;$i<=24;$i++)
								                {
								                    if($i<10)
								                    { 
								             ?>
								            <option value="<?php echo '0'.$i; ?>" <?php if($open1==$i) echo "selected"; ?> ><?php echo '0'.$i;?></option>
								            <?php } else {  ?>
								            <option value="<?php echo $i; ?>" <?php if($open1==$i) echo "selected"; ?> ><?php echo $i;?></option>       
								            <?php }  
								              }
								            ?> 
								        </select>    
								    </div>
								    
								     <div class="col-sm-3">    
								     <select  class="form-control" name="open2"> 
								     <option value="" selected>Select Minute</option>
								         <?php
								                for($i=0;$i<=59;$i++)
								                {
								                    if($i<10)
								                    { 
								            ?>
								            <option value="<?php echo '0'.$i?>" <?php if($open2==$i) echo "selected"; ?>><?php echo '0'.$i?></option>
								            <?php } else {  ?>
								            <option value="<?php echo $i?>" <?php if($open2==$i) echo "selected"; ?>><?php echo $i?></option>
								             <?php } 
								                }
								             ?>
								        </select>
								        </div>
								 </div>
								 
								 <div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">Close Time</label>
								    <div class="col-sm-3"> 
								      <select  class="form-control" name="close1"> 
								            <option value="" selected>Select Hour</option> 
								            <?php 
								                for($i=0;$i<=24;$i++)
								                {
								                    if($i<10)
								                    {
								            ?>
								            <option value="<?php echo '0'.$i; ?>" <?php if($close1==$i) echo "selected"; ?> ><?php echo '0'.$i;?></option>
								            <?php }  else { ?> 
								            <option value="<?php echo $i; ?>" <?php if($close1==$i) echo "selected"; ?> ><?php echo $i;?></option>
								            <?php } 
								                }
								            ?>
								        </select>    
								    </div>
								    
								     <div class="col-sm-3">    
								     <select  class="form-control" name="close2"> 
								     <option value="" selected>Select Minute</option>
								         <?php
								                for($i=0;$i<=59;$i++)
								                {
								                    if($i<10)
								                    {
								            ?>
								            <option value="<?php echo '0'.$i?>" <?php if($close2==$i) echo "selected"; ?>><?php echo '0'.$i?></option>
								             <?php } else {?>
								             <option value="<?php echo $i?>" <?php if($close2==$i) echo "selected"; ?>><?php echo $i?></option>
								             <?php }
								                }
								              ?>
								        </select>
								        </div>
								 </div>
								 
								   
								   
								   
								   
							   	<div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">Name</label>
								    <div class="col-sm-3">
								      <select name="ProUser" class="form-control">
								          <option value="1" <?php if($value->ProUser==1) echo "selected"; ?> >Active</option>
								          <option value="0" <?php if($value->ProUser==0) echo "selected"; ?> >Deactive</option>
								      </select>
								    </div>
								 </div>
								 <hr> 
								  
								  <div class="form-group">
										<label for="inputEmail3" class="col-sm-2 control-label">Update</label>
										<div class="col-sm-10">
										  <input type="submit"    class="btn btn-primary"  name="submit" value="Update">
										</div>
								  </div>   
								</form>
								
								
							
			  				</div>
			  			</div>
	  				</div>
	  				 
	  			</div>

	  			 


	  		<!--  Page content -->
		  </div>
		</div>
    </div>

<?php  include ABS_PATH.'/admin/footer.php';	?>    