public function ajax_refresh_captcha()
 {
     $length = 5;
     $charset = 'abcdefghijklmnpqrstuvwxyz123456789';
     $phrase = '';
     $chars = str_split($charset);
     for ($i = 0; $i < $length; $i++) {
         $phrase .= $chars[array_rand($chars)];
     }
     $resp = $resp2 = array();
     $resp['txt_color_st'] = isset($_POST['txt_color_st']) ? Uiform_Form_Helper::sanitizeInput($_POST['txt_color_st']) : '';
     $resp['txt_color'] = isset($_POST['txt_color']) ? Uiform_Form_Helper::sanitizeInput($_POST['txt_color']) : '';
     $resp['background_st'] = isset($_POST['background_st']) ? Uiform_Form_Helper::sanitizeInput($_POST['background_st']) : '';
     $resp['background_color'] = isset($_POST['txt_color_st']) ? Uiform_Form_Helper::sanitizeInput($_POST['background_color']) : '';
     $resp['distortion'] = isset($_POST['distortion']) ? Uiform_Form_Helper::sanitizeInput($_POST['distortion']) : '';
     $resp['behind_lines_st'] = isset($_POST['behind_lines_st']) ? Uiform_Form_Helper::sanitizeInput($_POST['behind_lines_st']) : '';
     $resp['behind_lines'] = isset($_POST['behind_lines']) ? Uiform_Form_Helper::sanitizeInput($_POST['behind_lines']) : '';
     $resp['front_lines_st'] = isset($_POST['front_lines_st']) ? Uiform_Form_Helper::sanitizeInput($_POST['front_lines_st']) : '';
     $resp['front_lines'] = isset($_POST['front_lines']) ? Uiform_Form_Helper::sanitizeInput($_POST['front_lines']) : '';
     $resp['ca_txt_gen'] = $phrase;
     $captcha_options = Uiform_Form_Helper::base64url_encode(json_encode($resp));
     $resp2 = array();
     $resp2['rkver'] = $captcha_options;
     //return data to ajax callback
     header('Content-Type: application/json');
     echo json_encode($resp2);
     wp_die();
 }
 function getDetailRecord($names, $form_id)
 {
     $sql = 'select ';
     $temp = array();
     foreach ($names as $value) {
         $temp[] = "extractvalue(fbh_data_xml,'/params/child::" . $value->fmf_uniqueid . "') AS " . Uiform_Form_Helper::sanitizeFnamestring($value->fieldname);
     }
     $temp[] = "r.fbh_id";
     $temp[] = "r.created_date";
     $sql .= implode(',', $temp) . ' from %s r';
     $sql .= " join %s frm on frm.fmb_id=r.form_fmb_id\r\n            where r.flag_status>0 and r.form_fmb_id=%s";
     $query = sprintf($sql, $this->table, $this->tbform, $form_id);
     return $this->wpdb->get_results($query);
 }
 public function ajax_save_options()
 {
     $opt_language = isset($_POST['language']) && $_POST['language'] ? Uiform_Form_Helper::sanitizeInput($_POST['language']) : '';
     $data = array();
     $data['language'] = $opt_language;
     $where = array('id' => 1);
     $result = $this->wpdb->update($this->model_settings->table, $data, $where);
     $json = array();
     if ($result > 0) {
         $json['success'] = 1;
     } else {
         $json['success'] = 0;
     }
     header('Content-Type: application/json');
     echo json_encode($json);
     wp_die();
 }
echo $form_id;
?>
" class="_rockfm_form_id" name="_rockfm_form_id">
    <?php 
if (isset($wizard['enable_st']) && intval($wizard['enable_st']) === 1 && count($wizard['tabs']) > 1) {
    ?>
        <input type="hidden" value="1" class="_rockfm_wizard_st" >
    <?php 
} else {
    ?>
        <input type="hidden" value="0" class="_rockfm_wizard_st" >
    <?php 
}
?>
    <input type="hidden" value="<?php 
echo Uiform_Form_Helper::base64url_encode(urldecode($onsubm['sm_successtext']));
?>
" name="_rockfm_onsubm_smsg" class="_rockfm_onsubm_smsg" >
    <!--- ajax or post --->
    <?php 
