<?php 	include_once('../../config.php');   	
		include_once(ABS_PATH.'/admin/login_check.php');    
 
 
            
            $myIdset = 0;
            if(isset($_REQUEST['PyId']))
            {     
                $myIdset = $_REQUEST['PyId']; 
                $stmt=$conn->prepare("select  * from  UI__TxnFailUsers where id=:id  ");  
                $stmt->bindValue(':id', $myIdset , PDO::PARAM_STR);
                $stmt->execute(); 
                $Mydetails = $stmt->fetch(PDO::FETCH_OBJ); 
                $sr = 1;

            }
                            

			if(isset($_POST['submitP']))
			{     
			         
        			$stmt=$conn->prepare("update UI__UpiManage set   Upiselect=:Upiselect,updatedOn=:updatedOn  where typ=1"); 
                    $stmt->bindValue(':Upiselect',$_POST['UpiPay'], PDO::PARAM_STR);  
                    $stmt->bindValue(':updatedOn', date("d-M-Y H:i"), PDO::PARAM_STR);    
                    $stmt->execute();   
                    header("Location: payout-manage.php");  
    				die; 
			}  
			
			
			if(isset($_POST['submitA']))
			{         
        			$stmt=$conn->prepare("update UI__UpiManage set   Upiselect=:Upiselect,updatedOn=:updatedOn  where typ=2"); 
                    $stmt->bindValue(':Upiselect',$_POST['UpiPay1'], PDO::PARAM_STR);  
                    $stmt->bindValue(':updatedOn', date("d-M-Y H:i"), PDO::PARAM_STR);    
                    $stmt->execute();   
                    header("Location: payout-manage.php");  
    				
    				die; 
			}  
			
			
			
			
			
            $stmt=$conn->prepare("select *  from UI__UpiManage   where typ=1"); 
            //$stmt->bindValue(':UPI',  $_POST['UPI'] , PDO::PARAM_STR);  
            $stmt->execute();     
            $RstUxd = $stmt->fetch(PDO::FETCH_OBJ); 
            
            
            $stmt=$conn->prepare("select *  from UI__UpiManage   where typ=2"); 
            //$stmt->bindValue(':UPI',  $_POST['UPI'] , PDO::PARAM_STR);  
            $stmt->execute();     
            $RstUxd1 = $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>



<script> 
$(document).ready(function()
{   
  
	
	    var URL = "<?php echo ROOTPATH; ?>";    
        $( "#userid" ).change(function() 
        {      
                   
                     
          $.ajax({	
                type: "POST",
                url: URL+"/ajax/validation.php",
                data: {userDatacheck:1,Data:$("#userid").val()},
                beforeSend: function(){ 
                },
                success: function(data)
                    {        
                        $("#AvailbleId").html("<span style='color:green;'>"+data+" &#x2713</span>");
                    }
                });   
        });
        
         $( "#useridA" ).change(function() 
        {      
                
                     
          $.ajax({	
                type: "POST",
                url: URL+"/ajax/validation.php",
                data: {userDatacheck:1,Data:$("#useridA").val()},
                beforeSend: function(){ 
                },
                success: function(data)
                    {        
                        
                        $("#AvailbleIdA").html("<span style='color:green;'>"+data+" &#x2713</span>");
                    }
                });   
        });
 
 
}); 

