PluginProbe
SupportCandy – AI Customer Support Ticket System & Live Chatbot Agent / 2.3.1
SupportCandy – AI Customer Support Ticket System & Live Chatbot Agent v2.3.1
3.5.4 3.5.3 3.5.2 3.5.1 3.4.9 3.5.0 3.4.8 3.4.7 trunk 2.3.1 3.3.6 3.3.7 3.3.8 3.3.9 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6
supportcandy / includes / admin / db_upgrade / db_version2.php

db_version2.php in SupportCandy – AI Customer Support Ticket System & Live Chatbot Agent 2.3.1, at includes/admin/db_upgrade/db_version2.php

58 lines 2.3 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; // Exit if accessed directly
4 }
5
6 global $current_user;
7
8 /**
9 * Exit if logged in user do not have administrator capabilities
10 */
11 if( !$current_user->has_cap('manage_options') ) exit();
12
13 ?>
14
15 <div class="wpsc-iso">
16
17 <div class="row" style="margin-top:20px;">
18 <div id="wpsc_upgrade_dialog_container" class="col-xs-12 col-sm-10 col-sm-offset-1 col-md-8 col-md-offset-2" style="background-color:#fff;text-align:center;padding-bottom:20px;">
19 <h3>Database Upgrade Required</h3>
20 <p class="help-block" style="font-size:15px">Database upgrade is required in your installation for SupportCandy (not related to database tables other than SupportCandy). This is mandatory process and you will not see ticket list until you complete this. This may take few minutes, please do not press "Back" or "Refresh" button until it finishes.</p>
21 <button type="button" class="btn btn-sm btn-primary" onclick="wpsc_db_upgrade_version2()">Upgrade Now</button>
22 </div>
23 </div>
24
25 </div>
26
27 <script type="text/javascript">
28
29 function wpsc_db_upgrade_version2(){
30 var replace_html_str = '<p class="help-block" style="font-size:15px">This may take few minutes, please do not press "Back" or "Refresh" button until it finishes.</p>'
31 + '<div class="progress" style="position: initial !important; height:20px !important; width:100% !important;">'
32 + '<div id="wpsc_db_upgrade_progress_bar" class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div>'
33 + '</div>';
34 jQuery('#wpsc_upgrade_dialog_container').html(replace_html_str);
35 wpsc_run_db_upgrade(1);
36 }
37
38 /**
39 * Run database upgrade
40 */
41 function wpsc_run_db_upgrade( page_no ) {
42 var data = {
43 action: 'wpsc_run_db_v2_upgrade',
44 page_no : page_no,
45 _ajax_nonce: '<?php echo wp_create_nonce('wpsc_run_db_v2_upgrade')?>'
46 };
47 jQuery.post(wpsc_admin.ajax_url, data, function(response_str) {
48 var response = JSON.parse(response_str);
49 jQuery('#wpsc_db_upgrade_progress_bar').css('width',response.completed+'%');
50 if(response.is_next===1){
51 wpsc_run_db_upgrade( response.page_no );
52 } else {
53 window.location.reload();
54 }
55 });
56 }
57
58 </script>