<?php 
include ('../ro_head.php'); 
include("methodlist.php");
?>


<link href="../assets/admin/layout/css/custom.css" rel="stylesheet" type="text/css"/>
<link href="../assets/css/daterangepicker.css" rel="stylesheet" type="text/css"/>
<!-- END THEME STYLES -->

<!-- END PAGE LEVEL STYLES -->

<!-- BEGIN CONTAINER -->
<div class="page-container">
<?php include_once("../ro_sidebar.php"); ?>
    <!-- BEGIN CONTENT -->
	<div class="page-content-wrapper">
		<div class="page-content">
			<!-- BEGIN SAMPLE PORTLET CONFIGURATION MODAL FORM-->
			<div class="modal fade" id="portlet-config" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
				<div class="modal-dialog">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
							<h4 class="modal-title">Modal title</h4>
						</div>
						<div class="modal-body">
							 Widget settings form goes here
						</div>
						<div class="modal-footer">
							<button type="button" class="btn blue">Save changes</button>
							<button type="button" class="btn default" data-dismiss="modal">Close</button>
						</div>
					</div>
					<!-- /.modal-content -->
				</div>
				<!-- /.modal-dialog -->
			</div>
			<!-- /.modal -->
			<!-- END SAMPLE PORTLET CONFIGURATION MODAL FORM-->
			<?php //include_once("ro_style_customizer.php"); ?>
			<!-- BEGIN PAGE HEADER-->
			<h3 class="page-title">
			Dashboard <small>reports & statistics</small>
			</h3>
			<!-- END PAGE HEADER-->
			<!-- BEGIN DASHBOARD STATS -->
			<div class="row">
				<div class="col-lg-4 col-md-3 col-sm-6 col-xs-12">
					<div class="dashboard-stat blue-madison">
						<div class="visual">
							<i class="fa fa-comments"></i>
						</div>
						<div class="details">
							<div class="number">
								 
								<?php
							//include('../db_con.php');

							//$sql = "select SUM(total_price) from customer_order where odate >= DATE_SUB(CURDATE(), INTERVAL 7 DAY)";
							$sql = "select SUM(total_fee) from applicant_table where DATE(created_date) = CURDATE() and `pstatus` =1";

							//$sql = "select SUM(total_fee) from applicant_table where created_date >= DATE_SUB(CURDATE(), INTERVAL 1 DAY) and `pstatus` =1";
							//$sql = "select * from applicant_table WHERE DATE(created_date) >= CURDATE() AND DATE(created_date) < CURDATE() + INTERVAL 1 DAY";

							//var_dump($sql) or die();
							//$sql = "select qc_name from qcareer";


						$res=mysqli_query($con,$sql);

					//	echo $result = mysql_result($res, 0).' (BDT)'; 
						
						

							?>

							

							</div>
							<div class="desc">
								Today Payment Recieved
							</div>
						</div>
						<a class="more" href="verification_reciept.php">
						View more <i class="m-icon-swapright m-icon-white"></i>
						</a>
					</div>
				</div>
				<div class="col-lg-4 col-md-3 col-sm-6 col-xs-12">
					<div class="dashboard-stat green-haze">
						<div class="visual">
							<i class="fa fa-bar-chart-o"></i>
						</div>
						<div class="details">
							<div class="number">

							<?php							

							$dt = new DateTime();
							$today=$dt->format('Y-m-d');
							
							$sql = "SELECT * FROM `applicant_table` where parent=0 AND DATE(created_date)='$today'";

							 $resutl= mysqli_query($con,$sql);

							 echo $crow = mysqli_num_rows($resutl); 
							  //echo $sql;
							?>						

								 
							</div>
							<div class="desc">
								 Today New Application
							</div>
						</div>
						<a class="more" href="application.php">
						View more <i class="m-icon-swapright m-icon-white"></i>
						</a>
					</div>
				</div>
				<div class="col-lg-4 col-md-3 col-sm-6 col-xs-12">
					<div class="dashboard-stat red-intense">
						<div class="visual">
							<i class="fa fa-shopping-cart"></i>
						</div>
						<div class="details">
							<div class="number">
							<?php								 

							 $sql = "SELECT * FROM `applicant_table` where `pstatus` =0";

							 $resutl= mysqli_query($con,$sql);

							 // var_dump($sql) or die();

							 echo $crow = mysqli_num_rows($resutl); 
							
							?>
							
							</div>
							<div class="desc">
								 Total Payment Pending Application
							</div>
						</div>
						<a class="more" href="application.php">
						View more <i class="m-icon-swapright m-icon-white"></i>
						</a>
					</div>
				</div>
				
			</div>

			<div class="row">
				<div class="col-md-12 col-sm-12">
					<div class="portlet light ">
						<div class="portlet-title">
							<div class="caption">
								<i class="icon-share font-blue-steel hide"></i>
								<span class="caption-subject font-blue-steel bold uppercase">Recent Activities</span>
							</div>
						</div>
						<div class="portlet-body">
							<div class="scroller" style="height: 350px;" data-always-visible="1" data-rail-visible="0">
								<ul class="feeds">
								<?php
								
			   					$hisrs = mysqli_query($con,"select * from app_his_table order by vh_datetime DESC limit 30");
			   					//echo "hello".mysqli_num_rows($hisrs);
                                 while($hisrow=mysqli_fetch_array($hisrs)){ 
                                 		
                                  		$name=get_session_user_name($hisrow["user_id"],$con);
//                                        echo "<li>".$hisrow["vh_datetime"]." : ".$hisrow["vh_notes"]." ".$name."</li>";                                        

                                          ?>
                                    <li>
										<div class="col1">
											<div class="cont">
												<div class="cont-col1">
													<div class="label label-sm label-info">
														<i class="fa fa-check"></i>
													</div>
												</div>
												<div class="cont-col2">
													<div class="desc">
														 <?php echo "<a href='applicationupdate.php?appid=".$hisrow["app_id"]."'>".$hisrow["vh_datetime"]."</a> : ".$hisrow["vh_notes"]." ".$name; ?> 
													</div>
												</div>
											</div>
										</div>										
									</li>
									<?php } ?>
																		
								</ul>
							</div>							
						</div>
					</div>
				</div>
			</div>	
			<!-- END DASHBOARD STATS -->
			
	<!-- END CONTENT -->
	
</div>
<!-- END CONTAINER -->
<!-- BEGIN FOOTER -->
<?php include_once("../ro_footer.php"); ?>

<!-- END FOOTER -->
<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
<?php include_once("../ro_js.php"); ?>

<script type="text/javascript" src="../assets/global/plugins/select2/select2.min.js"></script>
<script type="text/javascript" src="../assets/global/plugins/datatables/media/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="../assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.js"></script>
<script>
jQuery(document).ready(function() {       
   Metronic.init(); // init metronic core components
Layout.init(); // init current layout
QuickSidebar.init(); // init quick sidebar
Demo.init(); // init demo features
  // TableManaged.init();
});
</script>
<!-- END JAVASCRIPTS -->
</body>
<!-- END BODY -->
</html>