if (isset($main['submit_ajax']) && intval($main['submit_ajax']) === 1) {
    ?>
        <input type="hidden" value="1" class="_rockfm_type_submit" name="_rockfm_type_submit">
        <input type="hidden" value="rocket_front_submitajaxmode" name="action">
    <?php 
} else {
    ?>
        <input type="hidden" value="0" class="_rockfm_type_submit" name="_rockfm_type_submit">
    <?php 
}
?>
 /**
  * Sanitize recursive
  * 
  * @param string $data array
  * 
  * @return array
  */
 public static function sanitizeRecursive_html($data)
 {
     if (is_array($data)) {
         return array_map(array('Uiform_Form_Helper', 'sanitizeRecursive_html'), $data);
     } else {
         return Uiform_Form_Helper::sanitizeInput_html($data);
     }
 }
 public function list_records()
 {
     require_once UIFORM_FORMS_DIR . '/classes/Pagination.php';
     $this->pagination = new CI_Pagination();
     $offset = isset($_GET['offset']) && $_GET['offset'] ? Uiform_Form_Helper::sanitizeInput($_GET['offset']) : 0;
     //list all forms
     $data = $config = array();
     $config['base_url'] = admin_url() . '?page=uiform_form_builder&mod=formbuilder&controller=records&action=list_records';
     $config['total_rows'] = $this->model_record->CountRecords();
     $config['per_page'] = $this->per_page;
     $config['first_link'] = 'First';
     $config['last_link'] = 'Last';
     $config['full_tag_open'] = '<ul class="pagination pagination-sm">';
     $config['full_tag_close'] = '</ul>';
     $config['first_tag_open'] = '<li>';
     $config['first_tag_close'] = '</li>';
     $config['last_tag_open'] = '<li>';
     $config['last_tag_close'] = '</li>';
     $config['cur_tag_open'] = '<li><span>';
     $config['cur_tag_close'] = '</span></li>';
     $config['next_tag_open'] = '<li>';
     $config['next_tag_close'] = '</li>';
     $config['prev_tag_open'] = '<li>';
     $config['prev_tag_close'] = '</li>';
     $config['num_tag_open'] = '<li>';
     $config['num_tag_close'] = '</li>';
     $config['page_query_string'] = true;
     $config['query_string_segment'] = 'offset';
     $this->pagination->initialize($config);
     // If the pagination library doesn't recognize the current page add:
     $this->pagination->cur_page = $offset;
     $data['query'] = $this->model_record->getListRecords($this->per_page, $offset);
     $data['pagination'] = $this->pagination->create_links();
     echo self::loadPartial('layout.php', 'formbuilder/views/records/list_records.php', $data);
 }
    window.onload = function () {
    rocketform.loadForm_globalSettings();
    <?php 
if (isset($form_id) && intval($form_id) > 0) {
    ?>
    rocketform.loadFormSaved(<?php 
    echo $form_id;
    ?>
);
  <?php 
} else {
    ?>
  
     rocketform.loadNewForm();
     <?php 
    if (isset($_GET['opt']) && Uiform_Form_Helper::sanitizeInput($_GET['opt']) === 'import') {
        ?>
          rocketform.importForm_openModal(); 
      <?php 
    } else {
        ?>
          rocketform.formsetting_setFieldName(); 
      <?php 
    }
    ?>
    
 <?php 
}
?>
   
};
 public function route_page()
 {
     $route = Uiform_Form_Helper::getroute();
     if (!empty($route['module']) && !empty($route['controller']) && !empty($route['action'])) {
         if (method_exists($this->modules[$route['module']][$route['controller']], $route['action'])) {
             $this->modules[$route['module']][$route['controller']]->{$route}['action']();
         } else {
             echo 'wrong url';
         }
     } else {
         $this->modules['formbuilder']['forms']->list_uiforms();
     }
 }
            <li><a href="#"><?php 
echo __('Save', 'FRocket_admin');
?>
</a></li>
            <li class="divider"></li>
            <li><a href="<?php 
echo admin_url() . '?page=uiform_form_builder&mod=formbuilder&controller=forms&action=list_uiforms';
?>
"><?php 
echo __('List forms', 'FRocket_admin');
?>
</a></li>
          </ul>
        </li>
        <?php 
if (isset($_GET['action']) && Uiform_Form_Helper::sanitizeInput($_GET['action']) === 'create_uiform') {
    ?>
        <li class="divider-menu"></li>
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="fa fa-file-text-o"></span> <?php 
    echo __('Templates', 'FRocket_admin');
    ?>
 <span class="caret"></span></a>
          <ul class="dropdown-menu" role="menu">
              <li><a onclick="javascript:rocketform.templates_load(1);" 
                   href="javascript:void(0);"><?php 
    echo __('Contact us', 'FRocket_admin');
    ?>
</a>
              </li>
              <li><a onclick="javascript:rocketform.templates_load(2);" 
 public function create_uiform()
 {
     $data = array();
     $data['form_id'] = isset($_GET['form_id']) && $_GET['form_id'] ? Uiform_Form_Helper::sanitizeInput(trim($_GET['form_id'])) : 0;
     echo self::loadPartial('layout_editform.php', 'formbuilder/views/forms/create_form.php', $data);
 }
 public function get_form_shortcode($attributes, $content = null)
 {
     extract(shortcode_atts(array('id' => 1, 'ajax' => false), $attributes));
     $shortcode_string = "";
     $data_form = $this->formsmodel->getAvailableFormById($id);
     if (empty($data_form)) {
         return;
     }
     $shortcode_string = stripslashes($data_form->fmb_html);
     //load resources
     $this->load_form_resources($id);
     ob_start();
     // check for external shortcodes
     $shortcode_string = do_shortcode($shortcode_string);
     //adding alert message
     if (isset($_POST['_rockfm_type_submit']) && absint($_POST['_rockfm_type_submit']) === 0 && absint($_POST['_rockfm_form_id']) === intval($id)) {
         if (isset($this->flag_submitted) && intval($this->flag_submitted) > 0) {
             echo isset($_POST['_rockfm_onsubm_smsg']) ? Uiform_Form_Helper::base64url_decode(Uiform_Form_Helper::sanitizeInput_html($_POST['_rockfm_onsubm_smsg'])) : __('Success! your form was submitted', 'frocket_front');
         } else {
             echo __('warning! Form was not submitted', 'frocket_front');
         }
     }
     if (!file_exists(UIFORM_FORMS_DIR . '/assets/frontend/css/rockfm_form' . $id . '.css')) {
         ob_start();
         ?>
         <style type="text/css">
         <?php 
         echo $data_form->fmb_html_css;
         ?>
         </style> 
         <?php 
         $css_string = ob_get_clean();
         ob_end_clean();
         echo $css_string;
     }
     echo $shortcode_string;
     $output = ob_get_clean();
     return $output;
 }