PluginProbe
WPBot – AI ChatBot for Live Support, Lead Generation, WordPress Automation, AI Services / 3.3.6
WPBot – AI ChatBot for Live Support, Lead Generation, WordPress Automation, AI Services v3.3.6
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 8.5.4 8.5.3 All 534 releases
chatbot / includes / simple_text_response.php

simple_text_response.php in WPBot – AI ChatBot for Live Support, Lead Generation, WordPress Automation, AI Services 3.3.6, at includes/simple_text_response.php

163 lines 5.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 exit;
4 }
5 global $wpdb;
6 ?>
7 <style>
8 .wpbot_dashboard_header {
9 margin-right: unset !important;
10 margin-left: unset !important;
11 background: #32373c;
12 color: #fff;
13 text-align: center;
14 border-radius: 5px 5px 0px 0px;
15 }
16 .wpbot_addons_section {
17 margin-right: unset !important;
18 margin-left: unset !important;
19 margin-bottom: 10px;
20 background: #32373c;
21 padding-bottom: 20px;
22 border-radius: 0px 0px 5px 5px;
23 }
24 .wpbot_single_addon_wrapper2 {
25 background: #fff;
26 padding: 20px;
27 }
28 .wp-chatbot-admin-header, .wp-chatbot-admin-footer {
29 padding: 25px;
30 }
31 .wpbot_dashboard_header h1 {
32 font-size: 30px;
33 line-height: 100px;
34 margin: 0px;
35 color: #fff;
36 }
37 .container {
38 width: 1170px;
39 padding-right: 15px;
40 padding-left: 15px;
41 }
42 </style>
43
44
45 <?php if(isset($_GET['action']) && $_GET['action']=='edit'):
46 $hasEdit = false;
47 if(isset($_GET['query']) && $_GET['query']!=''){
48 $hasEdit = true;
49 $id = sanitize_text_field($_GET['query']);
50 $table = $wpdb->prefix.'wpbot_response';
51 $data = $wpdb->get_row("select * from $table where 1 and id = '".$id."'");
52
53 }
54
55 ?>
56 <div class="qcwrap">
57 <div class="wp-chatbot-wrap">
58 <div class="wpbot_dashboard_header container"><h1><?php echo ($hasEdit?'Edit':'Add') ?> Response</h1></div>
59 <form method="post" action="">
60 <div class="wpbot_addons_section container">
61 <div class="wpbot_single_addon_wrapper2">
62 <table class="form-table">
63 <tbody>
64 <tr valign="top">
65 <th scope="row">Query</th>
66 <td>
67 <input type="text" name="qc_bot_str_query" value="<?php echo ($hasEdit?$data->query:''); ?>" style="width: 400px;" required />
68 <br><i>*Required. Add the query here.</i>
69 </td>
70 </tr>
71
72 <tr valign="top">
73 <th scope="row">Response</th>
74 <td>
75 <textarea id="qlcd_wp_chatbot_stop_words" cols="130" rows="10" name="qc_bot_str_response" required><?php echo ($hasEdit?$data->response:''); ?></textarea>
76 <br><i>*Required. Add the response here.</i>
77 </td>
78 </tr>
79 <tr valign="top">
80 <th scope="row">Keyword</th>
81 <td>
82 <input type="text" name="qc_bot_str_keyword" value="<?php echo ($hasEdit?$data->keyword:''); ?>" style="width: 400px;" />
83 <br><i>Optional. Add multiple keyword or phrases as comma(,) seperated value. It will help to find the best match result.</i>
84 </td>
85 </tr>
86 <tr valign="top" style="display:none">
87 <th scope="row">Intent</th>
88 <td>
89 <input type="text" name="qc_bot_str_intent" value="<?php echo ($hasEdit?$data->intent:''); ?>" style="width: 400px;" />
90 <br><i>Optional. Single keyword or Phrase. Leave it empty if you do not need to use this response as a intent. This will add as a custom intent in every intent selection field in wpbot settings. Also the intent can be used as system command to trigger the response.</i>
91 <?php if($hasEdit): ?>
92
93 <input type="hidden" name="qc_bot_str_id" value="<?php echo ($data->id); ?>" />
94
95 <?php endif; ?>
96 </td>
97 </tr>
98
99 </tbody>
100 </table>
101 </div>
102
103 <footer class="wp-chatbot-admin-footer">
104 <div class="row">
105 <div class="text-left col-sm-3 col-sm-offset-3">
106
107 </div>
108 <div class="text-right col-sm-6">
109 <input type="submit" class="button button-primary" name="submit" id="submit" value="Save Settings">
110 </div>
111 </div>
112 <!-- row-->
113 </footer>
114
115
116 </div></form>
117 </div>
118 </div>
119 <?php else: ?>
120 <div class="wrap">
121 <h1 class="wp-heading-inline">
122 Simple Text Responses</h1>
123 <a href="<?php echo add_query_arg( 'action', 'edit', admin_url('admin.php?page=simple-text-response') ); ?>" class="page-title-action">Add New</a>
124 <hr class="wp-header-end">
125
126 <p>Create simple text responses and the ChatBot will use advanced search algorithm for natural language phrase matching with user input.</p>
127 <p><b>This is a new feature. If you have any feedback to improve this feature or found a bug please report us <a href="https://www.quantumcloud.com/resources/free-support/" target="_blank">here</a>.</b></p>
128
129 <form method="post" action="">
130 <table class="form-table">
131 <tbody>
132 <tr valign="top">
133 <th scope="row">Phrase matching accuracy</th>
134 <td>
135 <input type="text" name="qc_bot_str_weight" value="<?php echo (get_option('qc_bot_str_weight')?get_option('qc_bot_str_weight'):'0.4'); ?>" style="width: 400px;" required />
136 <input type="submit" class="button button-primary" name="submit" id="submit" value="Save Settings">
137 <br><i>Please enter a value between 0 to 1. Higher value means more exact matching of phrases.</i>
138
139 </td>
140
141 </tr>
142 </tbody>
143 </table>
144 </form>
145
146 <div id="poststuff">
147 <div id="post-body" class="metabox-holder columns-2">
148 <div id="post-body-content">
149 <div class="meta-box-sortables ui-sortable">
150 <form method="post">
151 <?php
152 $this->response_list->prepare_items();
153 $this->response_list->display(); ?>
154 </form>
155 </div>
156 </div>
157 </div>
158 <br class="clear">
159 </div>
160 </div>
161
162 <?php endif; ?>
163