[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: dash-statistics.php
<style type="text/css"> .card { border-radius: 10px; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); transition: transform 0.2s ease-in-out; } .card:hover { transform: translateY(-5px); } .badge-soft-primary { background: rgba(0, 123, 255, 0.1); color: #007bff; font-weight: bold; padding: 5px 10px; border-radius: 5px; } .text-xs { font-size: 12px; font-weight: 600; } .progress { height: 6px; border-radius: 4px; } .progress-bar { border-radius: 4px; transition: width 0.4s ease-in-out; } h2 { font-size: 1.8rem; font-weight: bold; color: #333; } </style> <?php $shopname = $_SESSION['business_name_Xw211qAAsq4']; $username = $_SESSION['username_Xw211qAAsq4']; ?> <?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-md-6 col-xl-3"> <div class="card"> <div class="card-body"> <div class="mb-4"> <span class="badge badge-soft-primary float-right">All Time</span> <div class="text-xs font-weight-bold text-primary text-uppercase mb-1"> Clients</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 $date = date("Y-m-d"); $stat = $con->prepare("SELECT COUNT(client_id) FROM clients WHERE business_name = ?"); $stat->execute(array($shopname)); $ts = $stat->fetchColumn(); if(empty($ts)){ echo $ts = 0; } else { echo $ts = $ts ; } ?> </h2> </div> <div class="col-4 text-right"> <!--<span class="text-muted">17.8% <i class="mdi mdi-arrow-down text-success"></i></span>--> <!-- <div class="easypiechart" id="easypiechart-blue" data-percent="<?php echo $ts;?>" ><span class="percent"><?php if($ts==""){ echo "0"; } else { echo $ts; } ?></span></div> --> </div> </div> <div class="progress shadow-sm" style="height: 5px;"> <div class="progress-bar bg-info" role="progressbar" style="width: 57%;"></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"> <span class="badge badge-soft-primary float-right">All Time</span> <div class="text-xs font-weight-bold text-info text-uppercase mb-1"> Employees</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 $date = date("Y-m-d"); $stat = $con->prepare("SELECT COUNT(employee_id) FROM employees WHERE business_name = ?"); $stat->execute(array($shopname)); $ts = $stat->fetchColumn(); if(empty($ts)){ echo $ts = 0; } else { echo $ts = $ts ; } ?> </h2> </div> </div> <div class="progress shadow-sm" style="height: 5px;"> <div class="progress-bar bg-info" role="progressbar" style="width: 57%;"></div> </div> </div> </div> </div> <div class="col-md-6 col-xl-3"> <div class="card"> <div class="card-body"> <div class="mb-4"> <div class="mb-4"> <span class="badge badge-soft-primary float-right">All Time</span> <div class="text-xs font-weight-bold text-success text-uppercase mb-1"> Services</div> </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 $date = date("Y-m-d"); $stat = $con->prepare("SELECT COUNT(service_id) FROM services WHERE business_name = ?"); $stat->execute(array($shopname)); $ts = $stat->fetchColumn(); if(empty($ts)){ echo $ts = 0; } else { echo $ts = $ts ; } ?> </h2> </div> </div> <div class="progress shadow-sm" style="height: 5px;"> <div class="progress-bar bg-success" role="progressbar" style="width: 57%;"></div> </div> </div> </div> </div> <div class="col-md-6 col-xl-3"> <div class="card"> <div class="card-body"> <div class="mb-4"> <span class="badge badge-soft-primary float-right">All Time</span> <div class="text-xs font-weight-bold text-warning text-uppercase mb-1"> Services done</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 $stat = $con->prepare("SELECT COUNT(appointment_id) FROM appointments WHERE business_name = ? and canceled = '0' and active = 'Yes'"); $stat->execute(array($shopname)); $ts = $stat->fetchColumn(); if(empty($ts)){ echo $ts = 0; } else { echo $ts = $ts ; } ?> </h2> </div> </div> <div class="progress shadow-sm" style="height: 5px;"> <div class="progress-bar bg-warning" role="progressbar" style="width: 57%;"></div> </div> </div> </div> </div> <div class="col-md-6 col-xl-3"> <div class="card"> <div class="card-body"> <div class="mb-4"> <span class="badge badge-soft-primary float-right">Today</span> <div class="text-xs font-weight-bold text-success text-uppercase mb-1"> Services done</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 $date = date("Y-m-d"); $stat = $con->prepare("SELECT COUNT(appointment_id) FROM appointments WHERE business_name = ? and created = ?"); $stat->execute(array($shopname,$date)); $ts = $stat->fetchColumn(); if(empty($ts)){ echo $ts = 0; } else { echo $ts = $ts ; } ?> </h2> </div> </div> <div class="progress shadow-sm" style="height: 5px;"> <div class="progress-bar bg-success" role="progressbar" style="width: 57%;"></div> </div> </div> </div> </div> <div class="col-md-6 col-xl-3"> <div class="card"> <div class="card-body"> <div class="mb-4"> <span class="badge badge-soft-primary float-right">Today</span> <div class="text-xs font-weight-bold text-warning text-uppercase mb-1"> Products sold</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 $date = date("Y-m-d"); $statr = $con->prepare("SELECT COUNT(po_id) FROM product_sales WHERE sold_date = ? and business_name = ?"); $statr->execute(array($date,$shopname)); $tp = $statr->fetchColumn(); if(empty($tp)){ echo $tp = 0; } else { echo $tp = $tp ; } ?> </h2> </div> </div> <div class="progress shadow-sm" style="height: 5px;"> <div class="progress-bar bg-warning" role="progressbar" style="width: 57%;"></div> </div> </div> </div> </div> <div class="col-md-6 col-xl-3"> <div class="card"> <div class="card-body"> <div class="mb-4"> <span class="badge badge-soft-primary float-right">All Time</span> <div class="text-xs font-weight-bold text-danger text-uppercase mb-1"> <a href="out-of-stock"> Out of Stock </a></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 $statr = mysqli_query($new,"SELECT COUNT(pro_id) AS pid FROM products WHERE qty <= 0 and business_name = '$shopname'"); $fetch = mysqli_fetch_array($statr); $ftch_row = $fetch['pid']; if(empty($ftch_row)){ echo $dbqty = 0; } else { echo $dbqty = $ftch_row ; } ?> </h2> </div> </div> <div class="progress shadow-sm" style="height: 5px;"> <div class="progress-bar bg-warning" role="progressbar" style="width: 57%;"></div> </div> </div> </div> </div> </div> <?php } elseif($namee != "Admin") { ?> <div class="row"> <div class="col-md-6 col-xl-3"> <div class="card"> <div class="card-body"> <div class="mb-4"> <span class="badge badge-soft-primary float-right">All Time</span> <div class="text-xs font-weight-bold text-primary text-uppercase mb-1"> Clients</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 $date = date("Y-m-d"); $stat = $con->prepare("SELECT COUNT(client_id) FROM clients WHERE business_name = ?"); $stat->execute(array($shopname)); $ts = $stat->fetchColumn(); if(empty($ts)){ echo $ts = 0; } else { echo $ts = $ts ; } ?> </h2> </div> <div class="col-4 text-right"> <!--<span class="text-muted">17.8% <i class="mdi mdi-arrow-down text-success"></i></span>--> <!-- <div class="easypiechart" id="easypiechart-blue" data-percent="<?php echo $ts;?>" ><span class="percent"><?php if($ts==""){ echo "0"; } else { echo $ts; } ?></span></div> --> </div> </div> <div class="progress shadow-sm" style="height: 5px;"> <div class="progress-bar bg-info" role="progressbar" style="width: 57%;"></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"> <span class="badge badge-soft-primary float-right">All Time</span> <div class="text-xs font-weight-bold text-info text-uppercase mb-1"> Employees</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 $date = date("Y-m-d"); $stat = $con->prepare("SELECT COUNT(employee_id) FROM employees WHERE business_name = ?"); $stat->execute(array($shopname)); $ts = $stat->fetchColumn(); if(empty($ts)){ echo $ts = 0; } else { echo $ts = $ts ; } ?> </h2> </div> </div> <div class="progress shadow-sm" style="height: 5px;"> <div class="progress-bar bg-info" role="progressbar" style="width: 57%;"></div> </div> </div> </div> </div> <div class="col-md-6 col-xl-3"> <div class="card"> <div class="card-body"> <div class="mb-4"> <div class="mb-4"> <span class="badge badge-soft-primary float-right">All Time</span> <div class="text-xs font-weight-bold text-success text-uppercase mb-1"> Services</div> </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 $date = date("Y-m-d"); $stat = $con->prepare("SELECT COUNT(service_id) FROM services WHERE business_name = ?"); $stat->execute(array($shopname)); $ts = $stat->fetchColumn(); if(empty($ts)){ echo $ts = 0; } else { echo $ts = $ts ; } ?> </h2> </div> </div> <div class="progress shadow-sm" style="height: 5px;"> <div class="progress-bar bg-success" role="progressbar" style="width: 57%;"></div> </div> </div> </div> </div> <div class="col-md-6 col-xl-3"> <div class="card"> <div class="card-body"> <div class="mb-4"> <span class="badge badge-soft-primary float-right">All Time</span> <div class="text-xs font-weight-bold text-warning text-uppercase mb-1"> Services done</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 $stat = $con->prepare("SELECT COUNT(appointment_id) FROM appointments WHERE business_name = ? and canceled = 0 and active = 'Yes'"); $stat->execute(array($shopname)); $ts = $stat->fetchColumn(); if(empty($ts)){ echo $ts = 0; } else { echo $ts = $ts ; } ?> </h2> </div> </div> <div class="progress shadow-sm" style="height: 5px;"> <div class="progress-bar bg-warning" role="progressbar" style="width: 57%;"></div> </div> </div> </div> </div> <div class="col-md-6 col-xl-3"> <div class="card"> <div class="card-body"> <div class="mb-4"> <span class="badge badge-soft-primary float-right">Today</span> <div class="text-xs font-weight-bold text-success text-uppercase mb-1"> Services done</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 $date = date("Y-m-d"); $stat = $con->prepare("SELECT COUNT(appointment_id) FROM appointments WHERE business_name = ? and created = ?"); $stat->execute(array($shopname,$date)); $ts = $stat->fetchColumn(); if(empty($ts)){ echo $ts = 0; } else { echo $ts = $ts ; } ?> </h2> </div> </div> <div class="progress shadow-sm" style="height: 5px;"> <div class="progress-bar bg-success" role="progressbar" style="width: 57%;"></div> </div> </div> </div> </div> <div class="col-md-6 col-xl-3"> <div class="card"> <div class="card-body"> <div class="mb-4"> <span class="badge badge-soft-primary float-right">Today</span> <div class="text-xs font-weight-bold text-warning text-uppercase mb-1"> Product sold</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 $date = date("Y-m-d"); $statr = $con->prepare("SELECT COUNT(po_id) FROM product_sales WHERE sold_date = ? and business_name = ?"); $statr->execute(array($date,$shopname)); $tp = $statr->fetchColumn(); if(empty($tp)){ echo $tp = 0; } else { echo $tp = $tp ; } ?> </h2> </div> </div> <div class="progress shadow-sm" style="height: 5px;"> <div class="progress-bar bg-warning" role="progressbar" style="width: 57%;"></div> </div> </div> </div> </div> <div class="col-md-6 col-xl-3"> <div class="card"> <div class="card-body"> <div class="mb-4"> <span class="badge badge-soft-primary float-right">All Time</span> <div class="text-xs font-weight-bold text-danger text-uppercase mb-1"> Out of Stock </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 $statr = mysqli_query($new,"SELECT COUNT(pro_id) AS pid FROM products WHERE qty <= 0 and business_name = '$shopname'"); $fetch = mysqli_fetch_array($statr); $ftch_row = $fetch['pid']; if(empty($ftch_row)){ echo $dbqty = 0; } else { echo $dbqty = $ftch_row ; } ?> </h2> </div> </div> <div class="progress shadow-sm" style="height: 5px;"> <div class="progress-bar bg-warning" role="progressbar" style="width: 57%;"></div> </div> </div> </div> </div> </div> <?php } else {?> <div class="row"> <div class="col-md-6 col-xl-3"> <div class="card"> <div class="card-body"> <div class="mb-4"> <span class="badge badge-soft-primary float-right">Today</span> <div class="text-xs font-weight-bold text-success text-uppercase mb-1"> Services done</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 $date = date("Y-m-d"); $stat = $con->prepare("SELECT COUNT(appointment_id) FROM appointments WHERE business_name = ? and created = ?"); $stat->execute(array($shopname,$date)); $ts = $stat->fetchColumn(); if(empty($ts)){ echo $ts = 0; } else { echo $ts = $ts ; } ?> </h2> </div> </div> <div class="progress shadow-sm" style="height: 5px;"> <div class="progress-bar bg-success" role="progressbar" style="width: 57%;"></div> </div> </div> </div> </div> <div class="col-md-6 col-xl-3"> <div class="card"> <div class="card-body"> <div class="mb-4"> <span class="badge badge-soft-primary float-right">Today</span> <div class="text-xs font-weight-bold text-warning text-uppercase mb-1"> Products sold</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 $date = date("Y-m-d"); $statr = $con->prepare("SELECT COUNT(po_id) FROM product_sales WHERE sold_date = ? and business_name = ?"); $statr->execute(array($date,$shopname)); $tp = $statr->fetchColumn(); if(empty($tp)){ echo $tp = 0; } else { echo $tp = $tp ; } ?> </h2> </div> </div> <div class="progress shadow-sm" style="height: 5px;"> <div class="progress-bar bg-warning" role="progressbar" style="width: 57%;"></div> </div> </div> </div> </div> <div class="col-md-6 col-xl-3"> <div class="card"> <div class="card-body"> <div class="mb-4"> <span class="badge badge-soft-primary float-right">All Time</span> <div class="text-xs font-weight-bold text-danger text-uppercase mb-1"> Out of Stock </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 $statr = mysqli_query($new,"SELECT COUNT(pro_id) AS pid FROM products WHERE qty <= 0 and business_name = '$shopname'"); $fetch = mysqli_fetch_array($statr); $ftch_row = $fetch['pid']; if(empty($ftch_row)){ echo $dbqty = 0; } else { echo $dbqty = $ftch_row ; } ?> </h2> </div> </div> <div class="progress shadow-sm" style="height: 5px;"> <div class="progress-bar bg-warning" role="progressbar" style="width: 57%;"></div> </div> </div> </div> </div> </div> <?php }?> <!-- end row-->
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.69 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