JezK
Edit File: dashboard.php
<?php include("app/checkSession.php"); include("app/adminObj.php"); if(!isset($_SESSION['user_id'])){ $customerObj->redirect('login.php'); } include("header.php"); $stock = $customerObj->db->get_row("SELECT SUM(item_quantity) as stock FROM uflexit_mini_goods_track WHERE user_id=".(int)$_SESSION['user_id']); $count = $customerObj->db->get_row("SELECT COUNT(*) as count FROM uflexit_invoice WHERE user_id=".(int)$_SESSION['user_id']); $shipment = $customerObj->db->get_row("SELECT COUNT(*) as count FROM uflexit_asn_request WHERE user_id=".(int)$_SESSION['user_id']); ?> <div class="container"> <div class="container my-3"> <div class="row px-md-4"> <div class="tophead col-md-4"> <h6>Dashboard</h6> </div> <div class="col-md-4"> </div> <!-- <div class="col-md-4"> <div class="input-group search-button mb-2" style="margin-right:10px;"> <input class="form-control border-right-0 border align-self-right border-rad-left" type="text" value="" id="myInput"> <span class="input-group-append"> <button class="btn btn-outline-secondary border-left-0 border border-rad-right" type="button"> <i class="fa fa-search"></i> </button> </span> </div> </div> --> </div> </div> <div class="container "> <div class="row px-md-4"> <div class="col-lg-4 col-sm-6 mb-2"> <div class="content"> <div class="row pt-4" id="your_stock"> <div class="col-sm-6 text-center"> <img src="images/Customer_croppings/YourStock.png"> </div> <div class="col-sm-6 text-center"> <p class="item_name">Total stock</p> <p class="stock_no mb-0"><?php if($stock) echo (int)$stock['stock']; else echo '0';?></p> </div> <div class="col-sm-12 text-md-left text-center"> <div class="col-sm-10 offset-sm-1 col-offset-sm-1 pl-md-0 mt-md-0 mt-3"> <p class="item_name mb-0">Your Stock</p> </div> </div> </div> <div class="row"> <div class="col-sm-3 offset-sm-9"><a href="yourstock.php" ><span class="view">view</span></a> </div> </div> </div> </div> <div class="col-lg-4 col-sm-6 mb-2"> <div class="content"> <div class="row pt-4" id="invoice"> <div class="col-sm-6 text-center"> <img src="images/Customer_croppings/YourInvoice.png"> </div> <div class="col-sm-6 text-center"> <p class="item_name">Total invoice</p> <p class="invoice_no mb-0"><?php if($count) echo (int)$count['count']; else echo '0';?></p> </div> <div class="col-sm-12 text-md-left text-center"> <div class="col-sm-10 offset-sm-1 col-offset-sm-1 pl-md-0 mt-md-0 mt-3"> <p class="item_name mb-0">Your Invoices</p> </div> </div> </div> <div class="row "> <div class="col-sm-3 offset-sm-9"><a href="invoice.php" ><span class="view">view</span></a></div> </div> </div> </div> <div class="col-lg-4 col-sm-6 mb-2"> <div class="content "> <div class="row pt-4" id="bookings"> <div class="col-sm-6 text-center"> <img src="images/Customer_croppings/YourShipmentstatus.png"> </div> <div class="col-sm-6 text-center"> <p class="item_name">Total bookings</p> <p class="shift_no mb-0"><?php if($shipment) echo (int)$shipment['count']; else echo '0';?></p> </div> <div class="col-sm-12 text-md-left text-center"> <div class="col-sm-10 offset-sm-1 col-offset-sm-1 pl-md-0 mt-md-0 mt-3"> <p class="item_name mb-0">Your Shipment status</p> </div> </div> </div> <div class="row "> <div class="col-sm-3 offset-sm-9"><a href="shipment.php" ><span class="view">view</span></a> </div> </div> </div> </div> </div> </div> <div id="table"> <div class="container " > <div class="table-responsive p-md-4 myquotation-table"> <table id="example" class="display bg-white tbl-border table-borderless" style="width:100%"> <thead> <tr> <th>Quotation ID</th> <th>Warehouse ID</th> <th>Warehouse Name</th> <th>Item Code</th> <th>Item Description</th> <th>Quantity</th> <th>Pallet No</th> <th>Status</th> </tr> </thead> </table> </div> </div> <div class="container position-relative"> <div class="row export_csv"> <div class="col-md-3 offset-md-9 "> <button id="export" class="btn btn-primary"><i class="fa fa-download"></i><span class="pl-2">EXPORT.CSV</span></button> </div> </div> </div> </div> <div id="table1"> <div class="container"> <div class="table-responsive p-md-4 "> <table id="example1" class="display bg-white tbl-border table-borderless" style="width:100%"> <thead> <tr> <th>Invoice No</th> <th>Quatation ID</th> <th>Customer</th> <th>Value</th> <th>Email</th> <th>Status</th> </tr> </thead> </table> </div> </div> <div class="container position-relative"> <div class="row export_csv"> <div class="col-md-3 offset-md-9 "> <button id="export" class="btn btn-primary"><i class="fa fa-upload"></i><span class="pl-2">EXPORT.CSV</span></button> </div> </div> </div> </div> <div id ="table2"> <div class="container " > <div class="table-responsive p-md-4 "> <table id="example2" class="display bg-white tbl-border table-borderless" style="width:100%"> <thead> <tr> <th>Warehouse Name </th> <th>Warehouse ID </th> <th>Request Type</th> <th>Customer Name</th> <th> Customer Type </th> <th>Value</th> <th> Date</th> <th>Time</th> <th>Status</th> </tr> </thead> </table> </div> </div> <div class="container position-relative"> <div class="row export_csv"> <div class="col-md-3 offset-md-9 "> <button id="export" class="btn btn-primary"><i class="fa fa-download"></i><span class="pl-2">EXPORT.CSV</span></button> </div> </div> </div> </div> </div> <!-- footer --> <?php include("footer.php"); ?> <!-- <script src="js/jquery.min.js"></script> --> <!-- <script src="js/jquery.pagination.min.js"></script> --> <!----> <script> let $ =jQuery; $(document).ready(function() { $('#example').DataTable({ language: { search: '', searchPlaceholder: "Search" }, "processing": true, "dataSrc": "", "sDom": 'Rfrtlip', "ajax": "yourstock.json", "columns": [ { "data": "Quatation ID" }, { "data": "Warehouse ID" }, { "data": "Warehouse Name" }, { "data": "Item Code" }, { "data": "Item Description" }, { "data": "Quantity" }, { "data": "Pallet No" }, { "data": "Status" } ] }); $('#example1').DataTable({ language: { search: '', searchPlaceholder: "Search" }, "processing": true, "dataSrc": "", "sDom": 'Rfrtlip', "ajax": "invoice.json", "columns": [ { "data": "Invoice No" }, { "data": "Quatation ID" }, { "data": "Customer" }, { "data": "Value" }, { "data": "Email" }, { "data": "Status" } ] }); $('#example2').DataTable({ language: { search: '', searchPlaceholder: "Search" }, "processing": true, "dataSrc": "", "sDom": 'Rfrtlip', "ajax": "shipment.json", "columns": [ { "data": "Warehouse Name" }, { "data": "Warehouse ID" }, { "data": "Request Type" }, { "data": "Customer Name" }, { "data": "Customer Type" }, { "data": "Value" }, { "data": "Date" }, { "data":"Time" }, { "data": "Status" } ] }); }); $(document).ready(function(){ $("#table1,#table2").hide(); $("#your_stock,#invoice,#bookings").on("click",function(){ // alert("hello") $("#table,#table1,#table2").hide(); if($(this).attr('id')=='your_stock'){ $("#table").show(); } else if($(this).attr('id')=='invoice'){ $('#table1').show(); } else{ $("#table2").show(); } }) }); </script>