File: //home/jibhires/www/btndates_report.php
<?php
include('includes/checklogin.php');
check_login();
?>
<!DOCTYPE html>
<!-- /*!
* Author Name: MH RONY.
* GigHub Link: https://github.com/dev-mhrony
* Facebook Link:https://www.facebook.com/dev.mhrony
* Youtube Link: https://www.youtube.com/channel/UChYhUxkwDNialcxj-OFRcDw
for any PHP, Laravel, Python, Dart, Flutter work contact me at developer.mhrony@gmail.com
* Visit My Website : developerrony.com
*/ -->
<html lang="en">
<?php @include("includes/head.php");?>
<body>
<div class="container-scroller">
<!-- partial:../../partials/_navbar.html -->
<?php @include("includes/header.php");?>
<!-- partial -->
<div class="container-fluid page-body-wrapper">
<!-- partial:../../partials/_sidebar.html -->
<?php @include("includes/sidebar.php");?>
<!-- partial -->
<div class="main-panel">
<div class="content-wrapper">
<div class="row">
<div class="col-lg-12 grid-margin stretch-card">
<div class="card">
<div class="modal-header">
<h5 class="modal-title" style="float: left;">Between Dates Reports</h5>
</div>
<div class="col-md-12 mt-4">
<form class="forms-sample" method="post" enctype="multipart/form-data" class="form-horizontal">
<div class="row ">
<div class="form-group col-md-6 ">
<label for="exampleInputPassword1">From Date</label>
<input type="date" id="fromdate" name="fromdate" value="" class="form-control" required="">
</div>
<div class="form-group col-md-6">
<label for="exampleInputName1">To Date </label>
<input type="date" id="todate" name="todate" value="" class="form-control" required="">
</div>
</div>
<!-- /*!
* Author Name: MH RONY.
* GigHub Link: https://github.com/dev-mhrony
* Facebook Link:https://www.facebook.com/dev.mhrony
* Youtube Link: https://www.youtube.com/channel/UChYhUxkwDNialcxj-OFRcDw
for any PHP, Laravel, Python, Dart, Flutter work contact me at developer.mhrony@gmail.com
* Visit My Website : developerrony.com
*/ -->
<button type="submit" style="float: left;" name="search" id="submit" class="btn btn-primary btn-sm mb-4">Search</button>
</form>
</div>
</div>
</div>
<div class="col-lg-12 grid-margin stretch-card">
<div class="card">
<!-- start modal -->
<div id="editData5" class="modal fade">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">View Visitor details</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body" id="info_update5">
<?php @include("view_visitor_details.php");?>
</div>
<div class="modal-footer ">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
</div>
<!-- end modal -->
<?php
if(isset($_POST['search']) & !empty($_POST['fromdate']))
{
?>
<div class="table-responsive p-3">
<?php
$fdate=$_POST['fromdate'];
$tdate=$_POST['todate'];
?>
<h5 align="center" style="color:blue">Report from <?php echo $fdate?> to <?php echo $tdate?></h5>
<hr />
<table class="table align-items-center table-flush table-hover table-bordered" id="dataTableHover">
<thead>
<tr>
<th class="text-center">No</th>
<th>Full Name</th>
<th>Contact Number</th>
<th>Email</th>
<th>Reg Date</th>
<th class=" Text-center" style="width: 15%;">Action</th>
</tr>
</thead>
<!-- /*!
* Author Name: MH RONY.
* GigHub Link: https://github.com/dev-mhrony
* Facebook Link:https://www.facebook.com/dev.mhrony
* Youtube Link: https://www.youtube.com/channel/UChYhUxkwDNialcxj-OFRcDw
for any PHP, Laravel, Python, Dart, Flutter work contact me at developer.mhrony@gmail.com
* Visit My Website : developerrony.com
*/ -->
<tbody>
<?php
$sql="select * from tblvisitor where date(EnterDate) between '$fdate' and '$tdate'";
$query = $dbh -> prepare($sql);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($query->rowCount() > 0)
{
foreach($results as $row)
{
?>
<tr>
<td class="text-center"><?php echo htmlentities($cnt);?></td>
<td class=""><?php echo htmlentities($row->FullName);?></td>
<td class="text-center"><?php echo htmlentities($row->MobileNumber);?></td>
<td class="text-center"><?php echo htmlentities($row->Email);?></td>
<td class="text-center"><?php echo htmlentities(date("d-m-Y", strtotime($row->EnterDate)));?></td>
<td class=" text-center">
<a href="#" class=" edit_data5" id="<?php echo ($row->ID); ?>" title="click to view"> <i class="mdi mdi-eye" aria-hidden="true"></i></a>
</td>
</tr>
<?php
$cnt=$cnt+1;
}
} ?>
</tbody>
</table>
</div>
<?php
}else{
?>
<!-- /*!
* Author Name: MH RONY.
* GigHub Link: https://github.com/dev-mhrony
* Facebook Link:https://www.facebook.com/dev.mhrony
* Youtube Link: https://www.youtube.com/channel/UChYhUxkwDNialcxj-OFRcDw
for any PHP, Laravel, Python, Dart, Flutter work contact me at developer.mhrony@gmail.com
* Visit My Website : developerrony.com
*/ -->
<div class="table-responsive p-3">
<table class="table align-items-center table-flush table-hover table-bordered" id="dataTableHover">
<thead>
<tr>
<th class="text-center">No</th>
<th>Full Name</th>
<th>Contact Number</th>
<th>Email</th>
<th>Reg Date</th>
<th class=" Text-center" style="width: 15%;">Action</th>
</tr>
</thead>
<tbody>
<?php
$sql="SELECT *from tblvisitor ORDER BY id DESC";
$query = $dbh -> prepare($sql);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($query->rowCount() > 0)
{
foreach($results as $row)
{
?>
<tr>
<td class="text-center"><?php echo htmlentities($cnt);?></td>
<td class=""><?php echo htmlentities($row->FullName);?></td>
<td class="text-center"><?php echo htmlentities($row->MobileNumber);?></td>
<td class="text-center"><?php echo htmlentities($row->Email);?></td>
<td class="text-center"><?php echo htmlentities(date("d-m-Y", strtotime($row->EnterDate)));?></td>
<td class=" text-center">
<a href="#" class=" edit_data5" id="<?php echo ($row->ID); ?>" title="click to view"> <i class="mdi mdi-eye" aria-hidden="true"></i></a>
</td>
</tr>
<?php
$cnt=$cnt+1;
}
} ?>
</tbody>
</table>
</div>
<!-- /*!
* Author Name: MH RONY.
* GigHub Link: https://github.com/dev-mhrony
* Facebook Link:https://www.facebook.com/dev.mhrony
* Youtube Link: https://www.youtube.com/channel/UChYhUxkwDNialcxj-OFRcDw
for any PHP, Laravel, Python, Dart, Flutter work contact me at developer.mhrony@gmail.com
* Visit My Website : developerrony.com
*/ -->
<?php
} ?>
</div>
</div>
</div>
</div>
<!-- content-wrapper ends -->
<!-- partial:../../partials/_footer.html -->
<?php @include("includes/footer.php");?>
<!-- partial -->
</div>
<!-- main-panel ends -->
</div>
<!-- page-body-wrapper ends -->
<!-- /*!
* Author Name: MH RONY.
* GigHub Link: https://github.com/dev-mhrony
* Facebook Link:https://www.facebook.com/dev.mhrony
* Youtube Link: https://www.youtube.com/channel/UChYhUxkwDNialcxj-OFRcDw
for any PHP, Laravel, Python, Dart, Flutter work contact me at developer.mhrony@gmail.com
* Visit My Website : developerrony.com
*/ -->
</div>
<!-- container-scroller -->
<?php @include("includes/foot.php");?>
<!-- End custom js for this page -->
<script type="text/javascript">
$(document).ready(function(){
$(document).on('click','.edit_data5',function(){
var edit_id5=$(this).attr('id');
$.ajax({
url:"view_visitor_details.php",
type:"post",
data:{edit_id5:edit_id5},
success:function(data){
$("#info_update5").html(data);
$("#editData5").modal('show');
}
});
});
});
</script>
<!-- /*!
* Author Name: MH RONY.
* GigHub Link: https://github.com/dev-mhrony
* Facebook Link:https://www.facebook.com/dev.mhrony
* Youtube Link: https://www.youtube.com/channel/UChYhUxkwDNialcxj-OFRcDw
for any PHP, Laravel, Python, Dart, Flutter work contact me at developer.mhrony@gmail.com
* Visit My Website : developerrony.com
*/ -->
</body>
</html>