run:R W Run
2.59 KB
2026-04-08 19:26:14
R W Run
4.57 KB
2026-04-08 19:26:13
R W Run
3.26 KB
2026-04-08 19:26:14
R W Run
4.66 KB
2026-04-08 19:26:15
R W Run
4.58 KB
2026-04-08 19:26:14
R W Run
6.06 KB
2026-04-08 19:26:13
R W Run
5.8 KB
2026-04-08 19:26:15
R W Run
2.22 KB
2026-04-08 19:26:13
R W Run
6.06 KB
2026-04-08 19:26:15
R W Run
9.07 KB
2026-04-08 19:26:14
R W Run
4.96 KB
2026-04-08 19:26:13
R W Run
2.95 KB
2026-04-08 19:26:14
R W Run
3.19 KB
2026-04-08 19:26:14
R W Run
6.09 KB
2026-04-08 19:26:15
R W Run
8.4 KB
2026-04-08 19:26:12
R W Run
8.92 KB
2026-04-08 19:26:13
R W Run
4.26 KB
2026-04-08 19:26:13
R W Run
42 By
2026-04-08 19:26:12
R W Run
10.36 KB
2026-04-08 19:26:15
R W Run
3.45 KB
2026-04-08 19:26:15
R W Run
4.05 KB
2026-04-08 19:26:14
R W Run
4.36 KB
2026-04-08 19:26:15
R W Run
4.43 KB
2026-04-08 19:26:14
R W Run
1.55 KB
2026-04-08 19:26:14
R W Run
3.53 KB
2026-04-08 19:26:15
R W Run
5.65 KB
2026-04-08 19:26:14
R W Run
3.63 KB
2026-04-08 19:26:13
R W Run
9.7 KB
2026-04-08 19:26:15
R W Run
4.35 KB
2026-04-08 19:26:14
R W Run
7.92 KB
2026-04-08 19:26:14
R W Run
2.23 KB
2026-04-08 19:26:13
R W Run
5.31 KB
2026-04-08 19:26:13
R W Run
4.5 KB
2026-04-08 19:26:13
R W Run
4.11 KB
2026-04-08 19:26:15
R W Run
2.99 KB
2026-04-08 19:26:14
R W Run
2.36 KB
2026-04-08 19:26:15
R W Run
7.08 KB
2026-04-08 19:26:12
R W Run
6.98 KB
2026-04-08 19:26:14
R W Run
error_log
📄new_customers.php
1<?php
2
3use WHMCS\Carbon;
4use WHMCS\Database\Capsule;
5
6if (!defined("WHMCS")) {
7 die("This file cannot be accessed directly");
8}
9
10/** @var string $requeststr */
11
12$reportdata["title"] = "New Customers";
13$reportdata["description"] = "This report shows the total number of new customers, orders and complete orders and compares each of these to the previous year on the graph.";
14
15$reportdata["tableheadings"] = array("Month","New Signups","Orders Placed","Orders Completed");
16
17$show = App::getFromRequest('show');
18if (!$show) {
19 $show = 'signups';
20}
21
22for ($rawmonth = 1; $rawmonth <= 12; $rawmonth++) {
23 $dateRange = Carbon::create($year, $rawmonth, 1);
24 $dateRangeLastYear = Carbon::create(($year - 1), $rawmonth, 1);
25
26 $firstOfMonth = $dateRange->firstOfMonth()->toDateTimeString();
27 $firstOfMonth2 = $dateRangeLastYear->firstOfMonth()->toDateTimeString();
28 $lastOfMonth = $dateRange->endOfMonth()->toDateTimeString();
29 $lastOfMonth2 = $dateRangeLastYear->endOfMonth()->toDateTimeString();
30
31 $newsignups = Capsule::table('tblclients')
32 ->whereBetween(
33 'datecreated',
34 [
35 $firstOfMonth,
36 $lastOfMonth
37 ]
38 )->count();
39
40 $totalorders = Capsule::table('tblorders')
41 ->whereBetween(
42 'date',
43 [
44 $firstOfMonth,
45 $lastOfMonth
46 ]
47 )->count();
48
49 $completedorders = Capsule::table('tblorders')
50 ->where('status', 'Active')
51 ->whereBetween(
52 'date',
53 [
54 $firstOfMonth,
55 $lastOfMonth
56 ]
57 )->count();
58
59 $newsignups2 = Capsule::table('tblclients')
60 ->whereBetween(
61 'datecreated',
62 [
63 $firstOfMonth2,
64 $lastOfMonth2
65 ]
66 )->count();
67
68 $totalorders2 = Capsule::table('tblorders')
69 ->whereBetween(
70 'date',
71 [
72 $firstOfMonth2,
73 $lastOfMonth2
74 ]
75 )->count();
76
77 $completedorders2 = Capsule::table('tblorders')
78 ->where('status', 'Active')
79 ->whereBetween(
80 'date',
81 [
82 $firstOfMonth2,
83 $lastOfMonth2
84 ]
85 )->count();
86
87 $reportdata["tablevalues"][] = array(
88 $months[$rawmonth] . ' ' . $year,
89 $newsignups,
90 $totalorders,
91 $completedorders
92 );
93
94 switch ($show) {
95 case 'orders':
96 $chartdata['rows'][] = array(
97 'c' => array(
98 array('v' => $months[$rawmonth]),
99 array('v' => (int) $totalorders),
100 array('v' => (int) $totalorders2),
101 ),
102 );
103 break;
104 case 'orderscompleted':
105 $chartdata['rows'][] = array(
106 'c' => array(
107 array('v' => $months[$rawmonth]),
108 array('v' => (int) $completedorders),
109 array('v' => (int) $completedorders2),
110 ),
111 );
112 break;
113 case 'show':
114 default:
115 $chartdata['rows'][] = array(
116 'c'=>array(
117 array('v' => $months[$rawmonth]),
118 array('v' => (int) $newsignups),
119 array('v' => (int) $newsignups2),
120 ),
121 );
122 }
123}
124
125$chartdata['cols'][] = array('label' => 'Month','type' => 'string');
126$chartdata['cols'][] = array('label' => $year,'type' => 'number');
127$chartdata['cols'][] = array('label' => ($year - 1),'type' => 'number');
128
129$args = array();
130if (!$show || $show=="signups") {
131 $args['title'] = 'New Signups';
132 $args['colors'] = '#3366CC,#888888';
133}
134if ($show=="orders") {
135 $args['title'] = 'Orders Placed';
136 $args['colors'] = '#DC3912,#888888';
137}
138if ($show=="orderscompleted") {
139 $args['title'] = 'Orders Completed';
140 $args['colors'] = '#FF9900,#888888';
141}
142$args['legendpos'] = 'right';
143
144$reportdata["headertext"] = $chart->drawChart('Area', $chartdata, $args, '400px').
145 '<p align="center">'.
146 '<a href="reports.php' . $requeststr . '&show=signups">New Signups</a>'
147 . ' | <a href="reports.php' . $requeststr . '&show=orders">Orders Placed</a>'
148 . ' | <a href="reports.php' . $requeststr . '&show=orderscompleted">Orders Completed</a>'
149 . '</p>';
150
151$reportdata["yearspagination"] = true;
152