D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home3
/
encodto1
/
salvation.incrediblebengal.com
/
admin
/
Filename :
sales-summary.php
back
Copy
<?php include'config.php'; include'get_session_access.php'; $page_title = "Sales Report"; ?> <!DOCTYPE html> <html lang="en"> <head> <title>Encode Restaurent - Admin Dashboard </title> <?php include'style.php'; ?> </head> <body> <div id="main-wrapper"> <?php include'header.php'; ?> <?php include'sidebar.php'; ?> <!--********************************** Content body start ***********************************--> <div class="content-body"> <!-- row --> <div class="container-fluid"> <div class="row"> <div class="col-xl-12"> <div class="inventory_div"> <ul class="nav nav-tabs mb-3"> <li><a data-toggle="tab" href="#dineSales">Dine_In Sales</a></li> <li><a data-toggle="tab" href="#takeAwaySales">Take Away Sales</a></li> </ul> <div class="tab-content"> <div id="dineSales" class="tab-pane fade"> <div class="row"> <div class="col-lg-7 col-md-7 col-sm-8 col-xs-12"> <form action="" method="GET" class="input_daterange"> <div class="clearfix"></div> <div class="row"> <div class="col-lg-4 col-sm-6 col-xs-12 pr-1"> <input type="text" name="strt_date" id="strt_date" class="form-control" onfocus="(this.type='date')" onblur="(this.type='text')" placeholder="Start Date*"> </div> <div class="col-lg-4 col-sm-6 col-xs-12 pl-1 pr-1"> <input type="text" name="end_date" id="end_date" class="form-control" onfocus="(this.type='date')" onblur="(this.type='text')" placeholder="End Date*"> </div> <div class="col-md-3 pl-1"> <input type="submit" name="search" id="search" value="Search" class="btn btn-info py-2" /> </div> </div> </form> </div> <div class="col-lg-5 col-md-5 col-sm-4 col-xs-12"> <button class="btn btn-warning" id="exl_download">Export 2 Excel</button> </div> </div> <div class="table-responsive"> <table id="example4" class="display dineSale_sheet" style="min-width: 845px"> <thead> <tr class="bg-primary text-white"> <th class=" py-2 px-3 fs-14 font-w400">S No</th> <th class=" py-2 px-3 fs-14 font-w400">Order Id</th> <th class=" py-2 px-3 fs-14 font-w400">Customer Phone</th> <th class=" py-2 px-3 fs-14 font-w400">Total Payment</th> <th class=" py-2 px-3 fs-14 font-w400">Order_date</th> </tr> </thead> <tbody> <?php if (isset($_GET['strt_date']) && isset($_GET['end_date'])) { $strt_date = $_GET['strt_date']; $end_date = $_GET['end_date']; $view_order = "SELECT order_id, DATE(order_date) AS o_date, customer_phone, total_payment FROM dinein_order WHERE DATE(order_date) BETWEEN '$strt_date' AND '$end_date' ORDER BY DATE(order_date) DESC"; $run_order = mysqli_query($conn, $view_order) or die($conn); if(mysqli_num_rows($run_order) > 0){ $sn = 0; foreach ($run_order as $row) { $order_id = $row['order_id']; $order_date = $row['o_date']; $customer_phone = $row['customer_phone']; $total_payment = $row['total_payment']; $sn++; echo "<tr> <td>".$sn.".</td> <td>0".$order_id."</td> <td>".$customer_phone."</td> <td>".$total_payment."</td> <td>".$order_date."</td> </tr>"; } } else{ echo "<tr colspan='4' class='bg-dark text-white w-100'> <td class='py-2 px-3 fs-14 font-w400'>No Record Found.</td> </tr>"; } } else{ $show_tk_order = "SELECT * FROM dinein_order ORDER BY DATE(order_date) DESC"; $run_tk_order = mysqli_query($conn, $show_tk_order); if($run_tk_order-> num_rows > 0){ $ru = 0; while($res = mysqli_fetch_assoc($run_tk_order)) { $tk_id = $res['order_id']; $tk_date = $res['order_date']; $tk_phone = $res['customer_phone']; $tk_payment = $res['total_payment']; $ru++; echo "<tr> <td>".$ru."</td> <td>".$tk_id.".</td> <td>".$tk_phone."</td> <td><i class='fa fa-inr'></i>".$tk_payment."</td> <td>".$tk_date."</td> </tr>"; } } } ?> </tbody> </table> </div> </div> <div id="takeAwaySales" class="tab-pane fade"> <div class="row"> <div class="col-lg-7 col-md-7 col-sm-8 col-xs-12"> <form action="" method="GET" class="input_daterange"> <div class="clearfix"></div> <div class="row"> <div class="col-lg-4 col-sm-6 col-xs-12 pr-1"> <input type="text" name="from_date" id="from_date" class="form-control" onfocus="(this.type='date')" onblur="(this.type='text')" placeholder="Start Date*"> </div> <div class="col-lg-4 col-sm-6 col-xs-12 pl-1 pr-1"> <input type="text" name="to_date" id="to_date" class="form-control" onfocus="(this.type='date')" onblur="(this.type='text')" placeholder="End Date*"> </div> <div class="col-md-3 pl-1"> <input type="submit" name="search1" id="search1" value="Search" class="btn btn-info py-2" /> </div> </div> </form> </div> <div class="col-lg-5 col-md-5 col-sm-4 col-xs-12"> <button class="btn btn-warning" id="takeAwaySale_download">Export 2 Excel</button> </div> </div> <div class="table-responsive"> <table class="example4 display takeAwaySale_sheet" style="min-width: 845px"> <thead> <tr class="bg-primary text-white"> <th class=" py-2 px-3 fs-14 font-w400">S No</th> <th class=" py-2 px-3 fs-14 font-w400">Order Id</th> <th class=" py-2 px-3 fs-14 font-w400">Customer Phone</th> <th class=" py-2 px-3 fs-14 font-w400">Total Payment</th> <th class=" py-2 px-3 fs-14 font-w400">Order_date</th> </tr> </thead> <tbody> <?php if (isset($_GET['from_date']) && isset($_GET['to_date'])) { $frm_date = $_GET['from_date']; $to_date = $_GET['to_date']; $view_date_tkorder = "SELECT order_id, DATE(order_date) AS o_date, customer_phone, total_payment FROM delivery_order WHERE DATE(order_date) BETWEEN '$frm_date' AND '$to_date' ORDER BY DATE(order_date) DESC"; $run_date_tkorder = mysqli_query($conn, $view_date_tkorder) or die($conn); if(mysqli_num_rows($run_date_tkorder) > 0){ $tn = 0; foreach ($run_date_tkorder as $rec) { $tk_id = $rec['order_id']; $tk_date = $rec['o_date']; $tk_phone = $rec['customer_phone']; $tk_payment = $rec['total_payment']; $tn++; echo "<tr> <td>".$tn.".</td> <td>0".$tk_id."</td> <td>".$tk_phone."</td> <td><i class='fa fa-inr'></i>".$tk_payment."</td> <td>".$tk_date."</td> </tr>"; } } else{ echo "<tr colspan='4' class='bg-dark text-white w-100'> <td class='py-2 px-3 fs-14 font-w400'>No Record Found.</td> </tr>"; } } else{ $show_tk_order = "SELECT * FROM delivery_order ORDER BY DATE(order_date) DESC"; $run_tk_order = mysqli_query($conn, $show_tk_order); if($run_tk_order-> num_rows > 0){ $ru = 0; while($res = mysqli_fetch_assoc($run_tk_order)) { $tk_id = $res['order_id']; $tk_date = $res['order_date']; $tk_phone = $res['customer_phone']; $tk_payment = $res['total_payment']; $ru++; echo "<tr> <td>".$ru."</td> <td>".$tk_id.".</td> <td>".$tk_phone."</td> <td><i class='fa fa-inr'></i>".$tk_payment."</td> <td>".$tk_date."</td> </tr>"; } } } ?> </tbody> </table> </div> </div> </div> </div> </div> </div> </div> </div> <!--********************************** Content body end ***********************************--> <?php include'footer.php'; ?> <script src="js/jquery.table2excel.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('.inventory_div ul.nav-tabs li:first').addClass('active'); $('.inventory_div .tab-content div.tab-pane:first').addClass('in active show'); $('.inventory_div ul.nav-tabs li a').click(function (ek) { $('.inventory_div ul.nav-tabs li').removeClass('active'); $(ek.currentTarget).parent('li').addClass('active'); }); $("#exl_download").click(function(){ $(".dineSale_sheet").table2excel({ name:"Sales Worksheet", filename:"DineIn Sales_Sheet.xls" }); }); $("#takeAwaySale_download").click(function(){ $(".takeAwaySale_sheet").table2excel({ name:"Sales Worksheet", filename:"Take Away Sales_Sheet.xls" }); }); }); </script> </body> </html>