<?php 	

        include_once('../../config.php');   	
		include_once(ABS_PATH.'/admin/login_check.php');    
    
  
			if(isset($_POST['submitF']))
			{     
                $stmt=$conn->prepare("update  UI__WithDralTimingsUPI set  start_tim=:start_tim,end_time=:end_time ");    
                $stmt->bindValue(':start_tim', $_POST['timings'] , PDO::PARAM_STR);
                $stmt->bindValue(':end_time', $_POST['timinge'] , PDO::PARAM_STR);    
                $stmt->execute();
				header("Location: withtimingUPI.php");  
				die;
			}   
			
			
			if(isset($_POST['submitT']))
			{     
		        
		        if(isset($_POST['mon']))
		          $mon = 1;
		        else    
		            $mon = 0;
		            
		        
		        if(isset($_POST['tue']))
		          $tue = 1;
		        else    
		            $tue = 0;    
		           
		        if(isset($_POST['wed']))
		          $wed = 1;
		        else    
		            $wed = 0;
		            
		        
		         if(isset($_POST['thu']))
		          $thu = 1;
		        else    
		            $thu = 0;  
		            
		            
		       if(isset($_POST['fri']))
		          $fri = 1;
		        else    
		            $fri = 0;   
		            
		        
	           if(isset($_POST['sat']))
		          $sat = 1;
		        else    
		            $sat = 0; 
		            
		       if(isset($_POST['sun']))
		          $sun = 1;
		        else    
		            $sun = 0;       
		                
              
                $stmt=$conn->prepare("update  UI__WithDralTimingsUPI set mon=:mon,tue=:tue,wed=:wed,thru=:thru,fri=:fri,sat=:sat,sun=:sun,messG=:messG,limitperday=:limitperday   ");    
                $stmt->bindValue(':mon',  $mon , PDO::PARAM_STR);
                $stmt->bindValue(':tue', $tue , PDO::PARAM_STR); 
                $stmt->bindValue(':wed', $wed , PDO::PARAM_STR);
                $stmt->bindValue(':thru', $thu , PDO::PARAM_STR); 
                $stmt->bindValue(':fri', $fri , PDO::PARAM_STR); 
                $stmt->bindValue(':sat', $sat , PDO::PARAM_STR); 
                $stmt->bindValue(':sun', $sun , PDO::PARAM_STR); 
                $stmt->bindValue(':messG', $_POST['messG'] , PDO::PARAM_STR); 
                $stmt->bindValue(':limitperday', $_POST['limitperday'] , PDO::PARAM_STR);   
                $stmt->execute();          
				header("Location: withtimingUPI.php");  
				die;
				
			}
			
			
		
		 
		    
    
            $stmt=$conn->prepare("select  * from  UI__WithDralTimingsUPI   ");   
            $stmt->execute(); 
            $AllUsers = $stmt->fetch(PDO::FETCH_OBJ);   
            $sr = 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> Withdrawl Timings UPI</h3></div>    
								
								<!--div class="panel-options"> 

								   <input type="button"  class="btn btn-warning" name="btnback" id="btnback" value=" Back " onClick="javascript:location.href='registered_users.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">Start Time</label>
								    <div class="col-sm-3">
								        <select class="form-control"  name="timings"  >
								            <?php 
								                for($i=5;$i<25;$i++) 
								                {
								            ?>
								            <option value="<?php echo $i;?>" <?php  if($AllUsers->start_tim==$i) echo "selected";  ?> ><?php echo $i;?></option>
								            <?php } ?>  
								        </select>
								       
								    </div>
								 </div>
								 <hr>
								 
								 <div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">End Time</label>
								    <div class="col-sm-3">
								        <select class="form-control"  name="timinge"  >
								            <?php 
								                for($i=5;$i<25;$i++) 
								                {
								            ?>
								            <option value="<?php echo $i;?>" <?php  if($AllUsers->end_time==$i) echo "selected";  ?> ><?php echo $i;?></option>
								            <?php } ?>  
								        </select>
								       
								    </div>
								 </div>
								 <hr> 
							   
								  
								  <div class="form-group">
										<label for="inputEmail3" class="col-sm-2 control-label">Update</label>
										<div class="col-sm-6">
										  <input type="submit"    class="btn btn-primary"  name="submitF" value="Update"> 										   
										</div>
								  </div>   
								</form>   
							
			  				</div>
			  			</div>
	  				</div> 
	  			</div>   
	  			
	  			
	  			
	  			
	  			<div class="row">
	  				<div class="col-md-12">
	  					<div class="content-box-large">
							<div class="panel-heading">
								<div class="panel-title"> <h3> Days</h3></div>    
								
								<!--div class="panel-options"> 

								   <input type="button"  class="btn btn-warning" name="btnback" id="btnback" value=" Back " onClick="javascript:location.href='registered_users.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">Monday</label>
								    <div class="col-sm-3">
								         <input type="checkbox" name="mon" value="1" <?php if($AllUsers->mon==1) echo "checked";?> />
								    </div>
								 </div>
								 <hr>
								 
								 
								  <div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">Tuesday</label>
								    <div class="col-sm-3">
								         <input type="checkbox" name="tue" value="1" <?php if($AllUsers->tue==1) echo "checked";?>/>
								    </div>
								 </div>
								 <hr>
								 
								  <div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">Wednesday</label>
								    <div class="col-sm-3">
								         <input type="checkbox" name="wed" value="1" <?php if($AllUsers->wed==1) echo "checked";?>/>
								    </div>
								 </div>
								 <hr>
								 
								 
								  <div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">Thrusday</label>
								    <div class="col-sm-3">
								         <input type="checkbox" name="thu" value="1" <?php if($AllUsers->thru==1) echo "checked";?>/>
								    </div>
								 </div>
								 <hr>
								 
								 
								  <div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">Friday</label>
								    <div class="col-sm-3">
								         <input type="checkbox" name="fri" value="1" <?php if($AllUsers->fri==1) echo "checked";?>/>
								    </div>
								 </div>
								 <hr>
								 
								  <div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">Saturday</label>
								    <div class="col-sm-3">
								         <input type="checkbox" name="sat" value="1" <?php if($AllUsers->sat==1) echo "checked";?>/>
								    </div>
								 </div>
								 <hr>
								 
								 
								 
								  <div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">Sunday</label>
								    <div class="col-sm-3">
								         <input type="checkbox" name="sun" value="1" <?php if($AllUsers->sun==1) echo "checked";?> />
								    </div>
								 </div>
								 <hr>
								 
								 
							 	 <div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">Message</label>
								    <div class="col-sm-6">
								       
								       <input class="form-control"  name="messG" required  value="<?php echo $AllUsers->messG;?>"  />
								        
								    </div>
								 </div>
								 <hr> 
								 
								 
							 	 <div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">Limit Per Day</label>
								    <div class="col-sm-6"> 
								       <input class="form-control"  name="limitperday" required  value="<?php echo $AllUsers->limitperday;?>"  />
								        
								    </div>
								 </div>
								 <hr> 
								 
								 
								 
								 
							   
								  
								  <div class="form-group">
										<label for="inputEmail3" class="col-sm-2 control-label">Update</label>
										<div class="col-sm-6">
										  <input type="submit"    class="btn btn-primary"  name="submitT" value="Update"> 										   
										</div>
								  </div>   
								</form>   
							
			  				</div>
			  			</div>
	  				</div> 
	  			</div> 

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

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