File manager - Edit - /home/custbahd/irungikitchen.com/admin/analytics/sales/index.php
Back
<?php session_start(); include_once "../../counter/db/config.php"; include '../../db/saucerer.php'; // Define variables and initialize with empty values $id = $user_id = $name = $email = $phone = $role = $priviledges = $password = $confirm_password = $image = $cover_image = $token = $access = ""; $id_err = $user_id_err = $name_err = $email_err = $phone_err = $role_err = $priviledges_err = $password_err = $confirm_password_err = $image_err = $cover_image_err = $token_err = $access_err = ""; // Check if the user is logged in, if not then redirect him to login page if(!isset($_SESSION["loggedin"]) || $_SESSION["loggedin"] != true){ $loggedin = ""; header("location: ../../secure/?page=analytics/sales"); exit; } elseif(!isset($_SESSION["loggedin"]) || $_SESSION["loggedin"] == true){ $loggedin = $_SESSION['loggedin']; $id = $_SESSION['id']; $token = $_SESSION['token']; // of college_data table $sql = "SELECT * FROM secure WHERE token='$token'"; $result = $conn->query($sql); // Display data on web page while($row = mysqli_fetch_array($result)) { $id = $row['id']; $name = $row['name']; $token = $row['token']; } } // Clients Count From Checkout $sql = "SELECT COUNT(DISTINCT email), SUM(quantity) FROM checkout"; $result = $conn->query($sql); while($row = mysqli_fetch_array($result)) { $clients_count = $row['COUNT(DISTINCT email)']; $quantity_count = $row['SUM(quantity)']; } // Clients Count From Checkout $sql = "SELECT COUNT(email) FROM clients"; $result = $conn->query($sql); while($row = mysqli_fetch_array($result)) { $clients_count_one = $row['COUNT(email)']; } // Generating a random number date_default_timezone_set('Africa/Kampala'); $today = date("His-dmY",time()); $today_day = date("D",time()); $today_month = date("M",time()); $next_month = date("M", strtotime($today_month . "+1 months")); $this_month = date("m",time()); $last_month = date("m",time())-1; $today_year = date("Y",time()); $last_year = date("Y",time())-1; $code1 = rand(1,9); $code2 = rand(1,9); $code3 = $code1 * $code2; $tokens = "$code3-$today"; ?> <?php //Comparisons //This Month $sql = "SELECT name, month, image, SUM(subtotal), SUM(quantity), COUNT(email), COUNT(DISTINCT email) FROM checkout WHERE MONTH(timestamp)='$this_month' AND year='$today_year' GROUP BY month"; $result = $conn->query($sql); //display data on web page if($row = mysqli_fetch_array($result)){ $this_name = $row["month"]; $this_sales = $row["SUM(quantity)"]; $this_orders = $row["COUNT(email)"]; $this_clients = $row["COUNT(DISTINCT email)"]; $this_income = $row["SUM(subtotal)"]; } else { $this_name = $today_month; $this_sales = 0; $this_orders = 0; $this_clients = 0; $this_income = 0; } //Last Month $sql = "SELECT name, month, image, SUM(subtotal), SUM(quantity), COUNT(email), COUNT(DISTINCT email) FROM checkout WHERE MONTH(timestamp)='$last_month' AND year='$today_year' GROUP BY month"; $result = $conn->query($sql); //display data on web page if($row = mysqli_fetch_array($result)){ $last_name = $row["month"]; $last_sales = $row["SUM(quantity)"]; $last_orders = $row["COUNT(email)"]; $last_clients = $row["COUNT(DISTINCT email)"]; $last_income = $row["SUM(subtotal)"]; } else { $last_name = "Last Month"; $last_sales = 0; $last_orders = 0; $last_clients = 0; $last_income = 0; } //This Year $sql = "SELECT name, month, year, image, SUM(subtotal), SUM(quantity), COUNT(email), COUNT(DISTINCT email) FROM checkout WHERE year='$today_year' GROUP BY year"; $result = $conn->query($sql); //display data on web page if($row = mysqli_fetch_array($result)){ $this_year_name = $row["year"]; $this_year_sales = $row["SUM(quantity)"]; $this_year_orders = $row["COUNT(email)"]; $this_year_clients = $row["COUNT(DISTINCT email)"]; $this_year_income = $row["SUM(subtotal)"]; } else { $this_year_name = $today_year; $this_year_sales = 0; $this_year_orders = 0; $this_year_clients = 0; $this_year_income = 0; } //Last Year $sql = "SELECT name, month, year, image, SUM(subtotal), SUM(quantity), COUNT(email), COUNT(DISTINCT email) FROM checkout WHERE year='$last_year' GROUP BY year"; $result = $conn->query($sql); //display data on web page if($row = mysqli_fetch_array($result)){ $last_year_name = $row["year"]; $last_year_sales = $row["SUM(quantity)"]; $last_year_orders = $row["COUNT(email)"]; $last_year_clients = $row["COUNT(DISTINCT email)"]; $last_year_income = $row["SUM(subtotal)"]; } else { $last_year_name = "Last Year"; $last_year_sales = 0; $last_year_orders = 0; $last_year_clients = 0; $last_year_income = 0; } //Analytics //Sales $sales_count = $this_sales + $last_sales; $sales_one = $this_sales / $sales_count; $sales_two = $sales_one * 100; $sales_ptg = round($sales_two, 0); $last_count = $this_sales + $last_sales; $last_one = $last_sales / $sales_count; $last_two = $last_one * 100; $last_ptg = round($last_two, 0); //Monthly Income $income_count = $this_income + $last_income; $income_one = $this_income / $income_count; $income_two = $income_one * 100; $income_ptg = round($income_two, 0); //Annual Income $income_year_count = $this_year_income + $last_year_income; $income_year_one = $this_year_income / $income_year_count; $income_year_two = $income_year_one * 100; $income_year_ptg = round($income_year_two, 0); ?> <?php $db_handle = new DBController(); if(!empty($_GET["action"])) { switch($_GET["action"]) { case "add": if(!empty($_POST["quantity"])) { $productByCode = $db_handle->runQuery("SELECT * FROM shop WHERE id='" . $_GET["id"] . "'"); $itemArray = array($productByCode[0]["id"]=>array('name'=>$productByCode[0]["name"], 'id'=>$productByCode[0]["id"], 'quantity'=>$_POST["quantity"], 'cat'=>$productByCode[0]["cat"], 'type'=>$productByCode[0]["type"], 'price'=>$productByCode[0]["price"], 'image'=>$productByCode[0]["image"])); if(!empty($_SESSION["cart_item"])) { if(in_array($productByCode[0]["id"],array_keys($_SESSION["cart_item"]))) { foreach($_SESSION["cart_item"] as $k => $v) { if($productByCode[0]["id"] == $k) { if(empty($_SESSION["cart_item"][$k]["quantity"])) { $_SESSION["cart_item"][$k]["quantity"] = 0; } $_SESSION["cart_item"][$k]["quantity"] += $_POST["quantity"]; } } } else { $_SESSION["cart_item"] = array_merge($_SESSION["cart_item"],$itemArray); } } else { $_SESSION["cart_item"] = $itemArray; } } break; case "remove": if(!empty($_SESSION["cart_item"])) { foreach($_SESSION["cart_item"] as $k => $v) { if($_GET["id"] == $k) unset($_SESSION["cart_item"][$k]); if(empty($_SESSION["cart_item"])) unset($_SESSION["cart_item"]); } } break; case "empty": unset($_SESSION["cart_item"]); break; } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width,initial-scale=1"> <title>Admin | Irungi Kitchen</title> <!-- Favicon --> <link rel="shortcut icon" href="../../../../img/fav-icon.png"> <link rel="apple-touch-icon" href="../../../../img/apple-touch-icon.png"> <link rel="stylesheet" href="../../vendor/chartist/css/chartist.min.css"> <link href="../../vendor/bootstrap-select/dist/css/bootstrap-select.min.css" rel="stylesheet"> <link href="../../vendor/owl-carousel/owl.carousel.css" rel="stylesheet"> <link href="../../css/style.css" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800;900&family=Roboto:wght@100;300;400;500;700;900&display=swap" rel="stylesheet"> <!--Fontawesome 6--> <link href="../../css/fontawesome/css/all.css" rel="stylesheet"> <!--Animations--> <link rel="stylesheet" href="../../css/animations/style.css"> <link rel="stylesheet" href="../../css/animations/letter/style.css"> <!-- Chat App --> <link rel="stylesheet" href="../../chat/css/style.css"> <!-- Daterange picker --> <link href="../../vendor/bootstrap-daterangepicker/daterangepicker.css" rel="stylesheet"> <!-- Clockpicker --> <link href="../../vendor/clockpicker/css/bootstrap-clockpicker.min.css" rel="stylesheet"> <!-- asColorpicker --> <link href="../../vendor/jquery-asColorPicker/css/asColorPicker.min.css" rel="stylesheet"> <!-- Material color picker --> <link href="../../vendor/bootstrap-material-datetimepicker/css/bootstrap-material-datetimepicker.css" rel="stylesheet"> <!-- Pick date --> <link rel="stylesheet" href="../../vendor/pickadate/themes/default.css"> <link rel="stylesheet" href="../../vendor/pickadate/themes/default.date.css"> <!-- Custom Stylesheet --> <link href="../../vendor/bootstrap-select/dist/css/bootstrap-select.min.css" rel="stylesheet"> <link href="../../vendor/dropzone/dist/dropzone.css" rel="stylesheet"> </head> <body> <!--******************* Preloader start ********************--> <div id="preloader"> <div class="sk-three-bounce"> <div class="sk-child sk-bounce1"></div> <div class="sk-child sk-bounce2"></div> <div class="sk-child sk-bounce3"></div> </div> </div> <!--******************* Preloader end ********************--> <!--********************************** Main wrapper start ***********************************--> <div id="main-wrapper"> <!--********************************** Nav header start ***********************************--> <div class="nav-header"> <a href="../../" class="brand-logo"> <img class="logo-abbr" src="../../../img/irungi-potrait-1.png" alt="Irungi Kitchen Logo"> </a> <div class="nav-control"> <div class="hamburger"> <span class="line"></span><span class="line"></span><span class="line"></span> </div> </div> </div> <!--********************************** Nav header end ***********************************--> <!--********************************** Chat box start ***********************************--> <div class="chatbox"> <div class="chatbox-close"></div> <div class="custom-tab-1"> <ul class="nav nav-tabs"> <li class="nav-item"> <a class="nav-link" data-toggle="tab" href="#notes">Notes</a> </li> <li class="nav-item"> <a class="nav-link active" data-toggle="tab" href="#alerts">Alerts</a> </li> <li class="nav-item"> <a class="nav-link" data-toggle="tab" href="#chat">Chat</a> </li> </ul> <div class="tab-content"> <div class="tab-pane fade" id="chat" role="tabpanel"> <div class="card mb-sm-3 mb-md-0 contacts_card dz-chat-user-box"> <div class="card-header chat-list-header text-center"> <a href="javascript:void(0)"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="18px" height="18px" viewBox="0 0 24 24" version="1.1"><g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><rect fill="#000000" x="4" y="11" width="16" height="2" rx="1"/><rect fill="#000000" opacity="0.3" transform="translate(12.000000, 12.000000) rotate(-270.000000) translate(-12.000000, -12.000000) " x="4" y="11" width="16" height="2" rx="1"/></g></svg></a> <div> <h6 class="mb-1">Chat List</h6> <p class="mb-0">Show All</p> </div> <a href="javascript:void(0)"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="18px" height="18px" viewBox="0 0 24 24" version="1.1"><g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><rect x="0" y="0" width="24" height="24"/><circle fill="#000000" cx="5" cy="12" r="2"/><circle fill="#000000" cx="12" cy="12" r="2"/><circle fill="#000000" cx="19" cy="12" r="2"/></g></svg></a> </div> <div class="card-body contacts_body p-0 dz-scroll " id="DZ_W_Contacts_Body"> <ul class="contacts"> <li class="name-first-letter">A</li> <?php $sql = "SELECT * FROM contact GROUP BY email ORDER BY id DESC"; //use for MySQLi-OOP $query = $conn->query($sql); while($row = $query->fetch_assoc()){ date_default_timezone_set('Africa/Kampala'); $start_count = date("Y-m-d H:i:s", strtotime($row['timestamp'] . "+1 days")); $today = date("Y-m-d H:i:s",time()); $start_diff = new DateTimeImmutable($row['timestamp']); $endd_diff = new DateTimeImmutable($today); $duration = $start_diff->diff($endd_diff); $today_diff = new DateTimeImmutable($today); $days_diff = $today_diff->diff($start_diff); echo '<li class="dz-chat-user">'; echo '<div class="d-flex bd-highlight">'; echo '<div class="img_cont">'; echo '<i class="fa fa-user"></i>'; echo '<span class="online_icon"></span>'; echo '</div>'; echo '<div class="user_info">'; echo '<span class="fs-12 mb-0">'.$row["name"].'</span>'; echo '<p class="fs-12 mb-0">'; echo ''.$row["message"].''; echo '</p>'; echo '<p class="fs-10 mb-0">'; if ($days_diff->format('%s')<30 & $days_diff->format('%i')==0 & $days_diff->format('%h')==0 & $days_diff->format('%d')==0 & $days_diff->format('%m')==0 & $days_diff->format('%y')==0) { echo "Just Now"; } elseif ($days_diff->format('%i')>=0 & $days_diff->format('%h')>=0 & $days_diff->format('%d')>=0 & $days_diff->format('%m')>=0 & $days_diff->format('%y')==1) { echo "".date("D, jS M", strtotime($row['timestamp'])).""; } elseif ($days_diff->format('%i')>=0 & $days_diff->format('%h')>=0 & $days_diff->format('%d')>=0 & $days_diff->format('%m')>=0 & $days_diff->format('%y')>=1) { echo "".$days_diff->format("%y years")." ago - ".date("D, jS M", strtotime($row['timestamp'])).""; } elseif ($days_diff->format('%s')>30 & $days_diff->format('%i')==0 & $days_diff->format('%h')==0 & $days_diff->format('%d')==0) { echo "".$days_diff->format("%s seconds")." ago"; } elseif ($days_diff->format('%i')==1 & $days_diff->format('%h')==0 & $days_diff->format('%d')==0) { echo "".$days_diff->format("%i minute")." ago"; } elseif ($days_diff->format('%i')>=0 & $days_diff->format('%h')==0 & $days_diff->format('%d')==0) { echo "".$days_diff->format("%i minutes")." ago"; } elseif ($days_diff->format('%h')==1 & $days_diff->format('%d')==0 & $days_diff->format('%m')==0) { echo "".$days_diff->format("%h hour")." ago"; } elseif ($days_diff->format('%h')>=0 & $days_diff->format('%d')==0 & $days_diff->format('%m')==0) { echo "".$days_diff->format("%h hours")." ago"; } elseif ($days_diff->format('%d')==1) { echo "Yesterday - ".date("h:ia", strtotime($row['timestamp'])).""; } elseif ($days_diff->format('%m')==0) { echo "".date("jS M, Y", strtotime($row['timestamp'])).""; } elseif ($days_diff->format('%m')==1) { echo "".date("jS M, Y", strtotime($row['timestamp'])).""; } elseif ($days_diff->format('%m')>=1) { echo "".date("jS M, Y", strtotime($row['timestamp'])).""; } echo '</p>'; echo '</div>'; echo '</div>'; echo '</li>'; } ?> </ul> </div> </div> <!--Chat History Start--> <?php include('../../modals/chat.php'); ?> <!--Chat History End--> </div> <div class="tab-pane fade active show" id="alerts" role="tabpanel"> <div class="card mb-sm-3 mb-md-0 contacts_card"> <div class="card-header chat-list-header text-center"> <a href="notifications/server" target="_blank"><i class="fa fa-shield"></i></a> <div> <h6 class="mb-1">Security</h6> </div> <a href="notifications/server" target="_blank"><i class="fa fa-caret-right"></i></a> </div> <div class="card-body contacts_body p-0 dz-scroll" id="DZ_W_Contacts_Body1"> <ul class="contacts"> <li class="name-first-letter">SERVER</li> <!--Notes Start--> <?php $sql = "SELECT * FROM secure WHERE handler='Admin' ORDER BY id DESC"; $result = $conn->query($sql); //display data on web page while($row = mysqli_fetch_array($result)){ date_default_timezone_set('Africa/Kampala'); $start_count = date("Y-m-d H:i:s", strtotime($row['timestamp'] . "+1 days")); $today = date("Y-m-d H:i:s",time()); $start_diff = new DateTimeImmutable($row['timestamp']); $endd_diff = new DateTimeImmutable($today); $duration = $start_diff->diff($endd_diff); $today_diff = new DateTimeImmutable($today); $days_diff = $today_diff->diff($start_diff); echo '<li>'; echo '<a href="../../notifications/noties/?id='.$row["id"].'" target="_blank">'; echo '<div class="d-flex bd-highlight">'; echo '<div class="img_cont primary">'; if ($row["handler"]=='Admin') { echo '<i class="icon flaticon-381-settings-2"></i>'; } else { echo '<i class="icon fa fa-user"></i>'; } echo '</div>'; echo '<div class="user_info">'; echo '<span class="fs-12">'; if ($row["name"]=='Author') { echo ''.$row["user"].''; } else { echo ''.$row["name"].''; } if ($row["attempt"]=='Placed') { echo ' '.$row["attempt"].''; echo ' '.$row["action"].''; } else { echo ' '.$row["action"].''; echo ' '.$row["attempt"].''; } echo '</span>'; echo '<p class="text-primary fs-12">'; if ($days_diff->format('%s')<30 & $days_diff->format('%i')==0 & $days_diff->format('%h')==0 & $days_diff->format('%d')==0 & $days_diff->format('%m')==0 & $days_diff->format('%y')==0) { echo "Just Now"; } elseif ($days_diff->format('%i')>=0 & $days_diff->format('%h')>=0 & $days_diff->format('%d')>=0 & $days_diff->format('%m')>=0 & $days_diff->format('%y')==1) { echo "Last Year - ".date("D, jS M", strtotime($row['timestamp'])).""; } elseif ($days_diff->format('%i')>=0 & $days_diff->format('%h')>=0 & $days_diff->format('%d')>=0 & $days_diff->format('%m')>=0 & $days_diff->format('%y')>=1) { echo "".$days_diff->format("%y years")." ago on ".date("D, jS M", strtotime($row['timestamp'])).""; } elseif ($days_diff->format('%s')>30 & $days_diff->format('%i')==0 & $days_diff->format('%h')==0 & $days_diff->format('%d')==0) { echo "".$days_diff->format("%s seconds")." ago"; } elseif ($days_diff->format('%i')==1 & $days_diff->format('%h')==0 & $days_diff->format('%d')==0) { echo "".$days_diff->format("%i minute")." ago"; } elseif ($days_diff->format('%i')>=0 & $days_diff->format('%h')==0 & $days_diff->format('%d')==0) { echo "".$days_diff->format("%i minutes")." ago"; } elseif ($days_diff->format('%h')==1 & $days_diff->format('%d')==0 & $days_diff->format('%m')==0) { echo "".$days_diff->format("%h hour")." ago"; } elseif ($days_diff->format('%h')>=0 & $days_diff->format('%d')==0 & $days_diff->format('%m')==0) { echo "".$days_diff->format("%h hours")." ago"; } elseif ($days_diff->format('%d')==1) { echo "Yesterday - ".date("h:ia", strtotime($row['timestamp'])).""; } elseif ($days_diff->format('%m')==0) { echo "".date("D, jS M - h:ia", strtotime($row['timestamp'])).""; } elseif ($days_diff->format('%m')==1) { echo "Last Month on ".date("jS D", strtotime($row['timestamp'])).""; } elseif ($days_diff->format('%m')>=1) { echo "".date("D, jS M Y", strtotime($row['timestamp'])).""; } echo '</p>'; echo '</div>'; echo '</div>'; echo '</a>'; echo '</li>'; } ?> <!--Notes End--> </ul> </div> <div class="card-footer"></div> </div> </div> <div class="tab-pane fade" id="notes"> <div class="card mb-sm-3 mb-md-0 note_card"> <div class="card-header chat-list-header text-center"> <p class="mb-0">Events</p> <div> <h6 class="mb-1">Upcoming</h6> </div> <a href="javascript:void(0)"><i class="fa fa-caret-right"></i></a> </div> <div class="card-body contacts_body p-0 dz-scroll" id="DZ_W_Contacts_Body2"> <ul class="contacts"> <!--Notes Start--> <!--JS Box--> <div class="notes-box"></div> <!--JS Box--> <?php include('../../modals/notes.php'); ?> <!--Notes End--> </ul> </div> </div> </div> </div> </div> </div> <!--********************************** Chat box End ***********************************--> <?php if(isset($_SESSION['error'])){ echo "<div class='alert alert-danger solid alert-right-icon alert-dismissible fade show alert pop'> <span><i class='fa fa-exclamation-mark'></i></span> <button type='button' class='close h-100' data-dismiss='alert' aria-label='Close'><span>×</span> </button> <strong>Warning!</strong> ".$_SESSION['error']." </div>"; unset($_SESSION['error']); } if(isset($_SESSION['success'])){ echo "<div class='alert alert-success solid alert-right-icon alert-dismissible fade show alert pop'> <span><i class='fa fa-check'></i></span> <button type='button' class='close h-100' data-dismiss='alert' aria-label='Close'><span>×</span> </button> ".$_SESSION['success']." </div>"; unset($_SESSION['success']); } ?> <!--********************************** Header start ***********************************--> <div class="header"> <div class="header-content"> <nav class="navbar navbar-expand"> <div class="collapse navbar-collapse justify-content-between"> <div class="header-left"> <div class="dashboard_bar"> Sales Analytics </div> </div> <ul class="navbar-nav header-right"> <li class="nav-item"> <form method="POST"> <div class="input-group search-area search-one d-xl-inline-flex d-none"> <input type="search" name="Search_Main" id="Search_Main" class="form-control" placeholder="Search..." required> <div class="input-group-append"> <button type="submit" name="main_search" id="main_search" value="Search" class="input-group-text"><i class="fa fa-search text-white"></i></button> </div> </div> </form> </li> <li class="nav-item dropdown notification_dropdown"> <a class="nav-link ai-icon" href="javascript:void(0)" role="button" data-toggle="dropdown"> <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" d="M12.8333 5.91732V3.49998C12.8333 2.85598 13.356 2.33331 14 2.33331C14.6428 2.33331 15.1667 2.85598 15.1667 3.49998V5.91732C16.9003 6.16698 18.5208 6.97198 19.7738 8.22498C21.3057 9.75681 22.1667 11.8346 22.1667 14V18.3913L23.1105 20.279C23.562 21.1831 23.5142 22.2565 22.9822 23.1163C22.4513 23.9761 21.5122 24.5 20.5018 24.5H15.1667C15.1667 25.144 14.6428 25.6666 14 25.6666C13.356 25.6666 12.8333 25.144 12.8333 24.5H7.49817C6.48667 24.5 5.54752 23.9761 5.01669 23.1163C4.48469 22.2565 4.43684 21.1831 4.88951 20.279L5.83333 18.3913V14C5.83333 11.8346 6.69319 9.75681 8.22502 8.22498C9.47919 6.97198 11.0985 6.16698 12.8333 5.91732ZM14 8.16664C12.4518 8.16664 10.969 8.78148 9.87469 9.87581C8.78035 10.969 8.16666 12.453 8.16666 14V18.6666C8.16666 18.8475 8.12351 19.026 8.04301 19.1881C8.04301 19.1881 7.52384 20.2265 6.9755 21.322C6.88567 21.5028 6.89501 21.7186 7.00117 21.8901C7.10734 22.0616 7.29517 22.1666 7.49817 22.1666H20.5018C20.7037 22.1666 20.8915 22.0616 20.9977 21.8901C21.1038 21.7186 21.1132 21.5028 21.0234 21.322C20.475 20.2265 19.9558 19.1881 19.9558 19.1881C19.8753 19.026 19.8333 18.8475 19.8333 18.6666V14C19.8333 12.453 19.2185 10.969 18.1242 9.87581C17.0298 8.78148 15.547 8.16664 14 8.16664Z" fill="#000000"/> </svg> <div class="pulse-css"></div> </a> <div class="dropdown-menu rounded dropdown-menu-right"> <div id="DZ_W_Notification1" class="widget-media dz-scroll p-3 height380"> <ul class="timeline"> <?php $sql = "SELECT * FROM secure WHERE action!='Login' ORDER BY id DESC"; $result = $conn->query($sql); //display data on web page while($row = mysqli_fetch_array($result)){ date_default_timezone_set('Africa/Kampala'); $start_count = date("Y-m-d H:i:s", strtotime($row['timestamp'] . "+1 days")); $today = date("Y-m-d H:i:s",time()); $start_diff = new DateTimeImmutable($row['timestamp']); $endd_diff = new DateTimeImmutable($today); $duration = $start_diff->diff($endd_diff); $today_diff = new DateTimeImmutable($today); $days_diff = $today_diff->diff($start_diff); echo '<li>'; echo '<div class="timeline-panel">'; echo '<div class="media mr-2">'; if ($row["handler"]=='Admin') { echo '<img width="50" src="../../../../img/il.png" alt="thumbnail">'; } else { echo '<i class="icon fa fa-user"></i>'; } echo '</div>'; echo '<div class="media-body">'; echo '<h6 class="mb-1 fs-12">'; echo '<a href="../../notifications/noties/?id='.$row["id"].'" target="_blank">'; if ($row["name"]=='Author') { echo ''.$row["user"].''; } else { echo ''.$row["name"].''; } echo ' '.$row["attempt"].' '.$row["action"].''; if ($row["attempt"]=='Placed' & $row["handler"]=='Admin') { echo ' for '.$row["user"].''; } echo '</a>'; echo '</h6>'; echo '<small class="d-block fs-11">'; if ($days_diff->format('%s')<30 & $days_diff->format('%i')==0 & $days_diff->format('%h')==0 & $days_diff->format('%d')==0 & $days_diff->format('%m')==0 & $days_diff->format('%y')==0) { echo "Just Now"; } elseif ($days_diff->format('%i')>=0 & $days_diff->format('%h')>=0 & $days_diff->format('%d')>=0 & $days_diff->format('%m')>=0 & $days_diff->format('%y')==1) { echo "Last Year - ".date("D, jS M", strtotime($row['timestamp'])).""; } elseif ($days_diff->format('%i')>=0 & $days_diff->format('%h')>=0 & $days_diff->format('%d')>=0 & $days_diff->format('%m')>=0 & $days_diff->format('%y')>=1) { echo "".$days_diff->format("%y years")." ago on ".date("D, jS M", strtotime($row['timestamp'])).""; } elseif ($days_diff->format('%s')>30 & $days_diff->format('%i')==0 & $days_diff->format('%h')==0 & $days_diff->format('%d')==0) { echo "".$days_diff->format("%s seconds")." ago"; } elseif ($days_diff->format('%i')==1 & $days_diff->format('%h')==0 & $days_diff->format('%d')==0) { echo "".$days_diff->format("%i minute")." ago"; } elseif ($days_diff->format('%i')>=0 & $days_diff->format('%h')==0 & $days_diff->format('%d')==0) { echo "".$days_diff->format("%i minutes")." ago"; } elseif ($days_diff->format('%h')==1 & $days_diff->format('%d')==0 & $days_diff->format('%m')==0) { echo "".$days_diff->format("%h hour")." ago"; } elseif ($days_diff->format('%h')>=0 & $days_diff->format('%d')==0 & $days_diff->format('%m')==0) { echo "".$days_diff->format("%h hours")." ago"; } elseif ($days_diff->format('%d')==1) { echo "Yesterday - ".date("h:ia", strtotime($row['timestamp'])).""; } elseif ($days_diff->format('%m')==0) { echo "".date("D, jS M - h:ia", strtotime($row['timestamp'])).""; } elseif ($days_diff->format('%m')==1) { echo "Last Month on ".date("jS D", strtotime($row['timestamp'])).""; } elseif ($days_diff->format('%m')>=1) { echo "".date("D, jS M Y", strtotime($row['timestamp'])).""; } echo '</small>'; echo '</div>'; echo '</div>'; echo '</li>'; } ?> </ul> </div> <a class="all-notification" href="../../notifications" target="_blank">See all notifications <i class="ti-arrow-right"></i></a> </div> </li> <li class="nav-item dropdown notification_dropdown"> <a class="nav-link bell bell-link" href="javascript:void(0)"> <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" d="M25.6666 8.16666C25.6666 5.5895 23.5771 3.5 21 3.5C17.1161 3.5 10.8838 3.5 6.99998 3.5C4.42281 3.5 2.33331 5.5895 2.33331 8.16666V23.3333C2.33331 23.8058 2.61798 24.2305 3.05315 24.4113C3.48948 24.5922 3.99115 24.4918 4.32481 24.1582C4.32481 24.1582 6.59281 21.8902 7.96714 20.517C8.40464 20.0795 8.99733 19.8333 9.61683 19.8333H21C23.5771 19.8333 25.6666 17.7438 25.6666 15.1667V8.16666ZM23.3333 8.16666C23.3333 6.87866 22.2891 5.83333 21 5.83333C17.1161 5.83333 10.8838 5.83333 6.99998 5.83333C5.71198 5.83333 4.66665 6.87866 4.66665 8.16666V20.517L6.31631 18.8673C7.19132 17.9923 8.37899 17.5 9.61683 17.5H21C22.2891 17.5 23.3333 16.4558 23.3333 15.1667V8.16666ZM8.16665 15.1667H17.5C18.144 15.1667 18.6666 14.644 18.6666 14C18.6666 13.356 18.144 12.8333 17.5 12.8333H8.16665C7.52265 12.8333 6.99998 13.356 6.99998 14C6.99998 14.644 7.52265 15.1667 8.16665 15.1667ZM8.16665 10.5H19.8333C20.4773 10.5 21 9.97733 21 9.33333C21 8.68933 20.4773 8.16666 19.8333 8.16666H8.16665C7.52265 8.16666 6.99998 8.68933 6.99998 9.33333C6.99998 9.97733 7.52265 10.5 8.16665 10.5Z" fill="#000000"/> </svg> <div class="pulse-css"></div> </a> </li> <li class="nav-item dropdown header-profile"> <a class="nav-link" href="javascript:void(0)" role="button" data-toggle="dropdown"> <svg id="icon-user1" xmlns="http://www.w3.org/2000/svg" class="text-black" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle></svg> <div class="header-info"> <span class="text-black"><strong><?php echo $_SESSION["name"]; ?></strong></span> <p class="fs-12 mb-0">Admin</p> </div> </a> <div class="dropdown-menu dropdown-menu-right"> <a href="../../profile" class="dropdown-item ai-icon"> <svg id="icon-user1" xmlns="http://www.w3.org/2000/svg" class="text-primary" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle></svg> <span class="ml-2">Profile </span> </a> <a href="../../contact" class="dropdown-item ai-icon"> <svg id="icon-inbox" xmlns="http://www.w3.org/2000/svg" class="text-success" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"></path><polyline points="22,6 12,13 2,6"></polyline></svg> <span class="ml-2">Inbox </span> </a> <a href="../../logout" class="dropdown-item ai-icon"> <svg id="icon-logout" xmlns="http://www.w3.org/2000/svg" class="text-danger" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path><polyline points="16 17 21 12 16 7"></polyline><line x1="21" y1="12" x2="9" y2="12"></line></svg> <span class="ml-2">Logout </span> </a> </div> </li> </ul> </div> </nav> </div> </div> <!--********************************** Header end ti-comment-alt ***********************************--> <!--********************************** Sidebar start ***********************************--> <div class="deznav"> <div class="deznav-scroll"> <!--Side Menu Start--> <ul class="metismenu" id="menu"> <li><a class="has-arrow ai-icon" href="javascript:void()" aria-expanded="false"> <i class="flaticon-381-television"></i> <span class="nav-text">Dashboard</span> </a> <ul aria-expanded="false"> <li><a href="../../">Home</a></li> <li><a class="has-arrow" href="javascript:void()" aria-expanded="false">Shortcuts</a> <ul aria-expanded="false"> <li><a href="../../clients/undefined">Edit Undefined</a></li> <li><a href="../../clients/call">Call Clients</a></li> <li><a href="../../clients/mailer">Email Clients</a></li> </ul> </li> </ul> </li> <li><a class="has-arrow ai-icon" href="javascript:void()" aria-expanded="false"> <i class="flaticon-381-archive"></i> <span class="nav-text">Products</span> </a> <ul aria-expanded="false"> <li><a href="../../products">All</a></li> <?php $sql = "SELECT cat FROM shop GROUP BY cat"; $result = $conn->query($sql); //display data on web page while($row = mysqli_fetch_array($result)){ echo '<li><a href="../../products">'.$row["cat"].'</a></li>'; } ?> </ul> </li> <li><a class="has-arrow ai-icon" href="javascript:void()" aria-expanded="false"> <i class="flaticon-381-layer-1"></i> <span class="nav-text">Order History</span> </a> <ul aria-expanded="false"> <li><a href="../../orders/history">Overall <i class="fa fa-star fs-8 mt-n1 ml-1"></i></a></li> <li><a href="../../orders/history/month/?month=<?php echo $today_month; ?>">This Month (<?php echo $today_month; ?>)</a></li> <li><a href="../../orders/history/month/?month=<?php echo $last_name; ?>">Last Month (<?php echo $last_name; ?>)</a></li> <li><a href="../../orders/history/year/?year=<?php echo $today_year; ?>">This Year (<?php echo $today_year; ?>)</a></li> <li><a href="../../orders/history/year/?year=<?php echo $last_year; ?>">Last Year (<?php echo $last_year; ?>)</a></li> <li><a href="../../orders/history/annual">Overall (Annual)</a></li> </ul> </li> <li><a class="has-arrow ai-icon" href="javascript:void()" aria-expanded="false"> <i class="flaticon-381-diamond"></i> <span class="nav-text">Clients</span> </a> <ul aria-expanded="false"> <li><a href="../../clients">Client Manager</a></li> <li><a href="../../rankings/clients">Rankings</a></li> <li><a class="has-arrow" href="javascript:void()" aria-expanded="false">Birthdays</a> <ul aria-expanded="false"> <li><a href="../../clients/birthdays">Overall <i class="fa fa-star fs-8 mt-n1 ml-1"></i></a></li> <li><a href="../../clients/birthdays/upcoming">Upcoming</a></li> <li><a href="../../clients/birthdays/undefined">Undefined</a></li> </ul> </li> </ul> </li> <li><a href="../../invoices" class="ai-icon"><i class="flaticon-381-reading"></i> <span class="nav-text">Invoices</span> </a> </li> <li><a class="has-arrow ai-icon" href="javascript:void()" aria-expanded="false"> <i class="flaticon-381-receive"></i> <span class="nav-text">Earnings</span> </a> <ul aria-expanded="false"> <li><a href="../../earnings">Overall <i class="fa fa-star fs-8 mt-n1 ml-1"></i></a></li> <li><a href="../../earnings/monthly">Monthly</a></li> <li><a href="../../earnings/annual">Annual</a></li> </ul> </li> <li><a class="has-arrow ai-icon" href="javascript:void()" aria-expanded="false"> <i class="flaticon-381-tab"></i> <span class="nav-text">Rankings</span> </a> <ul aria-expanded="false"> <li><a href="../../rankings">Overall <i class="fa fa-star fs-8 mt-n1 ml-1"></i></a></li> <li><a href="../../rankings/clients">Clients</a></li> <li><a href="../../rankings/products">Products</a></li> <li><a href="../../rankings/days">Days</a></li> <li><a href="../../rankings/months">Months</a></li> <li><a href="../../rankings/years">Years</a></li> </ul> </li> <li><a href="../../rewards" class="ai-icon" aria-expanded="false"> <i class="flaticon-381-gift"></i> <span class="nav-text">Rewards</span> </a> </li> <li><a href="#!" class="ai-icon"><i class="flaticon-381-user-8"></i> <span class="nav-text">Users</span> </a> </li> <li class="active"><a class="has-arrow ai-icon" href="javascript:void()" aria-expanded="false"> <i class="flaticon-381-knob-1"></i> <span class="nav-text">Analytics</span> </a> <ul aria-expanded="false"> <li><a href="../../analytics/clients">Clients</a></li> <li><a class="has-arrow" href="javascript:void()" aria-expanded="false">Sales</a> <ul aria-expanded="false"> <li><a href="../../analytics/sales">Overall <i class="fa fa-star fs-8 mt-n1 ml-1"></i></a></li> <li><a href="../../analytics/sales/months">Months</a></li> <li><a href="../../analytics/sales/years">Years</a></li> </ul> </li> <li><a class="has-arrow" href="javascript:void()" aria-expanded="false">Income</a> <ul aria-expanded="false"> <li><a href="../../analytics/income">Overall <i class="fa fa-star fs-8 mt-n1 ml-1"></i></a></li> <li><a href="../../analytics/income/months">Months</a></li> <li><a href="../../analytics/income/years">Years</a></li> </ul> </li> <li><a href="../../analytics/products">Products</a></li> </ul> </li> </ul> <!--Side Menu End--> <div class="copyright text-center"> <p class="fs-13"><strong><a href="#">Irungi Kitchen © <script>document.write(new Date().getFullYear());</script></a></strong>, All Rights Reserved</p> <p class="fs-12 mt-2">Algorithm by <a href="https://camonitor.online">Custom Assist Inc<span class="flash">.</span></a></p> </div> </div> </div> <!--********************************** Sidebar end ***********************************--> <!--********************************** Content body start ***********************************--> <div class="content-body"> <!-- row --> <div class="container-fluid"> <div class="page-titles"> <ol class="breadcrumb"> <li class="breadcrumb-item"><a href="../../">Admin</a></li> <li class="breadcrumb-item"><a href="../">Analytics</a></li> <li class="breadcrumb-item active"><a href="javascript:void(0)">Sales</a></li> </ol> </div> <div class="row"> <div class="col-xl-9 col-xxl-12"> <div class="row"> <!-- Main Search Box --> <div id="main_search_box"></div> <!--Top Clients Start--> <div class="col-lg-12"> <div class="card"> <div class="card-header"> <h4 class="card-title fs-14">Top Clients</h4> <div class="dropdown ml-auto text-right"> <div class="btn-link" data-toggle="dropdown"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="24px" viewBox="0 0 24 24" version="1.1"><g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><rect x="0" y="0" width="24" height="24"></rect><circle fill="#000000" cx="12" cy="5" r="2"></circle><circle fill="#000000" cx="12" cy="12" r="2"></circle><circle fill="#000000" cx="12" cy="19" r="2"></circle></g></svg> </div> <div class="dropdown-menu dropdown-menu-right"> <a class="dropdown-item" href="../clients">View All</a> <a class="dropdown-item" href="../../clients">Manage Clients</a> </div> </div> </div> <div class="card-body"> <div class="table-responsive"> <table class="table table-responsive-md"> <thead> <tr> <th class="width80 fs-12">#</th> <th class="fs-12">NAMES</th> <th class="fs-12">ORDERS</th> <th class="fs-12">SPENT</th> <th class="fs-12">ACTION</th> </tr> </thead> <tbody> <?php $sql = "SELECT COUNT(DISTINCT email) FROM checkout"; $result = $conn->query($sql); //display data on web page while($row = mysqli_fetch_array($result)){ $top_count = '1'; } $sql = "SELECT fname, lname, email, COUNT(DISTINCT email), SUM(quantity), SUM(subtotal) FROM checkout GROUP BY email ORDER BY SUM(quantity) DESC LIMIT 10"; $result = $conn->query($sql); //display data on web page while($row = mysqli_fetch_array($result)){ echo '<tr class="fs-12">'; echo '<td><strong>'.number_format($top_count++).'</strong></td>'; echo '<td>'.$row["fname"].' '.$row["lname"].'</td>'; echo '<td>'; echo ''.number_format($row["SUM(quantity)"]).''; if ($row["SUM(quantity)"]==1) { echo ' item'; } else { echo ' items'; } echo '</td>'; echo '<td>'.number_format($row["SUM(subtotal)"]).'/-</td>'; echo '<td><a href="../../clients/manager/?client='.$row["email"].'" class="btn btn-success"><i class="fa fa-caret-right"></i></a></td>'; echo '</tr>'; } ?> </tbody> </table> </div> </div> </div> </div> <!--Top Clients End--> <!--Top Sellers Start--> <div class="col-lg-12"> <div class="card"> <div class="card-header"> <h4 class="card-title fs-14">Top Sellers</h4> <div class="dropdown ml-auto text-right"> <div class="btn-link" data-toggle="dropdown"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24px" height="24px" viewBox="0 0 24 24" version="1.1"><g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><rect x="0" y="0" width="24" height="24"></rect><circle fill="#000000" cx="12" cy="5" r="2"></circle><circle fill="#000000" cx="12" cy="12" r="2"></circle><circle fill="#000000" cx="12" cy="19" r="2"></circle></g></svg> </div> <div class="dropdown-menu dropdown-menu-right"> <a class="dropdown-item" href="../products">View All</a> <a class="dropdown-item" href="../../products">Manage Products</a> </div> </div> </div> <div class="card-body"> <div class="table-responsive"> <table class="table table-responsive-md"> <thead> <tr> <th class="fs-12">PREVIEW</th> <th class="fs-12">ITEMS</th> <th class="fs-12">SALES</th> <th class="fs-12">ORDERS</th> <th class="fs-12">CLIENTS</th> <th class="fs-12">INCOME</th> </tr> </thead> <tbody> <?php $sql = "SELECT name, image, SUM(subtotal), SUM(quantity), COUNT(email), COUNT(DISTINCT email) FROM checkout GROUP BY name ORDER BY SUM(quantity) DESC LIMIT 6"; $result = $conn->query($sql); //display data on web page while($row = mysqli_fetch_array($result)){ echo '<tr class="fs-12">'; echo '<td><img src="../../images/'.$row["image"].'" style="width: 40px;height: 40px;border-radius: 100px;object-fit: cover;"></td>'; echo '<td>'.$row["name"].'</td>'; echo '<td>'; echo ''.number_format($row["SUM(quantity)"]).''; if ($row["SUM(quantity)"]==1) { echo ' item'; } else { echo ' items'; } echo '</td>'; echo '<td>'; echo ''.number_format($row["COUNT(email)"]).''; if ($row["COUNT(email)"]==1) { echo ' order'; } else { echo ' orders'; } echo '</td>'; echo '<td>'; echo ''.number_format($row["COUNT(DISTINCT email)"]).''; if ($row["COUNT(DISTINCT email)"]==1) { echo ' client'; } else { echo ' clients'; } echo '</td>'; echo '<td>'.number_format($row["SUM(subtotal)"]).'/-</td>'; echo '</tr>'; } ?> </tbody> </table> </div> </div> </div> </div> <!--Top Sellers End--> <!-- Day Activity Starts --> <div class="col-xl-12"> <div class="card"> <div class="card-body"> <div class="table-responsive"> <table class="table header-border table-hover verticle-middle fs-14"> <thead> <tr> <th scope="col" class="fs-14">Day</th> <th scope="col" class="fs-14">Activity</th> <th scope="col" class="fs-14"></th> <th scope="col" class="fs-14">Sales</th> </tr> </thead> <tbody> <?php $sql = "SELECT day, COUNT(DISTINCT email), SUM(quantity) FROM checkout GROUP BY day ORDER BY SUM(quantity) DESC"; $result = $conn->query($sql); //display data on web page while($row = mysqli_fetch_array($result)){ $day_one = $row["SUM(quantity)"] / $quantity_count; $day_two = $day_one * 100; $day_ptg = round($day_two, 0); echo '<tr>'; echo '<td>'.$row["day"].'</td>'; echo '<td>'; echo '<div class="progress bgl-primary">'; echo '<div class="progress-bar" style="width: '.$day_ptg.'%;" role="progressbar"><span class="sr-only">'.$day_ptg.'%</span> </div>'; echo '</div>'; echo '</td>'; echo '<td><span class="badge badge-primary light fs-12">'.$day_ptg.'%</span> </td>'; echo '<td>'; echo '<span class="badge badge-primary light fs-12">'; echo ''.$row["SUM(quantity)"].''; if ($row["SUM(quantity)"]==1) { echo ' item'; } else { echo ' items'; } echo '</span>'; echo '</td>'; echo '</tr>'; } ?> </tbody> </table> </div> </div> </div> </div> <!-- Day Activity End --> <!--Month Activity Start--> <div class="col-xl-12"> <div class="card"> <div class="card-body"> <div class="table-responsive"> <table class="table header-border table-hover verticle-middle fs-14"> <thead> <tr> <th scope="col" class="fs-14">Month</th> <th scope="col" class="fs-14">Activity</th> <th scope="col" class="fs-14"></th> <th scope="col" class="fs-14">Sales</th> <th scope="col" class="fs-14">Income</th> </tr> </thead> <tbody> <?php $sql = "SELECT month, COUNT(DISTINCT email), SUM(quantity), SUM(price) FROM checkout GROUP BY month ORDER BY SUM(quantity) DESC"; $result = $conn->query($sql); //display data on web page while($row = mysqli_fetch_array($result)){ $month_one = $row["SUM(quantity)"] / $quantity_count; $month_two = $month_one * 100; $month_ptg = round($month_two, 0); echo '<tr class="fs-14">'; if ($row["month"]==$today_month) { echo '<td>'.$row["month"].' <span class="fs-10">(This Month)</span></td>'; } else { echo '<td>'.$row["month"].'</td>'; } echo '<td>'; echo '<div class="progress bgl-primary">'; echo '<div class="progress-bar" style="width: '.$month_ptg.'%;" role="progressbar"><span class="sr-only">'.$month_ptg.'%</span> </div>'; echo '</div>'; echo '</td>'; echo '<td><span class="badge badge-primary light fs-12">'.$month_ptg.'%</span> </td>'; echo '<td>'; echo '<span class="badge badge-primary light fs-12">'; echo ''.$row["SUM(quantity)"].''; if ($row["SUM(quantity)"]==1) { echo ' item'; } else { echo ' items'; } echo '</span>'; echo '</td>'; echo '<td>'.number_format($row["SUM(price)"]).'/-</td>'; echo '</tr>'; } ?> </tbody> </table> </div> </div> </div> </div> <!--Month Activity End--> <!--Year Activity Start--> <div class="col-xl-12"> <div class="card"> <div class="card-body"> <div class="table-responsive"> <table class="table header-border table-hover verticle-middle fs-14"> <thead> <tr> <th scope="col" class="fs-14">Year</th> <th scope="col" class="fs-14">Activity</th> <th scope="col" class="fs-14"></th> <th scope="col" class="fs-14">Sales</th> <th scope="col" class="fs-14">Income</th> </tr> </thead> <tbody> <?php $sql = "SELECT year, COUNT(DISTINCT email), SUM(quantity), SUM(price) FROM checkout GROUP BY year ORDER BY SUM(quantity) DESC"; $result = $conn->query($sql); //display data on web page while($row = mysqli_fetch_array($result)){ $year_one = $row["SUM(quantity)"] / $quantity_count; $year_two = $year_one * 100; $year_ptg = round($year_two, 0); echo '<tr class="fs-14">'; if ($row["year"]==$today_year) { echo '<td>'.$row["year"].' <span class="fs-10">(This Year)</span></td>'; } else { echo '<td>'.$row["year"].'</td>'; } echo '<td>'; echo '<div class="progress bgl-primary">'; echo '<div class="progress-bar" style="width: '.$year_ptg.'%;" role="progressbar"><span class="sr-only">'.$year_ptg.'%</span> </div>'; echo '</div>'; echo '</td>'; echo '<td><span class="badge badge-primary light fs-12">'.$year_ptg.'%</span> </td>'; echo '<td>'; echo '<span class="badge badge-primary light fs-12">'; echo ''.$row["SUM(quantity)"].''; if ($row["SUM(quantity)"]==1) { echo ' item'; } else { echo ' items'; } echo '</span>'; echo '</td>'; echo '<td>'.number_format($row["SUM(price)"]).'/-</td>'; echo '</tr>'; } ?> </tbody> </table> </div> </div> </div> </div> <!--Year Activity End--> </div> </div> </div> </div> </div> <!--********************************** Content body end ***********************************--> <!--********************************** Footer start ***********************************--> <div class="footer"> <div class="copyright"> <p class="fs-14"><strong><a href="#">Irungi Kitchen © <script>document.write(new Date().getFullYear());</script></a></strong>, All Rights Reserved</p> <p class="fs-12 mt-2">Algorithm by <a href="https://camonitor.online">Custom Assist Inc<span class="flash">.</span></a></p> </div> </div> <!--********************************** Footer end ***********************************--> <!--********************************** Support ticket button start ***********************************--> <!--********************************** Support ticket button end ***********************************--> </div> <!--********************************** Main wrapper end ***********************************--> <!--********************************** Scripts ***********************************--> <script src="../../counter/js/chat.js"></script> <!-- Required vendors --> <script src="../../vendor/global/global.min.js"></script> <script src="../../vendor/bootstrap-select/dist/js/bootstrap-select.min.js"></script> <script src="../../vendor/chart.js/Chart.bundle.min.js"></script> <script src="../../js/custom.min.js"></script> <script src="../../js/deznav-init.js"></script> <script src="../../vendor/owl-carousel/owl.carousel.js"></script> <!-- Chart piety plugin files --> <script src="../../vendor/peity/jquery.peity.min.js"></script> <!-- Apex Chart --> <script src="../../vendor/apexchart/apexchart.js"></script> <!-- Dashboard 1 --> <script src="../../js/dashboard/analytics.js"></script> <script src="../../vendor/highlightjs/highlight.pack.min.js"></script> <!-- Circle progress --> <!-- Rating --> <script src="../../vendor/star-rating/jquery.star-rating-svg.js"></script> <!-- Animations --> <script src="../../js/animations/letter/script.js"></script> <script src="../../js/js/bootstrap.min.js"></script> <script src="../../js/js/owl.carousel.min.js"></script> <script src="../../js/js/main.js"></script> <!-- Chat App --> <script src="../../chat/javascript/users.js"></script> <!-- Daterangepicker --> <!-- momment js is must --> <script src="../../vendor/moment/moment.min.js"></script> <script src="../../vendor/bootstrap-daterangepicker/daterangepicker.js"></script> <!-- clockpicker --> <script src="../../vendor/clockpicker/js/bootstrap-clockpicker.min.js"></script> <!-- asColorPicker --> <script src="../../vendor/jquery-asColor/jquery-asColor.min.js"></script> <script src="../../vendor/jquery-asGradient/jquery-asGradient.min.js"></script> <script src="../../vendor/jquery-asColorPicker/js/jquery-asColorPicker.min.js"></script> <!-- Material color picker --> <script src="../../vendor/bootstrap-material-datetimepicker/js/bootstrap-material-datetimepicker.js"></script> <!-- pickdate --> <script src="../../vendor/pickadate/picker.js"></script> <script src="../../vendor/pickadate/picker.time.js"></script> <script src="../../vendor/pickadate/picker.date.js"></script> <!-- Daterangepicker --> <script src="../../js/plugins-init/bs-daterange-picker-init.js"></script> <!-- Clockpicker init --> <script src="../../js/plugins-init/clock-picker-init.js"></script> <!-- asColorPicker init --> <script src="../../js/plugins-init/jquery-asColorPicker.init.js"></script> <!-- Material color picker init --> <script src="../../js/plugins-init/material-date-picker-init.js"></script> <!-- Pickdate --> <script src="../../js/plugins-init/pickadate-init.js"></script> <script src="../../vendor/dropzone/dist/dropzone.js"></script> <script> //Main Search $(document).ready(function() { var delay = 500; $('#main_search').click(function(e){ e.preventDefault(); var Search_Main = $('#Search_Main').val(); var main_search = $('#main_search').val(); if(Search_Main == ''){ $('#main_search_box').html( '<div class="text-primary fs-14 font-w600 text-center">Please enter an event name, location or venue to search!</div>' ); $('#Search_Main').focus(); return false; } $.ajax ({ type: "POST", url: "../../search/one/index.php", data: "Search_Main="+Search_Main+"&main_search="+main_search, beforeSend: function() { $('#main_search_box').html( '<div id="form-preloader"><div class="sk-three-bounce"><div class="sk-child sk-bounce1"></div><div class="sk-child sk-bounce2"></div><div class="sk-child sk-bounce3"></div></div></div>' ); }, success: function(data) { setTimeout(function() { $('#main_search_box').html(data); }, delay); } }); }); }); </script> </body> </html>
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Generation time: 4.01 |
proxy
|
phpinfo
|
Settings