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