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

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

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');
	}
	});
	
	}	
	
}

</script>
		 
		<div class="col-md-10">  
  			<div class="content-box-large">
  				<div class="panel-heading">
					<div class="panel-title"><h3> Collection Qr Reporting </h3></div>
					
					 
					 <div align="left"> 
					 <form method="post" autocomplete="off">  
					
					<div class="col-sm-2">
						<input name="dateselect" id="dateselect" class="form-control"   placeholder="Date"  > 
					</div>
					
					 
					<input   class="btn btn-warning"  type="submit" value="Apply" name="filterSub"/> 
					</form>
						
					</div>     
				</div>
				
  				<div class="panel-body">
  					<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="example">
						<thead>
							<tr>
								<th>Name</th>   
								<th>Values </th>   
							</tr>
						</thead>
						<tbody>
						   
							<?php  
								if(isset($_POST['filterSub']))  
								{ 
									$lst = date("d-M-Y", strtotime($_POST['dateselect'])); 
									$lst1 = date("Y-m-d", strtotime($_POST['dateselect']));
								}
								else
								{
									
									$lst =  date("d-M-Y");
									$lst1 = date("Y-m-d");
								}
								
								 
								 
                                $stmt=$conn->prepare("SELECT * FROM UI__ConirmQr where Tdate like '%$lst%' and trasnferStatus=0   ");   
                                //$stmt->bindValue(':cuurentId',  $_SESSION['userId'] , PDO::PARAM_STR);  
                                $stmt->execute(); 
                                $moneytransfer = $stmt->fetchAll(PDO::FETCH_OBJ); 
                                
                            
                                $amt = 0;
                                foreach($moneytransfer as $mpp)
                                        $amt += $mpp->Amt;  
                                        
                               
							?>
							
							 <tr class="odd gradeX"> 
								<td>
								     <a href="TdysCollection.php?Tdate=<?php echo $lst;?>&Tdate1=<?php echo $lst1;?>"> Todays Collection</a>    
								     </td>    
								<td>   <?php echo $amt;?> </td>     
							</tr>  
							
							
							<?php  
								if(isset($_POST['filterSub']))  
								{ 
									$lst = date("d-M-Y", strtotime($_POST['dateselect'])); 
									$lst1 = date("Y-m-d", strtotime($_POST['dateselect']));
								}
								else
								{
									
									$lst =  date("d-M-Y");
									$lst1 = date("Y-m-d");
								}
								
								 
								 
                                $stmt=$conn->prepare("SELECT * FROM `UI__CollTopup`  where Tdate like '%$lst%'  ");   
                                //$stmt->bindValue(':cuurentId',  $_SESSION['userId'] , PDO::PARAM_STR);  
                                $stmt->execute(); 
                                $moneytransfer = $stmt->fetchAll(PDO::FETCH_OBJ); 
                                
                            
                                $amt = 0;
                                foreach($moneytransfer as $mpp)
                                        $amt += $mpp->amt;  
                                        
                               
							?>
							
							 <tr class="odd gradeX"> 
								<td> <a href="TdysTopUp.php?Tdate=<?php echo $lst;?>&Tdate1=<?php echo $lst1;?>"> Todays Topup</a>    </td>    
								<td> <?php echo $amt;?> </td>     
							</tr>  
							
							
							 
							
						 
							
						 
						</tbody>
					</table>
  				</div>
  			</div>



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

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