PluginProbe
WPBot – AI ChatBot for Live Support, Lead Generation, WordPress Automation, AI Services / 8.8.0
WPBot – AI ChatBot for Live Support, Lead Generation, WordPress Automation, AI Services v8.8.0
8.8.0 8.7.9 8.7.8 8.7.7 8.7.6 8.7.5 8.7.4 8.7.3 8.7.2 8.7.1 8.7.0 8.6.9 8.6.8 8.6.7 8.6.6 8.6.5 8.6.4 8.6.2 8.6.1 8.6.0 8.5.9 8.5.8 8.5.7 8.5.6 8.5.5 All 536 releases
chatbot / includes / chat-sessions / reports / view / reporting-highlights.php

reporting-highlights.php in WPBot – AI ChatBot for Live Support, Lead Generation, WordPress Automation, AI Services 8.8.0, at includes/chat-sessions/reports/view/reporting-highlights.php

373 lines 10.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if ( ! defined( 'ABSPATH' ) ) { exit; } ?>
2
3 <main id="main" class="main clearfix wpbot-reports-dashboard">
4
5 <div class="pagetitle">
6 <h1><?php echo esc_html__( 'Bot - Reporting Dashboard', 'chatbot' ); ?></h1>
7 </div><!-- End Page Title -->
8
9 <section class="section dashboard">
10 <div class="row">
11
12 <!-- Left side columns -->
13 <div class="col-lg-12">
14 <div class="row">
15
16 <!-- Card 1 -->
17 <div class="col-xxl-4 col-md-6">
18 <div class="card info-card sales-card">
19
20 <div class="card-body">
21 <h5 class="card-title">Total Conversations</span></h5>
22
23 <div class="d-flex align-items-center">
24 <div class="card-icon rounded-circle d-flex align-items-center justify-content-center">
25 <i class="bi bi-wechat"></i>
26 </div>
27 <div class="ps-3">
28 <h6>
29 <?php echo intval( botreports_get_total_conversation_count() ); ?>
30 </h6>
31 <span class="text-success small pt-1 fw-bold">
32 <?php echo intval( botreports_get_todays_conversation_count() ); ?>
33 </span>
34 <span class="text-muted small pt-2 ps-1">Today</span>,
35 <span class="text-success small pt-1 fw-bold">
36 <?php echo intval( botreports_get_weeks_conversation_count() ); ?>
37 </span>
38 <span class="text-muted small pt-2 ps-1">Last Week</span>
39
40 </div>
41 </div>
42 </div>
43
44 </div>
45 </div><!-- End Card 1 -->
46 <!-- Card 1 -->
47 <div class="col-xxl-4 col-md-6">
48 <div class="card info-card sales-card feedback-card feedback-card--like" data-type="like" style="cursor:pointer;">
49 <div class="card-body">
50 <h5 class="card-title">Positive Feedback</h5>
51 <div class="d-flex align-items-center">
52 <div class="card-icon rounded-circle d-flex align-items-center justify-content-center">
53 <i class="bi bi-hand-thumbs-up"></i>
54 </div>
55 <div class="ps-3">
56 <h6><?php echo intval( wpbot_get_report_stats_count()['likes'] ); ?></h6>
57 </div>
58 </div>
59 </div>
60 </div>
61 </div>
62
63 <div class="col-xxl-4 col-md-6">
64 <div class="card info-card sales-card feedback-card feedback-card--dislike" data-type="dislike" style="cursor:pointer;">
65 <div class="card-body">
66 <h5 class="card-title">Negative Feedback</h5>
67 <div class="d-flex align-items-center">
68 <div class="card-icon rounded-circle d-flex align-items-center justify-content-center">
69 <i class="bi bi-hand-thumbs-down"></i>
70 </div>
71 <div class="ps-3">
72 <h6><?php echo intval( wpbot_get_report_stats_count()['dislikes'] ); ?></h6>
73 </div>
74 </div>
75 </div>
76 </div>
77 </div>
78 <div id="feedback-results" class="col-12" style="margin-top:8px;"></div>
79
80
81
82 <!-- Card 2 -->
83 <div class="col-xxl-4 col-md-6">
84 <div class="card info-card sales-card">
85
86 <div class="card-body">
87 <h5 class="card-title">Conversations in Last 30 Days</span></h5>
88
89 <div class="d-flex align-items-center">
90 <div class="card-icon rounded-circle d-flex align-items-center justify-content-center">
91 <i class="bi bi-bar-chart-steps"></i>
92 </div>
93 <div class="ps-3">
94 <h6>
95 <?php echo intval( botreports_get_last30days_conversation_count() ); ?>
96 </h6>
97 </div>
98 </div>
99 </div>
100
101 </div>
102 </div><!-- End Card 2 -->
103
104 <!-- Card 3 -->
105 <div class="col-xxl-4 col-md-6">
106 <div class="card info-card sales-card">
107
108 <div class="card-body">
109 <h5 class="card-title">Average Daily Conversation</span></h5>
110
111 <div class="d-flex align-items-center">
112 <div class="card-icon rounded-circle d-flex align-items-center justify-content-center">
113 <i class="bi bi-bar-chart"></i>
114 </div>
115 <div class="ps-3">
116 <h6><?php echo esc_html( botreports_get_last30days_conversation_average() ); ?></h6>
117 <span class="text-muted small">In</span>
118 <span class="text-success small pt-1 fw-bold">Last 30</span>
119 <span class="text-muted small pt-2 ps-1">Days</span>
120 </div>
121 </div>
122 </div>
123
124 </div>
125 </div><!-- End Card 3 -->
126
127 <!-- Reports: Conversation Density Chart -->
128 <div class="col-lg-12">
129 <div class="card wpbot-report-panel" style="max-width: 100% !important;">
130 <div class="card-body">
131 <h5 class="card-title">Conversation Density Chart</h5>
132
133 <!-- Area Chart -->
134 <div id="areaChart" style="min-height: 365px;"></div>
135
136 <?php
137
138 $densityTable = botreports_get_last30days_conversation_density();
139
140 $dates = array();
141 $conversation_count_in_date = array();
142
143 foreach ( $densityTable as $data ) {
144 array_push( $dates, $data->CONVERSATION_DATE );
145 array_push( $conversation_count_in_date, $data->CONVERSATION_NUM );
146 }
147
148 ?>
149
150 <script>
151 document.addEventListener("DOMContentLoaded", () => {
152 const series = {
153 "monthDataSeries1": {
154 "count": <?php echo wp_json_encode( $conversation_count_in_date ); ?>,
155 "dates": <?php echo wp_json_encode( $dates ); ?>,
156 },
157 }
158 new ApexCharts(document.querySelector("#areaChart"), {
159 series: [{
160 name: "Conversation Count",
161 data: series.monthDataSeries1.count
162 }],
163 chart: {
164 type: 'bar',
165 height: 350,
166 fontFamily: '"DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
167 zoom: {
168 enabled: false
169 }
170 },
171 colors: ['#5B4E96'],
172 plotOptions: {
173 bar: {
174 horizontal: false,
175 borderRadius: 6,
176 columnWidth: '55%'
177 }
178 },
179 dataLabels: {
180 enabled: true,
181 style: { colors: ['#5B4E96'] }
182 },
183 labels: series.monthDataSeries1.dates,
184 xaxis: {
185 type: 'datetime',
186 },
187 yaxis: {
188 opposite: true
189 },
190 grid: {
191 borderColor: '#e4e0f2',
192 strokeDashArray: 4
193 },
194 legend: {
195 horizontalAlign: 'left'
196 }
197 }).render();
198 });
199 </script>
200 <!-- End Area Chart -->
201
202 </div>
203 </div>
204 </div><!-- End Reports: Conversation Density Chart -->
205
206 <!-- Recent Conversations -->
207 <div class="col-lg-12 clearfix">
208 <div class="card wpbot-report-panel" style="max-width: 100% !important;">
209
210 <div class="card-body">
211 <h5 class="card-title">Recent 5 Conversations</h5>
212
213 <?php
214
215 $results = botreports_get_last5_conversations();
216
217 $numberOfRecords = count( $results );
218
219 if ( $numberOfRecords > 0 ) :
220
221 ?>
222
223 <table class="table table-hover wpbot-report-table">
224 <thead>
225 <tr class="first-row text-center">
226 <th scope="col">#</th>
227 <th scope="col">Date & Time</th>
228 <th scope="col">Session ID</th>
229 <th scope="col">Interaction Count</th>
230 <th scope="col">Action</th>
231 </tr>
232 </thead>
233 <tbody>
234
235 <?php
236
237 $counter = count( $results ) === 5 ? 5 : count( $results );
238
239 foreach ( $results as $result ) {
240
241 ?>
242
243 <tr class="text-center">
244 <th scope="row">
245 <a href="<?php echo esc_url( admin_url( "admin.php?page=wbcs-botsessions-page&userid={$result->user_id}" ) ); ?>">
246 <?php echo esc_html( $counter ); ?>
247 </a>
248 </th>
249 <td><?php echo esc_html( gmdate( 'd M, Y g:i A', strtotime( $result->date ) ) ); ?></td>
250 <td><?php echo esc_html( $result->session_id ); ?></td>
251 <td><?php echo intval( get_user_interaction_count( $result->conversation ) ); ?></td>
252 <td>
253 <a href="<?php echo esc_url( admin_url( "admin.php?page=wbcs-botsessions-page&userid={$result->user_id}" ) ); ?>" class="btn btn-primary">
254 <i class="bi bi-eyeglasses"></i> View Chat
255 </a>
256 </td>
257 </tr>
258
259 <?php
260
261 --$counter;
262
263 }
264
265 ?>
266
267
268 </tbody>
269
270 </table>
271
272 <?php else : ?>
273
274 <div class="alert alert-info">No chat records were found in the database.</div>
275
276 <?php endif; ?>
277
278 </div>
279
280 </div>
281 </div><!-- End Recent Conversations -->
282 <!-- Reports Conversations -->
283 <div class="col-lg-12 clearfix">
284 <div class="card wpbot-report-panel" style="max-width: 100% !important;">
285
286 <div class="card-body">
287 <h5 class="card-title">Conversations Reports</h5>
288
289 <?php
290
291 $reports_count = wpbot_get_report_stats_count()['reports_only'];
292
293
294
295 if ( $reports_count > 0 ) :
296
297 ?>
298
299 <table class="table table-hover wpbot-report-table">
300 <thead>
301 <tr class="first-row text-center">
302 <th scope="col">#</th>
303 <th scope="col">Id</th>
304 <th scope="col">Email</th>
305 <th scope="col">Message</th>
306 <th scope="col">Report Text</th>
307 <th scope="col">Date</th>
308 </tr>
309 </thead>
310 <tbody>
311
312 <?php
313 $rests = wpbot_get_reports_list();
314 $counter = count( $rests ) === 5 ? 5 : count( $rests );
315
316 foreach ( $rests as $report ) {
317 $meta = maybe_unserialize( $report['meta_info'] );
318 $email = isset($meta['email']) ? $meta['email'] : '';
319 $report_text = isset($meta['report_text']) ? $meta['report_text'] : '';
320 ?>
321
322 <tr class="text-center">
323 <th scope="row">
324 <?php echo esc_html( $counter ); ?>
325 </th>
326 <td><?php echo esc_html( $report['id'] ); ?></td>
327 <td><?php echo esc_html( $email ); ?></td>
328 <td><?php echo esc_html( $report['message'] ); ?></td>
329 <td><?php echo esc_html( $report_text ); ?></td>
330 <td><?php echo esc_html( $report['created_at'] ); ?></td>
331 </tr>
332
333 <?php
334
335 --$counter;
336
337 }
338
339 ?>
340
341
342 </tbody>
343
344 </table>
345
346 <?php else : ?>
347
348 <div class="alert alert-info">No chat records were found in the database.</div>
349
350 <?php endif; ?>
351
352 </div>
353
354 </div>
355 </div><!-- End Reports Conversations -->
356
357 </div>
358
359 <div class="wpbot-report-actions">
360 <a href="<?php echo esc_url( admin_url( 'admin.php?page=wbcs-botsessions-page' ) ); ?>" class="btn btn-primary">
361 <i class="bi bi-gear-wide-connected me-1"></i> Manage All Conversations
362 </a>
363
364 <button id="wpbot-clear-feedback" class="btn btn-danger"><i class="bi bi-trash me-1"></i>Clear All Feedback</button>
365 <div id="wpbot-clear-feedback-msg"></div>
366 </div>
367
368 </div><!-- End Left side columns -->
369
370 </div>
371 </section>
372
373 </main><!-- End #main -->