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
📄ticket_tags.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$reportdata["title"] = "Ticket Tags Overview";
11$reportdata["description"] = "This report provides an overview of ticket tags assigned to tickets for a given date range";
12
13$range = App::getFromRequest('range');
14if (!$range) {
15 $today = Carbon::today()->endOfDay();
16 $lastWeek = Carbon::today()->subMonth()->startOfDay();
17 $range = $lastWeek->toAdminDateFormat() . ' - ' . $today->toAdminDateFormat();
18}
19$dateRange = Carbon::parseDateRangeValue($range);
20$startdate = $dateRange['from'];
21$enddate = $dateRange['to'];
22
23$reportdata['headertext'] = '';
24if (!$print) {
25 $reportdata['headertext'] = <<<HTML
26<form method="post" action="reports.php?report={$report}&currencyid={$currencyid}&calculate=true">
27 <div class="report-filters-wrapper">
28 <div class="inner-container">
29 <h3>Filters</h3>
30 <div class="row">
31 <div class="col-md-3 col-sm-6">
32 <div class="form-group">
33 <label for="inputFilterDate">{$dateRangeText}</label>
34 <div class="form-group date-picker-prepend-icon">
35 <label for="inputFilterDate" class="field-icon">
36 <i class="fal fa-calendar-alt"></i>
37 </label>
38 <input id="inputFilterDate"
39 type="text"
40 name="range"
41 value="{$range}"
42 class="form-control date-picker-search"
43 />
44 </div>
45 </div>
46 </div>
47 </div>
48 <button type="submit" class="btn btn-primary">
49 {$aInt->lang('reports', 'generateReport')}
50 </button>
51 </div>
52 </div>
53</form>
54HTML;
55}
56
57$reportdata["tableheadings"][] = "Tag";
58$reportdata["tableheadings"][] = "Count";
59
60$results = Capsule::table('tbltickettags')
61 ->select(Capsule::raw('tbltickettags.tag, count(*) as `count`'))
62 ->join('tbltickets', 'tbltickets.id', '=', 'tbltickettags.ticketid')
63 ->whereBetween(
64 'tbltickets.date',
65 [
66 $startdate->toDateTimeString(),
67 $enddate->toDateTimeString(),
68 ]
69 )
70 ->groupBy('tbltickettags.tag')
71 ->orderBy('count', 'desc')
72 ->get()
73 ->all();
74
75foreach ($results as $result) {
76 $tag = $result->tag;
77 $count = $result->count;
78
79 $reportdata["tablevalues"][] = [$tag, $count];
80 $chartdata['rows'][] = [
81 'c' => [
82 ['v' => $tag],
83 ['v' => (int) $count, 'f' => $count],
84 ],
85 ];
86}
87
88$chartdata['cols'][] = array('label'=>'Tag','type'=>'string');
89$chartdata['cols'][] = array('label'=>'Count','type'=>'number');
90
91$args = array();
92$args['legendpos'] = 'right';
93
94$reportdata["headertext"] .= $chart->drawChart('Pie',$chartdata,$args,'300px');
95