</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> UPI PAY LIST </h3></div>    
								
								<div class="panel-options">  
								   <a class="btn btn-warning" href="impspaidUser.php"> Paid User List</a> 
								</div>
							  
								 
							</div>
							
							
			  				<div class="panel-body">    
			  				
			  				<?php 
			  				    if($myIdset==0) 
			  				    {
			  				?>
			  				
	  				    <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="example">
						<thead>
							<tr> 
							
								<th>Sr</th>
								<th>UserID</th>  
								<th>User Name</th>  	   
								<th>Amount</th>  	    
								<th>Date</th>   
								<th>Reject</th>
								<th>Action</th>
								
							</tr>
						</thead>
						<tbody>
							<?php
                                    $stmt=$conn->prepare("select  * from  UI__UPreqst where  status=0  order by id desc");  
                                    //$stmt->bindValue(':Ttime', $InTime , PDO::PARAM_STR);
                                    $stmt->execute(); 
                                    $AllUsers = $stmt->fetchAll(PDO::FETCH_OBJ); 
                                    $sr = 1;
								  foreach($AllUsers as $users)
								  {    
							          
							        $stmt=$conn->prepare("select  nm from   UI__Rgst where cuurentId=:cuurentId   ");  
                                    $stmt->bindValue(':cuurentId', $users->custId ,  PDO::PARAM_STR);
                                    $stmt->execute();  
                                    $NM = $stmt->fetch(PDO::FETCH_OBJ);     
                                                                               
							?>
							<tr class="odd gradeX">
								<td><?php echo $sr++;?> </td>
								<td><?php echo $users->custId;?></td>
								<td><?php echo $NM->nm;?>  </td>   
								<td><?php echo $users->amount;?></td>    
								<td><?php echo $users->Tdate;?></td>    
								<td> <a href="rejkectUPI.php?PyId=<?php echo $users->id;?>&serKy=jspdfpofnpprimv00nF">Reject</a></td>     
								<td> <a href="payUPI.php?PyId=<?php echo $users->id;?>&NPSID=BSJOLEDPFEIFMELFFF475f">Pay</a></td>     
							</tr>  
							<?php } ?>
						</tbody>
					</table>
					
					
					        
					    
					    
			  				 
			  				</div>
			  			</div>
			  			
			  			
			  			
			  			
			  			<div class="content-box-large">
							<div class="panel-heading">
								<div class="panel-title"> <h3> </h3></div>    
								 
							 
								 
							</div>   
			  				</div>
			  			</div>
			  			
			  			<?php  } else {?>
			  			
			  			
			  				<div class="content-box-large">
			  				<div class="panel-body">    
			  					<form class="form-horizontal"  action="pgDmt.php"   method="post"  >     
								  <div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">Account Holder Name</label>
								    <div class="col-sm-6">  
								      <input type="text" value="<?php echo $Mydetails->holder;?>"  class="form-control"   readonly > 
								    </div>
								 </div>
								 <hr>  
								 
								 <div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">Account   No</label>
								    <div class="col-sm-6">  
								      <input type="text" value="<?php echo $Mydetails->accno;?>"  class="form-control"   readonly > 
								    </div>
								 </div>
								 <hr>  
								 
								 <div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">IFSC</label>
								    <div class="col-sm-6">  
								      <input type="text" value="<?php echo $Mydetails->ifsc;?>"  class="form-control"  readonly > 
								    </div>
								 </div>
								 <hr>  
								 
								 <div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">Amount</label>
								    <div class="col-sm-6">  
								      <input type="text" value="<?php echo $Mydetails->amt;?>"   class="form-control" readonly   > 
								    </div>
								 </div>
								 <hr>  
								 
								 <div class="form-group">
								    <label for="inputEmail3" class="col-sm-2 control-label">Password</label>
								    <div class="col-sm-6">  
								      <input type="text" name="pdddF"   class="form-control"  required  > 
								      <input type="hidden" name="PyId"   value="<?php echo $_REQUEST['PyId'];?>"   > 
								    </div>
								 </div>
								 <hr>  
								 
								 
								  <div class="form-group">
										<label for="inputEmail3" class="col-sm-2 control-label">Submit</label>
										<div class="col-sm-6">
										  <input type="submit"    class="btn btn-primary"  name="PssSub" value="Submit">
										  <a href="payout-manage.php"  class="btn btn-primary" >  Cancel</a>
										</div>
								  </div>
								  
								  
								  
								  
								  
								</form>  
			  				</div>
			  				</div>
			  			
			  			<?php } ?>
			  			
			  			
	  				</div> 
	  			</div>  


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

<?php  include ABS_PATH.'/admin/footer.php';	
    unset($_SESSION['userpanadhar']);
?>    