← All changes
|
includes/chat-sessions/reports/view/partials/view-single-chat.php
+12
-10
8.7.2
→
8.8.2
View file →
| @@ -1,14 +1,16 @@ | ||
| 1 | 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 | -<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css" integrity="sha384-4LISF5TTJX/fLmGSxO53rV4miRxdg84mZsxmO8Rx5jGtp/LbrixFETvWa5a6sESd" crossorigin="anonymous"> | |
| 4 | 2 | |
| 5 | 3 | <?php |
| 6 | 4 | global $wpdb; |
| 7 | 5 | |
| 8 | - $userid = absint( $_GET['userid'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended | |
| 6 | + $tableuser = $wpdb->prefix . 'wpbot_user'; | |
| 7 | + $tableconversation = $wpdb->prefix . 'wpbot_conversation'; | |
| 8 | + $table_user_sql = '`' . esc_sql( $tableuser ) . '`'; | |
| 9 | + $table_conv_sql = '`' . esc_sql( $tableconversation ) . '`'; | |
| 10 | + $userid = isset( $_GET['userid'] ) ? absint( wp_unslash( $_GET['userid'] ) ) : 0; // phpcs:ignore WordPress.Security.NonceVerification.Recommended | |
| 9 | 11 | |
| 10 | - $userinfo = $wpdb->get_row( $wpdb->prepare( 'SELECT * FROM %i WHERE id = %d', $tableuser, $userid ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching | |
| 12 | + $userinfo = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$table_user_sql} WHERE id = %d", $userid ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared, PluginCheck.Security.DirectDB.UnescapedDBParameter | |
| 11 | 13 | |
| 12 | 14 | $delurl = wp_nonce_url( admin_url( 'admin.php?page=wbcs-botsessions-page&userid=' . $userinfo->id . '&act=delete' ), 'wpcs_delete_session_' . $userinfo->id ); |
| 13 | 15 | |
| 14 | 16 | $export = wp_nonce_url( admin_url( 'admin-post.php?action=wpbot_conversations.csv&user_id=' . $userid ), 'wpbot_conversations_csv' ); |
| @@ -22,12 +24,12 @@ | ||
| 22 | 24 | <div class="wpbot-session-meta-card__header"> |
| 23 | 25 | <h2><?php echo esc_html__( 'Session Details', 'chatbot' ); ?></h2> |
| 24 | 26 | <div class="wpbot-session-meta-card__actions"> |
| 25 | 27 | <a href="<?php echo esc_url( $delurl ); ?>" class="btn btn-danger" onclick="return confirm('Are you sure?')"> |
| 26 | - <i class="bi bi-trash me-1"></i> <?php echo esc_html__( 'Delete', 'chatbot' ); ?> | |
| 28 | + <?php echo esc_html__( 'Delete', 'chatbot' ); ?> | |
| 27 | 29 | </a> |
| 28 | 30 | <a href="<?php echo esc_url( $export ); ?>" class="btn btn-primary"> |
| 29 | - <i class="bi bi-filetype-csv me-1"></i> <?php echo esc_html__( 'Export', 'chatbot' ); ?> | |
| 31 | + <?php echo esc_html__( 'Export', 'chatbot' ); ?> | |
| 30 | 32 | </a> |
| 31 | 33 | </div> |
| 32 | 34 | </div> |
| 33 | 35 | |
| @@ -49,15 +51,15 @@ | ||
| 49 | 51 | <span class="wpbot-session-meta-item__value"><?php echo ( $userinfo->phone != '' ) ? esc_html( $userinfo->phone ) : '---'; ?></span> |
| 50 | 52 | </div> |
| 51 | 53 | <div class="wpbot-session-meta-item"> |
| 52 | 54 | <span class="wpbot-session-meta-item__label"><?php echo esc_html__( 'Date and Time', 'chatbot' ); ?></span> |
| 53 | - <span class="wpbot-session-meta-item__value"><?php echo esc_html( date( 'M d, Y h:i:s A', strtotime( $userinfo->date ) ) ); ?></span> | |
| 55 | + <span class="wpbot-session-meta-item__value"><?php echo esc_html( gmdate( 'M d, Y h:i:s A', strtotime( $userinfo->date ) ) ); ?></span> | |
| 54 | 56 | </div> |
| 55 | 57 | </div> |
| 56 | 58 | </div> |
| 57 | 59 | |
| 58 | 60 | <?php |
| 59 | - $result = $wpdb->get_row( $wpdb->prepare( 'SELECT * FROM %i WHERE user_id = %d', $tableconversation, $userid ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching | |
| 61 | + $result = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$table_conv_sql} WHERE user_id = %d", $userid ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared | |
| 60 | 62 | |
| 61 | 63 | if ( ! empty( $result ) ) : |
| 62 | 64 | |
| 63 | 65 | $qcld_wb_chatbot_theme = get_option( 'qcld_wb_chatbot_theme' ); |
| @@ -76,9 +78,9 @@ | ||
| 76 | 78 | <div class="single-chat-container-wrapper wpbot-session-chat-card"> |
| 77 | 79 | <div class="wpbot-session-chat-card__header"> |
| 78 | 80 | <h3><?php echo esc_html__( 'Chat Messages', 'chatbot' ); ?></h3> |
| 79 | 81 | <a href="<?php echo esc_url( admin_url( 'admin.php?page=wbcs-botsessions-page' ) ); ?>" class="btn btn-primary wpbot-session-back-btn"> |
| 80 | - <i class="bi bi-arrow-left me-1"></i> <?php echo esc_html__( 'Conversation List', 'chatbot' ); ?> | |
| 82 | + <?php echo esc_html__( 'Conversation List', 'chatbot' ); ?> | |
| 81 | 83 | </a> |
| 82 | 84 | </div> |
| 83 | 85 | <div class="wp-chatbot-messages-wrapper"> |
| 84 | 86 | <?php |
| @@ -112,9 +114,9 @@ | ||
| 112 | 114 | </div> |
| 113 | 115 | </div> |
| 114 | 116 | |
| 115 | 117 | <button type="button" class="wpbot-reply-fab" id="wpbot_reply_fab" aria-expanded="false" aria-controls="wpbot_reply_panel"> |
| 116 | - <i class="bi bi-envelope" aria-hidden="true"></i> | |
| 118 | + | |
| 117 | 119 | <span><?php echo esc_html__( 'Reply via Email', 'chatbot' ); ?></span> |
| 118 | 120 | </button> |
| 119 | 121 | |
| 120 | 122 | <div class="wpbot-reply-panel" id="wpbot_reply_panel" hidden> |