[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: index_old1.php
<?php include("../admin/includes/functions/functions.php");?> <?php include("../admin/db/db.php");?> <?php if(!isset($_SESSION['username_Xw211qAAsq4'])) { header('Location: ../auth/'); exit(); } else{ $pageTitle = 'Dashboard'; $shopname = $_SESSION['business_name_Xw211qAAsq4']; $username = $_SESSION['username_Xw211qAAsq4']; $currency = mysqli_query($new,"SELECT currency from barber_admin WHERE business_name = '$shopname'"); $fechC = mysqli_fetch_array($currency); $qurtyCurrency = $fechC['currency']; $stmt = $db->prepare("SELECT forgot_pass_expire_time FROM barber_admin WHERE business_name = :business_name and username = :username"); $stmt->execute(['business_name' => $shopname,'username' =>$username]); $expiry_date = $stmt->fetchColumn(); $current_date = new DateTime(); $expiry_date = new DateTime($expiry_date); if ($current_date > $expiry_date) { $expiry_date = 'yes'; $stmt = $con->prepare("update barber_admin SET expired = ? where business_name = ? "); $stmt->execute(array($expiry_date,$shopname)); } $active = 1; $stmt1 = $con->prepare("SELECT rate FROM comm_rate WHERE business_name = ? and active = ?"); $stmt1->execute(array($shopname,$active)); $rows = $stmt1->fetchAll(); foreach($rows as $row) { $comRate1 = $row['rate']; if($comRate1 == 0){ $comRate = 0; } else { $comRate = $comRate1; } } $seleda = mysqli_query($new,"SELECT * FROM barber_admin WHERE business_name = '$shopname' and account_status = 'Trial'"); $fetch = mysqli_fetch_array($seleda); $expirationDate = $fetch['forgot_pass_expire_time']; // Current date $currentDate = date('Y-m-d'); // Calculate the difference between the current date and the expiration date $diff = strtotime($expirationDate) - strtotime($currentDate); $daysRemaining = floor($diff / (60 * 60 * 24)); // Check if there are exactly two days remaining for account expiration if ($daysRemaining > 0) { // Display the notification //echo" <p style='color:red'>Trial expired in ".$daysRemaining." day(s)</p>"; } elseif ($daysRemaining == 0) { //echo" <p style='color:red'>Trial expired today</p>"; $expiry_date = 'yes'; $stmt = $con->prepare("update barber_admin SET expired = ? where business_name = ? "); $stmt->execute(array($expiry_date,$shopname)); header("location../expired"); } // else { // $expiry_date = 'yes'; // $stmt = $con->prepare("update barber_admin SET expired = ? where business_name = ? "); // $stmt->execute(array($expiry_date,$shopname)); // header("location../expired"); // } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title> <?php echo $pageTitle;?> - <?php echo $shopname;?></title> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <script src="https://code.jquery.com/jquery-3.6.4.min.js" integrity="sha256-oP6HI9z1XaZNBrJURtCoUT5SUnxFr8s3BzRl+cbzUq8=" crossorigin="anonymous"></script> <link rel="shortcut icon" href="../assets/icon.png" type="image/x-icon"> <link rel="icon" href="../assets/icon.png" type="image/x-icon"> <!-- App favicon --> <script src="https://code.highcharts.com/highcharts.js"></script> <script src="https://code.highcharts.com/modules/accessibility.js"></script> <!-- App css --> <link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> <link href="assets/css/icons.min.css" rel="stylesheet" type="text/css" /> <link href="assets/css/theme.min.css" rel="stylesheet" type="text/css" /> <style> #preloader { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 9999; background-color: #fff; } #loader { display: block; position: absolute; top: 50%; left: 50%; border: 16px solid #f3f3f3; border-top: 16px solid #3498db; border-radius: 50%; width: 70px; height: 70px; animation: spin 2s linear infinite; } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } .highcharts-credits { display: none !important; } </style> </head> <body> <div id="preloader"> <div id="loader"></div> </div> <!-- Begin page --> <div id="layout-wrapper"> <div class="header-border"></div> <?php include("includes/template/head.php");?> <?php include("includes/template/side.php");?> <div class="main-content"> <div class="page-content"> <div class="container-fluid"> <!-- start page title --> <div class="row"> <div class="col-12"> <div class="page-title-box d-flex align-items-center justify-content-between"> <h4 class="mb-0 font-size-18">Dashboard</h4> <div class="page-title-right"> <ol class="breadcrumb m-0"> <li class="breadcrumb-item"><a href="javascript: void(0);"><?= $shopname;?></a></li> <li class="breadcrumb-item active"><?php echo $pageTitle;?></li> </ol> </div> </div> </div> </div> <!-- end page title --> <?php include("dash-statistics.php");?> <?php $stmt = $con->prepare("SELECT account_type FROM barber_admin WHERE username = ? and business_name = ?"); $stmt->execute(array($username,$shopname)); $userstatus = $stmt->fetchAll(); foreach($userstatus as $sta) { $namee = $sta['account_type']; } $select_role = mysqli_query($new,"SELECT * FROM role_permissions WHERE business_name = '$shopname' and type = '$namee'"); $rowroles = mysqli_fetch_array($select_role); $rolestatus = $rowroles['status']; if($rolestatus == "1"){?> <div class="row"> <div class="col-lg-9"> <div class="card"> <div class="card-body"> <div class="row"> <div class="col-lg-8"> <h4 class="card-title">Sales Analytics</h4> <p class="card-subtitle mb-4"></p> <div id="container1"></div> </div> <div class="col-lg-4"> <h4 class="card-title">Product sold today</h4> <p class="card-subtitle mb-4"></p> <?php $tdate = date('Y-m-d'); $stmtServices = $con->prepare("SELECT * FROM product_sales WHERE sold_date = '$tdate' and business_name = ?"); $stmtServices->execute(array($shopname)); $rowsServices = $stmtServices->fetchAll(); $tst = $stmtServices->fetchColumn(); if(empty($tst)){ $totaL = 0; } else { $totaL = $tst; } foreach($rowsServices as $rowsService) { $price = $rowsService['total_amount']; $disc = $rowsService['discount']; $tdis = ($disc / 100) * $price; $totalAmt = $price - $tdis; $todayT +=$totalAmt; } $todayT = number_format($todayT,2); $pastdate= date("Y-m-d", strtotime("-1 week")); $crrntdte=date("Y-m-d"); $stmtServices = $con->prepare("SELECT * FROM product_sales WHERE sold_date between '$pastdate' AND '$crrntdte' and business_name = ?"); $stmtServices->execute(array($shopname)); $rowsServices = $stmtServices->fetchAll(); foreach($rowsServices as $rowsService) { $price = $rowsService['total_amount']; $disc = $rowsService['discount']; $tdis = ($disc / 100) * $price; $totalAmt = $price - $tdis; $todayTw +=$totalAmt; } $todayTww = number_format($todayTw,2); ?> <div class="text-center"> <input data-plugin="knob" data-width="165" data-height="165" data-linecap=round data-fgColor="#7a08c2" value="<?php echo $totaL;?>" data-skin="tron" data-angleOffset="180" data-readOnly=true data-thickness=".15" /> <h5 class="text-muted mt-3">Product sales</h5> <p class="text-muted w-75 mx-auto sp-line-2"><br /><br /><br /></p> <div class="row mt-3"> <div class="col-6"> <p class="text-muted font-15 mb-1 text-truncate">Todays Sales</p> <h4><?php echo $todayss = number_format($todayT,2).' '.$qurtyCurrency ;?></h4> </div> <div class="col-6"> <p class="text-muted font-15 mb-1 text-truncate">Weekly sales</p> <h4><?php echo $week = number_format($todayTww,2).' '.$qurtyCurrency;?></h4> </div> </div> </div> </div> </div> </div> <!--end card body--> </div> <!-- end card--> </div> <!-- end col --> <div class="col-md-6 col-xl-3"> <div class="card"> <div class="card-body"> <div class="mb-4"> <div class="text-xs font-weight-bold text-uppercase mb-1"> Expenses - <?php echo date("M Y");?> </div> </div> <div class="row d-flex align-items-center mb-4"> <div class="col-8"> <h2 class="d-flex align-items-center mb-0"> <?php $month = date('F'); $year = date('Y'); $stmt = $con->prepare("SELECT sum(item_amount) as amount FROM expenses WHERE MONTHNAME(date) = '$month' and business_name = ?"); $stmt->execute(array($shopname)); $rows_services = $stmt->fetchAll(); foreach($rows_services as $service) { $v = $service['amount']; if(empty($v)){ echo $ggg = 0; } else { echo $ggg = $v; } $percc = ($ggg / 100); } ?> </h2> </div> </div> <div class="progress shadow-sm" style="height: 5px;"> <div class="progress-bar bg-warning" role="progressbar" style="width: <?php echo $percc;?>%;"></div> </div> </div> <div class="card-body"> <br /><br /> <div class="mb-4"> <div class="text-xs font-weight-bold text-success text-uppercase mb-1"> Total Expenses - <?php echo date('Y');?> </div> </div> <div class="row d-flex align-items-center mb-4"> <div class="col-8"> <h2 class="d-flex align-items-center mb-0"> <?php $year = date('Y'); $stmt = $con->prepare("SELECT sum(item_amount) as amount FROM expenses WHERE year(date) = '$year' and business_name = ? "); $stmt->execute(array($shopname)); $rows_services = $stmt->fetchAll(); foreach($rows_services as $service) { $v = $service['amount']; if(empty($v)){ echo $gg = 0; } else { echo $gg = $v; } $perc = ($gg / 100); } ?> </h2> </div> </div> <div class="progress shadow-sm" style="height: 5px;"> <div class="progress-bar bg-warning" role="progressbar" style="width: <?php echo $perc;?>%;"></div> </div> </div> </div> </div> </div> <div class="row"> <div class="col-lg-7"> <div class="card"> <div class="card-body"> <div id="container" style="height:400px;"></div> </div> </div> </div> <div class="col-lg-5"> <div class="card"> <div id="containerdon" style="height:440px;"></div> </div> </div> </div> <!-- <div class="row"> <div class="col-lg-6"> <div class="card"> <div class="card-body"> <div id="container50" style="height:400px;"></div> </div> </div> </div> <div class="col-lg-6"> <div class="card"> <div class="card-body"> <div id="container22" style="height:400px;"></div> </div> </div> </div> </div> --> </div> <!-- container-fluid --> </div> <?php } elseif($namee != "Admin") { ?> <div class="row"> <div class="col-lg-9"> <div class="card"> <div class="card-body"> <div class="row"> <div class="col-lg-8"> <h4 class="card-title">Sales Analytics</h4> <p class="card-subtitle mb-4"></p> <div id="container1"></div> </div> <div class="col-lg-4"> <h4 class="card-title">Product sold today</h4> <p class="card-subtitle mb-4"></p> <?php $tdate = date('Y-m-d'); $stmtServices = $con->prepare("SELECT * FROM product_sales WHERE sold_date = '$tdate' and business_name = ?"); $stmtServices->execute(array($shopname)); $rowsServices = $stmtServices->fetchAll(); $tst = $stmtServices->fetchColumn(); if(empty($tst)){ $totaL = 0; } else { $totaL = $tst; } foreach($rowsServices as $rowsService) { $price = $rowsService['total_amount']; $disc = $rowsService['discount']; $tdis = ($disc / 100) * $price; $totalAmt = $price - $tdis; $todayT +=$totalAmt; } $todayT = number_format($todayT,2); $pastdate= date("Y-m-d", strtotime("-1 week")); $crrntdte=date("Y-m-d"); $stmtServices = $con->prepare("SELECT * FROM product_sales WHERE sold_date between '$pastdate' AND '$crrntdte' and business_name = ?"); $stmtServices->execute(array($shopname)); $rowsServices = $stmtServices->fetchAll(); foreach($rowsServices as $rowsService) { $price = $rowsService['total_amount']; $disc = $rowsService['discount']; $tdis = ($disc / 100) * $price; $totalAmt = $price - $tdis; $todayTw +=$totalAmt; } $todayTww = number_format($todayTw,2); ?> <div class="text-center"> <input data-plugin="knob" data-width="165" data-height="165" data-linecap=round data-fgColor="#7a08c2" value="<?php echo $totaL;?>" data-skin="tron" data-angleOffset="180" data-readOnly=true data-thickness=".15" /> <h5 class="text-muted mt-3">Product sales</h5> <p class="text-muted w-75 mx-auto sp-line-2"><br /><br /><br /></p> <div class="row mt-3"> <div class="col-6"> <p class="text-muted font-15 mb-1 text-truncate">Todays Sales</p> <h4><?php echo $todayss = number_format($todayT,2).' '.$qurtyCurrency;?></h4> </div> <div class="col-6"> <p class="text-muted font-15 mb-1 text-truncate">Weekly sales</p> <h4><?php echo $week = number_format($todayTww,2).' '.$qurtyCurrency;?></h4> </div> </div> </div> </div> </div> </div> <!--end card body--> </div> <!-- end card--> </div> <!-- end col --> <div class="col-md-6 col-xl-3"> <div class="card"> <div class="card-body"> <div class="mb-4"> <div class="text-xs font-weight-bold text-uppercase mb-1"> Expenses - <?php echo date("M Y");?> </div> </div> <div class="row d-flex align-items-center mb-4"> <div class="col-8"> <h2 class="d-flex align-items-center mb-0"> <?php $month = date('F'); $year = date('Y'); $stmt = $con->prepare("SELECT sum(item_amount) as amount FROM expenses WHERE MONTHNAME(date) = '$month' and business_name = ?"); $stmt->execute(array($shopname)); $rows_services = $stmt->fetchAll(); foreach($rows_services as $service) { $v = $service['amount']; if(empty($v)){ echo $gg = 0; } else { echo $gg = $v; } } ?> </h2> </div> </div> <div class="progress shadow-sm" style="height: 5px;"> <div class="progress-bar bg-warning" role="progressbar" style="width: <?php echo $gg;?>%;"></div> </div> </div> <div class="card-body"> <br /><br /> <div class="mb-4"> <div class="text-xs font-weight-bold text-success text-uppercase mb-1"> Total Expenses - <?php echo date('Y');?> </div> </div> <div class="row d-flex align-items-center mb-4"> <div class="col-8"> <h2 class="d-flex align-items-center mb-0"> <?php $year = date('Y'); $stmt = $con->prepare("SELECT sum(item_amount) as amount FROM expenses WHERE year(date) = '$year' and business_name = ? "); $stmt->execute(array($shopname)); $rows_services = $stmt->fetchAll(); foreach($rows_services as $service) { $v = $service['amount']; if(empty($v)){ echo $gg = 0; } else { echo $gg = $v; } $perc = ($gg / 100); } ?> </h2> </div> </div> <div class="progress shadow-sm" style="height: 5px;"> <div class="progress-bar bg-warning" role="progressbar" style="width: <?php echo $perc;?>%;"></div> </div> </div> </div> </div> </div> <div class="row"> <div class="col-lg-7"> <div class="card"> <div class="card-body"> <div id="container" style="height:400px;"></div> </div> </div> </div> <div class="col-lg-5"> <div class="card"> <div id="containerdon" style="height:440px;"></div> </div> </div> </div> <!-- <div class="row"> <div class="col-lg-6"> <div class="card"> <div class="card-body"> <div id="container50" style="height:400px;"></div> </div> </div> </div> <div class="col-lg-6"> <div class="card"> <div class="card-body"> <div id="container22" style="height:400px;"></div> </div> </div> </div> </div> --> </div> <!-- container-fluid --> </div> <?php } else {?> <div class="row"> <div class="col-lg-8"> <p class="card-subtitle mb-4"></p> <div id="container1"></div> </div> <div class="col-lg-4"> <div class="card"> <div class="card-body"> <?php $tdate = date('Y-m-d'); $stmtServices = $con->prepare("SELECT * FROM product_sales WHERE sold_date = '$tdate' and business_name = ?"); $stmtServices->execute(array($shopname)); $rowsServices = $stmtServices->fetchAll(); foreach($rowsServices as $rowsService) { $price = $rowsService['total_amount']; $disc = $rowsService['discount']; $tdis = ($disc / 100) * $price; $totalAmt = $price - $tdis; $todayT +=$totalAmt; } $todayT = number_format($todayT,2); $pastdate= date("Y-m-d", strtotime("-1 week")); $crrntdte=date("Y-m-d"); $stmtServices = $con->prepare("SELECT * FROM product_sales WHERE sold_date between '$pastdate' AND '$crrntdte' and business_name = ?"); $stmtServices->execute(array($shopname)); $rowsServices = $stmtServices->fetchAll(); // if(empty($rowsServices)){ // $totaL = 0; // } else { // $totaL = $rowsServices; // } foreach($rowsServices as $rowsService) { $price = $rowsService['total_amount']; $disc = $rowsService['discount']; $tdis = ($disc / 100) * $price; $totalAmt = $price - $tdis; $todayTw +=$totalAmt; } $todayTwwq = number_format($todayTw,2); ?> <div class="text-center"> <input data-plugin="knob" data-width="165" data-height="165" data-linecap=round data-fgColor="#7a08c2" value="<?php echo $rowsServices;?>" data-skin="tron" data-angleOffset="180" data-readOnly=true data-thickness=".15" /> <h5 class="text-muted mt-3">Product sales</h5> <p class="text-muted w-75 mx-auto sp-line-2"><br /><br /><br /></p> <div class="row mt-3"> <div class="col-6"> <p class="text-muted font-15 mb-1 text-truncate">Today total Sales</p> <h4><?php echo $todayss = number_format($todayT,2).' '.$qurtyCurrency;?></h4> </div> <div class="col-6"> <p class="text-muted font-15 mb-1 text-truncate">A week Sales</p> <h4><?php echo $week = number_format($todayTwwq,2).' '.$qurtyCurrency;?></h4> </div> </div> </div> </div> </div> </div> </div> <!--end card body--> </div> <!-- end card--> </div> <!-- end col --> </div> <?php }?> <?php include("includes/template/newfooter.php");?> </div> <!-- end main content--> </div> <!-- END layout-wrapper --> <!-- Overlay--> <div class="menu-overlay"></div> <script src="assets/js/jquery.min.js"></script> <script src="assets/js/bootstrap.bundle.min.js"></script> <script src="assets/js/metismenu.min.js"></script> <script src="assets/js/waves.js"></script> <script src="assets/js/simplebar.min.js"></script> <script src="plugins/raphael/raphael.min.js"></script> <script src="assets/pages/dashboard-demo.js"></script> <script src="assets/js/theme.js"></script> <script src="plugins/jquery-sparkline/jquery.sparkline.min.js"></script> <!-- Chart Js--> <script src="plugins/jquery-knob/jquery.knob.min.js"></script> <!-- Chart Custom Js--> <script src="assets/pages/knob-chart-demo.js"></script> <script src="easypiechart-data.js"></script> <script src="bootstrap-datepicker.js"></script> <script type="text/javascript"> document.onreadystatechange = function() { if (document.readyState !== "complete") { document.querySelector("#preloader").style.display = "block"; } else { document.querySelector("#preloader").style.display = "none"; } }; </script> <script type="text/javascript"> Highcharts.setOptions({ colors: Highcharts.map(Highcharts.getOptions().colors, function (color) { return { radialGradient: { cx: 0.5, cy: 0.3, r: 0.7 }, stops: [ [0, color], [1, Highcharts.color(color).brighten(-0.3).get('rgb')] // darken ] }; }) }); Highcharts.chart('container1', { title: { text: 'Weekly Services Sales Report', align: 'left' }, xAxis: { categories: [<?php for($i=1;$i<8;$i++){ $weekdays = date("l",mktime(0,0,0,3,28,2009)+$i * (3600*24)); echo "['".$weekdays."'],"; }?>] }, yAxis: { title: { text: 'Cash (<?php echo $qurtyCurrency;?>)' } }, tooltip: { headerFormat: '<span style="font-size:10px">{point.key}</span><table>', pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' + '<td style="padding:0"><b>{point.y:.1f}</b></td></tr>', footerFormat: '</table>', shared: true, useHTML: true }, plotOptions: { series: { borderWidth: 0, dataLabels: { enabled: true, format: '{point.y:.1f} <?php echo $qurtyCurrency;?>' } } }, series: [{ type: 'column', name: 'Sales', color: '#669999', data: [<?php for($i=1;$i<8;$i++){ $weekdays = date("l",mktime(0,0,0,3,28,2009)+$i * (3600*24)); $yesterday = date( 'Y-m-d'); //$yesterday = date( 'Y-m-d', strtotime( '-2 days' ) ); $newdays = date('Y-m-d', strtotime(' + 8 days')); $endDate = date('Y-m-d', strtotime("+7 days")); $stmtServices = $con->prepare("SELECT sum(price) as amount,MONTHNAME(a.created) as month from services s, true_price sb,appointments a where s.service_id = sb.service_id and sb.appointment_id = a.appointment_id and a.canceled = '0' and a.active = 'Yes' AND DAYNAME(a.created) = '$weekdays' and date(a.created) between '$yesterday' AND '$newdays' and a.business_name = ?"); $stmtServices->execute(array($shopname)); $rowsServices = $stmtServices->fetchAll(); foreach($rowsServices as $rowsService) { $saleamount = $rowsService['amount']; if(empty($saleamount)){ $totalamount = '0'; } else { $totalamount = $saleamount; } echo "".$totalamount.","; } }?>] }, { type: 'column', name: 'Disc', color: '#0099cc', data: [<?php for($i = 1; $i < 8; $i++) { $weekdays = date("l", mktime(0, 0, 0, 3, 28, 2009) + $i * (3600 * 24)); $yesterday = date('Y-m-d'); //$yesterday = date( 'Y-m-d', strtotime( '-1 days' ) ); $yesterday = date( 'Y-m-d'); $newdays = date('Y-m-d', strtotime(' + 8 days')); $dis = mysqli_query($new,"SELECT discount FROM appointments WHERE canceled = '0' AND active = 'Yes' AND DAYNAME(created) = '$weekdays' and date(created) = '$yesterday' AND business_name = '$shopname'"); while ($do = mysqli_fetch_array($dis)) { $too = $do['discount']; } $stmtServices = $con->prepare("SELECT sum(price) as amount,MONTHNAME(created) as month,discount,comRate from services s, true_price sb,appointments a where s.service_id = sb.service_id and sb.appointment_id = a.appointment_id and a.canceled = '0' and a.active = 'Yes' AND DAYNAME(a.created) = '$weekdays' and date(a.created) = '$yesterday' and a.business_name = ?"); $stmtServices->execute(array($shopname)); $rowsServices = $stmtServices->fetchAll(); foreach($rowsServices as $rowsService) { $saleamount = $rowsService['amount']; $Disc = ($too / 100) * $saleamount ; $afterDisc = $saleamount - $Disc; if(empty($Disc)){ $comm = '0'; } else { $comm = $Disc; } } echo "".$comm.","; } ?>] }, { type: 'column', name: 'Comm', color: '#cc7a00', data: [<?php for($i=1;$i<8;$i++){ $weekdays = date("l",mktime(0,0,0,3,28,2009)+$i * (3600*24)); $yesterday = date("Y-m-d"); $dis = mysqli_query($new,"SELECT comRate FROM appointments WHERE canceled = '0' AND active = 'Yes' AND DAYNAME(created) = '$weekdays' and date(created) = '$yesterday' AND business_name = '$shopname'"); while ($do = mysqli_fetch_array($dis)) { $rate = $do['comRate']; } $dis = mysqli_query($new,"SELECT discount FROM appointments WHERE canceled = '0' AND active = 'Yes' AND DAYNAME(created) = '$weekdays' and date(created) = '$yesterday' AND business_name = '$shopname'"); while ($do = mysqli_fetch_array($dis)) { $too = $do['discount']; } $stmtServices = $con->prepare("SELECT sum(price) as amount,MONTHNAME(created) as month,discount,comRate from services s, true_price sb,appointments a where s.service_id = sb.service_id and sb.appointment_id = a.appointment_id and a.canceled = '0' and a.active = 'Yes' AND DAYNAME(a.created) = '$weekdays' and date(a.created) = '$yesterday' and a.business_name = ?"); $stmtServices->execute(array($shopname)); $rowsServices = $stmtServices->fetchAll(); foreach($rowsServices as $rowsService) { $saleamount = $rowsService['amount']; $Disc = ($too / 100) * $saleamount ; $afterDisc = $saleamount - $Disc; $Tcom = ($rate / 100) * $afterDisc ; } if(empty($Tcom)){ $ComT = '0'; } else { $ComT = $Tcom; } echo "".$ComT.","; }?>] }, { type: 'column', name: 'Expenses', data: [<?php for($i=1;$i<8;$i++){ $weekdays = date("l",mktime(0,0,0,3,28,2009)+$i * (3600*24)); $year = date('Y'); $yesterday = date( 'Y-m-d'); // $yesterday = date( 'Y-m-d'); $bt = date('Y-m-d', strtotime($pdate. ' + 8 days')); $stmt = $con->prepare("SELECT sum(item_amount) as amount,MONTHNAME(date) as month FROM expenses WHERE DAYNAME(date) = '$weekdays' and date(date) = '$yesterday' "); $stmt->execute(); $rows_services = $stmt->fetchAll(); foreach($rows_services as $service) { $v = $service['amount']; if(empty($v)){ $gg = '0'; } else { $gg = $v; } echo "".$gg.","; } }?>] },] }); Highcharts.chart('containerdon', { title: { text: 'Customer based on Gender', align: 'left' }, xAxis: { categories: [<?php for ($m=1; $m<=12; $m++) { $month = date('F', mktime(0,0,0,$m, 1, date('Y'))); echo "['".$month."'],"; }?>] }, yAxis: { title: { text: 'Customers' } }, tooltip: { headerFormat: '<span style="font-size:10px">{point.key}</span><table>', pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' + '<td style="padding:0"><b>{point.y:.1f}</b></td></tr>', footerFormat: '</table>', shared: true, useHTML: true }, plotOptions: { series: { borderWidth: 0, dataLabels: { enabled: true, format: '{point.y:.1f}' } } }, series: [{ type: 'column', name: 'Male', data: [<?php for ($m=1; $m<=12; $m++) { $month = date('F', mktime(0,0,0,$m, 1, date('Y'))); $year = date('Y'); $stmtServices = $con->prepare("SELECT count(gender) as male FROM clients WHERE clients.gender = 'male' AND MONTHNAME(clients.date) = '$month' and YEAR(date) = '$year' and business_name = ?"); $stmtServices->execute(array($shopname)); $rowsServices = $stmtServices->fetchAll(); foreach($rowsServices as $rowsService) { $male = $rowsService['male']; echo "".$male.","; } }?>] }, { type: 'column', name: 'Female', color : 'pink', data: [<?php for ($m=1; $m<=12; $m++) { $month = date('F', mktime(0,0,0,$m, 1, date('Y'))); $year = date('Y'); $stmtServices = $con->prepare("SELECT count(gender) as female FROM clients WHERE clients.gender = 'female' AND MONTHNAME(clients.date) = '$month' AND YEAR(date) = '$year' and business_name = ?"); $stmtServices->execute(array($shopname)); $rowsServices = $stmtServices->fetchAll(); foreach($rowsServices as $fmale) { $female = $fmale['female']; echo "".$female.","; } } ?>] },] }); </script> <script type="text/javascript"> Highcharts.chart('container', { chart: { type: 'column' }, title: { text: 'Monthly Services Sales' }, xAxis: { categories: [<?php for ($m=1; $m<=12; $m++) { $month = date('F', mktime(0,0,0,$m, 1, date('Y'))); echo "['".$month."'],"; }?>], crosshair: true }, yAxis: { min: 0, title: { text: 'Cash (<?php echo $qurtyCurrency;?>)' } }, tooltip: { headerFormat: '<span style="font-size:10px">{point.key}</span><table>', pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' + '<td style="padding:0"><b>{point.y:.1f}</b></td></tr>', footerFormat: '</table>', shared: true, useHTML: true }, plotOptions: { series: { borderWidth: 0, dataLabels: { enabled: true, format: '{point.y:.1f} <?php echo $qurtyCurrency;?>' } } }, series: [{ name: 'Sales', data: [ <?php for ($m=1; $m<=12; $m++) { $month = date('F', mktime(0,0,0,$m, 1, date('Y'))); $year = date('Y'); $stmtServices = $con->prepare("SELECT sum(price) as amount,MONTHNAME(a.created) as month from services s, true_price sb,appointments a where s.service_id = sb.service_id and sb.appointment_id = a.appointment_id and a.canceled = '0' and a.active = 'Yes' AND MONTHNAME(a.created) = '$month' and YEAR(a.created) = '$year' and a.business_name = ? "); $stmtServices->execute(array($shopname)); $rowsServices = $stmtServices->fetchAll(); foreach($rowsServices as $rowsService) { $saleamount = $rowsService['amount']; if(empty($saleamount)){ $totalamount = '0'; } else { $totalamount = $saleamount; } echo "".$totalamount.","; } } ?>] },{ type: 'column', name: 'Disc', color: '#996666', data: [ <?php for ($m=1; $m<=12; $m++) { $month = date('F', mktime(0,0,0,$m, 1, date('Y'))); $year = date("Y"); $dis = mysqli_query($new,"SELECT discount FROM appointments WHERE canceled = '0' AND active = 'Yes' AND MONTHNAME(created) = '$month' and YEAR(created) = '$year' and business_name = '$shopname'"); while ($do1 = mysqli_fetch_array($dis)) { $too1 = $do1['discount']; } $stmtServices = $con->prepare("SELECT sum(price) as amount,MONTHNAME(a.created) as month from services s, true_price sb,appointments a where s.service_id = sb.service_id and sb.appointment_id = a.appointment_id and a.canceled = '0' and a.active = 'Yes' AND MONTHNAME(a.created) = '$month' and YEAR(a.created) = '$year' and a.business_name = ? "); $stmtServices->execute(array($shopname)); $rowsServices = $stmtServices->fetchAll(); foreach($rowsServices as $rowsService70) { $saleamountT = $rowsService70['amount']; $Disc = ($too1 / 100) * $saleamountT ; $afterDisc = $saleamountT - $Disc; if(empty($Disc)){ $comm = '0'; } else { $comm = $Disc; } } echo "".$comm.","; } ?>] } ,{ name: 'Com', color: '#f6c23e', data: [ <?php for ($m=1; $m<=12; $m++) { $month = date('F', mktime(0,0,0,$m, 1, date('Y'))); $year = date('Y'); $dis = mysqli_query($new,"SELECT comRate FROM appointments WHERE canceled = '0' AND active = 'Yes' AND MONTHNAME(created) = '$month' and YEAR(created) = '$year' AND business_name = '$shopname'"); while ($do = mysqli_fetch_array($dis)) { $rate = $do['comRate']; } $dis = mysqli_query($new,"SELECT discount FROM appointments WHERE canceled = '0' AND active = 'Yes' AND MONTHNAME(created) = '$month' and YEAR(created) = '$year' AND business_name = '$shopname'"); while ($do = mysqli_fetch_array($dis)) { $too = $do['discount']; } $stmtServices = $con->prepare("SELECT sum(price) as amount,MONTHNAME(created) as month,discount,comRate from services s, true_price sb,appointments a where s.service_id = sb.service_id and sb.appointment_id = a.appointment_id and a.canceled = '0' and a.active = 'Yes' AND MONTHNAME(a.created) = '$month' and YEAR(a.created) = '$year' and a.business_name = ?"); $stmtServices->execute(array($shopname)); $rowsServices = $stmtServices->fetchAll(); foreach($rowsServices as $rowsService50) { $saless = $rowsService50['amount']; $Disc = ($too / 100) * $saless ; $afterDisc = $saless - $Disc; $Tcomm = ($rate / 100) * $afterDisc ; } if(empty($Tcomm)){ $mComm = '0'; } else { $mComm = $Tcomm; } echo "".$mComm.","; } ?>] }, { type: 'column', name: 'Expenses', data: [<?php for ($m=1; $m<=12; $m++) { $month = date('F', mktime(0,0,0,$m, 1, date('Y'))); $year = date('Y'); $yesterday = date('Y-m-d'); // $yesterday = date( 'Y-m-d'); $bt = date('Y-m-d', strtotime($pdate. ' + 8 days')); $stmt = $con->prepare("SELECT sum(item_amount) as amount FROM expenses WHERE MONTHNAME(date) = '$month' and YEAR(date) = '$year' and business_name = ? "); $stmt->execute(array($shopename)); $rows_services = $stmt->fetchAll(); foreach($rows_services as $service) { $v = $service['amount']; if(empty($v)){ $gg = 0; } else { $gg = $v; } echo "".$gg.","; } }?>] }, ] }); </script> <script type="text/javascript"> Highcharts.chart('container22', { chart: { type: 'column' }, title: { text: '<p>Top Ranked Customers Performance <?php echo $date = date("M-Y");?></p>' }, xAxis: { categories: [<?php $month = date('M'); $Year = date('Y'); $query = "SELECT a.client_id, COUNT(*) AS occurrences,c.first_name,c.last_name FROM appointments a,clients c WHERE a.client_id = c.client_id and a.business_name = '$shopname' and a.active = 'Yes' AND MONTHNAME(a.created) = '$month' AND YEAR(a.created) = '$Year' GROUP BY a.client_id ORDER BY occurrences DESC LIMIT 5"; $result = mysqli_query($new,$query); while($row = mysqli_fetch_array($result)){ $full_name = $row['first_name'].' '.$row['last_name']; echo "['".$full_name."'],"; }?>] }, yAxis: { min: 0, title: { text: 'Count' } }, tooltip: { headerFormat: '<span style="font-size:10px">{point.key}</span><table>', pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' + '<td style="padding:0"><b>{point.y:.1f}</b></td></tr>', footerFormat: '</table>', shared: true, useHTML: true }, plotOptions: { series: { borderWidth: 0, dataLabels: { enabled: true, format: '{point.y:.1f}' } } }, series: [{ name: 'Booked', data: [<?php $month = date('M'); $Year = date('Y'); $query = "SELECT a.client_id, COUNT(*) AS occurrences,c.first_name,c.last_name FROM appointments a,clients c WHERE a.client_id = c.client_id and a.business_name = '$shopname' and a.active = 'Yes' AND MONTHNAME(a.created) = '$month' AND YEAR(a.created) = '$Year' GROUP BY a.client_id ORDER BY occurrences DESC LIMIT 5"; $result = mysqli_query($new, $query); while($row = mysqli_fetch_array($result)){ $occurrences = $row['occurrences']; if(empty($occurrences)){ $newt = 0; } else { $newt = $occurrences; } echo "".$newt.","; } ?>] },] }); </script> <script type="text/javascript"> Highcharts.chart('container50', { chart: { type: 'column' }, title: { text: '<p>Top Ranked Employees Performance - <?php echo $date = date("M-Y");?></p>' }, xAxis: { categories: [<?php $month = date('M'); $Year = date('Y'); $query = "SELECT a.employee_id, COUNT(*) AS occurrences,c.first_name,c.last_name FROM appointments a,employees c WHERE a.employee_id = c.employee_id and a.business_name = '$shopname' and a.active = 'Yes' AND MONTHNAME(a.created) = '$month' AND YEAR(a.created) = '$Year' and a.business_name = '$shopname' GROUP BY a.employee_id ORDER BY occurrences DESC LIMIT 5"; $result1 = mysqli_query($new, $query); while($row = mysqli_fetch_array($result1)){ $full_name = $row['first_name'].' '.$row['last_name']; echo "['".$full_name."'],"; } ?>] }, yAxis: { min: 0, title: { text: 'Count' } }, tooltip: { headerFormat: '<span style="font-size:10px">{point.key}</span><table>', pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' + '<td style="padding:0"><b>{point.y:.1f}</b></td></tr>', footerFormat: '</table>', shared: true, useHTML: true }, plotOptions: { series: { borderWidth: 0, dataLabels: { enabled: true, format: '{point.y:.1f}' } } }, series: [{ name: 'Service', data: [<?php $month = date('M'); $Year = date('Y'); $query = "SELECT a.employee_id, COUNT(*) AS occurrences,c.first_name,c.last_name FROM appointments a,employees c WHERE a.employee_id = c.employee_id and a.active = 'Yes' AND MONTHNAME(a.created) = '$month' AND YEAR(a.created) = '$Year' and a.business_name = '$shopname' GROUP BY a.employee_id ORDER BY occurrences DESC LIMIT 5"; $result2 = mysqli_query($new, $query); while($row = mysqli_fetch_array($result2)){ $occurrencesq = $row['occurrences']; if(empty($occurrencesq)){ $newt = 0; } else { $newt = $occurrencesq; } echo "".$newt.","; }?>] },] }); </script> </body> </html>
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.81 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002