<?php 	include_once('../../config.php');   	
		include_once(ABS_PATH.'/admin/login_check.php');    
 
			if(isset($_POST['submitF']))
			{    
			    if($_POST['status']==0)
			    {
                    $stmt=$conn->prepare("update  UI__Bns set  paidStatus=:paidStatus ,PaidDate=''  where id=:id");  
                    $stmt->bindValue(':paidStatus', $_POST['status'], PDO::PARAM_STR);
                    $stmt->bindValue(':id', $_REQUEST['id'], PDO::PARAM_STR);
                    $stmt->execute();    
			    }else
			    {
			        $stmt=$conn->prepare("update  UI__Bns set  paidStatus=:paidStatus   where id=:id");  
                    $stmt->bindValue(':paidStatus', $_POST['status'], PDO::PARAM_STR);
                    $stmt->bindValue(':id', $_REQUEST['id'], PDO::PARAM_STR);
                    $stmt->execute(); 
			    }
			}  
			
            			      
            $stmt=$conn->prepare("select  paidStatus from   UI__Bns  where id=:id");  
            $stmt->bindValue(':id', $_REQUEST['id'], PDO::PARAM_STR);
            $stmt->execute(); 
            $MyReqst = $stmt->fetch(PDO::FETCH_OBJ);  
             
                    
include ABS_PATH.'/admin/header.php';	
?>


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

	
	$("#product_frm").validate({
		
		errorElement:'div',
		rules:{ 
			userid:{
				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> Edit   Update</h3></div>    
								
    								<div class="panel-options">  
    								    
    								</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">Userid</label>
								    <div class="col-sm-3">  
								    <select name="status" class="form-control" >
								        <option value="1" <?php if($MyReqst->paidStatus==1) echo  "selected";?> >Paid</option>
								        <option value="0" <?php if($MyReqst->paidStatus==0) echo  "selected";?> >Unpaid</option>
								    </select>      
								    
								    </div>
								 </div>
								 <hr>  
								 
								  <div class="form-group">
										<label for="inputEmail3" class="col-sm-2 control-label">Update Status</label>
										<div class="col-sm-10">
										  <input type="submit" class="btn btn-primary"  name="submitF" value="Update">
										</div>
								  </div>   
								</form>  
			  				</div>
			  			</div>
	  				</div> 
	  			</div>  


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

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