<?php 	include_once('../../config.php');   	
		include_once(ABS_PATH.'/admin/login_check.php');    
?>  
<?php  include ABS_PATH.'/admin/header.php';	?>  

<script>
var URL  = '<?php echo ROOTPATH;?>';  
function del_record(val)
{

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

</script>
		 
		<div class="col-md-10">  
  			<div class="content-box-large">
  				<div class="panel-heading">
					<div class="panel-title"><h3> Level List Level : <?php echo $_REQUEST['level'];?> </h3></div>
					
					<div align="right"> 
					    <a   class="btn btn-warning"  href="allLevelList.php" > Back</a>
					</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>Userid</th>  
								<th>Name</th>  
								<th>Top Up Amount</th>  
								<th>Top Up On</th>  
								<th>Registered On</th>  
							 
							 
							  
							</tr>
						</thead>
						<tbody>
							<?php
                                    $stmt=$conn->prepare("select  * from UI__DChstr where level=:level ");  
                                    $stmt->bindValue(':level', $_REQUEST['level'] , PDO::PARAM_STR);
                                    $stmt->execute();   
                                    $AllUsers = $stmt->fetchAll(PDO::FETCH_OBJ); 
                                    $sr = 1;  
								  foreach($AllUsers as $users)
								  {   
								      
                                        $stmt=$conn->prepare("select  * from UI__Rgst where cuurentId=:cuurentId ");  
                                        $stmt->bindValue(':cuurentId', $users->Rid , PDO::PARAM_STR);
                                        $stmt->execute(); 
                                        $User = $stmt->fetch(PDO::FETCH_OBJ); 
                                        
                                        $stmt=$conn->prepare("select  amt,Tdate from UI__DChstr where Rid=:cuurentId and typ=1 ");  
                                        $stmt->bindValue(':cuurentId', $users->Rid , PDO::PARAM_STR);
                                        $stmt->execute(); 
                                        
                                        if($stmt->rowCount() > 0)
                                        {
                                            $Top = $stmt->fetch(PDO::FETCH_OBJ); 
                                            $amt = $Top->amt;
                                            $damt = $Top->Tdate;
                                        }else
                                        {
                                            $amt = "";
                                            $damt = "";
                                        }
							?>							
				            <tr class="odd gradeX">
								<td><?php echo $sr++;?> </td>
								<td><?php echo $users->Rid;?></td> 	
								<td><?php echo $User->nm;?></td>    
								<td><?php echo $amt;?></td>
								<td><?php echo $damt;?></td>
								<td><?php echo $User->RegOn; ?></td>
							</tr>  
							<?php } ?>
						</tbody>
					</table>
  				</div>
  			</div>



		  </div>
		</div>
    </div>

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