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

<script>
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> Dashboard <?php echo $_REQUEST['date'];?> </h3></div>
					
					<!--div align="right">  <input type="button"    class="btn btn-warning" name="btnback" id="btnback" value=" Add New User " onClick="javascript:location.href='#';" />
					</div-->
					
				</div>
				
  				<div class="panel-body">
  					<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="example">
						<thead>
							<tr> 
								<th>Today Joining</th>  	   
								<th>Today Activation</th> 
								<th>Total Business</th> 
								<th>Income Wallet</th> 
								<th>Withdraw Amount</th>  
								<th>Total User</th>  
								<th>Active User</th>  
								<th>Non Active User</th>  
							</tr>
						</thead>
						<tbody>
						    
						    <?php  
						     
						        $date = date("d-m-Y", strtotime($_REQUEST['date'])); 
                                $stmt=$conn->prepare("select  RegOn  from  UI__Rgst  where RegOn=:RegOn ");  
                                $stmt->bindValue(':RegOn', $date , PDO::PARAM_STR);
                                $stmt->execute(); 
                                //$AllUsers = $stmt->fetchAll(PDO::FETCH_OBJ); 
                                $RegOn = $stmt->rowCount(); 
                                
                                
                                $dm = $_REQUEST['date']; 
                                $stmt=$conn->prepare("select   amt  from  UI__DChstr  where  typ=1 and  Tdate  like '%$dm%'  ");   
                                $stmt->execute();  
                                $UI__DChstr = $stmt->rowCount(); 
                                
                                if($UI__DChstr>0)
                                {
                                    $AllUsersUI__DChstr = $stmt->fetchAll(PDO::FETCH_OBJ);     
                                    foreach($AllUsersUI__DChstr as $dmmt)
                                    {
                                                $Tbusiness +=$dmmt->amt;
                                    } 
                                }
                                
                                $stmt=$conn->prepare("select  id  from  UI__Rgst    ");    
                                $stmt->execute(); 
                                //$AllUsers = $stmt->fetchAll(PDO::FETCH_OBJ); 
                                $TotaslUser = $stmt->rowCount();
                                
                                $stmt=$conn->prepare("select  id  from   UI__DChstr where typ=1    ");    
                                $stmt->execute(); 
                                //$AllUsers = $stmt->fetchAll(PDO::FETCH_OBJ); 
                                $UI__DChstrActive = $stmt->rowCount();
                                
						    ?>
							 
							<tr class="odd gradeX"> 
								<td><?php echo $RegOn;?></td> 
								<td><?php echo $UI__DChstr;?></td> 
								<td><?php echo $Tbusiness;?></td>  
								<td></td>
								<td></td>
								<td><?php echo $TotaslUser;?></td>
								<td><?php echo $UI__DChstrActive;?></td>
								<td><?php echo ($TotaslUser-$UI__DChstrActive);?></td>
								
							</tr>  
						 
						</tbody>
					</table>
  				</div>
  			</div>



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

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