public function ajax_submit_ajaxmode()
 {
     $resp = array();
     $this->process_form();
     if (isset($this->flag_submitted) && intval($this->flag_submitted) > 0) {
         $resp['success'] = 1;
         $resp['show_message'] = isset($_POST['_rockfm_onsubm_smsg']) ? Uiform_Form_Helper::base64url_decode(Uiform_Form_Helper::sanitizeInput_html($_POST['_rockfm_onsubm_smsg'])) : '<div class="rockfm-alert rockfm-alert-danger"><i class="fa fa-exclamation-triangle"></i> ' . __('Success! your form was submitted', 'frocket_front') . '</div>';
     } else {
         $resp['success'] = 0;
         $resp['show_message'] = '<div class="rockfm-alert rockfm-alert-danger"><i class="fa fa-exclamation-triangle"></i> ' . __('warning! Form was not submitted', 'frocket_front') . '</div>';
     }
     $resp['show_message'] = Uiform_Form_Helper::encodeHex($resp['show_message']);
     //return data to ajax callback
     header('Content-Type: text/html; charset=UTF-8');
     echo json_encode($resp);
     wp_die();
 }
 public function ajax_refresh_previewpanel()
 {
     $data = array();
     $fmb_data = !empty($_POST['form_data']) ? Uiform_Form_Helper::sanitizeInput_html($_POST['form_data']) : '';
     $fmb_data = urldecode($fmb_data);
     $fmb_data = str_replace("\\'", "'", $fmb_data);
     $fmb_data = !empty($fmb_data) ? array_map(array('Uiform_Form_Helper', 'sanitizeRecursive_html'), json_decode($fmb_data, true)) : array();
     $data['fmb_data'] = $fmb_data;
     $data['fmb_name'] = !empty($_POST['uifm_frm_main_title']) ? Uiform_Form_Helper::sanitizeInput(trim($_POST['uifm_frm_main_title'])) : '';
     $json = array();
     $tmp_html = $this->generate_previewpanel_html($data);
     $data['fmb_html_backend'] = Uiform_Form_Helper::encodeHex($tmp_html['output_html']);
     $json['data'] = $data;
     //return data to ajax callback
     header('Content-Type: application/json');
     echo json_encode($json);
     wp_die();
 }