Plugin Directory

Changeset 2708596


Ignore:
Timestamp:
04/12/2022 12:38:27 PM (4 years ago)
Author:
nirweb
Message:

bugfix

Location:
nirweb-support/trunk
Files:
43 edited

Legend:

Unmodified
Added
Removed
  • nirweb-support/trunk/core/core.php

    r2707344 r2708596  
    99//---------- Styles And JS Files --------------------
    1010add_action('wp_enqueue_scripts', function () {
    11     $size = wpyar_ticket['size_of_file_wpyartik'];
    12 
     11    $size = sanitize_text_field(wpyar_ticket['size_of_file_wpyartik']);
    1312    wp_enqueue_style('font5-css-wpyt', NIRWEB_SUPPORT_URL_TICKET . 'assets/css/all.min.css');
    1413    if (is_rtl()) {
     
    1716        wp_enqueue_style('user-css-wpyt', NIRWEB_SUPPORT_URL_TICKET . 'assets/css/user.css');
    1817    }
    19      wp_enqueue_script('jquery');
    20      wp_enqueue_script('user-js-file', NIRWEB_SUPPORT_URL_TICKET . 'assets/js/user.js');
     18    wp_enqueue_script('jquery');
     19    wp_enqueue_script('user-js-file', NIRWEB_SUPPORT_URL_TICKET . 'assets/js/user.js');
    2120    wp_localize_script(
    2221        'user-js-file',
     
    2423        [
    2524            'upload_url' => admin_url('async-upload.php'),
    26             'ajax_url'   => admin_url('admin-ajax.php'),
    27             'nonce'      => wp_create_nonce('media-form'),
    28             'reset_form_title' => __('Are you sure you want to reset?', 'nirweb-support'),
    29             'reset_form_subtitle' => __('This will cause data loss.', 'nirweb-support'),
    30             'reset_form_success' => __('Form successfully reset.', 'nirweb-support'),
    31             'attach_file' => __('Attachment File', 'nirweb-support'),
    32             'recv_info' => __('Receiving information ...', 'nirweb-support'),
    33             'nes_field' =>  __('complete all stared sections Please', 'nirweb-support'),
    34             'max_size_file' => __("maximum Size Of File $size MB", 'nirweb-support'),
    35             'nvalid_file' => __("File is not valid.", 'nirweb-support'),
    36             'answerede' => __("Answerede", 'nirweb-support'),
    37             'necessary' => __("necessary", 'nirweb-support'),
    38             'normal' => __("normal", 'nirweb-support'),
    39             'low' => __("low", 'nirweb-support'),
    40             'new' => __("new", 'nirweb-support'),
    41             'inprogress' => __("inprogress", 'nirweb-support'),
    42             'answerede' => __("answerede", 'nirweb-support'),
    43             'closed' => __("closed", 'nirweb-support'),
    44             'ok_text' => __('Ok', 'nirweb-support'),
    45             'cancel_text' => __('Cancel', 'nirweb-support'),
     25            'ajax_url' => admin_url('admin-ajax.php'),
     26            'nonce' => wp_create_nonce('media-form'),
     27            'reset_form_title' => esc_html__('Are you sure you want to reset?', 'nirweb-support'),
     28            'reset_form_subtitle' => esc_html__('This will cause data loss.', 'nirweb-support'),
     29            'reset_form_success' => esc_html__('Form successfully reset.', 'nirweb-support'),
     30            'attach_file' => esc_html__('Attachment File', 'nirweb-support'),
     31            'recv_info' => esc_html__('Receiving information ...', 'nirweb-support'),
     32            'nes_field' => esc_html__('complete all stared sections Please', 'nirweb-support'),
     33            'max_size_file' => esc_html__("maximum Size Of File $size MB", 'nirweb-support'),
     34            'nvalid_file' => esc_html__("File is not valid.", 'nirweb-support'),
     35            'necessary' => esc_html__("necessary", 'nirweb-support'),
     36            'normal' => esc_html__("normal", 'nirweb-support'),
     37            'low' => esc_html__("low", 'nirweb-support'),
     38            'new' => esc_html__("new", 'nirweb-support'),
     39            'inprogress' => esc_html__("inprogress", 'nirweb-support'),
     40            'answerede' => esc_html__("answerede", 'nirweb-support'),
     41            'closed' => esc_html__("closed", 'nirweb-support'),
     42            'ok_text' => esc_html__('Ok', 'nirweb-support'),
     43            'cancel_text' => esc_html__('Cancel', 'nirweb-support'),
    4644        ]
    4745    );
    4846});
    4947//~~~~~~~~~~~~START Create Menu~~~~~~~~~~
    50 add_action('admin_menu',function ()
    51 {
     48add_action('admin_menu', function () {
    5249    require_once NIRWEB_SUPPORT_TICKET . 'inc/admin/functions/func_number_tab_ticktes.php';
    5350    if (current_user_can('administrator')) {
     
    5855    $cont = $scount > 0 ? '<p class="number_ticket">' . nirweb_ticket_count_new_ticket() . '</p>' : '';
    5956    add_menu_page(
    60         __('Tickets', 'nirweb-support'),
    61         __('Tickets', 'nirweb-support') . $cont,
     57        esc_html__('Tickets', 'nirweb-support'),
     58        esc_html__('Tickets', 'nirweb-support') . $cont,
    6259        'upload_files',
    6360        'nirweb_ticket_manage_tickets',
     
    6663        8
    6764    );
    68     add_submenu_page('nirweb_ticket_manage_tickets&tab=all_ticket', __('All tickets', 'nirweb-support'), __('All tickets', 'nirweb-support'), 'upload_files', 'nirweb_ticket_manage_tickets&tab=all_ticket', 'nirweb_ticket_manage_tickets_callback');
    69     add_submenu_page('nirweb_ticket_manage_tickets', __('Send ticket', 'nirweb-support'), __('Send ticket', 'nirweb-support'), 'upload_files', 'nirweb_ticket_send_ticket', 'nirweb_ticket_send_ticket_callback');
    70     add_submenu_page('nirweb_ticket_manage_tickets', __('Department', 'nirweb-support'), __('Department', 'nirweb-support'), 'manage_options', 'nirweb_ticket_department_ticket', 'nirweb_ticket_department_ticket_callback');
    71     add_submenu_page('nirweb_ticket_manage_tickets', __('Pre answer', 'nirweb-support'), __('Pre answer', 'nirweb-support'), 'manage_options', 'edit.php?post_type=pre_answer_wpyticket');
    72     add_submenu_page('nirweb_ticket_manage_tickets', __('FAQ', 'nirweb-support'), __('FAQ', 'nirweb-support'), 'manage_options', 'nirweb_ticket_FAQ_ticket', 'nirweb_ticket_FAQ_ticket_callback');
    73 
    74        
     65    add_submenu_page('nirweb_ticket_manage_tickets&tab=all_ticket',
     66        esc_html__('All tickets', 'nirweb-support'),
     67        esc_html__('All tickets', 'nirweb-support'),
     68        'upload_files',
     69        'nirweb_ticket_manage_tickets&tab=all_ticket',
     70        'nirweb_ticket_manage_tickets_callback');
     71    add_submenu_page('nirweb_ticket_manage_tickets',
     72        esc_html__('Send ticket', 'nirweb-support'),
     73        esc_html__('Send ticket', 'nirweb-support'),
     74        'upload_files', 'nirweb_ticket_send_ticket',
     75        'nirweb_ticket_send_ticket_callback');
     76    add_submenu_page('nirweb_ticket_manage_tickets',
     77        esc_html__('Department', 'nirweb-support'),
     78        esc_html__('Department', 'nirweb-support'),
     79        'manage_options',
     80        'nirweb_ticket_department_ticket',
     81        'nirweb_ticket_department_ticket_callback');
     82    add_submenu_page('nirweb_ticket_manage_tickets',
     83        esc_html__('Pre answer', 'nirweb-support'),
     84        esc_html__('Pre answer', 'nirweb-support'),
     85        'manage_options',
     86        'edit.php?post_type=pre_answer_wpyticket');
     87    add_submenu_page('nirweb_ticket_manage_tickets',
     88        esc_html__('FAQ', 'nirweb-support'),
     89        esc_html__('FAQ', 'nirweb-support'),
     90        'manage_options',
     91        'nirweb_ticket_FAQ_ticket',
     92        'nirweb_ticket_FAQ_ticket_callback');
    7593    //---------- Transfer Data Start ------------
     94    global $wpdb;
     95    $table_name = $wpdb->prefix . 'wp_yar_ticket';
     96    $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
     97    if ($wpdb->get_var($query) == $table_name) {
     98        add_submenu_page('nirweb_ticket_manage_tickets',
     99            esc_html__('Transfer Data', 'nirweb-support'),
     100            esc_html__('Transfer Data', 'nirweb-support'),
     101            'manage_options',
     102            'nirweb_ticket_tranfer_data',
     103            'nirweb_ticket_tranfer_data_callback');
     104    }
     105});
     106
     107function nirweb_ticket_tranfer_data_callback()
     108{
     109    if (isset($_POST['trans_data_nirweb_ticket']) && wp_verify_nonce($_POST['trans_data_nirweb_ticket'], 'trans_data_nirweb_ticket')) {
    76110        global $wpdb;
    77      $table_name = $wpdb->prefix . 'wp_yar_ticket';
    78     $query = $wpdb->prepare('SHOW TABLES LIKE %s', $wpdb->esc_like($table_name));
    79         if ($wpdb->get_var($query) == $table_name) {
    80   add_submenu_page('nirweb_ticket_manage_tickets', __('Transfer Data', 'nirweb-support'), __('Transfer Data', 'nirweb-support'), 'manage_options', 'nirweb_ticket_tranfer_data', 'nirweb_ticket_tranfer_data_callback');
    81         }
    82 } );
    83 
    84 function nirweb_ticket_tranfer_data_callback(){
    85 if (isset( $_POST['trans_data_nirweb_ticket'] )
    86     &&  wp_verify_nonce( $_POST['trans_data_nirweb_ticket'], 'trans_data_nirweb_ticket' )
    87 ) {
    88    
    89  global $wpdb; 
    90 
    91       $table_name = $wpdb->prefix . 'nirweb_ticket_ticket_faq';
    92       $table_name2 = $wpdb->prefix . 'wp_yar_ticket_faq';
    93       $list_1 = $wpdb->get_results("SELECT * FROM $table_name2");
    94       foreach($list_1 as $row){
    95           $wpdb->insert($table_name,[
    96               'question'=>$row->question,
    97               'answer'=>$row->answer,
    98               'department_id'=>$row->department_id,
    99               ]);
    100          
    101       }
    102       $table_name = $wpdb->prefix . 'nirweb_ticket_ticket_user_upload';
    103       $table_name2 = $wpdb->prefix . 'wp_yar_ticket_user_upload';
    104       $list_1 = $wpdb->get_results("SELECT * FROM $table_name2");
    105       foreach($list_1 as $row){
    106           $wpdb->insert($table_name,[
    107               'url_file'=>$row->url_file,
    108               'user_id'=>$row->user_id,
    109               'file_id'=>$row->file_id,
    110               'time_upload'=>$row->time_upload,
    111               ]);
    112       }
    113      
    114       $table_name = $wpdb->prefix . 'nirweb_ticket_ticket_department';
    115       $table_name2 = $wpdb->prefix . 'wp_yar_ticket_department';
    116       $list_1 = $wpdb->get_results("SELECT * FROM $table_name2");
    117       foreach($list_1 as $row){
    118           $wpdb->insert($table_name,[
    119               'name'=>$row->name,
    120               'support_id'=>$row->support_id,
    121               ]);
    122       }   
    123      
    124       $table_name = $wpdb->prefix . 'nirweb_ticket_ticket_answered';
    125       $table_name2 = $wpdb->prefix . 'wp_yar_ticket_answered';
    126       $list_1 = $wpdb->get_results("SELECT * FROM $table_name2");
    127       foreach($list_1 as $row){
    128           $wpdb->insert($table_name,[
    129               'user_id'=>$row->user_id,
    130               'text'=>$row->text,
    131               'attach_url'=>$row->attach_url,
    132               'time_answer'=>$row->time_answer,
    133                'ticket_id'=>$row->ticket_id,
    134               ]);
    135       }   
    136          $table_name = $wpdb->prefix . 'nirweb_ticket_ticket';
    137       $table_name2 = $wpdb->prefix . 'wp_yar_ticket';
    138       $list_1 = $wpdb->get_results("SELECT * FROM $table_name2");
    139       foreach($list_1 as $row){
    140           $wpdb->insert($table_name,[
    141               'id_receiver'=>$row->id_receiver,
    142               'subject'=>$row->subject,
    143               'content'=>$row->content,
    144               'department'=>$row->department,
    145               'priority'=>$row->priority,
    146               'website'=>$row->website,
    147               'product'=>$row->product,
    148               'support_id'=>$row->support_id,
    149               'sender_id'=>$row->sender_id,
    150               'status'=>$row->status,
    151               'date_qustion'=>$row->date_qustion,
    152               'time_update'=>$row->time_update,
    153               'file_url'=>$row->file_url,
    154      
    155               ]);
    156       }   
    157        
    158        
    159    update_option( 'trans_ticket_nirweb', true );   
    160 
    161 }
    162 
    163 if (isset( $_POST['del_data_nirweb_ticket'] )  &&  wp_verify_nonce( $_POST['del_data_nirweb_ticket'], 'del_data_nirweb_ticket' ) ) {
    164   global $wpdb;
    165  
    166       $tb1 = $wpdb->prefix . 'wp_yar_ticket_faq';
    167       $tb2 = $wpdb->prefix . 'wp_yar_ticket_user_upload';
    168       $tb3 = $wpdb->prefix . 'wp_yar_ticket_department';
    169       $tb4 = $wpdb->prefix . 'wp_yar_ticket_priority';
    170       $tb5 = $wpdb->prefix . 'wp_yar_ticket_status';
    171       $tb6 = $wpdb->prefix . 'wp_yar_ticket_pre_answer';
    172       $tb7 = $wpdb->prefix . 'wp_yar_ticket_answered';
    173       $tb8 = $wpdb->prefix . 'wp_yar_ticket';
    174       $wpdb->query( "DROP TABLE  $tb1" );
    175       $wpdb->query( "DROP TABLE  $tb2" );
    176       $wpdb->query( "DROP TABLE  $tb3" );
    177       $wpdb->query( "DROP TABLE  $tb4" );
    178       $wpdb->query( "DROP TABLE  $tb5" );
    179       $wpdb->query( "DROP TABLE  $tb6" );
    180       $wpdb->query( "DROP TABLE  $tb7" );
    181       $wpdb->query( "DROP TABLE  $tb8" );
    182         wp_safe_redirect(admin_url());exit;
    183  }
    184 ?>
    185         <div class="wrap">
    186             <h1><?php echo  __('Transfer Data', 'nirweb-support') ?></h1>
    187                 <?php if(! get_option('trans_ticket_nirweb')) :?>       
    188              <form method="POST" style="background: #fff;padding: 15px;border-radius: 3px;border: solid 1px #CCC;">
    189                     <?php wp_nonce_field( 'trans_data_nirweb_ticket', 'trans_data_nirweb_ticket' ); ?>
    190                  <p><?php echo  __('To transfer data from the old table to the new one, please click on the button below', 'nirweb-support') ?></p>
    191                  <button type="submit" class="button button-primary"><?php echo  __('Transfer Data', 'nirweb-support') ?></button>
    192              </form>   
    193                 <?php endif; ?>
    194                 <form method="POST" id="del_old_tbl_nirweb_ticket" style="background: #ffffff;padding: 15px;border-radius: 3px;border: solid 1px #CCC;margin-top: 20px;color: #f00;">
    195                    <?php wp_nonce_field( 'del_data_nirweb_ticket', 'del_data_nirweb_ticket' ); ?>
    196                  <p style="font-size: 18px;font-weight: bold;"><?php echo  __('To delete old tables, click on the button below (if deleted, it is not possible to recover)', 'nirweb-support') ?></p>
    197                  <button type="submit" class="button"><?php echo  __('Delete Data', 'nirweb-support') ?></button>
    198              </form>   
    199                  </div>
     111        $table_name = $wpdb->prefix . 'nirweb_ticket_ticket_faq';
     112        $table_name2 = $wpdb->prefix . 'wp_yar_ticket_faq';
     113        $list_1 = $wpdb->get_results("SELECT * FROM $table_name2");
     114        foreach ($list_1 as $row) {
     115            $wpdb->insert($table_name, [
     116                'question' => sanitize_text_field($row->question),
     117                'answer' => sanitize_textarea_field($row->answer),
     118                'department_id' => sanitize_text_field($row->department_id),
     119            ]);
     120        }
     121        $table_name = $wpdb->prefix . 'nirweb_ticket_ticket_user_upload';
     122        $table_name2 = $wpdb->prefix . 'wp_yar_ticket_user_upload';
     123        $list_1 = $wpdb->get_results("SELECT * FROM $table_name2");
     124        foreach ($list_1 as $row) {
     125            $wpdb->insert($table_name, [
     126                'url_file' => esc_url_raw($row->url_file),
     127                'user_id' => sanitize_text_field($row->user_id),
     128                'file_id' => sanitize_text_field($row->file_id),
     129                'time_upload' => sanitize_text_field($row->time_upload),
     130            ]);
     131        }
     132
     133        $table_name = $wpdb->prefix . 'nirweb_ticket_ticket_department';
     134        $table_name2 = $wpdb->prefix . 'wp_yar_ticket_department';
     135        $list_1 = $wpdb->get_results("SELECT * FROM $table_name2");
     136        foreach ($list_1 as $row) {
     137            $wpdb->insert($table_name, [
     138                'name' => sanitize_text_field($row->name),
     139                'support_id' => sanitize_text_field($row->support_id),
     140            ]);
     141        }
     142
     143        $table_name = $wpdb->prefix . 'nirweb_ticket_ticket_answered';
     144        $table_name2 = $wpdb->prefix . 'wp_yar_ticket_answered';
     145        $list_1 = $wpdb->get_results("SELECT * FROM $table_name2");
     146        foreach ($list_1 as $row) {
     147            $wpdb->insert($table_name, [
     148                'user_id' => sanitize_text_field($row->user_id),
     149                'text' => sanitize_text_field($row->text),
     150                'attach_url' => sanitize_url($row->attach_url),
     151                'time_answer' => sanitize_text_field($row->time_answer),
     152                'ticket_id' => sanitize_text_field($row->ticket_id),
     153            ]);
     154        }
     155        $table_name = $wpdb->prefix . 'nirweb_ticket_ticket';
     156        $table_name2 = $wpdb->prefix . 'wp_yar_ticket';
     157        $list_1 = $wpdb->get_results("SELECT * FROM $table_name2");
     158        foreach ($list_1 as $row) {
     159            $wpdb->insert($table_name, [
     160                'id_receiver' => sanitize_text_field($row->id_receiver),
     161                'subject' => sanitize_text_field($row->subject),
     162                'content' => sanitize_textarea_field($row->content),
     163                'department' => sanitize_text_field($row->department),
     164                'priority' => sanitize_text_field($row->priority),
     165                'website' => sanitize_text_field($row->website),
     166                'product' => sanitize_text_field($row->product),
     167                'support_id' => sanitize_text_field($row->support_id),
     168                'sender_id' => sanitize_text_field($row->sender_id),
     169                'status' => sanitize_text_field($row->status),
     170                'date_qustion' => sanitize_text_field($row->date_qustion),
     171                'time_update' => sanitize_text_field($row->time_update),
     172                'file_url' => sanitize_url($row->file_url),
     173
     174            ]);
     175        }
     176        update_option('trans_ticket_nirweb', true);
     177    }
     178
     179    if (isset($_POST['del_data_nirweb_ticket']) && wp_verify_nonce($_POST['del_data_nirweb_ticket'], 'del_data_nirweb_ticket')) {
     180        global $wpdb;
     181
     182        $tb1 = $wpdb->prefix . 'wp_yar_ticket_faq';
     183        $tb2 = $wpdb->prefix . 'wp_yar_ticket_user_upload';
     184        $tb3 = $wpdb->prefix . 'wp_yar_ticket_department';
     185        $tb4 = $wpdb->prefix . 'wp_yar_ticket_priority';
     186        $tb5 = $wpdb->prefix . 'wp_yar_ticket_status';
     187        $tb6 = $wpdb->prefix . 'wp_yar_ticket_pre_answer';
     188        $tb7 = $wpdb->prefix . 'wp_yar_ticket_answered';
     189        $tb8 = $wpdb->prefix . 'wp_yar_ticket';
     190        $wpdb->query("DROP TABLE  $tb1");
     191        $wpdb->query("DROP TABLE  $tb2");
     192        $wpdb->query("DROP TABLE  $tb3");
     193        $wpdb->query("DROP TABLE  $tb4");
     194        $wpdb->query("DROP TABLE  $tb5");
     195        $wpdb->query("DROP TABLE  $tb6");
     196        $wpdb->query("DROP TABLE  $tb7");
     197        $wpdb->query("DROP TABLE  $tb8");
     198        wp_safe_redirect(admin_url());
     199        exit;
     200    }
     201    ?>
     202    <div class="wrap">
     203        <h1><?php echo esc_html__('Transfer Data', 'nirweb-support') ?></h1>
     204        <?php if (!get_option('trans_ticket_nirweb')) : ?>
     205            <form method="POST" style="background: #fff;padding: 15px;border-radius: 3px;border: solid 1px #CCC;">
     206                <?php wp_nonce_field('trans_data_nirweb_ticket', 'trans_data_nirweb_ticket'); ?>
     207                <p>
     208                    <?php echo esc_html__('To transfer data from the old table to the new one, please click on the button below', 'nirweb-support') ?>
     209                </p>
     210                <button type="submit"
     211                        class="button button-primary"><?php echo esc_html__('Transfer Data', 'nirweb-support') ?></button>
     212            </form>
     213        <?php endif; ?>
     214        <form method="POST" id="del_old_tbl_nirweb_ticket"
     215              style="background: #ffffff;padding: 15px;border-radius: 3px;border: solid 1px #CCC;margin-top: 20px;color: #f00;">
     216            <?php wp_nonce_field('del_data_nirweb_ticket', 'del_data_nirweb_ticket'); ?>
     217            <p style="font-size: 18px;font-weight: bold;"><?php echo esc_html__('To delete old tables, click on the button below (if deleted, it is not possible to recover)', 'nirweb-support') ?></p>
     218            <button type="submit" class="button"><?php echo esc_html__('Delete Data', 'nirweb-support') ?></button>
     219        </form>
     220    </div>
    200221<?php }
     222
    201223//-------- Transfer Data End --------------
    202224if (!function_exists('nirweb_ticket_manage_tickets_callback')) {
     
    214236if (!function_exists('nirweb_ticket_department_ticket_callback')) {
    215237    function nirweb_ticket_department_ticket_callback()
    216         {
    217          require_once NIRWEB_SUPPORT_INC_ADMIN_THEMES_TICKET . 'department.php';
    218         }
     238    {
     239        require_once NIRWEB_SUPPORT_INC_ADMIN_THEMES_TICKET . 'department.php';
     240    }
    219241}
    220242if (!function_exists('nirweb_ticket_PreAnswer_ticket_callback')) {
     
    230252    }
    231253}
    232 
    233 
    234254//~~~~~~~~~~~~END create Menu~~~~~~~~~~~~~
    235255//~~~~~~~~~~~~START Action Create Roles~~~~~~
    236 add_action('init',function ()
    237 {
    238     $role = add_role('user_support', __('Support', 'nirweb-support'), array(
     256add_action('init', function () {
     257    $role = add_role('user_support',
     258        esc_html__('Support', 'nirweb-support'),
     259        array(
    239260        'read' => true,
    240261        'upload_files' => true
     
    248269
    249270//~~~~~~~~~~~~END Action Create Roles~~~~~~
    250 add_action('admin_menu', function ()
    251 {
     271add_action('admin_menu', function () {
    252272    if (current_user_can('user_support')) {
    253273        remove_menu_page('edit.php');
     
    257277});
    258278
    259 add_action('admin_bar_menu', function ($wp_admin_bar)
    260 {
     279add_action('admin_bar_menu', function ($wp_admin_bar) {
    261280    if (current_user_can('user_support')) {
    262281        $wp_admin_bar->remove_node('new-post');
     
    267286add_action('init', function () {
    268287    $labels = array(
    269         'name' => __('pre answer', 'nirweb-support'),
    270         'singular_name' => __('pre answer', 'nirweb-support'),
    271         'add_new' => __('New Answer', 'nirweb-support'),
    272         'add_new_item' => __('New Answer', 'nirweb-support'),
    273         'edit_item' => __('Edit Answer', 'nirweb-support'),
    274         'new_item' => __('New Answer', 'nirweb-support'),
    275         'all_items' => __('pre answer', 'nirweb-support'),
    276         'view_item' => __('Show Answer', 'nirweb-support'),
    277         'menu_name' => __('pre answer', 'nirweb-support')
     288        'name' => esc_html__('pre answer', 'nirweb-support'),
     289        'singular_name' => esc_html__('pre answer', 'nirweb-support'),
     290        'add_new' => esc_html__('New Answer', 'nirweb-support'),
     291        'add_new_item' => esc_html__('New Answer', 'nirweb-support'),
     292        'edit_item' => esc_html__('Edit Answer', 'nirweb-support'),
     293        'new_item' => esc_html__('New Answer', 'nirweb-support'),
     294        'all_items' => esc_html__('pre answer', 'nirweb-support'),
     295        'view_item' => esc_html__('Show Answer', 'nirweb-support'),
     296        'menu_name' => esc_html__('pre answer', 'nirweb-support')
    278297    );
    279298    $args = array(
     
    283302        'show_ui' => true,
    284303        'query_var' => false,
    285         'rewrite' => array('slug' => false),
     304        'rewrite' => ['slug' => false],
    286305        'capability_type' => 'post',
    287306        'has_archive' => false,
     
    298317    class nirweb_ticket_My_Account_Endpoint
    299318    {
    300         /**
    301          * Custom endpoint name.
    302          *
    303          * @var string
    304          */
    305319        public static $endpoint = 'wpyar-ticket';
    306         /**
    307          * Plugin actions.
    308          */
    309320        public function __construct()
    310321        {
     
    315326            add_action('woocommerce_account_' . self::$endpoint . '_endpoint', array($this, 'endpoint_content'));
    316327        }
     328
    317329        public function add_endpoints()
    318330        {
    319331            add_rewrite_endpoint(self::$endpoint, EP_ROOT | EP_PAGES);
    320332        }
     333
    321334        public function add_query_vars($vars)
    322335        {
     
    324337            return $vars;
    325338        }
     339
    326340        public function endpoint_title($title)
    327341        {
     
    329343            $is_endpoint = isset($wp_query->query_vars[self::$endpoint]);
    330344            if ($is_endpoint && !is_admin() && is_main_query() && in_the_loop() && is_account_page()) {
    331                 // New page title.
    332                 $title = __('Support Ticket', 'nirweb-support');
     345                $title = esc_html__('Support Ticket', 'nirweb-support');
    333346                remove_filter('the_title', array($this, 'endpoint_title'));
    334347            }
    335348            return $title;
    336349        }
     350
    337351        public function new_menu_items($items)
    338352        {
    339353            $logout = $items['customer-logout'];
    340354            unset($items['customer-logout']);
    341             $items[self::$endpoint] = __('Support Ticket', 'nirweb-support');
     355            $items[self::$endpoint] = esc_html__('Support Ticket', 'nirweb-support');
    342356            $items['customer-logout'] = $logout;
    343357            return $items;
    344358        }
    345         /**
    346          * Endpoint HTML content.
    347          */
     359
    348360        public function endpoint_content()
    349361        {
    350          
    351             if (isset($_GET['action']) && !empty(sanitize_text_field($_GET['action']))) {
    352                 if (sanitize_text_field($_GET['action']) == 'new') {
     362            if (isset($_GET['action']) && !empty(esc_html($_GET['action']))) {
     363                if (esc_html($_GET['action']) == 'new') {
    353364                    require_once NIRWEB_SUPPORT_INC_USER_THEMES_TICKET . 'new_ticket.php';
    354                 } elseif (sanitize_text_field($_GET['action']) == 'reply') {
     365                } elseif (esc_html($_GET['action']) == 'reply') {
    355366                    require_once NIRWEB_SUPPORT_INC_USER_THEMES_TICKET . 'replay_ticket.php';
    356367                }
     
    359370            }
    360371        }
    361         /**
    362          * Plugin install action.
    363          * Flush rewrite rules to make our custom endpoint available.
    364          */
    365372        public static function install()
    366373        {
     
    368375        }
    369376    }
     377
    370378    new nirweb_ticket_My_Account_Endpoint();
    371379    // Flush rewrite rules on plugin activation.
     
    374382//~~~~~~~~~~~~END Add Page Ticket To My Account ~~~~~~~~~~
    375383//~~~~~~~~~~~~ Start ShortCode ~~~~~~
    376 add_shortcode('nirweb_ticket',function ()
    377 {
     384add_shortcode('nirweb_ticket', function () {
    378385    if (is_user_logged_in()) {
    379          if (isset($_GET['action']) && sanitize_text_field($_GET['action']) == 'new') {
     386        if (isset($_GET['action']) && esc_html($_GET['action']) == 'new') {
    380387            require_once NIRWEB_SUPPORT_INC_USER_THEMES_TICKET . 'new_ticket.php';
    381         } else if (isset($_GET['action']) && sanitize_text_field($_GET['action']) == 'reply') {
     388        } else if (isset($_GET['action']) && esc_html($_GET['action']) == 'reply') {
    382389            require_once NIRWEB_SUPPORT_INC_USER_THEMES_TICKET . 'replay_ticket.php';
    383390        } else {
     
    387394});
    388395
    389  
    390 
    391 add_shortcode('nirweb_ticket_new', function (){
     396
     397add_shortcode('nirweb_ticket_new', function () {
    392398    require_once NIRWEB_SUPPORT_INC_USER_THEMES_TICKET . 'new_ticket.php';
    393399});
    394400
    395 add_shortcode('nirweb_ticket_rep',function ()
    396 {
    397      require_once NIRWEB_SUPPORT_INC_USER_THEMES_TICKET . 'replay_ticket.php';
     401add_shortcode('nirweb_ticket_rep', function () {
     402    require_once NIRWEB_SUPPORT_INC_USER_THEMES_TICKET . 'replay_ticket.php';
    398403});
    399404//--- ~~~~~~~~~~~~ END ShortCode ~~~~~~~~~~~~~
    400 if (wpyar_ticket['display_icon_send_ticket'] == '1') {
    401     add_action('wp_footer',     function (){
    402         $pag_id = intval(wpyar_ticket['select_page_ticket']);
    403 ?>
    404   <?php
    405         if(is_plugin_active('wpyar_panel/wpyar_panel.php' )){
    406              $wpyarud = get_option('wpyarud_prefix_my_options');
    407               $page_name =$wpyarud['page_wpyarud_plugin']; 
    408             $page =get_bloginfo('url').'/'.get_post_field( 'post_name', op_wpyar_panel['page_wpyarud_plugin']).'?endp=nirweb-ticket';
    409         }else{
    410             if( wpyar_ticket['select_page_ticket']){
    411                $page = esc_url( get_page_link( wpyar_ticket['select_page_ticket'] ) );
    412             }else{
    413                $page = get_permalink( get_option('woocommerce_myaccount_page_id') ).'wpyar-ticket/';
     405if (isset(wpyar_ticket['display_icon_send_ticket']) && wpyar_ticket['display_icon_send_ticket']) {
     406    add_action('wp_footer', function () {
     407        $pag_id = esc_html(intval(wpyar_ticket['select_page_ticket']));
     408        ?>
     409        <?php
     410        if (is_plugin_active('wpyar_panel/wpyar_panel.php')) {
     411            $wpyarud = get_option('wpyarud_prefix_my_options');
     412            $page_name = $wpyarud['page_wpyarud_plugin'];
     413            $page = get_bloginfo('url') . '/' . get_post_field('post_name', op_wpyar_panel['page_wpyarud_plugin']) . '?endp=nirweb-ticket';
     414        } else {
     415            if (wpyar_ticket['select_page_ticket']) {
     416                $page = esc_url_raw(get_page_link(wpyar_ticket['select_page_ticket']));
     417            } else {
     418                $page = get_permalink(get_option('woocommerce_myaccount_page_id')) . 'wpyar-ticket/';
    414419            }
    415420        }
    416     ?>
     421        ?>
    417422
    418423        <a class="nirweb_ticket_logo" href="<?php echo esc_html($page) ?>" style="<?php
    419                         echo (wpyar_ticket['position_icon_nirweb_ticket_front'] == 'icon-left') ? 'left:0' : 'right:0';
    420                         ?> ">
    421             <img class="logo_ticket_wpyar" src="<?php if (wpyar_ticket['icon_nirweb_ticket_front']['url']) {
    422                     echo wpyar_ticket['icon_nirweb_ticket_front']['url'];
    423                 } else {
    424                     echo NIRWEB_SUPPORT_URL_TICKET . 'assets/images/defualt-logo.png';
    425                 } ?>" alt="<?php bloginfo('name') ?>" />
     424        echo (esc_html(wpyar_ticket['position_icon_nirweb_ticket_front']) == 'icon-left') ? 'left:0' : 'right:0';
     425        ?> ">
     426            <img class="logo_ticket_wpyar" src="<?php if (esc_url_raw(wpyar_ticket['icon_nirweb_ticket_front']['url'])) {
     427                echo esc_url_raw(wpyar_ticket['icon_nirweb_ticket_front']['url']);
     428            } else {
     429                echo NIRWEB_SUPPORT_URL_TICKET . 'assets/images/defualt-logo.png';
     430            } ?>" alt="<?php bloginfo('name') ?>"/>
    426431        </a>
    427432        <style>
     
    432437            }
    433438        </style>
    434 <?php }, 100);
    435 
    436    
     439    <?php }, 100);
     440
     441
    437442}
    438443//----------- Add Number Ticket in Admin Bar   
    439444require_once NIRWEB_SUPPORT_TICKET . 'inc/admin/functions/func_number_tab_ticktes.php';
    440445
    441 add_action('admin_bar_menu', function ($wp_admin_bar)
    442 {
     446add_action('admin_bar_menu', function ($wp_admin_bar) {
    443447    if (current_user_can('administrator')) {
    444448        $scount = nirweb_ticket_count_new_ticket();
     
    449453        $args = array(
    450454            'id' => 'New_ticket',
    451             'title' => '<p style="background:red;color:#fff;padding:0 5px;"> ' . __('Count New Ticket', 'nirweb-support') . $scount . '</p>',
     455            'title' => '<p style="background:red;color:#fff;padding:0 5px;"> ' . esc_html__('Count New Ticket', 'nirweb-support') . $scount . '</p>',
    452456            'href' => get_bloginfo('url') . '/wp-admin/admin.php?page=nirweb_ticket_manage_tickets&tab=new_ticket',
    453457            'meta' => array(
    454458                'class' => 'New_ticket',
    455                 'title' => __('New Ticket', 'nirweb-support')
     459                'title' => esc_html__('New Ticket', 'nirweb-support')
    456460            )
    457461        );
     
    460464}, 999);
    461465//--------------- Filter Media
    462 add_filter('ajax_query_attachments_args', function ($query = array())
    463 {
     466add_filter('ajax_query_attachments_args', function ($query = array()) {
    464467    $user_id = get_current_user_id();
    465468    if ($user_id) {
     
    469472}, 10, 1);
    470473
    471  //--------------- Timr Ago
     474//--------------- Timr Ago
    472475if (!function_exists('ago_ticket_nirweb')) {
    473476    function ago_ticket_nirweb($post_date)
    474477    {
    475         echo esc_html(human_time_diff($post_date,  strtotime(current_time("Y-m-d H:i:s")))) . __(' ago', 'nirweb-support');
    476     }
    477 }
     478        echo esc_html(human_time_diff($post_date, strtotime(current_time("Y-m-d H:i:s")))) . esc_html__(' ago', 'nirweb-support');
     479    }
     480}
  • nirweb-support/trunk/core/create_db.php

    r2707344 r2708596  
    125125    $wpdb->delete($table_name,['priority_id'=>2]);
    126126    $wpdb->delete($table_name,['priority_id'=>3]);
    127     $wpdb->insert($table_name,['priority_id'=>1,'name'=>__('low','nirweb-support')]);
    128     $wpdb->insert($table_name,['priority_id'=>2,'name'=>__('normal','nirweb-support')]);
    129     $wpdb->insert($table_name,['priority_id'=>3,'name'=>__('necessary','nirweb-support')]);
     127    $wpdb->insert($table_name,['priority_id'=>1,'name'=>esc_html__('low','nirweb-support')]);
     128    $wpdb->insert($table_name,['priority_id'=>2,'name'=>esc_html__('normal','nirweb-support')]);
     129    $wpdb->insert($table_name,['priority_id'=>3,'name'=>esc_html__('necessary','nirweb-support')]);
    130130});
    131131//----------------- Status Datbase
     
    149149    $wpdb->delete($table_name,['status_id'=>3]);
    150150    $wpdb->delete($table_name,['status_id'=>4]);
    151     $wpdb->insert($table_name,['status_id'=>1,'name_status'=>__('new','nirweb-support')]);
    152     $wpdb->insert($table_name,['status_id'=>2,'name_status'=>__('in progress','nirweb-support')]);
    153     $wpdb->insert($table_name,['status_id'=>3,'name_status'=>__('answered','nirweb-support')]);
    154     $wpdb->insert($table_name,['status_id'=>4,'name_status'=>__('closed','nirweb-support')]);
     151    $wpdb->insert($table_name,['status_id'=>1,'name_status'=>esc_html__('new','nirweb-support')]);
     152    $wpdb->insert($table_name,['status_id'=>2,'name_status'=>esc_html__('in progress','nirweb-support')]);
     153    $wpdb->insert($table_name,['status_id'=>3,'name_status'=>esc_html__('answered','nirweb-support')]);
     154    $wpdb->insert($table_name,['status_id'=>4,'name_status'=>esc_html__('closed','nirweb-support')]);
    155155});
  • nirweb-support/trunk/inc/admin/functions/ajax.php

    r2707344 r2708596  
    33 #--------------- Ajax Search in ticketes
    44 */
    5 add_action('wp_ajax_ajax_search_in_ticketes_wpyar', 'ajax_search_in_ticketes_wpyar'); 
    6 add_action('wp_ajax_nopriv_ajax_search_in_ticketes_wpyar', 'ajax_search_in_ticketes_wpyar'); 
     5add_action('wp_ajax_ajax_search_in_ticketes_wpyar', 'ajax_search_in_ticketes_wpyar');
     6add_action('wp_ajax_nopriv_ajax_search_in_ticketes_wpyar', 'ajax_search_in_ticketes_wpyar');
    77if (!function_exists('func_ajax_search_in_ticketes_wpyar')) {
    88    function ajax_search_in_ticketes_wpyar()
     
    1010        include_once NIRWEB_SUPPORT_INC_ADMIN_FUNCTIONS_TICKET . 'ajax_search_in_ticketes_wpyar.php';
    1111        func_ajax_search_in_ticketes_wpyar(sanitize_text_field($_POST['value']));
    12         exit();   
    13     }
    14 } 
     12        exit();
     13    }
     14}
    1515
    1616/*
    1717 #--------------- Ajax Send type user
    1818 */
    19 add_action('wp_ajax_send_type_role_user', 'send_type_role_user'); 
    20 add_action('wp_ajax_nopriv_send_type_role_user', 'send_type_role_user'); 
     19add_action('wp_ajax_send_type_role_user', 'send_type_role_user');
     20add_action('wp_ajax_nopriv_send_type_role_user', 'send_type_role_user');
    2121if (!function_exists('send_type_role_user')) {
    2222    function send_type_role_user()
     
    2626            $get_users = $wpdb->get_results("SELECT * FROM {$wpdb->prefix}users");
    2727            foreach ($get_users as $user) {
    28                  echo esc_html('<option  data-mail="'.$user->user_email.'"  value="' . sanitize_text_field($user->ID) . '">' . sanitize_text_field($user->display_name) . '</option>');
     28                echo('<option  data-mail="' . esc_html($user->user_email) . '"  value="' . esc_html($user->ID) . '">' . esc_html($user->display_name) . '</option>');
    2929            }
    3030        } else if (sanitize_text_field($_POST['selectedtypsender']) == 2) {
    31             $get_users = get_users(['role__in' => ['user_support']]); 
     31            $get_users = get_users(['role__in' => ['user_support']]);
    3232            foreach ($get_users as $user) {
    33                 echo esc_html('<option value="' . sanitize_text_field($user->ID) . '">' . sanitize_text_field($user->display_name) . '</option>');
     33                echo('<option value="' . esc_html($user->ID) . '">' . esc_html($user->display_name) . '</option>');
    3434            }
    3535        }
    3636        exit();
    3737    }
    38 } 
     38}
    3939
    4040/*
     
    5353        ));
    5454        if (!$customer_orders) return;
    55          foreach ($customer_orders as $customer_order) {
     55        foreach ($customer_orders as $customer_order) {
    5656            $order = wc_get_order($customer_order->ID);
    5757            $items = $order->get_items();
    58             echo esc_html('<option value="0">'.__('Select Prodcut', 'nirweb-support').'</option>');
     58            echo('<option value="0">' . esc_html__('Select Prodcut', 'nirweb-support') . '</option>');
    5959            foreach ($items as $item) {
    6060                $product_id = $item->get_product_id();
    6161                $product_name = $item->get_name();
    62                 echo esc_html('<option value="' . esc_html($product_id) . '">' . esc_html($product_name) . '</option>');
     62                echo('<option value="' . esc_html($product_id) . '">' . esc_html($product_name) . '</option>');
    6363            }
    6464        }
     
    7373add_action('wp_ajax_nopriv_load_page_new_tiket', 'load_page_new_tiket');
    7474if (!function_exists('load_page_new_tiket')) {
    75     function load_page_new_tiket(){
    76     include_once NIRWEB_SUPPORT_INC_USER_THEMES_TICKET . 'new_ticket.php';
    77     exit();
    78 }
     75    function load_page_new_tiket()
     76    {
     77        include_once NIRWEB_SUPPORT_INC_USER_THEMES_TICKET . 'new_ticket.php';
     78        exit();
     79    }
    7980}
    8081/*
     
    8485add_action('wp_ajax_nopriv_send_new_ticket', 'send_new_ticket');
    8586if (!function_exists('send_new_ticket')) {
    86     function send_new_ticket(){
    87     include_once NIRWEB_SUPPORT_INC_ADMIN_FUNCTIONS_TICKET.'func_send_ticket.php';
    88     nirweb_ticket_send_ticket();
    89     }
    90 }
    91 
    92  /*
    93  #--------------- Ajax answer_ticket_admin
    94  */
     87    function send_new_ticket()
     88    {
     89        include_once NIRWEB_SUPPORT_INC_ADMIN_FUNCTIONS_TICKET . 'func_send_ticket.php';
     90        nirweb_ticket_send_ticket();
     91    }
     92}
     93
     94/*
     95#--------------- Ajax answer_ticket_admin
     96*/
    9597add_action('wp_ajax_answerd_ticket', 'answerd_ticket');
    9698add_action('wp_ajax_nopriv_answerd_ticket', 'answerd_ticket');
    97 if (!function_exists('answerd_ticket') && is_admin( )) {
     99if (!function_exists('answerd_ticket') && is_admin()) {
    98100    function answerd_ticket()
    99         {
    100             include_once NIRWEB_SUPPORT_INC_ADMIN_FUNCTIONS_TICKET.'func_answerd_ticket.php';
    101             nirweb_ticket_answer_ticket(sanitize_text_field($_POST['id_form']));
    102                 func_list_answer_ajax(sanitize_text_field($_POST['id_form']));
    103         exit();
    104         }
     101    {
     102        include_once NIRWEB_SUPPORT_INC_ADMIN_FUNCTIONS_TICKET . 'func_answerd_ticket.php';
     103        nirweb_ticket_answer_ticket(sanitize_text_field($_POST['id_form']));
     104        func_list_answer_ajax(sanitize_text_field($_POST['id_form']));
     105        exit();
     106    }
    105107}
    106108
     
    113115    function delete_tickets_admin()
    114116    {
    115         include_once NIRWEB_SUPPORT_INC_ADMIN_FUNCTIONS_TICKET.'func_list_tickets.php';
     117        include_once NIRWEB_SUPPORT_INC_ADMIN_FUNCTIONS_TICKET . 'func_list_tickets.php';
    116118        nirweb_ticket_delete_ticket(sanitize_post($_POST['check']));
    117119        exit();
     
    125127add_action('wp_ajax_nopriv_add_department_wpyt', 'add_department_wpyt');
    126128if (!function_exists('add_department_wpyt')) {
    127     function add_department_wpyt(){
    128         include_once NIRWEB_SUPPORT_INC_ADMIN_FUNCTIONS_TICKET.'func_department.php';
     129    function add_department_wpyt()
     130    {
     131        include_once NIRWEB_SUPPORT_INC_ADMIN_FUNCTIONS_TICKET . 'func_department.php';
    129132        nirweb_ticket_ticket_add_department();
    130133        get_list_department_ajax();
     
    141144    function delete_department()
    142145    {
    143         include_once NIRWEB_SUPPORT_INC_ADMIN_FUNCTIONS_TICKET.'func_department.php';
     146        include_once NIRWEB_SUPPORT_INC_ADMIN_FUNCTIONS_TICKET . 'func_department.php';
    144147        nirweb_ticket_delete_department();
    145          exit();
     148        exit();
    146149    }
    147150}
     
    154157if (!function_exists('edite_department')) {
    155158    function edite_department()
    156         {
    157             include_once NIRWEB_SUPPORT_INC_ADMIN_FUNCTIONS_TICKET.'func_department.php';
    158             nirweb_ticket_edite_department(sanitize_post($_POST));
    159             get_list_department_ajax();
    160             exit();
    161         }
     159    {
     160        include_once NIRWEB_SUPPORT_INC_ADMIN_FUNCTIONS_TICKET . 'func_department.php';
     161        nirweb_ticket_edite_department(sanitize_post($_POST));
     162        get_list_department_ajax();
     163        exit();
     164    }
    162165}
    163166
     
    168171add_action('wp_ajax_nopriv_add_question_faq', 'add_question_faq');
    169172if (!function_exists('add_question_faq')) {
    170     function add_question_faq(){
    171         include_once NIRWEB_SUPPORT_INC_ADMIN_FUNCTIONS_TICKET.'func_FAQ.php';
     173    function add_question_faq()
     174    {
     175        include_once NIRWEB_SUPPORT_INC_ADMIN_FUNCTIONS_TICKET . 'func_FAQ.php';
    172176        nirweb_ticket_add_question_faq();
    173177        nirweb_ticket_ajax_get_all_faq();
     
    184188    function delete_faq()
    185189    {
    186         include_once NIRWEB_SUPPORT_INC_ADMIN_FUNCTIONS_TICKET.'func_FAQ.php';
     190        include_once NIRWEB_SUPPORT_INC_ADMIN_FUNCTIONS_TICKET . 'func_FAQ.php';
    187191        nirweb_ticket_delete_faq();
    188          exit();
     192        exit();
    189193    }
    190194}
     
    197201if (!function_exists('ticket_wpyar_file_user_delete')) {
    198202    function ticket_wpyar_file_user_delete()
    199 {
    200     include NIRWEB_SUPPORT_INC_ADMIN_FUNCTIONS_TICKET.'func_upload_file.php';
    201     fun_ticket_wpyar_file_user_delete();
    202      exit();
    203 }
     203    {
     204        include NIRWEB_SUPPORT_INC_ADMIN_FUNCTIONS_TICKET . 'func_upload_file.php';
     205        fun_ticket_wpyar_file_user_delete();
     206        exit();
     207    }
    204208}
    205209
     
    210214 #--------------- Ajax Search in ticketes
    211215 */
    212 add_action('wp_ajax_nirweb_ticket_user_search', 'nirweb_ticket_user_search'); 
    213 add_action('wp_ajax_nopriv_nirweb_ticket_user_search', 'nirweb_ticket_user_search'); 
     216add_action('wp_ajax_nirweb_ticket_user_search', 'nirweb_ticket_user_search');
     217add_action('wp_ajax_nopriv_nirweb_ticket_user_search', 'nirweb_ticket_user_search');
    214218if (!function_exists('nirweb_ticket_user_search')) {
    215219    function nirweb_ticket_user_search()
    216             {
    217                 include_once NIRWEB_SUPPORT_INC_USER_FUNCTIONS_TICKET.'ajax_nirweb_ticket_user_search.php';
    218             func_ajax_nirweb_ticket_user_search(sanitize_text_field($_POST['value']));
    219             exit();
    220             }
    221 } 
    222 
    223   /*
    224  #--------------- Ajax send  ticketes
    225  */
    226 add_action('wp_ajax_user_send_tiket', 'user_send_tiket'); 
    227 add_action('wp_ajax_nopriv_user_send_tiket', 'user_send_tiket');   
     220    {
     221        include_once NIRWEB_SUPPORT_INC_USER_FUNCTIONS_TICKET . 'ajax_nirweb_ticket_user_search.php';
     222        func_ajax_nirweb_ticket_user_search(sanitize_text_field($_POST['value']));
     223        exit();
     224    }
     225}
     226
     227/*
     228#--------------- Ajax send  ticketes
     229*/
     230add_action('wp_ajax_user_send_tiket', 'user_send_tiket');
     231add_action('wp_ajax_nopriv_user_send_tiket', 'user_send_tiket');
    228232if (!function_exists('user_send_tiket')) {
    229233    function user_send_tiket()
    230             {
    231                 include_once NIRWEB_SUPPORT_INC_USER_FUNCTIONS_TICKET.'ajax_user_send_tiket.php';
    232                 func_user_send_tiket();
    233                 exit();
    234             }
     234    {
     235        include_once NIRWEB_SUPPORT_INC_USER_FUNCTIONS_TICKET . 'ajax_user_send_tiket.php';
     236        func_user_send_tiket();
     237        exit();
     238    }
    235239}
    236240
     
    238242 #--------------- Ajax send Answer
    239243 */
    240 add_action('wp_ajax_user_answer_ticket','user_answer_ticket');
    241 add_action('wp_ajax_nopriv_user_answer_ticket','user_answer_ticket');
     244add_action('wp_ajax_user_answer_ticket', 'user_answer_ticket');
     245add_action('wp_ajax_nopriv_user_answer_ticket', 'user_answer_ticket');
    242246if (!function_exists('user_answer_ticket')) {
    243     function user_answer_ticket(){
    244         include_once NIRWEB_SUPPORT_INC_USER_FUNCTIONS_TICKET.'ajax_user_send_answer.php';
     247    function user_answer_ticket()
     248    {
     249        include_once NIRWEB_SUPPORT_INC_USER_FUNCTIONS_TICKET . 'ajax_user_send_answer.php';
    245250        user_wpyar_answer_ticket();
    246251        func_list_answer_ajax_user();
     
    252257 #--------------- Ajax Filtter Ststus
    253258 */
    254 add_action('wp_ajax_filtter_ticket_status','filtter_ticket_status');
    255 add_action('wp_ajax_nopriv_filtter_ticket_status','filtter_ticket_status');
     259add_action('wp_ajax_filtter_ticket_status', 'filtter_ticket_status');
     260add_action('wp_ajax_nopriv_filtter_ticket_status', 'filtter_ticket_status');
    256261if (!function_exists('filtter_ticket_status')) {
    257     function filtter_ticket_status(){
    258         include_once NIRWEB_SUPPORT_INC_USER_FUNCTIONS_TICKET.'filter_ajax_ticket.php';
     262    function filtter_ticket_status()
     263    {
     264        include_once NIRWEB_SUPPORT_INC_USER_FUNCTIONS_TICKET . 'filter_ajax_ticket.php';
    259265        filter_ajax_ticket_func();
    260          exit();
    261     }
    262 }
    263 
     266        exit();
     267    }
     268}
     269
  • nirweb-support/trunk/inc/admin/functions/ajax_search_in_ticketes_wpyar.php

    r2707344 r2708596  
    88         $results = $wpdb->get_results( "SELECT * FROM {$address_table} {$where}" );
    99                if(sizeof($results)>0){
    10                     foreach($results as $row){
    11                         echo esc_html('<li><a href="'.get_bloginfo('url').'/wp-admin/admin.php?page=nirweb_ticket_manage_tickets&amp;tab=all_ticket&amp;action=edit&amp;id='.esc_html($row->ticket_id).'">'.esc_html($row->subject).'</a></li>');
    12                              }
     10        foreach($results as $row){
     11                 echo ('<li><a href="'.get_bloginfo('url').'/wp-admin/admin.php?page=nirweb_ticket_manage_tickets&amp;tab=all_ticket&amp;action=edit&amp;id='.esc_html($row->ticket_id).'">'.esc_html($row->subject).'</a></li>');
     12                    }
    1313                }else{
    14                      echo esc_html('<p class="not_found">'.__('not found', 'nirweb-support').'</p>') ;
     14                     echo ('<p class="not_found">'.esc_html__('not found', 'nirweb-support').'</p>') ;
    1515                }
    1616    }
  • nirweb-support/trunk/inc/admin/functions/func_FAQ.php

    r2705011 r2708596  
    1414        $faqs = $wpdb->get_results("SELECT * FROM {$wpdb->prefix}nirweb_ticket_ticket_faq ORDER BY id DESC   ");
    1515       foreach ($faqs as $faq):
    16             echo esc_html('
     16            echo ('
    1717      <li class="flex w-100">
    1818      <span class="dashicons dashicons-trash remove_faq danger" data-id=""></span>
    1919      <div class="li_list_question  ">
    2020          <div class="question_wpy_faq flex">
    21               <span class="soal_name_wpyt">' . $faq->question . '</span>
     21              <span class="soal_name_wpyt">' .esc_html($faq->question). '</span>
    2222              <span class="arrow_wpyt cret flex aline-c"></span>
    2323          </div>
    2424          <div class="answer_wpys_faq" >
    25               <p>' . $faq->answer . '
     25              <p>' .esc_html($faq->answer). '
    2626              </p>
    2727          </div>  </div> </li>
  • nirweb-support/trunk/inc/admin/functions/func_answerd_ticket.php

    r2707344 r2708596  
    99            'user_id' => get_current_user_id(),
    1010            'time_answer' => current_time("Y-m-d H:i:s"),
    11             'text' => $text,
    12             'attach_url' => isset($_POST['file_url']) && wp_http_validate_url($_POST['file_url']) ? esc_url_raw($_POST['file_url']) : '',
     11            'text' => sanitize_textarea_field($text),
     12            'attach_url' => isset($_POST['file_url']) && wp_http_validate_url($_POST['file_url']) ? esc_url_raw(sanitize_url($_POST['file_url'])) : '',
    1313            'ticket_id' => isset($_POST['id_form']) ? sanitize_text_field($_POST['id_form']) : '');
    1414        if (strlen(sanitize_text_field($_POST['content'])) > 3) {
     
    2222        if (get_option('nirweb_ticket_perfix')['active_send_mail_to_user'] == '1') {
    2323            $user = get_user_by('id', intval(sanitize_text_field($_POST['sender_id'])));
    24             $user = $user->user_email;
     24            $user = sanitize_text_field($user->user_email);
    2525            $ticket_id = sanitize_text_field($_POST['id_form']);
    2626            $ticket_title = sanitize_text_field($_POST['subject']);
    2727            $name_poshtiban = get_user_by('id', intval(sanitize_text_field($_POST['resivered_id'])));
    28             $ticket_poshtiban = $name_poshtiban->user_nicename;
     28            $ticket_poshtiban = sanitize_text_field($name_poshtiban->user_nicename);
    2929            $ticket_dep = sanitize_text_field($_POST['department_name']);
    3030            $ticket_pri = sanitize_text_field($_POST['proname']);
     
    4747        $t_id = sanitize_text_field($ticket_id);
    4848        global $wpdb;
    49         $process_answer_list = $wpdb->get_results("SELECT answered.* ,users.ID , users.display_name
    50                 FROM {$wpdb->prefix}nirweb_ticket_ticket_answered answered   JOIN {$wpdb->prefix}users users ON user_id=ID
    51                 WHERE ticket_id=$t_id  ORDER BY answer_id ASC ");
     49        $process_answer_list = $wpdb->get_results("SELECT answered.* ,users.ID , users.display_name FROM {$wpdb->prefix}nirweb_ticket_ticket_answered answered   JOIN {$wpdb->prefix}users users ON user_id=ID WHERE ticket_id=$t_id  ORDER BY answer_id ASC ");
    5250        foreach ($process_answer_list as $row):
    5351            echo '<li> <div class="head_answer"> <span class="name">' . esc_html($row->display_name) . '  </span>
    54                     <span class="time">' . $date = date('(H:i:s)', strtotime($row->time_answer)) . '' . $date = wp_date(' Y-m-d', strtotime($row->time_answer)) . ' </span>  </div> <div class="content">' . $row->text; ?>
    55             <?php if ($row->attach_url) { echo  esc_html('<p>' .  __('Attachment File', 'nirweb-support') . '  ' . esc_url($row->attach_url) . ' </p>'); } ?>
     52                    <span class="time">' .esc_html(date('(H:i:s)', strtotime($row->time_answer))) . esc_html(wp_date(' Y-m-d', strtotime($row->time_answer))) . ' </span>  </div>
     53                    <div class="content">' .wpautop(esc_html($row->text)); ?>
     54            <?php if ($row->attach_url) { echo  ('<p>' .  esc_html__('Attachment File', 'nirweb-support') . '  ' . esc_url_raw($row->attach_url) . ' </p>'); } ?>
    5655            <?php echo  ' </div></li> ' ;  endforeach;
    5756        exit();
  • nirweb-support/trunk/inc/admin/functions/func_department.php

    r2707344 r2708596  
    11<?php
    2 global $wpdb,$table_prefix;
    3 if (!function_exists('nirweb_ticket_ticket_get_supporter_department')) {function nirweb_ticket_ticket_get_supporter_department()
     2global $wpdb, $table_prefix;
     3if (!function_exists('nirweb_ticket_ticket_get_supporter_department')) {
     4    function nirweb_ticket_ticket_get_supporter_department()
    45    {
    5         $users =  get_users( [ 'role__in' => [ 'user_support', 'administrator'] ]);
     6        $users = get_users(['role__in' => ['user_support', 'administrator']]);
    67        return $users;
    7     }}
     8    }
     9}
    810if (!function_exists('nirweb_ticket_ticket_add_department')) {
    911    function nirweb_ticket_ticket_add_department()
    10 {
    11     $new_arg=array(
    12         'name'  =>  sanitize_text_field($_POST['department_name']),
    13         'support_id'  => sanitize_text_field($_POST['id_poshtiban'])
    14     );
    15     global $wpdb;
    16     $wpdb->insert($wpdb->prefix.'nirweb_ticket_ticket_department',$new_arg);
    17     return $wpdb->last_query;
     12    {
     13        $new_arg = array(
     14            'name' => sanitize_text_field($_POST['department_name']),
     15            'support_id' => sanitize_text_field($_POST['id_poshtiban'])
     16        );
     17        global $wpdb;
     18        $wpdb->insert($wpdb->prefix . 'nirweb_ticket_ticket_department', $new_arg);
     19        return $wpdb->last_query;
     20    }
    1821}
     22if (!function_exists('get_list_department_ajax')) {
     23    function get_list_department_ajax()
     24    {
     25        global $wpdb;
     26        $departments = $wpdb->get_results("SELECT wd.*,wu.ID,wu.display_name
     27    FROM {$wpdb->prefix}nirweb_ticket_ticket_department wd JOIN  {$wpdb->prefix}users wu  ON ID=support_id  ORDER BY department_id DESC    ");
     28        foreach ($departments as $department) {
     29            echo (' <tr style="border: solid 1px #ccc" class="row_dep"> <th><input type="checkbox" id="frm_check_items" name="frm_check_items[]" value="' . esc_html($department->department_id) . '"></th>
     30            <th  class="dep_name"  data-id="' . esc_html($department->department_id) . '" >' . esc_html($department->name) . '</th>
     31            <th class="name_user"  data-user_id="' . esc_html($department->support_id) . '" >' . esc_html($department->display_name) . '</th>
     32            <th><a class="edit_ticket_wpys"> <span class="dashicons dashicons-edit"></span></a></a></th>  </tr>');
     33        }
     34    }
    1935}
    20 if (!function_exists('get_list_department_ajax')) {function get_list_department_ajax(){
    21     global $wpdb;
    22     $departments = $wpdb->get_results("SELECT wd.*,wu.ID,wu.display_name
    23     FROM {$wpdb->prefix}nirweb_ticket_ticket_department wd JOIN  {$wpdb->prefix}users wu  ON ID=support_id  ORDER BY department_id DESC    ");
    24   foreach ($departments as $department){ 
    25 echo esc_html(' <tr style="border: solid 1px #ccc" class="row_dep"> <th><input type="checkbox" id="frm_check_items" name="frm_check_items[]" value="'.esc_html($department->department_id).'"></th>
    26             <th  class="dep_name"  data-id="'.esc_html($department->department_id) .'" >'.esc_html($department->name) .'</th>
    27             <th class="name_user"  data-user_id="'.esc_html($department->support_id) .'" >'.esc_html($department->display_name) .'</th>
    28             <th><a class="edit_ticket_wpys"> <span class="dashicons dashicons-edit"></span></a></a></th>  </tr>');
    29    }
    30 }}
    31 if (!function_exists('nirweb_ticket_ticket_get_list_department')) {function nirweb_ticket_ticket_get_list_department()
     36if (!function_exists('nirweb_ticket_ticket_get_list_department')) {
     37    function nirweb_ticket_ticket_get_list_department()
    3238    {
    3339        global $wpdb;
     
    3541         FROM {$wpdb->prefix}nirweb_ticket_ticket_department wd JOIN  {$wpdb->prefix}users wu ON ID=support_id  ORDER BY department_id DESC ");
    3642        return $departments;
    37     }}
    38 if (!function_exists('nirweb_ticket_delete_department')) {function nirweb_ticket_delete_department(){
    39     global $wpdb;
    40     $item_delete = sanitize_post($_POST['check']);
    41     for ($i = 0; $i < count($item_delete); $i++) {
    42         $wpdb->delete($wpdb->prefix.'nirweb_ticket_ticket_department', array('department_id' => $item_delete[$i]));
    4343    }
    44 }}
    45 if (!function_exists('nirweb_ticket_edite_department')) {function nirweb_ticket_edite_department($data){
    46     $name = sanitize_text_field($data['department_name']);
    47       $id = sanitize_text_field($data['depa_id']);
    48       $support_id = sanitize_text_field($data['id_poshtiban']);
    49       global $wpdb;
    50      $table_name  = $wpdb->prefix."nirweb_ticket_ticket_department";
    51      $wpdb->update( $table_name, array('name'=>$name, 'support_id'=>$support_id), array('department_id' => $id));
    52  }}
     44}
     45if (!function_exists('nirweb_ticket_delete_department')) {
     46    function nirweb_ticket_delete_department()
     47    {
     48        global $wpdb;
     49        $item_delete = sanitize_post($_POST['check']);
     50        for ($i = 0; $i < count($item_delete); $i++) {
     51            $wpdb->delete($wpdb->prefix . 'nirweb_ticket_ticket_department', array('department_id' => $item_delete[$i]));
     52        }
     53    }
     54}
     55if (!function_exists('nirweb_ticket_edite_department')) {
     56    function nirweb_ticket_edite_department($data)
     57    {
     58        $name = sanitize_text_field($data['department_name']);
     59        $id = sanitize_text_field($data['depa_id']);
     60        $support_id = sanitize_text_field($data['id_poshtiban']);
     61        global $wpdb;
     62        $table_name = $wpdb->prefix . "nirweb_ticket_ticket_department";
     63        $wpdb->update($table_name, array('name' => $name, 'support_id' => $support_id), array('department_id' => $id));
     64    }
     65}
  • nirweb-support/trunk/inc/admin/functions/func_list_tickets.php

    r2707344 r2708596  
    11<?php
    2 if (!function_exists('wp_list_ticket_check')) {function wp_list_ticket_check(){
    3     global $wpdb;
    4     $new_ticket_list = $wpdb->get_results("SELECT ticket.* , users.* ,status.*,department.* ,department.name as depname,priority.*,priority.name as proname
     2if (!function_exists('wp_list_ticket_check')) {
     3    function wp_list_ticket_check()
     4    {
     5        global $wpdb;
     6        $new_ticket_list = $wpdb->get_results("SELECT ticket.* , users.* ,status.*,department.* ,department.name as depname,priority.*,priority.name as proname
    57   ,post.ID,post.post_title as product_name
    68                                              FROM {$wpdb->prefix}nirweb_ticket_ticket ticket
     
    1618                                              ON product=post.ID
    1719                                              ");
    18     return $new_ticket_list;
    19 }}
    20 if (!function_exists('wp_list_ticket_check_posht')) {function wp_list_ticket_check_posht($id)
    21 {
    22     global $wpdb;
    23     $new_ticket_list = $wpdb->get_results("SELECT ticket.* , users.* ,status.*,department.* ,department.name as depname,priority.*,priority.name as proname
     20        return $new_ticket_list;
     21    }
     22}
     23if (!function_exists('wp_list_ticket_check_posht')) {
     24    function wp_list_ticket_check_posht($id)
     25    {
     26        global $wpdb;
     27        $id = sanitize_text_field($id);
     28        $new_ticket_list = $wpdb->get_results("SELECT ticket.* , users.* ,status.*,department.* ,department.name as depname,priority.*,priority.name as proname
    2429        ,post.ID,post.post_title as product_name
    2530                                                   FROM {$wpdb->prefix}nirweb_ticket_ticket ticket
     
    3641                                                    WHERE ticket.support_id = $id OR ticket.sender_id = $id
    3742                                                 ");
    38     return $new_ticket_list;
    39 }}
    40 if (!function_exists('nirweb_ticket_get_list_all_ticket')) {function nirweb_ticket_get_list_all_ticket()
    41 {
    42     global $wpdb;
    43     $items_per_page = 20;
    44     $page = isset( $_GET['cpage'] ) ? abs( (int) $_GET['cpage'] ) : 1;
    45     $offset = ( $page * $items_per_page ) - $items_per_page;
    46     $query = 'SELECT * FROM '.$wpdb->prefix.'nirweb_ticket_ticket ticket';
    47     $total_query = "SELECT COUNT(1) FROM (${query}) AS combined_table";
    48     $total = $wpdb->get_var( $total_query );
    49     $new_ticket_list = $wpdb->get_results("SELECT ticket.* , users.* ,status.*,department.* ,department.name as depname,priority.*,priority.name as proname
     43        return $new_ticket_list;
     44    }
     45}
     46if (!function_exists('nirweb_ticket_get_list_all_ticket')) {
     47    function nirweb_ticket_get_list_all_ticket()
     48    {
     49        global $wpdb;
     50        $items_per_page = 20;
     51        $page = isset($_GET['cpage']) ? abs((int)$_GET['cpage']) : 1;
     52        $offset = ($page * $items_per_page) - $items_per_page;
     53        $query = 'SELECT * FROM ' . $wpdb->prefix . 'nirweb_ticket_ticket ticket';
     54        $total_query = "SELECT COUNT(1) FROM (${query}) AS combined_table";
     55        $total = $wpdb->get_var($total_query);
     56        $new_ticket_list = $wpdb->get_results("SELECT ticket.* , users.* ,status.*,department.* ,department.name as depname,priority.*,priority.name as proname
    5057        ,post.ID,post.post_title as product_name
    51                                                    FROM {$wpdb->prefix}nirweb_ticket_ticket ticket
    52                                                    LEFT JOIN {$wpdb->prefix}users users
    53                                                    ON sender_id=ID
    54                                     LEFT JOIN  {$wpdb->prefix}nirweb_ticket_ticket_status status
    55                                                    ON status=status_id 
    56                                                    LEFT JOIN  {$wpdb->prefix}nirweb_ticket_ticket_department department
    57                                                    ON department=department_id 
    58                                      LEFT JOIN  {$wpdb->prefix}nirweb_ticket_ticket_priority priority
    59                                                    ON priority=priority_id
    60                                      LEFT JOIN  {$wpdb->prefix}posts post
    61                                                    ON product=post.ID
    62                                                    ORDER BY ticket_id DESC
    63                                                    LIMIT  $offset,  $items_per_page
    64                                                    ");
    65     return array($new_ticket_list,paginate_links( array(
    66         'base' => add_query_arg( 'cpage', '%#%' ),
    67         'format' => '',
    68         'prev_text' => __('&laquo;'),
    69         'next_text' => __('&raquo;'),
    70         'total' => ceil($total / $items_per_page),
    71         'current' => $page
    72     )));
    73 }}
    74 if (!function_exists('nirweb_ticket_get_list_all_ticket_posht')) {function nirweb_ticket_get_list_all_ticket_posht($id)
    75 {
    76     global $wpdb;
    77     $items_per_page = 20;
    78     $page = isset( $_GET['cpage'] ) ? abs( (int) $_GET['cpage'] ) : 1;
    79     $offset = ( $page * $items_per_page ) - $items_per_page;
    80     $query = 'SELECT * FROM '.$wpdb->prefix.'nirweb_ticket_ticket ticket';
    81     $total_query = "SELECT COUNT(1) FROM (${query}) AS combined_table";
    82     $total = $wpdb->get_var( $total_query );
    83     $new_ticket_list = $wpdb->get_results("SELECT ticket.* , users.* ,status.*,department.* ,department.name as depname,priority.*,priority.name as proname
    84         ,post.ID,post.post_title as product_name
    85                                                    FROM {$wpdb->prefix}nirweb_ticket_ticket ticket
    86                                                    LEFT JOIN {$wpdb->prefix}users users
    87                                                    ON sender_id=ID
    88                                     LEFT JOIN  {$wpdb->prefix}nirweb_ticket_ticket_status status
    89                                                    ON status=status_id 
    90                                                    LEFT JOIN  {$wpdb->prefix}nirweb_ticket_ticket_department department
    91                                                    ON department=department_id 
    92                                      LEFT JOIN  {$wpdb->prefix}nirweb_ticket_ticket_priority priority
    93                                                    ON priority=priority_id
    94                                      LEFT JOIN  {$wpdb->prefix}posts post
    95                                                    ON product=post.ID
    96                                                     WHERE ticket.support_id = $id OR ticket.sender_id = $id
    97                                                    ORDER BY ticket_id DESC
    98                                                    LIMIT  $offset,  $items_per_page
    99                                                    ");
    100     return array($new_ticket_list,paginate_links( array(
    101         'base' => add_query_arg( 'cpage', '%#%' ),
    102         'format' => '',
    103         'prev_text' => __('&laquo;'),
    104         'next_text' => __('&raquo;'),
    105         'total' => ceil($total / $items_per_page),
    106         'current' => $page
    107     )));
    108 }}
    109 if (!function_exists('nirweb_ticket_get_list_new_ticket')) {function nirweb_ticket_get_list_new_ticket()
    110 {
    111     global $wpdb;
    112     $items_per_page = 20;
    113     $page = isset( $_GET['cpage'] ) ? abs( (int) $_GET['cpage'] ) : 1;
    114     $offset = ( $page * $items_per_page ) - $items_per_page;
    115     $query = 'SELECT * FROM '.$wpdb->prefix.'nirweb_ticket_ticket ticket WHERE status=1';
    116     $total_query = "SELECT COUNT(1) FROM (${query}) AS combined_table";
    117     $total = $wpdb->get_var( $total_query );
    118     $process_ticket_list = $wpdb->get_results("SELECT ticket.* , users.* ,status.*,department.* ,department.name as depname ,priority.*,priority.name as proname  ,post.ID,post.post_title as product_name
     58        FROM {$wpdb->prefix}nirweb_ticket_ticket ticket
     59        LEFT JOIN {$wpdb->prefix}users users
     60        ON sender_id=ID
     61        LEFT JOIN  {$wpdb->prefix}nirweb_ticket_ticket_status status
     62        ON status=status_id 
     63        LEFT JOIN  {$wpdb->prefix}nirweb_ticket_ticket_department department
     64        ON department=department_id 
     65        LEFT JOIN  {$wpdb->prefix}nirweb_ticket_ticket_priority priority
     66        ON priority=priority_id
     67        LEFT JOIN  {$wpdb->prefix}posts post
     68        ON product=post.ID
     69        ORDER BY ticket_id DESC
     70        LIMIT  $offset,  $items_per_page ");
     71        return array($new_ticket_list, paginate_links(array(
     72            'base' => add_query_arg('cpage', '%#%'),
     73            'format' => '',
     74            'prev_text' => __('&laquo;'),
     75            'next_text' => __('&raquo;'),
     76            'total' => ceil($total / $items_per_page),
     77            'current' => $page
     78        )));
     79    }
     80}
     81if (!function_exists('nirweb_ticket_get_list_all_ticket_posht')) {
     82    function nirweb_ticket_get_list_all_ticket_posht($id)
     83    {
     84        global $wpdb;
     85        $id = sanitize_text_field($id);
     86        $items_per_page = 20;
     87        $page = isset($_GET['cpage']) ? abs((int)$_GET['cpage']) : 1;
     88        $offset = ($page * $items_per_page) - $items_per_page;
     89        $query = 'SELECT * FROM ' . $wpdb->prefix . 'nirweb_ticket_ticket ticket';
     90        $total_query = "SELECT COUNT(1) FROM (${query}) AS combined_table";
     91        $total = $wpdb->get_var($total_query);
     92        $new_ticket_list = $wpdb->get_results("SELECT ticket.* , users.* ,status.*,department.* ,department.name as depname,priority.*,priority.name as proname
     93            ,post.ID,post.post_title as product_name
     94            FROM {$wpdb->prefix}nirweb_ticket_ticket ticket
     95            LEFT JOIN {$wpdb->prefix}users users
     96            ON sender_id=ID
     97            LEFT JOIN  {$wpdb->prefix}nirweb_ticket_ticket_status status
     98            ON status=status_id 
     99            LEFT JOIN  {$wpdb->prefix}nirweb_ticket_ticket_department department
     100            ON department=department_id 
     101            LEFT JOIN  {$wpdb->prefix}nirweb_ticket_ticket_priority priority
     102            ON priority=priority_id
     103            LEFT JOIN  {$wpdb->prefix}posts post
     104            ON product=post.ID
     105            WHERE ticket.support_id = $id OR ticket.sender_id = $id
     106            ORDER BY ticket_id DESC
     107            LIMIT  $offset,  $items_per_page
     108        ");
     109        return array($new_ticket_list, paginate_links(array(
     110            'base' => add_query_arg('cpage', '%#%'),
     111            'format' => '',
     112            'prev_text' => __('&laquo;'),
     113            'next_text' => __('&raquo;'),
     114            'total' => ceil($total / $items_per_page),
     115            'current' => $page
     116        )));
     117    }
     118}
     119if (!function_exists('nirweb_ticket_get_list_new_ticket')) {
     120    function nirweb_ticket_get_list_new_ticket()
     121    {
     122        global $wpdb;
     123        $items_per_page = 20;
     124        $page = isset($_GET['cpage']) ? abs((int)$_GET['cpage']) : 1;
     125        $offset = ($page * $items_per_page) - $items_per_page;
     126        $query = 'SELECT * FROM ' . $wpdb->prefix . 'nirweb_ticket_ticket ticket WHERE status=1';
     127        $total_query = "SELECT COUNT(1) FROM (${query}) AS combined_table";
     128        $total = $wpdb->get_var($total_query);
     129        $process_ticket_list = $wpdb->get_results("SELECT ticket.* , users.* ,status.*,department.* ,department.name as depname ,priority.*,priority.name as proname  ,post.ID,post.post_title as product_name
    119130               FROM {$wpdb->prefix}nirweb_ticket_ticket ticket
    120131               LEFT JOIN {$wpdb->prefix}users users
     
    132143                                LIMIT  $offset,  $items_per_page
    133144                                                   ");
    134     return array($process_ticket_list,paginate_links( array(
    135         'base' => add_query_arg( 'cpage', '%#%' ),
    136         'format' => '',
    137         'prev_text' => __('&laquo;'),
    138         'next_text' => __('&raquo;'),
    139         'total' => ceil($total / $items_per_page),
    140         'current' => $page
    141     ))
    142     );
    143 }}
    144 if (!function_exists('nirweb_ticket_get_list_new_ticket_posht')) {function nirweb_ticket_get_list_new_ticket_posht($id)
    145 {
    146     global $wpdb;
    147     $items_per_page = 20;
    148     $page = isset( $_GET['cpage'] ) ? abs( (int) $_GET['cpage'] ) : 1;
    149     $offset = ( $page * $items_per_page ) - $items_per_page;
    150     $query = 'SELECT * FROM '.$wpdb->prefix.'nirweb_ticket_ticket ticket WHERE status=1';
    151     $total_query = "SELECT COUNT(1) FROM (${query}) AS combined_table";
    152     $total = $wpdb->get_var( $total_query );
    153     $process_ticket_list = $wpdb->get_results("SELECT ticket.* , users.* ,status.*,department.* ,department.name as depname ,priority.*,priority.name as proname  ,post.ID,post.post_title as product_name
     145        return array($process_ticket_list, paginate_links(array(
     146            'base' => add_query_arg('cpage', '%#%'),
     147            'format' => '',
     148            'prev_text' => __('&laquo;'),
     149            'next_text' => __('&raquo;'),
     150            'total' => ceil($total / $items_per_page),
     151            'current' => $page
     152        ))
     153        );
     154    }
     155}
     156if (!function_exists('nirweb_ticket_get_list_new_ticket_posht')) {
     157    function nirweb_ticket_get_list_new_ticket_posht($id)
     158    {
     159        global $wpdb;
     160        $id = sanitize_text_field($id);
     161        $items_per_page = 20;
     162        $page = isset($_GET['cpage']) ? abs((int)$_GET['cpage']) : 1;
     163        $offset = ($page * $items_per_page) - $items_per_page;
     164        $query = 'SELECT * FROM ' . $wpdb->prefix . 'nirweb_ticket_ticket ticket WHERE status=1';
     165        $total_query = "SELECT COUNT(1) FROM (${query}) AS combined_table";
     166        $total = $wpdb->get_var($total_query);
     167        $process_ticket_list = $wpdb->get_results("SELECT ticket.* , users.* ,status.*,department.* ,department.name as depname ,priority.*,priority.name as proname  ,post.ID,post.post_title as product_name
    154168               FROM {$wpdb->prefix}nirweb_ticket_ticket ticket
    155169               LEFT JOIN {$wpdb->prefix}users users
     
    167181                                LIMIT  $offset,  $items_per_page
    168182                                                   ");
    169     return array($process_ticket_list,paginate_links( array(
    170         'base' => add_query_arg( 'cpage', '%#%' ),
    171         'format' => '',
    172         'prev_text' => __('&laquo;'),
    173         'next_text' => __('&raquo;'),
    174         'total' => ceil($total / $items_per_page),
    175         'current' => $page
    176     ))
    177     );
    178 }}
    179 if (!function_exists('nirweb_ticket_get_list_process_ticket')) {function nirweb_ticket_get_list_process_ticket()
    180 {
    181     global $wpdb;
    182     $items_per_page = 20;
    183     $page = isset( $_GET['cpage'] ) ? abs( (int) $_GET['cpage'] ) : 1;
    184     $offset = ( $page * $items_per_page ) - $items_per_page;
    185     $query = 'SELECT * FROM '.$wpdb->prefix.'nirweb_ticket_ticket ticket WHERE status=2';
    186     $total_query = "SELECT COUNT(1) FROM (${query}) AS combined_table";
    187     $total = $wpdb->get_var( $total_query );
    188     $process_ticket_list = $wpdb->get_results("SELECT ticket.* , users.* ,status.*,department.* ,department.name as depname,priority.*,priority.name as proname,post.ID,post.post_title as product_name
     183        return array($process_ticket_list, paginate_links(array(
     184            'base' => add_query_arg('cpage', '%#%'),
     185            'format' => '',
     186            'prev_text' => __('&laquo;'),
     187            'next_text' => __('&raquo;'),
     188            'total' => ceil($total / $items_per_page),
     189            'current' => $page
     190        ))
     191        );
     192    }
     193}
     194if (!function_exists('nirweb_ticket_get_list_process_ticket')) {
     195    function nirweb_ticket_get_list_process_ticket()
     196    {
     197        global $wpdb;
     198        $items_per_page = 20;
     199        $page = isset($_GET['cpage']) ? abs((int)$_GET['cpage']) : 1;
     200        $offset = ($page * $items_per_page) - $items_per_page;
     201        $query = 'SELECT * FROM ' . $wpdb->prefix . 'nirweb_ticket_ticket ticket WHERE status=2';
     202        $total_query = "SELECT COUNT(1) FROM (${query}) AS combined_table";
     203        $total = $wpdb->get_var($total_query);
     204        $process_ticket_list = $wpdb->get_results("SELECT ticket.* , users.* ,status.*,department.* ,department.name as depname,priority.*,priority.name as proname,post.ID,post.post_title as product_name
    189205                       FROM {$wpdb->prefix}nirweb_ticket_ticket ticket
    190206                       LEFT JOIN {$wpdb->prefix}users users
     
    202218                    LIMIT  $offset,  $items_per_page
    203219                                                   ");
    204     return array($process_ticket_list,paginate_links( array(
    205         'base' => add_query_arg( 'cpage', '%#%' ),
    206         'format' => '',
    207         'prev_text' => __('&laquo;'),
    208         'next_text' => __('&raquo;'),
    209         'total' => ceil($total / $items_per_page),
    210         'current' => $page
    211     ))
    212     );
    213 }}
    214 if (!function_exists('nirweb_ticket_get_list_process_ticket_posht')) {function nirweb_ticket_get_list_process_ticket_posht($id)
    215 {
    216     global $wpdb;
    217     $items_per_page = 20;
    218     $page = isset( $_GET['cpage'] ) ? abs( (int) $_GET['cpage'] ) : 1;
    219     $offset = ( $page * $items_per_page ) - $items_per_page;
    220     $query = 'SELECT * FROM '.$wpdb->prefix.'nirweb_ticket_ticket ticket WHERE status=2';
    221     $total_query = "SELECT COUNT(1) FROM (${query}) AS combined_table";
    222     $total = $wpdb->get_var( $total_query );
    223     $process_ticket_list = $wpdb->get_results("SELECT ticket.* , users.* ,status.*,department.* ,department.name as depname,priority.*,priority.name as proname,post.ID,post.post_title as product_name
     220        return array($process_ticket_list, paginate_links(array(
     221            'base' => add_query_arg('cpage', '%#%'),
     222            'format' => '',
     223            'prev_text' => __('&laquo;'),
     224            'next_text' => __('&raquo;'),
     225            'total' => ceil($total / $items_per_page),
     226            'current' => $page
     227        ))
     228        );
     229    }
     230}
     231if (!function_exists('nirweb_ticket_get_list_process_ticket_posht')) {
     232    function nirweb_ticket_get_list_process_ticket_posht($id)
     233    {
     234        global $wpdb;
     235        $id = sanitize_text_field($id);
     236        $items_per_page = 20;
     237        $page = isset($_GET['cpage']) ? abs((int)$_GET['cpage']) : 1;
     238        $offset = ($page * $items_per_page) - $items_per_page;
     239        $query = 'SELECT * FROM ' . $wpdb->prefix . 'nirweb_ticket_ticket ticket WHERE status=2';
     240        $total_query = "SELECT COUNT(1) FROM (${query}) AS combined_table";
     241        $total = $wpdb->get_var($total_query);
     242        $process_ticket_list = $wpdb->get_results("SELECT ticket.* , users.* ,status.*,department.* ,department.name as depname,priority.*,priority.name as proname,post.ID,post.post_title as product_name
    224243                   FROM {$wpdb->prefix}nirweb_ticket_ticket ticket
    225244                   LEFT JOIN {$wpdb->prefix}users users
     
    236255                   ORDER BY ticket_id DESC
    237256                LIMIT  $offset,  $items_per_page  ");
    238     return array($process_ticket_list,paginate_links( array(
    239         'base' => add_query_arg( 'cpage', '%#%' ),
    240         'format' => '',
    241         'prev_text' => __('&laquo;'),
    242         'next_text' => __('&raquo;'),
    243         'total' => ceil($total / $items_per_page),
    244         'current' => $page
    245     ))
    246     );
    247 }}
     257        return array($process_ticket_list, paginate_links(array(
     258            'base' => add_query_arg('cpage', '%#%'),
     259            'format' => '',
     260            'prev_text' => __('&laquo;'),
     261            'next_text' => __('&raquo;'),
     262            'total' => ceil($total / $items_per_page),
     263            'current' => $page
     264        ))
     265        );
     266    }
     267}
    248268if (!function_exists('wp_yap_get_list_answered_ticket')) {
    249269    function wp_yap_get_list_answered_ticket()
     
    251271        global $wpdb;
    252272        $items_per_page = 20;
    253         $page = isset( $_GET['cpage'] ) ? abs( (int) $_GET['cpage'] ) : 1;
    254         $offset = ( $page * $items_per_page ) - $items_per_page;
    255         $query = 'SELECT * FROM '.$wpdb->prefix.'nirweb_ticket_ticket ticket WHERE status=3';
    256         $total_query = "SELECT COUNT(1) FROM (${query}) AS combined_table";
    257         $total = $wpdb->get_var( $total_query );
     273        $page = isset($_GET['cpage']) ? abs((int)$_GET['cpage']) : 1;
     274        $offset = ($page * $items_per_page) - $items_per_page;
     275        $query = 'SELECT * FROM ' . $wpdb->prefix . 'nirweb_ticket_ticket ticket WHERE status=3';
     276        $total_query = "SELECT COUNT(1) FROM (${query}) AS combined_table";
     277        $total = $wpdb->get_var($total_query);
    258278        $answered_ticket_list = $wpdb->get_results("SELECT ticket.* , users.* ,status.*,department.* ,department.name as depname,priority.*,priority.name as proname,post.ID,post.post_title as product_name
    259279                                               FROM {$wpdb->prefix}nirweb_ticket_ticket ticket
     
    272292                                        LIMIT  $offset,  $items_per_page
    273293                                               ");
    274         return array($answered_ticket_list,paginate_links( array(
    275             'base' => add_query_arg( 'cpage', '%#%' ),
    276             'format' => '',
    277             'prev_text' => __('&laquo;'),
    278             'next_text' => __('&raquo;'),
    279             'total' => ceil($total / $items_per_page),
    280             'current' => $page
    281         ))
    282         );
    283     }
    284 }
    285 if (!function_exists('wp_yap_get_list_answered_ticket_posht')) {function wp_yap_get_list_answered_ticket_posht($id)
    286 {
    287     global $wpdb;
    288     $items_per_page = 20;
    289     $page = isset( $_GET['cpage'] ) ? abs( (int) $_GET['cpage'] ) : 1;
    290     $offset = ( $page * $items_per_page ) - $items_per_page;
    291     $query = 'SELECT * FROM '.$wpdb->prefix.'nirweb_ticket_ticket ticket WHERE status=3';
    292     $total_query = "SELECT COUNT(1) FROM (${query}) AS combined_table";
    293     $total = $wpdb->get_var( $total_query );
    294     $answered_ticket_list = $wpdb->get_results("SELECT ticket.* ,users.* ,status.*,department.* ,department.name as depname,priority.*,priority.name as proname,post.ID,post.post_title as product_name
     294        return array($answered_ticket_list, paginate_links(array(
     295            'base' => add_query_arg('cpage', '%#%'),
     296            'format' => '',
     297            'prev_text' => __('&laquo;'),
     298            'next_text' => __('&raquo;'),
     299            'total' => ceil($total / $items_per_page),
     300            'current' => $page
     301        ))
     302        );
     303    }
     304}
     305if (!function_exists('wp_yap_get_list_answered_ticket_posht')) {
     306    function wp_yap_get_list_answered_ticket_posht($id)
     307    {
     308        global $wpdb;
     309        $id = sanitize_text_field($id);
     310        $items_per_page = 20;
     311        $page = isset($_GET['cpage']) ? abs((int)$_GET['cpage']) : 1;
     312        $offset = ($page * $items_per_page) - $items_per_page;
     313        $query = 'SELECT * FROM ' . $wpdb->prefix . 'nirweb_ticket_ticket ticket WHERE status=3';
     314        $total_query = "SELECT COUNT(1) FROM (${query}) AS combined_table";
     315        $total = $wpdb->get_var($total_query);
     316        $answered_ticket_list = $wpdb->get_results("SELECT ticket.* ,users.* ,status.*,department.* ,department.name as depname,priority.*,priority.name as proname,post.ID,post.post_title as product_name
    295317                                                   FROM {$wpdb->prefix}nirweb_ticket_ticket ticket
    296318                                                   LEFT JOIN {$wpdb->prefix}users users
     
    308330                                            LIMIT  $offset,  $items_per_page
    309331                                                   ");
    310     return array($answered_ticket_list,paginate_links( array(
    311         'base' => add_query_arg( 'cpage', '%#%' ),
    312         'format' => '',
    313         'prev_text' => __('&laquo;'),
    314         'next_text' => __('&raquo;'),
    315         'total' => ceil($total / $items_per_page),
    316         'current' => $page
    317     ))
    318     );
    319 }}
    320 if (!function_exists('wp_yap_get_list_closed_ticket')) {function wp_yap_get_list_closed_ticket()
    321 {
    322     global $wpdb;
    323     $items_per_page = 20;
    324     $page = isset( $_GET['cpage'] ) ? abs( (int) $_GET['cpage'] ) : 1;
    325     $offset = ( $page * $items_per_page ) - $items_per_page;
    326     $query = 'SELECT * FROM '.$wpdb->prefix.'nirweb_ticket_ticket ticket WHERE status=4';
    327     $total_query = "SELECT COUNT(1) FROM (${query}) AS combined_table";
    328     $total = $wpdb->get_var( $total_query );
    329     $closed_ticket_list = $wpdb->get_results("SELECT ticket.* , users.* ,status.*,department.* ,department.name as depname,priority.*,priority.name as proname,post.ID,post.post_title as product_name
     332        return array($answered_ticket_list, paginate_links(array(
     333            'base' => add_query_arg('cpage', '%#%'),
     334            'format' => '',
     335            'prev_text' => __('&laquo;'),
     336            'next_text' => __('&raquo;'),
     337            'total' => ceil($total / $items_per_page),
     338            'current' => $page
     339        ))
     340        );
     341    }
     342}
     343if (!function_exists('wp_yap_get_list_closed_ticket')) {
     344    function wp_yap_get_list_closed_ticket()
     345    {
     346        global $wpdb;
     347        $items_per_page = 20;
     348        $page = isset($_GET['cpage']) ? abs((int)$_GET['cpage']) : 1;
     349        $offset = ($page * $items_per_page) - $items_per_page;
     350        $query = 'SELECT * FROM ' . $wpdb->prefix . 'nirweb_ticket_ticket ticket WHERE status=4';
     351        $total_query = "SELECT COUNT(1) FROM (${query}) AS combined_table";
     352        $total = $wpdb->get_var($total_query);
     353        $closed_ticket_list = $wpdb->get_results("SELECT ticket.* , users.* ,status.*,department.* ,department.name as depname,priority.*,priority.name as proname,post.ID,post.post_title as product_name
    330354                                                   FROM {$wpdb->prefix}nirweb_ticket_ticket ticket
    331355                                                   LEFT JOIN {$wpdb->prefix}users users
     
    343367                                                    LIMIT  $offset,  $items_per_page
    344368                                                   ");
    345     return array($closed_ticket_list,paginate_links( array(
    346         'base' => add_query_arg( 'cpage', '%#%' ),
    347         'format' => '',
    348         'prev_text' => __('&laquo;'),
    349         'next_text' => __('&raquo;'),
    350         'total' => ceil($total / $items_per_page),
    351         'current' => $page
    352     ))
    353     );
    354 }}
    355 if (!function_exists('wp_yap_get_list_closed_ticket_posht')) {function wp_yap_get_list_closed_ticket_posht($id)
    356 {
    357     global $wpdb;
    358     $items_per_page = 20;
    359     $page = isset( $_GET['cpage'] ) ? abs( (int) $_GET['cpage'] ) : 1;
    360     $offset = ( $page * $items_per_page ) - $items_per_page;
    361     $query = 'SELECT * FROM '.$wpdb->prefix.'nirweb_ticket_ticket ticket WHERE status=4';
    362     $total_query = "SELECT COUNT(1) FROM (${query}) AS combined_table";
    363     $total = $wpdb->get_var( $total_query );
    364     $closed_ticket_list = $wpdb->get_results("SELECT ticket.* , users.* ,status.*,department.* ,department.name as depname,priority.*,priority.name as proname,post.ID,post.post_title as product_name
     369        return array($closed_ticket_list, paginate_links(array(
     370            'base' => add_query_arg('cpage', '%#%'),
     371            'format' => '',
     372            'prev_text' => __('&laquo;'),
     373            'next_text' => __('&raquo;'),
     374            'total' => ceil($total / $items_per_page),
     375            'current' => $page
     376        ))
     377        );
     378    }
     379}
     380if (!function_exists('wp_yap_get_list_closed_ticket_posht')) {
     381    function wp_yap_get_list_closed_ticket_posht($id)
     382    {
     383        global $wpdb;
     384        $id = sanitize_text_field($id);
     385        $items_per_page = 20;
     386        $page = isset($_GET['cpage']) ? abs((int)$_GET['cpage']) : 1;
     387        $offset = ($page * $items_per_page) - $items_per_page;
     388        $query = 'SELECT * FROM ' . $wpdb->prefix . 'nirweb_ticket_ticket ticket WHERE status=4';
     389        $total_query = "SELECT COUNT(1) FROM (${query}) AS combined_table";
     390        $total = $wpdb->get_var($total_query);
     391        $closed_ticket_list = $wpdb->get_results("SELECT ticket.* , users.* ,status.*,department.* ,department.name as depname,priority.*,priority.name as proname,post.ID,post.post_title as product_name
    365392                                                   FROM {$wpdb->prefix}nirweb_ticket_ticket ticket
    366393                                                   LEFT JOIN {$wpdb->prefix}users users
     
    378405                                                    LIMIT  $offset,  $items_per_page
    379406                                                   ");
    380     return array($closed_ticket_list,paginate_links( array(
    381         'base' => add_query_arg( 'cpage', '%#%' ),
    382         'format' => '',
    383         'prev_text' => __('&laquo;'),
    384         'next_text' => __('&raquo;'),
    385         'total' => ceil($total / $items_per_page),
    386         'current' => $page
    387     ))
    388     );
    389 }}
    390 if (!function_exists('nirweb_ticket_edit_ticket')) { function nirweb_ticket_edit_ticket($ticket_id)
    391 {
    392     global $wpdb;
    393     $ticket = $wpdb->get_row("SELECT ticket.* ,users.* ,status.*,department.* ,department.name as depname,priority.*,priority.name as proname ,revuser.ID as rev_id,revuser.display_name as rev_name ,posts.ID,posts.post_title as product_name
     407        return array($closed_ticket_list, paginate_links(array(
     408            'base' => add_query_arg('cpage', '%#%'),
     409            'format' => '',
     410            'prev_text' => __('&laquo;'),
     411            'next_text' => __('&raquo;'),
     412            'total' => ceil($total / $items_per_page),
     413            'current' => $page
     414        ))
     415        );
     416    }
     417}
     418if (!function_exists('nirweb_ticket_edit_ticket')) {
     419    function nirweb_ticket_edit_ticket($ticket_id)
     420    {
     421        global $wpdb;
     422        $ticket_id = sanitize_text_field($ticket_id);
     423        $ticket = $wpdb->get_row("SELECT ticket.* ,users.* ,status.*,department.* ,department.name as depname,priority.*,priority.name as proname ,revuser.ID as rev_id,revuser.display_name as rev_name ,posts.ID,posts.post_title as product_name
    394424        FROM {$wpdb->prefix}nirweb_ticket_ticket ticket
    395425        LEFT JOIN {$wpdb->prefix}users users
     
    406436        ON priority=priority_id       
    407437      where $ticket_id = ticket_id;  ");
    408     return $ticket;
    409 }}
    410 if (!function_exists('nirweb_ticket_delete_ticket')) {function nirweb_ticket_delete_ticket($item_delete)
    411 {
    412     global $wpdb;
    413     for ($i = 0; $i < count($item_delete); $i++) {
    414         $wpdb->delete($wpdb->prefix.'nirweb_ticket_ticket', array('ticket_id' => $item_delete[$i]));
    415         $wpdb->delete($wpdb->prefix.'nirweb_ticket_ticket_answered', array('ticket_id' => $item_delete[$i]));
    416     }
    417 }
     438        return $ticket;
     439    }
     440}
     441if (!function_exists('nirweb_ticket_delete_ticket')) {
     442    function nirweb_ticket_delete_ticket($item_delete)
     443    {
     444        global $wpdb;
     445        for ($i = 0; $i < count($item_delete); $i++) {
     446            $wpdb->delete($wpdb->prefix . 'nirweb_ticket_ticket', array('ticket_id' => $item_delete[$i]));
     447            $wpdb->delete($wpdb->prefix . 'nirweb_ticket_ticket_answered', array('ticket_id' => $item_delete[$i]));
     448        }
     449    }
    418450}
    419451 
  • nirweb-support/trunk/inc/admin/functions/func_number_tab_ticktes.php

    r2529767 r2708596  
    33    global $wpdb;
    44    $count_all=intval($wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->prefix}nirweb_ticket_ticket"));
    5     return $count_all;
     5    return esc_html($count_all);
    66}}
    77if (!function_exists('nirweb_ticket_count_new_ticket')) {function nirweb_ticket_count_new_ticket(){
     
    99    $count_all=intval($wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->prefix}nirweb_ticket_ticket
    1010                                            WHERE status=1"));
    11     return $count_all;
     11    return esc_html($count_all);
    1212}}
    1313if (!function_exists('nirweb_ticket_count_new_ticket_posht')) {function nirweb_ticket_count_new_ticket_posht($id){
     
    1515    $count_all=intval($wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->prefix}nirweb_ticket_ticket
    1616                                            WHERE (support_id = $id OR sender_id = $id) AND status=1"));
    17     return $count_all;
     17    return esc_html($count_all);
    1818}}
    1919if (!function_exists('nirweb_ticket_count_process_ticket')) {function nirweb_ticket_count_process_ticket(){
     
    2121    $count_all=intval($wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->prefix}nirweb_ticket_ticket
    2222                                            WHERE status=2"));
    23     return $count_all;
     23    return esc_html($count_all);
    2424}}
    2525if (!function_exists('nirweb_ticket_count_answered_ticket')) {function nirweb_ticket_count_answered_ticket(){
     
    2727    $count_all=intval($wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->prefix}nirweb_ticket_ticket
    2828                                            WHERE status=3"));
    29     return $count_all;
     29    return esc_html($count_all);
    3030}}
    3131if (!function_exists('nirweb_ticket_count_closed_ticket')) {function nirweb_ticket_count_closed_ticket(){
     
    3333    $count_all=intval($wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->prefix}nirweb_ticket_ticket
    3434                                            WHERE status=4"));
    35     return $count_all;
     35    return esc_html($count_all);
    3636}}
    3737 
  • nirweb-support/trunk/inc/admin/functions/func_send_ticket.php

    r2707344 r2708596  
    99            'receiver_type' =>sanitize_text_field($_POST['receiver_type']),
    1010            'subject'  =>  sanitize_text_field($_POST['subject']),
    11             'content'  => $text,
     11            'content'  => sanitize_textarea_field($text),
    1212            'department'    => isset($_POST['department_id']) ? intval(sanitize_text_field($_POST['department_id'])) : '',
    1313            'priority'  =>  isset($_POST['priority_id']) ? intval(sanitize_text_field($_POST['priority_id'])) : '',
     
    1616            'support_id' =>  isset( $_POST[''] ) ? sanitize_text_field($_POST['']) : '',
    1717            'status' =>  isset($_POST['status']) ? intval(sanitize_text_field($_POST['status'])):'',
    18             'file_url' =>  isset($_POST['file_url'])  ? esc_url($_POST['file_url']) : '' ,
     18            'file_url' =>  isset($_POST['file_url'])  ? esc_url_raw($_POST['file_url']) : '' ,
    1919            'time_update'   =>  current_time("Y-m-d H:i:s"),
    2020            'date_qustion'   =>  current_time("Y-m-d H:i:s")
     
    2525            $recever_name = sanitize_text_field($_POST['receiver_name']);
    2626            $current_user = wp_get_current_user();
    27             $user_sender = $current_user->display_name;
     27            $user_sender = sanitize_text_field($current_user->display_name);
    2828            $department = sanitize_text_field($_POST['department']);
    2929            $priority = sanitize_text_field($_POST['priority']);
     
    3535            $htmlContent = wpautop(str_replace('{username}',$recever_name,get_option('nirweb_ticket_perfix')['template_send_ticket_email']));
    3636            $headers = array('Content-Type: text/html; charset=UTF-8');
    37             $body = $htmlContent;
    38             $rres =  wp_mail( $to, $subject, $body, $headers );
     37            $body = sanitize_textarea_field($htmlContent);
     38            wp_mail( $to, $subject, $body, $headers );
    3939        }
    4040
  • nirweb-support/trunk/inc/admin/functions/scripts.php

    r2703852 r2708596  
    1616        [
    1717            'ajax_url' => admin_url( 'admin-ajax.php' ),
    18             'comp_sec' => __('Please complete all starred sections', 'nirweb-support'),
    19             'send_info' => __('Sending information...', 'nirweb-support'),
    20             'add_file' => __('Add File', 'nirweb-support'),
    21             'use_file' => __('Use the file', 'nirweb-support'),
    22             'send_tik_success' => __('Your ticket was sent successfully', 'nirweb-support'),
    23             'send_ans_success' => __('Your answer was sent successfully', 'nirweb-support'),
    24             'send_ans_err' => __('There was a problem sending the reply', 'nirweb-support'),
    25             'ques' => __('Are you sure?', 'nirweb-support'),
    26             'subdel' => __('The delete action causes the information to be lost.', 'nirweb-support'),
    27             'ok' => __('Ok', 'nirweb-support'),
    28             'cancel' => __('Cancel', 'nirweb-support'),
    29             'add_dep' => __('Add Department', 'nirweb-support'),
    30             'name_dep_err' => __('Please enter the name of the department', 'nirweb-support'),
    31             'sup_dep_err' => __('Please enter the support of the department', 'nirweb-support'),
    32             'chenge_dep' => __('The department changed successfully', 'nirweb-support'),
    33             'add_ques_err' => __('Please enter a question', 'nirweb-support'),
    34             'add_text_faq_err' => __('Please enter the answer text', 'nirweb-support'),
    35             'faq_ques_add' => __('Question added', 'nirweb-support'),
     18            'comp_sec' => esc_html__('Please complete all starred sections', 'nirweb-support'),
     19            'send_info' => esc_html__('Sending information...', 'nirweb-support'),
     20            'add_file' => esc_html__('Add File', 'nirweb-support'),
     21            'use_file' => esc_html__('Use the file', 'nirweb-support'),
     22            'send_tik_success' => esc_html__('Your ticket was sent successfully', 'nirweb-support'),
     23            'send_ans_success' => esc_html__('Your answer was sent successfully', 'nirweb-support'),
     24            'send_ans_err' => esc_html__('There was a problem sending the reply', 'nirweb-support'),
     25            'ques' => esc_html__('Are you sure?', 'nirweb-support'),
     26            'subdel' => esc_html__('The delete action causes the information to be lost.', 'nirweb-support'),
     27            'ok' => esc_html__('Ok', 'nirweb-support'),
     28            'cancel' => esc_html__('Cancel', 'nirweb-support'),
     29            'add_dep' => esc_html__('Add Department', 'nirweb-support'),
     30            'name_dep_err' => esc_html__('Please enter the name of the department', 'nirweb-support'),
     31            'sup_dep_err' => esc_html__('Please enter the support of the department', 'nirweb-support'),
     32            'chenge_dep' => esc_html__('The department changed successfully', 'nirweb-support'),
     33            'add_ques_err' => esc_html__('Please enter a question', 'nirweb-support'),
     34            'add_text_faq_err' => esc_html__('Please enter the answer text', 'nirweb-support'),
     35            'faq_ques_add' => esc_html__('Question added', 'nirweb-support'),
    3636        ]
    3737    );
     
    4040        'wpyarticketsw',
    4141        [
    42              'ok' => __('Ok', 'nirweb-support'),
    43             'cancel' => __('Cancel', 'nirweb-support'),
     42             'ok' => esc_html__('Ok', 'nirweb-support'),
     43            'cancel' => esc_html__('Cancel', 'nirweb-support'),
    4444         ]
    4545    );
  • nirweb-support/trunk/inc/admin/themes/FAQ.php

    r2707344 r2708596  
    11<?php
    2  include NIRWEB_SUPPORT_INC_ADMIN_FUNCTIONS_TICKET.'func_FAQ.php';
    3  if(isset($_POST['submit_new_faq']))
    4 {
     2include NIRWEB_SUPPORT_INC_ADMIN_FUNCTIONS_TICKET . 'func_FAQ.php';
     3if (isset($_POST['submit_new_faq'])) {
    54    nirweb_ticket_save_new_faq();
    65}
    7 $FAQS=nirweb_ticket_get_all_faq();
     6$FAQS = nirweb_ticket_get_all_faq();
    87?>
    98
    10 <h1 class="title_page_wpyt"><?php echo __('FAQ', 'nirweb-support') ?></h1>
     9<h1 class="title_page_wpyt"><?php echo esc_html__('FAQ', 'nirweb-support') ?></h1>
    1110<div class="wapper flex">
    12     <div class="right_FAQ" >
    13 <form action="" id="form_Add_faq"  method="post">
    14         <div class="question__faq flex flexd-cul" >
    15             <label class="w-100"><b><?php echo __('Question', 'nirweb-support') ?></b></label>
    16             <input  name="nirweb_ticket_frm_subject_faq_ticket" id="nirweb_ticket_frm_subject_faq_ticket" class="wpyt_input" placeholder="<?php echo __('Enter Question', 'nirweb-support') ?>">
    17         </div>
     11    <div class="right_FAQ">
     12        <form action="" id="form_Add_faq" method="post">
     13            <div class="question__faq flex flexd-cul">
     14                <label class="w-100"><b><?php echo esc_html__('Question', 'nirweb-support') ?></b></label>
     15                <input name="nirweb_ticket_frm_subject_faq_ticket" id="nirweb_ticket_frm_subject_faq_ticket"
     16                       class="wpyt_input" placeholder="<?php echo esc_html__('Enter Question', 'nirweb-support') ?>">
     17            </div>
    1818
    1919
    20     <div class="answer__faq flex flexd-cul" >
    21             <label class="w-100"><b><?php echo __('Answer', 'nirweb-support') ?></b></label>
     20            <div class="answer__faq flex flexd-cul">
     21                <label class="w-100"><b><?php echo esc_html__('Answer', 'nirweb-support') ?></b></label>
    2222
    23         <?php
    24         $content = '';
    25         $editor_id = 'nirweb_ticket_frm_faq_ticket';
    26         wp_editor($content, $editor_id); ?>
     23                <?php
     24                $content = '';
     25                $editor_id = 'nirweb_ticket_frm_faq_ticket';
     26                wp_editor($content, $editor_id); ?>
    2727
    28         </div>
     28            </div>
    2929
    30         <button name="submit_new_faq" id="submit_new_faq" class="button button-primary">
    31         <?php echo __('Add Question', 'nirweb-support') ?>
    32         </button>
     30            <button name="submit_new_faq" id="submit_new_faq" class="button button-primary">
     31                <?php echo esc_html__('Add Question', 'nirweb-support') ?>
     32            </button>
    3333
    34 </form>
     34        </form>
    3535
    3636    </div>
    3737
    3838    <div class="left_FAQ">
    39     <ul class="list__question_faq">
    40 <?php if(count($FAQS)>=1)
    41     foreach ($FAQS as $faq):
    42      echo esc_html('
    43     <li class="flex w-100"> <span class="dashicons dashicons-trash remove_faq danger" data-id="'.esc_html($faq->id).'"></span>
    44     <div class="li_list_question  "> <div class="question_wpy_faq flex"> <span class="soal_name_wpyt">'.esc_html($faq->question).'</span> <span class="arrow_wpyt cret flex aline-c"></span>
    45                 </div>  <div class="answer_wpys_faq" >  <p>'.wpautop(esc_html($faq->answer)).' </p> </div> </div> </li>  ');
    46     endforeach;
    47 else
    48     echo  __('not found', 'nirweb-support'); ?>
     39        <ul class="list__question_faq">
     40            <?php if (count($FAQS) >= 1)
     41                foreach ($FAQS as $faq):
     42                    echo('
     43    <li class="flex w-100"> <span class="dashicons dashicons-trash remove_faq danger" data-id="' . esc_html($faq->id) . '"></span>
     44    <div class="li_list_question  "> <div class="question_wpy_faq flex"> <span class="soal_name_wpyt">' . esc_html($faq->question) . '</span> <span class="arrow_wpyt cret flex aline-c"></span>
     45                </div>  <div class="answer_wpys_faq" >  <p>' . wpautop(esc_html($faq->answer)) . ' </p> </div> </div> </li>  ');
     46                endforeach;
     47            else
     48                echo esc_html__('not found', 'nirweb-support'); ?>
    4949
    50 </ul>
     50        </ul>
    5151    </div>
    5252
  • nirweb-support/trunk/inc/admin/themes/all_ticket.php

    r2707344 r2708596  
    66}else{
    77    $tickets=nirweb_ticket_get_list_all_ticket_posht(get_current_user_id());
    8 
    98}
    109?>
     
    1615        <th> <input type="checkbox" id="selectAll" /></th>
    1716         <th>ID</th>
    18         <th><?php echo __('Status', 'nirweb-support')?></th>
    19         <th><?php echo __('Subject', 'nirweb-support')?></th>
    20         <th><?php echo __('Sender', 'nirweb-support')?></th>
    21         <th><?php echo __('Department', 'nirweb-support')?></th>
    22         <th><?php echo __('Priority', 'nirweb-support')?></th>
    23         <th><?php echo __('Product', 'nirweb-support')?></th>
    24         <th><?php echo __('Answer', 'nirweb-support')?></th>
     17        <th><?php echo esc_html__('Status', 'nirweb-support')?></th>
     18        <th><?php echo esc_html__('Subject', 'nirweb-support')?></th>
     19        <th><?php echo esc_html__('Sender', 'nirweb-support')?></th>
     20        <th><?php echo esc_html__('Department', 'nirweb-support')?></th>
     21        <th><?php echo esc_html__('Priority', 'nirweb-support')?></th>
     22        <th><?php echo esc_html__('Product', 'nirweb-support')?></th>
     23        <th><?php echo esc_html__('Answer', 'nirweb-support')?></th>
    2524    </tr>
    2625    </thead>
     
    2827
    2928
    30     <?php foreach ($tickets[0] as $ticket):
    31         $date = strtotime($ticket->date_qustion);
    32         $date = wp_date( 'Y-m-d H:i:s' , $date);
    33 
    34         ?>
     29    <?php foreach ($tickets[0] as $ticket): ?>
    3530        <tr style="border: solid 1px #ccc">
    3631            <th><input type="checkbox" id="frm_check_items" name="frm_check_items[]" value="<?php echo  esc_html($ticket->ticket_id) ?>"></th>
     
    5651        <th></th>
    5752        <th>ID</th>
    58         <th><?php echo __('Status', 'nirweb-support')?></th>
    59         <th><?php echo __('Subject', 'nirweb-support')?></th>
    60         <th><?php echo __('Sender', 'nirweb-support')?></th>
    61         <th><?php echo __('Department', 'nirweb-support')?></th>
    62         <th><?php echo __('Priority', 'nirweb-support')?></th>
    63         <th><?php echo __('Product', 'nirweb-support')?></th>
    64         <th><?php echo __('Answer', 'nirweb-support')?></th>
     53        <th><?php echo esc_html__('Status', 'nirweb-support')?></th>
     54        <th><?php echo esc_html__('Subject', 'nirweb-support')?></th>
     55        <th><?php echo esc_html__('Sender', 'nirweb-support')?></th>
     56        <th><?php echo esc_html__('Department', 'nirweb-support')?></th>
     57        <th><?php echo esc_html__('Priority', 'nirweb-support')?></th>
     58        <th><?php echo esc_html__('Product', 'nirweb-support')?></th>
     59        <th><?php echo esc_html__('Answer', 'nirweb-support')?></th>
    6560    </tr>
    6661    </tfoot>
     
    7065
    7166<div class="nirweb_ticket_pagination">
    72 
    7367<?php echo esc_html($tickets[1]) ?>
    74 
    7568</div>
    7669 
  • nirweb-support/trunk/inc/admin/themes/answer-ticket.php

    r2707344 r2708596  
    2323
    2424 <h1 class="title_page_wpyt">
    25      <?php echo __('Ticket Number ', 'nirweb-support') ?>
     25     <?php echo esc_html__('Ticket Number ', 'nirweb-support') ?>
    2626     <?php echo esc_html($ticket_id) ?>
    2727
     
    3131         <div class="display_content_ticket">
    3232             <h3>
    33 
    3433                 <span class="subject"> <?php echo esc_html($info_ticket->subject) ?></span>
    35 
    36 
    3734                 <span class="titme_title">
    38                      <?php echo  $date = wp_date( 'Y-m-d ' , strtotime($info_ticket->date_qustion)); ?>
    39                      <?php echo $date = date('H:i:s',strtotime($info_ticket->date_qustion)); ?>
     35                     <?php echo  esc_html(wp_date( 'Y-m-d ' , strtotime($info_ticket->date_qustion))); ?>
     36                     <?php echo  esc_html(date('H:i:s',strtotime($info_ticket->date_qustion))); ?>
    4037                 </span>
    41 
    42 
    4338             </h3>
    44 
    45 
    46 
    47 
    4839             <div class="text_ticket">
    4940                 <?php echo wpautop(esc_html($info_ticket->content))  ?>
    5041             </div>
    51 
    52 
    53 
    5442         </div>
    5543
    5644
    5745         <div class="info_wpyar_ticket">
    58              <!-~~ Start info ticket ~~~-->
    59 
    60                  <h2> <?php echo __('Ticket Information ', 'nirweb-support') ?>
    61                  </h2>
    62 
     46                 <h2> <?php echo esc_html__('Ticket Information ', 'nirweb-support') ?> </h2>
    6347                 <div class="row_wpyt">
    64                      <!-~~ start row ~~~-->
    65 
    6648                         <div class="left_info">
    67                              <!-~~ Start Left info ~~~-->
    68                                  <div class="row_wpyt">
    69                                      <div class="name_info">
    70                                          <p>   <?php echo __('Sender', 'nirweb-support') ?> : </p>
     49                                 <div class="row_wpyt">
     50                                     <div class="name_info">
     51                                         <p>   <?php echo esc_html__('Sender', 'nirweb-support') ?> : </p>
    7152                                     </div>
    7253                                     <div class="val_info">
     
    7859                                 <div class="row_wpyt">
    7960                                     <div class="name_info">
    80                                          <p>   <?php echo __('Receiver', 'nirweb-support') ?>: </p>
     61                                         <p>   <?php echo esc_html__('Receiver', 'nirweb-support') ?>: </p>
    8162                                     </div>
    8263                                     <div class="val_info">
     
    9071                                 <div class="row_wpyt">
    9172                                     <div class="name_info">
    92                                          <p>  <?php echo __('Priority', 'nirweb-support') ?> : </p>
     73                                         <p>  <?php echo esc_html__('Priority', 'nirweb-support') ?> : </p>
    9374                                     </div>
    9475                                     <div class="val_info">
     
    10081                                 <div class="row_wpyt">
    10182                                     <div class="name_info">
    102                                          <p><?php echo __('WebSite', 'nirweb-support') ?></p>
     83                                         <p><?php echo esc_html__('WebSite', 'nirweb-support') ?></p>
    10384                                     </div>
    10485                                     <div class="val_info">
     
    11091                                 <div class="row_wpyt">
    11192                                     <div class="name_info">
    112                                          <p><?php echo __('Product', 'nirweb-support') ?></p>
     93                                         <p><?php echo esc_html__('Product', 'nirweb-support') ?></p>
    11394                                     </div>
    11495                                     <div class="val_info">
     
    119100                                 <div class="row_wpyt">
    120101                                     <div class="name_info">
    121                                          <p><?php echo __('Attachment File', 'nirweb-support') ?></p>
     102                                         <p><?php echo esc_html__('Attachment File', 'nirweb-support') ?></p>
    122103                                     </div>
    123104                                     <div class="val_info">
    124105                                         <?php if($info_ticket->file_url){ ?>
    125                                          <p><a href="<?php echo esc_url($info_ticket->file_url) ?>" target="_blank"><?php echo __('Attachment File', 'nirweb-support') ?></a></p>
     106                                         <p><a href="<?php echo esc_url_raw($info_ticket->file_url) ?>" target="_blank">
     107                                                 <?php echo esc_html__('Attachment File', 'nirweb-support') ?></a></p>
    126108                                         <?php } ?>
    127109                                     </div>
    128110                                 </div>
    129111                         </div>
    130                          <!-~~ end Left info ~~~-->
    131112
    132113                             <div class="right_info">
    133                                  <!-~~ Start right info ~~~-->
    134                                      <div class=" ">
    135 
    136 
     114                                      <div class=" ">
    137115                                         <label><?php echo __('Department', 'nirweb-support') ?></label>
    138116                                         <select class="wpyt_select" id="nirweb_ticket_frm_department_send_ticket"
     
    150128
    151129                                     <div class="">
    152                                          <label><?php echo __('Status', 'nirweb-support') ?></label>
     130                                         <label><?php echo esc_html__('Status', 'nirweb-support') ?></label>
    153131                                         <select class="wpyt_select" id="nirweb_ticket_frm_status_send_ticket"
    154132                                             name="nirweb_ticket_frm_status_send_ticket">
     
    157135                            foreach ($list_status as $status):?>
    158136                                             <option <?php selected($info_ticket->status,$status->status_id)?>
    159                                                  value="<?php echo esc_html($status->status_id) ?>"><?php echo esc_html($status->name_status) ?></option>
     137                                                 value="<?php echo esc_html($status->status_id) ?>">
     138                                                 <?php echo esc_html($status->name_status) ?></option>
    160139                                             <?php endforeach; ?>
    161140                                         </select>
    162141                                     </div>
    163 
    164142                             </div>
    165                              <!-~~ end right info ~~~-->
    166 
    167143                 </div>
    168                  <!-~~ end row ~~~-->
    169 
    170144         </div>
    171          <!-~~ End info ticket ~~~-->
    172145
    173146             <div class="answerd_this_ticket_wpyar">
    174                  <h2><?php echo __('Answer', 'nirweb-support') ?></h2>
     147                 <h2><?php echo esc_html__('Answer', 'nirweb-support') ?></h2>
    175148
    176149                 <div class="war_pre_answer_wp_yar">
     
    181154                             <span class="icons"></span>
    182155                         </p>
    183                          <p><?php echo __('Pre Answer', 'nirweb-support') ?></p>
     156                         <p><?php echo esc_html__('Pre Answer', 'nirweb-support') ?></p>
    184157                     </div>
    185158
     
    196169                                 <span class="soal_name_wpyt"><?php the_title() ?></span>
    197170                                 <div class="flex">
    198                                      <a href="#" class="insert_text_into_editor_wp"><?php echo __('Insert', 'nirweb-support') ?></a>
     171                                     <a href="#" class="insert_text_into_editor_wp"><?php echo esc_html__('Insert', 'nirweb-support') ?></a>
    199172                                     <span class="arrow_wpyt flex aline-c cret_t"></span>
    200173                                 </div>
     
    205178
    206179                         </li>
    207                          <?php
    208                
    209             endwhile;
    210             wp_reset_query();
    211             ?>
    212 
     180                         <?php  endwhile;  wp_reset_query(); ?>
    213181                     </ul>
    214 
    215 
    216 
    217 
    218                  </div>
     182                  </div>
    219183
    220184                 <div class="war_insert_pre_answer_wp_yar">
     
    226190
    227191                         <div class="file__wpyt">
    228                              <label><?php echo __('Attachment File', 'nirweb-support') ?></label>
     192                             <label><?php echo esc_html__('Attachment File', 'nirweb-support') ?></label>
    229193
    230194                             <input type="text" id="nirweb_ticket_frm_file_send_ticket" name="nirweb_ticket_frm_file_send_ticket"
    231195                                 class="regular-text process_custom_images">
    232196                             <input id="plupload-browse-button" name="misha_upload_image_button" type="button"
    233                                  value="<?php echo __('Image Select', 'nirweb-support') ?>" class="button wpyt_upload_image_button"
     197                                 value="<?php echo esc_html__('Image Select', 'nirweb-support') ?>" class="button wpyt_upload_image_button"
    234198                                 style=" position: relative; z-index: 1;">
    235199                         </div>
    236200                         <div class="box_send_answered">
    237                              <button type="submit" class="btn_send_answered btn-send "><?php echo __('Send Answer', 'nirweb-support') ?></button>
     201                             <button type="submit" class="btn_send_answered btn-send "><?php echo esc_html__('Send Answer', 'nirweb-support') ?></button>
    238202                         </div>
    239203                     </form>
     
    246210
    247211             <div class="list_answerd_in_dash_admin">
    248                  <h2 class="title_get_answered"><?php echo __('List Answer', 'nirweb-support') ?></h2>
    249 
     212                 <h2 class="title_get_answered"><?php echo esc_html__('List Answer', 'nirweb-support') ?></h2>
    250213                 <ul class="list_all_answered">
    251 
    252214                     <?php foreach($info_answerd as $row): ?>
    253 
    254215                     <li>
    255216                         <div class="head_answer">
     
    260221
    261222                             <span class="time">
    262                                  <?php echo  $date = date( '(H:i:s)' , strtotime($row->time_answer)); ?>
    263                                  <?php echo  $date = wp_date( 'Y-m-d' , strtotime($row->time_answer)); ?>
     223                                 <?php echo  esc_html( date( '(H:i:s)' , strtotime($row->time_answer))); ?>
     224                                 <?php echo  esc_html( wp_date( 'Y-m-d' , strtotime($row->time_answer))); ?>
    264225                             </span>
    265226
     
    268229
    269230                         <div class="content">
    270                              <?php echo wpautop(sanitize_textarea_field($row->text)) ?>
    271 
     231                              <?php echo wpautop(esc_html($row->text)) ?>
    272232                             <?php if ($row->attach_url){
    273233                            echo '<p>'.
    274                               __('Attachment File', 'nirweb-support').'
    275                                 '.esc_url($row->attach_url).'
    276                                     </p>';
     234                              esc_html__('Attachment File', 'nirweb-support').'
     235                                '.esc_url_raw($row->attach_url).'
     236                                </p>';
    277237                        } ?>
    278238                         </div>
     
    281241                  </ul>
    282242              </div>
    283 
    284243 </div>
    285  <!-~~~ End Base ~~~-->
    286 
    287244     <?php } else{
    288     echo'<p>'.__('You do not have permission to access this ticket', 'nirweb-support').'</p>';
     245    echo'<p>'.esc_html__('You do not have permission to access this ticket', 'nirweb-support').'</p>';
    289246}
  • nirweb-support/trunk/inc/admin/themes/answered_ticket.php

    r2707344 r2708596  
    1313        <th> <input type="checkbox" id="selectAll" /></th>
    1414        <th>ID</th>
    15         <th><?php echo __('Status', 'nirweb-support')?></th>
    16         <th><?php echo __('Subject', 'nirweb-support')?></th>
    17         <th><?php echo __('Sender', 'nirweb-support')?></th>
    18         <th><?php echo __('Department', 'nirweb-support')?></th>
    19         <th><?php echo __('Priority', 'nirweb-support')?></th>
    20         <th><?php echo __('Product', 'nirweb-support')?></th>
    21         <th><?php echo __('Answer', 'nirweb-support')?></th>
     15        <th><?php echo esc_html__('Status', 'nirweb-support')?></th>
     16        <th><?php echo esc_html__('Subject', 'nirweb-support')?></th>
     17        <th><?php echo esc_html__('Sender', 'nirweb-support')?></th>
     18        <th><?php echo esc_html__('Department', 'nirweb-support')?></th>
     19        <th><?php echo esc_html__('Priority', 'nirweb-support')?></th>
     20        <th><?php echo esc_html__('Product', 'nirweb-support')?></th>
     21        <th><?php echo esc_html__('Answer', 'nirweb-support')?></th>
    2222    </tr>
    2323    </thead>
     
    2626        <th></th>
    2727        <th>ID</th>
    28         <th><?php echo __('Status', 'nirweb-support')?></th>
    29         <th><?php echo __('Subject', 'nirweb-support')?></th>
    30         <th><?php echo __('Sender', 'nirweb-support')?></th>
    31         <th><?php echo __('Department', 'nirweb-support')?></th>
    32         <th><?php echo __('Priority', 'nirweb-support')?></th>
    33         <th><?php echo __('Product', 'nirweb-support')?></th>
    34         <th><?php echo __('Answer', 'nirweb-support')?></th>
     28        <th><?php echo esc_html__('Status', 'nirweb-support')?></th>
     29        <th><?php echo esc_html__('Subject', 'nirweb-support')?></th>
     30        <th><?php echo esc_html__('Sender', 'nirweb-support')?></th>
     31        <th><?php echo esc_html__('Department', 'nirweb-support')?></th>
     32        <th><?php echo esc_html__('Priority', 'nirweb-support')?></th>
     33        <th><?php echo esc_html__('Product', 'nirweb-support')?></th>
     34        <th><?php echo esc_html__('Answer', 'nirweb-support')?></th>
    3535
    3636    </tr>
     
    3838
    3939    <tbody>
    40     <?php foreach ($tickets[0] as $ticket):
    41         $date = strtotime($ticket->date_qustion);
    42         $date = wp_date( 'Y-m-d H:i:s' , $date);
    43         ?>
     40    <?php foreach ($tickets[0] as $ticket): ?>
    4441        <tr style="border: solid 1px #ccc">
    4542            <th><input type="checkbox" id="frm_check_items" name="frm_check_items[]" value="<?php echo esc_html($ticket->ticket_id)?>"></th>
     
    5956</form>
    6057<div class="nirweb_ticket_pagination">
    61 
    6258    <?php echo esc_html($tickets[1]) ?>
    63 
    6459</div>
  • nirweb-support/trunk/inc/admin/themes/closed_ticket.php

    r2707344 r2708596  
    1313        <th> <input type="checkbox" id="selectAll" /></th>
    1414        <th>ID</th>
    15         <th><?php echo __('Status', 'nirweb-support')?></th>
    16         <th><?php echo __('Subject', 'nirweb-support')?></th>
    17         <th><?php echo __('Sender', 'nirweb-support')?></th>
    18         <th><?php echo __('Department', 'nirweb-support')?></th>
    19         <th><?php echo __('Priority', 'nirweb-support')?></th>
    20         <th><?php echo __('Product', 'nirweb-support')?></th>
    21         <th><?php echo __('Answer', 'nirweb-support')?></th>
     15        <th><?php echo esc_html__('Status', 'nirweb-support')?></th>
     16        <th><?php echo esc_html__('Subject', 'nirweb-support')?></th>
     17        <th><?php echo esc_html__('Sender', 'nirweb-support')?></th>
     18        <th><?php echo esc_html__('Department', 'nirweb-support')?></th>
     19        <th><?php echo esc_html__('Priority', 'nirweb-support')?></th>
     20        <th><?php echo esc_html__('Product', 'nirweb-support')?></th>
     21        <th><?php echo esc_html__('Answer', 'nirweb-support')?></th>
    2222    </tr>
    2323    </thead>
     
    2626        <th></th>
    2727        <th>ID</th>
    28         <th><?php echo __('Status', 'nirweb-support')?></th>
    29         <th><?php echo __('Subject', 'nirweb-support')?></th>
    30         <th><?php echo __('Sender', 'nirweb-support')?></th>
    31         <th><?php echo __('Department', 'nirweb-support')?></th>
    32         <th><?php echo __('Priority', 'nirweb-support')?></th>
    33         <th><?php echo __('Product', 'nirweb-support')?></th>
    34         <th><?php echo __('Answer', 'nirweb-support')?></th>
    35 
     28        <th><?php echo esc_html__('Status', 'nirweb-support')?></th>
     29        <th><?php echo esc_html__('Subject', 'nirweb-support')?></th>
     30        <th><?php echo esc_html__('Sender', 'nirweb-support')?></th>
     31        <th><?php echo esc_html__('Department', 'nirweb-support')?></th>
     32        <th><?php echo esc_html__('Priority', 'nirweb-support')?></th>
     33        <th><?php echo esc_html__('Product', 'nirweb-support')?></th>
     34        <th><?php echo esc_html__('Answer', 'nirweb-support')?></th>
    3635    </tr>
    3736    </tfoot>
    3837
    3938    <tbody>
    40     <?php foreach ($tickets[0] as $ticket):
    41         $date = strtotime($ticket->date_qustion);
    42         $date = wp_date( 'Y-m-d H:i:s' , $date);
    43         ?>
     39    <?php foreach ($tickets[0] as $ticket):  ?>
    4440        <tr style="border: solid 1px #ccc">
    4541            <th><input type="checkbox" id="frm_check_items" name="frm_check_items[]" value="<?php echo esc_html($ticket->ticket_id)?>"></th>
    4642            <th><?php echo esc_html($ticket->ticket_id)?></th>
    4743            <th><?php echo esc_html( $ticket->name_status)?></th>
    48             <th><a href="<?php echo get_bloginfo('url').'/wp-admin/admin.php?page=nirweb_ticket_send_ticket&action=edit&id='.esc_html($ticket->ticket_id)   ?>" class="su_link_tik"><?php echo esc_html($ticket->subject)?></a></th>
     44            <th><a href="<?php echo get_bloginfo('url').'/wp-admin/admin.php?page=nirweb_ticket_send_ticket&action=edit&id='.esc_html($ticket->ticket_id)?>" class="su_link_tik"><?php echo esc_html($ticket->subject)?></a></th>
    4945            <th><?php echo esc_html($ticket->user_login) ?></th>
    5046            <th><?php echo esc_html($ticket->depname)?></th>
     
    5652    </tbody>
    5753</table>
    58 
    5954</form>
    6055<div class="nirweb_ticket_pagination"> <?php echo esc_html($tickets[1]) ?> </div>
  • nirweb-support/trunk/inc/admin/themes/department.php

    r2707344 r2708596  
    44?>
    55 
    6 <h1 class="title_page_wpyt"><?php echo __('Departments', 'nirweb-support') ?></h1>
     6<h1 class="title_page_wpyt"><?php echo esc_html__('Departments', 'nirweb-support') ?></h1>
    77<div class="wapper flex">
    88    <div class="right_FAQ" >
    99        <form method="post">
    1010            <div class="question__faq flex flexd-cul" >
    11                 <label class="w-100"><b><?php echo __('Department Name', 'nirweb-support') ?></b></label>
    12                 <input id="nirweb_ticket_name_department" name="nirweb_ticket_name_department" class="wpyt_input"  placeholder="<?php echo __('Department Name', 'nirweb-support') ?>">
     11                <label class="w-100">
     12                    <b><?php echo esc_html__('Department Name', 'nirweb-support') ?></b>
     13                </label>
     14                <input id="nirweb_ticket_name_department" name="nirweb_ticket_name_department" class="wpyt_input"  placeholder="<?php echo esc_html__('Department Name', 'nirweb-support') ?>">
    1315            </div>
    1416            <div class="question__faq flex flexd-cul" >
    15                 <label class="w-100"><b><?php echo __('Support', 'nirweb-support') ?></b></label>
     17                <label class="w-100"><b><?php echo esc_html__('Support', 'nirweb-support') ?></b></label>
    1618                <?php
    1719                echo '<select id="nirweb_ticket_support_department" name="nirweb_ticket_support_department">';
    18                 echo '<option value="-1">'.__('Select Support User', 'nirweb-support').'</option>';
     20                echo '<option value="-1">'.esc_html__('Select Support User', 'nirweb-support').'</option>';
    1921                foreach ($users as $user) { ?>
    2022                    <option data-mail="<?php echo esc_html($user->user_email) ?>"  value="<?php echo esc_html($user->ID) ?>">
     
    2426                ?>
    2527            </div>
    26             <button name="submit_new_department" id="submit_new_department" class="button button-primary"><?php echo __('Add Department', 'nirweb-support') ?></button>
     28            <button name="submit_new_department" id="submit_new_department" class="button button-primary"><?php echo esc_html__('Add Department', 'nirweb-support') ?></button>
    2729        </form>
    2830    </div>
     
    3234            <tr>
    3335                <th></th>
    34                 <th><?php echo __('Department Name', 'nirweb-support') ?></th>
    35                 <th><?php echo __('Support', 'nirweb-support') ?></th>
    36                 <th><?php echo __('Edit', 'nirweb-support') ?></th>
     36                <th><?php echo esc_html__('Department Name', 'nirweb-support') ?></th>
     37                <th><?php echo esc_html__('Support', 'nirweb-support') ?></th>
     38                <th><?php echo esc_html__('Edit', 'nirweb-support') ?></th>
    3739            </tr>
    3840            </thead>
     
    4143               
    4244                <th></th>
    43                 <th><?php echo __('Department Name', 'nirweb-support') ?></th>
    44                 <th><?php echo __('Support', 'nirweb-support') ?></th>
    45                 <th><?php echo __('Edit', 'nirweb-support') ?></th>
     45                <th><?php echo esc_html__('Department Name', 'nirweb-support') ?></th>
     46                <th><?php echo esc_html__('Support', 'nirweb-support') ?></th>
     47                <th><?php echo esc_html__('Edit', 'nirweb-support') ?></th>
    4648            </tr>
    4749            </tfoot>
     
    5052            <tr style="border: solid 1px #ccc" class="row_dep">
    5153            <th><input type="checkbox" id="frm_check_items" name="frm_check_items[]" value="<?php echo esc_html($department->department_id) ?>"></th>
    52             <th  class="dep_name"  data-id="<?php echo esc_html($department->department_id)  ?>" ><?php echo esc_html($department->name) ?></th>
    53             <th class="name_user"  data-user_id="<?php echo esc_html($department->support_id) ?>" ><?php echo esc_html($department->display_name) ?></th>
     54            <th class="dep_name"  data-id="<?php echo esc_html($department->department_id)  ?>" ><?php echo esc_html($department->name) ?></th>
     55            <th class="name_user" data-user_id="<?php echo esc_html($department->support_id) ?>" ><?php echo esc_html($department->display_name) ?></th>
    5456            <th><a class="edit_ticket_wpys edit_dep_wpys">
    5557            <span class="dashicons dashicons-edit"></span></a></a></th>
     
    6062        <div class="remove_wpyt font-base" >
    6163            <button class="button button-primary" id="frm_btn_delete_dep">
    62             <?php echo __('Delete', 'nirweb-support') ?>
     64            <?php echo esc_html__('Delete', 'nirweb-support') ?>
    6365            </button>
    6466        </div>
  • nirweb-support/trunk/inc/admin/themes/file_uploads.php

    r2707344 r2708596  
    55<div class="base_load_file">
    66
    7 <h2><?php echo __('List of uploaded files', 'nirweb-support'); ?></h2>
     7<h2><?php echo esc_html__('List of uploaded files', 'nirweb-support'); ?></h2>
    88
    99<form method="post" id="list_all_user_files" name="list_all_user_files[]">
     
    1313    <tr>
    1414        <th style="width: 45px"></th>
    15          <th style="width: 80px"><?php echo __('Image File', 'nirweb-support'); ?></th>
    16         <th><?php echo __('Link File', 'nirweb-support'); ?></th>
     15         <th style="width: 80px"><?php echo esc_html__('Image File', 'nirweb-support'); ?></th>
     16        <th><?php echo esc_html__('Link File', 'nirweb-support'); ?></th>
    1717    </tr>
    1818    </thead>
     
    2727        <th><input type="checkbox" id="frm_check_items" name="frm_check_items[]"
    2828        value="<?php echo esc_html($row->id) ?>" data-file="<?php echo esc_html($row->file_id) ?>"></th>
    29         <th><img src="<?php echo esc_html($row->url_file) ?>" width="50" height="50"></th>
    30         <th><a href="<?php echo esc_html($row->url_file) ?>" target="_blank"><?php echo __('Show Image', 'nirweb-support'); ?></a></th>
     29        <th><img src="<?php echo esc_url_raw($row->url_file) ?>" width="50" height="50"></th>
     30        <th><a href="<?php echo esc_url_raw($row->url_file) ?>" target="_blank"><?php echo esc_html__('Show Image', 'nirweb-support'); ?></a></th>
    3131    </tr>
    3232<?php endforeach ?>
     
    3636    <tr>
    3737    <th></th>
    38          <th><?php echo __('Image File', 'nirweb-support'); ?></th>
    39         <th><?php echo __('Link File', 'nirweb-support'); ?></th>
     38         <th><?php echo esc_html__('Image File', 'nirweb-support'); ?></th>
     39        <th><?php echo esc_html__('Link File', 'nirweb-support'); ?></th>
    4040    </tr>
    4141    </tfoot>
     
    4343<div class="remove_wpyt font-base" >
    4444    <button type="submit" class="danger" id="frm_btn_delete_files_users">
    45     <?php echo __('Delete', 'nirweb-support'); ?>
     45    <?php echo esc_html__('Delete', 'nirweb-support'); ?>
    4646    </button>
    4747</div>
  • nirweb-support/trunk/inc/admin/themes/manage_tickets.php

    r2707344 r2708596  
    22<?php
    33 include_once NIRWEB_SUPPORT_INC_ADMIN_FUNCTIONS_TICKET.'func_number_tab_ticktes.php';
    4 $action = isset($_GET['action']) && !empty($_GET['action']) && ctype_alpha($_GET['action']) ?
    5     $_GET['action'] : null;
     4$action = isset($_GET['action']) && !empty($_GET['action']) && esc_html($_GET['action']) ?
     5    esc_html($_GET['action']) : null;
    66if($action=='edit')
    77{
    8     $ticket_id=isset($_GET['id']) && !empty($_GET['id']) && ctype_digit($_GET['id'])?
     8    $ticket_id=isset($_GET['id']) && !empty($_GET['id']) && esc_html($_GET['id'])?
    99        intval($_GET['id']):null;
    1010    if($ticket_id) {
    11         wp_redirect(admin_url('admin.php?page=nirweb_ticket_send_ticket&id='.$ticket_id));
     11        wp_redirect(admin_url('admin.php?page=nirweb_ticket_send_ticket&id='.esc_html($ticket_id)));
    1212    }
    1313}
    1414    $tabs = array(
    15         'all_ticket' => __('All Ticket', 'nirweb-support').'('.nirweb_ticket_count_all_ticket().')',
    16         'new_ticket' => __('New', 'nirweb-support').'('.nirweb_ticket_count_new_ticket().')',
    17         'process_ticket' => __('InProgress', 'nirweb-support').'('.nirweb_ticket_count_process_ticket().')',
    18         'answered_ticket' => __('Answered', 'nirweb-support').'('.nirweb_ticket_count_answered_ticket().')',
    19         'closed_ticket' => __('Closed', 'nirweb-support').'('.nirweb_ticket_count_closed_ticket().')',
     15        'all_ticket' => esc_html__('All Ticket', 'nirweb-support').'('.nirweb_ticket_count_all_ticket().')',
     16        'new_ticket' => esc_html__('New', 'nirweb-support').'('.nirweb_ticket_count_new_ticket().')',
     17        'process_ticket' => esc_html__('InProgress', 'nirweb-support').'('.nirweb_ticket_count_process_ticket().')',
     18        'answered_ticket' => esc_html__('Answered', 'nirweb-support').'('.nirweb_ticket_count_answered_ticket().')',
     19        'closed_ticket' => esc_html__('Closed', 'nirweb-support').'('.nirweb_ticket_count_closed_ticket().')',
    2020 
    2121    );
    22     $curent_tab = isset($_GET['tab']) ? $_GET['tab'] : 'new_ticket';
     22    $curent_tab = isset($_GET['tab']) ? esc_html($_GET['tab']) : 'new_ticket';
    2323    ?>
    24 <h1 class="title_page_wpyt"><?php echo __('Tickets', 'nirweb-support') ?></h1>
     24<h1 class="title_page_wpyt"><?php echo esc_html__('Tickets', 'nirweb-support') ?></h1>
    2525<style>
    2626    a:focus,button:focus, input[type=color]:focus, input[type=date]:focus, input[type=datetime-local]:focus, input[type=datetime]:focus, input[type=email]:focus, input[type=month]:focus, input[type=number]:focus, input[type=password]:focus, input[type=radio]:focus, input[type=search]:focus, input[type=tel]:focus, input[type=text]:focus, input[type=time]:focus, input[type=url]:focus, input[type=week]:focus, select:focus, textarea:focus {
     
    5252            <?php foreach ($tabs as $tab=>$title): ?>
    5353            <?php $class = ( $tab == $curent_tab ) ? ' nav-active' : '';?>
    54             <li class='<?php echo   $class?> <?php echo   $tab ?> '> <a href='?page=nirweb_ticket_manage_tickets&tab=<?php echo   $tab?>'>
    55                     <?php if($tab =='all_ticket'){
    56                echo '<svg id="svg_total-ticket" viewBox="0 0 48.4 48.4" style="width: 40px"><g transform="translate(-2300 -319)"><path fill="#FEA000" d="M2318.241 335.827l3.748-3.747 16.475 16.475-3.748 3.748z"></path><path fill="#4D4D4D" d="M2326.4 352.4c-.3 0-.5-.1-.7-.3l-2.4-2.4c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l2.4 2.4c.4.4.4 1 0 1.4-.2.2-.5.3-.7.3zm-4.9-4.9c-.3 0-.5-.1-.7-.3l-2.4-2.4c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l2.4 2.4c.4.4.4 1 0 1.4-.1.2-.4.3-.7.3z"></path><path fill="#E6E6E6" d="M2338.4 348.5l9-9-3.8-3.8c-2.4 2.5-6.4 2.5-8.9.1-2.4-2.5-2.4-6.5.1-8.9l-3.8-3.8-9 9 16.4 16.4z"></path><path fill="#4D4D4D" d="M2348.4 339.5c0-.1 0-.3-.1-.4 0-.1-.1-.2-.2-.3l-3.8-3.8c-.2-.2-.4-.3-.7-.3-.3 0-.5.1-.7.3-.5.5-1.1.9-1.7 1.2h-.2c-.3.1-.5.2-.8.2-.3.1-.7.1-1 .1-1.4 0-2.7-.5-3.7-1.5l-.1-.1c-1-1-1.5-2.4-1.5-3.7 0-1.3.6-2.7 1.6-3.7.2-.2.3-.4.3-.7v-.1c0-.3-.1-.5-.3-.7l-3.8-3.8c-.4-.4-1-.4-1.4 0l-27 27c-.4.4-.4 1 0 1.4l3.8 3.8c.2.2.4.3.7.3.3 0 .5-.1.7-.3 2-2.1 5.4-2.1 7.5-.1 2 2.1 2 5.4-.1 7.5-.2.2-.3.4-.3.7 0 .3.1.5.3.7l3.8 3.8c.2.2.5.3.7.3.3 0 .5-.1.7-.3l14-13.9c.1 0 .3-.1.4-.2l3.7-3.7c.1-.1.1-.2.2-.2l8.6-8.6.1-.1c.1-.1.2-.2.2-.3.1-.2.1-.3.1-.5zm-14.4-3c.8.8 1.8 1.3 2.8 1.7.1 0 .3.1.4.1.2 0 .3.1.5.1.3.1.6.1.9.1h1c.2 0 .4 0 .6-.1.3 0 .5-.1.8-.2.1 0 .2-.1.4-.1.3-.1.7-.2 1-.4.1 0 .1 0 .2-.1.4-.2.7-.4 1.1-.7l1.2 1.2 1.2 1.2-7.5 7.5-15-15 7.5-7.5 2.4 2.4c-1.1 1.4-1.6 3.1-1.5 4.8 0 2 .7 3.7 2 5zm-12-3l15 15-2.3 2.3-15-15 2.3-2.3zm-1.6 31.5l-2.4-2.4c2.2-2.8 2-6.9-.6-9.6-2.6-2.6-6.7-2.7-9.6-.6l-2.4-2.4 9.1-9.1v.1l1.4 1.4c.2.2.5.3.7.3s.5-.1.7-.3c.4-.4.4-1 0-1.4l-1.4-1.4h-.1l2.3-2.3 15 15-2.3 2.3-1.4-1.4c-.4-.4-1-.4-1.4 0s-.4 1 0 1.4l1.4 1.4-9 9zM2301.4 347.3c-.3 0-.5-.1-.7-.3-.4-.4-.4-1 0-1.4l25.4-25.9c.4-.4 1-.4 1.4 0 .4.4.4 1 0 1.4l-25.4 25.9c-.2.2-.4.3-.7.3z"></path></g></svg>';
    57            }if($tab =='new_ticket'){
     54            <li class='<?php echo   esc_html($class)?> <?php echo esc_html($tab) ?> '> <a href='?page=nirweb_ticket_manage_tickets&tab=<?php echo esc_html($tab)?>'>
     55                    <?php if(esc_html($tab) =='all_ticket'){
     56               echo  '<svg id="svg_total-ticket" viewBox="0 0 48.4 48.4" style="width: 40px"><g transform="translate(-2300 -319)"><path fill="#FEA000" d="M2318.241 335.827l3.748-3.747 16.475 16.475-3.748 3.748z"></path><path fill="#4D4D4D" d="M2326.4 352.4c-.3 0-.5-.1-.7-.3l-2.4-2.4c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l2.4 2.4c.4.4.4 1 0 1.4-.2.2-.5.3-.7.3zm-4.9-4.9c-.3 0-.5-.1-.7-.3l-2.4-2.4c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l2.4 2.4c.4.4.4 1 0 1.4-.1.2-.4.3-.7.3z"></path><path fill="#E6E6E6" d="M2338.4 348.5l9-9-3.8-3.8c-2.4 2.5-6.4 2.5-8.9.1-2.4-2.5-2.4-6.5.1-8.9l-3.8-3.8-9 9 16.4 16.4z"></path><path fill="#4D4D4D" d="M2348.4 339.5c0-.1 0-.3-.1-.4 0-.1-.1-.2-.2-.3l-3.8-3.8c-.2-.2-.4-.3-.7-.3-.3 0-.5.1-.7.3-.5.5-1.1.9-1.7 1.2h-.2c-.3.1-.5.2-.8.2-.3.1-.7.1-1 .1-1.4 0-2.7-.5-3.7-1.5l-.1-.1c-1-1-1.5-2.4-1.5-3.7 0-1.3.6-2.7 1.6-3.7.2-.2.3-.4.3-.7v-.1c0-.3-.1-.5-.3-.7l-3.8-3.8c-.4-.4-1-.4-1.4 0l-27 27c-.4.4-.4 1 0 1.4l3.8 3.8c.2.2.4.3.7.3.3 0 .5-.1.7-.3 2-2.1 5.4-2.1 7.5-.1 2 2.1 2 5.4-.1 7.5-.2.2-.3.4-.3.7 0 .3.1.5.3.7l3.8 3.8c.2.2.5.3.7.3.3 0 .5-.1.7-.3l14-13.9c.1 0 .3-.1.4-.2l3.7-3.7c.1-.1.1-.2.2-.2l8.6-8.6.1-.1c.1-.1.2-.2.2-.3.1-.2.1-.3.1-.5zm-14.4-3c.8.8 1.8 1.3 2.8 1.7.1 0 .3.1.4.1.2 0 .3.1.5.1.3.1.6.1.9.1h1c.2 0 .4 0 .6-.1.3 0 .5-.1.8-.2.1 0 .2-.1.4-.1.3-.1.7-.2 1-.4.1 0 .1 0 .2-.1.4-.2.7-.4 1.1-.7l1.2 1.2 1.2 1.2-7.5 7.5-15-15 7.5-7.5 2.4 2.4c-1.1 1.4-1.6 3.1-1.5 4.8 0 2 .7 3.7 2 5zm-12-3l15 15-2.3 2.3-15-15 2.3-2.3zm-1.6 31.5l-2.4-2.4c2.2-2.8 2-6.9-.6-9.6-2.6-2.6-6.7-2.7-9.6-.6l-2.4-2.4 9.1-9.1v.1l1.4 1.4c.2.2.5.3.7.3s.5-.1.7-.3c.4-.4.4-1 0-1.4l-1.4-1.4h-.1l2.3-2.3 15 15-2.3 2.3-1.4-1.4c-.4-.4-1-.4-1.4 0s-.4 1 0 1.4l1.4 1.4-9 9zM2301.4 347.3c-.3 0-.5-.1-.7-.3-.4-.4-.4-1 0-1.4l25.4-25.9c.4-.4 1-.4 1.4 0 .4.4.4 1 0 1.4l-25.4 25.9c-.2.2-.4.3-.7.3z"></path></g></svg>';
     57           }if(esc_html($tab) =='new_ticket'){
    5858               echo '<svg id="svg_open-ticket" viewBox="0 0 48.6 48.6" style="width: 40px"><path fill="#FFF" d="M17.5 14.2l2.4-2.4c5.6 5.6 11.2 11.3 16.8 16.9L34.4 31c-5.6-5.5-11.3-11.2-16.9-16.8z"></path><path fill="#E6E6E6" d="M38.2 28.8l9.4-9.4-4.2-4.2c-2.7 2.6-7.1 2.5-9.7-.2-2.7-2.6-2.8-7-.2-9.7L29.3 1l-9.4 9.4 18.3 18.4z"></path><path fill="#4D4D4D" d="M25.3 32.3c-.3 0-.5-.1-.7-.3l-2.7-2.7c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l2.7 2.7c.4.4.4 1 0 1.4-.2.2-.5.3-.7.3zm-5.4-5.4c-.3 0-.5-.1-.7-.3l-2.7-2.7c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l2.7 2.7c.4.4.4 1 0 1.4-.2.2-.5.3-.7.3z"></path><path fill="#4D4D4D" d="M48.3 18.6l-4.2-4.2c-.4-.4-1-.4-1.4 0-2.3 2.2-6 2.1-8.2-.2-2.3-2.2-2.4-6-.2-8.3.4-.4.4-1 0-1.4L30 .3l-.2-.1-.2-.1-.2-.1H29.1c-.2 0-.4.1-.5.2l-9.4 9.4-18.9 19c-.4.4-.4 1 0 1.4l4.2 4.2c.4.4 1 .4 1.4 0 2.3-2.2 6.1-2.1 8.3.2 2.3 2.2 2.4 6 .2 8.3-.4.4-.4 1 0 1.4l4.2 4.2c.2.2.5.3.7.3s.5-.1.7-.3l14.8-14.8c.2 0 .3-.1.4-.2l4.2-4.2c.1-.1.1-.2.2-.3l8.7-8.7c.2-.2.3-.5.3-.8 0-.2-.1-.5-.3-.7zm-19-16.2l2.9 2.9c-2.3 3.1-2 7.6.8 10.3 2.8 2.8 7.2 3.1 10.4.9l2.8 2.8-7.5 7.5L21.8 10l7.5-7.6zm-9.4 9.4l16.8 16.9-2.3 2.3-16.9-16.8 2.4-2.4zm-.6 34.4l-2.8-2.8c2.3-3.1 2-7.6-.8-10.3-2.8-2.8-7.2-3.1-10.4-.9l-2.8-2.8 9.8-9.8c0 .1.1.2.2.3l1.4 1.4c.2.2.5.3.7.3s.5-.1.7-.3c.4-.4.4-1 0-1.4l-1.4-1.4c-.1-.1-.2-.1-.3-.2l2.6-2.6L33 32.5l-2.6 2.6c0-.2-.1-.3-.2-.4l-1.4-1.4c-.4-.4-1-.4-1.4 0s-.4 1 0 1.4l1.4 1.4c.1.1.3.2.4.2l-9.9 9.9z"></path><circle fill="#FF1A1A" cx="35.2" cy="35.7" r="9.9"></circle><path fill="#FFF" d="M35.2 47.7c-6.6 0-12-5.4-12-12s5.4-12 12-12 12 5.4 12 12-5.4 12-12 12zm0-22c-5.5 0-10 4.5-10 10s4.5 10 10 10 10-4.5 10-10-4.5-10-10-10z"></path><path fill="#FFF" d="M38.8 40.5h-6c-.6 0-1-.4-1-1s.4-1 1-1h5v-5h-5c-.6 0-1-.4-1-1s.4-1 1-1h6c.6 0 1 .4 1 1v7c0 .6-.4 1-1 1z"></path></svg>';
    59            }if($tab =='process_ticket'){
    60                echo '<svg id="svg_doing-ticket" viewBox="0 0 48.6 48.6" style="width: 40px"><g transform="translate(-1031 1558)"><path fill="#FFF" d="M1047.103-1543.742l4.242-4.242 18.385 18.384-4.243 4.243z"></path><path fill="#4D4D4D" d="M1056.3-1525.7c-.3 0-.5-.1-.7-.3l-2.7-2.7c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l2.7 2.7c.4.4.4 1 0 1.4-.2.2-.5.3-.7.3zm-5.4-5.4c-.3 0-.5-.1-.7-.3l-2.7-2.7c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l2.7 2.7c.4.4.4 1 0 1.4-.2.2-.5.3-.7.3z"></path><path fill="#E6E6E6" d="M1069.2-1529.2l9.4-9.4-4.2-4.2c-2.7 2.6-7.1 2.5-9.7-.2-2.7-2.6-2.8-7-.2-9.7l-4.2-4.3-9.4 9.4 18.3 18.4z"></path><path fill="#4D4D4D" d="M1079.3-1539.4l-4.2-4.2c-.4-.4-1-.4-1.4 0-2.3 2.2-6 2.1-8.2-.2-2.3-2.2-2.4-6-.2-8.3.4-.4.4-1 0-1.4l-4.3-4.2s-.1-.1-.2-.1-.1-.1-.2-.1-.2 0-.3-.1H1060c-.2 0-.4.1-.5.2l-9.4 9.4-18.9 18.9c-.4.4-.4 1 0 1.4l4.2 4.2c.4.4 1 .4 1.4 0 2.3-2.2 6.1-2.1 8.3.2 2.3 2.2 2.4 6 .2 8.3-.4.4-.4 1 0 1.4l4.2 4.2c.2.2.5.3.7.3s.5-.1.7-.3l14.8-14.8c.2 0 .3-.1.4-.2l4.2-4.2c.1-.1.1-.2.2-.3l8.7-8.7c.2-.2.3-.5.3-.8.1-.1 0-.4-.2-.6zm-19-16.2l2.9 2.9c-2.3 3.1-2 7.6.8 10.3 2.8 2.8 7.2 3.1 10.4.9l2.8 2.8-7.5 7.5-16.9-16.9 7.5-7.5zm-9.4 9.4l16.8 16.9-2.3 2.3-16.9-16.9 2.4-2.3zm-.6 34.4l-2.8-2.8c2.3-3.1 2-7.6-.8-10.3-2.8-2.8-7.2-3.1-10.4-.9l-2.8-2.8 9.8-9.8c0 .1.1.2.2.3l1.4 1.4c.2.2.5.3.7.3s.5-.1.7-.3c.4-.4.4-1 0-1.4l-1.4-1.4c-.1-.1-.2-.1-.3-.2l2.6-2.6 16.9 16.9-2.6 2.6c0-.2-.1-.3-.2-.4l-1.4-1.4c-.4-.4-1-.4-1.4 0s-.4 1 0 1.4l1.4 1.4c.1.1.3.2.4.2l-10 9.8z"></path><circle fill="#2096FC" cx="1065.2" cy="-1522.3" r="11"></circle><path fill="#FFF" d="M1065.2-1510.3c-6.6 0-12-5.4-12-12s5.4-12 12-12 12 5.4 12 12-5.4 12-12 12zm0-22c-5.5 0-10 4.5-10 10s4.5 10 10 10 10-4.5 10-10-4.5-10-10-10z"></path><path fill="#FFF" d="M1071.3-1520.7h-1.1c-.6 0-1-.4-1-1s.4-1 1-1h1.1c.6 0 1 .4 1 1s-.4 1-1 1zM1060.4-1520.7h-1.1c-.6 0-1-.4-1-1s.4-1 1-1h1.1c.6 0 1 .4 1 1s-.4 1-1 1zM1065.9-1520.7h-1.1c-.6 0-1-.4-1-1s.4-1 1-1h1.1c.6 0 1 .4 1 1s-.4 1-1 1z"></path></g></svg>';
    61            }if($tab =='answered_ticket'){
    62                echo '<svg id="svg_answered-ticket" viewBox="0 0 48.6 48.6" style="width: 40px"><g transform="translate(-1179 1558)"><path fill="#FFF" d="M1195.102-1543.74l4.242-4.243 18.385 18.384-4.243 4.243z"></path><path fill="#E6E6E6" d="M1217.2-1529.2l9.4-9.4-4.2-4.2c-2.7 2.6-7.1 2.5-9.7-.2-2.7-2.6-2.8-7-.2-9.7l-4.2-4.3-9.4 9.4 18.3 18.4z"></path><path fill="#4D4D4D" d="M1204.3-1525.7c-.3 0-.5-.1-.7-.3l-2.7-2.7c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l2.7 2.7c.4.4.4 1 0 1.4-.2.2-.5.3-.7.3zm-5.4-5.4c-.3 0-.5-.1-.7-.3l-2.7-2.7c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l2.7 2.7c.4.4.4 1 0 1.4-.2.2-.5.3-.7.3z"></path><path fill="#4D4D4D" d="M1227.3-1539.4l-4.2-4.2c-.4-.4-1-.4-1.4 0-2.3 2.2-6 2.1-8.2-.2-2.3-2.2-2.4-6-.2-8.3.4-.4.4-1 0-1.4l-4.3-4.2s-.1-.1-.2-.1-.1-.1-.2-.1-.2 0-.3-.1H1208c-.2 0-.4.1-.5.2l-9.4 9.4-18.9 18.9c-.4.4-.4 1 0 1.4l4.2 4.2c.4.4 1 .4 1.4 0 2.3-2.2 6.1-2.1 8.3.2 2.3 2.2 2.4 6 .2 8.3-.4.4-.4 1 0 1.4l4.2 4.2c.2.2.5.3.7.3s.5-.1.7-.3l14.8-14.8c.2 0 .3-.1.4-.2l4.2-4.2c.1-.1.1-.2.2-.3l8.7-8.7c.2-.2.3-.5.3-.8.1-.1 0-.4-.2-.6zm-19-16.2l2.9 2.9c-2.3 3.1-2 7.6.8 10.3 2.8 2.8 7.2 3.1 10.4.9l2.8 2.8-7.5 7.5-16.9-16.9 7.5-7.5zm-9.4 9.4l16.8 16.9-2.3 2.3-16.9-16.9 2.4-2.3zm-.6 34.4l-2.8-2.8c2.3-3.1 2-7.6-.8-10.3-2.8-2.8-7.2-3.1-10.4-.9l-2.8-2.8 9.8-9.8c0 .1.1.2.2.3l1.4 1.4c.2.2.5.3.7.3s.5-.1.7-.3c.4-.4.4-1 0-1.4l-1.4-1.4c-.1-.1-.2-.1-.3-.2l2.6-2.6 16.9 16.9-2.6 2.6c0-.2-.1-.3-.2-.4l-1.4-1.4c-.4-.4-1-.4-1.4 0s-.4 1 0 1.4l1.4 1.4c.1.1.3.2.4.2l-10 9.8z"></path><path fill="#9F3FE5" d="M1213.2-1533.3c6.1 0 11 4.9 11 11s-4.9 11-11 11-11-4.9-11-11 4.9-11 11-11z"></path><path fill="#FFF" d="M1213.2-1510.3c-6.6 0-12-5.4-12-12 0-3.2 1.2-6.2 3.5-8.5s5.3-3.5 8.5-3.5h.1c6.6 0 12 5.4 12 12s-5.5 12-12.1 12zm0-23v1c-2.7 0-5.2 1.1-7.1 2.9-1.9 1.9-2.9 4.4-2.9 7.1 0 5.5 4.5 10 10 10s10-4.5 10-10-4.5-10-10-10v-1z"></path><path fill="#FFF" d="M1212.4-1517.6c-.2 0-.4-.1-.6-.2l-2.9-2.3c-.4-.3-.5-1-.2-1.4.3-.4 1-.5 1.4-.2l2.1 1.7 4.1-5.3c.3-.4 1-.5 1.4-.2.4.3.5 1 .2 1.4l-4.7 6.1c-.2.2-.4.3-.7.4h-.1z"></path></g></svg>';
    63            }if($tab =='closed_ticket'){
    64                echo '<svg id="svg_close-ticket" viewBox="0 0 48.6 48.6" style="width: 40px"><g transform="translate(-905 1558)"><path fill="#FFF" d="M921.104-1543.743l4.242-4.242 18.385 18.384-4.243 4.243z"></path><path fill="#E6E6E6" d="M943.2-1529.2l9.4-9.4-4.2-4.2c-2.7 2.6-7.1 2.5-9.7-.2-2.7-2.6-2.8-7-.2-9.7l-4.2-4.3-9.4 9.4 18.3 18.4z"></path><path fill="#4D4D4D" d="M930.3-1525.7c-.3 0-.5-.1-.7-.3l-2.7-2.7c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l2.7 2.7c.4.4.4 1 0 1.4-.2.2-.5.3-.7.3zm-5.4-5.4c-.3 0-.5-.1-.7-.3l-2.7-2.7c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l2.7 2.7c.4.4.4 1 0 1.4-.2.2-.5.3-.7.3z"></path><path fill="#4D4D4D" d="M953.3-1539.4l-4.2-4.2c-.4-.4-1-.4-1.4 0-2.3 2.2-6 2.1-8.2-.2-2.3-2.2-2.4-6-.2-8.3.4-.4.4-1 0-1.4l-4.3-4.2s-.1-.1-.2-.1-.1-.1-.2-.1-.2 0-.3-.1H934c-.2 0-.4.1-.5.2l-9.4 9.4-18.9 18.9c-.4.4-.4 1 0 1.4l4.2 4.2c.4.4 1 .4 1.4 0 2.3-2.2 6.1-2.1 8.3.2 2.3 2.2 2.4 6 .2 8.3-.4.4-.4 1 0 1.4l4.2 4.2c.2.2.5.3.7.3s.5-.1.7-.3l14.8-14.8c.2 0 .3-.1.4-.2l4.2-4.2c.1-.1.1-.2.2-.3l8.7-8.7c.2-.2.3-.5.3-.8.1-.1 0-.4-.2-.6zm-19-16.2l2.9 2.9c-2.3 3.1-2 7.6.8 10.3 2.8 2.8 7.2 3.1 10.4.9l2.8 2.8-7.5 7.5-16.9-16.9 7.5-7.5zm-9.4 9.4l16.8 16.9-2.3 2.3-16.9-16.9 2.4-2.3zm-.6 34.4l-2.8-2.8c2.3-3.1 2-7.6-.8-10.3-2.8-2.8-7.2-3.1-10.4-.9l-2.8-2.8 9.8-9.8c0 .1.1.2.2.3l1.4 1.4c.2.2.5.3.7.3s.5-.1.7-.3c.4-.4.4-1 0-1.4l-1.4-1.4c-.1-.1-.2-.1-.3-.2l2.6-2.6 16.9 16.9-2.6 2.6c0-.2-.1-.3-.2-.4l-1.4-1.4c-.4-.4-1-.4-1.4 0s-.4 1 0 1.4l1.4 1.4c.1.1.3.2.4.2l-10 9.8z"></path><circle fill="#2FBE35" cx="940.2" cy="-1522.3" r="11"></circle><path fill="#FFF" d="M940.2-1510.3c-6.6 0-12-5.4-12-12s5.4-12 12-12 12 5.4 12 12-5.4 12-12 12zm0-22c-5.5 0-10 4.5-10 10s4.5 10 10 10 10-4.5 10-10-4.5-10-10-10z"></path><path fill="#FFF" d="M943.8-1517.5h-7c-.6 0-1-.4-1-1v-7c0-.6.4-1 1-1h7c.6 0 1 .4 1 1v7c0 .6-.4 1-1 1zm-6-2h5v-5h-5v5z"></path></g></svg>';
     59           }if(esc_html($tab) =='process_ticket'){
     60               echo  '<svg id="svg_doing-ticket" viewBox="0 0 48.6 48.6" style="width: 40px"><g transform="translate(-1031 1558)"><path fill="#FFF" d="M1047.103-1543.742l4.242-4.242 18.385 18.384-4.243 4.243z"></path><path fill="#4D4D4D" d="M1056.3-1525.7c-.3 0-.5-.1-.7-.3l-2.7-2.7c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l2.7 2.7c.4.4.4 1 0 1.4-.2.2-.5.3-.7.3zm-5.4-5.4c-.3 0-.5-.1-.7-.3l-2.7-2.7c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l2.7 2.7c.4.4.4 1 0 1.4-.2.2-.5.3-.7.3z"></path><path fill="#E6E6E6" d="M1069.2-1529.2l9.4-9.4-4.2-4.2c-2.7 2.6-7.1 2.5-9.7-.2-2.7-2.6-2.8-7-.2-9.7l-4.2-4.3-9.4 9.4 18.3 18.4z"></path><path fill="#4D4D4D" d="M1079.3-1539.4l-4.2-4.2c-.4-.4-1-.4-1.4 0-2.3 2.2-6 2.1-8.2-.2-2.3-2.2-2.4-6-.2-8.3.4-.4.4-1 0-1.4l-4.3-4.2s-.1-.1-.2-.1-.1-.1-.2-.1-.2 0-.3-.1H1060c-.2 0-.4.1-.5.2l-9.4 9.4-18.9 18.9c-.4.4-.4 1 0 1.4l4.2 4.2c.4.4 1 .4 1.4 0 2.3-2.2 6.1-2.1 8.3.2 2.3 2.2 2.4 6 .2 8.3-.4.4-.4 1 0 1.4l4.2 4.2c.2.2.5.3.7.3s.5-.1.7-.3l14.8-14.8c.2 0 .3-.1.4-.2l4.2-4.2c.1-.1.1-.2.2-.3l8.7-8.7c.2-.2.3-.5.3-.8.1-.1 0-.4-.2-.6zm-19-16.2l2.9 2.9c-2.3 3.1-2 7.6.8 10.3 2.8 2.8 7.2 3.1 10.4.9l2.8 2.8-7.5 7.5-16.9-16.9 7.5-7.5zm-9.4 9.4l16.8 16.9-2.3 2.3-16.9-16.9 2.4-2.3zm-.6 34.4l-2.8-2.8c2.3-3.1 2-7.6-.8-10.3-2.8-2.8-7.2-3.1-10.4-.9l-2.8-2.8 9.8-9.8c0 .1.1.2.2.3l1.4 1.4c.2.2.5.3.7.3s.5-.1.7-.3c.4-.4.4-1 0-1.4l-1.4-1.4c-.1-.1-.2-.1-.3-.2l2.6-2.6 16.9 16.9-2.6 2.6c0-.2-.1-.3-.2-.4l-1.4-1.4c-.4-.4-1-.4-1.4 0s-.4 1 0 1.4l1.4 1.4c.1.1.3.2.4.2l-10 9.8z"></path><circle fill="#2096FC" cx="1065.2" cy="-1522.3" r="11"></circle><path fill="#FFF" d="M1065.2-1510.3c-6.6 0-12-5.4-12-12s5.4-12 12-12 12 5.4 12 12-5.4 12-12 12zm0-22c-5.5 0-10 4.5-10 10s4.5 10 10 10 10-4.5 10-10-4.5-10-10-10z"></path><path fill="#FFF" d="M1071.3-1520.7h-1.1c-.6 0-1-.4-1-1s.4-1 1-1h1.1c.6 0 1 .4 1 1s-.4 1-1 1zM1060.4-1520.7h-1.1c-.6 0-1-.4-1-1s.4-1 1-1h1.1c.6 0 1 .4 1 1s-.4 1-1 1zM1065.9-1520.7h-1.1c-.6 0-1-.4-1-1s.4-1 1-1h1.1c.6 0 1 .4 1 1s-.4 1-1 1z"></path></g></svg>';
     61           }if(esc_html($tab) =='answered_ticket'){
     62               echo  '<svg id="svg_answered-ticket" viewBox="0 0 48.6 48.6" style="width: 40px"><g transform="translate(-1179 1558)"><path fill="#FFF" d="M1195.102-1543.74l4.242-4.243 18.385 18.384-4.243 4.243z"></path><path fill="#E6E6E6" d="M1217.2-1529.2l9.4-9.4-4.2-4.2c-2.7 2.6-7.1 2.5-9.7-.2-2.7-2.6-2.8-7-.2-9.7l-4.2-4.3-9.4 9.4 18.3 18.4z"></path><path fill="#4D4D4D" d="M1204.3-1525.7c-.3 0-.5-.1-.7-.3l-2.7-2.7c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l2.7 2.7c.4.4.4 1 0 1.4-.2.2-.5.3-.7.3zm-5.4-5.4c-.3 0-.5-.1-.7-.3l-2.7-2.7c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l2.7 2.7c.4.4.4 1 0 1.4-.2.2-.5.3-.7.3z"></path><path fill="#4D4D4D" d="M1227.3-1539.4l-4.2-4.2c-.4-.4-1-.4-1.4 0-2.3 2.2-6 2.1-8.2-.2-2.3-2.2-2.4-6-.2-8.3.4-.4.4-1 0-1.4l-4.3-4.2s-.1-.1-.2-.1-.1-.1-.2-.1-.2 0-.3-.1H1208c-.2 0-.4.1-.5.2l-9.4 9.4-18.9 18.9c-.4.4-.4 1 0 1.4l4.2 4.2c.4.4 1 .4 1.4 0 2.3-2.2 6.1-2.1 8.3.2 2.3 2.2 2.4 6 .2 8.3-.4.4-.4 1 0 1.4l4.2 4.2c.2.2.5.3.7.3s.5-.1.7-.3l14.8-14.8c.2 0 .3-.1.4-.2l4.2-4.2c.1-.1.1-.2.2-.3l8.7-8.7c.2-.2.3-.5.3-.8.1-.1 0-.4-.2-.6zm-19-16.2l2.9 2.9c-2.3 3.1-2 7.6.8 10.3 2.8 2.8 7.2 3.1 10.4.9l2.8 2.8-7.5 7.5-16.9-16.9 7.5-7.5zm-9.4 9.4l16.8 16.9-2.3 2.3-16.9-16.9 2.4-2.3zm-.6 34.4l-2.8-2.8c2.3-3.1 2-7.6-.8-10.3-2.8-2.8-7.2-3.1-10.4-.9l-2.8-2.8 9.8-9.8c0 .1.1.2.2.3l1.4 1.4c.2.2.5.3.7.3s.5-.1.7-.3c.4-.4.4-1 0-1.4l-1.4-1.4c-.1-.1-.2-.1-.3-.2l2.6-2.6 16.9 16.9-2.6 2.6c0-.2-.1-.3-.2-.4l-1.4-1.4c-.4-.4-1-.4-1.4 0s-.4 1 0 1.4l1.4 1.4c.1.1.3.2.4.2l-10 9.8z"></path><path fill="#9F3FE5" d="M1213.2-1533.3c6.1 0 11 4.9 11 11s-4.9 11-11 11-11-4.9-11-11 4.9-11 11-11z"></path><path fill="#FFF" d="M1213.2-1510.3c-6.6 0-12-5.4-12-12 0-3.2 1.2-6.2 3.5-8.5s5.3-3.5 8.5-3.5h.1c6.6 0 12 5.4 12 12s-5.5 12-12.1 12zm0-23v1c-2.7 0-5.2 1.1-7.1 2.9-1.9 1.9-2.9 4.4-2.9 7.1 0 5.5 4.5 10 10 10s10-4.5 10-10-4.5-10-10-10v-1z"></path><path fill="#FFF" d="M1212.4-1517.6c-.2 0-.4-.1-.6-.2l-2.9-2.3c-.4-.3-.5-1-.2-1.4.3-.4 1-.5 1.4-.2l2.1 1.7 4.1-5.3c.3-.4 1-.5 1.4-.2.4.3.5 1 .2 1.4l-4.7 6.1c-.2.2-.4.3-.7.4h-.1z"></path></g></svg>' ;
     63           }if(esc_html($tab) =='closed_ticket'){
     64               echo  '<svg id="svg_close-ticket" viewBox="0 0 48.6 48.6" style="width: 40px"><g transform="translate(-905 1558)"><path fill="#FFF" d="M921.104-1543.743l4.242-4.242 18.385 18.384-4.243 4.243z"></path><path fill="#E6E6E6" d="M943.2-1529.2l9.4-9.4-4.2-4.2c-2.7 2.6-7.1 2.5-9.7-.2-2.7-2.6-2.8-7-.2-9.7l-4.2-4.3-9.4 9.4 18.3 18.4z"></path><path fill="#4D4D4D" d="M930.3-1525.7c-.3 0-.5-.1-.7-.3l-2.7-2.7c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l2.7 2.7c.4.4.4 1 0 1.4-.2.2-.5.3-.7.3zm-5.4-5.4c-.3 0-.5-.1-.7-.3l-2.7-2.7c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l2.7 2.7c.4.4.4 1 0 1.4-.2.2-.5.3-.7.3z"></path><path fill="#4D4D4D" d="M953.3-1539.4l-4.2-4.2c-.4-.4-1-.4-1.4 0-2.3 2.2-6 2.1-8.2-.2-2.3-2.2-2.4-6-.2-8.3.4-.4.4-1 0-1.4l-4.3-4.2s-.1-.1-.2-.1-.1-.1-.2-.1-.2 0-.3-.1H934c-.2 0-.4.1-.5.2l-9.4 9.4-18.9 18.9c-.4.4-.4 1 0 1.4l4.2 4.2c.4.4 1 .4 1.4 0 2.3-2.2 6.1-2.1 8.3.2 2.3 2.2 2.4 6 .2 8.3-.4.4-.4 1 0 1.4l4.2 4.2c.2.2.5.3.7.3s.5-.1.7-.3l14.8-14.8c.2 0 .3-.1.4-.2l4.2-4.2c.1-.1.1-.2.2-.3l8.7-8.7c.2-.2.3-.5.3-.8.1-.1 0-.4-.2-.6zm-19-16.2l2.9 2.9c-2.3 3.1-2 7.6.8 10.3 2.8 2.8 7.2 3.1 10.4.9l2.8 2.8-7.5 7.5-16.9-16.9 7.5-7.5zm-9.4 9.4l16.8 16.9-2.3 2.3-16.9-16.9 2.4-2.3zm-.6 34.4l-2.8-2.8c2.3-3.1 2-7.6-.8-10.3-2.8-2.8-7.2-3.1-10.4-.9l-2.8-2.8 9.8-9.8c0 .1.1.2.2.3l1.4 1.4c.2.2.5.3.7.3s.5-.1.7-.3c.4-.4.4-1 0-1.4l-1.4-1.4c-.1-.1-.2-.1-.3-.2l2.6-2.6 16.9 16.9-2.6 2.6c0-.2-.1-.3-.2-.4l-1.4-1.4c-.4-.4-1-.4-1.4 0s-.4 1 0 1.4l1.4 1.4c.1.1.3.2.4.2l-10 9.8z"></path><circle fill="#2FBE35" cx="940.2" cy="-1522.3" r="11"></circle><path fill="#FFF" d="M940.2-1510.3c-6.6 0-12-5.4-12-12s5.4-12 12-12 12 5.4 12 12-5.4 12-12 12zm0-22c-5.5 0-10 4.5-10 10s4.5 10 10 10 10-4.5 10-10-4.5-10-10-10z"></path><path fill="#FFF" d="M943.8-1517.5h-7c-.6 0-1-.4-1-1v-7c0-.6.4-1 1-1h7c.6 0 1 .4 1 1v7c0 .6-.4 1-1 1zm-6-2h5v-5h-5v5z"></path></g></svg>' ;
    6565           } ?>
    66 
    67                     <span><?php echo esc_html($title) ?></span></a></li>
     66          <span><?php echo esc_html($title) ?></span></a></li>
    6867            <?php endforeach; ?>
    6968            <li class="search_del"><a>
     
    123122                                </g>
    124123                            </svg>
    125 
    126124                        </i>
    127125
     
    138136                        </button>
    139137                        <?php } ?>
    140 
    141 
    142138                    </div>
    143139                </a></li>
     
    148144    <div class="ajax_search">
    149145        <input class="form-control" id="serch_support_wpy" type="text"
    150             placeholder="<?php echo __('Enter ID or subject ticket', 'nirweb-support')  ?>">
     146            placeholder="<?php echo esc_html__('Enter ID or subject ticket', 'nirweb-support')  ?>">
    151147        <span class="ajax_search_loading_ticket ajxtd"></span>
    152148        <ul></ul>
    153149    </div>
    154150
    155     <?php include NIRWEB_SUPPORT_INC_ADMIN_THEMES_TICKET.$curent_tab.'.php'?>
     151    <?php include NIRWEB_SUPPORT_INC_ADMIN_THEMES_TICKET.esc_html($curent_tab).'.php'?>
    156152
  • nirweb-support/trunk/inc/admin/themes/new_ticket.php

    r2707344 r2708596  
    1313        <th> <input type="checkbox" id="selectAll" /></th>
    1414        <th>ID</th>
    15         <th><?php echo __('Status', 'nirweb-support')?></th>
    16         <th><?php echo __('Subject', 'nirweb-support')?></th>
    17         <th><?php echo __('Sender', 'nirweb-support')?></th>
    18         <th><?php echo __('Department', 'nirweb-support')?></th>
    19         <th><?php echo __('Priority', 'nirweb-support')?></th>
    20         <th><?php echo __('Product', 'nirweb-support')?></th>
    21         <th><?php echo __('Answer', 'nirweb-support')?></th>
     15        <th><?php echo esc_html__('Status', 'nirweb-support')?></th>
     16        <th><?php echo esc_html__('Subject', 'nirweb-support')?></th>
     17        <th><?php echo esc_html__('Sender', 'nirweb-support')?></th>
     18        <th><?php echo esc_html__('Department', 'nirweb-support')?></th>
     19        <th><?php echo esc_html__('Priority', 'nirweb-support')?></th>
     20        <th><?php echo esc_html__('Product', 'nirweb-support')?></th>
     21        <th><?php echo esc_html__('Answer', 'nirweb-support')?></th>
    2222    </tr>
    2323    </thead>
    2424    <tbody>
    25     <?php foreach ($tickets[0] as $ticket):
    26         $date = strtotime($ticket->date_qustion);
    27         $date = wp_date( 'Y-m-d H:i:s' , $date);
    28         ?>
     25    <?php foreach ($tickets[0] as $ticket): ?>
    2926    <tr style="border: solid 1px #ccc">
    3027        <th><input type="checkbox" id="frm_check_items" name="frm_check_items[]" value="<?php echo esc_html($ticket->ticket_id) ?>"></th>
     
    4441        <th></th>
    4542        <th>ID</th>
    46         <th><?php echo __('Status', 'nirweb-support')?></th>
    47         <th><?php echo __('Subject', 'nirweb-support')?></th>
    48         <th><?php echo __('Sender', 'nirweb-support')?></th>
    49         <th><?php echo __('Department', 'nirweb-support')?></th>
    50         <th><?php echo __('Priority', 'nirweb-support')?></th>
    51         <th><?php echo __('Product', 'nirweb-support')?></th>
    52         <th><?php echo __('Answer', 'nirweb-support')?></th>
     43        <th><?php echo esc_html__('Status', 'nirweb-support')?></th>
     44        <th><?php echo esc_html__('Subject', 'nirweb-support')?></th>
     45        <th><?php echo esc_html__('Sender', 'nirweb-support')?></th>
     46        <th><?php echo esc_html__('Department', 'nirweb-support')?></th>
     47        <th><?php echo esc_html__('Priority', 'nirweb-support')?></th>
     48        <th><?php echo esc_html__('Product', 'nirweb-support')?></th>
     49        <th><?php echo esc_html__('Answer', 'nirweb-support')?></th>
    5350
    5451    </tr>
  • nirweb-support/trunk/inc/admin/themes/process_ticket.php

    r2707344 r2708596  
    1313        <th> <input type="checkbox" id="selectAll" /></th>
    1414        <th>ID</th>
    15         <th><?php echo __('Status', 'nirweb-support')?></th>
    16         <th><?php echo __('Subject', 'nirweb-support')?></th>
    17         <th><?php echo __('Sender', 'nirweb-support')?></th>
    18         <th><?php echo __('Department', 'nirweb-support')?></th>
    19         <th><?php echo __('Priority', 'nirweb-support')?></th>
    20         <th><?php echo __('Product', 'nirweb-support')?></th>
    21         <th><?php echo __('Answer', 'nirweb-support')?></th>
     15        <th><?php echo esc_html__('Status', 'nirweb-support')?></th>
     16        <th><?php echo esc_html__('Subject', 'nirweb-support')?></th>
     17        <th><?php echo esc_html__('Sender', 'nirweb-support')?></th>
     18        <th><?php echo esc_html__('Department', 'nirweb-support')?></th>
     19        <th><?php echo esc_html__('Priority', 'nirweb-support')?></th>
     20        <th><?php echo esc_html__('Product', 'nirweb-support')?></th>
     21        <th><?php echo esc_html__('Answer', 'nirweb-support')?></th>
    2222     </tr>
    2323    </thead>
     
    2626        <th></th>
    2727        <th>ID</th>
    28         <th><?php echo __('Status', 'nirweb-support')?></th>
    29         <th><?php echo __('Subject', 'nirweb-support')?></th>
    30         <th><?php echo __('Sender', 'nirweb-support')?></th>
    31         <th><?php echo __('Department', 'nirweb-support')?></th>
    32         <th><?php echo __('Priority', 'nirweb-support')?></th>
    33         <th><?php echo __('Product', 'nirweb-support')?></th>
    34         <th><?php echo __('Answer', 'nirweb-support')?></th>
     28        <th><?php echo esc_html__('Status', 'nirweb-support')?></th>
     29        <th><?php echo esc_html__('Subject', 'nirweb-support')?></th>
     30        <th><?php echo esc_html__('Sender', 'nirweb-support')?></th>
     31        <th><?php echo esc_html__('Department', 'nirweb-support')?></th>
     32        <th><?php echo esc_html__('Priority', 'nirweb-support')?></th>
     33        <th><?php echo esc_html__('Product', 'nirweb-support')?></th>
     34        <th><?php echo esc_html__('Answer', 'nirweb-support')?></th>
    3535
    3636    </tr>
     
    3838
    3939    <tbody>
    40     <?php foreach ($tickets[0] as $ticket):
    41         $date = strtotime($ticket->date_qustion);
    42         $date = wp_date( 'Y-m-d H:i:s' , $date);
    43         ?>
     40    <?php foreach ($tickets[0] as $ticket): ?>
    4441        <tr style="border: solid 1px #ccc">
    4542            <th><input type="checkbox" id="frm_check_items" name="frm_check_items[]" value="<?php echo esc_html($ticket->ticket_id)?>"></th>
     
    5653    </tbody>
    5754</table>
    58 
    5955</form>
    6056<div class="nirweb_ticket_pagination"> <?php echo esc_html($tickets[1]) ?> </div>
  • nirweb-support/trunk/inc/admin/themes/send_ticket.php

    r2707344 r2708596  
    1 <h1 class="title_page_wpyt"><?php echo __('Send ticket','nirweb-support') ?></h1>
    2 <!--~~~~~~~START Container~~~~~~~ -->
    3 <div class="container flex justify-content-sb">
    4     <!--Right Container -->
    5     <div class="nirweb_ticket_right_container_send_ticket">
    6         <!--Form Send ticket-->
    7         <form action="" id="send_form_ticket" name="send_form_ticket[]" method="post" enctype="multipart/form-data">
    8             <!--Select Receiver-->
    9             <div class="nirweb_ticket_frm_send_ticket_select_receiver flex aline-c">
    10                 <!--Receiver Type-->
    11                 <div class="nirweb_ticket_frm_type_receiver flex flexd-cul halft_wpyt">
    12 
    13                     <label><?php echo __('Receiver type', 'nirweb-support') ?>  *</label>
     1<h1 class="title_page_wpyt"><?php echo esc_html__('Send ticket','nirweb-support') ?></h1>
     2 <div class="container flex justify-content-sb">
     3     <div class="nirweb_ticket_right_container_send_ticket">
     4         <form action="" id="send_form_ticket" name="send_form_ticket[]" method="post" enctype="multipart/form-data">
     5             <div class="nirweb_ticket_frm_send_ticket_select_receiver flex aline-c">
     6                 <div class="nirweb_ticket_frm_type_receiver flex flexd-cul halft_wpyt">
     7                    <label><?php echo esc_html__('Receiver type', 'nirweb-support') ?>  *</label>
    148                     <select  id="nirweb_ticket_frm_type_receiver" name="nirweb_ticket_frm_type_receiver" class="wpyt_select" required  aria-required="true" >
    15                         <option value="0"><?php echo __('Select Receiver type', 'nirweb-support') ?></option>
    16                         <option value="1"><?php echo __('User', 'nirweb-support') ?></option>
    17                         <option value="2"> <?php echo __('Suport', 'nirweb-support') ?></option>
     9                        <option value="0"><?php echo esc_html__('Select Receiver type', 'nirweb-support') ?></option>
     10                        <option value="1"><?php echo esc_html__('User', 'nirweb-support') ?></option>
     11                        <option value="2"> <?php echo esc_html__('Suport', 'nirweb-support') ?></option>
    1812                    </select>
    1913                </div>
    2014                <!--  List Receiver Final-->
    2115                <div class="nirweb_ticket_frm_final_items_receiver flex flexd-cul halft_wpyt sel2">
    22                     <label><?php echo __('Receiver', 'nirweb-support') ?>  *</label>
     16                    <label><?php echo esc_html__('Receiver', 'nirweb-support') ?>  *</label>
    2317                    <select id="selUser" class="wpyt_select" name="selUser"  aria-required="true" >
    2418                        <?php if (isset($info_ticket->id_receiver)) {
     
    3933                </div>
    4034            </div>
    41             <!--Enter Subject -->
    42             <label for="nirweb_ticket_frm_subject_send_ticket"><?php echo __('Subject', 'nirweb-support') ?>  *</label>
    43             <input type="text" id="nirweb_ticket_frm_subject_send_ticket" class="wpyt_input"
    44                    name="nirweb_ticket_frm_subject_send_ticket"
    45                    placeholder="<?php echo __('Enter Subject', 'nirweb-support') ?>" >
    46             <!--Write Content Ticket -->
    47             <div class="box_wpyt flex justify-content-sb">
     35             <label for="nirweb_ticket_frm_subject_send_ticket"><?php echo esc_html__('Subject', 'nirweb-support') ?>  *</label>
     36            <input type="text" id="nirweb_ticket_frm_subject_send_ticket" class="wpyt_input" name="nirweb_ticket_frm_subject_send_ticket"
     37                   placeholder="<?php echo esc_html__('Enter Subject', 'nirweb-support') ?>" >
     38             <div class="box_wpyt flex justify-content-sb">
    4839                <div class="halft_wpyt">
    49                     <label><?php echo __('Department', 'nirweb-support') ?></label>
     40                    <label><?php echo esc_html__('Department', 'nirweb-support') ?></label>
    5041                    <select class="wpyt_select" id="nirweb_ticket_frm_department_send_ticket" name="nirweb_ticket_frm_department_send_ticket">
    51                         <option value="0"><?php echo __('Select Department', 'nirweb-support') ?></option>
     42                        <option value="0"><?php echo esc_html__('Select Department', 'nirweb-support') ?></option>
    5243                        <?php foreach ($departments as $department): ?>
    5344                            <option value="<?php echo esc_html($department->department_id) ?>"><?php echo esc_html($department->name) ?></option>
     
    5647                </div>
    5748                <div class="halft_wpyt">
    58                     <label><?php echo __('Priority', 'nirweb-support') ?></label>
     49                    <label><?php echo esc_html__('Priority', 'nirweb-support') ?></label>
    5950                    <select class="wpyt_select" id="nirweb_ticket_frm_priority_send_ticket" name="nirweb_ticket_frm_priority_send_ticket">
    60                         <option value="0"><?php echo __('Select Priority', 'nirweb-support') ?></option>
     51                        <option value="0"><?php echo esc_html__('Select Priority', 'nirweb-support') ?></option>
    6152                        <?php $list_priority = nirweb_ticket_get_priority();
    6253                        foreach ($list_priority as $priority) { ?>
     
    6859            <div class="box_wpyt flex justify-content-sb">
    6960                <div class="halft_wpyt">
    70                     <label><?php echo __('WebSite', 'nirweb-support') ?></label>
     61                    <label><?php echo esc_html__('WebSite', 'nirweb-support') ?></label>
    7162                    <input type="text" class="wpyt_input" name="nirweb_ticket_frm_website_send_ticket"
    7263                           id="nirweb_ticket_frm_website_send_ticket">
     
    7465                <?php if (is_plugin_active('woocommerce/woocommerce.php')) { ?>
    7566                    <div class="halft_wpyt select_product_wpyt sel3">
    76                         <label><?php echo __('Product', 'nirweb-support') ?></label>
     67                        <label><?php echo esc_html__('Product', 'nirweb-support') ?></label>
    7768                        <select id="nirweb_ticket_frm_product_send_ticket"  class="wpyt_select" name="nirweb_ticket_frm_product_send_ticket">
    78                             <option value="-1"><?php echo __('Select Product', 'nirweb-support') ?></option>
     69                            <option value="-1"><?php echo esc_html__('Select Product', 'nirweb-support') ?></option>
    7970                             <?php $args = array('post_type' => 'product',);
    8071                            $loop = new WP_Query($args);
    8172                            while ($loop->have_posts()) : $loop->the_post();
    8273                                global $product;
    83                                 echo '<option value="' . $product->get_ID() . '" >' . get_the_title() . '</option>';
     74                                echo '<option value="' .esc_html($product->get_ID()) . '" >' . esc_html(get_the_title()) . '</option>';
    8475                            endwhile;
    8576                            wp_reset_query(); ?>
     
    8980                <?php }elseif (is_plugin_active('easy-digital-downloads/easy-digital-downloads.php')){ ?>
    9081                    <div class="halft_wpyt select_product_wpyt sel3">
    91                         <label><?php echo __('Product', 'nirweb-support') ?></label>
     82                        <label><?php echo esc_html__('Product', 'nirweb-support') ?></label>
    9283                        <select id="nirweb_ticket_frm_product_send_ticket"  class="wpyt_select" name="nirweb_ticket_frm_product_send_ticket">
    93                             <option value="-1"><?php echo __('Select Product', 'nirweb-support') ?></option>
     84                            <option value="-1"><?php echo esc_html__('Select Product', 'nirweb-support') ?></option>
    9485                            <?php $args = array('post_type' => 'download',);
    9586                            $loop = new WP_Query($args);
     
    10394            </div>
    10495            <div class="box_wpyt">
    105                 <label for="nirweb_ticket_frm_custom_editor"><?php echo __('Message', 'nirweb-support') ?> *</label>
     96                <label for="nirweb_ticket_frm_custom_editor"><?php echo esc_html__('Message', 'nirweb-support') ?> *</label>
    10697                <?php
    10798                $content = '';
     
    111102            </div>
    112103            <div class="file__wpyt">
    113                 <label><?php echo __('Attachment File', 'nirweb-support') ?></label>
     104                <label><?php echo esc_html__('Attachment File', 'nirweb-support') ?></label>
    114105
    115106                <input type="text" id="nirweb_ticket_frm_file_send_ticket" name="nirweb_ticket_frm_file_send_ticket"
    116107                       class="regular-text process_custom_images">
    117                 <input id="plupload-browse-button" name="misha_upload_image_button" type="button" value="<?php echo __('Select Image', 'nirweb-support') ?>"
     108                <input id="plupload-browse-button" name="misha_upload_image_button" type="button" value="<?php echo esc_html__('Select Image', 'nirweb-support') ?>"
    118109                       class="button wpyt_upload_image_button" style=" position: relative; z-index: 1;">
    119110            </div>
    120111            <div class="send__form">
    121                 <button type="submit" class="btn-send btn_send_ticket" data-name="nirweb_ticket_frm_btn_send_ticket"><?php echo __('Send Ticket', 'nirweb-support') ?></button>
     112                <button type="submit" class="btn-send btn_send_ticket" data-name="nirweb_ticket_frm_btn_send_ticket"><?php echo esc_html__('Send Ticket', 'nirweb-support') ?></button>
    122113            </div>
    123114    </div>
     
    126117        <div class="nirweb_ticket_left_sidebar_send_ticket">
    127118            <div class="nirweb_ticket_left_sidebar_header">
    128                 <h4><?php echo __('Status', 'nirweb-support') ?></h4>
     119                <h4><?php echo esc_html__('Status', 'nirweb-support') ?></h4>
    129120                <span class="arrow_wpyt cret flex aline-c"></span>
    130121            </div>
    131122            <div class="nirweb_ticket_left_sidebar_content">
    132                 <label><?php echo __('Select Status', 'nirweb-support') ?></label>
     123                <label><?php echo esc_html__('Select Status', 'nirweb-support') ?></label>
    133124                <select id="nirweb_ticket_frm_status_send_ticket" class="wpyt_select" name="nirweb_ticket_frm_status_send_ticket">
    134125                    <?php
     
    143134    <div class="nirweb_ticket_left_sidebar_send_ticket">
    144135        <div class="nirweb_ticket_left_sidebar_header">
    145             <h4><?php echo __('Notification', 'nirweb-support') ?></h4>
     136            <h4><?php echo esc_html__('Notification', 'nirweb-support') ?></h4>
    146137            <span class="arrow_wpyt cret"></span>
    147138        </div>
    148139        <div class="nirweb_ticket_left_sidebar_content">
    149             <label><?php echo __('Select Type Notification', 'nirweb-support') ?></label>
     140            <label><?php echo esc_html__('Select Type Notification', 'nirweb-support') ?></label>
    150141            <div class="arow">
    151142                <input id="chk_email" name="chk_email" type="checkbox">
    152                 <label><?php echo __('Send Email To User', 'nirweb-support') ?></label>
     143                <label><?php echo esc_html__('Send Email To User', 'nirweb-support') ?></label>
    153144            </div>
    154145        </div>
  • nirweb-support/trunk/inc/user/functions/ajax_user_send_answer.php

    r2707344 r2708596  
    33    function user_wpyar_answer_ticket()
    44    {
     5
    56         global $wpdb;
    67      if ( $_FILES ) {
     
    3031            'time_answer' => current_time("Y-m-d H:i:s"),
    3132            'text' => isset($_POST['user_answer']) ? sanitize_textarea_field(wpautop($_POST['user_answer'])) : '',
    32             'attach_url' => esc_url($url_file),
     33            'attach_url' => sanitize_url(esc_url_raw($url_file)),
    3334            'ticket_id' => isset($_POST['tik_id']) ? sanitize_text_field( $_POST['tik_id'] ) : '');
    3435        if(sanitize_text_field($_POST['user_answer']) or $url_file){   
     
    3940        $wpdb->update($wpdb->prefix.'nirweb_ticket_ticket',array(
    4041            'status' =>  sanitize_text_field($status),
    41             'time_update' => $time,
    42         ),array(   'ticket_id' =>  intval(sanitize_text_field($_POST['tik_id']) )));
     42            'time_update' => sanitize_text_field($time),
     43        ),array(   'ticket_id' =>  sanitize_text_field(intval($_POST['tik_id']))));
    4344            if($attach_id){
    4445                     global $wpdb;
    4546        $wpyar_user_upload=array( 
    4647                'user_id' =>  get_current_user_id(),
    47                 'url_file'   =>   $url_file,
    48                 'file_id'   =>   $attach_id,
     48                'url_file'   =>   sanitize_url(esc_url_raw($url_file)),
     49                'file_id'   =>   sanitize_text_field($attach_id),
    4950                'time_upload'   =>   current_time("Y-m-d H:i:s")
    5051            );
    5152         $wpdb->insert($wpdb->prefix.'nirweb_ticket_ticket_user_upload',$wpyar_user_upload);
    5253            }
     54
     55
    5356            //----------- Start Mail Department User
    5457      $wpytik = get_option('nirweb_ticket_perfix');
    5558      if( $wpytik['active_send_mail_to_poshtiban']=='1'){
    5659      $user_poshtiban = get_user_by('id',intval(sanitize_text_field($_POST['id_user'])));
    57       $user_poshtiban =$user_poshtiban->user_email;
     60      $user_poshtiban =sanitize_text_field($user_poshtiban->user_email);
    5861      $ticket_id=sanitize_text_field($_POST['tik_id']);
    5962      $ticket_title= sanitize_text_field($_POST['subject']);
    6063      $name_poshtiban = get_user_by('id', intval(sanitize_text_field($_POST['id_user'] )));
    61       $ticket_poshtiban = $name_poshtiban->user_nicename;
     64      $ticket_poshtiban = sanitize_text_field($name_poshtiban->user_nicename);
    6265      $ticket_dep = sanitize_text_field($_POST['dep_name']);
    6366      $ticket_pri = sanitize_text_field($_POST['priority_name']);
    6467      $search = ['{{ticket_id}}','{{ticket_title}}','{{ticket_poshtiban}}','{{ticket_dep}}','{{ticket_pri}}','{{ticket_stu}}'];
    65       $replace = [ $ticket_id,$ticket_title,$ticket_poshtiban,$ticket_dep,$ticket_pri ,__('open', 'nirweb-support') ];     
     68      $replace = [ $ticket_id,$ticket_title,$ticket_poshtiban,$ticket_dep,$ticket_pri ,esc_html__('new', 'nirweb-support') ];
    6669      $to = $user_poshtiban;
    6770      $headers = array('Content-Type: text/html; charset=UTF-8');
    6871      $subject = $wpytik['oposhtiban_tab_wpyarticket']['subject_mail_poshtiban_answer'];
    6972      $body = wpautop(str_replace($search, $replace, $wpytik['oposhtiban_tab_wpyarticket']['poshtiban_text_email_send_answer']));
    70       wp_mail( $to, $subject, $body, $headers );
     73      wp_mail( esc_html($to), esc_html($subject), esc_html($body), $headers );
    7174      }
    7275    }
     76
    7377}
    7478
    7579if (!function_exists('func_list_answer_ajax_user')) {
    7680    function func_list_answer_ajax_user(){
     81
    7782        $ticket_id = sanitize_text_field($_POST['tik_id']);
    7883        global $wpdb;
     
    8085        FROM {$wpdb->prefix}nirweb_ticket_ticket_answered answered   JOIN {$wpdb->prefix}users users ON user_id=ID
    8186        WHERE ticket_id=$ticket_id  ORDER BY answer_id ASC");
     87
     88
     89
    8290        foreach($process_answer_list as $row): 
    8391              $user=get_userdata( $row->user_id);
    84                 $role = $user->roles;
     92                $role =$user->roles;
    8593                 if(in_array ('user_support', $role) or in_array ('administrator', $role)){
    8694                    $cls ='user_support_wpyar';
     
    95103                            <?php if ($row->attach_url){ ?>
    96104                            <p class="file_atach_url">
    97                                 <a href="<?php echo esc_url($row->attach_url) ?>" target="_blank">
    98                                 <?php echo __('show attachment file', 'nirweb-support') ?>
     105                                <a href="<?php echo esc_url_raw($row->attach_url) ?>" target="_blank">
     106                                <?php echo esc_html__('show attachment file', 'nirweb-support') ?>
    99107                                 </a>
    100108                            </p>
     
    103111                        <div class="head_answer">
    104112                            <span class="name">
    105                                 <?php echo $row->display_name ?>
     113                                <?php echo esc_html( $row->display_name) ?>
    106114                            </span>
    107115                            <?php  if(in_array ('user_support', $role)){ ?>
    108116                              <span class="time">
    109                               <?php echo __('Hour', 'nirweb-support') ?>
    110                                 <?php echo  $date = date( 'H:i:s' , strtotime($row->time_answer)); ?>
     117                              <?php echo esc_html__('Hour', 'nirweb-support') ?>
     118                                <?php echo  esc_html( date( 'H:i:s' , strtotime($row->time_answer))); ?>
    111119                            </span>
    112120                                <span class="date">
    113                                 <?php echo __('Date :', 'nirweb-support') ?>
    114                                 <?php echo wp_date('d F Y' , strtotime($row->time_answer))   ?>
     121                                <?php echo esc_html__('Date :', 'nirweb-support') ?>
     122                                <?php echo esc_html(wp_date('d F Y' , strtotime($row->time_answer)))   ?>
    115123                            </span>
    116124                            <?php } else { ?>
    117125                            <span class="date">
    118                             <?php echo __('Date :', 'nirweb-support') ?>
    119                                 <?php echo wp_date('d F Y' , strtotime($row->time_answer))  ?>
     126                            <?php echo esc_html__('Date :', 'nirweb-support') ?>
     127                                <?php echo esc_html(wp_date('d F Y' , strtotime($row->time_answer))) ?>
    120128                            </span>
    121129                            <span class="time">
    122                             <?php echo __('Hour', 'nirweb-support') ?>
    123                                 <?php echo  $date = date( 'H:i:s' , strtotime($row->time_answer)); ?>
     130                            <?php echo esc_html__('Hour', 'nirweb-support') ?>
     131                                <?php echo esc_html( date( 'H:i:s' , strtotime($row->time_answer))); ?>
    124132                            </span>
    125133                        <?php } ?>
     
    128136                </li>
    129137       <?php  endforeach;
     138
    130139        exit();
    131140        }
  • nirweb-support/trunk/inc/user/functions/ajax_user_send_tiket.php

    r2707344 r2708596  
    11<?php
    22if (!function_exists('func_user_send_tiket')) {
    3     function func_user_send_tiket(){
     3    function func_user_send_tiket()
     4    {
    45        global $wpdb;
    5      
    6        
    7   if (sizeof( $_FILES) >0) {
    8     $accsses_file = explode(",",trim( wpyar_ticket['mojaz_file_upload_user_wpyar']));
    9             if( $_FILES['updoc']['type'] =='text/javascript' || $_FILES['updoc']['type'] == 'application/octet-stream' ){
     6
     7
     8        if (sizeof($_FILES) > 0) {
     9            $accsses_file = explode(",", trim(wpyar_ticket['mojaz_file_upload_user_wpyar']));
     10            if ($_FILES['updoc']['type'] == 'text/javascript' || $_FILES['updoc']['type'] == 'application/octet-stream') {
    1011                echo 'error_valid_type';
    1112                exit;
    1213            }
    13    
    14 
    15         require_once(ABSPATH . "wp-admin" . '/includes/image.php');
    16         require_once(ABSPATH . "wp-admin" . '/includes/file.php');
    17         require_once(ABSPATH . "wp-admin" . '/includes/media.php');
    18         $file_handler = 'updoc';
    19         $attach_id = media_handle_upload($file_handler,$post_id);
    20         $url_file = wp_get_attachment_url( $attach_id );
    21  
    22      }else{
    23          $url_file='';
    24        }
    2514
    2615
    27     $frm_ary_elements=array(
    28         'sender_id' =>  get_current_user_id(),
    29         'id_receiver'   => sanitize_text_field($_POST['resived_id']),
    30         'receiver_type' =>2,
    31         'subject'  =>  sanitize_text_field($_POST['subject']),
    32         'content'  => sanitize_textarea_field($_POST['content']),
    33         'department'    => isset($_POST['department'])?intval(sanitize_text_field($_POST['department'])):'',
    34         'priority'  =>  sanitize_text_field(intval($_POST['priority'])),
    35         'website' =>   isset($_POST['website']) ? sanitize_text_field($_POST['website']) : '',
    36         'product' =>  isset($_POST['product']) ? intval(sanitize_text_field($_POST['product'])) : '',
    37         'support_id' =>  isset($_POST['resived_id']) ? sanitize_text_field($_POST['resived_id']) : '',
    38         'status' =>  1,
    39         'file_url' =>  $url_file,
    40         'date_qustion'   =>  current_time("Y-m-d H:i:s"),
    41         'time_update'   =>  current_time("Y-m-d H:i:s")
    42     );
    43     $wpdb->insert($wpdb->prefix.'nirweb_ticket_ticket',$frm_ary_elements);
    44      $ticket_id=$wpdb->insert_id;
    45      if($attach_id){
    46                  $wpyar_user_upload=array( 
    47             'user_id' =>  get_current_user_id(),
    48             'url_file'   =>   $url_file,
    49             'file_id'   =>   $attach_id,
    50             'time_upload'   =>   current_time("Y-m-d H:i:s")
     16            require_once(ABSPATH . "wp-admin" . '/includes/image.php');
     17            require_once(ABSPATH . "wp-admin" . '/includes/file.php');
     18            require_once(ABSPATH . "wp-admin" . '/includes/media.php');
     19            $file_handler = 'updoc';
     20            $attach_id = media_handle_upload($file_handler, $post_id);
     21            $url_file = wp_get_attachment_url($attach_id);
     22
     23        } else {
     24            $url_file = '';
     25        }
     26
     27        $frm_ary_elements = array(
     28            'sender_id' => get_current_user_id(),
     29            'id_receiver' => sanitize_text_field($_POST['resived_id']),
     30            'receiver_type' => 2,
     31            'subject' => sanitize_text_field($_POST['subject']),
     32            'content' => sanitize_textarea_field($_POST['content']),
     33            'department' => isset($_POST['department']) ? intval(sanitize_text_field($_POST['department'])) : '',
     34            'priority' => sanitize_text_field(intval($_POST['priority'])),
     35            'website' => isset($_POST['website']) ? sanitize_text_field($_POST['website']) : '',
     36            'product' => isset($_POST['product']) ? intval(sanitize_text_field($_POST['product'])) : '',
     37            'support_id' => isset($_POST['resived_id']) ? sanitize_text_field($_POST['resived_id']) : '',
     38            'status' => 1,
     39            'file_url' => sanitize_url(esc_url_raw($url_file)),
     40            'date_qustion' => current_time("Y-m-d H:i:s"),
     41            'time_update' => current_time("Y-m-d H:i:s")
    5142        );
     43        $wpdb->insert($wpdb->prefix . 'nirweb_ticket_ticket', $frm_ary_elements);
     44        $ticket_id = $wpdb->insert_id;
     45        if ($attach_id) {
     46            $wpyar_user_upload = array(
     47                'user_id' => get_current_user_id(),
     48                'url_file' => sanitize_url(esc_url_raw($url_file)),
     49                'file_id' => sanitize_text_field($attach_id),
     50                'time_upload' => current_time("Y-m-d H:i:s")
     51            );
    5252
    53         $wpdb->insert($wpdb->prefix.'nirweb_ticket_ticket_user_upload',$wpyar_user_upload);
    54      }
     53            $wpdb->insert($wpdb->prefix . 'nirweb_ticket_ticket_user_upload', $wpyar_user_upload);
     54            var_dump($wpdb->last_error);
     55            exit;
     56        }
    5557
    5658
    57  //----------- Information Send Mail
    58  
    59  if( wpyar_ticket['active_send_mail_to_poshtiban']=='1' or wpyar_ticket['active_send_mail_to_user']=='1'  ){
    60   $ticket_title= sanitize_text_field($_POST['subject']);
    61   $name_poshtiban = get_user_by('id', intval(sanitize_text_field($_POST['resived_id'])));
    62   $ticket_poshtiban = $name_poshtiban->display_name;
    63   $ticket_dep = sanitize_text_field($_POST['dep_name']);
    64   $ticket_pri = sanitize_text_field($_POST['priority_name']);
    65   $search = ['{{ticket_id}}','{{ticket_title}}','{{ticket_poshtiban}}','{{ticket_dep}}','{{ticket_pri}}','{{ticket_stu}}'];
    66   $replace = [ $ticket_id,$ticket_title,$ticket_poshtiban,$ticket_dep,$ticket_pri ,__('open', 'nirweb-support') ];     
    67 }
     59        //----------- Information Send Mail
     60
     61        if (wpyar_ticket['active_send_mail_to_poshtiban'] == '1' or wpyar_ticket['active_send_mail_to_user'] == '1') {
     62            $ticket_title = sanitize_text_field($_POST['subject']);
     63            $name_poshtiban = get_user_by('id', intval(sanitize_text_field($_POST['resived_id'])));
     64            $ticket_poshtiban = sanitize_text_field($name_poshtiban->display_name);
     65            $ticket_dep = sanitize_text_field($_POST['dep_name']);
     66            $ticket_pri = sanitize_text_field($_POST['priority_name']);
     67            $search = ['{{ticket_id}}', '{{ticket_title}}', '{{ticket_poshtiban}}', '{{ticket_dep}}', '{{ticket_pri}}', '{{ticket_stu}}'];
     68            $replace = [$ticket_id, $ticket_title, $ticket_poshtiban, $ticket_dep, $ticket_pri, __('open', 'nirweb-support')];
     69        }
    6870
    6971//----------- Start Mail Department User
    70  if(wpyar_ticket['active_send_mail_to_poshtiban'] == '1'){
    71  $user_poshtiban = get_user_by('id', intval(sanitize_text_field($_POST['resived_id'])));
    72  $user_poshtiban =$user_poshtiban->user_email;
    73  $subject = wpyar_ticket['oposhtiban_tab_wpyarticket']['subject_mail_poshtiban_new'];
    74  $body = wpautop(str_replace($search, $replace, wpyar_ticket['oposhtiban_tab_wpyarticket']['poshtiban_text_email_send']));
    75  $to = $user_poshtiban;
    76  $headers = array('Content-Type: text/html; charset=UTF-8');
    77  wp_mail( $to, $subject, $body, $headers );
    78 }
     72        if (wpyar_ticket['active_send_mail_to_poshtiban'] == '1') {
     73            $user_poshtiban = get_user_by('id', intval(sanitize_text_field($_POST['resived_id'])));
     74            $user_poshtiban = $user_poshtiban->user_email;
     75            $subject = wpyar_ticket['oposhtiban_tab_wpyarticket']['subject_mail_poshtiban_new'];
     76            $body = wpautop(str_replace($search, $replace, wpyar_ticket['oposhtiban_tab_wpyarticket']['poshtiban_text_email_send']));
     77            $to = $user_poshtiban;
     78            $headers = array('Content-Type: text/html; charset=UTF-8');
     79            wp_mail(esc_html($to), esc_html($subject), esc_html($body), $headers);
     80        }
    7981
    80 //---------------- End Mail Department User
     82        if (get_option('nirweb_ticket_perfix')['active_send_mail_to_user'] == 1) {
     83            $user = get_user_by('id', get_current_user_id());
     84            $user = sanitize_text_field($user->user_email);
    8185
    82 //----------- Start Mail  User
    83    
    84  if( get_option('nirweb_ticket_perfix')['active_send_mail_to_user']==1 ){
    85  $user = get_user_by('id',get_current_user_id());
    86  $user =$user->user_email;
    87  
    88  
    89  $subject = wpyar_ticket['ueser_tab_wpyarticket']['subject_mail_user_new'];
    90  $body = wpautop(str_replace($search, $replace, wpyar_ticket['ueser_tab_wpyarticket']['user_text_email_send']));
    91  $to = $user;
    92  $headers = array('Content-Type: text/html; charset=UTF-8');
    93  wp_mail( $to, $subject, $body, $headers );
    94 }
    95  
    96     echo esc_html('<div class="upfile_wpyartick">
     86
     87            $subject = wpyar_ticket['ueser_tab_wpyarticket']['subject_mail_user_new'];
     88            $body = wpautop(str_replace($search, $replace, wpyar_ticket['ueser_tab_wpyarticket']['user_text_email_send']));
     89            $to = $user;
     90            $headers = array('Content-Type: text/html; charset=UTF-8');
     91            wp_mail(esc_html($to), esc_html($subject), esc_html($body), $headers);
     92        }
     93
     94        echo '<div class="upfile_wpyartick">
    9795             
    9896        <label for="main_image" class="label_main_image">
    9997             <span class="remove_file_by_user"><i class="fal fa-times-circle"></i></span> 
    10098            <i class="fal fa-arrow-up upicon" style="font-size: 30px;margin-bottom: 10px;"></i>
    101             <span class="text_label_main_image">'.__('Attachment File', 'nirweb-support').'</span>
     99            <span class="text_label_main_image">' . esc_html__('Attachment File', 'nirweb-support') . '</span>
    102100         </label>
    103         <input type="file" name="main_image" id="main_image" accept="'.wpyar_ticket['mojaz_file_upload_user_wpyar'].'">
    104             </div> ');
     101        <input type="file" name="main_image" id="main_image" accept="' . esc_html(wpyar_ticket['mojaz_file_upload_user_wpyar']) . '">
     102            </div> ';
     103    }
    105104}
    106 }
  • nirweb-support/trunk/inc/user/functions/ajax_wpyar_ticket_user_search.php

    r2705011 r2708596  
    11<?php
    22if (!function_exists('func_ajax_nirweb_ticket_user_search')) {
    3     function func_ajax_nirweb_ticket_user_search($value){
     3    function func_ajax_nirweb_ticket_user_search($value)
     4    {
    45        global $wpdb;
    5         $user_id=get_current_user_id();
     6        $value = sanitize_text_field($value);
     7        $user_id = get_current_user_id();
    68        $address_table = $wpdb->prefix . "nirweb_ticket_ticket";
    7         // To use "LIKE" with the wildcards (%), we have to do some funny business:
    89        $search = "%{$value}%";
    9         // Build the where clause using $wpdb->prepare to prevent SQL injection attacks
    10         // Searching ALL THREE of our columns: Product, Application, Sector
    11         $where = $wpdb->prepare( 'WHERE (id_receiver=%s OR sender_id=%s) AND (ticket_id LIKE %s OR subject LIKE %s)', $user_id, $user_id,$search, $search);
    12         // Execute the query with our WHERE clause
    13         // NOTE: Your code originally used "$sc_products", but that variable was not defined - so have replaced to the proper $address_table here.
    14         $results = $wpdb->get_results( "SELECT * FROM {$address_table} {$where}" );
    15                 if(sizeof($results)>0){
    16                     foreach($results as $row){
    17                  
    18                         echo esc_html( '<li><a href="#">'.$row->subject.'</a></li>');
     10        $where = $wpdb->prepare('WHERE (id_receiver=%s OR sender_id=%s) AND (ticket_id LIKE %s OR subject LIKE %s)', $user_id, $user_id, $search, $search);
     11        $results = $wpdb->get_results("SELECT * FROM {$address_table} {$where}");
     12        if (sizeof($results) > 0) {
     13            foreach ($results as $row) {
     14                echo '<li><a href="#">' . esc_html($row->subject) . '</a></li>';
    1915                             }
    20                 }else{
    21                      echo'<p class="not_found">'.__('not found', 'nirweb-support').'</p>' ; 
    22                 }
     16        } else {
     17            echo '<p class="not_found">' . esc_html__('not found', 'nirweb-support') . '</p>';
     18        }
    2319    }
    2420}
  • nirweb-support/trunk/inc/user/functions/filter_ajax_ticket.php

    r2707344 r2708596  
    4040                        <?php      foreach ($process_ticket_list as $row) :    ?>
    4141                            <li>
    42                                 <a href="?action=reply&id=<?php echo $row->ticket_id ?>" class="<?php
     42                                <a href="?action=reply&id=<?php echo esc_html($row->ticket_id) ?>" class="<?php
    4343                                if (intval($row->status) == 1) {
    4444                                    echo 'arbitrator_wpyaru-red';
     
    6868                                            $orig_time = strtotime( $row->time_update);
    6969                                            $date = strtotime($row->date_qustion);
    70                                             echo $date = wp_date('d F Y', $date); ?>
    71                                             <?php echo __('Hour', 'nirweb-support') ?>
     70                                            echo esc_html(wp_date('d F Y', $date)); ?>
     71                                            <?php echo esc_html__('Hour', 'nirweb-support') ?>
    7272                                            <?php
    73                                             echo $date = wp_date('H:i', $date); ?>
     73                                            echo  esc_html(wp_date('H:i', $date)); ?>
    7474                                        </time>
    7575                                    </div>
     
    7878                                        <time>
    7979                                            <?php
    80                                             $orig_time = strtotime( $row->time_update);
     80                                            $orig_time = strtotime(esc_html($row->time_update));
    8181                                            ago_ticket_nirweb($orig_time) ?>
    8282                                        </time>
     
    8989                <?php
    9090            }else{
    91                 echo '<h3 style="color:red;font-weight: 400;text-align: center;font-size: 18px;">
    92         '.__('not found', 'nirweb-support').'
     91                echo '<h3 style="color:red;font-weight: 400;text-align: center;font-size: 18px;"> '.esc_html__('not found', 'nirweb-support').'
    9392        </h3>' ;
    9493            }
     
    10099                    <?php      foreach ($list_ticket[0] as $row) :    ?>
    101100                        <li>
    102                             <a href="?action=reply&id=<?php echo $row->ticket_id ?>" class="<?php
     101                            <a href="?action=reply&id=<?php echo esc_html($row->ticket_id) ?>" class="<?php
    103102                            if (intval($row->status) == 1) {
    104103                                echo 'arbitrator_wpyaru-red';
     
    128127                                        $orig_time = strtotime( $row->time_update);
    129128                                        $date = strtotime($row->date_qustion);
    130                                         echo $date = wp_date('d F Y', $date); ?>
    131                                         <?php echo __('Hour', 'nirweb-support') ?>
     129                                        echo esc_html(wp_date('d F Y', $date)); ?>
     130                                        <?php echo esc_html__('Hour', 'nirweb-support') ?>
    132131                                        <?php
    133                                         echo $date = wp_date('H:i', $date); ?>
     132                                        echo esc_html( wp_date('H:i', $date)); ?>
    134133                                    </time>
    135134                                </div>
     
    138137                                    <time>
    139138                                        <?php
    140                                         $orig_time = strtotime( $row->time_update);
     139                                        $orig_time = strtotime( esc_html($row->time_update));
    141140                                        ago_ticket_nirweb($orig_time) ?>
    142141                                    </time>
  • nirweb-support/trunk/inc/user/functions/func_shourt_code.php

    r2705011 r2708596  
    33    function nirweb_ticket_login_ticket()
    44    {
     5
    56        if (!is_user_logged_in()) {
    67            include NIRWEB_SUPPORT_INC_USER_THEMES_TICKET . 'login.php';
  • nirweb-support/trunk/inc/user/functions/func_u_list_ticket.php

    r2707344 r2708596  
    11<?php
    2 if (!function_exists('nirweb_ticket_get_list_all_ticket_user')) {function nirweb_ticket_get_list_all_ticket_user(){
    3     global $wpdb,$table_prefix;
     2if (!function_exists('nirweb_ticket_get_list_all_ticket_user')) {
     3    function nirweb_ticket_get_list_all_ticket_user()
     4    {
     5        global $wpdb, $table_prefix;
     6        $user_id = get_current_user_id();
     7        global $wpdb;
     8        $items_per_page = 20;
     9        $page = isset($_GET['cpage']) ? abs((int)$_GET['cpage']) : 1;
     10        $offset = ($page * $items_per_page) - $items_per_page;
     11        $query = 'SELECT * FROM ' . $wpdb->prefix . 'nirweb_ticket_ticket ticket WHERE ticket.id_receiver=' . $user_id . '
     12  or ticket.sender_id=' . $user_id . ' ';
    413
    5 
    6     $user_id=get_current_user_id();
    7 
    8     global $wpdb;
    9     $items_per_page = 20;
    10     $page = isset( $_GET['cpage'] ) ? abs( (int) $_GET['cpage'] ) : 1;
    11     $offset = ( $page * $items_per_page ) - $items_per_page;
    12     $query = 'SELECT * FROM '.$wpdb->prefix.'nirweb_ticket_ticket ticket WHERE ticket.id_receiver='.$user_id.'
    13   or ticket.sender_id='.$user_id.' ';
    14 
    15     $total_query = "SELECT COUNT(1) FROM (${query}) AS combined_table";
    16     $total = $wpdb->get_var( $total_query );
    17 
    18 
    19 
    20     $new_ticket_list=$wpdb->get_results("SELECT ticket.* , users.ID , users.display_name,status.*,depart.*, depart.name as department_name,post.ID,post.post_title,priority.*,priority.name as proname
     14        $total_query = "SELECT COUNT(1) FROM (${query}) AS combined_table";
     15        $total = $wpdb->get_var($total_query);
     16        $new_ticket_list = $wpdb->get_results("SELECT ticket.* , users.ID , users.display_name,status.*,depart.*, depart.name as department_name,post.ID,post.post_title,priority.*,priority.name as proname
    2117                                             FROM {$wpdb->prefix}nirweb_ticket_ticket ticket
    2218                                             
     
    4238                                               LIMIT  $offset,  $items_per_page
    4339                                                                                            ");
    44     return array(
     40        return array(
    4541
    46         $new_ticket_list,paginate_links( array(
    47             'base' => add_query_arg( 'cpage', '%#%' ),
    48             'format' => '',
    49             'prev_text' => __('&laquo;'),
    50             'next_text' => __('&raquo;'),
    51             'total' => ceil($total / $items_per_page),
    52             'current' => $page
    53         ))
    54     ) ;
     42            $new_ticket_list, paginate_links(array(
     43                'base' => add_query_arg('cpage', '%#%'),
     44                'format' => '',
     45                'prev_text' => __('&laquo;'),
     46                'next_text' => __('&raquo;'),
     47                'total' => ceil($total / $items_per_page),
     48                'current' => $page
     49            ))
     50        );
    5551
    5652
    57 }}
    58 if (!function_exists('nirweb_ticket_edit_ticket')) {function nirweb_ticket_edit_ticket($ticket_id)
    59 {
    60     global $wpdb;
    61     $ticket = $wpdb->get_row("SELECT ticket.* , users.ID , users.display_name,status.*,department.* ,department.name as depname,priority.*,priority.name as proname ,revuser.ID as rev_id,revuser.display_name as rev_name ,posts.ID,posts.post_title as product_name
     53    }
     54}
     55if (!function_exists('nirweb_ticket_edit_ticket')) {
     56    function nirweb_ticket_edit_ticket($ticket_id)
     57    {
     58        global $wpdb;
     59        $ticket = $wpdb->get_row("SELECT ticket.* , users.ID , users.display_name,status.*,department.* ,department.name as depname,priority.*,priority.name as proname ,revuser.ID as rev_id,revuser.display_name as rev_name ,posts.ID,posts.post_title as product_name
    6260      FROM {$wpdb->prefix}nirweb_ticket_ticket ticket
    6361      LEFT JOIN {$wpdb->prefix}users users
     
    7472      ON priority=priority_id       
    7573    where $ticket_id = ticket_id;  ");
    76     return $ticket;
    77 }}
    78 if (!function_exists('nirweb_ticket_count_all_ticket_user_fr')) {function nirweb_ticket_count_all_ticket_user_fr(){
    79     $user_id=get_current_user_id();
    80     global $wpdb;
    81     $count_all=intval($wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->prefix}nirweb_ticket_ticket WHERE  id_receiver= $user_id OR sender_id=$user_id "));
    82     echo $count_all;
    83 }}
    84 if (!function_exists('nirweb_ticket_count_new_ticket_user_fr')) {function nirweb_ticket_count_new_ticket_user_fr(){
    85     $user_id=get_current_user_id();
     74        return $ticket;
     75    }
     76}
     77if (!function_exists('nirweb_ticket_count_all_ticket_user_fr')) {
     78    function nirweb_ticket_count_all_ticket_user_fr()
     79    {
     80        $user_id = get_current_user_id();
     81        global $wpdb;
     82        $count_all = intval($wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->prefix}nirweb_ticket_ticket WHERE  id_receiver= $user_id OR sender_id=$user_id "));
     83        echo esc_html($count_all);
     84    }
     85}
     86if (!function_exists('nirweb_ticket_count_new_ticket_user_fr')) {
     87    function nirweb_ticket_count_new_ticket_user_fr()
     88    {
     89        $user_id = get_current_user_id();
    8690
    87     global $wpdb;
    88     $count_all=intval($wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->prefix}nirweb_ticket_ticket
     91        global $wpdb;
     92        $count_all = intval($wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->prefix}nirweb_ticket_ticket
    8993                                          WHERE (id_receiver= $user_id OR sender_id=$user_id ) AND  status=1"));
    90     echo $count_all;
    91 }}
     94        echo esc_html($count_all);
     95    }
     96}
    9297
    93 if (!function_exists('nirweb_ticket_count_process_ticket_user_fr')) {function nirweb_ticket_count_process_ticket_user_fr(){
    94     $user_id=get_current_user_id();
     98if (!function_exists('nirweb_ticket_count_process_ticket_user_fr')) {
     99    function nirweb_ticket_count_process_ticket_user_fr()
     100    {
     101        $user_id = get_current_user_id();
    95102
    96     global $wpdb;
    97     $count_all=intval($wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->prefix}nirweb_ticket_ticket
     103        global $wpdb;
     104        $count_all = intval($wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->prefix}nirweb_ticket_ticket
    98105                                          WHERE (id_receiver= $user_id OR sender_id=$user_id ) AND status=2 "));
    99     echo $count_all;
    100 }}
    101 if (!function_exists('nirweb_ticket_count_answered_ticket_user_fr')) {function nirweb_ticket_count_answered_ticket_user_fr(){
    102     $user_id=get_current_user_id();
     106        echo esc_html($count_all);
     107    }
     108}
     109if (!function_exists('nirweb_ticket_count_answered_ticket_user_fr')) {
     110    function nirweb_ticket_count_answered_ticket_user_fr()
     111    {
     112        $user_id = get_current_user_id();
    103113
    104     global $wpdb;
    105     $count_all=intval($wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->prefix}nirweb_ticket_ticket
     114        global $wpdb;
     115        $count_all = intval($wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->prefix}nirweb_ticket_ticket
    106116                                          WHERE (id_receiver= $user_id OR sender_id=$user_id ) AND status=3"));
    107     echo $count_all;
    108 }}
    109 if (!function_exists('nirweb_ticket_count_closed_ticket_user_fr')) {function nirweb_ticket_count_closed_ticket_user_fr(){
    110     $user_id=get_current_user_id();
     117        echo esc_html($count_all);
     118    }
     119}
     120if (!function_exists('nirweb_ticket_count_closed_ticket_user_fr')) {
     121    function nirweb_ticket_count_closed_ticket_user_fr()
     122    {
     123        $user_id = get_current_user_id();
    111124
    112     global $wpdb;
    113     $count_all=intval($wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->prefix}nirweb_ticket_ticket
     125        global $wpdb;
     126        $count_all = intval($wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->prefix}nirweb_ticket_ticket
    114127                                          WHERE (id_receiver= $user_id OR sender_id=$user_id ) AND status=4 "));
    115     echo $count_all;
    116 }
     128        echo esc_html($count_all);
     129    }
    117130
    118131
  • nirweb-support/trunk/inc/user/themes/home.php

    r2707344 r2708596  
    1 <?php 
    2 include NIRWEB_SUPPORT_INC_USER_FUNCTIONS_TICKET .'func_u_list_ticket.php';
    3 include NIRWEB_SUPPORT_INC_ADMIN_FUNCTIONS_TICKET .'func_status_and_priority.php';
     1<?php
     2include NIRWEB_SUPPORT_INC_USER_FUNCTIONS_TICKET . 'func_u_list_ticket.php';
     3include NIRWEB_SUPPORT_INC_ADMIN_FUNCTIONS_TICKET . 'func_status_and_priority.php';
    44$list_ticket = nirweb_ticket_get_list_all_ticket_user();
    55$list_status = nirweb_ticket_get_status();
    66$user = wp_get_current_user();
    77?>
    8  <div class="nirweb_ticket_base wpyar-ticket">   
    9      <h3 class="tite_status_tickets_wpyar"><?php echo  __('Ticket status', 'nirweb-support') ?></h3>
    10      <div class="row_status">
    11          <div class="col_box_status_ticket_wpyar" id="open">
    12          <svg id="svg_open-ticket" viewBox="0 0 48.6 48.6" style="width: 50px"><path fill="#FFF" d="M17.5 14.2l2.4-2.4c5.6 5.6 11.2 11.3 16.8 16.9L34.4 31c-5.6-5.5-11.3-11.2-16.9-16.8z"></path><path fill="#E6E6E6" d="M38.2 28.8l9.4-9.4-4.2-4.2c-2.7 2.6-7.1 2.5-9.7-.2-2.7-2.6-2.8-7-.2-9.7L29.3 1l-9.4 9.4 18.3 18.4z"></path><path fill="#4D4D4D" d="M25.3 32.3c-.3 0-.5-.1-.7-.3l-2.7-2.7c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l2.7 2.7c.4.4.4 1 0 1.4-.2.2-.5.3-.7.3zm-5.4-5.4c-.3 0-.5-.1-.7-.3l-2.7-2.7c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l2.7 2.7c.4.4.4 1 0 1.4-.2.2-.5.3-.7.3z"></path><path fill="#4D4D4D" d="M48.3 18.6l-4.2-4.2c-.4-.4-1-.4-1.4 0-2.3 2.2-6 2.1-8.2-.2-2.3-2.2-2.4-6-.2-8.3.4-.4.4-1 0-1.4L30 .3l-.2-.1-.2-.1-.2-.1H29.1c-.2 0-.4.1-.5.2l-9.4 9.4-18.9 19c-.4.4-.4 1 0 1.4l4.2 4.2c.4.4 1 .4 1.4 0 2.3-2.2 6.1-2.1 8.3.2 2.3 2.2 2.4 6 .2 8.3-.4.4-.4 1 0 1.4l4.2 4.2c.2.2.5.3.7.3s.5-.1.7-.3l14.8-14.8c.2 0 .3-.1.4-.2l4.2-4.2c.1-.1.1-.2.2-.3l8.7-8.7c.2-.2.3-.5.3-.8 0-.2-.1-.5-.3-.7zm-19-16.2l2.9 2.9c-2.3 3.1-2 7.6.8 10.3 2.8 2.8 7.2 3.1 10.4.9l2.8 2.8-7.5 7.5L21.8 10l7.5-7.6zm-9.4 9.4l16.8 16.9-2.3 2.3-16.9-16.8 2.4-2.4zm-.6 34.4l-2.8-2.8c2.3-3.1 2-7.6-.8-10.3-2.8-2.8-7.2-3.1-10.4-.9l-2.8-2.8 9.8-9.8c0 .1.1.2.2.3l1.4 1.4c.2.2.5.3.7.3s.5-.1.7-.3c.4-.4.4-1 0-1.4l-1.4-1.4c-.1-.1-.2-.1-.3-.2l2.6-2.6L33 32.5l-2.6 2.6c0-.2-.1-.3-.2-.4l-1.4-1.4c-.4-.4-1-.4-1.4 0s-.4 1 0 1.4l1.4 1.4c.1.1.3.2.4.2l-9.9 9.9z"></path><circle fill="#FF1A1A" cx="35.2" cy="35.7" r="9.9"></circle><path fill="#FFF" d="M35.2 47.7c-6.6 0-12-5.4-12-12s5.4-12 12-12 12 5.4 12 12-5.4 12-12 12zm0-22c-5.5 0-10 4.5-10 10s4.5 10 10 10 10-4.5 10-10-4.5-10-10-10z"></path><path fill="#FFF" d="M38.8 40.5h-6c-.6 0-1-.4-1-1s.4-1 1-1h5v-5h-5c-.6 0-1-.4-1-1s.4-1 1-1h6c.6 0 1 .4 1 1v7c0 .6-.4 1-1 1z"></path></svg>
    13          <p class="title"><?php echo __('Open', 'nirweb-support') ?></p>
    14          <p class="number c-red">
    15              <?php nirweb_ticket_count_new_ticket_user_fr ()?>
    16          </p>
    17          </div>
    18          <div class="col_box_status_ticket_wpyar" id="inprogress">
    19              <svg id="svg_doing-ticket" viewBox="0 0 48.6 48.6"style="width: 50px"><g transform="translate(-1031 1558)"><path fill="#FFF" d="M1047.103-1543.742l4.242-4.242 18.385 18.384-4.243 4.243z"></path><path fill="#4D4D4D" d="M1056.3-1525.7c-.3 0-.5-.1-.7-.3l-2.7-2.7c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l2.7 2.7c.4.4.4 1 0 1.4-.2.2-.5.3-.7.3zm-5.4-5.4c-.3 0-.5-.1-.7-.3l-2.7-2.7c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l2.7 2.7c.4.4.4 1 0 1.4-.2.2-.5.3-.7.3z"></path><path fill="#E6E6E6" d="M1069.2-1529.2l9.4-9.4-4.2-4.2c-2.7 2.6-7.1 2.5-9.7-.2-2.7-2.6-2.8-7-.2-9.7l-4.2-4.3-9.4 9.4 18.3 18.4z"></path><path fill="#4D4D4D" d="M1079.3-1539.4l-4.2-4.2c-.4-.4-1-.4-1.4 0-2.3 2.2-6 2.1-8.2-.2-2.3-2.2-2.4-6-.2-8.3.4-.4.4-1 0-1.4l-4.3-4.2s-.1-.1-.2-.1-.1-.1-.2-.1-.2 0-.3-.1H1060c-.2 0-.4.1-.5.2l-9.4 9.4-18.9 18.9c-.4.4-.4 1 0 1.4l4.2 4.2c.4.4 1 .4 1.4 0 2.3-2.2 6.1-2.1 8.3.2 2.3 2.2 2.4 6 .2 8.3-.4.4-.4 1 0 1.4l4.2 4.2c.2.2.5.3.7.3s.5-.1.7-.3l14.8-14.8c.2 0 .3-.1.4-.2l4.2-4.2c.1-.1.1-.2.2-.3l8.7-8.7c.2-.2.3-.5.3-.8.1-.1 0-.4-.2-.6zm-19-16.2l2.9 2.9c-2.3 3.1-2 7.6.8 10.3 2.8 2.8 7.2 3.1 10.4.9l2.8 2.8-7.5 7.5-16.9-16.9 7.5-7.5zm-9.4 9.4l16.8 16.9-2.3 2.3-16.9-16.9 2.4-2.3zm-.6 34.4l-2.8-2.8c2.3-3.1 2-7.6-.8-10.3-2.8-2.8-7.2-3.1-10.4-.9l-2.8-2.8 9.8-9.8c0 .1.1.2.2.3l1.4 1.4c.2.2.5.3.7.3s.5-.1.7-.3c.4-.4.4-1 0-1.4l-1.4-1.4c-.1-.1-.2-.1-.3-.2l2.6-2.6 16.9 16.9-2.6 2.6c0-.2-.1-.3-.2-.4l-1.4-1.4c-.4-.4-1-.4-1.4 0s-.4 1 0 1.4l1.4 1.4c.1.1.3.2.4.2l-10 9.8z"></path><circle fill="#2096FC" cx="1065.2" cy="-1522.3" r="11"></circle><path fill="#FFF" d="M1065.2-1510.3c-6.6 0-12-5.4-12-12s5.4-12 12-12 12 5.4 12 12-5.4 12-12 12zm0-22c-5.5 0-10 4.5-10 10s4.5 10 10 10 10-4.5 10-10-4.5-10-10-10z"></path><path fill="#FFF" d="M1071.3-1520.7h-1.1c-.6 0-1-.4-1-1s.4-1 1-1h1.1c.6 0 1 .4 1 1s-.4 1-1 1zM1060.4-1520.7h-1.1c-.6 0-1-.4-1-1s.4-1 1-1h1.1c.6 0 1 .4 1 1s-.4 1-1 1zM1065.9-1520.7h-1.1c-.6 0-1-.4-1-1s.4-1 1-1h1.1c.6 0 1 .4 1 1s-.4 1-1 1z"></path></g></svg>
    20          <p class="title"><?php echo __('Inprogress', 'nirweb-support') ?></p>
    21          <p class="number c-blue"><?php nirweb_ticket_count_process_ticket_user_fr ()?></p>
    22          </div>
    23          <div class="col_box_status_ticket_wpyar" id="closed">
    24          <svg id="svg_close-ticket" viewBox="0 0 48.6 48.6" style="width: 50px"><g transform="translate(-905 1558)"><path fill="#FFF" d="M921.104-1543.743l4.242-4.242 18.385 18.384-4.243 4.243z"></path><path fill="#E6E6E6" d="M943.2-1529.2l9.4-9.4-4.2-4.2c-2.7 2.6-7.1 2.5-9.7-.2-2.7-2.6-2.8-7-.2-9.7l-4.2-4.3-9.4 9.4 18.3 18.4z"></path><path fill="#4D4D4D" d="M930.3-1525.7c-.3 0-.5-.1-.7-.3l-2.7-2.7c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l2.7 2.7c.4.4.4 1 0 1.4-.2.2-.5.3-.7.3zm-5.4-5.4c-.3 0-.5-.1-.7-.3l-2.7-2.7c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l2.7 2.7c.4.4.4 1 0 1.4-.2.2-.5.3-.7.3z"></path><path fill="#4D4D4D" d="M953.3-1539.4l-4.2-4.2c-.4-.4-1-.4-1.4 0-2.3 2.2-6 2.1-8.2-.2-2.3-2.2-2.4-6-.2-8.3.4-.4.4-1 0-1.4l-4.3-4.2s-.1-.1-.2-.1-.1-.1-.2-.1-.2 0-.3-.1H934c-.2 0-.4.1-.5.2l-9.4 9.4-18.9 18.9c-.4.4-.4 1 0 1.4l4.2 4.2c.4.4 1 .4 1.4 0 2.3-2.2 6.1-2.1 8.3.2 2.3 2.2 2.4 6 .2 8.3-.4.4-.4 1 0 1.4l4.2 4.2c.2.2.5.3.7.3s.5-.1.7-.3l14.8-14.8c.2 0 .3-.1.4-.2l4.2-4.2c.1-.1.1-.2.2-.3l8.7-8.7c.2-.2.3-.5.3-.8.1-.1 0-.4-.2-.6zm-19-16.2l2.9 2.9c-2.3 3.1-2 7.6.8 10.3 2.8 2.8 7.2 3.1 10.4.9l2.8 2.8-7.5 7.5-16.9-16.9 7.5-7.5zm-9.4 9.4l16.8 16.9-2.3 2.3-16.9-16.9 2.4-2.3zm-.6 34.4l-2.8-2.8c2.3-3.1 2-7.6-.8-10.3-2.8-2.8-7.2-3.1-10.4-.9l-2.8-2.8 9.8-9.8c0 .1.1.2.2.3l1.4 1.4c.2.2.5.3.7.3s.5-.1.7-.3c.4-.4.4-1 0-1.4l-1.4-1.4c-.1-.1-.2-.1-.3-.2l2.6-2.6 16.9 16.9-2.6 2.6c0-.2-.1-.3-.2-.4l-1.4-1.4c-.4-.4-1-.4-1.4 0s-.4 1 0 1.4l1.4 1.4c.1.1.3.2.4.2l-10 9.8z"></path><circle fill="#2FBE35" cx="940.2" cy="-1522.3" r="11"></circle><path fill="#FFF" d="M940.2-1510.3c-6.6 0-12-5.4-12-12s5.4-12 12-12 12 5.4 12 12-5.4 12-12 12zm0-22c-5.5 0-10 4.5-10 10s4.5 10 10 10 10-4.5 10-10-4.5-10-10-10z"></path><path fill="#FFF" d="M943.8-1517.5h-7c-.6 0-1-.4-1-1v-7c0-.6.4-1 1-1h7c.6 0 1 .4 1 1v7c0 .6-.4 1-1 1zm-6-2h5v-5h-5v5z"></path></g></svg>
    25          <p class="title"><?php echo __('Closed', 'nirweb-support') ?></p>
    26          <p class="number c-green"><?php nirweb_ticket_count_closed_ticket_user_fr ()?></p>
    27          </div>
    28          <div class="col_box_status_ticket_wpyar" id="answered">
    29          <svg id="svg_answered-ticket" viewBox="0 0 48.6 48.6" style="width: 50px"><g transform="translate(-1179 1558)"><path fill="#FFF" d="M1195.102-1543.74l4.242-4.243 18.385 18.384-4.243 4.243z"></path><path fill="#E6E6E6" d="M1217.2-1529.2l9.4-9.4-4.2-4.2c-2.7 2.6-7.1 2.5-9.7-.2-2.7-2.6-2.8-7-.2-9.7l-4.2-4.3-9.4 9.4 18.3 18.4z"></path><path fill="#4D4D4D" d="M1204.3-1525.7c-.3 0-.5-.1-.7-.3l-2.7-2.7c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l2.7 2.7c.4.4.4 1 0 1.4-.2.2-.5.3-.7.3zm-5.4-5.4c-.3 0-.5-.1-.7-.3l-2.7-2.7c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l2.7 2.7c.4.4.4 1 0 1.4-.2.2-.5.3-.7.3z"></path><path fill="#4D4D4D" d="M1227.3-1539.4l-4.2-4.2c-.4-.4-1-.4-1.4 0-2.3 2.2-6 2.1-8.2-.2-2.3-2.2-2.4-6-.2-8.3.4-.4.4-1 0-1.4l-4.3-4.2s-.1-.1-.2-.1-.1-.1-.2-.1-.2 0-.3-.1H1208c-.2 0-.4.1-.5.2l-9.4 9.4-18.9 18.9c-.4.4-.4 1 0 1.4l4.2 4.2c.4.4 1 .4 1.4 0 2.3-2.2 6.1-2.1 8.3.2 2.3 2.2 2.4 6 .2 8.3-.4.4-.4 1 0 1.4l4.2 4.2c.2.2.5.3.7.3s.5-.1.7-.3l14.8-14.8c.2 0 .3-.1.4-.2l4.2-4.2c.1-.1.1-.2.2-.3l8.7-8.7c.2-.2.3-.5.3-.8.1-.1 0-.4-.2-.6zm-19-16.2l2.9 2.9c-2.3 3.1-2 7.6.8 10.3 2.8 2.8 7.2 3.1 10.4.9l2.8 2.8-7.5 7.5-16.9-16.9 7.5-7.5zm-9.4 9.4l16.8 16.9-2.3 2.3-16.9-16.9 2.4-2.3zm-.6 34.4l-2.8-2.8c2.3-3.1 2-7.6-.8-10.3-2.8-2.8-7.2-3.1-10.4-.9l-2.8-2.8 9.8-9.8c0 .1.1.2.2.3l1.4 1.4c.2.2.5.3.7.3s.5-.1.7-.3c.4-.4.4-1 0-1.4l-1.4-1.4c-.1-.1-.2-.1-.3-.2l2.6-2.6 16.9 16.9-2.6 2.6c0-.2-.1-.3-.2-.4l-1.4-1.4c-.4-.4-1-.4-1.4 0s-.4 1 0 1.4l1.4 1.4c.1.1.3.2.4.2l-10 9.8z"></path><path fill="#9F3FE5" d="M1213.2-1533.3c6.1 0 11 4.9 11 11s-4.9 11-11 11-11-4.9-11-11 4.9-11 11-11z"></path><path fill="#FFF" d="M1213.2-1510.3c-6.6 0-12-5.4-12-12 0-3.2 1.2-6.2 3.5-8.5s5.3-3.5 8.5-3.5h.1c6.6 0 12 5.4 12 12s-5.5 12-12.1 12zm0-23v1c-2.7 0-5.2 1.1-7.1 2.9-1.9 1.9-2.9 4.4-2.9 7.1 0 5.5 4.5 10 10 10s10-4.5 10-10-4.5-10-10-10v-1z"></path><path fill="#FFF" d="M1212.4-1517.6c-.2 0-.4-.1-.6-.2l-2.9-2.3c-.4-.3-.5-1-.2-1.4.3-.4 1-.5 1.4-.2l2.1 1.7 4.1-5.3c.3-.4 1-.5 1.4-.2.4.3.5 1 .2 1.4l-4.7 6.1c-.2.2-.4.3-.7.4h-.1z"></path></g></svg>
    30          <p class="title"><?php echo __('Answered', 'nirweb-support') ?></p>
    31          <p class="number c-purple"><?php nirweb_ticket_count_answered_ticket_user_fr ()?></p>
    32          </div>
    33          <div class="col_box_status_ticket_wpyar" id="all">
    34          <svg id="svg_total-ticket" viewBox="0 0 48.4 48.4" style="width: 50px"><g transform="translate(-2300 -319)"><path fill="#FEA000" d="M2318.241 335.827l3.748-3.747 16.475 16.475-3.748 3.748z"></path><path fill="#4D4D4D" d="M2326.4 352.4c-.3 0-.5-.1-.7-.3l-2.4-2.4c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l2.4 2.4c.4.4.4 1 0 1.4-.2.2-.5.3-.7.3zm-4.9-4.9c-.3 0-.5-.1-.7-.3l-2.4-2.4c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l2.4 2.4c.4.4.4 1 0 1.4-.1.2-.4.3-.7.3z"></path><path fill="#E6E6E6" d="M2338.4 348.5l9-9-3.8-3.8c-2.4 2.5-6.4 2.5-8.9.1-2.4-2.5-2.4-6.5.1-8.9l-3.8-3.8-9 9 16.4 16.4z"></path><path fill="#4D4D4D" d="M2348.4 339.5c0-.1 0-.3-.1-.4 0-.1-.1-.2-.2-.3l-3.8-3.8c-.2-.2-.4-.3-.7-.3-.3 0-.5.1-.7.3-.5.5-1.1.9-1.7 1.2h-.2c-.3.1-.5.2-.8.2-.3.1-.7.1-1 .1-1.4 0-2.7-.5-3.7-1.5l-.1-.1c-1-1-1.5-2.4-1.5-3.7 0-1.3.6-2.7 1.6-3.7.2-.2.3-.4.3-.7v-.1c0-.3-.1-.5-.3-.7l-3.8-3.8c-.4-.4-1-.4-1.4 0l-27 27c-.4.4-.4 1 0 1.4l3.8 3.8c.2.2.4.3.7.3.3 0 .5-.1.7-.3 2-2.1 5.4-2.1 7.5-.1 2 2.1 2 5.4-.1 7.5-.2.2-.3.4-.3.7 0 .3.1.5.3.7l3.8 3.8c.2.2.5.3.7.3.3 0 .5-.1.7-.3l14-13.9c.1 0 .3-.1.4-.2l3.7-3.7c.1-.1.1-.2.2-.2l8.6-8.6.1-.1c.1-.1.2-.2.2-.3.1-.2.1-.3.1-.5zm-14.4-3c.8.8 1.8 1.3 2.8 1.7.1 0 .3.1.4.1.2 0 .3.1.5.1.3.1.6.1.9.1h1c.2 0 .4 0 .6-.1.3 0 .5-.1.8-.2.1 0 .2-.1.4-.1.3-.1.7-.2 1-.4.1 0 .1 0 .2-.1.4-.2.7-.4 1.1-.7l1.2 1.2 1.2 1.2-7.5 7.5-15-15 7.5-7.5 2.4 2.4c-1.1 1.4-1.6 3.1-1.5 4.8 0 2 .7 3.7 2 5zm-12-3l15 15-2.3 2.3-15-15 2.3-2.3zm-1.6 31.5l-2.4-2.4c2.2-2.8 2-6.9-.6-9.6-2.6-2.6-6.7-2.7-9.6-.6l-2.4-2.4 9.1-9.1v.1l1.4 1.4c.2.2.5.3.7.3s.5-.1.7-.3c.4-.4.4-1 0-1.4l-1.4-1.4h-.1l2.3-2.3 15 15-2.3 2.3-1.4-1.4c-.4-.4-1-.4-1.4 0s-.4 1 0 1.4l1.4 1.4-9 9zM2301.4 347.3c-.3 0-.5-.1-.7-.3-.4-.4-.4-1 0-1.4l25.4-25.9c.4-.4 1-.4 1.4 0 .4.4.4 1 0 1.4l-25.4 25.9c-.2.2-.4.3-.7.3z"></path></g></svg>
    35          <p class="title"><?php echo __('Total', 'nirweb-support') ?></p>
    36          <p class="number c-org"><?php nirweb_ticket_count_all_ticket_user_fr ()?></p>
     8<div class="nirweb_ticket_base wpyar-ticket">
     9    <h3 class="tite_status_tickets_wpyar"><?php echo esc_html__('Ticket status', 'nirweb-support') ?></h3>
     10    <div class="row_status">
     11        <div class="col_box_status_ticket_wpyar" id="open">
     12            <svg id="svg_open-ticket" viewBox="0 0 48.6 48.6" style="width: 50px">
     13                <path fill="#FFF"
     14                      d="M17.5 14.2l2.4-2.4c5.6 5.6 11.2 11.3 16.8 16.9L34.4 31c-5.6-5.5-11.3-11.2-16.9-16.8z"></path>
     15                <path fill="#E6E6E6"
     16                      d="M38.2 28.8l9.4-9.4-4.2-4.2c-2.7 2.6-7.1 2.5-9.7-.2-2.7-2.6-2.8-7-.2-9.7L29.3 1l-9.4 9.4 18.3 18.4z"></path>
     17                <path fill="#4D4D4D"
     18                      d="M25.3 32.3c-.3 0-.5-.1-.7-.3l-2.7-2.7c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l2.7 2.7c.4.4.4 1 0 1.4-.2.2-.5.3-.7.3zm-5.4-5.4c-.3 0-.5-.1-.7-.3l-2.7-2.7c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l2.7 2.7c.4.4.4 1 0 1.4-.2.2-.5.3-.7.3z"></path>
     19                <path fill="#4D4D4D"
     20                      d="M48.3 18.6l-4.2-4.2c-.4-.4-1-.4-1.4 0-2.3 2.2-6 2.1-8.2-.2-2.3-2.2-2.4-6-.2-8.3.4-.4.4-1 0-1.4L30 .3l-.2-.1-.2-.1-.2-.1H29.1c-.2 0-.4.1-.5.2l-9.4 9.4-18.9 19c-.4.4-.4 1 0 1.4l4.2 4.2c.4.4 1 .4 1.4 0 2.3-2.2 6.1-2.1 8.3.2 2.3 2.2 2.4 6 .2 8.3-.4.4-.4 1 0 1.4l4.2 4.2c.2.2.5.3.7.3s.5-.1.7-.3l14.8-14.8c.2 0 .3-.1.4-.2l4.2-4.2c.1-.1.1-.2.2-.3l8.7-8.7c.2-.2.3-.5.3-.8 0-.2-.1-.5-.3-.7zm-19-16.2l2.9 2.9c-2.3 3.1-2 7.6.8 10.3 2.8 2.8 7.2 3.1 10.4.9l2.8 2.8-7.5 7.5L21.8 10l7.5-7.6zm-9.4 9.4l16.8 16.9-2.3 2.3-16.9-16.8 2.4-2.4zm-.6 34.4l-2.8-2.8c2.3-3.1 2-7.6-.8-10.3-2.8-2.8-7.2-3.1-10.4-.9l-2.8-2.8 9.8-9.8c0 .1.1.2.2.3l1.4 1.4c.2.2.5.3.7.3s.5-.1.7-.3c.4-.4.4-1 0-1.4l-1.4-1.4c-.1-.1-.2-.1-.3-.2l2.6-2.6L33 32.5l-2.6 2.6c0-.2-.1-.3-.2-.4l-1.4-1.4c-.4-.4-1-.4-1.4 0s-.4 1 0 1.4l1.4 1.4c.1.1.3.2.4.2l-9.9 9.9z"></path>
     21                <circle fill="#FF1A1A" cx="35.2" cy="35.7" r="9.9"></circle>
     22                <path fill="#FFF"
     23                      d="M35.2 47.7c-6.6 0-12-5.4-12-12s5.4-12 12-12 12 5.4 12 12-5.4 12-12 12zm0-22c-5.5 0-10 4.5-10 10s4.5 10 10 10 10-4.5 10-10-4.5-10-10-10z"></path>
     24                <path fill="#FFF"
     25                      d="M38.8 40.5h-6c-.6 0-1-.4-1-1s.4-1 1-1h5v-5h-5c-.6 0-1-.4-1-1s.4-1 1-1h6c.6 0 1 .4 1 1v7c0 .6-.4 1-1 1z"></path>
     26            </svg>
     27            <p class="title"><?php echo esc_html__('Open', 'nirweb-support') ?></p>
     28            <p class="number c-red">
     29                <?php nirweb_ticket_count_new_ticket_user_fr() ?>
     30            </p>
    3731        </div>
    38      </div>
    39         <div class="head_wpyar_tickt">
    40             <h3><?php echo __('List of tickets', 'nirweb-support') ?></h3>
    41             <?php if(is_plugin_active( 'wpyar_panel/wpyar_panel.php' )){ ?>
    42                 <a class=" wpyar-ticket" href="?endp=new-ticket"><?php echo __('New Ticket', 'nirweb-support') ?></a>
     32        <div class="col_box_status_ticket_wpyar" id="inprogress">
     33            <svg id="svg_doing-ticket" viewBox="0 0 48.6 48.6" style="width: 50px">
     34                <g transform="translate(-1031 1558)">
     35                    <path fill="#FFF" d="M1047.103-1543.742l4.242-4.242 18.385 18.384-4.243 4.243z"></path>
     36                    <path fill="#4D4D4D"
     37                          d="M1056.3-1525.7c-.3 0-.5-.1-.7-.3l-2.7-2.7c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l2.7 2.7c.4.4.4 1 0 1.4-.2.2-.5.3-.7.3zm-5.4-5.4c-.3 0-.5-.1-.7-.3l-2.7-2.7c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l2.7 2.7c.4.4.4 1 0 1.4-.2.2-.5.3-.7.3z"></path>
     38                    <path fill="#E6E6E6"
     39                          d="M1069.2-1529.2l9.4-9.4-4.2-4.2c-2.7 2.6-7.1 2.5-9.7-.2-2.7-2.6-2.8-7-.2-9.7l-4.2-4.3-9.4 9.4 18.3 18.4z"></path>
     40                    <path fill="#4D4D4D"
     41                          d="M1079.3-1539.4l-4.2-4.2c-.4-.4-1-.4-1.4 0-2.3 2.2-6 2.1-8.2-.2-2.3-2.2-2.4-6-.2-8.3.4-.4.4-1 0-1.4l-4.3-4.2s-.1-.1-.2-.1-.1-.1-.2-.1-.2 0-.3-.1H1060c-.2 0-.4.1-.5.2l-9.4 9.4-18.9 18.9c-.4.4-.4 1 0 1.4l4.2 4.2c.4.4 1 .4 1.4 0 2.3-2.2 6.1-2.1 8.3.2 2.3 2.2 2.4 6 .2 8.3-.4.4-.4 1 0 1.4l4.2 4.2c.2.2.5.3.7.3s.5-.1.7-.3l14.8-14.8c.2 0 .3-.1.4-.2l4.2-4.2c.1-.1.1-.2.2-.3l8.7-8.7c.2-.2.3-.5.3-.8.1-.1 0-.4-.2-.6zm-19-16.2l2.9 2.9c-2.3 3.1-2 7.6.8 10.3 2.8 2.8 7.2 3.1 10.4.9l2.8 2.8-7.5 7.5-16.9-16.9 7.5-7.5zm-9.4 9.4l16.8 16.9-2.3 2.3-16.9-16.9 2.4-2.3zm-.6 34.4l-2.8-2.8c2.3-3.1 2-7.6-.8-10.3-2.8-2.8-7.2-3.1-10.4-.9l-2.8-2.8 9.8-9.8c0 .1.1.2.2.3l1.4 1.4c.2.2.5.3.7.3s.5-.1.7-.3c.4-.4.4-1 0-1.4l-1.4-1.4c-.1-.1-.2-.1-.3-.2l2.6-2.6 16.9 16.9-2.6 2.6c0-.2-.1-.3-.2-.4l-1.4-1.4c-.4-.4-1-.4-1.4 0s-.4 1 0 1.4l1.4 1.4c.1.1.3.2.4.2l-10 9.8z"></path>
     42                    <circle fill="#2096FC" cx="1065.2" cy="-1522.3" r="11"></circle>
     43                    <path fill="#FFF"
     44                          d="M1065.2-1510.3c-6.6 0-12-5.4-12-12s5.4-12 12-12 12 5.4 12 12-5.4 12-12 12zm0-22c-5.5 0-10 4.5-10 10s4.5 10 10 10 10-4.5 10-10-4.5-10-10-10z"></path>
     45                    <path fill="#FFF"
     46                          d="M1071.3-1520.7h-1.1c-.6 0-1-.4-1-1s.4-1 1-1h1.1c.6 0 1 .4 1 1s-.4 1-1 1zM1060.4-1520.7h-1.1c-.6 0-1-.4-1-1s.4-1 1-1h1.1c.6 0 1 .4 1 1s-.4 1-1 1zM1065.9-1520.7h-1.1c-.6 0-1-.4-1-1s.4-1 1-1h1.1c.6 0 1 .4 1 1s-.4 1-1 1z"></path>
     47                </g>
     48            </svg>
     49            <p class="title"><?php echo esc_html__('Inprogress', 'nirweb-support') ?></p>
     50            <p class="number c-blue"><?php nirweb_ticket_count_process_ticket_user_fr() ?></p>
     51        </div>
     52        <div class="col_box_status_ticket_wpyar" id="closed">
     53            <svg id="svg_close-ticket" viewBox="0 0 48.6 48.6" style="width: 50px">
     54                <g transform="translate(-905 1558)">
     55                    <path fill="#FFF" d="M921.104-1543.743l4.242-4.242 18.385 18.384-4.243 4.243z"></path>
     56                    <path fill="#E6E6E6"
     57                          d="M943.2-1529.2l9.4-9.4-4.2-4.2c-2.7 2.6-7.1 2.5-9.7-.2-2.7-2.6-2.8-7-.2-9.7l-4.2-4.3-9.4 9.4 18.3 18.4z"></path>
     58                    <path fill="#4D4D4D"
     59                          d="M930.3-1525.7c-.3 0-.5-.1-.7-.3l-2.7-2.7c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l2.7 2.7c.4.4.4 1 0 1.4-.2.2-.5.3-.7.3zm-5.4-5.4c-.3 0-.5-.1-.7-.3l-2.7-2.7c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l2.7 2.7c.4.4.4 1 0 1.4-.2.2-.5.3-.7.3z"></path>
     60                    <path fill="#4D4D4D"
     61                          d="M953.3-1539.4l-4.2-4.2c-.4-.4-1-.4-1.4 0-2.3 2.2-6 2.1-8.2-.2-2.3-2.2-2.4-6-.2-8.3.4-.4.4-1 0-1.4l-4.3-4.2s-.1-.1-.2-.1-.1-.1-.2-.1-.2 0-.3-.1H934c-.2 0-.4.1-.5.2l-9.4 9.4-18.9 18.9c-.4.4-.4 1 0 1.4l4.2 4.2c.4.4 1 .4 1.4 0 2.3-2.2 6.1-2.1 8.3.2 2.3 2.2 2.4 6 .2 8.3-.4.4-.4 1 0 1.4l4.2 4.2c.2.2.5.3.7.3s.5-.1.7-.3l14.8-14.8c.2 0 .3-.1.4-.2l4.2-4.2c.1-.1.1-.2.2-.3l8.7-8.7c.2-.2.3-.5.3-.8.1-.1 0-.4-.2-.6zm-19-16.2l2.9 2.9c-2.3 3.1-2 7.6.8 10.3 2.8 2.8 7.2 3.1 10.4.9l2.8 2.8-7.5 7.5-16.9-16.9 7.5-7.5zm-9.4 9.4l16.8 16.9-2.3 2.3-16.9-16.9 2.4-2.3zm-.6 34.4l-2.8-2.8c2.3-3.1 2-7.6-.8-10.3-2.8-2.8-7.2-3.1-10.4-.9l-2.8-2.8 9.8-9.8c0 .1.1.2.2.3l1.4 1.4c.2.2.5.3.7.3s.5-.1.7-.3c.4-.4.4-1 0-1.4l-1.4-1.4c-.1-.1-.2-.1-.3-.2l2.6-2.6 16.9 16.9-2.6 2.6c0-.2-.1-.3-.2-.4l-1.4-1.4c-.4-.4-1-.4-1.4 0s-.4 1 0 1.4l1.4 1.4c.1.1.3.2.4.2l-10 9.8z"></path>
     62                    <circle fill="#2FBE35" cx="940.2" cy="-1522.3" r="11"></circle>
     63                    <path fill="#FFF"
     64                          d="M940.2-1510.3c-6.6 0-12-5.4-12-12s5.4-12 12-12 12 5.4 12 12-5.4 12-12 12zm0-22c-5.5 0-10 4.5-10 10s4.5 10 10 10 10-4.5 10-10-4.5-10-10-10z"></path>
     65                    <path fill="#FFF"
     66                          d="M943.8-1517.5h-7c-.6 0-1-.4-1-1v-7c0-.6.4-1 1-1h7c.6 0 1 .4 1 1v7c0 .6-.4 1-1 1zm-6-2h5v-5h-5v5z"></path>
     67                </g>
     68            </svg>
     69            <p class="title"><?php echo esc_html__('Closed', 'nirweb-support') ?></p>
     70            <p class="number c-green"><?php nirweb_ticket_count_closed_ticket_user_fr() ?></p>
     71        </div>
     72        <div class="col_box_status_ticket_wpyar" id="answered">
     73            <svg id="svg_answered-ticket" viewBox="0 0 48.6 48.6" style="width: 50px">
     74                <g transform="translate(-1179 1558)">
     75                    <path fill="#FFF" d="M1195.102-1543.74l4.242-4.243 18.385 18.384-4.243 4.243z"></path>
     76                    <path fill="#E6E6E6"
     77                          d="M1217.2-1529.2l9.4-9.4-4.2-4.2c-2.7 2.6-7.1 2.5-9.7-.2-2.7-2.6-2.8-7-.2-9.7l-4.2-4.3-9.4 9.4 18.3 18.4z"></path>
     78                    <path fill="#4D4D4D"
     79                          d="M1204.3-1525.7c-.3 0-.5-.1-.7-.3l-2.7-2.7c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l2.7 2.7c.4.4.4 1 0 1.4-.2.2-.5.3-.7.3zm-5.4-5.4c-.3 0-.5-.1-.7-.3l-2.7-2.7c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l2.7 2.7c.4.4.4 1 0 1.4-.2.2-.5.3-.7.3z"></path>
     80                    <path fill="#4D4D4D"
     81                          d="M1227.3-1539.4l-4.2-4.2c-.4-.4-1-.4-1.4 0-2.3 2.2-6 2.1-8.2-.2-2.3-2.2-2.4-6-.2-8.3.4-.4.4-1 0-1.4l-4.3-4.2s-.1-.1-.2-.1-.1-.1-.2-.1-.2 0-.3-.1H1208c-.2 0-.4.1-.5.2l-9.4 9.4-18.9 18.9c-.4.4-.4 1 0 1.4l4.2 4.2c.4.4 1 .4 1.4 0 2.3-2.2 6.1-2.1 8.3.2 2.3 2.2 2.4 6 .2 8.3-.4.4-.4 1 0 1.4l4.2 4.2c.2.2.5.3.7.3s.5-.1.7-.3l14.8-14.8c.2 0 .3-.1.4-.2l4.2-4.2c.1-.1.1-.2.2-.3l8.7-8.7c.2-.2.3-.5.3-.8.1-.1 0-.4-.2-.6zm-19-16.2l2.9 2.9c-2.3 3.1-2 7.6.8 10.3 2.8 2.8 7.2 3.1 10.4.9l2.8 2.8-7.5 7.5-16.9-16.9 7.5-7.5zm-9.4 9.4l16.8 16.9-2.3 2.3-16.9-16.9 2.4-2.3zm-.6 34.4l-2.8-2.8c2.3-3.1 2-7.6-.8-10.3-2.8-2.8-7.2-3.1-10.4-.9l-2.8-2.8 9.8-9.8c0 .1.1.2.2.3l1.4 1.4c.2.2.5.3.7.3s.5-.1.7-.3c.4-.4.4-1 0-1.4l-1.4-1.4c-.1-.1-.2-.1-.3-.2l2.6-2.6 16.9 16.9-2.6 2.6c0-.2-.1-.3-.2-.4l-1.4-1.4c-.4-.4-1-.4-1.4 0s-.4 1 0 1.4l1.4 1.4c.1.1.3.2.4.2l-10 9.8z"></path>
     82                    <path fill="#9F3FE5"
     83                          d="M1213.2-1533.3c6.1 0 11 4.9 11 11s-4.9 11-11 11-11-4.9-11-11 4.9-11 11-11z"></path>
     84                    <path fill="#FFF"
     85                          d="M1213.2-1510.3c-6.6 0-12-5.4-12-12 0-3.2 1.2-6.2 3.5-8.5s5.3-3.5 8.5-3.5h.1c6.6 0 12 5.4 12 12s-5.5 12-12.1 12zm0-23v1c-2.7 0-5.2 1.1-7.1 2.9-1.9 1.9-2.9 4.4-2.9 7.1 0 5.5 4.5 10 10 10s10-4.5 10-10-4.5-10-10-10v-1z"></path>
     86                    <path fill="#FFF"
     87                          d="M1212.4-1517.6c-.2 0-.4-.1-.6-.2l-2.9-2.3c-.4-.3-.5-1-.2-1.4.3-.4 1-.5 1.4-.2l2.1 1.7 4.1-5.3c.3-.4 1-.5 1.4-.2.4.3.5 1 .2 1.4l-4.7 6.1c-.2.2-.4.3-.7.4h-.1z"></path>
     88                </g>
     89            </svg>
     90            <p class="title"><?php echo esc_html__('Answered', 'nirweb-support') ?></p>
     91            <p class="number c-purple"><?php nirweb_ticket_count_answered_ticket_user_fr() ?></p>
     92        </div>
     93        <div class="col_box_status_ticket_wpyar" id="all">
     94            <svg id="svg_total-ticket" viewBox="0 0 48.4 48.4" style="width: 50px">
     95                <g transform="translate(-2300 -319)">
     96                    <path fill="#FEA000" d="M2318.241 335.827l3.748-3.747 16.475 16.475-3.748 3.748z"></path>
     97                    <path fill="#4D4D4D"
     98                          d="M2326.4 352.4c-.3 0-.5-.1-.7-.3l-2.4-2.4c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l2.4 2.4c.4.4.4 1 0 1.4-.2.2-.5.3-.7.3zm-4.9-4.9c-.3 0-.5-.1-.7-.3l-2.4-2.4c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l2.4 2.4c.4.4.4 1 0 1.4-.1.2-.4.3-.7.3z"></path>
     99                    <path fill="#E6E6E6"
     100                          d="M2338.4 348.5l9-9-3.8-3.8c-2.4 2.5-6.4 2.5-8.9.1-2.4-2.5-2.4-6.5.1-8.9l-3.8-3.8-9 9 16.4 16.4z"></path>
     101                    <path fill="#4D4D4D"
     102                          d="M2348.4 339.5c0-.1 0-.3-.1-.4 0-.1-.1-.2-.2-.3l-3.8-3.8c-.2-.2-.4-.3-.7-.3-.3 0-.5.1-.7.3-.5.5-1.1.9-1.7 1.2h-.2c-.3.1-.5.2-.8.2-.3.1-.7.1-1 .1-1.4 0-2.7-.5-3.7-1.5l-.1-.1c-1-1-1.5-2.4-1.5-3.7 0-1.3.6-2.7 1.6-3.7.2-.2.3-.4.3-.7v-.1c0-.3-.1-.5-.3-.7l-3.8-3.8c-.4-.4-1-.4-1.4 0l-27 27c-.4.4-.4 1 0 1.4l3.8 3.8c.2.2.4.3.7.3.3 0 .5-.1.7-.3 2-2.1 5.4-2.1 7.5-.1 2 2.1 2 5.4-.1 7.5-.2.2-.3.4-.3.7 0 .3.1.5.3.7l3.8 3.8c.2.2.5.3.7.3.3 0 .5-.1.7-.3l14-13.9c.1 0 .3-.1.4-.2l3.7-3.7c.1-.1.1-.2.2-.2l8.6-8.6.1-.1c.1-.1.2-.2.2-.3.1-.2.1-.3.1-.5zm-14.4-3c.8.8 1.8 1.3 2.8 1.7.1 0 .3.1.4.1.2 0 .3.1.5.1.3.1.6.1.9.1h1c.2 0 .4 0 .6-.1.3 0 .5-.1.8-.2.1 0 .2-.1.4-.1.3-.1.7-.2 1-.4.1 0 .1 0 .2-.1.4-.2.7-.4 1.1-.7l1.2 1.2 1.2 1.2-7.5 7.5-15-15 7.5-7.5 2.4 2.4c-1.1 1.4-1.6 3.1-1.5 4.8 0 2 .7 3.7 2 5zm-12-3l15 15-2.3 2.3-15-15 2.3-2.3zm-1.6 31.5l-2.4-2.4c2.2-2.8 2-6.9-.6-9.6-2.6-2.6-6.7-2.7-9.6-.6l-2.4-2.4 9.1-9.1v.1l1.4 1.4c.2.2.5.3.7.3s.5-.1.7-.3c.4-.4.4-1 0-1.4l-1.4-1.4h-.1l2.3-2.3 15 15-2.3 2.3-1.4-1.4c-.4-.4-1-.4-1.4 0s-.4 1 0 1.4l1.4 1.4-9 9zM2301.4 347.3c-.3 0-.5-.1-.7-.3-.4-.4-.4-1 0-1.4l25.4-25.9c.4-.4 1-.4 1.4 0 .4.4.4 1 0 1.4l-25.4 25.9c-.2.2-.4.3-.7.3z"></path>
     103                </g>
     104            </svg>
     105            <p class="title"><?php echo esc_html__('Total', 'nirweb-support') ?></p>
     106            <p class="number c-org"><?php nirweb_ticket_count_all_ticket_user_fr() ?></p>
     107        </div>
     108    </div>
     109    <div class="head_wpyar_tickt">
     110        <h3><?php echo esc_html__('List of tickets', 'nirweb-support') ?></h3>
     111        <?php if (is_plugin_active('wpyar_panel/wpyar_panel.php')) { ?>
     112            <a class=" wpyar-ticket"
     113               href="?endp=new-ticket"><?php echo esc_html__('New Ticket', 'nirweb-support') ?></a>
    43114
    44            <?php }else{ ?>
    45      <a class=" wpyar-ticket" href="?action=new"><?php echo __('New Ticket', 'nirweb-support') ?></a>
     115        <?php } else { ?>
     116            <a class=" wpyar-ticket" href="?action=new"><?php echo esc_html__('New Ticket', 'nirweb-support') ?></a>
    46117
    47             <?php }?>
     118        <?php } ?>
     119    </div>
     120    <di class="ajax_result">
     121        <div class="base_list_ticket_uwpyar">
     122            <ul class="ul_list_ticket_uwpyar">
     123                <?php foreach ($list_ticket[0] as $row) : ?>
     124                    <li>
     125                        <a href="?action=reply&id=<?php echo esc_html($row->ticket_id) ?>"
     126                           class="<?php
     127                           if ($row->status == 1) {
     128                               echo 'arbitrator_wpyaru-red';
     129                           }
     130                           if ($row->status == 2) {
     131                               echo 'arbitrator_wpyaru-blue';
     132                           }
     133                           if ($row->status == 3) {
     134                               echo 'arbitrator_wpyaru-purple';
     135                           }
     136                           if ($row->status == 4) {
     137                               echo 'arbitrator_wpyaru-green';
     138                           } ?>">
     139                            <div class="info_user_time_wpyaru">
     140                                <?php echo get_avatar($row->sender_id, 130); ?>
     141                                <div class="icon_nameUser">
     142                                    <svg id="svg_username" viewBox="0 0 14.8 17.1" style="width: 17px">
     143                                        <path d="M10.9 7.3c.6-.8.9-1.7.9-2.8C11.8 2 9.8 0 7.3 0S2.8 2 2.8 4.5c0 1.1.4 2 1 2.8C1.5 8.6 0 11.1 0 13.7c0 2.3 3.7 3.4 7.4 3.4s7.4-1 7.4-3.3c0-2.7-1.5-5.2-3.9-6.5zM7.3 1c2 0 3.5 1.6 3.5 3.5 0 2-1.6 3.5-3.5 3.5-2 0-3.5-1.6-3.5-3.5S5.4 1 7.3 1zm.1 15.1c-3.1 0-6.4-.8-6.4-2.4 0-2.3 1.3-4.5 3.3-5.6.9.6 2 1 3.1 1s2.2-.3 3-1c2 1.1 3.3 3.3 3.3 5.6.1 1.6-3.2 2.4-6.3 2.4z"></path>
     144                                    </svg>
     145                                    <?php echo esc_html($user->display_name); ?>
     146                                </div>
     147                                <time>
     148                                    <?php
     149                                    $orig_time = strtotime($row->time_update);
     150                                    $date = strtotime($row->date_qustion);
     151                                    echo esc_html(wp_date('d F', $date)) ?>
     152
     153                                </time>
     154                            </div>
     155                            <div class="title_time_ticket">
     156                                <p><?php echo esc_html($row->subject) ?></p>
     157                                <time>
     158                                    <?php
     159                                    $orig_time = strtotime($row->time_update);
     160                                    ago_ticket_nirweb($orig_time) ?>
     161                                </time>
     162                            </div>
     163                        </a>
     164                    </li>
     165                <?php endforeach ?>
     166            </ul>
    48167        </div>
    49 <di class="ajax_result">
    50 <div class="base_list_ticket_uwpyar">
    51     <ul class="ul_list_ticket_uwpyar">
    52     <?php  foreach ($list_ticket[0] as $row) :  ?>
    53         <li>
    54             <a href="?action=reply&id=<?php echo $row->ticket_id ?>" 
    55             class="<?php
    56                     if ($row->status  == 1) {
    57                         echo 'arbitrator_wpyaru-red';
    58                     }
    59                     if ($row->status  == 2) {
    60                         echo 'arbitrator_wpyaru-blue';
    61                     }
    62                     if ($row->status  == 3) {
    63                         echo 'arbitrator_wpyaru-purple';
    64                     }
    65                     if ($row->status  == 4) {
    66                         echo 'arbitrator_wpyaru-green';
    67                     }  ?>" >
    68                 <div class="info_user_time_wpyaru">
    69                 <?php   echo get_avatar( $row->sender_id, 130); ?>
    70                     <div class="icon_nameUser">
    71                     <svg id="svg_username" viewBox="0 0 14.8 17.1" style="width: 17px"><path d="M10.9 7.3c.6-.8.9-1.7.9-2.8C11.8 2 9.8 0 7.3 0S2.8 2 2.8 4.5c0 1.1.4 2 1 2.8C1.5 8.6 0 11.1 0 13.7c0 2.3 3.7 3.4 7.4 3.4s7.4-1 7.4-3.3c0-2.7-1.5-5.2-3.9-6.5zM7.3 1c2 0 3.5 1.6 3.5 3.5 0 2-1.6 3.5-3.5 3.5-2 0-3.5-1.6-3.5-3.5S5.4 1 7.3 1zm.1 15.1c-3.1 0-6.4-.8-6.4-2.4 0-2.3 1.3-4.5 3.3-5.6.9.6 2 1 3.1 1s2.2-.3 3-1c2 1.1 3.3 3.3 3.3 5.6.1 1.6-3.2 2.4-6.3 2.4z"></path></svg>
    72                     <?php echo esc_html($user->display_name); ?>
    73                     </div>
    74                     <time>
    75                     <?php
    76                         $orig_time = strtotime( $row->time_update);
    77                         $date = strtotime($row->date_qustion);
    78                          echo $date = wp_date('d F', $date); ?>
    79                      
    80                             </time>
    81                 </div>
    82                 <div class="title_time_ticket">
    83                     <p><?php echo esc_html($row->subject) ?></p>
    84                     <time>
    85                         <?php
    86                         $orig_time = strtotime( $row->time_update);
    87                        ago_ticket_nirweb($orig_time) ?>
    88                     </time>
    89                 </div>
    90             </a>
    91         </li>
    92         <?php endforeach ?>
    93     </ul>
     168        <div class="pagination_ticket_index">
     169            <?php echo esc_html($list_ticket[1]) ?>
     170        </div>
     171    </di>
    94172</div>
    95     <div class="pagination_ticket_index">
    96         <?php echo esc_html($list_ticket[1]) ?>
    97     </div>
    98 </di>
    99  </div>
  • nirweb-support/trunk/inc/user/themes/new_ticket.php

    r2707344 r2708596  
    88    <div class="top_box_send_ticket">
    99        <div class="head_send_ticket_wpyar">
    10             <h4 class="wpyar-ticket"><?php echo __('New Ticket', 'nirweb-support') ?></h4>
     10            <h4 class="wpyar-ticket"><?php echo esc_html__('New Ticket', 'nirweb-support') ?></h4>
    1111            <?php
    1212            if (is_plugin_active('wpyar_panel/wpyar_panel.php')) {
     
    1414            } else {
    1515                if (wpyar_ticket['select_page_ticket']) {
    16                     $page = esc_url(get_page_link(wpyar_ticket['select_page_ticket']));
     16                    $page = esc_url_raw(get_page_link(wpyar_ticket['select_page_ticket']));
    1717                } else {
    1818                    $page = get_permalink(get_option('woocommerce_myaccount_page_id')) . 'wpyar-ticket/';
     
    2020            }
    2121            ?>
    22             <a href=" <?php echo $page; ?> "
    23                class="btn btn_back_wpyt"><?php echo __('Back To List Tickets', 'nirweb-support') ?></a>
     22            <a href=" <?php echo esc_url_raw($page); ?> "
     23               class="btn btn_back_wpyt"><?php echo esc_html__('Back To List Tickets', 'nirweb-support') ?></a>
    2424        </div>
    2525        <div class="content_ticket_send">
     
    3535                            <span class="title_faq_wpyar"><?php echo esc_html($value->question) ?></span>
    3636                        </p>
    37                         <div class="content_faq_wpyar"><?php echo $value->answer ?> </div>
     37                        <div class="content_faq_wpyar"><?php echo esc_html($value->answer) ?> </div>
    3838                    </li>
    3939                <?php endforeach; ?>
     
    4343            echo "style='display:none !important'";
    4444        } ?> >
    45             <span><?php echo __('I didn\'t find the answer to my question', 'nirweb-support') ?></span>
     45            <span><?php echo esc_html__('I didn\'t find the answer to my question', 'nirweb-support') ?></span>
    4646        </div>
    4747    </div>
     
    5555        <div class="row_nirweb_ticket_send">
    5656            <div class="w-50">
    57                 <label for="nirweb_ticket_frm_subject_send_ticket_user"><?php echo __('Enter subject please *', 'nirweb-support') ?></label>
    58                 <input type="text" id="nirweb_ticket_frm_subject_send_ticket_user"
    59                        name="nirweb_ticket_frm_subject_send_ticket_user">
     57                <label for="nirweb_ticket_frm_subject_send_ticket_user"><?php echo esc_html__('Enter subject please *', 'nirweb-support') ?></label>
     58                <input type="text" id="nirweb_ticket_frm_subject_send_ticket_user" name="nirweb_ticket_frm_subject_send_ticket_user">
    6059            </div>
    6160            <!-- DepartMent-->
    6261            <div class="w-50">
    6362                <div class="department_form_user_send">
    64                     <label for="nirweb_ticket_frm_department_send_ticket_user"><?php echo __('Select department please *', 'nirweb-support') ?></label>
     63                    <label for="nirweb_ticket_frm_department_send_ticket_user"><?php echo esc_html__('Select department please *', 'nirweb-support') ?></label>
    6564                    <div class="select_custom_wpyar">
    6665                        <div class="custom_input_wpyar_send_ticket" id="nirweb_ticket_frm_department_send_ticket_user"
    6766                             data-id="-1" data-user="0">
    68                             <?php echo __('Select department', 'nirweb-support') ?>
     67                            <?php echo esc_html__('Select department', 'nirweb-support') ?>
    6968                        </div>
    7069                        <i class="fal fa-angle-down"></i>
     
    8483        <div class="row_nirweb_ticket_send">
    8584            <div class="w-50">
    86                 <label for="nirweb_ticket_frm_priority_send_ticket_user"><?php echo __('Priority *', 'nirweb-support') ?></label>
     85                <label for="nirweb_ticket_frm_priority_send_ticket_user"><?php echo esc_html__('Priority *', 'nirweb-support') ?></label>
    8786                <div class="select_custom_wpyar">
    88                     <div class="custom_input_wpyar_send_ticket" id="nirweb_ticket_frm_priority_send_ticket_user"
    89                          data-id="-1">
    90                         <?php echo __('Select priority', 'nirweb-support') ?>
     87                    <div class="custom_input_wpyar_send_ticket" id="nirweb_ticket_frm_priority_send_ticket_user" data-id="-1">
     88                        <?php echo esc_html__('Select priority', 'nirweb-support') ?>
    9189                    </div>
    9290                    <i class="fal fa-angle-down"></i>
    9391                    <ul>
    94                         <li data-id="1"> <?php echo __('low', 'nirweb-support') ?></li>
    95                         <li data-id="2"> <?php echo __('normal', 'nirweb-support') ?></li>
    96                         <li data-id="3"> <?php echo __('necessary', 'nirweb-support') ?></li>
     92                        <li data-id="1"> <?php echo esc_html__('low', 'nirweb-support') ?></li>
     93                        <li data-id="2"> <?php echo esc_html__('normal', 'nirweb-support') ?></li>
     94                        <li data-id="3"> <?php echo esc_html__('necessary', 'nirweb-support') ?></li>
    9795                    </ul>
    9896                </div>
     
    10199                <?php if (is_plugin_active('woocommerce/woocommerce.php')){ ?>
    102100                    <label for="product_user_wpyar_tixket">
    103                         <?php echo __('Product', 'nirweb-support') ?>
     101                        <?php echo esc_html__('Product', 'nirweb-support') ?>
    104102                        <?php if (@wpyar_ticket['require_procut_user_wpyar'] == '1') {
    105103                            echo ' * ';
     
    108106                    <div class="select_custom_wpyar">
    109107                        <div class="custom_input_wpyar_send_ticket" id="product_user_wpyar_tixket" data-id="-1">
    110                             <?php echo __('Select Product', 'nirweb-support') ?>
     108                            <?php echo esc_html__('Select Product', 'nirweb-support') ?>
    111109                        </div>
    112110                        <i class="fal fa-angle-down"></i>
     
    128126                                        $product_name = $item->get_name();
    129127                                        ?>
    130                                         <li data-id="<?php echo $item['product_id'] ?>">
    131                                             <?php echo get_the_title( $item['product_id']) ?>
     128                                        <li data-id="<?php echo esc_html($item['product_id']) ?>">
     129                                            <?php echo esc_html(get_the_title( $item['product_id'])) ?>
    132130                                        </li>
    133131                                    <?php }
     
    137135                    </div>
    138136                <?php } else if (is_plugin_active('easy-digital-downloads/easy-digital-downloads.php')){ ?>
    139                 <label>        <?php echo __('Product', 'nirweb-support') ?></label>
     137                <label>        <?php echo esc_html__('Product', 'nirweb-support') ?></label>
    140138                <div class="select_custom_wpyar">
    141139                    <div class="custom_input_wpyar_send_ticket" id="product_user_wpyar_tixket" data-id="-1">
    142                         <?php echo __('Select Product', 'nirweb-support') ?>
     140                        <?php echo esc_html__('Select Product', 'nirweb-support') ?>
    143141                    </div>
    144142                    <i class="fal fa-angle-down"></i>
     
    156154        <div class="row_nirweb_ticket_send">
    157155            <div class="w-100">
    158                 <label><?php echo __('Enter Message', 'nirweb-support'); ?></label>
     156                <label><?php echo esc_html__('Enter Message', 'nirweb-support'); ?></label>
    159157                <textarea id="nirweb_ticket_frm_content_send_ticket_user"
    160158                          name="nirweb_ticket_frm_content_send_ticket_user"
    161                           placeholder="<?php echo __('Enter Message please', 'nirweb-support'); ?>"></textarea>
     159                          placeholder="<?php echo esc_html__('Enter Message please', 'nirweb-support'); ?>"></textarea>
    162160            </div>
    163161        </div>
     
    168166                    <span class="remove_file_by_user"><i class="fal fa-times-circle"></i></span>
    169167                    <i class="fal fa-arrow-up upicon" style="font-size: 30px;margin-bottom: 10px;"></i>
    170                     <span class="text_label_main_image"> <?php echo __('Attachment File', 'nirweb-support') ?></span>
     168                    <span class="text_label_main_image"> <?php echo esc_html__('Attachment File', 'nirweb-support') ?></span>
    171169                </label>
    172170                <input type="file" name="main_image" id="main_image"
     
    181179                    <div class="double-bounce2"></div>
    182180                </div>
    183                 <p><?php echo __('Send Request ...', 'nirweb-support') ?></p>
     181                <p><?php echo esc_html__('Send Request ...', 'nirweb-support') ?></p>
    184182            </div>
    185183
    186184            <button data-fileurl="" type="submit" class="btn btn-primary text-white"
    187185                    name="nirweb_ticket_frm_user_send_ticket" id="nirweb_ticket_frm_user_send_ticket">
    188                 <?php echo __('Send Ticket', 'nirweb-support') ?>
     186                <?php echo esc_html__('Send Ticket', 'nirweb-support') ?>
    189187            </button>
    190188            <p class="stasus_send_wpyt"></p>
    191189        </div>
    192190    </form>
    193     <?php $accsses_file = str_replace('.', '', trim(wpyar_ticket['mojaz_file_upload_user_wpyar']));
     191    <?php
     192    add_action('wp_footer',function (){
     193    $accsses_file = str_replace('.', '', esc_html(trim(wpyar_ticket['mojaz_file_upload_user_wpyar'])));
    194194    $accsses_file = explode(",", trim($accsses_file)); ?>
    195195    <!-- End form-->
     
    200200            switch (ext) {
    201201            <?php foreach ($accsses_file as $file):?>
    202                 case "<?php echo $file ?>":
     202                case "<?php echo esc_html($file) ?>":
    203203                    break;
    204204            <?php endforeach; ?>
     
    260260                            alert(wpyarticket.nvalid_file);
    261261                            jQuery('.base_loarder').css('display', 'none');
    262                             jQuery('.text_label_main_image').html('<?php echo __('Attachment File', 'nirweb-support') ?>');
     262                            jQuery('.text_label_main_image').html('<?php echo esc_html__('Attachment File', 'nirweb-support') ?>');
    263263                            return false;
    264264                        }
    265265                        jQuery('.base_loarder').css('display', 'none');
    266                         alert_success("<?php echo __('Send Ticket Success', 'nirweb-support') ?>");
     266                        alert_success("<?php echo esc_html__('Send Ticket Success', 'nirweb-support') ?>");
    267267                        setTimeout(() => {
    268268                            location.reload();
     
    284284            jQuery('.bg_alert__nirweb').hide();
    285285        })
    286 
    287 
    288286        jQuery('body').on('click', '.box_alert_nirweb', function (e) {
    289287            e.preventDefault();
     
    317315        }
    318316    </script>
     317    <?php })
     318        ?>
    319319</div>
  • nirweb-support/trunk/inc/user/themes/replay_ticket.php

    r2707344 r2708596  
    11<div class="nirweb_ticket_base">
    2 <?php
    3 $ticket_id = sanitize_text_field($_GET['id']);
    4 $user_tickets = array();
    5 include NIRWEB_SUPPORT_INC_USER_FUNCTIONS_TICKET . 'func_u_list_ticket.php';
    6 $ticket = nirweb_ticket_get_list_all_ticket_user();
    7  foreach ($ticket as $tts) {
    8     if (is_array($tts) || is_object($tts)) {
    9         foreach ($tts as $rs) {
    10             array_push($user_tickets, $rs->ticket_id);
     2    <?php
     3    $ticket_id = sanitize_text_field($_GET['id']);
     4    $user_tickets = array();
     5    include NIRWEB_SUPPORT_INC_USER_FUNCTIONS_TICKET . 'func_u_list_ticket.php';
     6    $ticket = nirweb_ticket_get_list_all_ticket_user();
     7    foreach ($ticket as $tts) {
     8        if (is_array($tts) || is_object($tts)) {
     9            foreach ($tts as $rs) {
     10                array_push($user_tickets, $rs->ticket_id);
     11            }
    1112        }
    1213    }
    13 }
    14 if (in_array($ticket_id, $user_tickets)) {
    15     include NIRWEB_SUPPORT_INC_ADMIN_FUNCTIONS_TICKET . 'func_status_and_priority.php';
    16     $info_ticket = nirweb_ticket_edit_ticket($ticket_id);
    17     include NIRWEB_SUPPORT_INC_ADMIN_FUNCTIONS_TICKET . 'func_list_answered.php';
    18     $info_answerd = nirweb_ticket_get_list_answerd(); ?>
    19     <div class="top_box_back_rep">
    20          <?php
    21         if(is_plugin_active('wpyar_panel/wpyar_panel.php' )){
    22             $page =slug_page.'?endp=nirweb-ticket';
    23         }else{
    24             if( wpyar_ticket['select_page_ticket']){
    25                $page = esc_url( get_page_link( wpyar_ticket['select_page_ticket'] ) );
    26             }else{
    27                $page = get_permalink( get_option('woocommerce_myaccount_page_id') ).'wpyar-ticket/';
     14    if (in_array($ticket_id, $user_tickets)) {
     15        include NIRWEB_SUPPORT_INC_ADMIN_FUNCTIONS_TICKET . 'func_status_and_priority.php';
     16        $info_ticket = nirweb_ticket_edit_ticket($ticket_id);
     17        include NIRWEB_SUPPORT_INC_ADMIN_FUNCTIONS_TICKET . 'func_list_answered.php';
     18        $info_answerd = nirweb_ticket_get_list_answerd(); ?>
     19        <div class="top_box_back_rep">
     20            <?php
     21            if (is_plugin_active('wpyar_panel/wpyar_panel.php')) {
     22                $page = slug_page . '?endp=nirweb-ticket';
     23            } else {
     24                if (wpyar_ticket['select_page_ticket']) {
     25                    $page = esc_url_raw(get_page_link(wpyar_ticket['select_page_ticket']));
     26                } else {
     27                    $page = get_permalink(get_option('woocommerce_myaccount_page_id')) . 'wpyar-ticket/';
     28                }
    2829            }
    29         }
    30     ?>
    31         <a href=" <?php echo $page; ?> " class="btn btn_back_wpyt"> <?php echo __('Back To List Tickets', 'nirweb-support')  ?> </a>
    32     </div>
    33     <div class="edit_ticket_bg">
    34         <!-~~ Start Base ~~~-->
    35         <div class="display_content_ticket">
     30            ?>
     31            <a href=" <?php echo esc_url_raw($page); ?> " class="btn btn_back_wpyt">
     32                <?php echo esc_html__('Back To List Tickets', 'nirweb-support') ?>
     33            </a>
     34        </div>
     35        <div class="edit_ticket_bg">
     36            <div class="display_content_ticket">
    3637         <span>
    37              <?php echo __('Subject', 'nirweb-support'); ?>
     38             <?php echo esc_html__('Subject', 'nirweb-support'); ?>
    3839               <span class="subject_ticket"> <?php echo esc_html($info_ticket->subject) ?></span>
    3940         </span>
    40             <span>
    41             <?php echo __('Ticket Number', 'nirweb-support'); ?>
    42     <?php echo esc_html($ticket_id) ?></span>
    43         </div>
    44         <div class="info_wpyar_ticket wpyar-ticket">
    45             <!-~~ Start info ticket ~~~-->
    46             <div class="box_info_ticket">
    47                 <p class="title"><?php echo __('Department' , 'nirweb-support') ?></p>
    48                 <p class="info dep" user-id="<?php echo esc_html($info_ticket->support_id) ?>"><?php echo esc_html($info_ticket->depname) ?></p>
    49             </div>
    50             <div class="box_info_ticket">
    51                 <p class="title"><?php echo  __('Status', 'nirweb-support')  ?></p>
    52                 <p class="info"> <?php echo esc_html($info_ticket->name_status) ?></p>
    53             </div>
    54             <div class="box_info_ticket">
    55                 <p class="title"><?php echo __('Priority', 'nirweb-support') ?></p>
    56                 <p class="info priority"><?php echo esc_html($info_ticket->proname) ?></p>
    57             </div>
    58             <?php if ($info_ticket->product_name): ?>
     41                <span>
     42            <?php echo esc_html__('Ticket Number', 'nirweb-support'); ?>
     43            <?php echo esc_html($ticket_id) ?></span>
     44            </div>
     45            <div class="info_wpyar_ticket wpyar-ticket">
    5946                <div class="box_info_ticket">
    60                     <p class="title"><?php echo __('Product', 'nirweb-support') ?></p>
    61                     <p class="info priority"><?php echo esc_html($info_ticket->product_name) ?></p>
    62                 </div>
    63             <?php endif; ?>
    64 
    65         </div>
    66     </div>
    67 
    68 
    69     <div class="box_answer_war_wpyar_ticket">
    70         <div class="ticket_question">
    71             <div class="img_avatar_wpyartick">
    72 
    73                 <?php echo  get_avatar($info_ticket->sender_id, 100 ) ?>
    74             </div>
    75 
    76             <div class="info_answer_box_wpyartick">
    77                 <div class="text_message_wpyartick">
    78                     <?php echo wpautop( esc_html($info_ticket->content) ) ?>
    79 
    80                     <?php if ($info_ticket->file_url): ?>
    81                         <p class="file_atach_url">
    82                             <a href="<?php echo esc_url($info_ticket->file_url) ?>" target="_blank">
    83                             <?php echo __('Attachment File', 'nirweb-support') ?>
    84                             </a>
    85                         </p>
    86                     <?php endif; ?>
    87                 </div>
    88 
    89                 <div class="head_answer">
    90                 <span class="name">
    91                     <?php echo esc_html($info_ticket->display_name); ?>
    92                 </span>
    93                     <span class="date">
    94                     <?php echo  __('Date ', 'nirweb-support') ?> :
    95 
    96                     <?php echo wp_date('d F Y', strtotime($info_ticket->date_qustion)) ?>
    97                 </span>
    98                     <span class="time">
    99                     <?php echo __(' Hour ', 'nirweb-support') ?>
    100                     <?php echo $date = date('H:i:s', strtotime($info_ticket->date_qustion)); ?>
    101                 </span>
    102 
    103                 </div>
    104 
    105             </div>
    106         </div>
    107         <div class="list_answerd_in_dash_admin">
    108             <ul class="list_all_answered">
    109                 <?php foreach ($info_answerd as $row):
    110 
    111                     $user = get_userdata($row->user_id);
    112                     $role = $user->roles;
    113 
    114                     if ((in_array('user_support', $role)) or (in_array('administrator', $role))) {
    115                         $cls = 'user_support_wpyar';
    116                     } else {
    117                         $cls = '';
    118                     }
    119                     ?>
    120 
    121                     <li class="<?php echo $cls ?>">
    122                         <div class="img_avatar_wpyartick">
    123                             <?php echo  get_avatar($row->user_id, 100)  ?>
    124                         </div>
    125 
    126                         <div class="info_answer_box_wpyartick">
    127                             <div class="text_message_wpyartick">
    128                                 <?php echo wpautop(sanitize_textarea_field($row->text)) ?>
    129                                 <?php if ($row->attach_url) { ?>
    130                                     <p class="file_atach_url">
    131                                         <a href="<?php echo esc_url($row->attach_url) ?>" target="_blank">
    132                                         <?php echo __('Attachment File', 'nirweb-support') ?>
    133                                         </a>
    134                                     </p>
    135                                 <?php } ?>
    136                             </div>
    137 
    138 
    139                             <div class="head_answer">
     47                    <p class="title"><?php echo esc_html__('Department', 'nirweb-support') ?></p>
     48                    <p class="info dep"
     49                       user-id="<?php echo esc_html($info_ticket->support_id) ?>"><?php echo esc_html($info_ticket->depname) ?></p>
     50                </div>
     51                <div class="box_info_ticket">
     52                    <p class="title"><?php echo esc_html__('Status', 'nirweb-support') ?></p>
     53                    <p class="info"> <?php echo esc_html($info_ticket->name_status) ?></p>
     54                </div>
     55                <div class="box_info_ticket">
     56                    <p class="title"><?php echo esc_html__('Priority', 'nirweb-support') ?></p>
     57                    <p class="info priority"><?php echo esc_html($info_ticket->proname) ?></p>
     58                </div>
     59                <?php if ($info_ticket->product_name): ?>
     60                    <div class="box_info_ticket">
     61                        <p class="title"><?php echo esc_html__('Product', 'nirweb-support') ?></p>
     62                        <p class="info priority"><?php echo esc_html($info_ticket->product_name) ?></p>
     63                    </div>
     64                <?php endif; ?>
     65
     66            </div>
     67        </div>
     68        <div class="box_answer_war_wpyar_ticket">
     69            <div class="ticket_question">
     70                <div class="img_avatar_wpyartick">
     71                    <?php echo get_avatar($info_ticket->sender_id, 100) ?>
     72                </div>
     73
     74                <div class="info_answer_box_wpyartick">
     75                    <div class="text_message_wpyartick">
     76                        <?php echo wpautop(esc_html($info_ticket->content)) ?>
     77
     78                        <?php if ($info_ticket->file_url): ?>
     79                            <p class="file_atach_url">
     80                                <a href="<?php echo esc_url_raw($info_ticket->file_url) ?>" target="_blank">
     81                                    <?php echo esc_html__('Attachment File', 'nirweb-support') ?>
     82                                </a>
     83                            </p>
     84                        <?php endif; ?>
     85                    </div>
     86
     87                    <div class="head_answer">
     88                    <span class="name">
     89                        <?php echo esc_html($info_ticket->display_name); ?>
     90                    </span>
     91                        <span class="date">
     92                        <?php echo esc_html__('Date ', 'nirweb-support') ?> :
     93                        <?php echo esc_html(wp_date('d F Y', strtotime($info_ticket->date_qustion))) ?>
     94                    </span>
     95                        <span class="time">
     96                        <?php echo esc_html__(' Hour ', 'nirweb-support') ?>
     97                        <?php echo esc_html(date('H:i:s', strtotime($info_ticket->date_qustion))) ?>
     98                    </span>
     99                    </div>
     100                </div>
     101            </div>
     102            <div class="list_answerd_in_dash_admin">
     103                <ul class="list_all_answered">
     104                    <?php foreach ($info_answerd as $row):
     105                        $user = get_userdata($row->user_id);
     106                        $role = $user->roles;
     107                        if ((in_array('user_support', $role)) or (in_array('administrator', $role))) {
     108                            $cls = 'user_support_wpyar';
     109                        } else {
     110                            $cls = '';
     111                        } ?>
     112                        <li class="<?php echo $cls ?>">
     113                            <div class="img_avatar_wpyartick">
     114                                <?php echo get_avatar($row->user_id, 100) ?>
     115                            </div>
     116
     117                            <div class="info_answer_box_wpyartick">
     118                                <div class="text_message_wpyartick">
     119                                    <?php echo wpautop(esc_html($row->text)) ?>
     120                                    <?php if ($row->attach_url) { ?>
     121                                        <p class="file_atach_url">
     122                                            <a href="<?php echo esc_url_raw($row->attach_url) ?>" target="_blank">
     123                                                <?php echo esc_html__('Attachment File', 'nirweb-support') ?>
     124                                            </a>
     125                                        </p>
     126                                    <?php } ?>
     127                                </div>
     128
     129
     130                                <div class="head_answer">
    140131                        <span class="name">
    141132                            <?php echo esc_html($row->display_name) ?>
    142133                        </span>
    143                                 <?php if (in_array('user_support', $role)) { ?>
    144                                     <span class="time">
    145                                     <?php echo __('Hour', 'nirweb-support') ?>
    146                             <?php echo $date = date('H:i:s', strtotime($row->time_answer)); ?>
    147                         </span>
    148                                     <span class="date">
    149                                     <?php echo  __('Date :', 'nirweb-support') ?> :
    150                             <?php echo wp_date('d F Y', strtotime($row->time_answer)) ?>
    151                         </span>
    152                                 <?php } else { ?>
    153                                     <span class="date">
    154                                     <?php echo  __('Date :', 'nirweb-support') ?> :
    155                             <?php echo wp_date('d F Y', strtotime($row->time_answer)) ?>
    156                         </span>
    157                                     <span class="time">
    158                                     <?php echo __('Hour', 'nirweb-support') ?>
    159                             <?php echo $date = date('H:i:s', strtotime($row->time_answer)); ?>
    160                         </span>
    161                                 <?php } ?>
    162 
    163                             </div>
    164 
     134                                    <?php if (in_array('user_support', $role)) { ?>
     135                                        <span class="time">
     136                                    <?php echo esc_html__('Hour', 'nirweb-support') ?>
     137                                    <?php echo esc_html(date('H:i:s', strtotime($row->time_answer))); ?>
     138                        </span>
     139                                        <span class="date">
     140                                    <?php echo esc_html__('Date :', 'nirweb-support') ?> :
     141                            <?php echo esc_html(wp_date('d F Y', strtotime($row->time_answer))) ?>
     142                        </span>
     143                                    <?php } else { ?>
     144                                        <span class="date">
     145                                    <?php echo esc_html__('Date :', 'nirweb-support') ?> :
     146                            <?php echo esc_html(wp_date('d F Y', strtotime($row->time_answer))) ?>
     147                        </span>
     148                                        <span class="time">
     149                                    <?php echo esc_html__('Hour', 'nirweb-support') ?>
     150                                    <?php echo esc_html(date('H:i:s', strtotime($row->time_answer))); ?>
     151                        </span>
     152                                    <?php } ?>
     153
     154                                </div>
     155
     156                            </div>
     157
     158                        </li>
     159                    <?php endforeach ?>
     160                </ul>
     161            </div>
     162        </div>
     163
     164        <div class="row_wpyt">
     165            <div class="content_answer_user_wpyar_ticket">
     166                <form action="" id="answer_form">
     167                    <div class="w-100">
     168                        <label><?php echo esc_html__('Message *', 'nirweb-support') ?></label>
     169                        <textarea id="user_content_answ" name="user_content_answ"
     170                                  placeholder="<?php echo esc_html__('Enter the text of the message Plase', 'nirweb-support') ?>"></textarea>
     171                    </div>
     172
     173                    <div class="row_wpyar_ticket ">
     174                        <div class="row_nirweb_ticket_send wpyar_upfile_base">
     175                            <div class="upfile_wpyartick">
     176
     177                                <label for="main_image" class="label_main_image">
     178                                    <span class="remove_file_by_user"><i class="fal fa-times-circle"></i></span>
     179                                    <i class="fal fa-arrow-up upicon" style="font-size: 30px;margin-bottom: 10px;"></i>
     180                                    <span class="text_label_main_image">
     181                                <?php echo esc_html__('Attachment File', 'nirweb-support') ?>
     182                                </span>
     183                                </label>
     184                                <input type="file" name="main_image" id="main_image"
     185                                       accept="<?php
     186                                       echo esc_html(wpyar_ticket['mojaz_file_upload_user_wpyar']) ?>">
     187
     188                            </div>
     189
     190                            <div id="apf-response"></div>
    165191                        </div>
    166192
    167                     </li>
    168                 <?php endforeach ?>
    169             </ul>
    170         </div>
    171     </div>
    172 
    173 
    174     <!-~~~ End info ticket ~~~-->
    175 
    176     <div class="row_wpyt">
    177         <!-~~ start row ~~~-->
    178         <div class="content_answer_user_wpyar_ticket">
    179             <form action="" id="answer_form">
    180                 <div class="w-100">
    181                     <label><?php echo __('Message *', 'nirweb-support') ?></label>
    182                     <textarea id="user_content_answ" name="user_content_answ"
    183                               placeholder="<?php echo __('Enter the text of the message Plase', 'nirweb-support') ?>"></textarea>
    184                 </div>
    185 
    186                 <div class="row_wpyar_ticket ">
    187                     <div class="row_nirweb_ticket_send wpyar_upfile_base">
    188                         <div class="upfile_wpyartick">
    189 
    190                             <label for="main_image" class="label_main_image">
    191                                 <span class="remove_file_by_user"><i class="fal fa-times-circle"></i></span>
    192                                 <i class="fal fa-arrow-up upicon" style="font-size: 30px;margin-bottom: 10px;"></i>
    193                                 <span class="text_label_main_image">
    194                                 <?php echo __('Attachment File', 'nirweb-support') ?>
    195                                 </span>
    196                             </label>
    197                             <input type="file" name="main_image" id="main_image"
    198                                    accept="<?php 
    199                                    echo esc_html(wpyar_ticket['mojaz_file_upload_user_wpyar']) ?>">
    200 
     193                    </div>
     194                    <div class="wpyar-ticket box_btn_send_answer_user">
     195                        <div class="base_loarder">
     196                            <div class="spinner">
     197                                <div class="double-bounce1"></div>
     198                                <div class="double-bounce2"></div>
     199                            </div>
     200                            <p><?php echo esc_html__('Send Request ...', 'nirweb-support') ?></p>
    201201                        </div>
    202202
    203                         <div id="apf-response"></div>
    204                     </div>
    205 
    206                 </div>
    207                 <div class="wpyar-ticket box_btn_send_answer_user">
    208                     <div class="base_loarder">
    209                         <div class="spinner">
    210                             <div class="double-bounce1"></div>
    211                             <div class="double-bounce2"></div>
     203                        <div class="box_btn_send_answer_user">
     204                            <input id="closed_answer" name="closed_answer" value="closed_answer" type="checkbox">
     205                            <label for="closed_answer"><?php echo esc_html__('Close Ticket', 'nirweb-support') ?></label>
    212206                        </div>
    213                         <p><?php echo __('Send Request ...', 'nirweb-support') ?></p>
    214                     </div>
    215 
    216                     <div class="box_btn_send_answer_user">
    217                         <input id="closed_answer" name="closed_answer" value="closed_answer" type="checkbox">
    218                         <label for="closed_answer"><?php echo __('Close Ticket', 'nirweb-support') ?></label>
    219                     </div>
    220 
    221                     <button data-id="<?php echo sanitize_text_field($_GET['id']) ?>" class="send_user_answer"><?php echo __('Send Answer', 'nirweb-support') ?></button>
    222                 </div>
    223 
    224             </form>
    225 
    226         </div>
    227     </div>
    228     <?php $accsses_file = str_replace('.','',trim( wpyar_ticket['mojaz_file_upload_user_wpyar']));
    229   $accsses_file = explode(",",trim($accsses_file));?>
    230  
    231     <script>
    232  jQuery("#main_image").change(function () {
    233   var ext = this.value.match(/\.(.+)$/)[1];
    234   switch (ext) {
    235       <?php foreach ($accsses_file as $file):?>
    236       case "<?php echo $file ?>":
    237           <?php endforeach; ?>
    238            break;
    239       default:
    240       alert( wpyarticket.nvalid_file);
    241            this.value = '';
    242   }
    243 });
    244 jQuery('.send_user_answer').click(function (e) {
    245 
    246             e.preventDefault();
    247 
    248             jQuery('.base_loarder').css('display', 'flex');
    249             var user_answer = jQuery('#user_content_answ').val();
    250             var tik_id = jQuery(this).attr('data-id');
    251             var id_user = jQuery('.dep').attr('user-id');
    252             var dep_name = jQuery('.dep').text();
    253             var priority_name =jQuery('.priority').text();
    254             var subject = jQuery('.subject_ticket').text();
    255             var closed_answer = jQuery('input[name=closed_answer]:checked').val();
    256             var formData = new FormData();
    257 
    258             var formData = new FormData();
    259 
    260             formData.append('updoc', jQuery('input[type=file]')[0].files[0]);
    261             formData.append('user_answer', user_answer),
    262                 formData.append('tik_id', tik_id),
    263                 formData.append('id_user', id_user),
    264                 formData.append('dep_name', dep_name),
    265                 formData.append('subject', subject),
    266                 formData.append('priority_name', priority_name);
    267             if (closed_answer) {
    268                 formData.append('closed_answer', closed_answer);
    269             }
    270             if (jQuery('input[type=file]')[0].files[0]) {
    271                 var size_file = jQuery('input[type=file]')[0].files[0]['size'];
    272                 var ac_size = <?php echo wpyar_ticket['size_of_file_wpyartik']; ?>000000;
    273 
    274                 if (size_file >= ac_size) {
    275                     jQuery('.text_upload').css('display', 'none')
    276                    alert(wpyarticket.max_size_file);
    277                     return false
    278                 }
    279             }
    280 
    281 
    282             formData.append('action', "user_answer_ticket");
    283             jQuery.ajax({
    284                 url: wpyarticket.ajax_url,
    285                 type: "POST",
    286                 data: formData, cache: false,
    287                 processData: false,
    288                 contentType: false,
    289                 success: function (response) {
    290                     if(response =='error_valid_type'){
    291                     alert( wpyarticket.nvalid_file);
    292                     jQuery('.base_loarder').css('display','none');
    293                     jQuery('.text_label_main_image').html('<?php echo __('Attachment File', 'nirweb-support') ?>');
    294                     return false;
    295                 }
    296                     jQuery('.base_loarder').css('display', 'none');
    297                     jQuery('#answer_form').trigger('reset');
    298                     jQuery('.list_all_answered').html(response)
    299                     jQuery('.remove_file_by_user').hide();
    300                     jQuery('.text_label_main_image').html('<?php echo __('Attachment File', 'nirweb-support') ?>');
    301                     window.location.reload();
    302                 },
    303 
    304             });
    305 
    306 
    307         });
    308 
    309 
    310     </script>
    311 
    312 <?php } else {
    313     echo '<p>'.__('You do not have permission to access this ticket', 'nirweb-support').'</p>';
    314 } ?>
     207
     208                        <button data-id="<?php echo esc_html($_GET['id']) ?>"
     209                                class="send_user_answer"><?php echo esc_html__('Send Answer', 'nirweb-support') ?></button>
     210                    </div>
     211
     212                </form>
     213
     214            </div>
     215        </div>
     216            <?php add_action('wp_footer',function (){
     217                 $accsses_file = str_replace('.', '', trim(wpyar_ticket['mojaz_file_upload_user_wpyar']));
     218    $accsses_file = explode(",", trim($accsses_file)); ?>
     219                <script>
     220                    jQuery("#main_image").change(function () {
     221                        var ext = this.value.match(/\.(.+)$/)[1];
     222                        switch (ext) {
     223                        <?php foreach ($accsses_file as $file):?>
     224                            case "<?php echo esc_html($file) ?>":
     225                            <?php endforeach; ?>
     226                                break;
     227                            default:
     228                                alert(wpyarticket.nvalid_file);
     229                                this.value = '';
     230                        }
     231                    });
     232                    jQuery('.send_user_answer').click(function (e) {
     233                        e.preventDefault();
     234                        jQuery('.base_loarder').css('display', 'flex');
     235                        var user_answer = jQuery('#user_content_answ').val();
     236                        var tik_id = jQuery(this).attr('data-id');
     237                        var id_user = jQuery('.dep').attr('user-id');
     238                        var dep_name = jQuery('.dep').text();
     239                        var priority_name = jQuery('.priority').text();
     240                        var subject = jQuery('.subject_ticket').text();
     241                        var closed_answer = jQuery('input[name=closed_answer]:checked').val();
     242                        var formData = new FormData();
     243                        formData.append('updoc', jQuery('input[type=file]')[0].files[0]);
     244                        formData.append('user_answer', user_answer),
     245                            formData.append('tik_id', tik_id),
     246                            formData.append('id_user', id_user),
     247                            formData.append('dep_name', dep_name),
     248                            formData.append('subject', subject),
     249                            formData.append('priority_name', priority_name);
     250                        if (closed_answer) {
     251                            formData.append('closed_answer', closed_answer);
     252                        }
     253                        if (jQuery('input[type=file]')[0].files[0]) {
     254                            var size_file = jQuery('input[type=file]')[0].files[0]['size'];
     255                            var ac_size = <?php echo wpyar_ticket['size_of_file_wpyartik']; ?>000000;
     256                            if (size_file >= ac_size) {
     257                                jQuery('.text_upload').css('display', 'none')
     258                                alert(wpyarticket.max_size_file);
     259                                return false
     260                            }
     261                        }
     262                        formData.append('action', "user_answer_ticket");
     263                        jQuery.ajax({
     264                            url: wpyarticket.ajax_url,
     265                            type: "POST",
     266                            data: formData, cache: false,
     267                            processData: false,
     268                            contentType: false,
     269                            success: function (response) {
     270                                console.log(response);
     271                                if (response == 'error_valid_type') {
     272                                    alert(wpyarticket.nvalid_file);
     273                                    jQuery('.base_loarder').css('display', 'none');
     274                                    jQuery('.text_label_main_image').html('<?php echo esc_html__('Attachment File', 'nirweb-support') ?>');
     275                                    return false;
     276                                }
     277                                jQuery('.base_loarder').css('display', 'none');
     278                                jQuery('#answer_form').trigger('reset');
     279                                jQuery('.list_all_answered').html(response)
     280                                jQuery('.remove_file_by_user').hide();
     281                                jQuery('.text_label_main_image').html('<?php echo esc_html__('Attachment File', 'nirweb-support') ?>');
     282                                //window.location.reload();
     283                            },
     284                        });
     285                    });
     286                </script>
     287    <?php });
     288     } else {
     289        echo '<p>' . esc_html__('You do not have permission to access this ticket', 'nirweb-support') . '</p>';
     290    } ?>
    315291</div>
  • nirweb-support/trunk/nirweb-support.php

    r2705518 r2708596  
    3939
    4040register_activation_hook(__FILE__, 'check_active_pro_wpyar_ticket');
    41 
     41add_action('wp_enqueue_scripts',function (){
     42   wp_enqueue_script('jquery');
     43});
    4244add_action( 'plugins_loaded',function() {
    4345    load_textdomain( 'nirweb-support', NIRWEB_SUPPORT_TICKET .'languages/nirweb-support-'. get_locale() .'.mo' );
  • nirweb-support/trunk/option/classes/admin-options.class.php

    r2705518 r2708596  
    205205          'id'    => $menu_slug,
    206206          'title' => $menu_icon . esc_attr( $this->args['menu_title'] ),
    207           'href'  => esc_url( ( is_network_admin() ) ? network_admin_url( 'admin.php?page='. $menu_slug ) : admin_url( 'admin.php?page='. $menu_slug ) ),
     207          'href'  => esc_url_raw( ( is_network_admin() ) ? network_admin_url( 'admin.php?page='. $menu_slug ) : admin_url( 'admin.php?page='. $menu_slug ) ),
    208208        ) );
    209209
     
    214214              'id'     => $menu_slug .'-'. $menu_key,
    215215              'title'  => $menu_value[0],
    216               'href'   => esc_url( ( is_network_admin() ) ? network_admin_url( 'admin.php?page='. $menu_value[2] ) : admin_url( 'admin.php?page='. $menu_value[2] ) ),
     216              'href'   => esc_url_raw( ( is_network_admin() ) ? network_admin_url( 'admin.php?page='. $menu_value[2] ) : admin_url( 'admin.php?page='. $menu_value[2] ) ),
    217217            ) );
    218218          }
  • nirweb-support/trunk/option/classes/setup.class.php

    r2705518 r2708596  
    372372    // Set url constant
    373373    public static function include_plugin_url( $file ) {
    374       return esc_url( self::$url ) .'/'. ltrim( $file, '/' );
     374      return esc_url_raw( self::$url ) .'/'. ltrim( $file, '/' );
    375375    }
    376376
     
    651651          $query['display'] = 'swap';
    652652
    653           wp_enqueue_style( 'CSFTICKET-google-web-fonts', esc_url( add_query_arg( $query, '//fonts.googleapis.com/css' ) ), array(), null );
     653          wp_enqueue_style( 'CSFTICKET-google-web-fonts', esc_url_raw( add_query_arg( $query, '//fonts.googleapis.com/css' ) ), array(), null );
    654654
    655655        }
     
    663663          }
    664664
    665           wp_enqueue_script( 'CSFTICKET-google-web-fonts', esc_url( '//ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js' ), array(), null );
     665          wp_enqueue_script( 'CSFTICKET-google-web-fonts', esc_url_raw( '//ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js' ), array(), null );
    666666
    667667          wp_localize_script( 'CSFTICKET-google-web-fonts', 'WebFontConfig', array( 'google' => array( 'families' => $fonts ) ) );
  • nirweb-support/trunk/option/fields/backup/backup.php

    r2705011 r2708596  
    2727      echo '<hr />';
    2828      echo '<textarea readonly="readonly" class="CSFTICKET-export-data">'. esc_attr( json_encode( get_option( $unique ) ) ) .'</textarea>';
    29       echo '<a href="'. esc_url( $export ) .'" class="button button-primary CSFTICKET-export" target="_blank">'. esc_html__( 'Export & Download', 'CSFTICKET' ) .'</a>';
     29      echo '<a href="'. esc_url_raw( $export ) .'" class="button button-primary CSFTICKET-export" target="_blank">'. esc_html__( 'Export & Download', 'CSFTICKET' ) .'</a>';
    3030      echo '<hr />';
    3131      echo '<button type="submit" name="CSFTICKET_transient[reset]" value="reset" class="button CSFTICKET-warning-primary CSFTICKET-confirm CSFTICKET-reset" data-unique="'. esc_attr( $unique ) .'" data-nonce="'. esc_attr( $nonce ) .'">'. esc_html__( 'Reset', 'CSFTICKET' ) .'</button>';
  • nirweb-support/trunk/option/fields/code_editor/code_editor.php

    r2705518 r2708596  
    4545
    4646      if ( ! wp_script_is( 'CSFTICKET-codemirror' ) ) {
    47         wp_enqueue_script( 'CSFTICKET-codemirror', esc_url( NIRWEB_SUPPORT_URL_CODESTAR_TICKET.'codemirror.min.js' ), array( 'CSFTICKET' ), $this->version, true );
    48         wp_enqueue_script( 'CSFTICKET-codemirror-loadmode', esc_url(NIRWEB_SUPPORT_URL_CODESTAR_TICKET.'loadmode.min.js' ), array( 'CSFTICKET-codemirror' ), $this->version, true );
     47        wp_enqueue_script( 'CSFTICKET-codemirror', esc_url_raw( NIRWEB_SUPPORT_URL_CODESTAR_TICKET.'codemirror.min.js' ), array( 'CSFTICKET' ), $this->version, true );
     48        wp_enqueue_script( 'CSFTICKET-codemirror-loadmode', esc_url_raw(NIRWEB_SUPPORT_URL_CODESTAR_TICKET.'loadmode.min.js' ), array( 'CSFTICKET-codemirror' ), $this->version, true );
    4949      }
    5050
    5151      if ( ! wp_style_is( 'CSFTICKET-codemirror' ) ) {
    52         wp_enqueue_style( 'CSFTICKET-codemirror', esc_url( NIRWEB_SUPPORT_URL_CODESTAR_TICKET.'codemirror.min.css' ), array(), $this->version );
     52        wp_enqueue_style( 'CSFTICKET-codemirror', esc_url_raw( NIRWEB_SUPPORT_URL_CODESTAR_TICKET.'codemirror.min.css' ), array(), $this->version );
    5353      }
    5454
  • nirweb-support/trunk/option/fields/gallery/gallery.php

    r2705011 r2708596  
    3434        foreach ( $values as $id ) {
    3535          $attachment = wp_get_attachment_image_src( $id, 'thumbnail' );
    36           echo '<li><img src="'. esc_url( $attachment[0] ) .'" /></li>';
     36          echo '<li><img src="'. esc_url_raw( $attachment[0] ) .'" /></li>';
    3737        }
    3838
  • nirweb-support/trunk/option/fields/image_select/image_select.php

    r2705011 r2708596  
    4444          echo '<div class="CSFTICKET--sibling CSFTICKET--image'. esc_attr( $active ) .'">';
    4545            echo '<figure>';
    46               echo '<img src="'. esc_url( $option ) .'" alt="img-'. esc_attr( $num++ ) .'" />';
     46              echo '<img src="'. esc_url_raw( $option ) .'" alt="img-'. esc_attr( $num++ ) .'" />';
    4747              echo '<input type="'. esc_attr( $type ) .'" name="'. esc_attr( $this->field_name( $extra ) ) .'" value="'. esc_attr( $key ) .'"'. $this->field_attributes() . esc_attr( $checked ) .'/>';
    4848            echo '</figure>';
  • nirweb-support/trunk/option/fields/map/map.php

    r2705518 r2708596  
    8282
    8383      if ( ! wp_script_is( 'CSFTICKET-leaflet' ) ) {
    84         wp_enqueue_script( 'CSFTICKET-leaflet', esc_url( NIRWEB_SUPPORT_URL_CODESTAR_TICKET.'leaflet.js' ), array( 'CSFTICKET' ), $this->version, true );
     84        wp_enqueue_script( 'CSFTICKET-leaflet', esc_url_raw( NIRWEB_SUPPORT_URL_CODESTAR_TICKET.'leaflet.js' ), array( 'CSFTICKET' ), $this->version, true );
    8585      }
    8686
    8787      if ( ! wp_style_is( 'CSFTICKET-leaflet' ) ) {
    88         wp_enqueue_style( 'CSFTICKET-leaflet', esc_url( NIRWEB_SUPPORT_URL_CODESTAR_TICKET.'leaflet.css' ), array(), $this->version );
     88        wp_enqueue_style( 'CSFTICKET-leaflet', esc_url_raw( NIRWEB_SUPPORT_URL_CODESTAR_TICKET.'leaflet.css' ), array(), $this->version );
    8989      }
    9090
  • nirweb-support/trunk/option/fields/media/media.php

    r2705011 r2708596  
    6969        echo '<div class="CSFTICKET--preview'. esc_attr( $hidden_auto ) .'">';
    7070        echo '<div class="CSFTICKET-image-preview"'. $preview_style .'>';
    71         echo '<i class="CSFTICKET--remove fas fa-times"></i><span><img src="'. esc_url( $preview_src ) .'" class="CSFTICKET--src" /></span>';
     71        echo '<i class="CSFTICKET--remove fas fa-times"></i><span><img src="'. esc_url_raw( $preview_src ) .'" class="CSFTICKET--src" /></span>';
    7272        echo '</div>';
    7373        echo '</div>';
  • nirweb-support/trunk/option/fields/upload/upload.php

    r2705011 r2708596  
    4343        echo '<div class="CSFTICKET--preview'. esc_attr( $preview_hidden ) .'">';
    4444        echo '<div class="CSFTICKET-image-preview"'. $preview_style .'>';
    45         echo '<i class="CSFTICKET--remove fas fa-times"></i><span><img src="'. esc_url( $preview_src ) .'" class="CSFTICKET--src" /></span>';
     45        echo '<i class="CSFTICKET--remove fas fa-times"></i><span><img src="'. esc_url_raw( $preview_src ) .'" class="CSFTICKET--src" /></span>';
    4646        echo '</div>';
    4747        echo '</div>';
  • nirweb-support/trunk/option/views/header.php

    r2705011 r2708596  
    2222  <p class="CSFTICKET-about-text">A Simple and Lightweight WordPress Option Framework for Themes and Plugins</p>
    2323
    24   <p class="CSFTICKET-demo-button"><a href="<?php echo esc_url( add_query_arg( array( 'CSFTICKET-demo' => $status ) ) ); ?>" class="button button-primary<?php echo esc_attr( $class ); ?>"><?php echo esc_attr( $text ); ?> Demo</a></p>
     24  <p class="CSFTICKET-demo-button"><a href="<?php echo esc_url_raw( add_query_arg( array( 'CSFTICKET-demo' => $status ) ) ); ?>" class="button button-primary<?php echo esc_attr( $class ); ?>"><?php echo esc_attr( $text ); ?> Demo</a></p>
    2525
    2626  <div class="CSFTICKET-logo">
     
    4343        $activate = ( $section === $key ) ? ' nav-tab-active' : '';
    4444
    45         echo '<a href="'. esc_url( add_query_arg( array( 'page' => 'CSFTICKET-welcome', 'section' => $key ), admin_url( 'tools.php' ) ) ) .'" class="nav-tab'. esc_attr( $activate ) .'">'. esc_attr( $link ) .'</a>';
     45        echo '<a href="'. esc_url_raw( add_query_arg( array( 'page' => 'CSFTICKET-welcome', 'section' => $key ), admin_url( 'tools.php' ) ) ) .'" class="nav-tab'. esc_attr( $activate ) .'">'. esc_attr( $link ) .'</a>';
    4646
    4747      }
  • nirweb-support/trunk/option/views/welcome.php

    r2705011 r2708596  
    7979
    8080      if ( $plugin_file === 'codestar-framework/codestar-framework.php' && ! empty( $links ) ) {
    81         $links['CSFTICKET--welcome'] = '<a href="'. esc_url( admin_url( 'tools.php?page=CSFTICKET-welcome' ) ) .'">Settings</a>';
     81        $links['CSFTICKET--welcome'] = '<a href="'. esc_url_raw( admin_url( 'tools.php?page=CSFTICKET-welcome' ) ) .'">Settings</a>';
    8282        if ( ! CSFTICKET::$premium ) {
    8383          $links['CSFTICKET--upgrade'] = '<a href="http://codestarframework.com/">Upgrade</a>';
Note: See TracChangeset for help on using the changeset viewer.