<?php 	
    include_once('../../config.php');   	
    include_once(ABS_PATH.'/admin/login_check.php');     
    
        
        
                    if(isset($_POST['dnExc']))
                    {          
                        
                         
                }
include ABS_PATH.'/admin/header.php';	        
?>  
        

<script>
            
            function GetBalance(sr,Id)
            {
                
                    $.ajax({
                    type: 'POST',
                    url: "../../config.php",
                    //async: false,			 
                    data: {gtMybal:1,Id:Id,bYadmin:1},	  
                    success: function(ajaxresult)
                    {	      
                        $("#MyBal"+sr).html(ajaxresult);     
                    },
                    error: function(XMLHttpRequest, textStatus, errorThrown) 
                    { 
                    
                            alert('Error');
                            
                    }
                    });
            
            }
	
function del_record(val)
{

	var r = confirm("Do you really want to delete record !");
	if (r == true) {    
	$.ajax({
	type: 'POST',
	url: "../ajax/default.php",
	//async: false,			 
	data: {del_city_names:1,val:val},	  
	success: function(ajaxresult){	     
		location.reload();	 	
	},
	error: function(XMLHttpRequest, textStatus, errorThrown) { 
	alert('Error');
	}
	});
	
	}	  
	
}



$( document ).ready(function() 
{
    
   
    
    
    
    
     
});

var fruits = [];  
function ckkl(i)
    {
        
     
         $('#Chxk'+i).prop('checked', true); 
         fruits.push(i); 
         var  text = fruits.toString();    
         $("#idS").val(text);   
    }  
</script>
		 
		<div class="col-md-10">  
  			<div class="content-box-large">
  			    <form method="post" autocomplete="off"> 
  				<div class="panel-heading">
					<div class="panel-title"><h3>PG Request </h3></div>
					
			       
					
				</div>
				
  				<div class="panel-body">
  					<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="example">
						<thead>
							<tr>
								<th>Sr</th>
								<th>Name</th>  	  
								<th>Count</th>  
						 
							</tr>
						</thead>
						<tbody>
							<?php
                                   
                                    $stmt=$conn->prepare("select  cuurentId,nm   from  UI__Rgst where is_active = 1  and marchant=0 and  cuurentId!='DP112233' order by id");  
                                    //$stmt->bindValue(':Ttime', $InTime , PDO::PARAM_STR);
                                    $stmt->execute(); 
                                    $AllUsers = $stmt->fetchAll(PDO::FETCH_OBJ); 
                                    $sr = 1;
                                    
								  foreach($AllUsers as $users)
								  {   
								      
    								$cmtCt = 0;
    								      
                                    $stmt=$conn->prepare("select  * from  UI__TxnFailUsers where custId=:custId and impnft = 1  and UTR=''  order by id desc");  
                                    $stmt->bindValue(':custId', $users->cuurentId , PDO::PARAM_STR);
                                    $stmt->execute(); 
                                	if($stmt->rowCount()>0)
                                	    $cmtCt += $stmt->rowCount();
                                	    
                            	    $stmt=$conn->prepare("select  * from  UI__TxnFailUsersPay2 where custId=:custId and impnft = 1  and status!=1  order by id desc");  
                                    $stmt->bindValue(':custId', $users->cuurentId , PDO::PARAM_STR);
                                    $stmt->execute(); 
                                    if($stmt->rowCount()>0)
                                    $cmtCt += $stmt->rowCount();  
                                	       
                    
                                    $stmt=$conn->prepare("select  * from   UI__TxnFailUsers  where custId=:custId and  impnft=0 and status!=1 order by id desc ");   
                                    $stmt->bindValue(':custId', $users->cuurentId , PDO::PARAM_STR);
                                    $stmt->execute(); 
                                    if($stmt->rowCount()>0)
                                    $cmtCt += $stmt->rowCount();  
                                	          
                                    
                                	  
                                	if($cmtCt>0) {    

								      
							?>
							<tr class="odd gradeX">
								<td><?php echo $sr++;?> </td>
								<td> <a href="<?php echo ROOTPATH;?>/admin/wallet/PgPay.php?custId=<?php echo $users->cuurentId;?>"><?php echo $users->nm;?></a></td>
								<td><?php echo $cmtCt;?></td>  
							</tr>  
							<?php  
                                	}
								  }
							?>
						</tbody>
					</table>
  				</div>
  				
  				<input name="idS"   id="idS" type="hidden" /> 
  				</form>
  			</div>  
		  </div>
		  
		</div>
    </div>

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