From 3db8f7c92ca1c08c0c4e6dc037b0749ce4fda694 Mon Sep 17 00:00:00 2001 From: raimundo Date: Sun, 21 Jan 2024 02:05:31 -0500 Subject: [PATCH] v5.9.2 --- README.md | 4 +- application/config/constants.php | 2 +- application/config/database.php.~2~ | 35 - application/helpers/common_helper.php | 2 +- application/helpers/dompdflib_helper.php | 2 +- .../helpers/email_configuration_helper.php | 2 +- application/libraries/Addon.php | 6 +- application/libraries/Auth.php | 6 +- application/libraries/Template.php | 4 +- .../addon/controllers/zfad_backend.php | 583 +- .../modules/addon/controllers/zfad_common.php | 202 +- .../addon/controllers/zfad_frontend.php | 410 +- .../modules/addon/models/model_addon.php | 213 +- .../addon/models/model_addon_details.php | 87 +- .../addon/models/model_addon_details_log.php | 34 +- .../addon/views/backend/list_extensions.php | 167 +- .../controllers/zfad_mgtranslate_back.php | 870 +-- .../languages/src/FormulaConverter.php | 3 +- .../modules/addon_mgtranslate/src/Entry.php | 366 +- .../modules/addon_mgtranslate/src/Parser.php | 1099 +-- .../modules/addon_mgtranslate/src/Writer.php | 468 +- .../views/backend/ajax_load_pofile.php | 91 +- .../views/backend/ajax_new_lang.php | 20 +- .../views/backend/show_list.php | 146 +- .../modules/default/controllers/dashboard.php | 105 +- .../modules/default/controllers/intranet.php | 563 +- .../modules/default/controllers/zerror.php | 56 +- .../modules/default/views/intranet/about.php | 177 +- .../default/views/intranet/changepassword.php | 169 +- .../modules/default/views/intranet/gopro.php | 106 +- .../modules/default/views/intranet/help.php | 132 +- .../modules/default/views/intranet/login.php | 144 +- .../default/views/intranet/recoverpass.php | 39 +- .../views/intranet/recoverpass_mail.php | 6 +- .../default/views/intranet/settings.php | 363 +- .../views/intranet/showfilemanager.php | 10 +- .../modules/default/views/zerror/error.php | 80 +- .../formbuilder/controllers/fields.php | 2471 +++---- .../modules/formbuilder/controllers/forms.php | 6317 +++++++++-------- .../formbuilder/controllers/frontend.php | 5528 +++++++-------- .../formbuilder/controllers/recaptcha.php | 278 +- .../formbuilder/controllers/records.php | 1561 ++-- .../formbuilder/controllers/settings.php | 912 +-- .../formbuilder/controllers/uifmrecaptcha.php | 153 +- .../formbuilder/models/model_fields.php | 157 +- .../formbuilder/models/model_form_log.php | 215 +- .../formbuilder/models/model_forms.php | 437 +- .../formbuilder/models/model_record.php | 948 +-- .../formbuilder/models/model_settings.php | 252 +- .../views/fields/formhtml_panelfld.php | 187 +- .../views/fields/formhtml_panelfld_css.php | 219 +- .../fields/modal/field_opt_checkbox_extra.php | 206 +- .../views/fields/modal/field_opt_column.php | 1909 +++-- .../fields/modal/field_opt_select_extra.php | 410 +- .../views/fields/modal/field_opt_text.php | 262 +- .../fields/modal/settings_field_helpblock.php | 263 +- .../fields/modal/settings_field_input.php | 407 +- .../fields/modal/settings_field_input_1.php | 1353 ++-- .../fields/modal/settings_field_input_11.php | 245 +- .../fields/modal/settings_field_input_12.php | 997 +-- .../fields/modal/settings_field_input_13.php | 953 +-- .../fields/modal/settings_field_input_14.php | 103 +- .../fields/modal/settings_field_input_15.php | 79 +- .../fields/modal/settings_field_input_16.php | 227 +- .../fields/modal/settings_field_input_17.php | 229 +- .../fields/modal/settings_field_input_18.php | 1167 +-- .../fields/modal/settings_field_input_19.php | 439 +- .../fields/modal/settings_field_input_2.php | 415 +- .../fields/modal/settings_field_input_3.php | 325 +- .../fields/modal/settings_field_input_4.php | 293 +- .../fields/modal/settings_field_input_5.php | 129 +- .../fields/modal/settings_field_input_6.php | 343 +- .../fields/modal/settings_field_input_7.php | 79 +- .../fields/modal/settings_field_input_8.php | 39 +- .../fields/modal/settings_field_input_9.php | 153 +- .../fields/modal/settings_field_label.php | 1321 ++-- .../fields/modal/settings_field_misc.php | 621 +- .../fields/modal/settings_field_validate.php | 997 +-- .../fields/modal/settings_form_clogic.php | 293 +- .../views/fields/modal/settings_form_more.php | 473 +- .../fields/options/select/impbulkdata.php | 33 +- .../options/select/impbulkdata_footer.php | 13 +- .../views/fields/posthtml_gridsystem_css.php | 391 +- .../render_back/fieldoptions_data_1.php | 34 +- .../render_back/fieldoptions_data_10.php | 34 +- .../render_back/fieldoptions_data_11.php | 34 +- .../render_back/fieldoptions_data_2.php | 34 +- .../render_back/fieldoptions_data_3.php | 34 +- .../render_back/fieldoptions_data_4.php | 34 +- .../render_back/fieldoptions_data_5.php | 34 +- .../render_back/fieldoptions_data_6.php | 34 +- .../render_back/fieldoptions_data_8.php | 34 +- .../render_back/fieldoptions_data_9.php | 34 +- .../fields/render_css_front/addon_css.php | 29 +- .../fields/render_css_front/block_main.php | 17 +- .../fields/render_css_front/common_css.php | 341 +- .../fields/render_css_front/common_css2.php | 55 +- .../fields/render_css_front/type_appprep.php | 9 +- .../fields/render_css_front/type_apptext.php | 9 +- .../fields/render_css_front/type_captcha.php | 9 +- .../fields/render_css_front/type_checkbox.php | 153 +- .../render_css_front/type_colorpicker.php | 9 +- .../render_css_front/type_customhtml.php | 119 +- .../fields/render_css_front/type_date2.php | 9 +- .../render_css_front/type_datepicker.php | 9 +- .../fields/render_css_front/type_datetime.php | 9 +- .../fields/render_css_front/type_divider.php | 182 +- .../render_css_front/type_dyncheckbox.php | 45 +- .../render_css_front/type_dynradiobtn.php | 45 +- .../render_css_front/type_fileupload.php | 9 +- .../fields/render_css_front/type_heading.php | 266 +- .../render_css_front/type_hiddenfield.php | 9 +- .../render_css_front/type_imageupload.php | 9 +- .../render_css_front/type_multiselect.php | 190 +- .../fields/render_css_front/type_password.php | 168 +- .../fields/render_css_front/type_preptext.php | 9 +- .../render_css_front/type_radiobutton.php | 151 +- .../fields/render_css_front/type_range.php | 9 +- .../render_css_front/type_recaptcha.php | 9 +- .../fields/render_css_front/type_select.php | 184 +- .../fields/render_css_front/type_slider.php | 45 +- .../fields/render_css_front/type_spinner.php | 63 +- .../render_css_front/type_starrating.php | 9 +- .../render_css_front/type_submitbutton.php | 264 +- .../fields/render_css_front/type_switch.php | 45 +- .../fields/render_css_front/type_textarea.php | 274 +- .../fields/render_css_front/type_textbox.php | 266 +- .../render_css_front/type_timepicker.php | 9 +- .../render_css_front/type_wizardbtn.php | 513 +- .../fields/render_front/block_container.php | 135 +- .../fields/render_front/block_input_cont.php | 95 +- .../views/fields/render_front/block_label.php | 180 +- .../views/fields/render_front/block_main.php | 167 +- .../fields/render_front/type_appprep.php | 27 +- .../fields/render_front/type_apptext.php | 25 +- .../fields/render_front/type_captcha.php | 115 +- .../fields/render_front/type_checkbox.php | 129 +- .../fields/render_front/type_colorpicker.php | 23 +- .../fields/render_front/type_customhtml.php | 11 +- .../views/fields/render_front/type_date2.php | 63 +- .../fields/render_front/type_datepicker.php | 41 +- .../fields/render_front/type_datetime.php | 41 +- .../fields/render_front/type_divider.php | 61 +- .../fields/render_front/type_dyncheckbox.php | 325 +- .../fields/render_front/type_dynradiobtn.php | 321 +- .../fields/render_front/type_fileupload.php | 33 +- .../fields/render_front/type_heading.php | 91 +- .../fields/render_front/type_hiddenfield.php | 17 +- .../fields/render_front/type_imageupload.php | 33 +- .../fields/render_front/type_multiselect.php | 97 +- .../fields/render_front/type_password.php | 17 +- .../fields/render_front/type_preptext.php | 25 +- .../fields/render_front/type_radiobutton.php | 125 +- .../views/fields/render_front/type_range.php | 35 +- .../fields/render_front/type_recaptcha.php | 75 +- .../views/fields/render_front/type_select.php | 101 +- .../views/fields/render_front/type_slider.php | 63 +- .../fields/render_front/type_spinner.php | 45 +- .../fields/render_front/type_starrating.php | 31 +- .../views/fields/render_front/type_subbtn.php | 21 +- .../views/fields/render_front/type_switch.php | 43 +- .../fields/render_front/type_textarea.php | 19 +- .../fields/render_front/type_textbox.php | 19 +- .../fields/render_front/type_timepicker.php | 37 +- .../fields/render_front/type_wizardbtn.php | 59 +- .../fields/templates/prevpanel_appetext.php | 89 +- .../fields/templates/prevpanel_captcha.php | 139 +- .../fields/templates/prevpanel_checkbox.php | 109 +- .../templates/prevpanel_colorpicker.php | 81 +- .../fields/templates/prevpanel_customhtml.php | 81 +- .../fields/templates/prevpanel_datepicker.php | 95 +- .../fields/templates/prevpanel_datetime.php | 91 +- .../fields/templates/prevpanel_datetime_2.php | 97 +- .../fields/templates/prevpanel_divider.php | 33 +- .../templates/prevpanel_dyncheckbox.php | 83 +- .../templates/prevpanel_dynradiobtn.php | 83 +- .../fields/templates/prevpanel_fileupload.php | 97 +- .../templates/prevpanel_gridsystem_four.php | 67 +- .../templates/prevpanel_gridsystem_one.php | 39 +- .../templates/prevpanel_gridsystem_six.php | 87 +- .../templates/prevpanel_gridsystem_three.php | 57 +- .../templates/prevpanel_gridsystem_two.php | 49 +- .../fields/templates/prevpanel_heading1.php | 77 +- .../fields/templates/prevpanel_heading2.php | 77 +- .../fields/templates/prevpanel_heading3.php | 77 +- .../fields/templates/prevpanel_heading4.php | 77 +- .../fields/templates/prevpanel_heading5.php | 77 +- .../fields/templates/prevpanel_heading6.php | 77 +- .../templates/prevpanel_hiddeninput.php | 29 +- .../templates/prevpanel_imageupload.php | 101 +- .../views/fields/templates/prevpanel_main.php | 47 +- .../templates/prevpanel_multiselect.php | 93 +- .../fields/templates/prevpanel_panelfld.php | 53 +- .../fields/templates/prevpanel_password.php | 83 +- .../templates/prevpanel_prepapptext.php | 91 +- .../fields/templates/prevpanel_preptext.php | 89 +- .../fields/templates/prevpanel_quickopts.php | 9 +- .../fields/templates/prevpanel_quickopts2.php | 9 +- .../fields/templates/prevpanel_quickopts3.php | 9 +- .../fields/templates/prevpanel_radiobtn.php | 107 +- .../fields/templates/prevpanel_range.php | 89 +- .../fields/templates/prevpanel_ratingstar.php | 79 +- .../fields/templates/prevpanel_recaptcha.php | 81 +- .../fields/templates/prevpanel_select.php | 93 +- .../fields/templates/prevpanel_slider.php | 99 +- .../fields/templates/prevpanel_spinner.php | 87 +- .../fields/templates/prevpanel_submitbtn.php | 81 +- .../fields/templates/prevpanel_switch.php | 83 +- .../fields/templates/prevpanel_textarea.php | 83 +- .../fields/templates/prevpanel_textbox.php | 81 +- .../fields/templates/prevpanel_timepicker.php | 95 +- .../fields/templates/prevpanel_wizardbtn.php | 53 +- .../views/forms/ajax_integrity_openmodal.php | 21 +- .../views/forms/ajax_rollback_openmodal.php | 89 +- .../views/forms/ajax_variables_emailpage.php | 275 +- .../views/forms/ajax_variables_openmodal.php | 617 +- .../formbuilder/views/forms/create_form.php | 537 +- .../views/forms/create_form_main.php | 481 +- .../views/forms/create_form_modals.php | 207 +- .../formbuilder/views/forms/export_form.php | 69 +- .../views/forms/fields_available.php | 1536 ++-- .../views/forms/form_show_shortcodes.php | 93 +- .../formbuilder/views/forms/form_success.php | 90 +- .../views/forms/formhtml_css_form.php | 220 +- .../views/forms/formhtml_css_global.php | 233 +- .../views/forms/formhtml_css_init.php | 29 +- .../views/forms/formhtml_css_wizard.php | 682 +- .../formbuilder/views/forms/formhtml_form.php | 405 +- .../views/forms/formhtml_sticky.php | 17 +- .../views/forms/formhtml_tabcontainer.php | 21 +- .../views/forms/formhtml_tabfooter.php | 9 +- .../views/forms/formhtml_tabheader.php | 73 +- .../views/forms/get_code_cached_html.php | 47 +- .../views/forms/get_code_cached_scripts.php | 171 +- .../views/forms/get_code_iframe.php | 39 +- .../views/forms/get_code_widget.php | 67 +- .../formbuilder/views/forms/getcode.php | 160 +- .../formbuilder/views/forms/header_form.php | 115 +- .../formbuilder/views/forms/list_forms.php | 365 +- .../views/forms/list_forms_table.php | 199 +- .../formbuilder/views/forms/modal1_footer.php | 8 +- .../views/forms/pdf_global_template.php | 184 +- .../views/forms/preview_clogic_graph.php | 67 +- .../views/forms/preview_fields.php | 57 +- .../views/forms/previewpanel_form.php | 69 +- .../views/forms/previewpanel_tabcontainer.php | 25 +- .../views/forms/previewpanel_tabfooter.php | 9 +- .../views/forms/previewpanel_tabheader.php | 73 +- .../views/forms/settings_form_calc.php | 595 +- .../views/forms/settings_form_email.php | 1267 ++-- .../views/forms/settings_form_invoice.php | 708 +- .../views/forms/settings_form_main.php | 241 +- .../views/forms/settings_form_main_add.php | 173 +- .../views/forms/settings_form_main_cur.php | 331 +- .../views/forms/settings_form_main_email.php | 101 +- .../views/forms/settings_form_main_imp.php | 101 +- .../views/forms/settings_form_main_pdf.php | 312 +- .../forms/settings_form_main_recaptcha.php | 147 +- .../views/forms/settings_form_main_record.php | 228 +- .../forms/settings_form_samplebuttons.php | 251 +- .../views/forms/settings_form_skin.php | 991 +-- .../views/forms/settings_form_submission.php | 341 +- .../views/forms/settings_form_summbox.php | 1225 ++-- .../views/forms/settings_form_wizard.php | 841 +-- .../views/forms/templates_fields.php | 4467 ++++++------ .../views/forms/test_dcheckbox.php | 571 +- .../views/frontend/form_invoice.php | 388 +- .../views/frontend/form_invoice_custom.php | 57 +- .../views/frontend/form_summary.php | 136 +- .../views/frontend/form_summary_custom.php | 55 +- .../views/frontend/get_code_iframe.php | 34 +- .../views/frontend/get_form_iframe.php | 134 +- .../formbuilder/views/frontend/index.php | 12 +- .../views/frontend/mail_generate_fields.php | 422 +- .../views/frontend/mail_global_template.php | 48 +- .../views/frontend/payment_html.php | 167 +- .../views/frontend/pdf_global_template.php | 68 +- .../formbuilder/views/frontend/viewform.php | 72 +- .../formbuilder/views/frontend/welcome.php | 2 +- .../records/custom_report_getAllfields.php | 109 +- .../formbuilder/views/records/info_record.php | 176 +- .../views/records/info_record_topdf.php | 140 +- .../views/records/list_records.php | 171 +- .../records/list_records_getdatatable.php | 71 +- .../formbuilder/views/records/view_charts.php | 65 +- .../views/settings/backup_settings.php | 298 +- .../views/settings/blocked_getmessage.php | 33 +- .../views/settings/system_check.php | 333 +- .../formbuilder/views/settings/system_db.json | 1 + .../views/settings/view_settings.php | 274 +- .../modules/gateways/controllers/paypal.php | 702 +- .../modules/gateways/controllers/records.php | 739 +- .../modules/gateways/controllers/settings.php | 442 +- .../gateways/models/model_gateways.php | 99 +- .../gateways/models/model_gateways_logs.php | 73 +- .../models/model_gateways_records.php | 353 +- .../gateways/views/frontend/offline.php | 53 +- .../gateways/views/frontend/paypal.php | 117 +- .../gateways/views/paypal/notification.php | 8 +- .../gateways/views/settings/editoffline.php | 169 +- .../gateways/views/settings/editpaypal.php | 315 +- .../gateways/views/settings/view_settings.php | 241 +- .../modules/user/controllers/intranet.php | 302 +- .../modules/user/models/model_user.php | 171 +- .../user/views/intranet/createuser.php | 140 +- .../modules/user/views/intranet/index.php | 157 +- .../modules/visitor/models/model_visitor.php | 72 +- .../visitor/models/model_visitor_error.php | 29 +- application/views/footer.php | 2 +- application/views/frontend/footer.php | 4 +- application/views/frontend/header.php | 2 +- application/views/frontend/layout.php | 4 +- application/views/header-blank.php | 2 +- application/views/header.php | 2 +- application/views/html_view.php | 2 +- application/views/invoice_pdf.php | 2 +- application/views/json_view.php | 2 +- application/views/layout-editform.php | 2 +- application/views/layout-fmanager.php | 2 +- application/views/layout-global.php | 2 +- application/views/layout-login.php | 2 +- application/views/layout.php | 2 +- application/views/layout_blank.php | 2 +- application/views/notice_footer.php | 2 +- application/views/sidebar.php | 2 +- assets/backend/js/admin.debug.js | 20 +- assets/backend/js/admin.min.js | 2 +- change_log.txt | 6 + i18n/languages/backend/wprockf-de_DE.mo | Bin 59626 -> 59604 bytes i18n/languages/backend/wprockf-de_DE.po | 1810 ++--- i18n/languages/backend/wprockf-en_US.mo | Bin 57913 -> 57891 bytes i18n/languages/backend/wprockf-en_US.po | 1810 ++--- i18n/languages/backend/wprockf-es_ES.mo | Bin 59758 -> 59736 bytes i18n/languages/backend/wprockf-es_ES.po | 1810 ++--- i18n/languages/backend/wprockf-fr_FR.mo | Bin 60189 -> 60167 bytes i18n/languages/backend/wprockf-fr_FR.po | 1810 ++--- i18n/languages/backend/wprockf-it_IT.mo | Bin 59609 -> 59587 bytes i18n/languages/backend/wprockf-it_IT.po | 1810 ++--- i18n/languages/backend/wprockf-pt_BR.mo | Bin 57913 -> 57891 bytes i18n/languages/backend/wprockf-pt_BR.po | 1810 ++--- i18n/languages/backend/wprockf-ru_RU.mo | Bin 66606 -> 66584 bytes i18n/languages/backend/wprockf-ru_RU.po | 1810 ++--- i18n/languages/backend/wprockf-zh_CN.mo | Bin 57656 -> 57634 bytes i18n/languages/backend/wprockf-zh_CN.po | 1810 ++--- i18n/languages/backend/wprockf.pot | 1810 ++--- i18n/languages/front/wprockf-de_DE.po | 60 +- i18n/languages/front/wprockf-en_US.po | 60 +- i18n/languages/front/wprockf-es_ES.po | 60 +- i18n/languages/front/wprockf-fr_FR.po | 60 +- i18n/languages/front/wprockf-it_IT.po | 60 +- i18n/languages/front/wprockf-pt_BR.po | 60 +- i18n/languages/front/wprockf-ru_RU.po | 60 +- i18n/languages/front/wprockf-zh_CN.po | 60 +- i18n/languages/front/wprockf.pot | 64 +- install/db/structure.sql | 6 +- install/db/structure_mysql8.sql | 6 +- install/includes/core_class.php | 4 +- install/index.php | 2 +- install/templates/completed.php | 2 +- install/templates/data_config.php | 2 +- install/templates/database_config.php | 2 +- install/templates/licence.php | 2 +- install/templates/pre_install.php | 2 +- readme.txt | 8 +- system/database/DB_cache.php | 2 +- system/libraries/Calendar.php | 2 +- system/libraries/Cart.php | 2 +- system/libraries/Encrypt.php | 2 +- system/libraries/Pagination.php | 2 +- system/libraries/Session.php | 2 +- vendor/autoload.php | 2 +- vendor/composer/autoload_real.php | 14 +- vendor/composer/autoload_static.php | 8 +- 373 files changed, 48535 insertions(+), 47907 deletions(-) delete mode 100644 application/config/database.php.~2~ create mode 100755 application/modules/formbuilder/views/settings/system_db.json diff --git a/README.md b/README.md index b54fcbd7..92834579 100755 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ https://kb.softdiscover.com/docs/zigaform-php-cost-estimator/installation/via-wi ## Support ## -Please see https://php-cost-estimator.zigaform.com/#contact for more details. +Please see https://softdiscover.com/zigaform/php-cost-estimator/#contact for more details. ### Features: * real-time drag and drop form builder which makes to build estimation forms @@ -74,7 +74,7 @@ Please see https://php-cost-estimator.zigaform.com/#contact for more details. > >Try out [Zigaform - PHP Cost Estimation & Payment Form Builder Premium](https://codecanyon.net/item/zigaform-php-calculator-cost-estimation-form-builder/15883447?ref=softdiscover) -More info in https://php-cost-estimator.zigaform.com/ +More info in https://softdiscover.com/zigaform/php-cost-estimator/   ** OVERALL FEATURES diff --git a/application/config/constants.php b/application/config/constants.php index 7fce33c3..891e5253 100755 --- a/application/config/constants.php +++ b/application/config/constants.php @@ -1,7 +1,7 @@ load->language_alt(model_settings::$db_config['language']); + $this->template->set('controller', $this); + $this->load->model('model_addon'); - protected $modules; + // admin resources + add_action('admin_enqueue_scripts', array( &$this, 'loadStyle' )); + add_filter('zgfm_back_filter_globalvars', array( &$this, 'filter_add_globalvariable' )); + } + /* + * update addon status + */ + public function listaddon_updateStatus() + { - /** - * Constructor - * - * @mvc Controller - */ - function __construct() { + $data = array(); + $add_name = ( $_POST['add_name'] ) ? Uiform_Form_Helper::sanitizeInput(trim($_POST['add_name'])) : ''; + $add_status = ( $_POST['add_status'] ) ? Uiform_Form_Helper::sanitizeInput(trim($_POST['add_status'])) : '0'; - parent::__construct(); - $this->load->language_alt( model_settings::$db_config['language'] ); - $this->template->set( 'controller', $this ); - $this->load->model( 'model_addon' ); - - // admin resources - add_action( 'admin_enqueue_scripts', array( &$this, 'loadStyle' ) ); - - add_filter( 'zgfm_back_filter_globalvars', array( &$this, 'filter_add_globalvariable' ) ); - } - - /* - * update addon status - */ - public function listaddon_updateStatus() { - - $data = array(); - $add_name = ( $_POST['add_name'] ) ? Uiform_Form_Helper::sanitizeInput( trim( $_POST['add_name'] ) ) : ''; - $add_status = ( $_POST['add_status'] ) ? Uiform_Form_Helper::sanitizeInput( trim( $_POST['add_status'] ) ) : '0'; - - $data['flag_status'] = $add_status; - $json = array(); - if ( $this->model_addon->existAddon( $add_name ) ) { - - $this->db->set( $data ); - $this->db->where( 'add_name', $add_name ); - $this->db->update( $this->model_addon->table ); - - } - - $json['status'] = 'updated'; - - // return data to ajax callback - header( 'Content-Type: application/json' ); - echo json_encode( $json ); - die(); - } - - public function filter_add_globalvariable( $value ) { - $value['addon'] = self::$_addons_jsactions; - return $value; - } - - /* - * Show extensions - */ - public function list_extensions() { - - $data = array(); - $data['query'] = $this->model_addon->getListAddons( 100, 0 ); - $data['wp_version'] = UIFORM_VERSION; - // $this->template->loadPartial('layout', 'addon/zfad_backend/list_extensions', $data); - $this->template->loadPartial( 'layout', 'backend/list_extensions', $data ); - } - - - public function loadStyle() { - // load - - ob_start(); - ?> - - - model_addon->getListAddonsByBack(); - - // flag variables - $tmp_addons_arr = array(); - $tmp_modules_arr = self::$_addons; - - // storing lib objects - foreach ( $tmp_addons as $key => $value ) { - - // load addons - // require_once( FCPATH . '/modules/addon_'.$value->add_name.'/controllers/backend.php'); - - $tmp_add_new_contr = array(); - - // $tmp_add_new_contr['backend'] = 'zfad_'.$value->add_name.'_back'; - $tmp_add_new_contr['backend'] = modules::run( 'addon_' . $value->add_name . '/zfad_' . $value->add_name . '_back/get_instance' ); - - $tmp_add_new_flag = array(); - - // $tmp_add_new_flag = call_user_func(array($tmp_add_new_contr['backend'], 'add_controllers')); - // $tmp_add_new_flag = modules::run('addon_'.$value->add_name.'/'.$tmp_add_new_contr['backend'].'/add_controllers'); - $tmp_add_new_flag = call_user_func( array( $tmp_add_new_contr['backend'], 'add_controllers' ) ); - - $tmp_add_new_contr = array_merge( $tmp_add_new_contr, $tmp_add_new_flag ); - - self::$_addons[ $value->add_name ] = $tmp_add_new_contr; - - } - - } - - - public function load_addActions() { - - $tmp_addons = self::$_addons; - - $tmp_addons_actions = array(); - - /* - pending to add cache*/ - // loop addons - foreach ( $tmp_addons as $key => $value ) { - // loop controllers - foreach ( $value as $key2 => $value2 ) { - - $tmp_flag = array(); - $tmp_flag = $value2->local_back_actions; - - if ( ! empty( $tmp_flag ) ) { - foreach ( $tmp_flag as $key3 => $value3 ) { - $tmp_addons_actions[ $value3['action'] ][ $value3['priority'] ][ $key ] = array( - 'function' => $value3['function'], - 'accepted_args' => $value3['accepted_args'], - 'controller' => $key2, - - ); - } - } - } - } - - self::$_addons_actions = $tmp_addons_actions; - - // add js actions - $tmp_addons_actions = array(); - - /* - pending to add cache*/ - // loop addons - foreach ( $tmp_addons as $key => $value ) { - // loop controllers - foreach ( $value as $key2 => $value2 ) { - - $tmp_flag = array(); - $tmp_flag = $value2->js_back_actions; - - if ( ! empty( $tmp_flag ) ) { - foreach ( $tmp_flag as $key3 => $value3 ) { - $tmp_addons_actions[ $value3['action'] ][ $value3['priority'] ][ $key ] = array( - 'function' => $value3['function'], - 'accepted_args' => $value3['accepted_args'], - 'controller' => $value3['controller'], - - ); - } - } - } - } - - self::$_addons_jsactions = $tmp_addons_actions; - - } - - - - public function addons_doActions( $section = '', $return_array = false ) { - - if ( empty( self::$_addons_actions[ $section ] ) ) { - return ''; - } - - $tmp_addons = self::$_addons_actions[ $section ]; - - if ( $return_array ) { - $tmp_str = array(); - } else { - $tmp_str = ''; - } - - if ( ! empty( $tmp_addons ) ) { - foreach ( $tmp_addons as $key => $value ) { - foreach ( $value as $key2 => $value2 ) { - if ( $return_array ) { - $tmp_str[] = call_user_func( array( self::$_addons[ $key2 ][ $value2['controller'] ], $value2['function'] ) ); - } else { - $tmp_str .= call_user_func( array( self::$_addons[ $key2 ][ $value2['controller'] ], $value2['function'] ) ); - } - } - } - } - - return $tmp_str; - - } - - public function get_addon_content( $addon_name ) { - - // return 'here loading content of addon '.$addon_name; - } - - - /** - * Register callbacks for actions and filters - * - * @mvc Controller - */ - public function register_hook_callbacks() { - - } - - /** - * Initializes variables - * - * @mvc Controller - */ - public function init() { - - try { - // $instance_example = new WPPS_Instance_Class( 'Instance example', '42' ); - // add_notice('ba'); - } catch ( Exception $exception ) { - add_notice( __METHOD__ . ' error: ' . $exception->getMessage(), 'error' ); - } - } - - /* - * Instance methods - */ - - /** - * Prepares sites to use the plugin during single or network-wide activation - * - * @mvc Controller - * - * @param bool $network_wide - */ - public function activate( $network_wide ) { - - return true; - } - - /** - * Rolls back activation procedures when de-activating the plugin - * - * @mvc Controller - */ - public function deactivate() { - return true; - } - - /** - * Checks if the plugin was recently updated and upgrades if necessary - * - * @mvc Controller - * - * @param string $db_version - */ - public function upgrade( $db_version = 0 ) { - return true; - } - - /** - * Checks that the object is in a correct state - * - * @mvc Model - * - * @param string $property An individual property to check, or 'all' to check all of them - * @return bool - */ - protected function is_valid( $property = 'all' ) { - return true; - } + $data['flag_status'] = $add_status; + $json = array(); + if ( $this->model_addon->existAddon($add_name)) { + $this->db->set($data); + $this->db->where('add_name', $add_name); + $this->db->update($this->model_addon->table); + } + + $json['status'] = 'updated'; + + // return data to ajax callback + header('Content-Type: application/json'); + echo json_encode($json); + die(); + } + + public function filter_add_globalvariable($value) + { + $value['addon'] = self::$_addons_jsactions; + return $value; + } + + /* + * Show extensions + */ + public function list_extensions() + { + + $data = array(); + $data['query'] = $this->model_addon->getListAddons(100, 0); + $data['wp_version'] = UIFORM_VERSION; + // $this->template->loadPartial('layout', 'addon/zfad_backend/list_extensions', $data); + $this->template->loadPartial('layout', 'backend/list_extensions', $data); + } + + + public function loadStyle() + { + // load + + ob_start(); + ?> + + + model_addon->getListAddonsByBack(); + + // flag variables + $tmp_addons_arr = array(); + $tmp_modules_arr = self::$_addons; + + // storing lib objects + foreach ( $tmp_addons as $key => $value) { + // load addons + // require_once( FCPATH . '/modules/addon_'.$value->add_name.'/controllers/backend.php'); + + $tmp_add_new_contr = array(); + + // $tmp_add_new_contr['backend'] = 'zfad_'.$value->add_name.'_back'; + $tmp_add_new_contr['backend'] = modules::run('addon_' . $value->add_name . '/zfad_' . $value->add_name . '_back/get_instance'); + + $tmp_add_new_flag = array(); + + // $tmp_add_new_flag = call_user_func(array($tmp_add_new_contr['backend'], 'add_controllers')); + // $tmp_add_new_flag = modules::run('addon_'.$value->add_name.'/'.$tmp_add_new_contr['backend'].'/add_controllers'); + $tmp_add_new_flag = call_user_func(array( $tmp_add_new_contr['backend'], 'add_controllers' )); + + $tmp_add_new_contr = array_merge($tmp_add_new_contr, $tmp_add_new_flag); + + self::$_addons[ $value->add_name ] = $tmp_add_new_contr; + } + } + + + public function load_addActions() + { + + $tmp_addons = self::$_addons; + + $tmp_addons_actions = array(); + + /* + pending to add cache*/ + // loop addons + foreach ( $tmp_addons as $key => $value) { + // loop controllers + foreach ( $value as $key2 => $value2) { + $tmp_flag = array(); + $tmp_flag = $value2->local_back_actions; + + if ( ! empty($tmp_flag)) { + foreach ( $tmp_flag as $key3 => $value3) { + $tmp_addons_actions[ $value3['action'] ][ $value3['priority'] ][ $key ] = array( + 'function' => $value3['function'], + 'accepted_args' => $value3['accepted_args'], + 'controller' => $key2, + + ); + } + } + } + } + + self::$_addons_actions = $tmp_addons_actions; + + // add js actions + $tmp_addons_actions = array(); + + /* + pending to add cache*/ + // loop addons + foreach ( $tmp_addons as $key => $value) { + // loop controllers + foreach ( $value as $key2 => $value2) { + $tmp_flag = array(); + $tmp_flag = $value2->js_back_actions; + + if ( ! empty($tmp_flag)) { + foreach ( $tmp_flag as $key3 => $value3) { + $tmp_addons_actions[ $value3['action'] ][ $value3['priority'] ][ $key ] = array( + 'function' => $value3['function'], + 'accepted_args' => $value3['accepted_args'], + 'controller' => $value3['controller'], + + ); + } + } + } + } + + self::$_addons_jsactions = $tmp_addons_actions; + } + + + + public function addons_doActions($section = '', $return_array = false) + { + + if ( empty(self::$_addons_actions[ $section ])) { + return ''; + } + + $tmp_addons = self::$_addons_actions[ $section ]; + + if ( $return_array) { + $tmp_str = array(); + } else { + $tmp_str = ''; + } + + if ( ! empty($tmp_addons)) { + foreach ( $tmp_addons as $key => $value) { + foreach ( $value as $key2 => $value2) { + if ( $return_array) { + $tmp_str[] = call_user_func(array( self::$_addons[ $key2 ][ $value2['controller'] ], $value2['function'] )); + } else { + $tmp_str .= call_user_func(array( self::$_addons[ $key2 ][ $value2['controller'] ], $value2['function'] )); + } + } + } + } + + return $tmp_str; + } + + public function get_addon_content($addon_name) + { + + // return 'here loading content of addon '.$addon_name; + } + + + /** + * Register callbacks for actions and filters + * + * @mvc Controller + */ + public function register_hook_callbacks() + { + } + + /** + * Initializes variables + * + * @mvc Controller + */ + public function init() + { + + try { + // $instance_example = new WPPS_Instance_Class( 'Instance example', '42' ); + // add_notice('ba'); + } catch ( Exception $exception) { + add_notice(__METHOD__ . ' error: ' . $exception->getMessage(), 'error'); + } + } + + /* + * Instance methods + */ + + /** + * Prepares sites to use the plugin during single or network-wide activation + * + * @mvc Controller + * + * @param bool $network_wide + */ + public function activate($network_wide) + { + + return true; + } + + /** + * Rolls back activation procedures when de-activating the plugin + * + * @mvc Controller + */ + public function deactivate() + { + return true; + } + + /** + * Checks if the plugin was recently updated and upgrades if necessary + * + * @mvc Controller + * + * @param string $db_version + */ + public function upgrade($db_version = 0) + { + return true; + } + + /** + * Checks that the object is in a correct state + * + * @mvc Model + * + * @param string $property An individual property to check, or 'all' to check all of them + * @return bool + */ + protected function is_valid($property = 'all') + { + return true; + } } ?> diff --git a/application/modules/addon/controllers/zfad_common.php b/application/modules/addon/controllers/zfad_common.php index 1d68f9c8..325322a3 100755 --- a/application/modules/addon/controllers/zfad_common.php +++ b/application/modules/addon/controllers/zfad_common.php @@ -11,10 +11,10 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: intranet.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link http://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } /** @@ -26,101 +26,105 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version Release: 1.00 - * @link http://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -class zfad_common extends BackendController { - - const VERSION = '0.1'; - private $pagination = ''; - var $per_page = 5; - - protected $modules; - - - /** - * Constructor - * - * @mvc Controller - */ - function __construct() { - parent::__construct(); - $this->load->language_alt( model_settings::$db_config['language'] ); - // $this->template->set('controller', $this); - // $this->load->model('model_addon'); - } - - /** - * Register callbacks for actions and filters - * - * @mvc Controller - */ - public function register_hook_callbacks() { - - } - - /** - * Initializes variables - * - * @mvc Controller - */ - public function init() { - - try { - // $instance_example = new WPPS_Instance_Class( 'Instance example', '42' ); - // add_notice('ba'); - } catch ( Exception $exception ) { - add_notice( __METHOD__ . ' error: ' . $exception->getMessage(), 'error' ); - } - } - - /* - * Instance methods - */ - - /** - * Prepares sites to use the plugin during single or network-wide activation - * - * @mvc Controller - * - * @param bool $network_wide - */ - public function activate( $network_wide ) { - - return true; - } - - /** - * Rolls back activation procedures when de-activating the plugin - * - * @mvc Controller - */ - public function deactivate() { - return true; - } - - /** - * Checks if the plugin was recently updated and upgrades if necessary - * - * @mvc Controller - * - * @param string $db_version - */ - public function upgrade( $db_version = 0 ) { - return true; - } - - /** - * Checks that the object is in a correct state - * - * @mvc Model - * - * @param string $property An individual property to check, or 'all' to check all of them - * @return bool - */ - protected function is_valid( $property = 'all' ) { - return true; - } - +class zfad_common extends BackendController +{ + + const VERSION = '0.1'; + private $pagination = ''; + private $per_page = 5; + + protected $modules; + + + /** + * Constructor + * + * @mvc Controller + */ + public function __construct() + { + parent::__construct(); + $this->load->language_alt(model_settings::$db_config['language']); + // $this->template->set('controller', $this); + // $this->load->model('model_addon'); + } + + /** + * Register callbacks for actions and filters + * + * @mvc Controller + */ + public function register_hook_callbacks() + { + } + + /** + * Initializes variables + * + * @mvc Controller + */ + public function init() + { + + try { + // $instance_example = new WPPS_Instance_Class( 'Instance example', '42' ); + // add_notice('ba'); + } catch ( Exception $exception) { + add_notice(__METHOD__ . ' error: ' . $exception->getMessage(), 'error'); + } + } + + /* + * Instance methods + */ + + /** + * Prepares sites to use the plugin during single or network-wide activation + * + * @mvc Controller + * + * @param bool $network_wide + */ + public function activate($network_wide) + { + + return true; + } + + /** + * Rolls back activation procedures when de-activating the plugin + * + * @mvc Controller + */ + public function deactivate() + { + return true; + } + + /** + * Checks if the plugin was recently updated and upgrades if necessary + * + * @mvc Controller + * + * @param string $db_version + */ + public function upgrade($db_version = 0) + { + return true; + } + + /** + * Checks that the object is in a correct state + * + * @mvc Model + * + * @param string $property An individual property to check, or 'all' to check all of them + * @return bool + */ + protected function is_valid($property = 'all') + { + return true; + } } - - diff --git a/application/modules/addon/controllers/zfad_frontend.php b/application/modules/addon/controllers/zfad_frontend.php index b0e55310..9d93adeb 100755 --- a/application/modules/addon/controllers/zfad_frontend.php +++ b/application/modules/addon/controllers/zfad_frontend.php @@ -11,10 +11,10 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: intranet.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link http://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } /** @@ -26,222 +26,222 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version Release: 1.00 - * @link http://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -class zfad_frontend extends FrontendController { +class zfad_frontend extends FrontendController +{ - const VERSION = '0.1'; - private $pagination = ''; - var $per_page = 5; + const VERSION = '0.1'; + private $pagination = ''; + private $per_page = 5; - protected $modules; + protected $modules; - /** - * Constructor - * - * @mvc Controller - */ - function __construct() { - parent::__construct(); - $this->load->language_alt( model_settings::$db_config['language'] ); - // $this->template->set('controller', $this); - $this->load->model( 'model_addon' ); + /** + * Constructor + * + * @mvc Controller + */ + public function __construct() + { + parent::__construct(); + $this->load->language_alt(model_settings::$db_config['language']); + // $this->template->set('controller', $this); + $this->load->model('model_addon'); + } - } + public function load_addonsByFront() + { - public function load_addonsByFront() { + // get addons + $tmp_addons = $this->model_addon->getListAddonsByFront(); - // get addons - $tmp_addons = $this->model_addon->getListAddonsByFront(); + // flag variables + $tmp_addons_arr = array(); + $tmp_modules_arr = self::$_addons; - // flag variables - $tmp_addons_arr = array(); - $tmp_modules_arr = self::$_addons; + foreach ( $tmp_addons as $key => $value) { + // $tmp_addons_arr[$value->add_section][$value->add_name]=$tmp_addons[$key]; - foreach ( $tmp_addons as $key => $value ) { - // $tmp_addons_arr[$value->add_section][$value->add_name]=$tmp_addons[$key]; + // load addons + // require_once( FCPATH . '/modules/addon_'.$value->add_name.'/controllers/frontend.php'); - // load addons - // require_once( FCPATH . '/modules/addon_'.$value->add_name.'/controllers/frontend.php'); + // $tmp_modules_arr['addon_'.$value->add_name]=array( 'back' => call_user_func( array( 'zfaddn_back_'.$value->add_name, 'get_instance' ) )); - // $tmp_modules_arr['addon_'.$value->add_name]=array( 'back' => call_user_func( array( 'zfaddn_back_'.$value->add_name, 'get_instance' ) )); + $tmp_add_new_contr = array(); + // $tmp_add_new_contr['frontend'] = call_user_func(array('zfaddn_'.$value->add_name.'_front', 'get_instance')); + $tmp_add_new_contr['frontend'] = modules::run('addon_' . $value->add_name . '/zfad_' . $value->add_name . '_front/get_instance'); - $tmp_add_new_contr = array(); - // $tmp_add_new_contr['frontend'] = call_user_func(array('zfaddn_'.$value->add_name.'_front', 'get_instance')); - $tmp_add_new_contr['frontend'] = modules::run( 'addon_' . $value->add_name . '/zfad_' . $value->add_name . '_front/get_instance' ); + $tmp_add_new_flag = array(); + $tmp_add_new_flag = call_user_func(array( $tmp_add_new_contr['frontend'], 'add_controllers' )); - $tmp_add_new_flag = array(); - $tmp_add_new_flag = call_user_func( array( $tmp_add_new_contr['frontend'], 'add_controllers' ) ); - - $tmp_add_new_contr = array_merge( $tmp_add_new_contr, $tmp_add_new_flag ); - - // $tmp_modules_arr['addon_'.$value->add_name] = $tmp_add_new_contr; - self::$_addons[ $value->add_name ] = $tmp_add_new_contr; - } - - // self::$_addons = $tmp_addons_arr; - } - - public function load_addActions() { - - $tmp_addons = self::$_addons; - - $tmp_addons_actions = array(); - - /* - pending to add cache*/ - // loop addons - foreach ( $tmp_addons as $key => $value ) { - // loop controllers - foreach ( $value as $key2 => $value2 ) { - - $tmp_flag = array(); - $tmp_flag = $value2->local_actions; - - if ( ! empty( $tmp_flag ) ) { - foreach ( $tmp_flag as $key3 => $value3 ) { - $tmp_addons_actions[ $value3['action'] ][ $value3['priority'] ][ $key ] = array( - 'function' => $value3['function'], - 'accepted_args' => $value3['accepted_args'], - 'controller' => $key2, - - ); - } - } - } - } - - self::$_addons_actions = $tmp_addons_actions; - - // add js actions - $tmp_addons_actions = array(); - - /* - pending to add cache*/ - // loop addons - foreach ( $tmp_addons as $key => $value ) { - // loop controllers - foreach ( $value as $key2 => $value2 ) { - - $tmp_flag = array(); - $tmp_flag = $value2->js_actions; - - if ( ! empty( $tmp_flag ) ) { - foreach ( $tmp_flag as $key3 => $value3 ) { - $tmp_addons_actions[ $value3['action'] ][ $value3['priority'] ][ $key ] = array( - 'function' => $value3['function'], - 'accepted_args' => $value3['accepted_args'], - 'controller' => $value3['controller'], - - ); - } - } - } - } - - self::$_addons_jsactions = $tmp_addons_actions; - - } - - public function addons_doActions( $section = '' ) { - - if ( empty( self::$_addons_actions[ $section ] ) ) { - return ''; - } - - $tmp_addons = self::$_addons_actions[ $section ]; - - $tmp_str = ''; - - if ( ! empty( $tmp_addons ) ) { - foreach ( $tmp_addons as $key => $value ) { - foreach ( $value as $key2 => $value2 ) { - - $tmp_str .= call_user_func( array( self::$_addons[ $key2 ][ $value2['controller'] ], $value2['function'] ) ); - - } - } - } - - return $tmp_str; - - } - - - /** - * Register callbacks for actions and filters - * - * @mvc Controller - */ - public function register_hook_callbacks() { - - } - - /** - * Initializes variables - * - * @mvc Controller - */ - public function init() { - - try { - // $instance_example = new WPPS_Instance_Class( 'Instance example', '42' ); - // add_notice('ba'); - } catch ( Exception $exception ) { - add_notice( __METHOD__ . ' error: ' . $exception->getMessage(), 'error' ); - } - } - - /* - * Instance methods - */ - - /** - * Prepares sites to use the plugin during single or network-wide activation - * - * @mvc Controller - * - * @param bool $network_wide - */ - public function activate( $network_wide ) { - - return true; - } - - /** - * Rolls back activation procedures when de-activating the plugin - * - * @mvc Controller - */ - public function deactivate() { - return true; - } - - /** - * Checks if the plugin was recently updated and upgrades if necessary - * - * @mvc Controller - * - * @param string $db_version - */ - public function upgrade( $db_version = 0 ) { - return true; - } - - /** - * Checks that the object is in a correct state - * - * @mvc Model - * - * @param string $property An individual property to check, or 'all' to check all of them - * @return bool - */ - protected function is_valid( $property = 'all' ) { - return true; - } + $tmp_add_new_contr = array_merge($tmp_add_new_contr, $tmp_add_new_flag); + // $tmp_modules_arr['addon_'.$value->add_name] = $tmp_add_new_contr; + self::$_addons[ $value->add_name ] = $tmp_add_new_contr; + } + + // self::$_addons = $tmp_addons_arr; + } + + public function load_addActions() + { + + $tmp_addons = self::$_addons; + + $tmp_addons_actions = array(); + + /* + pending to add cache*/ + // loop addons + foreach ( $tmp_addons as $key => $value) { + // loop controllers + foreach ( $value as $key2 => $value2) { + $tmp_flag = array(); + $tmp_flag = $value2->local_actions; + + if ( ! empty($tmp_flag)) { + foreach ( $tmp_flag as $key3 => $value3) { + $tmp_addons_actions[ $value3['action'] ][ $value3['priority'] ][ $key ] = array( + 'function' => $value3['function'], + 'accepted_args' => $value3['accepted_args'], + 'controller' => $key2, + + ); + } + } + } + } + + self::$_addons_actions = $tmp_addons_actions; + + // add js actions + $tmp_addons_actions = array(); + + /* + pending to add cache*/ + // loop addons + foreach ( $tmp_addons as $key => $value) { + // loop controllers + foreach ( $value as $key2 => $value2) { + $tmp_flag = array(); + $tmp_flag = $value2->js_actions; + + if ( ! empty($tmp_flag)) { + foreach ( $tmp_flag as $key3 => $value3) { + $tmp_addons_actions[ $value3['action'] ][ $value3['priority'] ][ $key ] = array( + 'function' => $value3['function'], + 'accepted_args' => $value3['accepted_args'], + 'controller' => $value3['controller'], + + ); + } + } + } + } + + self::$_addons_jsactions = $tmp_addons_actions; + } + + public function addons_doActions($section = '') + { + + if ( empty(self::$_addons_actions[ $section ])) { + return ''; + } + + $tmp_addons = self::$_addons_actions[ $section ]; + + $tmp_str = ''; + + if ( ! empty($tmp_addons)) { + foreach ( $tmp_addons as $key => $value) { + foreach ( $value as $key2 => $value2) { + $tmp_str .= call_user_func(array( self::$_addons[ $key2 ][ $value2['controller'] ], $value2['function'] )); + } + } + } + + return $tmp_str; + } + + + /** + * Register callbacks for actions and filters + * + * @mvc Controller + */ + public function register_hook_callbacks() + { + } + + /** + * Initializes variables + * + * @mvc Controller + */ + public function init() + { + + try { + // $instance_example = new WPPS_Instance_Class( 'Instance example', '42' ); + // add_notice('ba'); + } catch ( Exception $exception) { + add_notice(__METHOD__ . ' error: ' . $exception->getMessage(), 'error'); + } + } + + /* + * Instance methods + */ + + /** + * Prepares sites to use the plugin during single or network-wide activation + * + * @mvc Controller + * + * @param bool $network_wide + */ + public function activate($network_wide) + { + + return true; + } + + /** + * Rolls back activation procedures when de-activating the plugin + * + * @mvc Controller + */ + public function deactivate() + { + return true; + } + + /** + * Checks if the plugin was recently updated and upgrades if necessary + * + * @mvc Controller + * + * @param string $db_version + */ + public function upgrade($db_version = 0) + { + return true; + } + + /** + * Checks that the object is in a correct state + * + * @mvc Model + * + * @param string $property An individual property to check, or 'all' to check all of them + * @return bool + */ + protected function is_valid($property = 'all') + { + return true; + } } - - diff --git a/application/modules/addon/models/model_addon.php b/application/modules/addon/models/model_addon.php index b83d2ec8..348992e9 100755 --- a/application/modules/addon/models/model_addon.php +++ b/application/modules/addon/models/model_addon.php @@ -10,10 +10,10 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } @@ -26,23 +26,26 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version Release: 1.00 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -class model_addon extends CI_Model { +class model_addon extends CI_Model +{ - public $table = ''; - public $tbaddon_details = ''; + public $table = ''; + public $tbaddon_details = ''; - function __construct() { - parent::__construct(); - $this->table = $this->db->dbprefix . 'cest_addon'; - $this->tbaddon_details = $this->db->dbprefix . 'cest_addon_details'; - } + public function __construct() + { + parent::__construct(); + $this->table = $this->db->dbprefix . 'cest_addon'; + $this->tbaddon_details = $this->db->dbprefix . 'cest_addon_details'; + } - function getListAddonsByBack() { - $query = sprintf( - ' + public function getListAddonsByBack() + { + $query = sprintf( + ' select c.add_name ,c.add_title ,c.add_info @@ -71,16 +74,17 @@ function getListAddonsByBack() { and c.add_load_back=1 ORDER BY c.add_order desc ', - $this->table - ); + $this->table + ); - $query2 = $this->db->query( $query ); - return $query2->result(); - } + $query2 = $this->db->query($query); + return $query2->result(); + } - function getListAddonsByFront() { - $query = sprintf( - ' + public function getListAddonsByFront() + { + $query = sprintf( + ' select c.add_name ,c.add_title ,c.add_info @@ -109,40 +113,42 @@ function getListAddonsByFront() { and c.add_load_front=1 ORDER BY c.add_order desc ', - $this->table - ); + $this->table + ); - $query2 = $this->db->query( $query ); - return $query2->result(); - } + $query2 = $this->db->query($query); + return $query2->result(); + } - function getActiveAddonsNamesOnBack() { - $query = sprintf( - ' + public function getActiveAddonsNamesOnBack() + { + $query = sprintf( + ' select c.add_name from %s c where c.flag_status=1 and c.add_load_back=1 ORDER BY c.add_order desc ', - $this->table - ); + $this->table + ); - $query2 = $this->db->query( $query ); - $tmp_result = $query2->result(); + $query2 = $this->db->query($query); + $tmp_result = $query2->result(); - $result = array(); - foreach ( $tmp_result as $key => $value ) { - $result[] = $value->add_name; - } + $result = array(); + foreach ( $tmp_result as $key => $value) { + $result[] = $value->add_name; + } - return $result; - } + return $result; + } - function getAddonsNamesOnBackByForm( $idform ) { - $query = sprintf( - ' + public function getAddonsNamesOnBackByForm($idform) + { + $query = sprintf( + ' select c.add_name from %s c left join %s ad on ad.add_name = c.add_name @@ -150,27 +156,28 @@ function getAddonsNamesOnBackByForm( $idform ) { and c.add_load_back=1 ORDER BY c.add_order desc ', - $this->table, - $this->tbaddon_details, - $idform - ); + $this->table, + $this->tbaddon_details, + $idform + ); - $query2 = $this->db->query( $query ); - $tmp_result = $query2->result(); + $query2 = $this->db->query($query); + $tmp_result = $query2->result(); - $result = array(); - foreach ( $tmp_result as $key => $value ) { - $result[] = $value->add_name; - } + $result = array(); + foreach ( $tmp_result as $key => $value) { + $result[] = $value->add_name; + } - return $result; - } + return $result; + } - function getListAddonsBySection( $section = '' ) { - $query = sprintf( - ' + public function getListAddonsBySection($section = '') + { + $query = sprintf( + ' select c.add_name ,c.add_title ,c.add_info @@ -199,26 +206,27 @@ function getListAddonsBySection( $section = '' ) { and c.add_section="%s" ORDER BY c.add_section_order desc ', - $this->table, - $section - ); + $this->table, + $section + ); - $query2 = $this->db->query( $query ); - return $query2->result(); - } + $query2 = $this->db->query($query); + return $query2->result(); + } - /** - * addonmodel::getListAddon() - * List form estimator - * - * @param int $per_page max number of form estimators - * @param int $segment Number of pagination - * - * @return array - */ - function getListAddons( $per_page = '', $segment = '' ) { - $query = sprintf( - ' + /** + * addonmodel::getListAddon() + * List form estimator + * + * @param int $per_page max number of form estimators + * @param int $segment Number of pagination + * + * @return array + */ + public function getListAddons($per_page = '', $segment = '') + { + $query = sprintf( + ' select c.add_name, c.add_title, c.add_info, c.flag_status, c.add_params, extractvalue(c.add_xml, "/params/child::required_wp") as required_wp, extractvalue(c.add_xml, "/params/child::required_php") as required_php @@ -226,37 +234,34 @@ function getListAddons( $per_page = '', $segment = '' ) { where c.flag_status>=0 ORDER BY c.created_date desc ', - $this->table - ); + $this->table + ); - if ( $per_page != '' || $segment != '' ) { - $segment = ( ! empty( $segment ) ) ? $segment : 0; - $query .= sprintf( ' limit %s,%s', (int) $segment, (int) $per_page ); - } - $query2 = $this->db->query( $query ); - return $query2->result(); - } + if ( $per_page != '' || $segment != '') { + $segment = ( ! empty($segment) ) ? $segment : 0; + $query .= sprintf(' limit %s,%s', (int) $segment, (int) $per_page); + } + $query2 = $this->db->query($query); + return $query2->result(); + } - function existAddon( $addon_name ) { - $query = sprintf( - 'select + public function existAddon($addon_name) + { + $query = sprintf( + 'select COUNT(*) as count from %s ad where ad.add_name ="%s" ', - $this->table, - $addon_name - ); - $query2 = $this->db->query( $query ); - - $row = $query2->row(); - if ( intval( $row->count ) > 0 ) { - return 1; - } else { - return 0; - } - } - + $this->table, + $addon_name + ); + $query2 = $this->db->query($query); + $row = $query2->row(); + if ( intval($row->count) > 0) { + return 1; + } else { + return 0; + } + } } - - diff --git a/application/modules/addon/models/model_addon_details.php b/application/modules/addon/models/model_addon_details.php index 0ebbac02..a95e8220 100755 --- a/application/modules/addon/models/model_addon_details.php +++ b/application/modules/addon/models/model_addon_details.php @@ -10,13 +10,13 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } -if ( class_exists( 'model_addon_details' ) ) { - return; +if ( class_exists('model_addon_details')) { + return; } /** @@ -28,23 +28,26 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version Release: 1.00 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -class model_addon_details extends CI_Model { +class model_addon_details extends CI_Model +{ - public $table = ''; - public $tbaddon = ''; + public $table = ''; + public $tbaddon = ''; - function __construct() { - parent::__construct(); - $this->table = $this->db->dbprefix . 'cest_addon_details'; - $this->tbaddon = $this->db->dbprefix . 'cest_addon'; - } + public function __construct() + { + parent::__construct(); + $this->table = $this->db->dbprefix . 'cest_addon_details'; + $this->tbaddon = $this->db->dbprefix . 'cest_addon'; + } - function getAddonDataByForm( $addon_name, $form_id ) { - $query = sprintf( - ' + public function getAddonDataByForm($addon_name, $form_id) + { + $query = sprintf( + ' select ad.adet_data from %s c left join %s ad on ad.add_name = c.add_name @@ -52,37 +55,35 @@ function getAddonDataByForm( $addon_name, $form_id ) { and c.add_load_back=1 ORDER BY c.add_order desc ', - $this->tbaddon, - $this->table, - (int) $form_id, - $addon_name - ); + $this->tbaddon, + $this->table, + (int) $form_id, + $addon_name + ); - $query2 = $this->db->query( $query ); - return $query2->row(); - } + $query2 = $this->db->query($query); + return $query2->row(); + } - function existRecord( $addon_name, $form_id ) { - $query = sprintf( - 'select + public function existRecord($addon_name, $form_id) + { + $query = sprintf( + 'select COUNT(*) as count from %s ad where ad.add_name ="%s" and ad.fmb_id=%s', - $this->table, - $addon_name, - (int) $form_id - ); - $query2 = $this->db->query( $query ); - $row = $query2->row(); - - if ( intval( $row->count ) > 0 ) { - return 1; - } else { - return 0; - } - } + $this->table, + $addon_name, + (int) $form_id + ); + $query2 = $this->db->query($query); + $row = $query2->row(); + if ( intval($row->count) > 0) { + return 1; + } else { + return 0; + } + } } - - diff --git a/application/modules/addon/models/model_addon_details_log.php b/application/modules/addon/models/model_addon_details_log.php index 70df2e3e..93371d1f 100755 --- a/application/modules/addon/models/model_addon_details_log.php +++ b/application/modules/addon/models/model_addon_details_log.php @@ -10,13 +10,13 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } -if ( class_exists( 'model_addon_details_log' ) ) { - return; +if ( class_exists('model_addon_details_log')) { + return; } /** @@ -28,22 +28,18 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version Release: 1.00 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -class model_addon_details_log extends CI_Model { - - - public $table = ''; - public $tbaddon_details = ''; - - function __construct() { - parent::__construct(); - $this->table = $this->db->dbprefix . 'cest_addon_details_log'; - } - +class model_addon_details_log extends CI_Model +{ + public $table = ''; + public $tbaddon_details = ''; + public function __construct() + { + parent::__construct(); + $this->table = $this->db->dbprefix . 'cest_addon_details_log'; + } } - - diff --git a/application/modules/addon/views/backend/list_extensions.php b/application/modules/addon/views/backend/list_extensions.php index 8e3c00cc..5b901070 100755 --- a/application/modules/addon/views/backend/list_extensions.php +++ b/application/modules/addon/views/backend/list_extensions.php @@ -9,97 +9,98 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?>
-
-
-
+
+
+
-
- -
- -
- -
-
-
    - $value ) { ?> -
  • -
    -
    add_title; ?>
    -
    add_info ); ?>
    - -
    -
    - -
    - - add_name ) === 'woocommerce' || strval( $value->add_name ) === 'mgtranslate' ) { - ?> - required_wp) || version_compare( PHP_VERSION, $value->required_php, '>=' ) ) { ?> - flag_status ) === 0 ) { ?> - - - - - - - - - - - - - -
    - -
    -
    - required_php ) ) { ?> -
      -
    • :
    • - -
    • : 7.2+ - required_php, '>=' ) ) { - ?> - - - - -
    • -
    - -
    -
    - -
    +
    + +
    + +
    + +
    +
    +
      + $value) { ?> +
    • +
      +
      add_title; ?>
      +
      add_info); ?>
      + +
      +
      + +
      + + add_name) === 'woocommerce' || strval($value->add_name) === 'mgtranslate') { + ?> + required_wp) || version_compare(PHP_VERSION, $value->required_php, '>=')) { ?> + flag_status) === 0) { ?> + + + + + + + + + + + + + +
      + +
      +
      + required_php)) { ?> +
        +
      • :
      • + +
      • : 7.2+ + required_php, '>=')) { + ?> + + + + +
      • +
      + +
      +
      + +
      -
    • - -
    -
    +
  • + +
+
-
-
+
+
diff --git a/application/modules/addon_mgtranslate/controllers/zfad_mgtranslate_back.php b/application/modules/addon_mgtranslate/controllers/zfad_mgtranslate_back.php index a938b960..a5bc0575 100755 --- a/application/modules/addon_mgtranslate/controllers/zfad_mgtranslate_back.php +++ b/application/modules/addon_mgtranslate/controllers/zfad_mgtranslate_back.php @@ -12,13 +12,13 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } -if ( class_exists( 'zfad_mgtranslate_back' ) ) { - return; +if ( class_exists('zfad_mgtranslate_back')) { + return; } /** @@ -30,428 +30,442 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version Release: 1.00 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -class zfad_mgtranslate_back extends BackendController { - - - const VERSION = '0.1'; - private $pagination = ''; - var $per_page = 5; - private $wpdb = ''; - var $CI; - - // adding routes - public $local_back_actions = array(); - - // adding js actions - public $js_back_actions = array(); - - /** - * Constructor - * - * @mvc Controller - */ - function __construct() { - parent::__construct(); - $this->CI =& get_instance(); - $this->load->language_alt( model_settings::$db_config['language'] ); - $this->template->set( 'controller', $this ); - - // Composer autoload - $composer_path = dirname( __FILE__ ) . '/../vendor/autoload.php'; - if ( file_exists( $composer_path ) ) { - require_once $composer_path; - } - - add_action( 'admin_menu', array( &$this, 'load_menu' ) ); - - // admin resources - add_action( 'admin_enqueue_scripts', array( &$this, 'load_dependencies' ), 20, 1 ); - - // add class to body if translator page is selected - //add_filter('admin_body_class', array( &$this, 'filter_body_class' )); - } - - /** - * ajax_create_lang - * - * @author Unknown - * @since v0.0.1 - * @version v1.0.0 Thursday, October 1st, 2020. - * @access public - * @return void - */ - public function ajax_create_lang() { - $resp = array(); - $resp['html_title'] = __( 'Translation Manager', 'FRocket_admin' ); - - try { - $newlangname = ( $_POST['newlangname'] ) ? Uiform_Form_Helper::sanitizeInput( trim( $_POST['newlangname'] ) ) : ''; - - $resp['html_footer'] = ''; - if ( preg_match( '/^[a-zA-Z0-9_]+$/', $newlangname ) ) { - - $file = FCPATH . 'i18n/languages/backend/wprockf-en_US.po'; - $newfile = FCPATH . 'i18n/languages/backend/wprockf-' . $newlangname . '.po'; - if ( ! copy( $file, $newfile ) ) { - throw new Exception( 'Error Processing Request', 1 ); - } else { - $file = FCPATH . 'i18n/languages/backend/wprockf-en_US.mo'; - $newfile = FCPATH . 'i18n/languages/backend/wprockf-' . $newlangname . '.mo'; - if ( ! copy( $file, $newfile ) ) { - throw new Exception( 'Error Processing Request', 1 ); - } else { - $file = FCPATH . 'i18n/languages/front/wprockf-en_US.mo'; - $newfile = FCPATH . 'i18n/languages/front/wprockf-' . $newlangname . '.mo'; - if ( ! copy( $file, $newfile ) ) { - throw new Exception( 'Error Processing Request', 1 ); - } else { - $file = FCPATH . 'i18n/languages/front/wprockf-en_US.po'; - $newfile = FCPATH . 'i18n/languages/front/wprockf-' . $newlangname . '.po'; - if ( ! copy( $file, $newfile ) ) { - throw new Exception( 'Error Processing Request', 1 ); - } else { - $resp['html'] = __( 'New translation created successfully', 'FRocket_admin' ); - } - } - } - } - //wp_send_json_success($resp); - $json = array(); - $json['success'] = 1; - $json['data'] = $resp; - echo json_encode( $json ); - die(); - } else { - throw new Exception( 'Error Processing Request', 1 ); - - } - } catch ( Exception $e ) { - $resp['html'] = __( 'Error! An error ocurred during the process', 'FRocket_admin' ); - //wp_send_json_error($resp); - $json = array(); - $json['success'] = 0; - $json['data'] = $resp; - echo json_encode( $json ); - die(); - } - - } - - /** - * ajax_new_lang. - * - * @author Unknown - * @since v0.0.1 - * @version v1.0.0 Thursday, October 1st, 2020. - * @access public - * @return void - */ - public function ajax_new_lang() { - - $resp = array(); - $resp['html_title'] = __( 'Translation Manager', 'FRocket_admin' ); - //$resp['html']=self::render_template('addon_mgtranslate/views/backend/ajax_new_lang.php', array()); - $resp['html'] = $this->load->view( 'addon_mgtranslate/backend/ajax_new_lang', array(), true ); - $resp['html_buttons'] = ''; - //wp_send_json_success($resp); - $json = array(); - $json['success'] = 1; - $json['data'] = $resp; - echo json_encode( $json ); - die(); - } - /** - * add class to body - * - * @access public - * @since 1.0.0 - * @return void - */ - public function filter_body_class( $classes ) { - $customClass = ''; - if ( isset( $_GET['page'] ) && $_GET['page'] == 'zigaform-translation' ) { - // id index exists - $customClass = 'sfdc-wrap sfdclauncher'; - } - return $classes . ' ' . $customClass; - } - - /** - * ajax_save_pofile. - * - * @author Unknown - * @since v0.0.1 - * @version v1.0.0 Thursday, October 1st, 2020. - * @access public - * @return void - */ - public function ajax_save_pofile() { - - $translation = ( isset( $_POST['translation'] ) && $_POST['translation'] ) ? array_map( array( 'Uiform_Form_Helper', 'sanitizeRecursive_html' ), $_POST['translation'] ) : array(); - $lang = ( $_POST['lang'] ) ? Uiform_Form_Helper::sanitizeInput( trim( $_POST['lang'] ) ) : ''; - $side = ( $_POST['side'] ) ? Uiform_Form_Helper::sanitizeInput( trim( $_POST['side'] ) ) : ''; - - $url = sprintf( FCPATH . 'i18n/languages/%s/wprockf-%s.po', $side, $lang ); - $urlMo = sprintf( FCPATH . 'i18n/languages/%s/wprockf-%s.mo', $side, $lang ); - $resp = array(); - if ( $lang == '' && ! file_exists( $url ) ) { - //wp_send_json_error($resp); - $json = array(); - $json['success'] = 0; - $json['data'] = $resp; - echo json_encode( $json ); - die(); - } - - //process - $parser = new PoParser\Parser(); - $parser->read( $url ); - $entries = $parser->getEntriesAsArrays(); - - $count = 1; - $newArr = array(); - foreach ( $translation as $key => $value ) { - $count2 = 1; - foreach ( $entries as $key2 => $value2 ) { - if ( $key === $count2 ) { - $newArr[] = array( - 'original' => $key2, - 'replace' => $value, - ); - break; - } - $count2++; - } - } - - //updating po file - $parser = new PoParser\Parser(); - $parser->read( $url ); - // updating changes - foreach ( $newArr as $key => $value ) { - $parser->updateEntry( $value['original'], $value['replace'] ); - } - $parser->write( $url ); - - //update po to mo - //import from a .po file: - $loader = new PoLoader(); - $translations = $loader->loadFile( $url ); - - //export to a .mo file: - $generator = new MoGenerator(); - $generator->generateFile( $translations, $urlMo ); - - $resp['lang'] = $lang; - $resp['side'] = $side; - $resp['translation'] = $translation; - $resp['replace'] = $newArr; - $resp['html_title'] = __( 'Translation Manager', 'FRocket_admin' ); - $resp['html'] = __( 'Translation saved successfully', 'FRocket_admin' ); - //wp_send_json_success($resp); - $json = array(); - $json['success'] = 1; - $json['data'] = $resp; - echo json_encode( $json ); - die(); - } - - /** - * load pofile - * - * @author Unknown - * @since v0.0.1 - * @version v1.0.0 Wednesday, September 30th, 2020. - * @access public - * @return void - */ - public function ajax_load_pofile() { - $lang = ( isset( $_POST['lang'] ) ) ? Uiform_Form_Helper::sanitizeInput( trim( $_POST['lang'] ) ) : ''; - $side = ( isset( $_POST['side'] ) ) ? Uiform_Form_Helper::sanitizeInput( trim( $_POST['side'] ) ) : 'backend'; - $resp = array(); - $url = sprintf( FCPATH . 'i18n/languages/%s/wprockf-%s.po', $side, $lang ); - - if ( $lang == '' && ! file_exists( $url ) ) { - //wp_send_json_error($resp); - $json['success'] = 0; - $json['data'] = $resp; - echo json_encode( $json ); - die(); - } - - $parser = new PoParser\Parser(); - $parser->read( $url ); - $entries = $parser->getEntriesAsArrays(); - $data = array(); - $data['lang'] = $lang; - $data['side'] = $side; - $data['entries'] = $entries; - //$resp['content'] = self::render_template('addon_mgtranslate/views/backend/ajax_load_pofile.php', $data); - $resp['content'] = $this->load->view( 'addon_mgtranslate/backend/ajax_load_pofile', $data, true ); - //wp_send_json_success($resp); - $json = array(); - $json['success'] = true; - $json['data'] = $resp; - echo json_encode( $json ); - die(); - } - - /** - * load submenu - * - * @return void - */ - public function load_menu() { - $perms = 'manage_options'; - add_submenu_page( 'zgfm_form_builder', __( 'Translation', 'FRocket_admin' ), __( 'Translation', 'FRocket_admin' ), $perms, 'zigaform-translation', array( &$this, 'get_menu' ) ); - } - - /** - * Redirects the clicked menu item to the correct location - * - * @return null - */ - public function get_menu() { - $current_page = isset( $_REQUEST['page'] ) ? esc_html( $_REQUEST['page'] ) : 'zgfm_form_builder'; - - switch ( $current_page ) { - case 'zigaform-translation': - $this->show_list(); - break; - - default: - break; - } - } - - /* - * load css, and javascript files - */ - public function load_dependencies() { - - ob_start(); - ?> - - - - - - - - - - CI->db->query( 'select * from cepf_cest_addon where flag_status=1 and add_name="mgtranslate"' ); - $row = (array) $query2->row(); - if ( empty( $row ) ) { - $this->template->loadPartial2( 'layout-global', __( 'Extension is not availabe. Go to Extensions Header menu and activate Translation Manager Add-on', 'FRocket_admin' ) ); - return; - } - - $data = array(); - $pofilespath = FCPATH . 'i18n/languages/backend/'; - $data['language'] = 'en_US'; - $data['lang_list'] = Uiform_Form_Helper::getLanguageList( $pofilespath ); - - //echo self::render_template('addon_mgtranslate/views/backend/show_list.php', $data); - $this->template->loadPartial( 'layout-global', 'backend/show_list', $data ); - } - - - /** - * Adding new controllers - * - * @mvc Controller - */ - public function add_controllers() { - - $tmp_flag = array(); - - return $tmp_flag; - } - - /** - * Register callbacks for actions and filters - * - * @mvc Controller - */ - public function register_hook_callbacks() { - } - - /** - * Initializes variables - * - * @mvc Controller - */ - public function init() { - - try { - // $instance_example = new WPPS_Instance_Class( 'Instance example', '42' ); - // add_notice('ba'); - } catch ( Exception $exception ) { - add_notice( __METHOD__ . ' error: ' . $exception->getMessage(), 'error' ); - } - } - - /* - * Instance methods - */ - - /** - * Prepares sites to use the plugin during single or network-wide activation - * - * @mvc Controller - * - * @param bool $network_wide - */ - public function activate( $network_wide ) { - - return true; - } - - /** - * Rolls back activation procedures when de-activating the plugin - * - * @mvc Controller - */ - public function deactivate() { - return true; - } - - /** - * Checks if the plugin was recently updated and upgrades if necessary - * - * @mvc Controller - * - * @param string $db_version - */ - public function upgrade( $db_version = 0 ) { - return true; - } - - /** - * Checks that the object is in a correct state - * - * @mvc Model - * - * @param string $property An individual property to check, or 'all' to check all of them - * @return bool - */ - protected function is_valid( $property = 'all' ) { - return true; - } +class zfad_mgtranslate_back extends BackendController +{ + + + const VERSION = '0.1'; + private $pagination = ''; + private $per_page = 5; + private $wpdb = ''; + public $CI; + + // adding routes + public $local_back_actions = array(); + + // adding js actions + public $js_back_actions = array(); + + /** + * Constructor + * + * @mvc Controller + */ + public function __construct() + { + parent::__construct(); + $this->CI =& get_instance(); + $this->load->language_alt(model_settings::$db_config['language']); + $this->template->set('controller', $this); + + // Composer autoload + $composer_path = dirname(__FILE__) . '/../vendor/autoload.php'; + if ( file_exists($composer_path)) { + require_once $composer_path; + } + + add_action('admin_menu', array( &$this, 'load_menu' )); + + // admin resources + add_action('admin_enqueue_scripts', array( &$this, 'load_dependencies' ), 20, 1); + + // add class to body if translator page is selected + //add_filter('admin_body_class', array( &$this, 'filter_body_class' )); + } + + /** + * ajax_create_lang + * + * @author Unknown + * @since v0.0.1 + * @version v1.0.0 Thursday, October 1st, 2020. + * @access public + * @return void + */ + public function ajax_create_lang() + { + $resp = array(); + $resp['html_title'] = __('Translation Manager', 'FRocket_admin'); + + try { + $newlangname = ( $_POST['newlangname'] ) ? Uiform_Form_Helper::sanitizeInput(trim($_POST['newlangname'])) : ''; + + $resp['html_footer'] = ''; + if ( preg_match('/^[a-zA-Z0-9_]+$/', $newlangname)) { + $file = FCPATH . 'i18n/languages/backend/wprockf-en_US.po'; + $newfile = FCPATH . 'i18n/languages/backend/wprockf-' . $newlangname . '.po'; + if ( ! copy($file, $newfile)) { + throw new Exception('Error Processing Request', 1); + } else { + $file = FCPATH . 'i18n/languages/backend/wprockf-en_US.mo'; + $newfile = FCPATH . 'i18n/languages/backend/wprockf-' . $newlangname . '.mo'; + if ( ! copy($file, $newfile)) { + throw new Exception('Error Processing Request', 1); + } else { + $file = FCPATH . 'i18n/languages/front/wprockf-en_US.mo'; + $newfile = FCPATH . 'i18n/languages/front/wprockf-' . $newlangname . '.mo'; + if ( ! copy($file, $newfile)) { + throw new Exception('Error Processing Request', 1); + } else { + $file = FCPATH . 'i18n/languages/front/wprockf-en_US.po'; + $newfile = FCPATH . 'i18n/languages/front/wprockf-' . $newlangname . '.po'; + if ( ! copy($file, $newfile)) { + throw new Exception('Error Processing Request', 1); + } else { + $resp['html'] = __('New translation created successfully', 'FRocket_admin'); + } + } + } + } + //wp_send_json_success($resp); + $json = array(); + $json['success'] = 1; + $json['data'] = $resp; + echo json_encode($json); + die(); + } else { + throw new Exception('Error Processing Request', 1); + } + } catch ( Exception $e) { + $resp['html'] = __('Error! An error ocurred during the process', 'FRocket_admin'); + //wp_send_json_error($resp); + $json = array(); + $json['success'] = 0; + $json['data'] = $resp; + echo json_encode($json); + die(); + } + } + + /** + * ajax_new_lang. + * + * @author Unknown + * @since v0.0.1 + * @version v1.0.0 Thursday, October 1st, 2020. + * @access public + * @return void + */ + public function ajax_new_lang() + { + + $resp = array(); + $resp['html_title'] = __('Translation Manager', 'FRocket_admin'); + //$resp['html']=self::render_template('addon_mgtranslate/views/backend/ajax_new_lang.php', array()); + $resp['html'] = $this->load->view('addon_mgtranslate/backend/ajax_new_lang', array(), true); + $resp['html_buttons'] = ''; + //wp_send_json_success($resp); + $json = array(); + $json['success'] = 1; + $json['data'] = $resp; + echo json_encode($json); + die(); + } + /** + * add class to body + * + * @access public + * @since 1.0.0 + * @return void + */ + public function filter_body_class($classes) + { + $customClass = ''; + if ( isset($_GET['page']) && $_GET['page'] == 'zigaform-translation') { + // id index exists + $customClass = 'sfdc-wrap sfdclauncher'; + } + return $classes . ' ' . $customClass; + } + + /** + * ajax_save_pofile. + * + * @author Unknown + * @since v0.0.1 + * @version v1.0.0 Thursday, October 1st, 2020. + * @access public + * @return void + */ + public function ajax_save_pofile() + { + + $translation = ( isset($_POST['translation']) && $_POST['translation'] ) ? array_map(array( 'Uiform_Form_Helper', 'sanitizeRecursive_html' ), $_POST['translation']) : array(); + $lang = ( $_POST['lang'] ) ? Uiform_Form_Helper::sanitizeInput(trim($_POST['lang'])) : ''; + $side = ( $_POST['side'] ) ? Uiform_Form_Helper::sanitizeInput(trim($_POST['side'])) : ''; + + $url = sprintf(FCPATH . 'i18n/languages/%s/wprockf-%s.po', $side, $lang); + $urlMo = sprintf(FCPATH . 'i18n/languages/%s/wprockf-%s.mo', $side, $lang); + $resp = array(); + if ( $lang == '' && ! file_exists($url)) { + //wp_send_json_error($resp); + $json = array(); + $json['success'] = 0; + $json['data'] = $resp; + echo json_encode($json); + die(); + } + + //process + $parser = new PoParser\Parser(); + $parser->read($url); + $entries = $parser->getEntriesAsArrays(); + + $count = 1; + $newArr = array(); + foreach ( $translation as $key => $value) { + $count2 = 1; + foreach ( $entries as $key2 => $value2) { + if ( $key === $count2) { + $newArr[] = array( + 'original' => $key2, + 'replace' => $value, + ); + break; + } + $count2++; + } + } + + //updating po file + $parser = new PoParser\Parser(); + $parser->read($url); + // updating changes + foreach ( $newArr as $key => $value) { + $parser->updateEntry($value['original'], $value['replace']); + } + $parser->write($url); + + //update po to mo + //import from a .po file: + $loader = new PoLoader(); + $translations = $loader->loadFile($url); + + //export to a .mo file: + $generator = new MoGenerator(); + $generator->generateFile($translations, $urlMo); + + $resp['lang'] = $lang; + $resp['side'] = $side; + $resp['translation'] = $translation; + $resp['replace'] = $newArr; + $resp['html_title'] = __('Translation Manager', 'FRocket_admin'); + $resp['html'] = __('Translation saved successfully', 'FRocket_admin'); + //wp_send_json_success($resp); + $json = array(); + $json['success'] = 1; + $json['data'] = $resp; + echo json_encode($json); + die(); + } + + /** + * load pofile + * + * @author Unknown + * @since v0.0.1 + * @version v1.0.0 Wednesday, September 30th, 2020. + * @access public + * @return void + */ + public function ajax_load_pofile() + { + $lang = ( isset($_POST['lang']) ) ? Uiform_Form_Helper::sanitizeInput(trim($_POST['lang'])) : ''; + $side = ( isset($_POST['side']) ) ? Uiform_Form_Helper::sanitizeInput(trim($_POST['side'])) : 'backend'; + $resp = array(); + $url = sprintf(FCPATH . 'i18n/languages/%s/wprockf-%s.po', $side, $lang); + + if ( $lang == '' && ! file_exists($url)) { + //wp_send_json_error($resp); + $json['success'] = 0; + $json['data'] = $resp; + echo json_encode($json); + die(); + } + + $parser = new PoParser\Parser(); + $parser->read($url); + $entries = $parser->getEntriesAsArrays(); + $data = array(); + $data['lang'] = $lang; + $data['side'] = $side; + $data['entries'] = $entries; + //$resp['content'] = self::render_template('addon_mgtranslate/views/backend/ajax_load_pofile.php', $data); + $resp['content'] = $this->load->view('addon_mgtranslate/backend/ajax_load_pofile', $data, true); + //wp_send_json_success($resp); + $json = array(); + $json['success'] = true; + $json['data'] = $resp; + echo json_encode($json); + die(); + } + + /** + * load submenu + * + * @return void + */ + public function load_menu() + { + $perms = 'manage_options'; + add_submenu_page('zgfm_form_builder', __('Translation', 'FRocket_admin'), __('Translation', 'FRocket_admin'), $perms, 'zigaform-translation', array( &$this, 'get_menu' )); + } + + /** + * Redirects the clicked menu item to the correct location + * + * @return null + */ + public function get_menu() + { + $current_page = isset($_REQUEST['page']) ? esc_html($_REQUEST['page']) : 'zgfm_form_builder'; + + switch ( $current_page) { + case 'zigaform-translation': + $this->show_list(); + break; + + default: + break; + } + } + + /* + * load css, and javascript files + */ + public function load_dependencies() + { + + ob_start(); + ?> + + + + + + + + + + CI->db->query('select * from cepf_cest_addon where flag_status=1 and add_name="mgtranslate"'); + $row = (array) $query2->row(); + if ( empty($row)) { + $this->template->loadPartial2('layout-global', __('Extension is not availabe. Go to Extensions Header menu and activate Translation Manager Add-on', 'FRocket_admin')); + return; + } + + $data = array(); + $pofilespath = FCPATH . 'i18n/languages/backend/'; + $data['language'] = 'en_US'; + $data['lang_list'] = Uiform_Form_Helper::getLanguageList($pofilespath); + + //echo self::render_template('addon_mgtranslate/views/backend/show_list.php', $data); + $this->template->loadPartial('layout-global', 'backend/show_list', $data); + } + + + /** + * Adding new controllers + * + * @mvc Controller + */ + public function add_controllers() + { + + $tmp_flag = array(); + + return $tmp_flag; + } + + /** + * Register callbacks for actions and filters + * + * @mvc Controller + */ + public function register_hook_callbacks() + { + } + + /** + * Initializes variables + * + * @mvc Controller + */ + public function init() + { + + try { + // $instance_example = new WPPS_Instance_Class( 'Instance example', '42' ); + // add_notice('ba'); + } catch ( Exception $exception) { + add_notice(__METHOD__ . ' error: ' . $exception->getMessage(), 'error'); + } + } + + /* + * Instance methods + */ + + /** + * Prepares sites to use the plugin during single or network-wide activation + * + * @mvc Controller + * + * @param bool $network_wide + */ + public function activate($network_wide) + { + + return true; + } + + /** + * Rolls back activation procedures when de-activating the plugin + * + * @mvc Controller + */ + public function deactivate() + { + return true; + } + + /** + * Checks if the plugin was recently updated and upgrades if necessary + * + * @mvc Controller + * + * @param string $db_version + */ + public function upgrade($db_version = 0) + { + return true; + } + + /** + * Checks that the object is in a correct state + * + * @mvc Model + * + * @param string $property An individual property to check, or 'all' to check all of them + * @return bool + */ + protected function is_valid($property = 'all') + { + return true; + } } diff --git a/application/modules/addon_mgtranslate/lib/gettext/languages/src/FormulaConverter.php b/application/modules/addon_mgtranslate/lib/gettext/languages/src/FormulaConverter.php index 6eb14b5f..c9e39cd0 100755 --- a/application/modules/addon_mgtranslate/lib/gettext/languages/src/FormulaConverter.php +++ b/application/modules/addon_mgtranslate/lib/gettext/languages/src/FormulaConverter.php @@ -162,7 +162,8 @@ private static function expandAtom($atom) } switch ($op) { case '==': - return '(' . implode(' || ', $chunks) . ')'; break; + return '(' . implode(' || ', $chunks) . ')'; + break; case '!=': return implode(' && ', $chunks); } diff --git a/application/modules/addon_mgtranslate/src/Entry.php b/application/modules/addon_mgtranslate/src/Entry.php index 29f2aa87..06ada787 100755 --- a/application/modules/addon_mgtranslate/src/Entry.php +++ b/application/modules/addon_mgtranslate/src/Entry.php @@ -2,179 +2,195 @@ namespace PoParser; -class Entry { - - /** - * @var string - */ - protected $context; - - /** - * @var string - */ - protected $msgId; - - /** - * @var null - */ - protected $msgIdPlural; - - /** - * @var bool - */ - protected $fuzzy = false; - - /** - * @var bool - */ - protected $obsolete = false; - - /** - * @var bool - */ - protected $header = false; - - /** - * @var array - */ - protected $flags = array(); - - /** - * @var array - */ - protected $translations = array(); - - /** - * @var array - */ - protected $references = array(); - - /** - * @var string - */ - protected $extractedComment; - - /** - * @var string - */ - protected $translatorComment; - - /** - * @param $properties - */ - public function __construct( $properties ) { - $this->context = $properties['msgctxt']; - $this->translatorComment = $properties['tcomment']; - $this->extractedComment = $properties['ccomment']; - $this->msgId = $properties['msgid']; - $this->msgIdPlural = isset( $properties['msgid_plural'] ) ? $properties['msgid_plural'] : null; - $this->fuzzy = $properties['fuzzy'] === true; - $this->obsolete = $properties['obsolete'] === true; - $this->header = $properties['header'] === true; - $this->translations = $properties['msgstr']; - $this->references = $properties['references']; - $this->flags = $properties['flags']; - } - - /** - * @return bool - */ - public function isHeader() { - return $this->header; - } - - /** - * @return bool - */ - public function isFuzzy() { - return $this->fuzzy; - } - - /** - * @return string - */ - public function getMsgId() { - return is_array( $this->msgId ) ? implode( '', $this->msgId ) : $this->msgId; - } - - /** - * @return null|string - */ - public function getMsgIdPlural() { - return is_array( $this->msgIdPlural ) ? implode( '', $this->msgIdPlural ) : $this->msgIdPlural; - } - - /** - * @return bool - */ - public function isObsolete() { - return $this->obsolete; - } - - /** - * @return array - */ - public function getTranslations() { - return $this->translations; - } - - /** - * @param $index - * - * @return string - */ - public function getTranslation( $index = 0 ) { - return ( isset( $this->translations[ $index ] ) ) ? $this->translations[ $index ] : ''; - } - - /** - * @return bool - */ - public function isPlural() { - return ! empty( $this->msgIdPlural ); - } - - /** - * @param $flag - * - * @return bool - */ - public function hasFlag( $flag ) { - return array_search( $flag, $this->flags, true ) !== false; - } - - /** - * @return string - */ - public function getContext() { - return $this->context; - } - - /** - * @return string - */ - public function getExtractedComment() { - return $this->extractedComment; - } - - /** - * @return string - */ - public function getTranslatorComment() { - return $this->translatorComment; - } - - /** - * @return array - */ - public function getFlags() { - return $this->flags; - } - - /** - * @return array - */ - public function getReferences() { - return $this->references; - } +class Entry +{ + + /** + * @var string + */ + protected $context; + + /** + * @var string + */ + protected $msgId; + + /** + * @var null + */ + protected $msgIdPlural; + + /** + * @var bool + */ + protected $fuzzy = false; + + /** + * @var bool + */ + protected $obsolete = false; + + /** + * @var bool + */ + protected $header = false; + + /** + * @var array + */ + protected $flags = array(); + + /** + * @var array + */ + protected $translations = array(); + + /** + * @var array + */ + protected $references = array(); + + /** + * @var string + */ + protected $extractedComment; + + /** + * @var string + */ + protected $translatorComment; + + /** + * @param $properties + */ + public function __construct($properties) + { + $this->context = $properties['msgctxt']; + $this->translatorComment = $properties['tcomment']; + $this->extractedComment = $properties['ccomment']; + $this->msgId = $properties['msgid']; + $this->msgIdPlural = isset($properties['msgid_plural']) ? $properties['msgid_plural'] : null; + $this->fuzzy = $properties['fuzzy'] === true; + $this->obsolete = $properties['obsolete'] === true; + $this->header = $properties['header'] === true; + $this->translations = $properties['msgstr']; + $this->references = $properties['references']; + $this->flags = $properties['flags']; + } + + /** + * @return bool + */ + public function isHeader() + { + return $this->header; + } + + /** + * @return bool + */ + public function isFuzzy() + { + return $this->fuzzy; + } + + /** + * @return string + */ + public function getMsgId() + { + return is_array($this->msgId) ? implode('', $this->msgId) : $this->msgId; + } + + /** + * @return null|string + */ + public function getMsgIdPlural() + { + return is_array($this->msgIdPlural) ? implode('', $this->msgIdPlural) : $this->msgIdPlural; + } + + /** + * @return bool + */ + public function isObsolete() + { + return $this->obsolete; + } + + /** + * @return array + */ + public function getTranslations() + { + return $this->translations; + } + + /** + * @param $index + * + * @return string + */ + public function getTranslation($index = 0) + { + return ( isset($this->translations[ $index ]) ) ? $this->translations[ $index ] : ''; + } + + /** + * @return bool + */ + public function isPlural() + { + return ! empty($this->msgIdPlural); + } + + /** + * @param $flag + * + * @return bool + */ + public function hasFlag($flag) + { + return array_search($flag, $this->flags, true) !== false; + } + + /** + * @return string + */ + public function getContext() + { + return $this->context; + } + + /** + * @return string + */ + public function getExtractedComment() + { + return $this->extractedComment; + } + + /** + * @return string + */ + public function getTranslatorComment() + { + return $this->translatorComment; + } + + /** + * @return array + */ + public function getFlags() + { + return $this->flags; + } + + /** + * @return array + */ + public function getReferences() + { + return $this->references; + } } diff --git a/application/modules/addon_mgtranslate/src/Parser.php b/application/modules/addon_mgtranslate/src/Parser.php index fa79eadd..3ff79937 100755 --- a/application/modules/addon_mgtranslate/src/Parser.php +++ b/application/modules/addon_mgtranslate/src/Parser.php @@ -2,539 +2,568 @@ namespace PoParser; -class Parser { - - /** - * @var array - */ - protected $headers = array(); - - /** - * @var Entry[] - */ - protected $entries = array(); - - /** - * @var array - */ - protected $entriesAsArrays = array(); - - /** - * @var string - */ - protected $state; - - /** - * @var array - */ - protected $rawEntries; - - /** - * @var array - */ - protected $currentEntry; - - /** - * @var boolean - */ - protected $justNewEntry; - - /** - * @return Entry[] - */ - public function getEntries() { - return $this->entries; - } - - /** - * @return array - */ - public function getEntriesAsArrays() { - return $this->entriesAsArrays; - } - - /** - * Reads and parses strings in a .po file. - * - * return An array of entries located in the file: - * Format: array( - * 'msgid' => ID of the message. - * 'msgctxt' => Message context. - * 'msgstr' => Message translation. - * 'tcomment' => Comment from translator. - * 'ccomment' => Extracted comments from code. - * 'references' => Location of string in code. - * 'obsolete' => Is the message obsolete? - * 'fuzzy' => Is the message "fuzzy"? - * 'flags' => Flags of the entry. Internal usage. - * ) - * - * #~ (old entry) - * # @ default - * #, fuzzy - * #~ msgid "Editar datos" - * #~ msgstr "editar dades" - * - * @param string $filePath - * @throws \Exception - * @return array|bool - */ - public function read( $filePath ) { - $this->rawEntries = array(); - $this->currentEntry = $this->createNewEntryAsArray(); - $this->state = null; - $this->justNewEntry = false; - - $handle = $this->openFile( $filePath ); - while ( ! feof( $handle ) ) { - $line = trim( fgets( $handle ) ); - $this->processLine( $line ); - } - fclose( $handle ); - - $this->addFinalEntry(); - $this->prepareResults(); - - return $this->entriesAsArrays; - } - - /** - * @param string $line - * - * @throws \Exception - */ - protected function processLine( $line ) { - if ( $line === '' ) { - $this->handleBlankLine(); - return; - } - - $this->justNewEntry = false; - - $data = $this->parseLine( $line ); - - if ( $data['key'][0] === '#' ) { - $this->handleComment( $data ); - return; - } - - $this->handleOtherCases( $data, $line ); - } - - /** - * - */ - protected function handleBlankLine() { - if ( $this->justNewEntry ) { - // Two consecutive blank lines - return; - } - - // A new entry is found - $this->rawEntries[] = $this->currentEntry; - $this->currentEntry = $this->createNewEntryAsArray(); - $this->state = null; - $this->justNewEntry = true; - } - - /** - * @param $line - * - * @return array - */ - protected function parseLine( $line ) { - $split = preg_split( '/\s/', $line, 2 ); - - return array( - 'key' => $split[0], - 'value' => isset( $split[1] ) ? $split[1] : null, - ); - } - - /** - * @param $data - * - * @return array - */ - protected function parseFlags( $data ) { - return preg_split( '/,\s*/', $data ); - } - - /** - * @param $data - */ - protected function handleComment( $data ) { - switch ( $data['key'] ) { - case '#:': - $this->currentEntry['references'][] = addslashes( $data['value'] ); - break; - case '#,': - //flag - $this->currentEntry['flags'] = $this->parseFlags( $data['value'] ); - $this->currentEntry['fuzzy'] = in_array( 'fuzzy', $this->currentEntry['flags'], true ); - break; - case '#': - $this->currentEntry['tcomment'] = $data['value']; - break; - case '#.': - $this->currentEntry['ccomment'] = $data['value']; - break; - case '#|': - //msgid previous-untranslated-string - // start a new entry - break; - case '#@': - // ignore #@ default - $this->currentEntry['@'] = $data['value']; - break; - case '#~': - $this->processObsoleteEntry( $data['value'] ); - break; - default: - break; - } - } - - /** - * @param $data - * @param $rawLine - * - * @throws \Exception - */ - protected function handleOtherCases( $data, $rawLine ) { - switch ( $data['key'] ) { - case 'msgctxt': - case 'msgid': - case 'msgid_plural': - case 'msgstr': - $this->state = $data['key']; - $this->addEntryData( $data['value'] ); - break; - default: - if ( strpos( $data['key'], 'msgstr[' ) !== false ) { - // translated plurals - $this->state = 'msgstr'; - $this->addEntryData( $data['value'] ); - } else { - $this->processContinuedLineInSameState( $rawLine ); - } - break; - } - } - - /** - * @param string $line - * - * @throws \Exception - */ - protected function processContinuedLineInSameState( $line ) { - switch ( $this->state ) { - case 'msgctxt': - case 'msgid': - case 'msgid_plural': - if ( is_string( $this->currentEntry[ $this->state ] ) ) { - // Convert it to array - $this->currentEntry[ $this->state ] = array( $this->currentEntry[ $this->state ] ); - } - $this->currentEntry[ $this->state ][] = $line; - break; - case 'msgstr': - $this->currentEntry['msgstr'][] = trim( $line, '"' ); - break; - default: - throw new \Exception( 'Parse error!' ); - } - } - - /** - * @param $data - */ - protected function processObsoleteEntry( $data ) { - $this->currentEntry['obsolete'] = true; - - $tmpParts = explode( ' ', $data ); - $tmpKey = $tmpParts[0]; - $str = implode( ' ', array_slice( $tmpParts, 1 ) ); - - switch ( $tmpKey ) { - case 'msgid': - $this->currentEntry['msgid'] = trim( $str, '"' ); - break; - case 'msgstr': - $this->currentEntry['msgstr'][] = trim( $str, '"' ); - break; - default: - break; - } - } - - /** - * @param $value - */ - protected function addEntryData( $value ) { - if ( $this->state === 'msgstr' ) { - $this->currentEntry[ $this->state ][] = $value; - } else { - $this->currentEntry[ $this->state ] = $value; - } - } - - /** - * - */ - protected function addFinalEntry() { - if ( $this->state == 'msgstr' || $this->currentEntry['obsolete'] ) { - $this->rawEntries[] = $this->currentEntry; - } - } - - /** - * Cleanup data, merge multiline entries, reindex hash for ksort - * - * @return bool - */ - protected function prepareResults() { - $this->entriesAsArrays = array(); - $this->entries = array(); - $this->headers = array(); - - $counter = 0; - foreach ( $this->rawEntries as $entry ) { - $entry = $this->prepareEntry( $entry, $counter ); - - $id = $this->getMsgId( $entry ); - - $this->entriesAsArrays[ $id ] = $entry; - $this->entries[ $id ] = new Entry( $entry ); - - $counter++; - } - - return true; - } - - /** - * @param $entry - * - * @return string - */ - protected function getMsgId( $entry ) { - return is_array( $entry['msgid'] ) ? implode( '', $entry['msgid'] ) : $entry['msgid']; - } - - /** - * @param $entry - * @param $index - * - * @return array - */ - protected function prepareEntry( $entry, $index ) { - foreach ( $entry as &$fieldValue ) { - $fieldValue = $this->clean( $fieldValue ); - } - - $id = $this->getMsgId( $entry ); - - if ( $index === 0 && $id === '' ) { - //header entry - $entry['header'] = true; - $this->setHeaders( $this->parseHeaders( $entry ) ); - } - - return $entry; - } - - /** - * @return array - */ - protected function createNewEntryAsArray() { - return array( - 'msgctxt' => '', - 'header' => false, - 'obsolete' => false, - 'fuzzy' => false, - 'flags' => array(), - 'references' => array(), - 'ccomment' => '', - 'tcomment' => '', - ); - } - - /** - * @param string $filePath - * - * @throws \Exception - * @return resource - */ - protected function openFile( $filePath ) { - if ( empty( $filePath ) ) { - throw new \Exception( 'Input file not defined.' ); - } elseif ( ! file_exists( $filePath ) ) { - throw new \Exception( "File does not exist: {$filePath}" ); - } - - $handle = @fopen( $filePath, 'r' ); - if ( false === $handle ) { - throw new \Exception( "Unable to open file for reading: {$filePath}" ); - } - - return $handle; - } - - /** - * @param array $entry - * - * @return array - */ - protected function parseHeaders( array $entry ) { - $headers = array(); - - if ( ! is_array( $entry['msgstr'] ) ) { - return $headers; - } - - foreach ( $entry['msgstr'] as $headerRaw ) { - $parts = explode( ':', $headerRaw ); - if ( count( $parts ) < 2 ) { - continue; - } - - $parts[1] = ltrim( $parts[1] ); - $values = array_slice( $parts, 1 ); - $headerValue = rtrim( implode( ':', $values ) ); - - $headers[ $parts[0] ] = $headerValue; - } - - return $headers; - } - - /** - * set all entries at once - * - * @param array $entries - */ - public function setEntries( array $entries ) { - $this->entriesAsArrays = $entries; - } - - /** - * Helper for the update-functions by deleting the fuzzy flag - * - * @param $msgid string msgid of entry - * - * @throws \Exception - */ - protected function removeFuzzyFlagForMsgId( $msgid ) { - if ( ! isset( $this->entriesAsArrays[ $msgid ] ) ) { - throw new \Exception( 'Entry does not exist' ); - } - if ( $this->entriesAsArrays[ $msgid ]['fuzzy'] ) { - $flags = $this->entriesAsArrays[ $msgid ]['flags']; - unset( $flags[ array_search( 'fuzzy', $flags, true ) ] ); - $this->entriesAsArrays[ $msgid ]['flags'] = $flags; - $this->entriesAsArrays[ $msgid ]['fuzzy'] = false; - } - } - - /** - * Allows modification of all translations of an entry - * - * @param $msgid string msgid of the entry which should be updated - * @param $translation array of strings new Translation for all msgstr by msgid - * - * @throws \Exception - */ - public function updateEntries( $msgid, $translation ) { - if ( - ! isset( $this->entriesAsArrays[ $msgid ] ) - || ! is_array( $translation ) - || sizeof( $translation ) != sizeof( $this->entriesAsArrays[ $msgid ]['msgstr'] ) - ) { - throw new \Exception( 'Cannot update entry translation' ); - } - $this->removeFuzzyFlagForMsgId( $msgid ); - $this->entriesAsArrays[ $msgid ]['msgstr'] = $translation; - } - - /** - * Allows modification of a single translation of an entry - * - * @param $msgid string msgid of the entry which should be updated - * @param $translation string new translation for an msgstr by msgid - * @param $positionMsgstr integer spezification which of the msgstr - * should be changed - * - * @throws \Exception - */ - public function updateEntry( $msgid, $translation, $positionMsgstr = 0 ) { - if ( - ! isset( $this->entriesAsArrays[ $msgid ] ) - || ! is_string( $translation ) - || ! isset( $this->entriesAsArrays[ $msgid ]['msgstr'][ $positionMsgstr ] ) - ) { - throw new \Exception( 'Cannot update entry translation' ); - } - $this->removeFuzzyFlagForMsgId( $msgid ); - $this->entriesAsArrays[ $msgid ]['msgstr'][ $positionMsgstr ] = $translation; - } - - /** - * Write entries into the po file. - * - * @param string $filePath - * @throws \Exception - */ - public function write( $filePath ) { - $writer = new Writer(); - $writer->write( $filePath, $this->entriesAsArrays ); - } - - /** - * - */ - public function clearFuzzy() { - foreach ( $this->entriesAsArrays as &$entry ) { - if ( $entry['fuzzy'] === true ) { - $flags = $entry['flags']; - $entry['flags'] = str_replace( 'fuzzy', '', $flags ); - $entry['fuzzy'] = false; - $entry['msgstr'] = array( '' ); - } - } - } - - /** - * @param $value - * - * @return array|string - */ - public function clean( $value ) { - if ( $value === true || $value === false ) { - return $value; - } elseif ( is_array( $value ) ) { - foreach ( $value as $k => $v ) { - $value[ $k ] = $this->clean( $v ); - } - } else { - $value = preg_replace( '/^\"|\"$/', '', $value ); - $value = stripcslashes( $value ); - } - - return $value; - } - - /** - * @return array - */ - public function getHeaders() { - return $this->headers; - } - - /** - * @param array $headers - */ - public function setHeaders( $headers ) { - $this->headers = $headers; - } +class Parser +{ + + /** + * @var array + */ + protected $headers = array(); + + /** + * @var Entry[] + */ + protected $entries = array(); + + /** + * @var array + */ + protected $entriesAsArrays = array(); + + /** + * @var string + */ + protected $state; + + /** + * @var array + */ + protected $rawEntries; + + /** + * @var array + */ + protected $currentEntry; + + /** + * @var boolean + */ + protected $justNewEntry; + + /** + * @return Entry[] + */ + public function getEntries() + { + return $this->entries; + } + + /** + * @return array + */ + public function getEntriesAsArrays() + { + return $this->entriesAsArrays; + } + + /** + * Reads and parses strings in a .po file. + * + * return An array of entries located in the file: + * Format: array( + * 'msgid' => ID of the message. + * 'msgctxt' => Message context. + * 'msgstr' => Message translation. + * 'tcomment' => Comment from translator. + * 'ccomment' => Extracted comments from code. + * 'references' => Location of string in code. + * 'obsolete' => Is the message obsolete? + * 'fuzzy' => Is the message "fuzzy"? + * 'flags' => Flags of the entry. Internal usage. + * ) + * + * #~ (old entry) + * # @ default + * #, fuzzy + * #~ msgid "Editar datos" + * #~ msgstr "editar dades" + * + * @param string $filePath + * @throws \Exception + * @return array|bool + */ + public function read($filePath) + { + $this->rawEntries = array(); + $this->currentEntry = $this->createNewEntryAsArray(); + $this->state = null; + $this->justNewEntry = false; + + $handle = $this->openFile($filePath); + while ( ! feof($handle)) { + $line = trim(fgets($handle)); + $this->processLine($line); + } + fclose($handle); + + $this->addFinalEntry(); + $this->prepareResults(); + + return $this->entriesAsArrays; + } + + /** + * @param string $line + * + * @throws \Exception + */ + protected function processLine($line) + { + if ( $line === '') { + $this->handleBlankLine(); + return; + } + + $this->justNewEntry = false; + + $data = $this->parseLine($line); + + if ( $data['key'][0] === '#') { + $this->handleComment($data); + return; + } + + $this->handleOtherCases($data, $line); + } + + /** + * + */ + protected function handleBlankLine() + { + if ( $this->justNewEntry) { + // Two consecutive blank lines + return; + } + + // A new entry is found + $this->rawEntries[] = $this->currentEntry; + $this->currentEntry = $this->createNewEntryAsArray(); + $this->state = null; + $this->justNewEntry = true; + } + + /** + * @param $line + * + * @return array + */ + protected function parseLine($line) + { + $split = preg_split('/\s/', $line, 2); + + return array( + 'key' => $split[0], + 'value' => isset($split[1]) ? $split[1] : null, + ); + } + + /** + * @param $data + * + * @return array + */ + protected function parseFlags($data) + { + return preg_split('/,\s*/', $data); + } + + /** + * @param $data + */ + protected function handleComment($data) + { + switch ( $data['key']) { + case '#:': + $this->currentEntry['references'][] = addslashes($data['value']); + break; + case '#,': + //flag + $this->currentEntry['flags'] = $this->parseFlags($data['value']); + $this->currentEntry['fuzzy'] = in_array('fuzzy', $this->currentEntry['flags'], true); + break; + case '#': + $this->currentEntry['tcomment'] = $data['value']; + break; + case '#.': + $this->currentEntry['ccomment'] = $data['value']; + break; + case '#|': + //msgid previous-untranslated-string + // start a new entry + break; + case '#@': + // ignore #@ default + $this->currentEntry['@'] = $data['value']; + break; + case '#~': + $this->processObsoleteEntry($data['value']); + break; + default: + break; + } + } + + /** + * @param $data + * @param $rawLine + * + * @throws \Exception + */ + protected function handleOtherCases($data, $rawLine) + { + switch ( $data['key']) { + case 'msgctxt': + case 'msgid': + case 'msgid_plural': + case 'msgstr': + $this->state = $data['key']; + $this->addEntryData($data['value']); + break; + default: + if ( strpos($data['key'], 'msgstr[') !== false) { + // translated plurals + $this->state = 'msgstr'; + $this->addEntryData($data['value']); + } else { + $this->processContinuedLineInSameState($rawLine); + } + break; + } + } + + /** + * @param string $line + * + * @throws \Exception + */ + protected function processContinuedLineInSameState($line) + { + switch ( $this->state) { + case 'msgctxt': + case 'msgid': + case 'msgid_plural': + if ( is_string($this->currentEntry[ $this->state ])) { + // Convert it to array + $this->currentEntry[ $this->state ] = array( $this->currentEntry[ $this->state ] ); + } + $this->currentEntry[ $this->state ][] = $line; + break; + case 'msgstr': + $this->currentEntry['msgstr'][] = trim($line, '"'); + break; + default: + throw new \Exception('Parse error!'); + } + } + + /** + * @param $data + */ + protected function processObsoleteEntry($data) + { + $this->currentEntry['obsolete'] = true; + + $tmpParts = explode(' ', $data); + $tmpKey = $tmpParts[0]; + $str = implode(' ', array_slice($tmpParts, 1)); + + switch ( $tmpKey) { + case 'msgid': + $this->currentEntry['msgid'] = trim($str, '"'); + break; + case 'msgstr': + $this->currentEntry['msgstr'][] = trim($str, '"'); + break; + default: + break; + } + } + + /** + * @param $value + */ + protected function addEntryData($value) + { + if ( $this->state === 'msgstr') { + $this->currentEntry[ $this->state ][] = $value; + } else { + $this->currentEntry[ $this->state ] = $value; + } + } + + /** + * + */ + protected function addFinalEntry() + { + if ( $this->state == 'msgstr' || $this->currentEntry['obsolete']) { + $this->rawEntries[] = $this->currentEntry; + } + } + + /** + * Cleanup data, merge multiline entries, reindex hash for ksort + * + * @return bool + */ + protected function prepareResults() + { + $this->entriesAsArrays = array(); + $this->entries = array(); + $this->headers = array(); + + $counter = 0; + foreach ( $this->rawEntries as $entry) { + $entry = $this->prepareEntry($entry, $counter); + + $id = $this->getMsgId($entry); + + $this->entriesAsArrays[ $id ] = $entry; + $this->entries[ $id ] = new Entry($entry); + + $counter++; + } + + return true; + } + + /** + * @param $entry + * + * @return string + */ + protected function getMsgId($entry) + { + return is_array($entry['msgid']) ? implode('', $entry['msgid']) : $entry['msgid']; + } + + /** + * @param $entry + * @param $index + * + * @return array + */ + protected function prepareEntry($entry, $index) + { + foreach ( $entry as &$fieldValue) { + $fieldValue = $this->clean($fieldValue); + } + + $id = $this->getMsgId($entry); + + if ( $index === 0 && $id === '') { + //header entry + $entry['header'] = true; + $this->setHeaders($this->parseHeaders($entry)); + } + + return $entry; + } + + /** + * @return array + */ + protected function createNewEntryAsArray() + { + return array( + 'msgctxt' => '', + 'header' => false, + 'obsolete' => false, + 'fuzzy' => false, + 'flags' => array(), + 'references' => array(), + 'ccomment' => '', + 'tcomment' => '', + ); + } + + /** + * @param string $filePath + * + * @throws \Exception + * @return resource + */ + protected function openFile($filePath) + { + if ( empty($filePath)) { + throw new \Exception('Input file not defined.'); + } elseif ( ! file_exists($filePath)) { + throw new \Exception("File does not exist: {$filePath}"); + } + + $handle = @fopen($filePath, 'r'); + if ( false === $handle) { + throw new \Exception("Unable to open file for reading: {$filePath}"); + } + + return $handle; + } + + /** + * @param array $entry + * + * @return array + */ + protected function parseHeaders(array $entry) + { + $headers = array(); + + if ( ! is_array($entry['msgstr'])) { + return $headers; + } + + foreach ( $entry['msgstr'] as $headerRaw) { + $parts = explode(':', $headerRaw); + if ( count($parts) < 2) { + continue; + } + + $parts[1] = ltrim($parts[1]); + $values = array_slice($parts, 1); + $headerValue = rtrim(implode(':', $values)); + + $headers[ $parts[0] ] = $headerValue; + } + + return $headers; + } + + /** + * set all entries at once + * + * @param array $entries + */ + public function setEntries(array $entries) + { + $this->entriesAsArrays = $entries; + } + + /** + * Helper for the update-functions by deleting the fuzzy flag + * + * @param $msgid string msgid of entry + * + * @throws \Exception + */ + protected function removeFuzzyFlagForMsgId($msgid) + { + if ( ! isset($this->entriesAsArrays[ $msgid ])) { + throw new \Exception('Entry does not exist'); + } + if ( $this->entriesAsArrays[ $msgid ]['fuzzy']) { + $flags = $this->entriesAsArrays[ $msgid ]['flags']; + unset($flags[ array_search('fuzzy', $flags, true) ]); + $this->entriesAsArrays[ $msgid ]['flags'] = $flags; + $this->entriesAsArrays[ $msgid ]['fuzzy'] = false; + } + } + + /** + * Allows modification of all translations of an entry + * + * @param $msgid string msgid of the entry which should be updated + * @param $translation array of strings new Translation for all msgstr by msgid + * + * @throws \Exception + */ + public function updateEntries($msgid, $translation) + { + if ( + ! isset($this->entriesAsArrays[ $msgid ]) + || ! is_array($translation) + || sizeof($translation) != sizeof($this->entriesAsArrays[ $msgid ]['msgstr']) + ) { + throw new \Exception('Cannot update entry translation'); + } + $this->removeFuzzyFlagForMsgId($msgid); + $this->entriesAsArrays[ $msgid ]['msgstr'] = $translation; + } + + /** + * Allows modification of a single translation of an entry + * + * @param $msgid string msgid of the entry which should be updated + * @param $translation string new translation for an msgstr by msgid + * @param $positionMsgstr integer spezification which of the msgstr + * should be changed + * + * @throws \Exception + */ + public function updateEntry($msgid, $translation, $positionMsgstr = 0) + { + if ( + ! isset($this->entriesAsArrays[ $msgid ]) + || ! is_string($translation) + || ! isset($this->entriesAsArrays[ $msgid ]['msgstr'][ $positionMsgstr ]) + ) { + throw new \Exception('Cannot update entry translation'); + } + $this->removeFuzzyFlagForMsgId($msgid); + $this->entriesAsArrays[ $msgid ]['msgstr'][ $positionMsgstr ] = $translation; + } + + /** + * Write entries into the po file. + * + * @param string $filePath + * @throws \Exception + */ + public function write($filePath) + { + $writer = new Writer(); + $writer->write($filePath, $this->entriesAsArrays); + } + + /** + * + */ + public function clearFuzzy() + { + foreach ( $this->entriesAsArrays as &$entry) { + if ( $entry['fuzzy'] === true) { + $flags = $entry['flags']; + $entry['flags'] = str_replace('fuzzy', '', $flags); + $entry['fuzzy'] = false; + $entry['msgstr'] = array( '' ); + } + } + } + + /** + * @param $value + * + * @return array|string + */ + public function clean($value) + { + if ( $value === true || $value === false) { + return $value; + } elseif ( is_array($value)) { + foreach ( $value as $k => $v) { + $value[ $k ] = $this->clean($v); + } + } else { + $value = preg_replace('/^\"|\"$/', '', $value); + $value = stripcslashes($value); + } + + return $value; + } + + /** + * @return array + */ + public function getHeaders() + { + return $this->headers; + } + + /** + * @param array $headers + */ + public function setHeaders($headers) + { + $this->headers = $headers; + } } diff --git a/application/modules/addon_mgtranslate/src/Writer.php b/application/modules/addon_mgtranslate/src/Writer.php index ed78cbf4..ed8b202f 100755 --- a/application/modules/addon_mgtranslate/src/Writer.php +++ b/application/modules/addon_mgtranslate/src/Writer.php @@ -2,232 +2,244 @@ namespace PoParser; -class Writer { - - /** - * @param string $filePath - * @param array $entries - * - * @throws \Exception - */ - public function write( $filePath, array $entries ) { - $handle = $this->openFile( $filePath ); - - $entriesCount = count( $entries ); - $counter = 0; - foreach ( $entries as $entry ) { - $entryStr = $this->getEntryStr( $entry, $counter, $entriesCount ); - fwrite( $handle, $entryStr ); - - $counter++; - } - - fclose( $handle ); - } - - /** - * @param string $filePath - * @throws \Exception - * @return resource - */ - protected function openFile( $filePath ) { - if ( empty( $filePath ) ) { - throw new \Exception( 'Output file not defined.' ); - } - - $handle = @fopen( $filePath, 'wb' ); - if ( false === $handle ) { - throw new \Exception( "Unable to open file for writing: {$filePath}" ); - } - - return $handle; - } - - /** - * @param array $entry - * - * @return string - */ - protected function getEntryStr( array $entry, $index, $entriesCount ) { - $result = ''; - if ( $index > 0 ) { - $result = "\n"; - } - - $result .= $this->writeComments( $entry ); - $result .= $this->writeReferences( $entry ); - $result .= $this->writeFlags( $entry ); - $result .= $this->writeContext( $entry ); - $result .= $this->writeObsolete( $entry ); - $result .= $this->writeMsgId( $entry, 'msgid' ); - $result .= $this->writeMsgId( $entry, 'msgid_plural' ); - $result .= $this->writeMsgStr( $entry ); - - if ( $index == $entriesCount - 1 ) { - $result = rtrim( $result ); - } - - return $result; - } - - /** - * @param array $entry - * - * @return string - */ - protected function writeComments( array $entry ) { - $result = ''; - - if ( $entry['tcomment'] !== '' ) { - $result .= '# ' . $entry['tcomment'] . "\n"; - } - - if ( $entry['ccomment'] !== '' ) { - $result .= '#. ' . $entry['ccomment'] . "\n"; - } - - return $result; - } - - /** - * @param array $entry - * - * @return string - */ - protected function writeFlags( array $entry ) { - $result = ''; - - if ( count( $entry['flags'] ) > 0 ) { - $result .= '#, ' . implode( ', ', $entry['flags'] ) . "\n"; - } - - if ( isset( $entry['@'] ) ) { - $result .= '#@ ' . $entry['@'] . "\n"; - } - - return $result; - } - - /** - * @param array $entry - * - * @return string - */ - protected function writeReferences( array $entry ) { - $result = ''; - - if ( count( $entry['references'] ) > 0 ) { - foreach ( $entry['references'] as $ref ) { - $result .= '#: ' . $ref . "\n"; - } - } - - return $result; - } - - /** - * @param array $entry - * - * @return string - */ - protected function writeContext( array $entry ) { - $result = ''; - - if ( $entry['msgctxt'] !== '' ) { - $result .= 'msgctxt ' . $this->cleanExport( $entry['msgctxt'] ) . "\n"; - } - - return $result; - } - - /** - * @param array $entry - * - * @return string - */ - protected function writeObsolete( array $entry ) { - return ( $entry['obsolete'] ) ? '#~ ' : ''; - } - - /** - * @param array $entry - * @param string $type msgid or msgid_plural - * - * @return string - */ - protected function writeMsgId( array $entry, $type = 'msgid' ) { - $result = ''; - - if ( ! isset( $entry[ $type ] ) ) { - return $result; - } - - $result .= $type . ' '; - if ( is_array( $entry[ $type ] ) ) { - foreach ( $entry[ $type ] as $id ) { - $result .= $this->cleanExport( $id ) . "\n"; - } - } else { - $result .= $this->cleanExport( $entry[ $type ] ) . "\n"; - } - - return $result; - } - - /** - * @param array $entry - * - * @return string - */ - protected function writeMsgStr( array $entry ) { - $result = ''; - - if ( ! isset( $entry['msgstr'] ) ) { - return $result; - } - - $isPlural = isset( $entry['msgid_plural'] ); - - foreach ( $entry['msgstr'] as $i => $value ) { - if ( $entry['obsolete'] ) { - $result .= '#~ '; - } - - if ( $isPlural ) { - $result .= "msgstr[$i] "; - } else { - if ( $i == 0 ) { - $result .= 'msgstr '; - } - } - - $result .= $this->cleanExport( $value ) . "\n"; - } - - return $result; - } - - /** - * @param $string - * - * @return mixed - */ - protected function cleanExport( $string ) { - $quote = '"'; - $slash = '\\'; - $newline = "\n"; - - $replaces = array( - "$slash" => "$slash$slash", - "$quote" => "$slash$quote", - "\t" => '\t', - ); - - $string = str_replace( array_keys( $replaces ), array_values( $replaces ), $string ); - - $po = $quote . implode( "${slash}n$quote$newline$quote", explode( $newline, $string ) ) . $quote; - - // remove empty strings - return str_replace( "$newline$quote$quote", '', $po ); - } +class Writer +{ + + /** + * @param string $filePath + * @param array $entries + * + * @throws \Exception + */ + public function write($filePath, array $entries) + { + $handle = $this->openFile($filePath); + + $entriesCount = count($entries); + $counter = 0; + foreach ( $entries as $entry) { + $entryStr = $this->getEntryStr($entry, $counter, $entriesCount); + fwrite($handle, $entryStr); + + $counter++; + } + + fclose($handle); + } + + /** + * @param string $filePath + * @throws \Exception + * @return resource + */ + protected function openFile($filePath) + { + if ( empty($filePath)) { + throw new \Exception('Output file not defined.'); + } + + $handle = @fopen($filePath, 'wb'); + if ( false === $handle) { + throw new \Exception("Unable to open file for writing: {$filePath}"); + } + + return $handle; + } + + /** + * @param array $entry + * + * @return string + */ + protected function getEntryStr(array $entry, $index, $entriesCount) + { + $result = ''; + if ( $index > 0) { + $result = "\n"; + } + + $result .= $this->writeComments($entry); + $result .= $this->writeReferences($entry); + $result .= $this->writeFlags($entry); + $result .= $this->writeContext($entry); + $result .= $this->writeObsolete($entry); + $result .= $this->writeMsgId($entry, 'msgid'); + $result .= $this->writeMsgId($entry, 'msgid_plural'); + $result .= $this->writeMsgStr($entry); + + if ( $index == $entriesCount - 1) { + $result = rtrim($result); + } + + return $result; + } + + /** + * @param array $entry + * + * @return string + */ + protected function writeComments(array $entry) + { + $result = ''; + + if ( $entry['tcomment'] !== '') { + $result .= '# ' . $entry['tcomment'] . "\n"; + } + + if ( $entry['ccomment'] !== '') { + $result .= '#. ' . $entry['ccomment'] . "\n"; + } + + return $result; + } + + /** + * @param array $entry + * + * @return string + */ + protected function writeFlags(array $entry) + { + $result = ''; + + if ( count($entry['flags']) > 0) { + $result .= '#, ' . implode(', ', $entry['flags']) . "\n"; + } + + if ( isset($entry['@'])) { + $result .= '#@ ' . $entry['@'] . "\n"; + } + + return $result; + } + + /** + * @param array $entry + * + * @return string + */ + protected function writeReferences(array $entry) + { + $result = ''; + + if ( count($entry['references']) > 0) { + foreach ( $entry['references'] as $ref) { + $result .= '#: ' . $ref . "\n"; + } + } + + return $result; + } + + /** + * @param array $entry + * + * @return string + */ + protected function writeContext(array $entry) + { + $result = ''; + + if ( $entry['msgctxt'] !== '') { + $result .= 'msgctxt ' . $this->cleanExport($entry['msgctxt']) . "\n"; + } + + return $result; + } + + /** + * @param array $entry + * + * @return string + */ + protected function writeObsolete(array $entry) + { + return ( $entry['obsolete'] ) ? '#~ ' : ''; + } + + /** + * @param array $entry + * @param string $type msgid or msgid_plural + * + * @return string + */ + protected function writeMsgId(array $entry, $type = 'msgid') + { + $result = ''; + + if ( ! isset($entry[ $type ])) { + return $result; + } + + $result .= $type . ' '; + if ( is_array($entry[ $type ])) { + foreach ( $entry[ $type ] as $id) { + $result .= $this->cleanExport($id) . "\n"; + } + } else { + $result .= $this->cleanExport($entry[ $type ]) . "\n"; + } + + return $result; + } + + /** + * @param array $entry + * + * @return string + */ + protected function writeMsgStr(array $entry) + { + $result = ''; + + if ( ! isset($entry['msgstr'])) { + return $result; + } + + $isPlural = isset($entry['msgid_plural']); + + foreach ( $entry['msgstr'] as $i => $value) { + if ( $entry['obsolete']) { + $result .= '#~ '; + } + + if ( $isPlural) { + $result .= "msgstr[$i] "; + } else { + if ( $i == 0) { + $result .= 'msgstr '; + } + } + + $result .= $this->cleanExport($value) . "\n"; + } + + return $result; + } + + /** + * @param $string + * + * @return mixed + */ + protected function cleanExport($string) + { + $quote = '"'; + $slash = '\\'; + $newline = "\n"; + + $replaces = array( + "$slash" => "$slash$slash", + "$quote" => "$slash$quote", + "\t" => '\t', + ); + + $string = str_replace(array_keys($replaces), array_values($replaces), $string); + + $po = $quote . implode("${slash}n$quote$newline$quote", explode($newline, $string)) . $quote; + + // remove empty strings + return str_replace("$newline$quote$quote", '', $po); + } } diff --git a/application/modules/addon_mgtranslate/views/backend/ajax_load_pofile.php b/application/modules/addon_mgtranslate/views/backend/ajax_load_pofile.php index a65aee93..8c36cecb 100755 --- a/application/modules/addon_mgtranslate/views/backend/ajax_load_pofile.php +++ b/application/modules/addon_mgtranslate/views/backend/ajax_load_pofile.php @@ -9,10 +9,10 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link https://zigaform.com + * @link https://softdiscover.com/zigaform */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } ob_start(); ?> @@ -22,55 +22,54 @@ chartset="utf-8" name="mgtranslationPoData" class=""> - : , : - - - - - - - - - - - - - - - - $value ) { + +
#
: , :
+ + + + + + + + + + + + + + + $value) { + if ( ! $value['header']) { + ?> + + + + + + + - - - - - - - - - - -
#
- - - + ?> + + + + + + + diff --git a/application/modules/addon_mgtranslate/views/backend/ajax_new_lang.php b/application/modules/addon_mgtranslate/views/backend/ajax_new_lang.php index 0303cd40..07d940ba 100755 --- a/application/modules/addon_mgtranslate/views/backend/ajax_new_lang.php +++ b/application/modules/addon_mgtranslate/views/backend/ajax_new_lang.php @@ -9,10 +9,10 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link https://zigaform.com + * @link https://softdiscover.com/zigaform */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } ob_start(); ?> @@ -21,17 +21,17 @@
- - - -
-
- + + + +
+
+
diff --git a/application/modules/addon_mgtranslate/views/backend/show_list.php b/application/modules/addon_mgtranslate/views/backend/show_list.php index a5e1088b..89c09818 100755 --- a/application/modules/addon_mgtranslate/views/backend/show_list.php +++ b/application/modules/addon_mgtranslate/views/backend/show_list.php @@ -9,10 +9,10 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link https://zigaform.com + * @link https://softdiscover.com/zigaform */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } ob_start(); ?> @@ -21,88 +21,88 @@
-

+


-
- -
- - -
-
- - -
- - -
- - -
- - -
- -
- -
- -
- -
- -
-
- - -
- -
-
-
- -
-
- -
-
- -
-
-
+
+ +
+ + +
+
+ + +
+ + +
+ + +
+ + +
+ +
+ +
+ +
+ +
+ +
+
+ + +
+ +
+
+
+ +
+
+ +
+
+ +
+
+
- -
+ +
- + diff --git a/application/modules/default/controllers/dashboard.php b/application/modules/default/controllers/dashboard.php index f328b54e..2a35bfa5 100755 --- a/application/modules/default/controllers/dashboard.php +++ b/application/modules/default/controllers/dashboard.php @@ -10,10 +10,10 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: intranet.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } /** @@ -25,63 +25,64 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version Release: 1.00 - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -class Dashboard extends BackendController { +class Dashboard extends BackendController +{ - /** - * Intranet::__construct() - * - * @return - */ - function __construct() { - parent::__construct(); - $this->load->language_alt( model_settings::$db_config['language'] ); - $this->template->set( 'controller', $this ); + /** + * Intranet::__construct() + * + * @return + */ + public function __construct() + { + parent::__construct(); + $this->load->language_alt(model_settings::$db_config['language']); + $this->template->set('controller', $this); - $this->load->model( 'user/model_user' ); - $this->load->model( 'visitor/model_visitor' ); + $this->load->model('user/model_user'); + $this->load->model('visitor/model_visitor'); + } - } + /** + * Intranet::index() + * Print the dashboard of the HTML page. + * + * @return void + */ + public function index() + { + // generate cache + // check if cache exist + /* + $this->load->library('cache'); + $data1 = $this->cache->get('addon_back'); + $data2 = $this->cache->get('addon_front'); + $data3 = $this->cache->get('addon_routes'); - /** - * Intranet::index() - * Print the dashboard of the HTML page. - * - * @return void - */ - public function index() { - // generate cache - // check if cache exist - /* - $this->load->library('cache'); - $data1 = $this->cache->get('addon_back'); - $data2 = $this->cache->get('addon_front'); - $data3 = $this->cache->get('addon_routes'); + if( !file_exists(FCPATH .'application/cache/addon_back.cache') + && !file_exists(FCPATH .'application/cache/addon_front.cache') + && !file_exists(FCPATH .'application/cache/addon_routes.cache') + ){ + if (empty($data1) ) { + $tmp_addon=$this->addon->load_addonsbyBack(); + $this->cache->write($tmp_addon, 'addon_back'); + } - if( !file_exists(FCPATH .'application/cache/addon_back.cache') - && !file_exists(FCPATH .'application/cache/addon_front.cache') - && !file_exists(FCPATH .'application/cache/addon_routes.cache') - ){ - if (empty($data1) ) { - $tmp_addon=$this->addon->load_addonsbyBack(); - $this->cache->write($tmp_addon, 'addon_back'); - } + if (empty($data2) ) { + $tmp_addon=$this->addon->load_addonsByFront(); + $this->cache->write($tmp_addon, 'addon_front'); + } - if (empty($data2) ) { - $tmp_addon=$this->addon->load_addonsByFront(); - $this->cache->write($tmp_addon, 'addon_front'); - } + if (empty($data3) ) { + $tmp_addon=$this->addon->load_addRoutes(); + $this->cache->write($tmp_addon, 'addon_routes'); + } - if (empty($data3) ) { - $tmp_addon=$this->addon->load_addRoutes(); - $this->cache->write($tmp_addon, 'addon_routes'); - } - - } */ - redirect( site_url() . 'formbuilder/forms/list_uiforms' ); - } - + } */ + redirect(site_url() . 'formbuilder/forms/list_uiforms'); + } } diff --git a/application/modules/default/controllers/intranet.php b/application/modules/default/controllers/intranet.php index b65bfbea..ea4752a6 100755 --- a/application/modules/default/controllers/intranet.php +++ b/application/modules/default/controllers/intranet.php @@ -11,10 +11,10 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: intranet.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } /** @@ -26,277 +26,290 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version Release: 1.00 - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -class Intranet extends CommonController { - - /** - * Intranet::__construct() - * - * @return - */ - function __construct() { - parent::__construct(); - $this->load->language_alt( model_settings::$db_config['language'] ); - $this->template->set( 'controller', $this ); - $this->load->model( 'formbuilder/model_settings' ); - $this->load->model( 'user/model_user' ); - - // check update - $this->auth->checkupdate(); - } - - /** - * Intranet::dashboard() - * Print the dashboard of the HTML page. - * - * @return void - */ - public function dashboard() { - $this->auth->authenticate( true ); - redirect( site_url() . 'default/dashboard/index' ); - } - - /** - * Intranet::login() - * Print the login of the HTML page. - * - * @return void - */ - public function login() { - $this->template->loadPartial( 'layout-login', 'intranet/login' ); - } - - /** - * Intranet::recoverpass() - * Print the login of the HTML page. - * - * @return void - */ - public function recoverpass() { - $data = array(); - $data['token'] = uniqid(); - - $email_message = $this->load->view( 'intranet/recoverpass_mail', $data, true ); - - // sending email - $this->load->library( 'email', emailConfiguration( intval( model_settings::$db_config['type_email'] ) ) ); - $this->email->set_newline( "\r\n" ); - $this->email->from( model_settings::$db_config['admin_mail'], model_settings::$db_config['site_title'] ); - $list = array(); - $list[] = model_settings::$db_config['admin_mail']; - $this->email->to( $list ); - - $this->email->subject( model_settings::$db_config['site_title'] . ' - Recovery password' ); - $this->email->set_mailtype( 'html' ); - - $this->email->message( $email_message ); - if ( $this->email->send() ) { - $data['message'] = 'Recovery password link was sent to admin mail'; - } else { - $data['message'] = 'Error. Recovery password link was not sent to your mail because of your mail service is not working fine.'; - } - /* get user data */ - $data_user = $this->model_user->getFirstUser(); - - $data2 = array(); - $data2['use_password_token'] = $data['token']; - $this->db->set( $data2 ); - $this->db->where( 'use_id', $data_user->use_id ); - $this->db->update( $this->model_user->table ); - - $this->template->loadPartial( 'layout-login', 'intranet/recoverpass', $data ); - } - - /** - * Intranet::recoverpass() - * Print the login of the HTML page. - * - * @return void - */ - public function processchangepassword() { - $data = array(); - $data['pass_token'] = ( $this->input->post( 'pass_token' ) ) ? Uiform_Form_Helper::sanitizeInput( $this->input->post( 'pass_token' ) ) : ''; - $data['username'] = ( $this->input->post( 'username' ) ) ? Uiform_Form_Helper::sanitizeInput( $this->input->post( 'username' ) ) : ''; - $data['use_password'] = ( $this->input->post( 'password' ) ) ? md5( Uiform_Form_Helper::sanitizeInput( $this->input->post( 'password' ) ) ) : ''; - - $data_user = $this->model_user->getPasswordToken( $data['pass_token'] ); - $data2 = array(); - $data2['use_password_token'] = ''; - $data2['use_password'] = $data['use_password']; - $this->db->set( $data2 ); - $this->db->where( array( 'use_id' => $data_user->use_id ) ); - $this->db->update( $this->model_user->table ); - $this->session->set_flashdata( 'message', 'info: Password was updated' ); - redirect( site_url() . 'admin' ); - } - - /** - * Intranet::recoverpass() - * Print the login of the HTML page. - * - * @return void - */ - public function changepassword() { - $pass_token = Uiform_Form_Helper::sanitizeInput( $this->uri->segment( 4, 0 ) ); - $data = array(); - $data_user = $this->model_user->getPasswordToken( $pass_token ); - if ( ! empty( $data_user ) && (string) $pass_token === $data_user->use_password_token ) { - $data['pass_token'] = $pass_token; - $data['use_login'] = $data_user->use_login; - $this->template->loadPartial( 'layout-login', 'intranet/changepassword', $data ); - } else { - /* redirect to login */ - $this->session->set_flashdata( 'message', 'warning: Recovery password expired. Try again' ); - redirect( site_url() . 'admin' ); - } - } - - /** - * Intranet::settings() - * Print the global settings of the HTML page. - * - * @return array - */ - public function settings() { - $this->auth->authenticate( true ); - $data = array(); - $rdata = $this->model_settings->getSettings(); - $data['site_title'] = $rdata->site_title; - $data['admin_mail'] = $rdata->admin_mail; - $data['type_email'] = $rdata->type_email; - $data['smtp_host'] = $rdata->smtp_host; - $data['smtp_port'] = $rdata->smtp_port; - $data['smtp_user'] = $rdata->smtp_user; - $data['smtp_pass'] = $rdata->smtp_pass; - $data['smtp_conn'] = $rdata->smtp_conn; - $data['sendmail_path'] = $rdata->sendmail_path; - $data['language'] = $rdata->language; - - $pofilespath = FCPATH . 'i18n/languages/backend/'; - $data['lang_list'] = Uiform_Form_Helper::getLanguageList( $pofilespath ); - $this->template->loadPartial( 'layout', 'intranet/settings', $data ); - } - - - /** - * Intranet::settings() - * Print the global settings of the HTML page. - * - * @return array - */ - public function showfilemanager() { - $this->auth->authenticate( true ); - $data = array(); - - $this->template->loadPartial( 'layout-fmanager', 'intranet/showfilemanager', $data ); - } - - /** - * Intranet::help() - * Print the global settings of the HTML page. - * - * @return array - */ - public function help() { - $this->auth->authenticate( true ); - $data = array(); - $this->template->loadPartial( 'layout_blank', 'intranet/help', $data ); - } - - /** - * Intranet::about() - * Print the global settings of the HTML page. - * - * @return array - */ - public function about() { - $this->auth->authenticate( true ); - $data = array(); - $this->template->loadPartial( 'layout_blank', 'intranet/about', $data ); - } - - - /** - * Intranet::gopro() - * Print the global settings of the HTML page. - * - * @return array - */ - public function gopro() { - $this->auth->authenticate( true ); - $data = array(); - $this->template->loadPartial( 'layout_blank', 'intranet/gopro', $data ); - } - - - /** - * Intranet::savesettings() - * Save the global settings - * - * @return void - */ - public function savesettings() { - $this->auth->authenticate( true ); - // deleting cache before inserting data - $this->cache->delete( 'settings' ); - $data = array(); - $data['site_title'] = ( $this->input->post( 'site_title' ) ) ? Uiform_Form_Helper::sanitizeInput( $this->input->post( 'site_title' ) ) : ''; - $data['admin_mail'] = ( $this->input->post( 'admin_mail' ) ) ? Uiform_Form_Helper::sanitizeInput( $this->input->post( 'admin_mail' ) ) : ''; - $data['type_email'] = ( $this->input->post( 'type_mail' ) ) ? Uiform_Form_Helper::sanitizeInput( $this->input->post( 'type_mail' ) ) : 1; - $data['smtp_host'] = ( $this->input->post( 'smtp_host' ) ) ? Uiform_Form_Helper::sanitizeInput( $this->input->post( 'smtp_host' ) ) : ''; - $data['smtp_port'] = ( $this->input->post( 'smtp_port' ) ) ? Uiform_Form_Helper::sanitizeInput( $this->input->post( 'smtp_port' ) ) : '0'; - $data['smtp_user'] = ( $this->input->post( 'smtp_user' ) ) ? Uiform_Form_Helper::sanitizeInput( $this->input->post( 'smtp_user' ) ) : ''; - $data['smtp_pass'] = ( $this->input->post( 'smtp_pass' ) ) ? Uiform_Form_Helper::sanitizeInput( $this->input->post( 'smtp_pass' ) ) : ''; - $data['smtp_conn'] = ( $this->input->post( 'smtp_conn' ) ) ? Uiform_Form_Helper::sanitizeInput( $this->input->post( 'smtp_conn' ) ) : ''; - $data['sendmail_path'] = ( $this->input->post( 'sendmail_path' ) ) ? Uiform_Form_Helper::sanitizeInput( $this->input->post( 'sendmail_path' ) ) : ''; - $data['language'] = ( $this->input->post( 'language' ) ) ? Uiform_Form_Helper::sanitizeInput( $this->input->post( 'language' ) ) : 'en'; - - // inserting data - $this->db->set( $data ); - $this->db->where( 'id', 1 ); - $this->db->update( $this->model_settings->table ); - $this->session->set_flashdata( 'message', 'success: Settings was updated' ); - redirect( site_url() . 'default/intranet/settings' ); - } - - /** - * Intranet::logout() - * Logging out user - * - * @return void - */ - public function logout() { - $this->auth->authenticate( true ); - $this->auth->logout( 'default/intranet/login' ); - } - - /** - * Intranet::authenticate() - * Authenticating user - * - * @return void - */ - public function authenticate() { - $redirect_to = $this->config->item( 'site_url' ) . 'default/intranet/dashboard'; - if ( $this->auth->loggedIn() == false ) { - $data = array(); - $data['error'] = false; - $this->load->library( 'form_validation' ); - $this->form_validation->set_rules( 'username', 'Username', 'trim|required|min_length[1]' ); - $this->form_validation->set_rules( 'password', 'Password', 'trim|required|min_length[1]|max_length[32]' ); - $this->form_validation->set_error_delimiters( '

', '

' ); - - if ( $this->form_validation->run() == false ) { - $this->session->set_flashdata( 'message', 'danger: Access denied - validation' ); - redirect( '/admin' ); - } else { - $this->auth->login( Uiform_Form_Helper::sanitizeInput( $this->input->post( 'username' ) ), Uiform_Form_Helper::sanitizeInput( $this->input->post( 'password' ) ), $redirect_to ); - } - } else { - - redirect( $redirect_to ); - } - } - +class Intranet extends CommonController +{ + + /** + * Intranet::__construct() + * + * @return + */ + public function __construct() + { + parent::__construct(); + $this->load->language_alt(model_settings::$db_config['language']); + $this->template->set('controller', $this); + $this->load->model('formbuilder/model_settings'); + $this->load->model('user/model_user'); + + // check update + $this->auth->checkupdate(); + } + + /** + * Intranet::dashboard() + * Print the dashboard of the HTML page. + * + * @return void + */ + public function dashboard() + { + $this->auth->authenticate(true); + redirect(site_url() . 'default/dashboard/index'); + } + + /** + * Intranet::login() + * Print the login of the HTML page. + * + * @return void + */ + public function login() + { + $this->template->loadPartial('layout-login', 'intranet/login'); + } + + /** + * Intranet::recoverpass() + * Print the login of the HTML page. + * + * @return void + */ + public function recoverpass() + { + $data = array(); + $data['token'] = uniqid(); + + $email_message = $this->load->view('intranet/recoverpass_mail', $data, true); + + // sending email + $this->load->library('email', emailConfiguration(intval(model_settings::$db_config['type_email']))); + $this->email->set_newline("\r\n"); + $this->email->from(model_settings::$db_config['admin_mail'], model_settings::$db_config['site_title']); + $list = array(); + $list[] = model_settings::$db_config['admin_mail']; + $this->email->to($list); + + $this->email->subject(model_settings::$db_config['site_title'] . ' - Recovery password'); + $this->email->set_mailtype('html'); + + $this->email->message($email_message); + if ( $this->email->send()) { + $data['message'] = 'Recovery password link was sent to admin mail'; + } else { + $data['message'] = 'Error. Recovery password link was not sent to your mail because of your mail service is not working fine.'; + } + /* get user data */ + $data_user = $this->model_user->getFirstUser(); + + $data2 = array(); + $data2['use_password_token'] = $data['token']; + $this->db->set($data2); + $this->db->where('use_id', $data_user->use_id); + $this->db->update($this->model_user->table); + + $this->template->loadPartial('layout-login', 'intranet/recoverpass', $data); + } + + /** + * Intranet::recoverpass() + * Print the login of the HTML page. + * + * @return void + */ + public function processchangepassword() + { + $data = array(); + $data['pass_token'] = ( $this->input->post('pass_token') ) ? Uiform_Form_Helper::sanitizeInput($this->input->post('pass_token')) : ''; + $data['username'] = ( $this->input->post('username') ) ? Uiform_Form_Helper::sanitizeInput($this->input->post('username')) : ''; + $data['use_password'] = ( $this->input->post('password') ) ? md5(Uiform_Form_Helper::sanitizeInput($this->input->post('password'))) : ''; + + $data_user = $this->model_user->getPasswordToken($data['pass_token']); + $data2 = array(); + $data2['use_password_token'] = ''; + $data2['use_password'] = $data['use_password']; + $this->db->set($data2); + $this->db->where(array( 'use_id' => $data_user->use_id )); + $this->db->update($this->model_user->table); + $this->session->set_flashdata('message', 'info: Password was updated'); + redirect(site_url() . 'admin'); + } + + /** + * Intranet::recoverpass() + * Print the login of the HTML page. + * + * @return void + */ + public function changepassword() + { + $pass_token = Uiform_Form_Helper::sanitizeInput($this->uri->segment(4, 0)); + $data = array(); + $data_user = $this->model_user->getPasswordToken($pass_token); + if ( ! empty($data_user) && (string) $pass_token === $data_user->use_password_token) { + $data['pass_token'] = $pass_token; + $data['use_login'] = $data_user->use_login; + $this->template->loadPartial('layout-login', 'intranet/changepassword', $data); + } else { + /* redirect to login */ + $this->session->set_flashdata('message', 'warning: Recovery password expired. Try again'); + redirect(site_url() . 'admin'); + } + } + + /** + * Intranet::settings() + * Print the global settings of the HTML page. + * + * @return array + */ + public function settings() + { + $this->auth->authenticate(true); + $data = array(); + $rdata = $this->model_settings->getSettings(); + $data['site_title'] = $rdata->site_title; + $data['admin_mail'] = $rdata->admin_mail; + $data['type_email'] = $rdata->type_email; + $data['smtp_host'] = $rdata->smtp_host; + $data['smtp_port'] = $rdata->smtp_port; + $data['smtp_user'] = $rdata->smtp_user; + $data['smtp_pass'] = $rdata->smtp_pass; + $data['smtp_conn'] = $rdata->smtp_conn; + $data['sendmail_path'] = $rdata->sendmail_path; + $data['language'] = $rdata->language; + + $pofilespath = FCPATH . 'i18n/languages/backend/'; + $data['lang_list'] = Uiform_Form_Helper::getLanguageList($pofilespath); + $this->template->loadPartial('layout', 'intranet/settings', $data); + } + + + /** + * Intranet::settings() + * Print the global settings of the HTML page. + * + * @return array + */ + public function showfilemanager() + { + $this->auth->authenticate(true); + $data = array(); + + $this->template->loadPartial('layout-fmanager', 'intranet/showfilemanager', $data); + } + + /** + * Intranet::help() + * Print the global settings of the HTML page. + * + * @return array + */ + public function help() + { + $this->auth->authenticate(true); + $data = array(); + $this->template->loadPartial('layout_blank', 'intranet/help', $data); + } + + /** + * Intranet::about() + * Print the global settings of the HTML page. + * + * @return array + */ + public function about() + { + $this->auth->authenticate(true); + $data = array(); + $this->template->loadPartial('layout_blank', 'intranet/about', $data); + } + + + /** + * Intranet::gopro() + * Print the global settings of the HTML page. + * + * @return array + */ + public function gopro() + { + $this->auth->authenticate(true); + $data = array(); + $this->template->loadPartial('layout_blank', 'intranet/gopro', $data); + } + + + /** + * Intranet::savesettings() + * Save the global settings + * + * @return void + */ + public function savesettings() + { + $this->auth->authenticate(true); + // deleting cache before inserting data + $this->cache->delete('settings'); + $data = array(); + $data['site_title'] = ( $this->input->post('site_title') ) ? Uiform_Form_Helper::sanitizeInput($this->input->post('site_title')) : ''; + $data['admin_mail'] = ( $this->input->post('admin_mail') ) ? Uiform_Form_Helper::sanitizeInput($this->input->post('admin_mail')) : ''; + $data['type_email'] = ( $this->input->post('type_mail') ) ? Uiform_Form_Helper::sanitizeInput($this->input->post('type_mail')) : 1; + $data['smtp_host'] = ( $this->input->post('smtp_host') ) ? Uiform_Form_Helper::sanitizeInput($this->input->post('smtp_host')) : ''; + $data['smtp_port'] = ( $this->input->post('smtp_port') ) ? Uiform_Form_Helper::sanitizeInput($this->input->post('smtp_port')) : '0'; + $data['smtp_user'] = ( $this->input->post('smtp_user') ) ? Uiform_Form_Helper::sanitizeInput($this->input->post('smtp_user')) : ''; + $data['smtp_pass'] = ( $this->input->post('smtp_pass') ) ? Uiform_Form_Helper::sanitizeInput($this->input->post('smtp_pass')) : ''; + $data['smtp_conn'] = ( $this->input->post('smtp_conn') ) ? Uiform_Form_Helper::sanitizeInput($this->input->post('smtp_conn')) : ''; + $data['sendmail_path'] = ( $this->input->post('sendmail_path') ) ? Uiform_Form_Helper::sanitizeInput($this->input->post('sendmail_path')) : ''; + $data['language'] = ( $this->input->post('language') ) ? Uiform_Form_Helper::sanitizeInput($this->input->post('language')) : 'en'; + + // inserting data + $this->db->set($data); + $this->db->where('id', 1); + $this->db->update($this->model_settings->table); + $this->session->set_flashdata('message', 'success: Settings was updated'); + redirect(site_url() . 'default/intranet/settings'); + } + + /** + * Intranet::logout() + * Logging out user + * + * @return void + */ + public function logout() + { + $this->auth->authenticate(true); + $this->auth->logout('default/intranet/login'); + } + + /** + * Intranet::authenticate() + * Authenticating user + * + * @return void + */ + public function authenticate() + { + $redirect_to = $this->config->item('site_url') . 'default/intranet/dashboard'; + if ( $this->auth->loggedIn() == false) { + $data = array(); + $data['error'] = false; + $this->load->library('form_validation'); + $this->form_validation->set_rules('username', 'Username', 'trim|required|min_length[1]'); + $this->form_validation->set_rules('password', 'Password', 'trim|required|min_length[1]|max_length[32]'); + $this->form_validation->set_error_delimiters('

', '

'); + + if ( $this->form_validation->run() == false) { + $this->session->set_flashdata('message', 'danger: Access denied - validation'); + redirect('/admin'); + } else { + $this->auth->login(Uiform_Form_Helper::sanitizeInput($this->input->post('username')), Uiform_Form_Helper::sanitizeInput($this->input->post('password')), $redirect_to); + } + } else { + redirect($redirect_to); + } + } } diff --git a/application/modules/default/controllers/zerror.php b/application/modules/default/controllers/zerror.php index 08344559..e4bebbd3 100755 --- a/application/modules/default/controllers/zerror.php +++ b/application/modules/default/controllers/zerror.php @@ -10,11 +10,11 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: frontend.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } @@ -27,32 +27,34 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version Release: 1.00 - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -class Zerror extends MX_Controller { +class Zerror extends MX_Controller +{ - /** - * Error::__construct() - * - * @return - */ - function __construct() { - parent::__construct(); - } - - /** - * Error::index() - * Show error page - * - * @return array - */ - public function index() { - $this->output->set_status_header( '404' ); - $data = array(); - $data['heading'] = '404 Page Not Found'; - $data['message'] = '

The page you requested was not found.

'; - $this->load->view( 'zerror/error', $data ); - } + /** + * Error::__construct() + * + * @return + */ + public function __construct() + { + parent::__construct(); + } + /** + * Error::index() + * Show error page + * + * @return array + */ + public function index() + { + $this->output->set_status_header('404'); + $data = array(); + $data['heading'] = '404 Page Not Found'; + $data['message'] = '

The page you requested was not found.

'; + $this->load->view('zerror/error', $data); + } } diff --git a/application/modules/default/views/intranet/about.php b/application/modules/default/views/intranet/about.php index 10d58b0c..1b1138a1 100755 --- a/application/modules/default/views/intranet/about.php +++ b/application/modules/default/views/intranet/about.php @@ -10,10 +10,10 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: settings.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-form-builder.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-form-builder/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } ?> @@ -22,90 +22,89 @@
- -
-

-
- -
-
-
-
- -
-
- -
- -
- -
+ +
+

+
+ +
+
+
+
+ +
+
+ +
+ +
+ +
diff --git a/application/modules/default/views/intranet/changepassword.php b/application/modules/default/views/intranet/changepassword.php index 5768f8e0..cea09bc8 100755 --- a/application/modules/default/views/intranet/changepassword.php +++ b/application/modules/default/views/intranet/changepassword.php @@ -12,91 +12,90 @@ * @version CVS: $Id: index.php, v1.20 2014-04-28 02:52:40 Softdiscover $ * @link http://universal-form-builder.softdiscover.com/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } ?> - + +
+
+
+ +
+
+
+ + diff --git a/application/modules/default/views/intranet/gopro.php b/application/modules/default/views/intranet/gopro.php index e6c12e5f..95e5ef53 100755 --- a/application/modules/default/views/intranet/gopro.php +++ b/application/modules/default/views/intranet/gopro.php @@ -10,170 +10,170 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: settings.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-form-builder.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-form-builder/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } ?>
- -

- -

+ +

+ +

-
- -
-
- +
+ +
+
+
- - - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +
   
  
-
-
+
+
-
- -

- - -

- - -
+
+ +

+ + +

+ + +
diff --git a/application/modules/default/views/intranet/help.php b/application/modules/default/views/intranet/help.php index 4ec0525f..9af0460d 100755 --- a/application/modules/default/views/intranet/help.php +++ b/application/modules/default/views/intranet/help.php @@ -10,74 +10,74 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: settings.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-form-builder.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-form-builder/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } ?>
-

-
- - - - -
- -
-
-
- -
-
- -
- -
- -
- +

+
+ + + + +
+ +
+
+
+ +
+
+ +
+ +
+ +
+
diff --git a/application/modules/default/views/intranet/login.php b/application/modules/default/views/intranet/login.php index 133dab7b..b0debbe2 100755 --- a/application/modules/default/views/intranet/login.php +++ b/application/modules/default/views/intranet/login.php @@ -10,80 +10,78 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: index.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } ?> - + +
+
+
+ +
+
+
+ + diff --git a/application/modules/default/views/intranet/recoverpass.php b/application/modules/default/views/intranet/recoverpass.php index 05bdc402..61e7214a 100755 --- a/application/modules/default/views/intranet/recoverpass.php +++ b/application/modules/default/views/intranet/recoverpass.php @@ -12,26 +12,25 @@ * @version CVS: $Id: index.php, v1.20 2014-04-28 02:52:40 Softdiscover $ * @link http://universal-form-builder.softdiscover.com/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } ?> - + +
+
+
+
+ +
+
+
+
+ + diff --git a/application/modules/default/views/intranet/recoverpass_mail.php b/application/modules/default/views/intranet/recoverpass_mail.php index a0e1ae8f..d4ec1156 100755 --- a/application/modules/default/views/intranet/recoverpass_mail.php +++ b/application/modules/default/views/intranet/recoverpass_mail.php @@ -12,11 +12,11 @@ * @version CVS: $Id: index.php, v1.20 2014-04-28 02:52:40 Softdiscover $ * @link http://universal-form-builder.softdiscover.com/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } ?> hi, copy & paste the url or just click on next: default/intranet/changepassword/ - + diff --git a/application/modules/default/views/intranet/settings.php b/application/modules/default/views/intranet/settings.php index ed09e9b7..9d5e10e2 100755 --- a/application/modules/default/views/intranet/settings.php +++ b/application/modules/default/views/intranet/settings.php @@ -10,203 +10,202 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: settings.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } ?>
session->flashdata( 'message' ) ) { - $resp = explode( ':', $this->session->flashdata( 'message' ) ) - ?> -
- - -
- session->flashdata('message')) { + $resp = explode(':', $this->session->flashdata('message')) + ?> +
+ + +
+
-
-
-
+
+
+
-
-
-
- 'form-horizontal', - 'id' => 'frmform', - 'name' => 'frmform', - ); - echo form_open( site_url() . 'default/intranet/savesettings', $attributes ); - ?> - -
- -
- -
-
-
- -
- -
-
- - -
- -
-
- +
+
+
+ +
+ +
+
+ + +
+ +
+
+ -
- -
-
-
- -
-
- -
-
-
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
- -
- -
- - + foreach ( $lang_list as $key => $frow) : + ?> + + + + + +
+ +
+
+
+ +
+
+ +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+ + -
-
-
-
-
- -
- -
-
-
- -
-
- +
+
+
+
+ +
+ +
+
+
+ +
+
+ -
+ + +
+ diff --git a/application/modules/default/views/intranet/showfilemanager.php b/application/modules/default/views/intranet/showfilemanager.php index c085f343..561c6a34 100755 --- a/application/modules/default/views/intranet/showfilemanager.php +++ b/application/modules/default/views/intranet/showfilemanager.php @@ -10,14 +10,14 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: settings.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-form-builder.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-form-builder/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } ?>
-

-
+

+
diff --git a/application/modules/default/views/zerror/error.php b/application/modules/default/views/zerror/error.php index 16054918..9165454a 100755 --- a/application/modules/default/views/zerror/error.php +++ b/application/modules/default/views/zerror/error.php @@ -10,10 +10,10 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: error.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } ?> @@ -27,61 +27,61 @@ ::webkit-selection{ background-color: #E13300; color: white; } body { - background-color: #fff; - margin: 40px; - font: 13px/20px normal Helvetica, Arial, sans-serif; - color: #4F5155; + background-color: #fff; + margin: 40px; + font: 13px/20px normal Helvetica, Arial, sans-serif; + color: #4F5155; } a { - color: #003399; - background-color: transparent; - font-weight: normal; + color: #003399; + background-color: transparent; + font-weight: normal; } h1 { - color: #444; - background-color: transparent; - border-bottom: 1px solid #D0D0D0; - font-size: 19px; - font-weight: normal; - margin: 0 0 14px 0; - padding: 14px 15px 10px 15px; + color: #444; + background-color: transparent; + border-bottom: 1px solid #D0D0D0; + font-size: 19px; + font-weight: normal; + margin: 0 0 14px 0; + padding: 14px 15px 10px 15px; } code { - font-family: Consolas, Monaco, Courier New, Courier, monospace; - font-size: 12px; - background-color: #f9f9f9; - border: 1px solid #D0D0D0; - color: #002166; - display: block; - margin: 14px 0 14px 0; - padding: 12px 10px 12px 10px; + font-family: Consolas, Monaco, Courier New, Courier, monospace; + font-size: 12px; + background-color: #f9f9f9; + border: 1px solid #D0D0D0; + color: #002166; + display: block; + margin: 14px 0 14px 0; + padding: 12px 10px 12px 10px; } #container { - margin: 10px; - border: 1px solid #D0D0D0; - -webkit-box-shadow: 0 0 8px #D0D0D0; + margin: 10px; + border: 1px solid #D0D0D0; + -webkit-box-shadow: 0 0 8px #D0D0D0; } p { - margin: 12px 15px 12px 15px; + margin: 12px 15px 12px 15px; } - -
-

- -
+ +
+

+ +
diff --git a/application/modules/formbuilder/controllers/fields.php b/application/modules/formbuilder/controllers/fields.php index 43a4cab9..bb2cb869 100755 --- a/application/modules/formbuilder/controllers/fields.php +++ b/application/modules/formbuilder/controllers/fields.php @@ -11,10 +11,10 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: intranet.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } /** @@ -26,1203 +26,1272 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version Release: 1.00 - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -class Fields extends BackendController { - /** - * max number of forms in order show by pagination - * - * @var int - */ - - const VERSION = '0.1'; - - /** - * name of form estimator table - * - * @var string - */ - var $table = ''; - var $per_page = 10; - - /** - * Fields::__construct() - * - * @return - */ - function __construct() { - parent::__construct(); - $this->load->language_alt( model_settings::$db_config['language'] ); - $this->template->set( 'controller', $this ); - $this->load->model( 'model_fields' ); - $this->load->model( 'addon/model_addon' ); - - } - - - /** - * Forms::ajax_dev generation field options - * - * @return - */ - public function ajax_dev_genfieldopts() { - - $data_render = array(); - - $array = array( 1, 2, 3, 4, 5, 6, 8, 9, 10, 11 ); - foreach ( $array as $type ) { - switch ( intval( $type ) ) { - case 1: - // 1 col - $field_block = 0; - $data_render[ $type ] = $this->load_field_options( $type, '', $field_block ); - break; - case 2: - // 2 cols - $field_block = 0; - $data_render[ $type ] = $this->load_field_options( $type, '', $field_block ); - break; - case 3: - // 3 cols - $field_block = 0; - $data_render[ $type ] = $this->load_field_options( $type, '', $field_block ); - break; - case 4: - // 4 cols - $field_block = 0; - $data_render[ $type ] = $this->load_field_options( $type, '', $field_block ); - break; - case 5: - // 6 cols - $field_block = 0; - $data_render[ $type ] = $this->load_field_options( $type, '', $field_block ); - break; - case 6: - // textbox - $data_render[ $type ] = $this->load_field_options( $type, '', null ); - break; - - case 8: - // radio button - $data_render[ $type ] = $this->load_field_options( $type, '', null ); - break; - case 9: - // checkbox - $data_render[ $type ] = $this->load_field_options( $type, '', null ); - break; - case 10: - // select - $data_render[ $type ] = $this->load_field_options( $type, '', null ); - break; - case 11: - // multiple select - $data_render[ $type ] = $this->load_field_options( $type, '', null ); - break; - } - } - - - - $search2 = base_url(); - $replace2 = '{{{data.site_url}}}'; - - $js_store = ''; - - foreach ( $data_render as $key => $value ) { - - $html_output = ''; - ob_start(); - ?><?php - /** - * Intranet - * - * PHP version 5 - * - * @category PHP - * @package Rocket_form - * @author Softdiscover <info@softdiscover.com> - * @copyright 2015 Softdiscover - * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-form-builder.uiform.com/ - */ - if (!defined('BASEPATH')) {exit('No direct script access allowed');} - ?> - <!-- options --> - '; - - preg_match_all( '##is', $value, $matches ); - foreach ( $matches[0] as $value2 ) { - $js_store .= $value2; - } - - $value = str_replace( $search1, $replace1, $value ); - $value = str_replace( $search2, $replace2, $value ); - - $html_output .= htmlentities( $value ); - - $html_output .= ''; - $html_output .= ''; - - - $fname = APPPATH . '/modules/formbuilder/views/fields/render_back/fieldoptions_data_'.$key.'.php'; - - $fhandle = fopen( $fname, 'w' ); - fwrite( $fhandle, $html_output ); - fclose( $fhandle ); - - } - - - - // echo json_encode($data_render); - die(); - } - - /** - * Forms::ajax_delete_form_byid() - * - * @return - */ - public function ajax_field_sel_impbulkdata() { - - $data = array(); - - $json = array(); - $json['modal_header'] = '

' . __( 'Import Bulk Data', 'FRocket_admin' ) . '

'; - $json['modal_body'] = $this->load->view( 'formbuilder/fields/options/select/impbulkdata', $data, true ); - $json['modal_footer'] = $this->load->view( 'formbuilder/fields/options/select/impbulkdata_footer', $data, true ); - - // return data to ajax callback - header( 'Content-Type: application/json' ); - echo json_encode( $json ); - die(); - } - - /** - * Get field option in order to customize the field - * - * @return json - */ - public function ajax_field_option() { - - // check_ajax_referer('zgfm_ajax_nonce', 'zgfm_security'); - - $id = ( isset( $_POST['field_id'] ) ) ? Uiform_Form_Helper::sanitizeInput( trim( $_POST['field_id'] ) ) : ''; - $type = ( isset( $_POST['field_type'] ) ) ? Uiform_Form_Helper::sanitizeInput( trim( $_POST['field_type'] ) ) : ''; - $field_block = ( isset( $_POST['field_block'] ) ) ? Uiform_Form_Helper::sanitizeInput( trim( $_POST['field_block'] ) ) : ''; - $field_block = ( isset( $field_block ) && intval( $field_block ) > 0 ) ? $field_block : 0; - $json = array(); - - $json['modal_body'] = $this->load_field_options( $type, $id, $field_block ); - - $json['field_id'] = $id; - $json['field_type'] = $type; - $json['field_block'] = $field_block; - - // addons - - // $json['addons'] = $this->model_addon->getActiveAddonsNamesOnBack(); - - header( 'Content-Type: application/json' ); - echo json_encode( $json ); - die(); - } - - - /** - * load field option by type - * - * @return json - */ - public function load_field_options( $type, $id, $block = null ) { - - $output = ''; - - $data = array(); - switch ( intval( $type ) ) { - case 1: - case 2: - case 3: - case 4: - case 5: - $data['field_id'] = $id; - $data['field_type'] = $type; - $data['field_block'] = ( isset( $block ) && intval( $block ) > 0 ) ? $block : 0; - - $data['is_row'] = true; - $data['message_picked_el'] = ''; - if ( isset( $block ) && intval( $block ) > 0 ) { - $data['is_row'] = false; - $data['message_picked_el'] = __( 'Column', 'FRocket_admin' ) . ' ' . $block; - } - - $data['modules_field_more'] = ''; - - $output .= $this->load->view( 'formbuilder/fields/modal/field_opt_column', $data, true ); - break; - - default: - // textbox - $data = array(); - $data['field_id'] = $id; - $data['field_type'] = $type; - switch ( intval( $type ) ) { - case 8: - // radio button - case 9: - // checkbox - $data['field_extra_src'] = $this->load->view( 'formbuilder/fields/modal/field_opt_checkbox_extra', $data, true ); - break; - case 10: - // select - case 11: - // Multiple select - $data['field_extra_src'] = $this->load->view( 'formbuilder/fields/modal/field_opt_select_extra', $data, true ); - break; - default: - break; - } - - $data['modules_field_more'] = modules::run( 'addon/zfad_backend/addons_doActions', 'back_field_opt_more' ); - - $data['obj_sfm'] = Uiform_Form_Helper::get_font_library(); - $output .= $this->load->view( 'formbuilder/fields/modal/field_opt_text', $data, true ); - break; - - } - - return $output; - } - - /** - * Fields:: ajax_refresh_captcha() - * - * @return - */ - 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 ); - die(); - } - - - /** - * Fields::edit_uiform() - * - * @return - */ - public function edit_uiform() { - - $data = array(); - echo $this->load->view( 'formbuilder/forms/edit_form', $data, true ); - } - - - public function formhtml_textbox( $value, $num_tab ) { - $data = array(); - $data['tab_num'] = $num_tab; - $data = array_merge( $data, $value ); - return $this->formhtml_renderField( $data ); - } - - public function formhtml_textbox_css( $data ) { - return $this->formhtml_renderCssField( $data ); - } - - public function formhtml_textarea( $value, $num_tab ) { - $data = array(); - $data['tab_num'] = $num_tab; - $data = array_merge( $data, $value ); - return $this->formhtml_renderField( $data ); - } - - public function formhtml_textarea_css( $data ) { - return $this->formhtml_renderCssField( $data ); - } - - public function formhtml_radiobtn( $value, $num_tab ) { - $data = array(); - $data['tab_num'] = $num_tab; - $data = array_merge( $data, $value ); - return $this->formhtml_renderField( $data ); - } - - public function formhtml_radiobtn_css( $data ) { - return $this->formhtml_renderCssField( $data ); - } - - public function formhtml_checkbox( $value, $num_tab ) { - $data = array(); - $data['tab_num'] = $num_tab; - $data = array_merge( $data, $value ); - - return $this->formhtml_renderField( $data ); - } - - public function formhtml_checkbox_css( $data ) { - - return $this->formhtml_renderCssField( $data ); - - } - - public function formhtml_select( $value, $num_tab ) { - $data = array(); - $data['tab_num'] = $num_tab; - $data = array_merge( $data, $value ); - return $this->formhtml_renderField( $data ); - } - - public function formhtml_select_css( $data ) { - return $this->formhtml_renderCssField( $data ); - } - - public function formhtml_multiselect( $value, $num_tab ) { - $data = array(); - $data['tab_num'] = $num_tab; - $data = array_merge( $data, $value ); - return $this->formhtml_renderField( $data ); - } - - public function formhtml_multiselect_css( $data ) { - // using select css because it's the same - return $this->formhtml_renderCssField( $data ); - } - - public function formhtml_fileupload( $value, $num_tab ) { - $data = array(); - $data['tab_num'] = $num_tab; - $data = array_merge( $data, $value ); - return $this->formhtml_renderField( $data ); - } - - public function formhtml_fileupload_css( $data ) { - return $this->formhtml_renderCssField( $data ); - } - - public function formhtml_imageupload( $value, $num_tab ) { - $data = array(); - $data['tab_num'] = $num_tab; - $data = array_merge( $data, $value ); - return $this->formhtml_renderField( $data ); - } - - public function formhtml_imageupload_css( $data ) { - return $this->formhtml_renderCssField( $data ); - } - - public function formhtml_customhtml( $value, $num_tab ) { - $data = array(); - $data['tab_num'] = $num_tab; - $data = array_merge( $data, $value ); - return $this->formhtml_renderField( $data ); - } - - public function formhtml_customhtml_css( $data ) { - return $this->formhtml_renderCssField( $data ); - } - - public function formhtml_password( $value, $num_tab ) { - $data = array(); - $data['tab_num'] = $num_tab; - $data = array_merge( $data, $value ); - return $this->formhtml_renderField( $data ); - } - - public function formhtml_password_css( $data ) { - return $this->formhtml_renderCssField( $data ); - } - - public function formhtml_preptext( $value, $num_tab ) { - $data = array(); - $data['tab_num'] = $num_tab; - $data = array_merge( $data, $value ); - return $this->formhtml_renderField( $data ); - } - - public function formhtml_preptext_css( $data ) { - return $this->formhtml_renderCssField( $data ); - } - - public function formhtml_appetext( $value, $num_tab ) { - $data = array(); - $data['tab_num'] = $num_tab; - $data = array_merge( $data, $value ); - return $this->formhtml_renderField( $data ); - } - - public function formhtml_appetext_css( $data ) { - return $this->formhtml_renderCssField( $data ); - } - - public function formhtml_prepapptext( $value, $num_tab ) { - $data = array(); - $data['tab_num'] = $num_tab; - $data = array_merge( $data, $value ); - return $this->formhtml_renderField( $data ); - } - - public function formhtml_prepapptext_css( $data ) { - return $this->formhtml_renderCssField( $data ); - } - - public function formhtml_panelfld( $value, $num_tab ) { - $data = array(); - $data['tab_num'] = $num_tab; - $data = array_merge( $data, $value ); - return $this->formhtml_renderField( $data ); - } - - public function formhtml_panelfld_css( $data ) { - return $this->formhtml_renderCssField( $data ); - } - - public function formhtml_slider( $value, $num_tab ) { - $data = array(); - $data['tab_num'] = $num_tab; - $data = array_merge( $data, $value ); - return $this->formhtml_renderField( $data ); - } - - public function formhtml_slider_css( $data ) { - return $this->formhtml_renderCssField( $data ); - } - - public function formhtml_range( $value, $num_tab ) { - $data = array(); - $data['tab_num'] = $num_tab; - $data = array_merge( $data, $value ); - return $this->formhtml_renderField( $data ); - } - - public function formhtml_range_css( $data ) { - return $this->formhtml_renderCssField( $data ); - } - - public function formhtml_spinner( $value, $num_tab ) { - $data = array(); - $data['tab_num'] = $num_tab; - $data = array_merge( $data, $value ); - return $this->formhtml_renderField( $data ); - } - - public function formhtml_spinner_css( $data ) { - return $this->formhtml_renderCssField( $data ); - } - - public function formhtml_captcha( $value, $num_tab ) { - $data = array(); - $data['tab_num'] = $num_tab; - $data = array_merge( $data, $value ); - return $this->formhtml_renderField( $data ); - } - - public function formhtml_captcha_css( $data ) { - return $this->formhtml_renderCssField( $data ); - } - - public function formhtml_recaptcha( $value, $num_tab ) { - $data = array(); - $data['tab_num'] = $num_tab; - $data = array_merge( $data, $value ); - return $this->formhtml_renderField( $data ); - } - - public function formhtml_recaptcha_css( $data ) { - return $this->formhtml_renderCssField( $data ); - } - - public function formhtml_datepicker( $value, $num_tab ) { - $data = array(); - $data['tab_num'] = $num_tab; - $data = array_merge( $data, $value ); - return $this->formhtml_renderField( $data ); - } - - public function formhtml_datepicker_css( $data ) { - return $this->formhtml_renderCssField( $data ); - } - - public function formhtml_date2( $value, $num_tab ) { - $data = array(); - $data['tab_num'] = $num_tab; - $data = array_merge( $data, $value ); - return $this->formhtml_renderField( $data ); - } - - public function formhtml_date2_css( $data ) { - return $this->formhtml_renderCssField( $data ); - } - - public function formhtml_timepicker( $value, $num_tab ) { - $data = array(); - $data['tab_num'] = $num_tab; - $data = array_merge( $data, $value ); - return $this->formhtml_renderField( $data ); - } - - public function formhtml_timepicker_css( $data ) { - return $this->formhtml_renderCssField( $data ); - } - - public function formhtml_datetime( $value, $num_tab ) { - $data = array(); - $data['tab_num'] = $num_tab; - $data = array_merge( $data, $value ); - return $this->formhtml_renderField( $data ); - } - - public function formhtml_datetime_css( $data ) { - return $this->formhtml_renderCssField( $data ); - } - - public function formhtml_submitbtn( $value, $num_tab ) { - $data = array(); - $data['tab_num'] = $num_tab; - $data = array_merge( $data, $value ); - return $this->formhtml_renderField( $data ); - } - - public function formhtml_submitbtn_css( $data ) { - return $this->formhtml_renderCssField( $data ); - } - - public function formhtml_hiddeninput( $value, $num_tab ) { - $data = array(); - $data['tab_num'] = $num_tab; - $data = array_merge( $data, $value ); - return $this->formhtml_renderField( $data ); - } - - public function formhtml_hiddeninput_css( $data ) { - return $this->formhtml_renderCssField( $data ); - } - - public function formhtml_ratingstar( $value, $num_tab ) { - $data = array(); - $data['tab_num'] = $num_tab; - $data = array_merge( $data, $value ); - return $this->formhtml_renderField( $data ); - } - - public function formhtml_ratingstar_css( $data ) { - return $this->formhtml_renderCssField( $data ); - } - - public function formhtml_colorpicker( $value, $num_tab ) { - $data = array(); - $data['tab_num'] = $num_tab; - $data = array_merge( $data, $value ); - return $this->formhtml_renderField( $data ); - } - - public function formhtml_colorpicker_css( $data ) { - return $this->formhtml_renderCssField( $data ); - } - - public function formhtml_divider( $value, $num_tab ) { - $data = array(); - $data['tab_num'] = $num_tab; - $data = array_merge( $data, $value ); - return $this->formhtml_renderField( $data ); - } - - public function formhtml_divider_css( $data ) { - - return $this->formhtml_renderCssField( $data ); - } - - public function formhtml_wizardbtn( $value, $num_tab ) { - $data = array(); - $data['tab_num'] = $num_tab; - $data = array_merge( $data, $value ); - return $this->formhtml_renderField( $data ); - } - - public function formhtml_wizardbtn_css( $data ) { - return $this->formhtml_renderCssField( $data ); - } - public function formhtml_switch( $value, $num_tab ) { - $data = array(); - $data['tab_num'] = $num_tab; - $data = array_merge( $data, $value ); - return $this->formhtml_renderField( $data ); - } - - public function formhtml_switch_css( $data ) { - return $this->formhtml_renderCssField( $data ); - } - - public function formhtml_dyncheckbox( $value, $num_tab ) { - $data = array(); - $data['tab_num'] = $num_tab; - $data = array_merge( $data, $value ); - return $this->formhtml_renderField( $data ); - } - - public function formhtml_dyncheckbox_css( $data ) { - return $this->formhtml_renderCssField( $data ); - } - public function formhtml_dynradiobtn( $value, $num_tab ) { - $data = array(); - $data['tab_num'] = $num_tab; - $data = array_merge( $data, $value ); - return $this->formhtml_renderField( $data ); - } - - public function formhtml_dynradiobtn_css( $data ) { - return $this->formhtml_renderCssField( $data ); - } - public function formhtml_heading( $value, $num_tab ) { - $data = array(); - $data['tab_num'] = $num_tab; - $data = array_merge( $data, $value ); - return $this->formhtml_renderField( $data ); - } - - public function formhtml_heading_css( $data ) { - return $this->formhtml_renderCssField( $data ); - } - - public function formhtml_renderCssField( $data ) { - - $tmp_type = intval( $data['type'] ); - - $output = ''; - - switch ( $tmp_type ) { - case 6: - /*textbox*/ - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - case 19: - case 20: - case 21: - case 22: - case 23: - case 24: - case 25: - case 26: - case 27: - case 28: - case 29: - case 30: - case 32: - case 33: - case 34: - case 35: - case 36: - case 37: - case 38: - case 39: - case 40: - case 41: - case 42: - case 43: - $data['render_common_css'] = $this->load->view( 'formbuilder/fields/render_css_front/common_css', $data, true ); - $data['render_common_css2'] = $this->load->view( 'formbuilder/fields/render_css_front/common_css2', $data, true ); - $data['render_addon_css'] = $this->load->view( 'formbuilder/fields/render_css_front/addon_css', $data, true ); - - switch ( $tmp_type ) { - case 6: - /*textbox*/ - $data['render_block_type'] = $this->load->view( 'formbuilder/fields/render_css_front/type_textbox', $data, true ); - break; - case 7: - /*textarea*/ - $data['render_block_type'] = $this->load->view( 'formbuilder/fields/render_css_front/type_textarea', $data, true ); - break; - case 8: - /*radio button*/ - $data['render_block_type'] = $this->load->view( 'formbuilder/fields/render_css_front/type_radiobutton', $data, true ); - break; - case 9: - /*checkbox*/ - $data['render_block_type'] = $this->load->view( 'formbuilder/fields/render_css_front/type_checkbox', $data, true ); - break; - case 10: - /*select*/ - $data['render_block_type'] = $this->load->view( 'formbuilder/fields/render_css_front/type_select', $data, true ); - break; - case 11: - /*multiselect*/ - $data['render_block_type'] = $this->load->view( 'formbuilder/fields/render_css_front/type_multiselect', $data, true ); - break; - case 12: - /*file upload*/ - $data['render_block_type'] = $this->load->view( 'formbuilder/fields/render_css_front/type_fileupload', $data, true ); - break; - case 13: - /*image upload*/ - $data['render_block_type'] = $this->load->view( 'formbuilder/fields/render_css_front/type_imageupload', $data, true ); - break; - case 14: - /*custom html*/ - $data['render_block_type'] = $this->load->view( 'formbuilder/fields/render_css_front/type_customhtml', $data, true ); - break; - case 15: - /*password*/ - $data['render_block_type'] = $this->load->view( 'formbuilder/fields/render_css_front/type_password', $data, true ); - break; - case 16: - /*Slider*/ - $data['render_block_type'] = $this->load->view( 'formbuilder/fields/render_css_front/type_slider', $data, true ); - break; - case 17: - /*range*/ - $data['render_block_type'] = $this->load->view( 'formbuilder/fields/render_css_front/type_range', $data, true ); - break; - case 18: - /*spinner*/ - $data['render_block_type'] = $this->load->view( 'formbuilder/fields/render_css_front/type_spinner', $data, true ); - break; - case 19: - /*captcha*/ - $data['render_block_type'] = $this->load->view( 'formbuilder/fields/render_css_front/type_captcha', $data, true ); - break; - case 20: - /*submit button*/ - $data['render_block_type'] = $this->load->view( 'formbuilder/fields/render_css_front/type_submitbutton', $data, true ); - break; - case 21: - /*hidden field*/ - $data['render_block_type'] = ''; - break; - case 22: - /*star rating*/ - $data['render_block_type'] = $this->load->view( 'formbuilder/fields/render_css_front/type_starrating', $data, true ); - break; - case 23: - /*color picker*/ - $data['render_block_type'] = $this->load->view( 'formbuilder/fields/render_css_front/type_colorpicker', $data, true ); - break; - case 24: - /* date picker*/ - $data['render_block_type'] = $this->load->view( 'formbuilder/fields/render_css_front/type_datepicker', $data, true ); - break; - case 25: - /* time picker*/ - $data['render_block_type'] = $this->load->view( 'formbuilder/fields/render_css_front/type_timepicker', $data, true ); - break; - case 26: - /* date and time*/ - $data['render_block_type'] = $this->load->view( 'formbuilder/fields/render_css_front/type_datetime', $data, true ); - break; - case 27: - /* recaptcha*/ - $data['render_block_type'] = $this->load->view( 'formbuilder/fields/render_css_front/type_recaptcha', $data, true ); - break; - case 28: - /* prependtext*/ - $data['render_block_type'] = $this->load->view( 'formbuilder/fields/render_css_front/type_textbox', $data, true ); - break; - case 29: - /* app text*/ - $data['render_block_type'] = $this->load->view( 'formbuilder/fields/render_css_front/type_textbox', $data, true ); - break; - case 30: - /* app prep*/ - $data['render_block_type'] = $this->load->view( 'formbuilder/fields/render_css_front/type_textbox', $data, true ); - break; - case 32: - /* divider*/ - $data['render_block_type'] = $this->load->view( 'formbuilder/fields/render_css_front/type_divider', $data, true ); - break; - case 33: - case 34: - case 35: - case 36: - case 37: - case 38: - /* heading 1*/ - $data['render_block_type'] = $this->load->view( 'formbuilder/fields/render_css_front/type_heading', $data, true ); - break; - case 39: - /* wizard buttons*/ - $data['render_block_type'] = $this->load->view( 'formbuilder/fields/render_css_front/type_wizardbtn', $data, true ); - break; - case 40: - /* switch */ - $data['render_block_type'] = $this->load->view( 'formbuilder/fields/render_css_front/type_switch', $data, true ); - break; - case 41: - /* dyn checkbox */ - $data['render_block_type'] = $this->load->view( 'formbuilder/fields/render_css_front/type_dyncheckbox', $data, true ); - break; - case 42: - /* dyn radio button */ - $data['render_block_type'] = $this->load->view( 'formbuilder/fields/render_css_front/type_dynradiobtn', $data, true ); - break; - case 43: - /* date 2 */ - $data['render_block_type'] = $this->load->view( 'formbuilder/fields/render_css_front/type_date2', $data, true ); - break; - - } - - $output = $this->load->view( 'formbuilder/fields/render_css_front/block_main', $data, true ); - - break; - default: - break; - } - - return $output; - } - - public function formhtml_renderField( $data ) { - - $tmp_type = intval( $data['type'] ); - - $output = ''; - - switch ( $tmp_type ) { - case 6: - /*textbox*/ - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - case 19: - case 20: - case 21: - case 22: - case 23: - case 24: - case 25: - case 26: - case 27: - case 28: - case 29: - case 30: - case 33: - case 34: - case 35: - case 36: - case 37: - case 38: - case 39: - case 40: - case 41: - case 42: - case 43: - $data['render_block_label'] = $this->load->view( 'formbuilder/fields/render_front/block_label', $data, true ); - - switch ( $tmp_type ) { - case 6: - /*textbox*/ - $data['render_block_input'] = $this->load->view( 'formbuilder/fields/render_front/type_textbox', $data, true ); - $data['render_extraclass1'] = 'rockfm-textbox '; - break; - - case 7: - /*textarea*/ - $data['render_block_input'] = $this->load->view( 'formbuilder/fields/render_front/type_textarea', $data, true ); - $data['render_extraclass1'] = 'rockfm-textarea '; - break; - case 8: - /*radio button*/ - $data['render_block_input'] = $this->load->view( 'formbuilder/fields/render_front/type_radiobutton', $data, true ); - $data['render_extraclass1'] = 'rockfm-radiobtn '; - break; - case 9: - /*checkbox*/ - $data['render_block_input'] = $this->load->view( 'formbuilder/fields/render_front/type_checkbox', $data, true ); - $data['render_extraclass1'] = 'rockfm-checkbox '; - break; - case 10: - /*select*/ - $data['render_block_input'] = $this->load->view( 'formbuilder/fields/render_front/type_select', $data, true ); - $data['render_extraclass1'] = 'rockfm-select '; - break; - case 11: - /*multi select*/ - $data['render_block_input'] = $this->load->view( 'formbuilder/fields/render_front/type_multiselect', $data, true ); - $data['render_extraclass1'] = 'rockfm-multiselect '; - break; - case 12: - /*file upload*/ - $data['render_block_input'] = $this->load->view( 'formbuilder/fields/render_front/type_fileupload', $data, true ); - $data['render_extraclass1'] = 'rockfm-fileupload '; - break; - case 13: - /*Image upload*/ - $data['render_block_input'] = $this->load->view( 'formbuilder/fields/render_front/type_imageupload', $data, true ); - $data['render_extraclass1'] = 'rockfm-imageupload'; - break; - case 14: - /*custom html*/ - $data['render_block_input'] = $this->load->view( 'formbuilder/fields/render_front/type_customhtml', $data, true ); - $data['render_extraclass1'] = 'rockfm-customhtml'; - break; - case 15: - /*password*/ - $data['render_block_input'] = $this->load->view( 'formbuilder/fields/render_front/type_password', $data, true ); - $data['render_extraclass1'] = 'rockfm-password '; - break; - case 16: - /*slider*/ - $data['render_block_input'] = $this->load->view( 'formbuilder/fields/render_front/type_slider', $data, true ); - $data['render_extraclass1'] = 'rockfm-slider '; - break; - case 17: - /*range*/ - $data['render_block_input'] = $this->load->view( 'formbuilder/fields/render_front/type_range', $data, true ); - $data['render_extraclass1'] = 'rockfm-range '; - break; - case 18: - /*spinner*/ - $data['render_block_input'] = $this->load->view( 'formbuilder/fields/render_front/type_spinner', $data, true ); - $data['render_extraclass1'] = 'rockfm-spinner '; - break; - case 19: - /*catpcha*/ - $data['render_block_input'] = $this->load->view( 'formbuilder/fields/render_front/type_captcha', $data, true ); - $data['render_extraclass1'] = 'rockfm-captcha '; - break; - case 20: - /*submit button*/ - $data['render_block_input'] = $this->load->view( 'formbuilder/fields/render_front/type_subbtn', $data, true ); - $data['render_extraclass1'] = 'rockfm-submitbtn '; - break; - case 21: - /*hidden field*/ - $data['render_block_input'] = $this->load->view( 'formbuilder/fields/render_front/type_hiddenfield', $data, true ); - $data['render_extraclass1'] = 'rockfm-hiddeninput '; - break; - case 22: - /*star rating*/ - $data['render_block_input'] = $this->load->view( 'formbuilder/fields/render_front/type_starrating', $data, true ); - $data['render_extraclass1'] = 'rockfm-ratingstar '; - break; - case 23: - /*color picker*/ - $data['render_block_input'] = $this->load->view( 'formbuilder/fields/render_front/type_colorpicker', $data, true ); - $data['render_extraclass1'] = 'rockfm-colorpicker '; - break; - case 24: - /*Date picker*/ - $data['render_block_input'] = $this->load->view( 'formbuilder/fields/render_front/type_datepicker', $data, true ); - $data['render_extraclass1'] = 'rockfm-datepicker '; - break; - case 25: - /*time picker*/ - $data['render_block_input'] = $this->load->view( 'formbuilder/fields/render_front/type_timepicker', $data, true ); - $data['render_extraclass1'] = 'rockfm-timepicker '; - break; - case 26: - /*date time*/ - $data['render_block_input'] = $this->load->view( 'formbuilder/fields/render_front/type_datetime', $data, true ); - $data['render_extraclass1'] = 'rockfm-datetime '; - break; - case 27: - /*recaptcha*/ - $data['render_block_input'] = $this->load->view( 'formbuilder/fields/render_front/type_recaptcha', $data, true ); - $data['render_extraclass1'] = 'rockfm-recaptcha '; - break; - case 28: - /*prep text*/ - $data['render_block_input'] = $this->load->view( 'formbuilder/fields/render_front/type_preptext', $data, true ); - $data['render_extraclass1'] = 'rockfm-preptext '; - break; - case 29: - /*app text*/ - $data['render_block_input'] = $this->load->view( 'formbuilder/fields/render_front/type_apptext', $data, true ); - $data['render_extraclass1'] = 'rockfm-appetext '; - break; - case 30: - /*app prep*/ - $data['render_block_input'] = $this->load->view( 'formbuilder/fields/render_front/type_appprep', $data, true ); - $data['render_extraclass1'] = 'rockfm-prepapptext '; - break; - - case 33: - case 34: - case 35: - case 36: - case 37: - case 38: - /*heading*/ - $data['render_block_input'] = $this->load->view( 'formbuilder/fields/render_front/type_heading', $data, true ); - $data['render_extraclass1'] = 'rockfm-heading '; - break; - case 39: - /*wizard button*/ - $data['render_block_input'] = $this->load->view( 'formbuilder/fields/render_front/type_wizardbtn', $data, true ); - $data['render_extraclass1'] = 'rockfm-wizardbtn '; - break; - case 40: - /*switch*/ - $data['render_block_input'] = $this->load->view( 'formbuilder/fields/render_front/type_switch', $data, true ); - $data['render_extraclass1'] = 'rockfm-switch '; - break; - case 41: - /*dyn checkbox*/ - $data['render_block_input'] = $this->load->view( 'formbuilder/fields/render_front/type_dyncheckbox', $data, true ); - $data['render_extraclass1'] = 'rockfm-dyncheckbox '; - break; - case 42: - /*dyn radio button*/ - $data['render_block_input'] = $this->load->view( 'formbuilder/fields/render_front/type_dynradiobtn', $data, true ); - $data['render_extraclass1'] = 'rockfm-dynradiobtn '; - break; - case 43: - /*date 2*/ - $data['render_block_input'] = $this->load->view( 'formbuilder/fields/render_front/type_date2', $data, true ); - $data['render_extraclass1'] = 'rockfm-date2 '; - break; - } - - $data['render_block_input_cont'] = $this->load->view( 'formbuilder/fields/render_front/block_input_cont', $data, true ); - $data['render_block_container'] = $this->load->view( 'formbuilder/fields/render_front/block_container', $data, true ); - - $output = $this->load->view( 'formbuilder/fields/render_front/block_main', $data, true ); - break; - case 32: - /*divider*/ - $data['render_block_container'] = $this->load->view( 'formbuilder/fields/render_front/type_divider', $data, true ); - $data['render_extraclass1'] = 'rockfm-divider '; - - $output = $this->load->view( 'formbuilder/fields/render_front/block_main', $data, true ); - break; - default: - break; - } - - return $output; - } - - /** - * Fields::formhtml() - * - * @return - */ - public function preview_fields() { - $data = array(); - echo $this->load->view( 'formbuilder/fields/preview_fields', $data, true ); - } - - /** - * Fields::formhtml() - * - * @return - */ - public function generate_templates_fields() { - $data = array(); - $data['id_field'] = ''; - $data['quick_options'] = $this->load->view( 'formbuilder/fields/templates/prevpanel_quickopts', $data, true ); - $data['uiform_grid_two'] = $this->load->view( 'formbuilder/fields/templates/prevpanel_textbox', $data, true ); - $data['uiform_textbox'] = $this->load->view( 'formbuilder/fields/templates/prevpanel_textbox', $data, true ); - $content = $this->load->view( 'formbuilder/fields/templates/prevpanel_main', $data, true ); - - $pathfile = APPPATH . '/modules/formbuilder/views/fields/templates/testing_file.php'; - $fh = fopen( $pathfile, 'w' ); - - if ( fwrite( $fh, $content ) ) { - return true; - } - fclose( $fh ); - } - - /** - * Generate grid system css - * - * @return string - */ - public function posthtml_gridsystem_css( $data ) { - - $str_output_2 = ''; - - foreach ( $data as $key => $value ) { - - // $key -> main or blocks - if ( ! empty( $value ) && is_array( $value ) ) { - - if ( (string) $key === 'main' ) { - // send info of main - $str_output_2 .= $this->posthtml_gridsystem_css_block( $data['id'], 0, $value ); - } else { - - foreach ( $value as $key2 => $value2 ) { - // $key2 -> skin or index - if ( is_array( $value2 ) ) { - $str_output_2 .= $this->posthtml_gridsystem_css_block( $data['id'], $key2, $value2 ); - } - } - } - } - } - - return $str_output_2; - } - - /** - * Generate grid system blocks - * - * @return string - */ - public function posthtml_gridsystem_css_block( $id, $block, $data ) { - - $data2 = array(); - if ( intval( $block ) === 0 ) { - $data2['id_str'] = '#zgfb_' . $id . ' > .sfdc-container-fluid'; - } else { - $data2['id_str'] = '#zgfb_' . $id . ' > .sfdc-container-fluid > .sfdc-row > .zgpb-fl-gs-block-style[data-zgpb-blocknum="' . $block . '"] >.zgpb-fl-gs-block-inner'; - } - $data2['skin'] = isset( $data['skin'] ) ? $data['skin'] : array(); - - return $this->load->view( 'formbuilder/fields/posthtml_gridsystem_css', $data2, true ); - } - - +class Fields extends BackendController +{ + /** + * max number of forms in order show by pagination + * + * @var int + */ + + const VERSION = '0.1'; + + /** + * name of form estimator table + * + * @var string + */ + public $table = ''; + private $per_page = 10; + + /** + * Fields::__construct() + * + * @return + */ + public function __construct() + { + parent::__construct(); + $this->load->language_alt(model_settings::$db_config['language']); + $this->template->set('controller', $this); + $this->load->model('model_fields'); + $this->load->model('addon/model_addon'); + } + + + /** + * Forms::ajax_dev generation field options + * + * @return + */ + public function ajax_dev_genfieldopts() + { + + $data_render = array(); + + $array = array( 1, 2, 3, 4, 5, 6, 8, 9, 10, 11 ); + foreach ( $array as $type) { + switch ( intval($type)) { + case 1: + // 1 col + $field_block = 0; + $data_render[ $type ] = $this->load_field_options($type, '', $field_block); + break; + case 2: + // 2 cols + $field_block = 0; + $data_render[ $type ] = $this->load_field_options($type, '', $field_block); + break; + case 3: + // 3 cols + $field_block = 0; + $data_render[ $type ] = $this->load_field_options($type, '', $field_block); + break; + case 4: + // 4 cols + $field_block = 0; + $data_render[ $type ] = $this->load_field_options($type, '', $field_block); + break; + case 5: + // 6 cols + $field_block = 0; + $data_render[ $type ] = $this->load_field_options($type, '', $field_block); + break; + case 6: + // textbox + $data_render[ $type ] = $this->load_field_options($type, '', null); + break; + + case 8: + // radio button + $data_render[ $type ] = $this->load_field_options($type, '', null); + break; + case 9: + // checkbox + $data_render[ $type ] = $this->load_field_options($type, '', null); + break; + case 10: + // select + $data_render[ $type ] = $this->load_field_options($type, '', null); + break; + case 11: + // multiple select + $data_render[ $type ] = $this->load_field_options($type, '', null); + break; + } + } + + + + $search2 = base_url(); + $replace2 = '{{{data.site_url}}}'; + + $js_store = ''; + + foreach ( $data_render as $key => $value) { + $html_output = ''; + ob_start(); + ?><?php + /** + * Intranet + * + * PHP version 5 + * + * @category PHP + * @package Rocket_form + * @author Softdiscover <info@softdiscover.com> + * @copyright 2015 Softdiscover + * @license http://www.php.net/license/3_01.txt PHP License 3.01 + * @link http://wordpress-form-builder.uiform.com/ + */ + if (!defined('BASEPATH')) {exit('No direct script access allowed');} + ?> + <!-- options --> + '; + + preg_match_all('##is', $value, $matches); + foreach ( $matches[0] as $value2) { + $js_store .= $value2; + } + + $value = str_replace($search1, $replace1, $value); + $value = str_replace($search2, $replace2, $value); + + $html_output .= htmlentities($value); + + $html_output .= ''; + $html_output .= ''; + + + $fname = APPPATH . '/modules/formbuilder/views/fields/render_back/fieldoptions_data_'.$key.'.php'; + + $fhandle = fopen($fname, 'w'); + fwrite($fhandle, $html_output); + fclose($fhandle); + } + + + + // echo json_encode($data_render); + die(); + } + + /** + * Forms::ajax_delete_form_byid() + * + * @return + */ + public function ajax_field_sel_impbulkdata() + { + + $data = array(); + + $json = array(); + $json['modal_header'] = '

' . __('Import Bulk Data', 'FRocket_admin') . '

'; + $json['modal_body'] = $this->load->view('formbuilder/fields/options/select/impbulkdata', $data, true); + $json['modal_footer'] = $this->load->view('formbuilder/fields/options/select/impbulkdata_footer', $data, true); + + // return data to ajax callback + header('Content-Type: application/json'); + echo json_encode($json); + die(); + } + + /** + * Get field option in order to customize the field + * + * @return json + */ + public function ajax_field_option() + { + + // check_ajax_referer('zgfm_ajax_nonce', 'zgfm_security'); + + $id = ( isset($_POST['field_id']) ) ? Uiform_Form_Helper::sanitizeInput(trim($_POST['field_id'])) : ''; + $type = ( isset($_POST['field_type']) ) ? Uiform_Form_Helper::sanitizeInput(trim($_POST['field_type'])) : ''; + $field_block = ( isset($_POST['field_block']) ) ? Uiform_Form_Helper::sanitizeInput(trim($_POST['field_block'])) : ''; + $field_block = ( isset($field_block) && intval($field_block) > 0 ) ? $field_block : 0; + $json = array(); + + $json['modal_body'] = $this->load_field_options($type, $id, $field_block); + + $json['field_id'] = $id; + $json['field_type'] = $type; + $json['field_block'] = $field_block; + + // addons + + // $json['addons'] = $this->model_addon->getActiveAddonsNamesOnBack(); + + header('Content-Type: application/json'); + echo json_encode($json); + die(); + } + + + /** + * load field option by type + * + * @return json + */ + public function load_field_options($type, $id, $block = null) + { + + $output = ''; + + $data = array(); + switch ( intval($type)) { + case 1: + case 2: + case 3: + case 4: + case 5: + $data['field_id'] = $id; + $data['field_type'] = $type; + $data['field_block'] = ( isset($block) && intval($block) > 0 ) ? $block : 0; + + $data['is_row'] = true; + $data['message_picked_el'] = ''; + if ( isset($block) && intval($block) > 0) { + $data['is_row'] = false; + $data['message_picked_el'] = __('Column', 'FRocket_admin') . ' ' . $block; + } + + $data['modules_field_more'] = ''; + + $output .= $this->load->view('formbuilder/fields/modal/field_opt_column', $data, true); + break; + + default: + // textbox + $data = array(); + $data['field_id'] = $id; + $data['field_type'] = $type; + switch ( intval($type)) { + case 8: + // radio button + case 9: + // checkbox + $data['field_extra_src'] = $this->load->view('formbuilder/fields/modal/field_opt_checkbox_extra', $data, true); + break; + case 10: + // select + case 11: + // Multiple select + $data['field_extra_src'] = $this->load->view('formbuilder/fields/modal/field_opt_select_extra', $data, true); + break; + default: + break; + } + + $data['modules_field_more'] = modules::run('addon/zfad_backend/addons_doActions', 'back_field_opt_more'); + + $data['obj_sfm'] = Uiform_Form_Helper::get_font_library(); + $output .= $this->load->view('formbuilder/fields/modal/field_opt_text', $data, true); + break; + } + + return $output; + } + + /** + * Fields:: ajax_refresh_captcha() + * + * @return + */ + 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); + die(); + } + + + /** + * Fields::edit_uiform() + * + * @return + */ + public function edit_uiform() + { + + $data = array(); + echo $this->load->view('formbuilder/forms/edit_form', $data, true); + } + + + public function formhtml_textbox($value, $num_tab) + { + $data = array(); + $data['tab_num'] = $num_tab; + $data = array_merge($data, $value); + return $this->formhtml_renderField($data); + } + + public function formhtml_textbox_css($data) + { + return $this->formhtml_renderCssField($data); + } + + public function formhtml_textarea($value, $num_tab) + { + $data = array(); + $data['tab_num'] = $num_tab; + $data = array_merge($data, $value); + return $this->formhtml_renderField($data); + } + + public function formhtml_textarea_css($data) + { + return $this->formhtml_renderCssField($data); + } + + public function formhtml_radiobtn($value, $num_tab) + { + $data = array(); + $data['tab_num'] = $num_tab; + $data = array_merge($data, $value); + return $this->formhtml_renderField($data); + } + + public function formhtml_radiobtn_css($data) + { + return $this->formhtml_renderCssField($data); + } + + public function formhtml_checkbox($value, $num_tab) + { + $data = array(); + $data['tab_num'] = $num_tab; + $data = array_merge($data, $value); + + return $this->formhtml_renderField($data); + } + + public function formhtml_checkbox_css($data) + { + + return $this->formhtml_renderCssField($data); + } + + public function formhtml_select($value, $num_tab) + { + $data = array(); + $data['tab_num'] = $num_tab; + $data = array_merge($data, $value); + return $this->formhtml_renderField($data); + } + + public function formhtml_select_css($data) + { + return $this->formhtml_renderCssField($data); + } + + public function formhtml_multiselect($value, $num_tab) + { + $data = array(); + $data['tab_num'] = $num_tab; + $data = array_merge($data, $value); + return $this->formhtml_renderField($data); + } + + public function formhtml_multiselect_css($data) + { + // using select css because it's the same + return $this->formhtml_renderCssField($data); + } + + public function formhtml_fileupload($value, $num_tab) + { + $data = array(); + $data['tab_num'] = $num_tab; + $data = array_merge($data, $value); + return $this->formhtml_renderField($data); + } + + public function formhtml_fileupload_css($data) + { + return $this->formhtml_renderCssField($data); + } + + public function formhtml_imageupload($value, $num_tab) + { + $data = array(); + $data['tab_num'] = $num_tab; + $data = array_merge($data, $value); + return $this->formhtml_renderField($data); + } + + public function formhtml_imageupload_css($data) + { + return $this->formhtml_renderCssField($data); + } + + public function formhtml_customhtml($value, $num_tab) + { + $data = array(); + $data['tab_num'] = $num_tab; + $data = array_merge($data, $value); + return $this->formhtml_renderField($data); + } + + public function formhtml_customhtml_css($data) + { + return $this->formhtml_renderCssField($data); + } + + public function formhtml_password($value, $num_tab) + { + $data = array(); + $data['tab_num'] = $num_tab; + $data = array_merge($data, $value); + return $this->formhtml_renderField($data); + } + + public function formhtml_password_css($data) + { + return $this->formhtml_renderCssField($data); + } + + public function formhtml_preptext($value, $num_tab) + { + $data = array(); + $data['tab_num'] = $num_tab; + $data = array_merge($data, $value); + return $this->formhtml_renderField($data); + } + + public function formhtml_preptext_css($data) + { + return $this->formhtml_renderCssField($data); + } + + public function formhtml_appetext($value, $num_tab) + { + $data = array(); + $data['tab_num'] = $num_tab; + $data = array_merge($data, $value); + return $this->formhtml_renderField($data); + } + + public function formhtml_appetext_css($data) + { + return $this->formhtml_renderCssField($data); + } + + public function formhtml_prepapptext($value, $num_tab) + { + $data = array(); + $data['tab_num'] = $num_tab; + $data = array_merge($data, $value); + return $this->formhtml_renderField($data); + } + + public function formhtml_prepapptext_css($data) + { + return $this->formhtml_renderCssField($data); + } + + public function formhtml_panelfld($value, $num_tab) + { + $data = array(); + $data['tab_num'] = $num_tab; + $data = array_merge($data, $value); + return $this->formhtml_renderField($data); + } + + public function formhtml_panelfld_css($data) + { + return $this->formhtml_renderCssField($data); + } + + public function formhtml_slider($value, $num_tab) + { + $data = array(); + $data['tab_num'] = $num_tab; + $data = array_merge($data, $value); + return $this->formhtml_renderField($data); + } + + public function formhtml_slider_css($data) + { + return $this->formhtml_renderCssField($data); + } + + public function formhtml_range($value, $num_tab) + { + $data = array(); + $data['tab_num'] = $num_tab; + $data = array_merge($data, $value); + return $this->formhtml_renderField($data); + } + + public function formhtml_range_css($data) + { + return $this->formhtml_renderCssField($data); + } + + public function formhtml_spinner($value, $num_tab) + { + $data = array(); + $data['tab_num'] = $num_tab; + $data = array_merge($data, $value); + return $this->formhtml_renderField($data); + } + + public function formhtml_spinner_css($data) + { + return $this->formhtml_renderCssField($data); + } + + public function formhtml_captcha($value, $num_tab) + { + $data = array(); + $data['tab_num'] = $num_tab; + $data = array_merge($data, $value); + return $this->formhtml_renderField($data); + } + + public function formhtml_captcha_css($data) + { + return $this->formhtml_renderCssField($data); + } + + public function formhtml_recaptcha($value, $num_tab) + { + $data = array(); + $data['tab_num'] = $num_tab; + $data = array_merge($data, $value); + return $this->formhtml_renderField($data); + } + + public function formhtml_recaptcha_css($data) + { + return $this->formhtml_renderCssField($data); + } + + public function formhtml_datepicker($value, $num_tab) + { + $data = array(); + $data['tab_num'] = $num_tab; + $data = array_merge($data, $value); + return $this->formhtml_renderField($data); + } + + public function formhtml_datepicker_css($data) + { + return $this->formhtml_renderCssField($data); + } + + public function formhtml_date2($value, $num_tab) + { + $data = array(); + $data['tab_num'] = $num_tab; + $data = array_merge($data, $value); + return $this->formhtml_renderField($data); + } + + public function formhtml_date2_css($data) + { + return $this->formhtml_renderCssField($data); + } + + public function formhtml_timepicker($value, $num_tab) + { + $data = array(); + $data['tab_num'] = $num_tab; + $data = array_merge($data, $value); + return $this->formhtml_renderField($data); + } + + public function formhtml_timepicker_css($data) + { + return $this->formhtml_renderCssField($data); + } + + public function formhtml_datetime($value, $num_tab) + { + $data = array(); + $data['tab_num'] = $num_tab; + $data = array_merge($data, $value); + return $this->formhtml_renderField($data); + } + + public function formhtml_datetime_css($data) + { + return $this->formhtml_renderCssField($data); + } + + public function formhtml_submitbtn($value, $num_tab) + { + $data = array(); + $data['tab_num'] = $num_tab; + $data = array_merge($data, $value); + return $this->formhtml_renderField($data); + } + + public function formhtml_submitbtn_css($data) + { + return $this->formhtml_renderCssField($data); + } + + public function formhtml_hiddeninput($value, $num_tab) + { + $data = array(); + $data['tab_num'] = $num_tab; + $data = array_merge($data, $value); + return $this->formhtml_renderField($data); + } + + public function formhtml_hiddeninput_css($data) + { + return $this->formhtml_renderCssField($data); + } + + public function formhtml_ratingstar($value, $num_tab) + { + $data = array(); + $data['tab_num'] = $num_tab; + $data = array_merge($data, $value); + return $this->formhtml_renderField($data); + } + + public function formhtml_ratingstar_css($data) + { + return $this->formhtml_renderCssField($data); + } + + public function formhtml_colorpicker($value, $num_tab) + { + $data = array(); + $data['tab_num'] = $num_tab; + $data = array_merge($data, $value); + return $this->formhtml_renderField($data); + } + + public function formhtml_colorpicker_css($data) + { + return $this->formhtml_renderCssField($data); + } + + public function formhtml_divider($value, $num_tab) + { + $data = array(); + $data['tab_num'] = $num_tab; + $data = array_merge($data, $value); + return $this->formhtml_renderField($data); + } + + public function formhtml_divider_css($data) + { + + return $this->formhtml_renderCssField($data); + } + + public function formhtml_wizardbtn($value, $num_tab) + { + $data = array(); + $data['tab_num'] = $num_tab; + $data = array_merge($data, $value); + return $this->formhtml_renderField($data); + } + + public function formhtml_wizardbtn_css($data) + { + return $this->formhtml_renderCssField($data); + } + public function formhtml_switch($value, $num_tab) + { + $data = array(); + $data['tab_num'] = $num_tab; + $data = array_merge($data, $value); + return $this->formhtml_renderField($data); + } + + public function formhtml_switch_css($data) + { + return $this->formhtml_renderCssField($data); + } + + public function formhtml_dyncheckbox($value, $num_tab) + { + $data = array(); + $data['tab_num'] = $num_tab; + $data = array_merge($data, $value); + return $this->formhtml_renderField($data); + } + + public function formhtml_dyncheckbox_css($data) + { + return $this->formhtml_renderCssField($data); + } + public function formhtml_dynradiobtn($value, $num_tab) + { + $data = array(); + $data['tab_num'] = $num_tab; + $data = array_merge($data, $value); + return $this->formhtml_renderField($data); + } + + public function formhtml_dynradiobtn_css($data) + { + return $this->formhtml_renderCssField($data); + } + public function formhtml_heading($value, $num_tab) + { + $data = array(); + $data['tab_num'] = $num_tab; + $data = array_merge($data, $value); + return $this->formhtml_renderField($data); + } + + public function formhtml_heading_css($data) + { + return $this->formhtml_renderCssField($data); + } + + public function formhtml_renderCssField($data) + { + + $tmp_type = intval($data['type']); + + $output = ''; + + switch ( $tmp_type) { + case 6: + /*textbox*/ + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 32: + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 43: + $data['render_common_css'] = $this->load->view('formbuilder/fields/render_css_front/common_css', $data, true); + $data['render_common_css2'] = $this->load->view('formbuilder/fields/render_css_front/common_css2', $data, true); + $data['render_addon_css'] = $this->load->view('formbuilder/fields/render_css_front/addon_css', $data, true); + + switch ( $tmp_type) { + case 6: + /*textbox*/ + $data['render_block_type'] = $this->load->view('formbuilder/fields/render_css_front/type_textbox', $data, true); + break; + case 7: + /*textarea*/ + $data['render_block_type'] = $this->load->view('formbuilder/fields/render_css_front/type_textarea', $data, true); + break; + case 8: + /*radio button*/ + $data['render_block_type'] = $this->load->view('formbuilder/fields/render_css_front/type_radiobutton', $data, true); + break; + case 9: + /*checkbox*/ + $data['render_block_type'] = $this->load->view('formbuilder/fields/render_css_front/type_checkbox', $data, true); + break; + case 10: + /*select*/ + $data['render_block_type'] = $this->load->view('formbuilder/fields/render_css_front/type_select', $data, true); + break; + case 11: + /*multiselect*/ + $data['render_block_type'] = $this->load->view('formbuilder/fields/render_css_front/type_multiselect', $data, true); + break; + case 12: + /*file upload*/ + $data['render_block_type'] = $this->load->view('formbuilder/fields/render_css_front/type_fileupload', $data, true); + break; + case 13: + /*image upload*/ + $data['render_block_type'] = $this->load->view('formbuilder/fields/render_css_front/type_imageupload', $data, true); + break; + case 14: + /*custom html*/ + $data['render_block_type'] = $this->load->view('formbuilder/fields/render_css_front/type_customhtml', $data, true); + break; + case 15: + /*password*/ + $data['render_block_type'] = $this->load->view('formbuilder/fields/render_css_front/type_password', $data, true); + break; + case 16: + /*Slider*/ + $data['render_block_type'] = $this->load->view('formbuilder/fields/render_css_front/type_slider', $data, true); + break; + case 17: + /*range*/ + $data['render_block_type'] = $this->load->view('formbuilder/fields/render_css_front/type_range', $data, true); + break; + case 18: + /*spinner*/ + $data['render_block_type'] = $this->load->view('formbuilder/fields/render_css_front/type_spinner', $data, true); + break; + case 19: + /*captcha*/ + $data['render_block_type'] = $this->load->view('formbuilder/fields/render_css_front/type_captcha', $data, true); + break; + case 20: + /*submit button*/ + $data['render_block_type'] = $this->load->view('formbuilder/fields/render_css_front/type_submitbutton', $data, true); + break; + case 21: + /*hidden field*/ + $data['render_block_type'] = ''; + break; + case 22: + /*star rating*/ + $data['render_block_type'] = $this->load->view('formbuilder/fields/render_css_front/type_starrating', $data, true); + break; + case 23: + /*color picker*/ + $data['render_block_type'] = $this->load->view('formbuilder/fields/render_css_front/type_colorpicker', $data, true); + break; + case 24: + /* date picker*/ + $data['render_block_type'] = $this->load->view('formbuilder/fields/render_css_front/type_datepicker', $data, true); + break; + case 25: + /* time picker*/ + $data['render_block_type'] = $this->load->view('formbuilder/fields/render_css_front/type_timepicker', $data, true); + break; + case 26: + /* date and time*/ + $data['render_block_type'] = $this->load->view('formbuilder/fields/render_css_front/type_datetime', $data, true); + break; + case 27: + /* recaptcha*/ + $data['render_block_type'] = $this->load->view('formbuilder/fields/render_css_front/type_recaptcha', $data, true); + break; + case 28: + /* prependtext*/ + $data['render_block_type'] = $this->load->view('formbuilder/fields/render_css_front/type_textbox', $data, true); + break; + case 29: + /* app text*/ + $data['render_block_type'] = $this->load->view('formbuilder/fields/render_css_front/type_textbox', $data, true); + break; + case 30: + /* app prep*/ + $data['render_block_type'] = $this->load->view('formbuilder/fields/render_css_front/type_textbox', $data, true); + break; + case 32: + /* divider*/ + $data['render_block_type'] = $this->load->view('formbuilder/fields/render_css_front/type_divider', $data, true); + break; + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + /* heading 1*/ + $data['render_block_type'] = $this->load->view('formbuilder/fields/render_css_front/type_heading', $data, true); + break; + case 39: + /* wizard buttons*/ + $data['render_block_type'] = $this->load->view('formbuilder/fields/render_css_front/type_wizardbtn', $data, true); + break; + case 40: + /* switch */ + $data['render_block_type'] = $this->load->view('formbuilder/fields/render_css_front/type_switch', $data, true); + break; + case 41: + /* dyn checkbox */ + $data['render_block_type'] = $this->load->view('formbuilder/fields/render_css_front/type_dyncheckbox', $data, true); + break; + case 42: + /* dyn radio button */ + $data['render_block_type'] = $this->load->view('formbuilder/fields/render_css_front/type_dynradiobtn', $data, true); + break; + case 43: + /* date 2 */ + $data['render_block_type'] = $this->load->view('formbuilder/fields/render_css_front/type_date2', $data, true); + break; + } + + $output = $this->load->view('formbuilder/fields/render_css_front/block_main', $data, true); + + break; + default: + break; + } + + return $output; + } + + public function formhtml_renderField($data) + { + + $tmp_type = intval($data['type']); + + $output = ''; + + switch ( $tmp_type) { + case 6: + /*textbox*/ + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 43: + $data['render_block_label'] = $this->load->view('formbuilder/fields/render_front/block_label', $data, true); + + switch ( $tmp_type) { + case 6: + /*textbox*/ + $data['render_block_input'] = $this->load->view('formbuilder/fields/render_front/type_textbox', $data, true); + $data['render_extraclass1'] = 'rockfm-textbox '; + break; + + case 7: + /*textarea*/ + $data['render_block_input'] = $this->load->view('formbuilder/fields/render_front/type_textarea', $data, true); + $data['render_extraclass1'] = 'rockfm-textarea '; + break; + case 8: + /*radio button*/ + $data['render_block_input'] = $this->load->view('formbuilder/fields/render_front/type_radiobutton', $data, true); + $data['render_extraclass1'] = 'rockfm-radiobtn '; + break; + case 9: + /*checkbox*/ + $data['render_block_input'] = $this->load->view('formbuilder/fields/render_front/type_checkbox', $data, true); + $data['render_extraclass1'] = 'rockfm-checkbox '; + break; + case 10: + /*select*/ + $data['render_block_input'] = $this->load->view('formbuilder/fields/render_front/type_select', $data, true); + $data['render_extraclass1'] = 'rockfm-select '; + break; + case 11: + /*multi select*/ + $data['render_block_input'] = $this->load->view('formbuilder/fields/render_front/type_multiselect', $data, true); + $data['render_extraclass1'] = 'rockfm-multiselect '; + break; + case 12: + /*file upload*/ + $data['render_block_input'] = $this->load->view('formbuilder/fields/render_front/type_fileupload', $data, true); + $data['render_extraclass1'] = 'rockfm-fileupload '; + break; + case 13: + /*Image upload*/ + $data['render_block_input'] = $this->load->view('formbuilder/fields/render_front/type_imageupload', $data, true); + $data['render_extraclass1'] = 'rockfm-imageupload'; + break; + case 14: + /*custom html*/ + $data['render_block_input'] = $this->load->view('formbuilder/fields/render_front/type_customhtml', $data, true); + $data['render_extraclass1'] = 'rockfm-customhtml'; + break; + case 15: + /*password*/ + $data['render_block_input'] = $this->load->view('formbuilder/fields/render_front/type_password', $data, true); + $data['render_extraclass1'] = 'rockfm-password '; + break; + case 16: + /*slider*/ + $data['render_block_input'] = $this->load->view('formbuilder/fields/render_front/type_slider', $data, true); + $data['render_extraclass1'] = 'rockfm-slider '; + break; + case 17: + /*range*/ + $data['render_block_input'] = $this->load->view('formbuilder/fields/render_front/type_range', $data, true); + $data['render_extraclass1'] = 'rockfm-range '; + break; + case 18: + /*spinner*/ + $data['render_block_input'] = $this->load->view('formbuilder/fields/render_front/type_spinner', $data, true); + $data['render_extraclass1'] = 'rockfm-spinner '; + break; + case 19: + /*catpcha*/ + $data['render_block_input'] = $this->load->view('formbuilder/fields/render_front/type_captcha', $data, true); + $data['render_extraclass1'] = 'rockfm-captcha '; + break; + case 20: + /*submit button*/ + $data['render_block_input'] = $this->load->view('formbuilder/fields/render_front/type_subbtn', $data, true); + $data['render_extraclass1'] = 'rockfm-submitbtn '; + break; + case 21: + /*hidden field*/ + $data['render_block_input'] = $this->load->view('formbuilder/fields/render_front/type_hiddenfield', $data, true); + $data['render_extraclass1'] = 'rockfm-hiddeninput '; + break; + case 22: + /*star rating*/ + $data['render_block_input'] = $this->load->view('formbuilder/fields/render_front/type_starrating', $data, true); + $data['render_extraclass1'] = 'rockfm-ratingstar '; + break; + case 23: + /*color picker*/ + $data['render_block_input'] = $this->load->view('formbuilder/fields/render_front/type_colorpicker', $data, true); + $data['render_extraclass1'] = 'rockfm-colorpicker '; + break; + case 24: + /*Date picker*/ + $data['render_block_input'] = $this->load->view('formbuilder/fields/render_front/type_datepicker', $data, true); + $data['render_extraclass1'] = 'rockfm-datepicker '; + break; + case 25: + /*time picker*/ + $data['render_block_input'] = $this->load->view('formbuilder/fields/render_front/type_timepicker', $data, true); + $data['render_extraclass1'] = 'rockfm-timepicker '; + break; + case 26: + /*date time*/ + $data['render_block_input'] = $this->load->view('formbuilder/fields/render_front/type_datetime', $data, true); + $data['render_extraclass1'] = 'rockfm-datetime '; + break; + case 27: + /*recaptcha*/ + $data['render_block_input'] = $this->load->view('formbuilder/fields/render_front/type_recaptcha', $data, true); + $data['render_extraclass1'] = 'rockfm-recaptcha '; + break; + case 28: + /*prep text*/ + $data['render_block_input'] = $this->load->view('formbuilder/fields/render_front/type_preptext', $data, true); + $data['render_extraclass1'] = 'rockfm-preptext '; + break; + case 29: + /*app text*/ + $data['render_block_input'] = $this->load->view('formbuilder/fields/render_front/type_apptext', $data, true); + $data['render_extraclass1'] = 'rockfm-appetext '; + break; + case 30: + /*app prep*/ + $data['render_block_input'] = $this->load->view('formbuilder/fields/render_front/type_appprep', $data, true); + $data['render_extraclass1'] = 'rockfm-prepapptext '; + break; + + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + /*heading*/ + $data['render_block_input'] = $this->load->view('formbuilder/fields/render_front/type_heading', $data, true); + $data['render_extraclass1'] = 'rockfm-heading '; + break; + case 39: + /*wizard button*/ + $data['render_block_input'] = $this->load->view('formbuilder/fields/render_front/type_wizardbtn', $data, true); + $data['render_extraclass1'] = 'rockfm-wizardbtn '; + break; + case 40: + /*switch*/ + $data['render_block_input'] = $this->load->view('formbuilder/fields/render_front/type_switch', $data, true); + $data['render_extraclass1'] = 'rockfm-switch '; + break; + case 41: + /*dyn checkbox*/ + $data['render_block_input'] = $this->load->view('formbuilder/fields/render_front/type_dyncheckbox', $data, true); + $data['render_extraclass1'] = 'rockfm-dyncheckbox '; + break; + case 42: + /*dyn radio button*/ + $data['render_block_input'] = $this->load->view('formbuilder/fields/render_front/type_dynradiobtn', $data, true); + $data['render_extraclass1'] = 'rockfm-dynradiobtn '; + break; + case 43: + /*date 2*/ + $data['render_block_input'] = $this->load->view('formbuilder/fields/render_front/type_date2', $data, true); + $data['render_extraclass1'] = 'rockfm-date2 '; + break; + } + + $data['render_block_input_cont'] = $this->load->view('formbuilder/fields/render_front/block_input_cont', $data, true); + $data['render_block_container'] = $this->load->view('formbuilder/fields/render_front/block_container', $data, true); + + $output = $this->load->view('formbuilder/fields/render_front/block_main', $data, true); + break; + case 32: + /*divider*/ + $data['render_block_container'] = $this->load->view('formbuilder/fields/render_front/type_divider', $data, true); + $data['render_extraclass1'] = 'rockfm-divider '; + + $output = $this->load->view('formbuilder/fields/render_front/block_main', $data, true); + break; + default: + break; + } + + return $output; + } + + /** + * Fields::formhtml() + * + * @return + */ + public function preview_fields() + { + $data = array(); + echo $this->load->view('formbuilder/fields/preview_fields', $data, true); + } + + /** + * Fields::formhtml() + * + * @return + */ + public function generate_templates_fields() + { + $data = array(); + $data['id_field'] = ''; + $data['quick_options'] = $this->load->view('formbuilder/fields/templates/prevpanel_quickopts', $data, true); + $data['uiform_grid_two'] = $this->load->view('formbuilder/fields/templates/prevpanel_textbox', $data, true); + $data['uiform_textbox'] = $this->load->view('formbuilder/fields/templates/prevpanel_textbox', $data, true); + $content = $this->load->view('formbuilder/fields/templates/prevpanel_main', $data, true); + + $pathfile = APPPATH . '/modules/formbuilder/views/fields/templates/testing_file.php'; + $fh = fopen($pathfile, 'w'); + + if ( fwrite($fh, $content)) { + return true; + } + fclose($fh); + } + + /** + * Generate grid system css + * + * @return string + */ + public function posthtml_gridsystem_css($data) + { + + $str_output_2 = ''; + + foreach ( $data as $key => $value) { + // $key -> main or blocks + if ( ! empty($value) && is_array($value)) { + if ( (string) $key === 'main') { + // send info of main + $str_output_2 .= $this->posthtml_gridsystem_css_block($data['id'], 0, $value); + } else { + foreach ( $value as $key2 => $value2) { + // $key2 -> skin or index + if ( is_array($value2)) { + $str_output_2 .= $this->posthtml_gridsystem_css_block($data['id'], $key2, $value2); + } + } + } + } + } + + return $str_output_2; + } + + /** + * Generate grid system blocks + * + * @return string + */ + public function posthtml_gridsystem_css_block($id, $block, $data) + { + + $data2 = array(); + if ( intval($block) === 0) { + $data2['id_str'] = '#zgfb_' . $id . ' > .sfdc-container-fluid'; + } else { + $data2['id_str'] = '#zgfb_' . $id . ' > .sfdc-container-fluid > .sfdc-row > .zgpb-fl-gs-block-style[data-zgpb-blocknum="' . $block . '"] >.zgpb-fl-gs-block-inner'; + } + $data2['skin'] = isset($data['skin']) ? $data['skin'] : array(); + + return $this->load->view('formbuilder/fields/posthtml_gridsystem_css', $data2, true); + } } diff --git a/application/modules/formbuilder/controllers/forms.php b/application/modules/formbuilder/controllers/forms.php index 800edb0b..e3ae4422 100755 --- a/application/modules/formbuilder/controllers/forms.php +++ b/application/modules/formbuilder/controllers/forms.php @@ -10,10 +10,10 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: intranet.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } use \Zigaform\Admin\List_data; @@ -27,3159 +27,3176 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version Release: 1.00 - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -class Forms extends BackendController { - /** - * max number of forms in order show by pagination - * - * @var int - */ - - const VERSION = '0.1'; - - /** - * name of form estimator table - * - * @var string - */ - var $per_page = 10; - protected $modules; - private $saved_form_id = ''; - private $current_data_addon = array(); - private $current_data_form = array(); - private $current_data_num_tabs = array(); - private $current_data_tab_cont = array(); - private $current_data_steps = array(); - private $current_data_skin = array(); - private $current_data_wizard = array(); - private $current_data_onsubm = array(); - private $current_data_calculation = array(); - private $current_data_main = array(); - private $saveform_clogic = array(); - private $current_data_summbox = array(); - - public $gen_post_src; - /** - * Forms::__construct() - * - * @return - */ - function __construct() { - parent::__construct(); - $this->load->language_alt( model_settings::$db_config['language'] ); - $this->template->set( 'controller', $this ); - $this->load->model( 'model_forms' ); - $this->load->model( 'model_fields' ); - $this->load->model( 'model_record' ); - $this->load->model( 'model_form_log' ); - $this->load->model( 'visitor/model_visitor' ); - $this->load->model( 'addon/model_addon' ); - $this->load->model( 'addon/model_addon_details' ); - $this->load->model( 'addon/model_addon_details_log' ); - $this->load->model( 'gateways/model_gateways_logs' ); - $this->load->model( 'gateways/model_gateways_records' ); - $this->load->library( 'cache' ); - - } - - public function ajax_pdf_showsample() { - - $full_page = ( isset( $_POST['full_page'] ) ) ? Uiform_Form_Helper::sanitizeInput( trim( $_POST['full_page'] ) ) : ''; - $form_id = ( isset( $_POST['form_id'] ) ) ? Uiform_Form_Helper::sanitizeInput( trim( $_POST['form_id'] ) ) : ''; - $message = ( isset( $_POST['message'] ) ) ? Uiform_Form_Helper::sanitizeInput_html( $_POST['message'] ) : ''; - $message = urldecode( $message ); - - $data2 = array(); - - $pdf_paper_size = 'a4'; - $pdf_paper_orie = 'landscape'; - - if ( intval( $form_id ) > 0 ) { - - $form_data = $this->model_forms->getFormById_2( $form_id ); - $form_data_onsubm = json_decode( $form_data->fmb_data2, true ); - $pdf_charset = ( isset( $form_data_onsubm['main']['pdf_charset'] ) ) ? $form_data_onsubm['main']['pdf_charset'] : ''; - $pdf_font = ( isset( $form_data_onsubm['main']['pdf_font'] ) ) ? urldecode( $form_data_onsubm['main']['pdf_font'] ) : ''; - $pdf_paper_size = ( isset( $form_data_onsubm['main']['pdf_paper_size'] ) ) ? $form_data_onsubm['main']['pdf_paper_size'] : 'a4'; - $pdf_paper_orie = ( isset( $form_data_onsubm['main']['pdf_paper_orie'] ) ) ? $form_data_onsubm['main']['pdf_paper_orie'] : 'landscape'; - - $data2['font'] = $pdf_font; - $data2['charset'] = $pdf_charset; - } else { - $data2['font'] = '2'; - $data2['charset'] = 'UTF-8'; - } - $data2['head_extra'] = ''; - $data2['content'] = $message; - - $pos = strpos( $message, '' ); - $pos2 = strpos( $message, '' ); - - if ( $pos === false && $pos2 === false ) { - $full_page = 0; - } else { - $full_page = 1; - } - - $data2['html_wholecont'] = $full_page; - - $content = $this->load->view( 'formbuilder/forms/pdf_global_template', $data2, true ); - - $file_name = 'zgfm_pdf_sample'; - - // remove previous pdf sample - @unlink( FCPATH . 'temp/' . $file_name . '.pdf' ); - - $output = generate_pdf( $content, $file_name, $pdf_paper_size, $pdf_paper_orie, false ); - $status = '0'; - if ( file_exists( $output ) ) { - $status = '1'; - } else { - $status = '0'; - } - - $json = array(); - $json['status'] = $status; - $json['pdf_name'] = $file_name; - $json['pdf_dir'] = $output; - $json['dir'] = FCPATH; - $json['pdf_url'] = base_url() . 'temp/' . $file_name . '.pdf'; - - // return data to ajax callback - header( 'Content-Type: application/json' ); - echo json_encode( $json ); - die(); - } - - public function ajax_email_sendsample() { - - $full_page = ( isset( $_POST['full_page'] ) ) ? Uiform_Form_Helper::sanitizeInput( trim( $_POST['full_page'] ) ) : ''; - $message = ( isset( $_POST['message'] ) ) ? Uiform_Form_Helper::sanitizeInput_html( $_POST['message'] ) : ''; - $message = urldecode( $message ); - $email_to = ( isset( $_POST['email_to'] ) ) ? Uiform_Form_Helper::sanitizeInput( $_POST['email_to'] ) : ''; - - $mail_template_msg = $this->load->view( - 'formbuilder/frontend/mail_global_template', - array( - 'content' => $message, - 'html_wholecont' => $full_page, - ), - true - ); - - $data_mail = array(); - $data_mail['from_mail'] = $email_to; - $data_mail['from_name'] = 'test'; - $data_mail['message'] = $mail_template_msg; - $data_mail['subject'] = 'Zigaform - this is just a test'; - $data_mail['attachments'] = array(); - $data_mail['to'] = $email_to; - $data_mail['cc'] = ''; - $data_mail['bcc'] = ''; - $data_mail['mail_replyto'] = ''; +class Forms extends BackendController +{ + /** + * max number of forms in order show by pagination + * + * @var int + */ + + const VERSION = '0.1'; + + /** + * name of form estimator table + * + * @var string + */ + private $per_page = 10; + protected $modules; + private $saved_form_id = ''; + private $current_data_addon = array(); + private $current_data_form = array(); + private $current_data_num_tabs = array(); + private $current_data_tab_cont = array(); + private $current_data_steps = array(); + private $current_data_skin = array(); + private $current_data_wizard = array(); + private $current_data_onsubm = array(); + private $current_data_calculation = array(); + private $current_data_main = array(); + private $saveform_clogic = array(); + private $current_data_summbox = array(); + + public $gen_post_src; + /** + * Forms::__construct() + * + * @return + */ + public function __construct() + { + parent::__construct(); + $this->load->language_alt(model_settings::$db_config['language']); + $this->template->set('controller', $this); + $this->load->model('model_forms'); + $this->load->model('model_fields'); + $this->load->model('model_record'); + $this->load->model('model_form_log'); + $this->load->model('visitor/model_visitor'); + $this->load->model('addon/model_addon'); + $this->load->model('addon/model_addon_details'); + $this->load->model('addon/model_addon_details_log'); + $this->load->model('gateways/model_gateways_logs'); + $this->load->model('gateways/model_gateways_records'); + $this->load->library('cache'); + } + + public function ajax_pdf_showsample() + { + + $full_page = ( isset($_POST['full_page']) ) ? Uiform_Form_Helper::sanitizeInput(trim($_POST['full_page'])) : ''; + $form_id = ( isset($_POST['form_id']) ) ? Uiform_Form_Helper::sanitizeInput(trim($_POST['form_id'])) : ''; + $message = ( isset($_POST['message']) ) ? Uiform_Form_Helper::sanitizeInput_html($_POST['message']) : ''; + $message = urldecode($message); + + $data2 = array(); + + $pdf_paper_size = 'a4'; + $pdf_paper_orie = 'landscape'; + + if ( intval($form_id) > 0) { + $form_data = $this->model_forms->getFormById_2($form_id); + $form_data_onsubm = json_decode($form_data->fmb_data2, true); + $pdf_charset = ( isset($form_data_onsubm['main']['pdf_charset']) ) ? $form_data_onsubm['main']['pdf_charset'] : ''; + $pdf_font = ( isset($form_data_onsubm['main']['pdf_font']) ) ? urldecode($form_data_onsubm['main']['pdf_font']) : ''; + $pdf_paper_size = ( isset($form_data_onsubm['main']['pdf_paper_size']) ) ? $form_data_onsubm['main']['pdf_paper_size'] : 'a4'; + $pdf_paper_orie = ( isset($form_data_onsubm['main']['pdf_paper_orie']) ) ? $form_data_onsubm['main']['pdf_paper_orie'] : 'landscape'; + + $data2['font'] = $pdf_font; + $data2['charset'] = $pdf_charset; + } else { + $data2['font'] = '2'; + $data2['charset'] = 'UTF-8'; + } + $data2['head_extra'] = ''; + $data2['content'] = $message; + + $pos = strpos($message, ''); + $pos2 = strpos($message, ''); + + if ( $pos === false && $pos2 === false) { + $full_page = 0; + } else { + $full_page = 1; + } + + $data2['html_wholecont'] = $full_page; + + $content = $this->load->view('formbuilder/forms/pdf_global_template', $data2, true); + + $file_name = 'zgfm_pdf_sample'; + + // remove previous pdf sample + @unlink(FCPATH . 'temp/' . $file_name . '.pdf'); + + $output = generate_pdf($content, $file_name, $pdf_paper_size, $pdf_paper_orie, false); + $status = '0'; + if ( file_exists($output)) { + $status = '1'; + } else { + $status = '0'; + } + + $json = array(); + $json['status'] = $status; + $json['pdf_name'] = $file_name; + $json['pdf_dir'] = $output; + $json['dir'] = FCPATH; + $json['pdf_url'] = base_url() . 'temp/' . $file_name . '.pdf'; + + // return data to ajax callback + header('Content-Type: application/json'); + echo json_encode($json); + die(); + } + + public function ajax_email_sendsample() + { + + $full_page = ( isset($_POST['full_page']) ) ? Uiform_Form_Helper::sanitizeInput(trim($_POST['full_page'])) : ''; + $message = ( isset($_POST['message']) ) ? Uiform_Form_Helper::sanitizeInput_html($_POST['message']) : ''; + $message = urldecode($message); + $email_to = ( isset($_POST['email_to']) ) ? Uiform_Form_Helper::sanitizeInput($_POST['email_to']) : ''; + + $mail_template_msg = $this->load->view( + 'formbuilder/frontend/mail_global_template', + array( + 'content' => $message, + 'html_wholecont' => $full_page, + ), + true + ); + + $data_mail = array(); + $data_mail['from_mail'] = $email_to; + $data_mail['from_name'] = 'test'; + $data_mail['message'] = $mail_template_msg; + $data_mail['subject'] = 'Zigaform - this is just a test'; + $data_mail['attachments'] = array(); + $data_mail['to'] = $email_to; + $data_mail['cc'] = ''; + $data_mail['bcc'] = ''; + $data_mail['mail_replyto'] = ''; - // $mail_errors=$this->process_mail($data_mail); - $mail_errors = modules::run( 'formbuilder/frontend/process_mail', $data_mail ); + // $mail_errors=$this->process_mail($data_mail); + $mail_errors = modules::run('formbuilder/frontend/process_mail', $data_mail); - $json = array(); - $json['st_error'] = ( $mail_errors === true ) ? 1 : 0; + $json = array(); + $json['st_error'] = ( $mail_errors === true ) ? 1 : 0; + + // return data to ajax callback + header('Content-Type: application/json'); + echo json_encode($json); + die(); + } + + public function ajax_rollback_process() + { + + // check_ajax_referer( 'zgfm_ajax_nonce', 'zgfm_security' ); + + $log_id = ( isset($_POST['log_id']) ) ? Uiform_Form_Helper::sanitizeInput(trim($_POST['log_id'])) : ''; + + $query_obj = $this->model_form_log->getLogById($log_id); + + $json = array(); + /* + $json['log_frm_data'] = $query_obj->log_frm_data; + $json['log_frm_name'] = $query_obj->log_frm_name; + $json['log_frm_html_backend'] = $query_obj->log_frm_html_backend; + $json['log_frm_id'] = $query_obj->log_frm_id; */ + + $data = array(); + $data['fmb_data'] = json_decode($query_obj->log_frm_data, true); + $data['fmb_name'] = $query_obj->log_frm_name; + $data['fmb_html_backend'] = Uiform_Form_Helper::encodeHex($query_obj->log_frm_html_backend); - // return data to ajax callback - header( 'Content-Type: application/json' ); - echo json_encode( $json ); - die(); - } + $json['data'] = $data; - public function ajax_rollback_process() { + // return data to ajax callback + header('Content-Type: application/json'); + echo json_encode($json); + die(); + } - // check_ajax_referer( 'zgfm_ajax_nonce', 'zgfm_security' ); - - $log_id = ( isset( $_POST['log_id'] ) ) ? Uiform_Form_Helper::sanitizeInput( trim( $_POST['log_id'] ) ) : ''; - - $query_obj = $this->model_form_log->getLogById( $log_id ); - - $json = array(); - /* - $json['log_frm_data'] = $query_obj->log_frm_data; - $json['log_frm_name'] = $query_obj->log_frm_name; - $json['log_frm_html_backend'] = $query_obj->log_frm_html_backend; - $json['log_frm_id'] = $query_obj->log_frm_id; */ - - $data = array(); - $data['fmb_data'] = json_decode( $query_obj->log_frm_data, true ); - $data['fmb_name'] = $query_obj->log_frm_name; - $data['fmb_html_backend'] = Uiform_Form_Helper::encodeHex( $query_obj->log_frm_html_backend ); - - $json['data'] = $data; - - // return data to ajax callback - header( 'Content-Type: application/json' ); - echo json_encode( $json ); - die(); - } - - - public function ajax_rollback_openmodal() { - - // check_ajax_referer( 'zgfm_ajax_nonce', 'zgfm_security' ); - - $form_id = ( isset( $_POST['form_id'] ) ) ? Uiform_Form_Helper::sanitizeInput( trim( $_POST['form_id'] ) ) : ''; - - $data = array(); - - $query_obj = $this->model_form_log->getAvailableLogById( $form_id ); - - $log_array = array(); - foreach ( $query_obj as $key => $value ) { - $temp = array(); - $temp['form_name'] = $value->log_frm_name; - $temp['created_date'] = date( 'd-m-Y h:m:s', strtotime( $value->updated_date ) ); - $temp['log_id'] = $value->log_id; - $log_array[] = $temp; - } - - $data['logs'] = $log_array; - - $json = array(); - $json['modal_header'] = '

' . __( 'Rollback Form', 'FRocket_admin' ) . '

'; - $json['modal_body'] = $this->load->view( 'formbuilder/forms/ajax_rollback_openmodal', $data, true ); - $json['modal_footer'] = $this->load->view( 'formbuilder/forms/modal1_footer', $data, true ); - - // return data to ajax callback - header( 'Content-Type: application/json' ); - echo json_encode( $json ); - die(); - } - - - public function ajax_integrity_openmodal() { - - // check_ajax_referer( 'zgfm_ajax_nonce', 'zgfm_security' ); - - $form_id = ( isset( $_POST['form_id'] ) ) ? Uiform_Form_Helper::sanitizeInput( trim( $_POST['form_id'] ) ) : ''; - - $data = array(); - - $json = array(); - $json['modal_header'] = '

' . __( 'Error message', 'FRocket_admin' ) . '

'; - $json['modal_body'] = $this->load->view( 'formbuilder/forms/ajax_integrity_openmodal', $data, true ); - $json['modal_footer'] = $this->load->view( 'formbuilder/forms/modal1_footer', $data, true ); - - // return data to ajax callback - header( 'Content-Type: application/json' ); - echo json_encode( $json ); - die(); - } - - - public function ajax_variables_openmodal() { - - $data = array(); - $form_id = ( isset( $_POST['form_id'] ) ) ? Uiform_Form_Helper::sanitizeInput( trim( $_POST['form_id'] ) ) : ''; - $fmb_data = ( isset( $_POST['form_data'] ) ) ? $_POST['form_data'] : ''; - $fmb_data = urldecode( $fmb_data ); - $fmb_data = ( isset( $fmb_data ) && $fmb_data ) ? array_map( array( 'Uiform_Form_Helper', 'sanitizeRecursive_html' ), json_decode( $fmb_data, true ) ) : array(); - $data['fmb_data'] = $fmb_data; - - $json = array(); - $json['modal_header'] = '

' . __( 'Form variables', 'FRocket_admin' ) . '

'; - $json['modal_body'] = $this->load->view( 'formbuilder/forms/ajax_variables_openmodal', $data, true ); - $json['modal_footer'] = $this->load->view( 'formbuilder/forms/modal1_footer', $data, true ); - - // return data to ajax callback - header( 'Content-Type: application/json' ); - echo json_encode( $json ); - die(); - } - - public function ajax_variables_emailpage() { - - $data = array(); - $form_id = ( isset( $_POST['form_id'] ) ) ? Uiform_Form_Helper::sanitizeInput( trim( $_POST['form_id'] ) ) : ''; - $fmb_data = ( isset( $_POST['form_data'] ) ) ? urldecode( Uiform_Form_Helper::sanitizeInput_html( $_POST['form_data'] ) ) : ''; - if ( ! empty( $fmb_data ) ) { - $fmb_data = ( isset( $fmb_data ) && $fmb_data ) ? array_map( array( 'Uiform_Form_Helper', 'sanitizeRecursive_html' ), json_decode( $fmb_data, true ) ) : array(); - } - - $data['fmb_data'] = $fmb_data; - - $json = array(); - $json['message'] = $this->load->view( 'formbuilder/forms/ajax_variables_emailpage', $data, true ); - - // return data to ajax callback - header( 'Content-Type: application/json' ); - echo json_encode( $json ); - die(); - } - - /** - * Forms::ajax_load_templateform() - * - * @return - */ - public function ajax_load_templateform() { - $number = ( $_POST['number'] ) ? Uiform_Form_Helper::sanitizeInput( trim( $_POST['number'] ) ) : ''; - $fallback_file = file_get_contents( FCPATH . '/assets/backend/json/template_' . $number . '.json' ); - header( 'Content-Type: application/json' ); - echo $fallback_file; - die(); - } - - /** - * Forms::ajax_load_getthumbimg() - * - * @return - */ - public function ajax_load_getthumbimg() { - // this function is disabled - return; - $id_img = ( $_POST['img_id'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['img_id'] ) : ''; - $img_full = ( $_POST['img_src_full'] ) ? Uiform_Form_Helper::sanitizeInput_html( $_POST['img_src_full'] ) : ''; - $json = array(); - $json['img_full'] = $img_full; - $json['img_thumb'] = ( ! empty( $thumb[0] ) ) ? $thumb[0] : $img_full; - header( 'Content-Type: application/json' ); - echo json_encode( $json ); - die(); - } - - /** - * Forms::ajax_load_import_form() - * - * @return - */ - public function ajax_load_import_form() { - $imp_form = ( isset( $_POST['importcode'] ) && $_POST['importcode'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['importcode'] ) : ''; - - $dump_form = unserialize( Uiform_Form_Helper::base64url_decode( $imp_form ) ); - $data_form = array(); - $data_form['fmb_data'] = json_decode( $dump_form['fmb_data'] ); - $data_form['fmb_html_backend'] = $dump_form['fmb_html_backend']; - $data_form['fmb_name'] = $dump_form['fmb_name']; - $data_form['fmb_rec_tpl_html'] = @$dump_form['fmb_rec_tpl_html']; - $data_form['fmb_inv_tpl_html'] = @$dump_form['fmb_inv_tpl_html']; - $data_form['fmb_rec_tpl_st'] = @$dump_form['fmb_rec_tpl_st']; - $data_form['fmb_inv_tpl_st'] = @$dump_form['fmb_inv_tpl_st']; - $json = array(); - $json['data'] = $data_form; - header( 'Content-Type: application/json' ); - echo json_encode( $json ); - die(); - } - - - public function ajax_preview_clogic_graph() { - - $saveform_clogic = array(); - - $fmb_data = ( ! empty( $_POST['form_data'] ) ) ? $_POST['form_data'] : ''; - $fmb_data = ( ! empty( $fmb_data ) ) ? array_map( array( 'Uiform_Form_Helper', 'sanitizeRecursive_html' ), json_decode( $fmb_data, true ) ) : array(); - - // creating again - $steps_src = $fmb_data['steps_src']; - $tmp_var_typename = array(); - $tmp_var_fname = array(); - $tmp_var_fstep = array(); - if ( ! empty( $steps_src ) ) { - foreach ( $steps_src as $tabindex => $fields ) { - if ( ! empty( $fields ) ) { - foreach ( $fields as $key => $value ) { - $data = array(); - $data['fmf_uniqueid'] = $value['id']; - - $data['fmf_fieldname'] = isset( $value['field_name'] ) ? $value['field_name'] : 'not defined'; - $data['fmf_type_n'] = isset( $value['type_n'] ) ? $value['type_n'] : 'not defined'; - - $data['type_fby_id'] = $value['type']; - - $tmp_var_typename[ $value['id'] ] = $data['fmf_type_n']; - $tmp_var_fname[ $value['id'] ] = $data['fmf_fieldname']; - $tmp_var_fstep[ $value['id'] ] = intval( $tabindex ) + 1; - - if ( isset( $value['clogic'] ) && intval( $value['clogic']['show_st'] ) === 1 ) { - $tmp_clogic = array(); - $tmp_clogic['field_cond'] = $value['id']; - $tmp_clogic['field_cond_fname'] = $data['fmf_fieldname']; - $tmp_clogic['field_type_n'] = $data['fmf_type_n']; - - $tmp_clogic['action'] = $value['clogic']['f_show']; - - foreach ( $value['clogic']['list'] as $key2 => $value2 ) { - if ( empty( $value2 ) ) { - unset( $value['clogic']['list'][ $key2 ] ); - } - } - $tmp_clogic['list'] = array_filter( $value['clogic']['list'] ); - $tmp_clogic['req_match'] = ( intval( $value['clogic']['f_all'] ) === 1 ) ? count( $value['clogic']['list'] ) : 1; - $saveform_clogic['cond'][] = $tmp_clogic; - } - } - } - } - } - - $clogic_src = $saveform_clogic; - if ( ! empty( $clogic_src ) ) { - // get fires - $fields_fire = array(); - foreach ( $clogic_src['cond'] as $key => $value ) { - foreach ( $value['list'] as $key2 => $value2 ) { - if ( ! empty( $value2 ) ) { - if ( ! isset( $fields_fire[ $value2['field_fire'] ]['list'][ $value['field_cond'] ] ) ) { - $fields_fire[ $value2['field_fire'] ]['list'][] = $value['field_cond']; - } - } else { - unset( $clogic_src['cond'][ $key ]['list'][ $key2 ] ); - } - } - } - $saveform_clogic = $clogic_src; - // field fires - $logic_field_fire = array(); - foreach ( $fields_fire as $key => $value ) { - $temp_logic = array(); - $temp_logic['field_fire'] = $key; - $temp_logic['field_fire_typen'] = isset( $tmp_var_typename[ $key ] ) ? $tmp_var_typename[ $key ] : 'undefined'; - $temp_logic['field_fire_fname'] = isset( $tmp_var_fname[ $key ] ) ? $tmp_var_fname[ $key ] : 'undefined'; - $temp_logic['field_fire_fstep'] = isset( $tmp_var_fstep[ $key ] ) ? $tmp_var_fstep[ $key ] : 'undefined'; - - $tmp_list = array(); - foreach ( $value['list'] as $value2 ) { - $tmp_list[] = array( - 'field_cond' => $value2, - 'field_cond_typen' => isset( $tmp_var_typename[ $value2 ] ) ? $tmp_var_typename[ $value2 ] : 'undefined', - 'field_cond_fname' => isset( $tmp_var_fname[ $value2 ] ) ? $tmp_var_fname[ $value2 ] : 'undefined', - 'field_cond_fstep' => isset( $tmp_var_fstep[ $value2 ] ) ? $tmp_var_fstep[ $value2 ] : 'undefined', - ); - } - $temp_logic['list'] = $tmp_list; - $logic_field_fire[ $key ] = $temp_logic; - } - - $clogic_src['fire'] = $logic_field_fire; - $saveform_clogic = $clogic_src; - } - - $data2 = array(); - $data2['clogic'] = $saveform_clogic; - $output = $this->load->view( 'formbuilder/forms/preview_clogic_graph', $data2, true ); - - $json = array(); - $json['html'] = $output; - header( 'Content-Type: text/html; charset=UTF-8' ); - echo json_encode( $json ); - die(); - } - - - /** - * Forms::ajax_listform_duplicate() - * - * @return - */ - public function ajax_listform_duplicate() { - $list_ids = ( isset( $_POST['id'] ) && $_POST['id'] ) ? array_map( array( 'Uiform_Form_Helper', 'sanitizeRecursive' ), $_POST['id'] ) : array(); - - if ( $list_ids ) { - foreach ( $list_ids as $value ) { - $data_form = $this->model_forms->getFormById( $value ); - $data = array(); - $data['fmb_data'] = $data_form->fmb_data; - $data['fmb_data2'] = $data_form->fmb_data2; - $data['fmb_name'] = $data_form->fmb_name . ' - copy'; - $data['fmb_html_backend'] = $data_form->fmb_html_backend; - $data['created_ip'] = $_SERVER['REMOTE_ADDR']; - $data['created_by'] = 1; - $data['created_date'] = date( 'Y-m-d h:i:s' ); - - $this->db->set( $data ); - $this->db->insert( $this->model_forms->table ); - } - } - } - - - /** - * Forms::ajax_listform_updatest() - * - * @return - */ - public function ajax_listform_updatest() { - $list_ids = ( isset( $_POST['id'] ) && $_POST['id'] ) ? array_map( array( 'Uiform_Form_Helper', 'sanitizeRecursive' ), $_POST['id'] ) : array(); - $form_st = ( isset( $_POST['form_st'] ) && $_POST['form_st'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['form_st'] ) : ''; - if ( $list_ids ) { - foreach ( $list_ids as $value ) { - - $data = array( - 'flag_status' => intval( $form_st ), - ); - - $this->db->set( $data ); - $this->db->where( 'fmb_id', $value ); - $this->db->update( $this->model_forms->table ); - } - } - } - - public function ajax_list_trashform_updatest() { - - $list_ids = ( isset( $_POST['id'] ) && $_POST['id'] ) ? array_map( array( 'Uiform_Form_Helper', 'sanitizeRecursive' ), $_POST['id'] ) : array(); - $form_st = ( isset( $_POST['form_st'] ) && $_POST['form_st'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['form_st'] ) : ''; - if ( $list_ids ) { - - switch ( intval( $form_st ) ) { - case 1: - case 2: - foreach ( $list_ids as $value ) { - - $data = array( - 'flag_status' => intval( $form_st ), - ); - - $this->db->set( $data ); - $this->db->where( 'fmb_id', $value ); - $this->db->update( $this->model_forms->table ); - } - break; - case 0: - foreach ( $list_ids as $value ) { - - $this->delete_form_process( $value ); - - } - - break; - default: - # code... - break; - } - } - } - - private function delete_form_process( $value ) { - //remove from log form - $this->db->where( 'log_frm_id', $value ); - $this->db->delete( $this->model_form_log->table ); - - //remove from fields - $this->db->where( 'form_fmb_id', $value ); - $this->db->delete( $this->model_fields->table ); - - //remove from addons logs - $this->db->where( 'fmb_id', $value ); - $this->db->delete( $this->model_addon_details_log->table ); - - //remove from addons - $this->db->where( 'fmb_id', $value ); - $this->db->delete( $this->model_addon_details->table ); - - //remove pay record logs - $this->model_gateways_logs->deleteRecordbyFormId( $value ); - - //remove pay records - $this->model_gateways_records->deleteRecordbyFormId( $value ); - - //remove from records - $this->db->where( 'form_fmb_id', $value ); - $this->db->delete( $this->model_record->table ); - - //remove from form - $this->db->where( 'fmb_id', $value ); - $this->db->delete( $this->model_forms->table ); - } - - - /** - * delete trash form by form id - * - * @return void - */ - public function ajax_delete_trashform_byid() { - - $form_id = ( isset( $_POST['form_id'] ) && $_POST['form_id'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['form_id'] ) : 0; - - $this->delete_form_process( $form_id ); - } - - /** - * Forms::ajax_delete_form_byid() - * - * @return - */ - public function ajax_delete_form_byid() { - $form_id = ( isset( $_POST['form_id'] ) && $_POST['form_id'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['form_id'] ) : 0; - - $data = array( - 'flag_status' => 0, - ); - - $this->db->set( $data ); - $this->db->where( 'fmb_id', $form_id ); - $this->db->update( $this->model_forms->table ); - } - - /** - * Forms::ajax_load_preview_form() - * - * @return - */ - public function ajax_load_preview_form() { - - $form_id = ( isset( $_POST['form_id'] ) ) ? Uiform_Form_Helper::sanitizeInput( trim( $_POST['form_id'] ) ) : ''; - header( 'Content-type: text/html' ); - ob_start(); - - $data = array(); - $content = ''; - $content = site_url() . 'formbuilder/frontend/viewform/?form=' . $form_id; - $data['url'] = escape_text( $content ); - - $temp = array(); - $temp['url_form'] = $data['url'] . '&lmode=1'; - $temp['base_url'] = base_url(); - $temp['form_id'] = $form_id; - - $data['iframe'] = $this->load->view( 'formbuilder/forms/get_code_iframe', $temp, true ); - echo $data['iframe']; - ?> - - - load->view( 'formbuilder/forms/form_show_shortcodes', $data, true ); - - // return data to ajax callback - header( 'Content-type: text/html' ); - echo json_encode( $json ); - die(); - } - - public function ajax_modal_form_getshorcodes() { - - $form_id = ( isset( $_POST['form_id'] ) ) ? Uiform_Form_Helper::sanitizeInput( trim( $_POST['form_id'] ) ) : ''; - $data = array(); - $data['form_id'] = $form_id; - $json = array(); - $json['html_title'] = __( 'Shortcodes', 'FRocket_admin' ); - $json['html'] = $this->load->view( 'formbuilder/forms/form_show_shortcodes', $data, true ); - - // return data to ajax callback - header( 'Content-type: text/html' ); - echo json_encode( $json ); - die(); - } - - /** - * Forms::ajax_refresh_previewpanel() - * - * @return - */ - public function ajax_refresh_previewpanel() { - $data = array(); - $fmb_data = ( isset( $_POST['form_data'] ) ) ? $_POST['form_data'] : ''; - $fmb_data = urldecode( $fmb_data ); - $fmb_data = ( isset( $fmb_data ) && $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'] ) ) : ''; - - // in case title is empty - if ( empty( $data['fmb_name'] ) && ! empty( $_POST['uifm_frm_main_id'] ) && intval( $_POST['uifm_frm_main_id'] ) > 0 ) { - $tmp_form_id = ( ! empty( $_POST['uifm_frm_main_id'] ) ) ? Uiform_Form_Helper::sanitizeInput( trim( $_POST['uifm_frm_main_id'] ) ) : ''; - $tmp_form_title = $this->model_forms->getTitleFormById( $tmp_form_id ); - $data['fmb_name'] = $tmp_form_title->fmb_name; - } - - $json = array(); - $tmp_html = $this->generate_previewpanel_html( $data ); - $data['fmb_html_backend'] = Uiform_Form_Helper::encodeHex( do_shortcode( $tmp_html['output_html'] ) ); - $json['data'] = $data; - // return data to ajax callback - header( 'Content-Type: application/json' ); - echo json_encode( $json ); - die(); - } - - /** - * Forms::ajax_save_form_updateopts() - * - * @return - */ - public function ajax_save_form_updateopts() { - $data = array(); - $fmb_id = ( $_POST['uifm_frm_main_id'] ) ? Uiform_Form_Helper::sanitizeInput( trim( $_POST['uifm_frm_main_id'] ) ) : 0; - $data['fmb_html_backend'] = ( $_POST['form_html_backend'] ) ? Uiform_Form_Helper::sanitizeInput_html( $_POST['form_html_backend'] ) : ''; - $json = array(); - if ( intval( $fmb_id ) > 0 ) { - - $this->db->set( $data ); - $this->db->where( 'fmb_id', $fmb_id ); - $this->db->update( $this->model_forms->table ); - - $json['status'] = 'updated'; - $json['id'] = $fmb_id; - } - // return data to ajax callback - header( 'Content-Type: application/json' ); - echo json_encode( $json ); - die(); - } - - public function ajax_save_newform() { - - $json = array(); - try { - if ( ! Uiform_Form_Helper::check_User_Access() ) { - throw new Exception( __( 'Error! User has no permission to edit this form', 'FRocket_admin' ) ); - } - $data = array(); - $data['fmb_name'] = ( ! empty( $_POST['uifm_frm_main_title'] ) ) ? Uiform_Form_Helper::sanitizeInput( trim( $_POST['uifm_frm_main_title'] ) ) : ''; - $this->db->set( $data ); - $this->db->insert( $this->model_forms->table ); - - $idActivate = $this->db->insert_id(); - - $json['status'] = 'created'; - $json['id'] = $idActivate; - - } catch ( Exception $e ) { - - } - // return data to ajax callback - header( 'Content-Type: application/json' ); - echo json_encode( $json ); - die(); - } - - /** - * Forms::ajax_save_form() - * - * @return - */ - public function ajax_save_form() { - try { - if ( ! Uiform_Form_Helper::check_User_Access() ) { - throw new Exception( __( 'Error! User has no permission to edit this form', 'FRocket_admin' ) ); - } - ob_start(); - $data = array(); - - $fmb_data = ( isset( $_POST['form_data'] ) ) ? $_POST['form_data'] : ''; - $fmb_data = urldecode( $fmb_data ); - $fmb_data = ( isset( $fmb_data ) && $fmb_data ) ? array_map( array( 'Uiform_Form_Helper', 'sanitizeRecursive_html' ), json_decode( $fmb_data, true ) ) : array(); - - // here a message should be sent - if ( empty( $fmb_data ) ) { - return false; - } - - $data['fmb_data'] = json_encode( $fmb_data ); - - // addon data - $fmb_addon_data = ( isset( $_POST['addon_data'] ) ) ? urldecode( Uiform_Form_Helper::sanitizeInput_html( $_POST['addon_data'] ) ) : ''; - $fmb_addon_data = ( isset( $fmb_addon_data ) && $fmb_addon_data ) ? array_map( array( 'Uiform_Form_Helper', 'sanitizeRecursive_html' ), json_decode( $fmb_addon_data, true ) ) : array(); - - // form_inputs - $fmb_data['fm_inputs'] = ( isset( $_POST['form_inputs'] ) ) ? urldecode( Uiform_Form_Helper::sanitizeInput_html( $_POST['form_inputs'] ) ) : ''; - - // more options - $data['fmb_rec_tpl_html'] = ( isset( $_POST['uifm_frm_rec_tpl_html'] ) ) ? urldecode( Uiform_Form_Helper::sanitizeInput_html( $_POST['uifm_frm_rec_tpl_html'] ) ) : ''; - $data['fmb_inv_tpl_html'] = ( isset( $_POST['uifm_frm_inv_tpl_html'] ) ) ? urldecode( Uiform_Form_Helper::sanitizeInput_html( $_POST['uifm_frm_inv_tpl_html'] ) ) : ''; - $data['fmb_rec_tpl_st'] = ( isset( $_POST['uifm_frm_rec_tpl_st'] ) ) ? urldecode( Uiform_Form_Helper::sanitizeInput_html( $_POST['uifm_frm_rec_tpl_st'] ) ) : ''; - $data['fmb_inv_tpl_st'] = ( isset( $_POST['uifm_frm_inv_tpl_st'] ) ) ? urldecode( Uiform_Form_Helper::sanitizeInput_html( $_POST['uifm_frm_inv_tpl_st'] ) ) : ''; - - $tmp_data2 = array(); - $tmp_data2['onsubm'] = isset( $fmb_data['onsubm'] ) ? $fmb_data['onsubm'] : ''; - $tmp_data2['main'] = isset( $fmb_data['main'] ) ? $fmb_data['main'] : ''; - $tmp_data2['calculation'] = isset( $fmb_data['calculation'] ) ? $fmb_data['calculation'] : ''; - $data['fmb_data2'] = ! empty( $tmp_data2 ) ? json_encode( $tmp_data2 ) : ''; - $data['fmb_name'] = ( ! empty( $_POST['uifm_frm_main_title'] ) ) ? Uiform_Form_Helper::sanitizeInput( trim( $_POST['uifm_frm_main_title'] ) ) : ''; - $data['created_ip'] = $_SERVER['REMOTE_ADDR']; - $data['created_by'] = 1; - $data['created_date'] = date( 'Y-m-d h:i:s' ); - $fmb_id = ( isset( $_POST['uifm_frm_main_id'] ) ) ? Uiform_Form_Helper::sanitizeInput( trim( $_POST['uifm_frm_main_id'] ) ) : 0; - - /* global for fonts */ - global $global_fonts_stored; - $global_fonts_stored = array(); - - $json = array(); - if ( intval( $fmb_id ) > 0 ) { - - $this->db->set( $data ); - $this->db->where( 'fmb_id', $fmb_id ); - $this->db->update( $this->model_forms->table ); - - $json['status'] = 'updated'; - $json['id'] = $fmb_id; - } else { - - $this->db->set( $data ); - $this->db->insert( $this->model_forms->table ); - - $idActivate = $this->db->insert_id(); - $json['status'] = 'created'; - $json['id'] = $idActivate; - } - - $data_form = $this->model_forms->getFormById( $json['id'] ); - $fmb_data = json_decode( $data_form->fmb_data, true ); - - // all data fields - $fmb_data['addons'] = $fmb_addon_data; - - if ( intval( $json['id'] ) === 0 ) { - throw new Exception( 'Form id error' ); - } - - $where = array( - 'fmb_id' => $json['id'], - ); - - // process addons - if ( ! empty( self::$_addons_actions ) ) { - foreach ( self::$_addons_actions as $zkey => $zvalue ) { - - if ( strval( $zkey ) === 'saveForm_store' ) { - foreach ( $zvalue as $zkey2 => $zvalue2 ) { - foreach ( $zvalue2 as $zkey3 => $zvalue3 ) { - // call_user_func(array(self::$_addons[$zkey3][$zvalue3['controller']], $zvalue3['function']),$json['id'], $value['data'],$fmb_data); - - self::$_addons[ $zkey3 ][ $zvalue3['controller'] ]->saveData( $json['id'], $fmb_data ); - } - } - } - /* - if(isset(self::$_addons[$key][$value['controller']])){ - //call_user_func(array(self::$_addons[$key][$value['controller']] , 'saveData')); - self::$_addons[$key][$value['controller']]->saveData($json['id'], $value['data'],$fmb_data); - - - }*/ - } - } - - // all data fields - $this->current_data_addon = $fmb_data['addons']; - $this->current_data_form = $fmb_data['steps_src']; - $this->current_data_num_tabs = $fmb_data['num_tabs']; - $this->current_data_tab_cont = $fmb_data['steps']['tab_cont']; - $this->current_data_steps = $fmb_data['steps']; - $this->current_data_skin = $fmb_data['skin']; - $this->current_data_wizard = ( $fmb_data['wizard'] ) ? $fmb_data['wizard'] : array(); - $this->current_data_onsubm = ( $fmb_data['onsubm'] ) ? $fmb_data['onsubm'] : array(); - $this->current_data_main = ( $fmb_data['main'] ) ? $fmb_data['main'] : array(); - $this->current_data_summbox = ( $fmb_data['summbox'] ) ? $fmb_data['summbox'] : array(); - $this->current_data_calculation = ( $fmb_data['calculation'] ) ? $fmb_data['calculation'] : array(); - - // save fields to table - $this->saved_form_id = $json['id']; - $this->save_data_fields( $json['id'] ); - // save fields to table - $this->save_form_clogic(); - - // generate form html - $gen_return = $this->generate_form_html( $json['id'] ); - $data4 = array(); - $data4['fmb_html'] = $gen_return['output_html']; - $data4['fmb_html_backend'] = $this->generate_admin_form_html( $json['id'] ); - - // get global style - $data2 = array(); - $data2['idform'] = $json['id']; - $data2['addition_css'] = $this->current_data_main['add_css']; - $data2['skin'] = $this->current_data_skin; - $data2['summbox'] = $this->current_data_summbox; - $gen_return['output_css'] .= $this->load->view( 'formbuilder/forms/formhtml_css_global', $data2, true ); - - $data3 = array(); - $data3['fonts'] = $global_fonts_stored; - $gen_return['output_css'] = $this->load->view( 'formbuilder/forms/formhtml_css_init', $data3, true ) . $gen_return['output_css']; - $data4['fmb_html_css'] = $gen_return['output_css']; - $this->db->set( $data4 ); - $this->db->where( 'fmb_id', $json['id'] ); - $this->db->update( $this->model_forms->table ); - - // generate form css - ob_start(); - $pathCssFile = FCPATH . '/assets/frontend/css/rockfm_form' . $json['id'] . '.css'; - $f = fopen( $pathCssFile, 'w' ); - fwrite( $f, $gen_return['output_css'] ); - fclose( $f ); - ob_end_clean(); - - // add to log - $save_log_st = false; - $count_log_rec = $this->model_form_log->CountLogsByFormId( $json['id'] ); - - if ( intval( $count_log_rec ) > 0 ) { - $last_rec = $this->model_form_log->getLastLogById( $json['id'] ); - $new_hash = md5( $data_form->fmb_data ); - $old_hash = $last_rec->log_frm_hash; - if ( $new_hash != $old_hash ) { - $save_log_st = true; - } - } else { - $save_log_st = true; - } - - $log_lastid = 0; - - if ( $save_log_st ) { - $data5 = array(); - $data5['log_frm_data'] = $data['fmb_data']; - $data5['log_frm_name'] = $data['fmb_name']; - $data5['log_frm_html'] = ''; - $data5['log_frm_html_backend'] = $data4['fmb_html_backend']; - $data5['log_frm_html_css'] = ''; - $data5['log_frm_id'] = $json['id']; - $data5['log_frm_hash'] = md5( $data_form->fmb_data ); - $data5['created_ip'] = $_SERVER['REMOTE_ADDR']; - $data5['created_by'] = 1; - $data5['created_date'] = date( 'Y-m-d h:i:s' ); - - // $this->wpdb->insert($this->model_form_log->table, $data5); - $this->db->set( $data5 ); - $this->db->insert( $this->model_form_log->table ); - $log_lastid = $this->db->insert_id(); - // remove oldest if limit is exceeded - if ( intval( $count_log_rec ) > 50 ) { - $tmp_log = $this->model_form_log->getOldLogById( $json['id'] ); - - $this->db->where( 'log_id', $tmp_log->log_id )->delete( $this->model_form_log->table ); - } - } - - // process addons - if ( ! empty( self::$_addons_actions ) ) { - foreach ( self::$_addons_actions as $zkey => $zvalue ) { - - if ( strval( $zkey ) === 'OnSaveForm_saveLog' ) { - foreach ( $zvalue as $zkey2 => $zvalue2 ) { - foreach ( $zvalue2 as $zkey3 => $zvalue3 ) { - - if ( isset( $this->current_data_addon[ $zkey3 ]['data'] ) ) { - self::$_addons[ $zkey3 ][ $zvalue3['controller'] ]->saveLog( $json['id'], $save_log_st, $log_lastid, $this->current_data_addon[ $zkey3 ]['data'] ); - } - } - } - } - } - } - - // checking errors - $output_error = ob_get_contents(); - if ( ob_get_length() > 0 ) { - ob_end_clean(); - } - if ( ! empty( $output_error ) ) { - throw new Exception( $output_error ); - } - } catch ( Exception $e ) { - $data = array(); - $error = array(); - $error['Message'] = $e->getMessage(); - $error['Trace'] = $e->getTrace(); - $ip = isset( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : ''; - $user_agent = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : ''; - $hash = hash( 'crc32', md5( $ip . $user_agent ) ); - - $referer = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : ''; - $data['vis_uniqueid'] = $hash; - $data['vis_user_agent'] = $user_agent; - $data['vis_page'] = $_SERVER['REQUEST_URI']; - $data['vis_referer'] = $referer; - $data['vis_error'] = Uiform_Form_Helper::array2xml( $error ); - $data['vis_ip'] = $ip; - $data['fmb_id'] = $fmb_id; - $data['vis_last_date'] = date( 'Y-m-d H:i:s' ); - - $this->db->set( $data ); - $this->db->insert( $this->model_visitor->table ); - - $json = array(); - $json['status'] = 'failed'; - $json['modal_header'] = __( 'Error on saving form', 'FRocket_admin' ); - $json['modal_footer'] = ''; - $json['Message'] = $e->getMessage(); - } - // return data to ajax callback - header( 'Content-Type: application/json' ); - echo json_encode( $json ); - die(); - - } - - /** - * Forms::generate_form_getField() - * - * @return - */ - protected function generate_form_getField( $child_field ) { - $str_output = ''; - $str_output_3 = ''; - - $data = array(); - $data = $this->current_data_form[ intval( $child_field['num_tab'] ) ][ $child_field['id'] ]; - - $data['addon_extraclass'] = ''; - - // process addons - if ( ! empty( self::$_addons_actions ) ) { - foreach ( self::$_addons_actions as $zkey => $zvalue ) { - - if ( strval( $zkey ) === 'field_addon_extraclass' ) { - foreach ( $zvalue as $zkey2 => $zvalue2 ) { - foreach ( $zvalue2 as $zkey3 => $zvalue3 ) { - - self::$_addons[ $zkey3 ][ $zvalue3['controller'] ]->getExtraDataField( $data ); - } - } - } - } - } - - switch ( intval( $child_field['type'] ) ) { - case 6: - // textbox - - $str_output .= modules::run( 'formbuilder/fields/formhtml_textbox', $data, $child_field['num_tab'] ); - $str_output_3 .= modules::run( 'formbuilder/fields/formhtml_textbox_css', $data ); - - break; - case 7: - // textarea - $str_output .= modules::run( 'formbuilder/fields/formhtml_textarea', $data, $child_field['num_tab'] ); - $str_output_3 .= modules::run( 'formbuilder/fields/formhtml_textarea_css', $data ); - - break; - case 8: - // radio button - $data['main'] = $this->current_data_main; - $str_output .= modules::run( 'formbuilder/fields/formhtml_radiobtn', $data, $child_field['num_tab'] ); - $str_output_3 .= modules::run( 'formbuilder/fields/formhtml_radiobtn_css', $data ); - - break; - case 9: - // checkbox - $data['main'] = $this->current_data_main; - $str_output .= modules::run( 'formbuilder/fields/formhtml_checkbox', $data, $child_field['num_tab'] ); - $str_output_3 .= modules::run( 'formbuilder/fields/formhtml_checkbox_css', $data ); - - break; - case 10: - // select - $data['main'] = $this->current_data_main; - $str_output .= modules::run( 'formbuilder/fields/formhtml_select', $data, $child_field['num_tab'] ); - $str_output_3 .= modules::run( 'formbuilder/fields/formhtml_select_css', $data ); - - break; - case 11: - // multiselect - $data['main'] = $this->current_data_main; - $str_output .= modules::run( 'formbuilder/fields/formhtml_multiselect', $data, $child_field['num_tab'] ); - $str_output_3 .= modules::run( 'formbuilder/fields/formhtml_multiselect_css', $data ); - - break; - case 12: - // fileupload - $str_output .= modules::run( 'formbuilder/fields/formhtml_fileupload', $data, $child_field['num_tab'] ); - $str_output_3 .= modules::run( 'formbuilder/fields/formhtml_fileupload_css', $data ); - - break; - case 13: - // imageupload - $str_output .= modules::run( 'formbuilder/fields/formhtml_imageupload', $data, $child_field['num_tab'] ); - $str_output_3 .= modules::run( 'formbuilder/fields/formhtml_imageupload_css', $data ); - break; - case 14: - // custom html - $str_output .= modules::run( 'formbuilder/fields/formhtml_customhtml', $data, $child_field['num_tab'] ); - $str_output_3 .= modules::run( 'formbuilder/fields/formhtml_customhtml_css', $data ); - break; - case 15: - // password - $str_output .= modules::run( 'formbuilder/fields/formhtml_password', $data, $child_field['num_tab'] ); - $str_output_3 .= modules::run( 'formbuilder/fields/formhtml_password_css', $data ); - break; - case 16: - // slider - $data['main'] = $this->current_data_main; - $str_output .= modules::run( 'formbuilder/fields/formhtml_slider', $data, $child_field['num_tab'] ); - $str_output_3 .= modules::run( 'formbuilder/fields/formhtml_slider_css', $data ); - break; - case 17: - // range - $str_output .= modules::run( 'formbuilder/fields/formhtml_range', $data, $child_field['num_tab'] ); - $str_output_3 .= modules::run( 'formbuilder/fields/formhtml_range_css', $data ); - break; - case 18: - // spinner - $data['main'] = $this->current_data_main; - $str_output .= modules::run( 'formbuilder/fields/formhtml_spinner', $data, $child_field['num_tab'] ); - $str_output_3 .= modules::run( 'formbuilder/fields/formhtml_spinner_css', $data ); - break; - case 19: - // captcha - $str_output .= modules::run( 'formbuilder/fields/formhtml_captcha', $data, $child_field['num_tab'] ); - $str_output_3 .= modules::run( 'formbuilder/fields/formhtml_captcha_css', $data ); - break; - case 20: - // submit button - $str_output .= modules::run( 'formbuilder/fields/formhtml_submitbtn', $data, $child_field['num_tab'] ); - $str_output_3 .= modules::run( 'formbuilder/fields/formhtml_submitbtn_css', $data ); - break; - case 21: - // hidden field - $str_output .= modules::run( 'formbuilder/fields/formhtml_hiddeninput', $data, $child_field['num_tab'] ); - - break; - case 22: - // star rating - $str_output .= modules::run( 'formbuilder/fields/formhtml_ratingstar', $data, $child_field['num_tab'] ); - $str_output_3 .= modules::run( 'formbuilder/fields/formhtml_ratingstar_css', $data ); - break; - case 23: - // color picker - $str_output .= modules::run( 'formbuilder/fields/formhtml_colorpicker', $data, $child_field['num_tab'] ); - $str_output_3 .= modules::run( 'formbuilder/fields/formhtml_colorpicker_css', $data ); - break; - case 24: - // date picker - $str_output .= modules::run( 'formbuilder/fields/formhtml_datepicker', $data, $child_field['num_tab'] ); - $str_output_3 .= modules::run( 'formbuilder/fields/formhtml_datepicker_css', $data ); - break; - case 25: - // time picker - $str_output .= modules::run( 'formbuilder/fields/formhtml_timepicker', $data, $child_field['num_tab'] ); - $str_output_3 .= modules::run( 'formbuilder/fields/formhtml_timepicker_css', $data ); - break; - case 26: - // date time - $str_output .= modules::run( 'formbuilder/fields/formhtml_datetime', $data, $child_field['num_tab'] ); - $str_output_3 .= modules::run( 'formbuilder/fields/formhtml_datetime_css', $data ); - break; - case 27: - // recaptcha - $str_output .= modules::run( 'formbuilder/fields/formhtml_recaptcha', $data, $child_field['num_tab'] ); - $str_output_3 .= modules::run( 'formbuilder/fields/formhtml_recaptcha_css', $data ); - break; - case 28: - // prepended text - $str_output .= modules::run( 'formbuilder/fields/formhtml_preptext', $data, $child_field['num_tab'] ); - $str_output_3 .= modules::run( 'formbuilder/fields/formhtml_preptext_css', $data ); - break; - case 29: - // appended text - $str_output .= modules::run( 'formbuilder/fields/formhtml_appetext', $data, $child_field['num_tab'] ); - $str_output_3 .= modules::run( 'formbuilder/fields/formhtml_appetext_css', $data ); - break; - case 30: - // prep app text - $str_output .= modules::run( 'formbuilder/fields/formhtml_prepapptext', $data, $child_field['num_tab'] ); - $str_output_3 .= modules::run( 'formbuilder/fields/formhtml_prepapptext_css', $data ); - break; - case 31: - // panel - $str_output .= modules::run( 'formbuilder/fields/formhtml_panelfld', $data, $child_field['num_tab'] ); - $str_output_3 .= modules::run( 'formbuilder/fields/formhtml_panelfld_css', $data ); - break; - case 32: - // divider - $str_output .= modules::run( 'formbuilder/fields/formhtml_divider', $data, $child_field['num_tab'] ); - $data['form_skin'] = $this->current_data_skin; - $str_output_3 .= modules::run( 'formbuilder/fields/formhtml_divider_css', $data ); - - break; - case 33: - case 34: - case 35: - case 36: - case 37: - case 38: - // heading - $str_output .= modules::run( 'formbuilder/fields/formhtml_heading', $data, $child_field['num_tab'] ); - $str_output_3 .= modules::run( 'formbuilder/fields/formhtml_heading_css', $data ); - break; - case 39: - // wizard buttons - $data['form_wizard'] = $this->current_data_wizard; - $data['tab_count'] = $this->current_data_steps; - $str_output .= modules::run( 'formbuilder/fields/formhtml_wizardbtn', $data, $child_field['num_tab'] ); - $str_output_3 .= modules::run( 'formbuilder/fields/formhtml_wizardbtn_css', $data ); - break; - case 40: - // switch - $data['main'] = $this->current_data_main; - $str_output .= modules::run( 'formbuilder/fields/formhtml_switch', $data, $child_field['num_tab'] ); - $str_output_3 .= modules::run( 'formbuilder/fields/formhtml_switch_css', $data ); - break; - case 41: - // dyn checkbox - $data['main'] = $this->current_data_main; - $data['form_id'] = $this->saved_form_id; - $str_output .= modules::run( 'formbuilder/fields/formhtml_dyncheckbox', $data, $child_field['num_tab'] ); - $str_output_3 .= modules::run( 'formbuilder/fields/formhtml_dyncheckbox_css', $data ); - break; - case 42: - // dyn radiobtn - $data['main'] = $this->current_data_main; - $data['form_id'] = $this->saved_form_id; - $str_output .= modules::run( 'formbuilder/fields/formhtml_dynradiobtn', $data, $child_field['num_tab'] ); - $str_output_3 .= modules::run( 'formbuilder/fields/formhtml_dynradiobtn_css', $data ); - break; - case 43: - // date 2 - $data['main'] = $this->current_data_main; - $data['form_id'] = $this->saved_form_id; - $str_output .= modules::run( 'formbuilder/fields/formhtml_date2', $data, $child_field['num_tab'] ); - $str_output_3 .= modules::run( 'formbuilder/fields/formhtml_date2_css', $data ); - break; - default: - break; - } - - $return = array(); - $return['output_html'] = $str_output; - - // add css inside namespace of the form - require_once FCPATH . '/libs/lesslib/lessc.inc.php'; - $less = new lessc(); - $css_store = ''; - try { - $css_store = $less->compile( '#rockfm_form_' . $this->saved_form_id . ' {' . $str_output_3 . '}' ); - } catch ( exception $e ) { - $css_store = $str_output_3; - } - - $return['output_css'] = $css_store; - - return $return; - } - - /* - * Search field on core data if exists - */ - private function isField_OnCoreData( $core_data, $field_search ) { - foreach ( $core_data as $key => $field ) { - if ( isset( $core_data[ $key ][ $field_search ] ) && ! empty( $core_data[ $key ][ $field_search ] ) ) { - return $core_data[ $key ][ $field_search ]; - } - } - - return false; - } - /** - * Forms::generate_previewpanel_getField() - * - * @return - */ - protected function generate_previewpanel_getField( $child_field ) { - $str_output = ''; - - $data = array(); - - if ( empty( $this->current_data_form[ intval( $child_field['num_tab'] ) ][ $child_field['id'] ] ) ) { - $tmp_data = $this->isField_OnCoreData( $this->current_data_form, $child_field['id'] ); - if ( $tmp_data ) { - $data = $tmp_data; - } else { - $return = array(); - $return['output_html'] = ''; - return $return; - } - } else { - - $data = $this->current_data_form[ intval( $child_field['num_tab'] ) ][ $child_field['id'] ]; - } - - $data['quick_options'] = $this->load->view( 'formbuilder/fields/templates/prevpanel_quickopts', $data, true ); - switch ( intval( $child_field['type'] ) ) { - case 6: - // textbox - $str_output .= $this->load->view( 'formbuilder/fields/templates/prevpanel_textbox', $data, true ); - break; - case 7: - // textarea - $str_output .= $this->load->view( 'formbuilder/fields/templates/prevpanel_textarea', $data, true ); - break; - case 8: - // radio button - $str_output .= $this->load->view( 'formbuilder/fields/templates/prevpanel_radiobtn', $data, true ); - break; - case 9: - // checkbox - $str_output .= $this->load->view( 'formbuilder/fields/templates/prevpanel_checkbox', $data, true ); - break; - case 10: - // select - $str_output .= $this->load->view( 'formbuilder/fields/templates/prevpanel_select', $data, true ); - break; - case 11: - // multiselect - $str_output .= $this->load->view( 'formbuilder/fields/templates/prevpanel_multiselect', $data, true ); - break; - case 12: - // fileupload - $str_output .= $this->load->view( 'formbuilder/fields/templates/prevpanel_fileupload', $data, true ); - break; - case 13: - // imageupload - $str_output .= $this->load->view( 'formbuilder/fields/templates/prevpanel_imageupload', $data, true ); - break; - case 14: - // custom html - $str_output .= $this->load->view( 'formbuilder/fields/templates/prevpanel_customhtml', $data, true ); - break; - case 15: - // password - $str_output .= $this->load->view( 'formbuilder/fields/templates/prevpanel_password', $data, true ); - break; - case 16: - // slider - $str_output .= $this->load->view( 'formbuilder/fields/templates/prevpanel_slider', $data, true ); - break; - case 17: - // range - $str_output .= $this->load->view( 'formbuilder/fields/templates/prevpanel_range', $data, true ); - break; - case 18: - // spinner - $str_output .= $this->load->view( 'formbuilder/fields/templates/prevpanel_spinner', $data, true ); - break; - case 19: - // captcha - $str_output .= $this->load->view( 'formbuilder/fields/templates/prevpanel_captcha', $data, true ); - break; - case 20: - // submit button - $str_output .= $this->load->view( 'formbuilder/fields/templates/prevpanel_submitbtn', $data, true ); - break; - case 21: - // hidden field - $str_output .= $this->load->view( 'formbuilder/fields/templates/prevpanel_hiddeninput', $data, true ); - break; - case 22: - // star rating - $str_output .= $this->load->view( 'formbuilder/fields/templates/prevpanel_ratingstar', $data, true ); - break; - case 23: - // color picker - $str_output .= $this->load->view( 'formbuilder/fields/templates/prevpanel_colorpicker', $data, true ); - break; - case 24: - // date picker - $str_output .= $this->load->view( 'formbuilder/fields/templates/prevpanel_datepicker', $data, true ); - break; - case 25: - // time picker - $str_output .= $this->load->view( 'formbuilder/fields/templates/prevpanel_timepicker', $data, true ); - break; - case 26: - // date time - $str_output .= $this->load->view( 'formbuilder/fields/templates/prevpanel_datetime', $data, true ); - break; - case 27: - // recaptcha - $str_output .= $this->load->view( 'formbuilder/fields/templates/prevpanel_recaptcha', $data, true ); - break; - case 28: - // prepended text - $str_output .= $this->load->view( 'formbuilder/fields/templates/prevpanel_preptext', $data, true ); - break; - case 29: - // appended text - $str_output .= $this->load->view( 'formbuilder/fields/templates/prevpanel_appetext', $data, true ); - break; - case 30: - // prep app text - $str_output .= $this->load->view( 'formbuilder/fields/templates/prevpanel_prepapptext', $data, true ); - break; - case 32: - // divider - $str_output .= $this->load->view( 'formbuilder/fields/templates/prevpanel_divider', $data, true ); - break; - case 33: - // heading 1 - $str_output .= $this->load->view( 'formbuilder/fields/templates/prevpanel_heading1', $data, true ); - break; - case 34: - // heading 2 - $str_output .= $this->load->view( 'formbuilder/fields/templates/prevpanel_heading2', $data, true ); - break; - case 35: - // heading 3 - $str_output .= $this->load->view( 'formbuilder/fields/templates/prevpanel_heading3', $data, true ); - break; - case 36: - // heading 4 - $str_output .= $this->load->view( 'formbuilder/fields/templates/prevpanel_heading4', $data, true ); - break; - case 37: - // heading 5 - $str_output .= $this->load->view( 'formbuilder/fields/templates/prevpanel_heading5', $data, true ); - break; - case 38: - // heading 6 - $str_output .= $this->load->view( 'formbuilder/fields/templates/prevpanel_heading6', $data, true ); - break; - case 39: - // wizard buttons - $str_output .= $this->load->view( 'formbuilder/fields/templates/prevpanel_wizardbtn', $data, true ); - break; - case 40: - // switch - $str_output .= $this->load->view( 'formbuilder/fields/templates/prevpanel_switch', $data, true ); - break; - case 41: - // dyn checkbox - $str_output .= $this->load->view( 'formbuilder/fields/templates/prevpanel_dyncheckbox', $data, true ); - break; - case 42: - // dyn radiobtn - $str_output .= $this->load->view( 'formbuilder/fields/templates/prevpanel_dynradiobtn', $data, true ); - break; - case 43: - // date - $str_output .= $this->load->view( 'formbuilder/fields/templates/prevpanel_datetime_2', $data, true ); - break; - default: - break; - } - - $return = array(); - $return['output_html'] = $str_output; - return $return; - } - - /** - * Forms::getChildren_innerGrid() - * - * @return - */ - protected function getChildren_innerGrid( $type ) { - - $str_output = ''; - switch ( intval( $type ) ) { - case 1: - ob_start(); - ?> - -
-
- - - - - - -
- -
- - - - - - - - - -
- -
- - - - - - - - - - - - -
- -
- - - - - - - - - - - - - - - - - - -
- -
- - - - 'one', - 2 => 'two', - 3 => 'three', - 4 => 'four', - 5 => 'six', - ); - switch ( intval( $child_field['type'] ) ) { - case 1: - case 2: - case 3: - case 4: - case 5: - ob_start(); - ?> -
-
- - - $value ) { - $str_output .= $this->getChildren_genCol( $child_field['type'], $key, $value['cols'] ); - if ( $count_str === $count_total ) { - $fcontainer_class = ''; - } else { - $fcontainer_class = 'rkfm-bend-fcontainer-wrap'; - } - ob_start(); - ?> -
- - $value2 ) { - // get field - $get_data = array(); - // $str_output.='
'; - if ( isset( $value2['iscontainer'] ) && intval( $value2['iscontainer'] ) === 1 ) { - $get_data = $this->generate_admin_form_getChildren( $value2 ); - $str_output .= $get_data['output_html']; - - } else { - $get_data = $this->generate_previewpanel_getField( $value2 ); - $str_output .= $get_data['output_html']; - - } - } - } - $str_output .= '
'; - $str_output .= '
'; - $count_str++; - } - } - } else { - $str_output .= $this->getChildren_innerGrid( $child_field['type'] ); - } - ob_start(); - ?> - - -
- load->view('formbuilder/fields/templates/prevpanel_quickopts2',array(), true); ?> -
-
- -
-
-
-
-
-
-
-
-
-
-
- - $value ) { - - if ( ! empty( $value['children'] ) ) { - foreach ( $value['children'] as $key2 => $value2 ) { - // get field - $get_data = array(); - - if ( isset( $value2['iscontainer'] ) && intval( $value2['iscontainer'] ) === 1 ) { - $get_data = $this->generate_admin_form_getChildren( $value2 ); - $str_output .= $get_data['output_html']; - - } else { - $get_data = $this->generate_previewpanel_getField( $value2 ); - $str_output .= $get_data['output_html']; - - } - } - } - - $count_str++; - } - } - } - ob_start(); - ?> -
- -
-
-
-
-
- -
-
- - = 0 ) { - $str_output .= '
'; - $str_output .= '
'; - $str_output .= '
'; - $count_str = 0; - if ( isset( $child_field['inner'] ) ) { - foreach ( $child_field['inner'] as $key => $value ) { - $str_output .= '
'; - if ( $count_str === $key ) { - $str_output .= '
'; - } else { - $str_output .= '
'; - } - if ( ! empty( $value['children'] ) ) { - foreach ( $value['children'] as $key2 => $value2 ) { - // get field - $get_data = array(); - $str_output .= '
'; - if ( isset( $value2['iscontainer'] ) && intval( $value2['iscontainer'] ) === 1 ) { - $get_data = $this->generate_form_getChildren( $value2 ); - $str_output .= $get_data['output_html']; - $str_output_2 .= $get_data['output_css']; - } else { - $get_data = $this->generate_form_getField( $value2 ); - $str_output .= $get_data['output_html']; - $str_output_2 .= $get_data['output_css']; - } - $str_output .= '
'; - } - } - $str_output .= '
'; - $str_output .= '
'; - } - } - $str_output .= '
'; - $str_output .= '
'; - $str_output .= '
'; - } - - $data = array(); - $data = $this->gen_post_src[ $child_field['num_tab'] ][ $child_field['id'] ]; - $str_output_2 .= modules::run( 'formbuilder/fields/posthtml_gridsystem_css', $data ); - - break; - case 31: - /*panel*/ - $temp_str_output = ''; - if ( isset( $child_field['count_children'] ) && intval( $child_field['count_children'] ) > 0 ) { - $count_str = 0; - if ( isset( $child_field['inner'] ) ) { - foreach ( $child_field['inner'] as $key => $value ) { - - if ( ! empty( $value['children'] ) ) { - foreach ( $value['children'] as $key2 => $value2 ) { - // get field - $get_data = array(); - - if ( isset( $value2['iscontainer'] ) && intval( $value2['iscontainer'] ) === 1 ) { - $get_data = $this->generate_form_getChildren( $value2 ); - $temp_str_output .= $get_data['output_html']; - $str_output_2 .= $get_data['output_css']; - } else { - $get_data = $this->generate_form_getField( $value2 ); - $temp_str_output .= $get_data['output_html']; - $str_output_2 .= $get_data['output_css']; - } - } - } - } - } - } - - $temp_content = ''; - $data_tmp = array(); - $data_tmp = $this->current_data_form[ intval( $child_field['num_tab'] ) ][ $child_field['id'] ]; - $temp_content = $this->load->view( 'formbuilder/fields/formhtml_panelfld', $data_tmp, true ); - $str_output .= str_replace( '[[%%fields%%]]', $temp_str_output, $temp_content ); - $str_output_2 .= $this->load->view( 'formbuilder/fields/formhtml_panelfld_css', $data_tmp, true ); - break; - default: - break; - } - $return = array(); - $return['output_html'] = $str_output; - $return['output_css'] = $str_output_2; - - return $return; - } - - protected function generate_admin_form_getChildren( $child_field ) { - $str_output = ''; - $str_output_2 = ''; - - $grid_order = array( - 1 => 'one', - 2 => 'two', - 3 => 'three', - 4 => 'four', - 5 => 'five', - 6 => 'six', - ); - - switch ( intval( $child_field['type'] ) ) { - case 1: - case 2: - case 3: - case 4: - case 5: - if ( intval( $child_field['count_children'] ) >= 0 ) { - - ob_start(); - ?> -
-
-
- $value ) { - - // controling 12 cols - $tmp_col_rest2 = $tmp_col_rest - abs( $value['cols'] ); - if ( $tmp_col_rest2 < 12 && $tmp_col_rest2 > 0 ) { - - $tmp_col = abs( $value['cols'] ); - $tmp_col_rest = $tmp_col_rest2; - - } else { - $tmp_col = $tmp_col_rest; - } - - $str_output .= '
'; - $str_output .= '
'; - - if ( ! empty( $value['children'] ) ) { - foreach ( $value['children'] as $key2 => $value2 ) { - // get field - $get_data = array(); - - if ( isset( $value2['iscontainer'] ) && intval( $value2['iscontainer'] ) === 1 ) { - $get_data = $this->generate_admin_form_getChildren( $value2 ); - $str_output .= $get_data['output_html']; - } else { - $get_data = $this->generate_previewpanel_getField( $value2 ); - $str_output .= $get_data['output_html']; - } - } - } - - $str_output .= '
'; - - if ( $count_str < $count_total ) { - ob_start(); - ?> -
-
-
-
-
- -
- '; - $count_str++; - } - } - - ob_start(); - ?> -
-
-
- -
-
-
-
-
-
-
-
-
-
-
- - $value ) { - - if ( ! empty( $value['children'] ) ) { - foreach ( $value['children'] as $key2 => $value2 ) { - // get field - $get_data = array(); - - if ( isset( $value2['iscontainer'] ) && intval( $value2['iscontainer'] ) === 1 ) { - $get_data = $this->generate_admin_form_getChildren( $value2 ); - $str_output .= $get_data['output_html']; - - } else { - $get_data = $this->generate_previewpanel_getField( $value2 ); - $str_output .= $get_data['output_html']; - - } - } - } - - $count_str++; - } - } - } - ob_start(); - ?> -
- -
-
-
-
-
- -
-
- 1 ) { - $data1 = array(); - $data1['tab_title'] = $this->current_data_steps['tab_title']; - $data1['tab_theme'] = $this->current_data_wizard; - $data['form_tab_head'] = $this->load->view( 'formbuilder/forms/formhtml_tabheader', $data1, true ); - $data2 = array(); - $data['form_tab_footer'] = $this->load->view( 'formbuilder/forms/formhtml_tabfooter', $data2, true ); - } - - $data['tab_count'] = $numtab; - $data['form_content'] = $str_output; - $data['form_sticky_content'] = $this->generate_form_sticky(); - $data['form_id'] = $id; - $data['wizard'] = $this->current_data_wizard; - $data['onsubm'] = $this->current_data_onsubm; - $data['main'] = $this->current_data_main; - $data['clogic'] = $this->saveform_clogic; - $data['summbox'] = $this->current_data_summbox; - $data['calculation'] = $this->current_data_calculation; - return $this->load->view( 'formbuilder/forms/formhtml_form', $data, true ); - } - - public function generate_admin_form_container( $id, $numtab, $str_output ) { - - } - - /** - * Forms::generate_previewpanel_container() - * - * @return - */ - public function generate_previewpanel_container( $id, $numtab, $str_output ) { - $data = array(); - if ( intval( $numtab ) > 1 ) { - $data1 = array(); - $data1['tab_title'] = $this->current_data_steps['tab_title']; - $data1['tab_theme'] = $this->current_data_wizard; - $data['form_tab_head'] = $this->load->view( 'formbuilder/forms/previewpanel_tabheader', $data1, true ); - $data2 = array(); - $data['form_tab_footer'] = $this->load->view( 'formbuilder/forms/previewpanel_tabfooter', $data2, true ); - } - $data['tab_count'] = $numtab; - $data['form_content'] = $str_output; - $data['form_id'] = $id; - $data['wizard'] = $this->current_data_wizard; - $data['onsubm'] = $this->current_data_onsubm; - $data['main'] = $this->current_data_main; - $data['clogic'] = $this->saveform_clogic; - $data['summbox'] = $this->current_data_summbox; - return $this->load->view( 'formbuilder/forms/previewpanel_form', $data, true ); - } - - /** - * Forms::generate_previewpanel_tabContent() - * - * @return - */ - public function generate_previewpanel_tabContent( $tab_cont_num, $tabindex, $str_output ) { - $output = ''; - $data = array(); - $data['tabindex'] = $tabindex; - $data['tab_html_fields'] = $str_output; - // if (intval($tab_cont_num) > 1) { - // apply function - $output .= $this->load->view( 'formbuilder/forms/previewpanel_tabcontainer', $data, true ); - /* - } else { - $output.=$str_output; - } */ - return $output; - } - - /** - * Forms::generate_form_tabContent() - * - * @return - */ - public function generate_form_tabContent( $tab_cont_num, $tabindex, $str_output ) { - $output = ''; - $data = array(); - $data['tabindex'] = $tabindex; - $data['tab_html_fields'] = $str_output; - if ( intval( $tab_cont_num ) > 1 ) { - // apply function - $output .= $this->load->view( 'formbuilder/forms/formhtml_tabcontainer', $data, true ); - } else { - $output .= $str_output; - } - return $output; - } - - - public function generate_admin_form_tabContent( $tab_cont_num, $tabindex, $str_output ) { - $output = ''; - $data = array(); - $data['tabindex'] = $tabindex; - $data['tab_html_fields'] = $str_output; - if ( intval( $tab_cont_num ) > 1 ) { - // apply function - $output .= self::render_template( 'formbuilder/views/forms/formhtml_tabcontainer.php', $data, 'always' ); - } else { - $output .= $str_output; - } - return $output; - } - - /** - * Forms::save_form_clogic() - * - * @return - */ - public function save_form_clogic() { - $clogic_src = $this->saveform_clogic; - if ( ! empty( $clogic_src ) ) { - // get fires - $fields_fire = array(); - foreach ( $clogic_src['cond'] as $key => $value ) { - foreach ( $value['list'] as $key2 => $value2 ) { - if ( ! empty( $value2 ) ) { - if ( ! isset( $fields_fire[ $value2['field_fire'] ]['list'][ $value['field_cond'] ] ) ) { - $fields_fire[ $value2['field_fire'] ]['list'][] = $value['field_cond']; - } - } else { - unset( $clogic_src['cond'][ $key ]['list'][ $key2 ] ); - } - } - } - $this->saveform_clogic = $clogic_src; - // field fires - $logic_field_fire = array(); - foreach ( $fields_fire as $key => $value ) { - $temp_logic = array(); - $temp_logic['field_fire'] = $key; - $tmp_list = array(); - foreach ( $value['list'] as $value2 ) { - $tmp_list[] = array( 'field_cond' => $value2 ); - } - $temp_logic['list'] = $tmp_list; - $logic_field_fire[ $key ] = $temp_logic; - } - - $clogic_src['fire'] = $logic_field_fire; - $this->saveform_clogic = $clogic_src; - } - } - - /** - * Forms::save_data_fields() - * - * @return - */ - public function save_data_fields( $form_id = null ) { - - /* check for enabled field for reports */ - $check_rec_querys = $this->model_fields->queryGetQtyFieldsEnabled( $form_id ); - if ( intval( $check_rec_querys ) === 1 ) { - - // getting ones enabled for showing on list records - $tmp_query_list = array(); - $rec_querys_list = $this->model_fields->queryGetListFieldsEnabled( $form_id ); - foreach ( $rec_querys_list as $value ) { - $tmp_query_list[] = $value->fmf_uniqueid; - - } - // storing rec orders - $tmp_recorder_list = array(); - $rec_querys_list = $this->model_fields->queryGetListFieldsById( $form_id ); - foreach ( $rec_querys_list as $value ) { - - $tmp_recorder_list[ $value->fmf_uniqueid ] = $value->order_rec; - } - } - - // deleting form - $this->db->where( 'form_fmb_id', $form_id )->delete( $this->model_fields->table ); - // creating again - $data_form = $this->model_forms->getFormById( $form_id ); - $fmb_data = json_decode( $data_form->fmb_data, true ); - // $tab_cont=$fmb_data['steps']['tab_cont']; - $steps_src = $fmb_data['steps_src']; - - $set_rec_querys = 0; - if ( ! empty( $steps_src ) ) { - foreach ( $steps_src as $tabindex => $fields ) { - if ( ! empty( $fields ) ) { - foreach ( $fields as $key => $value ) { - $data = array(); - $data['fmf_uniqueid'] = $value['id']; - switch ( intval( $value['type'] ) ) { - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 15: - case 16: - case 17: - case 18: - case 21: - case 22: - case 23: - case 24: - case 25: - case 26: - case 28: - case 29: - case 30: - case 40: - case 41: - case 42: - // assign selected fields to the report - if ( intval( $check_rec_querys ) === 0 && $set_rec_querys < 5 ) { - $data['fmf_status_qu'] = 1; - $set_rec_querys++; - } elseif ( intval( $check_rec_querys ) === 1 ) { - if ( in_array( $value['id'], $tmp_query_list ) ) { - $data['fmf_status_qu'] = 1; - } - } - $data['fmf_fieldname'] = $value['field_name']; - $data['order_frm'] = $value['order_frm']; - - if ( isset( $tmp_recorder_list[ $value['id'] ] ) && intval( $tmp_recorder_list[ $value['id'] ] ) > 0 ) { - $data['order_rec'] = $tmp_recorder_list[ $value['id'] ]; - } else { - $data['order_rec'] = $value['order_frm']; - } - break; - case 19: - case 20: - case 27: - // asigning order to fields - $data['order_frm'] = $value['order_frm']; - break; - } - - $data['fmf_data'] = json_encode( $value ); - $data['type_fby_id'] = $value['type']; - $data['form_fmb_id'] = $form_id; - /* clean previous field */ - - $this->db->set( $data ); - $this->db->insert( $this->model_fields->table ); - - if ( isset( $value['clogic'] ) && intval( $value['clogic']['show_st'] ) === 1 ) { - $tmp_clogic = array(); - $tmp_clogic['field_cond'] = $value['id']; - $tmp_clogic['action'] = $value['clogic']['f_show']; - - foreach ( $value['clogic']['list'] as $key2 => $value2 ) { - if ( empty( $value2 ) ) { - unset( $value['clogic']['list'][ $key2 ] ); - } - } - $tmp_clogic['list'] = array_filter( $value['clogic']['list'] ); - $tmp_clogic['req_match'] = ( intval( $value['clogic']['f_all'] ) === 1 ) ? count( $value['clogic']['list'] ) : 1; - $this->saveform_clogic['cond'][] = $tmp_clogic; - } - } - } - } - } - } - - /** - * Forms::generate_form_html() - * - * @return - */ - public function generate_form_html( $form_id = null ) { - /* - $data_form = $this->model_forms->getFormById($form_id); - $fmb_data = json_decode($data_form->fmb_data, true);*/ - // all fields position - $tab_cont = $this->current_data_tab_cont; - $this->gen_post_src = $this->current_data_form; - $tab_cont_num = $this->current_data_num_tabs; - // generating - - $str_output_2 = ''; - $str_output_tab = ''; - foreach ( $tab_cont as $key => $value ) { - // tabs - $str_output = ''; - if ( ! empty( $value['content'] ) ) { - foreach ( $value['content'] as $key2 => $value2 ) { - $get_data = array(); - - // fields - if ( isset( $value2['iscontainer'] ) && intval( $value2['iscontainer'] ) === 1 ) { - $get_data = $this->generate_form_getChildren( $value2 ); - $str_output .= $get_data['output_html']; - $str_output_2 .= $get_data['output_css']; - } else { - - $get_data = $this->generate_form_getField( $value2 ); - $str_output .= $get_data['output_html']; - $str_output_2 .= $get_data['output_css']; - } - } - } - - // set tab container - $str_output_tab .= $this->generate_form_tabContent( $tab_cont_num, $key, $str_output ); - // jump if it is one - if ( intval( $tab_cont_num ) === 1 ) { - break 1; - } - } - - // generate form css - $str_output_2 .= $this->generate_form_css( $form_id ); - if ( $tab_cont_num > 1 ) { - $str_output_2 .= $this->generate_form_tab_css( $form_id ); - } - - $return = array(); - $return['output_html'] = $this->generate_form_container( $form_id, $tab_cont_num, $str_output_tab ); - $return['output_css'] = $str_output_2; - - return $return; - } - - - public function generate_admin_form_html( $form_id = null ) { - $data_form = $this->model_forms->getFormById( $form_id ); - if ( empty( $data_form ) ) { - return; - } - $fmb_data = json_decode( $data_form->fmb_data, true ); - // all fields position - $tab_cont = $fmb_data['steps']['tab_cont']; - - // generating - - $str_output_tab = ''; - $tab_cont_num = $fmb_data['num_tabs']; - - if ( ! empty( $tab_cont ) ) { - foreach ( $tab_cont as $key => $value ) { - // tabs - $str_output = ''; - if ( ! empty( $value['content'] ) ) { - foreach ( $value['content'] as $key2 => $value2 ) { - $get_data = array(); - - // fields - if ( isset( $value2['iscontainer'] ) && intval( $value2['iscontainer'] ) === 1 ) { - $get_data = $this->generate_admin_form_getChildren( $value2 ); - $str_output .= $get_data['output_html']; - - } else { - $get_data = $this->generate_previewpanel_getField( $value2 ); - $str_output .= $get_data['output_html']; - } - } - } - - // set tab container - $str_output_tab .= $this->generate_previewpanel_tabContent( $tab_cont_num, $key, $str_output ); - // jump if it is one - if ( intval( $tab_cont_num ) === 1 ) { - break 1; - } - } - } else { - // set tab container - $str_output_tab .= $this->generate_previewpanel_tabContent( 0, 0, '' ); - } - - $return = array(); - $return['output_html'] = $this->generate_previewpanel_container( $form_id, $tab_cont_num, $str_output_tab ); - - return $return['output_html']; - } - - - - /** - * Forms::generate_previewpanel_html() - * - * @return - */ - public function generate_previewpanel_html( $data ) { - - $fmb_data = $data['fmb_data']; - // all fields position - $tab_cont = $fmb_data['steps']['tab_cont']; - // all data fields - $steps_src = $fmb_data['steps_src']; - $this->current_data_form = $steps_src; - $this->current_data_steps = $fmb_data['steps']; - $this->current_data_skin = $fmb_data['skin']; - $this->current_data_wizard = ( $fmb_data['wizard'] ) ? $fmb_data['wizard'] : array(); - $this->current_data_onsubm = ( $fmb_data['onsubm'] ) ? $fmb_data['onsubm'] : array(); - $this->current_data_main = ( $fmb_data['main'] ) ? $fmb_data['main'] : array(); - // generating - - $str_output_tab = ''; - $tab_cont_num = $fmb_data['num_tabs']; - - if ( ! empty( $tab_cont ) ) { - foreach ( $tab_cont as $key => $value ) { - // tabs - $str_output = ''; - if ( ! empty( $value['content'] ) ) { - foreach ( $value['content'] as $key2 => $value2 ) { - $get_data = array(); - // fields - if ( isset( $value2['iscontainer'] ) && intval( $value2['iscontainer'] ) === 1 ) { - // $get_data = $this->generate_previewpanel_getChildren($value2); - - $get_data = $this->generate_admin_form_getChildren( $value2 ); - - $str_output .= $get_data['output_html']; - } else { - $get_data = $this->generate_previewpanel_getField( $value2 ); - $str_output .= $get_data['output_html']; - - } - } - } - - // set tab container - $str_output_tab .= $this->generate_previewpanel_tabContent( $tab_cont_num, $key, $str_output ); - // jump if it is one - if ( intval( $tab_cont_num ) === 1 ) { - break 1; - } - } - } else { - // there nos data - // set tab container - $str_output_tab .= $this->generate_previewpanel_tabContent( 0, 0, '' ); - } - - $return = array(); - $return['output_html'] = $this->generate_previewpanel_container( null, $str_output_tab, $str_output_tab ); - - return $return; - } - - /** - * Forms::export_form() - * - * @return - */ - public function export_form() { - $data = array(); - $data['list_forms'] = $this->model_forms->getListForms(); - $this->template->loadPartial( 'layout', 'forms/export_form', $data ); - } - - /** - * Forms::ajax_load_export_form() - * - * @return - */ - public function ajax_load_export_form() { - $form_id = ( isset( $_POST['form_id'] ) && $_POST['form_id'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['form_id'] ) : 0; - $data_form = $this->model_forms->getFormById( $form_id ); - $data_exp = array(); - $data_exp['fmb_data'] = $data_form->fmb_data; - $data_exp['fmb_html_backend'] = $data_form->fmb_html_backend; - $data_exp['fmb_name'] = $data_form->fmb_name; - $data_exp['fmb_rec_tpl_html'] = $data_form->fmb_rec_tpl_html; - $data_exp['fmb_inv_tpl_html'] = $data_form->fmb_inv_tpl_html; - $data_exp['fmb_rec_tpl_st'] = $data_form->fmb_rec_tpl_st; - $data_exp['fmb_inv_tpl_st'] = $data_form->fmb_inv_tpl_st; - $code_export = Uiform_Form_Helper::base64url_encode( serialize( $data_exp ) ); - echo $code_export; - die(); - } - - /** - * Forms::generate_form_css() - * - * @return - */ - public function generate_form_css( $form_id = null ) { - $data = array(); - $data['idform'] = $form_id; - $data['skin'] = $this->current_data_skin; - return $this->load->view( 'formbuilder/forms/formhtml_css_form', $data, true ); - } - - public function generate_form_sticky() { - $data = array(); - $data['summbox'] = $this->current_data_summbox; - return $this->load->view( 'formbuilder/forms/formhtml_sticky', $data, true ); - } - - /** - * Forms::generate_form_tab_css() - * - * @return - */ - public function generate_form_tab_css( $form_id = null ) { - $data = array(); - $data['idform'] = $form_id; - $data['wizard'] = $this->current_data_wizard; - return $this->load->view( 'formbuilder/forms/formhtml_css_wizard', $data, true ); - } - - /** - * Forms::ajax_load_form() - * - * @return - */ - public function ajax_load_form() { - $json = array(); - $form_id = ( isset( $_POST['form_id'] ) ) ? Uiform_Form_Helper::sanitizeInput( trim( $_POST['form_id'] ) ) : ''; - - $data_form = $this->model_forms->getFormById( $form_id ); - $data_form->fmb_data = json_decode( $data_form->fmb_data ); - $json['data'] = $data_form; - - // temp - $tmp_addon_names = $this->model_addon->getActiveAddonsNamesOnBack( $form_id ); - - $tmp_addon = array(); - - foreach ( $tmp_addon_names as $key => $value ) { - $tmp_data = $this->model_addon_details->getAddonDataByForm( $value, $form_id ); - if ( ! empty( $tmp_data ) ) { - $tmp_addon[ $value ] = json_decode( $tmp_data->adet_data, true ); - } - } - - $json['addons'] = $tmp_addon; - - header( 'Content-Type: application/json' ); - echo json_encode( $json ); - die(); - } - - /** - * Forms::list_uiforms() - * - * @return - */ - public function list_uiforms( $offset = 0 ) { - - $filter_data = get_option( 'zgfm_listform_searchfilter', true ); - - $data2 = array(); - if ( empty( $filter_data ) ) { - $data2['per_page'] = intval( $this->per_page ); - $data2['search_txt'] = ''; - $data2['orderby'] = 'asc'; - } else { - $data2['per_page'] = isset($filter_data['per_page'])?intval( $filter_data['per_page'] ):'5'; - $data2['search_txt'] = isset($filter_data['search_txt'])?$filter_data['search_txt']:''; - $data2['orderby'] = isset($filter_data['orderby'])?$filter_data['orderby']:''; - } - - $offset = ( isset( $_GET['offset'] ) ) ? Uiform_Form_Helper::sanitizeInput( $_GET['offset'] ) : 0; - $data2['offset'] = $offset; - - $form_data = $this->model_forms->ListTotals(); - - $data2['all'] = $form_data->r_all; - $data2['trash'] = $form_data->r_trash; - $data2['subcurrent'] = 1; - $data2['subsubsub'] = List_data::get()->subsubsub( $data2 ); - - $this->template->loadPartial( 'layout', 'forms/list_forms', $data2 ); - } - - - - /** - * Show trash list - * - * @return void - */ - public function list_trash() { - - $filter_data = get_option( 'zgfm_listform_searchfilter', true ); - $data2 = array(); - if ( empty( $filter_data ) ) { - $data2['per_page'] = intval( $this->per_page ); - $data2['orderby'] = 'asc'; - } else { - $data2['per_page'] = intval( $filter_data['per_page']??'' ); - $data2['orderby'] = $filter_data['orderby']??''; - } - - $offset = ( isset( $_GET['offset'] ) ) ? Uiform_Form_Helper::sanitizeInput( $_GET['offset'] ) : 0; - $data2['offset'] = $offset; - - $form_data = $this->model_forms->ListTotals(); - $data2['title'] = __( 'Forms in trash', 'FRocket_admin' ); - $data2['all'] = $form_data->r_all; - $data2['trash'] = $form_data->r_trash; - $data2['header_buttons'] = List_data::get()->list_detail_form_headerbuttons(); - $data2['script_trigger'] = 'zgfm_back_general.formslist_trashsearch_process();'; - $data2['subcurrent'] = 2; - $data2['subsubsub'] = List_data::get()->subsubsub( $data2 ); - - $content = List_data::get()->show_list( $data2 ); - //echo self::loadPartial2( 'layout.php', $content); - echo $this->template->loadPartial2( 'layout', $content ); - } - - - /** - * List trash forms - * - * @return void - */ - function ajax_trashformlist_sendfilter() { - - $data_filter = ( isset( $_POST['data_filter'] ) && $_POST['data_filter'] ) ? $_POST['data_filter'] : ''; - - $opt_save = ( isset( $_POST['opt_save'] ) && $_POST['opt_save'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['opt_save'] ) : 0; - $opt_offset = ( isset( $_POST['opt_offset'] ) && $_POST['opt_offset'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['opt_offset'] ) : 0; - - parse_str( $data_filter, $data_filter_arr ); - - $per_page = $data_filter_arr['zgfm-listform-pref-perpage']; - $orderby = $data_filter_arr['zgfm-listform-pref-orderby']; - - $data = array(); - $data['per_page'] = $per_page; - $data['orderby'] = $orderby; - - if ( intval( $opt_save ) === 1 ) { - update_option( 'zgfm_listform_trash', $data ); - } - - $data['segment'] = 0; - $data['offset'] = $opt_offset; - - $result = $this->ajax_trashformlist_refresh( $data ); - - $json = array(); - $json['content'] = $result; - - header( 'Content-Type: application/json' ); - echo json_encode( $json ); - die(); - } - - /** - * get forms in trash - * - * @param [type] $data - * @return void - */ - function ajax_trashformlist_refresh( $data ) { - - $this->load->library( 'pagination' ); - - $offset = $data['offset']; - - // list all forms - $config = array(); - $config['base_url'] = site_url() . 'formbuilder/forms/list_trash'; - - $tmp = $this->model_forms->ListTotals(); - $config['total_rows'] = $tmp->r_trash; - $config['per_page'] = $data['per_page']; - $config['first_link'] = 'First'; - $config['last_link'] = 'Last'; - $config['full_tag_open'] = '
    '; - $config['full_tag_close'] = '
'; - $config['first_tag_open'] = '
  • '; - $config['first_tag_close'] = '
  • '; - $config['last_tag_open'] = '
  • '; - $config['last_tag_close'] = '
  • '; - $config['cur_tag_open'] = '
  • '; - $config['cur_tag_close'] = '
  • '; - $config['next_tag_open'] = '
  • '; - $config['next_tag_close'] = '
  • '; - $config['prev_tag_open'] = '
  • '; - $config['prev_tag_close'] = '
  • '; - $config['num_tag_open'] = '
  • '; - $config['num_tag_close'] = '
  • '; - $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; - - $data2 = array(); - $data2['per_page'] = $data['per_page']; - $data2['segment'] = $offset; - $data2['orderby'] = $data['orderby']; - $data2['query'] = $this->model_forms->getListTrashFormsFiltered( $data2 ); - $data2['pagination'] = $this->pagination->create_links(); - $data2['obj_list_data'] = List_data::get(); - $data2['is_trash'] = 1; - - //$data2['list_buttons'] = List_data::get()->list_detail_form_buttons(); - ///$content=List_data::get()->list_detail($data3); - return List_data::get()->list_detail( $data2 ); - - //return self::render_template( 'formbuilder/views/forms/list_forms_table.php', $data3 ); - } - - /** - * list forms - * - * @return void - */ - function ajax_formlist_sendfilter() { - - $data_filter = ( isset( $_POST['data_filter'] ) && $_POST['data_filter'] ) ? $_POST['data_filter'] : ''; - - $opt_save = ( isset( $_POST['opt_save'] ) && $_POST['opt_save'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['opt_save'] ) : 0; - $opt_offset = ( isset( $_POST['opt_offset'] ) && $_POST['opt_offset'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['opt_offset'] ) : 0; - - parse_str( $data_filter, $data_filter_arr ); - - $per_page = isset( $data_filter_arr['zgfm-listform-pref-perpage'] ) ? $data_filter_arr['zgfm-listform-pref-perpage'] : ''; - $search_txt = isset( $data_filter_arr['zgfm-listform-pref-search'] ) ? $data_filter_arr['zgfm-listform-pref-search'] : ''; - $orderby = isset( $data_filter_arr['zgfm-listform-pref-orderby'] ) ? $data_filter_arr['zgfm-listform-pref-orderby'] : ''; - - $data = array(); - $data['per_page'] = $per_page; - $data['search_txt'] = $search_txt; - $data['orderby'] = $orderby; - - if ( intval( $opt_save ) === 1 ) { - update_option( 'zgfm_listform_searchfilter', $data ); - } - - $data['segment'] = 0; - $data['offset'] = $opt_offset; - - // self::$_models['formbuilder']['form']->getListFormsFiltered($data); - - $result = $this->ajax_formlist_refresh( $data ); - - $json = array(); - $json['content'] = $result; - - header( 'Content-Type: application/json' ); - echo json_encode( $json ); - die(); - } - - function ajax_formlist_refresh( $data ) { - - $this->load->library( 'pagination' ); - - $offset = $data['offset']; - - // list all forms - $config = array(); - $config['base_url'] = site_url() . 'formbuilder/forms/list_uiforms'; - $config['total_rows'] = $this->model_forms->CountForms(); - $config['per_page'] = $data['per_page']; - $config['first_link'] = 'First'; - $config['last_link'] = 'Last'; - $config['full_tag_open'] = '
      '; - $config['full_tag_close'] = '
    '; - $config['first_tag_open'] = '
  • '; - $config['first_tag_close'] = '
  • '; - $config['last_tag_open'] = '
  • '; - $config['last_tag_close'] = '
  • '; - $config['cur_tag_open'] = '
  • '; - $config['cur_tag_close'] = '
  • '; - $config['next_tag_open'] = '
  • '; - $config['next_tag_close'] = '
  • '; - $config['prev_tag_open'] = '
  • '; - $config['prev_tag_close'] = '
  • '; - $config['num_tag_open'] = '
  • '; - $config['num_tag_close'] = '
  • '; - $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; - - $data2 = array(); - $data2['per_page'] = $data['per_page']; - $data2['segment'] = $offset; - $data2['search_txt'] = $data['search_txt']; - $data2['orderby'] = $data['orderby']; - - $data3 = array(); - $data3['query'] = $this->model_forms->getListFormsFiltered( $data2 ); - $data3['pagination'] = $this->pagination->create_links(); - return $this->load->view( 'formbuilder/forms/list_forms_table', $data3, true ); - - } - - - /** - * Forms::edit_uiform() - * - * @return - */ - public function edit_uiform() { - $data = array(); - echo $this->load->view( 'formbuilder/forms/edit_form', $data, true ); - } - - /** - * Forms::create_uiform() - * - * @return - */ - 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; - $data['action'] = 'create_uiform'; - $data['obj_sfm'] = Uiform_Form_Helper::get_font_library(); - - if ( intval( $data['form_id'] ) > 0 ) { - - $formdata = $this->model_forms->getFormById( $data['form_id'] ); - - /* - * delete after a month - $data['uifm_frm_invoice_tpl_enable']=$formdata->fmb_inv_tpl_st; - $data['uifm_frm_invoice_tpl_content']=$formdata->fmb_inv_tpl_html; - $data['uifm_frm_record_tpl_enable']=$formdata->fmb_rec_tpl_st; - $data['uifm_frm_record_tpl_content']=$formdata->fmb_rec_tpl_html;*/ - } - $data['addons_actions'] = self::$_addons_actions; - $pdf_paper_size = array( - '4a0' => array( 0, 0, 4767.87, 6740.79 ), - '2a0' => array( 0, 0, 3370.39, 4767.87 ), - 'a0' => array( 0, 0, 2383.94, 3370.39 ), - 'a1' => array( 0, 0, 1683.78, 2383.94 ), - 'a2' => array( 0, 0, 1190.55, 1683.78 ), - 'a3' => array( 0, 0, 841.89, 1190.55 ), - 'a4' => array( 0, 0, 595.28, 841.89 ), - 'a5' => array( 0, 0, 419.53, 595.28 ), - 'a6' => array( 0, 0, 297.64, 419.53 ), - 'a7' => array( 0, 0, 209.76, 297.64 ), - 'a8' => array( 0, 0, 147.40, 209.76 ), - 'a9' => array( 0, 0, 104.88, 147.40 ), - 'a10' => array( 0, 0, 73.70, 104.88 ), - 'b0' => array( 0, 0, 2834.65, 4008.19 ), - 'b1' => array( 0, 0, 2004.09, 2834.65 ), - 'b2' => array( 0, 0, 1417.32, 2004.09 ), - 'b3' => array( 0, 0, 1000.63, 1417.32 ), - 'b4' => array( 0, 0, 708.66, 1000.63 ), - 'b5' => array( 0, 0, 498.90, 708.66 ), - 'b6' => array( 0, 0, 354.33, 498.90 ), - 'b7' => array( 0, 0, 249.45, 354.33 ), - 'b8' => array( 0, 0, 175.75, 249.45 ), - 'b9' => array( 0, 0, 124.72, 175.75 ), - 'b10' => array( 0, 0, 87.87, 124.72 ), - 'c0' => array( 0, 0, 2599.37, 3676.54 ), - 'c1' => array( 0, 0, 1836.85, 2599.37 ), - 'c2' => array( 0, 0, 1298.27, 1836.85 ), - 'c3' => array( 0, 0, 918.43, 1298.27 ), - 'c4' => array( 0, 0, 649.13, 918.43 ), - 'c5' => array( 0, 0, 459.21, 649.13 ), - 'c6' => array( 0, 0, 323.15, 459.21 ), - 'c7' => array( 0, 0, 229.61, 323.15 ), - 'c8' => array( 0, 0, 161.57, 229.61 ), - 'c9' => array( 0, 0, 113.39, 161.57 ), - 'c10' => array( 0, 0, 79.37, 113.39 ), - 'ra0' => array( 0, 0, 2437.80, 3458.27 ), - 'ra1' => array( 0, 0, 1729.13, 2437.80 ), - 'ra2' => array( 0, 0, 1218.90, 1729.13 ), - 'ra3' => array( 0, 0, 864.57, 1218.90 ), - 'ra4' => array( 0, 0, 609.45, 864.57 ), - 'sra0' => array( 0, 0, 2551.18, 3628.35 ), - 'sra1' => array( 0, 0, 1814.17, 2551.18 ), - 'sra2' => array( 0, 0, 1275.59, 1814.17 ), - 'sra3' => array( 0, 0, 907.09, 1275.59 ), - 'sra4' => array( 0, 0, 637.80, 907.09 ), - 'letter' => array( 0, 0, 612.00, 792.00 ), - 'half-letter' => array( 0, 0, 396.00, 612.00 ), - 'legal' => array( 0, 0, 612.00, 1008.00 ), - 'ledger' => array( 0, 0, 1224.00, 792.00 ), - 'tabloid' => array( 0, 0, 792.00, 1224.00 ), - 'executive' => array( 0, 0, 521.86, 756.00 ), - 'folio' => array( 0, 0, 612.00, 936.00 ), - 'commercial #10 envelope' => array( 0, 0, 684, 297 ), - 'catalog #10 1/2 envelope' => array( 0, 0, 648, 864 ), - '8.5x11' => array( 0, 0, 612.00, 792.00 ), - '8.5x14' => array( 0, 0, 612.00, 1008.0 ), - '11x17' => array( 0, 0, 792.00, 1224.00 ), - ); - $data['pdf_paper_size'] = $pdf_paper_size; - - $data['fields_fastload'] = get_option( 'zgfm_fields_fastload', 0 ); - - // $data['modules_tab_extension']= self::$_modules['addon']['backend']->addons_doActions('back_exttab_block'); - - $data['modules_tab_extension'] = modules::run( 'addon/zfad_backend/addons_doActions', 'back_exttab_block', true ); - - $this->template->loadPartial( 'layout-editform', 'forms/create_form', $data ); - } - - /** - * Forms::preview_fields() - * - * @return - */ - public function preview_fields() { - $data = array(); - echo $this->load->view( 'formbuilder/forms/preview_fields', $data, true ); - } - - /** - * Forms::getcode() - * - * @return - */ - public function getcode() { - $data = array(); - - $id_form = ( isset( $_POST['form_id'] ) ) ? Uiform_Form_Helper::sanitizeInput( trim( $_POST['form_id'] ) ) : ''; - $query = $this->db->get_where( $this->model_forms->table, array( 'fmb_id' => $id_form ), 1 ); - if ( $query->num_rows() === 1 ) { - $data = array(); - - // get data from form - $form_data = $this->model_forms->getFormById_2( $id_form ); - $form_data_onsubm = json_decode( $form_data->fmb_data2, true ); - - $onload_scroll = ( isset( $form_data_onsubm['main']['onload_scroll'] ) ) ? $form_data_onsubm['main']['onload_scroll'] : '1'; - - $preload_noconflict = ( isset( $form_data_onsubm['main']['preload_noconflict'] ) ) ? $form_data_onsubm['main']['preload_noconflict'] : '1'; - - $temp = array(); - $temp['id_form'] = $id_form; - $temp['site_url'] = site_url(); - $temp['base_url'] = base_url(); - - $data['script'] = escape_text( $this->load->view( 'formbuilder/forms/get_code_widget', $temp, true ) ); - - $content = ''; - $content = site_url() . 'formbuilder/frontend/viewform/?form=' . $id_form; - $data['url'] = escape_text( $content ); - - $temp = array(); - $temp['url_form'] = $data['url'] . '&lmode=1'; - $temp['base_url'] = base_url(); - $temp['form_id'] = $id_form; - - $data['iframe'] = escape_text( $this->load->view( 'formbuilder/forms/get_code_iframe', $temp, true ) ); - - $json = array(); - $json['html_title'] = __( 'Shortcodes', 'FRocket_admin' ); - - $cached_content = modules::run( 'formbuilder/frontend/generate_cache', $id_form ); - - $data['cached_scripts'] = escape_text( $cached_content['scripts'] ); - $data['cached_content'] = escape_text( $cached_content['html'] ); - - $json['html'] = $this->load->view( 'formbuilder/forms/getcode', $data, true ); - // return data to ajax callback - header( 'Content-type: text/html' ); - echo json_encode( $json ); - } else { - - } - } - - /** - * Forms::form_success() - * - * @return - */ - public function form_success() { - - $data = array(); - $id_form = ( isset( $_POST['form_id'] ) ) ? Uiform_Form_Helper::sanitizeInput( trim( $_POST['form_id'] ) ) : ''; - - $query = $this->db->get_where( $this->model_forms->table, array( 'fmb_id' => $id_form ), 1 ); - if ( $query->num_rows() === 1 ) { - $data = array(); - // get data from form - $form_data = $this->model_forms->getFormById_2( $id_form ); - $form_data_onsubm = json_decode( $form_data->fmb_data2, true ); - - $onload_scroll = ( isset( $form_data_onsubm['main']['onload_scroll'] ) ) ? $form_data_onsubm['main']['onload_scroll'] : '1'; - - $preload_noconflict = ( isset( $form_data_onsubm['main']['preload_noconflict'] ) ) ? $form_data_onsubm['main']['preload_noconflict'] : '1'; - - $temp = array(); - $temp['id_form'] = $id_form; - $temp['site_url'] = site_url(); - $temp['base_url'] = base_url(); - $temp['onload_scroll'] = $onload_scroll; - $temp['preload_noconflict'] = $preload_noconflict; - - $data['script'] = escape_text( $this->load->view( 'formbuilder/forms/get_code_widget', $temp, true ) ); - $data['id_form'] = $id_form; - $content = ''; - $content = site_url() . 'formbuilder/frontend/viewform/?form=' . $id_form; - $data['url'] = escape_text( $content ); - - $temp = array(); - $temp['url_form'] = $data['url'] . '&lmode=1'; - $temp['base_url'] = base_url(); - $temp['form_id'] = $id_form; - - $data['iframe'] = escape_text( $this->load->view( 'formbuilder/forms/get_code_iframe', $temp, true ) ); - - // echo $this->load->view('formbuilder/forms/form_success', $data, true); - - $json = array(); - $json['html_title'] = __( 'Shortcodes', 'FRocket_admin' ); - $json['html'] = $this->load->view( 'formbuilder/forms/form_success', $data, true ); - - // return data to ajax callback - header( 'Content-type: text/html' ); - echo json_encode( $json ); - die(); - } else { - - } - } + public function ajax_rollback_openmodal() + { + + // check_ajax_referer( 'zgfm_ajax_nonce', 'zgfm_security' ); + + $form_id = ( isset($_POST['form_id']) ) ? Uiform_Form_Helper::sanitizeInput(trim($_POST['form_id'])) : ''; + + $data = array(); + + $query_obj = $this->model_form_log->getAvailableLogById($form_id); + + $log_array = array(); + foreach ( $query_obj as $key => $value) { + $temp = array(); + $temp['form_name'] = $value->log_frm_name; + $temp['created_date'] = date('d-m-Y h:m:s', strtotime($value->updated_date)); + $temp['log_id'] = $value->log_id; + $log_array[] = $temp; + } + + $data['logs'] = $log_array; + + $json = array(); + $json['modal_header'] = '

    ' . __('Rollback Form', 'FRocket_admin') . '

    '; + $json['modal_body'] = $this->load->view('formbuilder/forms/ajax_rollback_openmodal', $data, true); + $json['modal_footer'] = $this->load->view('formbuilder/forms/modal1_footer', $data, true); + + // return data to ajax callback + header('Content-Type: application/json'); + echo json_encode($json); + die(); + } + + + public function ajax_integrity_openmodal() + { + + // check_ajax_referer( 'zgfm_ajax_nonce', 'zgfm_security' ); + + $form_id = ( isset($_POST['form_id']) ) ? Uiform_Form_Helper::sanitizeInput(trim($_POST['form_id'])) : ''; + + $data = array(); + + $json = array(); + $json['modal_header'] = '

    ' . __('Error message', 'FRocket_admin') . '

    '; + $json['modal_body'] = $this->load->view('formbuilder/forms/ajax_integrity_openmodal', $data, true); + $json['modal_footer'] = $this->load->view('formbuilder/forms/modal1_footer', $data, true); + + // return data to ajax callback + header('Content-Type: application/json'); + echo json_encode($json); + die(); + } + + + public function ajax_variables_openmodal() + { + + $data = array(); + $form_id = ( isset($_POST['form_id']) ) ? Uiform_Form_Helper::sanitizeInput(trim($_POST['form_id'])) : ''; + $fmb_data = ( isset($_POST['form_data']) ) ? $_POST['form_data'] : ''; + $fmb_data = urldecode($fmb_data); + $fmb_data = ( isset($fmb_data) && $fmb_data ) ? array_map(array( 'Uiform_Form_Helper', 'sanitizeRecursive_html' ), json_decode($fmb_data, true)) : array(); + $data['fmb_data'] = $fmb_data; + + $json = array(); + $json['modal_header'] = '

    ' . __('Form variables', 'FRocket_admin') . '

    '; + $json['modal_body'] = $this->load->view('formbuilder/forms/ajax_variables_openmodal', $data, true); + $json['modal_footer'] = $this->load->view('formbuilder/forms/modal1_footer', $data, true); + + // return data to ajax callback + header('Content-Type: application/json'); + echo json_encode($json); + die(); + } + + public function ajax_variables_emailpage() + { + + $data = array(); + $form_id = ( isset($_POST['form_id']) ) ? Uiform_Form_Helper::sanitizeInput(trim($_POST['form_id'])) : ''; + $fmb_data = ( isset($_POST['form_data']) ) ? urldecode(Uiform_Form_Helper::sanitizeInput_html($_POST['form_data'])) : ''; + if ( ! empty($fmb_data)) { + $fmb_data = ( isset($fmb_data) && $fmb_data ) ? array_map(array( 'Uiform_Form_Helper', 'sanitizeRecursive_html' ), json_decode($fmb_data, true)) : array(); + } + + $data['fmb_data'] = $fmb_data; + + $json = array(); + $json['message'] = $this->load->view('formbuilder/forms/ajax_variables_emailpage', $data, true); + + // return data to ajax callback + header('Content-Type: application/json'); + echo json_encode($json); + die(); + } + + /** + * Forms::ajax_load_templateform() + * + * @return + */ + public function ajax_load_templateform() + { + $number = ( $_POST['number'] ) ? Uiform_Form_Helper::sanitizeInput(trim($_POST['number'])) : ''; + $fallback_file = file_get_contents(FCPATH . '/assets/backend/json/template_' . $number . '.json'); + header('Content-Type: application/json'); + echo $fallback_file; + die(); + } + + /** + * Forms::ajax_load_getthumbimg() + * + * @return + */ + public function ajax_load_getthumbimg() + { + // this function is disabled + return; + $id_img = ( $_POST['img_id'] ) ? Uiform_Form_Helper::sanitizeInput($_POST['img_id']) : ''; + $img_full = ( $_POST['img_src_full'] ) ? Uiform_Form_Helper::sanitizeInput_html($_POST['img_src_full']) : ''; + $json = array(); + $json['img_full'] = $img_full; + $json['img_thumb'] = ( ! empty($thumb[0]) ) ? $thumb[0] : $img_full; + header('Content-Type: application/json'); + echo json_encode($json); + die(); + } + + /** + * Forms::ajax_load_import_form() + * + * @return + */ + public function ajax_load_import_form() + { + $imp_form = ( isset($_POST['importcode']) && $_POST['importcode'] ) ? Uiform_Form_Helper::sanitizeInput($_POST['importcode']) : ''; + + $dump_form = unserialize(Uiform_Form_Helper::base64url_decode($imp_form)); + $data_form = array(); + $data_form['fmb_data'] = json_decode($dump_form['fmb_data']); + $data_form['fmb_html_backend'] = $dump_form['fmb_html_backend']; + $data_form['fmb_name'] = $dump_form['fmb_name']; + $data_form['fmb_rec_tpl_html'] = @$dump_form['fmb_rec_tpl_html']; + $data_form['fmb_inv_tpl_html'] = @$dump_form['fmb_inv_tpl_html']; + $data_form['fmb_rec_tpl_st'] = @$dump_form['fmb_rec_tpl_st']; + $data_form['fmb_inv_tpl_st'] = @$dump_form['fmb_inv_tpl_st']; + $json = array(); + $json['data'] = $data_form; + header('Content-Type: application/json'); + echo json_encode($json); + die(); + } + + + public function ajax_preview_clogic_graph() + { + + $saveform_clogic = array(); + + $fmb_data = ( ! empty($_POST['form_data']) ) ? $_POST['form_data'] : ''; + $fmb_data = ( ! empty($fmb_data) ) ? array_map(array( 'Uiform_Form_Helper', 'sanitizeRecursive_html' ), json_decode($fmb_data, true)) : array(); + + // creating again + $steps_src = $fmb_data['steps_src']; + $tmp_var_typename = array(); + $tmp_var_fname = array(); + $tmp_var_fstep = array(); + if ( ! empty($steps_src)) { + foreach ( $steps_src as $tabindex => $fields) { + if ( ! empty($fields)) { + foreach ( $fields as $key => $value) { + $data = array(); + $data['fmf_uniqueid'] = $value['id']; + + $data['fmf_fieldname'] = isset($value['field_name']) ? $value['field_name'] : 'not defined'; + $data['fmf_type_n'] = isset($value['type_n']) ? $value['type_n'] : 'not defined'; + + $data['type_fby_id'] = $value['type']; + + $tmp_var_typename[ $value['id'] ] = $data['fmf_type_n']; + $tmp_var_fname[ $value['id'] ] = $data['fmf_fieldname']; + $tmp_var_fstep[ $value['id'] ] = intval($tabindex) + 1; + + if ( isset($value['clogic']) && intval($value['clogic']['show_st']) === 1) { + $tmp_clogic = array(); + $tmp_clogic['field_cond'] = $value['id']; + $tmp_clogic['field_cond_fname'] = $data['fmf_fieldname']; + $tmp_clogic['field_type_n'] = $data['fmf_type_n']; + + $tmp_clogic['action'] = $value['clogic']['f_show']; + + foreach ( $value['clogic']['list'] as $key2 => $value2) { + if ( empty($value2)) { + unset($value['clogic']['list'][ $key2 ]); + } + } + $tmp_clogic['list'] = array_filter($value['clogic']['list']); + $tmp_clogic['req_match'] = ( intval($value['clogic']['f_all']) === 1 ) ? count($value['clogic']['list']) : 1; + $saveform_clogic['cond'][] = $tmp_clogic; + } + } + } + } + } + + $clogic_src = $saveform_clogic; + if ( ! empty($clogic_src)) { + // get fires + $fields_fire = array(); + foreach ( $clogic_src['cond'] as $key => $value) { + foreach ( $value['list'] as $key2 => $value2) { + if ( ! empty($value2)) { + if ( ! isset($fields_fire[ $value2['field_fire'] ]['list'][ $value['field_cond'] ])) { + $fields_fire[ $value2['field_fire'] ]['list'][] = $value['field_cond']; + } + } else { + unset($clogic_src['cond'][ $key ]['list'][ $key2 ]); + } + } + } + $saveform_clogic = $clogic_src; + // field fires + $logic_field_fire = array(); + foreach ( $fields_fire as $key => $value) { + $temp_logic = array(); + $temp_logic['field_fire'] = $key; + $temp_logic['field_fire_typen'] = isset($tmp_var_typename[ $key ]) ? $tmp_var_typename[ $key ] : 'undefined'; + $temp_logic['field_fire_fname'] = isset($tmp_var_fname[ $key ]) ? $tmp_var_fname[ $key ] : 'undefined'; + $temp_logic['field_fire_fstep'] = isset($tmp_var_fstep[ $key ]) ? $tmp_var_fstep[ $key ] : 'undefined'; + + $tmp_list = array(); + foreach ( $value['list'] as $value2) { + $tmp_list[] = array( + 'field_cond' => $value2, + 'field_cond_typen' => isset($tmp_var_typename[ $value2 ]) ? $tmp_var_typename[ $value2 ] : 'undefined', + 'field_cond_fname' => isset($tmp_var_fname[ $value2 ]) ? $tmp_var_fname[ $value2 ] : 'undefined', + 'field_cond_fstep' => isset($tmp_var_fstep[ $value2 ]) ? $tmp_var_fstep[ $value2 ] : 'undefined', + ); + } + $temp_logic['list'] = $tmp_list; + $logic_field_fire[ $key ] = $temp_logic; + } + + $clogic_src['fire'] = $logic_field_fire; + $saveform_clogic = $clogic_src; + } + + $data2 = array(); + $data2['clogic'] = $saveform_clogic; + $output = $this->load->view('formbuilder/forms/preview_clogic_graph', $data2, true); + + $json = array(); + $json['html'] = $output; + header('Content-Type: text/html; charset=UTF-8'); + echo json_encode($json); + die(); + } + + + /** + * Forms::ajax_listform_duplicate() + * + * @return + */ + public function ajax_listform_duplicate() + { + $list_ids = ( isset($_POST['id']) && $_POST['id'] ) ? array_map(array( 'Uiform_Form_Helper', 'sanitizeRecursive' ), $_POST['id']) : array(); + + if ( $list_ids) { + foreach ( $list_ids as $value) { + $data_form = $this->model_forms->getFormById($value); + $data = array(); + $data['fmb_data'] = $data_form->fmb_data; + $data['fmb_data2'] = $data_form->fmb_data2; + $data['fmb_name'] = $data_form->fmb_name . ' - copy'; + $data['fmb_html_backend'] = $data_form->fmb_html_backend; + $data['created_ip'] = $_SERVER['REMOTE_ADDR']; + $data['created_by'] = 1; + $data['created_date'] = date('Y-m-d h:i:s'); + + $this->db->set($data); + $this->db->insert($this->model_forms->table); + } + } + } + + + /** + * Forms::ajax_listform_updatest() + * + * @return + */ + public function ajax_listform_updatest() + { + $list_ids = ( isset($_POST['id']) && $_POST['id'] ) ? array_map(array( 'Uiform_Form_Helper', 'sanitizeRecursive' ), $_POST['id']) : array(); + $form_st = ( isset($_POST['form_st']) && $_POST['form_st'] ) ? Uiform_Form_Helper::sanitizeInput($_POST['form_st']) : ''; + if ( $list_ids) { + foreach ( $list_ids as $value) { + $data = array( + 'flag_status' => intval($form_st), + ); + + $this->db->set($data); + $this->db->where('fmb_id', $value); + $this->db->update($this->model_forms->table); + } + } + } + + public function ajax_list_trashform_updatest() + { + + $list_ids = ( isset($_POST['id']) && $_POST['id'] ) ? array_map(array( 'Uiform_Form_Helper', 'sanitizeRecursive' ), $_POST['id']) : array(); + $form_st = ( isset($_POST['form_st']) && $_POST['form_st'] ) ? Uiform_Form_Helper::sanitizeInput($_POST['form_st']) : ''; + if ( $list_ids) { + switch ( intval($form_st)) { + case 1: + case 2: + foreach ( $list_ids as $value) { + $data = array( + 'flag_status' => intval($form_st), + ); + + $this->db->set($data); + $this->db->where('fmb_id', $value); + $this->db->update($this->model_forms->table); + } + break; + case 0: + foreach ( $list_ids as $value) { + $this->delete_form_process($value); + } + + break; + default: + # code... + break; + } + } + } + + private function delete_form_process($value) + { + //remove from log form + $this->db->where('log_frm_id', $value); + $this->db->delete($this->model_form_log->table); + + //remove from fields + $this->db->where('form_fmb_id', $value); + $this->db->delete($this->model_fields->table); + + //remove from addons logs + $this->db->where('fmb_id', $value); + $this->db->delete($this->model_addon_details_log->table); + + //remove from addons + $this->db->where('fmb_id', $value); + $this->db->delete($this->model_addon_details->table); + + //remove pay record logs + $this->model_gateways_logs->deleteRecordbyFormId($value); + + //remove pay records + $this->model_gateways_records->deleteRecordbyFormId($value); + + //remove from records + $this->db->where('form_fmb_id', $value); + $this->db->delete($this->model_record->table); + + //remove from form + $this->db->where('fmb_id', $value); + $this->db->delete($this->model_forms->table); + } + + + /** + * delete trash form by form id + * + * @return void + */ + public function ajax_delete_trashform_byid() + { + + $form_id = ( isset($_POST['form_id']) && $_POST['form_id'] ) ? Uiform_Form_Helper::sanitizeInput($_POST['form_id']) : 0; + + $this->delete_form_process($form_id); + } + + /** + * Forms::ajax_delete_form_byid() + * + * @return + */ + public function ajax_delete_form_byid() + { + $form_id = ( isset($_POST['form_id']) && $_POST['form_id'] ) ? Uiform_Form_Helper::sanitizeInput($_POST['form_id']) : 0; + + $data = array( + 'flag_status' => 0, + ); + + $this->db->set($data); + $this->db->where('fmb_id', $form_id); + $this->db->update($this->model_forms->table); + } + + /** + * Forms::ajax_load_preview_form() + * + * @return + */ + public function ajax_load_preview_form() + { + + $form_id = ( isset($_POST['form_id']) ) ? Uiform_Form_Helper::sanitizeInput(trim($_POST['form_id'])) : ''; + header('Content-type: text/html'); + ob_start(); + + $data = array(); + $content = ''; + $content = site_url() . 'formbuilder/frontend/viewform/?form=' . $form_id; + $data['url'] = escape_text($content); + + $temp = array(); + $temp['url_form'] = $data['url'] . '&lmode=1'; + $temp['base_url'] = base_url(); + $temp['form_id'] = $form_id; + + $data['iframe'] = $this->load->view('formbuilder/forms/get_code_iframe', $temp, true); + echo $data['iframe']; + ?> + + + load->view('formbuilder/forms/form_show_shortcodes', $data, true); + + // return data to ajax callback + header('Content-type: text/html'); + echo json_encode($json); + die(); + } + + public function ajax_modal_form_getshorcodes() + { + + $form_id = ( isset($_POST['form_id']) ) ? Uiform_Form_Helper::sanitizeInput(trim($_POST['form_id'])) : ''; + $data = array(); + $data['form_id'] = $form_id; + $json = array(); + $json['html_title'] = __('Shortcodes', 'FRocket_admin'); + $json['html'] = $this->load->view('formbuilder/forms/form_show_shortcodes', $data, true); + + // return data to ajax callback + header('Content-type: text/html'); + echo json_encode($json); + die(); + } + + /** + * Forms::ajax_refresh_previewpanel() + * + * @return + */ + public function ajax_refresh_previewpanel() + { + $data = array(); + $fmb_data = ( isset($_POST['form_data']) ) ? $_POST['form_data'] : ''; + $fmb_data = urldecode($fmb_data); + $fmb_data = ( isset($fmb_data) && $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'])) : ''; + + // in case title is empty + if ( empty($data['fmb_name']) && ! empty($_POST['uifm_frm_main_id']) && intval($_POST['uifm_frm_main_id']) > 0) { + $tmp_form_id = ( ! empty($_POST['uifm_frm_main_id']) ) ? Uiform_Form_Helper::sanitizeInput(trim($_POST['uifm_frm_main_id'])) : ''; + $tmp_form_title = $this->model_forms->getTitleFormById($tmp_form_id); + $data['fmb_name'] = $tmp_form_title->fmb_name; + } + + $json = array(); + $tmp_html = $this->generate_previewpanel_html($data); + $data['fmb_html_backend'] = Uiform_Form_Helper::encodeHex(do_shortcode($tmp_html['output_html'])); + $json['data'] = $data; + // return data to ajax callback + header('Content-Type: application/json'); + echo json_encode($json); + die(); + } + + /** + * Forms::ajax_save_form_updateopts() + * + * @return + */ + public function ajax_save_form_updateopts() + { + $data = array(); + $fmb_id = ( $_POST['uifm_frm_main_id'] ) ? Uiform_Form_Helper::sanitizeInput(trim($_POST['uifm_frm_main_id'])) : 0; + $data['fmb_html_backend'] = ( $_POST['form_html_backend'] ) ? Uiform_Form_Helper::sanitizeInput_html($_POST['form_html_backend']) : ''; + $json = array(); + if ( intval($fmb_id) > 0) { + $this->db->set($data); + $this->db->where('fmb_id', $fmb_id); + $this->db->update($this->model_forms->table); + + $json['status'] = 'updated'; + $json['id'] = $fmb_id; + } + // return data to ajax callback + header('Content-Type: application/json'); + echo json_encode($json); + die(); + } + + public function ajax_save_newform() + { + + $json = array(); + try { + if ( ! Uiform_Form_Helper::check_User_Access()) { + throw new Exception(__('Error! User has no permission to edit this form', 'FRocket_admin')); + } + $data = array(); + $data['fmb_name'] = ( ! empty($_POST['uifm_frm_main_title']) ) ? Uiform_Form_Helper::sanitizeInput(trim($_POST['uifm_frm_main_title'])) : ''; + $this->db->set($data); + $this->db->insert($this->model_forms->table); + + $idActivate = $this->db->insert_id(); + + $json['status'] = 'created'; + $json['id'] = $idActivate; + } catch ( Exception $e) { + } + // return data to ajax callback + header('Content-Type: application/json'); + echo json_encode($json); + die(); + } + + /** + * Forms::ajax_save_form() + * + * @return + */ + public function ajax_save_form() + { + try { + if ( ! Uiform_Form_Helper::check_User_Access()) { + throw new Exception(__('Error! User has no permission to edit this form', 'FRocket_admin')); + } + ob_start(); + $data = array(); + + $fmb_data = ( isset($_POST['form_data']) ) ? $_POST['form_data'] : ''; + $fmb_data = urldecode($fmb_data); + $fmb_data = ( isset($fmb_data) && $fmb_data ) ? array_map(array( 'Uiform_Form_Helper', 'sanitizeRecursive_html' ), json_decode($fmb_data, true)) : array(); + + // here a message should be sent + if ( empty($fmb_data)) { + return false; + } + + $data['fmb_data'] = json_encode($fmb_data); + + // addon data + $fmb_addon_data = ( isset($_POST['addon_data']) ) ? urldecode(Uiform_Form_Helper::sanitizeInput_html($_POST['addon_data'])) : ''; + $fmb_addon_data = ( isset($fmb_addon_data) && $fmb_addon_data ) ? array_map(array( 'Uiform_Form_Helper', 'sanitizeRecursive_html' ), json_decode($fmb_addon_data, true)) : array(); + + // form_inputs + $fmb_data['fm_inputs'] = ( isset($_POST['form_inputs']) ) ? urldecode(Uiform_Form_Helper::sanitizeInput_html($_POST['form_inputs'])) : ''; + + // more options + $data['fmb_rec_tpl_html'] = ( isset($_POST['uifm_frm_rec_tpl_html']) ) ? urldecode(Uiform_Form_Helper::sanitizeInput_html($_POST['uifm_frm_rec_tpl_html'])) : ''; + $data['fmb_inv_tpl_html'] = ( isset($_POST['uifm_frm_inv_tpl_html']) ) ? urldecode(Uiform_Form_Helper::sanitizeInput_html($_POST['uifm_frm_inv_tpl_html'])) : ''; + $data['fmb_rec_tpl_st'] = ( isset($_POST['uifm_frm_rec_tpl_st']) ) ? urldecode(Uiform_Form_Helper::sanitizeInput_html($_POST['uifm_frm_rec_tpl_st'])) : ''; + $data['fmb_inv_tpl_st'] = ( isset($_POST['uifm_frm_inv_tpl_st']) ) ? urldecode(Uiform_Form_Helper::sanitizeInput_html($_POST['uifm_frm_inv_tpl_st'])) : ''; + + $tmp_data2 = array(); + $tmp_data2['onsubm'] = isset($fmb_data['onsubm']) ? $fmb_data['onsubm'] : ''; + $tmp_data2['main'] = isset($fmb_data['main']) ? $fmb_data['main'] : ''; + $tmp_data2['calculation'] = isset($fmb_data['calculation']) ? $fmb_data['calculation'] : ''; + $data['fmb_data2'] = ! empty($tmp_data2) ? json_encode($tmp_data2) : ''; + $data['fmb_name'] = ( ! empty($_POST['uifm_frm_main_title']) ) ? Uiform_Form_Helper::sanitizeInput(trim($_POST['uifm_frm_main_title'])) : ''; + $data['created_ip'] = $_SERVER['REMOTE_ADDR']; + $data['created_by'] = 1; + $data['created_date'] = date('Y-m-d h:i:s'); + $fmb_id = ( isset($_POST['uifm_frm_main_id']) ) ? Uiform_Form_Helper::sanitizeInput(trim($_POST['uifm_frm_main_id'])) : 0; + + /* global for fonts */ + global $global_fonts_stored; + $global_fonts_stored = array(); + + $json = array(); + if ( intval($fmb_id) > 0) { + $this->db->set($data); + $this->db->where('fmb_id', $fmb_id); + $this->db->update($this->model_forms->table); + + $json['status'] = 'updated'; + $json['id'] = $fmb_id; + } else { + $this->db->set($data); + $this->db->insert($this->model_forms->table); + + $idActivate = $this->db->insert_id(); + $json['status'] = 'created'; + $json['id'] = $idActivate; + } + + $data_form = $this->model_forms->getFormById($json['id']); + $fmb_data = json_decode($data_form->fmb_data, true); + + // all data fields + $fmb_data['addons'] = $fmb_addon_data; + + if ( intval($json['id']) === 0) { + throw new Exception('Form id error'); + } + + $where = array( + 'fmb_id' => $json['id'], + ); + + // process addons + if ( ! empty(self::$_addons_actions)) { + foreach ( self::$_addons_actions as $zkey => $zvalue) { + if ( strval($zkey) === 'saveForm_store') { + foreach ( $zvalue as $zkey2 => $zvalue2) { + foreach ( $zvalue2 as $zkey3 => $zvalue3) { + // call_user_func(array(self::$_addons[$zkey3][$zvalue3['controller']], $zvalue3['function']),$json['id'], $value['data'],$fmb_data); + + self::$_addons[ $zkey3 ][ $zvalue3['controller'] ]->saveData($json['id'], $fmb_data); + } + } + } + /* + if(isset(self::$_addons[$key][$value['controller']])){ + //call_user_func(array(self::$_addons[$key][$value['controller']] , 'saveData')); + self::$_addons[$key][$value['controller']]->saveData($json['id'], $value['data'],$fmb_data); + + + }*/ + } + } + + // all data fields + $this->current_data_addon = $fmb_data['addons']; + $this->current_data_form = $fmb_data['steps_src']; + $this->current_data_num_tabs = $fmb_data['num_tabs']; + $this->current_data_tab_cont = $fmb_data['steps']['tab_cont']; + $this->current_data_steps = $fmb_data['steps']; + $this->current_data_skin = $fmb_data['skin']; + $this->current_data_wizard = ( $fmb_data['wizard'] ) ? $fmb_data['wizard'] : array(); + $this->current_data_onsubm = ( $fmb_data['onsubm'] ) ? $fmb_data['onsubm'] : array(); + $this->current_data_main = ( $fmb_data['main'] ) ? $fmb_data['main'] : array(); + $this->current_data_summbox = ( $fmb_data['summbox'] ) ? $fmb_data['summbox'] : array(); + $this->current_data_calculation = ( $fmb_data['calculation'] ) ? $fmb_data['calculation'] : array(); + + // save fields to table + $this->saved_form_id = $json['id']; + $this->save_data_fields($json['id']); + // save fields to table + $this->save_form_clogic(); + + // generate form html + $gen_return = $this->generate_form_html($json['id']); + $data4 = array(); + $data4['fmb_html'] = $gen_return['output_html']; + $data4['fmb_html_backend'] = $this->generate_admin_form_html($json['id']); + + // get global style + $data2 = array(); + $data2['idform'] = $json['id']; + $data2['addition_css'] = $this->current_data_main['add_css']; + $data2['skin'] = $this->current_data_skin; + $data2['summbox'] = $this->current_data_summbox; + $gen_return['output_css'] .= $this->load->view('formbuilder/forms/formhtml_css_global', $data2, true); + + $data3 = array(); + $data3['fonts'] = $global_fonts_stored; + $gen_return['output_css'] = $this->load->view('formbuilder/forms/formhtml_css_init', $data3, true) . $gen_return['output_css']; + $data4['fmb_html_css'] = $gen_return['output_css']; + $this->db->set($data4); + $this->db->where('fmb_id', $json['id']); + $this->db->update($this->model_forms->table); + + // generate form css + ob_start(); + $pathCssFile = FCPATH . '/assets/frontend/css/rockfm_form' . $json['id'] . '.css'; + $f = fopen($pathCssFile, 'w'); + fwrite($f, $gen_return['output_css']); + fclose($f); + ob_end_clean(); + + // add to log + $save_log_st = false; + $count_log_rec = $this->model_form_log->CountLogsByFormId($json['id']); + + if ( intval($count_log_rec) > 0) { + $last_rec = $this->model_form_log->getLastLogById($json['id']); + $new_hash = md5($data_form->fmb_data); + $old_hash = $last_rec->log_frm_hash; + if ( $new_hash != $old_hash) { + $save_log_st = true; + } + } else { + $save_log_st = true; + } + + $log_lastid = 0; + + if ( $save_log_st) { + $data5 = array(); + $data5['log_frm_data'] = $data['fmb_data']; + $data5['log_frm_name'] = $data['fmb_name']; + $data5['log_frm_html'] = ''; + $data5['log_frm_html_backend'] = $data4['fmb_html_backend']; + $data5['log_frm_html_css'] = ''; + $data5['log_frm_id'] = $json['id']; + $data5['log_frm_hash'] = md5($data_form->fmb_data); + $data5['created_ip'] = $_SERVER['REMOTE_ADDR']; + $data5['created_by'] = 1; + $data5['created_date'] = date('Y-m-d h:i:s'); + + // $this->wpdb->insert($this->model_form_log->table, $data5); + $this->db->set($data5); + $this->db->insert($this->model_form_log->table); + $log_lastid = $this->db->insert_id(); + // remove oldest if limit is exceeded + if ( intval($count_log_rec) > 50) { + $tmp_log = $this->model_form_log->getOldLogById($json['id']); + + $this->db->where('log_id', $tmp_log->log_id)->delete($this->model_form_log->table); + } + } + + // process addons + if ( ! empty(self::$_addons_actions)) { + foreach ( self::$_addons_actions as $zkey => $zvalue) { + if ( strval($zkey) === 'OnSaveForm_saveLog') { + foreach ( $zvalue as $zkey2 => $zvalue2) { + foreach ( $zvalue2 as $zkey3 => $zvalue3) { + if ( isset($this->current_data_addon[ $zkey3 ]['data'])) { + self::$_addons[ $zkey3 ][ $zvalue3['controller'] ]->saveLog($json['id'], $save_log_st, $log_lastid, $this->current_data_addon[ $zkey3 ]['data']); + } + } + } + } + } + } + + // checking errors + $output_error = ob_get_contents(); + if ( ob_get_length() > 0) { + ob_end_clean(); + } + if ( ! empty($output_error)) { + throw new Exception($output_error); + } + } catch ( Exception $e) { + $data = array(); + $error = array(); + $error['Message'] = $e->getMessage(); + $error['Trace'] = $e->getTrace(); + $ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : ''; + $user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''; + $hash = hash('crc32', md5($ip . $user_agent)); + + $referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; + $data['vis_uniqueid'] = $hash; + $data['vis_user_agent'] = $user_agent; + $data['vis_page'] = $_SERVER['REQUEST_URI']; + $data['vis_referer'] = $referer; + $data['vis_error'] = Uiform_Form_Helper::array2xml($error); + $data['vis_ip'] = $ip; + $data['fmb_id'] = $fmb_id; + $data['vis_last_date'] = date('Y-m-d H:i:s'); + + $this->db->set($data); + $this->db->insert($this->model_visitor->table); + + $json = array(); + $json['status'] = 'failed'; + $json['modal_header'] = __('Error on saving form', 'FRocket_admin'); + $json['modal_footer'] = ''; + $json['Message'] = $e->getMessage(); + } + // return data to ajax callback + header('Content-Type: application/json'); + echo json_encode($json); + die(); + } + + /** + * Forms::generate_form_getField() + * + * @return + */ + protected function generate_form_getField($child_field) + { + $str_output = ''; + $str_output_3 = ''; + + $data = array(); + $data = $this->current_data_form[ intval($child_field['num_tab']) ][ $child_field['id'] ]; + + $data['addon_extraclass'] = ''; + + // process addons + if ( ! empty(self::$_addons_actions)) { + foreach ( self::$_addons_actions as $zkey => $zvalue) { + if ( strval($zkey) === 'field_addon_extraclass') { + foreach ( $zvalue as $zkey2 => $zvalue2) { + foreach ( $zvalue2 as $zkey3 => $zvalue3) { + self::$_addons[ $zkey3 ][ $zvalue3['controller'] ]->getExtraDataField($data); + } + } + } + } + } + + switch ( intval($child_field['type'])) { + case 6: + // textbox + + $str_output .= modules::run('formbuilder/fields/formhtml_textbox', $data, $child_field['num_tab']); + $str_output_3 .= modules::run('formbuilder/fields/formhtml_textbox_css', $data); + + break; + case 7: + // textarea + $str_output .= modules::run('formbuilder/fields/formhtml_textarea', $data, $child_field['num_tab']); + $str_output_3 .= modules::run('formbuilder/fields/formhtml_textarea_css', $data); + + break; + case 8: + // radio button + $data['main'] = $this->current_data_main; + $str_output .= modules::run('formbuilder/fields/formhtml_radiobtn', $data, $child_field['num_tab']); + $str_output_3 .= modules::run('formbuilder/fields/formhtml_radiobtn_css', $data); + + break; + case 9: + // checkbox + $data['main'] = $this->current_data_main; + $str_output .= modules::run('formbuilder/fields/formhtml_checkbox', $data, $child_field['num_tab']); + $str_output_3 .= modules::run('formbuilder/fields/formhtml_checkbox_css', $data); + + break; + case 10: + // select + $data['main'] = $this->current_data_main; + $str_output .= modules::run('formbuilder/fields/formhtml_select', $data, $child_field['num_tab']); + $str_output_3 .= modules::run('formbuilder/fields/formhtml_select_css', $data); + + break; + case 11: + // multiselect + $data['main'] = $this->current_data_main; + $str_output .= modules::run('formbuilder/fields/formhtml_multiselect', $data, $child_field['num_tab']); + $str_output_3 .= modules::run('formbuilder/fields/formhtml_multiselect_css', $data); + + break; + case 12: + // fileupload + $str_output .= modules::run('formbuilder/fields/formhtml_fileupload', $data, $child_field['num_tab']); + $str_output_3 .= modules::run('formbuilder/fields/formhtml_fileupload_css', $data); + + break; + case 13: + // imageupload + $str_output .= modules::run('formbuilder/fields/formhtml_imageupload', $data, $child_field['num_tab']); + $str_output_3 .= modules::run('formbuilder/fields/formhtml_imageupload_css', $data); + break; + case 14: + // custom html + $str_output .= modules::run('formbuilder/fields/formhtml_customhtml', $data, $child_field['num_tab']); + $str_output_3 .= modules::run('formbuilder/fields/formhtml_customhtml_css', $data); + break; + case 15: + // password + $str_output .= modules::run('formbuilder/fields/formhtml_password', $data, $child_field['num_tab']); + $str_output_3 .= modules::run('formbuilder/fields/formhtml_password_css', $data); + break; + case 16: + // slider + $data['main'] = $this->current_data_main; + $str_output .= modules::run('formbuilder/fields/formhtml_slider', $data, $child_field['num_tab']); + $str_output_3 .= modules::run('formbuilder/fields/formhtml_slider_css', $data); + break; + case 17: + // range + $str_output .= modules::run('formbuilder/fields/formhtml_range', $data, $child_field['num_tab']); + $str_output_3 .= modules::run('formbuilder/fields/formhtml_range_css', $data); + break; + case 18: + // spinner + $data['main'] = $this->current_data_main; + $str_output .= modules::run('formbuilder/fields/formhtml_spinner', $data, $child_field['num_tab']); + $str_output_3 .= modules::run('formbuilder/fields/formhtml_spinner_css', $data); + break; + case 19: + // captcha + $str_output .= modules::run('formbuilder/fields/formhtml_captcha', $data, $child_field['num_tab']); + $str_output_3 .= modules::run('formbuilder/fields/formhtml_captcha_css', $data); + break; + case 20: + // submit button + $str_output .= modules::run('formbuilder/fields/formhtml_submitbtn', $data, $child_field['num_tab']); + $str_output_3 .= modules::run('formbuilder/fields/formhtml_submitbtn_css', $data); + break; + case 21: + // hidden field + $str_output .= modules::run('formbuilder/fields/formhtml_hiddeninput', $data, $child_field['num_tab']); + + break; + case 22: + // star rating + $str_output .= modules::run('formbuilder/fields/formhtml_ratingstar', $data, $child_field['num_tab']); + $str_output_3 .= modules::run('formbuilder/fields/formhtml_ratingstar_css', $data); + break; + case 23: + // color picker + $str_output .= modules::run('formbuilder/fields/formhtml_colorpicker', $data, $child_field['num_tab']); + $str_output_3 .= modules::run('formbuilder/fields/formhtml_colorpicker_css', $data); + break; + case 24: + // date picker + $str_output .= modules::run('formbuilder/fields/formhtml_datepicker', $data, $child_field['num_tab']); + $str_output_3 .= modules::run('formbuilder/fields/formhtml_datepicker_css', $data); + break; + case 25: + // time picker + $str_output .= modules::run('formbuilder/fields/formhtml_timepicker', $data, $child_field['num_tab']); + $str_output_3 .= modules::run('formbuilder/fields/formhtml_timepicker_css', $data); + break; + case 26: + // date time + $str_output .= modules::run('formbuilder/fields/formhtml_datetime', $data, $child_field['num_tab']); + $str_output_3 .= modules::run('formbuilder/fields/formhtml_datetime_css', $data); + break; + case 27: + // recaptcha + $str_output .= modules::run('formbuilder/fields/formhtml_recaptcha', $data, $child_field['num_tab']); + $str_output_3 .= modules::run('formbuilder/fields/formhtml_recaptcha_css', $data); + break; + case 28: + // prepended text + $str_output .= modules::run('formbuilder/fields/formhtml_preptext', $data, $child_field['num_tab']); + $str_output_3 .= modules::run('formbuilder/fields/formhtml_preptext_css', $data); + break; + case 29: + // appended text + $str_output .= modules::run('formbuilder/fields/formhtml_appetext', $data, $child_field['num_tab']); + $str_output_3 .= modules::run('formbuilder/fields/formhtml_appetext_css', $data); + break; + case 30: + // prep app text + $str_output .= modules::run('formbuilder/fields/formhtml_prepapptext', $data, $child_field['num_tab']); + $str_output_3 .= modules::run('formbuilder/fields/formhtml_prepapptext_css', $data); + break; + case 31: + // panel + $str_output .= modules::run('formbuilder/fields/formhtml_panelfld', $data, $child_field['num_tab']); + $str_output_3 .= modules::run('formbuilder/fields/formhtml_panelfld_css', $data); + break; + case 32: + // divider + $str_output .= modules::run('formbuilder/fields/formhtml_divider', $data, $child_field['num_tab']); + $data['form_skin'] = $this->current_data_skin; + $str_output_3 .= modules::run('formbuilder/fields/formhtml_divider_css', $data); + + break; + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + // heading + $str_output .= modules::run('formbuilder/fields/formhtml_heading', $data, $child_field['num_tab']); + $str_output_3 .= modules::run('formbuilder/fields/formhtml_heading_css', $data); + break; + case 39: + // wizard buttons + $data['form_wizard'] = $this->current_data_wizard; + $data['tab_count'] = $this->current_data_steps; + $str_output .= modules::run('formbuilder/fields/formhtml_wizardbtn', $data, $child_field['num_tab']); + $str_output_3 .= modules::run('formbuilder/fields/formhtml_wizardbtn_css', $data); + break; + case 40: + // switch + $data['main'] = $this->current_data_main; + $str_output .= modules::run('formbuilder/fields/formhtml_switch', $data, $child_field['num_tab']); + $str_output_3 .= modules::run('formbuilder/fields/formhtml_switch_css', $data); + break; + case 41: + // dyn checkbox + $data['main'] = $this->current_data_main; + $data['form_id'] = $this->saved_form_id; + $str_output .= modules::run('formbuilder/fields/formhtml_dyncheckbox', $data, $child_field['num_tab']); + $str_output_3 .= modules::run('formbuilder/fields/formhtml_dyncheckbox_css', $data); + break; + case 42: + // dyn radiobtn + $data['main'] = $this->current_data_main; + $data['form_id'] = $this->saved_form_id; + $str_output .= modules::run('formbuilder/fields/formhtml_dynradiobtn', $data, $child_field['num_tab']); + $str_output_3 .= modules::run('formbuilder/fields/formhtml_dynradiobtn_css', $data); + break; + case 43: + // date 2 + $data['main'] = $this->current_data_main; + $data['form_id'] = $this->saved_form_id; + $str_output .= modules::run('formbuilder/fields/formhtml_date2', $data, $child_field['num_tab']); + $str_output_3 .= modules::run('formbuilder/fields/formhtml_date2_css', $data); + break; + default: + break; + } + + $return = array(); + $return['output_html'] = $str_output; + + // add css inside namespace of the form + require_once FCPATH . '/libs/lesslib/lessc.inc.php'; + $less = new lessc(); + $css_store = ''; + try { + $css_store = $less->compile('#rockfm_form_' . $this->saved_form_id . ' {' . $str_output_3 . '}'); + } catch ( exception $e) { + $css_store = $str_output_3; + } + + $return['output_css'] = $css_store; + + return $return; + } + + /* + * Search field on core data if exists + */ + private function isField_OnCoreData($core_data, $field_search) + { + foreach ( $core_data as $key => $field) { + if ( isset($core_data[ $key ][ $field_search ]) && ! empty($core_data[ $key ][ $field_search ])) { + return $core_data[ $key ][ $field_search ]; + } + } + + return false; + } + /** + * Forms::generate_previewpanel_getField() + * + * @return + */ + protected function generate_previewpanel_getField($child_field) + { + $str_output = ''; + + $data = array(); + + if ( empty($this->current_data_form[ intval($child_field['num_tab']) ][ $child_field['id'] ])) { + $tmp_data = $this->isField_OnCoreData($this->current_data_form, $child_field['id']); + if ( $tmp_data) { + $data = $tmp_data; + } else { + $return = array(); + $return['output_html'] = ''; + return $return; + } + } else { + $data = $this->current_data_form[ intval($child_field['num_tab']) ][ $child_field['id'] ]; + } + + $data['quick_options'] = $this->load->view('formbuilder/fields/templates/prevpanel_quickopts', $data, true); + switch ( intval($child_field['type'])) { + case 6: + // textbox + $str_output .= $this->load->view('formbuilder/fields/templates/prevpanel_textbox', $data, true); + break; + case 7: + // textarea + $str_output .= $this->load->view('formbuilder/fields/templates/prevpanel_textarea', $data, true); + break; + case 8: + // radio button + $str_output .= $this->load->view('formbuilder/fields/templates/prevpanel_radiobtn', $data, true); + break; + case 9: + // checkbox + $str_output .= $this->load->view('formbuilder/fields/templates/prevpanel_checkbox', $data, true); + break; + case 10: + // select + $str_output .= $this->load->view('formbuilder/fields/templates/prevpanel_select', $data, true); + break; + case 11: + // multiselect + $str_output .= $this->load->view('formbuilder/fields/templates/prevpanel_multiselect', $data, true); + break; + case 12: + // fileupload + $str_output .= $this->load->view('formbuilder/fields/templates/prevpanel_fileupload', $data, true); + break; + case 13: + // imageupload + $str_output .= $this->load->view('formbuilder/fields/templates/prevpanel_imageupload', $data, true); + break; + case 14: + // custom html + $str_output .= $this->load->view('formbuilder/fields/templates/prevpanel_customhtml', $data, true); + break; + case 15: + // password + $str_output .= $this->load->view('formbuilder/fields/templates/prevpanel_password', $data, true); + break; + case 16: + // slider + $str_output .= $this->load->view('formbuilder/fields/templates/prevpanel_slider', $data, true); + break; + case 17: + // range + $str_output .= $this->load->view('formbuilder/fields/templates/prevpanel_range', $data, true); + break; + case 18: + // spinner + $str_output .= $this->load->view('formbuilder/fields/templates/prevpanel_spinner', $data, true); + break; + case 19: + // captcha + $str_output .= $this->load->view('formbuilder/fields/templates/prevpanel_captcha', $data, true); + break; + case 20: + // submit button + $str_output .= $this->load->view('formbuilder/fields/templates/prevpanel_submitbtn', $data, true); + break; + case 21: + // hidden field + $str_output .= $this->load->view('formbuilder/fields/templates/prevpanel_hiddeninput', $data, true); + break; + case 22: + // star rating + $str_output .= $this->load->view('formbuilder/fields/templates/prevpanel_ratingstar', $data, true); + break; + case 23: + // color picker + $str_output .= $this->load->view('formbuilder/fields/templates/prevpanel_colorpicker', $data, true); + break; + case 24: + // date picker + $str_output .= $this->load->view('formbuilder/fields/templates/prevpanel_datepicker', $data, true); + break; + case 25: + // time picker + $str_output .= $this->load->view('formbuilder/fields/templates/prevpanel_timepicker', $data, true); + break; + case 26: + // date time + $str_output .= $this->load->view('formbuilder/fields/templates/prevpanel_datetime', $data, true); + break; + case 27: + // recaptcha + $str_output .= $this->load->view('formbuilder/fields/templates/prevpanel_recaptcha', $data, true); + break; + case 28: + // prepended text + $str_output .= $this->load->view('formbuilder/fields/templates/prevpanel_preptext', $data, true); + break; + case 29: + // appended text + $str_output .= $this->load->view('formbuilder/fields/templates/prevpanel_appetext', $data, true); + break; + case 30: + // prep app text + $str_output .= $this->load->view('formbuilder/fields/templates/prevpanel_prepapptext', $data, true); + break; + case 32: + // divider + $str_output .= $this->load->view('formbuilder/fields/templates/prevpanel_divider', $data, true); + break; + case 33: + // heading 1 + $str_output .= $this->load->view('formbuilder/fields/templates/prevpanel_heading1', $data, true); + break; + case 34: + // heading 2 + $str_output .= $this->load->view('formbuilder/fields/templates/prevpanel_heading2', $data, true); + break; + case 35: + // heading 3 + $str_output .= $this->load->view('formbuilder/fields/templates/prevpanel_heading3', $data, true); + break; + case 36: + // heading 4 + $str_output .= $this->load->view('formbuilder/fields/templates/prevpanel_heading4', $data, true); + break; + case 37: + // heading 5 + $str_output .= $this->load->view('formbuilder/fields/templates/prevpanel_heading5', $data, true); + break; + case 38: + // heading 6 + $str_output .= $this->load->view('formbuilder/fields/templates/prevpanel_heading6', $data, true); + break; + case 39: + // wizard buttons + $str_output .= $this->load->view('formbuilder/fields/templates/prevpanel_wizardbtn', $data, true); + break; + case 40: + // switch + $str_output .= $this->load->view('formbuilder/fields/templates/prevpanel_switch', $data, true); + break; + case 41: + // dyn checkbox + $str_output .= $this->load->view('formbuilder/fields/templates/prevpanel_dyncheckbox', $data, true); + break; + case 42: + // dyn radiobtn + $str_output .= $this->load->view('formbuilder/fields/templates/prevpanel_dynradiobtn', $data, true); + break; + case 43: + // date + $str_output .= $this->load->view('formbuilder/fields/templates/prevpanel_datetime_2', $data, true); + break; + default: + break; + } + + $return = array(); + $return['output_html'] = $str_output; + return $return; + } + + /** + * Forms::getChildren_innerGrid() + * + * @return + */ + protected function getChildren_innerGrid($type) + { + + $str_output = ''; + switch ( intval($type)) { + case 1: + ob_start(); + ?> + +
    +
    + + + + + + +
    + +
    + + + + + + + + + +
    + +
    + + + + + + + + + + + + +
    + +
    + + + + + + + + + + + + + + + + + + +
    + +
    + + + + 'one', + 2 => 'two', + 3 => 'three', + 4 => 'four', + 5 => 'six', + ); + switch ( intval($child_field['type'])) { + case 1: + case 2: + case 3: + case 4: + case 5: + ob_start(); + ?> +
    +
    + + + $value) { + $str_output .= $this->getChildren_genCol($child_field['type'], $key, $value['cols']); + if ( $count_str === $count_total) { + $fcontainer_class = ''; + } else { + $fcontainer_class = 'rkfm-bend-fcontainer-wrap'; + } + ob_start(); + ?> +
    + + $value2) { + // get field + $get_data = array(); + // $str_output.='
    '; + if ( isset($value2['iscontainer']) && intval($value2['iscontainer']) === 1) { + $get_data = $this->generate_admin_form_getChildren($value2); + $str_output .= $get_data['output_html']; + } else { + $get_data = $this->generate_previewpanel_getField($value2); + $str_output .= $get_data['output_html']; + } + } + } + $str_output .= '
    '; + $str_output .= '
    '; + $count_str++; + } + } + } else { + $str_output .= $this->getChildren_innerGrid($child_field['type']); + } + ob_start(); + ?> + + +
    + load->view('formbuilder/fields/templates/prevpanel_quickopts2',array(), true); ?> +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + $value) { + if ( ! empty($value['children'])) { + foreach ( $value['children'] as $key2 => $value2) { + // get field + $get_data = array(); + + if ( isset($value2['iscontainer']) && intval($value2['iscontainer']) === 1) { + $get_data = $this->generate_admin_form_getChildren($value2); + $str_output .= $get_data['output_html']; + } else { + $get_data = $this->generate_previewpanel_getField($value2); + $str_output .= $get_data['output_html']; + } + } + } + + $count_str++; + } + } + } + ob_start(); + ?> +
    + +
    +
    +
    +
    +
    + +
    +
    + + = 0) { + $str_output .= '
    '; + $str_output .= '
    '; + $str_output .= '
    '; + $count_str = 0; + if ( isset($child_field['inner'])) { + foreach ( $child_field['inner'] as $key => $value) { + $str_output .= '
    '; + if ( $count_str === $key) { + $str_output .= '
    '; + } else { + $str_output .= '
    '; + } + if ( ! empty($value['children'])) { + foreach ( $value['children'] as $key2 => $value2) { + // get field + $get_data = array(); + $str_output .= '
    '; + if ( isset($value2['iscontainer']) && intval($value2['iscontainer']) === 1) { + $get_data = $this->generate_form_getChildren($value2); + $str_output .= $get_data['output_html']; + $str_output_2 .= $get_data['output_css']; + } else { + $get_data = $this->generate_form_getField($value2); + $str_output .= $get_data['output_html']; + $str_output_2 .= $get_data['output_css']; + } + $str_output .= '
    '; + } + } + $str_output .= '
    '; + $str_output .= '
    '; + } + } + $str_output .= '
    '; + $str_output .= '
    '; + $str_output .= '
    '; + } + + $data = array(); + $data = $this->gen_post_src[ $child_field['num_tab'] ][ $child_field['id'] ]; + $str_output_2 .= modules::run('formbuilder/fields/posthtml_gridsystem_css', $data); + + break; + case 31: + /*panel*/ + $temp_str_output = ''; + if ( isset($child_field['count_children']) && intval($child_field['count_children']) > 0) { + $count_str = 0; + if ( isset($child_field['inner'])) { + foreach ( $child_field['inner'] as $key => $value) { + if ( ! empty($value['children'])) { + foreach ( $value['children'] as $key2 => $value2) { + // get field + $get_data = array(); + + if ( isset($value2['iscontainer']) && intval($value2['iscontainer']) === 1) { + $get_data = $this->generate_form_getChildren($value2); + $temp_str_output .= $get_data['output_html']; + $str_output_2 .= $get_data['output_css']; + } else { + $get_data = $this->generate_form_getField($value2); + $temp_str_output .= $get_data['output_html']; + $str_output_2 .= $get_data['output_css']; + } + } + } + } + } + } + + $temp_content = ''; + $data_tmp = array(); + $data_tmp = $this->current_data_form[ intval($child_field['num_tab']) ][ $child_field['id'] ]; + $temp_content = $this->load->view('formbuilder/fields/formhtml_panelfld', $data_tmp, true); + $str_output .= str_replace('[[%%fields%%]]', $temp_str_output, $temp_content); + $str_output_2 .= $this->load->view('formbuilder/fields/formhtml_panelfld_css', $data_tmp, true); + break; + default: + break; + } + $return = array(); + $return['output_html'] = $str_output; + $return['output_css'] = $str_output_2; + + return $return; + } + + protected function generate_admin_form_getChildren($child_field) + { + $str_output = ''; + $str_output_2 = ''; + + $grid_order = array( + 1 => 'one', + 2 => 'two', + 3 => 'three', + 4 => 'four', + 5 => 'five', + 6 => 'six', + ); + + switch ( intval($child_field['type'])) { + case 1: + case 2: + case 3: + case 4: + case 5: + if ( intval($child_field['count_children']) >= 0) { + ob_start(); + ?> +
    +
    +
    + $value) { + // controling 12 cols + $tmp_col_rest2 = $tmp_col_rest - abs($value['cols']); + if ( $tmp_col_rest2 < 12 && $tmp_col_rest2 > 0) { + $tmp_col = abs($value['cols']); + $tmp_col_rest = $tmp_col_rest2; + } else { + $tmp_col = $tmp_col_rest; + } + + $str_output .= '
    '; + $str_output .= '
    '; + + if ( ! empty($value['children'])) { + foreach ( $value['children'] as $key2 => $value2) { + // get field + $get_data = array(); + + if ( isset($value2['iscontainer']) && intval($value2['iscontainer']) === 1) { + $get_data = $this->generate_admin_form_getChildren($value2); + $str_output .= $get_data['output_html']; + } else { + $get_data = $this->generate_previewpanel_getField($value2); + $str_output .= $get_data['output_html']; + } + } + } + + $str_output .= '
    '; + + if ( $count_str < $count_total) { + ob_start(); + ?> +
    +
    +
    +
    +
    + +
    + '; + $count_str++; + } + } + + ob_start(); + ?> +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + $value) { + if ( ! empty($value['children'])) { + foreach ( $value['children'] as $key2 => $value2) { + // get field + $get_data = array(); + + if ( isset($value2['iscontainer']) && intval($value2['iscontainer']) === 1) { + $get_data = $this->generate_admin_form_getChildren($value2); + $str_output .= $get_data['output_html']; + } else { + $get_data = $this->generate_previewpanel_getField($value2); + $str_output .= $get_data['output_html']; + } + } + } + + $count_str++; + } + } + } + ob_start(); + ?> +
    + +
    +
    +
    +
    +
    + +
    +
    + 1) { + $data1 = array(); + $data1['tab_title'] = $this->current_data_steps['tab_title']; + $data1['tab_theme'] = $this->current_data_wizard; + $data['form_tab_head'] = $this->load->view('formbuilder/forms/formhtml_tabheader', $data1, true); + $data2 = array(); + $data['form_tab_footer'] = $this->load->view('formbuilder/forms/formhtml_tabfooter', $data2, true); + } + + $data['tab_count'] = $numtab; + $data['form_content'] = $str_output; + $data['form_sticky_content'] = $this->generate_form_sticky(); + $data['form_id'] = $id; + $data['wizard'] = $this->current_data_wizard; + $data['onsubm'] = $this->current_data_onsubm; + $data['main'] = $this->current_data_main; + $data['clogic'] = $this->saveform_clogic; + $data['summbox'] = $this->current_data_summbox; + $data['calculation'] = $this->current_data_calculation; + return $this->load->view('formbuilder/forms/formhtml_form', $data, true); + } + + public function generate_admin_form_container($id, $numtab, $str_output) + { + } + + /** + * Forms::generate_previewpanel_container() + * + * @return + */ + public function generate_previewpanel_container($id, $numtab, $str_output) + { + $data = array(); + if ( intval($numtab) > 1) { + $data1 = array(); + $data1['tab_title'] = $this->current_data_steps['tab_title']; + $data1['tab_theme'] = $this->current_data_wizard; + $data['form_tab_head'] = $this->load->view('formbuilder/forms/previewpanel_tabheader', $data1, true); + $data2 = array(); + $data['form_tab_footer'] = $this->load->view('formbuilder/forms/previewpanel_tabfooter', $data2, true); + } + $data['tab_count'] = $numtab; + $data['form_content'] = $str_output; + $data['form_id'] = $id; + $data['wizard'] = $this->current_data_wizard; + $data['onsubm'] = $this->current_data_onsubm; + $data['main'] = $this->current_data_main; + $data['clogic'] = $this->saveform_clogic; + $data['summbox'] = $this->current_data_summbox; + return $this->load->view('formbuilder/forms/previewpanel_form', $data, true); + } + + /** + * Forms::generate_previewpanel_tabContent() + * + * @return + */ + public function generate_previewpanel_tabContent($tab_cont_num, $tabindex, $str_output) + { + $output = ''; + $data = array(); + $data['tabindex'] = $tabindex; + $data['tab_html_fields'] = $str_output; + // if (intval($tab_cont_num) > 1) { + // apply function + $output .= $this->load->view('formbuilder/forms/previewpanel_tabcontainer', $data, true); + /* + } else { + $output.=$str_output; + } */ + return $output; + } + + /** + * Forms::generate_form_tabContent() + * + * @return + */ + public function generate_form_tabContent($tab_cont_num, $tabindex, $str_output) + { + $output = ''; + $data = array(); + $data['tabindex'] = $tabindex; + $data['tab_html_fields'] = $str_output; + if ( intval($tab_cont_num) > 1) { + // apply function + $output .= $this->load->view('formbuilder/forms/formhtml_tabcontainer', $data, true); + } else { + $output .= $str_output; + } + return $output; + } + + + public function generate_admin_form_tabContent($tab_cont_num, $tabindex, $str_output) + { + $output = ''; + $data = array(); + $data['tabindex'] = $tabindex; + $data['tab_html_fields'] = $str_output; + if ( intval($tab_cont_num) > 1) { + // apply function + $output .= self::render_template('formbuilder/views/forms/formhtml_tabcontainer.php', $data, 'always'); + } else { + $output .= $str_output; + } + return $output; + } + + /** + * Forms::save_form_clogic() + * + * @return + */ + public function save_form_clogic() + { + $clogic_src = $this->saveform_clogic; + if ( ! empty($clogic_src)) { + // get fires + $fields_fire = array(); + foreach ( $clogic_src['cond'] as $key => $value) { + foreach ( $value['list'] as $key2 => $value2) { + if ( ! empty($value2)) { + if ( ! isset($fields_fire[ $value2['field_fire'] ]['list'][ $value['field_cond'] ])) { + $fields_fire[ $value2['field_fire'] ]['list'][] = $value['field_cond']; + } + } else { + unset($clogic_src['cond'][ $key ]['list'][ $key2 ]); + } + } + } + $this->saveform_clogic = $clogic_src; + // field fires + $logic_field_fire = array(); + foreach ( $fields_fire as $key => $value) { + $temp_logic = array(); + $temp_logic['field_fire'] = $key; + $tmp_list = array(); + foreach ( $value['list'] as $value2) { + $tmp_list[] = array( 'field_cond' => $value2 ); + } + $temp_logic['list'] = $tmp_list; + $logic_field_fire[ $key ] = $temp_logic; + } + + $clogic_src['fire'] = $logic_field_fire; + $this->saveform_clogic = $clogic_src; + } + } + + /** + * Forms::save_data_fields() + * + * @return + */ + public function save_data_fields($form_id = null) + { + + /* check for enabled field for reports */ + $check_rec_querys = $this->model_fields->queryGetQtyFieldsEnabled($form_id); + if ( intval($check_rec_querys) === 1) { + // getting ones enabled for showing on list records + $tmp_query_list = array(); + $rec_querys_list = $this->model_fields->queryGetListFieldsEnabled($form_id); + foreach ( $rec_querys_list as $value) { + $tmp_query_list[] = $value->fmf_uniqueid; + } + // storing rec orders + $tmp_recorder_list = array(); + $rec_querys_list = $this->model_fields->queryGetListFieldsById($form_id); + foreach ( $rec_querys_list as $value) { + $tmp_recorder_list[ $value->fmf_uniqueid ] = $value->order_rec; + } + } + + // deleting form + $this->db->where('form_fmb_id', $form_id)->delete($this->model_fields->table); + // creating again + $data_form = $this->model_forms->getFormById($form_id); + $fmb_data = json_decode($data_form->fmb_data, true); + // $tab_cont=$fmb_data['steps']['tab_cont']; + $steps_src = $fmb_data['steps_src']; + + $set_rec_querys = 0; + if ( ! empty($steps_src)) { + foreach ( $steps_src as $tabindex => $fields) { + if ( ! empty($fields)) { + foreach ( $fields as $key => $value) { + $data = array(); + $data['fmf_uniqueid'] = $value['id']; + switch ( intval($value['type'])) { + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 15: + case 16: + case 17: + case 18: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 28: + case 29: + case 30: + case 40: + case 41: + case 42: + // assign selected fields to the report + if ( intval($check_rec_querys) === 0 && $set_rec_querys < 5) { + $data['fmf_status_qu'] = 1; + $set_rec_querys++; + } elseif ( intval($check_rec_querys) === 1) { + if ( in_array($value['id'], $tmp_query_list)) { + $data['fmf_status_qu'] = 1; + } + } + $data['fmf_fieldname'] = $value['field_name']; + $data['order_frm'] = $value['order_frm']; + + if ( isset($tmp_recorder_list[ $value['id'] ]) && intval($tmp_recorder_list[ $value['id'] ]) > 0) { + $data['order_rec'] = $tmp_recorder_list[ $value['id'] ]; + } else { + $data['order_rec'] = $value['order_frm']; + } + break; + case 19: + case 20: + case 27: + // asigning order to fields + $data['order_frm'] = $value['order_frm']; + break; + } + + $data['fmf_data'] = json_encode($value); + $data['type_fby_id'] = $value['type']; + $data['form_fmb_id'] = $form_id; + /* clean previous field */ + + $this->db->set($data); + $this->db->insert($this->model_fields->table); + + if ( isset($value['clogic']) && intval($value['clogic']['show_st']) === 1) { + $tmp_clogic = array(); + $tmp_clogic['field_cond'] = $value['id']; + $tmp_clogic['action'] = $value['clogic']['f_show']; + + foreach ( $value['clogic']['list'] as $key2 => $value2) { + if ( empty($value2)) { + unset($value['clogic']['list'][ $key2 ]); + } + } + $tmp_clogic['list'] = array_filter($value['clogic']['list']); + $tmp_clogic['req_match'] = ( intval($value['clogic']['f_all']) === 1 ) ? count($value['clogic']['list']) : 1; + $this->saveform_clogic['cond'][] = $tmp_clogic; + } + } + } + } + } + } + + /** + * Forms::generate_form_html() + * + * @return + */ + public function generate_form_html($form_id = null) + { + /* + $data_form = $this->model_forms->getFormById($form_id); + $fmb_data = json_decode($data_form->fmb_data, true);*/ + // all fields position + $tab_cont = $this->current_data_tab_cont; + $this->gen_post_src = $this->current_data_form; + $tab_cont_num = $this->current_data_num_tabs; + // generating + + $str_output_2 = ''; + $str_output_tab = ''; + foreach ( $tab_cont as $key => $value) { + // tabs + $str_output = ''; + if ( ! empty($value['content'])) { + foreach ( $value['content'] as $key2 => $value2) { + $get_data = array(); + + // fields + if ( isset($value2['iscontainer']) && intval($value2['iscontainer']) === 1) { + $get_data = $this->generate_form_getChildren($value2); + $str_output .= $get_data['output_html']; + $str_output_2 .= $get_data['output_css']; + } else { + $get_data = $this->generate_form_getField($value2); + $str_output .= $get_data['output_html']; + $str_output_2 .= $get_data['output_css']; + } + } + } + + // set tab container + $str_output_tab .= $this->generate_form_tabContent($tab_cont_num, $key, $str_output); + // jump if it is one + if ( intval($tab_cont_num) === 1) { + break 1; + } + } + + // generate form css + $str_output_2 .= $this->generate_form_css($form_id); + if ( $tab_cont_num > 1) { + $str_output_2 .= $this->generate_form_tab_css($form_id); + } + + $return = array(); + $return['output_html'] = $this->generate_form_container($form_id, $tab_cont_num, $str_output_tab); + $return['output_css'] = $str_output_2; + + return $return; + } + + + public function generate_admin_form_html($form_id = null) + { + $data_form = $this->model_forms->getFormById($form_id); + if ( empty($data_form)) { + return; + } + $fmb_data = json_decode($data_form->fmb_data, true); + // all fields position + $tab_cont = $fmb_data['steps']['tab_cont']; + + // generating + + $str_output_tab = ''; + $tab_cont_num = $fmb_data['num_tabs']; + + if ( ! empty($tab_cont)) { + foreach ( $tab_cont as $key => $value) { + // tabs + $str_output = ''; + if ( ! empty($value['content'])) { + foreach ( $value['content'] as $key2 => $value2) { + $get_data = array(); + + // fields + if ( isset($value2['iscontainer']) && intval($value2['iscontainer']) === 1) { + $get_data = $this->generate_admin_form_getChildren($value2); + $str_output .= $get_data['output_html']; + } else { + $get_data = $this->generate_previewpanel_getField($value2); + $str_output .= $get_data['output_html']; + } + } + } + + // set tab container + $str_output_tab .= $this->generate_previewpanel_tabContent($tab_cont_num, $key, $str_output); + // jump if it is one + if ( intval($tab_cont_num) === 1) { + break 1; + } + } + } else { + // set tab container + $str_output_tab .= $this->generate_previewpanel_tabContent(0, 0, ''); + } + + $return = array(); + $return['output_html'] = $this->generate_previewpanel_container($form_id, $tab_cont_num, $str_output_tab); + + return $return['output_html']; + } + + + + /** + * Forms::generate_previewpanel_html() + * + * @return + */ + public function generate_previewpanel_html($data) + { + + $fmb_data = $data['fmb_data']; + // all fields position + $tab_cont = $fmb_data['steps']['tab_cont']; + // all data fields + $steps_src = $fmb_data['steps_src']; + $this->current_data_form = $steps_src; + $this->current_data_steps = $fmb_data['steps']; + $this->current_data_skin = $fmb_data['skin']; + $this->current_data_wizard = ( $fmb_data['wizard'] ) ? $fmb_data['wizard'] : array(); + $this->current_data_onsubm = ( $fmb_data['onsubm'] ) ? $fmb_data['onsubm'] : array(); + $this->current_data_main = ( $fmb_data['main'] ) ? $fmb_data['main'] : array(); + // generating + + $str_output_tab = ''; + $tab_cont_num = $fmb_data['num_tabs']; + + if ( ! empty($tab_cont)) { + foreach ( $tab_cont as $key => $value) { + // tabs + $str_output = ''; + if ( ! empty($value['content'])) { + foreach ( $value['content'] as $key2 => $value2) { + $get_data = array(); + // fields + if ( isset($value2['iscontainer']) && intval($value2['iscontainer']) === 1) { + // $get_data = $this->generate_previewpanel_getChildren($value2); + + $get_data = $this->generate_admin_form_getChildren($value2); + + $str_output .= $get_data['output_html']; + } else { + $get_data = $this->generate_previewpanel_getField($value2); + $str_output .= $get_data['output_html']; + } + } + } + + // set tab container + $str_output_tab .= $this->generate_previewpanel_tabContent($tab_cont_num, $key, $str_output); + // jump if it is one + if ( intval($tab_cont_num) === 1) { + break 1; + } + } + } else { + // there nos data + // set tab container + $str_output_tab .= $this->generate_previewpanel_tabContent(0, 0, ''); + } + + $return = array(); + $return['output_html'] = $this->generate_previewpanel_container(null, $str_output_tab, $str_output_tab); + + return $return; + } + + /** + * Forms::export_form() + * + * @return + */ + public function export_form() + { + $data = array(); + $data['list_forms'] = $this->model_forms->getListForms(); + $this->template->loadPartial('layout', 'forms/export_form', $data); + } + + /** + * Forms::ajax_load_export_form() + * + * @return + */ + public function ajax_load_export_form() + { + $form_id = ( isset($_POST['form_id']) && $_POST['form_id'] ) ? Uiform_Form_Helper::sanitizeInput($_POST['form_id']) : 0; + $data_form = $this->model_forms->getFormById($form_id); + $data_exp = array(); + $data_exp['fmb_data'] = $data_form->fmb_data; + $data_exp['fmb_html_backend'] = $data_form->fmb_html_backend; + $data_exp['fmb_name'] = $data_form->fmb_name; + $data_exp['fmb_rec_tpl_html'] = $data_form->fmb_rec_tpl_html; + $data_exp['fmb_inv_tpl_html'] = $data_form->fmb_inv_tpl_html; + $data_exp['fmb_rec_tpl_st'] = $data_form->fmb_rec_tpl_st; + $data_exp['fmb_inv_tpl_st'] = $data_form->fmb_inv_tpl_st; + $code_export = Uiform_Form_Helper::base64url_encode(serialize($data_exp)); + echo $code_export; + die(); + } + + /** + * Forms::generate_form_css() + * + * @return + */ + public function generate_form_css($form_id = null) + { + $data = array(); + $data['idform'] = $form_id; + $data['skin'] = $this->current_data_skin; + return $this->load->view('formbuilder/forms/formhtml_css_form', $data, true); + } + + public function generate_form_sticky() + { + $data = array(); + $data['summbox'] = $this->current_data_summbox; + return $this->load->view('formbuilder/forms/formhtml_sticky', $data, true); + } + + /** + * Forms::generate_form_tab_css() + * + * @return + */ + public function generate_form_tab_css($form_id = null) + { + $data = array(); + $data['idform'] = $form_id; + $data['wizard'] = $this->current_data_wizard; + return $this->load->view('formbuilder/forms/formhtml_css_wizard', $data, true); + } + + /** + * Forms::ajax_load_form() + * + * @return + */ + public function ajax_load_form() + { + $json = array(); + $form_id = ( isset($_POST['form_id']) ) ? Uiform_Form_Helper::sanitizeInput(trim($_POST['form_id'])) : ''; + + $data_form = $this->model_forms->getFormById($form_id); + $data_form->fmb_data = json_decode($data_form->fmb_data); + $json['data'] = $data_form; + + // temp + $tmp_addon_names = $this->model_addon->getActiveAddonsNamesOnBack($form_id); + + $tmp_addon = array(); + + foreach ( $tmp_addon_names as $key => $value) { + $tmp_data = $this->model_addon_details->getAddonDataByForm($value, $form_id); + if ( ! empty($tmp_data)) { + $tmp_addon[ $value ] = json_decode($tmp_data->adet_data, true); + } + } + + $json['addons'] = $tmp_addon; + + header('Content-Type: application/json'); + echo json_encode($json); + die(); + } + + /** + * Forms::list_uiforms() + * + * @return + */ + public function list_uiforms($offset = 0) + { + + $filter_data = get_option('zgfm_listform_searchfilter', true); + + $data2 = array(); + if ( empty($filter_data)) { + $data2['per_page'] = intval($this->per_page); + $data2['search_txt'] = ''; + $data2['orderby'] = 'asc'; + } else { + $data2['per_page'] = isset($filter_data['per_page'])?intval($filter_data['per_page']):'5'; + $data2['search_txt'] = isset($filter_data['search_txt'])?$filter_data['search_txt']:''; + $data2['orderby'] = isset($filter_data['orderby'])?$filter_data['orderby']:''; + } + + $offset = ( isset($_GET['offset']) ) ? Uiform_Form_Helper::sanitizeInput($_GET['offset']) : 0; + $data2['offset'] = $offset; + + $form_data = $this->model_forms->ListTotals(); + + $data2['all'] = $form_data->r_all; + $data2['trash'] = $form_data->r_trash; + $data2['subcurrent'] = 1; + $data2['subsubsub'] = List_data::get()->subsubsub($data2); + + $this->template->loadPartial('layout', 'forms/list_forms', $data2); + } + + + + /** + * Show trash list + * + * @return void + */ + public function list_trash() + { + + $filter_data = get_option('zgfm_listform_searchfilter', true); + $data2 = array(); + if ( empty($filter_data)) { + $data2['per_page'] = intval($this->per_page); + $data2['orderby'] = 'asc'; + } else { + $data2['per_page'] = intval($filter_data['per_page']??''); + $data2['orderby'] = $filter_data['orderby']??''; + } + + $offset = ( isset($_GET['offset']) ) ? Uiform_Form_Helper::sanitizeInput($_GET['offset']) : 0; + $data2['offset'] = $offset; + + $form_data = $this->model_forms->ListTotals(); + $data2['title'] = __('Forms in trash', 'FRocket_admin'); + $data2['all'] = $form_data->r_all; + $data2['trash'] = $form_data->r_trash; + $data2['header_buttons'] = List_data::get()->list_detail_form_headerbuttons(); + $data2['script_trigger'] = 'zgfm_back_general.formslist_trashsearch_process();'; + $data2['subcurrent'] = 2; + $data2['subsubsub'] = List_data::get()->subsubsub($data2); + + $content = List_data::get()->show_list($data2); + //echo self::loadPartial2( 'layout.php', $content); + echo $this->template->loadPartial2('layout', $content); + } + + + /** + * List trash forms + * + * @return void + */ + public function ajax_trashformlist_sendfilter() + { + + $data_filter = ( isset($_POST['data_filter']) && $_POST['data_filter'] ) ? $_POST['data_filter'] : ''; + + $opt_save = ( isset($_POST['opt_save']) && $_POST['opt_save'] ) ? Uiform_Form_Helper::sanitizeInput($_POST['opt_save']) : 0; + $opt_offset = ( isset($_POST['opt_offset']) && $_POST['opt_offset'] ) ? Uiform_Form_Helper::sanitizeInput($_POST['opt_offset']) : 0; + + parse_str($data_filter, $data_filter_arr); + + $per_page = $data_filter_arr['zgfm-listform-pref-perpage']; + $orderby = $data_filter_arr['zgfm-listform-pref-orderby']; + + $data = array(); + $data['per_page'] = $per_page; + $data['orderby'] = $orderby; + + if ( intval($opt_save) === 1) { + update_option('zgfm_listform_trash', $data); + } + + $data['segment'] = 0; + $data['offset'] = $opt_offset; + + $result = $this->ajax_trashformlist_refresh($data); + + $json = array(); + $json['content'] = $result; + + header('Content-Type: application/json'); + echo json_encode($json); + die(); + } + + /** + * get forms in trash + * + * @param [type] $data + * @return void + */ + public function ajax_trashformlist_refresh($data) + { + + $this->load->library('pagination'); + + $offset = $data['offset']; + + // list all forms + $config = array(); + $config['base_url'] = site_url() . 'formbuilder/forms/list_trash'; + + $tmp = $this->model_forms->ListTotals(); + $config['total_rows'] = $tmp->r_trash; + $config['per_page'] = $data['per_page']; + $config['first_link'] = 'First'; + $config['last_link'] = 'Last'; + $config['full_tag_open'] = '
      '; + $config['full_tag_close'] = '
    '; + $config['first_tag_open'] = '
  • '; + $config['first_tag_close'] = '
  • '; + $config['last_tag_open'] = '
  • '; + $config['last_tag_close'] = '
  • '; + $config['cur_tag_open'] = '
  • '; + $config['cur_tag_close'] = '
  • '; + $config['next_tag_open'] = '
  • '; + $config['next_tag_close'] = '
  • '; + $config['prev_tag_open'] = '
  • '; + $config['prev_tag_close'] = '
  • '; + $config['num_tag_open'] = '
  • '; + $config['num_tag_close'] = '
  • '; + $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; + + $data2 = array(); + $data2['per_page'] = $data['per_page']; + $data2['segment'] = $offset; + $data2['orderby'] = $data['orderby']; + $data2['query'] = $this->model_forms->getListTrashFormsFiltered($data2); + $data2['pagination'] = $this->pagination->create_links(); + $data2['obj_list_data'] = List_data::get(); + $data2['is_trash'] = 1; + + //$data2['list_buttons'] = List_data::get()->list_detail_form_buttons(); + ///$content=List_data::get()->list_detail($data3); + return List_data::get()->list_detail($data2); + + //return self::render_template( 'formbuilder/views/forms/list_forms_table.php', $data3 ); + } + + /** + * list forms + * + * @return void + */ + public function ajax_formlist_sendfilter() + { + + $data_filter = ( isset($_POST['data_filter']) && $_POST['data_filter'] ) ? $_POST['data_filter'] : ''; + + $opt_save = ( isset($_POST['opt_save']) && $_POST['opt_save'] ) ? Uiform_Form_Helper::sanitizeInput($_POST['opt_save']) : 0; + $opt_offset = ( isset($_POST['opt_offset']) && $_POST['opt_offset'] ) ? Uiform_Form_Helper::sanitizeInput($_POST['opt_offset']) : 0; + + parse_str($data_filter, $data_filter_arr); + + $per_page = isset($data_filter_arr['zgfm-listform-pref-perpage']) ? $data_filter_arr['zgfm-listform-pref-perpage'] : ''; + $search_txt = isset($data_filter_arr['zgfm-listform-pref-search']) ? $data_filter_arr['zgfm-listform-pref-search'] : ''; + $orderby = isset($data_filter_arr['zgfm-listform-pref-orderby']) ? $data_filter_arr['zgfm-listform-pref-orderby'] : ''; + + $data = array(); + $data['per_page'] = $per_page; + $data['search_txt'] = $search_txt; + $data['orderby'] = $orderby; + + if ( intval($opt_save) === 1) { + update_option('zgfm_listform_searchfilter', $data); + } + + $data['segment'] = 0; + $data['offset'] = $opt_offset; + + // self::$_models['formbuilder']['form']->getListFormsFiltered($data); + + $result = $this->ajax_formlist_refresh($data); + + $json = array(); + $json['content'] = $result; + + header('Content-Type: application/json'); + echo json_encode($json); + die(); + } + + public function ajax_formlist_refresh($data) + { + + $this->load->library('pagination'); + + $offset = $data['offset']; + + // list all forms + $config = array(); + $config['base_url'] = site_url() . 'formbuilder/forms/list_uiforms'; + $config['total_rows'] = $this->model_forms->CountForms(); + $config['per_page'] = $data['per_page']; + $config['first_link'] = 'First'; + $config['last_link'] = 'Last'; + $config['full_tag_open'] = '
      '; + $config['full_tag_close'] = '
    '; + $config['first_tag_open'] = '
  • '; + $config['first_tag_close'] = '
  • '; + $config['last_tag_open'] = '
  • '; + $config['last_tag_close'] = '
  • '; + $config['cur_tag_open'] = '
  • '; + $config['cur_tag_close'] = '
  • '; + $config['next_tag_open'] = '
  • '; + $config['next_tag_close'] = '
  • '; + $config['prev_tag_open'] = '
  • '; + $config['prev_tag_close'] = '
  • '; + $config['num_tag_open'] = '
  • '; + $config['num_tag_close'] = '
  • '; + $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; + + $data2 = array(); + $data2['per_page'] = $data['per_page']; + $data2['segment'] = $offset; + $data2['search_txt'] = $data['search_txt']; + $data2['orderby'] = $data['orderby']; + + $data3 = array(); + $data3['query'] = $this->model_forms->getListFormsFiltered($data2); + $data3['pagination'] = $this->pagination->create_links(); + return $this->load->view('formbuilder/forms/list_forms_table', $data3, true); + } + + + /** + * Forms::edit_uiform() + * + * @return + */ + public function edit_uiform() + { + $data = array(); + echo $this->load->view('formbuilder/forms/edit_form', $data, true); + } + + /** + * Forms::create_uiform() + * + * @return + */ + 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; + $data['action'] = 'create_uiform'; + $data['obj_sfm'] = Uiform_Form_Helper::get_font_library(); + + if ( intval($data['form_id']) > 0) { + $formdata = $this->model_forms->getFormById($data['form_id']); + + /* + * delete after a month + $data['uifm_frm_invoice_tpl_enable']=$formdata->fmb_inv_tpl_st; + $data['uifm_frm_invoice_tpl_content']=$formdata->fmb_inv_tpl_html; + $data['uifm_frm_record_tpl_enable']=$formdata->fmb_rec_tpl_st; + $data['uifm_frm_record_tpl_content']=$formdata->fmb_rec_tpl_html;*/ + } + $data['addons_actions'] = self::$_addons_actions; + $pdf_paper_size = array( + '4a0' => array( 0, 0, 4767.87, 6740.79 ), + '2a0' => array( 0, 0, 3370.39, 4767.87 ), + 'a0' => array( 0, 0, 2383.94, 3370.39 ), + 'a1' => array( 0, 0, 1683.78, 2383.94 ), + 'a2' => array( 0, 0, 1190.55, 1683.78 ), + 'a3' => array( 0, 0, 841.89, 1190.55 ), + 'a4' => array( 0, 0, 595.28, 841.89 ), + 'a5' => array( 0, 0, 419.53, 595.28 ), + 'a6' => array( 0, 0, 297.64, 419.53 ), + 'a7' => array( 0, 0, 209.76, 297.64 ), + 'a8' => array( 0, 0, 147.40, 209.76 ), + 'a9' => array( 0, 0, 104.88, 147.40 ), + 'a10' => array( 0, 0, 73.70, 104.88 ), + 'b0' => array( 0, 0, 2834.65, 4008.19 ), + 'b1' => array( 0, 0, 2004.09, 2834.65 ), + 'b2' => array( 0, 0, 1417.32, 2004.09 ), + 'b3' => array( 0, 0, 1000.63, 1417.32 ), + 'b4' => array( 0, 0, 708.66, 1000.63 ), + 'b5' => array( 0, 0, 498.90, 708.66 ), + 'b6' => array( 0, 0, 354.33, 498.90 ), + 'b7' => array( 0, 0, 249.45, 354.33 ), + 'b8' => array( 0, 0, 175.75, 249.45 ), + 'b9' => array( 0, 0, 124.72, 175.75 ), + 'b10' => array( 0, 0, 87.87, 124.72 ), + 'c0' => array( 0, 0, 2599.37, 3676.54 ), + 'c1' => array( 0, 0, 1836.85, 2599.37 ), + 'c2' => array( 0, 0, 1298.27, 1836.85 ), + 'c3' => array( 0, 0, 918.43, 1298.27 ), + 'c4' => array( 0, 0, 649.13, 918.43 ), + 'c5' => array( 0, 0, 459.21, 649.13 ), + 'c6' => array( 0, 0, 323.15, 459.21 ), + 'c7' => array( 0, 0, 229.61, 323.15 ), + 'c8' => array( 0, 0, 161.57, 229.61 ), + 'c9' => array( 0, 0, 113.39, 161.57 ), + 'c10' => array( 0, 0, 79.37, 113.39 ), + 'ra0' => array( 0, 0, 2437.80, 3458.27 ), + 'ra1' => array( 0, 0, 1729.13, 2437.80 ), + 'ra2' => array( 0, 0, 1218.90, 1729.13 ), + 'ra3' => array( 0, 0, 864.57, 1218.90 ), + 'ra4' => array( 0, 0, 609.45, 864.57 ), + 'sra0' => array( 0, 0, 2551.18, 3628.35 ), + 'sra1' => array( 0, 0, 1814.17, 2551.18 ), + 'sra2' => array( 0, 0, 1275.59, 1814.17 ), + 'sra3' => array( 0, 0, 907.09, 1275.59 ), + 'sra4' => array( 0, 0, 637.80, 907.09 ), + 'letter' => array( 0, 0, 612.00, 792.00 ), + 'half-letter' => array( 0, 0, 396.00, 612.00 ), + 'legal' => array( 0, 0, 612.00, 1008.00 ), + 'ledger' => array( 0, 0, 1224.00, 792.00 ), + 'tabloid' => array( 0, 0, 792.00, 1224.00 ), + 'executive' => array( 0, 0, 521.86, 756.00 ), + 'folio' => array( 0, 0, 612.00, 936.00 ), + 'commercial #10 envelope' => array( 0, 0, 684, 297 ), + 'catalog #10 1/2 envelope' => array( 0, 0, 648, 864 ), + '8.5x11' => array( 0, 0, 612.00, 792.00 ), + '8.5x14' => array( 0, 0, 612.00, 1008.0 ), + '11x17' => array( 0, 0, 792.00, 1224.00 ), + ); + $data['pdf_paper_size'] = $pdf_paper_size; + + $data['fields_fastload'] = get_option('zgfm_fields_fastload', 0); + + // $data['modules_tab_extension']= self::$_modules['addon']['backend']->addons_doActions('back_exttab_block'); + + $data['modules_tab_extension'] = modules::run('addon/zfad_backend/addons_doActions', 'back_exttab_block', true); + + $this->template->loadPartial('layout-editform', 'forms/create_form', $data); + } + + /** + * Forms::preview_fields() + * + * @return + */ + public function preview_fields() + { + $data = array(); + echo $this->load->view('formbuilder/forms/preview_fields', $data, true); + } + + /** + * Forms::getcode() + * + * @return + */ + public function getcode() + { + $data = array(); + + $id_form = ( isset($_POST['form_id']) ) ? Uiform_Form_Helper::sanitizeInput(trim($_POST['form_id'])) : ''; + $query = $this->db->get_where($this->model_forms->table, array( 'fmb_id' => $id_form ), 1); + if ( $query->num_rows() === 1) { + $data = array(); + + // get data from form + $form_data = $this->model_forms->getFormById_2($id_form); + $form_data_onsubm = json_decode($form_data->fmb_data2, true); + + $onload_scroll = ( isset($form_data_onsubm['main']['onload_scroll']) ) ? $form_data_onsubm['main']['onload_scroll'] : '1'; + + $preload_noconflict = ( isset($form_data_onsubm['main']['preload_noconflict']) ) ? $form_data_onsubm['main']['preload_noconflict'] : '1'; + + $temp = array(); + $temp['id_form'] = $id_form; + $temp['site_url'] = site_url(); + $temp['base_url'] = base_url(); + + $data['script'] = escape_text($this->load->view('formbuilder/forms/get_code_widget', $temp, true)); + + $content = ''; + $content = site_url() . 'formbuilder/frontend/viewform/?form=' . $id_form; + $data['url'] = escape_text($content); + + $temp = array(); + $temp['url_form'] = $data['url'] . '&lmode=1'; + $temp['base_url'] = base_url(); + $temp['form_id'] = $id_form; + + $data['iframe'] = escape_text($this->load->view('formbuilder/forms/get_code_iframe', $temp, true)); + + $json = array(); + $json['html_title'] = __('Shortcodes', 'FRocket_admin'); + + $cached_content = modules::run('formbuilder/frontend/generate_cache', $id_form); + + $data['cached_scripts'] = escape_text($cached_content['scripts']); + $data['cached_content'] = escape_text($cached_content['html']); + + $json['html'] = $this->load->view('formbuilder/forms/getcode', $data, true); + // return data to ajax callback + header('Content-type: text/html'); + echo json_encode($json); + } else { + } + } + + /** + * Forms::form_success() + * + * @return + */ + public function form_success() + { + + $data = array(); + $id_form = ( isset($_POST['form_id']) ) ? Uiform_Form_Helper::sanitizeInput(trim($_POST['form_id'])) : ''; + + $query = $this->db->get_where($this->model_forms->table, array( 'fmb_id' => $id_form ), 1); + if ( $query->num_rows() === 1) { + $data = array(); + // get data from form + $form_data = $this->model_forms->getFormById_2($id_form); + $form_data_onsubm = json_decode($form_data->fmb_data2, true); + + $onload_scroll = ( isset($form_data_onsubm['main']['onload_scroll']) ) ? $form_data_onsubm['main']['onload_scroll'] : '1'; + + $preload_noconflict = ( isset($form_data_onsubm['main']['preload_noconflict']) ) ? $form_data_onsubm['main']['preload_noconflict'] : '1'; + + $temp = array(); + $temp['id_form'] = $id_form; + $temp['site_url'] = site_url(); + $temp['base_url'] = base_url(); + $temp['onload_scroll'] = $onload_scroll; + $temp['preload_noconflict'] = $preload_noconflict; + + $data['script'] = escape_text($this->load->view('formbuilder/forms/get_code_widget', $temp, true)); + $data['id_form'] = $id_form; + $content = ''; + $content = site_url() . 'formbuilder/frontend/viewform/?form=' . $id_form; + $data['url'] = escape_text($content); + + $temp = array(); + $temp['url_form'] = $data['url'] . '&lmode=1'; + $temp['base_url'] = base_url(); + $temp['form_id'] = $id_form; + + $data['iframe'] = escape_text($this->load->view('formbuilder/forms/get_code_iframe', $temp, true)); + + // echo $this->load->view('formbuilder/forms/form_success', $data, true); + + $json = array(); + $json['html_title'] = __('Shortcodes', 'FRocket_admin'); + $json['html'] = $this->load->view('formbuilder/forms/form_success', $data, true); + + // return data to ajax callback + header('Content-type: text/html'); + echo json_encode($json); + die(); + } else { + } + } } diff --git a/application/modules/formbuilder/controllers/frontend.php b/application/modules/formbuilder/controllers/frontend.php index a400a582..e1472bd5 100755 --- a/application/modules/formbuilder/controllers/frontend.php +++ b/application/modules/formbuilder/controllers/frontend.php @@ -11,10 +11,10 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: intranet.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } /** @@ -26,2771 +26,2761 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version Release: 1.00 - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -class Frontend extends FrontendController { - - const VERSION = '1.2'; - - private $flag_submitted = 0; - private $form_response = array(); - private $current_cost = array(); - private $current_form_id = ''; - private $form_rec_msg_summ = ''; - private $form_email_err = array(); - private $form_cur_data = array(); - private $form_cur_data2 = array(); - - private $format_price_conf = array(); - - const PREFIX = 'wprofmr_'; - - /** - * Frontend::__construct() - * - * @return - */ - function __construct() { - - parent::__construct(); - $this->load->language_alt( model_settings::$db_config['language'] ); - $this->template->set( 'controller', $this ); - $this->load->model( 'model_fields' ); - $this->load->model( 'model_forms' ); - $this->load->model( 'model_record' ); - $this->load->model( 'visitor/model_visitor' ); - $this->load->model( 'visitor/model_visitor_error' ); - $this->load->model( 'gateways/model_gateways' ); - $this->load->model( 'gateways/model_gateways_records' ); - $this->load->library( 'cache' ); - /* - shortcodes*/ - // add_shortcode('uifm_cost_total', array(&$this, 'shortcode_uifm_cost_total') ); - add_shortcode( 'uifm_wrap', array( &$this, 'shortcode_uifm_recvar_wrap' ) ); - add_shortcode( 'uifm_recvar', array( &$this, 'shortcode_uifm_recvar' ) ); - add_shortcode( 'zgfm_rfvar', array( &$this, 'shortcode_uifm_recfvar' ) ); - add_shortcode( 'uifm_var', array( &$this, 'shortcode_uifm_form_var' ) ); - - /*shortcodes*/ - add_shortcode( 'uifm_symbol', array( &$this, 'shortcode_uifm_symbol' ) ); - add_shortcode( 'uifm_total', array( &$this, 'shortcode_uifm_total' ) ); - add_shortcode( 'uifm_currency', array( &$this, 'shortcode_uifm_currency' ) ); - add_shortcode( 'uifm_summary', array( &$this, 'shortcode_uifm_summary' ) ); - add_shortcode( 'uifm_summary_link', array( &$this, 'shortcode_uifm_summary_link' ) ); - add_shortcode( 'uifm_price', array( &$this, 'shortcode_uifm_price' ) ); - - add_shortcode( 'uifm_tax', array( &$this, 'shortcode_uifm_tax' ) ); - add_shortcode( 'uifm_subtotal', array( &$this, 'shortcode_uifm_subtotal' ) ); - - /*shortcode calc*/ - add_shortcode( 'zgfm_fvar', array( &$this, 'shortcode_uifm_form_fvar' ) ); - - // check update - $this->auth->checkupdate(); - } - - public function shortcode_uifm_tax( $atts ) { - - ob_start(); - - ?> - 0 - - 0 - - - 0'; - } - - public function shortcode_uifm_currency( $atts ) { - - ob_start(); - ?> - - '5', - 'heading' => '', - 'hide_cur_code' => '0', - 'hide_cur_symbol' => '0', - ), - $atts - ); - - ob_start(); - ?> - - - - - - - - - - - - - - 'Show summary', - ), - $atts - ); - - ob_start(); - ?> - - 0'; - } - - /** - * Frontend::index() - * Get all fields information by form id - * - * @return array - */ - public function index() { - - $form_id = ( $this->input->get( 'form' ) ) ? $this->input->get( 'form' ) : 0; - $website = 'cmsest'; - $ip = isset( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : ''; - if ( ! isset( $_COOKIE[ $website ] ) ) { - $user_agent = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : ''; - $hash = hash( 'crc32', md5( $ip . $user_agent ) ); - setcookie( $website, $hash, time() + ( 60 * 60 * 24 * 30 ), '/' ); - } else { - $hash = $_COOKIE[ $website ]; - } - $agent = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : ''; - $referer = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : ''; - - // visitor data - /* - $data3 = array(); - $data3['vis_uniqueid'] = $hash; - $data3['vis_user_agent'] = $agent; - $data3['vis_page'] = $_SERVER['REQUEST_URI']; - $data3['vis_referer'] = $referer; - $data3['vis_ip'] = $_SERVER['REMOTE_ADDR']; - $this->db->set($data3); - $this->db->insert($this->model_visitor->table);*/ - - $data = array(); - if ( $form_id == 0 ) { - $rdata = $this->model_forms->getFormDefault(); - if ( empty( $rdata ) ) { - $forms = $this->model_forms->getListActiveForms(); - if ( ! empty( $forms ) ) { - foreach ( $forms as $value ) { - $rdata = $this->model_forms->getFormById( $value->fmb_id ); - break 1; - } - } - } - } else { - - $rdata = $this->model_forms->getFormById( $form_id ); - } - - if ( ! empty( $rdata ) ) { - $data = array(); - $data['html_content'] = $rdata->fmb_html; - $data['forms'] = $this->model_forms->getListActiveForms(); - - $data['uniqueid'] = $hash; - - // get data from form - $form_data = $this->model_forms->getFormById_2( $rdata->fmb_id ); - $form_data_onsubm = json_decode( $form_data->fmb_data2, true ); - - $preload_noconflict = ( isset( $form_data_onsubm['main']['preload_noconflict'] ) ) ? $form_data_onsubm['main']['preload_noconflict'] : '1'; - - $temp = array(); - $temp['id_form'] = $rdata->fmb_id; - $temp['site_url'] = site_url(); - $temp['base_url'] = base_url(); - - $temp['preload_noconflict'] = $preload_noconflict; - - $data['script'] = $this->load->view( 'formbuilder/forms/get_code_widget', $temp, true ); - - $message = ( $this->input->get( 'message' ) ) ? $this->input->get( 'message' ) : ''; - if ( ! empty( $message ) ) { - switch ( $message ) { - case 'ppsuccess'; - $data['message'] = __( 'paypal success message', 'FRocket_admin' ); - break; - case 'pperror'; - $data['message'] = __( 'error found while submitting', 'FRocket_admin' ); - break; - case 'offlinesuccess'; - $data['message'] = __( 'Offline success', 'FRocket_admin' ); - break; - default; - break; - } - } - } - - $this->template->loadPartial( 'frontend/layout', 'frontend/index', $data ); - } - - /* - * Generate cached form - */ - public function generate_cache( $form_id ) { - - $this->auth->authenticate( true ); - - $output = array(); - $output['scripts'] = ''; - $output['html'] = ''; - - if ( intval( $form_id ) === 0 ) { - return $output; - } - - $rdata = $this->model_forms->getFormById( $form_id ); - - $response = array(); - $form_data_onsubm = json_decode( $rdata->fmb_data2, true ); - $onload_scroll = ( isset( $form_data_onsubm['main']['onload_scroll'] ) ) ? $form_data_onsubm['main']['onload_scroll'] : '1'; - - $preload_noconflict = ( isset( $form_data_onsubm['main']['preload_noconflict'] ) ) ? $form_data_onsubm['main']['preload_noconflict'] : '1'; - - // load form variables - $form_variables = array(); - $form_variables['_uifmvar']['addon'] = self::$_addons_jsactions; - $form_variables['_uifmvar']['is_demo'] = 0; - $form_variables['_uifmvar']['is_dev'] = 0; - $form_variables['onload_scroll'] = $onload_scroll; - $form_variables['preload_noconflict'] = $preload_noconflict; - $enqueue_scripts = do_filter( 'zgfm_front_enqueue_scripts', array() ); - - $data_scripts = array(); - $data_styles = array(); - if ( ! empty( $enqueue_scripts ) && is_array( $enqueue_scripts ) ) { - - foreach ( $enqueue_scripts as $key => $value ) { - if ( ! empty( $value ) && is_array( $value ) ) { - foreach ( $value as $key2 => $value2 ) { - if ( ! empty( $value2 ) && is_array( $value2 ) ) { - foreach ( $value2 as $key3 => $value3 ) { - - switch ( strval( $key3 ) ) { - case 'scripts': - foreach ( $value3 as $key4 => $value4 ) { - $data_scripts[] = $value4['src']; - - } - break; - case 'styles': - foreach ( $value3 as $key4 => $value4 ) { - $data_styles[] = $value4['src']; - - } - break; - default: - break; - } - } - } - } - } - } - } - $data_scripts = array_unique( $data_scripts ); - $data_styles = array_unique( $data_styles ); - $response['site_url'] = site_url(); - $response['base_url'] = base_url(); - $response['id_form'] = $form_id; - $response['scripts'] = $data_scripts; - $response['styles'] = $data_styles; - $form_variables['ajaxurl'] = ''; - $form_variables['uifm_baseurl'] = base_url(); - $form_variables['uifm_siteurl'] = site_url(); - $form_variables['uifm_sfm_baseurl'] = base_url() . 'libs/styles-font-menu/styles-fonts/png/'; - $form_variables['imagesurl'] = base_url() . 'assets/frontend/images'; - $response['rockfm_vars_arr'] = $form_variables; - - if ( ! empty( $rdata ) ) { - $response['html_content'] = do_shortcode( $rdata->fmb_html ); - } - - $output['scripts'] = $this->load->view( 'formbuilder/forms/get_code_cached_scripts', $response, true ); - $output['html'] = $this->load->view( 'formbuilder/forms/get_code_cached_html', $response, true ); - - return $output; - } - - /** - * Frontend::getform() - * Get form by form id - * - * @return array - */ - public function getform() { - - $form_id = ( $this->input->post( 'id' ) ) ? Uiform_Form_Helper::sanitizeInput( $this->input->post( 'id' ) ) : 0; - - $website = 'uiform'; - $ip = isset( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : ''; - if ( ! isset( $_COOKIE[ $website ] ) ) { - $user_agent = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : ''; - $hash = hash( 'crc32', md5( $ip . $user_agent ) ); - setcookie( $website, $hash, time() + ( 60 * 60 * 24 * 30 ), '/' ); - } else { - $hash = $_COOKIE[ $website ]; - } - $agent = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : ''; - $referer = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : ''; - - // visitor data - /* - $data3 = array(); - $data3['vis_uniqueid'] = $hash; - $data3['vis_user_agent'] = $agent; - $data3['vis_page'] = $_SERVER['REQUEST_URI']; - $data3['vis_referer'] = $referer; - $data3['vis_ip'] = $_SERVER['REMOTE_ADDR']; - $this->db->set($data3); - $this->db->insert($this->model_visitor->table);*/ - - $data = array(); - $response = array(); - if ( intval( $form_id ) === 0 ) { - return; - } - - $rdata = $this->model_forms->getAvailableFormById( $form_id ); - if ( empty( $rdata ) ) { - $response['success'] = '0'; - $response['html_content'] = ''; - } else { - - $form_data_onsubm = json_decode( $rdata->fmb_data2, true ); - $onload_scroll = ( isset( $form_data_onsubm['main']['onload_scroll'] ) ) ? $form_data_onsubm['main']['onload_scroll'] : '1'; - - $preload_noconflict = ( isset( $form_data_onsubm['main']['preload_noconflict'] ) ) ? $form_data_onsubm['main']['preload_noconflict'] : '1'; - - // load form variables - $form_variables = array(); - $form_variables['_uifmvar']['addon'] = self::$_addons_jsactions; - $form_variables['_uifmvar']['is_demo'] = 0; - $form_variables['_uifmvar']['is_dev'] = 0; - $form_variables['onload_scroll'] = $onload_scroll; - $form_variables['preload_noconflict'] = $preload_noconflict; - $form_variables['enqueue_scripts'] = do_filter( 'zgfm_front_enqueue_scripts', array() ); - $form_variables['ajaxurl'] = ''; - $form_variables['uifm_baseurl'] = base_url(); - $form_variables['uifm_siteurl'] = site_url(); - $form_variables['uifm_sfm_baseurl'] = base_url() . 'libs/styles-font-menu/styles-fonts/png/'; - $form_variables['imagesurl'] = base_url() . 'assets/frontend/images'; - $response['rockfm_vars_arr'] = $form_variables; - - if ( ! empty( $rdata ) ) { - $response['success'] = '1'; - $response['html_content'] = Uiform_Form_Helper::encodeHex( do_shortcode( $rdata->fmb_html ) ); - } - } - $data = array(); - $data['json'] = $response; - - $this->load->view( 'html_view', $data ); - } - - - public function ajax_payment_seeinvoice() { - $id_rec = ( isset( $_POST['form_r_id'] ) ) ? Uiform_Form_Helper::sanitizeInput( $_POST['form_r_id'] ) : ''; - $temp = $this->model_record->getFormDataById( $id_rec ); - $form_id = $temp->form_fmb_id; - $form_data = $this->model_forms->getFormById_2( $form_id ); - $form_data_onsubm = json_decode( $form_data->fmb_data2, true ); - $pdf_show_onpage = ( isset( $form_data_onsubm['main']['pdf_show_onpage'] ) ) ? $form_data_onsubm['main']['pdf_show_onpage'] : '0'; - - $resp = array(); - $resp['show_summary_title'] = __( 'Invoice', 'frocket_front' ); - if ( intval( $pdf_show_onpage ) === 1 ) { - $resp['show_summary_title'] = ' ' . __( 'Export to PDF', 'frocket_front' ) . ''; - } - - $data = array(); - $data['base_url'] = base_url() . '/'; - $data['form_id'] = $form_id; - $data['url_form'] = site_url() . 'formbuilder/frontend/pdf_show_invoice/?uifm_mode=pdf&is_html=1&id=' . $id_rec; - $resp['show_summary'] = Uiform_Form_Helper::encodeHex( $this->load->view( 'formbuilder/frontend/form_summary_custom', $data, true ) ); - - // return data to ajax callback - $data = array(); - $data['json'] = $resp; - - $this->load->view( 'html_view', $data ); - } - - public function ajax_payment_seesummary() { - $id_rec = ( isset( $_POST['form_r_id'] ) ) ? Uiform_Form_Helper::sanitizeInput( $_POST['form_r_id'] ) : ''; - $temp = $this->model_record->getFormDataById( $id_rec ); - $form_id = $temp->form_fmb_id; - $form_data = $this->model_forms->getFormById_2( $form_id ); - $form_data_onsubm = json_decode( $form_data->fmb_data2, true ); - $pdf_show_onpage = ( isset( $form_data_onsubm['main']['pdf_show_onpage'] ) ) ? $form_data_onsubm['main']['pdf_show_onpage'] : '0'; - - $resp = array(); - - $resp['show_summary_title'] = __( 'Order summary', 'frocket_front' ); - if ( intval( $pdf_show_onpage ) === 1 ) { - $resp['show_summary_title'] .= ' ' . __( 'Export to PDF', 'frocket_front' ) . ''; - } - - if ( isset( $temp->fmb_rec_tpl_st ) && intval( $temp->fmb_rec_tpl_st ) === 1 ) { - - $data = array(); - $data['base_url'] = base_url() . '/'; - $data['form_id'] = $form_id; - $data['url_form'] = site_url() . 'formbuilder/frontend/pdf_show_record/?uifm_mode=pdf&is_html=1&id=' . $id_rec; - $resp['show_summary'] = Uiform_Form_Helper::encodeHex( $this->load->view( 'formbuilder/frontend/form_summary_custom', $data, true ) ); - } else { - $resp['show_summary'] = Uiform_Form_Helper::encodeHex( do_shortcode( $this->get_summaryRecord( $id_rec ) ) ); - } - - $data = array(); - $data['json'] = $resp; - - $this->load->view( 'html_view', $data ); - } - - public function get_summaryInvoice() { - $id_rec = ( isset( $_GET['id'] ) ) ? Uiform_Form_Helper::sanitizeInput( $_GET['id'] ) : ''; - $form_id = ( isset( $_POST['form_id'] ) ) ? Uiform_Form_Helper::sanitizeInput( $_POST['form_id'] ) : ''; - - $name_fields = $this->model_record->getNameInvoiceField( $id_rec ); - $form_rec_data = $this->model_gateways_records->getInvoiceDataByFormRecId( $id_rec ); - if ( empty( $form_id ) ) { - $form_id = $form_rec_data->fmb_id; - } - - $form_data = json_decode( $form_rec_data->fmb_data, true ); - $form_data_currency = ( isset( $form_data['main']['price_currency'] ) ) ? $form_data['main']['price_currency'] : ''; - $form_data_invoice = ( isset( $form_data['invoice'] ) ) ? $form_data['invoice'] : ''; - - // price numeric format - $format_price_conf = array(); - $format_price_conf['price_format_st'] = ( isset( $form_data['main']['price_format_st'] ) ) ? $form_data['main']['price_format_st'] : '0'; - $format_price_conf['price_sep_decimal'] = ( isset( $form_data['main']['price_sep_decimal'] ) ) ? $form_data['main']['price_sep_decimal'] : '.'; - $format_price_conf['price_sep_thousand'] = ( isset( $form_data['main']['price_sep_thousand'] ) ) ? $form_data['main']['price_sep_thousand'] : ','; - $format_price_conf['price_sep_precision'] = ( isset( $form_data['main']['price_sep_precision'] ) ) ? $form_data['main']['price_sep_precision'] : '2'; - - $name_fields_check = array(); - - foreach ( $name_fields as $value ) { - $name_fields_check[ $value->fmf_uniqueid ]['fieldname'] = $value->fieldname; - $name_fields_check[ $value->fmf_uniqueid ]['id'] = $value->fmf_id; - } - - $data_record = $this->model_record->getRecordById( $id_rec ); - $record_user = json_decode( $data_record->fbh_data, true ); - $new_record_user = array(); - foreach ( $record_user as $key => $value ) { - - if ( isset( $name_fields_check[ $key ] ) && isset( $value['price_st'] ) && intval( $value['price_st'] ) === 1 ) { - $field_name = ''; - $field_id = ''; - $tmp_invoice_row = array(); - - $field_name = $name_fields_check[ $key ]['fieldname']; - $field_id = $name_fields_check[ $key ]['id']; - - $tmp_invoice_row['item_uniqueid'] = $key; - $tmp_invoice_row['item_id'] = $field_id; - // $tmp_invoice_row['item_desc']=$value['label']; - - if ( is_array( $value['input'] ) ) { - foreach ( $value['input'] as $key2 => $value2 ) { - - $tmp_invoice_row['item_qty'] = 1; - $tmp_invoice_row['item_desc'] = ''; - if ( isset( $value2['amount'] ) ) { - if ( isset( $value2['qty'] ) ) { - $tmp_invoice_row['item_qty'] = $value2['qty']; - $tmp_invoice_row['item_amount'] = $value2['amount']; - } else { - $tmp_invoice_row['item_amount'] = $value2['amount']; - } - } - - $tmp_inp_label = $value['label']; - if ( ! empty( $value2['label'] ) ) { - $tmp_inp_label .= ' - ' . $value2['label']; - } - $tmp_invoice_row['item_desc'] = $tmp_inp_label; - - $new_record_user[] = $tmp_invoice_row; - } - } else { - $tmp_invoice_row['item_qty'] = 1; - $tmp_invoice_row['item_desc'] .= ' ' . $value['input']; - $tmp_invoice_row['item_amount'] = ''; - $new_record_user[] = $tmp_invoice_row; - } - } - } - $data = array(); - - // processs tax - $form_data_tax_st = ( isset( $form_data['main']['price_tax_st'] ) ) ? $form_data['main']['price_tax_st'] : '0'; - $form_data_tax_val = ( isset( $form_data['main']['price_tax_val'] ) ) ? $form_data['main']['price_tax_val'] : ''; - - $tmp_amount_total = floatval( $form_rec_data->fbh_total_amount ); - if ( isset( $form_data_tax_st ) && intval( $form_data_tax_st ) === 1 ) { - $tmp_tax = ( floatval( $form_data_tax_val ) / 100 ); - $tmp_sub_total = ( $tmp_amount_total ) * ( 100 / ( 100 + ( 100 * $tmp_tax ) ) ); - $data['form_subtotal_amount'] = $tmp_sub_total; - $data['form_tax'] = $tmp_amount_total - $tmp_sub_total; - } - - $data['form_tax_enable'] = $form_data_tax_st; - $data['form_total_amount'] = $tmp_amount_total; - $data['form_mathcalc_st'] = ( isset( $form_data['calculation']['enable_st'] ) ) ? $form_data['calculation']['enable_st'] : '0'; - $data['form_currency'] = $form_data_currency; - $data['record_info'] = $new_record_user; - $data['price_format'] = $format_price_conf; - $data['invoice_id'] = $form_rec_data->pgr_id; - $data['invoice_date'] = date( 'F j, Y, g:i a', strtotime( $form_rec_data->created_date ) ); - - $data['invoice_from_info1'] = isset( $form_data_invoice['from_text1'] ) ? urldecode( $form_data_invoice['from_text1'] ) : ''; - $data['invoice_from_info2'] = isset( $form_data_invoice['from_text2'] ) ? urldecode( $form_data_invoice['from_text2'] ) : ''; - $data['invoice_from_info3'] = isset( $form_data_invoice['from_text3'] ) ? urldecode( $form_data_invoice['from_text3'] ) : ''; - $data['invoice_from_info4'] = isset( $form_data_invoice['from_text4'] ) ? urldecode( $form_data_invoice['from_text4'] ) : ''; - $data['invoice_from_info5'] = isset( $form_data_invoice['from_text5'] ) ? urldecode( $form_data_invoice['from_text5'] ) : ''; - $data['invoice_to_info1'] = isset( $form_data_invoice['to_text1'] ) ? urldecode( $this->model_record->getFieldOptRecord( $id_rec, '', $form_data_invoice['to_text1'], 'input' ) ) : ''; - $data['invoice_to_info2'] = isset( $form_data_invoice['to_text2'] ) ? urldecode( $this->model_record->getFieldOptRecord( $id_rec, '', $form_data_invoice['to_text2'], 'input' ) ) : ''; - $data['invoice_to_info3'] = isset( $form_data_invoice['to_text3'] ) ? urldecode( $this->model_record->getFieldOptRecord( $id_rec, '', $form_data_invoice['to_text3'], 'input' ) ) : ''; - $data['invoice_to_info4'] = isset( $form_data_invoice['to_text4'] ) ? urldecode( $this->model_record->getFieldOptRecord( $id_rec, '', $form_data_invoice['to_text4'], 'input' ) ) : ''; - $data['invoice_to_info5'] = isset( $form_data_invoice['to_text5'] ) ? urldecode( $form_data_invoice['to_text5'] ) : ''; - $form_summary = $this->load->view( 'formbuilder/frontend/form_invoice', $data, true ); - - return $form_summary; - } - - public function get_summaryRecord( $id_rec ) { - $form_id = ( isset( $_POST['form_id'] ) ) ? Uiform_Form_Helper::sanitizeInput( $_POST['form_id'] ) : ''; - - $name_fields = $this->model_record->getNameField( $id_rec ); - $form_rec_data = $this->model_record->getFormDataById( $id_rec ); - - $form_data = json_decode( $form_rec_data->fmb_data, true ); - - $form_data_currency = ( isset( $form_data['main']['price_currency'] ) ) ? $form_data['main']['price_currency'] : ''; - - // price numeric format - $format_price_conf = array(); - $format_price_conf['price_format_st'] = ( isset( $form_data['main']['price_format_st'] ) ) ? $form_data['main']['price_format_st'] : '0'; - $format_price_conf['price_sep_decimal'] = ( isset( $form_data['main']['price_sep_decimal'] ) ) ? $form_data['main']['price_sep_decimal'] : '.'; - $format_price_conf['price_sep_thousand'] = ( isset( $form_data['main']['price_sep_thousand'] ) ) ? $form_data['main']['price_sep_thousand'] : ','; - $format_price_conf['price_sep_precision'] = ( isset( $form_data['main']['price_sep_precision'] ) ) ? $form_data['main']['price_sep_precision'] : '2'; - - $name_fields_check = array(); - - $field_data_stored = array(); - - foreach ( $name_fields as $value ) { - $name_fields_check[ $value->fmf_uniqueid ] = $value->fieldname; - $field_data_stored[ $value->fmf_uniqueid ] = $value->fmf_data; - } - $data_record = $this->model_record->getRecordById( $id_rec ); - $record_user = json_decode( $data_record->fbh_data, true ); - $new_record_user = array(); - - foreach ( $record_user as $key => $value ) { - $field_name = ''; - if ( isset( $name_fields_check[ $key ] ) ) { - $field_name = $name_fields_check[ $key ]; - } - - $field_data = array(); - if ( isset( $field_data_stored[ $key ] ) ) { - $field_data = $field_data_stored[ $key ]; - $field_data = json_decode( $field_data, true ); - } - - $value['label'] = ( isset( $value['label'] ) ) ? $value['label'] : 'not assigned'; - - switch ( intval( $value['type'] ) ) { - case 12: - case 13: - $value_new = $value['input']; - // checking if image exists - if ( !empty($value_new) && @is_array( getimagesize( $value_new ) ) ) { - $value_new = ''; - } - - $new_record_user[] = array( - 'field' => $value['label'], - 'field_name' => $field_name, - 'type' => $value['type'], - 'price_lbl_show_st' => isset( $field_data['price']['lbl_show_st'] ) ? $field_data['price']['lbl_show_st'] : '0', - 'value' => $value_new, - ); - break; - default: - $new_record_user[] = array( - 'field' => $value['label'], - 'field_name' => $field_name, - 'type' => $value['type'], - 'price_lbl_show_st' => isset( $field_data['price']['lbl_show_st'] ) ? $field_data['price']['lbl_show_st'] : '0', - 'value' => $value['input'], - ); - break; - } - } - $data = array(); - - // processs tax - $form_data_tax_st = ( isset( $form_data['main']['price_tax_st'] ) ) ? $form_data['main']['price_tax_st'] : '0'; - $form_data_tax_val = ( isset( $form_data['main']['price_tax_val'] ) ) ? $form_data['main']['price_tax_val'] : ''; - - $tmp_amount_total = floatval( $form_rec_data->fbh_total_amount ); - if ( isset( $form_data_tax_st ) && intval( $form_data_tax_st ) === 1 ) { - $tmp_tax = ( floatval( $form_data_tax_val ) / 100 ); - $tmp_sub_total = ( $tmp_amount_total ) * ( 100 / ( 100 + ( 100 * $tmp_tax ) ) ); - $data['form_subtotal_amount'] = $tmp_sub_total; - $data['form_tax'] = $tmp_amount_total - $tmp_sub_total; - } - - $data['form_total_amount'] = $tmp_amount_total; - $data['form_currency'] = $form_data_currency; - $data['record_info'] = $new_record_user; - $data['price_format'] = $format_price_conf; - $form_summary = $this->load->view( 'formbuilder/frontend/form_summary', $data, true ); - return $form_summary; - } - - public function ajax_save_offlinepayment() { - $offline_return_url = ( isset( $_POST['offline_return_url'] ) ) ? Uiform_Form_Helper::sanitizeInput( $_POST['offline_return_url'] ) : ''; - $item_number = ( isset( $_POST['item_number'] ) ) ? Uiform_Form_Helper::sanitizeInput( $_POST['item_number'] ) : ''; - $form_id = ( isset( $_POST['form_id'] ) ) ? Uiform_Form_Helper::sanitizeInput( $_POST['form_id'] ) : ''; - - $data = array(); - $data['type_pg_id'] = 1; - $data['pgr_payment_status'] = 'completed'; - $data['pgr_data'] = json_encode( $_POST ); - $where = array( - 'pgr_id' => $item_number, - ); - - $this->db->set( $data ); - $this->db->where( 'pgr_id', $item_number ); - $this->db->update( $this->model_gateways_records->table ); - - $resp = array(); - $resp['success'] = 1; - $resp['return_url'] = $offline_return_url; - - $gt_data = $this->model_gateways_records->getRecordById( $item_number ); - $this->flag_submitted = $gt_data->fbh_id; - - if ( empty( $offline_return_url ) ) { - - // get data from form - $form_data = $this->model_forms->getFormById_2( $form_id ); - $form_data_onsubm = json_decode( $form_data->fmb_data2, true ); - // prepare message - $tmp_template_msg = ( isset( $form_data_onsubm['onsubm']['sm_successtext'] ) ) ? urldecode( $form_data_onsubm['onsubm']['sm_successtext'] ) : ''; - $tmp_template_msg = do_shortcode( $tmp_template_msg ); - - $resp['show_message'] = $tmp_template_msg; - } - - // return data to ajax callback - $data = array(); - $data['json'] = $resp; - - $this->load->view( 'html_view', $data ); - } - - public function uifm_set_newuser_cookie() { - $ip = isset( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : ''; - $user_agent = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : ''; - $hash = hash( 'crc32', md5( $ip . $user_agent ) ); - setcookie( 'uiform_costest', $hash, time() + ( 60 * 60 * 24 * 30 ), '/' ); - } - - public function shortcode_uifm_cost_total( $atts ) { - - $vars = shortcode_atts( - array( - 'heading' => __( 'Total cost', 'frocket_front' ), - ), - $atts - ); - - ob_start(); - ?> - - - - - - -
    :current_cost['symbol'] . $this->current_cost['total'] . ' ' . $this->current_cost['cur']; ?>
    - current_cost['st'] ) && intval( $this->current_cost['st'] ) === 1 ) { - return $str_output; - } else { - return ''; - } - - } - - public function shortcode_uifm_recvar_wrap( $atts, $content = null ) { - - $vars = shortcode_atts( - array( - 'id' => '', - 'atr1' => 'input', - 'opt' => '', // quick option - ), - $atts - ); - - $result = ''; - $output = ''; - - switch ( strval( $vars['opt'] ) ) { - case 'calc': - break; - default: - $f_data = $this->model_record->getFieldDataById( $this->flag_submitted, $vars['id'] ); - switch (intval($f_data->type)) { - case 16:case 17:case 18: - $output = $this->model_record->getFieldOptRecord( $this->flag_submitted, $f_data->type, $vars['id'], 'input','value' ); - break; - - default: - $output = $this->model_record->getFieldOptRecord( $this->flag_submitted, $f_data->type, $vars['id'], $vars['atr1'] ); - break; - } - - - - break; - } - - if ( $output != '' && $output!='0' ) { - $result = do_shortcode( $content ); - } else { - $result = ''; - } - - return $result; - - } - - public function shortcode_uifm_recvar( $atts ) { - - try { - $vars = shortcode_atts( - array( - 'id' => '', - 'atr1' => 'input', - 'atr2' => '', - 'atr3' => '', - 'atr4' => '', - ), - $atts - ); - - $f_data = $this->model_record->getFieldDataById( $this->flag_submitted, $vars['id'] ); - if ( ! isset( $f_data->type ) ) { - throw new Exception( __( 'field data is not cound. field:' . $vars['id'] ) ); - } - $output = $this->model_record->getFieldOptRecord( $this->flag_submitted, $f_data->type, $vars['id'], $vars['atr1'], $vars['atr2'] ); - - // apply price format - switch ( strval( $vars['atr3'] ) ) { - case 'price_format': - /* - * check if format price configuration is stored - */ - if ( empty( $this->format_price_conf ) ) { - $form_rec_data = $this->model_record->getFormDataById( $this->flag_submitted ); - $form_data = json_decode( $form_rec_data->fmb_data, true ); - // price numeric format - $format_price_conf = array(); - $format_price_conf['price_format_st'] = ( isset( $form_data['main']['price_format_st'] ) ) ? $form_data['main']['price_format_st'] : '0'; - $format_price_conf['price_sep_decimal'] = ( isset( $form_data['main']['price_sep_decimal'] ) ) ? $form_data['main']['price_sep_decimal'] : '.'; - $format_price_conf['price_sep_thousand'] = ( isset( $form_data['main']['price_sep_thousand'] ) ) ? $form_data['main']['price_sep_thousand'] : ','; - $format_price_conf['price_sep_precision'] = ( isset( $form_data['main']['price_sep_precision'] ) ) ? $form_data['main']['price_sep_precision'] : '2'; - $this->format_price_conf = $format_price_conf; - } - - $output = Uiform_Form_Helper::cformat_numeric( $this->format_price_conf, $output ); - - break; - case 'format': - switch ( strval( $vars['atr4'] ) ) { - case 'list': - //format to field with multiple options - switch ( strval( $f_data->type ) ) { - case '9': - case '11': - $tmpArr = explode( '^,^', $output ); - if ( is_array( $tmpArr ) ) { - $newString = '
      '; - foreach ( $tmpArr as $key => $value ) { - $newString .= '
    • ' . $value . '
    • '; - } - $newString .= '
    '; - $output = $newString; - } - - break; - - default: - # code... - break; - } - break; - case 'comma': - //format to field with multiple options - switch ( strval( $f_data->type ) ) { - case '9': - case '11': - $tmpArr = explode( '^,^', $output ); - if ( is_array( $tmpArr ) ) { - $output = str_replace( '^,^', ', ', $output ); - } - - break; - - default: - # code... - break; - } - break; - default: - break; - } - - break; - } - - if ( $output != '' ) { - return $output; - } else { - return ''; - } - } catch ( Exception $exception ) { - $data = array(); - $data['vars'] = $vars; - $data['error_debug'] = __METHOD__ . ' error: ' . $exception->getMessage(); - return ''; - } - - } - - - public function shortcode_uifm_recfvar( $atts ) { - - $vars = shortcode_atts( - array( - 'id' => '', - 'atr1' => 'input', - ), - $atts - ); - - switch ( strval( $vars['atr1'] ) ) { - case 'label': - ob_start(); - ?> - - - - - - - - '', - 'atr2' => '', - 'atr3' => '', - 'opt' => '', // quick option - ), - $atts - ); - $output = ''; - - if ( ! empty( $vars['opt'] ) ) { - switch ( (string) $vars['opt'] ) { - case 'calc': - ob_start(); - if ( isset( $vars['atr1'] ) && intval( $vars['atr1'] ) >= 0 ) { - ?> -
    - - - - - - 0 - - 0 - 0'; - break; - - } - } - - if ( $output != '' ) { - return $output; - } else { - return ''; - } - - } - - public function shortcode_uifm_form_var( $atts ) { - - $vars = shortcode_atts( - array( - 'atr1' => '0', // source 0=>fmb_data2; 1=>fmb_data - 'atr2' => '', - 'atr3' => '', - 'opt' => '', // quick option - ), - $atts - ); - $output = ''; - - $rec_id = $this->flag_submitted; - - if ( ! empty( $vars['opt'] ) ) { - switch ( (string) $vars['opt'] ) { - case 'calc': - $form_rec_data = $this->model_record->getVarOptRecord( 'calc_' . $vars['atr1'], $this->flag_submitted ); - $output = $form_rec_data; - break; - case 'form_currency_symbol': - case 'form_cur_symbol': - $form_data = $this->model_forms->getFormById_2( $this->current_form_id ); - $form_data_onsubm = json_decode( $form_data->fmb_data2, true ); - $output = $form_data_onsubm['main']['price_currency_symbol']; - break; - case 'form_currency_code': - case 'form_cur_code': - $form_data = $this->model_forms->getFormById_2( $this->current_form_id ); - $form_data_onsubm = json_decode( $form_data->fmb_data2, true ); - $output = $form_data_onsubm['main']['price_currency']; - break; - case 'form_total_amount': - case 'form_subtotal_amount': - case 'form_tax_amount': - $form_rec_data = $this->model_record->getFormDataById( $rec_id ); - if ( ! isset( $form_rec_data->fmb_data ) ) { - break 1; - } - $form_data = json_decode( $form_rec_data->fmb_data, true ); - - // price numeric format - $format_price_conf = array(); - $format_price_conf['price_format_st'] = ( isset( $form_data['main']['price_format_st'] ) ) ? $form_data['main']['price_format_st'] : '0'; - $format_price_conf['price_sep_decimal'] = ( isset( $form_data['main']['price_sep_decimal'] ) ) ? $form_data['main']['price_sep_decimal'] : '.'; - $format_price_conf['price_sep_thousand'] = ( isset( $form_data['main']['price_sep_thousand'] ) ) ? $form_data['main']['price_sep_thousand'] : ','; - $format_price_conf['price_sep_precision'] = ( isset( $form_data['main']['price_sep_precision'] ) ) ? $form_data['main']['price_sep_precision'] : '2'; - - $tmp_amount_total = 0; - $tmp_amount_subtotal = 0; - $tmp_amount_tax = 0; - - $tmp_output = $this->model_record->getOptRecordById( 'fbh_total_amount', $rec_id ); - if ( ! empty( $tmp_output ) && isset( $tmp_output->fbh_total_amount ) ) { - $tmp_amount_total = floatval( $tmp_output->fbh_total_amount ); - } - - // processs tax - $form_data_tax_st = ( isset( $form_data['main']['price_tax_st'] ) ) ? $form_data['main']['price_tax_st'] : '0'; - $form_data_tax_val = ( isset( $form_data['main']['price_tax_val'] ) ) ? $form_data['main']['price_tax_val'] : ''; - - if ( isset( $form_data_tax_st ) && intval( $form_data_tax_st ) === 1 ) { - $tmp_tax = ( floatval( $form_data_tax_val ) / 100 ); - $tmp_sub_total = ( $tmp_amount_total ) * ( 100 / ( 100 + ( 100 * $tmp_tax ) ) ); - $tmp_amount_subtotal = $tmp_sub_total; - $tmp_amount_tax = $tmp_amount_total - $tmp_sub_total; - } - - switch ( (string) $vars['opt'] ) { - case 'form_total_amount': - $output = Uiform_Form_Helper::cformat_numeric( $format_price_conf, $tmp_amount_total ); - break; - case 'form_subtotal_amount': - $output = Uiform_Form_Helper::cformat_numeric( $format_price_conf, $tmp_amount_subtotal ); - break; - case 'form_tax_amount': - $output = Uiform_Form_Helper::cformat_numeric( $format_price_conf, $tmp_amount_tax ); - break; - } - - break; - case 'rec_summ': - $data = $this->model_record->getFormDataById( $rec_id ); - $tmp_data = json_decode( $data->fbh_data, true ); - $form_data_onsubm = json_decode( $data->fmb_data2, true ); - - // price numeric format - $format_price_conf = array(); - $format_price_conf['price_format_st'] = ( isset( $form_data_onsubm['main']['price_format_st'] ) ) ? $form_data_onsubm['main']['price_format_st'] : '0'; - $format_price_conf['price_sep_decimal'] = ( isset( $form_data_onsubm['main']['price_sep_decimal'] ) ) ? $form_data_onsubm['main']['price_sep_decimal'] : '.'; - $format_price_conf['price_sep_thousand'] = ( isset( $form_data_onsubm['main']['price_sep_thousand'] ) ) ? $form_data_onsubm['main']['price_sep_thousand'] : ','; - $format_price_conf['price_sep_precision'] = ( isset( $form_data_onsubm['main']['price_sep_precision'] ) ) ? $form_data_onsubm['main']['price_sep_precision'] : '2'; - - $data2 = array(); - $data2['data'] = $tmp_data; - $data2['format_price_conf'] = $format_price_conf; - $data2['form_cost_total'] = $data->fbh_total_amount; - $data2['current_cost_st'] = ( isset( $form_data_onsubm['main']['price_st'] ) ) ? $form_data_onsubm['main']['price_st'] : 'USD'; - $data2['current_cost_symbol'] = ( isset( $form_data_onsubm['main']['price_currency_symbol'] ) ) ? $form_data_onsubm['main']['price_currency_symbol'] : '$'; - $data2['current_cost_cur'] = ( isset( $form_data_onsubm['main']['price_currency'] ) ) ? $form_data_onsubm['main']['price_currency'] : 'USD'; - $output = $this->load->view( 'formbuilder/frontend/mail_generate_fields', $data2, true ); - break; - case 'rec_url_fm': - $output = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : ''; - break; - case 'form_name': - $data = $this->model_record->getFormDataById( $rec_id ); - $output = $data->fmb_name; - break; - case 'rec_id': - $output = $rec_id; - break; - case 'form_inv_number': - $data = $this->model_gateways_records->getInvoiceDataByFormRecId( $rec_id ); - $output = $data->pgr_id; - break; - case 'form_inv_date': - $data = $this->model_gateways_records->getInvoiceDataByFormRecId( $rec_id ); - if ( ! empty( $vars['atr2'] ) ) { - $temp_date = date( $vars['atr2'], strtotime( $data->created_date ) ); - } else { - $temp_date = date( 'F j, Y', strtotime( $data->created_date ) ); - } - $output = $temp_date; - break; - case 'user_ip': - $data = $this->model_record->getFormDataById( $rec_id ); - $output = $data->created_ip; - break; - default: - } - - // apply price format - switch ( strval( $vars['atr3'] ) ) { - case 'price_format': - /* - * check if format price configuration is stored - */ - if ( empty( $this->format_price_conf ) ) { - $form_rec_data = $this->model_record->getFormDataById( $rec_id ); - $form_data = json_decode( $form_rec_data->fmb_data, true ); - // price numeric format - $format_price_conf = array(); - $format_price_conf['price_format_st'] = ( isset( $form_data['main']['price_format_st'] ) ) ? $form_data['main']['price_format_st'] : '0'; - $format_price_conf['price_sep_decimal'] = ( isset( $form_data['main']['price_sep_decimal'] ) ) ? $form_data['main']['price_sep_decimal'] : '.'; - $format_price_conf['price_sep_thousand'] = ( isset( $form_data['main']['price_sep_thousand'] ) ) ? $form_data['main']['price_sep_thousand'] : ','; - $format_price_conf['price_sep_precision'] = ( isset( $form_data['main']['price_sep_precision'] ) ) ? $form_data['main']['price_sep_precision'] : '2'; - $this->format_price_conf = $format_price_conf; - } - - $output = Uiform_Form_Helper::cformat_numeric( $this->format_price_conf, $output ); - - break; - - } - } else { - - } - - // get data from form - if ( $output != '' ) { - return $output; - } else { - return ''; - } - } - - /** - * Frontend::ajax_submit_ajaxmode() - * - * @return - */ - public function ajax_submit_ajaxmode() { - $resp = array(); - $resp = $this->process_form(); - - if ( isset( $this->flag_submitted ) && intval( $this->flag_submitted ) > 0 ) { - $resp['success'] = ( isset( $resp['success'] ) ) ? $resp['success'] : 0; - $resp['payment_st'] = ( isset( $resp['payment_st'] ) ) ? $resp['payment_st'] : 0; - if ( intval( $resp['payment_st'] ) === 1 ) { - $resp['show_message'] = ( isset( $resp['payment_html'] ) ) ? Uiform_Form_Helper::encodeHex( do_shortcode( $resp['payment_html'] ) ) : - '
    ' . __( 'Error! something went wrong.', 'frocket_front' ) . '
    '; - } else { - $resp['show_message'] = ( isset( $resp['show_message'] ) ) ? Uiform_Form_Helper::encodeHex( do_shortcode( $resp['show_message'] ) ) : - '
    ' . __( 'Success! your form was submitted', 'frocket_front' ) . '
    '; - } - } else { - $resp['success'] = 0; - $resp['show_message'] = '
    ' . __( 'warning! Form was not submitted', 'frocket_front' ) . '
    '; - } - - $data = array(); - $data['json'] = $resp; - - $this->load->view( 'html_view', $data ); - } - - /** - * Frontend::ajax_validate_captcha() - * - * @return - */ - public function ajax_validate_captcha() { - $rockfm_code = ( isset( $_POST['rockfm-code'] ) ) ? Uiform_Form_Helper::sanitizeInput( $_POST['rockfm-code'] ) : ''; - $rockfm_inpcode = ( isset( $_POST['rockfm-inpcode'] ) ) ? Uiform_Form_Helper::sanitizeInput( $_POST['rockfm-inpcode'] ) : ''; - $resp = array(); - $resp['code'] = $rockfm_code; - $resp['inpcode'] = $rockfm_inpcode; - - if ( ! empty( $rockfm_code ) ) { - $captcha_key = 'Rocketform-' . $_SERVER['HTTP_HOST']; - $captcha_resp = Uiform_Form_Helper::data_decrypt( $rockfm_code, $captcha_key ); - $resp['resp'] = $captcha_resp; - if ( (string) $captcha_resp === (string) ( $rockfm_inpcode ) ) { - $resp['success'] = true; - } else { - $resp['success'] = false; - } - } else { - $resp['success'] = false; - } - - // return data to ajax callback - header( 'Content-Type: text/html; charset=UTF-8' ); - echo json_encode( $resp ); - die(); - } - - /** - * Frontend::ajax_refresh_captcha() - * - * @return - */ - public function ajax_refresh_captcha() { - $rkver = ( isset( $_POST['rkver'] ) ) ? Uiform_Form_Helper::sanitizeInput( trim( $_POST['rkver'] ) ) : 0; - if ( $rkver ) { - $rkver = Uiform_Form_Helper::base64url_decode( json_decode( $rkver ) ); - $rkver_arr = json_decode( $rkver, true ); - - $length = 5; - $charset = 'abcdefghijklmnpqrstuvwxyz123456789'; - $phrase = ''; - $chars = str_split( $charset ); - - for ( $i = 0; $i < $length; $i++ ) { - $phrase .= $chars[ array_rand( $chars ) ]; - } - $captcha_data = array(); - - if ( isset( $rkver_arr['ca_txt_gen'] ) ) { - $rkver_arr['ca_txt_gen'] = $phrase; - $captcha_data = $rkver_arr; - } else { - $captcha_data['ca_txt_gen'] = $phrase; - } - $captcha_options = Uiform_Form_Helper::base64url_encode( json_encode( $captcha_data ) ); - $resp = array(); - $resp['rkver'] = $captcha_options; - - /* generate check code */ - $captcha_key = 'Rocketform-' . $_SERVER['HTTP_HOST']; - $resp['code'] = Uiform_Form_Helper::data_encrypt( $phrase, $captcha_key ); - - // return data to ajax callback - $data = array(); - $data['json'] = $resp; - - $this->load->view( 'html_view', $data ); - } - } - - /** - * Frontend::ajax_check_recaptcha() - * - * @return - */ - public function ajax_check_recaptcha() { - - modules::run( 'formbuilder/uifmrecaptcha/front_verify_recaptcha', array() ); - - } - - public function ajax_check_recaptchav3() { - - modules::run( 'formbuilder/uifmrecaptcha/front_verify_recaptchav3', array() ); - } - - /** - * Frontend::process_form() - * - * @return - */ - public function process_form() { - try { - - // upload an image and document options - $config = array(); - $config['upload_path'] = FCPATH . 'uploads'; - $config['allowed_types'] = 'jpg|png|gif|jpeg|JPG|PNG|GIF|JPEG|pdf|doc|docx|xls|xlsx|zip|rar'; - $config['max_size'] = '2097152'; // 0 = no file size limit - $config['overwrite'] = false; - $config['remove_spaces'] = true; - $this->load->library( 'upload', $config ); - - $form_id = ( $_POST['_rockfm_form_id'] ) ? Uiform_Form_Helper::sanitizeInput( trim( $_POST['_rockfm_form_id'] ) ) : 0; - $is_demo = ( $_POST['zgfm_is_demo'] ) ? intval( Uiform_Form_Helper::sanitizeInput( trim( $_POST['zgfm_is_demo'] ) ) ) : 0; - $this->current_form_id = $form_id; - $form_fields = ( isset( $_POST['uiform_fields'] ) && $_POST['uiform_fields'] ) ? array_map( array( 'Uiform_Form_Helper', 'sanitizeRecursive_html' ), $_POST['uiform_fields'] ) : array(); - $form_avars = ( isset( $_POST['zgfm_avars'] ) && $_POST['zgfm_avars'] ) ? array_map( array( 'Uiform_Form_Helper', 'sanitizeRecursive_html' ), $_POST['zgfm_avars'] ) : array(); - $form_f_tmp = array(); - $form_f_rec_tmp = array(); - $form_cost_total = 0; - $attachment_status = 0; - $attachments = array(); // initialize attachment array - // get data from form - $form_data = $this->model_forms->getFormById_2( $form_id ); - $form_data_onsubm = json_decode( $form_data->fmb_data2, true ); - $form_data_name = $form_data->fmb_name; - - // store to obj var - // $this->form_cur_data = json_decode($form_data->fmb_data, true); - $this->form_cur_data2 = json_decode( $form_data->fmb_data2, true ); - - // prepare message - $tmp_template_msg = ( isset( $form_data_onsubm['onsubm']['mail_template_msg'] ) ) ? urldecode( $form_data_onsubm['onsubm']['mail_template_msg'] ) : ''; - $tmp_sm_successtext = ( isset( $form_data_onsubm['onsubm']['sm_successtext'] ) ) ? urldecode( $form_data_onsubm['onsubm']['sm_successtext'] ) : ''; - $message = $tmp_template_msg; - - // math formula result - $zgfm_calc_math = ( $_POST['zgfm_calc_math'] ) ? Uiform_Form_Helper::sanitizeInput( trim( $_POST['zgfm_calc_math'] ) ) : 0; - $form_data_calc_enable = ( isset( $form_data_onsubm['calculation']['enable_st'] ) ) ? $form_data_onsubm['calculation']['enable_st'] : '0'; - - // process fields - $message_fields = ''; - $form_errors = array(); - $mail_errors = false; - - $this->current_cost['symbol'] = ( isset( $form_data_onsubm['main']['price_currency_symbol'] ) ) ? $form_data_onsubm['main']['price_currency_symbol'] : '$'; - $this->current_cost['cur'] = ( isset( $form_data_onsubm['main']['price_currency'] ) ) ? $form_data_onsubm['main']['price_currency'] : 'USD'; - $this->current_cost['st'] = ( isset( $form_data_onsubm['main']['price_st'] ) ) ? $form_data_onsubm['main']['price_st'] : 'USD'; - - // price numeric format - $format_price_conf = array(); - $format_price_conf['price_format_st'] = ( isset( $form_data_onsubm['main']['price_format_st'] ) ) ? $form_data_onsubm['main']['price_format_st'] : '0'; - $format_price_conf['price_sep_decimal'] = ( isset( $form_data_onsubm['main']['price_sep_decimal'] ) ) ? $form_data_onsubm['main']['price_sep_decimal'] : '.'; - $format_price_conf['price_sep_thousand'] = ( isset( $form_data_onsubm['main']['price_sep_thousand'] ) ) ? $form_data_onsubm['main']['price_sep_thousand'] : ','; - $format_price_conf['price_sep_precision'] = ( isset( $form_data_onsubm['main']['price_sep_precision'] ) ) ? $form_data_onsubm['main']['price_sep_precision'] : '2'; - - // other variables - $form_f_avar = array(); - - if ( ! empty( $form_avars ) ) { - foreach ( $form_avars as $key => $value ) { - switch ( strval( $key ) ) { - case 'calc': - foreach ( $value as $key2 => $value2 ) { - $form_f_avar['calc'][ $key2 ] = $value2; - } - break; - default: - break; - } - } - } - - // fields - if ( ! empty( $form_fields ) ) { - foreach ( $form_fields as $key => $value ) { - $tmp_field_name = $this->model_fields->getFieldNameByUniqueId( $key, $form_id ); - - if ( ! isset( $tmp_field_name->type ) ) { - $err_output = 'error $key:' . $key . ' - $form_id:' . $form_id; - if ( UIFORM_DEBUG === 1 ) { - $err_output .= ' - Last query: ' . htmlentities( $this->db->last_query(), ENT_NOQUOTES, 'UTF-8' ); - } - - throw new Exception( $err_output ); - } - - /*for validation only*/ - switch ( intval( $tmp_field_name->type ) ) { - case 6: - /*textbox*/ - case 28: - case 29: - case 30: - $tmp_fdata = json_decode( $tmp_field_name->data, true ); - if ( isset( $tmp_fdata['validate'] ) && isset( $tmp_fdata['validate']['typ_val'] ) && intval( $tmp_fdata['validate']['typ_val'] ) === 4 ) { - // $mail_replyto=$value; - } - break; - } - - /*storing to main array*/ - - switch ( intval( $tmp_field_name->type ) ) { - case 9: - /*checkbox*/ - case 11: - /*multiselect*/ - $tmp_fdata = json_decode( $tmp_field_name->data, true ); - $tmp_field_cost_total = 0; - $tmp_options = array(); - $tmp_field_label = ( ! empty( $tmp_fdata['label']['text'] ) ) ? $tmp_fdata['label']['text'] : $tmp_field_name->fieldname; - $form_f_tmp[ $key ]['type'] = $tmp_field_name->type; - $form_f_tmp[ $key ]['fieldname'] = $tmp_field_name->fieldname; - $form_f_tmp[ $key ]['label'] = $tmp_field_label; - $form_f_tmp[ $key ]['price_st'] = isset( $tmp_fdata['price']['enable_st'] ) ? $tmp_fdata['price']['enable_st'] : 0; - $form_f_tmp[ $key ]['lbl_show_st'] = isset( $tmp_fdata['price']['lbl_show_st'] ) ? $tmp_fdata['price']['lbl_show_st'] : 0; - - $tmp_f_values = array(); - - $tmp_inp_label = array(); - $tmp_inp_value = array(); - - if ( is_array( $value ) ) { - // for records - $tmp_options_rec = array(); - foreach ( $value as $key2 => $value2 ) { - $tmp_options_row = array(); - $tmp_options_row['label'] = isset( $tmp_fdata['input2']['options'][ $value2 ]['label'] ) ? $tmp_fdata['input2']['options'][ $value2 ]['label'] : ''; - $tmp_options_row['value'] = isset( $tmp_fdata['input2']['options'][ $value2 ]['value'] ) ? $tmp_fdata['input2']['options'][ $value2 ]['value'] : ''; - $tmp_options_rec[] = $tmp_options_row['value']; - $tmp_f_values[] = $value2; - } - $form_f_rec_tmp[ $key ] = implode( '^,^', $tmp_options_rec ); - // end for records - - foreach ( $value as $key2 => $value2 ) { - $tmp_options_row = array(); - $tmp_options_row['label'] = isset( $tmp_fdata['input2']['options'][ $value2 ]['label'] ) ? $tmp_fdata['input2']['options'][ $value2 ]['label'] : ''; - $tmp_options_row['value'] = isset( $tmp_fdata['input2']['options'][ $value2 ]['value'] ) ? $tmp_fdata['input2']['options'][ $value2 ]['value'] : ''; - - // store label - $tmp_inp_label[] = $tmp_options_row['label']; - $tmp_inp_value[] = $tmp_options_row['value']; - - if ( isset( $tmp_fdata['input2']['options'][ $value2 ] ) ) { - $tmp_options_row['cost'] = ( isset( $tmp_fdata['input2']['options'][ $value2 ]['price'] ) ) ? floatval( $tmp_fdata['input2']['options'][ $value2 ]['price'] ) : 0; - $tmp_options_row['amount'] = $tmp_options_row['cost']; - - if ( isset( $tmp_fdata['price']['enable_st'] ) - && intval( $this->current_cost['st'] ) === 1 - && intval( $tmp_fdata['price']['enable_st'] ) === 1 ) { - /*cost estimate*/ - - $form_cost_total += $tmp_options_row['cost']; - - } - - $tmp_field_cost_total = $tmp_field_cost_total + $tmp_options_row['cost']; - $form_f_tmp[ $key ]['input_cost_amt'] = floatval( $tmp_field_cost_total ); - } - - if ( isset( $tmp_fdata['input2']['options'][ $value2 ] ) && $tmp_fdata['input2']['options'][ $value2 ] ) { - - $tmp_options[ $value2 ] = $tmp_options_row; - } - } - } - $form_f_tmp[ $key ]['input_label'] = implode( '^,^', $tmp_inp_label ); - $form_f_tmp[ $key ]['input_value'] = implode( '^,^', $tmp_inp_value ); - - $form_f_tmp[ $key ]['chosen'] = implode( ',', $tmp_f_values ); - /*saving data to field array*/ - $form_f_tmp[ $key ]['input'] = $tmp_options; - - break; - case 8: - /*radiobutton*/ - case 10: - /*select*/ - - $tmp_fdata = json_decode( $tmp_field_name->data, true ); - $tmp_field_cost_total = 0; - $tmp_options = array(); - $tmp_field_label = ( ! empty( $tmp_fdata['label']['text'] ) ) ? $tmp_fdata['label']['text'] : $tmp_field_name->fieldname; - $form_f_tmp[ $key ]['type'] = $tmp_field_name->type; - $form_f_tmp[ $key ]['fieldname'] = $tmp_field_name->fieldname; - $form_f_tmp[ $key ]['label'] = $tmp_field_label; - $form_f_tmp[ $key ]['chosen'] = implode( ',', array( $value ) ); - $form_f_tmp[ $key ]['price_st'] = isset( $tmp_fdata['price']['enable_st'] ) ? $tmp_fdata['price']['enable_st'] : 0; - $form_f_tmp[ $key ]['lbl_show_st'] = isset( $tmp_fdata['price']['lbl_show_st'] ) ? $tmp_fdata['price']['lbl_show_st'] : 0; - // foreach ($value as $key2=>$value2) { - $tmp_options_row = array(); - $tmp_options_row['label'] = isset( $tmp_fdata['input2']['options'][ $value ]['label'] ) ? $tmp_fdata['input2']['options'][ $value ]['label'] : ''; - $tmp_options_row['value'] = isset( $tmp_fdata['input2']['options'][ $value ]['value'] ) ? $tmp_fdata['input2']['options'][ $value ]['value'] : ''; - - // for records - $form_f_rec_tmp[ $key ] = $tmp_options_row['label']; - - if ( isset( $tmp_fdata['input2']['options'][ $value ] ) ) { - $tmp_options_row['cost'] = ( isset( $tmp_fdata['input2']['options'][ $value ]['price'] ) ) ? floatval( $tmp_fdata['input2']['options'][ $value ]['price'] ) : 0; - $tmp_options_row['amount'] = $tmp_options_row['cost']; - - if ( isset( $tmp_fdata['price']['enable_st'] ) - && intval( $this->current_cost['st'] ) === 1 - && intval( $tmp_fdata['price']['enable_st'] ) === 1 ) { - /*cost estimate*/ - $form_cost_total += $tmp_options_row['amount']; - - } - - $tmp_field_cost_total = $tmp_field_cost_total + $tmp_options_row['cost']; - $form_f_tmp[ $key ]['input_cost_amt'] = floatval( $tmp_field_cost_total ); - - } - - if ( isset( $tmp_fdata['input2']['options'][ $value ] ) ) { - $tmp_options[ $value ] = $tmp_options_row; - } - // } - $form_f_tmp[ $key ]['input_label'] = $tmp_options_row['label']; - $form_f_tmp[ $key ]['input_value'] = $tmp_options_row['value']; - /*saving data to field array*/ - $form_f_tmp[ $key ]['input'] = $tmp_options; - - break; - case 12; - /* file input field */ - case 13; - /* - image upload */ - /* file input field */ - - $tmp_fdata = json_decode( $tmp_field_name->data, true ); - - $tmp_options = array(); - $tmp_field_label = ( ! empty( $tmp_fdata['label']['text'] ) ) ? $tmp_fdata['label']['text'] : $tmp_field_name->fieldname; - $form_f_tmp[ $key ]['type'] = $tmp_field_name->type; - $form_f_tmp[ $key ]['fieldname'] = $tmp_field_name->fieldname; - $form_f_tmp[ $key ]['label'] = $tmp_field_label; - - $allowedext_default = array( 'aaaa', 'png', 'doc', 'docx', 'xls', 'xlsx', 'csv', 'txt', 'rtf', 'zip', 'mp3', 'wma', 'wmv', 'mpg', 'flv', 'avi', 'jpg', 'jpeg', 'png', 'gif', 'ods', 'rar', 'ppt', 'tif', 'wav', 'mov', 'psd', 'eps', 'sit', 'sitx', 'cdr', 'ai', 'mp4', 'm4a', 'bmp', 'pps', 'aif', 'pdf' ); - $custom_allowedext = ( ! empty( $tmp_fdata['input16']['extallowed'] ) ) ? array_map( 'trim', explode( ',', $tmp_fdata['input16']['extallowed'] ) ) : $allowedext_default; - $custom_maxsize = ( ! empty( $tmp_fdata['input16']['maxsize'] ) ) ? floatval( $tmp_fdata['input16']['maxsize'] ) : 5; - $custom_attach_st = ( isset( $tmp_fdata['input16']['attach_st'] ) ) ? intval( $tmp_fdata['input16']['attach_st'] ) : 0; - - if ( isset( $_FILES['uiform_fields']['name'][ $key ] ) - && ! empty( $_FILES['uiform_fields']['name'][ $key ] ) ) { - - $fileSize = $_FILES['uiform_fields']['size'][ $key ]; - if ( floatval( $fileSize ) > $custom_maxsize * 1024 * 1024 ) { - $form_errors[] = __( 'Error! The file exceeds the allowed size of', 'frocket_front' ) . ' ' . $custom_maxsize . ' MB'; - } - /* find attachment max size found */ - $attachment_status = ( $attachment_status < $custom_attach_st ) ? $custom_attach_st : $attachment_status; - - $ext = strtolower( substr( $_FILES['uiform_fields']['name'][ $key ], strrpos( $_FILES['uiform_fields']['name'][ $key ], '.' ) + 1 ) ); - if ( ! in_array( $ext, $custom_allowedext ) ) { - $form_errors[] = __( 'Error! Type of file is not allowed to upload', 'frocket_front' ); - } - if ( empty( $form_errors ) ) { - $config['allowed_types'] = '*'; - $config['max_size'] = $custom_maxsize * 1024 * 1024; // 0 = no file size limit - $this->upload->initialize( $config ); - - $rename = 'file_' . md5( uniqid( $_FILES['uiform_fields']['name'][ $key ], true ) ); - - $_FILES['uiform_fields']['name'][ $key ] = $rename . '.' . strtolower( $ext ); - - // attachment - - if ( ! $this->upload->do_upload2( $key ) ) { - $form_errors[] = __( 'Error! File not uploaded - ' . $this->upload->display_errors( '', '' ), 'frocket_front' ); - } else { - $data_upload_files = $this->upload->data(); - $image = base_url() . 'uploads/' . $data_upload_files['file_name']; - // getting image uploaed - if ( intval( $custom_attach_st ) === 1 ) { - $attachments[] = $data_upload_files['file_path'] . $data_upload_files['file_name']; - } - - $form_f_tmp[ $key ]['input'] = $image; - $form_f_rec_tmp[ $key ] = $image; - $form_fields[ $key ] = $image; - - } - } - } else { - unset( $form_fields[ $key ] ); - $form_f_tmp[ $key ]['input'] = ''; - $form_f_rec_tmp[ $key ] = ''; - } - break; - case 16: - /*slider*/ - case 18: - /*spinner*/ - $tmp_fdata = json_decode( $tmp_field_name->data, true ); - - $tmp_field_label = ( ! empty( $tmp_fdata['label']['text'] ) ) ? $tmp_fdata['label']['text'] : $tmp_field_name->fieldname; - $form_f_tmp[ $key ]['type'] = $tmp_field_name->type; - $form_f_tmp[ $key ]['fieldname'] = $tmp_field_name->fieldname; - $form_f_tmp[ $key ]['label'] = $tmp_field_label; - $form_f_tmp[ $key ]['price_st'] = isset( $tmp_fdata['price']['enable_st'] ) ? $tmp_fdata['price']['enable_st'] : 0; - $form_f_tmp[ $key ]['lbl_show_st'] = isset( $tmp_fdata['price']['lbl_show_st'] ) ? $tmp_fdata['price']['lbl_show_st'] : 0; - - // foreach ($value as $key2=>$value2) { - $tmp_options_row = array(); - - $tmp_options_row['cost'] = floatval( $tmp_fdata['price']['unit_price'] ); - - $tmp_options_row['qty'] = floatval( $value ); - $tmp_options_row['value'] = floatval( $value ); - // for records - $form_f_rec_tmp[ $key ] = $value; - - if ( isset( $tmp_fdata['price']['enable_st'] ) - && intval( $this->current_cost['st'] ) === 1 - && intval( $tmp_fdata['price']['enable_st'] ) === 1 ) { - /*cost estimate*/ - $form_cost_total += floatval( $value ) * floatval( $tmp_fdata['price']['unit_price'] ); - - } - - $tmp_options_row['amount'] = floatval( $value ) * floatval( $tmp_fdata['price']['unit_price'] ); - - // } - /*saving data to field array*/ - $form_f_tmp[ $key ]['input'] = $tmp_options_row; - $form_f_tmp[ $key ]['input_cost_amt'] = floatval( $value ) * floatval( $tmp_fdata['price']['unit_price'] ); - break; - case 40: - /*switch*/ - $tmp_fdata = json_decode( $tmp_field_name->data, true ); - - $tmp_options = array(); - $tmp_field_label = ( ! empty( $tmp_fdata['label']['text'] ) ) ? $tmp_fdata['label']['text'] : $tmp_field_name->fieldname; - $form_f_tmp[ $key ]['type'] = $tmp_field_name->type; - $form_f_tmp[ $key ]['fieldname'] = $tmp_field_name->fieldname; - $form_f_tmp[ $key ]['label'] = $tmp_field_label; - $form_f_tmp[ $key ]['price_st'] = isset( $tmp_fdata['price']['enable_st'] ) ? $tmp_fdata['price']['enable_st'] : 0; - $form_f_tmp[ $key ]['lbl_show_st'] = isset( $tmp_fdata['price']['lbl_show_st'] ) ? $tmp_fdata['price']['lbl_show_st'] : 0; - - // foreach ($value as $key2=>$value2) { - - if ( $value === 'on' ) { - $tmp_options_row['label'] = ( ! empty( $tmp_fdata['input15']['txt_yes'] ) ) ? $tmp_fdata['input15']['txt_yes'] : $value; - $form_f_rec_tmp[ $key ] = 1; - } else { - $tmp_options_row['label'] = ( ! empty( $tmp_fdata['input15']['txt_no'] ) ) ? $tmp_fdata['input15']['txt_no'] : $value; - $form_f_rec_tmp[ $key ] = 0; - } - - if ( isset( $tmp_fdata['price']['unit_price'] ) ) { - $tmp_options_row['cost'] = floatval( $tmp_fdata['price']['unit_price'] ); - $tmp_options_row['amount'] = $tmp_options_row['cost']; - - if ( isset( $tmp_fdata['price']['enable_st'] ) - && intval( $this->current_cost['st'] ) === 1 - && intval( $tmp_fdata['price']['enable_st'] ) === 1 ) { - /*cost estimate*/ - $form_cost_total += $tmp_options_row['amount']; - - } - } - - // } - /*saving data to field array*/ - $form_f_tmp[ $key ]['input'] = $tmp_options_row; - $form_f_tmp[ $key ]['input_cost_amt'] = floatval( $tmp_fdata['price']['unit_price'] ); - break; - case 41; - /*dyn checkbox*/ - case 42; - /*dyn radiobtn*/ - $tmp_fdata = json_decode( $tmp_field_name->data, true ); - $tmp_field_cost_total = 0; - $tmp_options = array(); - $tmp_field_label = ( ! empty( $tmp_fdata['label']['text'] ) ) ? $tmp_fdata['label']['text'] : $tmp_field_name->fieldname; - $form_f_tmp[ $key ]['type'] = $tmp_field_name->type; - $form_f_tmp[ $key ]['fieldname'] = $tmp_field_name->fieldname; - $form_f_tmp[ $key ]['label'] = $tmp_field_label; - $form_f_tmp[ $key ]['price_st'] = isset( $tmp_fdata['price']['enable_st'] ) ? $tmp_fdata['price']['enable_st'] : 0; - $form_f_tmp[ $key ]['lbl_show_st'] = isset( $tmp_fdata['price']['lbl_show_st'] ) ? $tmp_fdata['price']['lbl_show_st'] : 0; - // for records - $tmp_summary = array(); - - foreach ( $value as $key2 => $value2 ) { - $tmp_summary_inner = ''; - - if ( isset( $tmp_fdata['input17']['options'][ $key2 ]['label'] ) ) { - $tmp_summary_inner .= $tmp_fdata['input17']['options'][ $key2 ]['label']; - } - - if ( intval( $value2 ) > 1 ) { - $tmp_summary_inner .= ' - qty: ' . $value2; - } - $tmp_summary[] = $tmp_summary_inner; - } - - $form_f_rec_tmp[ $key ] = implode( '^,^', $tmp_summary ); - // end for records - - foreach ( $value as $key2 => $value2 ) { - $tmp_options_row = array(); - $tmp_options_row['label'] = $tmp_fdata['input17']['options'][ $key2 ]['label']; - - if ( $tmp_fdata['input17']['options'][ $key2 ] ) { - $tmp_options_row['cost'] = floatval( $tmp_fdata['input17']['options'][ $key2 ]['price'] ); - $tmp_options_row['qty'] = $value2; - - $tmp_options_row['amount'] = floatval( $tmp_options_row['cost'] ) * floatval( $tmp_options_row['qty'] ); - - if ( isset( $tmp_fdata['price']['enable_st'] ) - && intval( $this->current_cost['st'] ) === 1 - && intval( $tmp_fdata['price']['enable_st'] ) === 1 ) { - /*cost estimate*/ - - $form_cost_total += $tmp_options_row['amount']; - $tmp_field_cost_total += $tmp_options_row['amount']; - } - } - - $tmp_options[] = $tmp_options_row; - } - /*saving data to field array*/ - $form_f_tmp[ $key ]['input'] = $tmp_options; - $form_f_tmp[ $key ]['input_cost_amt'] = $tmp_field_cost_total; - break; - default: - $tmp_fdata = json_decode( $tmp_field_name->data, true ); - $tmp_field_label = ( ! empty( $tmp_fdata['label']['text'] ) ) ? $tmp_fdata['label']['text'] : $tmp_field_name->fieldname; - $form_f_tmp[ $key ]['type'] = $tmp_field_name->type; - $form_f_tmp[ $key ]['fieldname'] = $tmp_field_name->fieldname; - $form_f_tmp[ $key ]['label'] = $tmp_field_label; - if ( is_array( $value ) ) { - $tmp_options = array(); - foreach ( $value as $value2 ) { - $tmp_options[] = $value2; - } - $form_f_tmp[ $key ]['input'] = implode( '^,^', $tmp_options ); - // for records - $form_f_rec_tmp[ $key ] = implode( '^,^', $tmp_options ); - - } else { - $form_f_tmp[ $key ]['input'] = $value; - // for records - $form_f_rec_tmp[ $key ] = $value; - - } - - break; - } - } - } - - // process tax - $tmp_price_tax_st = ( isset( $form_data_onsubm['main']['price_tax_st'] ) ) ? $form_data_onsubm['main']['price_tax_st'] : '0'; - $tmp_price_tax_val = ( isset( $form_data_onsubm['main']['price_tax_val'] ) ) ? $form_data_onsubm['main']['price_tax_val'] : '0'; - - // check if math calc is enabled - - if ( intval( $form_data_calc_enable ) === 1 ) { - $form_cost_total = isset( $zgfm_calc_math ) ? $zgfm_calc_math : 0; - } - - // check if tax is enabled - if ( intval( $tmp_price_tax_st ) === 1 ) { - $form_cost_subtotal = floatval( $form_cost_total ); - $form_cost_tax = ( floatval( $tmp_price_tax_val ) / 100 ) * floatval( $form_cost_subtotal ); - $form_cost_total = floatval( $form_cost_subtotal ) + $form_cost_tax; - - } - - // storing total cost - $this->current_cost['total'] = $form_cost_total; - - if ( count( $form_errors ) > 0 ) { - $data = array(); - $data['success'] = 0; - $data['form_errors'] = count( $form_errors ); - $tmp_err_msg = '
      '; - foreach ( $form_errors as $value_er ) { - $tmp_err_msg .= '
    • ' . $value_er . '
    • '; - } - $tmp_err_msg .= '
    '; - $tmp_err_msg = Uiform_Form_Helper::assign_alert_container( $tmp_err_msg, 4 ); - $data['form_error_msg'] = $tmp_err_msg; - $this->form_response = $data; - $data['form_error_msg'] = Uiform_Form_Helper::encodeHex( $data['form_error_msg'] ); - return $data; - } - - // generate mail html part - $tmp_data1 = array(); - $tmp_data1['data'] = $form_f_tmp; - $tmp_data1['price_tax_st'] = $tmp_price_tax_st; - if ( intval( $tmp_price_tax_st ) === 1 ) { - $tmp_data1['form_cost_subtotal'] = $form_cost_subtotal; - $tmp_data1['form_cost_tax'] = $form_cost_tax; - } - $tmp_data1['form_cost_total'] = $form_cost_total; - $tmp_data1['current_cost_st'] = $this->current_cost['st']; - $tmp_data1['current_cost_symbol'] = $this->current_cost['symbol']; - $tmp_data1['current_cost_cur'] = $this->current_cost['cur']; - $tmp_data1['format_price_conf'] = $format_price_conf; - $tmp_data1['form_data_calc_enable'] = $form_data_calc_enable; - if ( intval( $tmp_price_tax_st ) === 1 ) { - $tmp_data1['sub_total'] = Uiform_Form_Helper::cformat_numeric( $format_price_conf, $form_cost_subtotal ); - $tmp_data1['tax'] = Uiform_Form_Helper::cformat_numeric( $format_price_conf, $form_cost_tax ); - } - $tmp_data1['total'] = Uiform_Form_Helper::cformat_numeric( $format_price_conf, $form_cost_total ) . ' ' . $this->current_cost['cur']; - - $this->form_rec_msg_summ = $this->load->view( 'formbuilder/frontend/mail_generate_fields', $tmp_data1, true ); - - // ending form process - - // save to form records - $agent = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : ''; - $referer = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : ''; - - $form_f_rec_tmp = $this->process_DataRecord( $form_f_tmp, $form_f_rec_tmp ); - $form_f_avar_tmp = $this->process_DataRecord2( $form_f_avar ); - - $data = array(); - $data['fbh_data'] = json_encode( $form_f_tmp ); - $data['fbh_data_rec'] = json_encode( $form_f_rec_tmp ); - $data['fbh_data2'] = json_encode( $form_f_avar ); - $data['fbh_data_rec2'] = json_encode( $form_f_avar_tmp ); - $data['fbh_total_amount'] = $form_cost_total; - $data['created_ip'] = $_SERVER['REMOTE_ADDR']; - $data['form_fmb_id'] = $form_id; - $data['fbh_data_rec_xml'] = Uiform_Form_Helper::array2xml( $form_f_rec_tmp ); - $data['fbh_data_rec2_xml'] = Uiform_Form_Helper::array2xml( $form_f_avar_tmp ); - $data['fbh_user_agent'] = $agent; - $data['fbh_page'] = $_SERVER['REQUEST_URI']; - $data['fbh_referer'] = $referer; - - // generate uniqueid - if ( ! isset( $_COOKIE['uiform_costest'] ) ) { - $ip = isset( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : ''; - $user_agent = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : ''; - $hash = hash( 'crc32', md5( $ip . $user_agent ) ); - setcookie( 'uiform_costest', $hash, time() + ( 60 * 60 * 24 * 30 ), '/' ); - } else { - $hash = $_COOKIE['uiform_costest']; - } - - $data['vis_uniqueid'] = $hash; - - $this->db->set( $data ); - $this->db->insert( $this->model_record->table ); - - $idActivate = $this->db->insert_id(); - $json = array(); - $json['status'] = 'created'; - $json['id'] = $idActivate; - - $this->flag_submitted = $idActivate; - self::$_form_data['form_id'] = $form_id; - self::$_form_data['record_id'] = $idActivate; - - // insert to payment records - $data3 = array(); - $data3['fbh_id'] = $idActivate; - $data3['pgr_payment_amount'] = $form_cost_total; - $data3['pgr_currency'] = $this->current_cost['cur']; - $data3['flag_status'] = 1; - $data3['created_ip'] = $_SERVER['REMOTE_ADDR']; - $data3['created_by'] = 1; - $data3['created_date'] = date( 'Y-m-d h:i:s' ); - $data3['type_pg_id'] = 1; - - $this->db->set( $data3 ); - $this->db->insert( $this->model_gateways_records->table ); - $id_payrec = $this->db->insert_id(); - // preparing mail - - // is demo - if ( $is_demo === 0 ) { - - $mail_from_email = ( isset( $form_data_onsubm['onsubm']['mail_from_email'] ) ) ? $form_data_onsubm['onsubm']['mail_from_email'] : ''; - $mail_from_name = ( isset( $form_data_onsubm['onsubm']['mail_from_name'] ) ) ? $form_data_onsubm['onsubm']['mail_from_name'] : ''; - - $mail_html_wholecont = isset( $form_data_onsubm['main']['email_html_fullpage'] ) ? $form_data_onsubm['main']['email_html_fullpage'] : '0'; - $mail_pdf_wholecont = isset( $form_data_onsubm['main']['pdf_html_fullpage'] ) ? $form_data_onsubm['main']['pdf_html_fullpage'] : '0'; - - // admin - // mail template - $mail_template_msg = ( isset( $form_data_onsubm['onsubm']['mail_template_msg'] ) ) ? urldecode( $form_data_onsubm['onsubm']['mail_template_msg'] ) : ''; - $mail_template_msg = do_shortcode( $mail_template_msg ); - $mail_template_msg = html_entity_decode( $mail_template_msg, ENT_QUOTES, 'UTF-8' ); - $mail_template_msg = $this->load->view( - 'formbuilder/frontend/mail_global_template', - array( - 'content' => $mail_template_msg, - 'html_wholecont' => $mail_html_wholecont, - ), - true - ); - - $email_recipient = ( isset( $form_data_onsubm['onsubm']['mail_recipient'] ) ) ? $form_data_onsubm['onsubm']['mail_recipient'] : model_settings::$db_config['admin_mail']; - $email_cc = ( isset( $form_data_onsubm['onsubm']['mail_cc'] ) ) ? $form_data_onsubm['onsubm']['mail_cc'] : ''; - $email_bcc = ( isset( $form_data_onsubm['onsubm']['mail_bcc'] ) ) ? $form_data_onsubm['onsubm']['mail_bcc'] : ''; - $mail_subject = ( isset( $form_data_onsubm['onsubm']['mail_subject'] ) ) ? do_shortcode( $form_data_onsubm['onsubm']['mail_subject'] ) : __( 'New form request', 'frocket_front' ); - - $mail_usr_recipient = ( isset( $form_data_onsubm['onsubm']['mail_usr_recipient'] ) ) ? $form_data_onsubm['onsubm']['mail_usr_recipient'] : ''; - $mail_replyto = ( isset( $form_data_onsubm['onsubm']['mail_replyto'] ) ) ? $form_data_onsubm['onsubm']['mail_replyto'] : ''; - - $data_mail = array(); - $data_mail['from_mail'] = html_entity_decode( do_shortcode( $mail_from_email ) ); - $data_mail['from_name'] = html_entity_decode( do_shortcode( $mail_from_name ) ); - $data_mail['message'] = $mail_template_msg; - $data_mail['subject'] = html_entity_decode( $mail_subject ); - $data_mail['attachments'] = $attachments; - $data_mail['to'] = trim( $email_recipient ); - $data_mail['cc'] = array_map( 'trim', explode( ',', $email_cc ) ); - $data_mail['bcc'] = array_map( 'trim', explode( ',', $email_bcc ) ); - - $tmp_replyto = $this->model_record->getFieldOptRecord( $idActivate, '', $mail_replyto, 'input' ); - if ( ! empty( $tmp_replyto ) ) { - $data_mail['mail_replyto'] = $tmp_replyto; - } - - if ( isset( $form_data_onsubm['main']['email_dissubm'] ) && intval( $form_data_onsubm['main']['email_dissubm'] ) === 1 ) { - $mail_errors = false; - } else { - $mail_errors = $this->process_mail( $data_mail ); - } - - // customer - // mail template - $mail_usr_st = ( isset( $form_data_onsubm['onsubm']['mail_usr_st'] ) ) ? $form_data_onsubm['onsubm']['mail_usr_st'] : '0'; - if ( intval( $mail_usr_st ) === 1 ) { - $mail_template_msg = ( isset( $form_data_onsubm['onsubm']['mail_usr_template_msg'] ) ) ? urldecode( $form_data_onsubm['onsubm']['mail_usr_template_msg'] ) : ''; - $mail_template_msg = do_shortcode( $mail_template_msg ); - $mail_template_msg = html_entity_decode( $mail_template_msg, ENT_QUOTES, 'UTF-8' ); - $mail_template_msg = $this->load->view( - 'formbuilder/frontend/mail_global_template', - array( - 'content' => $mail_template_msg, - 'html_wholecont' => $mail_html_wholecont, - ), - true - ); - - $mail_usr_cc = ( isset( $form_data_onsubm['onsubm']['mail_usr_cc'] ) ) ? $form_data_onsubm['onsubm']['mail_usr_cc'] : ''; - $mail_usr_bcc = ( isset( $form_data_onsubm['onsubm']['mail_usr_bcc'] ) ) ? $form_data_onsubm['onsubm']['mail_usr_bcc'] : ''; - $mail_usr_replyto = ( isset( $form_data_onsubm['onsubm']['mail_usr_replyto'] ) ) ? $form_data_onsubm['onsubm']['mail_usr_replyto'] : ''; - $mail_usr_subject = ( isset( $form_data_onsubm['onsubm']['mail_usr_subject'] ) ) ? do_shortcode( $form_data_onsubm['onsubm']['mail_usr_subject'] ) : __( 'New form request', 'frocket_front' ); - - $mail_usr_pdf_st = ( isset( $form_data_onsubm['onsubm']['mail_usr_pdf_st'] ) ) ? $form_data_onsubm['onsubm']['mail_usr_pdf_st'] : '0'; - if ( intval( $mail_usr_pdf_st ) === 1 ) { - - $data_mail = array(); - $mail_template_msg_pdf = ( isset( $form_data_onsubm['onsubm']['mail_usr_pdf_template_msg'] ) ) ? urldecode( $form_data_onsubm['onsubm']['mail_usr_pdf_template_msg'] ) : ''; - $mail_template_msg_pdf = do_shortcode( $mail_template_msg_pdf ); - $data_mail['mail_usr_pdf_template_msg'] = $mail_template_msg_pdf; - $mail_pdf_fn = ( isset( $form_data_onsubm['onsubm']['mail_usr_pdf_fn'] ) ) ? urldecode( $form_data_onsubm['onsubm']['mail_usr_pdf_fn'] ) : ''; - $mail_pdf_fn = do_shortcode( $mail_pdf_fn ); - $data_mail['mail_usr_pdf_fn'] = $mail_pdf_fn; - $data_mail['html_wholecont'] = $mail_pdf_wholecont; - $data_mail['rec_id'] = $idActivate; - $data_mail['is_html'] = 0; - - $data_mail['charset'] = ( isset( $form_data_onsubm['main']['pdf_charset'] ) ) ? $form_data_onsubm['main']['pdf_charset'] : ''; - $data_mail['font'] = ( isset( $form_data_onsubm['main']['pdf_font'] ) ) ? urldecode( $form_data_onsubm['main']['pdf_font'] ) : ''; - $data_mail['pdf_paper_size'] = ( isset( $form_data_onsubm['main']['pdf_paper_size'] ) ) ? $form_data_onsubm['main']['pdf_paper_size'] : 'a4'; - $data_mail['pdf_paper_orie'] = ( isset( $form_data_onsubm['main']['pdf_paper_orie'] ) ) ? $form_data_onsubm['main']['pdf_paper_orie'] : 'landscape'; - - // $mail_pdf_font = (isset($form_data_onsubm['onsubm']['mail_usr_pdf_font'])) ? urldecode($form_data_onsubm['onsubm']['mail_usr_pdf_font']) : ''; - // $data_mail['mail_usr_pdf_font']=$mail_pdf_font; - // $data_mail['mail_usr_pdf_charset']=(isset($form_data_onsubm['onsubm']['mail_usr_pdf_charset'])) ? $form_data_onsubm['onsubm']['mail_usr_pdf_charset'] : ''; - $attachments[] = $this->process_custom_pdf( $data_mail ); - } - - $data_mail = array(); - $data_mail['from_mail'] = html_entity_decode( do_shortcode( $mail_from_email ) ); - $data_mail['from_name'] = html_entity_decode( do_shortcode( $mail_from_name ) ); - $data_mail['message'] = $mail_template_msg; - $data_mail['subject'] = html_entity_decode( do_shortcode( $mail_usr_subject ) ); - $data_mail['attachments'] = $attachments; - $data_mail['to'] = $this->model_record->getFieldOptRecord( $idActivate, '', $mail_usr_recipient, 'input' ); - $data_mail['cc'] = array_map( 'trim', explode( ',', $mail_usr_cc ) ); - $data_mail['bcc'] = array_map( 'trim', explode( ',', $mail_usr_bcc ) ); - if ( ! empty( $mail_usr_replyto ) ) { - $data_mail['mail_replyto'] = $mail_usr_replyto; - } - if ( isset( $form_data_onsubm['main']['email_dissubm'] ) && intval( $form_data_onsubm['main']['email_dissubm'] ) === 1 ) { - $mail_errors = false; - } else { - $mail_errors = $this->process_mail( $data_mail ); - } - } - } - // success message - - $tmp_sm_successtext = ( isset( $form_data_onsubm['onsubm']['sm_successtext'] ) ) ? urldecode( $form_data_onsubm['onsubm']['sm_successtext'] ) : ''; - $tmp_sm_successtext = do_shortcode( $tmp_sm_successtext ); - - // url redirection - $tmp_sm_redirect_st = ( isset( $form_data_onsubm['onsubm']['sm_redirect_st'] ) ) ? $form_data_onsubm['onsubm']['sm_redirect_st'] : '0'; - $tmp_sm_redirect_url = ( isset( $form_data_onsubm['onsubm']['sm_redirect_url'] ) ) ? urldecode( $form_data_onsubm['onsubm']['sm_redirect_url'] ) : ''; - - $data = array(); - $data['success'] = 1; - $data['show_message'] = $tmp_sm_successtext; - $data['sm_redirect_st'] = $tmp_sm_redirect_st; - $data['sm_redirect_url'] = $tmp_sm_redirect_url; - $data['price_format'] = $format_price_conf; - $data['amount'] = $form_cost_total; - $data['payment_st'] = ( isset( $form_data_onsubm['main']['payment_st'] ) ) ? $form_data_onsubm['main']['payment_st'] : 0; - $data['vis_uniqueid'] = $hash; - $data['form_errors'] = 0; - $data['form_id'] = $form_id; - $data['form_mail_err'] = $this->form_email_err; - $data['mail_error'] = ( $mail_errors ) ? 1 : 0; - $data['fbh_id'] = $idActivate; - $data['currency'] = $this->current_cost; - - modules::run( 'addon/zfad_frontend/addons_doActions', 'onSubmitForm_pos' ); - - if ( intval( $data['payment_st'] ) === 1 ) { - - $data['id_payrec'] = $id_payrec; - $this->form_response = $data; - $data['payment_html'] = $this->get_payment_html(); - // generate new invoice records - } else { - $this->form_response = $data; - } - return $data; - - } catch ( Exception $exception ) { - $data = array(); - $data['success'] = 0; - $data['form_errors'] = count( $form_errors ); - $data['error_debug'] = __METHOD__ . ' error: ' . $exception->getMessage(); - $data['mail_error'] = ( $mail_errors ) ? 1 : 0; - $this->form_response = $data; - return $data; - } - - } - - private function process_custom_pdf( $data ) { - - $output = ''; - $data2 = array(); - $data2['rec_id'] = $data['rec_id']; - $data2['content'] = $data['mail_usr_pdf_template_msg']; - $data2['html_wholecont'] = $data['html_wholecont']; - // $tmp_html = modules::run('formbuilder/frontend/pdf_global_template',$data2); - $output = generate_pdf( $data2['content'], $data['mail_usr_pdf_fn'], $data['pdf_paper_size'], $data['pdf_paper_orie'], false ); - - return $output; - } - - public function pdf_show_record() { - $rec_id = isset( $_GET['id'] ) ? Uiform_Form_Helper::sanitizeInput( $_GET['id'] ) : ''; - $is_html = isset( $_GET['is_html'] ) ? Uiform_Form_Helper::sanitizeInput( $_GET['is_html'] ) : 0; - - $form_data = $this->model_record->getFormDataById( $rec_id ); - $this->current_form_id = $form_data->form_fmb_id; - - if ( intval( $rec_id ) > 0 ) { - ob_start(); - ?> - - -

    fmb_name; ?>

    -

    - - - - flag_submitted = $rec_id; - - // custom template - if ( intval( $form_data->fmb_rec_tpl_st ) === 1 ) { - - $template_msg = do_shortcode( $form_data->fmb_rec_tpl_html ); - $template_msg = html_entity_decode( $template_msg, ENT_QUOTES, 'UTF-8' ); - $content = $template_msg; - } - - $pos = strpos( $content, '' ); - $pos2 = strpos( $content, '' ); - - if ( $pos === false && $pos2 === false ) { - $full_page = 0; - } else { - $full_page = 1; - if ( intval( $is_html ) === 1 ) { - $content = str_replace( '', '', $content ); - } - } - - $output = ''; - $data2 = array(); - $data2['rec_id'] = $rec_id; - $data2['html_wholecont'] = $full_page; - $data2['content'] = $content; - $data2['is_html'] = $is_html; - $tmp_res = modules::run( 'formbuilder/frontend/pdf_global_template', $data2 ); - - if ( intval( $is_html ) === 1 ) { - header( 'Content-type: text/html' ); - - echo $tmp_res['content']; - } else { - generate_pdf( $tmp_res['content'], 'record_' . $rec_id, $tmp_res['pdf_paper_size'], $tmp_res['pdf_paper_orie'], true ); - } - - die(); - - } - } - - - public function pdf_show_invoice() { - - $rec_id = isset( $_GET['id'] ) ? Uiform_Form_Helper::sanitizeInput( $_GET['id'] ) : ''; - $form_data = $this->model_gateways_records->getInvoiceDataByFormRecId( $rec_id ); - $is_html = isset( $_GET['is_html'] ) ? Uiform_Form_Helper::sanitizeInput( $_GET['is_html'] ) : 0; - - ob_start(); - ?> - - - - - - - -

     

    - - - flag_submitted = $rec_id; - - // custom template - if ( intval( $form_data->fmb_inv_tpl_st ) === 1 ) { - - $template_msg = do_shortcode( $form_data->fmb_inv_tpl_html ); - $template_msg = html_entity_decode( $template_msg, ENT_QUOTES, 'UTF-8' ); - $content = $template_msg; - } - - $pos = strpos( $content, '' ); - $pos2 = strpos( $content, '' ); - - if ( $pos === false && $pos2 === false ) { - $full_page = 0; - } else { - $full_page = 1; - if ( intval( $is_html ) === 1 ) { - $content = str_replace( '', '', $content ); - } - } - - $output = ''; - $data2 = array(); - $data2['rec_id'] = $rec_id; - $data2['head_extra'] = $head_extra; - $data2['content'] = $content; - $data2['is_html'] = $is_html; - // $tmp_html = self::$_modules['formbuilder']['frontend']->pdf_global_template($data2); - $tmp_res = modules::run( 'formbuilder/frontend/pdf_global_template', $data2 ); - if ( intval( $is_html ) === 1 ) { - header( 'Content-type: text/html' ); - - echo $tmp_res['content']; - } else { - generate_pdf( $tmp_res['content'], 'invoice_' . $rec_id, $tmp_res['pdf_paper_size'], $tmp_res['pdf_paper_orie'], true ); - } - - die(); - } - - public function pdf_global_template( $data ) { - - $rec_id = $data['rec_id']; - $temp = $this->model_record->getFormDataById( $rec_id ); - $form_id = $temp->form_fmb_id; - - $form_data = $this->model_forms->getFormById_2( $form_id ); - $form_data_onsubm = json_decode( $form_data->fmb_data2, true ); - $pdf_charset = ( isset( $form_data_onsubm['main']['pdf_charset'] ) ) ? $form_data_onsubm['main']['pdf_charset'] : ''; - $pdf_font = ( isset( $form_data_onsubm['main']['pdf_font'] ) ) ? urldecode( $form_data_onsubm['main']['pdf_font'] ) : ''; - $pdf_paper_size = ( isset( $form_data_onsubm['main']['pdf_paper_size'] ) ) ? $form_data_onsubm['main']['pdf_paper_size'] : 'a4'; - $pdf_paper_orie = ( isset( $form_data_onsubm['main']['pdf_paper_orie'] ) ) ? $form_data_onsubm['main']['pdf_paper_orie'] : 'landscape'; - - $data2 = array(); - $data2['font'] = $pdf_font; - $data2['charset'] = $pdf_charset; - $data2['pdf_paper_size'] = $pdf_paper_size; - $data2['pdf_paper_orie'] = $pdf_paper_orie; - $data2['head_extra'] = isset( $data['head_extra'] ) ? $data['head_extra'] : ''; - $data2['content'] = $data['content']; - $data2['html_wholecont'] = isset( $data['html_wholecont'] ) ? $data['html_wholecont'] : '0'; - $data2['is_html'] = isset( $data['is_html'] ) ? $data['is_html'] : '0'; - $data2['content'] = $this->load->view( 'formbuilder/forms/pdf_global_template', $data2, true ); - return $data2; - } - - private function process_DataRecord( $data1, $data2 ) { - - $data3 = array(); - - if ( ! empty( $data1 ) ) { - foreach ( $data1 as $key => $value ) { - - if ( ! empty( $value ) && is_array( $value ) ) { - foreach ( $value as $key2 => $value2 ) { - if ( is_array( $value2 ) ) { - // index - $temp_input = array(); - $temp_cost = array(); - $temp_qty = array(); - $temp_amt = array(); - - if ( is_array( $value2 ) ) { - foreach ( $value2 as $key3 => $value3 ) { - // values - if ( is_array( $value3 ) ) { - foreach ( $value3 as $key4 => $value4 ) { - switch ( $key4 ) { - case 'label': - $temp_input[] = $value4; - break; - case 'cost': - $temp_cost[] = $value4; - break; - case 'qty': - $temp_qty[] = $value4; - break; - case 'amount': - $temp_amt[] = $value4; - break; - default: - } - $data3[ $key . '_' . $key2 . '_' . $key3 . '_' . $key4 ] = $value4; - - } - } else { - $data3[ $key . '_' . $key2 . '_' . $key3 ] = $value3; - - } - } - } - - if ( ! empty( $temp_input ) ) { - $data3[ $key . '_input' ] = implode( '^,^', $temp_input ); - } - if ( ! empty( $temp_cost ) ) { - $data3[ $key . '_cost' ] = implode( '^,^', $temp_cost ); - } - if ( ! empty( $temp_qty ) ) { - $data3[ $key . '_qty' ] = implode( '^,^', $temp_qty ); - } - if ( ! empty( $temp_amt ) ) { - $data3[ $key . '_amount' ] = implode( '^,^', $temp_amt ); - } - } else { - $data3[ $key . '_' . $key2 ] = $value2; - } - } - } - } - } - $data3 = array_merge( $data3, $data2 ); - - return $data3; - } - - public function process_mail( $data ) { - $mail_errors = false; - - // disable mail function - if ( defined( 'ZF_DISABLE_EMAIL' ) && ZF_DISABLE_EMAIL === true ) { - return $mail_errors; - } - - /* - $this->email->clear(TRUE); - $this->email->set_newline("\r\n");*/ - /*getting admin mail*/ - $data['from_name'] = ! empty( $data['from_name'] ) ? $data['from_name'] : model_settings::$db_config['site_title']; - - // $headers = array(); - // $message_format='html'; - // $content_type = $message_format == "html" ? "text/html" : "text/plain"; - // $headers[] = "MIME-Version: 1.0"; - // $headers[] = "Content-type: {$content_type}"; - // $headers[] = "charset=utf8"; - // $headers[] = "From: \"{$data['from_name']}\" <{$data['from_mail']}>"; - - $to = trim( $data['to'] ); - - if ( preg_match( '/^[a-zA-Z0-9._+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/', $to ) ) { - - // $this->email->from($data['from_mail'], $data['from_name']); - // $this->email->to($to); - // $this->email->subject($data['subject']); - // $this->email->set_mailtype("html"); - // $this->email->message($data['message']); - - // phpmail library - require_once FCPATH . 'application/helpers/phpmailer/PHPMailerAutoload.php'; - - // Create a new PHPMailer instance - $mail = new PHPMailer(); - - if ( ! empty( $data['mail_replyto'] ) - && preg_match( '/^[a-zA-Z0-9._+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/', $data['mail_replyto'] ) ) { - - $mail_replyto_name = substr( $data['mail_replyto'], 0, strrpos( $data['mail_replyto'], '@' ) ); - // $headers[] = "Reply-To: \"{$mail_replyto_name}\" <{$data['mail_replyto']}>"; - - $mail->addReplyTo( $data['mail_replyto'], $mail_replyto_name ); - - // $this->email->reply_to($data['mail_replyto']); - // $data['subject'].=" - ".$data['mail_replyto']; - - } - // cc - if ( ! empty( $data['cc'] ) ) { - if ( is_array( $data['cc'] ) ) { - foreach ( $data['cc'] as $value ) { - if ( preg_match( '/^[a-zA-Z0-9._+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/', $value ) ) { - // $headers[] = "Cc: {$value}"; - - $mail->addCC( $value ); - - // $this->email->cc($value); - } - } - } - } - - // bcc - if ( ! empty( $data['bcc'] ) ) { - if ( is_array( $data['bcc'] ) ) { - foreach ( $data['bcc'] as $value ) { - if ( preg_match( '/^[a-zA-Z0-9._+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/', $value ) ) { - // $headers[] = "Bcc: {$value}"; - - $mail->addBCC( $value ); - - // $this->email->bcc($value); - } - } - } - } - - // charset - $mail->CharSet = 'UTF-8'; - - // Set who the message is to be sent from - $mail->setFrom( $data['from_mail'], $data['from_name'] ); - // Set who the message is to be sent to - $mail->addAddress( $to ); - // set html - $mail->isHTML( true ); - // Set the subject line - $mail->Subject = $data['subject']; - - $mail->Body = $data['message']; - $mail->AltBody = preg_replace( "/\n\s+/", "\n", rtrim( html_entity_decode( strip_tags( $data['message'] ) ) ) ); - - switch ( intval( model_settings::$db_config['type_email'] ) ) { - case 2: - // smtp - $mail->isSMTP(); // Set mailer to use SMTP - $mail->Host = model_settings::$db_config['smtp_host']; // Specify main and backup SMTP servers e.g. smtp1.example.com;smtp2.example.com - $mail->SMTPAuth = true; // Enable SMTP authentication - $mail->Username = model_settings::$db_config['smtp_user']; // SMTP username - $mail->Password = model_settings::$db_config['smtp_pass']; // SMTP password - $mail->SMTPSecure = model_settings::$db_config['smtp_conn']; // Enable TLS encryption, `ssl` also accepted - $mail->Port = model_settings::$db_config['smtp_port']; // TCP port to connect to - break; - case 3: - // sendmail - $mail->isSendmail(); - break; - case 1: - default: - // mail - - break; - } - - if ( ! empty( $data['attachments'] ) ) { - foreach ( $data['attachments'] as $attachment ) { - $mail->addAttachment( $attachment ); - // $this->email->attach($attachment); - } - } - - if ( ! $mail->send() ) { - $mail_errors = true; - $this->form_email_err[] = $mail->ErrorInfo; - } else { - $mail_errors = false; - } - - if ( false & ! empty( $data['attachments'] ) ) { - foreach ( $data['attachments'] as $attachment ) { - @unlink( $attachment ); // delete files after sending them - } - } - } else { - $mail_errors = true; - } - - return $mail_errors; - } - - - /** - * Frontend::viewform() - * - * @return - */ - public function viewform() { - $form_id = ( $this->input->get( 'form' ) ) ? Uiform_Form_Helper::sanitizeInput( $this->input->get( 'form' ) ) : 0; - $lmode = ( $this->input->get( 'lmode' ) ) ? Uiform_Form_Helper::sanitizeInput( $this->input->get( 'lmode' ) ) : ''; - - if ( $form_id === 0 ) { - return; - } - $website = 'uiform'; - $ip = isset( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : ''; - if ( ! isset( $_COOKIE[ $website ] ) ) { - $user_agent = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : ''; - $hash = hash( 'crc32', md5( $ip . $user_agent ) ); - setcookie( $website, $hash, time() + ( 60 * 60 * 24 * 30 ), '/' ); - } else { - $hash = $_COOKIE[ $website ]; - } - $agent = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : ''; - $referer = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : ''; - - // visitor data - /* - $data3 = array(); - $data3['vis_uniqueid'] = $hash; - $data3['vis_user_agent'] = $agent; - $data3['vis_page'] = $_SERVER['REQUEST_URI']; - $data3['vis_referer'] = $referer; - $data3['vis_ip'] = $_SERVER['REMOTE_ADDR']; - $this->db->set($data3); - $this->db->insert($this->model_visitor->table);*/ - - $rdata = $this->model_forms->getFormById( $form_id ); - $data = array(); - $data['uniqueid'] = $hash; - - // get data from form - $form_data = $this->model_forms->getFormById_2( $rdata->fmb_id ); - $form_data_onsubm = json_decode( $form_data->fmb_data2, true ); - - $onload_scroll = ( isset( $form_data_onsubm['main']['onload_scroll'] ) ) ? $form_data_onsubm['main']['onload_scroll'] : '1'; - - $preload_noconflict = ( isset( $form_data_onsubm['main']['preload_noconflict'] ) ) ? $form_data_onsubm['main']['preload_noconflict'] : '1'; - - $temp = array(); - $temp['id_form'] = $rdata->fmb_id; - $temp['site_url'] = site_url(); - $temp['base_url'] = base_url(); - $temp['lmode'] = $lmode; - $temp['onload_scroll'] = $onload_scroll; - $temp['preload_noconflict'] = $preload_noconflict; - - // addon - - $data['script'] = $this->load->view( 'formbuilder/forms/get_code_widget', $temp, true ); - - $this->load->view( 'formbuilder/frontend/viewform', $data ); - } - private function process_DataRecord2( $data1 ) { - - $data3 = array(); - if ( ! empty( $data1 ) ) { - foreach ( $data1 as $key => $value ) { - - switch ( strval( $key ) ) { - case 'calc': - if ( ! empty( $value ) && is_array( $value ) ) { - foreach ( $value as $key2 => $value2 ) { - $data3[ $key . '_' . $key2 ] = $value2; - } - } - break; - default: - } - } - } - - return $data3; - } - public function get_payment_html() { - - $data = array(); - $data['amount'] = ( isset( $this->form_response['amount'] ) ) ? $this->form_response['amount'] : 0; - $data['fbh_id'] = ( isset( $this->form_response['fbh_id'] ) ) ? $this->form_response['fbh_id'] : ''; - $data['currency'] = ( isset( $this->form_response['currency'] ) ) ? $this->form_response['currency'] : array(); - - $data['price_format'] = ( isset( $this->form_response['price_format'] ) ) ? $this->form_response['price_format'] : array(); - - $gateways = $this->model_gateways->getAvailableGateways(); - - foreach ( $gateways as $key => $value ) { - - switch ( intval( $value->pg_id ) ) { - case 1: - // offline - $pg_data = json_decode( $value->pg_data, true ); - $data2 = array(); - $data2['pg_name'] = ( isset( $value->pg_name ) ) ? $value->pg_name : ''; - $data2['pg_description'] = ( isset( $value->pg_description ) ) ? $value->pg_description : ''; - $data2['form_id'] = ( isset( $this->form_response['form_id'] ) ) ? $this->form_response['form_id'] : ''; - $data2['item_number'] = ( isset( $this->form_response['id_payrec'] ) ) ? $this->form_response['id_payrec'] : ''; - - $tmp_redirection = ''; - - // adding redirection - if ( ! empty( $pg_data['offline_return_url'] ) ) { - $tmp_redirection = $pg_data['offline_return_url']; - } elseif ( isset( $this->form_cur_data2['onsubm']['sm_redirect_st'] ) && intval( $this->form_cur_data2['onsubm']['sm_redirect_st'] ) === 1 ) { - $tmp_redirection = urldecode( $this->form_cur_data2['onsubm']['sm_redirect_url'] ); - } else { - - } - - $data2['offline_return_url'] = $tmp_redirection; - $gateways[ $key ]->html_view = $this->load->view( 'gateways/frontend/offline', $data2, true ); - - break; - case 2: - // paypal - if ( ZIGAFORM_C_LITE === 1 ) { - break 1; - } - $pg_data = json_decode( $value->pg_data, true ); - $data2 = array(); - $data2['amount'] = ( isset( $this->form_response['amount'] ) ) ? $this->form_response['amount'] : 0; - $data2['amount'] = number_format( round( $data2['amount'], 2, PHP_ROUND_HALF_EVEN ), 2, '.', '' ); - $data2['vis_uniqueid'] = ( isset( $this->form_response['vis_uniqueid'] ) ) ? $this->form_response['vis_uniqueid'] : ''; - $data2['pg_name'] = ( isset( $value->pg_name ) ) ? $value->pg_name : ''; - $data2['mod_test'] = ( isset( $value->pg_modtest ) ) ? $value->pg_modtest : 0; - $data2['pg_description'] = ( isset( $value->pg_description ) ) ? $value->pg_description : ''; - $data2['item_number'] = ( isset( $this->form_response['id_payrec'] ) ) ? $this->form_response['id_payrec'] : ''; - $data2['paypal_email'] = ( isset( $pg_data['paypal_email'] ) ) ? $pg_data['paypal_email'] : ''; - $data2['paypal_return_url'] = isset( $pg_data['paypal_return_url'] ) ? $pg_data['paypal_return_url'] : ''; - $data2['paypal_cancel_url'] = isset( $pg_data['paypal_cancel_url'] ) ? $pg_data['paypal_cancel_url'] : ''; - $data2['paypal_currency'] = isset( $pg_data['paypal_currency'] ) ? $pg_data['paypal_currency'] : ''; - $data2['paypal_method'] = isset( $pg_data['paypal_method'] ) ? $pg_data['paypal_method'] : 0; - - if ( intval( $data2['paypal_method'] ) === 0 ) { - - // get data from invoice - $form_rec_data = $this->model_gateways_records->getInvoiceDataByFormRecId( $data['fbh_id'] ); - $form_data = json_decode( $form_rec_data->fmb_data, true ); - - $form_data_calc_st = ( isset( $form_data['calculation']['enable_st'] ) ) ? $form_data['calculation']['enable_st'] : '0'; - - if ( intval( $form_data_calc_st ) === 1 ) { - // math calculation - - $tmp_invoice_row = array(); - $tmp_invoice_row['item_uniqueid'] = 0; - $tmp_invoice_row['item_id'] = 0; - $tmp_invoice_row['item_qty'] = 1; - $tmp_invoice_row['item_num'] = 1; - $tmp_invoice_row['item_name'] = ( isset( $form_data['calculation']['variables'][0]['tab_title'] ) ) ? $form_data['calculation']['variables'][0]['tab_title'] : 'Main Calc Variable'; - $tmp_invoice_row['item_amount'] = $form_rec_data->fbh_total_amount; - $new_record_user[] = $tmp_invoice_row; - } else { - - // processs tax - $form_data_tax_st = ( isset( $form_data['main']['price_tax_st'] ) ) ? $form_data['main']['price_tax_st'] : '0'; - $form_data_tax_val = ( isset( $form_data['main']['price_tax_val'] ) ) ? $form_data['main']['price_tax_val'] : ''; - - $tmp_amount_total = floatval( $this->form_response['amount'] ); - if ( isset( $form_data_tax_st ) && intval( $form_data_tax_st ) === 1 ) { - $tmp_tax = ( floatval( $form_data_tax_val ) / 100 ); - $tmp_sub_total = ( $tmp_amount_total ) * ( 100 / ( 100 + ( 100 * $tmp_tax ) ) ); - $data['form_subtotal_amount'] = $tmp_sub_total; - $data['form_tax'] = $tmp_amount_total - $tmp_sub_total; - } - - // process individuals - $name_fields = $this->model_record->getNameInvoiceField( $data['fbh_id'] ); - $name_fields_check = array(); - foreach ( $name_fields as $value ) { - $name_fields_check[ $value->fmf_uniqueid ]['fieldname'] = $value->fieldname; - $name_fields_check[ $value->fmf_uniqueid ]['id'] = $value->fmf_id; - } - - $data_record = $this->model_record->getRecordById( $data['fbh_id'] ); - $record_user = json_decode( $data_record->fbh_data, true ); - $new_record_user = array(); - $item_count = 1; - foreach ( $record_user as $key2 => $value ) { - - if ( isset( $name_fields_check[ $key2 ] ) && isset( $value['price_st'] ) && intval( $value['price_st'] ) === 1 ) { - $field_name = ''; - $field_id = ''; - $tmp_invoice_row = array(); - - $field_name = $name_fields_check[ $key2 ]['fieldname']; - $field_id = $name_fields_check[ $key2 ]['id']; - - $tmp_invoice_row['item_uniqueid'] = $key2; - $tmp_invoice_row['item_id'] = $field_id; - - if ( isset( $value['price_st'] ) && intval( $value['price_st'] ) === 1 ) { - if ( is_array( $value['input'] ) ) { - - if ( isset( $value['input']['amount'] ) ) { - $tmp_invoice_row['item_qty'] = 1; - $tmp_invoice_row['item_num'] = $item_count; - $tmp_invoice_row['item_name'] = $value['label']; - $tmp_invoice_row['item_amount'] = $value['input']['amount']; - $new_record_user[] = $tmp_invoice_row; - $item_count++; - } else { - foreach ( $value['input'] as $key3 => $value2 ) { - $tmp_invoice_row['item_qty'] = 1; - $tmp_invoice_row['item_name'] = ''; - $tmp_invoice_row['item_num'] = $item_count; - if ( isset( $value2['cost'] ) ) { - if ( isset( $value2['qty'] ) ) { - $tmp_invoice_row['item_qty'] = $value2['qty']; - $tmp_invoice_row['item_amount'] = $value2['cost']; - } else { - $tmp_invoice_row['item_amount'] = $value2['cost']; - } - } - - $tmp_inp_label = $value['label']; - if ( ! empty( $value2['label'] ) ) { - $tmp_inp_label .= ' - ' . $value2['label']; - } - $tmp_invoice_row['item_name'] = $tmp_inp_label; - - $new_record_user[] = $tmp_invoice_row; - $item_count++; - } - } - } else { - $tmp_invoice_row['item_qty'] = 0; - $tmp_invoice_row['item_num'] = $item_count; - $tmp_invoice_row['item_name'] .= ' ' . $value['input']; - $tmp_invoice_row['item_amount'] = 0; - $new_record_user[] = $tmp_invoice_row; - $item_count++; - } - } - } - } - - // add tax - if ( isset( $form_data_tax_st ) && intval( $form_data_tax_st ) === 1 ) { - $tmp_invoice_row = array(); - $tmp_invoice_row['item_qty'] = 1; - $tmp_invoice_row['item_num'] = $item_count; - $tmp_invoice_row['item_name'] = 'TAX'; - $tmp_invoice_row['item_amount'] = $data['form_tax']; - $new_record_user[] = $tmp_invoice_row; - } - } - $data2['paypal_individuals'] = $new_record_user; - } - $gateways[ $key ]->html_view = $this->load->view( 'gateways/frontend/paypal', $data2, true ); - break; - default: - break; - } - } - $data['gateways'] = $gateways; - - $output = $this->load->view( 'formbuilder/frontend/payment_html', $data, true ); - return $output; - } - - - +class Frontend extends FrontendController +{ + + const VERSION = '1.2'; + + private $flag_submitted = 0; + private $form_response = array(); + private $current_cost = array(); + private $current_form_id = ''; + private $form_rec_msg_summ = ''; + private $form_email_err = array(); + private $form_cur_data = array(); + private $form_cur_data2 = array(); + + private $format_price_conf = array(); + + const PREFIX = 'wprofmr_'; + + /** + * Frontend::__construct() + * + * @return + */ + public function __construct() + { + + parent::__construct(); + $this->load->language_alt(model_settings::$db_config['language']); + $this->template->set('controller', $this); + $this->load->model('model_fields'); + $this->load->model('model_forms'); + $this->load->model('model_record'); + $this->load->model('visitor/model_visitor'); + $this->load->model('visitor/model_visitor_error'); + $this->load->model('gateways/model_gateways'); + $this->load->model('gateways/model_gateways_records'); + $this->load->library('cache'); + /* + shortcodes*/ + // add_shortcode('uifm_cost_total', array(&$this, 'shortcode_uifm_cost_total') ); + add_shortcode('uifm_wrap', array( &$this, 'shortcode_uifm_recvar_wrap' )); + add_shortcode('uifm_recvar', array( &$this, 'shortcode_uifm_recvar' )); + add_shortcode('zgfm_rfvar', array( &$this, 'shortcode_uifm_recfvar' )); + add_shortcode('uifm_var', array( &$this, 'shortcode_uifm_form_var' )); + + /*shortcodes*/ + add_shortcode('uifm_symbol', array( &$this, 'shortcode_uifm_symbol' )); + add_shortcode('uifm_total', array( &$this, 'shortcode_uifm_total' )); + add_shortcode('uifm_currency', array( &$this, 'shortcode_uifm_currency' )); + add_shortcode('uifm_summary', array( &$this, 'shortcode_uifm_summary' )); + add_shortcode('uifm_summary_link', array( &$this, 'shortcode_uifm_summary_link' )); + add_shortcode('uifm_price', array( &$this, 'shortcode_uifm_price' )); + + add_shortcode('uifm_tax', array( &$this, 'shortcode_uifm_tax' )); + add_shortcode('uifm_subtotal', array( &$this, 'shortcode_uifm_subtotal' )); + + /*shortcode calc*/ + add_shortcode('zgfm_fvar', array( &$this, 'shortcode_uifm_form_fvar' )); + + // check update + $this->auth->checkupdate(); + } + + public function shortcode_uifm_tax($atts) + { + + ob_start(); + + ?> + 0 + + 0 + + + 0'; + } + + public function shortcode_uifm_currency($atts) + { + + ob_start(); + ?> + + '5', + 'heading' => '', + 'hide_cur_code' => '0', + 'hide_cur_symbol' => '0', + ), + $atts + ); + + ob_start(); + ?> + + + + + + + + + + + + + + 'Show summary', + ), + $atts + ); + + ob_start(); + ?> + + 0'; + } + + /** + * Frontend::index() + * Get all fields information by form id + * + * @return array + */ + public function index() + { + + $form_id = ( $this->input->get('form') ) ? $this->input->get('form') : 0; + $website = 'cmsest'; + $ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : ''; + if ( ! isset($_COOKIE[ $website ])) { + $user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''; + $hash = hash('crc32', md5($ip . $user_agent)); + setcookie($website, $hash, time() + ( 60 * 60 * 24 * 30 ), '/'); + } else { + $hash = $_COOKIE[ $website ]; + } + $agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''; + $referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; + + // visitor data + /* + $data3 = array(); + $data3['vis_uniqueid'] = $hash; + $data3['vis_user_agent'] = $agent; + $data3['vis_page'] = $_SERVER['REQUEST_URI']; + $data3['vis_referer'] = $referer; + $data3['vis_ip'] = $_SERVER['REMOTE_ADDR']; + $this->db->set($data3); + $this->db->insert($this->model_visitor->table);*/ + + $data = array(); + if ( $form_id == 0) { + $rdata = $this->model_forms->getFormDefault(); + if ( empty($rdata)) { + $forms = $this->model_forms->getListActiveForms(); + if ( ! empty($forms)) { + foreach ( $forms as $value) { + $rdata = $this->model_forms->getFormById($value->fmb_id); + break 1; + } + } + } + } else { + $rdata = $this->model_forms->getFormById($form_id); + } + + if ( ! empty($rdata)) { + $data = array(); + $data['html_content'] = $rdata->fmb_html; + $data['forms'] = $this->model_forms->getListActiveForms(); + + $data['uniqueid'] = $hash; + + // get data from form + $form_data = $this->model_forms->getFormById_2($rdata->fmb_id); + $form_data_onsubm = json_decode($form_data->fmb_data2, true); + + $preload_noconflict = ( isset($form_data_onsubm['main']['preload_noconflict']) ) ? $form_data_onsubm['main']['preload_noconflict'] : '1'; + + $temp = array(); + $temp['id_form'] = $rdata->fmb_id; + $temp['site_url'] = site_url(); + $temp['base_url'] = base_url(); + + $temp['preload_noconflict'] = $preload_noconflict; + + $data['script'] = $this->load->view('formbuilder/forms/get_code_widget', $temp, true); + + $message = ( $this->input->get('message') ) ? $this->input->get('message') : ''; + if ( ! empty($message)) { + switch ( $message) { + case 'ppsuccess': + $data['message'] = __('paypal success message', 'FRocket_admin'); + break; + case 'pperror': + $data['message'] = __('error found while submitting', 'FRocket_admin'); + break; + case 'offlinesuccess': + $data['message'] = __('Offline success', 'FRocket_admin'); + break; + default: + break; + } + } + } + + $this->template->loadPartial('frontend/layout', 'frontend/index', $data); + } + + /* + * Generate cached form + */ + public function generate_cache($form_id) + { + + $this->auth->authenticate(true); + + $output = array(); + $output['scripts'] = ''; + $output['html'] = ''; + + if ( intval($form_id) === 0) { + return $output; + } + + $rdata = $this->model_forms->getFormById($form_id); + + $response = array(); + $form_data_onsubm = json_decode($rdata->fmb_data2, true); + $onload_scroll = ( isset($form_data_onsubm['main']['onload_scroll']) ) ? $form_data_onsubm['main']['onload_scroll'] : '1'; + + $preload_noconflict = ( isset($form_data_onsubm['main']['preload_noconflict']) ) ? $form_data_onsubm['main']['preload_noconflict'] : '1'; + + // load form variables + $form_variables = array(); + $form_variables['_uifmvar']['addon'] = self::$_addons_jsactions; + $form_variables['_uifmvar']['is_demo'] = 0; + $form_variables['_uifmvar']['is_dev'] = 0; + $form_variables['onload_scroll'] = $onload_scroll; + $form_variables['preload_noconflict'] = $preload_noconflict; + $enqueue_scripts = do_filter('zgfm_front_enqueue_scripts', array()); + + $data_scripts = array(); + $data_styles = array(); + if ( ! empty($enqueue_scripts) && is_array($enqueue_scripts)) { + foreach ( $enqueue_scripts as $key => $value) { + if ( ! empty($value) && is_array($value)) { + foreach ( $value as $key2 => $value2) { + if ( ! empty($value2) && is_array($value2)) { + foreach ( $value2 as $key3 => $value3) { + switch ( strval($key3)) { + case 'scripts': + foreach ( $value3 as $key4 => $value4) { + $data_scripts[] = $value4['src']; + } + break; + case 'styles': + foreach ( $value3 as $key4 => $value4) { + $data_styles[] = $value4['src']; + } + break; + default: + break; + } + } + } + } + } + } + } + $data_scripts = array_unique($data_scripts); + $data_styles = array_unique($data_styles); + $response['site_url'] = site_url(); + $response['base_url'] = base_url(); + $response['id_form'] = $form_id; + $response['scripts'] = $data_scripts; + $response['styles'] = $data_styles; + $form_variables['ajaxurl'] = ''; + $form_variables['uifm_baseurl'] = base_url(); + $form_variables['uifm_siteurl'] = site_url(); + $form_variables['uifm_sfm_baseurl'] = base_url() . 'libs/styles-font-menu/styles-fonts/png/'; + $form_variables['imagesurl'] = base_url() . 'assets/frontend/images'; + $response['rockfm_vars_arr'] = $form_variables; + + if ( ! empty($rdata)) { + $response['html_content'] = do_shortcode($rdata->fmb_html); + } + + $output['scripts'] = $this->load->view('formbuilder/forms/get_code_cached_scripts', $response, true); + $output['html'] = $this->load->view('formbuilder/forms/get_code_cached_html', $response, true); + + return $output; + } + + /** + * Frontend::getform() + * Get form by form id + * + * @return array + */ + public function getform() + { + + $form_id = ( $this->input->post('id') ) ? Uiform_Form_Helper::sanitizeInput($this->input->post('id')) : 0; + + $website = 'uiform'; + $ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : ''; + if ( ! isset($_COOKIE[ $website ])) { + $user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''; + $hash = hash('crc32', md5($ip . $user_agent)); + setcookie($website, $hash, time() + ( 60 * 60 * 24 * 30 ), '/'); + } else { + $hash = $_COOKIE[ $website ]; + } + $agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''; + $referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; + + // visitor data + /* + $data3 = array(); + $data3['vis_uniqueid'] = $hash; + $data3['vis_user_agent'] = $agent; + $data3['vis_page'] = $_SERVER['REQUEST_URI']; + $data3['vis_referer'] = $referer; + $data3['vis_ip'] = $_SERVER['REMOTE_ADDR']; + $this->db->set($data3); + $this->db->insert($this->model_visitor->table);*/ + + $data = array(); + $response = array(); + if ( intval($form_id) === 0) { + return; + } + + $rdata = $this->model_forms->getAvailableFormById($form_id); + if ( empty($rdata)) { + $response['success'] = '0'; + $response['html_content'] = ''; + } else { + $form_data_onsubm = json_decode($rdata->fmb_data2, true); + $onload_scroll = ( isset($form_data_onsubm['main']['onload_scroll']) ) ? $form_data_onsubm['main']['onload_scroll'] : '1'; + + $preload_noconflict = ( isset($form_data_onsubm['main']['preload_noconflict']) ) ? $form_data_onsubm['main']['preload_noconflict'] : '1'; + + // load form variables + $form_variables = array(); + $form_variables['_uifmvar']['addon'] = self::$_addons_jsactions; + $form_variables['_uifmvar']['is_demo'] = 0; + $form_variables['_uifmvar']['is_dev'] = 0; + $form_variables['onload_scroll'] = $onload_scroll; + $form_variables['preload_noconflict'] = $preload_noconflict; + $form_variables['enqueue_scripts'] = do_filter('zgfm_front_enqueue_scripts', array()); + $form_variables['ajaxurl'] = ''; + $form_variables['uifm_baseurl'] = base_url(); + $form_variables['uifm_siteurl'] = site_url(); + $form_variables['uifm_sfm_baseurl'] = base_url() . 'libs/styles-font-menu/styles-fonts/png/'; + $form_variables['imagesurl'] = base_url() . 'assets/frontend/images'; + $response['rockfm_vars_arr'] = $form_variables; + + if ( ! empty($rdata)) { + $response['success'] = '1'; + $response['html_content'] = Uiform_Form_Helper::encodeHex(do_shortcode($rdata->fmb_html)); + } + } + $data = array(); + $data['json'] = $response; + + $this->load->view('html_view', $data); + } + + + public function ajax_payment_seeinvoice() + { + $id_rec = ( isset($_POST['form_r_id']) ) ? Uiform_Form_Helper::sanitizeInput($_POST['form_r_id']) : ''; + $temp = $this->model_record->getFormDataById($id_rec); + $form_id = $temp->form_fmb_id; + $form_data = $this->model_forms->getFormById_2($form_id); + $form_data_onsubm = json_decode($form_data->fmb_data2, true); + $pdf_show_onpage = ( isset($form_data_onsubm['main']['pdf_show_onpage']) ) ? $form_data_onsubm['main']['pdf_show_onpage'] : '0'; + + $resp = array(); + $resp['show_summary_title'] = __('Invoice', 'frocket_front'); + if ( intval($pdf_show_onpage) === 1) { + $resp['show_summary_title'] = ' ' . __('Export to PDF', 'frocket_front') . ''; + } + + $data = array(); + $data['base_url'] = base_url() . '/'; + $data['form_id'] = $form_id; + $data['url_form'] = site_url() . 'formbuilder/frontend/pdf_show_invoice/?uifm_mode=pdf&is_html=1&id=' . $id_rec; + $resp['show_summary'] = Uiform_Form_Helper::encodeHex($this->load->view('formbuilder/frontend/form_summary_custom', $data, true)); + + // return data to ajax callback + $data = array(); + $data['json'] = $resp; + + $this->load->view('html_view', $data); + } + + public function ajax_payment_seesummary() + { + $id_rec = ( isset($_POST['form_r_id']) ) ? Uiform_Form_Helper::sanitizeInput($_POST['form_r_id']) : ''; + $temp = $this->model_record->getFormDataById($id_rec); + $form_id = $temp->form_fmb_id; + $form_data = $this->model_forms->getFormById_2($form_id); + $form_data_onsubm = json_decode($form_data->fmb_data2, true); + $pdf_show_onpage = ( isset($form_data_onsubm['main']['pdf_show_onpage']) ) ? $form_data_onsubm['main']['pdf_show_onpage'] : '0'; + + $resp = array(); + + $resp['show_summary_title'] = __('Order summary', 'frocket_front'); + if ( intval($pdf_show_onpage) === 1) { + $resp['show_summary_title'] .= ' ' . __('Export to PDF', 'frocket_front') . ''; + } + + if ( isset($temp->fmb_rec_tpl_st) && intval($temp->fmb_rec_tpl_st) === 1) { + $data = array(); + $data['base_url'] = base_url() . '/'; + $data['form_id'] = $form_id; + $data['url_form'] = site_url() . 'formbuilder/frontend/pdf_show_record/?uifm_mode=pdf&is_html=1&id=' . $id_rec; + $resp['show_summary'] = Uiform_Form_Helper::encodeHex($this->load->view('formbuilder/frontend/form_summary_custom', $data, true)); + } else { + $resp['show_summary'] = Uiform_Form_Helper::encodeHex(do_shortcode($this->get_summaryRecord($id_rec))); + } + + $data = array(); + $data['json'] = $resp; + + $this->load->view('html_view', $data); + } + + public function get_summaryInvoice() + { + $id_rec = ( isset($_GET['id']) ) ? Uiform_Form_Helper::sanitizeInput($_GET['id']) : ''; + $form_id = ( isset($_POST['form_id']) ) ? Uiform_Form_Helper::sanitizeInput($_POST['form_id']) : ''; + + $name_fields = $this->model_record->getNameInvoiceField($id_rec); + $form_rec_data = $this->model_gateways_records->getInvoiceDataByFormRecId($id_rec); + if ( empty($form_id)) { + $form_id = $form_rec_data->fmb_id; + } + + $form_data = json_decode($form_rec_data->fmb_data, true); + $form_data_currency = ( isset($form_data['main']['price_currency']) ) ? $form_data['main']['price_currency'] : ''; + $form_data_invoice = ( isset($form_data['invoice']) ) ? $form_data['invoice'] : ''; + + // price numeric format + $format_price_conf = array(); + $format_price_conf['price_format_st'] = ( isset($form_data['main']['price_format_st']) ) ? $form_data['main']['price_format_st'] : '0'; + $format_price_conf['price_sep_decimal'] = ( isset($form_data['main']['price_sep_decimal']) ) ? $form_data['main']['price_sep_decimal'] : '.'; + $format_price_conf['price_sep_thousand'] = ( isset($form_data['main']['price_sep_thousand']) ) ? $form_data['main']['price_sep_thousand'] : ','; + $format_price_conf['price_sep_precision'] = ( isset($form_data['main']['price_sep_precision']) ) ? $form_data['main']['price_sep_precision'] : '2'; + + $name_fields_check = array(); + + foreach ( $name_fields as $value) { + $name_fields_check[ $value->fmf_uniqueid ]['fieldname'] = $value->fieldname; + $name_fields_check[ $value->fmf_uniqueid ]['id'] = $value->fmf_id; + } + + $data_record = $this->model_record->getRecordById($id_rec); + $record_user = json_decode($data_record->fbh_data, true); + $new_record_user = array(); + foreach ( $record_user as $key => $value) { + if ( isset($name_fields_check[ $key ]) && isset($value['price_st']) && intval($value['price_st']) === 1) { + $field_name = ''; + $field_id = ''; + $tmp_invoice_row = array(); + + $field_name = $name_fields_check[ $key ]['fieldname']; + $field_id = $name_fields_check[ $key ]['id']; + + $tmp_invoice_row['item_uniqueid'] = $key; + $tmp_invoice_row['item_id'] = $field_id; + // $tmp_invoice_row['item_desc']=$value['label']; + + if ( is_array($value['input'])) { + foreach ( $value['input'] as $key2 => $value2) { + $tmp_invoice_row['item_qty'] = 1; + $tmp_invoice_row['item_desc'] = ''; + if ( isset($value2['amount'])) { + if ( isset($value2['qty'])) { + $tmp_invoice_row['item_qty'] = $value2['qty']; + $tmp_invoice_row['item_amount'] = $value2['amount']; + } else { + $tmp_invoice_row['item_amount'] = $value2['amount']; + } + } + + $tmp_inp_label = $value['label']; + if ( ! empty($value2['label'])) { + $tmp_inp_label .= ' - ' . $value2['label']; + } + $tmp_invoice_row['item_desc'] = $tmp_inp_label; + + $new_record_user[] = $tmp_invoice_row; + } + } else { + $tmp_invoice_row['item_qty'] = 1; + $tmp_invoice_row['item_desc'] .= ' ' . $value['input']; + $tmp_invoice_row['item_amount'] = ''; + $new_record_user[] = $tmp_invoice_row; + } + } + } + $data = array(); + + // processs tax + $form_data_tax_st = ( isset($form_data['main']['price_tax_st']) ) ? $form_data['main']['price_tax_st'] : '0'; + $form_data_tax_val = ( isset($form_data['main']['price_tax_val']) ) ? $form_data['main']['price_tax_val'] : ''; + + $tmp_amount_total = floatval($form_rec_data->fbh_total_amount); + if ( isset($form_data_tax_st) && intval($form_data_tax_st) === 1) { + $tmp_tax = ( floatval($form_data_tax_val) / 100 ); + $tmp_sub_total = ( $tmp_amount_total ) * ( 100 / ( 100 + ( 100 * $tmp_tax ) ) ); + $data['form_subtotal_amount'] = $tmp_sub_total; + $data['form_tax'] = $tmp_amount_total - $tmp_sub_total; + } + + $data['form_tax_enable'] = $form_data_tax_st; + $data['form_total_amount'] = $tmp_amount_total; + $data['form_mathcalc_st'] = ( isset($form_data['calculation']['enable_st']) ) ? $form_data['calculation']['enable_st'] : '0'; + $data['form_currency'] = $form_data_currency; + $data['record_info'] = $new_record_user; + $data['price_format'] = $format_price_conf; + $data['invoice_id'] = $form_rec_data->pgr_id; + $data['invoice_date'] = date('F j, Y, g:i a', strtotime($form_rec_data->created_date)); + + $data['invoice_from_info1'] = isset($form_data_invoice['from_text1']) ? urldecode($form_data_invoice['from_text1']) : ''; + $data['invoice_from_info2'] = isset($form_data_invoice['from_text2']) ? urldecode($form_data_invoice['from_text2']) : ''; + $data['invoice_from_info3'] = isset($form_data_invoice['from_text3']) ? urldecode($form_data_invoice['from_text3']) : ''; + $data['invoice_from_info4'] = isset($form_data_invoice['from_text4']) ? urldecode($form_data_invoice['from_text4']) : ''; + $data['invoice_from_info5'] = isset($form_data_invoice['from_text5']) ? urldecode($form_data_invoice['from_text5']) : ''; + $data['invoice_to_info1'] = isset($form_data_invoice['to_text1']) ? urldecode($this->model_record->getFieldOptRecord($id_rec, '', $form_data_invoice['to_text1'], 'input')) : ''; + $data['invoice_to_info2'] = isset($form_data_invoice['to_text2']) ? urldecode($this->model_record->getFieldOptRecord($id_rec, '', $form_data_invoice['to_text2'], 'input')) : ''; + $data['invoice_to_info3'] = isset($form_data_invoice['to_text3']) ? urldecode($this->model_record->getFieldOptRecord($id_rec, '', $form_data_invoice['to_text3'], 'input')) : ''; + $data['invoice_to_info4'] = isset($form_data_invoice['to_text4']) ? urldecode($this->model_record->getFieldOptRecord($id_rec, '', $form_data_invoice['to_text4'], 'input')) : ''; + $data['invoice_to_info5'] = isset($form_data_invoice['to_text5']) ? urldecode($form_data_invoice['to_text5']) : ''; + $form_summary = $this->load->view('formbuilder/frontend/form_invoice', $data, true); + + return $form_summary; + } + + public function get_summaryRecord($id_rec) + { + $form_id = ( isset($_POST['form_id']) ) ? Uiform_Form_Helper::sanitizeInput($_POST['form_id']) : ''; + + $name_fields = $this->model_record->getNameField($id_rec); + $form_rec_data = $this->model_record->getFormDataById($id_rec); + + $form_data = json_decode($form_rec_data->fmb_data, true); + + $form_data_currency = ( isset($form_data['main']['price_currency']) ) ? $form_data['main']['price_currency'] : ''; + + // price numeric format + $format_price_conf = array(); + $format_price_conf['price_format_st'] = ( isset($form_data['main']['price_format_st']) ) ? $form_data['main']['price_format_st'] : '0'; + $format_price_conf['price_sep_decimal'] = ( isset($form_data['main']['price_sep_decimal']) ) ? $form_data['main']['price_sep_decimal'] : '.'; + $format_price_conf['price_sep_thousand'] = ( isset($form_data['main']['price_sep_thousand']) ) ? $form_data['main']['price_sep_thousand'] : ','; + $format_price_conf['price_sep_precision'] = ( isset($form_data['main']['price_sep_precision']) ) ? $form_data['main']['price_sep_precision'] : '2'; + + $name_fields_check = array(); + + $field_data_stored = array(); + + foreach ( $name_fields as $value) { + $name_fields_check[ $value->fmf_uniqueid ] = $value->fieldname; + $field_data_stored[ $value->fmf_uniqueid ] = $value->fmf_data; + } + $data_record = $this->model_record->getRecordById($id_rec); + $record_user = json_decode($data_record->fbh_data, true); + $new_record_user = array(); + + foreach ( $record_user as $key => $value) { + $field_name = ''; + if ( isset($name_fields_check[ $key ])) { + $field_name = $name_fields_check[ $key ]; + } + + $field_data = array(); + if ( isset($field_data_stored[ $key ])) { + $field_data = $field_data_stored[ $key ]; + $field_data = json_decode($field_data, true); + } + + $value['label'] = ( isset($value['label']) ) ? $value['label'] : 'not assigned'; + + switch ( intval($value['type'])) { + case 12: + case 13: + $value_new = $value['input']; + // checking if image exists + if ( !empty($value_new) && @is_array(getimagesize($value_new))) { + $value_new = ''; + } + + $new_record_user[] = array( + 'field' => $value['label'], + 'field_name' => $field_name, + 'type' => $value['type'], + 'price_lbl_show_st' => isset($field_data['price']['lbl_show_st']) ? $field_data['price']['lbl_show_st'] : '0', + 'value' => $value_new, + ); + break; + default: + $new_record_user[] = array( + 'field' => $value['label'], + 'field_name' => $field_name, + 'type' => $value['type'], + 'price_lbl_show_st' => isset($field_data['price']['lbl_show_st']) ? $field_data['price']['lbl_show_st'] : '0', + 'value' => $value['input'], + ); + break; + } + } + $data = array(); + + // processs tax + $form_data_tax_st = ( isset($form_data['main']['price_tax_st']) ) ? $form_data['main']['price_tax_st'] : '0'; + $form_data_tax_val = ( isset($form_data['main']['price_tax_val']) ) ? $form_data['main']['price_tax_val'] : ''; + + $tmp_amount_total = floatval($form_rec_data->fbh_total_amount); + if ( isset($form_data_tax_st) && intval($form_data_tax_st) === 1) { + $tmp_tax = ( floatval($form_data_tax_val) / 100 ); + $tmp_sub_total = ( $tmp_amount_total ) * ( 100 / ( 100 + ( 100 * $tmp_tax ) ) ); + $data['form_subtotal_amount'] = $tmp_sub_total; + $data['form_tax'] = $tmp_amount_total - $tmp_sub_total; + } + + $data['form_total_amount'] = $tmp_amount_total; + $data['form_currency'] = $form_data_currency; + $data['record_info'] = $new_record_user; + $data['price_format'] = $format_price_conf; + $form_summary = $this->load->view('formbuilder/frontend/form_summary', $data, true); + return $form_summary; + } + + public function ajax_save_offlinepayment() + { + $offline_return_url = ( isset($_POST['offline_return_url']) ) ? Uiform_Form_Helper::sanitizeInput($_POST['offline_return_url']) : ''; + $item_number = ( isset($_POST['item_number']) ) ? Uiform_Form_Helper::sanitizeInput($_POST['item_number']) : ''; + $form_id = ( isset($_POST['form_id']) ) ? Uiform_Form_Helper::sanitizeInput($_POST['form_id']) : ''; + + $data = array(); + $data['type_pg_id'] = 1; + $data['pgr_payment_status'] = 'completed'; + $data['pgr_data'] = json_encode($_POST); + $where = array( + 'pgr_id' => $item_number, + ); + + $this->db->set($data); + $this->db->where('pgr_id', $item_number); + $this->db->update($this->model_gateways_records->table); + + $resp = array(); + $resp['success'] = 1; + $resp['return_url'] = $offline_return_url; + + $gt_data = $this->model_gateways_records->getRecordById($item_number); + $this->flag_submitted = $gt_data->fbh_id; + + if ( empty($offline_return_url)) { + // get data from form + $form_data = $this->model_forms->getFormById_2($form_id); + $form_data_onsubm = json_decode($form_data->fmb_data2, true); + // prepare message + $tmp_template_msg = ( isset($form_data_onsubm['onsubm']['sm_successtext']) ) ? urldecode($form_data_onsubm['onsubm']['sm_successtext']) : ''; + $tmp_template_msg = do_shortcode($tmp_template_msg); + + $resp['show_message'] = $tmp_template_msg; + } + + // return data to ajax callback + $data = array(); + $data['json'] = $resp; + + $this->load->view('html_view', $data); + } + + public function uifm_set_newuser_cookie() + { + $ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : ''; + $user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''; + $hash = hash('crc32', md5($ip . $user_agent)); + setcookie('uiform_costest', $hash, time() + ( 60 * 60 * 24 * 30 ), '/'); + } + + public function shortcode_uifm_cost_total($atts) + { + + $vars = shortcode_atts( + array( + 'heading' => __('Total cost', 'frocket_front'), + ), + $atts + ); + + ob_start(); + ?> + + + + + + +
    :current_cost['symbol'] . $this->current_cost['total'] . ' ' . $this->current_cost['cur']; ?>
    + current_cost['st']) && intval($this->current_cost['st']) === 1) { + return $str_output; + } else { + return ''; + } + } + + public function shortcode_uifm_recvar_wrap($atts, $content = null) + { + + $vars = shortcode_atts( + array( + 'id' => '', + 'atr1' => 'input', + 'opt' => '', // quick option + ), + $atts + ); + + $result = ''; + $output = ''; + + switch ( strval($vars['opt'])) { + case 'calc': + break; + default: + $f_data = $this->model_record->getFieldDataById($this->flag_submitted, $vars['id']); + switch (intval($f_data->type)) { + case 16: + case 17: + case 18: + $output = $this->model_record->getFieldOptRecord($this->flag_submitted, $f_data->type, $vars['id'], 'input', 'value'); + break; + + default: + $output = $this->model_record->getFieldOptRecord($this->flag_submitted, $f_data->type, $vars['id'], $vars['atr1']); + break; + } + + + + break; + } + + if ( $output != '' && $output!='0') { + $result = do_shortcode($content); + } else { + $result = ''; + } + + return $result; + } + + public function shortcode_uifm_recvar($atts) + { + + try { + $vars = shortcode_atts( + array( + 'id' => '', + 'atr1' => 'input', + 'atr2' => '', + 'atr3' => '', + 'atr4' => '', + ), + $atts + ); + + $f_data = $this->model_record->getFieldDataById($this->flag_submitted, $vars['id']); + if ( ! isset($f_data->type)) { + throw new Exception(__('field data is not cound. field:' . $vars['id'])); + } + $output = $this->model_record->getFieldOptRecord($this->flag_submitted, $f_data->type, $vars['id'], $vars['atr1'], $vars['atr2']); + + // apply price format + switch ( strval($vars['atr3'])) { + case 'price_format': + /* + * check if format price configuration is stored + */ + if ( empty($this->format_price_conf)) { + $form_rec_data = $this->model_record->getFormDataById($this->flag_submitted); + $form_data = json_decode($form_rec_data->fmb_data, true); + // price numeric format + $format_price_conf = array(); + $format_price_conf['price_format_st'] = ( isset($form_data['main']['price_format_st']) ) ? $form_data['main']['price_format_st'] : '0'; + $format_price_conf['price_sep_decimal'] = ( isset($form_data['main']['price_sep_decimal']) ) ? $form_data['main']['price_sep_decimal'] : '.'; + $format_price_conf['price_sep_thousand'] = ( isset($form_data['main']['price_sep_thousand']) ) ? $form_data['main']['price_sep_thousand'] : ','; + $format_price_conf['price_sep_precision'] = ( isset($form_data['main']['price_sep_precision']) ) ? $form_data['main']['price_sep_precision'] : '2'; + $this->format_price_conf = $format_price_conf; + } + + $output = Uiform_Form_Helper::cformat_numeric($this->format_price_conf, $output); + + break; + case 'format': + switch ( strval($vars['atr4'])) { + case 'list': + //format to field with multiple options + switch ( strval($f_data->type)) { + case '9': + case '11': + $tmpArr = explode('^,^', $output); + if ( is_array($tmpArr)) { + $newString = '
      '; + foreach ( $tmpArr as $key => $value) { + $newString .= '
    • ' . $value . '
    • '; + } + $newString .= '
    '; + $output = $newString; + } + + break; + + default: + # code... + break; + } + break; + case 'comma': + //format to field with multiple options + switch ( strval($f_data->type)) { + case '9': + case '11': + $tmpArr = explode('^,^', $output); + if ( is_array($tmpArr)) { + $output = str_replace('^,^', ', ', $output); + } + + break; + + default: + # code... + break; + } + break; + default: + break; + } + + break; + } + + if ( $output != '') { + return $output; + } else { + return ''; + } + } catch ( Exception $exception) { + $data = array(); + $data['vars'] = $vars; + $data['error_debug'] = __METHOD__ . ' error: ' . $exception->getMessage(); + return ''; + } + } + + + public function shortcode_uifm_recfvar($atts) + { + + $vars = shortcode_atts( + array( + 'id' => '', + 'atr1' => 'input', + ), + $atts + ); + + switch ( strval($vars['atr1'])) { + case 'label': + ob_start(); + ?> + + + + + + + + '', + 'atr2' => '', + 'atr3' => '', + 'opt' => '', // quick option + ), + $atts + ); + $output = ''; + + if ( ! empty($vars['opt'])) { + switch ( (string) $vars['opt']) { + case 'calc': + ob_start(); + if ( isset($vars['atr1']) && intval($vars['atr1']) >= 0) { + ?> +
    + + + + + + 0 + + 0 + 0'; + break; + } + } + + if ( $output != '') { + return $output; + } else { + return ''; + } + } + + public function shortcode_uifm_form_var($atts) + { + + $vars = shortcode_atts( + array( + 'atr1' => '0', // source 0=>fmb_data2; 1=>fmb_data + 'atr2' => '', + 'atr3' => '', + 'atr4' => '', + 'opt' => '', // quick option + ), + $atts + ); + $output = ''; + + $rec_id = $this->flag_submitted; + + if ( ! empty($vars['opt'])) { + switch ( (string) $vars['opt']) { + case 'calc': + $form_rec_data = $this->model_record->getVarOptRecord('calc_' . $vars['atr1'], $this->flag_submitted); + $output = $form_rec_data; + break; + case 'form_currency_symbol': + case 'form_cur_symbol': + $form_data = $this->model_forms->getFormById_2($this->current_form_id); + $form_data_onsubm = json_decode($form_data->fmb_data2, true); + $output = $form_data_onsubm['main']['price_currency_symbol']; + break; + case 'form_currency_code': + case 'form_cur_code': + $form_data = $this->model_forms->getFormById_2($this->current_form_id); + $form_data_onsubm = json_decode($form_data->fmb_data2, true); + $output = $form_data_onsubm['main']['price_currency']; + break; + case 'form_total_amount': + case 'form_subtotal_amount': + case 'form_tax_amount': + $form_rec_data = $this->model_record->getFormDataById($rec_id); + if ( ! isset($form_rec_data->fmb_data)) { + break 1; + } + $form_data = json_decode($form_rec_data->fmb_data, true); + + // price numeric format + $format_price_conf = array(); + $format_price_conf['price_format_st'] = ( isset($form_data['main']['price_format_st']) ) ? $form_data['main']['price_format_st'] : '0'; + $format_price_conf['price_sep_decimal'] = ( isset($form_data['main']['price_sep_decimal']) ) ? $form_data['main']['price_sep_decimal'] : '.'; + $format_price_conf['price_sep_thousand'] = ( isset($form_data['main']['price_sep_thousand']) ) ? $form_data['main']['price_sep_thousand'] : ','; + $format_price_conf['price_sep_precision'] = ( isset($form_data['main']['price_sep_precision']) ) ? $form_data['main']['price_sep_precision'] : '2'; + + $tmp_amount_total = 0; + $tmp_amount_subtotal = 0; + $tmp_amount_tax = 0; + + $tmp_output = $this->model_record->getOptRecordById('fbh_total_amount', $rec_id); + if ( ! empty($tmp_output) && isset($tmp_output->fbh_total_amount)) { + $tmp_amount_total = floatval($tmp_output->fbh_total_amount); + } + + // processs tax + $form_data_tax_st = ( isset($form_data['main']['price_tax_st']) ) ? $form_data['main']['price_tax_st'] : '0'; + $form_data_tax_val = ( isset($form_data['main']['price_tax_val']) ) ? $form_data['main']['price_tax_val'] : ''; + + if ( isset($form_data_tax_st) && intval($form_data_tax_st) === 1) { + $tmp_tax = ( floatval($form_data_tax_val) / 100 ); + $tmp_sub_total = ( $tmp_amount_total ) * ( 100 / ( 100 + ( 100 * $tmp_tax ) ) ); + $tmp_amount_subtotal = $tmp_sub_total; + $tmp_amount_tax = $tmp_amount_total - $tmp_sub_total; + } + + switch ( (string) $vars['opt']) { + case 'form_total_amount': + $output = Uiform_Form_Helper::cformat_numeric($format_price_conf, $tmp_amount_total); + break; + case 'form_subtotal_amount': + $output = Uiform_Form_Helper::cformat_numeric($format_price_conf, $tmp_amount_subtotal); + break; + case 'form_tax_amount': + $output = Uiform_Form_Helper::cformat_numeric($format_price_conf, $tmp_amount_tax); + break; + } + + break; + case 'rec_summ': + $data = $this->model_record->getFormDataById($rec_id); + $tmp_data = json_decode($data->fbh_data, true); + $form_data_onsubm = json_decode($data->fmb_data2, true); + + // price numeric format + $format_price_conf = array(); + $format_price_conf['price_format_st'] = ( isset($form_data_onsubm['main']['price_format_st']) ) ? $form_data_onsubm['main']['price_format_st'] : '0'; + $format_price_conf['price_sep_decimal'] = ( isset($form_data_onsubm['main']['price_sep_decimal']) ) ? $form_data_onsubm['main']['price_sep_decimal'] : '.'; + $format_price_conf['price_sep_thousand'] = ( isset($form_data_onsubm['main']['price_sep_thousand']) ) ? $form_data_onsubm['main']['price_sep_thousand'] : ','; + $format_price_conf['price_sep_precision'] = ( isset($form_data_onsubm['main']['price_sep_precision']) ) ? $form_data_onsubm['main']['price_sep_precision'] : '2'; + + $data2 = array(); + $data2['data'] = $tmp_data; + $data2['format_price_conf'] = $format_price_conf; + $data2['form_cost_total'] = $data->fbh_total_amount; + $data2['current_cost_st'] = ( isset($form_data_onsubm['main']['price_st']) ) ? $form_data_onsubm['main']['price_st'] : 'USD'; + $data2['current_cost_symbol'] = ( isset($form_data_onsubm['main']['price_currency_symbol']) ) ? $form_data_onsubm['main']['price_currency_symbol'] : '$'; + $data2['current_cost_cur'] = ( isset($form_data_onsubm['main']['price_currency']) ) ? $form_data_onsubm['main']['price_currency'] : 'USD'; + $data2['show_only_value'] = ($vars['atr2'] === 'show_only_value')?'yes':'no'; + $output = $this->load->view('formbuilder/frontend/mail_generate_fields', $data2, true); + break; + case 'rec_url_fm': + $output = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; + break; + case 'form_name': + $data = $this->model_record->getFormDataById($rec_id); + $output = $data->fmb_name; + break; + case 'rec_id': + $output = $rec_id; + break; + case 'form_inv_number': + $data = $this->model_gateways_records->getInvoiceDataByFormRecId($rec_id); + $output = $data->pgr_id; + break; + case 'form_inv_date': + $data = $this->model_gateways_records->getInvoiceDataByFormRecId($rec_id); + if ( ! empty($vars['atr2'])) { + $temp_date = date($vars['atr2'], strtotime($data->created_date)); + } else { + $temp_date = date('F j, Y', strtotime($data->created_date)); + } + $output = $temp_date; + break; + case 'user_ip': + $data = $this->model_record->getFormDataById($rec_id); + $output = $data->created_ip; + break; + default: + } + + // apply price format + switch ( strval($vars['atr3'])) { + case 'price_format': + /* + * check if format price configuration is stored + */ + if ( empty($this->format_price_conf)) { + $form_rec_data = $this->model_record->getFormDataById($rec_id); + $form_data = json_decode($form_rec_data->fmb_data, true); + // price numeric format + $format_price_conf = array(); + $format_price_conf['price_format_st'] = ( isset($form_data['main']['price_format_st']) ) ? $form_data['main']['price_format_st'] : '0'; + $format_price_conf['price_sep_decimal'] = ( isset($form_data['main']['price_sep_decimal']) ) ? $form_data['main']['price_sep_decimal'] : '.'; + $format_price_conf['price_sep_thousand'] = ( isset($form_data['main']['price_sep_thousand']) ) ? $form_data['main']['price_sep_thousand'] : ','; + $format_price_conf['price_sep_precision'] = ( isset($form_data['main']['price_sep_precision']) ) ? $form_data['main']['price_sep_precision'] : '2'; + $this->format_price_conf = $format_price_conf; + } + + $output = Uiform_Form_Helper::cformat_numeric($this->format_price_conf, $output); + + break; + } + } else { + } + + // get data from form + if ( $output != '') { + return $output; + } else { + return ''; + } + } + + /** + * Frontend::ajax_submit_ajaxmode() + * + * @return + */ + public function ajax_submit_ajaxmode() + { + $resp = array(); + $resp = $this->process_form(); + + if ( isset($this->flag_submitted) && intval($this->flag_submitted) > 0) { + $resp['success'] = ( isset($resp['success']) ) ? $resp['success'] : 0; + $resp['payment_st'] = ( isset($resp['payment_st']) ) ? $resp['payment_st'] : 0; + if ( intval($resp['payment_st']) === 1) { + $resp['show_message'] = ( isset($resp['payment_html']) ) ? Uiform_Form_Helper::encodeHex(do_shortcode($resp['payment_html'])) : + '
    ' . __('Error! something went wrong.', 'frocket_front') . '
    '; + } else { + $resp['show_message'] = ( isset($resp['show_message']) ) ? Uiform_Form_Helper::encodeHex(do_shortcode($resp['show_message'])) : + '
    ' . __('Success! your form was submitted', 'frocket_front') . '
    '; + } + } else { + $resp['success'] = 0; + $resp['show_message'] = '
    ' . __('warning! Form was not submitted', 'frocket_front') . '
    '; + } + + $data = array(); + $data['json'] = $resp; + + $this->load->view('html_view', $data); + } + + /** + * Frontend::ajax_validate_captcha() + * + * @return + */ + public function ajax_validate_captcha() + { + $rockfm_code = ( isset($_POST['rockfm-code']) ) ? Uiform_Form_Helper::sanitizeInput($_POST['rockfm-code']) : ''; + $rockfm_inpcode = ( isset($_POST['rockfm-inpcode']) ) ? Uiform_Form_Helper::sanitizeInput($_POST['rockfm-inpcode']) : ''; + $resp = array(); + $resp['code'] = $rockfm_code; + $resp['inpcode'] = $rockfm_inpcode; + + if ( ! empty($rockfm_code)) { + $captcha_key = 'Rocketform-' . $_SERVER['HTTP_HOST']; + $captcha_resp = Uiform_Form_Helper::data_decrypt($rockfm_code, $captcha_key); + $resp['resp'] = $captcha_resp; + if ( (string) $captcha_resp === (string) ( $rockfm_inpcode )) { + $resp['success'] = true; + } else { + $resp['success'] = false; + } + } else { + $resp['success'] = false; + } + + // return data to ajax callback + header('Content-Type: text/html; charset=UTF-8'); + echo json_encode($resp); + die(); + } + + /** + * Frontend::ajax_refresh_captcha() + * + * @return + */ + public function ajax_refresh_captcha() + { + $rkver = ( isset($_POST['rkver']) ) ? Uiform_Form_Helper::sanitizeInput(trim($_POST['rkver'])) : 0; + if ( $rkver) { + $rkver = Uiform_Form_Helper::base64url_decode(json_decode($rkver)); + $rkver_arr = json_decode($rkver, true); + + $length = 5; + $charset = 'abcdefghijklmnpqrstuvwxyz123456789'; + $phrase = ''; + $chars = str_split($charset); + + for ( $i = 0; $i < $length; $i++) { + $phrase .= $chars[ array_rand($chars) ]; + } + $captcha_data = array(); + + if ( isset($rkver_arr['ca_txt_gen'])) { + $rkver_arr['ca_txt_gen'] = $phrase; + $captcha_data = $rkver_arr; + } else { + $captcha_data['ca_txt_gen'] = $phrase; + } + $captcha_options = Uiform_Form_Helper::base64url_encode(json_encode($captcha_data)); + $resp = array(); + $resp['rkver'] = $captcha_options; + + /* generate check code */ + $captcha_key = 'Rocketform-' . $_SERVER['HTTP_HOST']; + $resp['code'] = Uiform_Form_Helper::data_encrypt($phrase, $captcha_key); + + // return data to ajax callback + $data = array(); + $data['json'] = $resp; + + $this->load->view('html_view', $data); + } + } + + /** + * Frontend::ajax_check_recaptcha() + * + * @return + */ + public function ajax_check_recaptcha() + { + + modules::run('formbuilder/uifmrecaptcha/front_verify_recaptcha', array()); + } + + public function ajax_check_recaptchav3() + { + + modules::run('formbuilder/uifmrecaptcha/front_verify_recaptchav3', array()); + } + + /** + * Frontend::process_form() + * + * @return + */ + public function process_form() + { + try { + // upload an image and document options + $config = array(); + $config['upload_path'] = FCPATH . 'uploads'; + $config['allowed_types'] = 'jpg|png|gif|jpeg|JPG|PNG|GIF|JPEG|pdf|doc|docx|xls|xlsx|zip|rar'; + $config['max_size'] = '2097152'; // 0 = no file size limit + $config['overwrite'] = false; + $config['remove_spaces'] = true; + $this->load->library('upload', $config); + + $form_id = ( $_POST['_rockfm_form_id'] ) ? Uiform_Form_Helper::sanitizeInput(trim($_POST['_rockfm_form_id'])) : 0; + $is_demo = ( $_POST['zgfm_is_demo'] ) ? intval(Uiform_Form_Helper::sanitizeInput(trim($_POST['zgfm_is_demo']))) : 0; + $this->current_form_id = $form_id; + $form_fields = ( isset($_POST['uiform_fields']) && $_POST['uiform_fields'] ) ? array_map(array( 'Uiform_Form_Helper', 'sanitizeRecursive_html' ), $_POST['uiform_fields']) : array(); + $form_avars = ( isset($_POST['zgfm_avars']) && $_POST['zgfm_avars'] ) ? array_map(array( 'Uiform_Form_Helper', 'sanitizeRecursive_html' ), $_POST['zgfm_avars']) : array(); + $form_f_tmp = array(); + $form_f_rec_tmp = array(); + $form_cost_total = 0; + $attachment_status = 0; + $attachments = array(); // initialize attachment array + // get data from form + $form_data = $this->model_forms->getFormById_2($form_id); + $form_data_onsubm = json_decode($form_data->fmb_data2, true); + $form_data_name = $form_data->fmb_name; + + // store to obj var + // $this->form_cur_data = json_decode($form_data->fmb_data, true); + $this->form_cur_data2 = json_decode($form_data->fmb_data2, true); + + // prepare message + $tmp_template_msg = ( isset($form_data_onsubm['onsubm']['mail_template_msg']) ) ? urldecode($form_data_onsubm['onsubm']['mail_template_msg']) : ''; + $tmp_sm_successtext = ( isset($form_data_onsubm['onsubm']['sm_successtext']) ) ? urldecode($form_data_onsubm['onsubm']['sm_successtext']) : ''; + $message = $tmp_template_msg; + + // math formula result + $zgfm_calc_math = ( $_POST['zgfm_calc_math'] ) ? Uiform_Form_Helper::sanitizeInput(trim($_POST['zgfm_calc_math'])) : 0; + $form_data_calc_enable = ( isset($form_data_onsubm['calculation']['enable_st']) ) ? $form_data_onsubm['calculation']['enable_st'] : '0'; + + // process fields + $message_fields = ''; + $form_errors = array(); + $mail_errors = false; + + $this->current_cost['symbol'] = ( isset($form_data_onsubm['main']['price_currency_symbol']) ) ? $form_data_onsubm['main']['price_currency_symbol'] : '$'; + $this->current_cost['cur'] = ( isset($form_data_onsubm['main']['price_currency']) ) ? $form_data_onsubm['main']['price_currency'] : 'USD'; + $this->current_cost['st'] = ( isset($form_data_onsubm['main']['price_st']) ) ? $form_data_onsubm['main']['price_st'] : 'USD'; + + // price numeric format + $format_price_conf = array(); + $format_price_conf['price_format_st'] = ( isset($form_data_onsubm['main']['price_format_st']) ) ? $form_data_onsubm['main']['price_format_st'] : '0'; + $format_price_conf['price_sep_decimal'] = ( isset($form_data_onsubm['main']['price_sep_decimal']) ) ? $form_data_onsubm['main']['price_sep_decimal'] : '.'; + $format_price_conf['price_sep_thousand'] = ( isset($form_data_onsubm['main']['price_sep_thousand']) ) ? $form_data_onsubm['main']['price_sep_thousand'] : ','; + $format_price_conf['price_sep_precision'] = ( isset($form_data_onsubm['main']['price_sep_precision']) ) ? $form_data_onsubm['main']['price_sep_precision'] : '2'; + + // other variables + $form_f_avar = array(); + + if ( ! empty($form_avars)) { + foreach ( $form_avars as $key => $value) { + switch ( strval($key)) { + case 'calc': + foreach ( $value as $key2 => $value2) { + $form_f_avar['calc'][ $key2 ] = $value2; + } + break; + default: + break; + } + } + } + + // fields + if ( ! empty($form_fields)) { + foreach ( $form_fields as $key => $value) { + $tmp_field_name = $this->model_fields->getFieldNameByUniqueId($key, $form_id); + + if ( ! isset($tmp_field_name->type)) { + $err_output = 'error $key:' . $key . ' - $form_id:' . $form_id; + if ( UIFORM_DEBUG === 1) { + $err_output .= ' - Last query: ' . htmlentities($this->db->last_query(), ENT_NOQUOTES, 'UTF-8'); + } + + throw new Exception($err_output); + } + + /*for validation only*/ + switch ( intval($tmp_field_name->type)) { + case 6: + /*textbox*/ + case 28: + case 29: + case 30: + $tmp_fdata = json_decode($tmp_field_name->data, true); + if ( isset($tmp_fdata['validate']) && isset($tmp_fdata['validate']['typ_val']) && intval($tmp_fdata['validate']['typ_val']) === 4) { + // $mail_replyto=$value; + } + break; + } + + /*storing to main array*/ + + switch ( intval($tmp_field_name->type)) { + case 9: + /*checkbox*/ + case 11: + /*multiselect*/ + $tmp_fdata = json_decode($tmp_field_name->data, true); + $tmp_field_cost_total = 0; + $tmp_options = array(); + $tmp_field_label = ( ! empty($tmp_fdata['label']['text']) ) ? $tmp_fdata['label']['text'] : $tmp_field_name->fieldname; + $form_f_tmp[ $key ]['type'] = $tmp_field_name->type; + $form_f_tmp[ $key ]['fieldname'] = $tmp_field_name->fieldname; + $form_f_tmp[ $key ]['label'] = $tmp_field_label; + $form_f_tmp[ $key ]['price_st'] = isset($tmp_fdata['price']['enable_st']) ? $tmp_fdata['price']['enable_st'] : 0; + $form_f_tmp[ $key ]['lbl_show_st'] = isset($tmp_fdata['price']['lbl_show_st']) ? $tmp_fdata['price']['lbl_show_st'] : 0; + + $tmp_f_values = array(); + + $tmp_inp_label = array(); + $tmp_inp_value = array(); + + if ( is_array($value)) { + // for records + $tmp_options_rec = array(); + foreach ( $value as $key2 => $value2) { + $tmp_options_row = array(); + $tmp_options_row['label'] = isset($tmp_fdata['input2']['options'][ $value2 ]['label']) ? $tmp_fdata['input2']['options'][ $value2 ]['label'] : ''; + $tmp_options_row['value'] = isset($tmp_fdata['input2']['options'][ $value2 ]['value']) ? $tmp_fdata['input2']['options'][ $value2 ]['value'] : ''; + $tmp_options_rec[] = $tmp_options_row['value']; + $tmp_f_values[] = $value2; + } + $form_f_rec_tmp[ $key ] = implode('^,^', $tmp_options_rec); + // end for records + + foreach ( $value as $key2 => $value2) { + $tmp_options_row = array(); + $tmp_options_row['label'] = isset($tmp_fdata['input2']['options'][ $value2 ]['label']) ? $tmp_fdata['input2']['options'][ $value2 ]['label'] : ''; + $tmp_options_row['value'] = isset($tmp_fdata['input2']['options'][ $value2 ]['value']) ? $tmp_fdata['input2']['options'][ $value2 ]['value'] : ''; + + // store label + $tmp_inp_label[] = $tmp_options_row['label']; + $tmp_inp_value[] = $tmp_options_row['value']; + + if ( isset($tmp_fdata['input2']['options'][ $value2 ])) { + $tmp_options_row['cost'] = ( isset($tmp_fdata['input2']['options'][ $value2 ]['price']) ) ? floatval($tmp_fdata['input2']['options'][ $value2 ]['price']) : 0; + $tmp_options_row['amount'] = $tmp_options_row['cost']; + + if ( isset($tmp_fdata['price']['enable_st']) + && intval($this->current_cost['st']) === 1 + && intval($tmp_fdata['price']['enable_st']) === 1) { + /*cost estimate*/ + + $form_cost_total += $tmp_options_row['cost']; + } + + $tmp_field_cost_total = $tmp_field_cost_total + $tmp_options_row['cost']; + $form_f_tmp[ $key ]['input_cost_amt'] = floatval($tmp_field_cost_total); + } + + if ( isset($tmp_fdata['input2']['options'][ $value2 ]) && $tmp_fdata['input2']['options'][ $value2 ]) { + $tmp_options[ $value2 ] = $tmp_options_row; + } + } + } + $form_f_tmp[ $key ]['input_label'] = implode('^,^', $tmp_inp_label); + $form_f_tmp[ $key ]['input_value'] = implode('^,^', $tmp_inp_value); + + $form_f_tmp[ $key ]['chosen'] = implode(',', $tmp_f_values); + /*saving data to field array*/ + $form_f_tmp[ $key ]['input'] = $tmp_options; + + break; + case 8: + /*radiobutton*/ + case 10: + /*select*/ + + $tmp_fdata = json_decode($tmp_field_name->data, true); + $tmp_field_cost_total = 0; + $tmp_options = array(); + $tmp_field_label = ( ! empty($tmp_fdata['label']['text']) ) ? $tmp_fdata['label']['text'] : $tmp_field_name->fieldname; + $form_f_tmp[ $key ]['type'] = $tmp_field_name->type; + $form_f_tmp[ $key ]['fieldname'] = $tmp_field_name->fieldname; + $form_f_tmp[ $key ]['label'] = $tmp_field_label; + $form_f_tmp[ $key ]['chosen'] = implode(',', array( $value )); + $form_f_tmp[ $key ]['price_st'] = isset($tmp_fdata['price']['enable_st']) ? $tmp_fdata['price']['enable_st'] : 0; + $form_f_tmp[ $key ]['lbl_show_st'] = isset($tmp_fdata['price']['lbl_show_st']) ? $tmp_fdata['price']['lbl_show_st'] : 0; + // foreach ($value as $key2=>$value2) { + $tmp_options_row = array(); + $tmp_options_row['label'] = isset($tmp_fdata['input2']['options'][ $value ]['label']) ? $tmp_fdata['input2']['options'][ $value ]['label'] : ''; + $tmp_options_row['value'] = isset($tmp_fdata['input2']['options'][ $value ]['value']) ? $tmp_fdata['input2']['options'][ $value ]['value'] : ''; + + // for records + $form_f_rec_tmp[ $key ] = $tmp_options_row['label']; + + if ( isset($tmp_fdata['input2']['options'][ $value ])) { + $tmp_options_row['cost'] = ( isset($tmp_fdata['input2']['options'][ $value ]['price']) ) ? floatval($tmp_fdata['input2']['options'][ $value ]['price']) : 0; + $tmp_options_row['amount'] = $tmp_options_row['cost']; + + if ( isset($tmp_fdata['price']['enable_st']) + && intval($this->current_cost['st']) === 1 + && intval($tmp_fdata['price']['enable_st']) === 1) { + /*cost estimate*/ + $form_cost_total += $tmp_options_row['amount']; + } + + $tmp_field_cost_total = $tmp_field_cost_total + $tmp_options_row['cost']; + $form_f_tmp[ $key ]['input_cost_amt'] = floatval($tmp_field_cost_total); + } + + if ( isset($tmp_fdata['input2']['options'][ $value ])) { + $tmp_options[ $value ] = $tmp_options_row; + } + // } + $form_f_tmp[ $key ]['input_label'] = $tmp_options_row['label']; + $form_f_tmp[ $key ]['input_value'] = $tmp_options_row['value']; + /*saving data to field array*/ + $form_f_tmp[ $key ]['input'] = $tmp_options; + + break; + case 12: + /* file input field */ + case 13: + /* + image upload */ + /* file input field */ + + $tmp_fdata = json_decode($tmp_field_name->data, true); + + $tmp_options = array(); + $tmp_field_label = ( ! empty($tmp_fdata['label']['text']) ) ? $tmp_fdata['label']['text'] : $tmp_field_name->fieldname; + $form_f_tmp[ $key ]['type'] = $tmp_field_name->type; + $form_f_tmp[ $key ]['fieldname'] = $tmp_field_name->fieldname; + $form_f_tmp[ $key ]['label'] = $tmp_field_label; + + $allowedext_default = array( 'aaaa', 'png', 'doc', 'docx', 'xls', 'xlsx', 'csv', 'txt', 'rtf', 'zip', 'mp3', 'wma', 'wmv', 'mpg', 'flv', 'avi', 'jpg', 'jpeg', 'png', 'gif', 'ods', 'rar', 'ppt', 'tif', 'wav', 'mov', 'psd', 'eps', 'sit', 'sitx', 'cdr', 'ai', 'mp4', 'm4a', 'bmp', 'pps', 'aif', 'pdf' ); + $custom_allowedext = ( ! empty($tmp_fdata['input16']['extallowed']) ) ? array_map('trim', explode(',', $tmp_fdata['input16']['extallowed'])) : $allowedext_default; + $custom_maxsize = ( ! empty($tmp_fdata['input16']['maxsize']) ) ? floatval($tmp_fdata['input16']['maxsize']) : 5; + $custom_attach_st = ( isset($tmp_fdata['input16']['attach_st']) ) ? intval($tmp_fdata['input16']['attach_st']) : 0; + + if ( isset($_FILES['uiform_fields']['name'][ $key ]) + && ! empty($_FILES['uiform_fields']['name'][ $key ])) { + $fileSize = $_FILES['uiform_fields']['size'][ $key ]; + if ( floatval($fileSize) > $custom_maxsize * 1024 * 1024) { + $form_errors[] = __('Error! The file exceeds the allowed size of', 'frocket_front') . ' ' . $custom_maxsize . ' MB'; + } + /* find attachment max size found */ + $attachment_status = ( $attachment_status < $custom_attach_st ) ? $custom_attach_st : $attachment_status; + + $ext = strtolower(substr($_FILES['uiform_fields']['name'][ $key ], strrpos($_FILES['uiform_fields']['name'][ $key ], '.') + 1)); + if ( ! in_array($ext, $custom_allowedext)) { + $form_errors[] = __('Error! Type of file is not allowed to upload', 'frocket_front'); + } + if ( empty($form_errors)) { + $config['allowed_types'] = '*'; + $config['max_size'] = $custom_maxsize * 1024 * 1024; // 0 = no file size limit + $this->upload->initialize($config); + + $rename = 'file_' . md5(uniqid($_FILES['uiform_fields']['name'][ $key ], true)); + + $_FILES['uiform_fields']['name'][ $key ] = $rename . '.' . strtolower($ext); + + // attachment + + if ( ! $this->upload->do_upload2($key)) { + $form_errors[] = __('Error! File not uploaded - ' . $this->upload->display_errors('', ''), 'frocket_front'); + } else { + $data_upload_files = $this->upload->data(); + $image = base_url() . 'uploads/' . $data_upload_files['file_name']; + // getting image uploaed + if ( intval($custom_attach_st) === 1) { + $attachments[] = $data_upload_files['file_path'] . $data_upload_files['file_name']; + } + + $form_f_tmp[ $key ]['input'] = $image; + $form_f_rec_tmp[ $key ] = $image; + $form_fields[ $key ] = $image; + } + } + } else { + unset($form_fields[ $key ]); + $form_f_tmp[ $key ]['input'] = ''; + $form_f_rec_tmp[ $key ] = ''; + } + break; + case 16: + /*slider*/ + case 18: + /*spinner*/ + $tmp_fdata = json_decode($tmp_field_name->data, true); + + $tmp_field_label = ( ! empty($tmp_fdata['label']['text']) ) ? $tmp_fdata['label']['text'] : $tmp_field_name->fieldname; + $form_f_tmp[ $key ]['type'] = $tmp_field_name->type; + $form_f_tmp[ $key ]['fieldname'] = $tmp_field_name->fieldname; + $form_f_tmp[ $key ]['label'] = $tmp_field_label; + $form_f_tmp[ $key ]['price_st'] = isset($tmp_fdata['price']['enable_st']) ? $tmp_fdata['price']['enable_st'] : 0; + $form_f_tmp[ $key ]['lbl_show_st'] = isset($tmp_fdata['price']['lbl_show_st']) ? $tmp_fdata['price']['lbl_show_st'] : 0; + + // foreach ($value as $key2=>$value2) { + $tmp_options_row = array(); + + $tmp_options_row['cost'] = floatval($tmp_fdata['price']['unit_price']); + + $tmp_options_row['qty'] = floatval($value); + $tmp_options_row['value'] = floatval($value); + // for records + $form_f_rec_tmp[ $key ] = $value; + + if ( isset($tmp_fdata['price']['enable_st']) + && intval($this->current_cost['st']) === 1 + && intval($tmp_fdata['price']['enable_st']) === 1) { + /*cost estimate*/ + $form_cost_total += floatval($value) * floatval($tmp_fdata['price']['unit_price']); + } + + $tmp_options_row['amount'] = floatval($value) * floatval($tmp_fdata['price']['unit_price']); + + // } + /*saving data to field array*/ + $form_f_tmp[ $key ]['input'] = $tmp_options_row; + $form_f_tmp[ $key ]['input_cost_amt'] = floatval($value) * floatval($tmp_fdata['price']['unit_price']); + break; + case 40: + /*switch*/ + $tmp_fdata = json_decode($tmp_field_name->data, true); + + $tmp_options = array(); + $tmp_field_label = ( ! empty($tmp_fdata['label']['text']) ) ? $tmp_fdata['label']['text'] : $tmp_field_name->fieldname; + $form_f_tmp[ $key ]['type'] = $tmp_field_name->type; + $form_f_tmp[ $key ]['fieldname'] = $tmp_field_name->fieldname; + $form_f_tmp[ $key ]['label'] = $tmp_field_label; + $form_f_tmp[ $key ]['price_st'] = isset($tmp_fdata['price']['enable_st']) ? $tmp_fdata['price']['enable_st'] : 0; + $form_f_tmp[ $key ]['lbl_show_st'] = isset($tmp_fdata['price']['lbl_show_st']) ? $tmp_fdata['price']['lbl_show_st'] : 0; + + // foreach ($value as $key2=>$value2) { + + if ( $value === 'on') { + $tmp_options_row['label'] = ( ! empty($tmp_fdata['input15']['txt_yes']) ) ? $tmp_fdata['input15']['txt_yes'] : $value; + $form_f_rec_tmp[ $key ] = 1; + } else { + $tmp_options_row['label'] = ( ! empty($tmp_fdata['input15']['txt_no']) ) ? $tmp_fdata['input15']['txt_no'] : $value; + $form_f_rec_tmp[ $key ] = 0; + } + + if ( isset($tmp_fdata['price']['unit_price'])) { + $tmp_options_row['cost'] = floatval($tmp_fdata['price']['unit_price']); + $tmp_options_row['amount'] = $tmp_options_row['cost']; + + if ( isset($tmp_fdata['price']['enable_st']) + && intval($this->current_cost['st']) === 1 + && intval($tmp_fdata['price']['enable_st']) === 1) { + /*cost estimate*/ + $form_cost_total += $tmp_options_row['amount']; + } + } + + // } + /*saving data to field array*/ + $form_f_tmp[ $key ]['input'] = $tmp_options_row; + $form_f_tmp[ $key ]['input_cost_amt'] = floatval($tmp_fdata['price']['unit_price']); + break; + case 41: + /*dyn checkbox*/ + case 42: + /*dyn radiobtn*/ + $tmp_fdata = json_decode($tmp_field_name->data, true); + $tmp_field_cost_total = 0; + $tmp_options = array(); + $tmp_field_label = ( ! empty($tmp_fdata['label']['text']) ) ? $tmp_fdata['label']['text'] : $tmp_field_name->fieldname; + $form_f_tmp[ $key ]['type'] = $tmp_field_name->type; + $form_f_tmp[ $key ]['fieldname'] = $tmp_field_name->fieldname; + $form_f_tmp[ $key ]['label'] = $tmp_field_label; + $form_f_tmp[ $key ]['price_st'] = isset($tmp_fdata['price']['enable_st']) ? $tmp_fdata['price']['enable_st'] : 0; + $form_f_tmp[ $key ]['lbl_show_st'] = isset($tmp_fdata['price']['lbl_show_st']) ? $tmp_fdata['price']['lbl_show_st'] : 0; + // for records + $tmp_summary = array(); + + foreach ( $value as $key2 => $value2) { + $tmp_summary_inner = ''; + + if ( isset($tmp_fdata['input17']['options'][ $key2 ]['label'])) { + $tmp_summary_inner .= $tmp_fdata['input17']['options'][ $key2 ]['label']; + } + + if ( intval($value2) > 1) { + $tmp_summary_inner .= ' - qty: ' . $value2; + } + $tmp_summary[] = $tmp_summary_inner; + } + + $form_f_rec_tmp[ $key ] = implode('^,^', $tmp_summary); + // end for records + + foreach ( $value as $key2 => $value2) { + $tmp_options_row = array(); + $tmp_options_row['label'] = $tmp_fdata['input17']['options'][ $key2 ]['label']; + + if ( $tmp_fdata['input17']['options'][ $key2 ]) { + $tmp_options_row['cost'] = floatval($tmp_fdata['input17']['options'][ $key2 ]['price']); + $tmp_options_row['qty'] = $value2; + + $tmp_options_row['amount'] = floatval($tmp_options_row['cost']) * floatval($tmp_options_row['qty']); + + if ( isset($tmp_fdata['price']['enable_st']) + && intval($this->current_cost['st']) === 1 + && intval($tmp_fdata['price']['enable_st']) === 1) { + /*cost estimate*/ + + $form_cost_total += $tmp_options_row['amount']; + $tmp_field_cost_total += $tmp_options_row['amount']; + } + } + + $tmp_options[] = $tmp_options_row; + } + /*saving data to field array*/ + $form_f_tmp[ $key ]['input'] = $tmp_options; + $form_f_tmp[ $key ]['input_cost_amt'] = $tmp_field_cost_total; + break; + default: + $tmp_fdata = json_decode($tmp_field_name->data, true); + $tmp_field_label = ( ! empty($tmp_fdata['label']['text']) ) ? $tmp_fdata['label']['text'] : $tmp_field_name->fieldname; + $form_f_tmp[ $key ]['type'] = $tmp_field_name->type; + $form_f_tmp[ $key ]['fieldname'] = $tmp_field_name->fieldname; + $form_f_tmp[ $key ]['label'] = $tmp_field_label; + if ( is_array($value)) { + $tmp_options = array(); + foreach ( $value as $value2) { + $tmp_options[] = $value2; + } + $form_f_tmp[ $key ]['input'] = implode('^,^', $tmp_options); + // for records + $form_f_rec_tmp[ $key ] = implode('^,^', $tmp_options); + } else { + $form_f_tmp[ $key ]['input'] = $value; + // for records + $form_f_rec_tmp[ $key ] = $value; + } + + break; + } + } + } + + // process tax + $tmp_price_tax_st = ( isset($form_data_onsubm['main']['price_tax_st']) ) ? $form_data_onsubm['main']['price_tax_st'] : '0'; + $tmp_price_tax_val = ( isset($form_data_onsubm['main']['price_tax_val']) ) ? $form_data_onsubm['main']['price_tax_val'] : '0'; + + // check if math calc is enabled + + if ( intval($form_data_calc_enable) === 1) { + $form_cost_total = isset($zgfm_calc_math) ? $zgfm_calc_math : 0; + } + + // check if tax is enabled + if ( intval($tmp_price_tax_st) === 1) { + $form_cost_subtotal = floatval($form_cost_total); + $form_cost_tax = ( floatval($tmp_price_tax_val) / 100 ) * floatval($form_cost_subtotal); + $form_cost_total = floatval($form_cost_subtotal) + $form_cost_tax; + } + + // storing total cost + $this->current_cost['total'] = $form_cost_total; + + if ( count($form_errors) > 0) { + $data = array(); + $data['success'] = 0; + $data['form_errors'] = count($form_errors); + $tmp_err_msg = '
      '; + foreach ( $form_errors as $value_er) { + $tmp_err_msg .= '
    • ' . $value_er . '
    • '; + } + $tmp_err_msg .= '
    '; + $tmp_err_msg = Uiform_Form_Helper::assign_alert_container($tmp_err_msg, 4); + $data['form_error_msg'] = $tmp_err_msg; + $this->form_response = $data; + $data['form_error_msg'] = Uiform_Form_Helper::encodeHex($data['form_error_msg']); + return $data; + } + + // generate mail html part + $tmp_data1 = array(); + $tmp_data1['data'] = $form_f_tmp; + $tmp_data1['price_tax_st'] = $tmp_price_tax_st; + if ( intval($tmp_price_tax_st) === 1) { + $tmp_data1['form_cost_subtotal'] = $form_cost_subtotal; + $tmp_data1['form_cost_tax'] = $form_cost_tax; + } + $tmp_data1['form_cost_total'] = $form_cost_total; + $tmp_data1['current_cost_st'] = $this->current_cost['st']; + $tmp_data1['current_cost_symbol'] = $this->current_cost['symbol']; + $tmp_data1['current_cost_cur'] = $this->current_cost['cur']; + $tmp_data1['format_price_conf'] = $format_price_conf; + $tmp_data1['form_data_calc_enable'] = $form_data_calc_enable; + if ( intval($tmp_price_tax_st) === 1) { + $tmp_data1['sub_total'] = Uiform_Form_Helper::cformat_numeric($format_price_conf, $form_cost_subtotal); + $tmp_data1['tax'] = Uiform_Form_Helper::cformat_numeric($format_price_conf, $form_cost_tax); + } + $tmp_data1['total'] = Uiform_Form_Helper::cformat_numeric($format_price_conf, $form_cost_total) . ' ' . $this->current_cost['cur']; + + //$this->form_rec_msg_summ = $this->load->view( 'formbuilder/frontend/mail_generate_fields', $tmp_data1, true ); + + // ending form process + + // save to form records + $agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''; + $referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; + + $form_f_rec_tmp = $this->process_DataRecord($form_f_tmp, $form_f_rec_tmp); + $form_f_avar_tmp = $this->process_DataRecord2($form_f_avar); + + $data = array(); + $data['fbh_data'] = json_encode($form_f_tmp); + $data['fbh_data_rec'] = json_encode($form_f_rec_tmp); + $data['fbh_data2'] = json_encode($form_f_avar); + $data['fbh_data_rec2'] = json_encode($form_f_avar_tmp); + $data['fbh_total_amount'] = $form_cost_total; + $data['created_ip'] = $_SERVER['REMOTE_ADDR']; + $data['form_fmb_id'] = $form_id; + $data['fbh_data_rec_xml'] = Uiform_Form_Helper::array2xml($form_f_rec_tmp); + $data['fbh_data_rec2_xml'] = Uiform_Form_Helper::array2xml($form_f_avar_tmp); + $data['fbh_user_agent'] = $agent; + $data['fbh_page'] = $_SERVER['REQUEST_URI']; + $data['fbh_referer'] = $referer; + + // generate uniqueid + if ( ! isset($_COOKIE['uiform_costest'])) { + $ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : ''; + $user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''; + $hash = hash('crc32', md5($ip . $user_agent)); + setcookie('uiform_costest', $hash, time() + ( 60 * 60 * 24 * 30 ), '/'); + } else { + $hash = $_COOKIE['uiform_costest']; + } + + $data['vis_uniqueid'] = $hash; + + $this->db->set($data); + $this->db->insert($this->model_record->table); + + $idActivate = $this->db->insert_id(); + $json = array(); + $json['status'] = 'created'; + $json['id'] = $idActivate; + + $this->flag_submitted = $idActivate; + self::$_form_data['form_id'] = $form_id; + self::$_form_data['record_id'] = $idActivate; + + // insert to payment records + $data3 = array(); + $data3['fbh_id'] = $idActivate; + $data3['pgr_payment_amount'] = $form_cost_total; + $data3['pgr_currency'] = $this->current_cost['cur']; + $data3['flag_status'] = 1; + $data3['created_ip'] = $_SERVER['REMOTE_ADDR']; + $data3['created_by'] = 1; + $data3['created_date'] = date('Y-m-d h:i:s'); + $data3['type_pg_id'] = 1; + + $this->db->set($data3); + $this->db->insert($this->model_gateways_records->table); + $id_payrec = $this->db->insert_id(); + // preparing mail + + // is demo + if ( $is_demo === 0) { + $mail_from_email = ( isset($form_data_onsubm['onsubm']['mail_from_email']) ) ? $form_data_onsubm['onsubm']['mail_from_email'] : ''; + $mail_from_name = ( isset($form_data_onsubm['onsubm']['mail_from_name']) ) ? $form_data_onsubm['onsubm']['mail_from_name'] : ''; + + $mail_html_wholecont = isset($form_data_onsubm['main']['email_html_fullpage']) ? $form_data_onsubm['main']['email_html_fullpage'] : '0'; + $mail_pdf_wholecont = isset($form_data_onsubm['main']['pdf_html_fullpage']) ? $form_data_onsubm['main']['pdf_html_fullpage'] : '0'; + + // admin + // mail template + $mail_template_msg = ( isset($form_data_onsubm['onsubm']['mail_template_msg']) ) ? urldecode($form_data_onsubm['onsubm']['mail_template_msg']) : ''; + $mail_template_msg = do_shortcode($mail_template_msg); + $mail_template_msg = html_entity_decode($mail_template_msg, ENT_QUOTES, 'UTF-8'); + $mail_template_msg = $this->load->view( + 'formbuilder/frontend/mail_global_template', + array( + 'content' => $mail_template_msg, + 'html_wholecont' => $mail_html_wholecont, + ), + true + ); + + $email_recipient = ( isset($form_data_onsubm['onsubm']['mail_recipient']) ) ? $form_data_onsubm['onsubm']['mail_recipient'] : model_settings::$db_config['admin_mail']; + $email_cc = ( isset($form_data_onsubm['onsubm']['mail_cc']) ) ? $form_data_onsubm['onsubm']['mail_cc'] : ''; + $email_bcc = ( isset($form_data_onsubm['onsubm']['mail_bcc']) ) ? $form_data_onsubm['onsubm']['mail_bcc'] : ''; + $mail_subject = ( isset($form_data_onsubm['onsubm']['mail_subject']) ) ? do_shortcode($form_data_onsubm['onsubm']['mail_subject']) : __('New form request', 'frocket_front'); + + $mail_usr_recipient = ( isset($form_data_onsubm['onsubm']['mail_usr_recipient']) ) ? $form_data_onsubm['onsubm']['mail_usr_recipient'] : ''; + $mail_replyto = ( isset($form_data_onsubm['onsubm']['mail_replyto']) ) ? $form_data_onsubm['onsubm']['mail_replyto'] : ''; + + $data_mail = array(); + $data_mail['from_mail'] = html_entity_decode(do_shortcode($mail_from_email)); + $data_mail['from_name'] = html_entity_decode(do_shortcode($mail_from_name)); + $data_mail['message'] = $mail_template_msg; + $data_mail['subject'] = html_entity_decode($mail_subject); + $data_mail['attachments'] = $attachments; + $data_mail['to'] = trim($email_recipient); + $data_mail['cc'] = array_map('trim', explode(',', $email_cc)); + $data_mail['bcc'] = array_map('trim', explode(',', $email_bcc)); + + $tmp_replyto = $this->model_record->getFieldOptRecord($idActivate, '', $mail_replyto, 'input'); + if ( ! empty($tmp_replyto)) { + $data_mail['mail_replyto'] = $tmp_replyto; + } + + if ( isset($form_data_onsubm['main']['email_dissubm']) && intval($form_data_onsubm['main']['email_dissubm']) === 1) { + $mail_errors = false; + } else { + $mail_errors = $this->process_mail($data_mail); + } + + // customer + // mail template + $mail_usr_st = ( isset($form_data_onsubm['onsubm']['mail_usr_st']) ) ? $form_data_onsubm['onsubm']['mail_usr_st'] : '0'; + if ( intval($mail_usr_st) === 1) { + $mail_template_msg = ( isset($form_data_onsubm['onsubm']['mail_usr_template_msg']) ) ? urldecode($form_data_onsubm['onsubm']['mail_usr_template_msg']) : ''; + $mail_template_msg = do_shortcode($mail_template_msg); + $mail_template_msg = html_entity_decode($mail_template_msg, ENT_QUOTES, 'UTF-8'); + $mail_template_msg = $this->load->view( + 'formbuilder/frontend/mail_global_template', + array( + 'content' => $mail_template_msg, + 'html_wholecont' => $mail_html_wholecont, + ), + true + ); + + $mail_usr_cc = ( isset($form_data_onsubm['onsubm']['mail_usr_cc']) ) ? $form_data_onsubm['onsubm']['mail_usr_cc'] : ''; + $mail_usr_bcc = ( isset($form_data_onsubm['onsubm']['mail_usr_bcc']) ) ? $form_data_onsubm['onsubm']['mail_usr_bcc'] : ''; + $mail_usr_replyto = ( isset($form_data_onsubm['onsubm']['mail_usr_replyto']) ) ? $form_data_onsubm['onsubm']['mail_usr_replyto'] : ''; + $mail_usr_subject = ( isset($form_data_onsubm['onsubm']['mail_usr_subject']) ) ? do_shortcode($form_data_onsubm['onsubm']['mail_usr_subject']) : __('New form request', 'frocket_front'); + + $mail_usr_pdf_st = ( isset($form_data_onsubm['onsubm']['mail_usr_pdf_st']) ) ? $form_data_onsubm['onsubm']['mail_usr_pdf_st'] : '0'; + if ( intval($mail_usr_pdf_st) === 1) { + $data_mail = array(); + $mail_template_msg_pdf = ( isset($form_data_onsubm['onsubm']['mail_usr_pdf_template_msg']) ) ? urldecode($form_data_onsubm['onsubm']['mail_usr_pdf_template_msg']) : ''; + $mail_template_msg_pdf = do_shortcode($mail_template_msg_pdf); + $data_mail['mail_usr_pdf_template_msg'] = $mail_template_msg_pdf; + $mail_pdf_fn = ( isset($form_data_onsubm['onsubm']['mail_usr_pdf_fn']) ) ? urldecode($form_data_onsubm['onsubm']['mail_usr_pdf_fn']) : ''; + $mail_pdf_fn = do_shortcode($mail_pdf_fn); + $data_mail['mail_usr_pdf_fn'] = $mail_pdf_fn; + $data_mail['html_wholecont'] = $mail_pdf_wholecont; + $data_mail['rec_id'] = $idActivate; + $data_mail['is_html'] = 0; + + $data_mail['charset'] = ( isset($form_data_onsubm['main']['pdf_charset']) ) ? $form_data_onsubm['main']['pdf_charset'] : ''; + $data_mail['font'] = ( isset($form_data_onsubm['main']['pdf_font']) ) ? urldecode($form_data_onsubm['main']['pdf_font']) : ''; + $data_mail['pdf_paper_size'] = ( isset($form_data_onsubm['main']['pdf_paper_size']) ) ? $form_data_onsubm['main']['pdf_paper_size'] : 'a4'; + $data_mail['pdf_paper_orie'] = ( isset($form_data_onsubm['main']['pdf_paper_orie']) ) ? $form_data_onsubm['main']['pdf_paper_orie'] : 'landscape'; + + // $mail_pdf_font = (isset($form_data_onsubm['onsubm']['mail_usr_pdf_font'])) ? urldecode($form_data_onsubm['onsubm']['mail_usr_pdf_font']) : ''; + // $data_mail['mail_usr_pdf_font']=$mail_pdf_font; + // $data_mail['mail_usr_pdf_charset']=(isset($form_data_onsubm['onsubm']['mail_usr_pdf_charset'])) ? $form_data_onsubm['onsubm']['mail_usr_pdf_charset'] : ''; + $attachments[] = $this->process_custom_pdf($data_mail); + } + + $data_mail = array(); + $data_mail['from_mail'] = html_entity_decode(do_shortcode($mail_from_email)); + $data_mail['from_name'] = html_entity_decode(do_shortcode($mail_from_name)); + $data_mail['message'] = $mail_template_msg; + $data_mail['subject'] = html_entity_decode(do_shortcode($mail_usr_subject)); + $data_mail['attachments'] = $attachments; + $data_mail['to'] = $this->model_record->getFieldOptRecord($idActivate, '', $mail_usr_recipient, 'input'); + $data_mail['cc'] = array_map('trim', explode(',', $mail_usr_cc)); + $data_mail['bcc'] = array_map('trim', explode(',', $mail_usr_bcc)); + if ( ! empty($mail_usr_replyto)) { + $data_mail['mail_replyto'] = $mail_usr_replyto; + } + if ( isset($form_data_onsubm['main']['email_dissubm']) && intval($form_data_onsubm['main']['email_dissubm']) === 1) { + $mail_errors = false; + } else { + $mail_errors = $this->process_mail($data_mail); + } + } + } + // success message + + $tmp_sm_successtext = ( isset($form_data_onsubm['onsubm']['sm_successtext']) ) ? urldecode($form_data_onsubm['onsubm']['sm_successtext']) : ''; + $tmp_sm_successtext = do_shortcode($tmp_sm_successtext); + + // url redirection + $tmp_sm_redirect_st = ( isset($form_data_onsubm['onsubm']['sm_redirect_st']) ) ? $form_data_onsubm['onsubm']['sm_redirect_st'] : '0'; + $tmp_sm_redirect_url = ( isset($form_data_onsubm['onsubm']['sm_redirect_url']) ) ? urldecode($form_data_onsubm['onsubm']['sm_redirect_url']) : ''; + + $data = array(); + $data['success'] = 1; + $data['show_message'] = $tmp_sm_successtext; + $data['sm_redirect_st'] = $tmp_sm_redirect_st; + $data['sm_redirect_url'] = $tmp_sm_redirect_url; + $data['price_format'] = $format_price_conf; + $data['amount'] = $form_cost_total; + $data['payment_st'] = ( isset($form_data_onsubm['main']['payment_st']) ) ? $form_data_onsubm['main']['payment_st'] : 0; + $data['vis_uniqueid'] = $hash; + $data['form_errors'] = 0; + $data['form_id'] = $form_id; + $data['form_mail_err'] = $this->form_email_err; + $data['mail_error'] = ( $mail_errors ) ? 1 : 0; + $data['fbh_id'] = $idActivate; + $data['currency'] = $this->current_cost; + + modules::run('addon/zfad_frontend/addons_doActions', 'onSubmitForm_pos'); + + if ( intval($data['payment_st']) === 1) { + $data['id_payrec'] = $id_payrec; + $this->form_response = $data; + $data['payment_html'] = $this->get_payment_html(); + // generate new invoice records + } else { + $this->form_response = $data; + } + return $data; + } catch ( Exception $exception) { + $data = array(); + $data['success'] = 0; + $data['form_errors'] = count($form_errors); + $data['error_debug'] = __METHOD__ . ' error: ' . $exception->getMessage(); + $data['mail_error'] = ( $mail_errors ) ? 1 : 0; + $this->form_response = $data; + return $data; + } + } + + private function process_custom_pdf($data) + { + + $output = ''; + $data2 = array(); + $data2['rec_id'] = $data['rec_id']; + $data2['content'] = $data['mail_usr_pdf_template_msg']; + $data2['html_wholecont'] = $data['html_wholecont']; + // $tmp_html = modules::run('formbuilder/frontend/pdf_global_template',$data2); + $output = generate_pdf($data2['content'], $data['mail_usr_pdf_fn'], $data['pdf_paper_size'], $data['pdf_paper_orie'], false); + + return $output; + } + + public function pdf_show_record() + { + $rec_id = isset($_GET['id']) ? Uiform_Form_Helper::sanitizeInput($_GET['id']) : ''; + $is_html = isset($_GET['is_html']) ? Uiform_Form_Helper::sanitizeInput($_GET['is_html']) : 0; + + $form_data = $this->model_record->getFormDataById($rec_id); + $this->current_form_id = $form_data->form_fmb_id; + + if ( intval($rec_id) > 0) { + ob_start(); + ?> + + +

    fmb_name; ?>

    +

    + + + + flag_submitted = $rec_id; + + // custom template + if ( intval($form_data->fmb_rec_tpl_st) === 1) { + $template_msg = do_shortcode($form_data->fmb_rec_tpl_html); + $template_msg = html_entity_decode($template_msg, ENT_QUOTES, 'UTF-8'); + $content = $template_msg; + } + + $pos = strpos($content, ''); + $pos2 = strpos($content, ''); + + if ( $pos === false && $pos2 === false) { + $full_page = 0; + } else { + $full_page = 1; + if ( intval($is_html) === 1) { + $content = str_replace('', '', $content); + } + } + + $output = ''; + $data2 = array(); + $data2['rec_id'] = $rec_id; + $data2['html_wholecont'] = $full_page; + $data2['content'] = $content; + $data2['is_html'] = $is_html; + $tmp_res = modules::run('formbuilder/frontend/pdf_global_template', $data2); + + if ( intval($is_html) === 1) { + header('Content-type: text/html'); + + echo $tmp_res['content']; + } else { + generate_pdf($tmp_res['content'], 'record_' . $rec_id, $tmp_res['pdf_paper_size'], $tmp_res['pdf_paper_orie'], true); + } + + die(); + } + } + + + public function pdf_show_invoice() + { + + $rec_id = isset($_GET['id']) ? Uiform_Form_Helper::sanitizeInput($_GET['id']) : ''; + $form_data = $this->model_gateways_records->getInvoiceDataByFormRecId($rec_id); + $is_html = isset($_GET['is_html']) ? Uiform_Form_Helper::sanitizeInput($_GET['is_html']) : 0; + + ob_start(); + ?> + + + + + + + +

     

    + + + flag_submitted = $rec_id; + + // custom template + if ( intval($form_data->fmb_inv_tpl_st) === 1) { + $template_msg = do_shortcode($form_data->fmb_inv_tpl_html); + $template_msg = html_entity_decode($template_msg, ENT_QUOTES, 'UTF-8'); + $content = $template_msg; + } + + $pos = strpos($content, ''); + $pos2 = strpos($content, ''); + + if ( $pos === false && $pos2 === false) { + $full_page = 0; + } else { + $full_page = 1; + if ( intval($is_html) === 1) { + $content = str_replace('', '', $content); + } + } + + $output = ''; + $data2 = array(); + $data2['rec_id'] = $rec_id; + $data2['head_extra'] = $head_extra; + $data2['content'] = $content; + $data2['is_html'] = $is_html; + // $tmp_html = self::$_modules['formbuilder']['frontend']->pdf_global_template($data2); + $tmp_res = modules::run('formbuilder/frontend/pdf_global_template', $data2); + if ( intval($is_html) === 1) { + header('Content-type: text/html'); + + echo $tmp_res['content']; + } else { + generate_pdf($tmp_res['content'], 'invoice_' . $rec_id, $tmp_res['pdf_paper_size'], $tmp_res['pdf_paper_orie'], true); + } + + die(); + } + + public function pdf_global_template($data) + { + + $rec_id = $data['rec_id']; + $temp = $this->model_record->getFormDataById($rec_id); + $form_id = $temp->form_fmb_id; + + $form_data = $this->model_forms->getFormById_2($form_id); + $form_data_onsubm = json_decode($form_data->fmb_data2, true); + $pdf_charset = ( isset($form_data_onsubm['main']['pdf_charset']) ) ? $form_data_onsubm['main']['pdf_charset'] : ''; + $pdf_font = ( isset($form_data_onsubm['main']['pdf_font']) ) ? urldecode($form_data_onsubm['main']['pdf_font']) : ''; + $pdf_paper_size = ( isset($form_data_onsubm['main']['pdf_paper_size']) ) ? $form_data_onsubm['main']['pdf_paper_size'] : 'a4'; + $pdf_paper_orie = ( isset($form_data_onsubm['main']['pdf_paper_orie']) ) ? $form_data_onsubm['main']['pdf_paper_orie'] : 'landscape'; + + $data2 = array(); + $data2['font'] = $pdf_font; + $data2['charset'] = $pdf_charset; + $data2['pdf_paper_size'] = $pdf_paper_size; + $data2['pdf_paper_orie'] = $pdf_paper_orie; + $data2['head_extra'] = isset($data['head_extra']) ? $data['head_extra'] : ''; + $data2['content'] = $data['content']; + $data2['html_wholecont'] = isset($data['html_wholecont']) ? $data['html_wholecont'] : '0'; + $data2['is_html'] = isset($data['is_html']) ? $data['is_html'] : '0'; + $data2['content'] = $this->load->view('formbuilder/forms/pdf_global_template', $data2, true); + return $data2; + } + + private function process_DataRecord($data1, $data2) + { + + $data3 = array(); + + if ( ! empty($data1)) { + foreach ( $data1 as $key => $value) { + if ( ! empty($value) && is_array($value)) { + foreach ( $value as $key2 => $value2) { + if ( is_array($value2)) { + // index + $temp_input = array(); + $temp_cost = array(); + $temp_qty = array(); + $temp_amt = array(); + + if ( is_array($value2)) { + foreach ( $value2 as $key3 => $value3) { + // values + if ( is_array($value3)) { + foreach ( $value3 as $key4 => $value4) { + switch ( $key4) { + case 'label': + $temp_input[] = $value4; + break; + case 'cost': + $temp_cost[] = $value4; + break; + case 'qty': + $temp_qty[] = $value4; + break; + case 'amount': + $temp_amt[] = $value4; + break; + default: + } + $data3[ $key . '_' . $key2 . '_' . $key3 . '_' . $key4 ] = $value4; + } + } else { + $data3[ $key . '_' . $key2 . '_' . $key3 ] = $value3; + } + } + } + + if ( ! empty($temp_input)) { + $data3[ $key . '_input' ] = implode('^,^', $temp_input); + } + if ( ! empty($temp_cost)) { + $data3[ $key . '_cost' ] = implode('^,^', $temp_cost); + } + if ( ! empty($temp_qty)) { + $data3[ $key . '_qty' ] = implode('^,^', $temp_qty); + } + if ( ! empty($temp_amt)) { + $data3[ $key . '_amount' ] = implode('^,^', $temp_amt); + } + } else { + $data3[ $key . '_' . $key2 ] = $value2; + } + } + } + } + } + $data3 = array_merge($data3, $data2); + + return $data3; + } + + public function process_mail($data) + { + $mail_errors = false; + + // disable mail function + if ( defined('ZF_DISABLE_EMAIL') && ZF_DISABLE_EMAIL === true) { + return $mail_errors; + } + + /* + $this->email->clear(TRUE); + $this->email->set_newline("\r\n");*/ + /*getting admin mail*/ + $data['from_name'] = ! empty($data['from_name']) ? $data['from_name'] : model_settings::$db_config['site_title']; + + // $headers = array(); + // $message_format='html'; + // $content_type = $message_format == "html" ? "text/html" : "text/plain"; + // $headers[] = "MIME-Version: 1.0"; + // $headers[] = "Content-type: {$content_type}"; + // $headers[] = "charset=utf8"; + // $headers[] = "From: \"{$data['from_name']}\" <{$data['from_mail']}>"; + + $to = trim($data['to']); + + if ( preg_match('/^[a-zA-Z0-9._+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/', $to)) { + // $this->email->from($data['from_mail'], $data['from_name']); + // $this->email->to($to); + // $this->email->subject($data['subject']); + // $this->email->set_mailtype("html"); + // $this->email->message($data['message']); + + // phpmail library + require_once FCPATH . 'application/helpers/phpmailer/PHPMailerAutoload.php'; + + // Create a new PHPMailer instance + $mail = new PHPMailer(); + + if ( ! empty($data['mail_replyto']) + && preg_match('/^[a-zA-Z0-9._+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/', $data['mail_replyto'])) { + $mail_replyto_name = substr($data['mail_replyto'], 0, strrpos($data['mail_replyto'], '@')); + // $headers[] = "Reply-To: \"{$mail_replyto_name}\" <{$data['mail_replyto']}>"; + + $mail->addReplyTo($data['mail_replyto'], $mail_replyto_name); + + // $this->email->reply_to($data['mail_replyto']); + // $data['subject'].=" - ".$data['mail_replyto']; + } + // cc + if ( ! empty($data['cc'])) { + if ( is_array($data['cc'])) { + foreach ( $data['cc'] as $value) { + if ( preg_match('/^[a-zA-Z0-9._+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/', $value)) { + // $headers[] = "Cc: {$value}"; + + $mail->addCC($value); + + // $this->email->cc($value); + } + } + } + } + + // bcc + if ( ! empty($data['bcc'])) { + if ( is_array($data['bcc'])) { + foreach ( $data['bcc'] as $value) { + if ( preg_match('/^[a-zA-Z0-9._+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/', $value)) { + // $headers[] = "Bcc: {$value}"; + + $mail->addBCC($value); + + // $this->email->bcc($value); + } + } + } + } + + // charset + $mail->CharSet = 'UTF-8'; + + // Set who the message is to be sent from + $mail->setFrom($data['from_mail'], $data['from_name']); + // Set who the message is to be sent to + $mail->addAddress($to); + // set html + $mail->isHTML(true); + // Set the subject line + $mail->Subject = $data['subject']; + + $mail->Body = $data['message']; + $mail->AltBody = preg_replace("/\n\s+/", "\n", rtrim(html_entity_decode(strip_tags($data['message'])))); + + switch ( intval(model_settings::$db_config['type_email'])) { + case 2: + // smtp + $mail->isSMTP(); // Set mailer to use SMTP + $mail->Host = model_settings::$db_config['smtp_host']; // Specify main and backup SMTP servers e.g. smtp1.example.com;smtp2.example.com + $mail->SMTPAuth = true; // Enable SMTP authentication + $mail->Username = model_settings::$db_config['smtp_user']; // SMTP username + $mail->Password = model_settings::$db_config['smtp_pass']; // SMTP password + $mail->SMTPSecure = model_settings::$db_config['smtp_conn']; // Enable TLS encryption, `ssl` also accepted + $mail->Port = model_settings::$db_config['smtp_port']; // TCP port to connect to + break; + case 3: + // sendmail + $mail->isSendmail(); + break; + case 1: + default: + // mail + + break; + } + + if ( ! empty($data['attachments'])) { + foreach ( $data['attachments'] as $attachment) { + $mail->addAttachment($attachment); + // $this->email->attach($attachment); + } + } + + if ( ! $mail->send()) { + $mail_errors = true; + $this->form_email_err[] = $mail->ErrorInfo; + } else { + $mail_errors = false; + } + + if ( false & ! empty($data['attachments'])) { + foreach ( $data['attachments'] as $attachment) { + @unlink($attachment); // delete files after sending them + } + } + } else { + $mail_errors = true; + } + + return $mail_errors; + } + + + /** + * Frontend::viewform() + * + * @return + */ + public function viewform() + { + $form_id = ( $this->input->get('form') ) ? Uiform_Form_Helper::sanitizeInput($this->input->get('form')) : 0; + $lmode = ( $this->input->get('lmode') ) ? Uiform_Form_Helper::sanitizeInput($this->input->get('lmode')) : ''; + + if ( $form_id === 0) { + return; + } + $website = 'uiform'; + $ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : ''; + if ( ! isset($_COOKIE[ $website ])) { + $user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''; + $hash = hash('crc32', md5($ip . $user_agent)); + setcookie($website, $hash, time() + ( 60 * 60 * 24 * 30 ), '/'); + } else { + $hash = $_COOKIE[ $website ]; + } + $agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''; + $referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; + + // visitor data + /* + $data3 = array(); + $data3['vis_uniqueid'] = $hash; + $data3['vis_user_agent'] = $agent; + $data3['vis_page'] = $_SERVER['REQUEST_URI']; + $data3['vis_referer'] = $referer; + $data3['vis_ip'] = $_SERVER['REMOTE_ADDR']; + $this->db->set($data3); + $this->db->insert($this->model_visitor->table);*/ + + $rdata = $this->model_forms->getFormById($form_id); + $data = array(); + $data['uniqueid'] = $hash; + + // get data from form + $form_data = $this->model_forms->getFormById_2($rdata->fmb_id); + $form_data_onsubm = json_decode($form_data->fmb_data2, true); + + $onload_scroll = ( isset($form_data_onsubm['main']['onload_scroll']) ) ? $form_data_onsubm['main']['onload_scroll'] : '1'; + + $preload_noconflict = ( isset($form_data_onsubm['main']['preload_noconflict']) ) ? $form_data_onsubm['main']['preload_noconflict'] : '1'; + + $temp = array(); + $temp['id_form'] = $rdata->fmb_id; + $temp['site_url'] = site_url(); + $temp['base_url'] = base_url(); + $temp['lmode'] = $lmode; + $temp['onload_scroll'] = $onload_scroll; + $temp['preload_noconflict'] = $preload_noconflict; + + // addon + + $data['script'] = $this->load->view('formbuilder/forms/get_code_widget', $temp, true); + + $this->load->view('formbuilder/frontend/viewform', $data); + } + private function process_DataRecord2($data1) + { + + $data3 = array(); + if ( ! empty($data1)) { + foreach ( $data1 as $key => $value) { + switch ( strval($key)) { + case 'calc': + if ( ! empty($value) && is_array($value)) { + foreach ( $value as $key2 => $value2) { + $data3[ $key . '_' . $key2 ] = $value2; + } + } + break; + default: + } + } + } + + return $data3; + } + public function get_payment_html() + { + + $data = array(); + $data['amount'] = ( isset($this->form_response['amount']) ) ? $this->form_response['amount'] : 0; + $data['fbh_id'] = ( isset($this->form_response['fbh_id']) ) ? $this->form_response['fbh_id'] : ''; + $data['currency'] = ( isset($this->form_response['currency']) ) ? $this->form_response['currency'] : array(); + + $data['price_format'] = ( isset($this->form_response['price_format']) ) ? $this->form_response['price_format'] : array(); + + $gateways = $this->model_gateways->getAvailableGateways(); + + foreach ( $gateways as $key => $value) { + switch ( intval($value->pg_id)) { + case 1: + // offline + $pg_data = json_decode($value->pg_data, true); + $data2 = array(); + $data2['pg_name'] = ( isset($value->pg_name) ) ? $value->pg_name : ''; + $data2['pg_description'] = ( isset($value->pg_description) ) ? $value->pg_description : ''; + $data2['form_id'] = ( isset($this->form_response['form_id']) ) ? $this->form_response['form_id'] : ''; + $data2['item_number'] = ( isset($this->form_response['id_payrec']) ) ? $this->form_response['id_payrec'] : ''; + + $tmp_redirection = ''; + + // adding redirection + if ( ! empty($pg_data['offline_return_url'])) { + $tmp_redirection = $pg_data['offline_return_url']; + } elseif ( isset($this->form_cur_data2['onsubm']['sm_redirect_st']) && intval($this->form_cur_data2['onsubm']['sm_redirect_st']) === 1) { + $tmp_redirection = urldecode($this->form_cur_data2['onsubm']['sm_redirect_url']); + } else { + } + + $data2['offline_return_url'] = $tmp_redirection; + $gateways[ $key ]->html_view = $this->load->view('gateways/frontend/offline', $data2, true); + + break; + case 2: + // paypal + if ( ZIGAFORM_C_LITE === 1) { + break 1; + } + $pg_data = json_decode($value->pg_data, true); + $data2 = array(); + $data2['amount'] = ( isset($this->form_response['amount']) ) ? $this->form_response['amount'] : 0; + $data2['amount'] = number_format(round($data2['amount'], 2, PHP_ROUND_HALF_EVEN), 2, '.', ''); + $data2['vis_uniqueid'] = ( isset($this->form_response['vis_uniqueid']) ) ? $this->form_response['vis_uniqueid'] : ''; + $data2['pg_name'] = ( isset($value->pg_name) ) ? $value->pg_name : ''; + $data2['mod_test'] = ( isset($value->pg_modtest) ) ? $value->pg_modtest : 0; + $data2['pg_description'] = ( isset($value->pg_description) ) ? $value->pg_description : ''; + $data2['item_number'] = ( isset($this->form_response['id_payrec']) ) ? $this->form_response['id_payrec'] : ''; + $data2['paypal_email'] = ( isset($pg_data['paypal_email']) ) ? $pg_data['paypal_email'] : ''; + $data2['paypal_return_url'] = isset($pg_data['paypal_return_url']) ? $pg_data['paypal_return_url'] : ''; + $data2['paypal_cancel_url'] = isset($pg_data['paypal_cancel_url']) ? $pg_data['paypal_cancel_url'] : ''; + $data2['paypal_currency'] = isset($pg_data['paypal_currency']) ? $pg_data['paypal_currency'] : ''; + $data2['paypal_method'] = isset($pg_data['paypal_method']) ? $pg_data['paypal_method'] : 0; + + if ( intval($data2['paypal_method']) === 0) { + // get data from invoice + $form_rec_data = $this->model_gateways_records->getInvoiceDataByFormRecId($data['fbh_id']); + $form_data = json_decode($form_rec_data->fmb_data, true); + + $form_data_calc_st = ( isset($form_data['calculation']['enable_st']) ) ? $form_data['calculation']['enable_st'] : '0'; + + if ( intval($form_data_calc_st) === 1) { + // math calculation + + $tmp_invoice_row = array(); + $tmp_invoice_row['item_uniqueid'] = 0; + $tmp_invoice_row['item_id'] = 0; + $tmp_invoice_row['item_qty'] = 1; + $tmp_invoice_row['item_num'] = 1; + $tmp_invoice_row['item_name'] = ( isset($form_data['calculation']['variables'][0]['tab_title']) ) ? $form_data['calculation']['variables'][0]['tab_title'] : 'Main Calc Variable'; + $tmp_invoice_row['item_amount'] = $form_rec_data->fbh_total_amount; + $new_record_user[] = $tmp_invoice_row; + } else { + // processs tax + $form_data_tax_st = ( isset($form_data['main']['price_tax_st']) ) ? $form_data['main']['price_tax_st'] : '0'; + $form_data_tax_val = ( isset($form_data['main']['price_tax_val']) ) ? $form_data['main']['price_tax_val'] : ''; + + $tmp_amount_total = floatval($this->form_response['amount']); + if ( isset($form_data_tax_st) && intval($form_data_tax_st) === 1) { + $tmp_tax = ( floatval($form_data_tax_val) / 100 ); + $tmp_sub_total = ( $tmp_amount_total ) * ( 100 / ( 100 + ( 100 * $tmp_tax ) ) ); + $data['form_subtotal_amount'] = $tmp_sub_total; + $data['form_tax'] = $tmp_amount_total - $tmp_sub_total; + } + + // process individuals + $name_fields = $this->model_record->getNameInvoiceField($data['fbh_id']); + $name_fields_check = array(); + foreach ( $name_fields as $value) { + $name_fields_check[ $value->fmf_uniqueid ]['fieldname'] = $value->fieldname; + $name_fields_check[ $value->fmf_uniqueid ]['id'] = $value->fmf_id; + } + + $data_record = $this->model_record->getRecordById($data['fbh_id']); + $record_user = json_decode($data_record->fbh_data, true); + $new_record_user = array(); + $item_count = 1; + foreach ( $record_user as $key2 => $value) { + if ( isset($name_fields_check[ $key2 ]) && isset($value['price_st']) && intval($value['price_st']) === 1) { + $field_name = ''; + $field_id = ''; + $tmp_invoice_row = array(); + + $field_name = $name_fields_check[ $key2 ]['fieldname']; + $field_id = $name_fields_check[ $key2 ]['id']; + + $tmp_invoice_row['item_uniqueid'] = $key2; + $tmp_invoice_row['item_id'] = $field_id; + + if ( isset($value['price_st']) && intval($value['price_st']) === 1) { + if ( is_array($value['input'])) { + if ( isset($value['input']['amount'])) { + $tmp_invoice_row['item_qty'] = 1; + $tmp_invoice_row['item_num'] = $item_count; + $tmp_invoice_row['item_name'] = $value['label']; + $tmp_invoice_row['item_amount'] = $value['input']['amount']; + $new_record_user[] = $tmp_invoice_row; + $item_count++; + } else { + foreach ( $value['input'] as $key3 => $value2) { + $tmp_invoice_row['item_qty'] = 1; + $tmp_invoice_row['item_name'] = ''; + $tmp_invoice_row['item_num'] = $item_count; + if ( isset($value2['cost'])) { + if ( isset($value2['qty'])) { + $tmp_invoice_row['item_qty'] = $value2['qty']; + $tmp_invoice_row['item_amount'] = $value2['cost']; + } else { + $tmp_invoice_row['item_amount'] = $value2['cost']; + } + } + + $tmp_inp_label = $value['label']; + if ( ! empty($value2['label'])) { + $tmp_inp_label .= ' - ' . $value2['label']; + } + $tmp_invoice_row['item_name'] = $tmp_inp_label; + + $new_record_user[] = $tmp_invoice_row; + $item_count++; + } + } + } else { + $tmp_invoice_row['item_qty'] = 0; + $tmp_invoice_row['item_num'] = $item_count; + $tmp_invoice_row['item_name'] .= ' ' . $value['input']; + $tmp_invoice_row['item_amount'] = 0; + $new_record_user[] = $tmp_invoice_row; + $item_count++; + } + } + } + } + + // add tax + if ( isset($form_data_tax_st) && intval($form_data_tax_st) === 1) { + $tmp_invoice_row = array(); + $tmp_invoice_row['item_qty'] = 1; + $tmp_invoice_row['item_num'] = $item_count; + $tmp_invoice_row['item_name'] = 'TAX'; + $tmp_invoice_row['item_amount'] = $data['form_tax']; + $new_record_user[] = $tmp_invoice_row; + } + } + $data2['paypal_individuals'] = $new_record_user; + } + $gateways[ $key ]->html_view = $this->load->view('gateways/frontend/paypal', $data2, true); + break; + default: + break; + } + } + $data['gateways'] = $gateways; + + $output = $this->load->view('formbuilder/frontend/payment_html', $data, true); + return $output; + } } diff --git a/application/modules/formbuilder/controllers/recaptcha.php b/application/modules/formbuilder/controllers/recaptcha.php index 24ffb4fa..8bc22338 100755 --- a/application/modules/formbuilder/controllers/recaptcha.php +++ b/application/modules/formbuilder/controllers/recaptcha.php @@ -11,10 +11,10 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: intranet.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } /** @@ -26,143 +26,141 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version Release: 1.00 - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -class Recaptcha extends BackendController { - /** - * max number of forms in order show by pagination - * - * @var int - */ - - const VERSION = '0.1'; - - /** - * name of form estimator table - * - * @var string - */ - private $model_fields = ''; - - /** - * Recaptcha::__construct() - * - * @return - */ - function __construct() { - parent::__construct(); - $this->load->language_alt( model_settings::$db_config['language'] ); - $this->template->set( 'controller', $this ); - $this->load->model( 'model_fields' ); - } - - - /** - * Recaptcha::front_verify_recaptchav3() - * - * @return - */ - public function front_verify_recaptchav3() { - - - require_once FCPATH . 'libs/recaptcha3/1.3.0/src/autoload.php'; - - $form_id = ( isset( $_POST['form_id'] ) ) ? Uiform_Form_Helper::sanitizeInput( $_POST['form_id'] ) : 0; - - $data_form = $this->model_forms->getAvailableFormById( $form_id ); - $onsubm = json_decode( $data_form->fmb_data2, true ); - $secret= $onsubm['main']['recaptchav3_secretkey']??''; - $gRecaptchaResponse = ( isset( $_POST['zgfm_token'] ) ) ? Uiform_Form_Helper::sanitizeInput( $_POST['zgfm_token'] ) : ''; - $recaptcha = new \ReCaptcha\ReCaptcha($secret); - $remoteIp = $_SERVER['REMOTE_ADDR']; - $success = false; - $errors = []; - $resp = $recaptcha->setExpectedHostname($_SERVER['HTTP_HOST']) +class Recaptcha extends BackendController +{ + /** + * max number of forms in order show by pagination + * + * @var int + */ + + const VERSION = '0.1'; + + /** + * name of form estimator table + * + * @var string + */ + private $model_fields = ''; + + /** + * Recaptcha::__construct() + * + * @return + */ + public function __construct() + { + parent::__construct(); + $this->load->language_alt(model_settings::$db_config['language']); + $this->template->set('controller', $this); + $this->load->model('model_fields'); + } + + + /** + * Recaptcha::front_verify_recaptchav3() + * + * @return + */ + public function front_verify_recaptchav3() + { + + + require_once FCPATH . 'libs/recaptcha3/1.3.0/src/autoload.php'; + + $form_id = ( isset($_POST['form_id']) ) ? Uiform_Form_Helper::sanitizeInput($_POST['form_id']) : 0; + + $data_form = $this->model_forms->getAvailableFormById($form_id); + $onsubm = json_decode($data_form->fmb_data2, true); + $secret= $onsubm['main']['recaptchav3_secretkey']??''; + $gRecaptchaResponse = ( isset($_POST['zgfm_token']) ) ? Uiform_Form_Helper::sanitizeInput($_POST['zgfm_token']) : ''; + $recaptcha = new \ReCaptcha\ReCaptcha($secret); + $remoteIp = $_SERVER['REMOTE_ADDR']; + $success = false; + $errors = []; + $resp = $recaptcha->setExpectedHostname($_SERVER['HTTP_HOST']) ->verify($gRecaptchaResponse, $remoteIp); - if ($resp->isSuccess()) { - $success = true; - } else { - $success = true; - $errors = $resp->getErrorCodes(); - } - - - $json = array(); - $json['success'] = $success; - $json['error'] = $errors; - // return data to ajax callback - header( 'Content-Type: application/json' ); - echo json_encode( $json ); - die(); - } - - /** - * Recaptcha::front_verify_recaptcha() - * - * @return - */ - public function front_verify_recaptcha() { - require_once FCPATH . 'libs/recaptcha2/appengine-https.php'; - require_once FCPATH . 'libs/recaptcha2/autoload.php'; - - $uid_field = ( isset( $_POST['rockfm-uid-field'] ) ) ? Uiform_Form_Helper::sanitizeInput( $_POST['rockfm-uid-field'] ) : ''; - $form_id = ( isset( $_POST['form_id'] ) ) ? Uiform_Form_Helper::sanitizeInput( $_POST['form_id'] ) : 0; - $fmf_json = $this->model_fields->getDataByUniqueId( $uid_field, $form_id ); - $secret = ''; - $success = false; - if ( ! empty( $fmf_json ) ) { - $fmf_data = json_decode( $fmf_json->fmf_data, true ); - - $secret = ( isset( $fmf_data['input5']['g_key_secret'] ) ) ? $fmf_data['input5']['g_key_secret'] : ''; - $siteKey = ( isset( $fmf_data['input5']['g_key_public'] ) ) ? $fmf_data['input5']['g_key_public'] : ''; - - if ( $siteKey === '' || $secret === '' ) { - - } elseif ( isset( $_POST['rockfm-code-recaptcha'] ) ) { - - $recaptcha = new \ReCaptcha\ReCaptcha( $secret ); - - // If file_get_contents() is locked down on your PHP installation to disallow - // its use with URLs, then you can use the alternative request method instead. - // This makes use of fsockopen() instead. - // $recaptcha = new \ReCaptcha\ReCaptcha($secret, new \ReCaptcha\RequestMethod\SocketPost()); - // Make the call to verify the response and also pass the user's IP address - $resp = $recaptcha->setExpectedHostname( $_SERVER['SERVER_NAME'] ) - ->verify( $_POST['rockfm-code-recaptcha'], $_SERVER['REMOTE_ADDR'] ); - - if ( $resp->isSuccess() ) : - $success = true; - else : - $success = false; - endif; - - // in case false, using method 2 to get validation - if ( $success === false ) { - if ( is_callable( 'curl_init' ) ) { - $recaptcha = new \ReCaptcha\ReCaptcha( $secret, new \ReCaptcha\RequestMethod\CurlPost() ); - - $resp = $recaptcha->setExpectedHostname( $_SERVER['SERVER_NAME'] ) - ->verify( $_POST['rockfm-code-recaptcha'], $_SERVER['REMOTE_ADDR'] ); - if ( $resp->isSuccess() ) : - $success = true; - else : - $success = false; - endif; - - } - } - } else { - - } - } - - $json = array(); - $json['success'] = $success; - // return data to ajax callback - header( 'Content-Type: application/json' ); - echo json_encode( $json ); - die(); - - } - + if ($resp->isSuccess()) { + $success = true; + } else { + $success = true; + $errors = $resp->getErrorCodes(); + } + + + $json = array(); + $json['success'] = $success; + $json['error'] = $errors; + // return data to ajax callback + header('Content-Type: application/json'); + echo json_encode($json); + die(); + } + + /** + * Recaptcha::front_verify_recaptcha() + * + * @return + */ + public function front_verify_recaptcha() + { + require_once FCPATH . 'libs/recaptcha2/appengine-https.php'; + require_once FCPATH . 'libs/recaptcha2/autoload.php'; + + $uid_field = ( isset($_POST['rockfm-uid-field']) ) ? Uiform_Form_Helper::sanitizeInput($_POST['rockfm-uid-field']) : ''; + $form_id = ( isset($_POST['form_id']) ) ? Uiform_Form_Helper::sanitizeInput($_POST['form_id']) : 0; + $fmf_json = $this->model_fields->getDataByUniqueId($uid_field, $form_id); + $secret = ''; + $success = false; + if ( ! empty($fmf_json)) { + $fmf_data = json_decode($fmf_json->fmf_data, true); + + $secret = ( isset($fmf_data['input5']['g_key_secret']) ) ? $fmf_data['input5']['g_key_secret'] : ''; + $siteKey = ( isset($fmf_data['input5']['g_key_public']) ) ? $fmf_data['input5']['g_key_public'] : ''; + + if ( $siteKey === '' || $secret === '') { + } elseif ( isset($_POST['rockfm-code-recaptcha'])) { + $recaptcha = new \ReCaptcha\ReCaptcha($secret); + + // If file_get_contents() is locked down on your PHP installation to disallow + // its use with URLs, then you can use the alternative request method instead. + // This makes use of fsockopen() instead. + // $recaptcha = new \ReCaptcha\ReCaptcha($secret, new \ReCaptcha\RequestMethod\SocketPost()); + // Make the call to verify the response and also pass the user's IP address + $resp = $recaptcha->setExpectedHostname($_SERVER['SERVER_NAME']) + ->verify($_POST['rockfm-code-recaptcha'], $_SERVER['REMOTE_ADDR']); + + if ( $resp->isSuccess()) : + $success = true; + else : + $success = false; + endif; + + // in case false, using method 2 to get validation + if ( $success === false) { + if ( is_callable('curl_init')) { + $recaptcha = new \ReCaptcha\ReCaptcha($secret, new \ReCaptcha\RequestMethod\CurlPost()); + + $resp = $recaptcha->setExpectedHostname($_SERVER['SERVER_NAME']) + ->verify($_POST['rockfm-code-recaptcha'], $_SERVER['REMOTE_ADDR']); + if ( $resp->isSuccess()) : + $success = true; + else : + $success = false; + endif; + } + } + } else { + } + } + + $json = array(); + $json['success'] = $success; + // return data to ajax callback + header('Content-Type: application/json'); + echo json_encode($json); + die(); + } } diff --git a/application/modules/formbuilder/controllers/records.php b/application/modules/formbuilder/controllers/records.php index 1df23606..90990098 100755 --- a/application/modules/formbuilder/controllers/records.php +++ b/application/modules/formbuilder/controllers/records.php @@ -11,10 +11,10 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: intranet.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } use \Zigaform\Admin\List_data; @@ -28,779 +28,786 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version Release: 1.00 - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -class Records extends BackendController { - /** - * max number of forms in order show by pagination - * - * @var int - */ - - const VERSION = '0.1'; - - /** - * name of form estimator table - * - * @var string - */ - var $per_page = 50; - protected $modules; - - /** - * Records::__construct() - * - * @return - */ - function __construct() { - parent::__construct(); - $this->load->language_alt( model_settings::$db_config['language'] ); - $this->template->set( 'controller', $this ); - $this->load->model( 'model_forms' ); - $this->load->model( 'model_fields' ); - $this->load->model( 'model_record' ); - } - - public function ajax_list_record_updatest() { - - $list_ids = ( isset( $_POST['id'] ) && $_POST['id'] ) ? array_map( array( 'Uiform_Form_Helper', 'sanitizeRecursive' ), $_POST['id'] ) : array(); - $form_st = ( isset( $_POST['form_st'] ) && $_POST['form_st'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['form_st'] ) : ''; - $is_trash = ( isset( $_POST['is_trash'] ) && $_POST['is_trash'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['is_trash'] ) : ''; - if ( $list_ids ) { - - if ( intval( $is_trash ) === 0 ) { - switch ( intval( $form_st ) ) { - case 1: - case 2: - case 0: - foreach ( $list_ids as $value ) { - - $data = array( - 'flag_status' => intval( $form_st ), - ); - - $this->db->set( $data ); - $this->db->where( 'fbh_id', $value ); - $this->db->update( $this->model_record->table ); - } - break; - default: - break; - } - } else { - switch ( intval( $form_st ) ) { - case 1: - case 2: - foreach ( $list_ids as $value ) { - - $data = array( - 'flag_status' => intval( $form_st ), - ); - - $this->db->set( $data ); - $this->db->where( 'fbh_id', $value ); - $this->db->update( $this->model_record->table ); - } - break; - case 0: - foreach ( $list_ids as $value ) { - - $this->delete_form_process( $value ); - - } - - break; - default: - # code... - break; - } - } - } - } - - private function delete_form_process( $value ) { - - //remove from records - $this->db->where( 'fbh_id', $value ); - $this->db->delete( $this->model_record->table ); - - } - - /** - * Records::ajax_load_viewchart() - * - * @return - */ - public function ajax_load_viewchart() { - - $form_id = ( isset( $_POST['form_id'] ) && $_POST['form_id'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['form_id'] ) : 0; - - $data_chart = $this->model_record->getChartDataByIdForm( $form_id ); - - $data = array(); - $data['data'] = $data_chart; - header( 'Content-Type: application/json' ); - echo json_encode( $data ); - die(); - } - - /** - * Records::ajax_load_savereport() - * - * @return - */ - public function ajax_load_savereport() { - - $form_id = ( isset( $_POST['form_id'] ) && $_POST['form_id'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['form_id'] ) : 0; - $data_fields = ( isset( $_POST['data'] ) && ! empty( $_POST['data'] ) ) ? array_map( array( 'Uiform_Form_Helper', 'sanitizeRecursive' ), $_POST['data'] ) : array(); - $data_fields2 = ( isset( $_POST['data2'] ) && ! empty( $_POST['data2'] ) ) ? array_map( array( 'Uiform_Form_Helper', 'sanitizeRecursive' ), $_POST['data2'] ) : array(); - - /* update all fields by form */ - $where = array( 'form_fmb_id' => $form_id ); - $data = array( 'fmf_status_qu' => 0 ); - - $this->db->set( $data ); - $this->db->where( $where ); - $this->db->update( $this->model_fields->table ); - // update the fields to show in list - if ( ! empty( $data_fields ) ) { - foreach ( $data_fields as $value ) { - $where = array( - 'form_fmb_id' => $form_id, - 'fmf_uniqueid' => $value, - ); - $data = array( 'fmf_status_qu' => 1 ); - - $this->db->set( $data ); - $this->db->where( $where ); - $this->db->update( $this->model_fields->table ); - } - } - - // update order for all fields according to form - if ( ! empty( $data_fields2 ) ) { - foreach ( $data_fields2 as $value ) { - $where = array( - 'form_fmb_id' => $form_id, - 'fmf_uniqueid' => $value['name'], - ); - $data = array( 'order_rec' => $value['value'] ); - - $this->db->set( $data ); - $this->db->where( $where ); - $this->db->update( $this->model_fields->table ); - } - } - - die(); - } - - /** - * Records::ajax_load_customreport() - * - * @return - */ - public function ajax_load_customreport() { - - $form_id = ( isset( $_POST['form_id'] ) && $_POST['form_id'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['form_id'] ) : 0; - - $all_fields = $this->model_record->getAllFieldsForReport( $form_id ); - - $data = array(); - $data['list_fields'] = $all_fields; - - $textfield_tmp = $this->load->view( 'formbuilder/records/custom_report_getAllfields', $data, true ); - echo $textfield_tmp; - die(); - } - - /** - * Records::view_charts() - * - * @return - */ - public function view_charts() { - - $data = array(); - $data['list_forms'] = $this->model_forms->getListForms(); - $this->template->loadPartial( 'layout', 'records/view_charts', $data ); - } - - /** - * Records::custom_report() - * - * @return - */ - public function custom_report() { - - $data = array(); - $data['list_forms'] = $this->model_forms->getListForms(); - - $this->template->loadPartial( 'layout', 'records/custom_report', $data ); - } - - /** - * Records::ajax_load_record_byform() - * - * @return - */ - public function ajax_load_record_byform() { - - $form_id = ( isset( $_POST['form_id'] ) && $_POST['form_id'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['form_id'] ) : 0; - // records to show - $name_fields = $this->model_record->getNameFieldEnabledByForm( $form_id, true ); - $data = array(); - $data['datatable_head'] = $name_fields; - // process record - $flag_types = array(); - foreach ( $name_fields as $key => $value ) { - - $flag_types[ $key ] = $value->fby_id; - - } - - $pre_datatable_body = $this->model_record->getDetailRecord( $name_fields, $form_id ); - $new_record = array(); - foreach ( $pre_datatable_body as $key => $value ) { - $count1 = 0; - foreach ( $value as $key2 => $value2 ) { - - $new_record[ $key ][ $key2 ] = $value2; - - if ( isset( $flag_types[ $count1 ] ) ) { - switch ( intval( $flag_types[ $count1 ] ) ) { - case 12: - case 13: - // checking if image exists - if ( !empty($value_new) && @is_array( getimagesize( $value2 ) ) ) { - $new_record[ $key ][ $key2 ] = ''; - } - break; - default: - break; - } - } - $count1++; - - } - } - - $data['datatable_body'] = $new_record; - $textfield_tmp = $this->load->view( 'formbuilder/records/list_records_getdatatable', $data, true ); - echo $textfield_tmp; - die(); - } - - /** - * Records::ajax_delete_record() - * - * @return - */ - public function ajax_delete_record() { - - $rec_id = ( isset( $_POST['rec_id'] ) && $_POST['rec_id'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['rec_id'] ) : 0; - $is_trash = ( isset( $_POST['is_trash'] ) && $_POST['is_trash'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['is_trash'] ) : 0; - - if ( intval( $is_trash ) === 0 ) { - $where = array( - 'fbh_id' => $rec_id, - ); - $data = array( - 'flag_status' => 0, - ); - - $this->db->set( $data ); - $this->db->where( $where ); - $this->db->update( $this->model_record->table ); - } else { - $this->delete_form_process( $rec_id ); - - } - } - - /** - * Records::info_records_byforms() - * - * @return - */ - public function info_records_byforms() { - - $data = array(); - $data['list_forms'] = $this->model_forms->getListForms(); - $this->template->loadPartial( 'layout', 'records/list_records_byforms', $data ); - } - - /** - * Records::info_record() - * - * @return - */ - public function info_record() { - - $id_rec = ( isset( $_GET['id_rec'] ) && $_GET['id_rec'] ) ? Uiform_Form_Helper::sanitizeInput( $_GET['id_rec'] ) : 0; - $name_fields = $this->model_record->getNameField( $id_rec ); - $form_rec_data = $this->model_record->getFormDataById( $id_rec ); - $form_data = json_decode( $form_rec_data->fmb_data, true ); - - $form_data_currency = ( isset( $form_data['main']['price_currency'] ) ) ? $form_data['main']['price_currency'] : ''; - - // price numeric format - $format_price_conf = array(); - $format_price_conf['price_format_st'] = ( isset( $form_data['main']['price_format_st'] ) ) ? $form_data['main']['price_format_st'] : '0'; - $format_price_conf['price_sep_decimal'] = ( isset( $form_data['main']['price_sep_decimal'] ) ) ? $form_data['main']['price_sep_decimal'] : '.'; - $format_price_conf['price_sep_thousand'] = ( isset( $form_data['main']['price_sep_thousand'] ) ) ? $form_data['main']['price_sep_thousand'] : ','; - $format_price_conf['price_sep_precision'] = ( isset( $form_data['main']['price_sep_precision'] ) ) ? $form_data['main']['price_sep_precision'] : '2'; - - // calculation - $form_calculation = ( isset( $form_data['calculation']['enable_st'] ) ) ? $form_data['calculation']['enable_st'] : '0'; - - $name_fields_check = array(); - $fields_type_check = array(); - foreach ( $name_fields as $value ) { - $name_fields_check[ $value->fmf_uniqueid ] = $value->fieldname; - $fields_type_check[ $value->fmf_uniqueid ] = $value->type_fby_id; - } - - $data_record = $this->model_record->getRecordById( $id_rec ); - $record_user = json_decode( $data_record->fbh_data, true ); - $new_record_user = array(); - foreach ( $record_user as $key => $value ) { - if ( isset( $name_fields_check[ $key ] ) ) { - $key_det = $name_fields_check[ $key ]; - } - if ( isset( $fields_type_check[ $key ] ) ) { - - switch ( intval( $value['type'] ) ) { - case 9: - case 11: - $new_record_user[] = array( - 'field' => $key_det, - 'type' => $fields_type_check[ $key ], - 'value' => $value['input_value'], - ); - break; - case 12: - case 13: - $value_new = $value['input']; - // checking if image exists - if ( !empty($value_new) && @is_array( getimagesize( $value_new ) ) ) { - $value_new = ''; - } - - $new_record_user[] = array( - 'field' => $value['label'], - 'type' => $fields_type_check[ $key ], - 'value' => $value_new, - ); - break; - default: - $new_record_user[] = array( - 'field' => $key_det, - 'type' => $fields_type_check[ $key ], - 'value' => $value['input'], - ); - break; - } - } - } - $data = array(); - $data2 = array(); - - // processs tax - $form_data_tax_st = ( isset( $form_data['main']['price_tax_st'] ) ) ? $form_data['main']['price_tax_st'] : '0'; - $form_data_tax_val = ( isset( $form_data['main']['price_tax_val'] ) ) ? $form_data['main']['price_tax_val'] : ''; - - $tmp_amount_total = floatval( $form_rec_data->fbh_total_amount ); - if ( isset( $form_data_tax_st ) && intval( $form_data_tax_st ) === 1 ) { - $tmp_tax = ( floatval( $form_data_tax_val ) / 100 ); - $tmp_sub_total = ( $tmp_amount_total ) * ( 100 / ( 100 + ( 100 * $tmp_tax ) ) ); - $data['form_subtotal_amount'] = $tmp_sub_total; - $data['form_tax'] = $tmp_amount_total - $tmp_sub_total; - } - - $data['form_total_amount'] = $tmp_amount_total; - $data['form_currency'] = $form_data_currency; - $data['form_calculation'] = $form_calculation; - $data['record_id'] = $id_rec; - $data['record_info'] = $data2['record_info'] = $new_record_user; - - $data['price_format'] = $format_price_conf; - - $data['info_date'] = $data2['info_date'] = date( 'F j, Y, g:i a', strtotime( $data_record->created_date ) ); - $data['info_ip'] = $data2['info_ip'] = $data_record->created_ip; - - require_once APPPATH . '/helpers/Browser.php'; - $browser = new Browser( $data_record->fbh_user_agent ); - $data['info_useragent'] = $data2['info_useragent'] = $browser->getBrowser() . __( ' , version : ', 'frocket_front' ) . $browser->getVersion() . __( ' , platform : ', 'frocket_front' ) . $browser->getPlatform(); - $data['info_referer'] = $data2['info_referer'] = $data_record->fbh_referer; - $data['form_name'] = $data2['form_name'] = $form_rec_data->fmb_name; - $data2['info_labels'] = array( - 'title' => __( 'Entry information', 'FRocket_admin' ), - 'info_submitted' => __( 'Submitted form data', 'FRocket_admin' ), - 'info_additional' => __( 'Additional info', 'FRocket_admin' ), - 'info_date' => __( 'Date', 'FRocket_admin' ), - 'info_ip' => __( 'IP', 'FRocket_admin' ), - 'info_pc' => __( 'Client PC info', 'FRocket_admin' ), - 'info_frmurl' => __( 'Form URL', 'FRocket_admin' ), - 'form_name' => __( 'Form name', 'FRocket_admin' ), - ); - - $data['info_export'] = Uiform_Form_Helper::base64url_encode( json_encode( $data2 ) ); - $data['record_info_str'] = $this->get_info_records( $new_record_user, $data ); - - $data['fmb_rec_tpl_st'] = $form_rec_data->fmb_rec_tpl_st; - if ( intval( $data['fmb_rec_tpl_st'] ) === 1 ) { - $data['base_url'] = base_url() . '/'; - $data['form_id'] = $form_rec_data->form_fmb_id; - $data['url_form'] = site_url() . 'formbuilder/frontend/pdf_show_record/?uifm_mode=pdf&is_html=1&id=' . $id_rec; - $data['custom_template'] = $this->load->view( 'formbuilder/frontend/form_summary_custom', $data, true ); - } else { - $data['custom_template'] = ''; - } - - $this->template->loadPartial( 'layout', 'records/info_record', $data ); - } - - public function get_info_records( $new_record_user, $data ) { - /* - echo json_encode($new_record_user); - die();*/ - $tmp_form_info = '
      '; - foreach ( $new_record_user as $value ) { - $tmp_form_info .= '
    • '; - - if ( isset( $value['value'] ) && is_array( $value['value'] ) ) { - - $tmp_form_info .= '' . $value['field'] . ''; - - switch ( intval( $value['type'] ) ) { - case 8: - case 9: - case 10: - case 11: - $tmp_form_info .= '
        '; - foreach ( $value['value'] as $key3 => $value3 ) { - $tmp_form_info .= '
      • '; - - if ( isset( $value3['label'] ) ) { - $tmp_form_info .= $value3['label']; - } - if ( isset( $value3['qty'] ) && floatval( $value3['qty'] ) > 0 ) { - $tmp_form_info .= ' - ' . __( 'qty', 'frocket_front' ) . ': ' . $value3['qty'] . ' ' . __( 'Units', 'FRocket_admin' ); - } - if ( ( isset( $value3['amount'] ) && floatval( $value3['amount'] ) > 0 ) && intval( $data['form_calculation'] ) === 0 ) { - $tmp_form_info .= ' - ' . __( 'Amount', 'frocket_front' ) . ': ' . Uiform_Form_Helper::cformat_numeric( $data['price_format'], $value3['amount'] ) . ' ' . $data['form_currency']; - } - - $tmp_form_info .= '
      • '; - } - $tmp_form_info .= '
      '; - break; - case 16: - // slider - case 18: - // spinner - $tmp_form_info .= '
        '; - $tmp_form_info .= '
      • '; - - if ( intval( $data['form_calculation'] ) === 1 ) { - // with math calculation - $tmp_form_info .= ' : ' . Uiform_Form_Helper::cformat_numeric( $data['price_format'], $value['value']['value'] ); - } else { - // withoout math calc - $tmp_form_info .= ' cost : ' . $value['value']['cost'] . ' - qty: ' . $value['value']['qty'] . ' - ' . __( 'Amount', 'FRocket_admin' ) . ' : ' . Uiform_Form_Helper::cformat_numeric( $data['price_format'], $value['value']['amount'] ) . ' ' . $data['form_currency'] . ' ' . $data['form_currency']; - } - - $tmp_form_info .= '
      • '; - $tmp_form_info .= '
      '; - break; - default: - if ( isset( $value['value'] ) && is_array( $value['value'] ) ) { - $tmp_form_info .= '
        '; - foreach ( $value['value']as $key3 => $value3 ) { - $tmp_form_info .= '
      • '; - if ( ( isset( $value['value']['input_cost_amt'] ) && floatval( $value['value']['input_cost_amt'] ) > 0 ) && intval( $data['form_calculation'] ) === 1 ) { - $tmp_form_info .= $value['value']['input_cost_amt']; - } else { - if ( isset( $value3['label'] ) ) { - $tmp_form_info .= $value3['label']; - } - if ( isset( $value3['qty'] ) && floatval( $value3['qty'] ) > 0 ) { - $tmp_form_info .= ' - ' . __( 'qty', 'frocket_front' ) . ': ' . $value3['qty'] . ' ' . __( 'Units', 'FRocket_admin' ); - } - if ( ( isset( $value3['amount'] ) && floatval( $value3['amount'] ) > 0 ) && intval( $data['form_calculation'] ) === 0 ) { - $tmp_form_info .= ' - ' . __( 'Amount', 'frocket_front' ) . ': ' . Uiform_Form_Helper::cformat_numeric( $data['price_format'], $value3['amount'] ) . ' ' . $data['form_currency']; - } - } - $tmp_form_info .= '
      • '; - } - $tmp_form_info .= '
      '; - } else { - $tmp_form_info .= ' : ' . $value['value']; - } - - break; - } - } else { - - switch ( intval( $value['type'] ) ) { - case 8: - case 9: - case 10: - case 11: - $tmp_form_info .= '' . $value['field'] . ''; - if ( ! empty( $value['value'] ) ) { - $tmp_form_info .= ' : ' . $value['value']; - } - - break; - default: - $tmp_form_info .= '' . $value['field'] . ''; - if ( ! empty( $value['value'] ) ) { - $tmp_form_info .= ' : ' . $value['value']; - } - break; - } - } - $tmp_form_info .= '
    • '; - } - $tmp_form_info .= '
    '; - - return $tmp_form_info; - } - - - /** - * list records - * - * @return void - */ - public function list_records() { - $filter_data = get_option( 'zgfm_listrecords_searchfilter', true ); - $data2 = array(); - if ( empty( $filter_data ) && !isset($filter_data['orderby'])) { - $data2['per_page'] = intval( $this->per_page ); - $data2['orderby'] = 'asc'; - } else { - $data2['per_page'] = intval( $filter_data['per_page']??'' ); - $data2['orderby'] = $filter_data['orderby']??''; - } - - $offset = ( isset( $_GET['offset'] ) ) ? Uiform_Form_Helper::sanitizeInput( $_GET['offset'] ) : 0; - $data2['offset'] = $offset; - - $form_data = $this->model_record->ListTotals(); - $data2['title'] = __( 'Records list', 'FRocket_admin' ); - $data2['all'] = $form_data->r_all; - $data2['trash'] = $form_data->r_trash; - $data2['header_buttons'] = List_data::get()->list_detail_record_headerbuttons(); - $data2['script_trigger'] = 'zgfm_back_general.recordslist_search_process();'; - $data2['subcurrent'] = 1; - $data2['subsubsub'] = List_data::get()->subsubsub_records( $data2 ); - $data2['is_trash'] = 0; - - $content = List_data::get()->show_list( $data2 ); - //echo self::loadPartial2( 'layout.php', $content); - echo $this->template->loadPartial2( 'layout', $content ); - } - - /** - * list trash records - * - * @return void - */ - public function list_trash_records() { - $filter_data = get_option( 'zgfm_listrecords_searchfilter', true ); - $data2 = array(); - if ( empty( $filter_data ) && !isset($filter_data['orderby'])) { - $data2['per_page'] = intval( $this->per_page ); - $data2['orderby'] = 'asc'; - } else { - $data2['per_page'] = intval( $filter_data['per_page']??'' ); - $data2['orderby'] = $filter_data['orderby']??''; - } - - $offset = ( isset( $_GET['offset'] ) ) ? Uiform_Form_Helper::sanitizeInput( $_GET['offset'] ) : 0; - $data2['offset'] = $offset; - - $form_data = $this->model_record->ListTotals(); - $data2['title'] = __( 'Records in trash', 'FRocket_admin' ); - $data2['all'] = $form_data->r_all; - $data2['trash'] = $form_data->r_trash; - $data2['header_buttons'] = List_data::get()->list_detail_trashrecord_headerbuttons(); - $data2['script_trigger'] = 'zgfm_back_general.recordslist_search_process();'; - $data2['subcurrent'] = 2; - $data2['subsubsub'] = List_data::get()->subsubsub_records( $data2 ); - $data2['is_trash'] = 1; - - $content = List_data::get()->show_list( $data2 ); - //echo self::loadPartial2( 'layout.php', $content); - echo $this->template->loadPartial2( 'layout', $content ); - } - - /** - * List trash forms - * - * @return void - */ - function ajax_recordlist_sendfilter() { - - $data_filter = ( isset( $_POST['data_filter'] ) && $_POST['data_filter'] ) ? $_POST['data_filter'] : ''; - - $opt_save = ( isset( $_POST['opt_save'] ) && $_POST['opt_save'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['opt_save'] ) : 0; - $opt_offset = ( isset( $_POST['opt_offset'] ) && $_POST['opt_offset'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['opt_offset'] ) : 0; - $is_trash = ( isset( $_POST['op_is_trash'] ) && $_POST['op_is_trash'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['op_is_trash'] ) : 0; - - parse_str( $data_filter, $data_filter_arr ); - - $per_page = $data_filter_arr['zgfm-listform-pref-perpage']; - $orderby = $data_filter_arr['zgfm-listform-pref-orderby']; - - $data = array(); - $data['per_page'] = $per_page; - $data['orderby'] = $orderby; - $data['is_trash'] = $is_trash; - - update_option( 'zgfm_listrecords_searchfilter', $data ); - - $data['segment'] = 0; - $data['offset'] = $opt_offset; - - $result = $this->ajax_recordslist_refresh( $data ); - - $json = array(); - $json['content'] = $result; - - header( 'Content-Type: application/json' ); - echo json_encode( $json ); - die(); - } - - /** - * get forms in trash - * - * @param [type] $data - * @return void - */ - function ajax_recordslist_refresh( $data ) { - - $this->load->library( 'pagination' ); - - $offset = $data['offset']; - - // list all forms - $config = array(); - - $tmp = $this->model_record->ListTotals(); - if ( intval( $data['is_trash'] ) === 0 ) { - $config['base_url'] = site_url() . 'formbuilder/forms/list_records'; - $config['total_rows'] = $tmp->r_all; - } else { - $config['base_url'] = site_url() . 'formbuilder/forms/list_trash_records'; - $config['total_rows'] = $tmp->r_trash; - } - - $config['per_page'] = $data['per_page']; - $config['first_link'] = 'First'; - $config['last_link'] = 'Last'; - $config['full_tag_open'] = '
      '; - $config['full_tag_close'] = '
    '; - $config['first_tag_open'] = '
  • '; - $config['first_tag_close'] = '
  • '; - $config['last_tag_open'] = '
  • '; - $config['last_tag_close'] = '
  • '; - $config['cur_tag_open'] = '
  • '; - $config['cur_tag_close'] = '
  • '; - $config['next_tag_open'] = '
  • '; - $config['next_tag_close'] = '
  • '; - $config['prev_tag_open'] = '
  • '; - $config['prev_tag_close'] = '
  • '; - $config['num_tag_open'] = '
  • '; - $config['num_tag_close'] = '
  • '; - $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; - - $data2 = array(); - $data2['per_page'] = $data['per_page']; - $data2['segment'] = $offset; - $data2['orderby'] = $data['orderby']; - $data2['is_trash'] = $data['is_trash']; - - if ( intval( $data2['is_trash'] ) === 0 ) { - $data2['query'] = $this->model_record->getListAllRecordsFiltered( $data2 ); - } else { - $data2['query'] = $this->model_record->getListTrashRecordsFiltered( $data2 ); - } - - $data2['pagination'] = $this->pagination->create_links(); - $data2['obj_list_data'] = List_data::get(); - - if ( intval( $data2['is_trash'] ) === 0 ) { - return List_data::get()->list_detail_records( $data2 ); - } else { - return List_data::get()->list_detail_trashrecords( $data2 ); - } - - } - - public function action_pdf_show_invoice() { - modules::run( 'formbuilder/frontend/pdf_show_invoice' ); - } - - public function action_pdf_show_record() { - modules::run( 'formbuilder/frontend/pdf_show_record' ); - } - - public function action_csv_show_allrecords() { - - $form_id = isset( $_GET['id'] ) ? Uiform_Form_Helper::sanitizeInput( $_GET['id'] ) : ''; - - echo modules::run( 'formbuilder/records/csv_showAllForms', $form_id ); - - die(); - } - - public function csv_showAllForms( $form_id ) { - - require_once APPPATH . '/helpers/exporttocsv.php'; - if ( false ) { - $name_fields = $this->model_record->getNameFieldEnabledByForm( $form_id, true ); - } else { - $name_fields = $this->model_record->getNameFieldEnabledByForm( $form_id, false ); - } - - $tmp_data = array(); - $tmp_data['datatable_head'] = $name_fields; - $tmp_data['datatable_body'] = $this->model_record->getDetailRecord( $name_fields, $form_id ); - - $data = array(); - $tmp_ar = array(); - foreach ( $tmp_data['datatable_head'] as $value ) { - $tmp_ar[] = $value->fieldname; - } - $data[] = $tmp_ar; - - foreach ( $tmp_data['datatable_body'] as $key => $value ) { - $tmp_ar = array(); - foreach ( $value as $key => $value2 ) { - //if ( $key != 'fbh_id' ) { - $tmp_ar[] = $value2; - //} - } - $data[] = $tmp_ar; - } - - $tsv = new ExportDataCSV( 'browser' ); - $tsv->filename = 'csv_' . $form_id . '.csv'; - - $tsv->initialize(); - foreach ( $data as $row ) { - $tsv->addRow( $row ); - } - $tsv->finalize(); - } +class Records extends BackendController +{ + /** + * max number of forms in order show by pagination + * + * @var int + */ + + const VERSION = '0.1'; + + /** + * name of form estimator table + * + * @var string + */ + private $per_page = 50; + protected $modules; + + /** + * Records::__construct() + * + * @return + */ + public function __construct() + { + parent::__construct(); + $this->load->language_alt(model_settings::$db_config['language']); + $this->template->set('controller', $this); + $this->load->model('model_forms'); + $this->load->model('model_fields'); + $this->load->model('model_record'); + } + + public function ajax_list_record_updatest() + { + + $list_ids = ( isset($_POST['id']) && $_POST['id'] ) ? array_map(array( 'Uiform_Form_Helper', 'sanitizeRecursive' ), $_POST['id']) : array(); + $form_st = ( isset($_POST['form_st']) && $_POST['form_st'] ) ? Uiform_Form_Helper::sanitizeInput($_POST['form_st']) : ''; + $is_trash = ( isset($_POST['is_trash']) && $_POST['is_trash'] ) ? Uiform_Form_Helper::sanitizeInput($_POST['is_trash']) : ''; + if ( $list_ids) { + if ( intval($is_trash) === 0) { + switch ( intval($form_st)) { + case 1: + case 2: + case 0: + foreach ( $list_ids as $value) { + $data = array( + 'flag_status' => intval($form_st), + ); + + $this->db->set($data); + $this->db->where('fbh_id', $value); + $this->db->update($this->model_record->table); + } + break; + default: + break; + } + } else { + switch ( intval($form_st)) { + case 1: + case 2: + foreach ( $list_ids as $value) { + $data = array( + 'flag_status' => intval($form_st), + ); + + $this->db->set($data); + $this->db->where('fbh_id', $value); + $this->db->update($this->model_record->table); + } + break; + case 0: + foreach ( $list_ids as $value) { + $this->delete_form_process($value); + } + + break; + default: + # code... + break; + } + } + } + } + + private function delete_form_process($value) + { + + //remove from records + $this->db->where('fbh_id', $value); + $this->db->delete($this->model_record->table); + } + + /** + * Records::ajax_load_viewchart() + * + * @return + */ + public function ajax_load_viewchart() + { + + $form_id = ( isset($_POST['form_id']) && $_POST['form_id'] ) ? Uiform_Form_Helper::sanitizeInput($_POST['form_id']) : 0; + + $data_chart = $this->model_record->getChartDataByIdForm($form_id); + + $data = array(); + $data['data'] = $data_chart; + header('Content-Type: application/json'); + echo json_encode($data); + die(); + } + + /** + * Records::ajax_load_savereport() + * + * @return + */ + public function ajax_load_savereport() + { + + $form_id = ( isset($_POST['form_id']) && $_POST['form_id'] ) ? Uiform_Form_Helper::sanitizeInput($_POST['form_id']) : 0; + $data_fields = ( isset($_POST['data']) && ! empty($_POST['data']) ) ? array_map(array( 'Uiform_Form_Helper', 'sanitizeRecursive' ), $_POST['data']) : array(); + $data_fields2 = ( isset($_POST['data2']) && ! empty($_POST['data2']) ) ? array_map(array( 'Uiform_Form_Helper', 'sanitizeRecursive' ), $_POST['data2']) : array(); + + /* update all fields by form */ + $where = array( 'form_fmb_id' => $form_id ); + $data = array( 'fmf_status_qu' => 0 ); + + $this->db->set($data); + $this->db->where($where); + $this->db->update($this->model_fields->table); + // update the fields to show in list + if ( ! empty($data_fields)) { + foreach ( $data_fields as $value) { + $where = array( + 'form_fmb_id' => $form_id, + 'fmf_uniqueid' => $value, + ); + $data = array( 'fmf_status_qu' => 1 ); + + $this->db->set($data); + $this->db->where($where); + $this->db->update($this->model_fields->table); + } + } + + // update order for all fields according to form + if ( ! empty($data_fields2)) { + foreach ( $data_fields2 as $value) { + $where = array( + 'form_fmb_id' => $form_id, + 'fmf_uniqueid' => $value['name'], + ); + $data = array( 'order_rec' => $value['value'] ); + + $this->db->set($data); + $this->db->where($where); + $this->db->update($this->model_fields->table); + } + } + + die(); + } + + /** + * Records::ajax_load_customreport() + * + * @return + */ + public function ajax_load_customreport() + { + + $form_id = ( isset($_POST['form_id']) && $_POST['form_id'] ) ? Uiform_Form_Helper::sanitizeInput($_POST['form_id']) : 0; + + $all_fields = $this->model_record->getAllFieldsForReport($form_id); + + $data = array(); + $data['list_fields'] = $all_fields; + + $textfield_tmp = $this->load->view('formbuilder/records/custom_report_getAllfields', $data, true); + echo $textfield_tmp; + die(); + } + + /** + * Records::view_charts() + * + * @return + */ + public function view_charts() + { + + $data = array(); + $data['list_forms'] = $this->model_forms->getListForms(); + $this->template->loadPartial('layout', 'records/view_charts', $data); + } + + /** + * Records::custom_report() + * + * @return + */ + public function custom_report() + { + + $data = array(); + $data['list_forms'] = $this->model_forms->getListForms(); + + $this->template->loadPartial('layout', 'records/custom_report', $data); + } + + /** + * Records::ajax_load_record_byform() + * + * @return + */ + public function ajax_load_record_byform() + { + + $form_id = ( isset($_POST['form_id']) && $_POST['form_id'] ) ? Uiform_Form_Helper::sanitizeInput($_POST['form_id']) : 0; + // records to show + $name_fields = $this->model_record->getNameFieldEnabledByForm($form_id, true); + $data = array(); + $data['datatable_head'] = $name_fields; + // process record + $flag_types = array(); + foreach ( $name_fields as $key => $value) { + $flag_types[ $key ] = $value->fby_id; + } + + $pre_datatable_body = $this->model_record->getDetailRecord($name_fields, $form_id); + $new_record = array(); + foreach ( $pre_datatable_body as $key => $value) { + $count1 = 0; + foreach ( $value as $key2 => $value2) { + $new_record[ $key ][ $key2 ] = $value2; + + if ( isset($flag_types[ $count1 ])) { + switch ( intval($flag_types[ $count1 ])) { + case 12: + case 13: + // checking if image exists + if ( !empty($value_new) && @is_array(getimagesize($value2))) { + $new_record[ $key ][ $key2 ] = ''; + } + break; + default: + break; + } + } + $count1++; + } + } + + $data['datatable_body'] = $new_record; + $textfield_tmp = $this->load->view('formbuilder/records/list_records_getdatatable', $data, true); + echo $textfield_tmp; + die(); + } + + /** + * Records::ajax_delete_record() + * + * @return + */ + public function ajax_delete_record() + { + + $rec_id = ( isset($_POST['rec_id']) && $_POST['rec_id'] ) ? Uiform_Form_Helper::sanitizeInput($_POST['rec_id']) : 0; + $is_trash = ( isset($_POST['is_trash']) && $_POST['is_trash'] ) ? Uiform_Form_Helper::sanitizeInput($_POST['is_trash']) : 0; + + if ( intval($is_trash) === 0) { + $where = array( + 'fbh_id' => $rec_id, + ); + $data = array( + 'flag_status' => 0, + ); + + $this->db->set($data); + $this->db->where($where); + $this->db->update($this->model_record->table); + } else { + $this->delete_form_process($rec_id); + } + } + + /** + * Records::info_records_byforms() + * + * @return + */ + public function info_records_byforms() + { + + $data = array(); + $data['list_forms'] = $this->model_forms->getListForms(); + $this->template->loadPartial('layout', 'records/list_records_byforms', $data); + } + + /** + * Records::info_record() + * + * @return + */ + public function info_record() + { + + $id_rec = ( isset($_GET['id_rec']) && $_GET['id_rec'] ) ? Uiform_Form_Helper::sanitizeInput($_GET['id_rec']) : 0; + $name_fields = $this->model_record->getNameField($id_rec); + $form_rec_data = $this->model_record->getFormDataById($id_rec); + $form_data = json_decode($form_rec_data->fmb_data, true); + + $form_data_currency = ( isset($form_data['main']['price_currency']) ) ? $form_data['main']['price_currency'] : ''; + + // price numeric format + $format_price_conf = array(); + $format_price_conf['price_format_st'] = ( isset($form_data['main']['price_format_st']) ) ? $form_data['main']['price_format_st'] : '0'; + $format_price_conf['price_sep_decimal'] = ( isset($form_data['main']['price_sep_decimal']) ) ? $form_data['main']['price_sep_decimal'] : '.'; + $format_price_conf['price_sep_thousand'] = ( isset($form_data['main']['price_sep_thousand']) ) ? $form_data['main']['price_sep_thousand'] : ','; + $format_price_conf['price_sep_precision'] = ( isset($form_data['main']['price_sep_precision']) ) ? $form_data['main']['price_sep_precision'] : '2'; + + // calculation + $form_calculation = ( isset($form_data['calculation']['enable_st']) ) ? $form_data['calculation']['enable_st'] : '0'; + + $name_fields_check = array(); + $fields_type_check = array(); + foreach ( $name_fields as $value) { + $name_fields_check[ $value->fmf_uniqueid ] = $value->fieldname; + $fields_type_check[ $value->fmf_uniqueid ] = $value->type_fby_id; + } + + $data_record = $this->model_record->getRecordById($id_rec); + $record_user = json_decode($data_record->fbh_data, true); + $new_record_user = array(); + foreach ( $record_user as $key => $value) { + if ( isset($name_fields_check[ $key ])) { + $key_det = $name_fields_check[ $key ]; + } + if ( isset($fields_type_check[ $key ])) { + switch ( intval($value['type'])) { + case 9: + case 11: + $new_record_user[] = array( + 'field' => $key_det, + 'type' => $fields_type_check[ $key ], + 'value' => $value['input_value'], + ); + break; + case 12: + case 13: + $value_new = $value['input']; + // checking if image exists + if ( !empty($value_new) && @is_array(getimagesize($value_new))) { + $value_new = ''; + } + + $new_record_user[] = array( + 'field' => $value['label'], + 'type' => $fields_type_check[ $key ], + 'value' => $value_new, + ); + break; + default: + $new_record_user[] = array( + 'field' => $key_det, + 'type' => $fields_type_check[ $key ], + 'value' => $value['input'], + ); + break; + } + } + } + $data = array(); + $data2 = array(); + + // processs tax + $form_data_tax_st = ( isset($form_data['main']['price_tax_st']) ) ? $form_data['main']['price_tax_st'] : '0'; + $form_data_tax_val = ( isset($form_data['main']['price_tax_val']) ) ? $form_data['main']['price_tax_val'] : ''; + + $tmp_amount_total = floatval($form_rec_data->fbh_total_amount); + if ( isset($form_data_tax_st) && intval($form_data_tax_st) === 1) { + $tmp_tax = ( floatval($form_data_tax_val) / 100 ); + $tmp_sub_total = ( $tmp_amount_total ) * ( 100 / ( 100 + ( 100 * $tmp_tax ) ) ); + $data['form_subtotal_amount'] = $tmp_sub_total; + $data['form_tax'] = $tmp_amount_total - $tmp_sub_total; + } + + $data['form_total_amount'] = $tmp_amount_total; + $data['form_currency'] = $form_data_currency; + $data['form_calculation'] = $form_calculation; + $data['record_id'] = $id_rec; + $data['record_info'] = $data2['record_info'] = $new_record_user; + + $data['price_format'] = $format_price_conf; + + $data['info_date'] = $data2['info_date'] = date('F j, Y, g:i a', strtotime($data_record->created_date)); + $data['info_ip'] = $data2['info_ip'] = $data_record->created_ip; + + require_once APPPATH . '/helpers/Browser.php'; + $browser = new Browser($data_record->fbh_user_agent); + $data['info_useragent'] = $data2['info_useragent'] = $browser->getBrowser() . __(' , version : ', 'frocket_front') . $browser->getVersion() . __(' , platform : ', 'frocket_front') . $browser->getPlatform(); + $data['info_referer'] = $data2['info_referer'] = $data_record->fbh_referer; + $data['form_name'] = $data2['form_name'] = $form_rec_data->fmb_name; + $data2['info_labels'] = array( + 'title' => __('Entry information', 'FRocket_admin'), + 'info_submitted' => __('Submitted form data', 'FRocket_admin'), + 'info_additional' => __('Additional info', 'FRocket_admin'), + 'info_date' => __('Date', 'FRocket_admin'), + 'info_ip' => __('IP', 'FRocket_admin'), + 'info_pc' => __('Client PC info', 'FRocket_admin'), + 'info_frmurl' => __('Form URL', 'FRocket_admin'), + 'form_name' => __('Form name', 'FRocket_admin'), + ); + + $data['info_export'] = Uiform_Form_Helper::base64url_encode(json_encode($data2)); + $data['record_info_str'] = $this->get_info_records($new_record_user, $data); + + $data['fmb_rec_tpl_st'] = $form_rec_data->fmb_rec_tpl_st; + if ( intval($data['fmb_rec_tpl_st']) === 1) { + $data['base_url'] = base_url() . '/'; + $data['form_id'] = $form_rec_data->form_fmb_id; + $data['url_form'] = site_url() . 'formbuilder/frontend/pdf_show_record/?uifm_mode=pdf&is_html=1&id=' . $id_rec; + $data['custom_template'] = $this->load->view('formbuilder/frontend/form_summary_custom', $data, true); + } else { + $data['custom_template'] = ''; + } + + $this->template->loadPartial('layout', 'records/info_record', $data); + } + + public function get_info_records($new_record_user, $data) + { + /* + echo json_encode($new_record_user); + die();*/ + $tmp_form_info = '
      '; + foreach ( $new_record_user as $value) { + $tmp_form_info .= '
    • '; + + if ( isset($value['value']) && is_array($value['value'])) { + $tmp_form_info .= '' . $value['field'] . ''; + + switch ( intval($value['type'])) { + case 8: + case 9: + case 10: + case 11: + $tmp_form_info .= '
        '; + foreach ( $value['value'] as $key3 => $value3) { + $tmp_form_info .= '
      • '; + + if ( isset($value3['label'])) { + $tmp_form_info .= $value3['label']; + } + if ( isset($value3['qty']) && floatval($value3['qty']) > 0) { + $tmp_form_info .= ' - ' . __('qty', 'frocket_front') . ': ' . $value3['qty'] . ' ' . __('Units', 'FRocket_admin'); + } + if ( ( isset($value3['amount']) && floatval($value3['amount']) > 0 ) && intval($data['form_calculation']) === 0) { + $tmp_form_info .= ' - ' . __('Amount', 'frocket_front') . ': ' . Uiform_Form_Helper::cformat_numeric($data['price_format'], $value3['amount']) . ' ' . $data['form_currency']; + } + + $tmp_form_info .= '
      • '; + } + $tmp_form_info .= '
      '; + break; + case 16: + // slider + case 18: + // spinner + $tmp_form_info .= '
        '; + $tmp_form_info .= '
      • '; + + if ( intval($data['form_calculation']) === 1) { + // with math calculation + $tmp_form_info .= Uiform_Form_Helper::cformat_numeric($data['price_format'], $value['value']['value']); + } else { + // withoout math calc + $tmp_form_info .= ' cost : ' . $value['value']['cost'] . ' - qty: ' . $value['value']['qty'] . ' - ' . __('Amount', 'FRocket_admin') . ' : ' . Uiform_Form_Helper::cformat_numeric($data['price_format'], $value['value']['amount']) . ' ' . $data['form_currency'] . ' ' . $data['form_currency']; + } + + $tmp_form_info .= '
      • '; + $tmp_form_info .= '
      '; + break; + default: + if ( isset($value['value']) && is_array($value['value'])) { + $tmp_form_info .= '
        '; + foreach ( $value['value'] as $key3 => $value3) { + $tmp_form_info .= '
      • '; + if ( ( isset($value['value']['input_cost_amt']) && floatval($value['value']['input_cost_amt']) > 0 ) && intval($data['form_calculation']) === 1) { + $tmp_form_info .= $value['value']['input_cost_amt']; + } else { + if ( isset($value3['label'])) { + $tmp_form_info .= $value3['label']; + } + if ( isset($value3['qty']) && floatval($value3['qty']) > 0) { + $tmp_form_info .= ' - ' . __('qty', 'frocket_front') . ': ' . $value3['qty'] . ' ' . __('Units', 'FRocket_admin'); + } + if ( ( isset($value3['amount']) && floatval($value3['amount']) > 0 ) && intval($data['form_calculation']) === 0) { + $tmp_form_info .= ' - ' . __('Amount', 'frocket_front') . ': ' . Uiform_Form_Helper::cformat_numeric($data['price_format'], $value3['amount']) . ' ' . $data['form_currency']; + } + } + $tmp_form_info .= '
      • '; + } + $tmp_form_info .= '
      '; + } else { + $tmp_form_info .= ' : ' . $value['value']; + } + + break; + } + } else { + switch ( intval($value['type'])) { + case 8: + case 9: + case 10: + case 11: + $tmp_form_info .= '' . $value['field'] . ''; + if ( ! empty($value['value'])) { + $tmp_form_info .= ' : ' . $value['value']; + } + + break; + default: + $tmp_form_info .= '' . $value['field'] . ''; + if ( ! empty($value['value'])) { + $tmp_form_info .= ' : ' . $value['value']; + } + break; + } + } + $tmp_form_info .= '
    • '; + } + $tmp_form_info .= '
    '; + + return $tmp_form_info; + } + + + /** + * list records + * + * @return void + */ + public function list_records() + { + $filter_data = get_option('zgfm_listrecords_searchfilter', true); + $data2 = array(); + if ( empty($filter_data) && !isset($filter_data['orderby'])) { + $data2['per_page'] = intval($this->per_page); + $data2['orderby'] = 'asc'; + } else { + $data2['per_page'] = intval($filter_data['per_page']??''); + $data2['orderby'] = $filter_data['orderby']??''; + } + + $offset = ( isset($_GET['offset']) ) ? Uiform_Form_Helper::sanitizeInput($_GET['offset']) : 0; + $data2['offset'] = $offset; + + $form_data = $this->model_record->ListTotals(); + $data2['title'] = __('Records list', 'FRocket_admin'); + $data2['all'] = $form_data->r_all; + $data2['trash'] = $form_data->r_trash; + $data2['header_buttons'] = List_data::get()->list_detail_record_headerbuttons(); + $data2['script_trigger'] = 'zgfm_back_general.recordslist_search_process();'; + $data2['subcurrent'] = 1; + $data2['subsubsub'] = List_data::get()->subsubsub_records($data2); + $data2['is_trash'] = 0; + + $content = List_data::get()->show_list($data2); + //echo self::loadPartial2( 'layout.php', $content); + echo $this->template->loadPartial2('layout', $content); + } + + /** + * list trash records + * + * @return void + */ + public function list_trash_records() + { + $filter_data = get_option('zgfm_listrecords_searchfilter', true); + $data2 = array(); + if ( empty($filter_data) && !isset($filter_data['orderby'])) { + $data2['per_page'] = intval($this->per_page); + $data2['orderby'] = 'asc'; + } else { + $data2['per_page'] = intval($filter_data['per_page']??''); + $data2['orderby'] = $filter_data['orderby']??''; + } + + $offset = ( isset($_GET['offset']) ) ? Uiform_Form_Helper::sanitizeInput($_GET['offset']) : 0; + $data2['offset'] = $offset; + + $form_data = $this->model_record->ListTotals(); + $data2['title'] = __('Records in trash', 'FRocket_admin'); + $data2['all'] = $form_data->r_all; + $data2['trash'] = $form_data->r_trash; + $data2['header_buttons'] = List_data::get()->list_detail_trashrecord_headerbuttons(); + $data2['script_trigger'] = 'zgfm_back_general.recordslist_search_process();'; + $data2['subcurrent'] = 2; + $data2['subsubsub'] = List_data::get()->subsubsub_records($data2); + $data2['is_trash'] = 1; + + $content = List_data::get()->show_list($data2); + //echo self::loadPartial2( 'layout.php', $content); + echo $this->template->loadPartial2('layout', $content); + } + + /** + * List trash forms + * + * @return void + */ + public function ajax_recordlist_sendfilter() + { + + $data_filter = ( isset($_POST['data_filter']) && $_POST['data_filter'] ) ? $_POST['data_filter'] : ''; + + $opt_save = ( isset($_POST['opt_save']) && $_POST['opt_save'] ) ? Uiform_Form_Helper::sanitizeInput($_POST['opt_save']) : 0; + $opt_offset = ( isset($_POST['opt_offset']) && $_POST['opt_offset'] ) ? Uiform_Form_Helper::sanitizeInput($_POST['opt_offset']) : 0; + $is_trash = ( isset($_POST['op_is_trash']) && $_POST['op_is_trash'] ) ? Uiform_Form_Helper::sanitizeInput($_POST['op_is_trash']) : 0; + + parse_str($data_filter, $data_filter_arr); + + $per_page = $data_filter_arr['zgfm-listform-pref-perpage']; + $orderby = $data_filter_arr['zgfm-listform-pref-orderby']; + + $data = array(); + $data['per_page'] = $per_page; + $data['orderby'] = $orderby; + $data['is_trash'] = $is_trash; + + update_option('zgfm_listrecords_searchfilter', $data); + + $data['segment'] = 0; + $data['offset'] = $opt_offset; + + $result = $this->ajax_recordslist_refresh($data); + + $json = array(); + $json['content'] = $result; + + header('Content-Type: application/json'); + echo json_encode($json); + die(); + } + + /** + * get forms in trash + * + * @param [type] $data + * @return void + */ + public function ajax_recordslist_refresh($data) + { + + $this->load->library('pagination'); + + $offset = $data['offset']; + + // list all forms + $config = array(); + + $tmp = $this->model_record->ListTotals(); + if ( intval($data['is_trash']) === 0) { + $config['base_url'] = site_url() . 'formbuilder/forms/list_records'; + $config['total_rows'] = $tmp->r_all; + } else { + $config['base_url'] = site_url() . 'formbuilder/forms/list_trash_records'; + $config['total_rows'] = $tmp->r_trash; + } + + $config['per_page'] = $data['per_page']; + $config['first_link'] = 'First'; + $config['last_link'] = 'Last'; + $config['full_tag_open'] = '
      '; + $config['full_tag_close'] = '
    '; + $config['first_tag_open'] = '
  • '; + $config['first_tag_close'] = '
  • '; + $config['last_tag_open'] = '
  • '; + $config['last_tag_close'] = '
  • '; + $config['cur_tag_open'] = '
  • '; + $config['cur_tag_close'] = '
  • '; + $config['next_tag_open'] = '
  • '; + $config['next_tag_close'] = '
  • '; + $config['prev_tag_open'] = '
  • '; + $config['prev_tag_close'] = '
  • '; + $config['num_tag_open'] = '
  • '; + $config['num_tag_close'] = '
  • '; + $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; + + $data2 = array(); + $data2['per_page'] = $data['per_page']; + $data2['segment'] = $offset; + $data2['orderby'] = $data['orderby']; + $data2['is_trash'] = $data['is_trash']; + + if ( intval($data2['is_trash']) === 0) { + $data2['query'] = $this->model_record->getListAllRecordsFiltered($data2); + } else { + $data2['query'] = $this->model_record->getListTrashRecordsFiltered($data2); + } + + $data2['pagination'] = $this->pagination->create_links(); + $data2['obj_list_data'] = List_data::get(); + + if ( intval($data2['is_trash']) === 0) { + return List_data::get()->list_detail_records($data2); + } else { + return List_data::get()->list_detail_trashrecords($data2); + } + } + + public function action_pdf_show_invoice() + { + modules::run('formbuilder/frontend/pdf_show_invoice'); + } + + public function action_pdf_show_record() + { + modules::run('formbuilder/frontend/pdf_show_record'); + } + + public function action_csv_show_allrecords() + { + + $form_id = isset($_GET['id']) ? Uiform_Form_Helper::sanitizeInput($_GET['id']) : ''; + + echo modules::run('formbuilder/records/csv_showAllForms', $form_id); + + die(); + } + + public function csv_showAllForms($form_id) + { + + require_once APPPATH . '/helpers/exporttocsv.php'; + if ( false) { + $name_fields = $this->model_record->getNameFieldEnabledByForm($form_id, true); + } else { + $name_fields = $this->model_record->getNameFieldEnabledByForm($form_id, false); + } + + $tmp_data = array(); + $tmp_data['datatable_head'] = $name_fields; + $tmp_data['datatable_body'] = $this->model_record->getDetailRecord($name_fields, $form_id); + + $data = array(); + $tmp_ar = array(); + foreach ( $tmp_data['datatable_head'] as $value) { + $tmp_ar[] = $value->fieldname; + } + $data[] = $tmp_ar; + + foreach ( $tmp_data['datatable_body'] as $key => $value) { + $tmp_ar = array(); + foreach ( $value as $key => $value2) { + //if ( $key != 'fbh_id' ) { + $tmp_ar[] = $value2; + //} + } + $data[] = $tmp_ar; + } + + $tsv = new ExportDataCSV('browser'); + $tsv->filename = 'csv_' . $form_id . '.csv'; + + $tsv->initialize(); + foreach ( $data as $row) { + $tsv->addRow($row); + } + $tsv->finalize(); + } } diff --git a/application/modules/formbuilder/controllers/settings.php b/application/modules/formbuilder/controllers/settings.php index 98509462..74e4ef3d 100755 --- a/application/modules/formbuilder/controllers/settings.php +++ b/application/modules/formbuilder/controllers/settings.php @@ -11,10 +11,10 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: intranet.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if (!defined('BASEPATH')) { + exit('No direct script access allowed'); } /** @@ -26,431 +26,485 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version Release: 1.00 - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -class Settings extends BackendController { - /** - * max number of forms in order show by pagination - * - * @var int - */ - - const VERSION = '0.1'; - - /** - * name of form estimator table - * - * @var string - */ - protected $modules; - - /** - * Settings::__construct() - * - * @return - */ - function __construct() { - parent::__construct(); - $this->load->language_alt( model_settings::$db_config['language'] ); - $this->template->set( 'controller', $this ); - $this->load->model( 'model_settings' ); - - } - - public function ajax_blocked_getmessage() { - // check_ajax_referer( 'zgfm_ajax_nonce', 'zgfm_security' ); - $message = ( isset( $_POST['message'] ) && $_POST['message'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['message'] ) : ''; - - $data = array(); - $data['message'] = $message; - $json = array(); - $json['msg'] = $this->load->view( 'formbuilder/settings/blocked_getmessage', $data, true ); - header( 'Content-Type: application/json' ); - echo json_encode( $json ); - die(); - } - - /** - * Settings::backup_upload_file() - * - * @return - */ - public function backup_upload_file() { - - require_once APPPATH . 'helpers/uiform_backup.php'; - $dbBackup = new Uiform_Backup(); - $dbBackup->uploadBackupFile(); - } - - /** - * Settings::ajax_backup_create() - * - * @return - */ - public function ajax_backup_create() { - - // memory limite undefined - set_time_limit( 0 ); - ini_set( 'memory_limit', '-1' ); - - $json = array(); - - $name_bkp = ( isset( $_POST['uifm_frm_namebackup'] ) && $_POST['uifm_frm_namebackup'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['uifm_frm_namebackup'] ) : ''; - - require_once APPPATH . 'helpers/uiform_backup.php'; - $dbBackup = new Uiform_Backup(); - - $this->load->helper( 'file' ); - $CI = & get_instance(); - $CI->load->database(); - - $tables = array(); - $tables[] = 'cepf_cest_uiform_fields'; - $tables[] = 'cepf_cest_uiform_fields_type'; - $tables[] = 'cepf_cest_uiform_form'; - $tables[] = 'cepf_cest_uiform_form_log'; - $tables[] = 'cepf_cest_uiform_form_records'; - $tables[] = 'cepf_cest_uiform_pay_gateways'; - $tables[] = 'cepf_cest_uiform_pay_logs'; - $tables[] = 'cepf_cest_uiform_pay_records'; - $tables[] = 'cepf_cest_uiform_settings'; - $tables[] = 'cepf_cest_uiform_user'; - $tables[] = 'cepf_cest_uiform_visitor'; - $tables[] = 'cepf_cest_uiform_visitor_error'; - $tables[] = 'cepf_cest_uiform_options'; - - $name_bkp = ( ! empty( $name_bkp ) ) ? $name_bkp : date( 'd-M-Y_H-i-s' ); - - $this->load->helper( 'file' ); - - $CI = & get_instance(); - $CI->load->database(); - - $db_name = $name_bkp . '.sql'; - $save = FCPATH . '/backups/' . $db_name; - - if ( extension_loaded( 'mysql' ) && (string) $CI->db->dbdriver === 'mysql' ) { - $this->load->dbutil(); - require_once APPPATH . 'helpers/uiform_backup.php'; - - $dbBackup = new Uiform_Backup(); - $backup = $dbBackup->backup_database_mysql( $CI->db->hostname, $CI->db->username, $CI->db->password, $CI->db->database, $tables ); - - write_file( $save, $backup ); - - } else { - - require_once APPPATH . '/../libs/backup/MySQLDump.php'; - $dump = new MySQLDump( new mysqli( $CI->db->hostname, $CI->db->username, $CI->db->password, $CI->db->database ), 'utf8', $tables ); - $dump->save( $save ); - } - - header( 'Content-Type: application/json' ); - echo json_encode( $json ); - die(); - } - - - /** - * Settings::ajax_backup_restorefile() - * - * @return - */ - public function ajax_backup_restorefile() { - $json = array(); - $uifm_frm_resfile = ( isset( $_POST['uifm_frm_resfile'] ) && $_POST['uifm_frm_resfile'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['uifm_frm_resfile'] ) : ''; - require_once APPPATH . 'helpers/uiform_backup.php'; - $dbBackup = new Uiform_Backup(); - $CI = & get_instance(); - $CI->load->database(); - if ( extension_loaded( 'mysql' ) && (string) $CI->db->dbdriver === 'mysql' ) { - - $dbBackup->restoreBackup( $uifm_frm_resfile, $CI->db->database, $CI->db->username, $CI->db->password, $CI->db->hostname ); - } else { - - $dir = FCPATH . '/backups/'; - $file = $dir . $uifm_frm_resfile; // sql data file - $args = file_get_contents( $file ); // get contents - $dbBackup->mysqli_import_sql( $file, $uifm_frm_resfile, $args, $CI->db->hostname, $CI->db->username, $CI->db->password, $CI->db->database ); // execute - } - - header( 'Content-Type: application/json' ); - echo json_encode( $json ); - die(); - } - - /** - * Settings::ajax_backup_deletefile() - * - * @return - */ - public function ajax_backup_deletefile() { - $json = array(); - $uifm_frm_delfile = ( isset( $_POST['uifm_frm_delfile'] ) && $_POST['uifm_frm_delfile'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['uifm_frm_delfile'] ) : ''; - $dir = FCPATH . '/backups/'; - @unlink( $dir . $uifm_frm_delfile ); - header( 'Content-Type: application/json' ); - echo json_encode( $json ); - die(); - } - - /** - * Settings::ajax_save_options() - * - * @return - */ - 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, - ); - - $opt_fields_fastload = ( isset( $_POST['uifm_frm_fields_fastload'] ) && $_POST['uifm_frm_fields_fastload'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['uifm_frm_fields_fastload'] ) : 0; - if ( (string) $opt_fields_fastload === 'on' ) { - update_option( 'zgfm_fields_fastload', 1 ); - } else { - update_option( 'zgfm_fields_fastload', 0 ); - } - - $this->db->set( $data ); - $this->db->where( $where ); - $this->db->update( $this->model_settings->table ); - - $result = $this->db->affected_rows(); - $json = array(); - if ( $result > 0 ) { - $json['success'] = 1; - } else { - $json['success'] = 0; - } - - header( 'Content-Type: application/json' ); - echo json_encode( $json ); - die(); - } - - /** - * Settings::view_settings() - * - * @return - */ - public function view_settings() { - $data = array(); - $query = $this->model_settings->getOptions(); - - $pofilespath = FCPATH . 'i18n/languages/backend/'; - $data['language'] = $query->language; - $data['lang_list'] = Uiform_Form_Helper::getLanguageList( $pofilespath ); - - $data['fields_fastload'] = get_option( 'zgfm_fields_fastload', 0 ); - - $this->template->loadPartial( 'layout', 'settings/view_settings', $data ); - } - - /** - * Settings::backup_settings() - * - * @return - */ - public function backup_settings() { - if ( isset( $_POST['_uifm_bkp_submit_file'] ) && intval( $_POST['_uifm_bkp_submit_file'] ) === 1 ) { - $this->backup_upload_file(); - } - - $data = array(); - $dir = FCPATH . '/backups/'; - $data_files = array(); - if ( is_dir( $dir ) ) { - $getDir = dir( $dir ); - while ( false !== ( $file = $getDir->read() ) ) { - $ext = pathinfo( $file, PATHINFO_EXTENSION ); - if ( $file != '.' && $file != '..' && $ext == 'sql' ) { - $temp_file = array(); - $temp_file['file_name'] = $file; - $temp_file['file_url'] = base_url() . '/backups/' . $file; - $temp_file['file_date'] = date( 'F d Y H:i:s.', filemtime( $dir . $file ) ); - $temp_file['file_size'] = Uiform_Form_Helper::human_filesize( filesize( $dir . $file ) ); - $data_files[] = $temp_file; - } - } - } - $data['files'] = $data_files; - $this->template->loadPartial( 'layout', 'settings/backup_settings', $data ); - } - - public function system_check() { - $data = array(); - - $all_tables_tmp = $this->model_settings->getAllDatabases(); - - $uiform_tbs = array(); - $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_form'; - $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_form_records'; - $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_fields'; - $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_fields_type'; - $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_settings'; - $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_pay_gateways'; - $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_pay_records'; - $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_pay_logs'; - $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_visitor'; - $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_visitor_error'; - $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_form_log'; - $uiform_tbs[] = $this->db->dbprefix . 'cest_addon'; - $uiform_tbs[] = $this->db->dbprefix . 'cest_addon_details'; - $uiform_tbs[] = $this->db->dbprefix . 'cest_addon_details_log'; - - // tables - $name_tb = array(); - $name_tb[ $this->db->dbprefix . 'cest_uiform_form' ] = 'Forms'; - $name_tb[ $this->db->dbprefix . 'cest_uiform_form_records' ] = 'Records'; - $name_tb[ $this->db->dbprefix . 'cest_uiform_fields' ] = 'Fields'; - $name_tb[ $this->db->dbprefix . 'cest_uiform_fields_type' ] = 'Types'; - $name_tb[ $this->db->dbprefix . 'cest_uiform_settings' ] = 'Settings'; - $name_tb[ $this->db->dbprefix . 'cest_uiform_pay_gateways' ] = 'Gateways'; - $name_tb[ $this->db->dbprefix . 'cest_uiform_pay_records' ] = 'G records'; - $name_tb[ $this->db->dbprefix . 'cest_uiform_pay_logs' ] = 'G logs'; - $name_tb[ $this->db->dbprefix . 'cest_uiform_visitor' ] = 'G visitor'; - $name_tb[ $this->db->dbprefix . 'cest_uiform_visitor_error' ] = 'V. Error'; - $name_tb[ $this->db->dbprefix . 'cest_uiform_form_log' ] = 'Form Log'; - $name_tb[ $this->db->dbprefix . 'cest_addon' ] = 'Addon'; - $name_tb[ $this->db->dbprefix . 'cest_addon_details' ] = 'Addon detail'; - $name_tb[ $this->db->dbprefix . 'cest_addon_details_log' ] = 'Addon log'; - - $uiform_tbs_tmp = array(); - $count_err = 0; - foreach ( $uiform_tbs as $value ) { - $tmp_tb = array(); - $tmp_tb['table'] = $name_tb[ $value ]; - $tmp_tb['message'] = ''; - // check database - ( in_array( $value, $all_tables_tmp ) ) ? $tmp_tb['status'] = 1 : $tmp_tb['status'] = 0; - - // check columns - $tmp_check = $this->check_Database_Column( $value ); - - if ( ! empty( $tmp_check['err_msgs'] ) ) { - $tmp_tb['status'] = 0; - $tmp_tb['message'] = '
    • ' . implode( '
    • ', $tmp_check['err_msgs'] ) . '
    '; - } - - if ( $tmp_tb['status'] === 0 ) { - $count_err++; - } - - $uiform_tbs_tmp[] = $tmp_tb; - } - - $data['database_success'] = 1; - if ( $count_err > 0 ) { - $data['database_success'] = 0; - } - - $data['database_int'] = $uiform_tbs_tmp; - - $this->template->loadPartial( 'layout', 'formbuilder/settings/system_check', $data ); - } - - public function system_gendb_column() { - - $uiform_tbs = array(); - $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_form'; - $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_form_records'; - $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_fields'; - $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_fields_type'; - $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_settings'; - $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_pay_gateways'; - $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_pay_records'; - $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_pay_logs'; - $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_visitor'; - $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_visitor_error'; - $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_form_log'; - $uiform_tbs[] = $this->db->dbprefix . 'cest_addon'; - $uiform_tbs[] = $this->db->dbprefix . 'cest_addon_details'; - $uiform_tbs[] = $this->db->dbprefix . 'cest_addon_details_log'; - - $tmp_all_db = array(); - - foreach ( $uiform_tbs as $value ) { - - $row = $this->model_settings->getColsFromTable( $value ); - - // tables - $resultado = array(); - - $tmp_arr = array(); - if ( ! empty( $row ) ) { - foreach ( $row as $key => $value2 ) { - $tmp_arr[ $value2->Field ] = array( 'type' => $value2->Type ); - } - } - - $tmp_all_db[ str_replace( $this->db->dbprefix, '', $value ) ] = $tmp_arr; - } - - // Encode the array into a JSON string. - $encodedString = json_encode( $tmp_all_db ); - - // Save the JSON string to a text file. - file_put_contents( APPPATH . 'modules/formbuilder/views/settings/system_db.txt', $encodedString ); - - die( 'database structure generated' ); - } - - public function check_Database_Column( $table ) { - - // Retrieve the data from our text file. - $fileContents = file_get_contents( APPPATH . 'modules/formbuilder/views/settings/system_db.txt' ); - - // Convert the JSON string back into an array. - $tmp_all_db = json_decode( $fileContents, true ); - - // $row= $wpdb->get_results("SHOW COLUMNS FROM " . $table ); - $row = $this->model_settings->getColsFromTable( $table ); - // tables - $resultado = array(); - - $err_msgs = array(); - - $table = str_replace( $this->db->dbprefix, '', $table ); - - $col_st = false; - if ( ! empty( $row ) ) { - $tmp_arr = array(); - if ( isset( $tmp_all_db[ $table ] ) ) { - foreach ( $row as $key => $value ) { - if ( isset( $tmp_all_db[ $table ][ $value->Field ] ) ) { - - /* - if (($key2 = array_search($value->Field, $tmp_all_db[$table])) !== false) { - unset($tmp_all_db[$table][$key2]); - }*/ - - if ( strval( $value->Type ) === strval( $tmp_all_db[ $table ][ $value->Field ]['type'] ) ) { - - } else { - $err_msgs[] = $value->Field . ' field - ' . $tmp_all_db[ $table ][ $value->Field ]['type'] . ' type is missing'; - } - } else { - $err_msgs[] = $value->Field . ' field is missing'; - } - } - } else { - $err_msgs[] = $table . ' table is missing'; - } - } - - /* - foreach ($tmp_all_db[$table] as $value) { - $err_msgs[]=$value.' column is missing'; - }*/ - - $resultado['err_msgs'] = $err_msgs; - - return $resultado; - - } - - +class Settings extends BackendController +{ + /** + * max number of forms in order show by pagination + * + * @var int + */ + + const VERSION = '0.1'; + public $CI; + /** + * name of form estimator table + * + * @var string + */ + protected $modules; + + /** + * Settings::__construct() + * + * @return + */ + public function __construct() + { + parent::__construct(); + $this->load->language_alt(model_settings::$db_config['language']); + $this->template->set('controller', $this); + $this->load->model('model_settings'); + $this->CI = &get_instance(); + } + + public function system_update_table() + { + + $jsonFile = APPPATH . 'modules/formbuilder/views/settings/system_db.json'; + $prefix = 'cepf_'; + // Read the JSON file content + $jsonContent = file_get_contents($jsonFile); + + // Parse JSON content into an array + $dataArray = json_decode($jsonContent, true); + + // Check if JSON decoding was successful + if ($dataArray === null && json_last_error() !== JSON_ERROR_NONE) { + die('Error decoding JSON: ' . json_last_error_msg()); + } + + foreach ($dataArray as $key => $value) { + $tableName = $key; + + $query2 = $this->CI->db->query("SHOW TABLES LIKE '{$prefix}{$tableName}'"); + $row = (array) $query2->row(); + $tableExists = (string) reset($row) === "{$prefix}{$tableName}"; + + if (!$tableExists) { + continue; + } + + foreach ($value as $fieldToUpdate => $fieldData) { + + // Replace 'your_field_type' with the new type for the field + $newFieldType = $fieldData['type'] ?? ''; + $newFieldNull = $fieldData['null'] == 'YES' ? '' : 'NOT NULL'; + $newFieldDefault = $fieldData['Default'] ? 'DEFAULT ' . $fieldData['Default'] : ''; + if (in_array($fieldData['Extra'], ['DEFAULT_GENERATED on update CURRENT_TIMESTAMP','DEFAULT_GENERATED'])) { + $fieldData['Extra'] = ''; + } + $newFieldExtra = $fieldData['Extra'] ?? ''; + + $sql = "ALTER TABLE {$prefix}{$tableName} MODIFY COLUMN {$fieldToUpdate} {$newFieldType} {$newFieldNull} {$newFieldDefault} {$newFieldExtra}"; + + $this->CI->db->query($sql); + } + } + $json = []; + header('Content-Type: application/json'); + echo json_encode($json); + die(); + } + + public function ajax_blocked_getmessage() + { + // check_ajax_referer( 'zgfm_ajax_nonce', 'zgfm_security' ); + $message = (isset($_POST['message']) && $_POST['message']) ? Uiform_Form_Helper::sanitizeInput($_POST['message']) : ''; + + $data = array(); + $data['message'] = $message; + $json = array(); + $json['msg'] = $this->load->view('formbuilder/settings/blocked_getmessage', $data, true); + header('Content-Type: application/json'); + echo json_encode($json); + die(); + } + + /** + * Settings::backup_upload_file() + * + * @return + */ + public function backup_upload_file() + { + + require_once APPPATH . 'helpers/uiform_backup.php'; + $dbBackup = new Uiform_Backup(); + $dbBackup->uploadBackupFile(); + } + + /** + * Settings::ajax_backup_create() + * + * @return + */ + public function ajax_backup_create() + { + + // memory limite undefined + set_time_limit(0); + ini_set('memory_limit', '-1'); + + $json = array(); + + $name_bkp = (isset($_POST['uifm_frm_namebackup']) && $_POST['uifm_frm_namebackup']) ? Uiform_Form_Helper::sanitizeInput($_POST['uifm_frm_namebackup']) : ''; + + require_once APPPATH . 'helpers/uiform_backup.php'; + $dbBackup = new Uiform_Backup(); + + $this->load->helper('file'); + $CI = &get_instance(); + $CI->load->database(); + + $tables = array(); + $tables[] = 'cepf_cest_uiform_fields'; + $tables[] = 'cepf_cest_uiform_fields_type'; + $tables[] = 'cepf_cest_uiform_form'; + $tables[] = 'cepf_cest_uiform_form_log'; + $tables[] = 'cepf_cest_uiform_form_records'; + $tables[] = 'cepf_cest_uiform_pay_gateways'; + $tables[] = 'cepf_cest_uiform_pay_logs'; + $tables[] = 'cepf_cest_uiform_pay_records'; + $tables[] = 'cepf_cest_uiform_settings'; + $tables[] = 'cepf_cest_uiform_user'; + $tables[] = 'cepf_cest_uiform_visitor'; + $tables[] = 'cepf_cest_uiform_visitor_error'; + $tables[] = 'cepf_cest_uiform_options'; + + $name_bkp = (!empty($name_bkp)) ? $name_bkp : date('d-M-Y_H-i-s'); + + $this->load->helper('file'); + + $CI = &get_instance(); + $CI->load->database(); + + $db_name = $name_bkp . '.sql'; + $save = FCPATH . '/backups/' . $db_name; + + if (extension_loaded('mysql') && (string) $CI->db->dbdriver === 'mysql') { + $this->load->dbutil(); + require_once APPPATH . 'helpers/uiform_backup.php'; + + $dbBackup = new Uiform_Backup(); + $backup = $dbBackup->backup_database_mysql($CI->db->hostname, $CI->db->username, $CI->db->password, $CI->db->database, $tables); + + write_file($save, $backup); + } else { + require_once APPPATH . '/../libs/backup/MySQLDump.php'; + $dump = new MySQLDump(new mysqli($CI->db->hostname, $CI->db->username, $CI->db->password, $CI->db->database), 'utf8', $tables); + $dump->save($save); + } + + header('Content-Type: application/json'); + echo json_encode($json); + die(); + } + + + /** + * Settings::ajax_backup_restorefile() + * + * @return + */ + public function ajax_backup_restorefile() + { + $json = array(); + $uifm_frm_resfile = (isset($_POST['uifm_frm_resfile']) && $_POST['uifm_frm_resfile']) ? Uiform_Form_Helper::sanitizeInput($_POST['uifm_frm_resfile']) : ''; + require_once APPPATH . 'helpers/uiform_backup.php'; + $dbBackup = new Uiform_Backup(); + $CI = &get_instance(); + $CI->load->database(); + if (extension_loaded('mysql') && (string) $CI->db->dbdriver === 'mysql') { + $dbBackup->restoreBackup($uifm_frm_resfile, $CI->db->database, $CI->db->username, $CI->db->password, $CI->db->hostname); + } else { + $dir = FCPATH . '/backups/'; + $file = $dir . $uifm_frm_resfile; // sql data file + $args = file_get_contents($file); // get contents + $dbBackup->mysqli_import_sql($file, $uifm_frm_resfile, $args, $CI->db->hostname, $CI->db->username, $CI->db->password, $CI->db->database); // execute + } + + header('Content-Type: application/json'); + echo json_encode($json); + die(); + } + + /** + * Settings::ajax_backup_deletefile() + * + * @return + */ + public function ajax_backup_deletefile() + { + $json = array(); + $uifm_frm_delfile = (isset($_POST['uifm_frm_delfile']) && $_POST['uifm_frm_delfile']) ? Uiform_Form_Helper::sanitizeInput($_POST['uifm_frm_delfile']) : ''; + $dir = FCPATH . '/backups/'; + @unlink($dir . $uifm_frm_delfile); + header('Content-Type: application/json'); + echo json_encode($json); + die(); + } + + /** + * Settings::ajax_save_options() + * + * @return + */ + 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, + ); + + $opt_fields_fastload = (isset($_POST['uifm_frm_fields_fastload']) && $_POST['uifm_frm_fields_fastload']) ? Uiform_Form_Helper::sanitizeInput($_POST['uifm_frm_fields_fastload']) : 0; + if ((string) $opt_fields_fastload === 'on') { + update_option('zgfm_fields_fastload', 1); + } else { + update_option('zgfm_fields_fastload', 0); + } + + $this->db->set($data); + $this->db->where($where); + $this->db->update($this->model_settings->table); + + $result = $this->db->affected_rows(); + $json = array(); + if ($result > 0) { + $json['success'] = 1; + } else { + $json['success'] = 0; + } + + header('Content-Type: application/json'); + echo json_encode($json); + die(); + } + + /** + * Settings::view_settings() + * + * @return + */ + public function view_settings() + { + $data = array(); + $query = $this->model_settings->getOptions(); + + $pofilespath = FCPATH . 'i18n/languages/backend/'; + $data['language'] = $query->language; + $data['lang_list'] = Uiform_Form_Helper::getLanguageList($pofilespath); + + $data['fields_fastload'] = get_option('zgfm_fields_fastload', 0); + + $this->template->loadPartial('layout', 'settings/view_settings', $data); + } + + /** + * Settings::backup_settings() + * + * @return + */ + public function backup_settings() + { + if (isset($_POST['_uifm_bkp_submit_file']) && intval($_POST['_uifm_bkp_submit_file']) === 1) { + $this->backup_upload_file(); + } + + $data = array(); + $dir = FCPATH . '/backups/'; + $data_files = array(); + if (is_dir($dir)) { + $getDir = dir($dir); + while (false !== ($file = $getDir->read())) { + $ext = pathinfo($file, PATHINFO_EXTENSION); + if ($file != '.' && $file != '..' && $ext == 'sql') { + $temp_file = array(); + $temp_file['file_name'] = $file; + $temp_file['file_url'] = base_url() . '/backups/' . $file; + $temp_file['file_date'] = date('F d Y H:i:s.', filemtime($dir . $file)); + $temp_file['file_size'] = Uiform_Form_Helper::human_filesize(filesize($dir . $file)); + $data_files[] = $temp_file; + } + } + } + $data['files'] = $data_files; + $this->template->loadPartial('layout', 'settings/backup_settings', $data); + } + + public function system_check() + { + $data = array(); + + $all_tables_tmp = $this->model_settings->getAllDatabases(); + + $uiform_tbs = array(); + $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_form'; + $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_form_records'; + $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_fields'; + $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_fields_type'; + $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_settings'; + $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_pay_gateways'; + $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_pay_records'; + $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_pay_logs'; + $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_visitor'; + $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_visitor_error'; + $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_form_log'; + $uiform_tbs[] = $this->db->dbprefix . 'cest_addon'; + $uiform_tbs[] = $this->db->dbprefix . 'cest_addon_details'; + $uiform_tbs[] = $this->db->dbprefix . 'cest_addon_details_log'; + + // tables + $name_tb = array(); + $name_tb[$this->db->dbprefix . 'cest_uiform_form'] = 'Forms'; + $name_tb[$this->db->dbprefix . 'cest_uiform_form_records'] = 'Records'; + $name_tb[$this->db->dbprefix . 'cest_uiform_fields'] = 'Fields'; + $name_tb[$this->db->dbprefix . 'cest_uiform_fields_type'] = 'Types'; + $name_tb[$this->db->dbprefix . 'cest_uiform_settings'] = 'Settings'; + $name_tb[$this->db->dbprefix . 'cest_uiform_pay_gateways'] = 'Gateways'; + $name_tb[$this->db->dbprefix . 'cest_uiform_pay_records'] = 'G records'; + $name_tb[$this->db->dbprefix . 'cest_uiform_pay_logs'] = 'G logs'; + $name_tb[$this->db->dbprefix . 'cest_uiform_visitor'] = 'G visitor'; + $name_tb[$this->db->dbprefix . 'cest_uiform_visitor_error'] = 'V. Error'; + $name_tb[$this->db->dbprefix . 'cest_uiform_form_log'] = 'Form Log'; + $name_tb[$this->db->dbprefix . 'cest_addon'] = 'Addon'; + $name_tb[$this->db->dbprefix . 'cest_addon_details'] = 'Addon detail'; + $name_tb[$this->db->dbprefix . 'cest_addon_details_log'] = 'Addon log'; + + $uiform_tbs_tmp = array(); + $count_err = 0; + foreach ($uiform_tbs as $value) { + $tmp_tb = array(); + $tmp_tb['table'] = $name_tb[$value]; + $tmp_tb['message'] = ''; + // check database + (in_array($value, $all_tables_tmp)) ? $tmp_tb['status'] = 1 : $tmp_tb['status'] = 0; + + // check columns + $tmp_check = $this->check_Database_Column($value); + + if (!empty($tmp_check['err_msgs'])) { + $tmp_tb['status'] = 0; + $tmp_tb['message'] = '
    • ' . implode('
    • ', $tmp_check['err_msgs']) . '
    '; + } + + if ($tmp_tb['status'] === 0) { + $count_err++; + } + + $uiform_tbs_tmp[] = $tmp_tb; + } + + $data['database_success'] = 1; + if ($count_err > 0) { + $data['database_success'] = 0; + } + + $data['database_int'] = $uiform_tbs_tmp; + + $this->template->loadPartial('layout', 'formbuilder/settings/system_check', $data); + } + + public function system_gendb_column() + { + + $uiform_tbs = array(); + $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_form'; + $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_form_records'; + $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_fields'; + $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_fields_type'; + $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_settings'; + $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_pay_gateways'; + $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_pay_records'; + $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_pay_logs'; + $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_visitor'; + $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_visitor_error'; + $uiform_tbs[] = $this->db->dbprefix . 'cest_uiform_form_log'; + $uiform_tbs[] = $this->db->dbprefix . 'cest_addon'; + $uiform_tbs[] = $this->db->dbprefix . 'cest_addon_details'; + $uiform_tbs[] = $this->db->dbprefix . 'cest_addon_details_log'; + + $tmp_all_db = array(); + + foreach ($uiform_tbs as $value) { + $row = $this->model_settings->getColsFromTable($value); + + $tmp_arr = array(); + if (!empty($row)) { + foreach ($row as $key => $value2) { + $tmp_arr[$value2->Field] = [ + 'type' => $value2->Type, + 'null' => $value2->Null, + 'Default' => $value2->Default, + 'Extra' => $value2->Extra, + ]; + } + } + + $tmp_all_db[str_replace($this->db->dbprefix, '', $value)] = $tmp_arr; + } + + // Encode the array into a JSON string. + $encodedString = json_encode($tmp_all_db); + + // Save the JSON string to a text file. + file_put_contents(APPPATH . 'modules/formbuilder/views/settings/system_db.json', $encodedString); + + die('database structure generated'); + } + + public function check_Database_Column($table) + { + + // Retrieve the data from our text file. + $fileContents = file_get_contents(APPPATH . 'modules/formbuilder/views/settings/system_db.json'); + + // Convert the JSON string back into an array. + $tmp_all_db = json_decode($fileContents, true); + + // $row= $wpdb->get_results("SHOW COLUMNS FROM " . $table ); + $row = $this->model_settings->getColsFromTable($table); + // tables + $resultado = array(); + + $err_msgs = array(); + + $table = str_replace($this->db->dbprefix, '', $table); + + $col_st = false; + if (!empty($row)) { + $tmp_arr = array(); + if (isset($tmp_all_db[$table])) { + foreach ($row as $key => $value) { + if (isset($tmp_all_db[$table][$value->Field])) { + /* + if (($key2 = array_search($value->Field, $tmp_all_db[$table])) !== false) { + unset($tmp_all_db[$table][$key2]); + }*/ + + if (strval($value->Type) === strval($tmp_all_db[$table][$value->Field]['type'])) { + } else { + $err_msgs[] = $value->Field . ' field - ' . $tmp_all_db[$table][$value->Field]['type'] . ' type is missing'; + } + } else { + $err_msgs[] = $value->Field . ' field is missing'; + } + } + } else { + $err_msgs[] = $table . ' table is missing'; + } + } + + /* + foreach ($tmp_all_db[$table] as $value) { + $err_msgs[]=$value.' column is missing'; + }*/ + + $resultado['err_msgs'] = $err_msgs; + + return $resultado; + } } diff --git a/application/modules/formbuilder/controllers/uifmrecaptcha.php b/application/modules/formbuilder/controllers/uifmrecaptcha.php index efbe321d..f67581f5 100755 --- a/application/modules/formbuilder/controllers/uifmrecaptcha.php +++ b/application/modules/formbuilder/controllers/uifmrecaptcha.php @@ -11,10 +11,10 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: intranet.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-form-builder.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-form-builder/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } /** @@ -26,79 +26,78 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version Release: 1.00 - * @link https://php-form-builder.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-form-builder/ */ -class uifmrecaptcha extends FrontendController { - /** - * max number of forms in order show by pagination - * - * @var int - */ - - const VERSION = '0.1'; - - - - /** - * Recaptcha::__construct() - * - * @return - */ - function __construct() { - parent::__construct(); - $this->load->language_alt( model_settings::$db_config['language'] ); - $this->template->set( 'controller', $this ); - $this->load->model( 'model_fields' ); - } - - /** - * Recaptcha::front_verify_recaptcha() - * - * @return - */ - public function front_verify_recaptcha() { - - require_once FCPATH . 'libs/recaptcha2/autoload.php'; - - $uid_field = ( isset( $_POST['rockfm-uid-field'] ) ) ? Uiform_Form_Helper::sanitizeInput( $_POST['rockfm-uid-field'] ) : ''; - $form_id = ( isset( $_POST['form_id'] ) ) ? Uiform_Form_Helper::sanitizeInput( $_POST['form_id'] ) : 0; - $fmf_json = $this->model_fields->getDataByUniqueId( $uid_field, $form_id ); - $secret = ''; - $success = false; - if ( ! empty( $fmf_json ) ) { - $fmf_data = json_decode( $fmf_json->fmf_data, true ); - - $secret = ( isset( $fmf_data['input5']['g_key_secret'] ) ) ? $fmf_data['input5']['g_key_secret'] : ''; - $siteKey = ( isset( $fmf_data['input5']['g_key_public'] ) ) ? $fmf_data['input5']['g_key_public'] : ''; - - if ( $siteKey === '' || $secret === '' ) { - - } elseif ( isset( $_POST['rockfm-code-recaptcha'] ) ) { - - if ( is_callable( 'curl_init' ) ) { - $recaptcha = new \ReCaptcha\ReCaptcha( $secret, new \ReCaptcha\RequestMethod\CurlPost() ); - } else { - $recaptcha = new \ReCaptcha\ReCaptcha( $secret ); - } - - $resp = $recaptcha->verify( $_POST['rockfm-code-recaptcha'], $_SERVER['REMOTE_ADDR'] ); - - if ( $resp->isSuccess() ) : - $success = true; - else : - $success = false; - endif; - } else { - - } - } - - $json = array(); - $json['success'] = $success; - // return data to ajax callback - header( 'Content-Type: application/json' ); - echo json_encode( $json ); - die(); - } - +class uifmrecaptcha extends FrontendController +{ + /** + * max number of forms in order show by pagination + * + * @var int + */ + + const VERSION = '0.1'; + + + + /** + * Recaptcha::__construct() + * + * @return + */ + public function __construct() + { + parent::__construct(); + $this->load->language_alt(model_settings::$db_config['language']); + $this->template->set('controller', $this); + $this->load->model('model_fields'); + } + + /** + * Recaptcha::front_verify_recaptcha() + * + * @return + */ + public function front_verify_recaptcha() + { + + require_once FCPATH . 'libs/recaptcha2/autoload.php'; + + $uid_field = ( isset($_POST['rockfm-uid-field']) ) ? Uiform_Form_Helper::sanitizeInput($_POST['rockfm-uid-field']) : ''; + $form_id = ( isset($_POST['form_id']) ) ? Uiform_Form_Helper::sanitizeInput($_POST['form_id']) : 0; + $fmf_json = $this->model_fields->getDataByUniqueId($uid_field, $form_id); + $secret = ''; + $success = false; + if ( ! empty($fmf_json)) { + $fmf_data = json_decode($fmf_json->fmf_data, true); + + $secret = ( isset($fmf_data['input5']['g_key_secret']) ) ? $fmf_data['input5']['g_key_secret'] : ''; + $siteKey = ( isset($fmf_data['input5']['g_key_public']) ) ? $fmf_data['input5']['g_key_public'] : ''; + + if ( $siteKey === '' || $secret === '') { + } elseif ( isset($_POST['rockfm-code-recaptcha'])) { + if ( is_callable('curl_init')) { + $recaptcha = new \ReCaptcha\ReCaptcha($secret, new \ReCaptcha\RequestMethod\CurlPost()); + } else { + $recaptcha = new \ReCaptcha\ReCaptcha($secret); + } + + $resp = $recaptcha->verify($_POST['rockfm-code-recaptcha'], $_SERVER['REMOTE_ADDR']); + + if ( $resp->isSuccess()) : + $success = true; + else : + $success = false; + endif; + } else { + } + } + + $json = array(); + $json['success'] = $success; + // return data to ajax callback + header('Content-Type: application/json'); + echo json_encode($json); + die(); + } } diff --git a/application/modules/formbuilder/models/model_fields.php b/application/modules/formbuilder/models/model_fields.php index 41c62b74..953737f9 100755 --- a/application/modules/formbuilder/models/model_fields.php +++ b/application/modules/formbuilder/models/model_fields.php @@ -10,10 +10,10 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: model_forms.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } /** * Form estimator model @@ -24,75 +24,81 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version Release: 1.00 - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -class model_fields extends CI_Model { +class model_fields extends CI_Model +{ - public $table = ''; - public $tbform = ''; - public $tbformtype = ''; + public $table = ''; + public $tbform = ''; + public $tbformtype = ''; - /** - * model_forms::__construct() - * - * @return - */ - function __construct() { - parent::__construct(); + /** + * model_forms::__construct() + * + * @return + */ + public function __construct() + { + parent::__construct(); - $this->table = $this->db->dbprefix . 'cest_uiform_fields'; - $this->tbform = $this->db->dbprefix . 'cest_uiform_form'; - $this->tbformtype = $this->db->dbprefix . 'cest_uiform_fields_type'; - } + $this->table = $this->db->dbprefix . 'cest_uiform_fields'; + $this->tbform = $this->db->dbprefix . 'cest_uiform_form'; + $this->tbformtype = $this->db->dbprefix . 'cest_uiform_fields_type'; + } - function queryGetListFieldsEnabled( $form_id ) { - $query = sprintf( - 'select f.fmf_uniqueid,f.order_rec + public function queryGetListFieldsEnabled($form_id) + { + $query = sprintf( + 'select f.fmf_uniqueid,f.order_rec from %s f where f.fmf_status_qu=1 and f.form_fmb_id=%s', - $this->table, - (int) $form_id - ); + $this->table, + (int) $form_id + ); - $query2 = $this->db->query( $query ); - return $query2->result(); - } + $query2 = $this->db->query($query); + return $query2->result(); + } - function queryGetListFieldsById( $form_id ) { - $query = sprintf( - 'select f.fmf_uniqueid,f.order_rec + public function queryGetListFieldsById($form_id) + { + $query = sprintf( + 'select f.fmf_uniqueid,f.order_rec from %s f where f.form_fmb_id=%s', - $this->table, - (int) $form_id - ); + $this->table, + (int) $form_id + ); - $query2 = $this->db->query( $query ); - return $query2->result(); - } + $query2 = $this->db->query($query); + return $query2->result(); + } - function queryGetQtyFieldsEnabled( $form_id ) { - $query = sprintf( - 'select COUNT(*) as count + public function queryGetQtyFieldsEnabled($form_id) + { + $query = sprintf( + 'select COUNT(*) as count from %s f where f.fmf_status_qu=1 and f.form_fmb_id=%s', - $this->table, - (int) $form_id - ); - $query2 = $this->db->query( $query ); + $this->table, + (int) $form_id + ); + $query2 = $this->db->query($query); - $row = $query2->row(); - if ( intval( $row->count ) > 0 ) { - return 1; - } else { - return 0; - } - } + $row = $query2->row(); + if ( intval($row->count) > 0) { + return 1; + } else { + return 0; + } + } - function getFieldNameByUniqueId( $uid, $form_id ) { - $query = sprintf( - " + public function getFieldNameByUniqueId($uid, $form_id) + { + $query = sprintf( + " select f.type_fby_id as type,f.fmf_data as data,coalesce(NULLIF(f.fmf_fieldname,''),CONCAT(t.fby_name,f.fmf_id)) as fieldname from %s f join %s t on f.type_fby_id=t.fby_id @@ -100,34 +106,33 @@ function getFieldNameByUniqueId( $uid, $form_id ) { where frm.fmb_id=%s and f.fmf_uniqueid='%s'", - $this->table, - $this->tbformtype, - $this->tbform, - (int) $form_id, - $uid - ); + $this->table, + $this->tbformtype, + $this->tbform, + (int) $form_id, + $uid + ); - $query2 = $this->db->query( $query ); - return $query2->row(); - } + $query2 = $this->db->query($query); + return $query2->row(); + } - function getDataByUniqueId( $uid, $form_id ) { - $query = sprintf( - ' + public function getDataByUniqueId($uid, $form_id) + { + $query = sprintf( + ' select fmf_data from %s f join %s frm where frm.fmb_id=%s and f.fmf_uniqueid="%s" ', - $this->table, - $this->tbform, - (int) $form_id, - $uid - ); - $query2 = $this->db->query( $query ); - return $query2->row(); - } - + $this->table, + $this->tbform, + (int) $form_id, + $uid + ); + $query2 = $this->db->query($query); + return $query2->row(); + } } - diff --git a/application/modules/formbuilder/models/model_form_log.php b/application/modules/formbuilder/models/model_form_log.php index 822b51b1..421a0960 100755 --- a/application/modules/formbuilder/models/model_form_log.php +++ b/application/modules/formbuilder/models/model_form_log.php @@ -10,10 +10,10 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: model_forms.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-form-builder.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-form-builder/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } /** * Form estimator model @@ -24,76 +24,81 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version Release: 1.00 - * @link https://php-form-builder.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-form-builder/ */ -class model_form_log extends CI_Model { - - - public $table = ''; - - /** - * model_forms::__construct() - * - * @return - */ - function __construct() { - parent::__construct(); - $this->table = $this->db->dbprefix . 'cest_uiform_form_log'; - } - - /** - * model_forms::getListForms() - * List form estimator - * - * @param int $per_page max number of form estimators - * @param int $segment Number of pagination - * - * @return array - */ - - - function getListForms( $per_page = '', $segment = '' ) { - $query = sprintf( - ' +class model_form_log extends CI_Model +{ + + + public $table = ''; + + /** + * model_forms::__construct() + * + * @return + */ + public function __construct() + { + parent::__construct(); + $this->table = $this->db->dbprefix . 'cest_uiform_form_log'; + } + + /** + * model_forms::getListForms() + * List form estimator + * + * @param int $per_page max number of form estimators + * @param int $segment Number of pagination + * + * @return array + */ + + + public function getListForms($per_page = '', $segment = '') + { + $query = sprintf( + ' select uf.log_id,uf.log_frm_data,uf.log_frm_name,uf.log_frm_html,uf.log_frm_html_backend,uf.log_frm_html_css,uf.log_frm_id,uf.log_frm_hash,uf.flag_status,uf.created_date,uf.updated_date from %s uf where uf.flag_status>0 ORDER BY uf.updated_date desc ', - $this->table - ); - - if ( $per_page != '' || $segment != '' ) { - $segment = ( ! empty( $segment ) ) ? $segment : 0; - $query .= sprintf( ' limit %s,%s', $segment, $per_page ); - } - - $query2 = $this->db->query( $query ); - return $query2->result(); - } - - function getLogById( $id ) { - $query = sprintf( - ' + $this->table + ); + + if ( $per_page != '' || $segment != '') { + $segment = ( ! empty($segment) ) ? $segment : 0; + $query .= sprintf(' limit %s,%s', $segment, $per_page); + } + + $query2 = $this->db->query($query); + return $query2->result(); + } + + public function getLogById($id) + { + $query = sprintf( + ' select uf.log_id,uf.log_frm_data,uf.log_frm_name,uf.log_frm_html,uf.log_frm_html_backend,uf.log_frm_html_css,uf.log_frm_id,uf.log_frm_hash,uf.flag_status,uf.created_date,uf.updated_date from %s uf where uf.flag_status=1 and uf.log_id=%s ', - $this->table, - $id - ); + $this->table, + $id + ); - $query2 = $this->db->query( $query ); + $query2 = $this->db->query($query); - return $query2->row(); - } + return $query2->row(); + } - function getAvailableLogById( $id ) { - $query = sprintf( - ' + public function getAvailableLogById($id) + { + $query = sprintf( + ' select uf.log_id,uf.log_frm_data,uf.log_frm_name,uf.log_frm_html,uf.log_frm_html_backend,uf.log_frm_html_css,uf.log_frm_id,uf.log_frm_hash,uf.flag_status,uf.created_date,uf.updated_date from %s uf where @@ -101,70 +106,70 @@ function getAvailableLogById( $id ) { uf.log_frm_id=%s ORDER BY uf.updated_date desc ', - $this->table, - $id - ); - - $query2 = $this->db->query( $query ); - return $query2->result(); - } - - function getLastLogById( $id ) { - $query = sprintf( - ' + $this->table, + $id + ); + + $query2 = $this->db->query($query); + return $query2->result(); + } + + public function getLastLogById($id) + { + $query = sprintf( + ' select uf.log_id,uf.log_frm_data,uf.log_frm_name,uf.log_frm_html,uf.log_frm_html_backend,uf.log_frm_html_css,uf.log_frm_id,uf.log_frm_hash,uf.flag_status,uf.created_date,uf.updated_date from %s uf where uf.log_frm_id=%s ORDER BY uf.log_id desc LIMIT 11 ', - $this->table, - $id - ); - - $query2 = $this->db->query( $query ); - return $query2->row(); - } - - function getOldLogById( $id ) { - $query = sprintf( - ' + $this->table, + $id + ); + + $query2 = $this->db->query($query); + return $query2->row(); + } + + public function getOldLogById($id) + { + $query = sprintf( + ' select uf.log_id,uf.log_frm_data,uf.log_frm_name,uf.log_frm_html,uf.log_frm_html_backend,uf.log_frm_html_css,uf.log_frm_id,uf.log_frm_hash,uf.flag_status,uf.created_date,uf.updated_date from %s uf where uf.log_frm_id=%s ORDER BY uf.log_id asc LIMIT 1 ', - $this->table, - $id - ); - - $query2 = $this->db->query( $query ); - return $query2->row(); - } - - function CountLogsByFormId( $id ) { - $query = sprintf( - ' + $this->table, + $id + ); + + $query2 = $this->db->query($query); + return $query2->row(); + } + + public function CountLogsByFormId($id) + { + $query = sprintf( + ' select COUNT(*) AS counted from %s c where c.flag_status>0 and c.log_frm_id=%s ORDER BY c.updated_date desc ', - $this->table, - $id - ); - $query2 = $this->db->query( $query ); - - $row = $query2->row(); - if ( isset( $row->counted ) ) { - return $row->counted; - } else { - return 0; - } - } - - + $this->table, + $id + ); + $query2 = $this->db->query($query); + + $row = $query2->row(); + if ( isset($row->counted)) { + return $row->counted; + } else { + return 0; + } + } } - diff --git a/application/modules/formbuilder/models/model_forms.php b/application/modules/formbuilder/models/model_forms.php index a658201f..44c7a962 100755 --- a/application/modules/formbuilder/models/model_forms.php +++ b/application/modules/formbuilder/models/model_forms.php @@ -10,10 +10,10 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: model_forms.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } /** * Form estimator model @@ -24,168 +24,176 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version Release: 1.00 - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -class model_forms extends CI_Model { - - - public $table = ''; - - /** - * model_forms::__construct() - * - * @return - */ - function __construct() { - parent::__construct(); - $this->table = $this->db->dbprefix . 'cest_uiform_form'; - } - - /** - * formsmodel::getListForms() - * List form estimator - * - * @param int $per_page max number of form estimators - * @param int $segment Number of pagination - * - * @return array - */ - function getListFormsFiltered( $data ) { - - $per_page = $data['per_page']; - $segment = $data['segment']; - $search_txt = $data['search_txt']; - $orderby = $data['orderby']; - - $query = sprintf( - ' +class model_forms extends CI_Model +{ + + + public $table = ''; + + /** + * model_forms::__construct() + * + * @return + */ + public function __construct() + { + parent::__construct(); + $this->table = $this->db->dbprefix . 'cest_uiform_form'; + } + + /** + * formsmodel::getListForms() + * List form estimator + * + * @param int $per_page max number of form estimators + * @param int $segment Number of pagination + * + * @return array + */ + public function getListFormsFiltered($data) + { + + $per_page = $data['per_page']; + $segment = $data['segment']; + $search_txt = $data['search_txt']; + $orderby = $data['orderby']; + + $query = sprintf( + ' select uf.fmb_id,uf.fmb_data,uf.fmb_name,uf.fmb_html,uf.fmb_html_backend,uf.flag_status,uf.created_date,uf.updated_date, uf.fmb_html_css,uf.fmb_default,uf.fmb_skin_status,uf.fmb_skin_data,uf.fmb_skin_type,uf.fmb_data2 from %s uf where uf.flag_status>0 ', - $this->table - ); - - if ( ! empty( $search_txt ) ) { - $query .= " and uf.fmb_name like '%" . $search_txt . "%' "; - } - - $orderby = ( $orderby === 'asc' ) ? 'asc' : 'desc'; - - $query .= sprintf( ' ORDER BY uf.updated_date %s ', $orderby ); - - if ( $per_page != '' || $segment != '' ) { - $segment = ( ! empty( $segment ) ) ? $segment : 0; - $query .= sprintf( ' limit %s,%s', (int) $segment, (int) $per_page ); - } - - $query2 = $this->db->query( $query ); - return $query2->result(); - } - - /** - * formsmodel::getListForms() - * List form estimator - * - * @param int $per_page max number of form estimators - * @param int $segment Number of pagination - * - * @return array - */ - function getListTrashFormsFiltered( $data ) { - - $per_page = $data['per_page']; - $segment = $data['segment']; - $orderby = $data['orderby']; - - $query = sprintf( - ' + $this->table + ); + + if ( ! empty($search_txt)) { + $query .= " and uf.fmb_name like '%" . $search_txt . "%' "; + } + + $orderby = ( $orderby === 'asc' ) ? 'asc' : 'desc'; + + $query .= sprintf(' ORDER BY uf.updated_date %s ', $orderby); + + if ( $per_page != '' || $segment != '') { + $segment = ( ! empty($segment) ) ? $segment : 0; + $query .= sprintf(' limit %s,%s', (int) $segment, (int) $per_page); + } + + $query2 = $this->db->query($query); + return $query2->result(); + } + + /** + * formsmodel::getListForms() + * List form estimator + * + * @param int $per_page max number of form estimators + * @param int $segment Number of pagination + * + * @return array + */ + public function getListTrashFormsFiltered($data) + { + + $per_page = $data['per_page']; + $segment = $data['segment']; + $orderby = $data['orderby']; + + $query = sprintf( + ' select uf.fmb_id,uf.fmb_data,uf.fmb_name,uf.fmb_html,uf.fmb_html_backend,uf.flag_status,uf.created_date,uf.updated_date, uf.fmb_html_css,uf.fmb_default,uf.fmb_skin_status,uf.fmb_skin_data,uf.fmb_skin_type,uf.fmb_data2 from %s uf where uf.flag_status=0 ', - $this->table - ); - - $orderby = ( $orderby === 'asc' ) ? 'asc' : 'desc'; - - $query .= sprintf( ' ORDER BY uf.updated_date %s ', $orderby ); - - if ( $per_page != '' || $segment != '' ) { - $segment = ( ! empty( $segment ) ) ? $segment : 0; - $query .= sprintf( ' limit %s,%s', (int) $segment, (int) $per_page ); - } - - $query2 = $this->db->query( $query ); - return $query2->result(); - } - - /** - * formsmodel::getListForms() - * List form estimator - * - * @param int $per_page max number of form estimators - * @param int $segment Number of pagination - * - * @return array - */ - function getListForms( $per_page = '', $segment = '' ) { - $query = sprintf( - ' + $this->table + ); + + $orderby = ( $orderby === 'asc' ) ? 'asc' : 'desc'; + + $query .= sprintf(' ORDER BY uf.updated_date %s ', $orderby); + + if ( $per_page != '' || $segment != '') { + $segment = ( ! empty($segment) ) ? $segment : 0; + $query .= sprintf(' limit %s,%s', (int) $segment, (int) $per_page); + } + + $query2 = $this->db->query($query); + return $query2->result(); + } + + /** + * formsmodel::getListForms() + * List form estimator + * + * @param int $per_page max number of form estimators + * @param int $segment Number of pagination + * + * @return array + */ + public function getListForms($per_page = '', $segment = '') + { + $query = sprintf( + ' select uf.fmb_id,uf.fmb_data,uf.fmb_name,uf.fmb_html,uf.fmb_html_backend,uf.flag_status,uf.created_date,uf.updated_date, uf.fmb_html_css,uf.fmb_default,uf.fmb_skin_status,uf.fmb_skin_data,uf.fmb_skin_type,uf.fmb_data2 from %s uf where uf.flag_status>0 ORDER BY uf.updated_date desc ', - $this->table - ); - - if ( $per_page != '' || $segment != '' ) { - $segment = ( ! empty( $segment ) ) ? $segment : 0; - $query .= sprintf( ' limit %s,%s', (int) $segment, (int) $per_page ); - } - - $query2 = $this->db->query( $query ); - return $query2->result(); - } - - function getFormById( $id ) { - $query = sprintf( - ' + $this->table + ); + + if ( $per_page != '' || $segment != '') { + $segment = ( ! empty($segment) ) ? $segment : 0; + $query .= sprintf(' limit %s,%s', (int) $segment, (int) $per_page); + } + + $query2 = $this->db->query($query); + return $query2->result(); + } + + public function getFormById($id) + { + $query = sprintf( + ' select uf.fmb_id,uf.fmb_data,uf.fmb_name,uf.fmb_html,uf.fmb_html_backend,uf.flag_status,uf.created_date,uf.updated_date, uf.fmb_html_css,uf.fmb_default,uf.fmb_skin_status,uf.fmb_skin_data,uf.fmb_skin_type,uf.fmb_data2,fmb_rec_tpl_html,fmb_inv_tpl_html,fmb_rec_tpl_st,fmb_inv_tpl_st from %s uf where uf.fmb_id=%s ', - $this->table, - (int) $id - ); + $this->table, + (int) $id + ); - $query2 = $this->db->query( $query ); + $query2 = $this->db->query($query); - return $query2->row(); - } + return $query2->row(); + } - function getTitleFormById( $id ) { - $query = sprintf( - ' + public function getTitleFormById($id) + { + $query = sprintf( + ' select uf.fmb_name from %s uf where uf.fmb_id=%s ', - $this->table, - (int) $id - ); + $this->table, + (int) $id + ); - $query2 = $this->db->query( $query ); + $query2 = $this->db->query($query); - return $query2->row(); - } + return $query2->row(); + } - function getAvailableFormById( $id ) { - $query = sprintf( - ' + public function getAvailableFormById($id) + { + $query = sprintf( + ' select uf.fmb_id,uf.fmb_data,uf.fmb_name,uf.fmb_html,uf.fmb_html_backend,uf.flag_status,uf.created_date,uf.updated_date, uf.fmb_html_css,uf.fmb_default,uf.fmb_skin_status,uf.fmb_skin_data,uf.fmb_skin_type,uf.fmb_data2 from %s uf @@ -193,98 +201,99 @@ function getAvailableFormById( $id ) { uf.flag_status=1 and uf.fmb_id=%s ', - $this->table, - (int) $id - ); - - $query2 = $this->db->query( $query ); - return $query2->row(); - } - - function getFormById_2( $id ) { - $query = sprintf( - ' + $this->table, + (int) $id + ); + + $query2 = $this->db->query($query); + return $query2->row(); + } + + public function getFormById_2($id) + { + $query = sprintf( + ' select uf.fmb_data2,uf.fmb_name from %s uf where uf.fmb_id=%s ', - $this->table, - (int) $id - ); - - $query2 = $this->db->query( $query ); - return $query2->row(); - } - - function CountForms() { - $query = sprintf( - ' + $this->table, + (int) $id + ); + + $query2 = $this->db->query($query); + return $query2->row(); + } + + public function CountForms() + { + $query = sprintf( + ' select COUNT(*) AS counted from %s c where c.flag_status=1 ORDER BY c.updated_date desc ', - $this->table - ); - $query2 = $this->db->query( $query ); - - $row = $query2->row(); - if ( isset( $row->counted ) ) { - return $row->counted; - } else { - return 0; - } - } - - /** - * model_forms::getFormDefault() - * Get form estimator by default - * - * @return array - */ - function getFormDefault() { - $this->db->select( 'c.*' ); - $this->db->from( '{PRE}cest_uiform_form c' ); - $this->db->where( array( 'c.fmb_default' => 1 ) ); - $this->db->limit( 1 ); - return $this->db->get()->row(); - } - - - /** - * model_forms::getListActiveForms() - * Get list active form estimators - * - * @return array - */ - function getListActiveForms() { - $this->db->select( 'c.fmb_id, c.fmb_name, c.updated_date, c.created_date, c.flag_status' ); - $this->db->from( '{PRE}cest_uiform_form c' ); - $this->db->where( array( 'c.flag_status' => 1 ) ); - $this->db->order_by( 'c.updated_date desc' ); - return $this->db->get()->result(); - } - - - /* - * list all and trash forms - */ - function ListTotals() { - $query = sprintf( - ' + $this->table + ); + $query2 = $this->db->query($query); + + $row = $query2->row(); + if ( isset($row->counted)) { + return $row->counted; + } else { + return 0; + } + } + + /** + * model_forms::getFormDefault() + * Get form estimator by default + * + * @return array + */ + public function getFormDefault() + { + $this->db->select('c.*'); + $this->db->from('{PRE}cest_uiform_form c'); + $this->db->where(array( 'c.fmb_default' => 1 )); + $this->db->limit(1); + return $this->db->get()->row(); + } + + + /** + * model_forms::getListActiveForms() + * Get list active form estimators + * + * @return array + */ + public function getListActiveForms() + { + $this->db->select('c.fmb_id, c.fmb_name, c.updated_date, c.created_date, c.flag_status'); + $this->db->from('{PRE}cest_uiform_form c'); + $this->db->where(array( 'c.flag_status' => 1 )); + $this->db->order_by('c.updated_date desc'); + return $this->db->get()->result(); + } + + + /* + * list all and trash forms + */ + public function ListTotals() + { + $query = sprintf( + ' SELECT SUM(CASE WHEN flag_status = 0 THEN 1 ELSE 0 END) AS r_trash, SUM(CASE WHEN flag_status != 0 THEN 1 ELSE 0 END) AS r_all FROM %s ', - $this->table - ); - - $query2 = $this->db->query( $query ); - return $query2->row(); - - } - + $this->table + ); + $query2 = $this->db->query($query); + return $query2->row(); + } } - diff --git a/application/modules/formbuilder/models/model_record.php b/application/modules/formbuilder/models/model_record.php index 8d5662d4..23cc6f78 100755 --- a/application/modules/formbuilder/models/model_record.php +++ b/application/modules/formbuilder/models/model_record.php @@ -10,10 +10,10 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: model_forms.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } /** * Form estimator model @@ -24,33 +24,36 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version Release: 1.00 - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -class model_record extends CI_Model { - - - - public $table = ''; - public $tbform = ''; - public $tbformtype = ''; - public $tbformfields = ''; - - /** - * model_forms::__construct() - * - * @return - */ - function __construct() { - parent::__construct(); - $this->table = $this->db->dbprefix . 'cest_uiform_form_records'; - $this->tbform = $this->db->dbprefix . 'cest_uiform_form'; - $this->tbformtype = $this->db->dbprefix . 'cest_uiform_fields_type'; - $this->tbformfields = $this->db->dbprefix . 'cest_uiform_fields'; - } - - function getListRecords( $per_page = '', $segment = '' ) { - $query = sprintf( - ' +class model_record extends CI_Model +{ + + + + public $table = ''; + public $tbform = ''; + public $tbformtype = ''; + public $tbformfields = ''; + + /** + * model_forms::__construct() + * + * @return + */ + public function __construct() + { + parent::__construct(); + $this->table = $this->db->dbprefix . 'cest_uiform_form_records'; + $this->tbform = $this->db->dbprefix . 'cest_uiform_form'; + $this->tbformtype = $this->db->dbprefix . 'cest_uiform_fields_type'; + $this->tbformfields = $this->db->dbprefix . 'cest_uiform_fields'; + } + + public function getListRecords($per_page = '', $segment = '') + { + $query = sprintf( + ' select c.fbh_id,c.fbh_data,c.fbh_data_rec,c.fbh_data2,c.fbh_data_rec2,c.fbh_data_rec2_xml, c.fbh_total_amount,c.created_date,c.flag_status,c.fbh_data_user,c.form_fmb_id,c.fbh_data_rec_xml,c.fbh_user_agent,c.fbh_page, c.fbh_referer,c.fbh_params,f.fmb_name @@ -59,421 +62,424 @@ function getListRecords( $per_page = '', $segment = '' ) { where c.flag_status>0 ORDER BY c.created_date desc ', - $this->table, - $this->tbform - ); - - if ( $per_page != '' || $segment != '' ) { - $segment = ( ! empty( $segment ) ) ? $segment : 0; - $query .= sprintf( ' limit %s,%s', (int) $segment, (int) $per_page ); - } - - $query2 = $this->db->query( $query ); - return $query2->result(); - } - - /** - * Show all records according to filter - * - * @param string $per_page - * @param string $segment - * @return void - */ - function getListAllRecordsFiltered( $data ) { - - $per_page = $data['per_page']; - $segment = $data['segment']; - $orderby = $data['orderby']; - - $query = sprintf( - ' + $this->table, + $this->tbform + ); + + if ( $per_page != '' || $segment != '') { + $segment = ( ! empty($segment) ) ? $segment : 0; + $query .= sprintf(' limit %s,%s', (int) $segment, (int) $per_page); + } + + $query2 = $this->db->query($query); + return $query2->result(); + } + + /** + * Show all records according to filter + * + * @param string $per_page + * @param string $segment + * @return void + */ + public function getListAllRecordsFiltered($data) + { + + $per_page = $data['per_page']; + $segment = $data['segment']; + $orderby = $data['orderby']; + + $query = sprintf( + ' select c.fbh_id,c.fbh_data,c.fbh_data_rec,c.fbh_data2,c.fbh_data_rec2,c.fbh_data_rec2_xml, c.fbh_total_amount,c.created_date,c.flag_status,c.fbh_data_user,c.form_fmb_id,c.fbh_data_rec_xml,c.fbh_user_agent,c.fbh_page, c.fbh_referer,c.fbh_params,f.fmb_name from %s c join %s f on c.form_fmb_id=f.fmb_id where c.flag_status>0 ', - $this->table, - $this->tbform - ); - - $orderby = ( $orderby === 'asc' ) ? 'asc' : 'desc'; - - $query .= sprintf( ' ORDER BY c.created_date %s ', $orderby ); - - if ( $per_page != '' && $segment != '' ) { - $segment = ( ! empty( $segment ) ) ? $segment : 0; - $query .= sprintf( ' limit %s,%s', (int) $segment, (int) $per_page ); - } - - $query2 = $this->db->query( $query ); - return $query2->result(); - - } - - /** - * Show trash records according to filter - * - * @param string $per_page - * @param string $segment - * @return void - */ - function getListTrashRecordsFiltered( $data ) { - - $per_page = $data['per_page']; - $segment = $data['segment']; - $orderby = $data['orderby']; - - $query = sprintf( - ' + $this->table, + $this->tbform + ); + + $orderby = ( $orderby === 'asc' ) ? 'asc' : 'desc'; + + $query .= sprintf(' ORDER BY c.created_date %s ', $orderby); + + if ( $per_page != '' && $segment != '') { + $segment = ( ! empty($segment) ) ? $segment : 0; + $query .= sprintf(' limit %s,%s', (int) $segment, (int) $per_page); + } + + $query2 = $this->db->query($query); + return $query2->result(); + } + + /** + * Show trash records according to filter + * + * @param string $per_page + * @param string $segment + * @return void + */ + public function getListTrashRecordsFiltered($data) + { + + $per_page = $data['per_page']; + $segment = $data['segment']; + $orderby = $data['orderby']; + + $query = sprintf( + ' select c.fbh_id,c.fbh_data,c.fbh_data_rec,c.fbh_data2,c.fbh_data_rec2,c.fbh_data_rec2_xml, c.fbh_total_amount,c.created_date,c.flag_status,c.fbh_data_user,c.form_fmb_id,c.fbh_data_rec_xml,c.fbh_user_agent,c.fbh_page, c.fbh_referer,c.fbh_params,f.fmb_name from %s c join %s f on c.form_fmb_id=f.fmb_id where c.flag_status=0 ', - $this->table, - $this->tbform - ); - - $orderby = ( $orderby === 'asc' ) ? 'asc' : 'desc'; - - $query .= sprintf( ' ORDER BY c.created_date %s ', $orderby ); - - if ( $per_page != '' || $segment != '' ) { - $segment = ( ! empty( $segment ) ) ? $segment : 0; - $query .= sprintf( ' limit %s,%s', (int) $segment, (int) $per_page ); - } - - $query2 = $this->db->query( $query ); - return $query2->result(); - - } - - - function getDetailRecord( $names, $form_id ) { - if ( intval( $form_id ) > 0 ) { - $unique_names = array(); - - $sql = 'select '; - $temp = array(); - foreach ( $names as $value ) { - - if ( ! in_array( Uiform_Form_Helper::sanitizeFnamestring( $value->fieldname ), $unique_names ) ) { - $temp[] = "extractvalue(fbh_data_rec_xml,'/params/child::" . $value->fmf_uniqueid . "') AS " . Uiform_Form_Helper::sanitizeFnamestring( $value->fieldname ); - $unique_names[] = Uiform_Form_Helper::sanitizeFnamestring( $value->fieldname ); - } else { - $temp[] = "extractvalue(fbh_data_rec_xml,'/params/child::" . $value->fmf_uniqueid . "') AS " . Uiform_Form_Helper::sanitizeFnamestring( $value->fieldname ) . count( $unique_names ); - $unique_names[] = Uiform_Form_Helper::sanitizeFnamestring( $value->fieldname ) . count( $unique_names ); - } - } - $temp[] = 'r.fbh_id'; - $temp[] = 'r.created_date'; - $sql .= implode( ',', $temp ) . ' from %1$s r'; - $sql .= ' join %2$s frm on frm.fmb_id=r.form_fmb_id + $this->table, + $this->tbform + ); + + $orderby = ( $orderby === 'asc' ) ? 'asc' : 'desc'; + + $query .= sprintf(' ORDER BY c.created_date %s ', $orderby); + + if ( $per_page != '' || $segment != '') { + $segment = ( ! empty($segment) ) ? $segment : 0; + $query .= sprintf(' limit %s,%s', (int) $segment, (int) $per_page); + } + + $query2 = $this->db->query($query); + return $query2->result(); + } + + + public function getDetailRecord($names, $form_id) + { + if ( intval($form_id) > 0) { + $unique_names = array(); + + $sql = 'select '; + $temp = array(); + foreach ( $names as $value) { + if ( ! in_array(Uiform_Form_Helper::sanitizeFnamestring($value->fieldname), $unique_names)) { + $temp[] = "extractvalue(fbh_data_rec_xml,'/params/child::" . $value->fmf_uniqueid . "') AS " . Uiform_Form_Helper::sanitizeFnamestring($value->fieldname); + $unique_names[] = Uiform_Form_Helper::sanitizeFnamestring($value->fieldname); + } else { + $temp[] = "extractvalue(fbh_data_rec_xml,'/params/child::" . $value->fmf_uniqueid . "') AS " . Uiform_Form_Helper::sanitizeFnamestring($value->fieldname) . count($unique_names); + $unique_names[] = Uiform_Form_Helper::sanitizeFnamestring($value->fieldname) . count($unique_names); + } + } + $temp[] = 'r.fbh_id'; + $temp[] = 'r.created_date'; + $sql .= implode(',', $temp) . ' from %1$s r'; + $sql .= ' join %2$s frm on frm.fmb_id=r.form_fmb_id where r.flag_status>0 and r.form_fmb_id=%3$s'; - $query = sprintf( $sql, $this->table, $this->tbform, (int) $form_id ); - - $query2 = $this->db->query( $query ); - return $query2->result(); - } else { - return array(); - } - - } - - function getFieldOptRecord( $rec_id, $f_type = null, $f_id = null, $f_atr1 = null, $f_atr2 = null, $f_atr3 = null ) { - if ( intval( $rec_id ) > 0 ) { - $result = ''; - - switch ( intval( $f_type ) ) { - case 8: - case 10: - /*radio button, select*/ - - $tmp_str = ''; - $tmp_str .= $f_id; - if ( ! empty( $f_atr1 ) ) { - $tmp_str .= '_' . $f_atr1; - if ( ! empty( $f_atr2 ) ) { - $tmp_str .= '_' . $f_atr2; - if ( ! empty( $f_atr3 ) ) { - $tmp_str .= '_' . $f_atr3; - } - } - } - - $sql = "select extractvalue(fbh_data_rec_xml,'/params/child::" . $tmp_str . "') AS uifmoptvalue,"; - $sql .= 'r.fbh_id,r.created_date'; - $sql .= ' from %1$s r'; - $sql .= ' join %2$s frm on frm.fmb_id=r.form_fmb_id + $query = sprintf($sql, $this->table, $this->tbform, (int) $form_id); + + $query2 = $this->db->query($query); + return $query2->result(); + } else { + return array(); + } + } + + public function getFieldOptRecord($rec_id, $f_type = null, $f_id = null, $f_atr1 = null, $f_atr2 = null, $f_atr3 = null) + { + if ( intval($rec_id) > 0) { + $result = ''; + + switch ( intval($f_type)) { + case 8: + case 10: + /*radio button, select*/ + + $tmp_str = ''; + $tmp_str .= $f_id; + if ( ! empty($f_atr1)) { + $tmp_str .= '_' . $f_atr1; + if ( ! empty($f_atr2)) { + $tmp_str .= '_' . $f_atr2; + if ( ! empty($f_atr3)) { + $tmp_str .= '_' . $f_atr3; + } + } + } + + $sql = "select extractvalue(fbh_data_rec_xml,'/params/child::" . $tmp_str . "') AS uifmoptvalue,"; + $sql .= 'r.fbh_id,r.created_date'; + $sql .= ' from %1$s r'; + $sql .= ' join %2$s frm on frm.fmb_id=r.form_fmb_id where r.flag_status>0 and r.fbh_id=%3$s'; - $query = sprintf( $sql, $this->table, $this->tbform, (int) $rec_id ); - - if ( false ) { - // not tested yet - $sql = "select extractvalue(fbh_data_rec_xml,'/params/child::" . $f_id . "_chosen') AS uifmoptvalue,"; - $sql .= 'r.fbh_id,r.created_date'; - $sql .= ' from %1$s r'; - $sql .= ' join %2$s frm on frm.fmb_id=r.form_fmb_id + $query = sprintf($sql, $this->table, $this->tbform, (int) $rec_id); + + if ( false) { + // not tested yet + $sql = "select extractvalue(fbh_data_rec_xml,'/params/child::" . $f_id . "_chosen') AS uifmoptvalue,"; + $sql .= 'r.fbh_id,r.created_date'; + $sql .= ' from %1$s r'; + $sql .= ' join %2$s frm on frm.fmb_id=r.form_fmb_id where r.flag_status>0 and r.fbh_id=%3$s'; - $query = sprintf( $sql, $this->table, $this->tbform, (int) $rec_id ); - $query2 = $this->db->query( $query ); - - $row = $query2->row(); - - $chosen = $row->uifmoptvalue; - // get value or label - $sql = 'select '; - $temp = array(); - $temp[] = "extractvalue(fbh_data_rec_xml,'/params/child::" . $f_id . '_input_' . $chosen . '_' . $f_atr1 . "') AS uifmoptvalue"; - $temp[] = 'r.fbh_id'; - $temp[] = 'r.created_date'; - $sql .= implode( ',', $temp ) . ' from %1$s r'; - $sql .= ' join %2$s frm on frm.fmb_id=r.form_fmb_id + $query = sprintf($sql, $this->table, $this->tbform, (int) $rec_id); + $query2 = $this->db->query($query); + + $row = $query2->row(); + + $chosen = $row->uifmoptvalue; + // get value or label + $sql = 'select '; + $temp = array(); + $temp[] = "extractvalue(fbh_data_rec_xml,'/params/child::" . $f_id . '_input_' . $chosen . '_' . $f_atr1 . "') AS uifmoptvalue"; + $temp[] = 'r.fbh_id'; + $temp[] = 'r.created_date'; + $sql .= implode(',', $temp) . ' from %1$s r'; + $sql .= ' join %2$s frm on frm.fmb_id=r.form_fmb_id where r.flag_status>0 and r.fbh_id=%3$s'; - $query = sprintf( $sql, $this->table, $this->tbform, (int) $rec_id ); - } - - $query2 = $this->db->query( $query ); - - $row = $query2->row(); - if ( isset( $row->uifmoptvalue ) ) { - return $row->uifmoptvalue; - } else { - return ''; - } - - break; - case 9: - case 11: - /*checkbox , Multiple select*/ - $tmp_str = ''; - $tmp_str .= $f_id; - if ( ! empty( $f_atr1 ) ) { - $tmp_str .= '_' . $f_atr1; - if ( ! empty( $f_atr2 ) ) { - $tmp_str .= '_' . $f_atr2; - if ( ! empty( $f_atr3 ) ) { - $tmp_str .= '_' . $f_atr3; - } - } - } - - $sql = "select extractvalue(fbh_data_rec_xml,'/params/child::" . $tmp_str . "') AS uifmoptvalue,"; - $sql .= 'r.fbh_id,r.created_date'; - $sql .= ' from %1$s r'; - $sql .= ' join %2$s frm on frm.fmb_id=r.form_fmb_id + $query = sprintf($sql, $this->table, $this->tbform, (int) $rec_id); + } + + $query2 = $this->db->query($query); + + $row = $query2->row(); + if ( isset($row->uifmoptvalue)) { + return $row->uifmoptvalue; + } else { + return ''; + } + + break; + case 9: + case 11: + /*checkbox , Multiple select*/ + $tmp_str = ''; + $tmp_str .= $f_id; + if ( ! empty($f_atr1)) { + $tmp_str .= '_' . $f_atr1; + if ( ! empty($f_atr2)) { + $tmp_str .= '_' . $f_atr2; + if ( ! empty($f_atr3)) { + $tmp_str .= '_' . $f_atr3; + } + } + } + + $sql = "select extractvalue(fbh_data_rec_xml,'/params/child::" . $tmp_str . "') AS uifmoptvalue,"; + $sql .= 'r.fbh_id,r.created_date'; + $sql .= ' from %1$s r'; + $sql .= ' join %2$s frm on frm.fmb_id=r.form_fmb_id where r.flag_status>0 and r.fbh_id=%3$s'; - $query = sprintf( $sql, $this->table, $this->tbform, (int) $rec_id ); - - $query2 = $this->db->query( $query ); - - $row = $query2->row(); - if ( isset( $row->uifmoptvalue ) ) { - return $row->uifmoptvalue; - } else { - return ''; - } - - break; - case 16: - case 17: - case 18: - /*cspinner*/ - $tmp_flag = $f_id . '_' . $f_atr1; - if ( ! empty( $f_atr2 ) ) { - $tmp_flag .= '_' . $f_atr2; - } - - $sql = "select extractvalue(fbh_data_rec_xml,'/params/child::" . $tmp_flag . "') AS uifmoptvalue,"; - $sql .= 'r.fbh_id,r.created_date'; - $sql .= ' from %1$s r'; - $sql .= ' join %2$s frm on frm.fmb_id=r.form_fmb_id + $query = sprintf($sql, $this->table, $this->tbform, (int) $rec_id); + + $query2 = $this->db->query($query); + + $row = $query2->row(); + if ( isset($row->uifmoptvalue)) { + return $row->uifmoptvalue; + } else { + return ''; + } + + break; + case 16: + case 17: + case 18: + /*cspinner*/ + $tmp_flag = $f_id . '_' . $f_atr1; + if ( ! empty($f_atr2)) { + $tmp_flag .= '_' . $f_atr2; + } + + $sql = "select extractvalue(fbh_data_rec_xml,'/params/child::" . $tmp_flag . "') AS uifmoptvalue,"; + $sql .= 'r.fbh_id,r.created_date'; + $sql .= ' from %1$s r'; + $sql .= ' join %2$s frm on frm.fmb_id=r.form_fmb_id where r.flag_status>0 and r.fbh_id=%3$s'; - $query = sprintf( $sql, $this->table, $this->tbform, (int) $rec_id ); - - $query2 = $this->db->query( $query ); - - $row = $query2->row(); - if ( isset( $row->uifmoptvalue ) ) { - return $row->uifmoptvalue; - } else { - return ''; - } - - break; - default: - $option = $f_id . '_' . $f_atr1; - - $sql = 'select '; - $temp = array(); - $temp[] = "extractvalue(fbh_data_rec_xml,'/params/child::" . $option . "') AS uifmoptvalue"; - $temp[] = 'r.fbh_id'; - $temp[] = 'r.created_date'; - $sql .= implode( ',', $temp ) . ' from %1$s r'; - $sql .= ' join %2$s frm on frm.fmb_id=r.form_fmb_id + $query = sprintf($sql, $this->table, $this->tbform, (int) $rec_id); + + $query2 = $this->db->query($query); + + $row = $query2->row(); + if ( isset($row->uifmoptvalue)) { + return $row->uifmoptvalue; + } else { + return ''; + } + + break; + default: + $option = $f_id . '_' . $f_atr1; + + $sql = 'select '; + $temp = array(); + $temp[] = "extractvalue(fbh_data_rec_xml,'/params/child::" . $option . "') AS uifmoptvalue"; + $temp[] = 'r.fbh_id'; + $temp[] = 'r.created_date'; + $sql .= implode(',', $temp) . ' from %1$s r'; + $sql .= ' join %2$s frm on frm.fmb_id=r.form_fmb_id where r.flag_status>0 and r.fbh_id=%3$s'; - $query = sprintf( $sql, $this->table, $this->tbform, (int) $rec_id ); - - $query2 = $this->db->query( $query ); - - $row = $query2->row(); - if ( isset( $row->uifmoptvalue ) ) { - return $row->uifmoptvalue; - } else { - return ''; - } - break; - } - } else { - return ''; - } - - } - - - function getVarOptRecord( $option, $form_id ) { - if ( intval( $form_id ) > 0 ) { - - $sql = 'select '; - $temp = array(); - $temp[] = "extractvalue(fbh_data_rec2_xml,'/params/child::" . $option . "') AS uifmoptvalue"; - $temp[] = 'r.fbh_id'; - $temp[] = 'r.created_date'; - $sql .= implode( ',', $temp ) . ' from %1$s r'; - $sql .= ' join %2$s frm on frm.fmb_id=r.form_fmb_id + $query = sprintf($sql, $this->table, $this->tbform, (int) $rec_id); + + $query2 = $this->db->query($query); + + $row = $query2->row(); + if ( isset($row->uifmoptvalue)) { + return $row->uifmoptvalue; + } else { + return ''; + } + break; + } + } else { + return ''; + } + } + + + public function getVarOptRecord($option, $form_id) + { + if ( intval($form_id) > 0) { + $sql = 'select '; + $temp = array(); + $temp[] = "extractvalue(fbh_data_rec2_xml,'/params/child::" . $option . "') AS uifmoptvalue"; + $temp[] = 'r.fbh_id'; + $temp[] = 'r.created_date'; + $sql .= implode(',', $temp) . ' from %1$s r'; + $sql .= ' join %2$s frm on frm.fmb_id=r.form_fmb_id where r.flag_status>0 and r.fbh_id=%3$s'; - $query = sprintf( $sql, $this->table, $this->tbform, (int) $form_id ); - - $query2 = $this->db->query( $query ); - - $row = $query2->row(); - if ( isset( $row->uifmoptvalue ) ) { - return $row->uifmoptvalue; - } else { - return ''; - } - } else { - return ''; - } - - } - - function getNameFieldEnabledByForm( $id_form, $filter = false ) { - - if ( intval( $id_form ) > 0 ) { - $tmp_qu = 'select t.fby_id,f.fmf_uniqueid, coalesce(NULLIF(f.fmf_fieldname,""),CONCAT(t.fby_name,f.fmf_id)) as fieldname + $query = sprintf($sql, $this->table, $this->tbform, (int) $form_id); + + $query2 = $this->db->query($query); + + $row = $query2->row(); + if ( isset($row->uifmoptvalue)) { + return $row->uifmoptvalue; + } else { + return ''; + } + } else { + return ''; + } + } + + public function getNameFieldEnabledByForm($id_form, $filter = false) + { + + if ( intval($id_form) > 0) { + $tmp_qu = 'select t.fby_id,f.fmf_uniqueid, coalesce(NULLIF(f.fmf_fieldname,""),CONCAT(t.fby_name,f.fmf_id)) as fieldname from %s f join %s t on f.type_fby_id=t.fby_id join %s fm on fm.fmb_id=f.form_fmb_id where f.type_fby_id in (6,7,8,9,10,11,12,13,15,16,17,18,21,22,23,24,25,26,28,29,30,39,40,41,42,43) and'; - if ( $filter === true ) { - $tmp_qu .= ' f.fmf_status_qu=1 and'; - } + if ( $filter === true) { + $tmp_qu .= ' f.fmf_status_qu=1 and'; + } - $tmp_qu .= ' fm.fmb_id=%s order by f.order_rec asc'; + $tmp_qu .= ' fm.fmb_id=%s order by f.order_rec asc'; - $query = sprintf( $tmp_qu, $this->tbformfields, $this->tbformtype, $this->tbform, (int) $id_form ); + $query = sprintf($tmp_qu, $this->tbformfields, $this->tbformtype, $this->tbform, (int) $id_form); - $query2 = $this->db->query( $query ); - return $query2->result(); - } else { - return array(); - } + $query2 = $this->db->query($query); + return $query2->result(); + } else { + return array(); + } + } - } - - function getAllNameFieldEnabledByForm( $id_field ) { - if ( intval( $id_field ) > 0 ) { - $query = sprintf( - 'select f.fmf_uniqueid, coalesce(NULLIF(f.fmf_fieldname,""),CONCAT(t.fby_name,f.fmf_id)) as fieldname + public function getAllNameFieldEnabledByForm($id_field) + { + if ( intval($id_field) > 0) { + $query = sprintf( + 'select f.fmf_uniqueid, coalesce(NULLIF(f.fmf_fieldname,""),CONCAT(t.fby_name,f.fmf_id)) as fieldname from %s f join %s t on f.type_fby_id=t.fby_id join %s fm on fm.fmb_id=f.form_fmb_id where f.type_fby_id in (6,7,8,9,10,11,12,13,15,16,17,18,21,22,23,24,25,26,28,29,30,39,40,41,42,43) and fm.fmb_id=%s order by f.order_rec asc', - $this->tbformfields, - $this->tbformtype, - $this->tbform, - (int) $id_field - ); - $query2 = $this->db->query( $query ); - - return $query2->result(); - } else { - return array(); - } - - } - function getFormDataById( $id_rec ) { - $query = sprintf( - 'select f.created_ip, f.fmb_name,frec.form_fmb_id,f.fmb_data,f.fmb_data2,frec.fbh_total_amount,f.fmb_rec_tpl_st,f.fmb_rec_tpl_html,frec.fbh_data,f.fmb_inv_tpl_html,f.fmb_inv_tpl_st + $this->tbformfields, + $this->tbformtype, + $this->tbform, + (int) $id_field + ); + $query2 = $this->db->query($query); + + return $query2->result(); + } else { + return array(); + } + } + public function getFormDataById($id_rec) + { + $query = sprintf( + 'select f.created_ip, f.fmb_name,frec.form_fmb_id,f.fmb_data,f.fmb_data2,frec.fbh_total_amount,f.fmb_rec_tpl_st,f.fmb_rec_tpl_html,frec.fbh_data,f.fmb_inv_tpl_html,f.fmb_inv_tpl_st from %s frec join %s f on f.fmb_id=frec.form_fmb_id where frec.flag_status>=0 and frec.fbh_id=%s', - $this->table, - $this->tbform, - (int) $id_rec - ); - $query2 = $this->db->query( $query ); - return $query2->row(); - } - function getAllFieldsForReport( $id_form ) { - $query = sprintf( - 'select f.fmf_status_qu,f.fmf_uniqueid, coalesce(NULLIF(f.fmf_fieldname,""),CONCAT(t.fby_name,f.fmf_id)) as fieldname , f.order_rec + $this->table, + $this->tbform, + (int) $id_rec + ); + $query2 = $this->db->query($query); + return $query2->row(); + } + public function getAllFieldsForReport($id_form) + { + $query = sprintf( + 'select f.fmf_status_qu,f.fmf_uniqueid, coalesce(NULLIF(f.fmf_fieldname,""),CONCAT(t.fby_name,f.fmf_id)) as fieldname , f.order_rec from %s f join %s t on f.type_fby_id=t.fby_id where f.form_fmb_id=%s and f.type_fby_id in (6,7,8,9,10,11,12,13,15,16,17,18,21,22,23,24,25,26,28,29,30,39,40,41,42,43)', - $this->tbformfields, - $this->tbformtype, - (int) $id_form - ); - $query2 = $this->db->query( $query ); - return $query2->result(); - } - - function getNameField( $id_record ) { - $query = sprintf( - 'select f.fmf_uniqueid,f.fmf_id, coalesce(NULLIF(f.fmf_fieldname,""),CONCAT(t.fby_name,f.fmf_id)) as fieldname ,f.type_fby_id,f.fmf_data + $this->tbformfields, + $this->tbformtype, + (int) $id_form + ); + $query2 = $this->db->query($query); + return $query2->result(); + } + + public function getNameField($id_record) + { + $query = sprintf( + 'select f.fmf_uniqueid,f.fmf_id, coalesce(NULLIF(f.fmf_fieldname,""),CONCAT(t.fby_name,f.fmf_id)) as fieldname ,f.type_fby_id,f.fmf_data from %s f join %s t on f.type_fby_id=t.fby_id join %s fm on fm.fmb_id=f.form_fmb_id join %s rc on rc.form_fmb_id=fm.fmb_id where rc.fbh_id=%s', - $this->tbformfields, - $this->tbformtype, - $this->tbform, - $this->table, - (int) $id_record - ); - $query2 = $this->db->query( $query ); - return $query2->result(); - } - - function getNameInvoiceField( $id_field ) { - $query = sprintf( - 'select f.fmf_uniqueid,f.fmf_id, coalesce(NULLIF(f.fmf_fieldname,""),CONCAT(t.fby_name,f.fmf_id)) as fieldname + $this->tbformfields, + $this->tbformtype, + $this->tbform, + $this->table, + (int) $id_record + ); + $query2 = $this->db->query($query); + return $query2->result(); + } + + public function getNameInvoiceField($id_field) + { + $query = sprintf( + 'select f.fmf_uniqueid,f.fmf_id, coalesce(NULLIF(f.fmf_fieldname,""),CONCAT(t.fby_name,f.fmf_id)) as fieldname from %s f join %s t on f.type_fby_id=t.fby_id join %s fm on fm.fmb_id=f.form_fmb_id join %s rc on rc.form_fmb_id=fm.fmb_id where rc.fbh_id=%s and t.fby_id in (8,9,10,11,16,18,39,40,41,42)', - $this->tbformfields, - $this->tbformtype, - $this->tbform, - $this->table, - (int) $id_field - ); - $query2 = $this->db->query( $query ); - return $query2->result(); - } - - function getChartDataByIdForm( $id_field ) { - $query = 'SELECT + $this->tbformfields, + $this->tbformtype, + $this->tbform, + $this->table, + (int) $id_field + ); + $query2 = $this->db->query($query); + return $query2->result(); + } + + public function getChartDataByIdForm($id_field) + { + $query = 'SELECT DATE_FORMAT(r.created_date ,"%Y-%m-%d") as days, COUNT(r.fbh_id) as requests FROM ' . $this->table . ' r WHERE r.flag_status>0 @@ -482,109 +488,111 @@ function getChartDataByIdForm( $id_field ) { GROUP BY DAY(r.created_date) ORDER BY r.created_date ASC limit 31'; - $query2 = $this->db->query( $query ); - return $query2->result(); - } - - function getRecordById( $id ) { - $query = sprintf( - ' + $query2 = $this->db->query($query); + return $query2->result(); + } + + public function getRecordById($id) + { + $query = sprintf( + ' select uf.fbh_id,uf.fbh_data,uf.fbh_data_rec,uf.fbh_data2,uf.fbh_data_rec2,uf.fbh_data_rec2_xml,uf.created_ip, uf.fbh_total_amount,uf.created_date,uf.flag_status,uf.fbh_data_user,uf.form_fmb_id,uf.fbh_data_rec_xml,uf.fbh_user_agent,uf.fbh_page, uf.fbh_referer,uf.fbh_params,uf.vis_uniqueid from %s uf where uf.fbh_id=%s ', - $this->table, - (int) $id - ); - - $query2 = $this->db->query( $query ); - return $query2->row(); - } - - function getOptRecordById( $field, $id ) { - $query = sprintf( - ' + $this->table, + (int) $id + ); + + $query2 = $this->db->query($query); + return $query2->row(); + } + + public function getOptRecordById($field, $id) + { + $query = sprintf( + ' select uf.%s from %s uf where uf.fbh_id=%s ', - $field, - $this->table, - (int) $id - ); - - $query2 = $this->db->query( $query ); - - $row = $query2->row(); - if ( ! empty( $row ) ) { - return $row; - } else { - return ''; - } - } - - function CountRecords() { - $query = sprintf( - ' + $field, + $this->table, + (int) $id + ); + + $query2 = $this->db->query($query); + + $row = $query2->row(); + if ( ! empty($row)) { + return $row; + } else { + return ''; + } + } + + public function CountRecords() + { + $query = sprintf( + ' select COUNT(*) AS counted from %s c join %s f on c.form_fmb_id=f.fmb_id where c.flag_status>0 ORDER BY c.created_date desc ', - $this->table, - $this->tbform - ); - $query2 = $this->db->query( $query ); - - $row = $query2->row(); - if ( isset( $row->counted ) ) { - return $row->counted; - } else { - return 0; - } - } - - function getFieldDataById( $id_rec, $ui_field ) { - $query = sprintf( - "select f.type_fby_id as type,f.fmf_data + $this->table, + $this->tbform + ); + $query2 = $this->db->query($query); + + $row = $query2->row(); + if ( isset($row->counted)) { + return $row->counted; + } else { + return 0; + } + } + + public function getFieldDataById($id_rec, $ui_field) + { + $query = sprintf( + "select f.type_fby_id as type,f.fmf_data from %s f join %s t on f.type_fby_id=t.fby_id join %s frm on f.form_fmb_id=frm.fmb_id join %s frc on frc.form_fmb_id=frm.fmb_id where frc.fbh_id = %s and f.fmf_uniqueid='%s'", - $this->tbformfields, - $this->tbformtype, - $this->tbform, - $this->table, - $id_rec, - $ui_field - ); - - $query2 = $this->db->query( $query ); - return $query2->row(); - } - - /* - * list all and trash forms - */ - function ListTotals() { - $query = sprintf( - ' + $this->tbformfields, + $this->tbformtype, + $this->tbform, + $this->table, + $id_rec, + $ui_field + ); + + $query2 = $this->db->query($query); + return $query2->row(); + } + + /* + * list all and trash forms + */ + public function ListTotals() + { + $query = sprintf( + ' SELECT SUM(CASE WHEN flag_status = 0 THEN 1 ELSE 0 END) AS r_trash, SUM(CASE WHEN flag_status != 0 THEN 1 ELSE 0 END) AS r_all FROM %s ', - $this->table - ); - - $query2 = $this->db->query( $query ); - return $query2->row(); - - } + $this->table + ); + $query2 = $this->db->query($query); + return $query2->row(); + } } - diff --git a/application/modules/formbuilder/models/model_settings.php b/application/modules/formbuilder/models/model_settings.php index 1a90a276..31b09168 100755 --- a/application/modules/formbuilder/models/model_settings.php +++ b/application/modules/formbuilder/models/model_settings.php @@ -10,10 +10,10 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: model_forms.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } /** * Form estimator model @@ -24,133 +24,139 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version Release: 1.00 - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -class model_settings extends CI_Model { - - - /** - * register the global settings information - * - * @var array - */ - public static $db_config = array(); - - public $table = ''; - - - /** - * model_forms::__construct() - * - * @return - */ - function __construct() { - parent::__construct(); - $this->table = $this->db->dbprefix . 'cest_uiform_settings'; - $this->loadSettings(); - } - - function getOptions() { - $query = sprintf( - ' +class model_settings extends CI_Model +{ + + + /** + * register the global settings information + * + * @var array + */ + public static $db_config = array(); + + public $table = ''; + + + /** + * model_forms::__construct() + * + * @return + */ + public function __construct() + { + parent::__construct(); + $this->table = $this->db->dbprefix . 'cest_uiform_settings'; + $this->loadSettings(); + } + + public function getOptions() + { + $query = sprintf( + ' select uf.version,uf.type_email,uf.smtp_host,uf.smtp_port,uf.smtp_user,uf.smtp_pass,uf.smtp_conn,uf.sendmail_path,uf.language from %s uf where uf.id=%s ', - $this->table, - 1 - ); - - $query2 = $this->db->query( $query ); - return $query2->row(); - } - - function getLangOptions() { - $query = sprintf( - ' + $this->table, + 1 + ); + + $query2 = $this->db->query($query); + return $query2->row(); + } + + public function getLangOptions() + { + $query = sprintf( + ' select uf.language from %s uf where uf.id=%s ', - $this->table, - 1 - ); - - $query2 = $this->db->query( $query ); - return $query2->row(); - } - - /** - * model_settings::getSettings() - * Get setting information - * - * @return array - */ - function getSettings() { - $this->db->select( 'c.*' ); - $this->db->from( '{PRE}cest_uiform_settings c' ); - $this->db->limit( 1 ); - return $this->db->get()->row(); - } - - /** - * model_settings::loadSettings() - * Save global settings to cache - * - * @return array - */ - protected function loadSettings() { - $this->load->library( 'cache' ); - $data = $this->cache->get( 'settings' ); - if ( empty( $data ) ) { - $this->db->select( 'site_title, admin_mail, type_email,smtp_host,smtp_port,smtp_user,smtp_pass,smtp_conn,sendmail_path,language,version' ); - $this->db->from( '{PRE}cest_uiform_settings' ); - $this->db->where( array( 'id' => 1 ) ); - $this->db->limit( 1 ); - $query = $this->db->get(); - if ( ! empty( $query ) && $query->num_rows() == 1 ) { - $row = $query->row(); - self::$db_config['site_title'] = $row->site_title; - self::$db_config['admin_mail'] = $row->admin_mail; - self::$db_config['type_email'] = $row->type_email; - self::$db_config['smtp_host'] = $row->smtp_host; - self::$db_config['smtp_port'] = $row->smtp_port; - self::$db_config['smtp_user'] = $row->smtp_user; - self::$db_config['smtp_pass'] = $row->smtp_pass; - self::$db_config['smtp_conn'] = $row->smtp_conn; - self::$db_config['sendmail_path'] = $row->sendmail_path; - self::$db_config['language'] = $row->language; - self::$db_config['version'] = $row->version; - - $this->cache->write( self::$db_config, 'settings' ); - } - } else { - self::$db_config['site_title'] = $data['site_title']; - self::$db_config['admin_mail'] = $data['admin_mail']; - self::$db_config['type_email'] = $data['type_email']; - self::$db_config['smtp_host'] = $data['smtp_host']; - self::$db_config['smtp_port'] = $data['smtp_port']; - self::$db_config['smtp_user'] = $data['smtp_user']; - self::$db_config['smtp_pass'] = $data['smtp_pass']; - self::$db_config['smtp_conn'] = $data['smtp_conn']; - self::$db_config['sendmail_path'] = $data['sendmail_path']; - self::$db_config['language'] = $data['language']; - self::$db_config['version'] = ( isset( $data['version'] ) ) ? $data['version'] : 0; - } - } - - function getAllDatabases() { - // return $this->wpdb->get_results("SHOW TABLES", ARRAY_N); - return (array) $this->db->list_tables(); - } - - function getColsFromTable( $table ) { - - $query = sprintf( 'SHOW COLUMNS FROM %s', $table ); - - $query2 = $this->db->query( $query ); - return $query2->result(); - - } + $this->table, + 1 + ); + + $query2 = $this->db->query($query); + return $query2->row(); + } + + /** + * model_settings::getSettings() + * Get setting information + * + * @return array + */ + public function getSettings() + { + $this->db->select('c.*'); + $this->db->from('{PRE}cest_uiform_settings c'); + $this->db->limit(1); + return $this->db->get()->row(); + } + + /** + * model_settings::loadSettings() + * Save global settings to cache + * + * @return array + */ + protected function loadSettings() + { + $this->load->library('cache'); + $data = $this->cache->get('settings'); + if ( empty($data)) { + $this->db->select('site_title, admin_mail, type_email,smtp_host,smtp_port,smtp_user,smtp_pass,smtp_conn,sendmail_path,language,version'); + $this->db->from('{PRE}cest_uiform_settings'); + $this->db->where(array( 'id' => 1 )); + $this->db->limit(1); + $query = $this->db->get(); + if ( ! empty($query) && $query->num_rows() == 1) { + $row = $query->row(); + self::$db_config['site_title'] = $row->site_title; + self::$db_config['admin_mail'] = $row->admin_mail; + self::$db_config['type_email'] = $row->type_email; + self::$db_config['smtp_host'] = $row->smtp_host; + self::$db_config['smtp_port'] = $row->smtp_port; + self::$db_config['smtp_user'] = $row->smtp_user; + self::$db_config['smtp_pass'] = $row->smtp_pass; + self::$db_config['smtp_conn'] = $row->smtp_conn; + self::$db_config['sendmail_path'] = $row->sendmail_path; + self::$db_config['language'] = $row->language; + self::$db_config['version'] = $row->version; + + $this->cache->write(self::$db_config, 'settings'); + } + } else { + self::$db_config['site_title'] = $data['site_title']; + self::$db_config['admin_mail'] = $data['admin_mail']; + self::$db_config['type_email'] = $data['type_email']; + self::$db_config['smtp_host'] = $data['smtp_host']; + self::$db_config['smtp_port'] = $data['smtp_port']; + self::$db_config['smtp_user'] = $data['smtp_user']; + self::$db_config['smtp_pass'] = $data['smtp_pass']; + self::$db_config['smtp_conn'] = $data['smtp_conn']; + self::$db_config['sendmail_path'] = $data['sendmail_path']; + self::$db_config['language'] = $data['language']; + self::$db_config['version'] = ( isset($data['version']) ) ? $data['version'] : 0; + } + } + + public function getAllDatabases() + { + // return $this->wpdb->get_results("SHOW TABLES", ARRAY_N); + return (array) $this->db->list_tables(); + } + + public function getColsFromTable($table) + { + + $query = sprintf('SHOW COLUMNS FROM %s', $table); + + $query2 = $this->db->query($query); + return $query2->result(); + } } - diff --git a/application/modules/formbuilder/views/fields/formhtml_panelfld.php b/application/modules/formbuilder/views/fields/formhtml_panelfld.php index 8cc2e51e..fd7d7a5a 100755 --- a/application/modules/formbuilder/views/fields/formhtml_panelfld.php +++ b/application/modules/formbuilder/views/fields/formhtml_panelfld.php @@ -9,15 +9,16 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?> -
    -
    -
    -
    -
    -
    [[%%fields%%]]
    -
    - -
    -
    -
    -
    -
    -
    [[%%fields%%]]
    -
    - - -
    -
    [[%%fields%%]]
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    [[%%fields%%]]
    -
    - +
    +
    +
    +
    +
    +
    [[%%fields%%]]
    +
    + +
    +
    +
    +
    +
    +
    [[%%fields%%]]
    +
    + + +
    +
    [[%%fields%%]]
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    [[%%fields%%]]
    +
    + - -
    -
    [[%%fields%%]]
    -
    - + +
    +
    [[%%fields%%]]
    +
    + - +
    - style="display:none;" - - - > -
    -
    -
    - - - -
    -
    - -
    -
    + data-idfield="" + data-typefield="31" + class="rockfm-panelfld rockfm-field + + rockfm-clogic-fcond + + + rockfm-costest-field + + + " + + style="display:none;" + + + > +
    +
    +
    + + + +
    +
    + +
    +
    diff --git a/application/modules/formbuilder/views/fields/formhtml_panelfld_css.php b/application/modules/formbuilder/views/fields/formhtml_panelfld_css.php index 29e82d3c..a552d53b 100755 --- a/application/modules/formbuilder/views/fields/formhtml_panelfld_css.php +++ b/application/modules/formbuilder/views/fields/formhtml_panelfld_css.php @@ -1,130 +1,127 @@ #rockfm_ > .rockfm-field-wrap > .rockfm-input31-container{ +if ( isset($input18['pane_background']['show_st']) + && intval($input18['pane_background']['show_st']) === 1) { + ?> - - background:; - - background: ; - background-image: -webkit-linear-gradient(top, , ); - background-image: -moz-linear-gradient(top, , ); - background-image: -ms-linear-gradient(top, , ); - background-image: -o-linear-gradient(top, , ); - background-image: linear-gradient(to bottom, , ); - - - background-image:url(""); - background-repeat:repeat; - - - - + switch ( intval($input18['pane_background']['type'])) { + case 1: + // solid + if ( ! empty($input18['pane_background']['solid_color'])) { + ?> + background:; + + background: ; + background-image: -webkit-linear-gradient(top, , ); + background-image: -moz-linear-gradient(top, , ); + background-image: -ms-linear-gradient(top, , ); + background-image: -o-linear-gradient(top, , ); + background-image: linear-gradient(to bottom, , ); + + + background-image:url(""); + background-repeat:repeat; + + - - - -webkit-border-radius: px; - -moz-border-radius: px; - border-radius: px; - - - border: px; - - - box-shadow: ; - - - - padding: px px px px; - - - padding:10px; - - - - margin: px px px px; - - - - + + + -webkit-border-radius: px; + -moz-border-radius: px; + border-radius: px; + + + border: px; + + + box-shadow: ; + + + + padding: px px px px; + + + padding:10px; + + + + margin: px px px px; + + + + } - + diff --git a/application/modules/formbuilder/views/fields/modal/field_opt_checkbox_extra.php b/application/modules/formbuilder/views/fields/modal/field_opt_checkbox_extra.php index 81636fec..d00ae944 100755 --- a/application/modules/formbuilder/views/fields/modal/field_opt_checkbox_extra.php +++ b/application/modules/formbuilder/views/fields/modal/field_opt_checkbox_extra.php @@ -11,117 +11,117 @@ * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @link http://zigapage.softdiscover.com */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } ob_start(); ?>
    -
    -
    - -
    - -
    - -
    -
    -
    -
    - -
    -
    -
    -
    - -
    -
    -
    -
    -
    - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    - - -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    -
    -
    -
    - +
    +
    + +
    + +
    + +
    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + + +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +
    + diff --git a/application/modules/formbuilder/views/fields/modal/field_opt_column.php b/application/modules/formbuilder/views/fields/modal/field_opt_column.php index 8199d391..62ee8993 100755 --- a/application/modules/formbuilder/views/fields/modal/field_opt_column.php +++ b/application/modules/formbuilder/views/fields/modal/field_opt_column.php @@ -11,964 +11,963 @@ * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @link http://zigapage.softdiscover.com */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } ob_start(); ?>
    - - - -
    - - -
    -
    -
    -
    -
    -
    - - -
    -
    -
    -
    -
    - : -
    - - -
    -
    -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -

    -
    - -
    -
    -
    -
    - - - -
    -
    - -
    - -
      -
    • -
    • -
    -
    - - -
    -
    -
    -
    -
    -
    - - - -
    - -
    -
    -
    -
    -
    - - -
    -
    - - -
    - -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    - - -
    - -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    - - -
    - -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    - - -
    - -
    -
    -
    -
    -
    -
    - -
    - -
    -
    -
    -
    -
    - - -
    -
    - - -
    - -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    - - -
    - -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    - - -
    - -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    - - -
    - -
    -
    -
    -
    -
    -
    - - -
    - -
    -
    -
    -
    -
    - - -
    -
    -
    - - -
    - - -
    - -
    -
    -
    -
    -
    -
    - -
    - -
    -
    -
    -
    -
    - - -
    -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    -
    - - -
    - - -
    - -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    -
    -
    - - -
    -
    -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    - - -
    -
    -
    -
    - -
    - - - - - - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - - -
    -
    -
    - - -
    -
    - -
    - - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - - -
    -
    -
    - - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - - -
    -
    -
    - - -
    -
    -
    -
    -
    -
    - -
    -
    - -
    - -
    -
    -
    -
    -
    - - -
    -
    - -
    - -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    - -
    -
    -
    -
    - -
    -
    -
    -
    - -
    -
    -
    -
    -
    - - -
    -
    - -
    - -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    - - -
    - -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    - - -
    -
    - -
    - -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    -
    - - -
    -
    - -
    -
    -
    - -
    -
    -
    -
    -
    - - -
    -
    - - -
    - -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    - - -
    - -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    - - -
    - -
    -
    -
    -
    -
    -
    -
    - -
    - -
    -
    -
    -
    -
    -
    -
    -
    - -
    - -
    -
    -
    -
    - - -
    -
    - - -
    - -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    - - -
    - -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    - -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    + + + +
    + + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    + : +
    + + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +

    +
    + +
    +
    +
    +
    + + + +
    +
    + +
    + +
      +
    • +
    • +
    +
    + + +
    +
    +
    +
    +
    +
    + + + +
    + +
    +
    +
    +
    +
    + + +
    +
    + + +
    + +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + + +
    + +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + + +
    + +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + + +
    + +
    +
    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    +
    + + +
    +
    + + +
    + +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + + +
    + +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + + +
    + +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + + +
    + +
    +
    +
    +
    +
    +
    + + +
    + +
    +
    +
    +
    +
    + + +
    +
    +
    + + +
    + + +
    + +
    +
    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    +
    + + +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    +
    + + +
    + + +
    + +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    + + +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    + + +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + + +
    +
    +
    +
    + +
    + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + +
    +
    +
    + + +
    +
    + +
    + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + +
    +
    + +
    + +
    +
    +
    +
    +
    + + +
    +
    + +
    + +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + +
    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    +
    +
    +
    + + +
    +
    + +
    + +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + + +
    + +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + + +
    +
    + +
    + +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    +
    + + +
    +
    + +
    +
    +
    + +
    +
    +
    +
    +
    + + +
    +
    + + +
    + +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + + +
    + +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + + +
    + +
    +
    +
    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    + + +
    +
    + + +
    + +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + + +
    + +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    @@ -978,7 +977,7 @@ class="zgpb-custom-slider"> diff --git a/application/modules/formbuilder/views/fields/modal/field_opt_select_extra.php b/application/modules/formbuilder/views/fields/modal/field_opt_select_extra.php index 42ab1e5e..dac882af 100755 --- a/application/modules/formbuilder/views/fields/modal/field_opt_select_extra.php +++ b/application/modules/formbuilder/views/fields/modal/field_opt_select_extra.php @@ -11,219 +11,219 @@ * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @link http://zigapage.softdiscover.com */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } ob_start(); ?>
    -
    -
    - -
    - -
    - -
    -
    -
    -
    - -
    -
    -
    - - - - - - -
    -
    -
    -
    -
    - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    - -
    -
    - -
    -
    -
    - -
    -
    -
    -
    -
    - -
    -
    -
    - -
    -
    -
    -
    -
    - -
    -
    -
    - -
    -
    -
    -
    - -
    -
    -
    -
    -
    +
    +
    + +
    + +
    + +
    +
    +
    +
    + +
    +
    +
    + + + + + + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    + +
    +
    + +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +
    +
    +
    +
    diff --git a/application/modules/formbuilder/views/fields/modal/field_opt_text.php b/application/modules/formbuilder/views/fields/modal/field_opt_text.php index dce5688a..bc254b2a 100755 --- a/application/modules/formbuilder/views/fields/modal/field_opt_text.php +++ b/application/modules/formbuilder/views/fields/modal/field_opt_text.php @@ -11,8 +11,8 @@ * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @link http://zigapage.softdiscover.com */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } ob_start(); ?> @@ -23,134 +23,134 @@
    -
    -
    -
    -
    -
    -
    - - -
    -
    -
    -
    -
    - : -
    - - -
    -
    -
    -
    - - - -
    -
    - -
    - -
    -
    - -
      -
    • - -
    • -
    • -
    • -
    • -
    • -
    • -
    • - -
    • -
    • -
    • -
    • -
    - -
    - -
    -
    -
    -
    - - - -
    -
    -
    -
    -
    -
    - - - -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    - -
    - - -
    -
    +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    + : +
    + + +
    +
    +
    +
    + + + +
    +
    + +
    + +
    +
    + +
      +
    • + +
    • +
    • +
    • +
    • +
    • +
    • +
    • + +
    • +
    • +
    • +
    • +
    + +
    + +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + +
    + + +
    +
    + jQuery(document).ready(function($) { + + }); + diff --git a/application/modules/formbuilder/views/fields/modal/settings_field_input_18.php b/application/modules/formbuilder/views/fields/modal/settings_field_input_18.php index 48913e59..e6a50033 100755 --- a/application/modules/formbuilder/views/fields/modal/settings_field_input_18.php +++ b/application/modules/formbuilder/views/fields/modal/settings_field_input_18.php @@ -9,597 +9,598 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?>
    -
    -
    - -
    - true, - 'textarea_rows' => 5, - ); - // wp_editor('', 'uifm_frm_inp18_txt_cont',$settings ); - ?> - -
    +
    +
    + +
    + true, + 'textarea_rows' => 5, + ); + // wp_editor('', 'uifm_frm_inp18_txt_cont',$settings ); + ?> + +
    -
    -
    -
    +
    +
    +
    -
    -
    - -
    - -
    -
    -
    - -
    +
    +
    + +
    + +
    +
    +
    + +
    -
    - -
    -
    - - - - -
    -
    -
    -
    +
    + +
    +
    + + + + +
    +
    +
    +
    -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    - - -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    - - - - - - -
    -
    -
    - -
    -
    -
    - -
    -
    -
    - - -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    -
    -
    - - -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    -
    -
    - - -
    - -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    - -
    -
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    + + + + + + +
    +
    +
    + +
    +
    +
    + +
    +
    +
    + + +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    +
    +
    + + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    +
    +
    + + +
    + +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    diff --git a/application/modules/formbuilder/views/fields/modal/settings_field_input_19.php b/application/modules/formbuilder/views/fields/modal/settings_field_input_19.php index a449c866..60f7481e 100755 --- a/application/modules/formbuilder/views/fields/modal/settings_field_input_19.php +++ b/application/modules/formbuilder/views/fields/modal/settings_field_input_19.php @@ -9,237 +9,238 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?>
    - -
    - -
    -
    -
    -
    -
    - - -
    -
    - -
    + +
    + +
    +
    +
    +
    +
    + + +
    +
    + +
    -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    - -
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + +
    -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    - -
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + +
    -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    - -
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + +
    -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    - - -
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + + +
    -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    - -
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + +
    -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    - - -
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + + +
    -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    - - - -
    -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    - - -
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + + +
    -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    - - -
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + + +
    -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    - - -
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + + +
    -
    -
    -
    -
    -
    -
    - +
    +
    +
    +
    +
    +
    +
    diff --git a/application/modules/formbuilder/views/fields/modal/settings_field_input_2.php b/application/modules/formbuilder/views/fields/modal/settings_field_input_2.php index d16c6a6b..034ecfcd 100755 --- a/application/modules/formbuilder/views/fields/modal/settings_field_input_2.php +++ b/application/modules/formbuilder/views/fields/modal/settings_field_input_2.php @@ -9,224 +9,225 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?>
    -
    -
    -
    - -
    -
    - -
    -
    - - - -
    -
    +
    +
    +
    + +
    +
    + +
    +
    + + + +
    +
    -
    -
    -
    -
    -
    -
    - -
    - - -
    +
    +
    +
    +
    +
    +
    + +
    + + +
    -
    -
    -
    -
    - -
    - 'uifm_fld_inp2_font', - 'id' => 'uifm_fld_inp2_font', - 'data-field-store' => 'input2-font', - ); - $default_value = '{"family":"Arial, Helvetica, sans-serif","name":"Arial","classname":"arial"}'; - ?> - get_view_menu( $attributes, $default_value ); ?> - - - - -
    +
    +
    +
    +
    + +
    + 'uifm_fld_inp2_font', + 'id' => 'uifm_fld_inp2_font', + 'data-field-store' => 'input2-font', + ); + $default_value = '{"family":"Arial, Helvetica, sans-serif","name":"Arial","classname":"arial"}'; + ?> + get_view_menu($attributes, $default_value); ?> + + + + +
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    -
    -
    - - - - - -
    -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    - -
    -
    -
    +
    +
    + + + + + +
    +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    +
    -
    -
    - +
    +
    +
    -
    -
    -
    - -
    -
    - - +
    +
    +
    + +
    +
    + + -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    -
    - -
    - -
    -
    -
    - - - - - - +
    + +
    + +
    +
    +
    + + + + + + diff --git a/application/modules/formbuilder/views/fields/modal/settings_field_input_3.php b/application/modules/formbuilder/views/fields/modal/settings_field_input_3.php index 78229bbe..83e87948 100755 --- a/application/modules/formbuilder/views/fields/modal/settings_field_input_3.php +++ b/application/modules/formbuilder/views/fields/modal/settings_field_input_3.php @@ -9,175 +9,176 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?>
    -
    -
    - -
    - true, - 'textarea_rows' => 5, - 'wpautop' => true, - ); - // wp_editor('', 'uifm_fld_inp3_html',$settings ); - ?> +
    +
    + +
    + true, + 'textarea_rows' => 5, + 'wpautop' => true, + ); + // wp_editor('', 'uifm_fld_inp3_html',$settings ); + ?> -
    - -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - - - -
    - - - -
    + class="uifm_tinymce_obj" + name="uifm_fld_inp3_html" + id="uifm_fld_inp3_html"> +
    + +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + + + +
    + + + +
    -
    -
    -
    -
    -
    -
    - -
    - - -
    +
    +
    +
    +
    +
    +
    + +
    + + +
    -
    -
    -
    -
    - -
    - 'uifm_fld_inp3_font', - 'id' => 'uifm_fld_inp3_font', - 'data-field-store' => 'input3-font', - ); - $default_value = '{"family":"Arial, Helvetica, sans-serif","name":"Arial","classname":"arial"}'; - ?> - get_view_menu( $attributes, $default_value ); ?> - - - - -
    +
    +
    +
    +
    + +
    + 'uifm_fld_inp3_font', + 'id' => 'uifm_fld_inp3_font', + 'data-field-store' => 'input3-font', + ); + $default_value = '{"family":"Arial, Helvetica, sans-serif","name":"Arial","classname":"arial"}'; + ?> + get_view_menu($attributes, $default_value); ?> + + + + +
    -
    -
    -
    -
    -
    - -
    -
    - - - -
    -
    -
    -
    +
    +
    +
    +
    +
    + +
    +
    + + + +
    +
    +
    +
    diff --git a/application/modules/formbuilder/views/fields/modal/settings_field_input_4.php b/application/modules/formbuilder/views/fields/modal/settings_field_input_4.php index cbfc1439..37f23913 100755 --- a/application/modules/formbuilder/views/fields/modal/settings_field_input_4.php +++ b/application/modules/formbuilder/views/fields/modal/settings_field_input_4.php @@ -9,158 +9,159 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?>
    -
    -
    -
    -
    - - -
    -
    -
    -
    - - +
    +
    +
    +
    + + +
    +
    +
    +
    + + -
    -
    -
    -
    - -
    -
    -
    -
    - - -
    -
    - -
    -
    -
    - - +
    +
    +
    +
    + +
    +
    +
    +
    + + +
    +
    + +
    +
    +
    + + -
    -
    -
    -
    -
    -
    - -
    - - -
    - - -
    -
    - -
    -
    -
    - -
    -
    -
    -
    - - -
    -
    -
    -
    - - +
    +
    +
    +
    +
    +
    + +
    + + +
    + + +
    +
    + +
    +
    +
    + +
    +
    +
    +
    + + +
    +
    +
    +
    + + -
    -
    -
    -
    - - -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -
    - - -
    -
    -
    - -
    -
    -
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + + + +
    +
    + + +
    +
    +
    + +
    +
    +
    diff --git a/application/modules/formbuilder/views/fields/modal/settings_field_input_5.php b/application/modules/formbuilder/views/fields/modal/settings_field_input_5.php index 27439902..c947cbaf 100755 --- a/application/modules/formbuilder/views/fields/modal/settings_field_input_5.php +++ b/application/modules/formbuilder/views/fields/modal/settings_field_input_5.php @@ -9,76 +9,77 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?>
    -
    -
    -
    -
    - - -
    -
    -
    -
    - - +
    +
    +
    +
    + + +
    +
    +
    +
    + + -
    -
    -
    -
    -
    -
    -
    - -
    -
    - - -
    -
    -
    -
    -
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    + + +
    +
    +
    +
    +
    -
    -
    -
    - -
    - -
    -
    - +
    +
    +
    + +
    + +
    +
    +
    diff --git a/application/modules/formbuilder/views/fields/modal/settings_field_input_6.php b/application/modules/formbuilder/views/fields/modal/settings_field_input_6.php index 8caf93b6..a3007ad2 100755 --- a/application/modules/formbuilder/views/fields/modal/settings_field_input_6.php +++ b/application/modules/formbuilder/views/fields/modal/settings_field_input_6.php @@ -9,182 +9,183 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?>
    -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    - - -
    -
    -
    -
    - -
    -
    -
    - -
    -
    - -
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    + + +
    +
    +
    +
    + +
    +
    +
    + +
    +
    + +
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    - - -
    -
    -
    -
    - -
    -
    -
    - -
    -
    -
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    + + +
    +
    +
    +
    + +
    +
    +
    + +
    +
    +
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    - -
    -
    -
    - -
    -
    -
    - -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    -
    - -
    -
    -
    - -
    -
    -
    - -
    -
    -
    -
    -
    - -
    -
    - -
    -
    - - -
    -
    -
    - -
    -
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    +
    + +
    +
    +
    + +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + + +
    +
    +
    + +
    +
    diff --git a/application/modules/formbuilder/views/fields/modal/settings_field_input_7.php b/application/modules/formbuilder/views/fields/modal/settings_field_input_7.php index 7af00c83..ca324af1 100755 --- a/application/modules/formbuilder/views/fields/modal/settings_field_input_7.php +++ b/application/modules/formbuilder/views/fields/modal/settings_field_input_7.php @@ -9,48 +9,49 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?>
    -
    -
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    -
    -
    +
    +
    +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    +
    diff --git a/application/modules/formbuilder/views/fields/modal/settings_field_input_8.php b/application/modules/formbuilder/views/fields/modal/settings_field_input_8.php index e061f068..346ad1e6 100755 --- a/application/modules/formbuilder/views/fields/modal/settings_field_input_8.php +++ b/application/modules/formbuilder/views/fields/modal/settings_field_input_8.php @@ -9,28 +9,29 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?>
    -
    -
    -
    -
    - - - - -
    -
    -
    -
    +
    +
    +
    +
    + + + + +
    +
    +
    +
    diff --git a/application/modules/formbuilder/views/fields/modal/settings_field_input_9.php b/application/modules/formbuilder/views/fields/modal/settings_field_input_9.php index 992be5e8..e5ef90e1 100755 --- a/application/modules/formbuilder/views/fields/modal/settings_field_input_9.php +++ b/application/modules/formbuilder/views/fields/modal/settings_field_input_9.php @@ -9,85 +9,86 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?>
    -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    - - - -
    -
    -
    -
    -
    -
    - - - -
    -
    -
    -
    -
    -
    - - - -
    -
    -
    -
    -
    -
    - - - -
    -
    -
    -
    -
    -
    - - - -
    -
    -
    -
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + + +
    +
    +
    +
    diff --git a/application/modules/formbuilder/views/fields/modal/settings_field_label.php b/application/modules/formbuilder/views/fields/modal/settings_field_label.php index 8becac44..ee1245e2 100755 --- a/application/modules/formbuilder/views/fields/modal/settings_field_label.php +++ b/application/modules/formbuilder/views/fields/modal/settings_field_label.php @@ -9,679 +9,680 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?>
    - - + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    + + + + +
    +
    + +
    +
    -
    -
    - -
    - -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -
    -
    -
    -
    - +
    + +
    +
    + + + + + + + + + + + +
    +
    + +
    +
    +
    +
    + +
    + +
    + +
    +
    +
    +
    + +
    +
    + + + +
    +
    +
    +
    + + diff --git a/application/modules/formbuilder/views/fields/modal/settings_field_misc.php b/application/modules/formbuilder/views/fields/modal/settings_field_misc.php index 64a6441d..86bdc04b 100755 --- a/application/modules/formbuilder/views/fields/modal/settings_field_misc.php +++ b/application/modules/formbuilder/views/fields/modal/settings_field_misc.php @@ -9,319 +9,320 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?>
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    -
    -
    - - - -
    - true, - 'textarea_rows' => 5, - ); - // wp_editor('', 'uifm_fld_msc_text',$settings ); - ?> - -
    - -
    -
    -
    -
    -
    -
    - -
    - -
    -
    -
    -
    -
    - -
    - - - - - -
    +
    +
    + + + +
    + true, + 'textarea_rows' => 5, + ); + // wp_editor('', 'uifm_fld_msc_text',$settings ); + ?> + +
    + +
    +
    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    +
    + +
    + + + + + +
    -
    -
    -
    -
    -
    - -
    -
    - - - -
    -
    -
    -
    -
    -
    - -
    -
    - - - - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - -
    - -
    -
    -
    -
    -
    - -
    - -
    -
    -
    -
    -
    -
    - -
    - - -
    - - - - - - -
    -
    - - - - -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    - -
    - here goes the default error message -
    -
    -
    -
    -
    - - -
    -
    -
    -
    - -
    -
    -
    -
    - -
    -
    - - - - -
    -
    -
    -
    -
    -
    -
    - -
    - -
    -
    -
    -
    -
    - -
    - -
    -
    -
    -
    -
    -
    -
    - -
    -
    - - -
    -
    -
    -
    -
    -
    - +
    +
    +
    +
    +
    + +
    +
    + + + +
    +
    +
    +
    +
    +
    + +
    +
    + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    +
    +
    + +
    + + +
    + + + + + + +
    +
    + + + + +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    + +
    + here goes the default error message +
    +
    +
    +
    +
    + + +
    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    + + + + +
    +
    +
    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    +
    +
    +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    + diff --git a/application/modules/formbuilder/views/fields/modal/settings_field_validate.php b/application/modules/formbuilder/views/fields/modal/settings_field_validate.php index acbe38a0..d1dd61cf 100755 --- a/application/modules/formbuilder/views/fields/modal/settings_field_validate.php +++ b/application/modules/formbuilder/views/fields/modal/settings_field_validate.php @@ -9,507 +9,508 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?>
    -
    -
    - -
    -
    - -
    - -
    - -
    - - - - - -
    -
    - - - - -
    -
    - - -
    -
    - - -
    -
    -
    - - -
    - - - - - - - - - - -
    - -
    -
    - -
    -
    - - - - -
    -
    -
    -
    -
    -
    -
    - -
    - - -
    +
    +
    + +
    +
    + +
    + +
    + +
    + + + + + +
    +
    + + + + +
    +
    + + +
    +
    + + +
    +
    +
    + + +
    + + + + + + + + + + +
    + +
    +
    + +
    +
    + + + + +
    +
    +
    +
    +
    +
    +
    + +
    + + +
    -
    -
    -
    -
    - -
    - - - -
    +
    +
    +
    +
    + +
    + + + +
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - -
    - -
    -
    -
    -
    -
    - -
    - -
    -
    -
    -
    -
    -
    -
    - -
    -
    - - -
    -
    -
    -
    -
    -
    - +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    +
    +
    +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    +
    diff --git a/application/modules/formbuilder/views/fields/modal/settings_form_clogic.php b/application/modules/formbuilder/views/fields/modal/settings_form_clogic.php index 4d496ebe..c7e17e9f 100755 --- a/application/modules/formbuilder/views/fields/modal/settings_form_clogic.php +++ b/application/modules/formbuilder/views/fields/modal/settings_form_clogic.php @@ -9,164 +9,165 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?>
    -
    -
    -
    - - -
    - -
    -
    - -
    +
    +
    +
    + + +
    + +
    +
    + +
    -
    -
    - - - - - - -
    -
    - -
    +
    +
    + + + + + + +
    +
    + +
    -
    - - -
    - -
    - -
    -
    -
    -
    -
    -
    +
    +
    diff --git a/application/modules/formbuilder/views/fields/modal/settings_form_more.php b/application/modules/formbuilder/views/fields/modal/settings_form_more.php index 588b786b..0a661928 100755 --- a/application/modules/formbuilder/views/fields/modal/settings_form_more.php +++ b/application/modules/formbuilder/views/fields/modal/settings_form_more.php @@ -9,256 +9,257 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-form-builder.zigaform.com/ + * @link https://softdiscover.com/zigaform/wordpress-form-builder/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?>
    - - -
    - -
    -
    -
    -
    -
    - - -
    -
    - -
    + + +
    + +
    +
    +
    +
    +
    + + +
    +
    + +
    -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    - - -
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + + +
    -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    - - -
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + + +
    -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    - - -
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + + +
    -
    -
    -
    -
    -
    -
    - -
    - -
    -
    -
    -
    -
    - - -
    -
    - - -
    +
    +
    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    +
    + + +
    +
    + + +
    -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    - - -
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + + +
    -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    - - -
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + + +
    -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    - - -
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + + +
    -
    -
    -
    -
    -
    -
    - - -
    - -
    - -
    -
    -
    -
    - - -
    -
    - - -
    +
    +
    +
    +
    +
    +
    + + +
    + +
    + +
    +
    +
    +
    + + +
    +
    + + +
    -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    - - -
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + + +
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - - -
    -
    - -
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    + + +
    +
    + +
    -
    -
    -
    -
    - -
    -
    -
    - - - - - - +
    +
    +
    +
    + +
    +
    + + + + + + +
    \ No newline at end of file + /** + * Intranet + * + * PHP version 5 + * + * @category PHP + * @package Rocket_form + * @author Softdiscover + * @copyright 2015 Softdiscover + * @license http://www.php.net/license/3_01.txt PHP License 3.01 + * @link http://wordpress-form-builder.uiform.com/ + */ +if (!defined('BASEPATH')) { + exit('No direct script access allowed'); +} +?> + + \ No newline at end of file diff --git a/application/modules/formbuilder/views/fields/render_back/fieldoptions_data_10.php b/application/modules/formbuilder/views/fields/render_back/fieldoptions_data_10.php index 68421abc..f74e8a1e 100644 --- a/application/modules/formbuilder/views/fields/render_back/fieldoptions_data_10.php +++ b/application/modules/formbuilder/views/fields/render_back/fieldoptions_data_10.php @@ -1,17 +1,19 @@ - * @copyright 2015 Softdiscover - * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-form-builder.uiform.com/ - */ - if (!defined('BASEPATH')) {exit('No direct script access allowed');} - ?> - - \ No newline at end of file + /** + * Intranet + * + * PHP version 5 + * + * @category PHP + * @package Rocket_form + * @author Softdiscover + * @copyright 2015 Softdiscover + * @license http://www.php.net/license/3_01.txt PHP License 3.01 + * @link http://wordpress-form-builder.uiform.com/ + */ +if (!defined('BASEPATH')) { + exit('No direct script access allowed'); +} +?> + + \ No newline at end of file diff --git a/application/modules/formbuilder/views/fields/render_back/fieldoptions_data_11.php b/application/modules/formbuilder/views/fields/render_back/fieldoptions_data_11.php index a86fe933..cd7cfe0a 100644 --- a/application/modules/formbuilder/views/fields/render_back/fieldoptions_data_11.php +++ b/application/modules/formbuilder/views/fields/render_back/fieldoptions_data_11.php @@ -1,17 +1,19 @@ - * @copyright 2015 Softdiscover - * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-form-builder.uiform.com/ - */ - if (!defined('BASEPATH')) {exit('No direct script access allowed');} - ?> - - \ No newline at end of file + /** + * Intranet + * + * PHP version 5 + * + * @category PHP + * @package Rocket_form + * @author Softdiscover + * @copyright 2015 Softdiscover + * @license http://www.php.net/license/3_01.txt PHP License 3.01 + * @link http://wordpress-form-builder.uiform.com/ + */ +if (!defined('BASEPATH')) { + exit('No direct script access allowed'); +} +?> + + \ No newline at end of file diff --git a/application/modules/formbuilder/views/fields/render_back/fieldoptions_data_2.php b/application/modules/formbuilder/views/fields/render_back/fieldoptions_data_2.php index 47c4e6aa..f9a1bd23 100644 --- a/application/modules/formbuilder/views/fields/render_back/fieldoptions_data_2.php +++ b/application/modules/formbuilder/views/fields/render_back/fieldoptions_data_2.php @@ -1,17 +1,19 @@ - * @copyright 2015 Softdiscover - * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-form-builder.uiform.com/ - */ - if (!defined('BASEPATH')) {exit('No direct script access allowed');} - ?> - - \ No newline at end of file + /** + * Intranet + * + * PHP version 5 + * + * @category PHP + * @package Rocket_form + * @author Softdiscover + * @copyright 2015 Softdiscover + * @license http://www.php.net/license/3_01.txt PHP License 3.01 + * @link http://wordpress-form-builder.uiform.com/ + */ +if (!defined('BASEPATH')) { + exit('No direct script access allowed'); +} +?> + + \ No newline at end of file diff --git a/application/modules/formbuilder/views/fields/render_back/fieldoptions_data_3.php b/application/modules/formbuilder/views/fields/render_back/fieldoptions_data_3.php index d63e86a8..ab3e03a1 100644 --- a/application/modules/formbuilder/views/fields/render_back/fieldoptions_data_3.php +++ b/application/modules/formbuilder/views/fields/render_back/fieldoptions_data_3.php @@ -1,17 +1,19 @@ - * @copyright 2015 Softdiscover - * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-form-builder.uiform.com/ - */ - if (!defined('BASEPATH')) {exit('No direct script access allowed');} - ?> - - \ No newline at end of file + /** + * Intranet + * + * PHP version 5 + * + * @category PHP + * @package Rocket_form + * @author Softdiscover + * @copyright 2015 Softdiscover + * @license http://www.php.net/license/3_01.txt PHP License 3.01 + * @link http://wordpress-form-builder.uiform.com/ + */ +if (!defined('BASEPATH')) { + exit('No direct script access allowed'); +} +?> + + \ No newline at end of file diff --git a/application/modules/formbuilder/views/fields/render_back/fieldoptions_data_4.php b/application/modules/formbuilder/views/fields/render_back/fieldoptions_data_4.php index a0a2a9bf..f83024b9 100644 --- a/application/modules/formbuilder/views/fields/render_back/fieldoptions_data_4.php +++ b/application/modules/formbuilder/views/fields/render_back/fieldoptions_data_4.php @@ -1,17 +1,19 @@ - * @copyright 2015 Softdiscover - * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-form-builder.uiform.com/ - */ - if (!defined('BASEPATH')) {exit('No direct script access allowed');} - ?> - - \ No newline at end of file + /** + * Intranet + * + * PHP version 5 + * + * @category PHP + * @package Rocket_form + * @author Softdiscover + * @copyright 2015 Softdiscover + * @license http://www.php.net/license/3_01.txt PHP License 3.01 + * @link http://wordpress-form-builder.uiform.com/ + */ +if (!defined('BASEPATH')) { + exit('No direct script access allowed'); +} +?> + + \ No newline at end of file diff --git a/application/modules/formbuilder/views/fields/render_back/fieldoptions_data_5.php b/application/modules/formbuilder/views/fields/render_back/fieldoptions_data_5.php index 42b9dc9a..69f65e94 100644 --- a/application/modules/formbuilder/views/fields/render_back/fieldoptions_data_5.php +++ b/application/modules/formbuilder/views/fields/render_back/fieldoptions_data_5.php @@ -1,17 +1,19 @@ - * @copyright 2015 Softdiscover - * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-form-builder.uiform.com/ - */ - if (!defined('BASEPATH')) {exit('No direct script access allowed');} - ?> - - \ No newline at end of file + /** + * Intranet + * + * PHP version 5 + * + * @category PHP + * @package Rocket_form + * @author Softdiscover + * @copyright 2015 Softdiscover + * @license http://www.php.net/license/3_01.txt PHP License 3.01 + * @link http://wordpress-form-builder.uiform.com/ + */ +if (!defined('BASEPATH')) { + exit('No direct script access allowed'); +} +?> + + \ No newline at end of file diff --git a/application/modules/formbuilder/views/fields/render_back/fieldoptions_data_6.php b/application/modules/formbuilder/views/fields/render_back/fieldoptions_data_6.php index 1c3ad885..eb6bf4ee 100644 --- a/application/modules/formbuilder/views/fields/render_back/fieldoptions_data_6.php +++ b/application/modules/formbuilder/views/fields/render_back/fieldoptions_data_6.php @@ -1,17 +1,19 @@ - * @copyright 2015 Softdiscover - * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-form-builder.uiform.com/ - */ - if (!defined('BASEPATH')) {exit('No direct script access allowed');} - ?> - - \ No newline at end of file + /** + * Intranet + * + * PHP version 5 + * + * @category PHP + * @package Rocket_form + * @author Softdiscover + * @copyright 2015 Softdiscover + * @license http://www.php.net/license/3_01.txt PHP License 3.01 + * @link http://wordpress-form-builder.uiform.com/ + */ +if (!defined('BASEPATH')) { + exit('No direct script access allowed'); +} +?> + + \ No newline at end of file diff --git a/application/modules/formbuilder/views/fields/render_back/fieldoptions_data_8.php b/application/modules/formbuilder/views/fields/render_back/fieldoptions_data_8.php index d245d0d4..56703dc3 100644 --- a/application/modules/formbuilder/views/fields/render_back/fieldoptions_data_8.php +++ b/application/modules/formbuilder/views/fields/render_back/fieldoptions_data_8.php @@ -1,17 +1,19 @@ - * @copyright 2015 Softdiscover - * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-form-builder.uiform.com/ - */ - if (!defined('BASEPATH')) {exit('No direct script access allowed');} - ?> - - \ No newline at end of file + /** + * Intranet + * + * PHP version 5 + * + * @category PHP + * @package Rocket_form + * @author Softdiscover + * @copyright 2015 Softdiscover + * @license http://www.php.net/license/3_01.txt PHP License 3.01 + * @link http://wordpress-form-builder.uiform.com/ + */ +if (!defined('BASEPATH')) { + exit('No direct script access allowed'); +} +?> + + \ No newline at end of file diff --git a/application/modules/formbuilder/views/fields/render_back/fieldoptions_data_9.php b/application/modules/formbuilder/views/fields/render_back/fieldoptions_data_9.php index 224f23bc..fa9cf5f0 100644 --- a/application/modules/formbuilder/views/fields/render_back/fieldoptions_data_9.php +++ b/application/modules/formbuilder/views/fields/render_back/fieldoptions_data_9.php @@ -1,17 +1,19 @@ - * @copyright 2015 Softdiscover - * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-form-builder.uiform.com/ - */ - if (!defined('BASEPATH')) {exit('No direct script access allowed');} - ?> - - \ No newline at end of file + /** + * Intranet + * + * PHP version 5 + * + * @category PHP + * @package Rocket_form + * @author Softdiscover + * @copyright 2015 Softdiscover + * @license http://www.php.net/license/3_01.txt PHP License 3.01 + * @link http://wordpress-form-builder.uiform.com/ + */ +if (!defined('BASEPATH')) { + exit('No direct script access allowed'); +} +?> + + \ No newline at end of file diff --git a/application/modules/formbuilder/views/fields/render_css_front/addon_css.php b/application/modules/formbuilder/views/fields/render_css_front/addon_css.php index 746d877a..98a9e912 100755 --- a/application/modules/formbuilder/views/fields/render_css_front/addon_css.php +++ b/application/modules/formbuilder/views/fields/render_css_front/addon_css.php @@ -9,29 +9,30 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-form-builder.zigaform.com/ + * @link https://softdiscover.com/zigaform/wordpress-form-builder/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?> #rockfm_ { - = 0 ) { - ?> - animation-delay: s; - + = 0) { + ?> + animation-delay: s; + } - + diff --git a/application/modules/formbuilder/views/fields/render_css_front/block_main.php b/application/modules/formbuilder/views/fields/render_css_front/block_main.php index 323231db..98780c6d 100755 --- a/application/modules/formbuilder/views/fields/render_css_front/block_main.php +++ b/application/modules/formbuilder/views/fields/render_css_front/block_main.php @@ -1,18 +1,19 @@ - - - - + + + + * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?> - + #rockfm_ .rockfm-label{ - + display:block; - - font-size:px; - - - font-weight: bold; - - font-weight: normal; - - - font-style:italic; - - - text-decoration:underline; - - - color:; - - - - - font-family:; - - - - - - text-shadow: ; - - + + font-size:px; + + + font-weight: bold; + + font-weight: normal; + + + font-style:italic; + + + text-decoration:underline; + + + color:; + + + + + font-family:; + + + + + + text-shadow: ; + + } - + #rockfm_ .rockfm-sublabel{ - - - font-size:px; - - - font-weight: bold; - - font-weight: normal; - - - - font-style:italic; - - - text-decoration:underline; - - - color:; - - - - - font-family:; - - - - - - text-shadow: ; - - + + + font-size:px; + + + font-weight: bold; + + font-weight: normal; + + + + font-style:italic; + + + text-decoration:underline; + + + color:; + + + + + font-family:; + + + + + + text-shadow: ; + + } - + #rockfm_ .rockfm-control-label{ - - text-align: center; - - text-align: right; - - text-align: left; - - + + text-align: center; + + text-align: right; + + text-align: left; + + } #rockfm_ .rockfm-wrap-label{ - - display:none; - + + display:none; + } - + #rockfm_ .rockfm-help-block{ - - - - font-family:; - - - - + + + + font-family:; + + + + } /*popover custom*/ .popover_ { - - background:!important; - - - color:; - - + + background:!important; + + + color:; + + } .popover_ .popover-arrow:after, .popover_ .arrow:after{ - - border-top-color:!important; - + + border-top-color:!important; + } diff --git a/application/modules/formbuilder/views/fields/render_css_front/common_css2.php b/application/modules/formbuilder/views/fields/render_css_front/common_css2.php index 121c326f..b1b1546c 100755 --- a/application/modules/formbuilder/views/fields/render_css_front/common_css2.php +++ b/application/modules/formbuilder/views/fields/render_css_front/common_css2.php @@ -9,43 +9,44 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-form-builder.zigaform.com/ + * @link https://softdiscover.com/zigaform/wordpress-form-builder/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?> #rockfm_ { - - padding: px px px px; - - - padding:0px 0px 0px 0px; - - - margin: px px px px; - - - margin:0px 0px 0px 0px; - + + padding: px px px px; + + + padding:0px 0px 0px 0px; + + + margin: px px px px; + + + margin:0px 0px 0px 0px; + } diff --git a/application/modules/formbuilder/views/fields/render_css_front/type_appprep.php b/application/modules/formbuilder/views/fields/render_css_front/type_appprep.php index d1ac7d41..79ff5e2c 100755 --- a/application/modules/formbuilder/views/fields/render_css_front/type_appprep.php +++ b/application/modules/formbuilder/views/fields/render_css_front/type_appprep.php @@ -1,15 +1,16 @@ - #rockfm_ .rockfm-input2-wrap .rockfm-inp2-opt-label{ - - - font-size:px; - - - font-weight: bold; - - - font-style:italic; - - - text-decoration:underline; - - - color:; - - - - - font-family:; - - - - - - - } + #rockfm_ .rockfm-input2-wrap .rockfm-inp2-opt-label{ + + + font-size:px; + + + font-weight: bold; + + + font-style:italic; + + + text-decoration:underline; + + + color:; + + + + + font-family:; + + + + + + + } #rockfm_ .rockfm-inp2-opt-price-lbl, #rockfm_ .rockfm-inp2-opt-price-lbl span{ - - color:; - - - - - font-family:""; - - - - + + color:; + + + + + font-family:""; + + + + } - - #rockfm_ .checkradios-checkbox, - #rockfm_ .checkradios-radio { - - border:2px solid ; - - - background: ; - - - color: ; - - - font-size: px; - - } - + + #rockfm_ .checkradios-checkbox, + #rockfm_ .checkradios-radio { + + border:2px solid ; + + + background: ; + + + color: ; + + + font-size: px; + + } + diff --git a/application/modules/formbuilder/views/fields/render_css_front/type_colorpicker.php b/application/modules/formbuilder/views/fields/render_css_front/type_colorpicker.php index d1ac7d41..79ff5e2c 100755 --- a/application/modules/formbuilder/views/fields/render_css_front/type_colorpicker.php +++ b/application/modules/formbuilder/views/fields/render_css_front/type_colorpicker.php @@ -1,15 +1,16 @@ #rockfm_ .rockfm-input3-customhtml{ - - - font-size:px; - - - font-weight: bold; - - - font-style:italic; - - - text-decoration:underline; - - - color:; - - - - - font-family:; - - - - - - text-align:center; - - text-align:right; - - text-align:left; - - - } + + + font-size:px; + + + font-weight: bold; + + + font-style:italic; + + + text-decoration:underline; + + + color:; + + + + + font-family:; + + + + + + text-align:center; + + text-align:right; + + text-align:left; + + + } diff --git a/application/modules/formbuilder/views/fields/render_css_front/type_date2.php b/application/modules/formbuilder/views/fields/render_css_front/type_date2.php index d1ac7d41..79ff5e2c 100755 --- a/application/modules/formbuilder/views/fields/render_css_front/type_date2.php +++ b/application/modules/formbuilder/views/fields/render_css_front/type_date2.php @@ -1,15 +1,16 @@ - #rockfm_ .rockfm-divider-text{ - - display: flex; - flex-direction: row; - justify-content: center; - align-items: center; - - - font-size:px; - - - font-weight: bold; - - - font-style:italic; - - - text-decoration:underline; - - - color:; - - - - - font-family:; - - - - margin: 0 1em; - - + #rockfm_ .rockfm-divider-text{ + + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + + + font-size:px; + + + font-weight: bold; + + + font-style:italic; + + + text-decoration:underline; + + + color:; + + + + + font-family:; + + + + margin: 0 1em; + + - - background:; - - background: ; - background-image: -webkit-linear-gradient(top, , ); - background-image: -moz-linear-gradient(top, , ); - background-image: -ms-linear-gradient(top, , ); - background-image: -o-linear-gradient(top, , ); - background-image: linear-gradient(to bottom, , ); - - - background-image:url(""); - background-repeat:repeat; - - - - padding:10px; - - - } - + switch ( intval($form_skin['form_background']['type'])) { + case 1: + // solid + if ( ! empty($form_skin['form_background']['solid_color'])) { + ?> + background:; + + background: ; + background-image: -webkit-linear-gradient(top, , ); + background-image: -moz-linear-gradient(top, , ); + background-image: -ms-linear-gradient(top, , ); + background-image: -o-linear-gradient(top, , ); + background-image: linear-gradient(to bottom, , ); + + + background-image:url(""); + background-repeat:repeat; + + + padding:10px; + + + } + #rockfm_ .rockfm-divider-text::before{ content: ''; height: .125em; flex: 1; margin: 0 .25em 0 0; - - background: ; - + + background: ; + } #rockfm_ .rockfm-divider-text::after{ content: ''; height: .125em; - - background: ; - + + background: ; + flex: 1; margin: 0 0 0 .25em; } @@ -119,9 +119,9 @@ diff --git a/application/modules/formbuilder/views/fields/render_css_front/type_dyncheckbox.php b/application/modules/formbuilder/views/fields/render_css_front/type_dyncheckbox.php index 91ebcfa2..0f9ef85c 100755 --- a/application/modules/formbuilder/views/fields/render_css_front/type_dyncheckbox.php +++ b/application/modules/formbuilder/views/fields/render_css_front/type_dyncheckbox.php @@ -1,35 +1,36 @@ #rockfm_ .rockfm-inp2-opt-price-lbl, #rockfm_ .rockfm-inp2-opt-price-lbl span{ - - color:; - - - - - font-family:""; - - - - + + color:; + + + + + font-family:""; + + + + } diff --git a/application/modules/formbuilder/views/fields/render_css_front/type_dynradiobtn.php b/application/modules/formbuilder/views/fields/render_css_front/type_dynradiobtn.php index a3d43e76..04e61335 100755 --- a/application/modules/formbuilder/views/fields/render_css_front/type_dynradiobtn.php +++ b/application/modules/formbuilder/views/fields/render_css_front/type_dynradiobtn.php @@ -1,35 +1,36 @@ #rockfm_ .rockfm-inp2-opt-price-lbl, #rockfm_ .rockfm-inp2-opt-price-lbl span{ - - color:; - - - - - font-family:""; - - - - + + color:; + + + + + font-family:""; + + + + } diff --git a/application/modules/formbuilder/views/fields/render_css_front/type_fileupload.php b/application/modules/formbuilder/views/fields/render_css_front/type_fileupload.php index d1ac7d41..79ff5e2c 100755 --- a/application/modules/formbuilder/views/fields/render_css_front/type_fileupload.php +++ b/application/modules/formbuilder/views/fields/render_css_front/type_fileupload.php @@ -1,15 +1,16 @@ #rockfm_ .rockfm-input-container{ - text-align:center; - - text-align:right; - - text-align:left; - + switch ( intval($input['obj_align'])) { + case 1: + ?> + text-align:center; + + text-align:right; + + text-align:left; + } #rockfm_ .rockfm-heading{ - - display:inline-block; - - font-size:px; - - - font-weight: bold; - - - font-style:italic; - - - text-decoration:underline; - - - color:; - - - - - font-family:; - - - - - - background:; - - background: ; - background-image: -webkit-linear-gradient(top, , ); - background-image: -moz-linear-gradient(top, , ); - background-image: -ms-linear-gradient(top, , ); - background-image: -o-linear-gradient(top, , ); - background-image: linear-gradient(to bottom, , ); - - - - -webkit-border-radius: ; - -moz-border-radius: ; - border-radius: px; - - - border: px; - - } - - #rockfm_ .rockfm-txtbox-inp-val:focus{ - border: px; - } - + + display:inline-block; + + font-size:px; + + + font-weight: bold; + + + font-style:italic; + + + text-decoration:underline; + + + color:; + + + + + font-family:; + + + + + + background:; + + background: ; + background-image: -webkit-linear-gradient(top, , ); + background-image: -moz-linear-gradient(top, , ); + background-image: -ms-linear-gradient(top, , ); + background-image: -o-linear-gradient(top, , ); + background-image: linear-gradient(to bottom, , ); + + + + -webkit-border-radius: ; + -moz-border-radius: ; + border-radius: px; + + + border: px; + + } + + #rockfm_ .rockfm-txtbox-inp-val:focus{ + border: px; + } + diff --git a/application/modules/formbuilder/views/fields/render_css_front/type_hiddenfield.php b/application/modules/formbuilder/views/fields/render_css_front/type_hiddenfield.php index d1ac7d41..79ff5e2c 100755 --- a/application/modules/formbuilder/views/fields/render_css_front/type_hiddenfield.php +++ b/application/modules/formbuilder/views/fields/render_css_front/type_hiddenfield.php @@ -1,15 +1,16 @@ - #rockfm_ .rockfm-input2-wrap .rockfm-inp2-opt-label{ - - - font-size:px; - - - font-weight: bold; - - - font-style:italic; - - - text-decoration:underline; - - - color:; - - - - - font-family:; - - - - - - } - - - - + #rockfm_ .rockfm-input2-wrap .rockfm-inp2-opt-label{ + + + font-size:px; + + + font-weight: bold; + + + font-style:italic; + + + text-decoration:underline; + + + color:; + + + + + font-family:; + + + + + + } + + + #rockfm_ .rockfm-input2-wrap button.sfdc-btn { - - background-image: linear-gradient(to bottom, 0%, 100%)!important; - - - border-color:!important; - + + background-image: linear-gradient(to bottom, 0%, 100%)!important; + + + border-color:!important; + } #rockfm_ .rockfm-input2-wrap button.sfdc-btn:hover, # .rockfm-input2-wrap button.sfdc-btn:focus { - - background-image: linear-gradient(to bottom, 0%, 100%)!important; - background-position:0px 0px!important; - - - border-color:!important; - + + background-image: linear-gradient(to bottom, 0%, 100%)!important; + background-position:0px 0px!important; + + + border-color:!important; + } #rockfm_ .rockfm-input2-wrap .sfdc-bs-caret { - - color:!important; - + + color:!important; + } #rockfm_ .rockfm-input2-wrap .filter-option { - - color:!important; - text-shadow:0 1px 0 !important; - - - font-weight:bold; - - font-weight:normal; - - - font-style:italic; - - - text-decoration:underline; - - - font-size:!important; - + + color:!important; + text-shadow:0 1px 0 !important; + + + font-weight:bold; + + font-weight:normal; + + + font-style:italic; + + + text-decoration:underline; + + + font-size:!important; + } #rockfm_ .rockfm-input2-wrap .filter-option, #rockfm_ .bootstrap-select.sfdc-btn-group .sfdc-dropdown-menu li a span.text { - - - - font-family:!important; - - - + + + + font-family:!important; + + + } - - - + + + diff --git a/application/modules/formbuilder/views/fields/render_css_front/type_password.php b/application/modules/formbuilder/views/fields/render_css_front/type_password.php index 1c833e01..02c673be 100755 --- a/application/modules/formbuilder/views/fields/render_css_front/type_password.php +++ b/application/modules/formbuilder/views/fields/render_css_front/type_password.php @@ -1,95 +1,95 @@ #rockfm_ .rockfm-txtbox-inp-val{ - - - - background:; - - background: ; - background-image: -webkit-linear-gradient(top, , ); - background-image: -moz-linear-gradient(top, , ); - background-image: -ms-linear-gradient(top, , ); - background-image: -o-linear-gradient(top, , ); - background-image: linear-gradient(to bottom, , ); - - - - -webkit-border-radius: ; - -moz-border-radius: ; - border-radius: px; - - - border: px; - - } - - #rockfm_ .rockfm-txtbox-inp-val:focus{ - border: px; - } - + + + + background:; + + background: ; + background-image: -webkit-linear-gradient(top, , ); + background-image: -moz-linear-gradient(top, , ); + background-image: -ms-linear-gradient(top, , ); + background-image: -o-linear-gradient(top, , ); + background-image: linear-gradient(to bottom, , ); + + + + -webkit-border-radius: ; + -moz-border-radius: ; + border-radius: px; + + + border: px; + + } + + #rockfm_ .rockfm-txtbox-inp-val:focus{ + border: px; + } + diff --git a/application/modules/formbuilder/views/fields/render_css_front/type_preptext.php b/application/modules/formbuilder/views/fields/render_css_front/type_preptext.php index d1ac7d41..79ff5e2c 100755 --- a/application/modules/formbuilder/views/fields/render_css_front/type_preptext.php +++ b/application/modules/formbuilder/views/fields/render_css_front/type_preptext.php @@ -1,15 +1,16 @@ - #rockfm_ .rockfm-input2-wrap .rockfm-inp2-opt-label{ - - - font-size:px; - - - font-weight: bold; - - - font-style:italic; - - - text-decoration:underline; - - - color:; - - - - - font-family:; - - - - - - } + #rockfm_ .rockfm-input2-wrap .rockfm-inp2-opt-label{ + + + font-size:px; + + + font-weight: bold; + + + font-style:italic; + + + text-decoration:underline; + + + color:; + + + + + font-family:; + + + + + + } #rockfm_ .rockfm-inp2-opt-price-lbl, #rockfm_ .rockfm-inp2-opt-price-lbl span{ - - color:; - - - - - font-family:""; - - - - + + color:; + + + + + font-family:""; + + + + } - - #rockfm_ .checkradios-checkbox, - #rockfm_ .checkradios-radio { - - border:2px solid ; - - - background: ; - - - color: ; - - - font-size: px; - - } - + + #rockfm_ .checkradios-checkbox, + #rockfm_ .checkradios-radio { + + border:2px solid ; + + + background: ; + + + color: ; + + + font-size: px; + + } + diff --git a/application/modules/formbuilder/views/fields/render_css_front/type_range.php b/application/modules/formbuilder/views/fields/render_css_front/type_range.php index d1ac7d41..79ff5e2c 100755 --- a/application/modules/formbuilder/views/fields/render_css_front/type_range.php +++ b/application/modules/formbuilder/views/fields/render_css_front/type_range.php @@ -1,15 +1,16 @@ - #rockfm_ .rockfm-input2-wrap .rockfm-inp2-opt-label{ - - - font-size:px; - - - font-weight: bold; - - - font-style:italic; - - - text-decoration:underline; - - - color:; - - - - - font-family:; - - - - - - } + #rockfm_ .rockfm-input2-wrap .rockfm-inp2-opt-label{ + + + font-size:px; + + + font-weight: bold; + + + font-style:italic; + + + text-decoration:underline; + + + color:; + + + + + font-family:; + + + + + + } - - + #rockfm_ .rockfm-input2-wrap button.sfdc-btn { - - background-image: linear-gradient(to bottom, 0%, 100%)!important; - - - border-color:!important; - + + background-image: linear-gradient(to bottom, 0%, 100%)!important; + + + border-color:!important; + } #rockfm_ .rockfm-input2-wrap button.sfdc-btn:hover, # .rockfm-input2-wrap button.sfdc-btn:focus { - - background-image: linear-gradient(to bottom, 0%, 100%)!important; - background-position:0px 0px!important; - - - border-color:!important; - + + background-image: linear-gradient(to bottom, 0%, 100%)!important; + background-position:0px 0px!important; + + + border-color:!important; + } #rockfm_ .rockfm-input2-wrap .sfdc-bs-caret { - - color:!important; - + + color:!important; + } #rockfm_ .rockfm-input2-wrap .filter-option { - - color:!important; - text-shadow:0 1px 0 !important; - - - font-weight:bold; - - font-weight:normal; - - - font-style:italic; - - - text-decoration:underline; - - - font-size:!important; - + + color:!important; + text-shadow:0 1px 0 !important; + + + font-weight:bold; + + font-weight:normal; + + + font-style:italic; + + + text-decoration:underline; + + + font-size:!important; + } #rockfm_ .rockfm-input2-wrap .filter-option, #rockfm_ .bootstrap-select.sfdc-btn-group .sfdc-dropdown-menu li a span.text { - - - - font-family:!important; - - - + + + + font-family:!important; + + + } - - + + diff --git a/application/modules/formbuilder/views/fields/render_css_front/type_slider.php b/application/modules/formbuilder/views/fields/render_css_front/type_slider.php index e88b267f..476ca7b8 100755 --- a/application/modules/formbuilder/views/fields/render_css_front/type_slider.php +++ b/application/modules/formbuilder/views/fields/render_css_front/type_slider.php @@ -1,35 +1,36 @@ #rockfm_ .rockfm-inp4-opt-price-lbl, #rockfm_ .rockfm-inp4-opt-price-lbl span{ - - color:; - - - - - font-family:""; - - - - + + color:; + + + + + font-family:""; + + + + } diff --git a/application/modules/formbuilder/views/fields/render_css_front/type_spinner.php b/application/modules/formbuilder/views/fields/render_css_front/type_spinner.php index 56d92400..60aaa061 100755 --- a/application/modules/formbuilder/views/fields/render_css_front/type_spinner.php +++ b/application/modules/formbuilder/views/fields/render_css_front/type_spinner.php @@ -1,46 +1,47 @@ #rockfm_ .rockfm-inp4-opt-price-lbl, #rockfm_ .rockfm-inp4-opt-price-lbl span{ - - color:; - - - - - font-family:""; - - - - + + color:; + + + + + font-family:""; + + + + } - #rockfm_ .rockfm-input4-wrap{ - - width:100%; - max-width: px; - + #rockfm_ .rockfm-input4-wrap{ + + width:100%; + max-width: px; + } diff --git a/application/modules/formbuilder/views/fields/render_css_front/type_starrating.php b/application/modules/formbuilder/views/fields/render_css_front/type_starrating.php index d1ac7d41..79ff5e2c 100755 --- a/application/modules/formbuilder/views/fields/render_css_front/type_starrating.php +++ b/application/modules/formbuilder/views/fields/render_css_front/type_starrating.php @@ -1,15 +1,16 @@ #rockfm_ .rockfm-input-container{ - text-align:center; - - text-align:right; - - text-align:left; - + switch ( intval($input['obj_align'])) { + case 1: + ?> + text-align:center; + + text-align:right; + + text-align:left; + } #rockfm_ .rockfm-txtbox-inp-val{ - - - font-size:px; - - - font-weight: bold; - - - font-style:italic; - - - text-decoration:underline; - - - color:; - - - - - font-family:; - - - - - - background:; - - background: ; - background-image: -webkit-linear-gradient(top, , ); - background-image: -moz-linear-gradient(top, , ); - background-image: -ms-linear-gradient(top, , ); - background-image: -o-linear-gradient(top, , ); - background-image: linear-gradient(to bottom, , ); - - - - -webkit-border-radius: ; - -moz-border-radius: ; - border-radius: px; - - - border: px; - - } - - #rockfm_ .rockfm-txtbox-inp-val:focus{ - border: px; - } - + + + font-size:px; + + + font-weight: bold; + + + font-style:italic; + + + text-decoration:underline; + + + color:; + + + + + font-family:; + + + + + + background:; + + background: ; + background-image: -webkit-linear-gradient(top, , ); + background-image: -moz-linear-gradient(top, , ); + background-image: -ms-linear-gradient(top, , ); + background-image: -o-linear-gradient(top, , ); + background-image: linear-gradient(to bottom, , ); + + + + -webkit-border-radius: ; + -moz-border-radius: ; + border-radius: px; + + + border: px; + + } + + #rockfm_ .rockfm-txtbox-inp-val:focus{ + border: px; + } + diff --git a/application/modules/formbuilder/views/fields/render_css_front/type_switch.php b/application/modules/formbuilder/views/fields/render_css_front/type_switch.php index d2e5fad3..b4a0a4a7 100755 --- a/application/modules/formbuilder/views/fields/render_css_front/type_switch.php +++ b/application/modules/formbuilder/views/fields/render_css_front/type_switch.php @@ -1,35 +1,36 @@ #rockfm_ .rockfm-inp15-opt-price-lbl, #rockfm_ .rockfm-inp15-opt-price-lbl span{ - - color:; - - - - - font-family:""; - - - - + + color:; + + + + + font-family:""; + + + + } diff --git a/application/modules/formbuilder/views/fields/render_css_front/type_textarea.php b/application/modules/formbuilder/views/fields/render_css_front/type_textarea.php index 9bd3a9f3..89dbfe91 100755 --- a/application/modules/formbuilder/views/fields/render_css_front/type_textarea.php +++ b/application/modules/formbuilder/views/fields/render_css_front/type_textarea.php @@ -1,148 +1,148 @@ - #rockfm_ .rockfm-txtbox-inp-val{ - - - font-size:px; - - - font-weight: bold; - - - font-style:italic; - - - text-decoration:underline; - - - color:; - - - - - font-family:; - - - - - text-align:center; - - text-align:right; - - text-align:left; - - - background:; - - background: ; - background-image: -webkit-linear-gradient(top, , ); - background-image: -moz-linear-gradient(top, , ); - background-image: -ms-linear-gradient(top, , ); - background-image: -o-linear-gradient(top, , ); - background-image: linear-gradient(to bottom, , ); - - - - -webkit-border-radius: ; - -moz-border-radius: ; - border-radius: px; - - - border: px; - - } - - #rockfm_ .rockfm-txtbox-inp-val:focus{ - border: px; - } - - + #rockfm_ .rockfm-txtbox-inp-val{ + + + font-size:px; + + + font-weight: bold; + + + font-style:italic; + + + text-decoration:underline; + + + color:; + + + + + font-family:; + + + + + text-align:center; + + text-align:right; + + text-align:left; + + + background:; + + background: ; + background-image: -webkit-linear-gradient(top, , ); + background-image: -moz-linear-gradient(top, , ); + background-image: -ms-linear-gradient(top, , ); + background-image: -o-linear-gradient(top, , ); + background-image: linear-gradient(to bottom, , ); + + + + -webkit-border-radius: ; + -moz-border-radius: ; + border-radius: px; + + + border: px; + + } + + #rockfm_ .rockfm-txtbox-inp-val:focus{ + border: px; + } + + #rockfm_ textarea{ - min-height: 50px; - } - + min-height: 50px; + } + diff --git a/application/modules/formbuilder/views/fields/render_css_front/type_textbox.php b/application/modules/formbuilder/views/fields/render_css_front/type_textbox.php index a06bae01..35330671 100755 --- a/application/modules/formbuilder/views/fields/render_css_front/type_textbox.php +++ b/application/modules/formbuilder/views/fields/render_css_front/type_textbox.php @@ -1,144 +1,144 @@ - #rockfm_ .rockfm-txtbox-inp-val{ - - - font-size:px; - - - font-weight: bold; - - - font-style:italic; - - - text-decoration:underline; - - - color:; - - - - - font-family:; - - - - - text-align:center; - - text-align:right; - - text-align:left; - - - background:; - - background: ; - background-image: -webkit-linear-gradient(top, , ); - background-image: -moz-linear-gradient(top, , ); - background-image: -ms-linear-gradient(top, , ); - background-image: -o-linear-gradient(top, , ); - background-image: linear-gradient(to bottom, , ); - - - - -webkit-border-radius: ; - -moz-border-radius: ; - border-radius: px; - - - border: px; - - } - - #rockfm_ .rockfm-txtbox-inp-val:focus{ - border: px; - } - + #rockfm_ .rockfm-txtbox-inp-val{ + + + font-size:px; + + + font-weight: bold; + + + font-style:italic; + + + text-decoration:underline; + + + color:; + + + + + font-family:; + + + + + text-align:center; + + text-align:right; + + text-align:left; + + + background:; + + background: ; + background-image: -webkit-linear-gradient(top, , ); + background-image: -moz-linear-gradient(top, , ); + background-image: -ms-linear-gradient(top, , ); + background-image: -o-linear-gradient(top, , ); + background-image: linear-gradient(to bottom, , ); + + + + -webkit-border-radius: ; + -moz-border-radius: ; + border-radius: px; + + + border: px; + + } + + #rockfm_ .rockfm-txtbox-inp-val:focus{ + border: px; + } + diff --git a/application/modules/formbuilder/views/fields/render_css_front/type_timepicker.php b/application/modules/formbuilder/views/fields/render_css_front/type_timepicker.php index d1ac7d41..79ff5e2c 100755 --- a/application/modules/formbuilder/views/fields/render_css_front/type_timepicker.php +++ b/application/modules/formbuilder/views/fields/render_css_front/type_timepicker.php @@ -1,15 +1,16 @@ #rockfm_ .rockfm-input-container{ - text-align:center; - - text-align:right; - - text-align:left; - + switch ( intval($input14['obj_align'])) { + case 1: + ?> + text-align:center; + + text-align:right; + + text-align:left; + } #rockfm_ .rockfm-btn-wiznext{ - - - font-size:px; - - - font-weight: bold; - - - font-style:italic; - - - text-decoration:underline; - - - color:; - - - - - font-family:; - - - - - - background:; - - background: ; - background-image: -webkit-linear-gradient(top, , ); - background-image: -moz-linear-gradient(top, , ); - background-image: -ms-linear-gradient(top, , ); - background-image: -o-linear-gradient(top, , ); - background-image: linear-gradient(to bottom, , ); - - - - -webkit-border-radius: ; - -moz-border-radius: ; - border-radius: px; - - - border: px; - - } - - #rockfm_ .rockfm-btn-wiznext:focus{ - border: px; - } - + + + font-size:px; + + + font-weight: bold; + + + font-style:italic; + + + text-decoration:underline; + + + color:; + + + + + font-family:; + + + + + + background:; + + background: ; + background-image: -webkit-linear-gradient(top, , ); + background-image: -moz-linear-gradient(top, , ); + background-image: -ms-linear-gradient(top, , ); + background-image: -o-linear-gradient(top, , ); + background-image: linear-gradient(to bottom, , ); + + + + -webkit-border-radius: ; + -moz-border-radius: ; + border-radius: px; + + + border: px; + + } + + #rockfm_ .rockfm-btn-wiznext:focus{ + border: px; + } + #rockfm_ .rockfm-btn-wizprev{ - - - font-size:px; - - - font-weight: bold; - - - font-style:italic; - - - text-decoration:underline; - - - color:; - - - - - font-family:; - - - - - - background:; - - background: ; - background-image: -webkit-linear-gradient(top, , ); - background-image: -moz-linear-gradient(top, , ); - background-image: -ms-linear-gradient(top, , ); - background-image: -o-linear-gradient(top, , ); - background-image: linear-gradient(to bottom, , ); - - - - -webkit-border-radius: ; - -moz-border-radius: ; - border-radius: px; - - - border: px; - - } - - #rockfm_ .rockfm-btn-wizprev:focus{ - border: px; - } - - - + + + font-size:px; + + + font-weight: bold; + + + font-style:italic; + + + text-decoration:underline; + + + color:; + + + + + font-family:; + + + + + + background:; + + background: ; + background-image: -webkit-linear-gradient(top, , ); + background-image: -moz-linear-gradient(top, , ); + background-image: -ms-linear-gradient(top, , ); + background-image: -o-linear-gradient(top, , ); + background-image: linear-gradient(to bottom, , ); + + + + -webkit-border-radius: ; + -moz-border-radius: ; + border-radius: px; + + + border: px; + + } + + #rockfm_ .rockfm-btn-wizprev:focus{ + border: px; + } + + + #rockfm_ .rockfm-help-block{ - - - - font-family:; - - - + + + + font-family:; + + + } diff --git a/application/modules/formbuilder/views/fields/render_front/block_container.php b/application/modules/formbuilder/views/fields/render_front/block_container.php index fa1484ec..7f8ed36b 100755 --- a/application/modules/formbuilder/views/fields/render_front/block_container.php +++ b/application/modules/formbuilder/views/fields/render_front/block_container.php @@ -9,79 +9,80 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); -$field_laygrid = ( isset( $txt_block['grid_layout'] ) ) ? $txt_block['grid_layout'] : 2; +$field_laygrid = ( isset($txt_block['grid_layout']) ) ? $txt_block['grid_layout'] : 2; ?>
    -
    - - - -
    - -
    -
    - -
    - -
    - -
    -
    - -
    - -
    - -
    -
    - -
    - -
    - -
    -
    - -
    - - -
    - -
    - -
    -
    +
    + + + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + + +
    + +
    + +
    + * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?> -
    -
    - -
    - -
    - -
    - -
    - -
    - -
    - -
    -
    - +
    +
    + +
    + +
    + +
    + +
    + +
    + +
    + +
    +
    + -
    - -
    - +
    + +
    + * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    - style="display:none;" - - 0 ) { ?> - data-val-type="" - data-val-cval_regex="" - - data-val-custxt="" - data-val-pos="" - data-val-tip-col="" - data-val-tip-bg="" - - - > - - - - -
    + data-idfield="" + data-typefield="" + class=" rockfm-field + 0) { ?> + rockfm-required + + + rockfm-clogic-fcond + + + rockfm-costest-field + + + + + + " + + style="display:none;" + + 0) { ?> + data-val-type="" + data-val-cval_regex="" + + data-val-custxt="" + data-val-pos="" + data-val-tip-col="" + data-val-tip-bg="" + + + > + + + + + +if ( isset($skin['custom_css']['ctm_id']) && ! empty($skin['custom_css']['ctm_id'])) { + ob_start(); + ?>
    - +
    - diff --git a/application/modules/formbuilder/views/fields/render_front/type_appprep.php b/application/modules/formbuilder/views/fields/render_front/type_appprep.php index f2ae0da8..71bcf37f 100755 --- a/application/modules/formbuilder/views/fields/render_front/type_appprep.php +++ b/application/modules/formbuilder/views/fields/render_front/type_appprep.php @@ -9,25 +9,26 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    - -
    -
    +
    + +
    + * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    - -
    -
    + +
    + * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    - CAPTCHA - - - -
    - - -
    -
    -
    - 0 ) { ?> - data-val-type="" - - data-val-custxt="" - data-val-pos="" - data-val-tip-col="" - data-val-tip-bg="" - - class="sfdc-form-control rockfm-inp6-captcha-inputcode"> - - -
    -
    - +
    +
    + CAPTCHA + + + +
    + + +
    +
    +
    + 0) { ?> + data-val-type="" + + data-val-custxt="" + data-val-pos="" + data-val-tip-col="" + data-val-tip-bg="" + + class="sfdc-form-control rockfm-inp6-captcha-inputcode"> + + +
    +
    +
    * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    + data-theme-type="" + class="rockfm-input2-wrap"> $value ) { - $checked = ''; - if ( isset( $value['checked'] ) && intval( $value['checked'] ) === 1 ) { - $checked = 'checked="checked"'; - } - ?> -
    - -
    - $value) { + $checked = ''; + if ( isset($value['checked']) && intval($value['checked']) === 1) { + $checked = 'checked="checked"'; + } + ?> +
    + +
    + ">
    * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    - - -
    + data-uifm-tabnum="" + > + + + * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    + class="rockfm-input3-customhtml"> * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    - - - - - - - -
    -
    +
    +
    + + + + + + + +
    +
    * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    - - - - -
    -
    +
    +
    + + + + +
    +
    * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    - - - - -
    -
    -
    +
    +
    + + + + +
    +
    + * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    -
    - - - data-rockfm-gfont="" - - class="rockfm-divider-text"> - -
    - -
    -
    -
    +
    +
    +
    + + + data-rockfm-gfont="" + + class="rockfm-divider-text"> + +
    + +
    +
    + * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?> + $layout_type = isset($input17['thopt_mode']) ? intval($input17['thopt_mode']) : 1; + ?>
    + data-opt-laymode='' + data-thopt-height="" + data-thopt-width="" + data-thopt-zoom="" + data-thopt-showhvrtxt="" + data-thopt-showcheckb="" + class="rockfm-input17-wrap"> $value ) { - $checked = ''; - if ( isset( $value['checked'] ) && intval( $value['checked'] ) === 1 ) { - $checked = 'checked="checked"'; - } - ?> -
    - data-toggle="tooltip" - title="" - - data-placement="bottom" - data-html="true" - class="uifm-dcheckbox-item"> - -
    - -
    -
    - -
    - - - -
    - -
    - - -
    - -
    -
    - -
    - -
    - > -
    - -
    -
    - $value2 ) { - if ( ! empty( $value2['img_full'] ) ) { - ?> - - - - - +foreach ( $input17['options'] as $key => $value) { + $checked = ''; + if ( isset($value['checked']) && intval($value['checked']) === 1) { + $checked = 'checked="checked"'; + } + ?> +
    + data-toggle="tooltip" + title="" + + data-placement="bottom" + data-html="true" + class="uifm-dcheckbox-item"> + +
    + +
    +
    + +
    + + + +
    + +
    + + +
    + +
    +
    + +
    + +
    + > +
    + +
    +
    + $value2) { + if ( ! empty($value2['img_full'])) { + ?> + + + + + - $value2 ) { - if ( ! empty( $value2['img_full'] ) || ! empty( $value2['img_th_150x150'] ) ) { - ?> - - " + href="" + class="uifm-dcheckbox-item-imgsrc" + title="" data-gallery=""> + - - - + ?> + "> + + + - -
    -
    - -
    - -
    - -
    - +
    +
    + +
    + +
    + +
    + * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?> + $layout_type = isset($input17['thopt_mode']) ? intval($input17['thopt_mode']) : 1; + ?>
    + data-opt-laymode='' + data-thopt-height="" + data-thopt-width="" + data-thopt-zoom="" + data-thopt-showhvrtxt="" + data-thopt-showcheckb="" + class="rockfm-input17-wrap"> $value ) { - $checked = ''; - if ( isset( $value['checked'] ) && intval( $value['checked'] ) === 1 ) { - $checked = 'checked="checked"'; - } - ?> -
    - data-toggle="tooltip" - title="" - - data-placement="bottom" - data-html="true" - class="uifm-dradiobtn-item"> - -
    - -
    -
    - -
    - - -
    - -
    - -
    - -
    -
    - -
    -
    - > -
    - -
    -
    - $value2 ) { - if ( ! empty( $value2['img_full'] ) ) { - ?> - - - - - +foreach ( $input17['options'] as $key => $value) { + $checked = ''; + if ( isset($value['checked']) && intval($value['checked']) === 1) { + $checked = 'checked="checked"'; + } + ?> +
    + data-toggle="tooltip" + title="" + + data-placement="bottom" + data-html="true" + class="uifm-dradiobtn-item"> + +
    + +
    +
    + +
    + + +
    + +
    + +
    + +
    +
    + +
    +
    + > +
    + +
    +
    + $value2) { + if ( ! empty($value2['img_full'])) { + ?> + + + + + - $value2 ) { - if ( ! empty( $value2['img_full'] ) || ! empty( $value2['img_th_150x150'] ) ) { - ?> - - " + href="" + class="uifm-dcheckbox-item-imgsrc" + title="" data-gallery=""> + - - - + ?> + "> + + + - -
    -
    - -
    - -
    - -
    - +
    +
    + +
    + +
    + +
    + * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    -
    - - - - - -
    - + class="rockfm-fileupload-wrap"> +
    +
    +
    + + + + + +
    +
    * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    - data-rockfm-gfont="" - - >
    + if ( isset($input['font_st']) && intval($input['font_st']) === 1) { + if ( ! empty($input['font']) && isset($font_tmp['import_family'])) { + $font_tmp = json_decode($input['font'], true); + ?> + data-rockfm-gfont="" + + >
    -

    - -

    - -

    - -

    - -
    - -
    - +

    + +

    + +

    + +

    + +
    + +
    + * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?> + data-uifm-tabnum="" + style="display:none;" + name="uiform_fields[]" + class="rockfm-txtbox-inp8-val sfdc-form-control" > * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    -
    - - - - - -
    -
    - + class="rockfm-fileupload-wrap"> +
    +
    +
    + + + + + +
    +
    +
    * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?> + $defaul_class = 'sfdc-form-control uifm-input2-opt-main '; + if ( intval($input2['style_type']) === 1) { + $defaul_class = 'rockfm-input2-sel-styl1'; + } + ?>
    - $value ) { - $checked = ''; - if ( isset( $value['checked'] ) && intval( $value['checked'] ) === 1 ) { - $checked = 'selected'; - } - ?> - - $value) { + $checked = ''; + if ( isset($value['checked']) && intval($value['checked']) === 1) { + $checked = 'selected'; + } + ?> + + - - + + - +
    * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?> + class="rockfm-txtbox-inp-val sfdc-form-control" + data-uifm-tabnum="" + name="uiform_fields[]" + type="password" value=""> * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    - -
    +
    + +
    * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    + data-theme-type="" + class="rockfm-input2-wrap"> $value ) { - $checked = ''; - if ( isset( $value['checked'] ) && intval( $value['checked'] ) === 1 ) { - $checked = 'checked="checked"'; - } - ?> -
    - -
    - $value) { + $checked = ''; + if ( isset($value['checked']) && intval($value['checked']) === 1) { + $checked = 'checked="checked"'; + } + ?> +
    + +
    + ">
    * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    - ", ""]' - name="uiform_fields[]" - value="[,]" - /> -
    + ", ""]' + name="uiform_fields[]" + value="[,]" + /> + * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?> + switch ( intval($input5['g_theme'])) { + case 1: + $input5_theme = 'dark'; + break; + default: + $input5_theme = 'light'; + break; + } + ?>
    0 ) { ?> - data-val-type="" - - data-val-custxt="" - data-val-pos="" - data-val-tip-col="" - data-val-tip-bg="" - - class="rockfm-input5-wrap"> -
    -
    + 0) { ?> + data-val-type="" + + data-val-custxt="" + data-val-pos="" + data-val-tip-col="" + data-val-tip-bg="" + + class="rockfm-input5-wrap"> +
    + * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?> + $defaul_class = 'sfdc-form-control uifm-input2-opt-main '; + if ( intval($input2['style_type']) === 1) { + $defaul_class = 'rockfm-input2-sel-styl1'; + } + ?>
    - $value ) { - if ( ! empty( $value['label'] ) ) { - $checked = ''; - if ( isset( $value['checked'] ) && intval( $value['checked'] ) === 1 ) { - $checked = 'selected'; - } - ?> - - $value) { + if ( ! empty($value['label'])) { + $checked = ''; + if ( isset($value['checked']) && intval($value['checked']) === 1) { + $checked = 'selected'; + } + ?> + + - - - - + + + +
    * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    - - ", ""]' - value="" - name="uiform_fields[]" - /> -
    -
    - + + ", ""]' + value="" + name="uiform_fields[]" + /> +
    +
    + - - + + - -
    -
    + +
    + * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    - +
    - - + + * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?> + data-uifm-tabnum="" + data-uifm-txt-star1="" + data-uifm-txt-star2="" + data-uifm-txt-star3="" + data-uifm-txt-star4="" + data-uifm-txt-star5="" + data-uifm-txt-norate="" + name="uiform_fields[]" + data-min="1" + data-max="5" + data-step="1"> * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?> + class="rockfm-txtbox-inp-val sfdc-btn" + type="button" + data-val-btn="" + data-val-subm="" + + > * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    - - -
    + + + - - + + * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?> - + * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?> - + * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    - - - - -
    -
    -
    +
    +
    + + + + +
    +
    + * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?> * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    -
    -
    - - - -
    -
    -
    -
    -
    - -
    @
    -
    -
    -
    - -
    -
    -
    - -
    -
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    + +
    @
    +
    +
    +
    + +
    +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_captcha.php b/application/modules/formbuilder/views/fields/templates/prevpanel_captcha.php index c0cb7564..54ba7706 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_captcha.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_captcha.php @@ -9,86 +9,87 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    -
    -
    - - - -
    -
    -
    -
    -
    -
    - CAPTCHA +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + CAPTCHA - + -
    - - -
    -
    -
    - - - -
    -
    -
    -
    - -
    -
    -
    - -
    -
    +
    + + +
    +
    +
    + + + +
    +
    +
    +
    + +
    +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_checkbox.php b/application/modules/formbuilder/views/fields/templates/prevpanel_checkbox.php index 19fa1018..b978f15d 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_checkbox.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_checkbox.php @@ -9,69 +9,70 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    -
    -
    - - - -
    -
    -
    -
    -
    -
    - -
    - - -
    -
    -
    - -
    -
    -
    - -
    -
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + +
    + + +
    +
    +
    + +
    +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_colorpicker.php b/application/modules/formbuilder/views/fields/templates/prevpanel_colorpicker.php index 749cebf4..6fbb79b6 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_colorpicker.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_colorpicker.php @@ -9,54 +9,55 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    - - -
    -
    -
    - -
    -
    -
    - -
    -
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + + +
    +
    +
    + +
    +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_customhtml.php b/application/modules/formbuilder/views/fields/templates/prevpanel_customhtml.php index 78c60df6..2e02e1d0 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_customhtml.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_customhtml.php @@ -9,55 +9,56 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    -
    -
    - - - -
    -
    -
    -
    -
    - -
    -
    -
    - -
    -
    -
    - -
    -
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    + +
    +
    +
    + +
    +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_datepicker.php b/application/modules/formbuilder/views/fields/templates/prevpanel_datepicker.php index 5de63d90..3cffae9a 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_datepicker.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_datepicker.php @@ -9,61 +9,62 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    -
    -
    - - - -
    -
    -
    -
    -
    -
    -
    - - - - -
    -
    -
    -
    -
    - -
    -
    -
    - -
    -
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    +
    + + + + +
    +
    +
    +
    +
    + +
    +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_datetime.php b/application/modules/formbuilder/views/fields/templates/prevpanel_datetime.php index 8e3c3353..3aa47e2f 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_datetime.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_datetime.php @@ -9,59 +9,60 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    - - - - -
    -
    -
    -
    -
    - -
    -
    -
    - -
    -
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    + + + + +
    +
    +
    +
    +
    + +
    +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_datetime_2.php b/application/modules/formbuilder/views/fields/templates/prevpanel_datetime_2.php index 9d12011a..6f08a64c 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_datetime_2.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_datetime_2.php @@ -9,64 +9,65 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-form-builder.zigaform.com/ + * @link https://softdiscover.com/zigaform/wordpress-form-builder/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    - - - - - - - -
    -
    -
    -
    -
    - -
    -
    -
    - -
    -
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    + + + + + + + +
    +
    +
    +
    +
    + +
    +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_divider.php b/application/modules/formbuilder/views/fields/templates/prevpanel_divider.php index 3a4c6d65..59208aa3 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_divider.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_divider.php @@ -9,30 +9,31 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    -
    -
    - -
    -
    -
    - -
    -
    +
    +
    +
    +
    + +
    +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_dyncheckbox.php b/application/modules/formbuilder/views/fields/templates/prevpanel_dyncheckbox.php index c5b6b7dd..00345f81 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_dyncheckbox.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_dyncheckbox.php @@ -9,55 +9,56 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    - -
    -
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_dynradiobtn.php b/application/modules/formbuilder/views/fields/templates/prevpanel_dynradiobtn.php index b7e693f9..5ef1ae87 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_dynradiobtn.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_dynradiobtn.php @@ -9,56 +9,57 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    - -
    -
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_fileupload.php b/application/modules/formbuilder/views/fields/templates/prevpanel_fileupload.php index 5d494b55..ceda516b 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_fileupload.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_fileupload.php @@ -9,63 +9,64 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    -
    -
    - - - -
    -
    -
    -
    -
    -
    -
    -
    - - - - -
    -
    -
    -
    - -
    -
    -
    - -
    -
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    +
    +
    + + + + +
    +
    +
    +
    + +
    +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_gridsystem_four.php b/application/modules/formbuilder/views/fields/templates/prevpanel_gridsystem_four.php index e65e9095..f1b8c7e3 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_gridsystem_four.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_gridsystem_four.php @@ -9,47 +9,48 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    - - - - - - - -
    - - - - - - -
    - -
    -
    - -
    -
    +
    + + + + + + + +
    + + + + + + +
    + +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_gridsystem_one.php b/application/modules/formbuilder/views/fields/templates/prevpanel_gridsystem_one.php index 4244b4f9..0f68c3d3 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_gridsystem_one.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_gridsystem_one.php @@ -9,33 +9,34 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    - - - - -
    -
    - -
    -
    - - -
    -
    +
    + + + + +
    +
    + +
    +
    + + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_gridsystem_six.php b/application/modules/formbuilder/views/fields/templates/prevpanel_gridsystem_six.php index 224ad402..d18ce51b 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_gridsystem_six.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_gridsystem_six.php @@ -9,57 +9,58 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    - - - - - - - - - -
    - - - - - - - - - - -
    - -
    -
    - -
    -
    +
    + + + + + + + + + +
    + + + + + + + + + + +
    + +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_gridsystem_three.php b/application/modules/formbuilder/views/fields/templates/prevpanel_gridsystem_three.php index 41a36a67..8cd2fbbe 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_gridsystem_three.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_gridsystem_three.php @@ -9,42 +9,43 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    - - - - - - -
    - - - - -
    - -
    -
    - -
    -
    +
    + + + + + + +
    + + + + +
    + +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_gridsystem_two.php b/application/modules/formbuilder/views/fields/templates/prevpanel_gridsystem_two.php index 1c4a8945..3ab8e577 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_gridsystem_two.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_gridsystem_two.php @@ -9,37 +9,38 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?> -
    -
    - - - - - -
    - - -
    - -
    -
    - -
    -
    +
    +
    + + + + + +
    + + +
    + +
    +
    + +
    +
    diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_heading1.php b/application/modules/formbuilder/views/fields/templates/prevpanel_heading1.php index 29de0fe6..c85c84d2 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_heading1.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_heading1.php @@ -9,52 +9,53 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    - -
    -
    -
    -

    -
    -
    - -
    -
    - -
    -
    +
    +
    + +
    +
    +
    +

    +
    +
    + +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_heading2.php b/application/modules/formbuilder/views/fields/templates/prevpanel_heading2.php index 5096a03b..061ed410 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_heading2.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_heading2.php @@ -9,52 +9,53 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    - -
    -
    -
    -

    -
    -
    - -
    -
    - -
    -
    +
    +
    + +
    +
    +
    +

    +
    +
    + +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_heading3.php b/application/modules/formbuilder/views/fields/templates/prevpanel_heading3.php index 45e56846..e28bebd5 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_heading3.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_heading3.php @@ -9,52 +9,53 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    - -
    -
    -
    -

    -
    -
    - -
    -
    - -
    -
    +
    +
    + +
    +
    +
    +

    +
    +
    + +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_heading4.php b/application/modules/formbuilder/views/fields/templates/prevpanel_heading4.php index 5bee7ea2..df28aeb6 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_heading4.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_heading4.php @@ -9,52 +9,53 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    - -
    -
    -
    -

    -
    -
    - -
    -
    - -
    -
    +
    +
    + +
    +
    +
    +

    +
    +
    + +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_heading5.php b/application/modules/formbuilder/views/fields/templates/prevpanel_heading5.php index beebc884..8375fed0 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_heading5.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_heading5.php @@ -9,52 +9,53 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    +
    +
    + +
    +
    +
    +
    +
    +
    + +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_heading6.php b/application/modules/formbuilder/views/fields/templates/prevpanel_heading6.php index 41d54ce7..6b456973 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_heading6.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_heading6.php @@ -9,52 +9,53 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    +
    +
    + +
    +
    +
    +
    +
    +
    + +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_hiddeninput.php b/application/modules/formbuilder/views/fields/templates/prevpanel_hiddeninput.php index 6bc84817..9feeea72 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_hiddeninput.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_hiddeninput.php @@ -9,28 +9,29 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    -
    - -
    -
    - -
    -
    +
    +
    +
    + +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_imageupload.php b/application/modules/formbuilder/views/fields/templates/prevpanel_imageupload.php index 8a695614..285a5ea1 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_imageupload.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_imageupload.php @@ -9,66 +9,67 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    -
    -
    - - - -
    -
    -
    -
    -
    -
    -
    -
    - - - - - -
    -
    -
    -
    -
    - -
    -
    -
    - -
    -
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    +
    +
    + + + + + +
    +
    +
    +
    +
    + +
    +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_main.php b/application/modules/formbuilder/views/fields/templates/prevpanel_main.php index a62dafb0..a3d54344 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_main.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_main.php @@ -9,10 +9,11 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?> @@ -25,26 +26,26 @@ diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_multiselect.php b/application/modules/formbuilder/views/fields/templates/prevpanel_multiselect.php index e6ab7b0c..2b6e7531 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_multiselect.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_multiselect.php @@ -9,60 +9,61 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    -
    -
    - - - -
    -
    -
    -
    -
    - -
    -
    -
    - -
    -
    -
    - -
    -
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    + +
    +
    +
    + +
    +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_panelfld.php b/application/modules/formbuilder/views/fields/templates/prevpanel_panelfld.php index 1487c919..b53b87c5 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_panelfld.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_panelfld.php @@ -9,42 +9,43 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - [[%%fields%%]] -
    - -
    -
    -
    -
    -
    - -
    -
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + [[%%fields%%]] +
    + +
    +
    +
    +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_password.php b/application/modules/formbuilder/views/fields/templates/prevpanel_password.php index 076f4d93..57f7babd 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_password.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_password.php @@ -9,56 +9,57 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    -
    -
    - - - -
    -
    -
    -
    - -
    -
    - -
    -
    -
    - -
    -
    +
    +
    +
    +
    + + + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_prepapptext.php b/application/modules/formbuilder/views/fields/templates/prevpanel_prepapptext.php index b2e39de9..8a304904 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_prepapptext.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_prepapptext.php @@ -9,60 +9,61 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    -
    -
    - - - -
    -
    -
    -
    -
    -
    @
    - -
    @
    -
    -
    -
    - -
    -
    -
    - -
    -
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    @
    + +
    @
    +
    +
    +
    + +
    +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_preptext.php b/application/modules/formbuilder/views/fields/templates/prevpanel_preptext.php index 8f27eda5..bb5966ec 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_preptext.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_preptext.php @@ -9,60 +9,61 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    -
    -
    - - - -
    -
    -
    -
    -
    -
    @
    - -
    -
    -
    - -
    -
    -
    - -
    -
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    @
    + +
    +
    +
    + +
    +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_quickopts.php b/application/modules/formbuilder/views/fields/templates/prevpanel_quickopts.php index e71037d8..df1512d2 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_quickopts.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_quickopts.php @@ -9,16 +9,17 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?> * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?> * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?> * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    -
    -
    - - - -
    -
    -
    -
    -
    -
    - -
    - - -
    -
    -
    - -
    -
    -
    - -
    -
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + +
    + + +
    +
    +
    + +
    +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_range.php b/application/modules/formbuilder/views/fields/templates/prevpanel_range.php index 547575b0..174c48b9 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_range.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_range.php @@ -9,59 +9,60 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    -
    -
    - - - -
    -
    -
    -
    -
    - -
    -
    -
    - -
    -
    -
    - -
    -
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    + +
    +
    +
    + +
    +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_ratingstar.php b/application/modules/formbuilder/views/fields/templates/prevpanel_ratingstar.php index 8bf8cdef..d2af84d9 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_ratingstar.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_ratingstar.php @@ -9,53 +9,54 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    -
    - -
    -
    +
    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_recaptcha.php b/application/modules/formbuilder/views/fields/templates/prevpanel_recaptcha.php index 77dbf61e..1149d88b 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_recaptcha.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_recaptcha.php @@ -9,54 +9,55 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    -
    -
    - - - -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    - -
    -
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_select.php b/application/modules/formbuilder/views/fields/templates/prevpanel_select.php index aa1a727a..624585a4 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_select.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_select.php @@ -9,62 +9,63 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?> - +
    -
    -
    -
    -
    - - - -
    -
    -
    -
    -
    - - -
    -
    -
    - -
    -
    -
    - -
    -
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    + + +
    +
    +
    + +
    +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_slider.php b/application/modules/formbuilder/views/fields/templates/prevpanel_slider.php index 9b248a54..6456fd22 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_slider.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_slider.php @@ -9,64 +9,65 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    -
    -
    - - - -
    -
    -
    -
    -
    - - -
    -
    - -
    - -
    -
    -
    - -
    -
    -
    - -
    -
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    + + +
    +
    + +
    + +
    +
    +
    + +
    +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_spinner.php b/application/modules/formbuilder/views/fields/templates/prevpanel_spinner.php index 1e179781..5b78a50a 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_spinner.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_spinner.php @@ -9,58 +9,59 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    -
    -
    - - - -
    -
    -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    - -
    -
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_submitbtn.php b/application/modules/formbuilder/views/fields/templates/prevpanel_submitbtn.php index e4665517..34ebe5fe 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_submitbtn.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_submitbtn.php @@ -9,54 +9,55 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    - -
    -
    - - -
    - -
    -
    - -
    -
    +
    +
    + +
    +
    + + +
    + +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_switch.php b/application/modules/formbuilder/views/fields/templates/prevpanel_switch.php index 04c661fd..6267a3df 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_switch.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_switch.php @@ -9,56 +9,57 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    - -
    -
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_textarea.php b/application/modules/formbuilder/views/fields/templates/prevpanel_textarea.php index 29f70b2f..10d56f5a 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_textarea.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_textarea.php @@ -9,55 +9,56 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    -
    -
    - - -
    -
    -
    -
    - -
    -
    - -
    -
    -
    - - -
    -
    +
    +
    +
    +
    + + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    + + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_textbox.php b/application/modules/formbuilder/views/fields/templates/prevpanel_textbox.php index daf0bb75..f399551d 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_textbox.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_textbox.php @@ -9,53 +9,54 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?> -
    -
    -
    -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    -
    - -
    -
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_timepicker.php b/application/modules/formbuilder/views/fields/templates/prevpanel_timepicker.php index bc743657..d19fe41a 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_timepicker.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_timepicker.php @@ -9,62 +9,63 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    -
    -
    - - - -
    -
    -
    -
    -
    -
    -
    - - - - -
    -
    -
    -
    -
    - -
    -
    -
    - -
    -
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    +
    + + + + +
    +
    +
    +
    +
    + +
    +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/fields/templates/prevpanel_wizardbtn.php b/application/modules/formbuilder/views/fields/templates/prevpanel_wizardbtn.php index 66053e86..b67f4e09 100755 --- a/application/modules/formbuilder/views/fields/templates/prevpanel_wizardbtn.php +++ b/application/modules/formbuilder/views/fields/templates/prevpanel_wizardbtn.php @@ -9,40 +9,41 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    -
    -
    - - -
    - -
    -
    - -
    -
    +
    +
    +
    +
    + + +
    + +
    +
    + +
    + diff --git a/application/modules/formbuilder/views/forms/ajax_integrity_openmodal.php b/application/modules/formbuilder/views/forms/ajax_integrity_openmodal.php index f6d12c87..13af4cc3 100755 --- a/application/modules/formbuilder/views/forms/ajax_integrity_openmodal.php +++ b/application/modules/formbuilder/views/forms/ajax_integrity_openmodal.php @@ -9,28 +9,29 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?>
    - - diff --git a/application/modules/formbuilder/views/forms/ajax_rollback_openmodal.php b/application/modules/formbuilder/views/forms/ajax_rollback_openmodal.php index d1eeda79..74a65d08 100755 --- a/application/modules/formbuilder/views/forms/ajax_rollback_openmodal.php +++ b/application/modules/formbuilder/views/forms/ajax_rollback_openmodal.php @@ -9,64 +9,65 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?>
    - -
    - + +
    +
    - - - - - - + +
    + + + + - + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - -
    -
    - -
    -
    +
    + +
    +
    + +
    diff --git a/application/modules/formbuilder/views/forms/ajax_variables_emailpage.php b/application/modules/formbuilder/views/forms/ajax_variables_emailpage.php index d1ae12c5..6033df76 100755 --- a/application/modules/formbuilder/views/forms/ajax_variables_emailpage.php +++ b/application/modules/formbuilder/views/forms/ajax_variables_emailpage.php @@ -9,155 +9,156 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?> -
    - - - - - - - - - - - - - - - - +
    + + + + + + + + + + + + + + + $value ) { - foreach ( $value as $key2 => $value2 ) { - switch ( intval( $value2['type'] ) ) { - case 6: - case 7: - case 12: - case 13: - case 15: - case 22: - case 23: - case 24: - case 25: - case 26: - case 28: - case 29: - case 30: - ?> - - - - - - - - - $value) { + foreach ( $value as $key2 => $value2) { + switch ( intval($value2['type'])) { + case 6: + case 7: + case 12: + case 13: + case 15: + case 22: + case 23: + case 24: + case 25: + case 26: + case 28: + case 29: + case 30: + ?> + + + + + + + + + - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - -
    -
    + ?> + + + + + +
    diff --git a/application/modules/formbuilder/views/forms/ajax_variables_openmodal.php b/application/modules/formbuilder/views/forms/ajax_variables_openmodal.php index d703b3ef..ee12b28e 100755 --- a/application/modules/formbuilder/views/forms/ajax_variables_openmodal.php +++ b/application/modules/formbuilder/views/forms/ajax_variables_openmodal.php @@ -9,339 +9,340 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?>
    - -
    -
    - -
    -
      -
    • -
    • -
    -
    -
    -

    - - -

    -
    - - - - - - + +
    +
    + +
    +
      +
    • +
    • +
    +
    +
    +

    + + +

    +
    +
    + + + + + - - - - - + + + + + - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - -
    -
    -

    -
    - - - - - - - - - - - - - - - - - - - + + + + + + + + + +
    +
    +

    +
    + + + + + + + + + + + + + + + + + + + - -
    -
    -

    -
    - - - - - - - + +
    +
    +

    +
    + + + + + + + - - - $value ) { - ?> - - - - - - - -
    -
    -
    -
    - -

    -
    - - - - - - - - - - - - - - - - + + $value) { + ?> + + + + + + + +
    +
    +
    +
    + +

    +
    + + + + + + + + + + + + + + + + $value ) { - foreach ( $value as $key2 => $value2 ) { - switch ( intval( $value2['type'] ) ) { - case 6: - case 7: - case 12: - case 13: - case 15: - case 17: - case 22: - case 23: - case 24: - case 25: - case 26: - case 28: - case 29: - case 30: - ?> - - $value) { + foreach ( $value as $key2 => $value2) { + switch ( intval($value2['type'])) { + case 6: + case 7: + case 12: + case 13: + case 15: + case 17: + case 22: + case 23: + case 24: + case 25: + case 26: + case 28: + case 29: + case 30: + ?> + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - -
    -
    - - -

    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -

    -
    - - - - - - + ?> + + + + +
    +
    + + +

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +

    +
    + + + + + + - - - $value ) { - ?> - - - - - - -
    -
    -
    -
    - -
    - + + + $value) { + ?> + + + + + + + +
    +
    + + + + - - + + diff --git a/application/modules/formbuilder/views/forms/create_form.php b/application/modules/formbuilder/views/forms/create_form.php index cf9208f0..30e6df96 100755 --- a/application/modules/formbuilder/views/forms/create_form.php +++ b/application/modules/formbuilder/views/forms/create_form.php @@ -9,289 +9,288 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?>
    -
    - - -
    -
      -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • - - - -
    • -
    • - -
    -
    -
    -
    - - - -
    -
    -
    - -
    -
    -
    -
    - -
    -
    -
    -
    - -
    -
    -
    -
    - -
      -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    • -
    +
    + + +
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • + + +
    • +
    • + +
    +
    +
    +
    + + + +
    +
    +
    + +
    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    +
    +
    + +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    - -
    -
    -
    - -
    -
    -
    -
    - -
    -
    -
    -
    - -
    -
    -
    -
    - -
    -
    -
    -
    - -
    -
    -
    -
    - -
    -
    -
    -
    - -
    -
    -
    -
    - -
    -
    - - -
    - - -
    -
    - -
    -
    - - -
    -
    - -
    -
    - - -
    -
      - $value ) { - ?> -
    • - - - -
    • - -
    -
    - -
    -
    - - $value ) { - ?> -
    -
    - -
    -
    - - - -
    - -
    - - - - +
    +
    +
    + +
    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    + + +
    + + +
    +
    + +
    +
    + + +
    +
    + +
    +
    + + +
    +
      + $value) { + ?> +
    • + + + +
    • + +
    +
    + +
    +
    + + $value) { + ?> +
    +
    + +
    +
    + + + +
    + +
    + + + + - - -
    -
    - -
    + ?> + + +
    +
    + +
    - -
    -
    - - -
    -
    - - -
    -
    - - -
    -
    -
    - - - -
    -
    - - - -
    - - - -
    -
    + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    + + + +
    +
    + + + +
    + + + +
    +
    - + - + - + - + ?> diff --git a/application/modules/formbuilder/views/forms/create_form_main.php b/application/modules/formbuilder/views/forms/create_form_main.php index c6502b25..cea0a055 100755 --- a/application/modules/formbuilder/views/forms/create_form_main.php +++ b/application/modules/formbuilder/views/forms/create_form_main.php @@ -9,265 +9,266 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?>
    -
    -
    -
    - -
    +
    +
    +
    + +
    -
    -
    - - - - -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    - -
    - - -
    -
    -
    -
    -
    -
    - -
    - -
    -
    -
    - -
    -
    -
    -
    - -
      -
    • - -
    - -
    - -
    -
    -
    -
    -
    -
    - -
    - - -
    - -
    - -
    - - -
    -
    - -
    - -
    - -
      - -
    • -
    • -
    • -
    • -
    • - -
    +
    +
    + + + + +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    + +
    + + +
    +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
      +
    • + +
    + +
    + +
    +
    +
    +
    +
    +
    + +
    + + +
    + +
    + +
    + + +
    +
    + +
    + +
    + +
      + +
    • +
    • +
    • +
    • +
    • + +
    - -
    + +
    - -
    -
    -
    - - - -
    -
    -
    -
    -
    -
    - - - -
    -
    -
    -
    -
    -
    - - - -
    -
    -
    - -
    - -
    - -
    -
    - - -
    -
    -
    - -
    -
    -
    - - - - -
    -
    - - - - -
    -
    - + +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    + + + +
    +
    +
    + +
    + +
    + +
    +
    + + +
    +
    +
    + +
    +
    +
    + + + + +
    +
    + + + + +
    +
    +
    0 ) { - ?> +if ( isset($form_id) && intval($form_id) > 0) { + ?> - + ?> - - - - - - - + + + + + + diff --git a/application/modules/formbuilder/views/forms/create_form_modals.php b/application/modules/formbuilder/views/forms/create_form_modals.php index b6030ec5..c3f00e39 100755 --- a/application/modules/formbuilder/views/forms/create_form_modals.php +++ b/application/modules/formbuilder/views/forms/create_form_modals.php @@ -9,131 +9,132 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?> diff --git a/application/modules/formbuilder/views/forms/export_form.php b/application/modules/formbuilder/views/forms/export_form.php index 2346dc47..d84207af 100755 --- a/application/modules/formbuilder/views/forms/export_form.php +++ b/application/modules/formbuilder/views/forms/export_form.php @@ -9,47 +9,48 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?>
    -
    -
    -
    -
    - -
    -
    -
    -

    -
    -
    -
    -
    -
    - -
    -
    -
    - +
    +
    +
    +
    + +
    +
    +
    +

    +
    +
    +
    +
    +
    + +
    +
    +
    +
    diff --git a/application/modules/formbuilder/views/forms/fields_available.php b/application/modules/formbuilder/views/forms/fields_available.php index 8ead9a59..0c55e7e7 100755 --- a/application/modules/formbuilder/views/forms/fields_available.php +++ b/application/modules/formbuilder/views/forms/fields_available.php @@ -9,795 +9,795 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-form-builder.zigaform.com/ + * @link https://softdiscover.com/zigaform/wordpress-form-builder/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?>
      -
    • -
    • +
    • +
    -
    - -
    -
    - - +
    + + - - + + - - + + - -
    -
    - -
    - -
    +
    +
    + +
    +
    + +
    + +
    -
    -
    - -
    -
    - -
    - -
    +
    +
    + +
    +
    + +
    + +
    -
    -
    - -
    +
    +
    + +
    -
    - - -
    -
    - - +
    + + +
    +
    + + -
    -
    - -
    -
    - - +
    +
    + +
    +
    + + -
    -
    - -
    -
    - - +
    +
    + +
    +
    + + -
    -
    - - - - - -
    -
    - -
    -
    - -
    -
    +
    +
    + + + + +
    +
    + +
    +
    + +
    +
    -
    -
    +
    +
    - - - - - - + +
    +
    +
    - + diff --git a/application/modules/formbuilder/views/forms/form_show_shortcodes.php b/application/modules/formbuilder/views/forms/form_show_shortcodes.php index 7d856b61..24db83f4 100755 --- a/application/modules/formbuilder/views/forms/form_show_shortcodes.php +++ b/application/modules/formbuilder/views/forms/form_show_shortcodes.php @@ -9,62 +9,63 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?>
    - -
    -
    - -
    - -
    -
    - -
    -
    -
    -
    -
    - -
    -
    -
    - -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    + +
    +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    -
    -
    +
    +
    -
    -
    -
    -
    +
    +
    +
    + diff --git a/application/modules/formbuilder/views/forms/form_success.php b/application/modules/formbuilder/views/forms/form_success.php index cf0c3b7e..ff780750 100755 --- a/application/modules/formbuilder/views/forms/form_success.php +++ b/application/modules/formbuilder/views/forms/form_success.php @@ -10,59 +10,59 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: getcode.php, v1.00 2014-01-15 02:52:40 Softdiscover $ - * @link https://php-form-builder.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-form-builder/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } ?>
    -
    - -
    -

    - +
    + +
    +

    +
    -
    +
    - +
    -
    -
    - -
    -
    - -
    - -
    - -
    -
    -
    -
    - -
    - -
    -
    -
    -
    - -
    - -
    -
    -
    -
    - -
    -
    - +
    +
    + +
    +
    + +
    + +
    + +
    +
    +
    +
    + +
    + +
    +
    +
    +
    + +
    + +
    +
    +
    +
    + +
    +
    +
    - +
    - -
    + +
    diff --git a/application/modules/formbuilder/views/forms/formhtml_css_form.php b/application/modules/formbuilder/views/forms/formhtml_css_form.php index e54c110a..4c67d275 100755 --- a/application/modules/formbuilder/views/forms/formhtml_css_form.php +++ b/application/modules/formbuilder/views/forms/formhtml_css_form.php @@ -9,133 +9,131 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?> #rockfm_form_ .uiform-main-form{ +if ( isset($skin['form_background']['show_st']) + && intval($skin['form_background']['show_st']) === 1) { + ?> - - background:; - - background: ; - background-image: -webkit-linear-gradient(top, , ); - background-image: -moz-linear-gradient(top, , ); - background-image: -ms-linear-gradient(top, , ); - background-image: -o-linear-gradient(top, , ); - background-image: linear-gradient(to bottom, , ); - - - background-image:url(""); - background-repeat:repeat; - - - - padding:10px; + switch ( intval($skin['form_background']['type'])) { + case 1: + // solid + if ( ! empty($skin['form_background']['solid_color'])) { + ?> + background:; + + background: ; + background-image: -webkit-linear-gradient(top, , ); + background-image: -moz-linear-gradient(top, , ); + background-image: -ms-linear-gradient(top, , ); + background-image: -o-linear-gradient(top, , ); + background-image: linear-gradient(to bottom, , ); + + + background-image:url(""); + background-repeat:repeat; + + + padding:10px; - - - -webkit-border-radius: px; - -moz-border-radius: px; - border-radius: px; - - - border: px; - - - box-shadow: ; - - - - padding: px px px px; - - - padding:20px 20px 25px 20px; - - 0 - && intval( $skin['form_width']['show_st'] ) === 1 ) { - ?> - max-width: px; - - - + + + -webkit-border-radius: px; + -moz-border-radius: px; + border-radius: px; + + + border: px; + + + box-shadow: ; + + + + padding: px px px px; + + + padding:20px 20px 25px 20px; + + 0 + && intval($skin['form_width']['show_st']) === 1) { + ?> + max-width: px; + + + } diff --git a/application/modules/formbuilder/views/forms/formhtml_css_global.php b/application/modules/formbuilder/views/forms/formhtml_css_global.php index b59f6569..5e11e8b3 100755 --- a/application/modules/formbuilder/views/forms/formhtml_css_global.php +++ b/application/modules/formbuilder/views/forms/formhtml_css_global.php @@ -9,139 +9,138 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?> - - + + - #rockfm_form_ .uiform-sticky-sidebar-box-content{ - - - color:; - - - - - font-family:""; - - - - - - - } - + #rockfm_form_ .uiform-sticky-sidebar-box-content{ + + + color:; + + + + + font-family:""; + + + + + + + } + - + #rockfm_form_ .uiform-sticky-sidebar-box{ - - + - background:; - - background: ; - background-image: -webkit-linear-gradient(top, , ); - background-image: -moz-linear-gradient(top, , ); - background-image: -ms-linear-gradient(top, , ); - background-image: -o-linear-gradient(top, , ); - background-image: linear-gradient(to bottom, , ); - - - background-image:url(""); - background-repeat:repeat; - - - + switch ( intval($summbox['form_background']['type'])) { + case 1: + // solid + if ( ! empty($summbox['form_background']['solid_color'])) { + ?> + background:; + + background: ; + background-image: -webkit-linear-gradient(top, , ); + background-image: -moz-linear-gradient(top, , ); + background-image: -ms-linear-gradient(top, , ); + background-image: -o-linear-gradient(top, , ); + background-image: linear-gradient(to bottom, , ); + + + background-image:url(""); + background-repeat:repeat; + + + - -webkit-border-radius: px; - -moz-border-radius: px; - border-radius: px; - - - border: px; - - - box-shadow: ; - + // el_border_radius + if ( isset($summbox['form_border_radius']['show_st']) && intval($summbox['form_border_radius']['show_st']) === 1) { + ?> + -webkit-border-radius: px; + -moz-border-radius: px; + border-radius: px; + + + border: px; + + + box-shadow: ; + } - + diff --git a/application/modules/formbuilder/views/forms/formhtml_css_init.php b/application/modules/formbuilder/views/forms/formhtml_css_init.php index 868450a3..287479a1 100755 --- a/application/modules/formbuilder/views/forms/formhtml_css_init.php +++ b/application/modules/formbuilder/views/forms/formhtml_css_init.php @@ -9,29 +9,30 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?> + if ( ! empty($fonts)) { + foreach ( $fonts as $value) { + if ( ! empty($value)) { + ?> @import url(//fonts.googleapis.com/css?family=); - + diff --git a/application/modules/formbuilder/views/forms/formhtml_css_wizard.php b/application/modules/formbuilder/views/forms/formhtml_css_wizard.php index 3b9edce5..7a3d1551 100755 --- a/application/modules/formbuilder/views/forms/formhtml_css_wizard.php +++ b/application/modules/formbuilder/views/forms/formhtml_css_wizard.php @@ -9,365 +9,367 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?> - #rockfm_form_ .uiform-step-list{ - - border:1px solid ; - - - - background-color: ; - - } + switch ( $theme_type) { + case 0: + ?> + #rockfm_form_ .uiform-step-list{ + + border:1px solid ; + + + + background-color: ; + + } - #rockfm_form_ .uiform-step-list { - - - border-top-left-radius: 3px; - border-top-right-radius: 3px; - box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); - overflow: hidden; - position: relative; - z-index: 4; - } + #rockfm_form_ .uiform-step-list { + + + border-top-left-radius: 3px; + border-top-right-radius: 3px; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); + overflow: hidden; + position: relative; + z-index: 4; + } - - #rockfm_form_ .uiform-main-form .uiform-steps{ - border-radius: 3px; - list-style: none outside none; - margin: 0; - overflow: hidden; - padding: 0; - position: relative; - } - #rockfm_form_ .uiform-main-form .uiform-steps li{ - display: inline-block; - /*comoding*/ - float:left; - margin: 0; - padding: 0; - position: relative; - outline: none; - } + + #rockfm_form_ .uiform-main-form .uiform-steps{ + border-radius: 3px; + list-style: none outside none; + margin: 0; + overflow: hidden; + padding: 0; + position: relative; + } + #rockfm_form_ .uiform-main-form .uiform-steps li{ + display: inline-block; + /*comoding*/ + float:left; + margin: 0; + padding: 0; + position: relative; + outline: none; + } - #rockfm_form_ .uiform-main-form .uiform-steps li a{ - display: inline-block; - font-size: 16px; - height: 46px; - line-height: 46px; - margin: 0; - padding: 0 20px 0 30px; - text-decoration: none; - width: auto; - } + #rockfm_form_ .uiform-main-form .uiform-steps li a{ + display: inline-block; + font-size: 16px; + height: 46px; + line-height: 46px; + margin: 0; + padding: 0 20px 0 30px; + text-decoration: none; + width: auto; + } - /*just for backend*/ - #rockfm_form_ .uiform-main-form .uiform-steps li a{ - cursor: pointer!important; - } - .uiform-main-form .uiform-steps li.uifm-current a:focus{ - box-shadow:none!important; - } - #rockfm_form_ .uiform-main-form .uiform-steps li.uifm-current a, - #rockfm_form_ .uiform-main-form .uiform-steps li.uifm-current a:hover, - #rockfm_form_ .uiform-main-form .uiform-steps li.uifm-current a:active - { - - background: ; - - - color: ; - - cursor: default; - outline: none; - } - - #rockfm_form_ .uiform-main-form .uiform-steps li.uifm-complete a, - #rockfm_form_ .uiform-main-form .uiform-steps li.uifm-complete a:hover, - #rockfm_form_ .uiform-main-form .uiform-steps li.uifm-complete a:active - { - - background: ; - - - color: ; - - color:yellow; - cursor: default; - outline: none; - } - - #rockfm_form_ .uiform-main-form .uiform-steps li.uifm-disabled a:focus{ - box-shadow:none!important; - } - #rockfm_form_ .uiform-main-form .uiform-steps li.uifm-disabled a, - #rockfm_form_ .uiform-main-form .uiform-steps li.uifm-disabled a:hover, - #rockfm_form_ .uiform-main-form .uiform-steps li.uifm-disabled a:active - { - - background: ; - - - color: ; - - cursor: default; - outline: none; - } - #rockfm_form_ .uifm_frm_skin_tab_content { - border-bottom: 1px solid #CCCCCC; - border-top: 1px solid #CCCCCC; - padding: 20px 10px 10px; - background: #eee; - margin-top:5px; - } - #rockfm_form_ .uifm_frm_skin_tabs_options .btn-group{ - float:right; - } - #rockfm_form_ .uiform-steps .uifm-number { - - background-color: ; - - border-radius: 10px; - - color: ; - - display: inline-block; - float: left; - font-size: 12px; - font-weight: 700; - line-height: 1; - margin-right: 10px; - margin-top: 15px; - min-width: 10px; - padding: 3px 6px; - text-align: center; - white-space: nowrap; - } - #rockfm_form_ .uiform-steps .uifm-number:before { - position:absolute; - top:-1px; - right:-14px; - display:block; - z-index:2; - border:24px solid transparent; - border-right:0; - - border-left:14px solid ; - - content:" " - } - #rockfm_form_ .uiform-steps .uifm-number:after { - position:absolute; - top:-1px; - right:-14px; - display:block; - z-index:1; - border:24px solid transparent; - border-right:0; - - border-left:14px solid ; - - content:" "; - } - #rockfm_form_ .uiform-steps a:first-child { - border-bottom-left-radius: 3px; - border-top-left-radius: 3px; - } + /*just for backend*/ + #rockfm_form_ .uiform-main-form .uiform-steps li a{ + cursor: pointer!important; + } + .uiform-main-form .uiform-steps li.uifm-current a:focus{ + box-shadow:none!important; + } + #rockfm_form_ .uiform-main-form .uiform-steps li.uifm-current a, + #rockfm_form_ .uiform-main-form .uiform-steps li.uifm-current a:hover, + #rockfm_form_ .uiform-main-form .uiform-steps li.uifm-current a:active + { + + background: ; + + + color: ; + + cursor: default; + outline: none; + } + + #rockfm_form_ .uiform-main-form .uiform-steps li.uifm-complete a, + #rockfm_form_ .uiform-main-form .uiform-steps li.uifm-complete a:hover, + #rockfm_form_ .uiform-main-form .uiform-steps li.uifm-complete a:active + { + + background: ; + + + color: ; + + color:yellow; + + cursor: default; + outline: none; + } + + #rockfm_form_ .uiform-main-form .uiform-steps li.uifm-disabled a:focus{ + box-shadow:none!important; + } + #rockfm_form_ .uiform-main-form .uiform-steps li.uifm-disabled a, + #rockfm_form_ .uiform-main-form .uiform-steps li.uifm-disabled a:hover, + #rockfm_form_ .uiform-main-form .uiform-steps li.uifm-disabled a:active + { + + background: ; + + + color: ; + + cursor: default; + outline: none; + } + #rockfm_form_ .uifm_frm_skin_tab_content { + border-bottom: 1px solid #CCCCCC; + border-top: 1px solid #CCCCCC; + padding: 20px 10px 10px; + background: #eee; + margin-top:5px; + } + #rockfm_form_ .uifm_frm_skin_tabs_options .btn-group{ + float:right; + } + #rockfm_form_ .uiform-steps .uifm-number { + + background-color: ; + + border-radius: 10px; + + color: ; + + display: inline-block; + float: left; + font-size: 12px; + font-weight: 700; + line-height: 1; + margin-right: 10px; + margin-top: 15px; + min-width: 10px; + padding: 3px 6px; + text-align: center; + white-space: nowrap; + } + #rockfm_form_ .uiform-steps .uifm-number:before { + position:absolute; + top:-1px; + right:-14px; + display:block; + z-index:2; + border:24px solid transparent; + border-right:0; + + border-left:14px solid ; + + content:" " + } + #rockfm_form_ .uiform-steps .uifm-number:after { + position:absolute; + top:-1px; + right:-14px; + display:block; + z-index:1; + border:24px solid transparent; + border-right:0; + + border-left:14px solid ; + + content:" "; + } + #rockfm_form_ .uiform-steps a:first-child { + border-bottom-left-radius: 3px; + border-top-left-radius: 3px; + } - #rockfm_form_ .uiform-steps .uifm-disabled .uifm-number { - - background-color: ; - - - color: ; - - } - #rockfm_form_ .uiform-steps .uifm-current a, - #rockfm_form_ .uiform-steps .uifm-current a:hover, - #rockfm_form_ .uiform-steps .uifm-current a:active { - background: #ECF0F1; - color: #ECF0F1; - cursor: default; - } - #rockfm_form_ .uiform-steps .uifm-current .uifm-number:before { - - border-left-color: ; - - } - #rockfm_form_ .uiform-steps .uifm-current .uifm-number:after { - - border-left-color: ; - - } - #rockfm_form_ .uiform-steps .uifm-complete .uifm-number:before { - - border-left-color: ; - - } - #rockfm_form_ .uiform-steps .uifm-complete .uifm-number:after { - - border-left-color: ; - - } - - #rockfm_form_ .rockfm-wiztheme1 .uiform-steps{ - display: table; - list-style: outside none none; - margin: 0; - padding: 0; - position: relative; - width: 100%; - } - #rockfm_form_ .rockfm-wiztheme1 .uiform-steps li a{ - box-shadow: none; - text-decoration: none; - } - #rockfm_form_ .rockfm-wiztheme1 .uiform-steps li { - display: table-cell; - text-align: center; - width: 1%; - } - #rockfm_form_ .rockfm-wiztheme1 .uiform-steps li .uifm-number { - - background-color: ; - - background-color: #ffffff; - - - border: 5px solid ; - - border-radius: 100%; - - color: ; - - - display: inline-block; - font-size: 15px; - height: 40px; - line-height: 30px; - position: relative; - text-align: center; - width: 40px; - z-index: 2; - } - #rockfm_form_ .rockfm-wiztheme1 .uiform-steps li::before { - - border-top: 4px solid ; - - content: ""; - display: block; - font-size: 0; - height: 1px; - overflow: hidden; - position: relative; - top: 21px; - width: 100%; - z-index: 1; - } - #rockfm_form_ .rockfm-wiztheme1 .uiform-steps li.last-child::before { - max-width: 50%; - width: 50%; - } - #rockfm_form_ .rockfm-wiztheme1 .uiform-steps li:last-child::before { - max-width: 50%; - width: 50%; - } - #rockfm_form_ .rockfm-wiztheme1 .uiform-steps li:first-child::before { - left: 50%; - max-width: 51%; - } - #rockfm_form_ .rockfm-wiztheme1 .uiform-steps li.uifm-current::before, - #rockfm_form_ .rockfm-wiztheme1 .uiform-steps li.uifm-complete::before, - #rockfm_form_ .rockfm-wiztheme1 .uiform-steps li.uifm-current .uifm-number, - #rockfm_form_ .rockfm-wiztheme1 .uiform-steps li.uifm-complete .uifm-number { - - border-color: ; - - } - #rockfm_form_ .rockfm-wiztheme1 .uiform-steps li.uifm-complete .uifm-number { - color: #fff; - cursor: default; - transition: transform 0.1s ease 0s; - } - #rockfm_form_ .rockfm-wiztheme1 .uiform-steps li.uifm-complete .uifm-number::before { - background-color: #fff; - border-radius: 100%; - bottom: 0; - - color: ; - - content: ""; - display: block; - font-size: 17px; - font-family: FontAwesome; - left: 0; - line-height: 30px; - position: absolute; - right: 0; - text-align: center; - top: 0; - z-index: 3; - } - #rockfm_form_ .rockfm-wiztheme1 .uiform-steps li.uifm-complete:hover .uifm-number { - border-color: #80afd4; - transform: scale(1.1); - } - #rockfm_form_ .rockfm-wiztheme1 .uiform-steps li.uifm-complete:hover::before { - border-color: #80afd4; - } - #rockfm_form_ .rockfm-wiztheme1 .uiform-steps li .uifm-title { - - color: ; - - display: block; - font-size: 14px; - margin-top: 4px; - max-width: 100%; - table-layout: fixed; - text-align: center; - word-wrap: break-word; - z-index: 104; - } - #rockfm_form_ .rockfm-wiztheme1 .uiform-steps li.uifm-complete .uifm-title, - #rockfm_form_ .rockfm-wiztheme1 .uiform-steps li.uifm-current .uifm-title { - - color: ; - - } - - .uiform-steps .uifm-disabled .uifm-number { + + background-color: ; + + + color: ; + + } + #rockfm_form_ .uiform-steps .uifm-current a, + #rockfm_form_ .uiform-steps .uifm-current a:hover, + #rockfm_form_ .uiform-steps .uifm-current a:active { + background: #ECF0F1; + color: #ECF0F1; + cursor: default; + } + #rockfm_form_ .uiform-steps .uifm-current .uifm-number:before { + + border-left-color: ; + + } + #rockfm_form_ .uiform-steps .uifm-current .uifm-number:after { + + border-left-color: ; + + } + #rockfm_form_ .uiform-steps .uifm-complete .uifm-number:before { + + border-left-color: ; + + } + #rockfm_form_ .uiform-steps .uifm-complete .uifm-number:after { + + border-left-color: ; + + } + + #rockfm_form_ .rockfm-wiztheme1 .uiform-steps{ + display: table; + list-style: outside none none; + margin: 0; + padding: 0; + position: relative; + width: 100%; + } + #rockfm_form_ .rockfm-wiztheme1 .uiform-steps li a{ + box-shadow: none; + text-decoration: none; + } + #rockfm_form_ .rockfm-wiztheme1 .uiform-steps li { + display: table-cell; + text-align: center; + width: 1%; + } + #rockfm_form_ .rockfm-wiztheme1 .uiform-steps li .uifm-number { + + background-color: ; + + background-color: #ffffff; + + + border: 5px solid ; + + border-radius: 100%; + + color: ; + + + display: inline-block; + font-size: 15px; + height: 40px; + line-height: 30px; + position: relative; + text-align: center; + width: 40px; + z-index: 2; + } + #rockfm_form_ .rockfm-wiztheme1 .uiform-steps li::before { + + border-top: 4px solid ; + + content: ""; + display: block; + font-size: 0; + height: 1px; + overflow: hidden; + position: relative; + top: 21px; + width: 100%; + z-index: 1; + } + #rockfm_form_ .rockfm-wiztheme1 .uiform-steps li.last-child::before { + max-width: 50%; + width: 50%; + } + #rockfm_form_ .rockfm-wiztheme1 .uiform-steps li:last-child::before { + max-width: 50%; + width: 50%; + } + #rockfm_form_ .rockfm-wiztheme1 .uiform-steps li:first-child::before { + left: 50%; + max-width: 51%; + } + #rockfm_form_ .rockfm-wiztheme1 .uiform-steps li.uifm-current::before, + #rockfm_form_ .rockfm-wiztheme1 .uiform-steps li.uifm-complete::before, + #rockfm_form_ .rockfm-wiztheme1 .uiform-steps li.uifm-current .uifm-number, + #rockfm_form_ .rockfm-wiztheme1 .uiform-steps li.uifm-complete .uifm-number { + + border-color: ; + + } + #rockfm_form_ .rockfm-wiztheme1 .uiform-steps li.uifm-complete .uifm-number { + color: #fff; + cursor: default; + transition: transform 0.1s ease 0s; + } + #rockfm_form_ .rockfm-wiztheme1 .uiform-steps li.uifm-complete .uifm-number::before { + background-color: #fff; + border-radius: 100%; + bottom: 0; + + color: ; + + content: ""; + display: block; + font-size: 17px; + font-family: FontAwesome; + left: 0; + line-height: 30px; + position: absolute; + right: 0; + text-align: center; + top: 0; + z-index: 3; + } + #rockfm_form_ .rockfm-wiztheme1 .uiform-steps li.uifm-complete:hover .uifm-number { + border-color: #80afd4; + transform: scale(1.1); + } + #rockfm_form_ .rockfm-wiztheme1 .uiform-steps li.uifm-complete:hover::before { + border-color: #80afd4; + } + #rockfm_form_ .rockfm-wiztheme1 .uiform-steps li .uifm-title { + + color: ; + + display: block; + font-size: 14px; + margin-top: 4px; + max-width: 100%; + table-layout: fixed; + text-align: center; + word-wrap: break-word; + z-index: 104; + } + #rockfm_form_ .rockfm-wiztheme1 .uiform-steps li.uifm-complete .uifm-title, + #rockfm_form_ .rockfm-wiztheme1 .uiform-steps li.uifm-current .uifm-title { + + color: ; + + } + + .uiform-step-footer{ - clear:both; + clear:both; } diff --git a/application/modules/formbuilder/views/forms/formhtml_form.php b/application/modules/formbuilder/views/forms/formhtml_form.php index 6927bc3d..186aa39a 100755 --- a/application/modules/formbuilder/views/forms/formhtml_form.php +++ b/application/modules/formbuilder/views/forms/formhtml_form.php @@ -9,237 +9,236 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    - - - + action="javascript:void(0);" + name="" + method="post" + data-zgfm-type="2" + data-zgfm-version="" + data-zgfm-price-tax-st="" + data-zgfm-price-tax-val="" + data-zgfm-recaptchav3-active="" + data-zgfm-recaptchav3-sitekey="" + data-zgfm-recaptchav3-errmsg="" + enctype="multipart/form-data" + id="rockfm_form_"> + + + - 1 - ) { - ?> - - - - - - - - - - - - - - - 1 + ) { + ?> + + + + + + + + + + + + + + + - - -
    - - - - - - - - - - - - - - - -
    - -
    - - 1 ) { - echo $form_tab_head; - } - ?> -
    - -
    -
    - 1 ) { - ?> - - -
    - -
    - -
    - - - - - - + ?> + + +
    + + + + + + + + + + + + + + + +
    + +
    + + 1) { + echo $form_tab_head; + } + ?> +
    + +
    +
    + 1) { + ?> + + +
    + +
    + +
    + + + + + + -
    - - - - - $value ) { ?> - - - - - +
    + + + + + $value) { ?> + + + + +
    - - + - + - - - - + + +
    * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    - +
    * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    > -
    - -
    -
    +
    + +
    +
    diff --git a/application/modules/formbuilder/views/forms/formhtml_tabfooter.php b/application/modules/formbuilder/views/forms/formhtml_tabfooter.php index 0ec7f032..cff8b5cd 100755 --- a/application/modules/formbuilder/views/forms/formhtml_tabfooter.php +++ b/application/modules/formbuilder/views/forms/formhtml_tabfooter.php @@ -9,16 +9,17 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?> diff --git a/application/modules/formbuilder/views/forms/formhtml_tabheader.php b/application/modules/formbuilder/views/forms/formhtml_tabheader.php index 88a7f028..2b0a3c42 100755 --- a/application/modules/formbuilder/views/forms/formhtml_tabheader.php +++ b/application/modules/formbuilder/views/forms/formhtml_tabheader.php @@ -9,53 +9,54 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
      - - - $value ) { - $tab_active = ''; - if ( $count === 1 ) { - $tab_active = 'uifm-current'; - } else { - $tab_active = 'uifm-disabled'; - } - ?> -
    • - - - - -
    • - - - -
    -
    +
      + + + $value) { + $tab_active = ''; + if ( $count === 1) { + $tab_active = 'uifm-current'; + } else { + $tab_active = 'uifm-disabled'; + } + ?> +
    • + + + + +
    • + + + +
    + diff --git a/application/modules/formbuilder/views/forms/get_code_cached_html.php b/application/modules/formbuilder/views/forms/get_code_cached_html.php index 131ff65c..a74d2863 100755 --- a/application/modules/formbuilder/views/forms/get_code_cached_html.php +++ b/application/modules/formbuilder/views/forms/get_code_cached_html.php @@ -1,6 +1,7 @@ @@ -14,33 +15,33 @@ diff --git a/application/modules/formbuilder/views/forms/get_code_cached_scripts.php b/application/modules/formbuilder/views/forms/get_code_cached_scripts.php index 94cb4240..eb7c19f4 100755 --- a/application/modules/formbuilder/views/forms/get_code_cached_scripts.php +++ b/application/modules/formbuilder/views/forms/get_code_cached_scripts.php @@ -1,99 +1,100 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $value ) { - ?> - - assets/common/bootstrap/3.3.7/css/bootstrap-wrapper.css" rel="stylesheet"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $value) { + ?> + + $value ) { - ?> - - $value) { + ?> + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/modules/formbuilder/views/forms/get_code_iframe.php b/application/modules/formbuilder/views/forms/get_code_iframe.php index 7c86e7dc..fbada7a3 100755 --- a/application/modules/formbuilder/views/forms/get_code_iframe.php +++ b/application/modules/formbuilder/views/forms/get_code_iframe.php @@ -1,38 +1,39 @@ + scrolling="no" + id="zgfm-iframe-" + frameborder="0" + style="border:none;width:100%;min-height:100px" + allowTransparency="true"> + var uiform = document.createElement('script'); + uiform.type = 'text/javascript'; + uiform.async = true; + uiform.src = ('https:' == document.location.protocol ? UIFORM_SRC : UIFORM_SRC) + ''; + var s = document.getElementsByTagName('script')[0]; + s.parentNode.insertBefore(uiform, s); + })(); diff --git a/application/modules/formbuilder/views/forms/get_code_widget.php b/application/modules/formbuilder/views/forms/get_code_widget.php index 9cf1f114..7c335416 100755 --- a/application/modules/formbuilder/views/forms/get_code_widget.php +++ b/application/modules/formbuilder/views/forms/get_code_widget.php @@ -1,52 +1,53 @@
    diff --git a/application/modules/formbuilder/views/forms/getcode.php b/application/modules/formbuilder/views/forms/getcode.php index f8b5caad..28a87b2e 100755 --- a/application/modules/formbuilder/views/forms/getcode.php +++ b/application/modules/formbuilder/views/forms/getcode.php @@ -10,96 +10,96 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: getcode.php, v1.00 2014-01-15 02:52:40 Softdiscover $ - * @link https://php-form-builder.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-form-builder/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } ?>
    -
    -
    -
    -
    -
    -
    - -
    - -
    - -
    -
    -
    -
    - -
    - -
    -
    -
    -
    - -
    - -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    - -
    +
    +
    +
    +
    +
    +
    + +
    + +
    + +
    +
    +
    +
    + +
    + +
    +
    +
    +
    + +
    + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    -
    -
    -
    (BETA) -
    -
    -
    - -
    - -
    -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    -
    - -
    +
    +
    +
    (BETA) +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    + +
    diff --git a/application/modules/formbuilder/views/forms/header_form.php b/application/modules/formbuilder/views/forms/header_form.php index 9c3a0f35..b6acfae6 100755 --- a/application/modules/formbuilder/views/forms/header_form.php +++ b/application/modules/formbuilder/views/forms/header_form.php @@ -1,66 +1,67 @@
    diff --git a/application/modules/formbuilder/views/forms/list_forms.php b/application/modules/formbuilder/views/forms/list_forms.php index 754ab017..e46c73fd 100755 --- a/application/modules/formbuilder/views/forms/list_forms.php +++ b/application/modules/formbuilder/views/forms/list_forms.php @@ -9,203 +9,202 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?>
    -
    -
    -
    -
    -
    - -
    - -
    -
    - - -
    -
    -
    -
    - - - - - -
    - - - - - - - - - - - - - - - - -
    - - -
    -
    -
    -
    -
    -
    -
    - - -
    -
    - -
    - - - - -
    -
    -
    - - -
    -
    - - - - -
    -
    -
    -
    -
    - -
    - -
    -
    -
    -
    -
    +
    +
    +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    + + + + + +
    + + + + + + + + + + + + + + +
    + + +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + +
    + + + + +
    +
    +
    + + +
    +
    + + + + +
    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    +
    - - - + + +
    diff --git a/application/modules/formbuilder/views/forms/list_forms_table.php b/application/modules/formbuilder/views/forms/list_forms_table.php index 911cbe74..de5e531d 100755 --- a/application/modules/formbuilder/views/forms/list_forms_table.php +++ b/application/modules/formbuilder/views/forms/list_forms_table.php @@ -9,106 +9,107 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?>
    -
    - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + +
    - -
    - - fmb_name; ?> - - - - created_date; ?> - flag_status ) === 1 ) { - ?> - - - - flag_status ) === 2 ) { - ?> - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - -
    + +
    + + fmb_name; ?> + + + + created_date; ?> + flag_status) === 1) { + ?> + + + + flag_status) === 2) { + ?> + - - - - -
    - -
    -
    -
    -
    - - - -
    -
    + +
    + +
    +
    + +
    +
    +
    +
    + +
    + +
    +
    diff --git a/application/modules/formbuilder/views/forms/modal1_footer.php b/application/modules/formbuilder/views/forms/modal1_footer.php index 96e54984..b59cdd07 100755 --- a/application/modules/formbuilder/views/forms/modal1_footer.php +++ b/application/modules/formbuilder/views/forms/modal1_footer.php @@ -11,17 +11,17 @@ * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @link http://zigapage.softdiscover.com */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } ob_start(); ?> - + diff --git a/application/modules/formbuilder/views/forms/pdf_global_template.php b/application/modules/formbuilder/views/forms/pdf_global_template.php index 501e1261..c4dd6087 100755 --- a/application/modules/formbuilder/views/forms/pdf_global_template.php +++ b/application/modules/formbuilder/views/forms/pdf_global_template.php @@ -9,107 +9,107 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } ob_start(); -if ( isset( $html_wholecont ) && intval( $html_wholecont ) === 1 ) { - ?> - - + + + ?> - - - - - - - - - - - - - - - + ?> + + + + + + + + + + + - diff --git a/application/modules/formbuilder/views/forms/preview_clogic_graph.php b/application/modules/formbuilder/views/forms/preview_clogic_graph.php index 77679e3a..48365921 100755 --- a/application/modules/formbuilder/views/forms/preview_clogic_graph.php +++ b/application/modules/formbuilder/views/forms/preview_clogic_graph.php @@ -9,48 +9,47 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } ob_start(); ?>
    - -
      - -
    • - -
        - -
      • -
      • - -
      -
    • - -
    - - - - + +
      + +
    • + +
        + +
      • +
      • + +
      +
    • + +
    + + +
    diff --git a/application/modules/formbuilder/views/forms/preview_fields.php b/application/modules/formbuilder/views/forms/preview_fields.php index 09053a6e..dbed396b 100755 --- a/application/modules/formbuilder/views/forms/preview_fields.php +++ b/application/modules/formbuilder/views/forms/preview_fields.php @@ -1,37 +1,38 @@
    -
    - -

    +
    + +

      -
    • - -
        -
      • -
      • -
      • -
      -
    • +
    • + +
        +
      • +
      • +
      • +
      +
    - - - + + +
    diff --git a/application/modules/formbuilder/views/forms/previewpanel_form.php b/application/modules/formbuilder/views/forms/previewpanel_form.php index 72be31a6..f836efe3 100755 --- a/application/modules/formbuilder/views/forms/previewpanel_form.php +++ b/application/modules/formbuilder/views/forms/previewpanel_form.php @@ -9,47 +9,48 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    - -
    -
    -
    - -
    - - -
    - - -
    - -
    - -
    -
    +
    +
    + +
    +
    +
    + +
    + + +
    + + +
    + +
    + +
    +
    diff --git a/application/modules/formbuilder/views/forms/previewpanel_tabcontainer.php b/application/modules/formbuilder/views/forms/previewpanel_tabcontainer.php index f178e430..eb23f5b9 100755 --- a/application/modules/formbuilder/views/forms/previewpanel_tabcontainer.php +++ b/application/modules/formbuilder/views/forms/previewpanel_tabcontainer.php @@ -9,30 +9,31 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    - -
    -
    +
    + +
    +
    diff --git a/application/modules/formbuilder/views/forms/previewpanel_tabfooter.php b/application/modules/formbuilder/views/forms/previewpanel_tabfooter.php index 0ec7f032..cff8b5cd 100755 --- a/application/modules/formbuilder/views/forms/previewpanel_tabfooter.php +++ b/application/modules/formbuilder/views/forms/previewpanel_tabfooter.php @@ -9,16 +9,17 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?> diff --git a/application/modules/formbuilder/views/forms/previewpanel_tabheader.php b/application/modules/formbuilder/views/forms/previewpanel_tabheader.php index 71a978fc..5a43b932 100755 --- a/application/modules/formbuilder/views/forms/previewpanel_tabheader.php +++ b/application/modules/formbuilder/views/forms/previewpanel_tabheader.php @@ -9,53 +9,54 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
      - - - $value ) { - $tab_active = ''; - if ( $count === 1 ) { - $tab_active = 'uifm-current'; - } else { - $tab_active = 'uifm-disabled'; - } - ?> -
    • - - - - -
    • - - - -
    -
    +
      + + + $value) { + $tab_active = ''; + if ( $count === 1) { + $tab_active = 'uifm-current'; + } else { + $tab_active = 'uifm-disabled'; + } + ?> +
    • + + + + +
    • + + + +
    + diff --git a/application/modules/formbuilder/views/forms/settings_form_calc.php b/application/modules/formbuilder/views/forms/settings_form_calc.php index 0a1eb073..1411ab06 100755 --- a/application/modules/formbuilder/views/forms/settings_form_calc.php +++ b/application/modules/formbuilder/views/forms/settings_form_calc.php @@ -9,313 +9,314 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?> -
    -
    -
    -
    -
    - -
    -
    - - -
    +
    +
    +
    +
    +
    + +
    +
    + + +
    -
    -
    -
    -
    - +
    +
    +
    +
    + -
    -
    -
    -
    - - - - - -
    -
    -
    - -
    -
    - - -
      -
    • -
    -
    -
    - -
    - -
    -
    -
    -
    - -
    -
    -
    - - -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    -
    - - - - - - + +
    +
    +
    +
    +
    +
    diff --git a/application/modules/formbuilder/views/forms/settings_form_email.php b/application/modules/formbuilder/views/forms/settings_form_email.php index 025bd89e..2b792d56 100755 --- a/application/modules/formbuilder/views/forms/settings_form_email.php +++ b/application/modules/formbuilder/views/forms/settings_form_email.php @@ -9,632 +9,631 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-form-builder.zigaform.com/ + * @link https://softdiscover.com/zigaform/wordpress-form-builder/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} $default_template = ''; ob_start(); ?>
    - - - - - - - - - - - + + + + + + + + + + +

    -
    :
    -
    - [uifm_var opt="rec_summ"]
    -
    -
    - :
    -:[uifm_var opt="rec_url_fm"]
    -: [uifm_var opt="form_name"]
    -

    +
    :
    +
    + [uifm_var opt="rec_summ"]
    +
    +
    + :
    +:[uifm_var opt="rec_url_fm"]
    +: [uifm_var opt="form_name"]
    +
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    -
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    -
    -
    -
    - -
    -
    - -
    -
    -
    - - -
    - -
    - -
    -
    -
    - -
    -
    -
    -
    +
    +
    +
    + +
    +
    + +
    +
    +
    + + +
    + +
    + +
    +
    +
    + +
    +
    +
    +
    -
    -
    -
    -
    - -
      -
    • -
    • -
    - -
    -
    -
    -
    - -

    - -
    -
    -
    - - -
    -
    -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    - - +
    +
    +
    +
    + +
      +
    • +
    • +
    + +
    +
    +
    +
    + +

    + +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + + -
    -
    -
    - -
    -
    -
    - - -
    - true, - 'editor_height' => 325, - 'textarea_rows' => 20, - ); - // wp_editor($default_template, 'uifm_frm_email_tmpl',$settings ); - ?> - -
    - -
    -
    -
    -
    -
    - -
    - - - -
    -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    - ' ); ?> -
    -
    -
    -

    -
    -
    -
    - - +
    +
    +
    + +
    +
    +
    + + +
    + true, + 'editor_height' => 325, + 'textarea_rows' => 20, + ); + // wp_editor($default_template, 'uifm_frm_email_tmpl',$settings ); + ?> + +
    + +
    +
    +
    +
    +
    + +
    + + + +
    +
    +
    + +
    +
    +
    +
    +
    +
    + +
    +
    + '); ?> +
    +
    +
    +

    +
    +
    +
    + + -
    -
    -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    - - -
    -
    -
    - -
    -
    -
    - - -
    -
    -
    - -
    -
    -
    +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    + +
    +
    +
    + + +
    +
    +
    + +
    +
    +
    - -
    - true, - 'editor_height' => 325, - 'textarea_rows' => 20, - ); - // wp_editor($default_template, 'uifm_frm_email_usr_tmpl',$settings ); - ?> - -
    + +
    + true, + 'editor_height' => 325, + 'textarea_rows' => 20, + ); + // wp_editor($default_template, 'uifm_frm_email_usr_tmpl',$settings ); + ?> + +
    -
    -
    -
    -
    -
    - -
    - - - -
    -
    -
    - - - - -
    -
    -
    -
    - -
    -
    -
    -
    -
    - -
    - +
    +
    +
    +
    +
    + +
    + + + +
    +
    +
    + + +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    + -
    - -
    +
    + +
    -
    - - - -
    -
    - -
    -
    -
    -
    -
    -
    +
    + + + +
    +
    + +
    +
    +
    +
    +
    +
    - -
    - true, - 'editor_height' => 325, - 'textarea_rows' => 20, - ); - // wp_editor($default_template, 'uifm_frm_email_usr_tmpl_pdf',$settings ); - ?> - -
    + +
    + true, + 'editor_height' => 325, + 'textarea_rows' => 20, + ); + // wp_editor($default_template, 'uifm_frm_email_usr_tmpl_pdf',$settings ); + ?> + +
    -
    -
    -
    +
    +
    +
    -
    -
    -
    - -
    - -
    - - -
    -
    -
    - -
    - - - -
    -
    -
    +
    +
    +
    + +
    + +
    + + +
    +
    +
    + +
    + + + +
    +
    +
    -
    - - -
    - - - - -
    -
    -
    -
    -
    - +
    + + +
    + + + + +
    +
    +
    +
    +
    + -
    -
    +
    +
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - - -
    - -
      -
    • -
    • -
    - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - - - - - -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    - +
    +
    +
    + +
    +
    +
    +
    +
    +
    + + +
    + +
      +
    • +
    • +
    + +
    +
    +
    +
    + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    + - -
    -
    - -
    -
    - - - -
    - - -
    - + +
    +
    + +
    +
    + + + +
    + + +
    + diff --git a/application/modules/formbuilder/views/forms/settings_form_summbox.php b/application/modules/formbuilder/views/forms/settings_form_summbox.php index b3b3c089..a4d63a11 100755 --- a/application/modules/formbuilder/views/forms/settings_form_summbox.php +++ b/application/modules/formbuilder/views/forms/settings_form_summbox.php @@ -9,640 +9,641 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?>
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    - -
    -
    -
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    -
    - -
    +
    + +
    -
    -
    -
    +
    +
    +
    -
    -
    - -
    -
    - -
    -
    +
    +
    + +
    +
    + +
    +
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    - - -
    - -
      - -
    • -
    - -
    - -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    - -
    - true, - 'textarea_rows' => 5, - ); - // wp_editor('', 'uifm_frm_summbox_skintxt_txt',$settings ); - ?> - -
    - - -
    -
    -
    + + +
    + +
      + +
    • +
    + +
    + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    +
    + +
    + true, + 'textarea_rows' => 5, + ); + // wp_editor('', 'uifm_frm_summbox_skintxt_txt',$settings ); + ?> + +
    + + +
    +
    +
    -
    -
    - -
    - - -
    -
    -
    -
    -
    - -
    - - 'uifm_frm_summbox_skintxt_font', - 'id' => 'uifm_frm_summbox_skintxt_font', - 'data-form-store' => 'skin_text-font', - 'data-form-msec' => 'summbox', - ); - $default_value = '{"family":"Arial, Helvetica, sans-serif","name":"Arial","classname":"arial"}'; - ?> - get_view_menu( $attributes, $default_value ); ?> - - - -
    +
    +
    + +
    + + +
    +
    +
    +
    +
    + +
    + + 'uifm_frm_summbox_skintxt_font', + 'id' => 'uifm_frm_summbox_skintxt_font', + 'data-form-store' => 'skin_text-font', + 'data-form-msec' => 'summbox', + ); + $default_value = '{"family":"Arial, Helvetica, sans-serif","name":"Arial","classname":"arial"}'; + ?> + get_view_menu($attributes, $default_value); ?> + + + +
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    - - -
    -
    -
    -
    - - - - -
    -
    -
    - -
    -
    -
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + + +
    +
    +
    +
    + + + + +
    +
    +
    + +
    +
    +
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    -
    -
    - - -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    -
    -
    - - -
    - -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    - -
    -
    +
    +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    +
    +
    + + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    +
    +
    + + +
    + +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    diff --git a/application/modules/formbuilder/views/forms/settings_form_wizard.php b/application/modules/formbuilder/views/forms/settings_form_wizard.php index 9ee7ad5f..61ccd03a 100755 --- a/application/modules/formbuilder/views/forms/settings_form_wizard.php +++ b/application/modules/formbuilder/views/forms/settings_form_wizard.php @@ -9,429 +9,430 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-form-builder.zigaform.com/ + * @link https://softdiscover.com/zigaform/wordpress-form-builder/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?>
    -
    -
    -
    - -
    - - - - -
    - - - - - - - - - -
    -
    -
    - +
    +
    +
    + +
    + + + + +
    + + + + + + + + + +
    +
    +
    +
    diff --git a/application/modules/formbuilder/views/forms/templates_fields.php b/application/modules/formbuilder/views/forms/templates_fields.php index 2a39d234..f933a535 100755 --- a/application/modules/formbuilder/views/forms/templates_fields.php +++ b/application/modules/formbuilder/views/forms/templates_fields.php @@ -11,125 +11,126 @@ * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @link http://wordpress-form-builder.uiform.com/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?> + jQuery(document).ready(function($) { + + }); + diff --git a/application/modules/formbuilder/views/forms/test_dcheckbox.php b/application/modules/formbuilder/views/forms/test_dcheckbox.php index 55c2eed5..c9f4990d 100755 --- a/application/modules/formbuilder/views/forms/test_dcheckbox.php +++ b/application/modules/formbuilder/views/forms/test_dcheckbox.php @@ -1,296 +1,297 @@
    -
    -
    -
    -
    - -
    -
    -
    - - -
    -
    -
    - - -
    -
    - -
    - -
    - -
    - -
    -
    - -
    -
    - -
    -
    - -
    - - - -
    -
    - - -
    -
    - -
    - -
    - -
    - -
    -
    - -
    -
    - -
    -
    - -
    - - - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    - -
    -
    - +
    +
    +
    +
    + +
    +
    +
    + + +
    +
    +
    + + +
    +
    + +
    + +
    + +
    + +
    +
    + +
    +
    + +
    +
    + +
    + + + +
    +
    + + +
    +
    + +
    + +
    + +
    + +
    +
    + +
    +
    + +
    +
    + +
    + + + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    +
    -

    Bootstrap Image Gallery Demo

    -
    -

    Bootstrap Image Gallery is an extension to blueimp Gallery, a touch-enabled, responsive and customizable image & video gallery.
    It displays images and videos in the modal dialog of the Bootstrap framework, features swipe, mouse and keyboard navigation, transition effects, fullscreen support and on-demand content loading and can be extended to display additional content types.

    -
    -
    -
    - -
    -
    - -
    -
    - - -
    -
    -
    - -
    - -
    -
    +

    Bootstrap Image Gallery Demo

    +
    +

    Bootstrap Image Gallery is an extension to blueimp Gallery, a touch-enabled, responsive and customizable image & video gallery.
    It displays images and videos in the modal dialog of the Bootstrap framework, features swipe, mouse and keyboard navigation, transition effects, fullscreen support and on-demand content loading and can be extended to display additional content types.

    +
    +
    +
    + +
    +
    + +
    +
    + + +
    +
    +
    + +
    + +
    +
    - + diff --git a/application/modules/formbuilder/views/frontend/form_invoice.php b/application/modules/formbuilder/views/frontend/form_invoice.php index 22a1cefc..51d2b3b2 100755 --- a/application/modules/formbuilder/views/frontend/form_invoice.php +++ b/application/modules/formbuilder/views/frontend/form_invoice.php @@ -9,214 +9,208 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } ob_start(); ?> -
    -
    -
    -

    #

    - : -
    -
    -
    -
      -
    • - -
    • - -
    • - -
    • - - -
    • - -
    • - - -
    • - -
    • - - -
    • - -
    • - - -
    • - -
    • - -
    -
    -
    -
      -
    • - -
    • - -
    • - -
    • - - -
    • - -
    • - - -
    • - -
    • - - -
    • - -
    • - - -
    • - -
    • - -
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - +
    +
    +

    #

    + : +
    +
    +
    +
      +
    • + +
    • + +
    • + +
    • + + +
    • + +
    • + + +
    • + +
    • + + +
    • + +
    • + + +
    • + +
    • + +
    +
    +
    +
      +
    • + +
    • + +
    • + +
    • + + +
    • + +
    • + + +
    • + +
    • + + +
    • + +
    • + + +
    • + +
    • + +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + $value) { + if ( $tmp_counter == 1) { + ?> + + + + + + + + + + + $value ) { - if ( $tmp_counter == 1 ) { - ?> - - - - - - - - - - - - - - - - - - $value ) { - ?> - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    - - - -
    - - - -
    - - - -
    -
    -
    + ?> + + + + + + + $value) { + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + - + diff --git a/application/modules/formbuilder/views/frontend/form_invoice_custom.php b/application/modules/formbuilder/views/frontend/form_invoice_custom.php index e1ab0fa8..dc158c82 100755 --- a/application/modules/formbuilder/views/frontend/form_invoice_custom.php +++ b/application/modules/formbuilder/views/frontend/form_invoice_custom.php @@ -9,41 +9,42 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    -
    - - -
    -
    - +
    +
    +
    + + +
    +
    +
    diff --git a/application/modules/formbuilder/views/frontend/form_summary.php b/application/modules/formbuilder/views/frontend/form_summary.php index fcbeefba..5ab11f81 100755 --- a/application/modules/formbuilder/views/frontend/form_summary.php +++ b/application/modules/formbuilder/views/frontend/form_summary.php @@ -9,88 +9,86 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } ob_start(); ?>
    -
    -
    -
      - - +
      +
        + + - -
      • -
          - $value2 ) { - ?> -
        • - + +
        • +
            + $value2) { + ?> +
          • + 0){ - echo ' → '.$value2['qty'].' '.__('Units','FRocket_admin').' → '; - }*/ + /* + if(isset($value2['qty']) && floatval($value2['qty'])>0){ + echo ' → '.$value2['qty'].' '.__('Units','FRocket_admin').' → '; + }*/ - if ( isset( $value2['qty'] ) && floatval( $value2['qty'] ) > 0 && ! empty( $value2['label'] ) && floatval( $value2['amount'] ) > 0 ) { + if ( isset($value2['qty']) && floatval($value2['qty']) > 0 && ! empty($value2['label']) && floatval($value2['amount']) > 0) { + } elseif ( ! empty($value2['label']) && floatval($value2['amount']) > 0) { + echo ' : '; + } else { + } + ?> + 0 ) { - echo ' : '; - } else { - - } - ?> - 0 ) { - ?> - - -
          • - - -
          -
        • - -
        • :
        • - - - -
        - - 0 ) { ?> - : -
        - - - 0 ) { ?> - : -
        - - - 0 ) { ?> - : - - -
      -
    - + && floatval($value2['amount']) > 0) { + ?> + + + + + + + + +
  • :
  • + + + + + + 0) { ?> + : +
    + + + 0) { ?> + : +
    + + + 0) { ?> + : + + +
    +
    + diff --git a/application/modules/formbuilder/views/frontend/form_summary_custom.php b/application/modules/formbuilder/views/frontend/form_summary_custom.php index 73af01fd..ab54bbd3 100755 --- a/application/modules/formbuilder/views/frontend/form_summary_custom.php +++ b/application/modules/formbuilder/views/frontend/form_summary_custom.php @@ -9,41 +9,42 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ob_start(); ?>
    -
    -
    -
    - - -
    -
    - + document.getElementById("zgfm-iframe--rec-showrecsumm").onload = function() { + document.getElementById("uifm_frm_modal_html_loader").style.display = 'none'; + iFrameResize({ + log : false, + onScroll: function (coords) { + /*console.log("[OVERRIDE] overrode scrollCallback x: " + coords.x + " y: " + coords.y);*/ + } + },'#zgfm-iframe--rec-showrecsumm'); + }; + +
    + + diff --git a/application/modules/formbuilder/views/frontend/get_code_iframe.php b/application/modules/formbuilder/views/frontend/get_code_iframe.php index 82d9d8df..05dd857b 100755 --- a/application/modules/formbuilder/views/frontend/get_code_iframe.php +++ b/application/modules/formbuilder/views/frontend/get_code_iframe.php @@ -1,31 +1,31 @@ + scrolling="no" + id="zgfm-iframe-" + frameborder="0" + style="border:none;width:100%;" + allowTransparency="true"> + var uiform = document.createElement('script'); + uiform.type = 'text/javascript'; + uiform.async = true; + uiform.src = ('https:' == document.location.protocol ? UIFORM_SRC : UIFORM_SRC) + 'assets/frontend/js/loader-iframe.js'; + var s = document.getElementsByTagName('script')[0]; + s.parentNode.insertBefore(uiform, s); + })(); diff --git a/application/modules/formbuilder/views/frontend/get_form_iframe.php b/application/modules/formbuilder/views/frontend/get_form_iframe.php index 1eeb848b..fa8192cb 100755 --- a/application/modules/formbuilder/views/frontend/get_form_iframe.php +++ b/application/modules/formbuilder/views/frontend/get_form_iframe.php @@ -9,80 +9,80 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } ob_start(); ?> - - - - - - - - - - - - - - - - + + + + + - + + - - -
    + + +
    ', ' ', $cntACmp ); -$cntACmp = str_replace( '//', ' ', $cntACmp); +$cntACmp = str_replace('// - $value ) { - if ( isset( $value->html_view ) ) { - echo $value->html_view; - } - } - } - ?> - +
    +
    +
    +

    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + $value) { + if ( isset($value->html_view)) { + echo $value->html_view; + } + } + } + ?> + -
    -
    - -
    +
    +
    + +
    -
    -
    -
    - -
    -
    -
    -
    -

    - - - -

    - - - -

    - - - +

    +
    +
    + +
    +
    +
    +
    +

    + + + +

    + + +

    + + + -

    +

    - - - - -

    :   - -

    - -
    -
    + + + + +

    :   + +

    + +
    +
    -
    +
    - - -
    -
    -
    -
    -
    - -
    - + + + + + + +
    + +
    + diff --git a/application/modules/formbuilder/views/frontend/pdf_global_template.php b/application/modules/formbuilder/views/frontend/pdf_global_template.php index 59ad7a4c..1a7a766f 100755 --- a/application/modules/formbuilder/views/frontend/pdf_global_template.php +++ b/application/modules/formbuilder/views/frontend/pdf_global_template.php @@ -9,48 +9,48 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } ob_start(); ?> - - - - - - - - - - - + ?> + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + - -
    + if ( ! empty($script)) { + echo $script; + } + ?> + +
    diff --git a/application/modules/formbuilder/views/frontend/welcome.php b/application/modules/formbuilder/views/frontend/welcome.php index 8f3962b5..cd21ee30 100755 --- a/application/modules/formbuilder/views/frontend/welcome.php +++ b/application/modules/formbuilder/views/frontend/welcome.php @@ -9,5 +9,5 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ diff --git a/application/modules/formbuilder/views/records/custom_report_getAllfields.php b/application/modules/formbuilder/views/records/custom_report_getAllfields.php index 7cf51019..1ab1bb19 100755 --- a/application/modules/formbuilder/views/records/custom_report_getAllfields.php +++ b/application/modules/formbuilder/views/records/custom_report_getAllfields.php @@ -9,57 +9,58 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-form-builder.zigaform.com/ + * @link https://softdiscover.com/zigaform/wordpress-form-builder/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?>
    -
    - - - - - - - - - - - - - - - - - - + + + + +
    fmf_status_qu ) && intval( $value->fmf_status_qu ) === 1 ) { ?> - checked - - > - fieldname; ?> - - + + + + + + + + + + + + + + + + + + - - - - -
    fmf_status_qu) && intval($value->fmf_status_qu) === 1) { ?> + checked + + > + fieldname; ?> + + -
    - + class="uifm-cusreport-order-rec" + value="order_rec); ?>"/> +
    +
    - + @@ -68,14 +69,14 @@ class="uifm-cusreport-order-rec" // diff --git a/application/modules/formbuilder/views/records/info_record.php b/application/modules/formbuilder/views/records/info_record.php index db940990..382394ef 100755 --- a/application/modules/formbuilder/views/records/info_record.php +++ b/application/modules/formbuilder/views/records/info_record.php @@ -9,104 +9,104 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?>
    - - -
    -
    -
    -
    - -
    -

    -

    - - - - 0 ) { ?> - : -
    - - - 0 ) { ?> - : -
    - - - 0 ) { ?> - : - -
    - + + +
    +
    +
    +
    + +
    +

    +

    + + + + 0) { ?> + : +
    + + + 0) { ?> + : +
    + + + 0) { ?> + : + +
    + - + - - + + -
    -
    -
    -

    -
      -
    • - : - -
    • -
    • - : - -
    • -
    • - : - -
    • -
    • - : - -
    • -
    • - : - -
    • -
    -
    -
    -
    -
    - - -
    +
    +
    +
    +

    +
      +
    • + : + +
    • +
    • + : + +
    • +
    • + : + +
    • +
    • + : + +
    • +
    • + : + +
    • +
    +
    +
    +
    +
    + + +
    -
    - - - - - - - +
    + + + + + + -
    +
    diff --git a/application/modules/formbuilder/views/records/info_record_topdf.php b/application/modules/formbuilder/views/records/info_record_topdf.php index 30e31c69..b9fe603e 100755 --- a/application/modules/formbuilder/views/records/info_record_topdf.php +++ b/application/modules/formbuilder/views/records/info_record_topdf.php @@ -9,10 +9,11 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?> @@ -21,93 +22,92 @@

      -
    • - : - -
    • -
    • - : - -
    • -
    • - : - -
    • -
    • - : - -
    • -
    • - : - -
    • -
    +
  • + : + +
  • +
  • + : + +
  • +
  • + : + +
  • +
  • + : + +
  • +
  • + : + +
  • +
    diff --git a/application/modules/formbuilder/views/records/list_records.php b/application/modules/formbuilder/views/records/list_records.php index 6543d07d..002af06c 100755 --- a/application/modules/formbuilder/views/records/list_records.php +++ b/application/modules/formbuilder/views/records/list_records.php @@ -9,94 +9,95 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?>
    -
    -
    -
    -
    -
    - -
    - -
    - -
    -
    -
    - - - - - - - - - - - - - - - - + + + + + + + + + +
    fmb_name; ?>created_date; ?> - flag_status ) === 1 ) { - ?> - - - - - +
    +
    +
    +
    +
    + +
    + +
    + +
    +
    +
    + + + + + + + + + + + + + + + + - - - - - - - - - -
    fmb_name; ?>created_date; ?> + flag_status) === 1) { + ?> + + + + + - - - - -
    - -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    + +
    + +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    diff --git a/application/modules/formbuilder/views/records/list_records_getdatatable.php b/application/modules/formbuilder/views/records/list_records_getdatatable.php index 1558e645..dad702a6 100755 --- a/application/modules/formbuilder/views/records/list_records_getdatatable.php +++ b/application/modules/formbuilder/views/records/list_records_getdatatable.php @@ -9,43 +9,44 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?> - - - - - - - - - - - - - - $value2 ) { ?> - - - - - - - - - + + + + + + + + + + + + + + $value2) { ?> + + + + + + + + +
    fieldname; ?>ID
    -
    -
      -
    • -
    • -
    -
    -
    fieldname; ?>ID
    +
    +
      +
    • +
    • +
    +
    +
    diff --git a/application/modules/formbuilder/views/records/view_charts.php b/application/modules/formbuilder/views/records/view_charts.php index d5e8f5c2..abf7969c 100755 --- a/application/modules/formbuilder/views/records/view_charts.php +++ b/application/modules/formbuilder/views/records/view_charts.php @@ -9,48 +9,49 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?>
    -
    -
    -
    -
    - -
    -
    -
    -

    -
    -
    -
    -
    -
    -
    -
    -
    - -
    - +
    +
    +
    +
    + +
    +
    +
    +

    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    diff --git a/application/modules/formbuilder/views/settings/system_db.json b/application/modules/formbuilder/views/settings/system_db.json new file mode 100755 index 00000000..bc9074c0 --- /dev/null +++ b/application/modules/formbuilder/views/settings/system_db.json @@ -0,0 +1 @@ +{"cest_uiform_form":{"fmb_id":{"type":"int","null":"NO","Default":null,"Extra":"auto_increment"},"fmb_data":{"type":"longtext","null":"YES","Default":null,"Extra":""},"fmb_name":{"type":"varchar(255)","null":"YES","Default":null,"Extra":""},"fmb_html":{"type":"longtext","null":"YES","Default":null,"Extra":""},"fmb_html_backend":{"type":"longtext","null":"YES","Default":null,"Extra":""},"flag_status":{"type":"smallint","null":"YES","Default":"1","Extra":""},"created_date":{"type":"timestamp","null":"YES","Default":null,"Extra":""},"updated_date":{"type":"timestamp","null":"NO","Default":"CURRENT_TIMESTAMP","Extra":"DEFAULT_GENERATED"},"created_ip":{"type":"varchar(100)","null":"YES","Default":null,"Extra":""},"updated_ip":{"type":"varchar(100)","null":"YES","Default":null,"Extra":""},"created_by":{"type":"varchar(100)","null":"YES","Default":null,"Extra":""},"updated_by":{"type":"varchar(100)","null":"YES","Default":null,"Extra":""},"fmb_html_css":{"type":"longtext","null":"YES","Default":null,"Extra":""},"fmb_default":{"type":"tinyint","null":"YES","Default":"0","Extra":""},"fmb_skin_status":{"type":"tinyint","null":"YES","Default":"0","Extra":""},"fmb_skin_data":{"type":"longtext","null":"YES","Default":null,"Extra":""},"fmb_skin_type":{"type":"smallint","null":"YES","Default":"1","Extra":""},"fmb_data2":{"type":"longtext","null":"YES","Default":null,"Extra":""},"fmb_rec_tpl_html":{"type":"longtext","null":"YES","Default":null,"Extra":""},"fmb_inv_tpl_html":{"type":"longtext","null":"YES","Default":null,"Extra":""},"fmb_rec_tpl_st":{"type":"tinyint","null":"YES","Default":"0","Extra":""},"fmb_inv_tpl_st":{"type":"tinyint","null":"YES","Default":"0","Extra":""}},"cest_uiform_form_records":{"fbh_id":{"type":"int","null":"NO","Default":null,"Extra":"auto_increment"},"fbh_data":{"type":"longtext","null":"YES","Default":null,"Extra":""},"fbh_data_rec":{"type":"longtext","null":"YES","Default":null,"Extra":""},"fbh_data2":{"type":"longtext","null":"YES","Default":null,"Extra":""},"fbh_data_rec2":{"type":"longtext","null":"YES","Default":null,"Extra":""},"fbh_data_rec2_xml":{"type":"longtext","null":"YES","Default":null,"Extra":""},"fbh_total_amount":{"type":"varchar(45)","null":"YES","Default":null,"Extra":""},"created_date":{"type":"timestamp","null":"NO","Default":"CURRENT_TIMESTAMP","Extra":"DEFAULT_GENERATED"},"created_ip":{"type":"varchar(100)","null":"YES","Default":null,"Extra":""},"created_by":{"type":"varchar(100)","null":"YES","Default":null,"Extra":""},"flag_status":{"type":"smallint","null":"YES","Default":"1","Extra":""},"fbh_data_user":{"type":"longtext","null":"YES","Default":null,"Extra":""},"form_fmb_id":{"type":"int","null":"NO","Default":null,"Extra":""},"fbh_data_rec_xml":{"type":"longtext","null":"YES","Default":null,"Extra":""},"fbh_user_agent":{"type":"longtext","null":"YES","Default":null,"Extra":""},"fbh_page":{"type":"longtext","null":"YES","Default":null,"Extra":""},"fbh_referer":{"type":"longtext","null":"YES","Default":null,"Extra":""},"fbh_params":{"type":"longtext","null":"YES","Default":null,"Extra":""},"vis_uniqueid":{"type":"varchar(10)","null":"NO","Default":null,"Extra":""},"fbh_error":{"type":"longtext","null":"YES","Default":null,"Extra":""}},"cest_uiform_fields":{"fmf_id":{"type":"int","null":"NO","Default":null,"Extra":"auto_increment"},"fmf_uniqueid":{"type":"varchar(255)","null":"YES","Default":null,"Extra":""},"fmf_data":{"type":"longtext","null":"YES","Default":null,"Extra":""},"fmf_fieldname":{"type":"varchar(255)","null":"YES","Default":null,"Extra":""},"flag_status":{"type":"smallint","null":"YES","Default":null,"Extra":""},"created_date":{"type":"timestamp","null":"YES","Default":null,"Extra":""},"updated_date":{"type":"timestamp","null":"NO","Default":"CURRENT_TIMESTAMP","Extra":"DEFAULT_GENERATED"},"created_ip":{"type":"varchar(100)","null":"YES","Default":null,"Extra":""},"updated_ip":{"type":"varchar(100)","null":"YES","Default":null,"Extra":""},"created_by":{"type":"varchar(100)","null":"YES","Default":null,"Extra":""},"updated_by":{"type":"varchar(100)","null":"YES","Default":null,"Extra":""},"fmf_status_qu":{"type":"smallint","null":"NO","Default":"0","Extra":""},"type_fby_id":{"type":"int","null":"NO","Default":null,"Extra":""},"form_fmb_id":{"type":"int","null":"NO","Default":null,"Extra":""},"order_frm":{"type":"smallint","null":"YES","Default":null,"Extra":""},"order_rec":{"type":"smallint","null":"YES","Default":null,"Extra":""}},"cest_uiform_fields_type":{"fby_id":{"type":"int","null":"NO","Default":null,"Extra":"auto_increment"},"fby_name":{"type":"varchar(25)","null":"YES","Default":null,"Extra":""},"flag_status":{"type":"smallint","null":"YES","Default":null,"Extra":""},"created_date":{"type":"timestamp","null":"YES","Default":null,"Extra":""},"updated_date":{"type":"timestamp","null":"NO","Default":"CURRENT_TIMESTAMP","Extra":"DEFAULT_GENERATED"},"created_ip":{"type":"varchar(100)","null":"YES","Default":null,"Extra":""},"updated_ip":{"type":"varchar(100)","null":"YES","Default":null,"Extra":""},"created_by":{"type":"varchar(100)","null":"YES","Default":null,"Extra":""},"updated_by":{"type":"varchar(100)","null":"YES","Default":null,"Extra":""}},"cest_uiform_settings":{"version":{"type":"varchar(10)","null":"YES","Default":null,"Extra":""},"type_email":{"type":"smallint","null":"YES","Default":null,"Extra":""},"smtp_host":{"type":"varchar(255)","null":"YES","Default":null,"Extra":""},"smtp_port":{"type":"smallint","null":"YES","Default":null,"Extra":""},"smtp_user":{"type":"varchar(255)","null":"YES","Default":null,"Extra":""},"smtp_pass":{"type":"varchar(255)","null":"YES","Default":null,"Extra":""},"smtp_conn":{"type":"varchar(255)","null":"YES","Default":null,"Extra":""},"sendmail_path":{"type":"varchar(255)","null":"YES","Default":null,"Extra":""},"language":{"type":"varchar(45)","null":"YES","Default":null,"Extra":""},"id":{"type":"int","null":"NO","Default":null,"Extra":"auto_increment"},"site_title":{"type":"varchar(250)","null":"YES","Default":null,"Extra":""},"admin_mail":{"type":"varchar(250)","null":"YES","Default":null,"Extra":""},"created_date":{"type":"timestamp","null":"YES","Default":null,"Extra":""},"updated_date":{"type":"timestamp","null":"NO","Default":"CURRENT_TIMESTAMP","Extra":"DEFAULT_GENERATED"}},"cest_uiform_pay_gateways":{"pg_id":{"type":"int","null":"NO","Default":null,"Extra":"auto_increment"},"pg_name":{"type":"varchar(255)","null":"YES","Default":null,"Extra":""},"pg_modtest":{"type":"smallint","null":"YES","Default":null,"Extra":""},"pg_data":{"type":"longtext","null":"YES","Default":null,"Extra":""},"flag_status":{"type":"smallint","null":"YES","Default":null,"Extra":""},"pg_order":{"type":"smallint","null":"YES","Default":"0","Extra":""},"pg_description":{"type":"longtext","null":"YES","Default":null,"Extra":""}},"cest_uiform_pay_records":{"pgr_id":{"type":"bigint","null":"NO","Default":null,"Extra":"auto_increment"},"type_pg_id":{"type":"int","null":"NO","Default":null,"Extra":""},"pgr_payment_status":{"type":"varchar(100)","null":"YES","Default":null,"Extra":""},"pgr_payment_amount":{"type":"varchar(45)","null":"YES","Default":null,"Extra":""},"pgr_currency":{"type":"varchar(45)","null":"YES","Default":null,"Extra":""},"pgr_data":{"type":"longtext","null":"YES","Default":null,"Extra":""},"flag_status":{"type":"smallint","null":"YES","Default":null,"Extra":""},"created_date":{"type":"timestamp","null":"YES","Default":null,"Extra":""},"updated_date":{"type":"timestamp","null":"NO","Default":"CURRENT_TIMESTAMP","Extra":"DEFAULT_GENERATED"},"created_ip":{"type":"varchar(100)","null":"YES","Default":null,"Extra":""},"updated_ip":{"type":"varchar(100)","null":"YES","Default":null,"Extra":""},"created_by":{"type":"varchar(100)","null":"YES","Default":null,"Extra":""},"updated_by":{"type":"varchar(100)","null":"YES","Default":null,"Extra":""},"fbh_id":{"type":"int","null":"NO","Default":null,"Extra":""}},"cest_uiform_pay_logs":{"pgl_id":{"type":"bigint","null":"NO","Default":null,"Extra":"auto_increment"},"type_pg_id":{"type":"int","null":"NO","Default":null,"Extra":""},"pgl_data":{"type":"longtext","null":"YES","Default":null,"Extra":""},"pgl_data2":{"type":"longtext","null":"YES","Default":null,"Extra":""},"pgl_error":{"type":"longtext","null":"YES","Default":null,"Extra":""},"pgl_message":{"type":"longtext","null":"YES","Default":null,"Extra":""},"pgr_id":{"type":"int","null":"NO","Default":null,"Extra":""},"vis_last_date":{"type":"timestamp","null":"YES","Default":"CURRENT_TIMESTAMP","Extra":"DEFAULT_GENERATED"}},"cest_uiform_visitor":{"vis_id":{"type":"bigint","null":"NO","Default":null,"Extra":"auto_increment"},"fmb_id":{"type":"int","null":"NO","Default":null,"Extra":""},"vis_uniqueid":{"type":"varchar(10)","null":"YES","Default":null,"Extra":""},"vis_user_agent":{"type":"varchar(200)","null":"YES","Default":null,"Extra":""},"vis_page":{"type":"longtext","null":"YES","Default":null,"Extra":""},"vis_referer":{"type":"longtext","null":"YES","Default":null,"Extra":""},"vis_ip":{"type":"longtext","null":"YES","Default":null,"Extra":""},"vis_error":{"type":"longtext","null":"YES","Default":null,"Extra":""},"vis_last_date":{"type":"timestamp","null":"NO","Default":"CURRENT_TIMESTAMP","Extra":"DEFAULT_GENERATED"},"vis_params":{"type":"longtext","null":"YES","Default":null,"Extra":""}},"cest_uiform_visitor_error":{"vis_id":{"type":"bigint unsigned","null":"NO","Default":null,"Extra":"auto_increment"},"vis_uniqueid":{"type":"varchar(10)","null":"NO","Default":null,"Extra":""},"vis_user_agent":{"type":"varchar(250)","null":"YES","Default":null,"Extra":""},"vis_page":{"type":"longtext","null":"YES","Default":null,"Extra":""},"vis_referer":{"type":"longtext","null":"YES","Default":null,"Extra":""},"vis_error":{"type":"longtext","null":"YES","Default":null,"Extra":""},"vis_ip":{"type":"varchar(40)","null":"YES","Default":null,"Extra":""},"vis_last_date":{"type":"timestamp","null":"NO","Default":"CURRENT_TIMESTAMP","Extra":"DEFAULT_GENERATED"}},"cest_uiform_form_log":{"log_id":{"type":"bigint","null":"NO","Default":null,"Extra":"auto_increment"},"log_frm_data":{"type":"longtext","null":"YES","Default":null,"Extra":""},"log_frm_name":{"type":"varchar(255)","null":"YES","Default":null,"Extra":""},"log_frm_html":{"type":"longtext","null":"YES","Default":null,"Extra":""},"log_frm_html_backend":{"type":"longtext","null":"YES","Default":null,"Extra":""},"log_frm_html_css":{"type":"longtext","null":"YES","Default":null,"Extra":""},"log_frm_id":{"type":"int","null":"NO","Default":null,"Extra":""},"log_frm_hash":{"type":"varchar(255)","null":"NO","Default":null,"Extra":""},"flag_status":{"type":"smallint","null":"YES","Default":"1","Extra":""},"created_date":{"type":"timestamp","null":"YES","Default":null,"Extra":""},"updated_date":{"type":"timestamp","null":"NO","Default":"CURRENT_TIMESTAMP","Extra":"DEFAULT_GENERATED"},"created_ip":{"type":"varchar(100)","null":"YES","Default":null,"Extra":""},"updated_ip":{"type":"varchar(100)","null":"YES","Default":null,"Extra":""},"created_by":{"type":"varchar(100)","null":"YES","Default":null,"Extra":""},"updated_by":{"type":"varchar(100)","null":"YES","Default":null,"Extra":""}},"cest_addon":{"add_name":{"type":"varchar(45)","null":"NO","Default":"","Extra":""},"add_title":{"type":"text","null":"YES","Default":null,"Extra":""},"add_info":{"type":"text","null":"YES","Default":null,"Extra":""},"add_system":{"type":"smallint","null":"YES","Default":null,"Extra":""},"add_hasconfig":{"type":"smallint","null":"YES","Default":null,"Extra":""},"add_version":{"type":"varchar(45)","null":"YES","Default":null,"Extra":""},"add_icon":{"type":"text","null":"YES","Default":null,"Extra":""},"add_installed":{"type":"smallint","null":"YES","Default":null,"Extra":""},"add_order":{"type":"int","null":"YES","Default":null,"Extra":""},"add_params":{"type":"text","null":"YES","Default":null,"Extra":""},"add_log":{"type":"text","null":"YES","Default":null,"Extra":""},"addonscol":{"type":"varchar(45)","null":"YES","Default":null,"Extra":""},"flag_status":{"type":"smallint","null":"YES","Default":"1","Extra":""},"created_date":{"type":"timestamp","null":"YES","Default":null,"Extra":""},"updated_date":{"type":"timestamp","null":"NO","Default":"CURRENT_TIMESTAMP","Extra":"DEFAULT_GENERATED"},"created_ip":{"type":"varchar(100)","null":"YES","Default":null,"Extra":""},"updated_ip":{"type":"varchar(100)","null":"YES","Default":null,"Extra":""},"created_by":{"type":"varchar(100)","null":"YES","Default":null,"Extra":""},"updated_by":{"type":"varchar(100)","null":"YES","Default":null,"Extra":""},"add_xml":{"type":"text","null":"YES","Default":null,"Extra":""},"add_load_back":{"type":"smallint","null":"YES","Default":null,"Extra":""},"add_load_front":{"type":"smallint","null":"YES","Default":null,"Extra":""},"is_field":{"type":"smallint","null":"YES","Default":null,"Extra":""}},"cest_addon_details":{"add_name":{"type":"varchar(45)","null":"NO","Default":null,"Extra":""},"fmb_id":{"type":"int","null":"NO","Default":null,"Extra":""},"adet_data":{"type":"longtext","null":"YES","Default":null,"Extra":""},"flag_status":{"type":"smallint","null":"YES","Default":"1","Extra":""},"created_date":{"type":"timestamp","null":"YES","Default":null,"Extra":""},"updated_date":{"type":"timestamp","null":"NO","Default":"CURRENT_TIMESTAMP","Extra":"DEFAULT_GENERATED"},"created_ip":{"type":"varchar(100)","null":"YES","Default":null,"Extra":""},"updated_ip":{"type":"varchar(100)","null":"YES","Default":null,"Extra":""},"created_by":{"type":"varchar(100)","null":"YES","Default":null,"Extra":""},"updated_by":{"type":"varchar(100)","null":"YES","Default":null,"Extra":""}},"cest_addon_details_log":{"add_log_id":{"type":"bigint","null":"NO","Default":null,"Extra":"auto_increment"},"add_name":{"type":"varchar(45)","null":"NO","Default":null,"Extra":""},"fmb_id":{"type":"int","null":"NO","Default":null,"Extra":""},"adet_data":{"type":"longtext","null":"YES","Default":null,"Extra":""},"flag_status":{"type":"smallint","null":"YES","Default":"1","Extra":""},"created_date":{"type":"timestamp","null":"YES","Default":null,"Extra":""},"updated_date":{"type":"timestamp","null":"NO","Default":"CURRENT_TIMESTAMP","Extra":"DEFAULT_GENERATED"},"created_ip":{"type":"varchar(100)","null":"YES","Default":null,"Extra":""},"updated_ip":{"type":"varchar(100)","null":"YES","Default":null,"Extra":""},"created_by":{"type":"varchar(100)","null":"YES","Default":null,"Extra":""},"updated_by":{"type":"varchar(100)","null":"YES","Default":null,"Extra":""},"log_id":{"type":"int","null":"NO","Default":null,"Extra":""}}} \ No newline at end of file diff --git a/application/modules/formbuilder/views/settings/view_settings.php b/application/modules/formbuilder/views/settings/view_settings.php index 05f5dce2..3214de83 100755 --- a/application/modules/formbuilder/views/settings/view_settings.php +++ b/application/modules/formbuilder/views/settings/view_settings.php @@ -9,150 +9,150 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?>
    -
    -
    -
    - -
    -
    -
    -
    -
    - -
    - -
    - -
    -
    -
    -
    -
    - -
    -
    -
    - -
    - - - -
    - -
    - - -
    - -
    - -
    -
    -
    -
    - -
    - - - -
    - -
    - - - - -
    - -
    - -
    - -
    -
    -
    - -
    -
    - -
    -
    -
    -
    -
    - +
    +
    +
    + +
    +
    +
    +
    +
    + +
    + +
    + +
    +
    +
    +
    +
    + +
    +
    +
    + +
    + + + +
    + +
    + + +
    + +
    + +
    +
    +
    +
    + +
    + + + +
    + +
    + + + + +
    + +
    + +
    + +
    +
    +
    + +
    +
    + +
    +
    +
    +
    +
    +
    diff --git a/application/modules/gateways/controllers/paypal.php b/application/modules/gateways/controllers/paypal.php index 2bf92acb..03b6ffec 100755 --- a/application/modules/gateways/controllers/paypal.php +++ b/application/modules/gateways/controllers/paypal.php @@ -10,13 +10,13 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } -if ( class_exists( 'Paypal' ) ) { - return; +if ( class_exists('Paypal')) { + return; } /** @@ -28,353 +28,349 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version Release: 1.00 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -class Paypal extends MX_Controller { - - const VERSION = '0.1'; - - protected $modules; - - - /** - * If true, the paypal sandbox URI www.sandbox.paypal.com is used for the - * post back. If false, the live URI www.paypal.com is used. Default false. - * - * @var boolean - */ - public $use_sandbox = false; - public $force_ssl_v3 = false; - - const PAYPAL_HOST = 'www.paypal.com'; - const SANDBOX_HOST = 'www.sandbox.paypal.com'; - - /** - * Constructor - * - * @mvc Controller - */ - function __construct() { - parent::__construct(); - $this->load->language_alt( model_settings::$db_config['language'] ); - $this->template->set( 'controller', $this ); - $this->load->model( 'visitor/model_visitor' ); - $this->load->model( 'model_gateways' ); - $this->load->model( 'model_gateways_records' ); - $this->load->model( 'model_gateways_logs' ); - - } - /** - * Paypal::index() - * List all payment gateways - * - * @return array - */ - public function ipn() { - try { - ob_start(); - $this->_requirePostMethod(); - - // visitor data - $agent = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : ''; - $referer = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : ''; - $ip = isset( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : ''; - - // get paypal data - $paypal_data = $this->model_gateways->getGatewayById( 2 ); - $pg_data = json_decode( $paypal_data->pg_data, true ); - // STEP 1: read POST data - $this->use_sandbox = ( $paypal_data->pg_modtest == '1' ) ? true : false; - // Reading POSTed data directly from $_POST causes serialization issues with array data in the POST. - // Instead, read raw POST data from the input stream. - - $raw_post_data = file_get_contents( 'php://input' ); - $raw_post_array = explode( '&', $raw_post_data ); - $myPost = array(); - foreach ( $raw_post_array as $keyval ) { - $keyval = explode( '=', $keyval ); - if ( count( $keyval ) == 2 ) { - $myPost[ $keyval[0] ] = urldecode( $keyval[1] ); - } - } - // read the IPN message sent from PayPal and prepend 'cmd=_notify-validate' - $req = 'cmd=_notify-validate'; - if ( function_exists( 'get_magic_quotes_gpc' ) ) { - $get_magic_quotes_exists = true; - } - foreach ( $myPost as $key => $value ) { - if ( $get_magic_quotes_exists == true && get_magic_quotes_gpc() == 1 ) { - $value = urlencode( stripslashes( $value ) ); - } else { - $value = urlencode( $value ); - } - $req .= "&$key=$value"; - } - - // STEP 2: POST IPN data back to PayPal to validate - - $ch = curl_init( 'https://' . $this->_getPaypalHost() . '/cgi-bin/webscr' ); - curl_setopt( $ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1 ); - curl_setopt( $ch, CURLOPT_POST, 1 ); - curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); - curl_setopt( $ch, CURLOPT_POSTFIELDS, $req ); - curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, 1 ); - curl_setopt( $ch, CURLOPT_SSL_VERIFYHOST, 2 ); - curl_setopt( $ch, CURLOPT_FORBID_REUSE, 1 ); - curl_setopt( $ch, CURLOPT_HTTPHEADER, array( 'Connection: Close' ) ); - if ( $this->force_ssl_v3 ) { - curl_setopt( $ch, CURLOPT_SSLVERSION, 3 ); - } - // In wamp-like environments that do not come bundled with root authority certificates, - // please download 'cacert.pem' from "http://curl.haxx.se/docs/caextract.html" and set - // the directory path of the certificate as shown below: - // curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__) . '/cacert.pem'); - if ( ! ( $res = curl_exec( $ch ) ) ) { - // error_log("Got " . curl_error($ch) . " when processing IPN data"); - curl_close( $ch ); - throw new Exception( curl_error( $ch ) ); - die(); - } else { - curl_close( $ch ); - } - - //verify if variables exists - if(!isset($_POST['payment_status'])){ - throw new \Exception( "no payment status" ); - } - - // STEP 3: Inspect IPN validation result and act accordingly - - if ( strcmp( $res, 'VERIFIED' ) == 0 ) { - - // The IPN is verified, process it: - // check whether the payment_status is Completed - // check that txn_id has not been previously processed - // check that receiver_email is your Primary PayPal email - // check that payment_amount/payment_currency are correct - // process the notification - // assign posted variables to local variables - $item_name = isset( $_POST['item_name'] ) ? $_POST['item_name'] : ''; - $item_number = isset( $_POST['item_number'] ) ? $_POST['item_number'] : ''; - $custom = isset( $_POST['custom'] ) ? $_POST['custom'] : ''; - $payment_status = $_POST['payment_status']; - $payment_amount = $_POST['mc_gross']; - $payment_currency = $_POST['mc_currency']; - $txn_id = $_POST['txn_id']; - $receiver_email = $_POST['receiver_email']; - $payer_email = $_POST['payer_email']; - - // log data - $data3 = array(); - $data3['vis_uniqueid'] = ''; - $data3['vis_user_agent'] = $agent; - $data3['vis_page'] = $_SERVER['REQUEST_URI']; - $data3['vis_referer'] = $referer; - $data3['vis_ip'] = $ip; - $data4 = array(); - $data4['type_pg_id'] = 2; - $data4['pgr_id'] = $item_number; - $data4['pgl_data'] = json_encode( $_POST ); - $data4['pgl_data2'] = Uiform_Form_Helper::array2xml( $data3 ); - $data4['pgl_message'] = 'paypal ipn verified'; - - $this->db->set( $data4 ); - $this->db->insert( $this->model_gateways_logs->table ); - - // IPN message values depend upon the type of notification sent. - // To loop through the &_POST array and print the NV pairs to the screen: - $data_invoice = $this->model_gateways_records->getRecordById( $custom ); - if ( ( $payment_status == 'Completed' || $payment_status == 'Processed' || $payment_status == 'Pending' ) && - ( $receiver_email == $pg_data['paypal_email'] ) && ! empty( $data_invoice ) ) { - $data = array(); - $data['type_pg_id'] = 2; - $data['pgr_payment_status'] = $payment_status; - $data['pgr_data'] = json_encode( $_POST ); - - $where = array( - 'pgr_id' => $custom, - ); - - $this->db->set( $data ); - $this->db->where( 'pgr_id', $custom ); - $this->db->update( $this->model_gateways_records->table ); - // sending email - $data = array(); - $subject = 'Paypal order completed successfully - ' . $txn_id . ' - ' . $custom; - $data['message'] = 'Hi, paypal order completed sucessfully. '; - - /*getting admin mail*/ - $mail_from = model_settings::$db_config['admin_mail']; - // get domain - $sitename = strtolower( $_SERVER['SERVER_NAME'] ); - if ( substr( $sitename, 0, 4 ) == 'www.' ) { - $sitename = substr( $sitename, 4 ); - } - // get domain part - list( $user, $domain ) = explode( '@', $mail_from ); - // verify if mail is allowed - $mail_from = ( $sitename == $domain ) ? $mail_from : "wordpress@$sitename"; - $from_name = empty( $mail_from ) ? $mail_from : model_settings::$db_config['admin_mail']; - - $message = $data['message']; - - $headers = array(); - $message_format = 'html'; - $content_type = $message_format == 'html' ? 'text/html' : 'text/plain'; - $headers[] = 'MIME-Version: 1.0'; - $headers[] = "Content-type: {$content_type}"; - - $headers[] = "From: \"{$from_name}\" <{$mail_from}>"; - $to = model_settings::$db_config['admin_mail']; - - $this->load->library( 'email', emailConfiguration( intval( model_settings::$db_config['type_email'] ) ) ); - $this->email->set_newline( "\r\n" ); - $this->email->from( model_settings::$db_config['admin_mail'], model_settings::$db_config['site_title'] ); - $this->email->to( $to ); - $this->email->subject( $subject ); - $this->email->set_mailtype( 'html' ); - $template_message = $message; - $this->email->message( $template_message ); - $this->email->send(); - - } else { - // sending email - $message = 'Paypal order not completed - ' . $txn_id . ' - ' . $custom; - // log data - $data3 = array(); - $data3['vis_uniqueid'] = ''; - $data3['vis_user_agent'] = $agent; - $data3['vis_page'] = $_SERVER['REQUEST_URI']; - $data3['vis_referer'] = $referer; - $data3['vis_ip'] = $ip; - $data4 = array(); - $data4['type_pg_id'] = 2; - $data4['pgr_id'] = $custom; - $data4['pgl_data'] = json_encode( $_POST ); - $data4['pgl_data2'] = Uiform_Form_Helper::array2xml( $data3 ); - $data4['pgl_message'] = $message; - $this->db->set( $data4 ); - $this->db->insert( $this->model_gateways_logs->table ); - } - } elseif ( strcmp( $res, 'INVALID' ) == 0 ) { - // IPN invalid, log for manual investigation - $payer_email = $_POST['payer_email']; - $item_name = isset( $_POST['item_name'] ) ? $_POST['item_name'] : ''; - $item_number = isset( $_POST['item_number'] ) ? $_POST['item_number'] : ''; - $txn_id = $_POST['txn_id']; - - $message = 'The response from IPN was: ' . $res . ''; - // log data - $data3 = array(); - $data3['vis_uniqueid'] = ''; - $data3['vis_user_agent'] = $agent; - $data3['vis_page'] = $_SERVER['REQUEST_URI']; - $data3['vis_referer'] = $referer; - $data3['vis_ip'] = $ip; - $data4 = array(); - $data4['type_pg_id'] = 2; - $data4['pgr_id'] = $custom; - $data4['pgl_data'] = json_encode( $_POST ); - $data4['pgl_data2'] = Uiform_Form_Helper::array2xml( $data3 ); - $data4['pgl_message'] = $message; - - $this->db->set( $data4 ); - $this->db->insert( $this->model_gateways_logs->table ); - } else { - // log data - $data3 = array(); - $data3['vis_uniqueid'] = ''; - $data3['vis_user_agent'] = $agent; - $data3['vis_page'] = $_SERVER['REQUEST_URI']; - $data3['vis_referer'] = $referer; - $data3['vis_ip'] = $ip; - $data4 = array(); - $data4['type_pg_id'] = 2; - $data4['pgr_id'] = ''; - $data4['pgl_data'] = json_encode( $_POST ); - $data4['pgl_data2'] = Uiform_Form_Helper::array2xml( $data3 ); - $data4['pgl_message'] = 'paypal ipn connection'; - $this->db->set( $data4 ); - $this->db->insert( $this->model_gateways_logs->table ); - } - - // checking errors - $previousOutput = ob_get_contents(); - // putting at the of script - /* - if ($previousOutput) { - $previousOutput = "[" . date('d-m-Y H:i:s', time()) . "] invoice \n" . $previousOutput . "\n"; - $req_dump = print_r($previousOutput, true); - $fp = fopen('ipnlog.log', 'a'); - fwrite($fp, $req_dump); - fclose($fp); - }*/ - - ob_end_clean(); - if ( ! empty( $previousOutput ) ) { - throw new Exception( $previousOutput ); - } - } catch ( Exception $e ) { - $error = array(); - $error['Message'] = $e->getMessage(); - // $error['Trace'] = $e->getTrace(); - $ip = isset( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : ''; - $user_agent = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : ''; - $hash = hash( 'crc32', md5( $ip . $user_agent ) ); - $referer = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : ''; - - // log data - $data3 = array(); - $data3['vis_uniqueid'] = $hash; - $data3['vis_user_agent'] = $user_agent; - $data3['vis_page'] = $_SERVER['REQUEST_URI']; - $data3['vis_referer'] = $referer; - $data3['vis_ip'] = $ip; - $data4 = array(); - $data4['type_pg_id'] = 2; - $data4['pgr_id'] = ! empty( $custom ) ? $custom : '0'; - $data4['pgl_data'] = json_encode( $_POST ); - $data4['pgl_data2'] = json_encode( $data3 ); - $data4['pgl_error'] = Uiform_Form_Helper::array2xml( $error ); - $data4['pgl_message'] = 'Error - [' . date( 'd-m-Y H:i:s', time() ) . ']'; - $this->db->set( $data4 ); - $this->db->insert( $this->model_gateways_logs->table ); - - echo json_encode($error); - } - - } - - /** - * Paypal::_getPaypalHost() - * Get paypal host - * - * @return void - */ - private function _getPaypalHost() { - if ( $this->use_sandbox ) { - return self::SANDBOX_HOST; - } else { - return self::PAYPAL_HOST; - } - } - - /** - * Paypal::requirePostMethod() - * Verify post method - * - * @return void - */ - private function _requirePostMethod() { - // require POST requests - if ( $_SERVER['REQUEST_METHOD'] && $_SERVER['REQUEST_METHOD'] != 'POST' ) { - header( 'Allow: POST', true, 405 ); - throw new Exception( 'Invalid HTTP request method.' ); - } - } - - - +class Paypal extends MX_Controller +{ + + const VERSION = '0.1'; + + protected $modules; + + + /** + * If true, the paypal sandbox URI www.sandbox.paypal.com is used for the + * post back. If false, the live URI www.paypal.com is used. Default false. + * + * @var boolean + */ + public $use_sandbox = false; + public $force_ssl_v3 = false; + + const PAYPAL_HOST = 'www.paypal.com'; + const SANDBOX_HOST = 'www.sandbox.paypal.com'; + + /** + * Constructor + * + * @mvc Controller + */ + public function __construct() + { + parent::__construct(); + $this->load->language_alt(model_settings::$db_config['language']); + $this->template->set('controller', $this); + $this->load->model('visitor/model_visitor'); + $this->load->model('model_gateways'); + $this->load->model('model_gateways_records'); + $this->load->model('model_gateways_logs'); + } + /** + * Paypal::index() + * List all payment gateways + * + * @return array + */ + public function ipn() + { + try { + ob_start(); + $this->_requirePostMethod(); + + // visitor data + $agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''; + $referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; + $ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : ''; + + // get paypal data + $paypal_data = $this->model_gateways->getGatewayById(2); + $pg_data = json_decode($paypal_data->pg_data, true); + // STEP 1: read POST data + $this->use_sandbox = ( $paypal_data->pg_modtest == '1' ) ? true : false; + // Reading POSTed data directly from $_POST causes serialization issues with array data in the POST. + // Instead, read raw POST data from the input stream. + + $raw_post_data = file_get_contents('php://input'); + $raw_post_array = explode('&', $raw_post_data); + $myPost = array(); + foreach ( $raw_post_array as $keyval) { + $keyval = explode('=', $keyval); + if ( count($keyval) == 2) { + $myPost[ $keyval[0] ] = urldecode($keyval[1]); + } + } + // read the IPN message sent from PayPal and prepend 'cmd=_notify-validate' + $req = 'cmd=_notify-validate'; + if ( function_exists('get_magic_quotes_gpc')) { + $get_magic_quotes_exists = true; + } + foreach ( $myPost as $key => $value) { + if ( $get_magic_quotes_exists == true && get_magic_quotes_gpc() == 1) { + $value = urlencode(stripslashes($value)); + } else { + $value = urlencode($value); + } + $req .= "&$key=$value"; + } + + // STEP 2: POST IPN data back to PayPal to validate + + $ch = curl_init('https://' . $this->_getPaypalHost() . '/cgi-bin/webscr'); + curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); + curl_setopt($ch, CURLOPT_POST, 1); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($ch, CURLOPT_POSTFIELDS, $req); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); + curl_setopt($ch, CURLOPT_FORBID_REUSE, 1); + curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Connection: Close' )); + if ( $this->force_ssl_v3) { + curl_setopt($ch, CURLOPT_SSLVERSION, 3); + } + // In wamp-like environments that do not come bundled with root authority certificates, + // please download 'cacert.pem' from "http://curl.haxx.se/docs/caextract.html" and set + // the directory path of the certificate as shown below: + // curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__) . '/cacert.pem'); + if ( ! ( $res = curl_exec($ch) )) { + // error_log("Got " . curl_error($ch) . " when processing IPN data"); + curl_close($ch); + throw new Exception(curl_error($ch)); + die(); + } else { + curl_close($ch); + } + + //verify if variables exists + if (!isset($_POST['payment_status'])) { + throw new \Exception("no payment status"); + } + + // STEP 3: Inspect IPN validation result and act accordingly + + if ( strcmp($res, 'VERIFIED') == 0) { + // The IPN is verified, process it: + // check whether the payment_status is Completed + // check that txn_id has not been previously processed + // check that receiver_email is your Primary PayPal email + // check that payment_amount/payment_currency are correct + // process the notification + // assign posted variables to local variables + $item_name = isset($_POST['item_name']) ? $_POST['item_name'] : ''; + $item_number = isset($_POST['item_number']) ? $_POST['item_number'] : ''; + $custom = isset($_POST['custom']) ? $_POST['custom'] : ''; + $payment_status = $_POST['payment_status']; + $payment_amount = $_POST['mc_gross']; + $payment_currency = $_POST['mc_currency']; + $txn_id = $_POST['txn_id']; + $receiver_email = $_POST['receiver_email']; + $payer_email = $_POST['payer_email']; + + // log data + $data3 = array(); + $data3['vis_uniqueid'] = ''; + $data3['vis_user_agent'] = $agent; + $data3['vis_page'] = $_SERVER['REQUEST_URI']; + $data3['vis_referer'] = $referer; + $data3['vis_ip'] = $ip; + $data4 = array(); + $data4['type_pg_id'] = 2; + $data4['pgr_id'] = $item_number; + $data4['pgl_data'] = json_encode($_POST); + $data4['pgl_data2'] = Uiform_Form_Helper::array2xml($data3); + $data4['pgl_message'] = 'paypal ipn verified'; + + $this->db->set($data4); + $this->db->insert($this->model_gateways_logs->table); + + // IPN message values depend upon the type of notification sent. + // To loop through the &_POST array and print the NV pairs to the screen: + $data_invoice = $this->model_gateways_records->getRecordById($custom); + if ( ( $payment_status == 'Completed' || $payment_status == 'Processed' || $payment_status == 'Pending' ) && + ( $receiver_email == $pg_data['paypal_email'] ) && ! empty($data_invoice)) { + $data = array(); + $data['type_pg_id'] = 2; + $data['pgr_payment_status'] = $payment_status; + $data['pgr_data'] = json_encode($_POST); + + $where = array( + 'pgr_id' => $custom, + ); + + $this->db->set($data); + $this->db->where('pgr_id', $custom); + $this->db->update($this->model_gateways_records->table); + // sending email + $data = array(); + $subject = 'Paypal order completed successfully - ' . $txn_id . ' - ' . $custom; + $data['message'] = 'Hi, paypal order completed sucessfully. '; + + /*getting admin mail*/ + $mail_from = model_settings::$db_config['admin_mail']; + // get domain + $sitename = strtolower($_SERVER['SERVER_NAME']); + if ( substr($sitename, 0, 4) == 'www.') { + $sitename = substr($sitename, 4); + } + // get domain part + list( $user, $domain ) = explode('@', $mail_from); + // verify if mail is allowed + $mail_from = ( $sitename == $domain ) ? $mail_from : "wordpress@$sitename"; + $from_name = empty($mail_from) ? $mail_from : model_settings::$db_config['admin_mail']; + + $message = $data['message']; + + $headers = array(); + $message_format = 'html'; + $content_type = $message_format == 'html' ? 'text/html' : 'text/plain'; + $headers[] = 'MIME-Version: 1.0'; + $headers[] = "Content-type: {$content_type}"; + + $headers[] = "From: \"{$from_name}\" <{$mail_from}>"; + $to = model_settings::$db_config['admin_mail']; + + $this->load->library('email', emailConfiguration(intval(model_settings::$db_config['type_email']))); + $this->email->set_newline("\r\n"); + $this->email->from(model_settings::$db_config['admin_mail'], model_settings::$db_config['site_title']); + $this->email->to($to); + $this->email->subject($subject); + $this->email->set_mailtype('html'); + $template_message = $message; + $this->email->message($template_message); + $this->email->send(); + } else { + // sending email + $message = 'Paypal order not completed - ' . $txn_id . ' - ' . $custom; + // log data + $data3 = array(); + $data3['vis_uniqueid'] = ''; + $data3['vis_user_agent'] = $agent; + $data3['vis_page'] = $_SERVER['REQUEST_URI']; + $data3['vis_referer'] = $referer; + $data3['vis_ip'] = $ip; + $data4 = array(); + $data4['type_pg_id'] = 2; + $data4['pgr_id'] = $custom; + $data4['pgl_data'] = json_encode($_POST); + $data4['pgl_data2'] = Uiform_Form_Helper::array2xml($data3); + $data4['pgl_message'] = $message; + $this->db->set($data4); + $this->db->insert($this->model_gateways_logs->table); + } + } elseif ( strcmp($res, 'INVALID') == 0) { + // IPN invalid, log for manual investigation + $payer_email = $_POST['payer_email']; + $item_name = isset($_POST['item_name']) ? $_POST['item_name'] : ''; + $item_number = isset($_POST['item_number']) ? $_POST['item_number'] : ''; + $txn_id = $_POST['txn_id']; + + $message = 'The response from IPN was: ' . $res . ''; + // log data + $data3 = array(); + $data3['vis_uniqueid'] = ''; + $data3['vis_user_agent'] = $agent; + $data3['vis_page'] = $_SERVER['REQUEST_URI']; + $data3['vis_referer'] = $referer; + $data3['vis_ip'] = $ip; + $data4 = array(); + $data4['type_pg_id'] = 2; + $data4['pgr_id'] = $custom; + $data4['pgl_data'] = json_encode($_POST); + $data4['pgl_data2'] = Uiform_Form_Helper::array2xml($data3); + $data4['pgl_message'] = $message; + + $this->db->set($data4); + $this->db->insert($this->model_gateways_logs->table); + } else { + // log data + $data3 = array(); + $data3['vis_uniqueid'] = ''; + $data3['vis_user_agent'] = $agent; + $data3['vis_page'] = $_SERVER['REQUEST_URI']; + $data3['vis_referer'] = $referer; + $data3['vis_ip'] = $ip; + $data4 = array(); + $data4['type_pg_id'] = 2; + $data4['pgr_id'] = ''; + $data4['pgl_data'] = json_encode($_POST); + $data4['pgl_data2'] = Uiform_Form_Helper::array2xml($data3); + $data4['pgl_message'] = 'paypal ipn connection'; + $this->db->set($data4); + $this->db->insert($this->model_gateways_logs->table); + } + + // checking errors + $previousOutput = ob_get_contents(); + // putting at the of script + /* + if ($previousOutput) { + $previousOutput = "[" . date('d-m-Y H:i:s', time()) . "] invoice \n" . $previousOutput . "\n"; + $req_dump = print_r($previousOutput, true); + $fp = fopen('ipnlog.log', 'a'); + fwrite($fp, $req_dump); + fclose($fp); + }*/ + + ob_end_clean(); + if ( ! empty($previousOutput)) { + throw new Exception($previousOutput); + } + } catch ( Exception $e) { + $error = array(); + $error['Message'] = $e->getMessage(); + // $error['Trace'] = $e->getTrace(); + $ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : ''; + $user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''; + $hash = hash('crc32', md5($ip . $user_agent)); + $referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; + + // log data + $data3 = array(); + $data3['vis_uniqueid'] = $hash; + $data3['vis_user_agent'] = $user_agent; + $data3['vis_page'] = $_SERVER['REQUEST_URI']; + $data3['vis_referer'] = $referer; + $data3['vis_ip'] = $ip; + $data4 = array(); + $data4['type_pg_id'] = 2; + $data4['pgr_id'] = ! empty($custom) ? $custom : '0'; + $data4['pgl_data'] = json_encode($_POST); + $data4['pgl_data2'] = json_encode($data3); + $data4['pgl_error'] = Uiform_Form_Helper::array2xml($error); + $data4['pgl_message'] = 'Error - [' . date('d-m-Y H:i:s', time()) . ']'; + $this->db->set($data4); + $this->db->insert($this->model_gateways_logs->table); + + echo json_encode($error); + } + } + + /** + * Paypal::_getPaypalHost() + * Get paypal host + * + * @return void + */ + private function _getPaypalHost() + { + if ( $this->use_sandbox) { + return self::SANDBOX_HOST; + } else { + return self::PAYPAL_HOST; + } + } + + /** + * Paypal::requirePostMethod() + * Verify post method + * + * @return void + */ + private function _requirePostMethod() + { + // require POST requests + if ( $_SERVER['REQUEST_METHOD'] && $_SERVER['REQUEST_METHOD'] != 'POST') { + header('Allow: POST', true, 405); + throw new Exception('Invalid HTTP request method.'); + } + } } - - diff --git a/application/modules/gateways/controllers/records.php b/application/modules/gateways/controllers/records.php index 6335486a..94378bac 100755 --- a/application/modules/gateways/controllers/records.php +++ b/application/modules/gateways/controllers/records.php @@ -10,10 +10,10 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } use \Zigaform\Admin\List_data; @@ -27,375 +27,372 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version Release: 1.00 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -class Records extends BackendController { - - const VERSION = '0.1'; - var $per_page = 50; - protected $modules; - - /** - * Constructor - * - * @mvc Controller - */ - function __construct() { - - parent::__construct(); - $this->load->language_alt( model_settings::$db_config['language'] ); - $this->template->set( 'controller', $this ); - $this->load->model( 'model_gateways' ); - $this->load->model( 'model_gateways_records' ); - $this->load->model( 'model_gateways_logs' ); - $this->load->model( 'formbuilder/model_record' ); - // global $wpdb; - // $this->wpdb = $wpdb; - // $this->model_gateways_records = self::$_models['gateways']['records']; - // delete record - // add_action('wp_ajax_rocket_fbuilder_invoice_delete_records', array(&$this, 'ajax_delete_records')); - // - } - - public function ajax_list_invoice_updatest() { - - $list_ids = ( isset( $_POST['id'] ) && $_POST['id'] ) ? array_map( array( 'Uiform_Form_Helper', 'sanitizeRecursive' ), $_POST['id'] ) : array(); - $form_st = ( isset( $_POST['form_st'] ) && $_POST['form_st'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['form_st'] ) : ''; - $is_trash = ( isset( $_POST['is_trash'] ) && $_POST['is_trash'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['is_trash'] ) : ''; - if ( $list_ids ) { - - if ( intval( $is_trash ) === 0 ) { - switch ( intval( $form_st ) ) { - case 1: - case 2: - case 0: - foreach ( $list_ids as $value ) { - - $data = array( - 'flag_status' => intval( $form_st ), - ); - - $this->db->set( $data ); - $this->db->where( 'pgr_id', $value ); - $this->db->update( $this->model_gateways_records->table ); - } - break; - default: - break; - } - } else { - switch ( intval( $form_st ) ) { - case 1: - case 2: - foreach ( $list_ids as $value ) { - - $data = array( - 'flag_status' => intval( $form_st ), - ); - - $this->db->set( $data ); - $this->db->where( 'pgr_id', $value ); - $this->db->update( $this->model_gateways_records->table ); - } - break; - case 0: - foreach ( $list_ids as $value ) { - - $this->delete_form_process( $value ); - - } - - break; - default: - # code... - break; - } - } - } - } - - private function delete_form_process( $value ) { - - //remove from records - $this->db->where( 'pgr_id', $value ); - $this->db->delete( $this->model_gateways_logs->table ); - - //remove from records - $this->db->where( 'pgr_id', $value ); - $this->db->delete( $this->model_gateways_records->table ); - - } - - public function ajax_delete_invoice() { - - $pgr_id = ( isset( $_POST['pgr_id'] ) && $_POST['pgr_id'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['pgr_id'] ) : 0; - $is_trash = ( isset( $_POST['is_trash'] ) && $_POST['is_trash'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['is_trash'] ) : 0; - - if ( intval( $is_trash ) === 0 ) { - - $data = array( - 'flag_status' => 0, - ); - - $this->db->set( $data ); - $this->db->where( 'pgr_id', $pgr_id ); - $this->db->update( $this->model_gateways_records->table ); - - } else { - $this->delete_form_process( $pgr_id ); - - } - - } - - /** - * List trash forms - * - * @return void - */ - function ajax_invoicelist_sendfilter() { - - $data_filter = ( isset( $_POST['data_filter'] ) && $_POST['data_filter'] ) ? $_POST['data_filter'] : ''; - - $opt_save = ( isset( $_POST['opt_save'] ) && $_POST['opt_save'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['opt_save'] ) : 0; - $opt_offset = ( isset( $_POST['opt_offset'] ) && $_POST['opt_offset'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['opt_offset'] ) : 0; - $is_trash = ( isset( $_POST['op_is_trash'] ) && $_POST['op_is_trash'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['op_is_trash'] ) : 0; - - parse_str( $data_filter, $data_filter_arr ); - - $per_page = $data_filter_arr['zgfm-listform-pref-perpage']; - $orderby = $data_filter_arr['zgfm-listform-pref-orderby']; - - $data = array(); - $data['per_page'] = $per_page; - $data['orderby'] = $orderby; - $data['is_trash'] = $is_trash; - - update_option( 'zgfm_listinvoices_searchfilter', $data ); - - $data['segment'] = 0; - $data['offset'] = $opt_offset; - - $result = $this->ajax_invoiceslist_refresh( $data ); - - $json = array(); - $json['content'] = $result; - - header( 'Content-Type: application/json' ); - echo json_encode( $json ); - die(); - } - - /** - * get forms in trash - * - * @param [type] $data - * @return void - */ - function ajax_invoiceslist_refresh( $data ) { - - $this->load->library( 'pagination' ); - - $offset = $data['offset']; - - // list all forms - $config = array(); - - $tmp = $this->model_gateways_records->ListTotals(); - if ( intval( $data['is_trash'] ) === 0 ) { - $config['base_url'] = site_url() . 'formbuilder/forms/list_records'; - $config['total_rows'] = $tmp->r_all; - } else { - $config['base_url'] = site_url() . 'formbuilder/forms/list_trash_records'; - $config['total_rows'] = $tmp->r_trash; - } - - $config['per_page'] = $data['per_page']; - $config['first_link'] = 'First'; - $config['last_link'] = 'Last'; - $config['full_tag_open'] = '
      '; - $config['full_tag_close'] = '
    '; - $config['first_tag_open'] = '
  • '; - $config['first_tag_close'] = '
  • '; - $config['last_tag_open'] = '
  • '; - $config['last_tag_close'] = '
  • '; - $config['cur_tag_open'] = '
  • '; - $config['cur_tag_close'] = '
  • '; - $config['next_tag_open'] = '
  • '; - $config['next_tag_close'] = '
  • '; - $config['prev_tag_open'] = '
  • '; - $config['prev_tag_close'] = '
  • '; - $config['num_tag_open'] = '
  • '; - $config['num_tag_close'] = '
  • '; - $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; - - $data2 = array(); - $data2['per_page'] = $data['per_page']; - $data2['segment'] = $offset; - $data2['orderby'] = $data['orderby']; - $data2['is_trash'] = $data['is_trash']; - - if ( intval( $data2['is_trash'] ) === 0 ) { - $data2['query'] = $this->model_gateways_records->getListAllInvoicesFiltered( $data2 ); - } else { - $data2['query'] = $this->model_gateways_records->getListTrashInvoicesFiltered( $data2 ); - } - - $data2['pagination'] = $this->pagination->create_links(); - $data2['obj_list_data'] = List_data::get(); - - if ( intval( $data2['is_trash'] ) === 0 ) { - return List_data::get()->list_detail_invoices( $data2 ); - } else { - return List_data::get()->list_detail_invoicestrash( $data2 ); - } - - } - - public function info_record() { - $id_rec = ( isset( $_GET['id_rec'] ) && $_GET['id_rec'] ) ? Uiform_Form_Helper::sanitizeInput( $_GET['id_rec'] ) : 0; - $data = array(); - $data['record_id'] = $id_rec; - - $form_rec_data = $this->model_record->getFormDataById( $id_rec ); - - $data['fmb_inv_tpl_st'] = $form_rec_data->fmb_inv_tpl_st; - $data['base_url'] = base_url() . '/'; - $data['form_id'] = $form_rec_data->form_fmb_id; - $data['url_form'] = site_url() . 'formbuilder/frontend/pdf_show_invoice/?uifm_mode=pdf&is_html=1&id=' . $id_rec; - $data['show_summary'] = $this->load->view( 'formbuilder/frontend/form_summary_custom', $data, true ); - - $this->template->loadPartial( 'layout', 'gateways/records/info_record', $data ); - } - - public function list_records() { - $filter_data = get_option( 'zgfm_listinvoices_searchfilter', true ); - $data2 = array(); - if ( empty( $filter_data ) ) { - $data2['per_page'] = intval( $this->per_page ); - $data2['orderby'] = 'asc'; - } else { - $data2['per_page'] = intval( $filter_data['per_page']??'' ); - $data2['orderby'] = $filter_data['orderby']??''; - } - - $offset = ( isset( $_GET['offset'] ) ) ? Uiform_Form_Helper::sanitizeInput( $_GET['offset'] ) : 0; - $data2['offset'] = $offset; - - $form_data = $this->model_gateways_records->ListTotals(); - $data2['title'] = __( 'Invoices list', 'FRocket_admin' ); - $data2['all'] = $form_data->r_all; - $data2['trash'] = $form_data->r_trash; - $data2['header_buttons'] = List_data::get()->list_detail_invoice_headerbuttons(); - $data2['script_trigger'] = 'zgfm_back_general.invoiceslist_search_process();'; - $data2['subcurrent'] = 1; - $data2['subsubsub'] = List_data::get()->subsubsub_invoices( $data2 ); - $data2['is_trash'] = 0; - - $content = List_data::get()->show_list( $data2 ); - //echo self::loadPartial2( 'layout.php', $content); - echo $this->template->loadPartial2( 'layout', $content ); - } - - /** - * list trash records - * - * @return void - */ - public function list_trash_records() { - $filter_data = get_option( 'zgfm_listinvoices_searchfilter', true ); - $data2 = array(); - if ( empty( $filter_data ) ) { - $data2['per_page'] = intval( $this->per_page ); - $data2['orderby'] = 'asc'; - } else { - $data2['per_page'] = intval( $filter_data['per_page']??'' ); - $data2['orderby'] = $filter_data['orderby']??''; - } - - $offset = ( isset( $_GET['offset'] ) ) ? Uiform_Form_Helper::sanitizeInput( $_GET['offset'] ) : 0; - $data2['offset'] = $offset; - - $form_data = $this->model_gateways_records->ListTotals(); - $data2['title'] = __( 'Invoices in trash', 'FRocket_admin' ); - $data2['all'] = $form_data->r_all; - $data2['trash'] = $form_data->r_trash; - $data2['header_buttons'] = List_data::get()->list_detail_invoicetrash_headerbuttons(); - $data2['script_trigger'] = 'zgfm_back_general.invoiceslist_search_process();'; - $data2['subcurrent'] = 2; - $data2['subsubsub'] = List_data::get()->subsubsub_invoices( $data2 ); - $data2['is_trash'] = 1; - - $content = List_data::get()->show_list( $data2 ); - //echo self::loadPartial2( 'layout.php', $content); - echo $this->template->loadPartial2( 'layout', $content ); - } - - - public function action_pdf_show_invoice() { - - $rec_id = isset( $_GET['id'] ) ? Uiform_Form_Helper::sanitizeInput( $_GET['id'] ) : ''; - - if ( intval( $rec_id ) > 0 ) { - ob_start(); - ?> - - - - - - - - - - -
    - -

     

    - -
    - - - - load->language_alt(model_settings::$db_config['language']); + $this->template->set('controller', $this); + $this->load->model('model_gateways'); + $this->load->model('model_gateways_records'); + $this->load->model('model_gateways_logs'); + $this->load->model('formbuilder/model_record'); + // global $wpdb; + // $this->wpdb = $wpdb; + // $this->model_gateways_records = self::$_models['gateways']['records']; + // delete record + // add_action('wp_ajax_rocket_fbuilder_invoice_delete_records', array(&$this, 'ajax_delete_records')); + // + } + + public function ajax_list_invoice_updatest() + { + + $list_ids = ( isset($_POST['id']) && $_POST['id'] ) ? array_map(array( 'Uiform_Form_Helper', 'sanitizeRecursive' ), $_POST['id']) : array(); + $form_st = ( isset($_POST['form_st']) && $_POST['form_st'] ) ? Uiform_Form_Helper::sanitizeInput($_POST['form_st']) : ''; + $is_trash = ( isset($_POST['is_trash']) && $_POST['is_trash'] ) ? Uiform_Form_Helper::sanitizeInput($_POST['is_trash']) : ''; + if ( $list_ids) { + if ( intval($is_trash) === 0) { + switch ( intval($form_st)) { + case 1: + case 2: + case 0: + foreach ( $list_ids as $value) { + $data = array( + 'flag_status' => intval($form_st), + ); + + $this->db->set($data); + $this->db->where('pgr_id', $value); + $this->db->update($this->model_gateways_records->table); + } + break; + default: + break; + } + } else { + switch ( intval($form_st)) { + case 1: + case 2: + foreach ( $list_ids as $value) { + $data = array( + 'flag_status' => intval($form_st), + ); + + $this->db->set($data); + $this->db->where('pgr_id', $value); + $this->db->update($this->model_gateways_records->table); + } + break; + case 0: + foreach ( $list_ids as $value) { + $this->delete_form_process($value); + } + + break; + default: + # code... + break; + } + } + } + } + + private function delete_form_process($value) + { + + //remove from records + $this->db->where('pgr_id', $value); + $this->db->delete($this->model_gateways_logs->table); + + //remove from records + $this->db->where('pgr_id', $value); + $this->db->delete($this->model_gateways_records->table); + } + + public function ajax_delete_invoice() + { + + $pgr_id = ( isset($_POST['pgr_id']) && $_POST['pgr_id'] ) ? Uiform_Form_Helper::sanitizeInput($_POST['pgr_id']) : 0; + $is_trash = ( isset($_POST['is_trash']) && $_POST['is_trash'] ) ? Uiform_Form_Helper::sanitizeInput($_POST['is_trash']) : 0; + + if ( intval($is_trash) === 0) { + $data = array( + 'flag_status' => 0, + ); + + $this->db->set($data); + $this->db->where('pgr_id', $pgr_id); + $this->db->update($this->model_gateways_records->table); + } else { + $this->delete_form_process($pgr_id); + } + } + + /** + * List trash forms + * + * @return void + */ + public function ajax_invoicelist_sendfilter() + { + + $data_filter = ( isset($_POST['data_filter']) && $_POST['data_filter'] ) ? $_POST['data_filter'] : ''; + + $opt_save = ( isset($_POST['opt_save']) && $_POST['opt_save'] ) ? Uiform_Form_Helper::sanitizeInput($_POST['opt_save']) : 0; + $opt_offset = ( isset($_POST['opt_offset']) && $_POST['opt_offset'] ) ? Uiform_Form_Helper::sanitizeInput($_POST['opt_offset']) : 0; + $is_trash = ( isset($_POST['op_is_trash']) && $_POST['op_is_trash'] ) ? Uiform_Form_Helper::sanitizeInput($_POST['op_is_trash']) : 0; + + parse_str($data_filter, $data_filter_arr); + + $per_page = $data_filter_arr['zgfm-listform-pref-perpage']; + $orderby = $data_filter_arr['zgfm-listform-pref-orderby']; + + $data = array(); + $data['per_page'] = $per_page; + $data['orderby'] = $orderby; + $data['is_trash'] = $is_trash; + + update_option('zgfm_listinvoices_searchfilter', $data); + + $data['segment'] = 0; + $data['offset'] = $opt_offset; + + $result = $this->ajax_invoiceslist_refresh($data); + + $json = array(); + $json['content'] = $result; + + header('Content-Type: application/json'); + echo json_encode($json); + die(); + } + + /** + * get forms in trash + * + * @param [type] $data + * @return void + */ + public function ajax_invoiceslist_refresh($data) + { + + $this->load->library('pagination'); + + $offset = $data['offset']; + + // list all forms + $config = array(); + + $tmp = $this->model_gateways_records->ListTotals(); + if ( intval($data['is_trash']) === 0) { + $config['base_url'] = site_url() . 'formbuilder/forms/list_records'; + $config['total_rows'] = $tmp->r_all; + } else { + $config['base_url'] = site_url() . 'formbuilder/forms/list_trash_records'; + $config['total_rows'] = $tmp->r_trash; + } + + $config['per_page'] = $data['per_page']; + $config['first_link'] = 'First'; + $config['last_link'] = 'Last'; + $config['full_tag_open'] = '
      '; + $config['full_tag_close'] = '
    '; + $config['first_tag_open'] = '
  • '; + $config['first_tag_close'] = '
  • '; + $config['last_tag_open'] = '
  • '; + $config['last_tag_close'] = '
  • '; + $config['cur_tag_open'] = '
  • '; + $config['cur_tag_close'] = '
  • '; + $config['next_tag_open'] = '
  • '; + $config['next_tag_close'] = '
  • '; + $config['prev_tag_open'] = '
  • '; + $config['prev_tag_close'] = '
  • '; + $config['num_tag_open'] = '
  • '; + $config['num_tag_close'] = '
  • '; + $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; + + $data2 = array(); + $data2['per_page'] = $data['per_page']; + $data2['segment'] = $offset; + $data2['orderby'] = $data['orderby']; + $data2['is_trash'] = $data['is_trash']; + + if ( intval($data2['is_trash']) === 0) { + $data2['query'] = $this->model_gateways_records->getListAllInvoicesFiltered($data2); + } else { + $data2['query'] = $this->model_gateways_records->getListTrashInvoicesFiltered($data2); + } + + $data2['pagination'] = $this->pagination->create_links(); + $data2['obj_list_data'] = List_data::get(); + + if ( intval($data2['is_trash']) === 0) { + return List_data::get()->list_detail_invoices($data2); + } else { + return List_data::get()->list_detail_invoicestrash($data2); + } + } + + public function info_record() + { + $id_rec = ( isset($_GET['id_rec']) && $_GET['id_rec'] ) ? Uiform_Form_Helper::sanitizeInput($_GET['id_rec']) : 0; + $data = array(); + $data['record_id'] = $id_rec; + + $form_rec_data = $this->model_record->getFormDataById($id_rec); + + $data['fmb_inv_tpl_st'] = $form_rec_data->fmb_inv_tpl_st; + $data['base_url'] = base_url() . '/'; + $data['form_id'] = $form_rec_data->form_fmb_id; + $data['url_form'] = site_url() . 'formbuilder/frontend/pdf_show_invoice/?uifm_mode=pdf&is_html=1&id=' . $id_rec; + $data['show_summary'] = $this->load->view('formbuilder/frontend/form_summary_custom', $data, true); + + $this->template->loadPartial('layout', 'gateways/records/info_record', $data); + } + + public function list_records() + { + $filter_data = get_option('zgfm_listinvoices_searchfilter', true); + $data2 = array(); + if ( empty($filter_data)) { + $data2['per_page'] = intval($this->per_page); + $data2['orderby'] = 'asc'; + } else { + $data2['per_page'] = intval($filter_data['per_page']??''); + $data2['orderby'] = $filter_data['orderby']??''; + } + + $offset = ( isset($_GET['offset']) ) ? Uiform_Form_Helper::sanitizeInput($_GET['offset']) : 0; + $data2['offset'] = $offset; + + $form_data = $this->model_gateways_records->ListTotals(); + $data2['title'] = __('Invoices list', 'FRocket_admin'); + $data2['all'] = $form_data->r_all; + $data2['trash'] = $form_data->r_trash; + $data2['header_buttons'] = List_data::get()->list_detail_invoice_headerbuttons(); + $data2['script_trigger'] = 'zgfm_back_general.invoiceslist_search_process();'; + $data2['subcurrent'] = 1; + $data2['subsubsub'] = List_data::get()->subsubsub_invoices($data2); + $data2['is_trash'] = 0; + + $content = List_data::get()->show_list($data2); + //echo self::loadPartial2( 'layout.php', $content); + echo $this->template->loadPartial2('layout', $content); + } + + /** + * list trash records + * + * @return void + */ + public function list_trash_records() + { + $filter_data = get_option('zgfm_listinvoices_searchfilter', true); + $data2 = array(); + if ( empty($filter_data)) { + $data2['per_page'] = intval($this->per_page); + $data2['orderby'] = 'asc'; + } else { + $data2['per_page'] = intval($filter_data['per_page']??''); + $data2['orderby'] = $filter_data['orderby']??''; + } + + $offset = ( isset($_GET['offset']) ) ? Uiform_Form_Helper::sanitizeInput($_GET['offset']) : 0; + $data2['offset'] = $offset; + + $form_data = $this->model_gateways_records->ListTotals(); + $data2['title'] = __('Invoices in trash', 'FRocket_admin'); + $data2['all'] = $form_data->r_all; + $data2['trash'] = $form_data->r_trash; + $data2['header_buttons'] = List_data::get()->list_detail_invoicetrash_headerbuttons(); + $data2['script_trigger'] = 'zgfm_back_general.invoiceslist_search_process();'; + $data2['subcurrent'] = 2; + $data2['subsubsub'] = List_data::get()->subsubsub_invoices($data2); + $data2['is_trash'] = 1; + + $content = List_data::get()->show_list($data2); + //echo self::loadPartial2( 'layout.php', $content); + echo $this->template->loadPartial2('layout', $content); + } + + + public function action_pdf_show_invoice() + { + + $rec_id = isset($_GET['id']) ? Uiform_Form_Helper::sanitizeInput($_GET['id']) : ''; + + if ( intval($rec_id) > 0) { + ob_start(); + ?> + + + + + + + + + + +
    + +

     

    + +
    + + + + diff --git a/application/modules/gateways/controllers/settings.php b/application/modules/gateways/controllers/settings.php index b1ef4549..426d8af0 100755 --- a/application/modules/gateways/controllers/settings.php +++ b/application/modules/gateways/controllers/settings.php @@ -10,13 +10,13 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } -if ( class_exists( 'Uiform_Pg_Controller_Settings' ) ) { - return; +if ( class_exists('Uiform_Pg_Controller_Settings')) { + return; } /** @@ -28,218 +28,224 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version Release: 1.00 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -class Settings extends BackendController { - - const VERSION = '0.1'; - - protected $modules; - - /** - * Constructor - * - * @mvc Controller - */ - function __construct() { - - parent::__construct(); - $this->load->language_alt( model_settings::$db_config['language'] ); - $this->template->set( 'controller', $this ); - $this->load->model( 'model_gateways' ); - - // global $wpdb; - // $this->wpdb = $wpdb; - // $this->model_gateways = self::$_models['gateways']['gateways']; - // save settings options - // add_action('wp_ajax_rocket_fbuilder_setting_saveGateway', array(&$this, 'ajax_save_options')); - } - - public function ajax_save_options() { - - $pg_id = ( $_POST['pg_id'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['pg_id'] ) : 0; - $pg_name = ( $_POST['pg_name'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['pg_name'] ) : ''; - - $flag_status = ( isset( $_POST['flag_status'] ) ) ? Uiform_Form_Helper::sanitizeInput( $_POST['flag_status'] ) : 1; - $pg_modtest = ( isset( $_POST['pg_modtest'] ) ) ? Uiform_Form_Helper::sanitizeInput( $_POST['pg_modtest'] ) : 0; - $pg_description = ( isset( $_POST['pg_description'] ) ) ? Uiform_Form_Helper::sanitizeInput( $_POST['pg_description'] ) : ''; - $pg_order = ( isset( $_POST['pg_order'] ) ) ? Uiform_Form_Helper::sanitizeInput( $_POST['pg_order'] ) : 0; - $pg_id = ( $_POST['pg_id'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['pg_id'] ) : ''; - - $json = array(); - switch ( $pg_id ) { - case 1: - // offline - $json['offline_return_url'] = ( $_POST['offline_return_url'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['offline_return_url'] ) : ''; - break; - case 2: - // paypal - $json['paypal_email'] = ( $_POST['paypal_email'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['paypal_email'] ) : ''; - $json['paypal_currency'] = ( $_POST['paypal_currency'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['paypal_currency'] ) : ''; - $json['paypal_return_url'] = ( $_POST['paypal_return_url'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['paypal_return_url'] ) : ''; - $json['paypal_cancel_url'] = ( $_POST['paypal_cancel_url'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['paypal_cancel_url'] ) : ''; - $json['paypal_method'] = ( $_POST['paypal_method'] ) ? Uiform_Form_Helper::sanitizeInput( $_POST['paypal_method'] ) : 0; - break; - } - $data = array(); - $data['pg_name'] = $pg_name; - $data['pg_data'] = json_encode( $json ); - $data['flag_status'] = $flag_status; - $data['pg_order'] = $pg_order; - $data['pg_modtest'] = $pg_modtest; - $data['pg_description'] = $pg_description; - $where = array( - 'pg_id' => $pg_id, - ); - - $this->db->set( $data ); - $this->db->where( 'pg_id', $pg_id ); - $this->db->update( $this->model_gateways->table ); - $this->db->trans_complete(); - - if ( $this->db->trans_status() === false ) { - $json2['success'] = 0; - } else { - $json2['success'] = 1; - } - - $json2 = array(); - /* - if ($result > 0) { - $json2['success'] = 1; - } else { - $json2['success'] = 0; - }*/ - - header( 'Content-Type: application/json' ); - echo json_encode( $json2 ); - die(); - } - - - public function view_settings() { - $data = array(); - $data['query'] = $this->model_gateways->getListGateways(); - $this->template->loadPartial( 'layout', 'gateways/settings/view_settings', $data ); - } - - public function edit_gateway() { - $data = array(); - $id = ( isset( $_GET['id'] ) ) ? Uiform_Form_Helper::sanitizeInput( $_GET['id'] ) : 0; - $rdata = $this->model_gateways->getGatewayById( $id ); - - $data['pg_id'] = $rdata->pg_id; - $data['pg_name'] = $rdata->pg_name; - $data['pg_description'] = $rdata->pg_description; - $data['pg_modtest'] = ( isset( $rdata->pg_modtest ) && $rdata->pg_modtest == 1 ) ? 1 : 0; - $data['flag_status'] = $rdata->flag_status; - $data['pg_order'] = $rdata->pg_order; - - switch ( intval( $id ) ) { - case 1: - /*offline*/ - $other_options = json_decode( $rdata->pg_data, true ); - - $data['offline_return_url'] = ( isset( $other_options['offline_return_url'] ) ) ? $other_options['offline_return_url'] : ''; - $this->template->loadPartial( 'layout', 'gateways/settings/editoffline', $data ); - - break; - case 2: - /*paypal*/ - $other_options = json_decode( $rdata->pg_data, true ); - $data['paypal_email'] = ( isset( $other_options['paypal_email'] ) ) ? $other_options['paypal_email'] : ''; - $data['paypal_return_url'] = ( isset( $other_options['paypal_return_url'] ) ) ? $other_options['paypal_return_url'] : ''; - $data['paypal_cancel_url'] = ( isset( $other_options['paypal_cancel_url'] ) ) ? $other_options['paypal_cancel_url'] : ''; - $data['paypal_currency'] = ( isset( $other_options['paypal_currency'] ) ) ? $other_options['paypal_currency'] : ''; - $data['paypal_method'] = ( isset( $other_options['paypal_method'] ) ) ? $other_options['paypal_method'] : 0; - $list_cur = array(); - $currencies = Uiform_Form_Helper::getCurrency(); - foreach ( $currencies as $key => $value ) { - $list_cur[] = $key; - } - $data['currency_list'] = $list_cur; - $this->template->loadPartial( 'layout', 'gateways/settings/editpaypal', $data ); - break; - default: - $data['query'] = $this->model_gateways->getListGateways(); - $this->template->loadPartial( 'layout', 'gateways/settings/view_settings', $data ); - break; - } - - } - - /** - * Register callbacks for actions and filters - * - * @mvc Controller - */ - public function register_hook_callbacks() { - - } - - /** - * Initializes variables - * - * @mvc Controller - */ - public function init() { - - try { - // $instance_example = new WPPS_Instance_Class( 'Instance example', '42' ); - // add_notice('ba'); - } catch ( Exception $exception ) { - add_notice( __METHOD__ . ' error: ' . $exception->getMessage(), 'error' ); - } - } - - /* - * Instance methods - */ - - /** - * Prepares sites to use the plugin during single or network-wide activation - * - * @mvc Controller - * - * @param bool $network_wide - */ - public function activate( $network_wide ) { - - return true; - } - - /** - * Rolls back activation procedures when de-activating the plugin - * - * @mvc Controller - */ - public function deactivate() { - return true; - } - - /** - * Checks if the plugin was recently updated and upgrades if necessary - * - * @mvc Controller - * - * @param string $db_version - */ - public function upgrade( $db_version = 0 ) { - return true; - } - - /** - * Checks that the object is in a correct state - * - * @mvc Model - * - * @param string $property An individual property to check, or 'all' to check all of them - * @return bool - */ - protected function is_valid( $property = 'all' ) { - return true; - } - +class Settings extends BackendController +{ + + const VERSION = '0.1'; + + protected $modules; + + /** + * Constructor + * + * @mvc Controller + */ + public function __construct() + { + + parent::__construct(); + $this->load->language_alt(model_settings::$db_config['language']); + $this->template->set('controller', $this); + $this->load->model('model_gateways'); + + // global $wpdb; + // $this->wpdb = $wpdb; + // $this->model_gateways = self::$_models['gateways']['gateways']; + // save settings options + // add_action('wp_ajax_rocket_fbuilder_setting_saveGateway', array(&$this, 'ajax_save_options')); + } + + public function ajax_save_options() + { + + $pg_id = ( $_POST['pg_id'] ) ? Uiform_Form_Helper::sanitizeInput($_POST['pg_id']) : 0; + $pg_name = ( $_POST['pg_name'] ) ? Uiform_Form_Helper::sanitizeInput($_POST['pg_name']) : ''; + + $flag_status = ( isset($_POST['flag_status']) ) ? Uiform_Form_Helper::sanitizeInput($_POST['flag_status']) : 1; + $pg_modtest = ( isset($_POST['pg_modtest']) ) ? Uiform_Form_Helper::sanitizeInput($_POST['pg_modtest']) : 0; + $pg_description = ( isset($_POST['pg_description']) ) ? Uiform_Form_Helper::sanitizeInput($_POST['pg_description']) : ''; + $pg_order = ( isset($_POST['pg_order']) ) ? Uiform_Form_Helper::sanitizeInput($_POST['pg_order']) : 0; + $pg_id = ( $_POST['pg_id'] ) ? Uiform_Form_Helper::sanitizeInput($_POST['pg_id']) : ''; + + $json = array(); + switch ( $pg_id) { + case 1: + // offline + $json['offline_return_url'] = ( $_POST['offline_return_url'] ) ? Uiform_Form_Helper::sanitizeInput($_POST['offline_return_url']) : ''; + break; + case 2: + // paypal + $json['paypal_email'] = ( $_POST['paypal_email'] ) ? Uiform_Form_Helper::sanitizeInput($_POST['paypal_email']) : ''; + $json['paypal_currency'] = ( $_POST['paypal_currency'] ) ? Uiform_Form_Helper::sanitizeInput($_POST['paypal_currency']) : ''; + $json['paypal_return_url'] = ( $_POST['paypal_return_url'] ) ? Uiform_Form_Helper::sanitizeInput($_POST['paypal_return_url']) : ''; + $json['paypal_cancel_url'] = ( $_POST['paypal_cancel_url'] ) ? Uiform_Form_Helper::sanitizeInput($_POST['paypal_cancel_url']) : ''; + $json['paypal_method'] = ( $_POST['paypal_method'] ) ? Uiform_Form_Helper::sanitizeInput($_POST['paypal_method']) : 0; + break; + } + $data = array(); + $data['pg_name'] = $pg_name; + $data['pg_data'] = json_encode($json); + $data['flag_status'] = $flag_status; + $data['pg_order'] = $pg_order; + $data['pg_modtest'] = $pg_modtest; + $data['pg_description'] = $pg_description; + $where = array( + 'pg_id' => $pg_id, + ); + + $this->db->set($data); + $this->db->where('pg_id', $pg_id); + $this->db->update($this->model_gateways->table); + $this->db->trans_complete(); + + if ( $this->db->trans_status() === false) { + $json2['success'] = 0; + } else { + $json2['success'] = 1; + } + + $json2 = array(); + /* + if ($result > 0) { + $json2['success'] = 1; + } else { + $json2['success'] = 0; + }*/ + + header('Content-Type: application/json'); + echo json_encode($json2); + die(); + } + + + public function view_settings() + { + $data = array(); + $data['query'] = $this->model_gateways->getListGateways(); + $this->template->loadPartial('layout', 'gateways/settings/view_settings', $data); + } + + public function edit_gateway() + { + $data = array(); + $id = ( isset($_GET['id']) ) ? Uiform_Form_Helper::sanitizeInput($_GET['id']) : 0; + $rdata = $this->model_gateways->getGatewayById($id); + + $data['pg_id'] = $rdata->pg_id; + $data['pg_name'] = $rdata->pg_name; + $data['pg_description'] = $rdata->pg_description; + $data['pg_modtest'] = ( isset($rdata->pg_modtest) && $rdata->pg_modtest == 1 ) ? 1 : 0; + $data['flag_status'] = $rdata->flag_status; + $data['pg_order'] = $rdata->pg_order; + + switch ( intval($id)) { + case 1: + /*offline*/ + $other_options = json_decode($rdata->pg_data, true); + + $data['offline_return_url'] = ( isset($other_options['offline_return_url']) ) ? $other_options['offline_return_url'] : ''; + $this->template->loadPartial('layout', 'gateways/settings/editoffline', $data); + + break; + case 2: + /*paypal*/ + $other_options = json_decode($rdata->pg_data, true); + $data['paypal_email'] = ( isset($other_options['paypal_email']) ) ? $other_options['paypal_email'] : ''; + $data['paypal_return_url'] = ( isset($other_options['paypal_return_url']) ) ? $other_options['paypal_return_url'] : ''; + $data['paypal_cancel_url'] = ( isset($other_options['paypal_cancel_url']) ) ? $other_options['paypal_cancel_url'] : ''; + $data['paypal_currency'] = ( isset($other_options['paypal_currency']) ) ? $other_options['paypal_currency'] : ''; + $data['paypal_method'] = ( isset($other_options['paypal_method']) ) ? $other_options['paypal_method'] : 0; + $list_cur = array(); + $currencies = Uiform_Form_Helper::getCurrency(); + foreach ( $currencies as $key => $value) { + $list_cur[] = $key; + } + $data['currency_list'] = $list_cur; + $this->template->loadPartial('layout', 'gateways/settings/editpaypal', $data); + break; + default: + $data['query'] = $this->model_gateways->getListGateways(); + $this->template->loadPartial('layout', 'gateways/settings/view_settings', $data); + break; + } + } + + /** + * Register callbacks for actions and filters + * + * @mvc Controller + */ + public function register_hook_callbacks() + { + } + + /** + * Initializes variables + * + * @mvc Controller + */ + public function init() + { + + try { + // $instance_example = new WPPS_Instance_Class( 'Instance example', '42' ); + // add_notice('ba'); + } catch ( Exception $exception) { + add_notice(__METHOD__ . ' error: ' . $exception->getMessage(), 'error'); + } + } + + /* + * Instance methods + */ + + /** + * Prepares sites to use the plugin during single or network-wide activation + * + * @mvc Controller + * + * @param bool $network_wide + */ + public function activate($network_wide) + { + + return true; + } + + /** + * Rolls back activation procedures when de-activating the plugin + * + * @mvc Controller + */ + public function deactivate() + { + return true; + } + + /** + * Checks if the plugin was recently updated and upgrades if necessary + * + * @mvc Controller + * + * @param string $db_version + */ + public function upgrade($db_version = 0) + { + return true; + } + + /** + * Checks that the object is in a correct state + * + * @mvc Model + * + * @param string $property An individual property to check, or 'all' to check all of them + * @return bool + */ + protected function is_valid($property = 'all') + { + return true; + } } - - diff --git a/application/modules/gateways/models/model_gateways.php b/application/modules/gateways/models/model_gateways.php index 1d5d053f..a1fdaad9 100755 --- a/application/modules/gateways/models/model_gateways.php +++ b/application/modules/gateways/models/model_gateways.php @@ -10,13 +10,13 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } -if ( class_exists( 'model_gateways' ) ) { - return; +if ( class_exists('model_gateways')) { + return; } /** @@ -28,70 +28,71 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version Release: 1.00 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -class model_gateways extends CI_Model { +class model_gateways extends CI_Model +{ - public $table = ''; + public $table = ''; - function __construct() { + public function __construct() + { - $this->table = $this->db->dbprefix . 'cest_uiform_pay_gateways'; - } + $this->table = $this->db->dbprefix . 'cest_uiform_pay_gateways'; + } - /** - * formsmodel::getListGateways() - * List Gateways - * - * @param int $per_page max number of form estimators - * @param int $segment Number of pagination - * - * @return array - */ - function getListGateways() { - $query = sprintf( - ' + /** + * formsmodel::getListGateways() + * List Gateways + * + * @param int $per_page max number of form estimators + * @param int $segment Number of pagination + * + * @return array + */ + public function getListGateways() + { + $query = sprintf( + ' select c.pg_id,c.pg_name,c.pg_modtest,c.pg_data,c.flag_status,c.pg_order,c.pg_description from %s c where c.flag_status>=0 ', - $this->table - ); - $query2 = $this->db->query( $query ); - return $query2->result(); + $this->table + ); + $query2 = $this->db->query($query); + return $query2->result(); + } - } - - function getAvailableGateways() { - $query = sprintf( - ' + public function getAvailableGateways() + { + $query = sprintf( + ' select c.pg_id,c.pg_name,c.pg_modtest,c.pg_data,c.flag_status,c.pg_order,c.pg_description from %s c where c.flag_status=1 ORDER BY c.pg_order asc ', - $this->table - ); - $query2 = $this->db->query( $query ); - return $query2->result(); - } + $this->table + ); + $query2 = $this->db->query($query); + return $query2->result(); + } - function getGatewayById( $id ) { - $query = sprintf( - ' + public function getGatewayById($id) + { + $query = sprintf( + ' select c.pg_id,c.pg_name,c.pg_modtest,c.pg_data,c.flag_status,c.pg_order,c.pg_description from %s c where c.pg_id=%s ', - $this->table, - $id - ); - - $query2 = $this->db->query( $query ); - return $query2->row(); - } + $this->table, + $id + ); + $query2 = $this->db->query($query); + return $query2->row(); + } } - - diff --git a/application/modules/gateways/models/model_gateways_logs.php b/application/modules/gateways/models/model_gateways_logs.php index d8f39a24..3d906276 100755 --- a/application/modules/gateways/models/model_gateways_logs.php +++ b/application/modules/gateways/models/model_gateways_logs.php @@ -10,13 +10,13 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } -if ( class_exists( 'model_gateways_logs' ) ) { - return; +if ( class_exists('model_gateways_logs')) { + return; } /** @@ -28,50 +28,49 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version Release: 1.00 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -class model_gateways_logs extends CI_Model { +class model_gateways_logs extends CI_Model +{ - public $table = ''; - public $tbpay_record = ''; - public $tbform_record = ''; - public $tbform = ''; + public $table = ''; + public $tbpay_record = ''; + public $tbform_record = ''; + public $tbform = ''; - function __construct() { + public function __construct() + { - $this->table = $this->db->dbprefix . 'cest_uiform_pay_logs'; - $this->tbpay_record = $this->db->dbprefix . 'cest_uiform_pay_records'; - $this->tbform_record = $this->db->dbprefix . 'cest_uiform_form_records'; - $this->tbform = $this->db->dbprefix . 'cest_uiform_form'; - } + $this->table = $this->db->dbprefix . 'cest_uiform_pay_logs'; + $this->tbpay_record = $this->db->dbprefix . 'cest_uiform_pay_records'; + $this->tbform_record = $this->db->dbprefix . 'cest_uiform_form_records'; + $this->tbform = $this->db->dbprefix . 'cest_uiform_form'; + } - /** - * delete payment records by form id - * - * @param [type] $form_id - * @return void - */ - function deleteRecordbyFormId( $form_id ) { + /** + * delete payment records by form id + * + * @param [type] $form_id + * @return void + */ + public function deleteRecordbyFormId($form_id) + { - $query = sprintf( - ' + $query = sprintf( + ' DELETE from %s where pgr_id IN ( select pgr_id from %s where pgr_id IN ( select fbh_id from %s where form_fmb_id=%s ) ); ', - $this->table, - $this->tbpay_record, - $this->tbform_record, - $form_id - ); - - $this->db->query( $query ); - - } + $this->table, + $this->tbpay_record, + $this->tbform_record, + $form_id + ); + $this->db->query($query); + } } - - diff --git a/application/modules/gateways/models/model_gateways_records.php b/application/modules/gateways/models/model_gateways_records.php index 51e7b38e..8ad72315 100755 --- a/application/modules/gateways/models/model_gateways_records.php +++ b/application/modules/gateways/models/model_gateways_records.php @@ -10,13 +10,13 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } -if ( class_exists( 'model_gateways_records' ) ) { - return; +if ( class_exists('model_gateways_records')) { + return; } /** @@ -28,59 +28,64 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version Release: 1.00 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -class model_gateways_records extends CI_Model { +class model_gateways_records extends CI_Model +{ - public $table = ''; - public $tbform_record = ''; - public $tbform = ''; + public $table = ''; + public $tbform_record = ''; + public $tbform = ''; - function __construct() { + public function __construct() + { - $this->table = $this->db->dbprefix . 'cest_uiform_pay_records'; - $this->tbform_record = $this->db->dbprefix . 'cest_uiform_form_records'; - $this->tbform = $this->db->dbprefix . 'cest_uiform_form'; - } + $this->table = $this->db->dbprefix . 'cest_uiform_pay_records'; + $this->tbform_record = $this->db->dbprefix . 'cest_uiform_form_records'; + $this->tbform = $this->db->dbprefix . 'cest_uiform_form'; + } - function getRecordById( $id ) { - $query = sprintf( - ' + public function getRecordById($id) + { + $query = sprintf( + ' select uf.pgr_id,uf.type_pg_id,uf.pgr_payment_status,uf.pgr_payment_amount,uf.pgr_currency,uf.pgr_data,uf.flag_status,uf.created_date,uf.updated_date,uf.fbh_id from %s uf where uf.pgr_id=%s ', - $this->table, - $id - ); + $this->table, + $id + ); - $query2 = $this->db->query( $query ); + $query2 = $this->db->query($query); - return $query2->row(); - } + return $query2->row(); + } - function getInvoiceDataByFormRecId( $id_rec ) { - $query = sprintf( - 'select f.fmb_name,f.fmb_id,f.fmb_data,frec.fbh_total_amount,pr.pgr_id,pr.created_date,f.fmb_inv_tpl_html,f.fmb_inv_tpl_st + public function getInvoiceDataByFormRecId($id_rec) + { + $query = sprintf( + 'select f.fmb_name,f.fmb_id,f.fmb_data,frec.fbh_total_amount,pr.pgr_id,pr.created_date,f.fmb_inv_tpl_html,f.fmb_inv_tpl_st from %s frec join %s f on f.fmb_id=frec.form_fmb_id join %s pr on pr.fbh_id=frec.fbh_id where frec.flag_status>=0 and frec.fbh_id=%s', - $this->tbform_record, - $this->tbform, - $this->table, - $id_rec - ); - $query2 = $this->db->query( $query ); - - return $query2->row(); - } - - function CountRecords() { - $query = sprintf( - ' + $this->tbform_record, + $this->tbform, + $this->table, + $id_rec + ); + $query2 = $this->db->query($query); + + return $query2->row(); + } + + public function CountRecords() + { + $query = sprintf( + ' select COUNT(*) AS counted from %s gr join %s fr on fr.fbh_id=gr.fbh_id @@ -88,25 +93,26 @@ function CountRecords() { where gr.flag_status>0 ORDER BY gr.created_date desc ', - $this->table, - $this->tbform_record, - $this->tbform - ); - - $query2 = $this->db->query( $query ); - - $row = $query2->row(); - - if ( isset( $row->counted ) ) { - return $row->counted; - } else { - return 0; - } - } - - function getListRecords( $per_page = '', $segment = '' ) { - $query = sprintf( - ' + $this->table, + $this->tbform_record, + $this->tbform + ); + + $query2 = $this->db->query($query); + + $row = $query2->row(); + + if ( isset($row->counted)) { + return $row->counted; + } else { + return 0; + } + } + + public function getListRecords($per_page = '', $segment = '') + { + $query = sprintf( + ' select gr.pgr_id,gr.type_pg_id,gr.pgr_payment_status,gr.pgr_payment_amount,gr.pgr_currency,gr.pgr_data,gr.flag_status,gr.created_date,gr.updated_date,gr.fbh_id,f.fmb_name from %s gr join %s fr on fr.fbh_id=gr.fbh_id @@ -114,140 +120,137 @@ function getListRecords( $per_page = '', $segment = '' ) { where gr.flag_status>0 ORDER BY gr.created_date desc ', - $this->table, - $this->tbform_record, - $this->tbform - ); - - if ( $per_page != '' || $segment != '' ) { - $segment = ( ! empty( $segment ) ) ? $segment : 0; - $query .= sprintf( ' limit %s,%s', $segment, $per_page ); - } - - $query2 = $this->db->query( $query ); - return $query2->result(); - } - - - - /** - * Show all records according to filter - * - * @param string $per_page - * @param string $segment - * @return void - */ - function getListAllInvoicesFiltered( $data ) { - - $per_page = $data['per_page']; - $segment = $data['segment']; - $orderby = $data['orderby']; - - $query = sprintf( - ' + $this->table, + $this->tbform_record, + $this->tbform + ); + + if ( $per_page != '' || $segment != '') { + $segment = ( ! empty($segment) ) ? $segment : 0; + $query .= sprintf(' limit %s,%s', $segment, $per_page); + } + + $query2 = $this->db->query($query); + return $query2->result(); + } + + + + /** + * Show all records according to filter + * + * @param string $per_page + * @param string $segment + * @return void + */ + public function getListAllInvoicesFiltered($data) + { + + $per_page = $data['per_page']; + $segment = $data['segment']; + $orderby = $data['orderby']; + + $query = sprintf( + ' select gr.pgr_id,gr.type_pg_id,gr.pgr_payment_status,gr.pgr_payment_amount,gr.pgr_currency,gr.pgr_data,gr.flag_status,gr.created_date,gr.updated_date,gr.fbh_id,f.fmb_name from %s gr join %s fr on fr.fbh_id=gr.fbh_id join %s f on fr.form_fmb_id=f.fmb_id where gr.flag_status>0 ', - $this->table, - $this->tbform_record, - $this->tbform - ); - - $orderby = ( $orderby === 'asc' ) ? 'asc' : 'desc'; - - $query .= sprintf( ' ORDER BY gr.created_date %s ', $orderby ); - - if ( $per_page != '' || $segment != '' ) { - $segment = ( ! empty( $segment ) ) ? $segment : 0; - $query .= sprintf( ' limit %s,%s', (int) $segment, (int) $per_page ); - } - $query2 = $this->db->query( $query ); - return $query2->result(); - - } - - /** - * Show trash records according to filter - * - * @param string $per_page - * @param string $segment - * @return void - */ - function getListTrashInvoicesFiltered( $data ) { - - $per_page = $data['per_page']; - $segment = $data['segment']; - $orderby = $data['orderby']; - - $query = sprintf( - ' + $this->table, + $this->tbform_record, + $this->tbform + ); + + $orderby = ( $orderby === 'asc' ) ? 'asc' : 'desc'; + + $query .= sprintf(' ORDER BY gr.created_date %s ', $orderby); + + if ( $per_page != '' || $segment != '') { + $segment = ( ! empty($segment) ) ? $segment : 0; + $query .= sprintf(' limit %s,%s', (int) $segment, (int) $per_page); + } + $query2 = $this->db->query($query); + return $query2->result(); + } + + /** + * Show trash records according to filter + * + * @param string $per_page + * @param string $segment + * @return void + */ + public function getListTrashInvoicesFiltered($data) + { + + $per_page = $data['per_page']; + $segment = $data['segment']; + $orderby = $data['orderby']; + + $query = sprintf( + ' select gr.pgr_id,gr.type_pg_id,gr.pgr_payment_status,gr.pgr_payment_amount,gr.pgr_currency,gr.pgr_data,gr.flag_status,gr.created_date,gr.updated_date,gr.fbh_id,f.fmb_name from %s gr join %s fr on fr.fbh_id=gr.fbh_id join %s f on fr.form_fmb_id=f.fmb_id where gr.flag_status=0 ', - $this->table, - $this->tbform_record, - $this->tbform - ); - - $orderby = ( $orderby === 'asc' ) ? 'asc' : 'desc'; - - $query .= sprintf( ' ORDER BY gr.created_date %s ', $orderby ); - - if ( $per_page != '' || $segment != '' ) { - $segment = ( ! empty( $segment ) ) ? $segment : 0; - $query .= sprintf( ' limit %s,%s', (int) $segment, (int) $per_page ); - } - $query2 = $this->db->query( $query ); - return $query2->result(); - - } - - /** - * delete payment records by form id - * - * @param [type] $form_id - * @return void - */ - function deleteRecordbyFormId( $form_id ) { - - $query = sprintf( - ' + $this->table, + $this->tbform_record, + $this->tbform + ); + + $orderby = ( $orderby === 'asc' ) ? 'asc' : 'desc'; + + $query .= sprintf(' ORDER BY gr.created_date %s ', $orderby); + + if ( $per_page != '' || $segment != '') { + $segment = ( ! empty($segment) ) ? $segment : 0; + $query .= sprintf(' limit %s,%s', (int) $segment, (int) $per_page); + } + $query2 = $this->db->query($query); + return $query2->result(); + } + + /** + * delete payment records by form id + * + * @param [type] $form_id + * @return void + */ + public function deleteRecordbyFormId($form_id) + { + + $query = sprintf( + ' DELETE from %s where pgr_id IN ( select fbh_id from %s where form_fmb_id=%s ); ', - $this->table, - $this->tbform_record, - $form_id - ); - - $this->db->query( $query ); - - } - - /* - * list all and trash forms - */ - function ListTotals() { - $query = sprintf( - ' + $this->table, + $this->tbform_record, + $form_id + ); + + $this->db->query($query); + } + + /* + * list all and trash forms + */ + public function ListTotals() + { + $query = sprintf( + ' SELECT SUM(CASE WHEN flag_status = 0 THEN 1 ELSE 0 END) AS r_trash, SUM(CASE WHEN flag_status != 0 THEN 1 ELSE 0 END) AS r_all FROM %s ', - $this->table - ); - - $query2 = $this->db->query( $query ); - return $query2->row(); - - } + $this->table + ); + $query2 = $this->db->query($query); + return $query2->row(); + } } - - diff --git a/application/modules/gateways/views/frontend/offline.php b/application/modules/gateways/views/frontend/offline.php index 0b816251..c72ba98e 100755 --- a/application/modules/gateways/views/frontend/offline.php +++ b/application/modules/gateways/views/frontend/offline.php @@ -9,33 +9,34 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?>
    -
    -
    -
    -
    - -
    - -
    -
    -
    - -
    -
    -
    - - - +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    +
    + + + +
    -
    -
    +
    + diff --git a/application/modules/gateways/views/frontend/paypal.php b/application/modules/gateways/views/frontend/paypal.php index 004a4add..02baaad6 100755 --- a/application/modules/gateways/views/frontend/paypal.php +++ b/application/modules/gateways/views/frontend/paypal.php @@ -9,71 +9,72 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?>
    -
    -
    - -
    -
    - -
    - -
    -
    -
    - -
    -
    - +
    +
    + +
    +
    + +
    + +
    +
    +
    + +
    +
    +
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    - -
    -
    + +
    + diff --git a/application/modules/gateways/views/paypal/notification.php b/application/modules/gateways/views/paypal/notification.php index 1a32d95c..d5a0ae50 100755 --- a/application/modules/gateways/views/paypal/notification.php +++ b/application/modules/gateways/views/paypal/notification.php @@ -9,8 +9,8 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} - +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} diff --git a/application/modules/gateways/views/settings/editoffline.php b/application/modules/gateways/views/settings/editoffline.php index 1e6962fb..12c790f8 100755 --- a/application/modules/gateways/views/settings/editoffline.php +++ b/application/modules/gateways/views/settings/editoffline.php @@ -9,87 +9,88 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?>
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    - -
    -
    - -
    - -
    - -
    -
    - -
    - -
    - - -
    -
    - -
    - -
    - -
    -
    -
    - -
    - -
    -
    - - -
    -
    -
    - -
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + + +
    +
    + +
    + +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    + +
    @@ -97,15 +98,15 @@ class="sfdc-form-control col-md-7"> diff --git a/application/modules/gateways/views/settings/editpaypal.php b/application/modules/gateways/views/settings/editpaypal.php index 0412e84b..c9259182 100755 --- a/application/modules/gateways/views/settings/editpaypal.php +++ b/application/modules/gateways/views/settings/editpaypal.php @@ -9,160 +9,161 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?>
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - - -
    -
    -
    - -
    - - -
    -
    - -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - - -
    -
    - -
    -
    -
    - -
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + + +
    +
    +
    + +
    + + +
    +
    + +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + + +
    +
    + +
    +
    +
    + +
    @@ -170,15 +171,15 @@ class="sfdc-form-control col-md-7"> diff --git a/application/modules/gateways/views/settings/view_settings.php b/application/modules/gateways/views/settings/view_settings.php index 261b7df6..5123d41d 100755 --- a/application/modules/gateways/views/settings/view_settings.php +++ b/application/modules/gateways/views/settings/view_settings.php @@ -9,129 +9,130 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' );} +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); +} ?>
    -
    -
    -
    -
    -
    - -
    - -
    -
    - - -
    -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - + + + + + + + + +
    pg_name; ?> - flag_status ) === 1 ) { - ?> - - - - - +
    +
    +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + - + - - - - - - - - -
    pg_name; ?> + flag_status) === 1) { + ?> + + + + + - - - - -
    -
      -
    • - pg_id ) === 2 ) { - ?> - - - - - - - + + + +
    +
    +
      +
    • + pg_id) === 2) { + ?> + + + + + + + - - - - - - - - - - - - - -
    • -
    -
    -
    -
    -
    - -
    - -
    -
    -
    -
    + + + + + + + + + + + + + + + + +
    +
    +
    + +
    + +
    +
    +
    +
    diff --git a/application/modules/user/controllers/intranet.php b/application/modules/user/controllers/intranet.php index 865fbcb7..c22d01bd 100755 --- a/application/modules/user/controllers/intranet.php +++ b/application/modules/user/controllers/intranet.php @@ -10,11 +10,11 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: intranet.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } /** @@ -26,161 +26,165 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version Release: 1.00 - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -class Intranet extends BackendController { +class Intranet extends BackendController +{ - /** - * max number of user in order show by pagination - * - * @var int - */ - var $per_page = 10; + /** + * max number of user in order show by pagination + * + * @var int + */ + private $per_page = 10; - /** - * name of user table - * - * @var string - */ - var $table = ''; + /** + * name of user table + * + * @var string + */ + public $table = ''; - /** - * Intranet::__construct() - * - * @return - */ - function __construct() { - parent::__construct(); - $this->load->language_alt( model_settings::$db_config['language'] ); - $this->template->set( 'controller', $this ); - $this->load->model( 'default/model_settings' ); - $this->load->model( 'model_user' ); - $this->table = $this->db->dbprefix . 'cest_uiform_user'; + /** + * Intranet::__construct() + * + * @return + */ + public function __construct() + { + parent::__construct(); + $this->load->language_alt(model_settings::$db_config['language']); + $this->template->set('controller', $this); + $this->load->model('default/model_settings'); + $this->load->model('model_user'); + $this->table = $this->db->dbprefix . 'cest_uiform_user'; + } - } + /** + * Intranet::index() + * List all users + * + * @param int $offset Number of pagination + * + * @return array + */ + public function index($offset = 0) + { + // list all forms + $data = $config = array(); + // create pagination + $this->load->library('pagination'); + $config['base_url'] = site_url() . 'default/dashboard/index'; + $config['total_rows'] = $this->db->count_all($this->table); + $config['per_page'] = $this->per_page; + $config['first_link'] = 'First'; + $config['last_link'] = 'Last'; + $config['full_tag_open'] = '
      '; + $config['full_tag_close'] = '
    '; + $config['first_tag_open'] = '
  • '; + $config['first_tag_close'] = '
  • '; + $config['last_tag_open'] = '
  • '; + $config['last_tag_close'] = '
  • '; + $config['cur_tag_open'] = '
  • '; + $config['cur_tag_close'] = '
  • '; + $config['next_tag_open'] = '
  • '; + $config['next_tag_close'] = '
  • '; + $config['prev_tag_open'] = '
  • '; + $config['prev_tag_close'] = '
  • '; + $config['num_tag_open'] = '
  • '; + $config['num_tag_close'] = '
  • '; + $this->pagination->initialize($config); + // If the pagination library doesn't recognize the current page add + $this->pagination->cur_page = $offset; - /** - * Intranet::index() - * List all users - * - * @param int $offset Number of pagination - * - * @return array - */ - public function index( $offset = 0 ) { - // list all forms - $data = $config = array(); - // create pagination - $this->load->library( 'pagination' ); - $config['base_url'] = site_url() . 'default/dashboard/index'; - $config['total_rows'] = $this->db->count_all( $this->table ); - $config['per_page'] = $this->per_page; - $config['first_link'] = 'First'; - $config['last_link'] = 'Last'; - $config['full_tag_open'] = '
      '; - $config['full_tag_close'] = '
    '; - $config['first_tag_open'] = '
  • '; - $config['first_tag_close'] = '
  • '; - $config['last_tag_open'] = '
  • '; - $config['last_tag_close'] = '
  • '; - $config['cur_tag_open'] = '
  • '; - $config['cur_tag_close'] = '
  • '; - $config['next_tag_open'] = '
  • '; - $config['next_tag_close'] = '
  • '; - $config['prev_tag_open'] = '
  • '; - $config['prev_tag_close'] = '
  • '; - $config['num_tag_open'] = '
  • '; - $config['num_tag_close'] = '
  • '; - $this->pagination->initialize( $config ); - // If the pagination library doesn't recognize the current page add - $this->pagination->cur_page = $offset; + $data['query'] = $this->model_user->getList(); + $this->template->loadPartial('layout', 'intranet/index', $data); + } - $data['query'] = $this->model_user->getList(); - $this->template->loadPartial( 'layout', 'intranet/index', $data ); - } + /** + * Intranet::createuser() + * Create a new user + * + * @return void + */ + public function createuser() + { + $data = array(); + $data['flag_status'] = 1; + $this->template->loadPartial('layout', 'intranet/createuser', $data); + } - /** - * Intranet::createuser() - * Create a new user - * - * @return void - */ - public function createuser() { - $data = array(); - $data['flag_status'] = 1; - $this->template->loadPartial( 'layout', 'intranet/createuser', $data ); - } + /** + * Intranet::edituser() + * Edit user by id + * + * @return array + */ + public function edituser() + { + $id_user = Uiform_Form_Helper::sanitizeInput($this->uri->segment(4, 0)); + $query = $this->db->get_where($this->model_user->table, array( 'use_id' => $id_user ), 1); + if ( $query->num_rows() === 1) { + $data = array(); + $rdata = $this->model_user->getUserById($id_user); + $data['use_id'] = $rdata->use_id; + $data['use_login'] = $rdata->use_login; + $data['use_mail'] = $rdata->use_mail; + $data['flag_status'] = $rdata->flag_status; - /** - * Intranet::edituser() - * Edit user by id - * - * @return array - */ - public function edituser() { - $id_user = Uiform_Form_Helper::sanitizeInput( $this->uri->segment( 4, 0 ) ); - $query = $this->db->get_where( $this->model_user->table, array( 'use_id' => $id_user ), 1 ); - if ( $query->num_rows() === 1 ) { - $data = array(); - $rdata = $this->model_user->getUserById( $id_user ); - $data['use_id'] = $rdata->use_id; - $data['use_login'] = $rdata->use_login; - $data['use_mail'] = $rdata->use_mail; - $data['flag_status'] = $rdata->flag_status; + $this->template->loadPartial('layout', 'intranet/createuser', $data); + } else { + redirect(site_url() . 'user/intranet/index'); + } + } - $this->template->loadPartial( 'layout', 'intranet/createuser', $data ); - } else { - redirect( site_url() . 'user/intranet/index' ); - } + /** + * Intranet::delete() + * Delete user by id + * + * @param int $id_user id of user + * + * @return void + */ + public function delete($id_user) + { + $this->db->where('use_id', $id_user)->delete($this->table); + $this->session->set_flashdata('message', 'info: User was deleted'); + redirect(site_url() . 'user/intranet/index'); + } - } - - /** - * Intranet::delete() - * Delete user by id - * - * @param int $id_user id of user - * - * @return void - */ - function delete( $id_user ) { - $this->db->where( 'use_id', $id_user )->delete( $this->table ); - $this->session->set_flashdata( 'message', 'info: User was deleted' ); - redirect( site_url() . 'user/intranet/index' ); - } - - /** - * Intranet::saveuser() - * Save user information - * - * @return void - */ - public function saveuser() { - $id_user = Uiform_Form_Helper::sanitizeInput( $this->uri->segment( 4, 0 ) ); - $flag_status = ( $this->input->post( 'flag_status' ) ) ? Uiform_Form_Helper::sanitizeInput( $this->input->post( 'flag_status' ) ) : 0; - $data = array(); - $data['use_login'] = Uiform_Form_Helper::sanitizeInput( $this->input->post( 'use_login' ) ); - $data['use_mail'] = Uiform_Form_Helper::sanitizeInput( $this->input->post( 'use_mail' ) ); - $data['use_password'] = md5( trim( Uiform_Form_Helper::sanitizeInput( $this->input->post( 'use_password' ) ) ) ); - $data['flag_status'] = $flag_status; - $data['updated_ip'] = $_SERVER['REMOTE_ADDR']; - $data['updated_by'] = 1; - $data['updated_date'] = date( 'Y-m-d h:i:s' ); - $query = $this->db->get_where( $this->model_user->table, array( 'use_id' => $id_user ), 1 ); - if ( $query->num_rows() === 1 ) { - $this->db->set( $data ); - $this->db->where( 'use_id', $id_user ); - $this->db->update( $this->model_user->table ); - $this->session->set_flashdata( 'message', 'success: Form was updated' ); - } else { - $data['created_ip'] = $_SERVER['REMOTE_ADDR']; - $data['created_by'] = 1; - $data['created_date'] = date( 'Y-m-d h:i:s' ); - $this->db->set( $data ); - $this->db->insert( $this->model_user->table ); - $this->session->set_flashdata( 'message', 'success: User was created' ); - } - redirect( site_url() . 'user/intranet/index' ); - } + /** + * Intranet::saveuser() + * Save user information + * + * @return void + */ + public function saveuser() + { + $id_user = Uiform_Form_Helper::sanitizeInput($this->uri->segment(4, 0)); + $flag_status = ( $this->input->post('flag_status') ) ? Uiform_Form_Helper::sanitizeInput($this->input->post('flag_status')) : 0; + $data = array(); + $data['use_login'] = Uiform_Form_Helper::sanitizeInput($this->input->post('use_login')); + $data['use_mail'] = Uiform_Form_Helper::sanitizeInput($this->input->post('use_mail')); + $data['use_password'] = md5(trim(Uiform_Form_Helper::sanitizeInput($this->input->post('use_password')))); + $data['flag_status'] = $flag_status; + $data['updated_ip'] = $_SERVER['REMOTE_ADDR']; + $data['updated_by'] = 1; + $data['updated_date'] = date('Y-m-d h:i:s'); + $query = $this->db->get_where($this->model_user->table, array( 'use_id' => $id_user ), 1); + if ( $query->num_rows() === 1) { + $this->db->set($data); + $this->db->where('use_id', $id_user); + $this->db->update($this->model_user->table); + $this->session->set_flashdata('message', 'success: Form was updated'); + } else { + $data['created_ip'] = $_SERVER['REMOTE_ADDR']; + $data['created_by'] = 1; + $data['created_date'] = date('Y-m-d h:i:s'); + $this->db->set($data); + $this->db->insert($this->model_user->table); + $this->session->set_flashdata('message', 'success: User was created'); + } + redirect(site_url() . 'user/intranet/index'); + } } - diff --git a/application/modules/user/models/model_user.php b/application/modules/user/models/model_user.php index 8a312fca..e3bd106b 100755 --- a/application/modules/user/models/model_user.php +++ b/application/modules/user/models/model_user.php @@ -10,7 +10,7 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: model_user.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ /** @@ -22,95 +22,100 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version Release: 1.00 - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -class model_user extends CI_Model { +class model_user extends CI_Model +{ - public $table = ''; + public $table = ''; - /** - * model_user::__construct() - * - * @return - */ - function __construct() { - parent::__construct(); - $this->table = $this->db->dbprefix . 'cest_uiform_user'; - } + /** + * model_user::__construct() + * + * @return + */ + public function __construct() + { + parent::__construct(); + $this->table = $this->db->dbprefix . 'cest_uiform_user'; + } - /** - * model_user::getList() - * Get list user - * - * @return array - */ - function getList() { - $this->db->select( 'c.*' ); - $this->db->from( '{PRE}cest_uiform_user c' ); - return $this->db->get()->result(); - } + /** + * model_user::getList() + * Get list user + * + * @return array + */ + public function getList() + { + $this->db->select('c.*'); + $this->db->from('{PRE}cest_uiform_user c'); + return $this->db->get()->result(); + } - /** - * model_user::getUserById() - * Get user by id - * - * @param int $id_user id of user - * - * @return array - */ - function getUserById( $id_user ) { - $this->db->select( 'c.*' ); - $this->db->from( '{PRE}cest_uiform_user c' ); - $this->db->order_by( 'c.use_id', 'desc' ); - $this->db->where( array( 'c.use_id' => $id_user ), 1 ); - return $this->db->get()->row(); - } + /** + * model_user::getUserById() + * Get user by id + * + * @param int $id_user id of user + * + * @return array + */ + public function getUserById($id_user) + { + $this->db->select('c.*'); + $this->db->from('{PRE}cest_uiform_user c'); + $this->db->order_by('c.use_id', 'desc'); + $this->db->where(array( 'c.use_id' => $id_user ), 1); + return $this->db->get()->row(); + } - /** - * model_user::getTotalForms() - * List total rows - * - * @return array - */ - function getTotalList() { - $this->db->select( 'COUNT(*) as total' ); - $this->db->from( '{PRE}cest_uiform_user' ); - return $this->db->get()->row(); - } + /** + * model_user::getTotalForms() + * List total rows + * + * @return array + */ + public function getTotalList() + { + $this->db->select('COUNT(*) as total'); + $this->db->from('{PRE}cest_uiform_user'); + return $this->db->get()->row(); + } - /** - * model_user::getUserById() - * Get user by id - * - * @param int $id_user id of user - * - * @return array - */ - function getFirstUser() { - $this->db->select( 'c.*' ); - $this->db->from( '{PRE}cest_uiform_user c' ); - $this->db->order_by( 'c.use_id', 'desc' ); - $this->db->limit( 1 ); - return $this->db->get()->row(); - } - - /** - * model_user::getUserById() - * Get user by id - * - * @param int $id_user id of user - * - * @return array - */ - function getPasswordToken( $token ) { - $this->db->select( 'c.*' ); - $this->db->from( '{PRE}cest_uiform_user c' ); - $this->db->order_by( 'c.use_id', 'desc' ); - $this->db->where( array( 'c.use_password_token' => $token ) ); - $this->db->limit( 1 ); - return $this->db->get()->row(); - } + /** + * model_user::getUserById() + * Get user by id + * + * @param int $id_user id of user + * + * @return array + */ + public function getFirstUser() + { + $this->db->select('c.*'); + $this->db->from('{PRE}cest_uiform_user c'); + $this->db->order_by('c.use_id', 'desc'); + $this->db->limit(1); + return $this->db->get()->row(); + } + /** + * model_user::getUserById() + * Get user by id + * + * @param int $id_user id of user + * + * @return array + */ + public function getPasswordToken($token) + { + $this->db->select('c.*'); + $this->db->from('{PRE}cest_uiform_user c'); + $this->db->order_by('c.use_id', 'desc'); + $this->db->where(array( 'c.use_password_token' => $token )); + $this->db->limit(1); + return $this->db->get()->row(); + } } - diff --git a/application/modules/user/views/intranet/createuser.php b/application/modules/user/views/intranet/createuser.php index a9379896..fae84a18 100755 --- a/application/modules/user/views/intranet/createuser.php +++ b/application/modules/user/views/intranet/createuser.php @@ -10,82 +10,82 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: createuser.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } ?>
    -
    -
    -
    +
    +
    +
    -
    -
    -
    - 'form-horizontal', - 'id' => 'frmform', - 'name' => 'frmform', - ); - echo form_open( site_url() . 'user/intranet/saveuser/' . $use_id_var, $attributes ); - ?> -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - -
    -
    -
    - -
    - - -
    -
    - -
    -
    - -
    +
    +
    +
    + 'form-horizontal', + 'id' => 'frmform', + 'name' => 'frmform', + ); + echo form_open(site_url() . 'user/intranet/saveuser/' . $use_id_var, $attributes); + ?> +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + + +
    +
    + +
    +
    + +
    diff --git a/application/modules/user/views/intranet/index.php b/application/modules/user/views/intranet/index.php index 210dc5a5..818bb929 100755 --- a/application/modules/user/views/intranet/index.php +++ b/application/modules/user/views/intranet/index.php @@ -10,97 +10,96 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: index.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } ?>
    session->flashdata( 'message' ) ) { - $resp = explode( ':', $this->session->flashdata( 'message' ) ) - ?> -
    - - -
    - session->flashdata('message')) { + $resp = explode(':', $this->session->flashdata('message')) + ?> +
    + + +
    +
    -
    -
    - -
    -
    - -
    -
    -
    - - - - - - - - - - - - - - - +
    use_login; ?>created_date; ?> - flag_status ) { - ?> - +
    +
    + +
    +
    + +
    +
    +
    + + + + + + + + + + + + + + + - - - + + + + + + - -
    use_login; ?>created_date; ?> + flag_status) { + ?> + - - - - + + + + - - - - -
    - - - - - -
    -
    +
    + + + + + +
    +
    -
    -
    pagination->create_links(); ?>
    -
    -
    +
    +
    +
    pagination->create_links(); ?>
    +
    +
    diff --git a/application/modules/visitor/models/model_visitor.php b/application/modules/visitor/models/model_visitor.php index 10d1b6b7..4db5b7ed 100755 --- a/application/modules/visitor/models/model_visitor.php +++ b/application/modules/visitor/models/model_visitor.php @@ -10,7 +10,7 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: settingsmodel.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ /** @@ -22,40 +22,43 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version Release: 1.00 - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ -class model_visitor extends CI_Model { +class model_visitor extends CI_Model +{ - public $table = ''; - /** - * register the global settings information - * - * @var array - */ - public static $db_config = array(); + public $table = ''; + /** + * register the global settings information + * + * @var array + */ + public static $db_config = array(); - /** - * model_settings::__construct() - * - * @return - */ - function __construct() { - parent::__construct(); - $this->table = $this->db->dbprefix . 'cest_uiform_visitor'; - } - /** - * Visitormodel::getLastMonth() - * Get info last - * - * @param int $per_page max number of history forms - * @param int $segment Number of pagination - * - * @return array - */ - function getLastMonth() { - $query = $this->db->query( - "select a.d, a.requests,b.visits from (SELECT + /** + * model_settings::__construct() + * + * @return + */ + public function __construct() + { + parent::__construct(); + $this->table = $this->db->dbprefix . 'cest_uiform_visitor'; + } + /** + * Visitormodel::getLastMonth() + * Get info last + * + * @param int $per_page max number of history forms + * @param int $segment Number of pagination + * + * @return array + */ + public function getLastMonth() + { + $query = $this->db->query( + "select a.d, a.requests,b.visits from (SELECT DATE(created_date) as d, COUNT(ceh_id) as requests FROM cestimator_history WHERE DATE_FORMAT(created_date,'%e') BETWEEN 1 AND 31 @@ -70,8 +73,7 @@ function getLastMonth() { GROUP BY DATE_FORMAT(vis_last_date , '%Y-%m-%d') ORDER BY vis_last_date ASC limit 31) b on b.d=a.d" - ); - return $query->result(); - } + ); + return $query->result(); + } } - diff --git a/application/modules/visitor/models/model_visitor_error.php b/application/modules/visitor/models/model_visitor_error.php index 73e7a168..09ae397a 100755 --- a/application/modules/visitor/models/model_visitor_error.php +++ b/application/modules/visitor/models/model_visitor_error.php @@ -10,13 +10,13 @@ * @author Softdiscover * @copyright 2015 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -if ( ! defined( 'BASEPATH' ) ) { - exit( 'No direct script access allowed' ); +if ( ! defined('BASEPATH')) { + exit('No direct script access allowed'); } -if ( class_exists( 'model_visitor_error' ) ) { - return; +if ( class_exists('model_visitor_error')) { + return; } /** @@ -28,18 +28,17 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version Release: 1.00 - * @link http://wordpress-cost-estimator.zigaform.com + * @link https://softdiscover.com/zigaform/wordpress-cost-estimator */ -class model_visitor_error extends CI_Model { +class model_visitor_error extends CI_Model +{ - public $table = ''; - - function __construct() { - parent::__construct(); - $this->table = $this->db->dbprefix . 'cest_uiform_visitor_error'; - } + public $table = ''; + public function __construct() + { + parent::__construct(); + $this->table = $this->db->dbprefix . 'cest_uiform_visitor_error'; + } } - - diff --git a/application/views/footer.php b/application/views/footer.php index 180e71b3..f5e3ed55 100755 --- a/application/views/footer.php +++ b/application/views/footer.php @@ -10,7 +10,7 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: footer.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ if ( ! defined( 'BASEPATH' ) ) { exit( 'No direct script access allowed' ); diff --git a/application/views/frontend/footer.php b/application/views/frontend/footer.php index 6a699a41..92ac0761 100755 --- a/application/views/frontend/footer.php +++ b/application/views/frontend/footer.php @@ -10,7 +10,7 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: frontend_est_footer.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ if ( ! defined( 'BASEPATH' ) ) { exit( 'No direct script access allowed' ); @@ -22,7 +22,7 @@ . diff --git a/application/views/frontend/header.php b/application/views/frontend/header.php index 00a47691..88731c90 100755 --- a/application/views/frontend/header.php +++ b/application/views/frontend/header.php @@ -10,7 +10,7 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: frontend_header.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ if ( ! defined( 'BASEPATH' ) ) { exit( 'No direct script access allowed' ); diff --git a/application/views/frontend/layout.php b/application/views/frontend/layout.php index 94059a69..822d2488 100755 --- a/application/views/frontend/layout.php +++ b/application/views/frontend/layout.php @@ -10,7 +10,7 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: frontend_layout.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ if ( ! defined( 'BASEPATH' ) ) { exit( 'No direct script access allowed' ); @@ -60,7 +60,7 @@ diff --git a/application/views/header-blank.php b/application/views/header-blank.php index a74a76fd..d111766d 100755 --- a/application/views/header-blank.php +++ b/application/views/header-blank.php @@ -10,7 +10,7 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: header.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-form-builder.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-form-builder/ */ if ( ! defined( 'BASEPATH' ) ) { exit( 'No direct script access allowed' ); diff --git a/application/views/header.php b/application/views/header.php index 59693d4c..63a69ed2 100755 --- a/application/views/header.php +++ b/application/views/header.php @@ -10,7 +10,7 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: header.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ if ( ! defined( 'BASEPATH' ) ) { exit( 'No direct script access allowed' ); diff --git a/application/views/html_view.php b/application/views/html_view.php index 5df09f8a..6c06a543 100755 --- a/application/views/html_view.php +++ b/application/views/html_view.php @@ -10,7 +10,7 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: json_view.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ if ( ! defined( 'BASEPATH' ) ) { exit( 'No direct script access allowed' ); diff --git a/application/views/invoice_pdf.php b/application/views/invoice_pdf.php index b4b084bb..cce8cc1b 100755 --- a/application/views/invoice_pdf.php +++ b/application/views/invoice_pdf.php @@ -10,7 +10,7 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: invoice_pdf.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ if ( ! defined( 'BASEPATH' ) ) { exit( 'No direct script access allowed' ); diff --git a/application/views/json_view.php b/application/views/json_view.php index 1aeb96d5..6ffcd991 100755 --- a/application/views/json_view.php +++ b/application/views/json_view.php @@ -10,7 +10,7 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: json_view.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ if ( ! defined( 'BASEPATH' ) ) { exit( 'No direct script access allowed' ); diff --git a/application/views/layout-editform.php b/application/views/layout-editform.php index ac1f964f..96301457 100755 --- a/application/views/layout-editform.php +++ b/application/views/layout-editform.php @@ -10,7 +10,7 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: layout-login.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ if ( ! defined( 'BASEPATH' ) ) { exit( 'No direct script access allowed' ); diff --git a/application/views/layout-fmanager.php b/application/views/layout-fmanager.php index 7ac214b2..226138cd 100755 --- a/application/views/layout-fmanager.php +++ b/application/views/layout-fmanager.php @@ -10,7 +10,7 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: layout-login.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-form-builder.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-form-builder/ */ if ( ! defined( 'BASEPATH' ) ) { exit( 'No direct script access allowed' ); diff --git a/application/views/layout-global.php b/application/views/layout-global.php index c17c80dc..5243431f 100755 --- a/application/views/layout-global.php +++ b/application/views/layout-global.php @@ -10,7 +10,7 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: layout-login.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ if ( ! defined( 'BASEPATH' ) ) { exit( 'No direct script access allowed' ); diff --git a/application/views/layout-login.php b/application/views/layout-login.php index f6031ef4..db9816c9 100755 --- a/application/views/layout-login.php +++ b/application/views/layout-login.php @@ -10,7 +10,7 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: layout-login.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ if ( ! defined( 'BASEPATH' ) ) { exit( 'No direct script access allowed' ); diff --git a/application/views/layout.php b/application/views/layout.php index f0b2f9b9..f24b5923 100755 --- a/application/views/layout.php +++ b/application/views/layout.php @@ -10,7 +10,7 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: layout-login.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ if ( ! defined( 'BASEPATH' ) ) { exit( 'No direct script access allowed' ); diff --git a/application/views/layout_blank.php b/application/views/layout_blank.php index add18a18..1ac64fd7 100755 --- a/application/views/layout_blank.php +++ b/application/views/layout_blank.php @@ -10,7 +10,7 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: layout-login.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-form-builder.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-form-builder/ */ if ( ! defined( 'BASEPATH' ) ) { exit( 'No direct script access allowed' ); diff --git a/application/views/notice_footer.php b/application/views/notice_footer.php index c80f2494..d9b654c8 100755 --- a/application/views/notice_footer.php +++ b/application/views/notice_footer.php @@ -10,7 +10,7 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: sidebar.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-form-builder.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-form-builder/ */ if ( ! defined( 'BASEPATH' ) ) { exit( 'No direct script access allowed' ); diff --git a/application/views/sidebar.php b/application/views/sidebar.php index 9a304629..80533f28 100755 --- a/application/views/sidebar.php +++ b/application/views/sidebar.php @@ -10,7 +10,7 @@ * @copyright 2013 Softdiscover * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @version CVS: $Id: sidebar.php, v2.00 2013-11-30 02:52:40 Softdiscover $ - * @link https://php-cost-estimator.zigaform.com/ + * @link https://softdiscover.com/zigaform/php-cost-estimator/ */ if ( ! defined( 'BASEPATH' ) ) { exit( 'No direct script access allowed' ); diff --git a/assets/backend/js/admin.debug.js b/assets/backend/js/admin.debug.js index cc9a9917..1d1fcd44 100755 --- a/assets/backend/js/admin.debug.js +++ b/assets/backend/js/admin.debug.js @@ -32527,7 +32527,25 @@ if (!$uifm.isFunction(zgfm_back_fld_options)) { }); }; - this.generate_field_htmldata = function(showAlert = true) { + this.update_db_structure = function() { + $.ajax({ + type: 'POST', + url: rockfm_vars.uifm_siteurl + 'formbuilder/settings/system_update_table', + data: { + action: 'rocket_fbuilder_update_table_structure', + page: 'zgfm_form_builder', + zgfm_security: uiform_vars.ajax_nonce, + csrf_field_name: uiform_vars.csrf_field_name, + }, + beforeSend: function() {}, + success: function(response) { + alert('DB tables updated. '); + window.location.reload(); + }, + }); + }; + + this.generate_field_htmldata = function(showAlert = true) { $.ajax({ type: 'POST', url: rockfm_vars.uifm_siteurl + 'formbuilder/fields/ajax_dev_genfieldopts', diff --git a/assets/backend/js/admin.min.js b/assets/backend/js/admin.min.js index 12dea2dc..5eb27cde 100755 --- a/assets/backend/js/admin.min.js +++ b/assets/backend/js/admin.min.js @@ -1 +1 @@ -var $uifm_prev=jQuery.noConflict(),$uifm=jQuery.noConflict();void 0===$uifm&&($uifm=jQuery);var uiform_is_dragging=!1,uiform_is_children=!1,rocketform=rocketform||null,uifmsetting;$uifm.isFunction(rocketform)||function(t,e){e.rocketform=rocketform=t.rocketform=function(){var i=[];i.innerVars={},i.setfield_tab_active="",i.fields_flag_stored=[];var a={app_ver:"1.6.3",main:{submit_ajax:"1",add_css:"",add_js:"",onload_scroll:"0",preload_noconflict:"1",payment_st:"0",price_st:"1",price_currency_symbol:"$",price_currency:"USD",price_format_st:"1",price_sep_decimal:".",price_sep_thousand:",",price_sep_precision:"2",price_tax_st:"0",price_tax_val:"0",pdf_show_onpage:"1",pdf_charset:"UTF-8",pdf_font:"2",pdf_paper_size:"a4",pdf_paper_orie:"landscape",pdf_html_fullpage:"0",email_html_fullpage:"0",email_dissubm:"0"},calculation:{enable_st:"0",vars_str:"",variables:{}},invoice:{from_text1:"",from_text2:"",from_text3:"",from_text4:"",from_text5:"",to_text1:"",to_text2:"",to_text3:"",to_text4:"",to_text5:""},skin:{form_width:{show_st:"0",max:"800"},form_padding:{show_st:"1",pos_top:"20",pos_right:"17",pos_bottom:"20",pos_left:"17"},form_background:{show_st:"1",type:"1",start_color:"#eeeeee",end_color:"#ffffff",solid_color:"#ffffff",image:""},form_border_radius:{show_st:"0",size:"5"},form_border:{show_st:"0",color:"#000",style:"1",width:"1"},form_shadow:{show_st:"1",color:"#CCCCCC",h_shadow:"3",v_shadow:"3",blur:"10"}},wizard:{enable_st:"0",theme_type:0,theme:{0:{skin_tab_cur_bgcolor:"#4798E7",skin_tab_cur_txtcolor:"#ffffff",skin_tab_cur_numtxtcolor:"#4798E7",skin_tab_inac_bgcolor:"#ECF0F1",skin_tab_inac_txtcolor:"#95A5A6",skin_tab_inac_numtxtcolor:"#ECF0F1",skin_tab_done_bgcolor:"#9a8afa",skin_tab_done_txtcolor:"#ffffff",skin_tab_done_numtxtcolor:"#ECF0F1",skin_tab_cont_bgcolor:"#F9F9F9",skin_tab_cont_borcol:"#D4D4D4"},1:{skin_tab_cur_bgcolor:"#4798E7",skin_tab_cur_txtcolor:"#000000",skin_tab_cur_numtxtcolor:"#4798E7",skin_tab_cur_bg_numtxt:"#ffffff",skin_tab_inac_bgcolor:"#cccccc",skin_tab_inac_txtcolor:"#95A5A6"}}},onsubm:{sm_successtext:'',sm_boxmsg_bg_st:"0",sm_boxmsg_bg_type:"1",sm_boxmsg_bg_solid:"",sm_boxmsg_bg_start:"",sm_boxmsg_bg_end:"",sm_redirect_st:"0",sm_redirect_url:"",mail_from_email:"",mail_from_name:"",mail_template_msg:"",mail_recipient:"",mail_cc:"",mail_bcc:"",mail_subject:"",mail_usr_st:"0",mail_usr_template_msg:"",mail_usr_pdf_st:"0",mail_usr_pdf_store:"0",mail_usr_pdf_template_msg:"",mail_usr_pdf_fn:"",mail_usr_recipient:"",mail_usr_recipient_name:"",mail_usr_cc:"",mail_usr_bcc:"",mail_usr_subject:""},summbox:{setting:{enable_st:"0",pos:"0",resp_pos:"0",txt_title1:"Summary box"},skin_box:{box_sd_width:"250"},skin_text:{text:"%3Cp%3ETotal%20%3A%20%5Bzgfm_fvar%20opt%3D%22form_cur_symbol%22%5D%20%5Bzgfm_fvar%20opt%3D%22form_total_amount%22%5D%20%5Bzgfm_fvar%20opt%3D%22form_cur_code%22%5D%3Cbr%20%2F%3E%3Cbr%20%2F%3E%5Buifm_summary%20rows%3D%228%22%20heading%3D%22summary%20%3A%20%22%5D%3C%2Fp%3E%3Cp%3E%5Buifm_summary_link%20value%3D%22Show%20summary%22%5D%3C%2Fp%3E",color:"#000",font:'{"family":"\'Comic Sans MS\', Arial, sans-serif","name":"Comic Sans MS","classname":"comicsansms"}',font_st:1,shadow_st:0,shadow_color:"#666",shadow_x:1,shadow_y:1,shadow_blur:3},form_background:{show_st:"1",type:"1",start_color:"#eeeeee",end_color:"#ffffff",solid_color:"#eeeeee",image:""},form_border_radius:{show_st:"0",size:"5"},form_border:{show_st:"0",color:"#000",style:"1",width:"1"},form_shadow:{show_st:"1",color:"#CCCCCC",h_shadow:"3",v_shadow:"3",blur:"10"}},num_tabs:1,steps:{tab_title:[{title:"Tab title 1"}],tab_cont:[]},steps_src:[]};function o(){t("ul.uiform-list-fields a").draggable({connectToSortable:".uiform-items-container",helper:"clone",revert:"invalid",distance:0,cursorAt:{top:20,left:10},cursor:"move",handle:".sfdc-btn1-icon-left",appendTo:".uiform-main-form",drag:function(t,e){}}).disableSelection()}function s(){t(".uiform-items-container").sortable({placeholder:"uiform-draggable-placeholder",connectWith:".uiform-items-container",revert:!1,helper:function(e,i){var a=t(i).attr("data-typefield"),o=t(".uiform-builder-fields").first().find('a[data-type="'+a+'"]').html();return t('
    '+o+"
    ")},handle:".uiform-field-move",sort:function(t,e){e.placeholder},receive:function(t,e){var i=e.item.data("type");e.item.attr("id")||(uiform_is_dragging=!1,rocketform.showLoader(1,!0,!0),rocketform.getFieldsAfterDraggable(this,i,!1,""))},stop:function(i,a){t("#zgpb-editor-container").find(".zgpb-draggable-helper").length&&t("#zgpb-editor-container").find(".zgpb-draggable-helper").remove(),t("#zgpb-editor-container").find(".zgpb-fl-gs-block-style-hover").length&&t("#zgpb-editor-container").find(".zgpb-fl-gs-block-style-hover").removeClass("zgpb-fl-gs-block-style-hover"),!0===uiform_is_dragging&&(rocketform.hideLoader(),!0===uiform_is_children&&t(e).trigger("resize"))},start:function(t,e){uiform_is_dragging=!0,uiform_is_children=!1;e.item.attr("id")},tolerance:"pointer",opacity:.5})}arguments.callee.backend_init_load=function(){o(),s()},arguments.callee.setInnerVariable=function(t,e){i.innerVars[t]=e},arguments.callee.getInnerVariable=function(t){return i.innerVars[t]?i.innerVars[t]:""},arguments.callee.generateUniqueID=function(){var t=Math.random();return t.toString(36),t.toString(36).substr(2,9)},arguments.callee.generateSuffixID=function(t,e){return Math.floor(Math.random()*(e-t+1)+t)},arguments.callee.setUiVar=function(t,e){uivars[t]=e},arguments.callee.setUiArray=function(t,e,i){uivars[t][e]=i},arguments.callee.getUiArray=function(t,e){return uivars[t][e]},arguments.callee.getUiVar=function(t){return uivars[t]},arguments.callee.getFieldById=function(t){return uivars.fields[t]},arguments.callee.getFieldArray=function(t,e){return uivars.fields[t][e]},arguments.callee.showLoader=function(e,i,a){switch(parseInt(e)){case 2:rocketform.alerts_msg(3,t("#alert_header_msg_processing").val());break;case 3:rocketform.alerts_msg(1,t("#alert_header_saving").val());break;case 4:rocketform.alerts_msg(3,t("#alert_header_msg_removing").val());break;case 5:rocketform.alerts_msg(1,t("#alert_header_form_saved").val());break;case 1:default:rocketform.alerts_msg(2,t("#alert_header_loading").val())}i?t("#uifm-loading-box").find(".sfdc-alert").append(' '):t("#uifm-loading-box").find(".uifm-loader-header-1").remove(),a?t("#uifm-loading-box").fadeTo(2e3,500).slideUp(500,function(){t("#uifm-loading-box").slideUp(500)}):t("#uifm-loading-box").show(),t("#uifm-loading-box").show()},arguments.callee.hideLoader=function(){t("#uifm-loading-box").hide(),t("#uifm-loading-box").find(".alert").attr("class","alert").html("")},arguments.callee.loading_boxField=function(e,i){1===parseInt(i)?t('
    ').appendTo(t("#"+e).css("position","relative")):t("#"+e).find(".uiform-field-loadingst").remove()},arguments.callee.loading_panelbox2=function(e){1===parseInt(e)?(t("#uiform-panel-loadingst").parent().css("position","relative"),t("#uiform-panel-loadingst").show()):(t("#uiform-panel-loadingst").parent().removeCss("position","relative"),t("#uiform-panel-loadingst").hide())},arguments.callee.loading_panelbox=function(i,a){1===parseInt(a)?t("#"+i).show("fast",function(){t(e).trigger("resize")}):t("#uiform-panel-loadingst").hide()},arguments.callee.alerts_global_msg=function(t,e){var i;switch(parseInt(t)){case 1:i="alert-success";break;case 2:i="alert-info";break;case 3:i="alert-warning";break;case 4:i="alert-danger"}var a="";return a+='
    ',a+='×',a+=e,a+="
    "},arguments.callee.alerts_msg=function(e,i){var a;switch(parseInt(e)){case 1:a="uifm-alert-success";break;case 2:a="uifm-alert-info";break;case 3:a="uifm-alert-warning";break;case 4:a="uifm-alert-danger"}t("#uifm-loading-box").find(".uifm-alert").attr("class","uifm-alert "+a).html(i).append(' ')},arguments.callee.setHighlightPicked=function(e){t(document).find(".uifm-highlight-edited")&&t(document).find(".uifm-highlight-edited").removeClass("uifm-highlight-edited"),e.addClass("uifm-highlight-edited")},arguments.callee.getUiData=function(t){return a[t]},arguments.callee.setUiData=function(t,e){a[t]=e},arguments.callee.getUiData2=function(t,e){try{return a[t][e]}catch(t){}},arguments.callee.delUiData2=function(t,e){delete a[t][e]},arguments.callee.spliceUiData2=function(t,e){parseInt(e)>-1&&a[t].splice(parseInt(e),1)},arguments.callee.setUiData2=function(t,e,i){a.hasOwnProperty(t)||(a[t]={}),a[t].hasOwnProperty(e)||(a[t][e]={}),a[t][e]=i},arguments.callee.addIndexUiData2=function(t,e,i){void 0===a[t][e]||(a[t][e][i]={})},arguments.callee.getUiData3=function(t,e,i){try{return a[t][e][i]}catch(t){}},arguments.callee.delUiData3=function(t,e,i){delete a[t][e][i]},arguments.callee.spliceUiData3=function(t,e,i){parseInt(i)>-1&&a[t][e].splice(parseInt(i),1)},arguments.callee.setUiData3=function(t,e,i,o){a.hasOwnProperty(t)||(a[t]={}),a[t].hasOwnProperty(e)||(a[t][e]={}),a[t][e][i]=o},arguments.callee.setUiData4=function(t,e,i,o,s){a.hasOwnProperty(t)||(a[t]={}),a[t].hasOwnProperty(e)||(a[t][e]={}),a[t][e].hasOwnProperty(i)||(a[t][e][i]={}),a[t][e][i][o]=s},arguments.callee.getUiData4=function(t,e,i,o){try{return a[t][e][i][o]}catch(t){}},arguments.callee.getUiData5=function(t,e,i,o,s){try{return void 0===a[t][e]?"":a[t][e][i][o][s]}catch(t){return""}},arguments.callee.setUiData5=function(t,e,i,o,s,r){a.hasOwnProperty(t)||(a[t]={}),a[t].hasOwnProperty(e)||(a[t][e]={}),a[t][e].hasOwnProperty(i)||(a[t][e][i]={}),a[t][e][i].hasOwnProperty(o)||(a[t][e][i][o]={}),a[t][e][i][o][s]=r},arguments.callee.addIndexUiData5=function(t,e,i,o,s,r){void 0===a[t][e][i][o][s]||(a[t][e][i][o][s][r]={})},arguments.callee.getUiData6=function(t,e,i,o,s,r){try{return void 0===a[t][e][i][o][s][r]?"":a[t][e][i][o][s][r]}catch(t){return""}},arguments.callee.setUiData6=function(t,e,i,o,s,r,n){a.hasOwnProperty(t)||(a[t]={}),a[t].hasOwnProperty(e)||(a[t][e]={}),a[t][e].hasOwnProperty(i)||(a[t][e][i]={}),a[t][e][i].hasOwnProperty(o)||(a[t][e][i][o]={}),a[t][e][i][o].hasOwnProperty(s)||(a[t][e][i][o][s]={}),a[t][e][i][o][s][r]=n},arguments.callee.delUiData6=function(t,e,i,o,s,r){delete a[t][e][i][o][s][r]},arguments.callee.getUiData7=function(t,e,i,o,s,r,n){try{return void 0===a[t][e][i][o][s][r][n]?"":a[t][e][i][o][s][r][n]}catch(t){return""}},arguments.callee.setUiData7=function(t,e,i,o,s,r,n,c){a.hasOwnProperty(t)||(a[t]={}),a[t].hasOwnProperty(e)||(a[t][e]={}),a[t][e].hasOwnProperty(i)||(a[t][e][i]={}),a[t][e][i].hasOwnProperty(o)||(a[t][e][i][o]={}),a[t][e][i][o].hasOwnProperty(s)||(a[t][e][i][o][s]={}),a[t][e][i][o][s].hasOwnProperty(r)||(a[t][e][i][o][s][r]={}),a[t][e][i][o][s][r][n]=c},arguments.callee.addIndexUiData7=function(t,e,i,o,s,r,n){void 0===a[t][e][i][o][s][r]||(a[t][e][i][o][s][r][n]={})},arguments.callee.setUiData8=function(t,e,i,o,s,r,n,c,f){a.hasOwnProperty(t)||(a[t]={}),a[t].hasOwnProperty(e)||(a[t][e]={}),a[t][e].hasOwnProperty(i)||(a[t][e][i]={}),a[t][e][i].hasOwnProperty(o)||(a[t][e][i][o]={}),a[t][e][i][o].hasOwnProperty(s)||(a[t][e][i][o][s]={}),a[t][e][i][o][s].hasOwnProperty(r)||(a[t][e][i][o][s][r]={}),a[t][e][i][o][s][r].hasOwnProperty(n)||(a[t][e][i][o][s][r][n]={}),a[t][e][i][o][s][r][n][c]=f},arguments.callee.addIndexUiData8=function(t,e,i,o,s,r,n,c){void 0===a[t][e][i][o][s][r][n]||(a[t][e][i][o][s][r][n][c]={})},arguments.callee.delUiData8=function(t,e,i,o,s,r,n,c){delete a[t][e][i][o][s][r][n][c]},arguments.callee.setUiData9=function(t,e,i,o,s,r,n,c,f,l){a.hasOwnProperty(t)||(a[t]={}),a[t].hasOwnProperty(e)||(a[t][e]={}),a[t][e].hasOwnProperty(i)||(a[t][e][i]={}),a[t][e][i].hasOwnProperty(o)||(a[t][e][i][o]={}),a[t][e][i][o].hasOwnProperty(s)||(a[t][e][i][o][s]={}),a[t][e][i][o][s].hasOwnProperty(r)||(a[t][e][i][o][s][r]={}),a[t][e][i][o][s][r].hasOwnProperty(n)||(a[t][e][i][o][s][r][n]={}),a[t][e][i][o][s][r][n].hasOwnProperty(c)||(a[t][e][i][o][s][r][n][c]={}),a[t][e][i][o][s][r][n][c][f]=l},arguments.callee.checkIntegrityDataField=function(e){try{var i=t("#"+e).closest(".uiform-step-pane").data("uifm-step");return void 0!==a.steps_src[parseInt(i)][e]}catch(t){return!1}},arguments.callee.dumpvar3=function(t){return JSON.stringify(t,null,2)},arguments.callee.dumpvar2=function(t){return JSON.stringify(t)},arguments.callee.dumpvar=function(t){var e=[];JSON.stringify(t,function(t,i){if(null!=i&&"object"==typeof i){if(e.indexOf(i)>=0)return;e.push(i)}return i});return e},arguments.callee.checkScrollTab=function(){var e=t(".uiform-set-options-tabs").find("ul.sfdc-nav-tabs"),i=0;e.find("li").each(function(e){i+=parseInt(t(this).width())}),i>480?t(".uiform-set-options-tabs").find(".uifm-tab-navigation").show():t(".uiform-set-options-tabs").find(".uifm-tab-navigation").hide()},arguments.callee.setScrollTab=function(e,i){var a,o=t(i).parent().parent().parent().find("ul.sfdc-nav-tabs");(a=o.css("left")).replace("px",""),a=e>0?parseInt(a)+10:parseInt(a)-10;var s=0;o.find("li").each(function(e){s+=parseInt(t(this).width())}),a>0&&(a=0),s+a<410&&(a=parseInt(a)+10),o.css("left",a+"px")},arguments.callee.cleanSettingTab=function(){var e;e=[".uifm-set-section-fieldname",".uifm-tab-fld-label",".uifm-tab-fld-input",".uifm-tab-fld-helpblock",".uifm-tab-fld-validation",".uifm-tab-fld-misc",".uifm-tab-fld-appendimgs",".uifm-tab-fld-logicrls",".uifm-set-section-label",".uifm-set-section-sublabel",".uifm-set-section-blocktxt",".uifm-set-section-inputtextbox",".uifm-set-section-input12boxbg",".uifm-set-section-input13boxbg",".uifm-set-section-input-placeh",".uifm-set-section-input-valign",".uifm-set-section-input-objalign",".uifm-set-section-inputboxbg",".uifm-set-section-inputboxborder",".uifm-set-section-input12boxborder",".uifm-set-section-input13boxborder",".uifm-set-section-input2",".uifm-set-section-input3",".uifm-set-section-input4",".uifm-set-section-input4-skin-maxwidth",".uifm-set-section-input5",".uifm-set-section-input6",".uifm-set-section-input7",".uifm-set-section-input8",".uifm-set-section-input9",".uifm-set-section-input11",".uifm-set-section-input12",".uifm-set-section-input13",".uifm-set-section-input14",".uifm-set-section-input15",".uifm-set-section-input16",".uifm-set-section-input17",".uifm-set-section-input18","#uifm-fld-inp-date2-box",".uifm-set-section-pricesetting",".uifm-set-section-pricesetting2",".uifm-set-section-inputprice",".uifm-set-section-helpblock",".uifm-set-section-validator",".zgfm-set-section-custominput-box","#uifm-custom-val-req-btn","#uifm-custom-val-alpha-btn","#uifm-custom-val-alphanum-btn","#uifm-custom-val-num-btn","#uifm-custom-val-mail-btn","#uifm-fld-inp2-block-align-box",".uifm-set-section-inputprepend",".uifm-set-section-inputappend",".uifm-set-section-input4-range",".uifm-set-section-input4-defaultvalue",".uifm-set-section-input4-spinner-opts",".uifm-set-section-label-lbltxt",".uifm-set-section-label-sublbltxt",".uifm-set-section-input1-txtvalue",".uifm-set-section-helpblock-text",".uifm-tab-fld-moreopt"],t.each(e,function(){t(String(this)).addClass("uifm-hide")}),t("#uifm_fld_main_fldname").val(""),e=["#uifm_fld_inp_align_1","#uifm_fld_inp_align_2","#uifm_fld_inp_align_3","#uifm_fld_lbl_blo_pos_1","#uifm_fld_lbl_blo_pos_2","#uifm_fld_lbl_blo_pos_3","#uifm_fld_lbl_blo_pos_4","#uifm_fld_lbl_blo_align_1","#uifm_fld_lbl_blo_align_2","#uifm_fld_lbl_blo_align_3","#uifm_fld_elbor_style_1","#uifm_fld_elbor_style_2","#uifm_fld_hblock_pos_1","#uifm_fld_hblock_pos_2","#uifm_fld_hblock_pos_3","#uifm_fld_hblock_pos_4","#uifm_fld_val_pos_1","#uifm_fld_val_pos_2","#uifm_fld_val_pos_3","#uifm_fld_val_pos_4"],t.each(e,function(){t(String(this)).prop("checked",!1),t(String(this)).parent().removeClass("sfdc-active")}),e=["#uifm_fld_val_reqicon_pos_2","#uifm_fld_val_reqicon_pos_1"],t.each(e,function(){t(String(this)).prop("checked",!1),t(String(this)).removeClass("sfdc-active")}),e=["#uifm-custom-val-req-custxt","#uifm-custom-val-alpha-custxt","#uifm-custom-val-alphanum-custxt","#uifm-custom-val-numbers-custxt","#uifm-custom-val-email-custxt"],t.each(e,function(){t(String(this)).val("")})},arguments.callee.closeSettingTab=function(){t('.sfdc-nav-tabs a[href="#uiform-build-form-tab"]').sfdc_tab("show"),t('.sfdc-nav-tabs a[href="#uiform-settings-tab3-2"]').sfdc_tab("show"),t(".uifm-tab-selectedfield").hide(),t("#uifm-field-selected-id").val("")},arguments.callee.loadDataOptionByFieldId=function(t){},arguments.callee.enableSettingTabOption=function(e){switch(e){case"uifm-label":case"uifm-sublabel":t('.sfdc-nav-tabs a[href="#uiform-settings-tab-1"]').sfdc_tab("show"),rocketform.setInnerVariable("setfield_tab_active","label");break;case"uifm-txtbox-inp-val":t('.sfdc-nav-tabs a[href="#uiform-settings-tab-2"]').sfdc_tab("show"),rocketform.setInnerVariable("setfield_tab_active","input");break;case"uifm-help-block":t('.sfdc-nav-tabs a[href="#uiform-settings-tab-3"]').sfdc_tab("show"),rocketform.setInnerVariable("setfield_tab_active","helpb")}},arguments.callee.setDataToSettingTab=function(e,i){var a,o=t("#uifm-field-selected-id").val();t("#"+e);if(e===o){var s=t("#uifm-field-selected-id").parent();t.each(i,function(e,i){t.isPlainObject(i)&&t.each(i,function(i,o){t.isPlainObject(o)?t.each(o,function(t,o){(a=[]).push(e),a.push(i),a.push(t),rocketform.setDataOptToSetTab(s,a.join("-"),o)}):((a=[]).push(e),a.push(i),rocketform.setDataOptToSetTab(s,a.join("-"),o))})})}},arguments.callee.setDataToSettingTabAndPreview=function(e,i){var a,o=t("#uifm-field-selected-id").val(),s=t("#"+e);if(e===o){var r=t("#uifm-field-selected-id").parent();t.each(i,function(e,o){t.isPlainObject(o)?t.each(o,function(i,o){t.isPlainObject(o)?t.each(o,function(o,n){t.isPlainObject(n)?t.each(n,function(t,n){(a=[]).push(e),a.push(i),a.push(o),a.push(t),rocketform.setDataOptToSetTab(r,a.join("-"),n),rocketform.setDataOptToPrevField(s,a.join("-"),n)}):((a=[]).push(e),a.push(i),a.push(o),rocketform.setDataOptToSetTab(r,a.join("-"),n),rocketform.setDataOptToPrevField(s,a.join("-"),n))}):((a=[]).push(e),a.push(i),rocketform.setDataOptToSetTab(r,a.join("-"),o),rocketform.setDataOptToPrevField(s,a.join("-"),o))}):rocketform.setDataOptToSetTab_1(r,e,o,i.type)})}},arguments.callee.loadForm_updatePreviewField=function(e,i){try{var a=t("#"+e);t.each(i,function(e,i){t.isPlainObject(i)&&t.each(i,function(i,o){t.isPlainObject(o)?t.each(o,function(t,o){rocketform.setDataOptToPrevField(a,e+"-"+i+"-"+t,o)}):rocketform.setDataOptToPrevField(a,e+"-"+i,o)})})}catch(t){}},arguments.callee.setDataToPreviewField=function(e,i){var a=t("#"+e);a&&t.each(i,function(e,i){t.isPlainObject(i)&&t.each(i,function(t,i){rocketform.setDataOptToPrevField(a,e+"-"+t,i)})})},arguments.callee.setDataOptToCoreData=function(t,e,i,a){try{var o,s,r,n,c=(n=i.split("-")).length;switch(o=n[0],s=n[1],r=n[2]||null,String(o)){case"input18":r=n[2]||"",this.setUiData6("steps_src",String(t),String(e),String(o),String(s),String(r),a);break;default:switch(parseInt(c)){case 3:this.setUiData6("steps_src",String(t),String(e),String(o),String(s),String(r),a);break;case 2:this.setUiData5("steps_src",String(t),String(e),String(o),String(s),a)}}}catch(t){}},arguments.callee.previewform_shadowBox=function(t){var e,i,a,o,s,r;s=this.getUiData3("skin","form_shadow","show_st"),i=this.getUiData3("skin","form_shadow","h_shadow"),a=this.getUiData3("skin","form_shadow","v_shadow"),o=this.getUiData3("skin","form_shadow","blur"),r=this.getUiData3("skin","form_shadow","color"),1===parseInt(s)?(e=i+"px "+a+"px "+o+"px "+r,t.find(".uiform-main-form").css("box-shadow",e)):t.find(".uiform-main-form").removeCss("box-shadow")},arguments.callee.previewsummbox_shadowBox=function(){var e,i,a,o,s,r;s=this.getUiData3("summbox","form_shadow","show_st"),i=this.getUiData3("summbox","form_shadow","h_shadow"),a=this.getUiData3("summbox","form_shadow","v_shadow"),o=this.getUiData3("summbox","form_shadow","blur"),r=this.getUiData3("summbox","form_shadow","color"),1===parseInt(s)?(e=i+"px "+a+"px "+o+"px "+r,t("#uifm-sticky-sidebar-box").css("box-shadow",e)):t("#uifm-sticky-sidebar-box").removeCss("box-shadow")},arguments.callee.previewfield_shadowBox=function(e,i,a){var o,s,r,n,c,f,l=e.attr("id"),d=t("#"+l).closest(".uiform-step-pane").data("uifm-step");c=this.getUiData5("steps_src",d,l,i,"shadow_st"),s=this.getUiData5("steps_src",d,l,i,"shadow_x"),r=this.getUiData5("steps_src",d,l,i,"shadow_y"),n=this.getUiData5("steps_src",d,l,i,"shadow_blur"),f=this.getUiData5("steps_src",d,l,i,"shadow_color"),1===parseInt(c)?(o=s+"px "+r+"px "+n+"px "+f,e.find(a).css("text-shadow",o)):e.find(a).removeCss("text-shadow")},arguments.callee.previewfield_elementBorderRadius=function(e,i,a){var o=e.attr("id"),s=t("#"+o).closest(".uiform-step-pane").data("uifm-step"),r=this.getUiData5("steps_src",s,o,i,"show_st"),n=this.getUiData5("steps_src",s,o,i,"size");1===parseInt(r)?e.find(a).css("border-radius",n+"px"):e.find(a).removeCss("border-radius")},arguments.callee.previewform_elementBorderRadius=function(t,e){var i=this.getUiData3("skin","form_border_radius","show_st"),a=this.getUiData3("skin","form_border_radius","size");1===parseInt(i)?t.find(".uiform-main-form").css("border-radius",a+"px"):t.find(".uiform-main-form").removeCss("border-radius")},arguments.callee.previewsummbox_elementBorderRadius=function(){var e=this.getUiData3("summbox","form_border_radius","show_st"),i=this.getUiData3("summbox","form_border_radius","size");1===parseInt(e)?t("#uifm-sticky-sidebar-box").css("border-radius",i+"px"):t("#uifm-sticky-sidebar-box").removeCss("border-radius")},arguments.callee.previewfield_elementHelpBlockText=function(e,i){var a=e.attr("id"),o=t("#"+a).closest(".uiform-step-pane").data("uifm-step"),s=this.getUiData5("steps_src",o,a,i,"show_st"),r=this.getUiData5("steps_src",o,a,i,"text"),n=(this.getUiData5("steps_src",o,a,i,"font"),this.getUiData5("steps_src",o,a,i,"font_st"),this.getUiData5("steps_src",o,a,i,"pos")),c=(e.find(".uifm-input-container"),e.find(".uifm-help-block"),e.find(".uifm-label-helpblock"));if(1===parseInt(s))switch(parseInt(n)){case 1:e.find(".uifm-help-block").html(decodeURIComponent(r));break;case 2:c.attr("data-original-title")&&(c.attr("data-original-title",decodeURIComponent(r)),c.tooltip("hide"),c.tooltip({animation:!1,placement:c.data("placement")||"top",container:"body",html:!0,title:decodeURIComponent(r)}),c.tooltip("show"));break;case 3:t("#"+a+"_hb_modal")&&t("#"+a+"_hb_modal").find(".sfdc-modal-body").html(decodeURIComponent(r));break;case 0:default:e.find(".uifm-help-block").html(decodeURIComponent(r))}},arguments.callee.previewfield_elementTextarea=function(e,i){var a=e.attr("id"),o=t("#"+a).closest(".uiform-step-pane").data("uifm-step"),s=this.getUiData5("steps_src",o,a,i,"show_st"),r=(this.getUiData5("steps_src",o,a,i,"text"),this.getUiData5("steps_src",o,a,i,"font")),n=this.getUiData5("steps_src",o,a,i,"font_st");if(1===parseInt(s))if(this.previewfield_elementHelpBlockText(e,i),1===parseInt(n)&&r){var c=JSON.parse(r);e.find(".uifm-help-block").css("font-family",c.family)}else e.find(".uifm-help-block").removeCss("font-family");else e.find(".uifm-help-block").css("display","none"),e.find(".uifm-label-helpblock").hide()},arguments.callee.previewfield_helpBlockPosition=function(e,i){var a=e.attr("id"),o=t("#"+a).closest(".uiform-step-pane").data("uifm-step"),s=this.getUiData5("steps_src",o,a,i,"show_st"),r=this.getUiData5("steps_src",o,a,i,"pos"),n=this.getUiData5("steps_src",o,a,i,"text"),c=e.find(".uifm-input-container"),f=e.find(".uifm-help-block"),l=e.find(".uifm-label-helpblock");if(1===parseInt(s))switch(parseInt(r)){case 1:l.attr("data-original-title")&&(l.data&&l.data("tooltip")||(l.tooltip("hide"),l.tooltip("destroy")),l.removeAttr("data-original-title")),t("#"+a+"_hb_modal")&&t("#"+a+"_hb_modal").remove(),l.hide(),f.show(),t(f).insertBefore(c);break;case 2:t("#"+a+"_hb_modal")&&t("#"+a+"_hb_modal").remove(),l.attr("data-original-title")&&(l.data&&l.data("tooltip")||(l.tooltip("hide"),l.tooltip("destroy")),l.removeAttr("data-original-title")),l.show(),f.hide(),l.tooltip({animation:!1,placement:l.data("placement")||"top",container:"body",html:!0,title:n}),l.attr("data-original-title",decodeURIComponent(n)),"helpb"===String(this.getInnerVariable("setfield_tab_active"))&&l.tooltip("show");break;case 3:l.attr("data-original-title")&&(l.data&&l.data("tooltip")||(l.tooltip("hide"),l.tooltip("destroy")),l.removeAttr("data-original-title")),l.show(),f.hide();var d=t("#modaltemplate").clone();d.attr("id",a+"_hb_modal"),d.find(".sfdc-modal-body").html(decodeURIComponent(n)),t("body").append(d),l.attr("data-target","#"+a+"_hb_modal"),l.attr("data-toggle","modal");break;case 0:default:l.attr("data-original-title")&&(l.data&&l.data("tooltip")||(l.tooltip("hide"),l.tooltip("destroy")),l.removeAttr("data-original-title")),t("#"+a+"_hb_modal")&&t("#"+a+"_hb_modal").remove(),l.hide(),f.show(),t(c).insertBefore(f)}else l.attr("data-original-title")&&(l.data&&l.data("tooltip")||(l.tooltip("hide"),l.tooltip("destroy")),l.removeAttr("data-original-title")),t("#"+a+"_hb_modal")&&t("#"+a+"_hb_modal").remove(),l.hide(),f.hide()},arguments.callee.previewfield_validateRecIcon=function(e,i){var a=e.attr("id"),o=t("#"+a).closest(".uiform-step-pane").data("uifm-step"),s=this.getUiData5("steps_src",o,a,i,"reqicon_st"),r=this.getUiData5("steps_src",o,a,i,"reqicon_pos"),n=this.getUiData5("steps_src",o,a,i,"reqicon_img"),c=e.find(".uifm-label");1===parseInt(s)?(t("#"+a+"_val_iconreq_img").remove(),1===parseInt(r)?c.after(''):c.before('')):t("#"+a+"_val_iconreq_img").remove()},arguments.callee.previewfield_hideAllPopOver=function(){var e=t("#uifm-field-selected-id").val(),i=t("#"+e);if(i){var a=i.find(".uifm-txtbox-inp-val");a.data&&a.data("bs.sfdc_popover")&&a.sfdc_popover("destroy")}},arguments.callee.previewfield_removeAllPopovers=function(){var e=t(".uiform-main-form [aria-describedby^=popover]");e&&t.each(e,function(e,i){t(i).data&&t(i).data("bs.sfdc_popover")&&t(i).sfdc_popover("destroy")})},arguments.callee.previewfield_removeAllUndesiredObj=function(e){var i=t(".uiform-main-form .uiform-datepicker").not(e).find(".bootstrap-datetimepicker-widget");i&&i.remove()},arguments.callee.previewfield_hidePopOver=function(){var e=t("#uifm-field-selected-id").val(),i=t("#"+e);if(i){var a=i.find(".uifm-txtbox-inp-val");switch(String(this.getInnerVariable("setfield_tab_active"))){case"label":case"input":case"helpb":a.data&&a.data("bs.sfdc_popover")&&a.sfdc_popover("destroy");break;case"validate":this.previewfield_validatePopover(i,"validate")}}},arguments.callee.previewfield_helpblock_hidetooltip=function(){var e=t("#uifm-field-selected-id").val(),i=t("#"+e);if(i){var a=i.find(".uifm-label-helpblock");switch(String(this.getInnerVariable("setfield_tab_active"))){case"helpb":break;default:case"label":case"input":case"helpb":a.data&&a.data("bs.tooltip")&&a.tooltip("destroy")}}},arguments.callee.previewfield_validatePopover=function(e,i){var a,o=e.attr("id"),s=t("#"+o).closest(".uiform-step-pane").data("uifm-step"),r=this.getUiData4("steps_src",s,o,"type"),n=this.getUiData5("steps_src",s,o,i,"typ_val"),c=this.getUiData5("steps_src",s,o,i,"typ_val_custxt"),f=this.getUiData5("steps_src",s,o,i,"pos"),l=this.getUiData5("steps_src",s,o,i,"tip_col"),d=this.getUiData5("steps_src",s,o,i,"tip_bg");switch(parseInt(r)){case 6:case 7:a=e.find(".uifm-txtbox-inp-val");break;case 8:case 9:case 10:case 11:a=e.find(".uifm-input2-wrap");break;case 12:a=e.find(".uifm-fileinput-wrap");break;case 13:a=e.find(".uifm-fileinput-wrap .fileinput-preview");break;case 15:a=e.find(".uifm-txtbox-inp-val");break;case 19:a=e.find(".uifm-inp6-captcha-inputcode");break;case 23:a=e.find(".uiform-colorpicker-wrap");break;case 24:a=e.find(".uifm-input7-datepic");break;case 25:a=e.find(".uifm-input7-timepic");break;case 26:a=e.find(".uifm-input7-datetimepic");break;case 27:a=e.find(".uifm-input-recaptcha");break;case 28:case 29:case 30:a=e.find(".uifm-txtbox-inp-val");break;case 43:default:return}var _,m,p;switch(parseInt(n)){case 1:_=t("#uifm-custom-val-alpha-deftxt").val(),m=c||_;break;case 2:_=t("#uifm-custom-val-alphanum-deftxt").val(),m=c||_;break;case 3:_=t("#uifm-custom-val-numbers-deftxt").val(),m=c||_;break;case 4:_=t("#uifm-custom-val-email-deftxt").val(),m=c||_;break;case 5:_=t("#uifm-custom-val-req-deftxt").val(),m=c||_}switch(parseInt(f)){case 1:p="right";break;case 2:p="bottom";break;case 3:p="left";break;case 0:default:p="top"}switch(parseInt(n)){case 6:t("#zgfm-field-val-custominput-box").show();break;default:t("#zgfm-field-val-custominput-box").hide()}switch(parseInt(n)){case 1:case 2:case 3:case 4:case 5:case 6:var u;a.data&&a.data("bs.sfdc_popover")&&a.sfdc_popover("destroy"),a.sfdc_popover({placement:p,content:m,trigger:"manual",animation:!1,container:"body",html:!0}).focus(function(){a.sfdc_popover("show")}).blur(function(){a.sfdc_popover("hide")}),"validate"===String(this.getInnerVariable("setfield_tab_active"))&&a.sfdc_popover("show"),u=a.attr("aria-describedby");var h="";if(t("#"+o)){switch(t("#"+o+"_val_ppbox").remove(),h='",t("head").append(h)}t("#uifm-custom-val-title-added").show();break;default:t("#uifm-custom-val-title-added").hide(),a.data&&a.data("bs.sfdc_popover")&&a.sfdc_popover("destroy")}},arguments.callee.previewfield_elementBorder=function(e,i,a){var o,s=e.attr("id"),r=t("#"+s).closest(".uiform-step-pane").data("uifm-step"),n=this.getUiData5("steps_src",r,s,i,"show_st"),c=this.getUiData5("steps_src",r,s,i,"color"),f=(this.getUiData5("steps_src",r,s,i,"color_focus_st"),this.getUiData5("steps_src",r,s,i,"color_focus"),this.getUiData5("steps_src",r,s,i,"style")),l=this.getUiData5("steps_src",r,s,i,"width");1===parseInt(n)?(o=1===parseInt(f)?"solid ":"dotted ",o+=c+" "+l+"px",e.find(a).css("border",o)):e.find(a).removeCss("border")},arguments.callee.previewform_elementBorder=function(t,e){var i,a=this.getUiData3("skin","form_border","show_st"),o=this.getUiData3("skin","form_border","color"),s=this.getUiData3("skin","form_border","style"),r=this.getUiData3("skin","form_border","width");1===parseInt(a)?(i=1===parseInt(s)?"solid ":"dotted ",i+=o+" "+r+"px",t.find(".uiform-main-form").css("border",i)):t.find(".uiform-main-form").removeCss("border")},arguments.callee.previewsummbox_elementBorder=function(){var e,i=this.getUiData3("summbox","form_border","show_st"),a=this.getUiData3("summbox","form_border","color"),o=this.getUiData3("summbox","form_border","style"),s=this.getUiData3("summbox","form_border","width");1===parseInt(i)?(e=1===parseInt(o)?"solid ":"dotted ",e+=a+" "+s+"px",t("#uifm-sticky-sidebar-box").css("border",e)):t("#uifm-sticky-sidebar-box").removeCss("border")},arguments.callee.previewfield_elementBackground=function(e,i,a){var o=e.attr("id"),s=t("#"+o).closest(".uiform-step-pane").data("uifm-step"),r=this.getUiData5("steps_src",s,o,i,"show_st"),n=this.getUiData5("steps_src",s,o,i,"type"),c=this.getUiData5("steps_src",s,o,i,"start_color"),f=this.getUiData5("steps_src",s,o,i,"end_color"),l=this.getUiData5("steps_src",s,o,i,"solid_color");if(1===parseInt(r))switch(parseInt(n)){case 2:e.find(a).css({background:c,"background-image":"-webkit-linear-gradient(top, "+c+", "+f+")","background-image":"-moz-linear-gradient(top, "+c+", "+f+")","background-image":"-ms-linear-gradient(top, "+c+", "+f+")","background-image":"-o-linear-gradient(top, "+c+", "+f+")","background-image":"linear-gradient(to bottom, "+c+","+f+")"});break;case 1:default:l&&e.find(a).css("background",l)}else e.find(a).removeCss("background"),e.find(a).removeCss("background-image")},arguments.callee.previewform_elementPadding=function(t,e){var i=this.getUiData3("skin","form_padding","show_st"),a=this.getUiData3("skin","form_padding","pos_top"),o=this.getUiData3("skin","form_padding","pos_right"),s=this.getUiData3("skin","form_padding","pos_bottom"),r=this.getUiData3("skin","form_padding","pos_left");if(1===parseInt(i)){var n=a+"px "+o+"px "+s+"px "+r+"px";t.find(".uiform-main-form").css("padding",n)}else t.find(".uiform-main-form").removeCss("padding")},arguments.callee.previewform_elementBackground=function(e,i){var a=this.getUiData3("skin","form_background","show_st"),o=this.getUiData3("skin","form_background","type"),s=this.getUiData3("skin","form_background","start_color"),r=this.getUiData3("skin","form_background","end_color"),n=this.getUiData3("skin","form_background","solid_color"),c=this.getUiData3("skin","form_background","image");if(1===parseInt(a)){switch(parseInt(o)){case 2:e.find(".uiform-main-form").css({background:s,"background-image":"-webkit-linear-gradient(top, "+s+", "+r+")","background-image":"-moz-linear-gradient(top, "+s+", "+r+")","background-image":"-ms-linear-gradient(top, "+s+", "+r+")","background-image":"-o-linear-gradient(top, "+s+", "+r+")","background-image":"linear-gradient(to bottom, "+s+","+r+")"}),t(".uiform-main-form").find(".uiform-divider-text")&&t(".uiform-main-form").find(".uiform-divider-text").css({background:s,"background-image":"-webkit-linear-gradient(top, "+s+", "+r+")","background-image":"-moz-linear-gradient(top, "+s+", "+r+")","background-image":"-ms-linear-gradient(top, "+s+", "+r+")","background-image":"-o-linear-gradient(top, "+s+", "+r+")","background-image":"linear-gradient(to bottom, "+s+","+r+")"});break;case 1:default:n&&e.find(".uiform-main-form").css("background",n),t(".uiform-main-form").find(".uiform-divider-text")&&t(".uiform-main-form").find(".uiform-divider-text").css("background",n)}c&&(e.find(".uiform-main-form").removeCss("background-image"),e.find(".uiform-main-form").css({"background-image":"url('"+c+"')","background-repeat":"repeat"}),t(".uiform-main-form").find(".uiform-divider-text")&&t(".uiform-main-form").find(".uiform-divider-text").css({"background-image":"url('"+c+"')","background-repeat":"repeat"}))}else e.find(".uiform-main-form").removeCss("background"),e.find(".uiform-main-form").removeCss("background-image"),t(".uiform-main-form").find(".uiform-divider-text")&&(t(".uiform-main-form").find(".uiform-divider-text").removeCss("background"),t(".uiform-main-form").find(".uiform-divider-text").removeCss("background-image"),t(".uiform-main-form").find(".uiform-divider-text").removeCss("background-repeat"))},arguments.callee.previewform_summboxBackground=function(){var e=this.getUiData3("summbox","form_background","show_st"),i=this.getUiData3("summbox","form_background","type"),a=this.getUiData3("summbox","form_background","start_color"),o=this.getUiData3("summbox","form_background","end_color"),s=this.getUiData3("summbox","form_background","solid_color"),r=this.getUiData3("summbox","form_background","image");if(1===parseInt(e)){switch(parseInt(i)){case 2:t("#uifm-sticky-sidebar-box").css({background:a,"background-image":"-webkit-linear-gradient(top, "+a+", "+o+")","background-image":"-moz-linear-gradient(top, "+a+", "+o+")","background-image":"-ms-linear-gradient(top, "+a+", "+o+")","background-image":"-o-linear-gradient(top, "+a+", "+o+")","background-image":"linear-gradient(to bottom, "+a+","+o+")"});break;case 1:default:s&&t("#uifm-sticky-sidebar-box").css("background",s)}r&&(t("#uifm-sticky-sidebar-box").removeCss("background-image"),t("#uifm-sticky-sidebar-box").css({"background-image":"url('"+r+"')","background-repeat":"repeat"}))}else t("#uifm-sticky-sidebar-box").removeCss("background"),t("#uifm-sticky-sidebar-box").removeCss("background-image")},arguments.callee.previewfield_controlBlockLabel=function(e,i){var a=e.attr("id"),o=t("#"+a).closest(".uiform-step-pane").data("uifm-step"),s=this.getUiData5("steps_src",o,a,i,"block_pos"),r=this.getUiData5("steps_src",o,a,i,"block_st"),n=this.getUiData5("steps_src",o,a,i,"block_align"),c=this.getUiData5("steps_src",o,a,i,"grid_layout"),f=e.find(".uifm-control-label").parent(),l=e.find(".uifm-control-label").parent().siblings(),d=parseInt(f.index());let _;if(1===parseInt(r)){switch(f.show(),parseInt(s)){case 1:1===d&&t(f).insertBefore(l),e.find(".uifm-control-label").parent().attr("class","rkfm-col-sm-12"),e.find(".uifm-control-label").parent().siblings().attr("class","rkfm-col-sm-12");break;case 2:0===d&&t(l).insertBefore(f),_=this.previewfield_getBlockGridLayout(c),e.find(".uifm-control-label").parent().attr("class",`rkfm-col-sm-${_.right}`),e.find(".uifm-control-label").parent().siblings().attr("class",`rkfm-col-sm-${_.left}`);break;case 3:0===d&&t(l).insertBefore(f),e.find(".uifm-control-label").parent().attr("class","rkfm-col-sm-12"),e.find(".uifm-control-label").parent().siblings().attr("class","rkfm-col-sm-12");break;case 0:default:1===d&&t(f).insertBefore(l),_=this.previewfield_getBlockGridLayout(c),e.find(".uifm-control-label").parent().attr("class",`rkfm-col-sm-${_.left}`),e.find(".uifm-control-label").parent().siblings().attr("class",`rkfm-col-sm-${_.right}`)}switch(parseInt(n)){case 1:e.find(".uifm-control-label").css("text-align","center");break;case 2:e.find(".uifm-control-label").css("text-align","right");break;case 0:default:e.find(".uifm-control-label").css("text-align","left")}}else f.hide(),l.attr("class","rkfm-col-sm-12")},arguments.callee.previewfield_getBlockGridLayout=function(t){var e={};switch(parseInt(t)){case 1:e.left=1,e.right=10;break;case 2:e.left=2,e.right=9;break;case 3:e.left=3,e.right=9;break;case 4:e.left=4,e.right=8;break;case 5:e.left=5,e.right=7;break;case 6:e.left=6,e.right=6;break;case 7:e.left=7,e.right=5;break;case 8:e.left=8,e.right=4;break;case 9:e.left=9,e.right=3;break;case 10:e.left=10,e.right=2;break;case 11:e.left=11,e.right=1}return e},arguments.callee.previewfield_fontfamily=function(e,i,a){var o,s,r,n=e.attr("id"),c=t("#"+n).closest(".uiform-step-pane").data("uifm-step");if(o=this.getUiData5("steps_src",c,n,i,"font_st"),s=this.getUiData5("steps_src",c,n,i,"font"),1===parseInt(o)&&s){var f=JSON.parse(s);if(e.find(a).css("font-family",f.family),void 0!==f.import_family){var l="@import url(//fonts.googleapis.com/css?family="+f.import_family;r="zgfm_font_"+String(f.import_family).cleanup(),0===parseInt(t("#"+r).length)&&t('",t("head").append(e);break;case 1:o=this.getUiData4("wizard","theme",i,"skin_tab_cur_bgcolor"),s=this.getUiData4("wizard","theme",i,"skin_tab_cur_txtcolor"),r=this.getUiData4("wizard","theme",i,"skin_tab_cur_numtxtcolor");var _=this.getUiData4("wizard","theme",i,"skin_tab_cur_bg_numtxt");n=this.getUiData4("wizard","theme",i,"skin_tab_inac_bgcolor"),c=this.getUiData4("wizard","theme",i,"skin_tab_inac_txtcolor");t("#"+a+"_tab").remove(),e='",t("head").append(e)}}catch(t){}},arguments.callee.wizardtab_saveChangesToMdata=function(){var e=t("#uifm_frm_wiz_st").prop("checked")?1:0,i=parseInt(t("#uifm_frm_wiz_theme_typ").val()),a=t("#uifm_frm_wiz_tab_active_bgcolor").val(),o=t("#uifm_frm_wiz_tab_active_txtcolor").val(),s=t("#uifm_frm_wiz_tab_active_numtxtcolor").val(),r=t("#uifm_frm_wiz_tab_inactive_bgcolor").val(),n=t("#uifm_frm_wiz_tab_inactive_txtcolor").val(),c=t("#uifm_frm_wiz_tab_inactive_numtxtcolor").val(),f=t("#uifm_frm_wiz_tab_done_bgcolor").val(),l=t("#uifm_frm_wiz_tab_done_txtcolor").val(),d=t("#uifm_frm_wiz_tab_done_numtxtcolor").val(),_=t("#uifm_frm_wiz_tab_cont_bgcolor").val(),m=t("#uifm_frm_wiz_tab_cont_borcol").val();switch(this.setUiData2("wizard","enable_st",e),this.setUiData2("wizard","theme_type",i),i){case 0:this.setUiData4("wizard","theme",i,"skin_tab_cur_bgcolor",a),this.setUiData4("wizard","theme",i,"skin_tab_cur_txtcolor",o),this.setUiData4("wizard","theme",i,"skin_tab_cur_numtxtcolor",s),this.setUiData4("wizard","theme",i,"skin_tab_inac_bgcolor",r),this.setUiData4("wizard","theme",i,"skin_tab_inac_txtcolor",n),this.setUiData4("wizard","theme",i,"skin_tab_inac_numtxtcolor",c),this.setUiData4("wizard","theme",i,"skin_tab_done_bgcolor",f),this.setUiData4("wizard","theme",i,"skin_tab_done_txtcolor",l),this.setUiData4("wizard","theme",i,"skin_tab_done_numtxtcolor",d),this.setUiData4("wizard","theme",i,"skin_tab_cont_bgcolor",_),this.setUiData4("wizard","theme",i,"skin_tab_cont_borcol",m);break;case 1:var p=t("#uifm_frm_wiz_tab_active_bg_numtxt").val();this.setUiData4("wizard","theme",i,"skin_tab_cur_bgcolor",a),this.setUiData4("wizard","theme",i,"skin_tab_cur_txtcolor",o),this.setUiData4("wizard","theme",i,"skin_tab_cur_numtxtcolor",s),this.setUiData4("wizard","theme",i,"skin_tab_cur_bg_numtxt",p),this.setUiData4("wizard","theme",i,"skin_tab_inac_bgcolor",r),this.setUiData4("wizard","theme",i,"skin_tab_inac_txtcolor",n)}},arguments.callee.wizardtab_tabManualEvt=function(e,i){var a;if(i){var o=t(e).closest(".uifm_frm_skin_tab_content").attr("data-tab-nro");a=t(".uiform-step-list .uiform-steps a[data-tab-nro="+o+"]").parent()}else a=t(e);t("ul.uiform-steps li").removeClass("uifm-current").addClass("uifm-disabled"),a.addClass("uifm-current").removeClass("uifm-disabled"),t(".uiform-step-pane").hide();var s=a.find("a").attr("href");t(s).show()},arguments.callee.wizardtab_tabManageEvt=function(){t("ul.uiform-steps li").on("click",function(){return rocketform.wizardtab_tabManualEvt(this,!1),!1})},arguments.callee.fieldsetting_updateName=function(t,e,i){try{this.setUiData4("steps_src",String(t),String(e),"field_name",i)}catch(t){}},arguments.callee.fieldsetting_deleteField=function(e){var i=t("#"+e).closest(".uiform-step-pane").data("uifm-step");t("#"+e).remove(),rocketform.closeSettingTab(),rocketform.delUiData3("steps_src",i,e);var o,s=a.steps_src[i],r=s.length;for(o=0;o0){switch(t("#uifm_preview_form").removeData("bs.modal"),t("#uifm_preview_form").sfdc_modal("show"),parseInt(i)){case 1:t("#uifm_preview_form").find(".sfdc-modal-title").text(s);break;case 2:t("#uifm_preview_form").find(".sfdc-modal-title").text(r);break;case 3:t("#uifm_preview_form").find(".sfdc-modal-title").text(n)}zgfm_back_helper.tooltip_removeall(),t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"formbuilder/forms/ajax_load_preview_form",data:{action:"rocket_fbuilder_load_preview_form",page:"zgfm_cost_estimate",zgfm_security:uiform_vars.ajax_nonce,form_id:a,csrf_field_name:uiform_vars.csrf_field_name},success:function(e){t("#uifm_preview_form").find(".sfdc-modal-body").html(e),rocketform.previewform_resizeBox(i)}})}else bootbox.alert(o,function(){})},arguments.callee.previewform_onClosePopUp=function(){t(".uiform_popover_frontend").sfdc_popover("destroy")},arguments.callee.listform_duplicate=function(){if(t(".uiform-listform-chk-id").is(":checked")){var e=t("#uiform-form-listform").serialize();t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"formbuilder/forms/ajax_listform_duplicate",data:e+"&action=rocket_fbuilder_listform_duplicate&page=zgfm_cost_estimate&csrf_field_name="+uiform_vars.csrf_field_name,success:function(t){rocketform.redirect_tourl(uiform_vars.url_admin+"formbuilder/forms/list_uiforms")}})}else t("#uifm_modal_msg").sfdc_modal("show"),t("#uifm_modal_msg .sfdc-modal-title").html(t("#uifm_listform_popup_title").val()),t("#uifm_modal_msg .sfdc-modal-body").html("

    "+t("#uifm_listform_popup_notforms").val()+"

    ")},arguments.callee.listform_selectallforms=function(e){t(e).is(":checked")?t(".uiform-listform-chk-id").prop("checked",!0):t(".uiform-listform-chk-id").prop("checked",!1)},arguments.callee.modal_centerPos=function(e){e.each(function(e){var i=t(this).clone().css("display","block").appendTo("body"),a=Math.round((i.height()-i.find(".sfdc-modal-content").height())/2);a=a>0?a:0,i.remove(),t(this).find(".sfdc-modal-content").css("margin-top",a)})},arguments.callee.listform_updateStatus=function(e){if(t(".uiform-listform-chk-id").is(":checked")){var i=t("#uiform-form-listform").serialize();t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"formbuilder/forms/ajax_listform_updatest",data:i+"&action=rocket_fbuilder_listform_updatest&page=zgfm_cost_estimate&form_st="+e+"&csrf_field_name="+uiform_vars.csrf_field_name,success:function(t){rocketform.redirect_tourl(uiform_vars.url_admin+"formbuilder/forms/list_uiforms")}})}else t("#uifm_modal_msg").sfdc_modal("show"),t("#uifm_modal_msg .sfdc-modal-title").html(t("#uifm_listform_popup_title").val()),t("#uifm_modal_msg .sfdc-modal-body").html("

    "+t("#uifm_listform_popup_notforms").val()+"

    "),t("#uifm_modal_msg").on("show.bs.sfdc-modal",rocketform.modal_centerPos(t("#uifm_modal_msg")))},arguments.callee.listrecords_exportToCsv=function(){try{var e=t("#uifm-record-form-cmb").val();t("body").append("")}catch(t){}},arguments.callee.listform_deleteFormById=function(e){t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"formbuilder/forms/ajax_delete_form_byid",data:{action:"rocket_fbuilder_delete_form",page:"zgfm_cost_estimate",zgfm_security:uiform_vars.ajax_nonce,form_id:e,csrf_field_name:uiform_vars.csrf_field_name},success:function(t){rocketform.redirect_tourl(uiform_vars.url_admin+"formbuilder/forms/list_uiforms")}})},arguments.callee.input2settings_priceOption=function(e){var i=t(e).closest(".uifm-fld-inp2-options-row").data("opt-index"),a=t("#uifm-field-selected-id").val(),o=t("#uifm_frm_inp2_opt"+i+"_price").val(),s=t("#"+a).closest(".uiform-step-pane").data("uifm-step");rocketform.setUiData7("steps_src",parseInt(s),a,"input2","options",i,"price",o)},arguments.callee.input2settings_labelOption=function(e){var i=t(e).closest(".uifm-fld-inp2-options-row").data("opt-index"),a=t("#uifm-field-selected-id").val(),o=t("#uifm_frm_inp2_opt"+i+"_label").val(),s=t("#"+a).closest(".uiform-step-pane").data("uifm-step");rocketform.setUiData7("steps_src",parseInt(s),a,"input2","options",i,"label",o);var r=this.getUiData4("steps_src",s,a,"type");switch(parseInt(r)){case 8:t("#"+a).data("uiform_radiobtn").input2settings_preview_genAllOptions();break;case 9:t("#"+a).data("uiform_checkbox").input2settings_preview_genAllOptions();break;case 10:t("#"+a).data("uiform_select").input2settings_preview_genAllOptions();break;case 11:t("#"+a).data("uiform_multiselect").input2settings_preview_genAllOptions()}},arguments.callee.input2settings_stl1_quickcolor=function(e){var i=t("#uifm-field-selected-id").val(),a=t("#"+i).closest(".uiform-step-pane").data("uifm-step"),o=this.getUiData4("steps_src",a,i,"type");switch(parseInt(o)){case 10:t("#"+i).data("uiform_select").input2settings_stl1_quickcolor(e);break;case 11:t("#"+i).data("uiform_multiselect").input2settings_stl1_quickcolor(e)}},arguments.callee.input2settings_valueOption=function(e){var i=t(e).closest(".uifm-fld-inp2-options-row").data("opt-index"),a=t("#uifm-field-selected-id").val(),o=t("#uifm_frm_inp2_opt"+i+"_value").val(),s=t("#"+a).closest(".uiform-step-pane").data("uifm-step");rocketform.setUiData7("steps_src",parseInt(s),a,"input2","options",i,"value",o);this.getUiData4("steps_src",s,a,"type")},arguments.callee.input2settings_statusRdoOption=function(e){var i=t(e),a=t("#uifm-field-selected-id").val(),o=t("#uifm-field-selected-type").val();switch(parseInt(o)){case 8:t("#"+a).data("uiform_radiobtn").input2settings_statusRdoOption(i);break;case 9:t("#"+a).data("uiform_checkbox").input2settings_statusRdoOption(i);break;case 10:t("#"+a).data("uiform_select").input2settings_statusRdoOption(i);break;case 11:t("#"+a).data("uiform_multiselect").input2settings_statusRdoOption(i)}},arguments.callee.input17settings_deleteOption=function(e){var i=t(e),o=t("#uifm-field-selected-id").val(),s=i.closest(".uifm-fld-inp17-options-row").data("opt-index"),r=t("#"+o).closest(".uiform-step-pane").data("uifm-step");i.closest(".uifm-fld-inp17-options-row").remove(),rocketform.delUiData6("steps_src",parseInt(r),o,"input17","options",parseInt(s));var n,c=a.steps_src[parseInt(r)][o].input17.options,f=c.length;for(n=0;nObject.assign(t,{[e]:i}),{}),rocketform.setUiData5("steps_src",parseInt(a),i,"input2","options",_),parseInt(o)){case 8:t("#"+i).data("uiform_radiobtn").input2settings_preview_genAllOptions();break;case 9:t("#"+i).data("uiform_checkbox").input2settings_preview_genAllOptions();break;case 10:t("#"+i).data("uiform_select").input2settings_preview_genAllOptions();break;case 11:t("#"+i).data("uiform_multiselect").input2settings_preview_genAllOptions()}rocketform.input2settings_tabeditor_generateAllOptions(),t("#zgpb-modal1").sfdc_modal("hide")},arguments.callee.clogic_removeAll=function(){t("#uifm-conditional-logic-list").html("");var e=t("#uifm-field-selected-id").val(),i=t("#"+e).closest(".uiform-step-pane").data("uifm-step");rocketform.setUiData5("steps_src",parseInt(i),e,"clogic","list",[])},arguments.callee.clogic_tabeditor_generateAllOptions=function(e){var i,a;t("#uifm-conditional-logic-list").html("");var o=t("#uifm-conditional-logic-list");t.each(e,function(e,s){if(s&&0!=parseInt(t("#"+s.field_fire).length)){i=e,(a=t("#uiform-set-clogic-tmpl .uifm-conditional-row").clone()).attr("data-row-index",i),o.append(a),rocketform.clogic_getListField(a),a.find(".uifm_clogic_fieldsel").val(s.field_fire).trigger("chosen:updated");var r=rocketform.search_fieldById(s.field_fire);switch(rocketform.clogic_getTypeMatch(a,r.type),a.find(".uifm_clogic_mtype select").val(s.mtype).trigger("chosen:updated"),rocketform.clogic_getMatchInput(a,r),parseInt(r.type)){case 8:case 9:case 10:case 11:case 41:case 42:0!=parseInt(a.find(".uifm_clogic_minput_1").find('option[value="'+s.minput+'"]').length)?a.find(".uifm_clogic_minput_1").val(s.minput).trigger("chosen:updated"):rocketform.clogic_tabeditor_removeifnomatch(e);break;case 40:var n;n=1===parseInt(s.minput)?"1":"0",a.find(".uifm_clogic_minput_1").val(n).trigger("chosen:updated");break;case 16:case 18:a.find(".uifm_clogic_minput_2").val(s.minput)}}else rocketform.clogic_tabeditor_removeifnomatch(e)})},arguments.callee.clogic_tabeditor_removeifnomatch=function(e){var i=t("#uifm-field-selected-id").val(),o=t("#"+i).closest(".uiform-step-pane").data("uifm-step"),s=e;t("#uifm-conditional-logic-list").find('.uifm-conditional-row[data-row-index="'+e+'"]').remove(),rocketform.delUiData6("steps_src",parseInt(o),i,"clogic","list",parseInt(s));var r,n=a.steps_src[parseInt(o)][i].clogic.list,c=n.length;for(r=0;r'),rocketform.setUiData6("steps_src",parseInt(s),o,"input18","pane_background","image",a),this.input18settings_preview_genAllOptions(t("#"+o),"")},arguments.callee.input17settings_saveSrcImgOption=function(e,i){var a,o=e.closest(".uifm-fld-inp17-options-row"),s=o.attr("data-opt-index"),r=t("#uifm-field-selected-id").val(),n=t("#"+r).closest(".uiform-step-pane").data("uifm-step"),c=this.getUiData4("steps_src",n,r,"type"),f=this.getUiData5("steps_src",n,r,"input17","thopt_mode")||1;a=2===parseInt(f)?e.closest(".uifm_frm_inp17_opt2_imgwrap").attr("data-opt-index"):e.closest(".uifm_frm_inp17_opt_imgwrap").attr("data-opt-index");var l,d=i;switch(2===parseInt(f)?(o.find(".uifm_frm_inp17_opt_img_list_2_wrap").find("[data-opt-index='"+a+"']").find(".sfdc-img-thumbnail").attr("src",d),rocketform.setUiData9("steps_src",parseInt(n),r,"input17","options",parseInt(s),"img_list_2",parseInt(a),"img_full",d)):(o.find(".uifm_frm_inp17_opt_img_list_wrap").find("[data-opt-index='"+a+"']").find(".sfdc-img-thumbnail").attr("src",d),rocketform.setUiData9("steps_src",parseInt(n),r,"input17","options",parseInt(s),"img_list",parseInt(a),"img_full",d),rocketform.setUiData9("steps_src",parseInt(n),r,"input17","options",parseInt(s),"img_list",parseInt(a),"img_th_150x150",d)),parseInt(c)){case 41:l=t("#"+r).find(".uifm-dcheckbox-item[data-inp17-opt-index='"+s+"']");break;case 42:l=t("#"+r).find(".uifm-dradiobtn-item[data-inp17-opt-index='"+s+"']")}rocketform.input17settings_preview_refreshImgs(l)},arguments.callee.input17settings_changeSrcImg=function(i){var a=t(i);this.elfinder_showPopUp({windowURL:uiform_vars.url_elfinder2,windowName:"_blank",height:490,width:950,centerScreen:1,location:0}),e.processFile=function(t){rocketform.input17settings_saveSrcImgOption(a,t.url)}},arguments.callee.input18settings_changeSrcImg=function(i){var a=t(i);this.elfinder_showPopUp({windowURL:uiform_vars.url_elfinder2,windowName:"_blank",height:490,width:950,centerScreen:1,location:0}),e.processFile=function(t){rocketform.input18settings_savePaneBg(a,t.url)}},arguments.callee.elfinder_showPopUp=function(i){var a,o,s=t.extend({},{centerBrowser:0,centerScreen:0,height:500,left:0,location:0,menubar:0,resizable:0,scrollbars:0,status:0,width:500,windowName:null,windowURL:null,top:0,toolbar:0},i||{}),r="height="+s.height+",width="+s.width+",toolbar="+s.toolbar+",scrollbars="+s.scrollbars+",status="+s.status+",resizable="+s.resizable+",location="+s.location+",menuBar="+s.menubar;return s.windowName=this.name||s.windowName,s.windowURL=this.href||s.windowURL,s.centerBrowser?(t.browser.msie?(a=e.screenTop-120+((document.documentElement.clientHeight+120)/2-s.height/2),o=e.screenLeft+((document.body.offsetWidth+20)/2-s.width/2)):(a=e.screenY+(e.outerHeight/2-s.height/2),o=e.screenX+(e.outerWidth/2-s.width/2)),e.open(s.windowURL,s.windowName,r+",left="+o+",top="+a).focus()):s.centerScreen?(a=(screen.height-s.height)/2,o=(screen.width-s.width)/2,e.open(s.windowURL,s.windowName,r+",left="+o+",top="+a).focus()):e.open(s.windowURL,s.windowName,r+",left="+s.left+",top="+s.top).focus(),!1},arguments.callee.input18settings_deleteBgImagePane=function(){var e=t("#uifm-field-selected-id").val(),i=t("#"+e).closest(".uiform-step-pane").data("uifm-step");t("#uifm_frm_inp18_bg_srcimg_wrap").html(""),rocketform.setUiData6("steps_src",parseInt(i),e,"input18","pane_background","image",""),this.input18settings_preview_genAllOptions(t("#"+e),"")},arguments.callee.input17settings_tabeditor_generateAllOptions=function(){t("#uifm-fld-inp17-options-container").html("");var e,i,a=t("#uifm-field-selected-id").val(),o=t("#"+a).closest(".uiform-step-pane").data("uifm-step"),s=this.getUiData4("steps_src",o,a,"type"),r=this.getUiData5("steps_src",o,a,"input17","options"),n=this.getUiData5("steps_src",o,a,"input17","thopt_mode")||"1";switch(parseInt(s)){case 41:case 42:t.each(r,function(s,r){switch((e=t("#uifm_frm_inp17_templates").find(".uifm-fld-inp17-options-row").clone()).attr("data-opt-index",s),e.find(".uifm_frm_inp17_opt_label").val(r.label),e.find(".uifm_frm_inp17_opt_ckeck").prop("checked",parseInt(r.checked)),e.find(".uifm_frm_inp17_opt_price").val(r.price),e.find(".uifm_frm_inp17_opt_qty_st").bootstrapSwitchZgpb(),parseInt(r.qty_st)?e.find(".uifm_frm_inp17_opt_qty_st").bootstrapSwitchZgpb("state",!0):e.find(".uifm_frm_inp17_opt_qty_st").bootstrapSwitchZgpb("state",!1),e.find(".uifm_fld_inp17_spinner").TouchSpin({verticalbuttons:!0,min:0,max:1e9,stepinterval:1,verticalupclass:"sfdc-glyphicon sfdc-glyphicon-plus",verticaldownclass:"sfdc-glyphicon sfdc-glyphicon-minus"}),e.find(".uifm_frm_inp17_opt_qty_max").val(r.qty_max),parseInt(n)){case 2:r.img_list_2.length||(rocketform.addIndexUiData8("steps_src",parseInt(o),a,"input17","options",parseInt(s),"img_list_2",0),rocketform.setUiData8("steps_src",parseInt(o),a,"input17","options",parseInt(s),"img_list_2",0,{img_full:""}),rocketform.addIndexUiData8("steps_src",parseInt(o),a,"input17","options",parseInt(s),"img_list_2",1),rocketform.setUiData8("steps_src",parseInt(o),a,"input17","options",parseInt(s),"img_list_2",1,{img_full:""}),rocketform.addIndexUiData8("steps_src",parseInt(o),a,"input17","options",parseInt(s),"img_list_2",2),rocketform.setUiData8("steps_src",parseInt(o),a,"input17","options",parseInt(s),"img_list_2",2,{img_full:""}),r.img_list_2={0:{img_full:""},1:{img_full:""},2:{img_full:""}}),t.each(r.img_list_2,function(a,o){i=t("#uifm_frm_inp17_templates").find(".uifm_frm_inp17_opt2_imgwrap").clone(),o.img_full?i.find(".sfdc-img-thumbnail").attr("src",o.img_full):i.find(".sfdc-img-thumbnail").attr("src",uiform_vars.url_assets+"/common/imgs/uifm-question-mark.png"),i.attr("data-opt-index",a),e.find(".uifm_frm_inp17_opt_img_list_2_wrap").append(i)}),e.find('.uifm_frm_inp17_opt_img_list_2_wrap .uifm_frm_inp17_opt2_imgwrap[data-opt-index="0"]').find(".col-md-8 p").attr("class","alert alert-success").html("Checked"),e.find('.uifm_frm_inp17_opt_img_list_2_wrap .uifm_frm_inp17_opt2_imgwrap[data-opt-index="1"]').find(".col-md-8 p").attr("class","alert alert-warning").html("Hover"),e.find('.uifm_frm_inp17_opt_img_list_2_wrap .uifm_frm_inp17_opt2_imgwrap[data-opt-index="2"]').find(".col-md-8 p").attr("class","alert alert-info").html("Unchecked");break;case 1:default:r.img_list&&t.each(r.img_list,function(a,o){i=t("#uifm_frm_inp17_templates").find(".uifm_frm_inp17_opt_imgwrap").clone(),o.img_th_150x150?i.find(".sfdc-img-thumbnail").attr("src",o.img_th_150x150):i.find(".sfdc-img-thumbnail").attr("src",uiform_vars.url_assets+"/common/imgs/uifm-question-mark.png"),i.find(".uifm_frm_inp17_opt_imgitem_title").val(o.title),e.find(".uifm_frm_inp17_opt_img_list_wrap").append(i)})}t("#uifm-fld-inp17-options-container").append(e),t("#uifm-fld-inp17-options-container .autogrow").autogrow()})}rocketform.input17settings_showOptionbyLayMode(n),t("#uifm-fld-inp17-options-container .switch-field-17").on("switchChange.bootstrapSwitchZgpb",function(e,i){var a=i?1:0;rocketform.input17settings_updateOption(t(this),a,"qty_st")}),t("#uifm-fld-inp17-options-container .uifm_frm_inp17_opt_qty_max").on("change",function(e){var i=t(e.target).val();rocketform.input17settings_updateOption(t(e.target),i,"qty_max")})},arguments.callee.input17settings_showOptionbyLayMode=function(e){2===parseInt(e)?(t("#uifm-fld-inp17-options-container .uifm_frm_inp17_opt_img_list_1").hide(),t("#uifm-fld-inp17-options-container .uifm_frm_inp17_opt_img_list_2").show(),t("#uifm_fld_inp17_thopt_zoom_wrap").hide(),t("#uifm_fld_inp17_thopt_usethmb_wrap").hide(),t("#uifm_fld_inp17_thopt_showcheckb_wrap").show()):(t("#uifm-fld-inp17-options-container .uifm_frm_inp17_opt_img_list_1").show(),t("#uifm-fld-inp17-options-container .uifm_frm_inp17_opt_img_list_2").hide(),t("#uifm_fld_inp17_thopt_zoom_wrap").show(),t("#uifm_fld_inp17_thopt_usethmb_wrap").show(),t("#uifm_fld_inp17_thopt_showcheckb_wrap").hide())},arguments.callee.input17settings_enableCheckOption=function(e){var i=(e=t(e)).attr("data-option-store"),a=e.is(":checked")?1:0,o=t("#uifm-field-selected-id").val(),s=t("#"+o).closest(".uiform-step-pane").data("uifm-step"),r=this.getUiData4("steps_src",s,o,"type"),n=this.getUiData5("steps_src",s,o,"input17","thopt_mode")||"1";rocketform.input17settings_updateOption(e,a,i);var c,f=e.closest(".uifm-fld-inp17-options-row").attr("data-opt-index");switch(parseInt(r)){case 41:c=t("#"+o).find(".uifm-dcheckbox-item[data-inp17-opt-index='"+f+"']");break;case 42:c=t("#"+o).find(".uifm-dradiobtn-item[data-inp17-opt-index='"+f+"']")}switch(c.uiformDCheckbox("man_optChecked",a),parseInt(n)){case 2:c.uiformDCheckbox("man_mod2_refresh")}},arguments.callee.input17settings_onChangeOption=function(e){var i=(e=t(e)).attr("data-option-store"),a=e.val();rocketform.input17settings_updateOption(e,a,i);var o=t("#uifm-field-selected-id").val();rocketform.input17settings_preview_genAllOptions(t("#"+o),"input17")},arguments.callee.input17settings_updateOption=function(e,i,a){var o,s=e.closest(".uifm-fld-inp17-options-row").attr("data-opt-index"),r=t("#uifm-field-selected-id").val(),n=t("#"+r).closest(".uiform-step-pane").data("uifm-step"),c=this.getUiData4("steps_src",n,r,"type");switch(rocketform.setUiData7("steps_src",parseInt(n),r,"input17","options",parseInt(s),a,i),parseInt(c)){case 41:o=t("#"+r).find(".uifm-dcheckbox-item[data-inp17-opt-index='"+s+"']");break;case 42:o=t("#"+r).find(".uifm-dradiobtn-item[data-inp17-opt-index='"+s+"']")}switch(String(a)){case"qty_st":o.uiformDCheckbox("man_optQtySt",i);break;case"qty_max":o.uiformDCheckbox("man_optQtyMax",i)}},arguments.callee.input2settings_tabeditor_generateAllOptions=function(){t("#uifm-fld-inp2-options-container").html("");var e,i=t("#uifm-field-selected-id").val(),a=t("#"+i).closest(".uiform-step-pane").data("uifm-step"),o=this.getUiData4("steps_src",a,i,"type"),s=this.getUiData5("steps_src",a,i,"input2","options");switch(parseInt(o)){case 8:t.each(s,function(i,a){(e=t("#uifm_frm_inp2_templates").find(".uifm-fld-inp2-options-row").clone()).attr("data-opt-index",i),e.find(".uifm_frm_inp2_opt_checked").attr("id","uifm_frm_inp2_opt"+i+"_rdo"),e.find(".uifm_frm_inp2_opt_checked").prop("checked",parseInt(a.checked)),e.find(".uifm_frm_inp2_opt_checked").attr("type","radio"),e.find(".uifm_frm_inp2_opt_checked").attr("name","uifm_inp2_rdo"),e.find(".uifm_frm_inp2_opt_label_evt").attr("id","uifm_frm_inp2_opt"+i+"_label"),e.find(".uifm_frm_inp2_opt_label_evt").val(a.label),e.find(".uifm_frm_inp2_opt_value_evt").attr("id","uifm_frm_inp2_opt"+i+"_value"),e.find(".uifm_frm_inp2_opt_value_evt").val(a.value),e.find(".uifm_frm_inp2_opt_price_evt").attr("id","uifm_frm_inp2_opt"+i+"_price"),e.find(".uifm_frm_inp2_opt_price_evt").val(a.price),t("#uifm-fld-inp2-options-container").append(e)});break;case 9:t.each(s,function(i,a){(e=t("#uifm_frm_inp2_templates").find(".uifm-fld-inp2-options-row").clone()).attr("data-opt-index",i),e.find(".uifm_frm_inp2_opt_checked").attr("id","uifm_frm_inp2_opt"+i+"_chk"),e.find(".uifm_frm_inp2_opt_checked").prop("checked",parseInt(a.checked)),e.find(".uifm_frm_inp2_opt_checked").attr("name","uifm_inp2_chk"),e.find(".uifm_frm_inp2_opt_label_evt").attr("id","uifm_frm_inp2_opt"+i+"_label"),e.find(".uifm_frm_inp2_opt_label_evt").val(a.label),e.find(".uifm_frm_inp2_opt_value_evt").attr("id","uifm_frm_inp2_opt"+i+"_value"),e.find(".uifm_frm_inp2_opt_value_evt").val(a.value),e.find(".uifm_frm_inp2_opt_price_evt").attr("id","uifm_frm_inp2_opt"+i+"_price"),e.find(".uifm_frm_inp2_opt_price_evt").val(a.price),t("#uifm-fld-inp2-options-container").append(e)});break;case 10:t.each(s,function(i,a){(e=t("#uifm_frm_inp2_templates").find(".uifm-fld-inp2-options-row").clone()).attr("data-opt-index",i),e.find(".uifm_frm_inp2_opt_checked").attr("id","uifm_frm_inp2_opt"+i+"_rdo"),e.find(".uifm_frm_inp2_opt_checked").prop("checked",parseInt(a.checked)),e.find(".uifm_frm_inp2_opt_checked").attr("type","radio"),e.find(".uifm_frm_inp2_opt_checked").attr("name","uifm_inp2_rdo"),e.find(".uifm_frm_inp2_opt_label_evt").attr("id","uifm_frm_inp2_opt"+i+"_label"),e.find(".uifm_frm_inp2_opt_label_evt").val(a.label),e.find(".uifm_frm_inp2_opt_value_evt").attr("id","uifm_frm_inp2_opt"+i+"_value"),e.find(".uifm_frm_inp2_opt_value_evt").val(a.value),e.find(".uifm_frm_inp2_opt_price_evt").attr("id","uifm_frm_inp2_opt"+i+"_price"),e.find(".uifm_frm_inp2_opt_price_evt").val(a.price),t("#uifm-fld-inp2-options-container").append(e)});break;case 11:t.each(s,function(i,a){(e=t("#uifm_frm_inp2_templates").find(".uifm-fld-inp2-options-row").clone()).attr("data-opt-index",i),e.find(".uifm_frm_inp2_opt_checked").attr("id","uifm_frm_inp2_opt"+i+"_chk"),e.find(".uifm_frm_inp2_opt_checked").prop("checked",parseInt(a.checked)),e.find(".uifm_frm_inp2_opt_checked").attr("name","uifm_inp2_chk"),e.find(".uifm_frm_inp2_opt_label_evt").attr("id","uifm_frm_inp2_opt"+i+"_label"),e.find(".uifm_frm_inp2_opt_label_evt").val(a.label),e.find(".uifm_frm_inp2_opt_value_evt").attr("id","uifm_frm_inp2_opt"+i+"_value"),e.find(".uifm_frm_inp2_opt_value_evt").val(a.value),e.find(".uifm_frm_inp2_opt_price_evt").attr("id","uifm_frm_inp2_opt"+i+"_price"),e.find(".uifm_frm_inp2_opt_price_evt").val(a.price),t("#uifm-fld-inp2-options-container").append(e)})}zgfm_back_input2.input2settings_refreshSortable()},arguments.callee.input2settings_deleteOption=function(e){var i=t(e),o=t("#uifm-field-selected-id").val(),s=i.closest(".uifm-fld-inp2-options-row").data("opt-index"),r=t("#"+o).closest(".uiform-step-pane").data("uifm-step"),n=t("#uifm-field-selected-type").val();i.closest(".uifm-fld-inp2-options-row").remove(),rocketform.delUiData6("steps_src",parseInt(r),o,"input2","options",s);var c,f=a.steps_src[parseInt(r)][o].input2.options,l=f.length;for(c=0;c',o+="#"+s+" .uiform-divider-text::before {",o+="background:"+n+"!important;",o+="} ",o+="#"+s+" .uiform-divider-text::after {",o+="background:"+n+"!important;",o+="} ",o+="",t("head").append(o)):t("#"+s+"_prev_fld_divider").remove(),e.find(".uiform-divider-text").css("color",f),0!=parseInt(l.length)?e.find(".uiform-divider-text").show().html(l):e.find(".uiform-divider-text").hide(),rocketform.previewform_elementBackground(t(".uiform-main-form"),!1)}catch(t){}},arguments.callee.input9settings_updateField=function(e,i){e.data("typefield");var a,o=e.attr("id"),s=t("#"+o).closest(".uiform-step-pane").data("uifm-step"),r=this.getUiData5("steps_src",s,o,i,"txt_star1"),n=this.getUiData5("steps_src",s,o,i,"txt_star2"),c=this.getUiData5("steps_src",s,o,i,"txt_star3"),f=this.getUiData5("steps_src",s,o,i,"txt_star4"),l=this.getUiData5("steps_src",s,o,i,"txt_star5"),d=this.getUiData5("steps_src",s,o,i,"txt_norate");(a=e.find(".uifm-input-ratingstar")).data("rating")?t(a).rating("refresh",{starCaptions:{1:r,2:n,3:c,4:f,5:l},clearCaption:d}):t(a).rating({starCaptions:{1:r,2:n,3:c,4:f,5:l},clearCaption:d,starCaptionClasses:{1:"text-danger",2:"text-warning",3:"text-info",4:"text-primary",5:"text-success"}})},arguments.callee.input7settings_updateField=function(e,i,a){var o,s=e.data("typefield"),r=e.attr("id"),n=t("#"+r).closest(".uiform-step-pane").data("uifm-step"),c=this.getUiData5("steps_src",n,r,i,"language"),f=this.getUiData5("steps_src",n,r,i,"format");switch(parseInt(s)){case 24:(o=e.find(".uifm-input7-datepic")).data("DateTimePicker")||o.datetimepicker({format:"L"}),c&&o.data("DateTimePicker").locale(c),f&&(o.data("DateTimePicker").dayViewHeaderFormat(f),o.data("DateTimePicker").format(f));break;case 25:(o=e.find(".uifm-input7-timepic")).data("DateTimePicker")||o.datetimepicker({format:"LT"});break;case 26:(o=e.find(".uifm-input7-datetimepic")).data("DateTimePicker")||o.datetimepicker(),c?o.data("DateTimePicker").locale(c):o.data("DateTimePicker").locale("en"),f&&o.data("DateTimePicker").dayViewHeaderFormat(f)}},arguments.callee.input6settings_checkCaptcha=function(e,i,a){if(0!=parseInt(t(".uiform-main-form").find(".uiform-captcha").length)){var o=t(".uiform-main-form").find(".uifm-inp6-captcha");parseInt(o.length)>1&&o.each(function(e){0!=parseInt(e)&&t(this).removeClass("uifm-inp6-captcha").html("Captcha is loaded once. Remove this field")});var s=e.attr("id"),r=t("#"+s).closest(".uiform-step-pane").data("uifm-step"),n=this.getUiData5("steps_src",r,s,i,"txt_color_st"),c=this.getUiData5("steps_src",r,s,i,"txt_color"),f=this.getUiData5("steps_src",r,s,i,"background_st"),l=this.getUiData5("steps_src",r,s,i,"background_color"),d=this.getUiData5("steps_src",r,s,i,"distortion"),_=this.getUiData5("steps_src",r,s,i,"behind_lines_st"),m=this.getUiData5("steps_src",r,s,i,"behind_lines"),p=this.getUiData5("steps_src",r,s,i,"front_lines_st"),u=this.getUiData5("steps_src",r,s,i,"front_lines"),h=this.getUiData4("steps_src",r,s,i),b=CryptoJS.MD5(JSON.stringify(h)),g=t("#"+s).find(".uifm-inp6-captcha-inputcode").attr("data-check-hash");if(String(g)===String(b));else{t("#"+s).find(".uifm-inp6-captcha-inputcode").attr("data-check-hash",b);var k=e.find(".uifm-inp6-wrap-refrescaptcha a").data("rkurl");t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"formbuilder/fields/ajax_refresh_captcha",dataType:"json",data:{action:"rocket_backend_refreshcaptcha",txt_color_st:n,txt_color:c,background_st:f,background_color:l,distortion:d,behind_lines_st:_,behind_lines:m,front_lines_st:p,front_lines:u,zgfm_security:uiform_vars.ajax_nonce,page:"zgfm_cost_estimate",csrf_field_name:uiform_vars.csrf_field_name},success:function(t){e.find(".uifm-inp6-captcha-img").attr("src",k+t.rkver),e.find(".uifm-inp6-wrap-refrescaptcha a").attr("data-rkver",t.rkver)}})}}},arguments.callee.input5settings_checkRecaptcha=function(e,i,a){if(parseInt(t(".uiform-main-form").find(".uifm-input-recaptcha").length)>0){var o=t(".uiform-main-form").find(".uifm-input-recaptcha");parseInt(o.length)>1?o.each(function(e){0!=parseInt(e)?t(this).removeClass("g-recaptcha").html("ReCaptcha is loaded once. Remove this field"):t(this)}):o;var s=e.attr("id"),r=t("#"+s).closest(".uiform-step-pane").data("uifm-step"),n=(this.getUiData5("steps_src",r,s,"input5","g_key_public"),this.getUiData5("steps_src",r,s,i,"g_theme"));switch(t("#uifmobj-"+s).html(""),parseInt(n)){case 1:"dark",t("#uifmobj-"+s).html('');break;default:t("#uifmobj-"+s).html(''),"light"}}},arguments.callee.clogic_getListField=function(e){var i=t("#uiform-set-clogic-tmpl .uifm_clogic_fieldsel").clone(),a=this.getUiData("steps_src"),o=t("#uifm-field-selected-id").val(),s=[8,9,10,11,16,18,40,41,42],r="";t.each(a,function(e,i){t.each(i,function(e,i){String(o)!=String(i.id)&&t.inArray(parseInt(i.type),s)>=0&&(r+='")})}),i.append(r),e.find(".uifm_clogic_field").append(i),e.find(".uifm_clogic_fieldsel").chosen({width:"100%"})},arguments.callee.search_fieldById=function(t){var e=this.getUiData("steps_src");for(var i in e)for(var a in e[i])if(String(e[i][a].id)===String(t))return e[i][a];return!1},arguments.callee.viewchart_load=function(){var e=t("#uifm-record-form-cmb").val();rocketform.showLoader(1,!0,!0),t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"formbuilder/records/ajax_load_viewchart",data:{action:"rocket_fbuilder_loadchart_byform",page:"zgfm_cost_estimate",zgfm_security:uiform_vars.ajax_nonce,form_id:parseInt(e),csrf_field_name:uiform_vars.csrf_field_name},success:function(e){t("#uiform-viewchart-result").html(""),rocketform.viewchart_generate(e.data),rocketform.hideLoader()}})},arguments.callee.viewchart_generate=function(t){try{Morris.Area({element:"uiform-viewchart-result",data:t,xkey:"days",ykeys:["requests"],labels:["requests"],smooth:!1})}catch(t){}},arguments.callee.clogic_getTypeMatch=function(e,i){var a;switch(e.find(".uifm_clogic_mtype").html(""),e.find(".uifm_clogic_mtype").attr("data-loaded","0"),e.find(".uifm_clogic_mtype").append(''),e.find(".uifm_clogic_mtype").find(".sfdc-gly-spin").fadeOut("slow").remove(),parseInt(i)){case 8:case 9:case 10:case 11:case 40:case 41:case 42:a=t("#uiform-set-clogic-tmpl .uifm_clogic_mtypeinp_1").clone();break;case 16:case 18:a=t("#uiform-set-clogic-tmpl .uifm_clogic_mtypeinp_2").clone()}e.find(".uifm_clogic_mtype").append(a),e.find(".uifm_clogic_mtypeinp").chosen({width:"100%"}),e.find(".uifm_clogic_mtype").attr("data-loaded","1")},arguments.callee.clogic_getMatchInput=function(e,i){var a,o,s;switch(e.find(".uifm_clogic_minput").html(""),e.find(".uifm_clogic_minput").attr("data-loaded","0"),e.find(".uifm_clogic_minput").append(''),e.find(".uifm_clogic_minput").find(".sfdc-gly-spin").fadeOut("slow").remove(),parseInt(i.type)){case 8:case 9:case 10:case 11:a=t("#uiform-set-clogic-tmpl .uifm_clogic_minput_1").clone(),(s=i.input2.options)&&(o="",t.each(s,function(t,e){o+='"}),a.append(o)),e.find(".uifm_clogic_minput").append(a),e.find(".uifm_clogic_minput_1").chosen({width:"100%"});break;case 41:case 42:a=t("#uiform-set-clogic-tmpl .uifm_clogic_minput_1").clone(),(s=i.input17.options)&&(o="",t.each(s,function(t,e){o+='"}),a.append(o)),e.find(".uifm_clogic_minput").append(a),e.find(".uifm_clogic_minput_1").chosen({width:"100%"});break;case 40:a=t("#uiform-set-clogic-tmpl .uifm_clogic_minput_1").clone(),o="",o+='",o+='",a.append(o),e.find(".uifm_clogic_minput").append(a),e.find(".uifm_clogic_minput_1").chosen({width:"100%"});break;case 16:case 18:a=t("#uiform-set-clogic-tmpl .uifm_clogic_minput_2").clone();var r=i.input4.set_min,n=i.input4.set_max,c=i.input4.set_default,f=i.input4.set_step;e.find(".uifm_clogic_minput").append(a),e.find(".uifm_clogic_minput_2").TouchSpin({verticalbuttons:!0,min:parseFloat(r),max:parseFloat(n),stepinterval:parseFloat(f),verticalupclass:"sfdc-glyphicon sfdc-glyphicon-plus",verticaldownclass:"sfdc-glyphicon sfdc-glyphicon-minus",initval:parseFloat(c)})}e.find(".uifm_clogic_minput").attr("data-loaded","1")},arguments.callee.clogic_changeMtype=function(e){var i=t(e).closest(".uifm-conditional-row"),a=i.find(".uifm_clogic_mtype select").chosen().val(),o=i.data("row-index"),s=t("#uifm-field-selected-id").val(),r=t("#"+s).closest(".uiform-step-pane").data("uifm-step");rocketform.setUiData7("steps_src",parseInt(r),s,"clogic","list",parseInt(o),"mtype",a)},arguments.callee.clogic_changeMinput=function(e){var i,a=t(e).closest(".uifm-conditional-row"),o=a.data("row-index"),s=t("#uifm-field-selected-id").val(),r=t("#"+s).closest(".uiform-step-pane").data("uifm-step"),n=a.find(".uifm_clogic_fieldsel").chosen().val(),c=a.find('.uifm_clogic_fieldsel [value="'+n+'"]').data("type");switch(parseInt(c)){case 8:case 9:case 10:case 11:case 40:case 41:case 42:i=a.find(".uifm_clogic_minput_1").chosen().val();break;case 16:case 18:i=a.find(".uifm_clogic_minput_2").val()}rocketform.setUiData7("steps_src",parseInt(r),s,"clogic","list",parseInt(o),"minput",i)},arguments.callee.clogic_deleteConditional=function(e){var i=t(e),o=t("#uifm-field-selected-id").val(),s=i.closest(".uifm-conditional-row").data("row-index"),r=t("#"+o).closest(".uiform-step-pane").data("uifm-step");i.closest(".uifm-conditional-row").remove(),rocketform.delUiData6("steps_src",parseInt(r),o,"clogic","list",parseInt(s));var n,c=a.steps_src[parseInt(r)][o].clogic.list,f=c.length;for(n=0;n1?rocketform.fieldQuickOptions_selectField_MoreThanOne():(rocketform.closeSettingTab(),t(document).find(".uifm-highlight-edited")&&t(document).find(".uifm-highlight-edited").removeClass("uifm-highlight-edited"))},arguments.callee.fieldQuickOptions_EditField=function(e){var i=t(e).closest(".zgpb-fields-quick-options2").parent();parseInt(t(".uiform-main-form .uiform-fields-qopt-select input:checked").length)>0&&t(".uiform-main-form .uiform-fields-qopt-select input:checked").prop("checked",!1),t(".uiform-main-form .uiform-fields-qopt-select input").closest(".uiform-fields-quick-options").removeCss("display"),rocketform.previewfield_hidePopOver(),rocketform.previewfield_helpblock_hidetooltip(),rocketform.fieldQuickOptions_loadFieldSelected(i)},arguments.callee.fields2_fieldQuickOptions_EditField=function(e,i){t("#zgpb-editor-container .zgpb-fl-gs-block-style-hover").removeClass("zgpb-fl-gs-block-style-hover");var a,o=t(e),s=o.closest(".zgpb-field-template").attr("data-typefield"),r=o.closest(".zgpb-field-template").attr("id"),n=[],c=[];switch(parseInt(s)){case 1:case 2:case 3:case 4:case 5:if(i)n.block=0;else{var f=o.closest(".zgpb-fl-gs-block-style").attr("data-zgpb-blocknum")||0;n.block=f}a=t("#"+r).closest(".uiform-step-pane").data("uifm-step"),rocketform.enableSettingTabOnPick(r,s),c.id=r,c.typefield=s,c.step_pane=a,c.addt=n,c.oncreation=!1,rocketform.loadFieldSettingTab(c);break;default:s=(o=t(e)).closest(".uiform-field").attr("data-typefield"),r=o.closest(".uiform-field").attr("id"),n=[],a=t("#"+r).closest(".uiform-step-pane").data("uifm-step"),rocketform.enableSettingTabOnPick(r,s),c.id=r,c.typefield=s,c.step_pane=a,c.addt=n,c.oncreation=!1,rocketform.loadFieldSettingTab(c),rocketform.setHighlightPicked(t("#"+r))}},arguments.callee.fields2_fieldQuickOptions_DuplicateField=function(e){rocketform.setInnerVariable("fields_load_settings",2);var i,a,o,s,r,n,c=t("#"+e),f=c.attr("data-typefield"),l=t(".uiform-step-content .uiform-step-pane:visible").data("uifm-step");if(i={},a=c.data("iscontainer")?c.data("iscontainer"):0,i.iscontainer=parseInt(a),i.num_tab=0,i.type=f,i.id=e,1===a)rocketform.setInnerVariable("fields_flag_stored",[]),o=c.find(".zgpb-field-template").length,i.count_children=parseInt(o),s=c.find(".zgpb-field-template")||null,parseInt(o)>0&&(r=[],t(s).each(function(e,i){n=t(this).attr("id")?t(this).attr("id"):0,r.push(n)}),i.children_str=r.join(",")),i.inner=rocketform.getLayoutFormByStep_checkChildren(e,s,f,c,l),rocketform.setInnerVariable("fields_duplication_stored",i),rocketform.fields2_fieldQuickOptions_Duplicate_process(c,f);else{var d=t(".uiform-enable-fieldset").find('a[data-type="'+f+'"]'),_=t(d).clone();_.insertAfter(c);rocketform.getFieldsAfterDraggable(_,f,!0,c.attr("id"))}setTimeout(function(){rocketform.setInnerVariable("fields_load_settings",1)},1e3)},arguments.callee.fields2_fieldQuickOptions_Duplicate_process=function(e,i){var a=rocketform.getInnerVariable("fields_duplication_stored"),o=t(".uiform-enable-fieldset").find('a[data-type="'+i+'"]').first(),s=t(o).clone();s.insertAfter(e);var r,n,c,f,l,d,_=t(".uiform-step-content .uiform-step-pane:visible").data("uifm-step"),m=rocketform.getFieldsAfterDraggable(s,i,!0,e.attr("id"));switch(rocketform.enableFieldPlugin(_,m,i,rocketform.getUiData3("steps_src",_,m)),parseInt(i)){case 1:case 2:case 3:case 4:case 5:d=setInterval(function(){t("#"+m).find(".sfdc-container-fluid").length&&(0!=parseInt(a.inner.length)&&t.each(a.inner,function(e,i){c=t("#"+m).find("> .sfdc-container-fluid .zgpb-fl-gs-block-style:eq("+e+")"),f=c.find("> .zgpb-fl-gs-block-inner"),l=t.map(i.children,function(t,e){return e}).length,parseInt(l)>0&&t.each(i.children,function(t,e){r=e.id,n=e.type,rocketform.fieldQuickOptions_Duplicate_checkChildren(n,r,f)})}),clearInterval(d),d=null)},1e3);break;case 31:d=setInterval(function(){t("#"+m).find("> .uiform-field-wrap").length&&(0!=parseInt(a.inner.length)&&t.each(a.inner,function(e,i){c=t("#"+m).find("> .uiform-field-wrap").find(".uifm-input31-main-wrap").first(),f=c.find("> .uiform-grid-inner-col"),l=t.map(i.children,function(t,e){return e}).length,parseInt(l)>0&&t.each(i.children,function(t,e){r=e.id,n=e.type,rocketform.fieldQuickOptions_Duplicate_checkChildren(n,r,f)})}),clearInterval(d),d=null)},1e3)}},arguments.callee.fieldQuickOptions_Duplicate_checkChildren=function(e,i,a){var o,s,r,n,c,f,l,d,_;n=rocketform.getInnerVariable("fun_dupli_cur_field"),s=t(".uiform-enable-fieldset").find('a[data-type="'+e+'"]'),r=t(s).clone(),a.append(r),o=rocketform.getFieldsAfterDraggable(r,e,!0,i);var m,p=t(".uiform-step-content .uiform-step-pane:visible").data("uifm-step");switch(rocketform.enableFieldPlugin(p,o,e,rocketform.getUiData3("steps_src",p,o)),parseInt(e)){case 1:case 2:case 3:case 4:case 5:m=setInterval(function(){t("#"+o).find(".sfdc-container-fluid").length&&(n.hasOwnProperty("inner")&&0!=parseInt(n.inner.length)&&t.each(n.inner,function(e,i){c=t("#"+o).find("> .sfdc-container-fluid .zgpb-fl-gs-block-style:eq("+e+")"),f=c.find("> .zgpb-fl-gs-block-inner"),l=t.map(i.children,function(t,e){return e}).length,parseInt(l)>0&&t.each(i.children,function(t,e){d=e.id,_=e.type,rocketform.setInnerVariable("fun_dupli_cur_field",e),rocketform.fieldQuickOptions_Duplicate_checkChildren(_,d,f)})}),clearInterval(m),m=null)},1e3)}},arguments.callee.fields2_fieldQuickOptions_deleteField=function(e){var i=t("#zgpb_fld_del_box_title").val(),a=t("#zgpb_fld_del_box_msg").val(),o=t("#zgpb_fld_del_box_bt1_title").val(),s=t("#zgpb_fld_del_box_bt2_title").val();bootbox.dialog({message:a,title:i,buttons:{fld_del_opt1:{label:o,className:"sfdc-btn-default",callback:function(){t("body").removeClass("sfdc-modal-open")}},fld_del_opt2:{label:s,className:"sfdc-btn-primary",callback:function(){rocketform.fields2_fieldsetting_deleteField(e),rocketform.formvariables_removeFromlist(e),rocketform.fieldsdata_email_genListToIntMem(),zgfm_back_helper.tooltip_removeall(),t("body").removeClass("sfdc-modal-open")}}}})},arguments.callee.fields2_fieldsetting_deleteField=function(e){var i=t("#"+e).closest(".uiform-step-pane").data("uifm-step");i=parseInt(i),rocketform.delUiData3("steps_src",i,e),rocketform.closeSettingTab();var o,s=a.steps_src[i],r=s.length;for(o=0;o"+t("#uifm_guidetour_popup_notfound").val()+"

    ")}},arguments.callee.input4settings_generateField=function(e,i){var a,o,s=e.attr("id"),r=t("#"+s).closest(".uiform-step-pane").data("uifm-step"),n=this.getUiData5("steps_src",r,s,i,"set_min"),c=this.getUiData5("steps_src",r,s,i,"set_max"),f=this.getUiData5("steps_src",r,s,i,"set_default"),l=this.getUiData5("steps_src",r,s,i,"set_step"),d=this.getUiData4("steps_src",r,s,"type"),_=this.getUiData4("steps_src",r,s,i),m=CryptoJS.MD5(JSON.stringify(_)),p=t("#"+s).find(".uifm-inp4-fld").attr("data-check-hash");switch(parseInt(d)){case 16:null==(a=t("#"+s).find(".uifm-inp4-fld")).data("bootstrapSlider")&&(0!=parseInt(t("#"+s).find(".slider").find(".uifm-inp4-fld").length)&&(o=a.detach(),t("#"+s).find(".uifm-input4-wrap").append(o),a=t("#"+s).find(".uifm-inp4-fld")),a.parent().find(".slider").remove(),a.bootstrapSlider({step:parseFloat(l),min:parseFloat(n),max:parseFloat(c),value:parseFloat(f)}));break;case 17:a=t("#"+s).find(".uifm-inp4-fld");var u=this.getUiData5("steps_src",r,s,i,"set_range1"),h=this.getUiData5("steps_src",r,s,i,"set_range2");null==a.data("bootstrapSlider")&&(0!=parseInt(t("#"+s).find(".slider").find(".uifm-inp4-fld").length)&&(o=a.detach(),t("#"+s).find(".uifm-input4-wrap").append(o),a=t("#"+s).find(".uifm-inp4-fld")),a.parent().find(".slider").remove(),a.bootstrapSlider({step:parseFloat(l),min:parseFloat(n),max:parseFloat(c),range:!0,value:[parseFloat(u),parseFloat(h)]}))}if(String(p)===String(m));else switch(t("#"+s).find(".uifm-inp4-fld").attr("data-check-hash",m),parseInt(d)){case 16:a.bootstrapSlider("setAttribute","step",parseFloat(l)),a.bootstrapSlider("setAttribute","min",parseFloat(n)),a.bootstrapSlider("setAttribute","max",parseFloat(c)),a.bootstrapSlider("setAttribute","value",parseFloat(f)),a.bootstrapSlider("refresh"),t("#"+s).find(".uifm-inp4-number").html(f);break;case 17:a.bootstrapSlider("setAttribute","step",parseFloat(l)),a.bootstrapSlider("setAttribute","min",parseFloat(n)),a.bootstrapSlider("setAttribute","max",parseFloat(c)),a.bootstrapSlider("setAttribute","value",[parseFloat(u),parseFloat(h)]),a.bootstrapSlider("setAttribute","range",!0),a.bootstrapSlider("refresh");break;case 18:(a=t("#"+s).find(".uifm-input4-wrap")).find(".uifm-inp4-fld").val(parseFloat(f)),0!=parseInt(a.find(".bootstrap-touchspin").length)?a.find(".uifm-inp4-fld").trigger("touchspin.updatesettings",{min:parseFloat(n),max:parseFloat(c),stepinterval:parseFloat(l),initval:parseFloat(f)}):a.find(".uifm-inp4-fld").TouchSpin({verticalbuttons:!0,min:parseFloat(n),max:parseFloat(c),stepinterval:parseFloat(l),verticalupclass:"sfdc-glyphicon sfdc-glyphicon-plus",verticaldownclass:"sfdc-glyphicon sfdc-glyphicon-minus",initval:parseFloat(f)});var b=this.getUiData5("steps_src",r,s,i,"skin_maxwidth_st"),g=this.getUiData5("steps_src",r,s,i,"skin_maxwidth");1===parseInt(b)?(a.css("max-width",g+"px"),a.css("width","100%")):a.removeCss("max-width")}},arguments.callee.backup_deleteStoredFile=function(e){var i=e.attr("data-uifm-file");rocketform.loading_panelbox2(1),t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"formbuilder/settings/ajax_backup_deletefile",data:{action:"uiform_fbuilder_setting_delbackupfile",page:"zgfm_cost_estimate",zgfm_security:uiform_vars.ajax_nonce,uifm_frm_delfile:i,csrf_field_name:uiform_vars.csrf_field_name},success:function(){rocketform.loading_panelbox2(0);var t=uiform_vars.url_admin+"formbuilder/settings/backup_settings";rocketform.redirect_tourl(t)}})},arguments.callee.backup_restoreBackup=function(e){var i=e.attr("data-uifm-file");rocketform.loading_panelbox2(1),t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"formbuilder/settings/ajax_backup_restorefile",data:{action:"uiform_fbuilder_setting_restorebkpfile",page:"zgfm_cost_estimate",zgfm_security:uiform_vars.ajax_nonce,uifm_frm_resfile:i,csrf_field_name:uiform_vars.csrf_field_name},success:function(){rocketform.loading_panelbox2(0);var e=t("#uifm_bkp_msg_success_restore").val();t("#uifm-backup-response").html(rocketform.alerts_global_msg(1,e))}})},arguments.callee.backup_PopUpRestore=function(e){var i=t("#uifm_bkp_restore_box_title").val(),a=t("#uifm_fld_del_box_msg").val(),o=t("#uifm_fld_del_box_bt1_title").val(),s=t("#uifm_fld_del_box_bt2_title").val();bootbox.dialog({message:a,title:i,buttons:{fld_del_opt1:{label:o,className:"sfdc-btn-default",callback:function(){t("body").removeClass("sfdc-modal-open")}},fld_del_opt2:{label:s,className:"sfdc-btn-primary",callback:function(){rocketform.backup_restoreBackup(t(e)),t("body").removeClass("sfdc-modal-open")}}}})},arguments.callee.showFeatureLocked=function(e){t("#uifm_modal_msg").sfdc_modal("show"),t("#uifm_modal_msg .sfdc-modal-title").html("Feature locked");var i;i=t(e).attr("data-blocked-feature"),t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"formbuilder/settings/ajax_blocked_getmessage",data:{action:"uiform_fbuilder_blocked_getmessage",page:"zgfm_cost_estimate",zgfm_security:uiform_vars.ajax_nonce,message:i,csrf_field_name:uiform_vars.csrf_field_name},success:function(e){t("#uifm_modal_msg .sfdc-modal-body").html(e.msg)}})},arguments.callee.backup_PopUpDelete=function(e){var i=t("#uifm_bkp_del_box_title").val(),a=t("#uifm_fld_del_box_msg").val(),o=t("#uifm_fld_del_box_bt1_title").val(),s=t("#uifm_fld_del_box_bt2_title").val();bootbox.dialog({message:a,title:i,buttons:{fld_del_opt1:{label:o,className:"sfdc-btn-default",callback:function(){t("body").removeClass("sfdc-modal-open")}},fld_del_opt2:{label:s,className:"sfdc-btn-primary",callback:function(){rocketform.backup_deleteStoredFile(t(e)),t("body").removeClass("sfdc-modal-open")}}}})},arguments.callee.previewform_refreshsummbox=function(){var e=t("#uifm-sticky-sidebar-box"),i=this.getUiData3("summbox","setting","enable_st"),a=(this.getUiData3("summbox","setting","resp_pos"),this.getUiData3("summbox","skin_box","box_sd_width")),o=this.getUiData3("summbox","setting","pos"),s=this.getUiData3("summbox","skin_text","text"),r=this.getUiData3("summbox","skin_text","color"),n=this.getUiData3("summbox","skin_text","font"),c=this.getUiData3("summbox","skin_text","font_st");if(1===parseInt(i)){var f;switch(e.show(),parseInt(o)){case 1:f="right";break;case 2:f="left";break;case 3:f="bottom";break;case 4:f="topout";break;case 5:f="bottomout";break;case 0:default:f="top"}e.data("uiform_stickybox")?(e.data("uiform_stickybox").updateData({enable:0,orientation:f,form_container:t(".uiform-main-form"),main_container:t(".uiform-preview-base"),sticky:{width:a,height:"200"},resp_orientation:1,backend:1}),e.data("uiform_stickybox").init()):e.uiform_stickybox({enable:0,orientation:f,form_container:t(".uiform-main-form"),main_container:t(".uiform-preview-base"),sticky:{width:a,height:"200"},resp_orientation:1,backend:1});var l=decodeURIComponent(s);if(l=rocketform.pricesettings_processFormats(l),t("#uifm-sticky-sidebar-box-content").html(l),t("#uifm-sticky-sidebar-box-content").css({color:r}),1===parseInt(c)&&n){var d=JSON.parse(n);t("#uifm-sticky-sidebar-box-content").css("font-family",d.family)}else t("#uifm-sticky-sidebar-box-content").removeCss("font-family")}else e.hide(),t(".uiform-main-form").removeCss("width"),rocketform.previewform_skin_maxwidth();rocketform.guidedtour_showTextOnPreviewPane_recalc()},arguments.callee.pricesettings_processFormats=function(t){return t=rocketform.strings_replace_all(t,{"\\[uifm_symbol]":"$","\\[uifm_total]":"##","\\[uifm_price]":"##","\\[uifm_summary (.+?)]":" here goes summary content","\\[uifm_summary_link (.+?)]":'Show summary ',"\\[uifm_currency]":"USD"})},arguments.callee.strings_replace_all=function(e,i){var a,o=Object.keys(i);return t.each(o,function(t,o){a=new RegExp(o,"g"),e=e.replace(a,function(t){return i[o]})}),e},arguments.callee.testing_summbox=function(){},arguments.callee.backup_create=function(){rocketform.loading_panelbox2(1),t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"formbuilder/settings/ajax_backup_create",data:{action:"uiform_fbuilder_setting_backup",page:"zgfm_cost_estimate",zgfm_security:uiform_vars.ajax_nonce,uifm_frm_namebackup:t("#_uifm_backup_namebkp").val(),csrf_field_name:uiform_vars.csrf_field_name},success:function(){rocketform.loading_panelbox2(0),t("#_uifm_backup_namebkp").val("");var e=uiform_vars.url_admin+"formbuilder/settings/backup_settings";rocketform.redirect_tourl(e)},error:function(t,e,i){}})},arguments.callee.migrateToVersion3=function(){rocketform.loading_panelbox2(1),t.each(a.steps_src,function(e,i){t.isPlainObject(i)&&t.each(i,function(t,i){switch(parseInt(a.steps_src[e][t].type)){case 1:case 2:case 3:case 4:case 5:delete a.steps_src[e][t].skin;break;default:delete a.steps_src[e][t].skin}})}),this.migrateToVersion3_process()},arguments.callee.migrateToVersion3_process=function(){var e=a;t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"formbuilder/forms/ajax_refresh_previewpanel",data:{action:"rocket_fbuilder_refreshpreviewpanel",page:"zgfm_cost_estimate",zgfm_security:uiform_vars.ajax_nonce,uifm_frm_main_title:t("#uifm_frm_main_title").val(),uifm_frm_main_id:t("#uifm_frm_main_id").val(),form_data:encodeURIComponent(JSON.stringify(e)),csrf_field_name:uiform_vars.csrf_field_name},success:function(e){e.data.fmb_html_backend=decodeURIComponent(e.data.fmb_html_backend);var i,o,s,r={main:e.data.fmb_data.main,skin:e.data.fmb_data.skin,wizard:e.data.fmb_data.wizard,onsubm:e.data.fmb_data.onsubm,num_tabs:e.data.fmb_data.num_tabs,steps:e.data.fmb_data.steps,steps_src:e.data.fmb_data.steps_src};a=t.extend(!0,{},a,r),t(".uiform-preview-base").html(e.data.fmb_html_backend),t.each(a.steps_src,function(e,r){t.isPlainObject(r)&&t.each(r,function(r,n){switch(parseInt(a.steps_src[e][r].type)){case 1:case 2:case 3:case 4:case 5:switch(s=a.steps_src[e][r],i=a.steps_src[e][r].id,t("#"+i).zgpbld_gridsystem(),(o=t("#"+i).data("zgpbld_gridsystem")).setToDatalvl1("id",i),parseInt(a.steps_src[e][r].type)){case 1:o.setToDatalvl1("type",1),o.setToDatalvl1("type_n","grid1");break;case 2:o.setToDatalvl1("type",2),o.setToDatalvl1("type_n","grid2");break;case 3:o.setToDatalvl1("type",3),o.setToDatalvl1("type_n","grid3");break;case 4:o.setToDatalvl1("type",4),o.setToDatalvl1("type_n","grid4");break;case 5:o.setToDatalvl1("type",5),o.setToDatalvl1("type_n","grid6")}o.createBlockAttributes(),o.update_settingsData(s),o.setStep(e),o.updateVarData(i),o.setDataToCoreStore(e,i)}})}),e.data.fmb_data.steps_src=a.steps_src,rocketform.loadFormToEditPanel(e),rocketform.wizardform_refresh(),rocketform.loading_panelbox2(0)}})},arguments.callee.regenerateform=function(){rocketform.loading_panelbox2(1),this.refreshPreviewSection_process()},arguments.callee.refreshPreviewSection_process=function(){var e=a;t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"formbuilder/forms/ajax_refresh_previewpanel",data:{action:"rocket_fbuilder_refreshpreviewpanel",page:"zgfm_cost_estimate",zgfm_security:uiform_vars.ajax_nonce,uifm_frm_main_title:t("#uifm_frm_main_title").val(),uifm_frm_main_id:t("#uifm_frm_main_id").val(),form_data:encodeURIComponent(JSON.stringify(e)),csrf_field_name:uiform_vars.csrf_field_name},success:function(e){e.data.fmb_html_backend=decodeURIComponent(e.data.fmb_html_backend),rocketform.loadFormToEditPanel(e),rocketform.wizardform_refresh(),0!=parseInt(t.map(a.steps_src,function(t,e){return e}).length)&&t.each(a.steps_src,function(e,i){t.each(i,function(t,i){switch(parseInt(i.type)){case 1:case 2:case 3:case 4:case 5:break;case 8:case 9:case 10:case 11:var a=rocketform.getUiData5("steps_src",parseInt(e),i.id,"input2","options");for(var o in rocketform.setUiData5("steps_src",parseInt(e),i.id,"input2","options",{}),a)rocketform.addIndexUiData5("steps_src",parseInt(e),i.id,"input2","options",String(o)),rocketform.setUiData6("steps_src",parseInt(e),i.id,"input2","options",String(o),{value:a[o].value,label:a[o].label,checked:a[o].checked,price:a[o].price,order:a[o].order,id:a[o].id})}})}),rocketform.loading_panelbox2(0)}})},arguments.callee.refreshPreviewSection=function(){(rocketform.loading_panelbox2(1),rocketform.saveform_cleanForm(),t(document).find(".uifm-highlight-edited")&&t(document).find(".uifm-highlight-edited").removeClass("uifm-highlight-edited"),t(".uiform-main-form .uiform-fields-qopt-select input:checked").prop("checked",!1),t(".uiform-main-form .uiform-fields-qopt-select input:checked").closest(".uiform-fields-quick-options").removeCss("display"),this.closeSettingTab(),this.saveTabContent(),0!=parseInt(t(".uiform-main-form").find(".uifm-input-ratingstar").length))&&t(".uiform-main-form").find(".uifm-input-ratingstar").each(function(e){t(this).rating("destroy")});0!=parseInt(t(".uiform-main-form").find(".uifm-input-ratingstar").length)&&t(".uiform-main-form").find(".uifm-input-ratingstar").each(function(e){rocketform.input9settings_updateField(t(this).closest(".uiform-field"),"input9")}),this.refreshPreviewSection_process(),t(".sfdc-tooltip").hide()},arguments.callee.refreshPreviewSectionFromData=function(){rocketform.loading_panelbox2(1),t(document).find(".uifm-highlight-edited")&&t(document).find(".uifm-highlight-edited").removeClass("uifm-highlight-edited"),t(".uiform-main-form .uiform-fields-qopt-select input:checked").prop("checked",!1),t(".uiform-main-form .uiform-fields-qopt-select input:checked").closest(".uiform-fields-quick-options").removeCss("display"),this.closeSettingTab(),rocketform.showLoader(2,!0,!0);var e,i={},a=this.getUiData("steps_src");(t.each(a,function(t,a){(e={}).content=rocketform.getLayoutFormByStep(t),i[t]=e}),this.setUiData2("steps","tab_cont",i),0!=parseInt(t(".uiform-main-form").find(".uifm-input-ratingstar").length))&&t(".uiform-main-form").find(".uifm-input-ratingstar").each(function(e){t(this).rating("destroy")});0!=parseInt(t(".uiform-main-form").find(".uifm-input-ratingstar").length)&&t(".uiform-main-form").find(".uifm-input-ratingstar").each(function(e){rocketform.input9settings_updateField(t(this).closest(".uiform-field"),"input9")}),this.refreshPreviewSection_process(),t(".sfdc-tooltip").hide()},arguments.callee.gateway_saveoffline=function(){t("#uiform-form-editgateway").validate({errorClass:"help-inline",errorElement:"span",rules:{pg_name:{required:!0}},messages:{pg_name:{required:"Please specify a name"}},highlight:function(e){t(e).closest(".control-group").addClass("error").removeClass("success")},success:function(e){t(e).text("").closest(".control-group").addClass("success")},submitHandler:function(e){var i=t(e).serialize();t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"gateways/settings/ajax_save_options",data:i+"&action=rocket_fbuilder_setting_saveGateway&page=zgfm_cost_estimate&csrf_field_name="+uiform_vars.csrf_field_name,beforeSend:function(){rocketform.showLoader(3,!0,!0)},success:function(t){rocketform.hideLoader(),rocketform.gateway_gotoList()}})}}),t("#uiform-form-editgateway").submit()},arguments.callee.gateway_savepaypal=function(){t("#uiform-form-editgateway").validate({errorClass:"help-inline",errorElement:"span",rules:{pg_name:{required:!0},paypal_email:{required:!0,email:!0}},messages:{pg_name:{required:"Please specify a name"},paypal_email:{required:"We need a valid email address"}},highlight:function(e){t(e).closest(".control-group").addClass("error").removeClass("success")},success:function(e){t(e).text("").closest(".control-group").addClass("success")},submitHandler:function(e){var i=t(e).serialize();t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"gateways/settings/ajax_save_options",data:i+"&action=rocket_fbuilder_setting_saveGateway&page=zgfm_cost_estimate&csrf_field_name="+uiform_vars.csrf_field_name,beforeSend:function(){rocketform.showLoader(3,!0,!0)},success:function(t){rocketform.hideLoader(),rocketform.gateway_gotoList()}})}}),t("#uiform-form-editgateway").submit()},arguments.callee.gateway_gotoList=function(){var t=rockfm_vars.uifm_siteurl+"gateways/settings/view_settings";rocketform.redirect_tourl(t)},arguments.callee.form_getcode=function(e){t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"formbuilder/forms/getcode/",data:{action:"rocket_fbuilder_modal_form_getshorcodes",page:"zgfm_cost_estimate",zgfm_security:uiform_vars.ajax_nonce,form_id:e,csrf_field_name:uiform_vars.csrf_field_name},beforeSend:function(){t("#uifm_modal_msg .sfdc-modal-body").html(' ')},success:function(e){var i=JSON&&JSON.parse(e)||t.parseJSON(e);t("#uifm_modal_msg").sfdc_modal("show"),t("#uifm_modal_msg .sfdc-modal-title").html(i.html_title),t("#uifm_modal_msg .sfdc-modal-body").html(i.html)}})},arguments.callee.modal_close=function(){t("#modaltemplate").sfdc_modal("hide")},arguments.callee.formvariables_genListToIntMem=function(){rocketform.formvariables_generateTable()},arguments.callee.formvariables_addTolist=function(e){var i;i=this.getInnerVariable("form_rec_vars"),-1==t.inArray(e,i)&&i.push(e),this.setInnerVariable("form_rec_vars",i),rocketform.formvariables_generateTable()},arguments.callee.formvariables_removeFromlist=function(e){var i;i=this.getInnerVariable("form_rec_vars");var a=e;i=t.grep(i,function(t){return t!=a}),this.setInnerVariable("form_rec_vars",i),rocketform.formvariables_generateTable()},arguments.callee.formvariables_generateTable=function(){var e=t("#uifm_frm_main_id").val(),i=a;t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"formbuilder/forms/ajax_variables_emailpage",data:{action:"rocket_fbuilder_variables_emailpage",page:"zgfm_cost_estimate",zgfm_security:uiform_vars.ajax_nonce,form_id:e,form_data:encodeURIComponent(JSON.stringify(i)),csrf_field_name:uiform_vars.csrf_field_name},success:function(e){t("#uiform-form-mailset-vars-tab-1 .uifm-tab-inner-vars-1").html(e.message)}})},arguments.callee.formvariables_findFieldName=function(t){var e="";t:for(var i in a.steps_src)for(var o in a.steps_src[i])if(String(a.steps_src[i][o].id)===String(t)){e=a.steps_src[i][o].field_name;break t}return e},arguments.callee.formvariables_findFieldType=function(t){var e="";t:for(var i in a.steps_src)for(var o in a.steps_src[i])if(String(a.steps_src[i][o].id)===String(t)){e=a.steps_src[i][o].type;break t}return e},arguments.callee.fieldsdata_email_genListToIntMem=function(){rocketform.setInnerVariable("form_vars_fields_emailval",[]),0!=parseInt(t.map(a.steps_src,function(t,e){return e}).length)&&t.each(a.steps_src,function(e,i){t.each(i,function(e,i){if(0!=parseInt(t("#"+e).length))switch(parseInt(i.type)){case 6:case 28:case 29:case 30:4===parseInt(i.validate.typ_val)&&rocketform.fieldsdata_email_addTolist(i.id)}})}),rocketform.customeremail_generateHtml(),rocketform.adminemail_generateHtml()},arguments.callee.fieldsdata_email_addTolist=function(e){var i;i=this.getInnerVariable("form_vars_fields_emailval"),-1==t.inArray(e,i)&&i.push(e),this.setInnerVariable("form_vars_fields_emailval",i)},arguments.callee.customeremail_generateHtml=function(){t("#uifm_frm_email_usr_recipient").html(""),t("#uifm_frm_email_usr_recipient").append('");var e=this.getInnerVariable("form_vars_fields_emailval");t.each(e,function(e,i){t("#uifm_frm_email_usr_recipient").append('")});var i=rocketform.getUiData2("onsubm","mail_usr_recipient");parseInt(t("#uifm_frm_email_usr_recipient option[value='"+i+"']").length)>0?t("#uifm_frm_email_usr_recipient").val(i):(t("#uifm_frm_email_usr_recipient").val(""),rocketform.setUiData2("onsubm","mail_usr_recipient",""))},arguments.callee.adminemail_generateHtml=function(){t("#uifm_frm_email_replyto").html(""),t("#uifm_frm_email_replyto").append('");var e=this.getInnerVariable("form_vars_fields_emailval");t.each(e,function(e,i){t("#uifm_frm_email_replyto").append('")});var i=rocketform.getUiData2("onsubm","mail_replyto");parseInt(t("#uifm_frm_email_replyto option[value='"+i+"']").length)>0?t("#uifm_frm_email_replyto").val(i):(t("#uifm_frm_email_replyto").val(""),rocketform.setUiData2("onsubm","mail_replyto",""))},arguments.callee.invoiceoptions_genListToIntMem=function(){rocketform.setInnerVariable("form_vars_invoice_optto",[]),0!=parseInt(t.map(a.steps_src,function(t,e){return e}).length)&&t.each(a.steps_src,function(e,i){t.each(i,function(e,i){if(0!=parseInt(t("#"+e).length))switch(parseInt(i.type)){case 6:case 7:case 28:case 29:case 30:rocketform.invoiceoptions_addTolist(i.id)}})}),rocketform.invoiceoptions_generateHtml()},arguments.callee.invoiceoptions_addTolist=function(e){var i;i=this.getInnerVariable("form_vars_invoice_optto"),-1==t.inArray(e,i)&&i.push(e),this.setInnerVariable("form_vars_invoice_optto",i)},arguments.callee.invoiceoptions_generateHtml=function(){var e,i;t.each([1,2,3,4],function(a,o){t("#uifm_frm_inv_to_text"+o).html(""),t("#uifm_frm_inv_to_text"+o).append('"),e=rocketform.getInnerVariable("form_vars_invoice_optto"),t.each(e,function(e,i){t("#uifm_frm_inv_to_text"+o).append('")}),i=rocketform.getUiData2("invoice","to_text"+o),parseInt(t("#uifm_frm_inv_to_text"+o+" option[value='"+i+"']").length)>0?t("#uifm_frm_inv_to_text"+o).val(i):(t("#uifm_frm_inv_to_text"+o).val(""),rocketform.setUiData2("invoice","to_text"+o,""))})},arguments.callee.clogicgraph_popup=function(){t("#uiform-clogicgraph").dialog("open"),t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"formbuilder/forms/ajax_preview_clogic_graph",data:{action:"rocket_fbuilder_preview_clogic_graph",page:"zgfm_cost_estimate",zgfm_security:uiform_vars.ajax_nonce,form_data:encodeURIComponent(JSON.stringify(a)),csrf_field_name:uiform_vars.csrf_field_name},beforeSend:function(){t("#uiform-clogicgraph").html(' ')},success:function(e){var i=JSON&&JSON.parse(e)||t.parseJSON(e);t("#uiform-clogicgraph").html(i.html)}})},arguments.callee.loadFieldSettingTab=function(e){try{var i,a=e.id,o=e.typefield,s=(e.step_pane,e.addt);e.oncreation;switch(rocketform.loading_boxField("zgfm-panel-right-field-tabopt",1),t("#uiform-build-field-tab").addClass("zgfm-fieldtab-flag-loading"),parseInt(o)){case 1:case 2:case 3:case 4:case 5:i=s?s.block:0;break;default:i=0}var r=uiform_vars.fields_fastload;if(1!==parseInt(r)){var n;switch(parseInt(o)){case 1:case 2:case 3:case 4:case 5:case 8:case 9:case 10:case 11:n=wp.template("zgfm-field-opt-type-"+o);break;default:case 6:n=wp.template("zgfm-field-opt-type-6")}let s,r=t("
    ").html(n({site_url:rockfm_vars.uifm_baseurl})).text();s=0===parseInt(uiform_vars.app_is_lite)?{modal_body:r,field_id:a,field_type:o,field_block:i,addons:["func_anim"]}:{modal_body:r,field_id:a,field_type:o,field_block:i,addons:[]},zgfm_back_fld_options.load_on_selecteField(e,s)}else t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"formbuilder/fields/ajax_field_option",data:{action:"rocket_fbuilder_field_options",page:"zgfm_cost_estimate",csrf_field_name:uiform_vars.csrf_field_name,zgfm_security:uiform_vars.ajax_nonce,field_id:a,field_type:o,field_block:i},success:function(t){zgfm_back_fld_options.load_on_selecteField(e,t)}})}catch(t){}},arguments.callee.tinymceEvent_removeInst=function(){var e;t("#uiform-build-field-tab").find("#uifm_fld_msc_text")&&"undefined"!=typeof tinyMCE&&(e=tinyMCE.get("uifm_fld_msc_text"))&&e.remove(),t("#uiform-build-field-tab").find("#uifm_fld_price_lbl_format")&&"undefined"!=typeof tinyMCE&&(e=tinyMCE.get("uifm_fld_price_lbl_format"))&&e.remove(),t("#uiform-build-field-tab").find("#uifm_fld_inp3_html")&&"undefined"!=typeof tinyMCE&&(e=tinyMCE.get("uifm_fld_inp3_html"))&&e.remove(),t("#uiform-build-field-tab").find("#uifm_frm_inp18_txt_cont")&&"undefined"!=typeof tinyMCE&&(e=tinyMCE.get("uifm_frm_inp18_txt_cont"))&&e.remove()},arguments.callee.tinymceEvent_init=function(){},arguments.callee.checkIntegrityTinyMCE=function(t){var e=!1;try{return"undefined"!=typeof tinyMCE&&tinyMCE.activeEditor&&!tinyMCE.activeEditor.isHidden()&&(e=!0),e}catch(t){return!1}},arguments.callee.fields_events_bswitch=function(e){try{t(".switch-field").bootstrapSwitchZgpb(),t("#zgpb-editor-container .uifm-inp15-fld").bootstrapSwitchZgpb(),t("#uiform-build-field-tab .switch-field").on("switchChange.bootstrapSwitchZgpb",function(e,i){var a,o=t("#uifm-field-selected-id").val(),s=t(this).data("field-store"),r=s.split("-"),n=(r[0],r[1],i?1:0),c=t(".uiform-main-form .uiform-fields-qopt-select input:checked");if(parseInt(c.length)>1)f=c.closest(".uiform-field"),t.each(f,function(e,i){o=t(this).attr("id"),a=t("#"+o).closest(".uiform-step-pane").data("uifm-step"),rocketform.setDataOptToCoreData(a,o,s,n),t(this)&&rocketform.setDataOptToPrevField(t(this),s,n)});else{a=t("#"+o).closest(".uiform-step-pane").data("uifm-step"),rocketform.setDataOptToCoreData(a,o,s,n);var f=t("#"+o);f&&rocketform.setDataOptToPrevField(f,s,n)}})}catch(t){}},arguments.callee.fields_events_spinner=function(e){try{t(".uifm_fld_inp4_spinner").TouchSpin({verticalbuttons:!0,min:-1e9,max:1e9,decimals:3,step:.001,verticalupclass:"sfdc-glyphicon sfdc-glyphicon-plus",verticaldownclass:"sfdc-glyphicon sfdc-glyphicon-minus"}),t(".uifm_fld_inp6_spinner").TouchSpin({verticalbuttons:!0,min:0,max:5,stepinterval:1,verticalupclass:"sfdc-glyphicon sfdc-glyphicon-plus",verticaldownclass:"sfdc-glyphicon sfdc-glyphicon-minus"}),t(".uifm_fld_inp2_stl1").TouchSpin({verticalbuttons:!0,min:0,max:100,stepinterval:1,verticalupclass:"sfdc-glyphicon sfdc-glyphicon-plus",verticaldownclass:"sfdc-glyphicon sfdc-glyphicon-minus"}),t(".uifm_fld_input16_spinner").TouchSpin({verticalbuttons:!0,min:0,max:200,stepinterval:1,verticalupclass:"sfdc-glyphicon sfdc-glyphicon-plus",verticaldownclass:"sfdc-glyphicon sfdc-glyphicon-minus"}),t(".uifm_fld_inp17_thopt_spinner").TouchSpin({verticalbuttons:!0,min:35,max:1e3,stepinterval:1,verticalupclass:"sfdc-glyphicon sfdc-glyphicon-plus",verticaldownclass:"sfdc-glyphicon sfdc-glyphicon-minus"}),t(".uifm_fld_inp17_thopt_spinner_2").TouchSpin({verticalbuttons:!0,min:50,max:1e3,stepinterval:1,verticalupclass:"sfdc-glyphicon sfdc-glyphicon-plus",verticaldownclass:"sfdc-glyphicon sfdc-glyphicon-minus"}),t(".uifm_fld_inp4_spinner,.uifm_fld_inp6_spinner,.uifm_fld_inp4_spinner,.uifm_fld_input16_spinner,.uifm_fld_inp2_stl1").on("change",function(e){var i=t("#uifm-field-selected-id").val(),a=t(e.target).data("field-store"),o=a.split("-"),s=(o[0],o[1],t(e.target).val()),r=t("#"+i).closest(".uiform-step-pane").data("uifm-step");rocketform.setDataOptToCoreData(r,i,a,s);var n=t("#"+i);n&&rocketform.setDataOptToPrevField(n,a,s)})}catch(t){}},arguments.callee.fields_events_general=function(i){try{var a;t("#uiform-build-field-tab .uifm_tinymce_obj").html(""),tinymce.init({selector:".uifm_tinymce_obj",theme:"modern",menubar:!1,height:200,plugins:["advlist autolink lists link image charmap print preview anchor","searchreplace visualblocks code fullscreen","insertdatetime media contextmenu paste code"],relative_urls:!1,remove_script_host:!1,convert_urls:!0,browser_spellcheck:!0,codemirror:{indentOnInit:!0,path:"CodeMirror"},image_advtab:!0,toolbar1:"undo redo | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | styleselect",toolbar2:"| image | media | link unlink anchor | forecolor backcolor | print preview code | youtube | qrcode | flickr | picasa ",file_browser_callback:elFinderBrowser,setup:function(t){t.on("change KeyUp",function(e){rocketform.captureEventTinyMCE(t,e)})}}),uiformRefreshFontMenu(),jQuery("#uiform-build-field-tab select.sfm").chosen().change(function(){var e,i=jQuery(this).data("stylesFontMenu").uifm_preview_font_change(),a=t("#uifm-field-selected-id").val(),o=t(this).data("field-store"),s=o.split("-"),r=(s[0],s[1],JSON.stringify(i)),n=t(".uiform-main-form .uiform-fields-qopt-select input:checked");if(parseInt(n.length)>1)r&&(c=n.closest(".uiform-field"),t.each(c,function(i,s){a=t(this).attr("id"),e=t("#"+a).closest(".uiform-step-pane").data("uifm-step"),rocketform.setDataOptToCoreData(e,a,o,r),t(this)&&rocketform.setDataOptToPrevField(t(this),o,r)}));else{e=t("#"+a).closest(".uiform-step-pane").data("uifm-step"),rocketform.setDataOptToCoreData(e,a,o,r);var c=t("#"+a);c&&rocketform.setDataOptToPrevField(c,o,i.family)}}),t("#uiform-build-field-tab select.sfm").change(function(){}),t('button[role="iconpicker"],div[role="iconpicker"]').iconpicker(),t(document).on("change keyup focus keypress","#uifm_fld_main_fldname",function(e){var i=t("#uifm_fld_main_fldname").val(),a=t("#uifm-field-selected-id").val(),o=t("#"+a).closest(".uiform-step-pane").data("uifm-step");rocketform.fieldsetting_updateName(o,a,i)}),t("#uifm_fld_main_fldname").blur(function(){rocketform.formvariables_generateTable(),rocketform.customeremail_generateHtml();let t=uiform_vars.addon;var i,a;for(var o in t)if("fieldName_onBlur"===String(o))for(var s in t[o])for(var r in t[o][s])a=t[o][s][r].controller,i=t[o][s][r].function,e[a][i]()}),t(".uifm-fld-val-opts .sfdc-btn-group > .sfdc-btn[data-settings-option='group-checkboxes']").click(function(){var e,i,a=t(this),o=a.parent().parent(),s=t("#uifm-field-selected-id").val(),r=t(this).data("field-store"),n=r.split("-"),c=(n[0],n[1],t("#"+s).closest(".uiform-step-pane").data("uifm-step"));a.hasClass("sfdc-active")?(a.removeClass("sfdc-active"),e=a.data("field-select-box"),t("."+e).hide(),i=0):(t(".uifm-custom-validator").hide(),o.find(".uifm-f-setoption-gchecks").not(a).removeClass("sfdc-active"),a.addClass("sfdc-active"),e=a.data("field-select-box"),t("."+e).show(),i=parseInt(t(this).data("field-value"))),rocketform.setDataOptToCoreData(c,s,r,i);var f=t("#"+s);f&&rocketform.setDataOptToPrevField(f,r,i)}),t(".sfdc-btn-group > .sfdc-btn[data-settings-option='group-radiobutton']").click(function(e){var i=t(this);i.parent().children(".sfdc-btn[data-toggle-enable]").removeClass(function(){return"sfdc-active"}).addClass(function(){return""}).children("input").prop("checked",!1),i.addClass("sfdc-active"),i.children("input").prop("checked",!0)}),t(document).on("keyup focus","#uifm_fld_msc_text,#uifm_fld_inp3_html,#uifm_fld_price_lbl_format,#uifm_frm_inp18_txt_cont",function(t){rocketform.captureEventTinyMCE2(t)}),t(document).on("click",".uifm-f-setoption-btn",function(e){e&&(e.stopPropagation(),e.preventDefault());var i,a=t("#uifm-field-selected-id").val(),o=t(this).data("field-store"),s=o.split("-"),r=(s[0],s[1],t(this).find("input").val()),n=t(".uiform-main-form .uiform-fields-qopt-select input:checked");if(parseInt(n.length)>1)c=n.closest(".uiform-field"),t.each(c,function(e,s){a=t(this).attr("id"),i=t("#"+a).closest(".uiform-step-pane").data("uifm-step"),rocketform.setDataOptToCoreData(i,a,o,r),t(this)&&rocketform.setDataOptToPrevField(t(this),o,r)});else{i=t("#"+a).closest(".uiform-step-pane").data("uifm-step"),rocketform.setDataOptToCoreData(i,a,o,r);var c=t("#"+a);c&&rocketform.setDataOptToPrevField(c,o,r)}}),t(document).on("change","#uiform-build-field-tab .uifm-f-setoption-st",function(e){e&&(e.stopPropagation(),e.preventDefault());var i,a=t(".uiform-main-form .uiform-fields-qopt-select input:checked"),o=t("#uifm-field-selected-id").val(),s=t(this).data("field-store"),r=s.split("-"),n=(r[0],r[1],t(this).is(":checked"));if(n=n?1:0,parseInt(a.length)>1)c=a.closest(".uiform-field"),t.each(c,function(e,a){o=t(this).attr("id"),i=t("#"+o).closest(".uiform-step-pane").data("uifm-step"),rocketform.setDataOptToCoreData(i,o,s,n),t(this)&&rocketform.setDataOptToPrevField(t(this),s,n)});else{i=t("#"+o).closest(".uiform-step-pane").data("uifm-step"),rocketform.setDataOptToCoreData(i,o,s,n);var c=t("#"+o);c&&rocketform.setDataOptToPrevField(c,s,n)}}),t(document).on("change keyup",".uifm-f-setoption",function(e){e&&(e.stopPropagation(),e.preventDefault());var i,a=t("#uifm-field-selected-id").val(),o=t(this).data("field-store"),s=o.split("-"),r=(s[0],s[1],t(this).val()),n=t(".uiform-main-form .uiform-fields-qopt-select input:checked");if(parseInt(n.length)>1)c=n.closest(".uiform-field"),t.each(c,function(e,s){a=t(this).attr("id"),i=t("#"+a).closest(".uiform-step-pane").data("uifm-step"),rocketform.setDataOptToCoreData(i,a,o,r),t(this)&&rocketform.setDataOptToPrevField(t(this),o,r)});else{i=t("#"+a).closest(".uiform-step-pane").data("uifm-step"),rocketform.setDataOptToCoreData(i,a,o,r);var c=t("#"+a);c&&rocketform.setDataOptToPrevField(c,o,r)}}),t("#uifm_fld_inp2_style_type").on("change",function(e){var i=t(e.target).val();switch(parseInt(i)){case 1:t(".uifm-set-section-input2-stl1").show();break;default:t(".uifm-set-section-input2-stl1").hide()}}),t(document).on("change keyup",".uifm-f-setoption-font",function(e){e&&(e.stopPropagation(),e.preventDefault());var i,a=t("#uifm-field-selected-id").val(),o=t(this).parent().find("select").data("field-store"),s=o.split("-"),r=(s[0],s[1],t(this).val()),n=t(".uiform-main-form .uiform-fields-qopt-select input:checked");if(parseInt(n.length)>1)c=n.closest(".uiform-field"),t.each(c,function(e,s){a=t(this).attr("id"),i=t("#"+a).closest(".uiform-step-pane").data("uifm-step"),rocketform.setDataOptToCoreData(i,a,o,r),t(this)&&rocketform.setDataOptToPrevField(t(this),o,r)});else{i=t("#"+a).closest(".uiform-step-pane").data("uifm-step"),rocketform.setDataOptToCoreData(i,a,o,r);var c=t("#"+a);c&&rocketform.setDataOptToPrevField(c,o,r)}}),t(".sfdc-input-group-btn > .sfdc-btn").click(function(){var e=t(this),i=e.find("input");0===parseInt(i.val())?(e.addClass("sfdc-active"),i.val(1)):(e.removeClass("sfdc-active"),i.val(0))}),t("#uifm_fld_elbg_type_1").on("click",function(){t("#uifm_fld_elbg_color_1").closest(".sfdc-row").show(),t("#uifm_fld_elbg_color_2").closest(".sfdc-row").hide(),t("#uifm_fld_elbg_color_3").closest(".sfdc-row").hide()}),t("#uifm_fld_elbg_type_2").on("click",function(){t("#uifm_fld_elbg_color_1").closest(".sfdc-row").hide(),t("#uifm_fld_elbg_color_2").closest(".sfdc-row").show(),t("#uifm_fld_elbg_color_3").closest(".sfdc-row").show()}),t("#uifm_fld_val_reqicon_img,#uifm_fld_inp2_stl1_icmark").on("change",function(e){e&&(e.stopPropagation(),e.preventDefault());var i=t("#uifm-field-selected-id").val(),a=t(this).data("field-store"),o=a.split("-"),s=(o[0],o[1],e.icon),r=t("#"+i).closest(".uiform-step-pane").data("uifm-step");rocketform.setDataOptToCoreData(r,i,a,s);var n=t("#"+i);n&&rocketform.setDataOptToPrevField(n,a,s)}),t("#uifm_frm_clogic_st").on("switchChange.bootstrapSwitchZgpb",function(e,i){1===(i?1:0)?t("#uifm-show-conditional-logic").show():t("#uifm-show-conditional-logic").hide()}),t('[data-toggle="tooltip"]').tooltip({container:"body"}),t(".uiform-set-options-tabs ul.sfdc-nav-tabs").on("shown.bs.sfdc-tab",function(e){a=t(e.target).data("uifm-title"),rocketform.setInnerVariable("setfield_tab_active",a),rocketform.previewfield_hidePopOver(),rocketform.previewfield_helpblock_hidetooltip()}),t('.uiformc-menu-wrap ul.sfdc-nav-tabs a[data-toggle="sfdc-tab"],.uiform-set-options-tabs ul.sfdc-nav-tabs a[data-toggle="sfdc-tab"]').on("shown.bs.sfdc-tab",function(e){t(e.target).hasClass("uifm-tab-fld-validation")||t(".sfdc-popover").sfdc_popover("hide")}),t('.uiformc-menu-wrap ul.sfdc-nav-tabs a[data-toggle="sfdc-tab"],.uiform-set-options-tabs ul.sfdc-nav-tabs a[data-toggle="sfdc-tab"]').on("shown.bs.sfdc-tab",function(e){if(a=t(e.target).data("uifm-title"),rocketform.setInnerVariable("setfield_tab_active",a),"helpb"===String(a)){var i=t("#uifm-field-selected-id").val();rocketform.previewfield_elementTextarea(t("#"+i),"help_block")}else zgfm_back_helper.tooltip_removeall()}),t(".uifm_field_font_selectpicker").selectpicker({style:"btn-info",size:4})}catch(t){}},arguments.callee.fields2_events_cpicker=function(e){e.find(".zgpb-custom-color").data("colorpicker")||(e.find(".zgpb-custom-color").colorpicker(),e.find(".zgpb-custom-color").colorpicker().on("changeColor",function(e){var i=t(this).data("field-store"),a=t(this).find("input").val();rocketform.fields2_updateModalFieldCoreAndPreview(i,a)}))},arguments.callee.fields_events_cpicker=function(e){try{e.find(".uifm-custom-color").colorpicker(),t("#uiform-build-field-tab .uifm-custom-color").colorpicker().on("changeColor",function(e){var i,a,o=t("#uifm-field-selected-id").val(),s=t(this).data("field-store"),r=s.split("-"),n=(r[0],r[1],t(this).find("input").val()),c=t(".uiform-main-form .uiform-fields-qopt-select input:checked");parseInt(c.length)>1?n&&(a=c.closest(".uiform-field"),t.each(a,function(e,a){o=t(this).attr("id"),i=t("#"+o).closest(".uiform-step-pane").data("uifm-step"),rocketform.setDataOptToCoreData(i,o,s,n),t(this)&&rocketform.setDataOptToPrevField(t(this),s,n)})):n&&(i=t("#"+o).closest(".uiform-step-pane").data("uifm-step"),rocketform.setDataOptToCoreData(i,o,s,n),(a=t("#"+o))&&rocketform.setDataOptToPrevField(a,s,n))})}catch(t){}},arguments.callee.fields_events_select=function(t){try{t.find(".uifm_selectpicker").selectpicker({style:"btn-info",size:4}),t.find(".selectpicker").selectpicker()}catch(t){}},arguments.callee.fields_events_slider=function(e){try{e.find(".uiform-opt-slider").bootstrapSlider(),t("#uiform-build-field-tab .uiform-opt-slider").on("slide",function(e){var i,a=t("#uifm-field-selected-id").val(),o=t(this).data("field-store"),s=o.split("-"),r=(s[0],s[1],e.value),n=t(".uiform-main-form .uiform-fields-qopt-select input:checked");if(parseInt(n.length)>1)c=n.closest(".uiform-field"),t.each(c,function(e,s){a=t(this).attr("id"),i=t("#"+a).closest(".uiform-step-pane").data("uifm-step"),rocketform.setDataOptToCoreData(i,a,o,r),t(this)&&rocketform.setDataOptToPrevField(t(this),o,r)});else{i=t("#"+a).closest(".uiform-step-pane").data("uifm-step"),rocketform.setDataOptToCoreData(i,a,o,r);var c=t("#"+a);c&&rocketform.setDataOptToPrevField(c,o,r)}})}catch(t){}},arguments.callee.fields2_events_bswitch=function(e){e.find(".zgpb-switch-field").data("bootstrap-switch")||(e.find(".zgpb-switch-field").bootstrapSwitchZgpb(),e.find(".zgpb-switch-field").on("switchChange.bootstrapSwitchZgpb",function(e,i){var a=t(this).data("field-store"),o=i?1:0;rocketform.fields2_updateModalFieldCoreAndPreview(a,o)}))},arguments.callee.fields2_events_groupbtn=function(e){e.find(".sfdc-form-group").find(".zgpb-form-group-loaded").length||(e.find(".sfdc-form-group").addClass("zgpb-form-group-loaded"),e.find(".zgpb-col-setoption-btn").on("click",function(e){e&&(e.stopPropagation(),e.preventDefault()),e.preventDefault();var i=t(this);i.parent().children(".sfdc-btn[data-toggle-enable]").removeClass(function(){return t(this).data("toggle-enable")}).addClass(function(){return t(this).data("toggle-disable")}).children("input").prop("checked",!1),i.removeClass(t(this).data("toggle-disable")).addClass(i.data("toggle-enable")),i.children("input").prop("checked",!0)}),e.find(".zgpb-col-setoption-btn").on("click",function(e){e.preventDefault();var i=t(this).data("field-store"),a=parseInt(t(this).data("field-value"));rocketform.fields2_updateModalFieldCoreAndPreview(i,a)}))},arguments.callee.fields2_events_general=function(){t(document).on("change keyup focus keypress","#uifm_fld_main_fldname",function(e){var i=t("#uifm_fld_main_fldname").val(),a=t("#uifm-field-selected-id").val(),o=t("#"+a).closest(".uiform-step-pane").data("uifm-step");rocketform.fieldsetting_updateName(o,a,i)}),t("#uifm-field-opt-content").find('a[data-toggle="sfdc-tab"]').on("shown.bs.sfdc-tab",function(t){}),t(document).on("change","#uifm-field-opt-content .zgpb-f-setoption-st",function(e){e&&(e.stopPropagation(),e.preventDefault());var i=t(this).data("field-store"),a=t(this).is(":checked")?1:0;rocketform.fields2_updateModalFieldCoreAndPreview(i,a)}),t(document).on("change keyup","#uifm-field-opt-content .zgpb-f-setoption",function(e){e&&(e.stopPropagation(),e.preventDefault());var i=t(this).data("field-store"),a=t(this).val();rocketform.updateModalFieldCoreAndPreview(i,a)}),t(document).on("click","#uifm-field-opt-content .zgpb-f-setoption-btn",function(e){e&&(e.stopPropagation(),e.preventDefault());var i=t(this).data("field-store"),a=t(this).find("input").val();rocketform.fields2_updateModalFieldCoreAndPreview(i,a)})},arguments.callee.fields2_events_slider=function(e){e.find(".zgpb-custom-slider").bootstrapSlider(),e.find(".zgpb-custom-slider").on("slide",function(e){var i=t(this).data("field-store"),a=e.value;rocketform.fields2_updateModalFieldCoreAndPreview(i,a)})},arguments.callee.fields2_events_txts=function(e){e.find(".zgpb-field-col-event-txt").on("change keyup focus keypress",function(e){e&&e.stopPropagation();var i=t(this).data("field-store"),a=t(this).val();rocketform.fields2_updateModalFieldCoreAndPreview(i,a)})},arguments.callee.fields2_events_spinner=function(e){e.find(".zgpb_fld_settings_spinner").find(".bootstrap-touchspin-postfix").length||(e.find(".zgpb_fld_settings_spinner").TouchSpin({verticalbuttons:!0,min:0,max:1500,stepinterval:1,verticalupclass:"sfdc-glyphicon sfdc-glyphicon-plus",verticaldownclass:"sfdc-glyphicon sfdc-glyphicon-minus"}),e.find(".zgpb_fld_settings_spinner").on("change",function(e){e&&(e.stopPropagation(),e.preventDefault());var i=t(e.target).data("field-store"),a=t(e.target).val();rocketform.fields2_updateModalFieldCoreAndPreview(i,a)}))},arguments.callee.modal_editfield_col_bg_delimg=function(){t("#zgpb_fld_col_bg_srcimg_wrap").html(""),t("#zgpb_fld_col_bg_imgsource").val("");var e=t("#zgpb_fld_col_bg_imgsourcebtnadd").data("field-store");rocketform.fields2_updateModalFieldCoreAndPreview(e,"")},arguments.callee.fields2_events_bgimages=function(i){i.find("#zgpb_fld_col_bg_imgsourcebtnadd").on("click",function(i){i&&(i.stopPropagation(),i.preventDefault());var a=t(this);rocketform.elfinder_showPopUp({windowURL:uiform_vars.url_elfinder2,windowName:"_blank",height:490,width:950,centerScreen:1,location:0}),e.processFile=function(e){var i=e.url;t("#zgpb_fld_col_bg_imgsource").val(i),t("#zgpb_fld_col_bg_srcimg_wrap").html('');var o=a.data("field-store"),s=i;rocketform.fields2_updateModalFieldCoreAndPreview(o,s)}})},arguments.callee.fields2_updateModalFieldCoreAndPreview=function(e,i){try{var a,o;a=t("#uifm-field-selected-id").val(),o=t("#uifm-field-selected-type").val();var s=[];switch(parseInt(o)){case 1:case 2:case 3:case 4:case 5:var r=t("#zgpb-field-selected-block").val();s.block=r}rocketform.fields2_setDataOptToCoreData(a,o,e,i,s);var n=t("#"+a);n&&rocketform.fields2_setDataOptToPrevField(n,o,e,i,s)}catch(t){}},arguments.callee.fields2_setDataOptToCoreData=function(e,i,a,o,s){try{var r,n,c=t("#"+e);switch(parseInt(i)){case 1:case 2:case 3:case 4:case 5:r=[],n=a.split("-"),r.id=e,r.block=s.block,r.opt1=n[0],r.opt2=n[1],r.opt3=n[2],r.opt4=o,c.data("zgpbld_gridsystem").setDataToCore(r);break;case 6:default:switch(r=[],n=a.split("-"),r.id=e,r.opt1=n[0]||"",r.opt2=n[1]||"",r.opt3=n[2]||"",r.opt4=o,parseInt(i)){case 6:t("#"+e).data("uiform_textbox").setDataToCore(r);break;case 7:t("#"+e).data("uiform_textarea").setDataToCore(r);break;case 8:t("#"+e).data("uiform_radiobtn").setDataToCore(r);break;case 9:t("#"+e).data("uiform_checkbox").setDataToCore(r);break;case 10:t("#"+e).data("uiform_select").setDataToCore(r);break;case 11:t("#"+e).data("uiform_multiselect").setDataToCore(r);break;case 12:t("#"+e).data("uiform_fileupload").setDataToCore(r);break;case 13:t("#"+e).data("uiform_imageupload").setDataToCore(r);break;case 14:t("#"+e).data("uiform_customhtml").setDataToCore(r);break;case 15:t("#"+e).data("uiform_password").setDataToCore(r);break;case 16:t("#"+e).data("uiform_slider").setDataToCore(r);break;case 17:t("#"+e).data("uiform_range").setDataToCore(r);break;case 18:t("#"+e).data("uiform_spinner").setDataToCore(r);break;case 19:t("#"+e).data("uiform_captcha").setDataToCore(r);break;case 20:t("#"+e).data("uiform_submitbtn").setDataToCore(r);break;case 21:t("#"+e).data("uiform_hiddeninput").setDataToCore(r);break;case 22:t("#"+e).data("uiform_ratingstar").setDataToCore(r);break;case 23:t("#"+e).data("uiform_colorpicker").setDataToCore(r);break;case 24:t("#"+e).data("uiform_datepicker").setDataToCore(r);break;case 25:t("#"+e).data("uiform_timepicker").setDataToCore(r);break;case 26:t("#"+e).data("uiform_datetime").setDataToCore(r);break;case 27:t("#"+e).data("uiform_recaptcha").setDataToCore(r);break;case 28:t("#"+e).data("uiform_preptext").setDataToCore(r);break;case 29:t("#"+e).data("uiform_appetext").setDataToCore(r);break;case 30:t("#"+e).data("uiform_prepapptext").setDataToCore(r);break;case 31:t("#"+e).data("uiform_panelfld").setDataToCore(r);break;case 32:t("#"+e).data("uiform_divider").setDataToCore(r);break;case 33:case 34:case 35:case 36:case 37:case 38:t("#"+e).data("uiform_heading").setDataToCore(r);break;case 39:t("#"+e).data("uiform_wizardbtn").setDataToCore(r);break;case 40:t("#"+e).data("uiform_switch").setDataToCore(r);break;case 41:t("#"+e).data("uiform_dyncheckbox").setDataToCore(r);break;case 42:t("#"+e).data("uiform_dynradiobtn").setDataToCore(r);break;case 43:t("#"+e).data("uiform-datetime2").setDataToCore(r)}}}catch(t){}},arguments.callee.fields2_setDataOptToPrevField=function(t,e,i,a,o){try{switch(parseInt(e)){case 1:case 2:case 3:case 4:case 5:var s=[],r=i.split("-");s.block=o.block,s.opt1=r[0],s.opt2=r[1],s.opt3=r[2],s.opt4=a,t.data("zgpbld_gridsystem").setOptionsToPreview(s);break;default:s=[],r=i.split("-");rocketform.setDataOptToPrevField(t,i,a)}}catch(t){}},arguments.callee.rollback_openModal=function(){var e=t("#uifm_frm_main_id").val();try{rocketform.fields_showModalOptions(),t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"formbuilder/forms/ajax_rollback_openmodal",data:{action:"rocket_fbuilder_rollback_openmodal",page:"zgfm_cost_estimate",zgfm_security:uiform_vars.ajax_nonce,form_id:e,csrf_field_name:uiform_vars.csrf_field_name},success:function(e){t("#zgpb-modal1").find(".sfdc-modal-dialog").find(".zgpb-modal-header-inner").html(e.modal_header),t("#zgpb-modal1").find(".sfdc-modal-dialog").find(".sfdc-modal-body").html(e.modal_body),t("#zgpb-modal1").find(".sfdc-modal-dialog").find(".zgpb-modal-footer-wrap").html(e.modal_footer)}})}catch(t){}},arguments.callee.rollback_process=function(e){try{rocketform.fields_showModalOptions(),t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"formbuilder/forms/ajax_rollback_process",data:{action:"rocket_fbuilder_rollback_process",page:"zgfm_cost_estimate",zgfm_security:uiform_vars.ajax_nonce,log_id:e,csrf_field_name:uiform_vars.csrf_field_name},success:function(e){e.data.fmb_html_backend=decodeURIComponent(e.data.fmb_html_backend),rocketform.loadFormToEditPanel(e),rocketform.wizardform_refresh(),rocketform.loading_panelbox2(0),t("#zgpb-modal1").sfdc_modal("hide")}})}catch(t){}},arguments.callee.fields_showModalOptions=function(){var e='';t("#zgpb-modal1").find(".sfdc-modal-dialog").find(".zgpb-modal-header-inner").html(e),t("#zgpb-modal1").find(".sfdc-modal-dialog").find(".sfdc-modal-body").html(e),t("#zgpb-modal1").find(".sfdc-modal-dialog").find(".zgpb-modal-footer-wrap").html(e),t("#zgpb-modal1").find(".sfdc-modal-content").resizable({}),t("#zgpb-modal1").on("show.bs.sfdc-modal",function(){t(this).find(".sfdc-modal-body").css({"max-height":"100%"})}),t("#zgpb-modal1").sfdc_modal({show:!0,keyboard:!0})},arguments.callee.modal_field_loader=function(e){var i=t("#zgpb-modal1").find(".sfdc-modal-dialog .sfdc-modal-body");if(1===parseInt(e)){if(0===parseInt(i.find("#zgpb-modal-field-loader").length)){var a=wp.template("zgpb-modal-field-loader");i.append(a())}}else i.find("#zgpb-modal-field-loader")&&i.find("#zgpb-modal-field-loader").remove()},arguments.callee.check_fieldExist=function(t,e,i){try{return void 0!==a[t][e][i]}catch(t){return!1}},arguments.callee.variables_openModal=function(){var e=t("#uifm_frm_main_id").val();rocketform.fields_showModalOptions(),this.saveTabContent();var i=a;t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"formbuilder/forms/ajax_variables_openmodal",data:{action:"rocket_fbuilder_variables_openmodal",page:"zgfm_cost_estimate",zgfm_security:uiform_vars.ajax_nonce,form_id:e,form_data:encodeURIComponent(JSON.stringify(i)),csrf_field_name:uiform_vars.csrf_field_name},success:function(e){t("#zgpb-modal1").find(".sfdc-modal-dialog").find(".zgpb-modal-header-inner").html(e.modal_header),t("#zgpb-modal1").find(".sfdc-modal-dialog").find(".sfdc-modal-body").html(e.modal_body),t("#zgpb-modal1").find(".sfdc-modal-dialog").find(".zgpb-modal-footer-wrap").html(e.modal_footer),t('[data-toggle="tooltip"]').tooltip({container:"body"})}})},arguments.callee.get_coreData=function(){return a}}}($uifm,window),rocketform(),function(t){var e=function(e,i){var a,o=null,s=!1,r=t(e),n=!0,c=this,f={skin:{align:{show_st:0,max_width:"1200",max_width_st:"1"},margin:{show_st:1,top:"0",bottom:"0",left:"0",right:"0"},padding:{show_st:1,top:"5",bottom:"5",left:"0",right:"0"},text:{color:""},background:{show_st:"0",type:"1",cl_start_color:"#eeeeee",cl_end_color:"#ffffff",cl_solid_color:"#eeeeee",img_source:"",img_repeat:"0",img_position:"Center",img_attachment:"Scroll",img_scale:"Fill",img_overlay_color:"",img_overlay_opacity:"",img_size_type:"3",img_size_len:"100% 100%",opacity:"100"},border:{show_st:"0",color:"#000",color_focus_st:"0",color_focus:"#000",type:"1",width:"1"},border_radius:{show_st:"0",size:"17"},custom_css:{ctm_id:"",ctm_class:"",ctm_additional:""},shadow:{show_st:"0",color:"#CCCCCC",h_shadow:"3",v_shadow:"3",blur:"10"}}},l=t.extend(!0,{},{data:{type:0,id:"",type_n:"Grid",field_name:"",main:{},blocks:{}}}),d=[];d.innerVars={};this.publicMethod=function(){},this.showSettingTab=function(t){};this.setOptionsToModal=function(e){var i=t("#uifm-field-opt-content"),a=e.opt1,o=e.opt2,s=e.opt3,r=e.opt4;switch(String(a)){case"skin":switch(String(o)){case"align":switch(String(s)){case"show_st":1===parseInt(r)?i.find("#zgpb_fld_col_style_st").bootstrapSwitchZgpb("state",!0):i.find("#zgpb_fld_col_style_st").bootstrapSwitchZgpb("state",!1);break;case"max_width_st":1===parseInt(r)?i.find("#zgpb_fld_col_style_maxwidth_st").prop("checked",!0):i.find("#zgpb_fld_col_style_maxwidth_st").prop("checked",!1);break;case"max_width":i.find("#zgpb_fld_col_style_maxwidth").val(r)}break;case"margin":switch(String(s)){case"top":i.find("#zgpb_fld_col_margin_top").val(r);break;case"bottom":i.find("#zgpb_fld_col_margin_bottom").val(r);break;case"left":i.find("#zgpb_fld_col_margin_left").val(r);break;case"right":i.find("#zgpb_fld_col_margin_right").val(r)}break;case"padding":switch(String(s)){case"top":i.find("#zgpb_fld_col_padding_top").val(r);break;case"bottom":i.find("#zgpb_fld_col_padding_bottom").val(r);break;case"left":i.find("#zgpb_fld_col_padding_left").val(r);break;case"right":i.find("#zgpb_fld_col_padding_right").val(r)}break;case"text":switch(String(s)){case"color":i.find("#zgpb_fld_col_text_color").parent().colorpicker("setValue",r),i.find("#zgpb_fld_col_text_color").val(r)}break;case"background":switch(String(s)){case"show_st":1===parseInt(r)?i.find("#zgpb_fld_col_bg_st").bootstrapSwitchZgpb("state",!0):i.find("#zgpb_fld_col_bg_st").bootstrapSwitchZgpb("state",!1);break;case"type":switch(parseInt(r)){case 2:i.find("#zgpb_fld_col_bg_type_2").addClass("sfdc-active"),i.find("#zgpb_fld_col_bg_type_1_cont").hide(),i.find("#zgpb_fld_col_bg_type_2_cont").show();break;case 1:default:i.find("#zgpb_fld_col_bg_type_1").addClass("sfdc-active"),i.find("#zgpb_fld_col_bg_type_1_cont").show(),i.find("#zgpb_fld_col_bg_type_2_cont").hide()}break;case"cl_start_color":i.find("#zgpb_fld_col_bg_clstartcolor").parent().colorpicker("setValue",r),i.find("#zgpb_fld_col_bg_clstartcolor").val(r);break;case"cl_end_color":i.find("#zgpb_fld_col_bg_clendcolor").parent().colorpicker("setValue",r),i.find("#zgpb_fld_col_bg_clendcolor").val(r);break;case"cl_solid_color":i.find("#zgpb_fld_col_bg_clsolidcolor").parent().colorpicker("setValue",r),i.find("#zgpb_fld_col_bg_clsolidcolor").val(r);break;case"img_source":i.find("#zgpb_fld_col_bg_imgsource").val(r),r&&i.find("#zgpb_fld_col_bg_srcimg_wrap").html("");break;case"img_size_type":i.find("#zgpb_fld_col_bg_sizetype").val(r),1===parseInt(r)||2===parseInt(r)?t("#zgpb_fld_col_bg_sizetype_len_wrap").show():t("#zgpb_fld_col_bg_sizetype_len_wrap").hide();break;case"img_size_len":i.find("#zgpb_fld_col_bg_sizetype_len").val(r);break;case"img_repeat":i.find("#zgpb_fld_col_bg_repeat").val(r);break;case"img_position":i.find("#zgpb_fld_col_bg_pos").val(r)}break;case"border":switch(String(s)){case"show_st":1===parseInt(r)?i.find("#zgpb_fld_col_border_st").bootstrapSwitchZgpb("state",!0):i.find("#zgpb_fld_col_border_st").bootstrapSwitchZgpb("state",!1);break;case"type":switch(parseInt(r)){case 2:i.find("#zgpb_fld_col_border_type_2").addClass("sfdc-active");break;case 1:default:i.find("#zgpb_fld_col_border_type_1").addClass("sfdc-active")}break;case"color":i.find("#zgpb_fld_col_border_color").parent().colorpicker("setValue",r),i.find("#zgpb_fld_col_border_color").val(r);break;case"width":i.find("#zgpb_fld_col_border_width").val(r)}break;case"border_radius":switch(String(s)){case"show_st":1===parseInt(r)?i.find("#zgpb_fld_col_bradius_st").bootstrapSwitchZgpb("state",!0):i.find("#zgpb_fld_col_bradius_st").bootstrapSwitchZgpb("state",!1);break;case"size":i.find("#zgpb_fld_col_bradius_size").val(r)}break;case"shadow":switch(String(s)){case"show_st":1===parseInt(r)?i.find("#zgpb_fld_col_shadow_st").bootstrapSwitchZgpb("state",!0):i.find("#zgpb_fld_col_shadow_st").bootstrapSwitchZgpb("state",!1);break;case"color":i.find("#zgpb_fld_col_shadow_color").val(r);break;case"h_shadow":i.find("#zgpb_fld_col_shadow_h").bootstrapSlider("setValue",parseInt(r));break;case"v_shadow":i.find("#zgpb_fld_col_shadow_v").bootstrapSlider("setValue",parseInt(r));break;case"blur":i.find("#zgpb_fld_col_shadow_blur").bootstrapSlider("setValue",parseInt(r))}break;case"custom_css":switch(String(s)){case"ctm_id":break;case"ctm_class":i.find("#zgpb_fld_col_ctmclass").val(r);break;case"ctm_additional":i.find("#zgpb_fld_ctmaddt").val(r)}}}},this.previewfield_maxwidth=function(e){var i,o,s,r,c;if(n&&(i=l.data.main.skin.align.show_st,o=l.data.main.skin.align.max_width,l.data.main.skin.align.max_width_st,r=l.data.main.skin.align,e.find(".sfdc-container-fluid"),s="#"+l.data.id+" > .sfdc-container-fluid"),c="zgpb_"+l.data.id+"_skin_align_"+a,h(c,r)&&(t("#"+c)&&t("#"+c).remove(),1===parseInt(i))){var f='",t("head").append(f)}},this.setOptionsToPreview=function(t){var e=r,i=t.block,o=t.opt1,s=t.opt2,c=t.opt3,f=t.opt4;switch(n=!0,a=0,parseInt(i)>0&&(n=!1,a=parseInt(i)),String(o)){case"skin":switch(String(s)){case"align":switch(String(c)){case"show_st":case"max_width":case"max_width_st":this.previewfield_maxwidth(e)}break;case"margin":switch(String(c)){case"top":n?e.find(">.sfdc-container-fluid").attr("style",function(t,e){return(e||"")+`margin-top: ${f}px !important;`}):e.find('.zgpb-fl-gs-block-style[data-zgpb-blocknum="'+i+'"] > .zgpb-fl-gs-block-inner').css("margin-top",f+"px");break;case"bottom":n?e.find(">.sfdc-container-fluid").attr("style",function(t,e){return(e||"")+`margin-bottom: ${f}px !important;`}):e.find('.zgpb-fl-gs-block-style[data-zgpb-blocknum="'+i+'"] > .zgpb-fl-gs-block-inner').css("margin-bottom",f+"px");break;case"left":n?e.find(">.sfdc-container-fluid").attr("style",function(t,e){return(e||"")+`margin-left: ${f}px !important;`}):e.find('.zgpb-fl-gs-block-style[data-zgpb-blocknum="'+i+'"] > .zgpb-fl-gs-block-inner').css("margin-left",f+"px");break;case"right":n?e.find(">.sfdc-container-fluid").attr("style",function(t,e){return(e||"")+`margin-right: ${f}px !important;`}):e.find('.zgpb-fl-gs-block-style[data-zgpb-blocknum="'+i+'"] > .zgpb-fl-gs-block-inner').css("margin-right",f+"px")}break;case"padding":switch(String(c)){case"top":n?e.find(">.sfdc-container-fluid").attr("style",function(t,e){return(e||"")+`padding-top: ${f}px !important;`}):e.find('.zgpb-fl-gs-block-style[data-zgpb-blocknum="'+i+'"] > .zgpb-fl-gs-block-inner').css("padding-top",f+"px");break;case"bottom":n?e.find(">.sfdc-container-fluid").attr("style",function(t,e){return(e||"")+`padding-bottom: ${f}px !important;`}):e.find('.zgpb-fl-gs-block-style[data-zgpb-blocknum="'+i+'"] > .zgpb-fl-gs-block-inner').css("padding-bottom",f+"px");break;case"left":n?e.find(">.sfdc-container-fluid").attr("style",function(t,e){return(e||"")+`padding-left: ${f}px !important;`}):e.find('.zgpb-fl-gs-block-style[data-zgpb-blocknum="'+i+'"] > .zgpb-fl-gs-block-inner').css("padding-left",f+"px");break;case"right":n?e.find(">.sfdc-container-fluid").attr("style",function(t,e){return(e||"")+`padding-right: ${f}px !important;`}):e.find('.zgpb-fl-gs-block-style[data-zgpb-blocknum="'+i+'"] > .zgpb-fl-gs-block-inner').css("padding-right",f+"px")}break;case"text":switch(String(c)){case"color":n?e.find(".sfdc-container-fluid").css("color",f):e.find('.zgpb-fl-gs-block-style[data-zgpb-blocknum="'+i+'"] >.zgpb-fl-gs-block-inner').css("color",f)}break;case"background":u(e);break;case"border":p(e);break;case"border_radius":m(e);break;case"shadow":_(e)}}};var _=function(e){var i,o,s,r,c,f,d,_;if(n?(i=l.data.main.skin.shadow.show_st,o=l.data.main.skin.shadow.color,s=l.data.main.skin.shadow.h_shadow,r=l.data.main.skin.shadow.v_shadow,c=l.data.main.skin.shadow.blur,d=l.data.main.skin.shadow,e.find(".sfdc-container-fluid"),f="#"+l.data.id+" > .sfdc-container-fluid"):(i=l.data.blocks[a].skin.shadow.show_st,o=l.data.blocks[a].skin.shadow.color,s=l.data.blocks[a].skin.shadow.h_shadow,r=l.data.blocks[a].skin.shadow.v_shadow,c=l.data.blocks[a].skin.shadow.blur,d=l.data.blocks[a].skin.shadow,e.find('.zgpb-fl-gs-block-style[data-zgpb-blocknum="'+a+'"] >.zgpb-fl-gs-block-inner'),f="#"+l.data.id+' > .sfdc-container-fluid > .sfdc-row > .zgpb-fl-gs-block-style[data-zgpb-blocknum="'+a+'"] >.zgpb-fl-gs-block-inner'),_="zgpb_"+l.data.id+"_skin_shadow_"+a,h(_,d)&&(t("#"+_)&&t("#"+_).remove(),1===parseInt(i))){var m='",t("head").append(m)}},m=function(e){var i,o,s,r,c;if(n?(i=l.data.main.skin.border_radius.show_st,o=l.data.main.skin.border_radius.size,r=l.data.main.skin.border_radius,e.find(".sfdc-container-fluid"),s="#"+l.data.id+" > .sfdc-container-fluid"):(i=l.data.blocks[a].skin.border_radius.show_st,o=l.data.blocks[a].skin.border_radius.size,r=l.data.blocks[a].skin.border_radius,e.find('.zgpb-fl-gs-block-style[data-zgpb-blocknum="'+a+'"] >.zgpb-fl-gs-block-inner'),s="#"+l.data.id+' .zgpb-fl-gs-block-style[data-zgpb-blocknum="'+a+'"] >.zgpb-fl-gs-block-inner'),c="zgpb_"+l.data.id+"_skin_borderradius_"+a,h(c,r)&&(t("#"+c)&&t("#"+c).remove(),1===parseInt(i))){var f='",t("head").append(f)}},p=function(e){var i,o,s,r,c,f,d,_;if((n?(i=l.data.main.skin.border.show_st,o=l.data.main.skin.border.color,l.data.main.skin.border.color_focus_st,l.data.main.skin.border.color_focus,s=l.data.main.skin.border.type,r=l.data.main.skin.border.width,f=l.data.main.skin.border,e.find(".sfdc-container-fluid"),c="#"+l.data.id+" > .sfdc-container-fluid"):(i=l.data.blocks[a].skin.border.show_st,o=l.data.blocks[a].skin.border.color,l.data.blocks[a].skin.border.color_focus_st,l.data.blocks[a].skin.border.color_focus,s=l.data.blocks[a].skin.border.type,r=l.data.blocks[a].skin.border.width,f=l.data.blocks[a].skin.border,e.find('.zgpb-fl-gs-block-style[data-zgpb-blocknum="'+a+'"] >.zgpb-fl-gs-block-inner'),c="#"+l.data.id+' > .sfdc-container-fluid > .sfdc-row > .zgpb-fl-gs-block-style[data-zgpb-blocknum="'+a+'"] >.zgpb-fl-gs-block-inner:first-child '),d="zgpb_"+l.data.id+"_skin_border_"+a,h(d,f))&&(t("#"+d)&&t("#"+d).remove(),1===parseInt(i))){var m='",t("head").append(m)}},u=function(e){var i,o,s,r,c,f,d,_,m,p,u,b,g;if(n?(i=l.data.main.skin.background.show_st,o=l.data.main.skin.background.type,s=l.data.main.skin.background.cl_start_color,r=l.data.main.skin.background.cl_end_color,c=l.data.main.skin.background.cl_solid_color,f=l.data.main.skin.background.img_source,d=l.data.main.skin.background.img_repeat,_=l.data.main.skin.background.img_position,l.data.main.skin.background.img_attachment,l.data.main.skin.background.img_scale,l.data.main.skin.background.img_overlay_color,l.data.main.skin.background.img_overlay_opacity,m=l.data.main.skin.background.img_size_type,p=l.data.main.skin.background.img_size_len,l.data.main.skin.background.opacity,b=l.data.main.skin.background,e.find(".sfdc-container-fluid"),u="#"+l.data.id+" > .sfdc-container-fluid"):(i=l.data.blocks[a].skin.background.show_st,o=l.data.blocks[a].skin.background.type,s=l.data.blocks[a].skin.background.cl_start_color,r=l.data.blocks[a].skin.background.cl_end_color,c=l.data.blocks[a].skin.background.cl_solid_color,f=l.data.blocks[a].skin.background.img_source,d=l.data.blocks[a].skin.background.img_repeat,_=l.data.blocks[a].skin.background.img_position,l.data.blocks[a].skin.background.img_attachment,l.data.blocks[a].skin.background.img_scale,l.data.blocks[a].skin.background.img_overlay_color,l.data.blocks[a].skin.background.img_overlay_opacity,m=l.data.main.skin.background.img_size_type,p=l.data.main.skin.background.img_size_len,l.data.blocks[a].skin.background.opacity,b=l.data.blocks[a].skin.background,e.find('.zgpb-fl-gs-block-style[data-zgpb-blocknum="'+a+'"] >.zgpb-fl-gs-block-inner'),u="#"+l.data.id+' .zgpb-fl-gs-block-style[data-zgpb-blocknum="'+a+'"] >.zgpb-fl-gs-block-inner'),g="zgpb_"+l.data.id+"_skin_background_"+a,h(g,b)&&(t("#"+g)&&t("#"+g).remove(),1===parseInt(i))){var k,v='",t("head").append(v)}},h=function(t,e){var i,a=t,o=CryptoJS.MD5(JSON.stringify(e)),s=(i=a,d.innerVars[i]?d.innerVars[i]:"");return String(s)!==String(o)&&(function(t,e){d.innerVars[t]=e}(a,CryptoJS.MD5(JSON.stringify(e))),!0)};this.updateVarData=function(e){t("#"+e).data("zgpb-settings",l)},this.update_previewfield=function(e){t("#"+e)&&this.enableSettingOptions_process(l.data,!1,!0,null)},this.setToDatalvl1=function(t,e){l.data[t]=e},this.setFieldName=function(t){l.data.field_name=l.data.type_n+t},this.setStep=function(t){o=t},this.setDataToCoreStore=function(t,e){rocketform.setUiData3("steps_src",t,e,l.data)},this.update_settingsData=function(e){var i=uifm_validate_field(e.hasOwnProperty("data")?t.extend(!0,{},l,e):t.extend(!0,{},l,{data:e}),l);l=i},this.createBlockAttributes=function(){var e=l.data.type,i={};switch(parseInt(e)){case 1:i[1]=t.extend(!0,{},f);break;case 2:i[1]=t.extend(!0,{},f),i[2]=t.extend(!0,{},f);break;case 3:i[1]=t.extend(!0,{},f),i[2]=t.extend(!0,{},f),i[3]=t.extend(!0,{},f);break;case 4:i[1]=t.extend(!0,{},f),i[2]=t.extend(!0,{},f),i[3]=t.extend(!0,{},f),i[4]=t.extend(!0,{},f);break;case 5:i[1]=t.extend(!0,{},f),i[2]=t.extend(!0,{},f),i[3]=t.extend(!0,{},f),i[4]=t.extend(!0,{},f),i[5]=t.extend(!0,{},f),i[6]=t.extend(!0,{},f);break;case 6:i[1]=t.extend(!0,{},f),i[2]=t.extend(!0,{},f),i[3]=t.extend(!0,{},f),i[4]=t.extend(!0,{},f),i[5]=t.extend(!0,{},f),i[6]=t.extend(!0,{},f),i[7]=t.extend(!0,{},f),i[8]=t.extend(!0,{},f),i[9]=t.extend(!0,{},f),i[10]=t.extend(!0,{},f),i[11]=t.extend(!0,{},f),i[12]=t.extend(!0,{},f)}l.data.main=t.extend(!0,{},f),l.data.blocks=i},this.setDataToCore=function(t){var e=t.id,i=t.block,a=t.opt1,s=t.opt2,r=t.opt3,n=t.opt4;if(parseInt(i)>0){var c=parseInt(i);rocketform.setUiData8("steps_src",o,String(e),"blocks",c,String(a),String(s),String(r),n)}else rocketform.setUiData7("steps_src",o,String(e),"main",String(a),String(s),String(r),n)},this.enableSettingOptions_process=function(e,i,a,o){if(i){var s=t("#uifm-field-opt-content");rocketform.fields2_events_bswitch(s),rocketform.fields2_events_groupbtn(s),rocketform.fields2_events_cpicker(s),rocketform.fields2_events_spinner(s),rocketform.fields2_events_bgimages(s),rocketform.fields2_events_slider(s),rocketform.fields2_events_txts(s),rocketform.fields2_events_general()}var r,n=o?o.block:0,f=!0;parseInt(n)>0&&(f=!1),f?t("#zgpb_fld_col_style_wrapper").show():t("#zgpb_fld_col_style_wrapper").hide();var d=l.data.field_name||"";if(f)d&&t("#uifm_fld_main_fldname").val(d);else{t("#zgfm-field-col-fldname-lbl-bl2").html();t("#zgfm-field-col-fldname-lbl-bl1").html(d+" - ")}t.each(e,function(e,o){t.isPlainObject(o)&&t.each(o,function(o,s){t.isPlainObject(s)&&t.each(s,function(s,l){t.isPlainObject(l)&&t.each(l,function(l,d){t.isPlainObject(d)?t.each(d,function(t,d){r=[],"main"===String(e)?r.block=0:r.block=parseInt(o),r.opt1=s,r.opt2=l,r.opt3=t,r.opt4=d,!1===f&&"blocks"===String(e)&&parseInt(n)===parseInt(o)&&i&&c.setOptionsToModal(r),a&&c.setOptionsToPreview(r)}):"main"===String(e)&&((r=[]).block=0,r.opt1=o,r.opt2=s,r.opt3=l,r.opt4=d,!0===f&&i&&c.setOptionsToModal(r),a&&c.setOptionsToPreview(r))})})})})},this.showSettingTab=function(e){var i=t("#uifm-field-selected-id").val();if(String(i)!=String(e)){rocketform.cleanSettingTab();t.each([".uifm-set-section-fieldname",".uifm-tab-fld-input",".uifm-tab-fld-moreopt"],function(){t(String(this)).removeClass("uifm-hide")}),t('.sfdc-nav-tabs a[href="#uiform-settings-tab-1"]').sfdc_tab("show")}},this.enableSettingOptions=function(t,e){this.showSettingTab(),this.enableSettingOptions_process(t,!0,!0,e),rocketform.loading_boxField("zgfm-panel-right-field-tabopt",0),s&&(rocketform.loading_boxField(t.id,0),s=!1)},this.getOnProcessStatus=function(){return!1},this.setVariables=function(t){s=t.oncreation||!1}};t.fn.zgpbld_gridsystem=function(i){return this.each(function(){var a=t(this);if(!a.data("zgpbld_gridsystem")){var o=new e(this,i);a.data("zgpbld_gridsystem",o)}})}}($uifm),function(t){var e,i=t(document),a=t("head"),o=null,s=[],r=0,n="px",c="JColResizer",f=parseInt,l=Math;try{e=sessionStorage}catch(t){}a.append("");destroy=function(t){var e=t.attr("id");(t=s[e])&&t.is("table")&&(t.removeClass(c).gc.remove(),delete s[e])};var d=function(i){var a=i.find(">thead>tr>th,>thead>tr>td");a.length||(a=i.find(">tbody>tr:first>th,>tr:first>th,>tbody>tr:first>td, >tr:first>td")),i.cg=i.find("col"),i.ln=a.length,i.p&&e&&e[i.id]&&_(i,a),a.each(function(e){var a=t(this),o=t(i.gc.append('
    ')[0].lastChild);o.t=i,o.i=e,o.c=a,a.w=a.width(),a.blocks=a.attr("data-blocks"),a.mpercent=a.attr("data-maxpercent"),i.g.push(o),i.c.push(a),a.width(a.w).removeAttr("width"),e
    '):o.addClass("JCLRLastGrip").removeClass("JCLRgrip"),o.data(c,{i:e,t:i.attr("id")})}),i.cg.removeAttr("width"),m(i),i.find("td, th").not(a).not("table th, table td").each(function(){t(this).removeAttr("width")})},_=function(t,i){var a,o=0,s=0,r=[];if(i){if(t.cg.removeAttr("width"),t.opt.flush)return void(e[t.id]="");for(a=e[t.id].split(";");s*{cursor:"+n.opt.dragCursor+"!important}"),f.addClass(n.opt.draggingClass),o=f,n.c[r.i].l)for(var l,d=0;d",liveDrag:!0,minWidth:15,headerOnly:!1,hoverCursor:"e-resize",dragCursor:"e-resize",postbackSafe:!1,flush:!1,marginLeft:null,marginRight:null,disable:!1,onDrag:null,onResize:null},e);return this.each(function(){t(window).resize(function(){v()}),function(e,i){var a=t(e);if(i.disable)return destroy(a);var o=a.id=a.attr("id")||c+r++;a.p=i.postbackSafe,a.is("table")&&!s[o]&&(a.addClass(c).attr("id",o).before('
    '),a.opt=i,a.g=[],a.c=[],a.w=a.width(),a.gc=a.prev(),i.marginLeft&&a.gc.css("marginLeft",i.marginLeft),i.marginRight&&a.gc.css("marginRight",i.marginRight),a.cs=f(a.css("border-spacing"))||2,a.b=f(a.css("border-left-width"))||1,s[o]=a,d(a))}(this,e)})}})}($uifm),function(t){var e,i,a,o=[],s=0,r=0,n=0,c=0,f=0,l=0,d=0,_=function(){(s=t(".uiform-editing-main").width())>=r?r=s:s=r,m()},m=function(){if(t("#uifm-panel-arrow-left").hasClass("uifm-layout-toggler-open")){var r=262;r+=17}else r=10;var _,m,p,u;_=(100*parseFloat(r)/parseFloat(s)).toFixed(3),m=t("#uifm-panel-arrow-right").hasClass("uifm-layout-toggler-open")?520:10,p=(100*parseFloat(m)/parseFloat(s)).toFixed(3),u=100-parseFloat(p)-parseFloat(_),e.find(".uifm-edit-panel-left").css("width",_+"%"),c=_,e.find(".uifm-edit-panel-center").css("width",u+"%"),n=u,e.find(".uifm-edit-panel-right").css("width",p+"%"),f=p;var h=i.height();if(0!==parseInt(h)&&0!==parseInt(o.left.find(".uiform-builder-fields").height())){var b=i.offset().top,g=parseFloat(b)+h;if(0!==parseInt(g)){var k,v,w,x,y=a.offset(),S=(y.left,y.top);if(S>g)l=h+(S-g)-100;else l=h;i.css("height",l+"px"),k=t(".uiformc-menu-wrap").first().height(),w=o.left.find(".uiform-builder-fields").height(),v=S>g&&(x=l-k-w)>0?w+x:w,d=v,o.left.find(".uiform-builder-fields").height(d),o.center.find(".uiform-builder-preview").height(d),o.right.find(".uiform-builder-data").height(d),t(".uiform-builder-maintab-container .uiform-tab-content").height(parseFloat(d-170))}}};t.fn.extend({ColumnToggle:function(l){l=t.extend({draggingClass:"",onResize:null},l);return this.each(function(){var l;t(window).resize(function(){_()}),t("#uifm-panel-arrow-left").click(function(){!function(){var i,a,o;t("#uifm-panel-arrow-left").hasClass("uifm-layout-toggler-open")?(t("#uifm-panel-arrow-left").removeClass("uifm-layout-toggler-open"),i=(100*parseFloat(10)/parseFloat(s)).toFixed(3),a=parseFloat(c)+parseFloat(n),o=parseFloat(a)-parseFloat(i),e.find(".uifm-edit-panel-left").css("width",i+"%"),e.find(".uifm-edit-panel-center").css("width",o+"%"),e.find(".uifm-edit-panel-left").addClass("uifm-panel-tog-left-closed"),t("#uifm-panel-arrow-left").find(".uifm-arrow-open").css("display","none"),t("#uifm-panel-arrow-left").find(".uifm-arrow-closed").css("display","block"),t(".uiform-editing-main .uiform-builder-fields").hide(),t("#uifm-panel-arrow-left").addClass("uifm-layout-toggler-close"),t("#uifm-panel-arrow-left").attr("title","Open")):(t("#uifm-panel-arrow-left").removeClass("uifm-layout-toggler-close"),e.find(".uifm-edit-panel-left").removeClass("uifm-panel-tog-left-closed"),i=(100*parseFloat(279)/parseFloat(s)).toFixed(3),a=parseFloat(c)+parseFloat(n),o=parseFloat(a)-parseFloat(i),e.find(".uifm-edit-panel-left").css("width",i+"%"),e.find(".uifm-edit-panel-center").css("width",o+"%"),t("#uifm-panel-arrow-left").find(".uifm-arrow-open").css("display","block"),t("#uifm-panel-arrow-left").find(".uifm-arrow-closed").css("display","none"),t(".uiform-editing-main .uiform-builder-fields").show(),t("#uifm-panel-arrow-left").addClass("uifm-layout-toggler-open"),t("#uifm-panel-arrow-left").attr("title","Close"));t(window).trigger("resize")}()}),t("#uifm-panel-arrow-right").click(function(){!function(){var i,a,o;t("#uifm-panel-arrow-right").hasClass("uifm-layout-toggler-open")?(t("#uifm-panel-arrow-right").removeClass("uifm-layout-toggler-open"),i=(100*parseFloat(10)/parseFloat(s)).toFixed(3),a=parseFloat(f)+parseFloat(n),o=parseFloat(a)-parseFloat(i),e.find(".uifm-edit-panel-right").css("width",i+"%"),e.find(".uifm-edit-panel-center").css("width",o+"%"),e.find(".uifm-edit-panel-right").addClass("uifm-panel-tog-right-closed"),t("#uifm-panel-arrow-right").find(".uifm-arrow-open").css("display","none"),t("#uifm-panel-arrow-right").find(".uifm-arrow-closed").css("display","block"),t(".uiform-editing-main .uiform-builder-data").hide(),t("#uifm-panel-arrow-right").addClass("uifm-layout-toggler-close"),t("#uifm-panel-arrow-right").attr("title","Open")):(t("#uifm-panel-arrow-right").removeClass("uifm-layout-toggler-close"),e.find(".uifm-edit-panel-right").removeClass("uifm-panel-tog-right-closed"),i=(100*parseFloat(520)/parseFloat(s)).toFixed(3),a=parseFloat(f)+parseFloat(n),o=parseFloat(a)-parseFloat(i),e.find(".uifm-edit-panel-right").css("width",i+"%"),e.find(".uifm-edit-panel-center").css("width",o+"%"),t("#uifm-panel-arrow-right").find(".uifm-arrow-open").css("display","block"),t("#uifm-panel-arrow-right").find(".uifm-arrow-closed").css("display","none"),t(".uiform-editing-main .uiform-builder-data").show(),t("#uifm-panel-arrow-right").addClass("uifm-layout-toggler-open"),t("#uifm-panel-arrow-right").attr("title","Close"));t(window).trigger("resize")}()}),l=this,i=t("#rocketform-bk-content"),a=t("#wpfooter")||null,e=t(l),o.left=e.find(".uifm-edit-panel-left"),o.center=e.find(".uifm-edit-panel-center"),o.right=e.find(".uifm-edit-panel-right"),r=s=t(".uiform-editing-main").width(),m()})}})}($uifm),void 0===$uifm&&($uifm=jQuery),function(t,e){e.uifmsetting=uifmsetting=t.uifmsetting||function(){arguments.callee.redirect=function(t){e.event?(e.event.returnValue=!1,e.location=t):location.href=t},arguments.callee.settings_saveFormSettings=function(){t("#frmform").validate({errorClass:"help-inline",errorElement:"span",rules:{site_title:{required:!0},admin_mail:{required:!0,email:!0}},messages:{site_title:{required:"Please specify site title"},admin_mail:{required:"We need email address"}},highlight:function(e){t(e).closest(".control-group").addClass("error").removeClass("success")},success:function(e){t(e).text("").closest(".control-group").addClass("success")},submitHandler:function(t){t.submit()}}),t("#frmform").submit()},arguments.callee.user_SaveUser=function(){t("#frmform").validate({errorClass:"help-inline",errorElement:"span",rules:{use_login:{required:!0},use_password:{required:!0,minlength:5},use_password2:{required:!0,equalTo:"#use_password",minlength:5}},messages:{nameform:{required:"Please specify your username"},descriptionform:{required:"We need your email address"}},highlight:function(e){t(e).closest(".control-group").addClass("error").removeClass("success")},success:function(e){t(e).text("").closest(".control-group").addClass("success")},submitHandler:function(t){t.submit()}}),t("#frmform").submit()},arguments.callee.user_CancelUser=function(){this.redirect(uiform_vars.url_admin+"user/intranet/index")}},uifmsetting()}($uifm,window),function(t){var e=function(e,i){var a=null,o=!1,s=t(e),r=this,n=null,c={data:{type:29,id:"",skin:{margin:{show_st:1,top:"5",bottom:"5",left:"0",right:"0"},padding:{show_st:1,top:"0",bottom:"0",left:"0",right:"0"},custom_css:{ctm_id:"",ctm_class:"",ctm_additional:""}},field_name:"",order_frm:"0",type_n:"appetext",input:{value:"",size:"14",bold:0,italic:0,underline:0,placeholder:"",color:"#000",font:"",font_st:1,val_align:"",append_txt:encodeURIComponent("@")},label:{text:"Text label",size:"14",bold:0,italic:0,underline:0,color:"#000",font:'{"family":"\'Comic Sans MS\', Arial, sans-serif","name":"Comic Sans MS","classname":"comicsansms"}',font_st:1,shadow_st:0,shadow_color:"#666",shadow_x:1,shadow_y:1,shadow_blur:3},sublabel:{text:"",size:"14",bold:1,italic:1,underline:0,color:"#000",font:'{"family":"\'Comic Sans MS\', Arial, sans-serif","name":"Comic Sans MS","classname":"comicsansms"}',font_st:1,shadow_st:0,shadow_color:"#666",shadow_x:1,shadow_y:1,shadow_blur:3},txt_block:{block_pos:"1",block_st:"1",block_align:"0",grid_layout:"2"},el_background:{show_st:"1",type:"1",start_color:"",end_color:"",solid_color:"#ffffff"},el_border_radius:{show_st:"1",size:"0"},el_border:{show_st:"1",color:"#ccc",color_focus_st:"0",color_focus:"#000",style:"1",width:"1"},help_block:{text:"here your content",show_st:"0",font:"",font_st:"0",pos:""},validate:{typ_val:"0",typ_val_custxt:"",customval_regex:"",pos:"0",tip_col:"#000000",tip_bg:"#ffffff",reqicon_st:"0",reqicon_pos:"0",reqicon_img:"glyphicon-asterisk"},clogic:{show_st:"0",f_show:"1",f_all:"1",list:[]}}},f=t.extend(!0,{},c,i);this.publicMethod=function(){};this.testingdata=function(){},this.updateVarData=function(e){t("#"+e).data("uifm-settings",f)},this.update_previewfield=function(e){t("#"+e)&&rocketform.loadForm_updatePreviewField(e,f.data)},this.loadSettingDataTab=function(t){this.showSettingTab(t)},this.onWholeHover=function(e){e&&(e.stopPropagation(),e.preventDefault());var i=wp.template("zgpb-quick-options");0===parseInt(t(this).find(".zgpb-fields-quick-options2").length)&&t(this).append(i({type:f.data.type,id:f.data.id})),n=s.find(".zgpb-fields-quick-options2"),r.refresh_quickopt_position()},this.offWholeHover=function(e){e&&(e.stopPropagation(),e.preventDefault()),parseInt(t(this).find(".zgpb-fields-quick-options2").length)>0&&t(this).find(".zgpb-fields-quick-options2").remove()},this.init_events=function(){s.on("mouseenter",r.onWholeHover),s.on("mouseleave",r.offWholeHover),t(window).scroll(function(){r.refresh_quickopt_position()})},this.refresh_quickopt_position=function(){if(n&&n.is(":visible")){var e,i=t(s).offset().top||null,a=i+t(s).height(),o=t(window).scrollTop(),r=o+t(window).height();e=i>o&&ao&&a>r?((r-i)/2).toString()+"px":ir?(o-i+t(window).height()/2).toString()+"px":"50%",n.css("top",e)}},this.enableSettingOptions=function(e,i){this.showSettingTab(),rocketform.checkIntegrityDataField(e.id)&&(this.enableSettingOptions_process(e,!0,!0),rocketform.setDataToSettingTabAndPreview(e.id,f.data),rocketform.loading_boxField("zgfm-panel-right-field-tabopt",0),o&&(rocketform.loading_boxField(e.id,0),o=!1),t("#uiform-build-field-tab").removeClass("zgfm-fieldtab-flag-loading"))},this.setVariables=function(t){o=t.oncreation||!1},this.enableSettingOptions_process=function(e,i,a){var o=t("#uifm-field-opt-content");rocketform.fields_events_bswitch(o),rocketform.fields_events_spinner(o),rocketform.fields2_events_spinner(o),rocketform.fields_events_general(),rocketform.fields_events_cpicker(o),rocketform.fields_events_slider(o),rocketform.fields_events_select(o),rocketform.fields2_events_txts(o)},this.showSettingTab=function(e){var i=t("#uifm-field-selected-id").val();if(String(i)!=String(e)){rocketform.cleanSettingTab();t.each([".uifm-set-section-fieldname",".uifm-tab-fld-label",".uifm-tab-fld-input",".uifm-tab-fld-helpblock",".uifm-tab-fld-validation",".uifm-tab-fld-logicrls",".uifm-set-section-label",".uifm-set-section-sublabel",".uifm-set-section-blocktxt",".uifm-set-section-input-valign",".uifm-set-section-input-placeh",".uifm-set-section-inputtextbox",".uifm-set-section-inputboxbg",".uifm-set-section-inputboxborder",".uifm-set-section-helpblock",".uifm-set-section-validator",".zgfm-set-section-custominput-box","#uifm-custom-val-req-btn","#uifm-custom-val-alpha-btn","#uifm-custom-val-alphanum-btn","#uifm-custom-val-num-btn","#uifm-custom-val-mail-btn",".uifm-set-section-inputappend",".uifm-set-section-label-lbltxt",".uifm-set-section-label-sublbltxt",".uifm-set-section-input1-txtvalue",".uifm-set-section-helpblock-text",".uifm-tab-fld-moreopt"],function(){t(String(this)).removeClass("uifm-hide")}),t('.sfdc-nav-tabs a[href="#uiform-settings-tab-1"]').sfdc_tab("show")}rocketform.checkScrollTab()},this.setToDatalvl1=function(t,e){f.data[t]=e},this.setFieldName=function(t){f.data.field_name=f.data.type_n+t},this.setDataToCoreStore=function(t,e){rocketform.setUiData3("steps_src",t,e,f.data)},this.update_settingsData=function(e){var i=uifm_validate_field(t.extend(!0,{},f,{data:e}),f);f=i},this.setDataToCore=function(t){var e=t.id,i=t.opt1,o=t.opt2,s=t.opt3,r=t.opt4;switch(String(i)){case"skin":default:rocketform.setUiData6("steps_src",a,String(e),String(i),String(o),String(s),r)}},this.setStep=function(t){a=t}};t.fn.uiform_appetext=function(i){return this.each(function(){var a=t(this);if(!a.data("uiform_appetext")){var o=new e(this,i);a.data("uiform_appetext",o)}})}}($uifm),function(t){var e=function(e,i){var a=null,o=!1,s=t(e),r=this,n=null,c={data:{type:19,id:"",skin:{margin:{show_st:1,top:"5",bottom:"5",left:"0",right:"0"},padding:{show_st:1,top:"0",bottom:"0",left:"0",right:"0"},custom_css:{ctm_id:"",ctm_class:"",ctm_additional:""}},field_name:"",order_frm:"0",type_n:"captcha",input6:{txt_color_st:"0",txt_color:"1000",background_st:"0",background_color:"",distortion:"1",behind_lines_st:"0",behind_lines:"2",front_lines_st:"0",front_lines:"2"},label:{text:"Text label",size:"14",bold:0,italic:0,underline:0,color:"#000",font:'{"family":"\'Comic Sans MS\', Arial, sans-serif","name":"Comic Sans MS","classname":"comicsansms"}',font_st:1,shadow_st:0,shadow_color:"#666",shadow_x:1,shadow_y:1,shadow_blur:3},sublabel:{text:"",size:"14",bold:1,italic:1,underline:0,color:"#000",font:'{"family":"\'Comic Sans MS\', Arial, sans-serif","name":"Comic Sans MS","classname":"comicsansms"}',font_st:1,shadow_st:0,shadow_color:"#666",shadow_x:1,shadow_y:1,shadow_blur:3},txt_block:{block_pos:"1",block_st:"1",block_align:"0",grid_layout:"2"},help_block:{text:"here your content",show_st:"0",font:"",font_st:"0",pos:""},validate:{typ_val:"0",typ_val_custxt:"",pos:"0",tip_col:"#000000",tip_bg:"#ffffff",reqicon_st:"0",reqicon_pos:"0",reqicon_img:"glyphicon-asterisk"},clogic:{show_st:"0",f_show:"1",f_all:"1",list:[]}}},f=t.extend(!0,{},c,i);this.publicMethod=function(){};this.testingdata=function(){},this.updateVarData=function(e){t("#"+e).data("uifm-settings",f)},this.update_previewfield=function(e){t("#"+e)&&rocketform.loadForm_updatePreviewField(e,f.data)},this.loadSettingDataTab=function(t){this.showSettingTab(t)},this.onWholeHover=function(e){e&&(e.stopPropagation(),e.preventDefault());var i=wp.template("zgpb-quick-options");0===parseInt(t(this).find(".zgpb-fields-quick-options2").length)&&t(this).append(i({type:f.data.type,id:f.data.id})),n=s.find(".zgpb-fields-quick-options2"),r.refresh_quickopt_position()},this.offWholeHover=function(e){e&&(e.stopPropagation(),e.preventDefault()),parseInt(t(this).find(".zgpb-fields-quick-options2").length)>0&&t(this).find(".zgpb-fields-quick-options2").remove()},this.init_events=function(){s.on("mouseenter",r.onWholeHover),s.on("mouseleave",r.offWholeHover),t(window).scroll(function(){r.refresh_quickopt_position()})},this.refresh_quickopt_position=function(){if(n&&n.is(":visible")){var e,i=t(s).offset().top||null,a=i+t(s).height(),o=t(window).scrollTop(),r=o+t(window).height();e=i>o&&ao&&a>r?((r-i)/2).toString()+"px":ir?(o-i+t(window).height()/2).toString()+"px":"50%",n.css("top",e)}},this.enableSettingOptions=function(e,i){this.showSettingTab(),rocketform.checkIntegrityDataField(e.id)&&(this.enableSettingOptions_process(e,!0,!0),rocketform.setDataToSettingTabAndPreview(e.id,f.data),rocketform.loading_boxField("zgfm-panel-right-field-tabopt",0),o&&(rocketform.loading_boxField(e.id,0),o=!1),t("#uiform-build-field-tab").removeClass("zgfm-fieldtab-flag-loading"))},this.setVariables=function(t){o=t.oncreation||!1},this.enableSettingOptions_process=function(e,i,a){var o=t("#uifm-field-opt-content");rocketform.fields_events_bswitch(o),rocketform.fields_events_spinner(o),rocketform.fields2_events_spinner(o),rocketform.fields_events_general(),rocketform.fields_events_cpicker(o),rocketform.fields_events_slider(o),rocketform.fields_events_select(o),rocketform.fields2_events_txts(o)},this.showSettingTab=function(e){var i=t("#uifm-field-selected-id").val();if(String(i)!=String(e)){rocketform.cleanSettingTab();t.each([".uifm-set-section-fieldname",".uifm-tab-fld-label",".uifm-tab-fld-input",".uifm-tab-fld-helpblock",".uifm-tab-fld-logicrls",".uifm-set-section-label",".uifm-set-section-sublabel",".uifm-set-section-blocktxt",".uifm-set-section-input6",".uifm-set-section-helpblock","#uifm-fld-inp2-block-align-box",".uifm-set-section-input4-defaultvalue",".uifm-set-section-label-lbltxt",".uifm-set-section-label-sublbltxt",".uifm-set-section-input1-txtvalue",".uifm-set-section-helpblock-text",".uifm-tab-fld-moreopt"],function(){t(String(this)).removeClass("uifm-hide")}),t('.sfdc-nav-tabs a[href="#uiform-settings-tab-1"]').sfdc_tab("show")}rocketform.checkScrollTab()},this.setToDatalvl1=function(t,e){f.data[t]=e},this.setDataToCoreStore=function(t,e){rocketform.setUiData3("steps_src",t,e,f.data)},this.update_settingsData=function(e){var i=uifm_validate_field(t.extend(!0,{},f,{data:e}),f);f=i},this.setDataToCore=function(t){var e=t.id,i=t.opt1,o=t.opt2,s=t.opt3,r=t.opt4;switch(String(i)){case"skin":default:rocketform.setUiData6("steps_src",a,String(e),String(i),String(o),String(s),r)}},this.setStep=function(t){a=t}};t.fn.uiform_captcha=function(i){return this.each(function(){var a=t(this);if(!a.data("uiform_captcha")){var o=new e(this,i);a.data("uiform_captcha",o)}})}}($uifm),function(t){var e=function(e,i){var a=null,o=!1,s=t(e),r=this,n=null,c={data:{type:9,id:"",skin:{margin:{show_st:1,top:"5",bottom:"5",left:"0",right:"0"},padding:{show_st:1,top:"0",bottom:"0",left:"0",right:"0"},custom_css:{ctm_id:"",ctm_class:"",ctm_additional:""}},field_name:"",order_frm:"0",type_n:"checkbox",cost_st:"1",input2:{size:"14",bold:0,italic:0,underline:0,color:"#000",font:"",font_st:1,block_align:0,style_type:1,options:{},stl1:{border_color:"#337ab7",bg_color:"#ffffff",icon_color:"#337ab7",icon_mark:"fa-check",size:"14"}},price:{enable_st:"1",lbl_show_st:"1",lbl_show_format:"%3Cp%3E(%5Buifm_symbol%5D%20%5Buifm_price%5D%20%5Buifm_currency%5D)%3C%2Fp%3E",color:"#FF0000",font:'{"family":"\'Comic Sans MS\', Arial, sans-serif","name":"Comic Sans MS","classname":"comicsansms"}',font_st:1},label:{text:"Text label",size:"14",bold:0,italic:0,underline:0,color:"#000",font:'{"family":"\'Comic Sans MS\', Arial, sans-serif","name":"Comic Sans MS","classname":"comicsansms"}',font_st:1,shadow_st:0,shadow_color:"#666",shadow_x:1,shadow_y:1,shadow_blur:3},sublabel:{text:"",size:"14",bold:1,italic:1,underline:0,color:"#000",font:'{"family":"\'Comic Sans MS\', Arial, sans-serif","name":"Comic Sans MS","classname":"comicsansms"}',font_st:1,shadow_st:0,shadow_color:"#666",shadow_x:1,shadow_y:1,shadow_blur:3},txt_block:{block_pos:"1",block_st:"1",block_align:"0",grid_layout:"2"},help_block:{text:"here your content",show_st:"0",font:"",font_st:"0",pos:""},validate:{typ_val:"0",typ_val_custxt:"",pos:"0",tip_col:"#000000",tip_bg:"#ffffff",reqicon_st:"0",reqicon_pos:"0",reqicon_img:"glyphicon-asterisk"},clogic:{show_st:"0",f_show:"1",f_all:"1",list:[]}}},f=t.extend(!0,{},c,i);this.publicMethod=function(){};this.testingdata=function(){},this.updateVarData=function(e){t("#"+e).data("uifm-settings",f)},this.update_previewfield=function(e){t("#"+e)&&rocketform.loadForm_updatePreviewField(e,f.data)},this.loadSettingDataTab=function(t){this.showSettingTab(t)},this.onWholeHover=function(e){e&&(e.stopPropagation(),e.preventDefault());var i=wp.template("zgpb-quick-options");0===parseInt(t(this).find(".zgpb-fields-quick-options2").length)&&t(this).append(i({type:f.data.type,id:f.data.id})),n=s.find(".zgpb-fields-quick-options2"),r.refresh_quickopt_position()},this.offWholeHover=function(e){e&&(e.stopPropagation(),e.preventDefault()),parseInt(t(this).find(".zgpb-fields-quick-options2").length)>0&&t(this).find(".zgpb-fields-quick-options2").remove()},this.init_events=function(){s.on("mouseenter",r.onWholeHover),s.on("mouseleave",r.offWholeHover),t(window).scroll(function(){r.refresh_quickopt_position()})},this.refresh_quickopt_position=function(){if(n&&n.is(":visible")){var e,i=t(s).offset().top||null,a=i+t(s).height(),o=t(window).scrollTop(),r=o+t(window).height();e=i>o&&ao&&a>r?((r-i)/2).toString()+"px":ir?(o-i+t(window).height()/2).toString()+"px":"50%",n.css("top",e)}},this.enableSettingOptions=function(e,i){this.showSettingTab(),rocketform.checkIntegrityDataField(e.id)&&(this.enableSettingOptions_process(e,!0,!0),rocketform.setDataToSettingTabAndPreview(e.id,f.data),rocketform.loading_boxField("zgfm-panel-right-field-tabopt",0),o&&(rocketform.loading_boxField(e.id,0),o=!1),t("#uiform-build-field-tab").removeClass("zgfm-fieldtab-flag-loading"))},this.setVariables=function(t){o=t.oncreation||!1},this.enableSettingOptions_process=function(e,i,a){var o=t("#uifm-field-opt-content");rocketform.fields_events_bswitch(o),rocketform.fields_events_spinner(o),rocketform.fields2_events_spinner(o),rocketform.fields_events_general(),rocketform.fields_events_cpicker(o),rocketform.fields_events_slider(o),rocketform.fields_events_select(o),rocketform.fields2_events_txts(o)},this.showSettingTab=function(e){var i=t("#uifm-field-selected-id").val();if(String(i)!=String(e)){rocketform.cleanSettingTab();t.each([".uifm-set-section-fieldname",".uifm-tab-fld-label",".uifm-tab-fld-input",".uifm-tab-fld-helpblock",".uifm-tab-fld-validation",".uifm-tab-fld-logicrls",".uifm-set-section-label",".uifm-set-section-sublabel",".uifm-set-section-blocktxt",".uifm-set-section-input2",".uifm-set-section-pricesetting",".uifm-set-section-pricesetting2",".uifm-set-section-helpblock",".uifm-set-section-validator","#uifm-custom-val-req-btn","#uifm-fld-inp2-block-align-box",".uifm-set-section-label-lbltxt",".uifm-set-section-label-sublbltxt",".uifm-set-section-helpblock-text",".uifm-tab-fld-moreopt"],function(){t(String(this)).removeClass("uifm-hide")}),t('.sfdc-nav-tabs a[href="#uiform-settings-tab-1"]').sfdc_tab("show")}rocketform.checkScrollTab()},this.setToDatalvl1=function(t,e){f.data[t]=e},this.setFieldName=function(t){f.data.field_name=f.data.type_n+t},this.setDataToCoreStore=function(t,e){rocketform.setUiData3("steps_src",t,e,f.data)},this.update_settingsData=function(e){var i=uifm_validate_field(t.extend(!0,{},f,{data:e}),f);f=i},this.setDataToCore=function(t){var e=t.id,i=t.opt1,o=t.opt2,s=t.opt3,r=t.opt4;switch(String(i)){case"skin":default:rocketform.setUiData6("steps_src",a,String(e),String(i),String(o),String(s),r)}},this.setStep=function(t){a=t},this.input2settings_preview_genAllOptions=function(){var e=f.data.id,i=t("#"+e),a=t("#"+e).closest(".uiform-step-pane").data("uifm-step"),o=rocketform.getUiData5("steps_src",a,e,"input2","block_align"),s=rocketform.getUiData4("steps_src",a,e,"type"),r=rocketform.getUiData5("steps_src",a,e,"input2","options"),n=rocketform.getUiData5("steps_src",a,e,"input2","style_type"),c=rocketform.getUiData4("steps_src",a,e,"input2"),l=CryptoJS.MD5(JSON.stringify(c)),d=t("#"+e).attr("data-zgfm-input2-hash");if(String(d)===String(l));else{var _;switch(t("#"+e).attr("data-zgfm-input2-hash",l),i.find(".uifm-input2-wrap").html(""),parseInt(s)){case 8:t.each(r,function(a,o){(_=t("#uifm_frm_inp2_templates").find(".sfdc-radio").clone()).attr("data-inp2-opt-index",a),_.find(".uifm-inp2-rdo").prop("checked",parseInt(o.checked)),_.find(".uifm-inp2-rdo").attr("name","uifm_"+e+"_opt"),_.find(".uifm-inp2-label").html(o.label),i.find(".uifm-input2-wrap").append(_.prop("outerHTML"))}),i.find(".uifm-input2-wrap").find("label .uifm_frm_price_lbl_cont").html(rocketform.pricesettings_labelformat(t("#"+e))),1===parseInt(o)?i.find(".uifm-input2-wrap .sfdc-radio").attr("class","sfdc-radio-inline"):i.find(".uifm-input2-wrap .sfdc-radio-inline").attr("class","sfdc-radio");break;case 9:t.each(r,function(a,o){(_=t("#uifm_frm_inp2_templates").find(".sfdc-checkbox").clone()).attr("data-inp2-opt-index",a),_.find(".uifm-inp2-chk").prop("checked",parseInt(o.checked)),_.find(".uifm-inp2-chk").attr("name","uifm_"+e+"_opt"),_.find(".uifm-inp2-label").html(o.label),i.find(".uifm-input2-wrap").append(_)}),i.find(".uifm-input2-wrap").find("label .uifm_frm_price_lbl_cont").html(rocketform.pricesettings_labelformat(t("#"+e))),1===parseInt(o)?i.find(".uifm-input2-wrap .sfdc-checkbox").attr("class","sfdc-checkbox-inline"):i.find(".uifm-input2-wrap .sfdc-checkbox-inline").attr("class","sfdc-checkbox"),t("#"+e).attr("data-zgfm-stl1-hash",""),1===parseInt(n)&&this.previewfield_input2_stl1();break;case 10:i.find(".uifm-input2-wrap").append(''),t.each(r,function(t,e){_='
    ',sm_boxmsg_bg_st:"0",sm_boxmsg_bg_type:"1",sm_boxmsg_bg_solid:"",sm_boxmsg_bg_start:"",sm_boxmsg_bg_end:"",sm_redirect_st:"0",sm_redirect_url:"",mail_from_email:"",mail_from_name:"",mail_template_msg:"",mail_recipient:"",mail_cc:"",mail_bcc:"",mail_subject:"",mail_usr_st:"0",mail_usr_template_msg:"",mail_usr_pdf_st:"0",mail_usr_pdf_store:"0",mail_usr_pdf_template_msg:"",mail_usr_pdf_fn:"",mail_usr_recipient:"",mail_usr_recipient_name:"",mail_usr_cc:"",mail_usr_bcc:"",mail_usr_subject:""},summbox:{setting:{enable_st:"0",pos:"0",resp_pos:"0",txt_title1:"Summary box"},skin_box:{box_sd_width:"250"},skin_text:{text:"%3Cp%3ETotal%20%3A%20%5Bzgfm_fvar%20opt%3D%22form_cur_symbol%22%5D%20%5Bzgfm_fvar%20opt%3D%22form_total_amount%22%5D%20%5Bzgfm_fvar%20opt%3D%22form_cur_code%22%5D%3Cbr%20%2F%3E%3Cbr%20%2F%3E%5Buifm_summary%20rows%3D%228%22%20heading%3D%22summary%20%3A%20%22%5D%3C%2Fp%3E%3Cp%3E%5Buifm_summary_link%20value%3D%22Show%20summary%22%5D%3C%2Fp%3E",color:"#000",font:'{"family":"\'Comic Sans MS\', Arial, sans-serif","name":"Comic Sans MS","classname":"comicsansms"}',font_st:1,shadow_st:0,shadow_color:"#666",shadow_x:1,shadow_y:1,shadow_blur:3},form_background:{show_st:"1",type:"1",start_color:"#eeeeee",end_color:"#ffffff",solid_color:"#eeeeee",image:""},form_border_radius:{show_st:"0",size:"5"},form_border:{show_st:"0",color:"#000",style:"1",width:"1"},form_shadow:{show_st:"1",color:"#CCCCCC",h_shadow:"3",v_shadow:"3",blur:"10"}},num_tabs:1,steps:{tab_title:[{title:"Tab title 1"}],tab_cont:[]},steps_src:[]};function o(){t("ul.uiform-list-fields a").draggable({connectToSortable:".uiform-items-container",helper:"clone",revert:"invalid",distance:0,cursorAt:{top:20,left:10},cursor:"move",handle:".sfdc-btn1-icon-left",appendTo:".uiform-main-form",drag:function(t,e){}}).disableSelection()}function s(){t(".uiform-items-container").sortable({placeholder:"uiform-draggable-placeholder",connectWith:".uiform-items-container",revert:!1,helper:function(e,i){var a=t(i).attr("data-typefield"),o=t(".uiform-builder-fields").first().find('a[data-type="'+a+'"]').html();return t('
    '+o+"
    ")},handle:".uiform-field-move",sort:function(t,e){e.placeholder},receive:function(t,e){var i=e.item.data("type");e.item.attr("id")||(uiform_is_dragging=!1,rocketform.showLoader(1,!0,!0),rocketform.getFieldsAfterDraggable(this,i,!1,""))},stop:function(i,a){t("#zgpb-editor-container").find(".zgpb-draggable-helper").length&&t("#zgpb-editor-container").find(".zgpb-draggable-helper").remove(),t("#zgpb-editor-container").find(".zgpb-fl-gs-block-style-hover").length&&t("#zgpb-editor-container").find(".zgpb-fl-gs-block-style-hover").removeClass("zgpb-fl-gs-block-style-hover"),!0===uiform_is_dragging&&(rocketform.hideLoader(),!0===uiform_is_children&&t(e).trigger("resize"))},start:function(t,e){uiform_is_dragging=!0,uiform_is_children=!1;e.item.attr("id")},tolerance:"pointer",opacity:.5})}arguments.callee.backend_init_load=function(){o(),s()},arguments.callee.setInnerVariable=function(t,e){i.innerVars[t]=e},arguments.callee.getInnerVariable=function(t){return i.innerVars[t]?i.innerVars[t]:""},arguments.callee.generateUniqueID=function(){var t=Math.random();return t.toString(36),t.toString(36).substr(2,9)},arguments.callee.generateSuffixID=function(t,e){return Math.floor(Math.random()*(e-t+1)+t)},arguments.callee.setUiVar=function(t,e){uivars[t]=e},arguments.callee.setUiArray=function(t,e,i){uivars[t][e]=i},arguments.callee.getUiArray=function(t,e){return uivars[t][e]},arguments.callee.getUiVar=function(t){return uivars[t]},arguments.callee.getFieldById=function(t){return uivars.fields[t]},arguments.callee.getFieldArray=function(t,e){return uivars.fields[t][e]},arguments.callee.showLoader=function(e,i,a){switch(parseInt(e)){case 2:rocketform.alerts_msg(3,t("#alert_header_msg_processing").val());break;case 3:rocketform.alerts_msg(1,t("#alert_header_saving").val());break;case 4:rocketform.alerts_msg(3,t("#alert_header_msg_removing").val());break;case 5:rocketform.alerts_msg(1,t("#alert_header_form_saved").val());break;case 1:default:rocketform.alerts_msg(2,t("#alert_header_loading").val())}i?t("#uifm-loading-box").find(".sfdc-alert").append(' '):t("#uifm-loading-box").find(".uifm-loader-header-1").remove(),a?t("#uifm-loading-box").fadeTo(2e3,500).slideUp(500,function(){t("#uifm-loading-box").slideUp(500)}):t("#uifm-loading-box").show(),t("#uifm-loading-box").show()},arguments.callee.hideLoader=function(){t("#uifm-loading-box").hide(),t("#uifm-loading-box").find(".alert").attr("class","alert").html("")},arguments.callee.loading_boxField=function(e,i){1===parseInt(i)?t('
    ').appendTo(t("#"+e).css("position","relative")):t("#"+e).find(".uiform-field-loadingst").remove()},arguments.callee.loading_panelbox2=function(e){1===parseInt(e)?(t("#uiform-panel-loadingst").parent().css("position","relative"),t("#uiform-panel-loadingst").show()):(t("#uiform-panel-loadingst").parent().removeCss("position","relative"),t("#uiform-panel-loadingst").hide())},arguments.callee.loading_panelbox=function(i,a){1===parseInt(a)?t("#"+i).show("fast",function(){t(e).trigger("resize")}):t("#uiform-panel-loadingst").hide()},arguments.callee.alerts_global_msg=function(t,e){var i;switch(parseInt(t)){case 1:i="alert-success";break;case 2:i="alert-info";break;case 3:i="alert-warning";break;case 4:i="alert-danger"}var a="";return a+='
    ',a+='×',a+=e,a+="
    "},arguments.callee.alerts_msg=function(e,i){var a;switch(parseInt(e)){case 1:a="uifm-alert-success";break;case 2:a="uifm-alert-info";break;case 3:a="uifm-alert-warning";break;case 4:a="uifm-alert-danger"}t("#uifm-loading-box").find(".uifm-alert").attr("class","uifm-alert "+a).html(i).append(' ')},arguments.callee.setHighlightPicked=function(e){t(document).find(".uifm-highlight-edited")&&t(document).find(".uifm-highlight-edited").removeClass("uifm-highlight-edited"),e.addClass("uifm-highlight-edited")},arguments.callee.getUiData=function(t){return a[t]},arguments.callee.setUiData=function(t,e){a[t]=e},arguments.callee.getUiData2=function(t,e){try{return a[t][e]}catch(t){}},arguments.callee.delUiData2=function(t,e){delete a[t][e]},arguments.callee.spliceUiData2=function(t,e){parseInt(e)>-1&&a[t].splice(parseInt(e),1)},arguments.callee.setUiData2=function(t,e,i){a.hasOwnProperty(t)||(a[t]={}),a[t].hasOwnProperty(e)||(a[t][e]={}),a[t][e]=i},arguments.callee.addIndexUiData2=function(t,e,i){void 0===a[t][e]||(a[t][e][i]={})},arguments.callee.getUiData3=function(t,e,i){try{return a[t][e][i]}catch(t){}},arguments.callee.delUiData3=function(t,e,i){delete a[t][e][i]},arguments.callee.spliceUiData3=function(t,e,i){parseInt(i)>-1&&a[t][e].splice(parseInt(i),1)},arguments.callee.setUiData3=function(t,e,i,o){a.hasOwnProperty(t)||(a[t]={}),a[t].hasOwnProperty(e)||(a[t][e]={}),a[t][e][i]=o},arguments.callee.setUiData4=function(t,e,i,o,s){a.hasOwnProperty(t)||(a[t]={}),a[t].hasOwnProperty(e)||(a[t][e]={}),a[t][e].hasOwnProperty(i)||(a[t][e][i]={}),a[t][e][i][o]=s},arguments.callee.getUiData4=function(t,e,i,o){try{return a[t][e][i][o]}catch(t){}},arguments.callee.getUiData5=function(t,e,i,o,s){try{return void 0===a[t][e]?"":a[t][e][i][o][s]}catch(t){return""}},arguments.callee.setUiData5=function(t,e,i,o,s,r){a.hasOwnProperty(t)||(a[t]={}),a[t].hasOwnProperty(e)||(a[t][e]={}),a[t][e].hasOwnProperty(i)||(a[t][e][i]={}),a[t][e][i].hasOwnProperty(o)||(a[t][e][i][o]={}),a[t][e][i][o][s]=r},arguments.callee.addIndexUiData5=function(t,e,i,o,s,r){void 0===a[t][e][i][o][s]||(a[t][e][i][o][s][r]={})},arguments.callee.getUiData6=function(t,e,i,o,s,r){try{return void 0===a[t][e][i][o][s][r]?"":a[t][e][i][o][s][r]}catch(t){return""}},arguments.callee.setUiData6=function(t,e,i,o,s,r,n){a.hasOwnProperty(t)||(a[t]={}),a[t].hasOwnProperty(e)||(a[t][e]={}),a[t][e].hasOwnProperty(i)||(a[t][e][i]={}),a[t][e][i].hasOwnProperty(o)||(a[t][e][i][o]={}),a[t][e][i][o].hasOwnProperty(s)||(a[t][e][i][o][s]={}),a[t][e][i][o][s][r]=n},arguments.callee.delUiData6=function(t,e,i,o,s,r){delete a[t][e][i][o][s][r]},arguments.callee.getUiData7=function(t,e,i,o,s,r,n){try{return void 0===a[t][e][i][o][s][r][n]?"":a[t][e][i][o][s][r][n]}catch(t){return""}},arguments.callee.setUiData7=function(t,e,i,o,s,r,n,c){a.hasOwnProperty(t)||(a[t]={}),a[t].hasOwnProperty(e)||(a[t][e]={}),a[t][e].hasOwnProperty(i)||(a[t][e][i]={}),a[t][e][i].hasOwnProperty(o)||(a[t][e][i][o]={}),a[t][e][i][o].hasOwnProperty(s)||(a[t][e][i][o][s]={}),a[t][e][i][o][s].hasOwnProperty(r)||(a[t][e][i][o][s][r]={}),a[t][e][i][o][s][r][n]=c},arguments.callee.addIndexUiData7=function(t,e,i,o,s,r,n){void 0===a[t][e][i][o][s][r]||(a[t][e][i][o][s][r][n]={})},arguments.callee.setUiData8=function(t,e,i,o,s,r,n,c,f){a.hasOwnProperty(t)||(a[t]={}),a[t].hasOwnProperty(e)||(a[t][e]={}),a[t][e].hasOwnProperty(i)||(a[t][e][i]={}),a[t][e][i].hasOwnProperty(o)||(a[t][e][i][o]={}),a[t][e][i][o].hasOwnProperty(s)||(a[t][e][i][o][s]={}),a[t][e][i][o][s].hasOwnProperty(r)||(a[t][e][i][o][s][r]={}),a[t][e][i][o][s][r].hasOwnProperty(n)||(a[t][e][i][o][s][r][n]={}),a[t][e][i][o][s][r][n][c]=f},arguments.callee.addIndexUiData8=function(t,e,i,o,s,r,n,c){void 0===a[t][e][i][o][s][r][n]||(a[t][e][i][o][s][r][n][c]={})},arguments.callee.delUiData8=function(t,e,i,o,s,r,n,c){delete a[t][e][i][o][s][r][n][c]},arguments.callee.setUiData9=function(t,e,i,o,s,r,n,c,f,l){a.hasOwnProperty(t)||(a[t]={}),a[t].hasOwnProperty(e)||(a[t][e]={}),a[t][e].hasOwnProperty(i)||(a[t][e][i]={}),a[t][e][i].hasOwnProperty(o)||(a[t][e][i][o]={}),a[t][e][i][o].hasOwnProperty(s)||(a[t][e][i][o][s]={}),a[t][e][i][o][s].hasOwnProperty(r)||(a[t][e][i][o][s][r]={}),a[t][e][i][o][s][r].hasOwnProperty(n)||(a[t][e][i][o][s][r][n]={}),a[t][e][i][o][s][r][n].hasOwnProperty(c)||(a[t][e][i][o][s][r][n][c]={}),a[t][e][i][o][s][r][n][c][f]=l},arguments.callee.checkIntegrityDataField=function(e){try{var i=t("#"+e).closest(".uiform-step-pane").data("uifm-step");return void 0!==a.steps_src[parseInt(i)][e]}catch(t){return!1}},arguments.callee.dumpvar3=function(t){return JSON.stringify(t,null,2)},arguments.callee.dumpvar2=function(t){return JSON.stringify(t)},arguments.callee.dumpvar=function(t){var e=[];JSON.stringify(t,function(t,i){if(null!=i&&"object"==typeof i){if(e.indexOf(i)>=0)return;e.push(i)}return i});return e},arguments.callee.checkScrollTab=function(){var e=t(".uiform-set-options-tabs").find("ul.sfdc-nav-tabs"),i=0;e.find("li").each(function(e){i+=parseInt(t(this).width())}),i>480?t(".uiform-set-options-tabs").find(".uifm-tab-navigation").show():t(".uiform-set-options-tabs").find(".uifm-tab-navigation").hide()},arguments.callee.setScrollTab=function(e,i){var a,o=t(i).parent().parent().parent().find("ul.sfdc-nav-tabs");(a=o.css("left")).replace("px",""),a=e>0?parseInt(a)+10:parseInt(a)-10;var s=0;o.find("li").each(function(e){s+=parseInt(t(this).width())}),a>0&&(a=0),s+a<410&&(a=parseInt(a)+10),o.css("left",a+"px")},arguments.callee.cleanSettingTab=function(){var e;e=[".uifm-set-section-fieldname",".uifm-tab-fld-label",".uifm-tab-fld-input",".uifm-tab-fld-helpblock",".uifm-tab-fld-validation",".uifm-tab-fld-misc",".uifm-tab-fld-appendimgs",".uifm-tab-fld-logicrls",".uifm-set-section-label",".uifm-set-section-sublabel",".uifm-set-section-blocktxt",".uifm-set-section-inputtextbox",".uifm-set-section-input12boxbg",".uifm-set-section-input13boxbg",".uifm-set-section-input-placeh",".uifm-set-section-input-valign",".uifm-set-section-input-objalign",".uifm-set-section-inputboxbg",".uifm-set-section-inputboxborder",".uifm-set-section-input12boxborder",".uifm-set-section-input13boxborder",".uifm-set-section-input2",".uifm-set-section-input3",".uifm-set-section-input4",".uifm-set-section-input4-skin-maxwidth",".uifm-set-section-input5",".uifm-set-section-input6",".uifm-set-section-input7",".uifm-set-section-input8",".uifm-set-section-input9",".uifm-set-section-input11",".uifm-set-section-input12",".uifm-set-section-input13",".uifm-set-section-input14",".uifm-set-section-input15",".uifm-set-section-input16",".uifm-set-section-input17",".uifm-set-section-input18","#uifm-fld-inp-date2-box",".uifm-set-section-pricesetting",".uifm-set-section-pricesetting2",".uifm-set-section-inputprice",".uifm-set-section-helpblock",".uifm-set-section-validator",".zgfm-set-section-custominput-box","#uifm-custom-val-req-btn","#uifm-custom-val-alpha-btn","#uifm-custom-val-alphanum-btn","#uifm-custom-val-num-btn","#uifm-custom-val-mail-btn","#uifm-fld-inp2-block-align-box",".uifm-set-section-inputprepend",".uifm-set-section-inputappend",".uifm-set-section-input4-range",".uifm-set-section-input4-defaultvalue",".uifm-set-section-input4-spinner-opts",".uifm-set-section-label-lbltxt",".uifm-set-section-label-sublbltxt",".uifm-set-section-input1-txtvalue",".uifm-set-section-helpblock-text",".uifm-tab-fld-moreopt"],t.each(e,function(){t(String(this)).addClass("uifm-hide")}),t("#uifm_fld_main_fldname").val(""),e=["#uifm_fld_inp_align_1","#uifm_fld_inp_align_2","#uifm_fld_inp_align_3","#uifm_fld_lbl_blo_pos_1","#uifm_fld_lbl_blo_pos_2","#uifm_fld_lbl_blo_pos_3","#uifm_fld_lbl_blo_pos_4","#uifm_fld_lbl_blo_align_1","#uifm_fld_lbl_blo_align_2","#uifm_fld_lbl_blo_align_3","#uifm_fld_elbor_style_1","#uifm_fld_elbor_style_2","#uifm_fld_hblock_pos_1","#uifm_fld_hblock_pos_2","#uifm_fld_hblock_pos_3","#uifm_fld_hblock_pos_4","#uifm_fld_val_pos_1","#uifm_fld_val_pos_2","#uifm_fld_val_pos_3","#uifm_fld_val_pos_4"],t.each(e,function(){t(String(this)).prop("checked",!1),t(String(this)).parent().removeClass("sfdc-active")}),e=["#uifm_fld_val_reqicon_pos_2","#uifm_fld_val_reqicon_pos_1"],t.each(e,function(){t(String(this)).prop("checked",!1),t(String(this)).removeClass("sfdc-active")}),e=["#uifm-custom-val-req-custxt","#uifm-custom-val-alpha-custxt","#uifm-custom-val-alphanum-custxt","#uifm-custom-val-numbers-custxt","#uifm-custom-val-email-custxt"],t.each(e,function(){t(String(this)).val("")})},arguments.callee.closeSettingTab=function(){t('.sfdc-nav-tabs a[href="#uiform-build-form-tab"]').sfdc_tab("show"),t('.sfdc-nav-tabs a[href="#uiform-settings-tab3-2"]').sfdc_tab("show"),t(".uifm-tab-selectedfield").hide(),t("#uifm-field-selected-id").val("")},arguments.callee.loadDataOptionByFieldId=function(t){},arguments.callee.enableSettingTabOption=function(e){switch(e){case"uifm-label":case"uifm-sublabel":t('.sfdc-nav-tabs a[href="#uiform-settings-tab-1"]').sfdc_tab("show"),rocketform.setInnerVariable("setfield_tab_active","label");break;case"uifm-txtbox-inp-val":t('.sfdc-nav-tabs a[href="#uiform-settings-tab-2"]').sfdc_tab("show"),rocketform.setInnerVariable("setfield_tab_active","input");break;case"uifm-help-block":t('.sfdc-nav-tabs a[href="#uiform-settings-tab-3"]').sfdc_tab("show"),rocketform.setInnerVariable("setfield_tab_active","helpb")}},arguments.callee.setDataToSettingTab=function(e,i){var a,o=t("#uifm-field-selected-id").val();t("#"+e);if(e===o){var s=t("#uifm-field-selected-id").parent();t.each(i,function(e,i){t.isPlainObject(i)&&t.each(i,function(i,o){t.isPlainObject(o)?t.each(o,function(t,o){(a=[]).push(e),a.push(i),a.push(t),rocketform.setDataOptToSetTab(s,a.join("-"),o)}):((a=[]).push(e),a.push(i),rocketform.setDataOptToSetTab(s,a.join("-"),o))})})}},arguments.callee.setDataToSettingTabAndPreview=function(e,i){var a,o=t("#uifm-field-selected-id").val(),s=t("#"+e);if(e===o){var r=t("#uifm-field-selected-id").parent();t.each(i,function(e,o){t.isPlainObject(o)?t.each(o,function(i,o){t.isPlainObject(o)?t.each(o,function(o,n){t.isPlainObject(n)?t.each(n,function(t,n){(a=[]).push(e),a.push(i),a.push(o),a.push(t),rocketform.setDataOptToSetTab(r,a.join("-"),n),rocketform.setDataOptToPrevField(s,a.join("-"),n)}):((a=[]).push(e),a.push(i),a.push(o),rocketform.setDataOptToSetTab(r,a.join("-"),n),rocketform.setDataOptToPrevField(s,a.join("-"),n))}):((a=[]).push(e),a.push(i),rocketform.setDataOptToSetTab(r,a.join("-"),o),rocketform.setDataOptToPrevField(s,a.join("-"),o))}):rocketform.setDataOptToSetTab_1(r,e,o,i.type)})}},arguments.callee.loadForm_updatePreviewField=function(e,i){try{var a=t("#"+e);t.each(i,function(e,i){t.isPlainObject(i)&&t.each(i,function(i,o){t.isPlainObject(o)?t.each(o,function(t,o){rocketform.setDataOptToPrevField(a,e+"-"+i+"-"+t,o)}):rocketform.setDataOptToPrevField(a,e+"-"+i,o)})})}catch(t){}},arguments.callee.setDataToPreviewField=function(e,i){var a=t("#"+e);a&&t.each(i,function(e,i){t.isPlainObject(i)&&t.each(i,function(t,i){rocketform.setDataOptToPrevField(a,e+"-"+t,i)})})},arguments.callee.setDataOptToCoreData=function(t,e,i,a){try{var o,s,r,n,c=(n=i.split("-")).length;switch(o=n[0],s=n[1],r=n[2]||null,String(o)){case"input18":r=n[2]||"",this.setUiData6("steps_src",String(t),String(e),String(o),String(s),String(r),a);break;default:switch(parseInt(c)){case 3:this.setUiData6("steps_src",String(t),String(e),String(o),String(s),String(r),a);break;case 2:this.setUiData5("steps_src",String(t),String(e),String(o),String(s),a)}}}catch(t){}},arguments.callee.previewform_shadowBox=function(t){var e,i,a,o,s,r;s=this.getUiData3("skin","form_shadow","show_st"),i=this.getUiData3("skin","form_shadow","h_shadow"),a=this.getUiData3("skin","form_shadow","v_shadow"),o=this.getUiData3("skin","form_shadow","blur"),r=this.getUiData3("skin","form_shadow","color"),1===parseInt(s)?(e=i+"px "+a+"px "+o+"px "+r,t.find(".uiform-main-form").css("box-shadow",e)):t.find(".uiform-main-form").removeCss("box-shadow")},arguments.callee.previewsummbox_shadowBox=function(){var e,i,a,o,s,r;s=this.getUiData3("summbox","form_shadow","show_st"),i=this.getUiData3("summbox","form_shadow","h_shadow"),a=this.getUiData3("summbox","form_shadow","v_shadow"),o=this.getUiData3("summbox","form_shadow","blur"),r=this.getUiData3("summbox","form_shadow","color"),1===parseInt(s)?(e=i+"px "+a+"px "+o+"px "+r,t("#uifm-sticky-sidebar-box").css("box-shadow",e)):t("#uifm-sticky-sidebar-box").removeCss("box-shadow")},arguments.callee.previewfield_shadowBox=function(e,i,a){var o,s,r,n,c,f,l=e.attr("id"),d=t("#"+l).closest(".uiform-step-pane").data("uifm-step");c=this.getUiData5("steps_src",d,l,i,"shadow_st"),s=this.getUiData5("steps_src",d,l,i,"shadow_x"),r=this.getUiData5("steps_src",d,l,i,"shadow_y"),n=this.getUiData5("steps_src",d,l,i,"shadow_blur"),f=this.getUiData5("steps_src",d,l,i,"shadow_color"),1===parseInt(c)?(o=s+"px "+r+"px "+n+"px "+f,e.find(a).css("text-shadow",o)):e.find(a).removeCss("text-shadow")},arguments.callee.previewfield_elementBorderRadius=function(e,i,a){var o=e.attr("id"),s=t("#"+o).closest(".uiform-step-pane").data("uifm-step"),r=this.getUiData5("steps_src",s,o,i,"show_st"),n=this.getUiData5("steps_src",s,o,i,"size");1===parseInt(r)?e.find(a).css("border-radius",n+"px"):e.find(a).removeCss("border-radius")},arguments.callee.previewform_elementBorderRadius=function(t,e){var i=this.getUiData3("skin","form_border_radius","show_st"),a=this.getUiData3("skin","form_border_radius","size");1===parseInt(i)?t.find(".uiform-main-form").css("border-radius",a+"px"):t.find(".uiform-main-form").removeCss("border-radius")},arguments.callee.previewsummbox_elementBorderRadius=function(){var e=this.getUiData3("summbox","form_border_radius","show_st"),i=this.getUiData3("summbox","form_border_radius","size");1===parseInt(e)?t("#uifm-sticky-sidebar-box").css("border-radius",i+"px"):t("#uifm-sticky-sidebar-box").removeCss("border-radius")},arguments.callee.previewfield_elementHelpBlockText=function(e,i){var a=e.attr("id"),o=t("#"+a).closest(".uiform-step-pane").data("uifm-step"),s=this.getUiData5("steps_src",o,a,i,"show_st"),r=this.getUiData5("steps_src",o,a,i,"text"),n=(this.getUiData5("steps_src",o,a,i,"font"),this.getUiData5("steps_src",o,a,i,"font_st"),this.getUiData5("steps_src",o,a,i,"pos")),c=(e.find(".uifm-input-container"),e.find(".uifm-help-block"),e.find(".uifm-label-helpblock"));if(1===parseInt(s))switch(parseInt(n)){case 1:e.find(".uifm-help-block").html(decodeURIComponent(r));break;case 2:c.attr("data-original-title")&&(c.attr("data-original-title",decodeURIComponent(r)),c.tooltip("hide"),c.tooltip({animation:!1,placement:c.data("placement")||"top",container:"body",html:!0,title:decodeURIComponent(r)}),c.tooltip("show"));break;case 3:t("#"+a+"_hb_modal")&&t("#"+a+"_hb_modal").find(".sfdc-modal-body").html(decodeURIComponent(r));break;case 0:default:e.find(".uifm-help-block").html(decodeURIComponent(r))}},arguments.callee.previewfield_elementTextarea=function(e,i){var a=e.attr("id"),o=t("#"+a).closest(".uiform-step-pane").data("uifm-step"),s=this.getUiData5("steps_src",o,a,i,"show_st"),r=(this.getUiData5("steps_src",o,a,i,"text"),this.getUiData5("steps_src",o,a,i,"font")),n=this.getUiData5("steps_src",o,a,i,"font_st");if(1===parseInt(s))if(this.previewfield_elementHelpBlockText(e,i),1===parseInt(n)&&r){var c=JSON.parse(r);e.find(".uifm-help-block").css("font-family",c.family)}else e.find(".uifm-help-block").removeCss("font-family");else e.find(".uifm-help-block").css("display","none"),e.find(".uifm-label-helpblock").hide()},arguments.callee.previewfield_helpBlockPosition=function(e,i){var a=e.attr("id"),o=t("#"+a).closest(".uiform-step-pane").data("uifm-step"),s=this.getUiData5("steps_src",o,a,i,"show_st"),r=this.getUiData5("steps_src",o,a,i,"pos"),n=this.getUiData5("steps_src",o,a,i,"text"),c=e.find(".uifm-input-container"),f=e.find(".uifm-help-block"),l=e.find(".uifm-label-helpblock");if(1===parseInt(s))switch(parseInt(r)){case 1:l.attr("data-original-title")&&(l.data&&l.data("tooltip")||(l.tooltip("hide"),l.tooltip("destroy")),l.removeAttr("data-original-title")),t("#"+a+"_hb_modal")&&t("#"+a+"_hb_modal").remove(),l.hide(),f.show(),t(f).insertBefore(c);break;case 2:t("#"+a+"_hb_modal")&&t("#"+a+"_hb_modal").remove(),l.attr("data-original-title")&&(l.data&&l.data("tooltip")||(l.tooltip("hide"),l.tooltip("destroy")),l.removeAttr("data-original-title")),l.show(),f.hide(),l.tooltip({animation:!1,placement:l.data("placement")||"top",container:"body",html:!0,title:n}),l.attr("data-original-title",decodeURIComponent(n)),"helpb"===String(this.getInnerVariable("setfield_tab_active"))&&l.tooltip("show");break;case 3:l.attr("data-original-title")&&(l.data&&l.data("tooltip")||(l.tooltip("hide"),l.tooltip("destroy")),l.removeAttr("data-original-title")),l.show(),f.hide();var d=t("#modaltemplate").clone();d.attr("id",a+"_hb_modal"),d.find(".sfdc-modal-body").html(decodeURIComponent(n)),t("body").append(d),l.attr("data-target","#"+a+"_hb_modal"),l.attr("data-toggle","modal");break;case 0:default:l.attr("data-original-title")&&(l.data&&l.data("tooltip")||(l.tooltip("hide"),l.tooltip("destroy")),l.removeAttr("data-original-title")),t("#"+a+"_hb_modal")&&t("#"+a+"_hb_modal").remove(),l.hide(),f.show(),t(c).insertBefore(f)}else l.attr("data-original-title")&&(l.data&&l.data("tooltip")||(l.tooltip("hide"),l.tooltip("destroy")),l.removeAttr("data-original-title")),t("#"+a+"_hb_modal")&&t("#"+a+"_hb_modal").remove(),l.hide(),f.hide()},arguments.callee.previewfield_validateRecIcon=function(e,i){var a=e.attr("id"),o=t("#"+a).closest(".uiform-step-pane").data("uifm-step"),s=this.getUiData5("steps_src",o,a,i,"reqicon_st"),r=this.getUiData5("steps_src",o,a,i,"reqicon_pos"),n=this.getUiData5("steps_src",o,a,i,"reqicon_img"),c=e.find(".uifm-label");1===parseInt(s)?(t("#"+a+"_val_iconreq_img").remove(),1===parseInt(r)?c.after(''):c.before('')):t("#"+a+"_val_iconreq_img").remove()},arguments.callee.previewfield_hideAllPopOver=function(){var e=t("#uifm-field-selected-id").val(),i=t("#"+e);if(i){var a=i.find(".uifm-txtbox-inp-val");a.data&&a.data("bs.sfdc_popover")&&a.sfdc_popover("destroy")}},arguments.callee.previewfield_removeAllPopovers=function(){var e=t(".uiform-main-form [aria-describedby^=popover]");e&&t.each(e,function(e,i){t(i).data&&t(i).data("bs.sfdc_popover")&&t(i).sfdc_popover("destroy")})},arguments.callee.previewfield_removeAllUndesiredObj=function(e){var i=t(".uiform-main-form .uiform-datepicker").not(e).find(".bootstrap-datetimepicker-widget");i&&i.remove()},arguments.callee.previewfield_hidePopOver=function(){var e=t("#uifm-field-selected-id").val(),i=t("#"+e);if(i){var a=i.find(".uifm-txtbox-inp-val");switch(String(this.getInnerVariable("setfield_tab_active"))){case"label":case"input":case"helpb":a.data&&a.data("bs.sfdc_popover")&&a.sfdc_popover("destroy");break;case"validate":this.previewfield_validatePopover(i,"validate")}}},arguments.callee.previewfield_helpblock_hidetooltip=function(){var e=t("#uifm-field-selected-id").val(),i=t("#"+e);if(i){var a=i.find(".uifm-label-helpblock");switch(String(this.getInnerVariable("setfield_tab_active"))){case"helpb":break;default:case"label":case"input":case"helpb":a.data&&a.data("bs.tooltip")&&a.tooltip("destroy")}}},arguments.callee.previewfield_validatePopover=function(e,i){var a,o=e.attr("id"),s=t("#"+o).closest(".uiform-step-pane").data("uifm-step"),r=this.getUiData4("steps_src",s,o,"type"),n=this.getUiData5("steps_src",s,o,i,"typ_val"),c=this.getUiData5("steps_src",s,o,i,"typ_val_custxt"),f=this.getUiData5("steps_src",s,o,i,"pos"),l=this.getUiData5("steps_src",s,o,i,"tip_col"),d=this.getUiData5("steps_src",s,o,i,"tip_bg");switch(parseInt(r)){case 6:case 7:a=e.find(".uifm-txtbox-inp-val");break;case 8:case 9:case 10:case 11:a=e.find(".uifm-input2-wrap");break;case 12:a=e.find(".uifm-fileinput-wrap");break;case 13:a=e.find(".uifm-fileinput-wrap .fileinput-preview");break;case 15:a=e.find(".uifm-txtbox-inp-val");break;case 19:a=e.find(".uifm-inp6-captcha-inputcode");break;case 23:a=e.find(".uiform-colorpicker-wrap");break;case 24:a=e.find(".uifm-input7-datepic");break;case 25:a=e.find(".uifm-input7-timepic");break;case 26:a=e.find(".uifm-input7-datetimepic");break;case 27:a=e.find(".uifm-input-recaptcha");break;case 28:case 29:case 30:a=e.find(".uifm-txtbox-inp-val");break;case 43:default:return}var _,m,p;switch(parseInt(n)){case 1:_=t("#uifm-custom-val-alpha-deftxt").val(),m=c||_;break;case 2:_=t("#uifm-custom-val-alphanum-deftxt").val(),m=c||_;break;case 3:_=t("#uifm-custom-val-numbers-deftxt").val(),m=c||_;break;case 4:_=t("#uifm-custom-val-email-deftxt").val(),m=c||_;break;case 5:_=t("#uifm-custom-val-req-deftxt").val(),m=c||_}switch(parseInt(f)){case 1:p="right";break;case 2:p="bottom";break;case 3:p="left";break;case 0:default:p="top"}switch(parseInt(n)){case 6:t("#zgfm-field-val-custominput-box").show();break;default:t("#zgfm-field-val-custominput-box").hide()}switch(parseInt(n)){case 1:case 2:case 3:case 4:case 5:case 6:var u;a.data&&a.data("bs.sfdc_popover")&&a.sfdc_popover("destroy"),a.sfdc_popover({placement:p,content:m,trigger:"manual",animation:!1,container:"body",html:!0}).focus(function(){a.sfdc_popover("show")}).blur(function(){a.sfdc_popover("hide")}),"validate"===String(this.getInnerVariable("setfield_tab_active"))&&a.sfdc_popover("show"),u=a.attr("aria-describedby");var h="";if(t("#"+o)){switch(t("#"+o+"_val_ppbox").remove(),h='",t("head").append(h)}t("#uifm-custom-val-title-added").show();break;default:t("#uifm-custom-val-title-added").hide(),a.data&&a.data("bs.sfdc_popover")&&a.sfdc_popover("destroy")}},arguments.callee.previewfield_elementBorder=function(e,i,a){var o,s=e.attr("id"),r=t("#"+s).closest(".uiform-step-pane").data("uifm-step"),n=this.getUiData5("steps_src",r,s,i,"show_st"),c=this.getUiData5("steps_src",r,s,i,"color"),f=(this.getUiData5("steps_src",r,s,i,"color_focus_st"),this.getUiData5("steps_src",r,s,i,"color_focus"),this.getUiData5("steps_src",r,s,i,"style")),l=this.getUiData5("steps_src",r,s,i,"width");1===parseInt(n)?(o=1===parseInt(f)?"solid ":"dotted ",o+=c+" "+l+"px",e.find(a).css("border",o)):e.find(a).removeCss("border")},arguments.callee.previewform_elementBorder=function(t,e){var i,a=this.getUiData3("skin","form_border","show_st"),o=this.getUiData3("skin","form_border","color"),s=this.getUiData3("skin","form_border","style"),r=this.getUiData3("skin","form_border","width");1===parseInt(a)?(i=1===parseInt(s)?"solid ":"dotted ",i+=o+" "+r+"px",t.find(".uiform-main-form").css("border",i)):t.find(".uiform-main-form").removeCss("border")},arguments.callee.previewsummbox_elementBorder=function(){var e,i=this.getUiData3("summbox","form_border","show_st"),a=this.getUiData3("summbox","form_border","color"),o=this.getUiData3("summbox","form_border","style"),s=this.getUiData3("summbox","form_border","width");1===parseInt(i)?(e=1===parseInt(o)?"solid ":"dotted ",e+=a+" "+s+"px",t("#uifm-sticky-sidebar-box").css("border",e)):t("#uifm-sticky-sidebar-box").removeCss("border")},arguments.callee.previewfield_elementBackground=function(e,i,a){var o=e.attr("id"),s=t("#"+o).closest(".uiform-step-pane").data("uifm-step"),r=this.getUiData5("steps_src",s,o,i,"show_st"),n=this.getUiData5("steps_src",s,o,i,"type"),c=this.getUiData5("steps_src",s,o,i,"start_color"),f=this.getUiData5("steps_src",s,o,i,"end_color"),l=this.getUiData5("steps_src",s,o,i,"solid_color");if(1===parseInt(r))switch(parseInt(n)){case 2:e.find(a).css({background:c,"background-image":"-webkit-linear-gradient(top, "+c+", "+f+")","background-image":"-moz-linear-gradient(top, "+c+", "+f+")","background-image":"-ms-linear-gradient(top, "+c+", "+f+")","background-image":"-o-linear-gradient(top, "+c+", "+f+")","background-image":"linear-gradient(to bottom, "+c+","+f+")"});break;case 1:default:l&&e.find(a).css("background",l)}else e.find(a).removeCss("background"),e.find(a).removeCss("background-image")},arguments.callee.previewform_elementPadding=function(t,e){var i=this.getUiData3("skin","form_padding","show_st"),a=this.getUiData3("skin","form_padding","pos_top"),o=this.getUiData3("skin","form_padding","pos_right"),s=this.getUiData3("skin","form_padding","pos_bottom"),r=this.getUiData3("skin","form_padding","pos_left");if(1===parseInt(i)){var n=a+"px "+o+"px "+s+"px "+r+"px";t.find(".uiform-main-form").css("padding",n)}else t.find(".uiform-main-form").removeCss("padding")},arguments.callee.previewform_elementBackground=function(e,i){var a=this.getUiData3("skin","form_background","show_st"),o=this.getUiData3("skin","form_background","type"),s=this.getUiData3("skin","form_background","start_color"),r=this.getUiData3("skin","form_background","end_color"),n=this.getUiData3("skin","form_background","solid_color"),c=this.getUiData3("skin","form_background","image");if(1===parseInt(a)){switch(parseInt(o)){case 2:e.find(".uiform-main-form").css({background:s,"background-image":"-webkit-linear-gradient(top, "+s+", "+r+")","background-image":"-moz-linear-gradient(top, "+s+", "+r+")","background-image":"-ms-linear-gradient(top, "+s+", "+r+")","background-image":"-o-linear-gradient(top, "+s+", "+r+")","background-image":"linear-gradient(to bottom, "+s+","+r+")"}),t(".uiform-main-form").find(".uiform-divider-text")&&t(".uiform-main-form").find(".uiform-divider-text").css({background:s,"background-image":"-webkit-linear-gradient(top, "+s+", "+r+")","background-image":"-moz-linear-gradient(top, "+s+", "+r+")","background-image":"-ms-linear-gradient(top, "+s+", "+r+")","background-image":"-o-linear-gradient(top, "+s+", "+r+")","background-image":"linear-gradient(to bottom, "+s+","+r+")"});break;case 1:default:n&&e.find(".uiform-main-form").css("background",n),t(".uiform-main-form").find(".uiform-divider-text")&&t(".uiform-main-form").find(".uiform-divider-text").css("background",n)}c&&(e.find(".uiform-main-form").removeCss("background-image"),e.find(".uiform-main-form").css({"background-image":"url('"+c+"')","background-repeat":"repeat"}),t(".uiform-main-form").find(".uiform-divider-text")&&t(".uiform-main-form").find(".uiform-divider-text").css({"background-image":"url('"+c+"')","background-repeat":"repeat"}))}else e.find(".uiform-main-form").removeCss("background"),e.find(".uiform-main-form").removeCss("background-image"),t(".uiform-main-form").find(".uiform-divider-text")&&(t(".uiform-main-form").find(".uiform-divider-text").removeCss("background"),t(".uiform-main-form").find(".uiform-divider-text").removeCss("background-image"),t(".uiform-main-form").find(".uiform-divider-text").removeCss("background-repeat"))},arguments.callee.previewform_summboxBackground=function(){var e=this.getUiData3("summbox","form_background","show_st"),i=this.getUiData3("summbox","form_background","type"),a=this.getUiData3("summbox","form_background","start_color"),o=this.getUiData3("summbox","form_background","end_color"),s=this.getUiData3("summbox","form_background","solid_color"),r=this.getUiData3("summbox","form_background","image");if(1===parseInt(e)){switch(parseInt(i)){case 2:t("#uifm-sticky-sidebar-box").css({background:a,"background-image":"-webkit-linear-gradient(top, "+a+", "+o+")","background-image":"-moz-linear-gradient(top, "+a+", "+o+")","background-image":"-ms-linear-gradient(top, "+a+", "+o+")","background-image":"-o-linear-gradient(top, "+a+", "+o+")","background-image":"linear-gradient(to bottom, "+a+","+o+")"});break;case 1:default:s&&t("#uifm-sticky-sidebar-box").css("background",s)}r&&(t("#uifm-sticky-sidebar-box").removeCss("background-image"),t("#uifm-sticky-sidebar-box").css({"background-image":"url('"+r+"')","background-repeat":"repeat"}))}else t("#uifm-sticky-sidebar-box").removeCss("background"),t("#uifm-sticky-sidebar-box").removeCss("background-image")},arguments.callee.previewfield_controlBlockLabel=function(e,i){var a=e.attr("id"),o=t("#"+a).closest(".uiform-step-pane").data("uifm-step"),s=this.getUiData5("steps_src",o,a,i,"block_pos"),r=this.getUiData5("steps_src",o,a,i,"block_st"),n=this.getUiData5("steps_src",o,a,i,"block_align"),c=this.getUiData5("steps_src",o,a,i,"grid_layout"),f=e.find(".uifm-control-label").parent(),l=e.find(".uifm-control-label").parent().siblings(),d=parseInt(f.index());let _;if(1===parseInt(r)){switch(f.show(),parseInt(s)){case 1:1===d&&t(f).insertBefore(l),e.find(".uifm-control-label").parent().attr("class","rkfm-col-sm-12"),e.find(".uifm-control-label").parent().siblings().attr("class","rkfm-col-sm-12");break;case 2:0===d&&t(l).insertBefore(f),_=this.previewfield_getBlockGridLayout(c),e.find(".uifm-control-label").parent().attr("class",`rkfm-col-sm-${_.right}`),e.find(".uifm-control-label").parent().siblings().attr("class",`rkfm-col-sm-${_.left}`);break;case 3:0===d&&t(l).insertBefore(f),e.find(".uifm-control-label").parent().attr("class","rkfm-col-sm-12"),e.find(".uifm-control-label").parent().siblings().attr("class","rkfm-col-sm-12");break;case 0:default:1===d&&t(f).insertBefore(l),_=this.previewfield_getBlockGridLayout(c),e.find(".uifm-control-label").parent().attr("class",`rkfm-col-sm-${_.left}`),e.find(".uifm-control-label").parent().siblings().attr("class",`rkfm-col-sm-${_.right}`)}switch(parseInt(n)){case 1:e.find(".uifm-control-label").css("text-align","center");break;case 2:e.find(".uifm-control-label").css("text-align","right");break;case 0:default:e.find(".uifm-control-label").css("text-align","left")}}else f.hide(),l.attr("class","rkfm-col-sm-12")},arguments.callee.previewfield_getBlockGridLayout=function(t){var e={};switch(parseInt(t)){case 1:e.left=1,e.right=10;break;case 2:e.left=2,e.right=9;break;case 3:e.left=3,e.right=9;break;case 4:e.left=4,e.right=8;break;case 5:e.left=5,e.right=7;break;case 6:e.left=6,e.right=6;break;case 7:e.left=7,e.right=5;break;case 8:e.left=8,e.right=4;break;case 9:e.left=9,e.right=3;break;case 10:e.left=10,e.right=2;break;case 11:e.left=11,e.right=1}return e},arguments.callee.previewfield_fontfamily=function(e,i,a){var o,s,r,n=e.attr("id"),c=t("#"+n).closest(".uiform-step-pane").data("uifm-step");if(o=this.getUiData5("steps_src",c,n,i,"font_st"),s=this.getUiData5("steps_src",c,n,i,"font"),1===parseInt(o)&&s){var f=JSON.parse(s);if(e.find(a).css("font-family",f.family),void 0!==f.import_family){var l="@import url(//fonts.googleapis.com/css?family="+f.import_family;r="zgfm_font_"+String(f.import_family).cleanup(),0===parseInt(t("#"+r).length)&&t('",t("head").append(e);break;case 1:o=this.getUiData4("wizard","theme",i,"skin_tab_cur_bgcolor"),s=this.getUiData4("wizard","theme",i,"skin_tab_cur_txtcolor"),r=this.getUiData4("wizard","theme",i,"skin_tab_cur_numtxtcolor");var _=this.getUiData4("wizard","theme",i,"skin_tab_cur_bg_numtxt");n=this.getUiData4("wizard","theme",i,"skin_tab_inac_bgcolor"),c=this.getUiData4("wizard","theme",i,"skin_tab_inac_txtcolor");t("#"+a+"_tab").remove(),e='",t("head").append(e)}}catch(t){}},arguments.callee.wizardtab_saveChangesToMdata=function(){var e=t("#uifm_frm_wiz_st").prop("checked")?1:0,i=parseInt(t("#uifm_frm_wiz_theme_typ").val()),a=t("#uifm_frm_wiz_tab_active_bgcolor").val(),o=t("#uifm_frm_wiz_tab_active_txtcolor").val(),s=t("#uifm_frm_wiz_tab_active_numtxtcolor").val(),r=t("#uifm_frm_wiz_tab_inactive_bgcolor").val(),n=t("#uifm_frm_wiz_tab_inactive_txtcolor").val(),c=t("#uifm_frm_wiz_tab_inactive_numtxtcolor").val(),f=t("#uifm_frm_wiz_tab_done_bgcolor").val(),l=t("#uifm_frm_wiz_tab_done_txtcolor").val(),d=t("#uifm_frm_wiz_tab_done_numtxtcolor").val(),_=t("#uifm_frm_wiz_tab_cont_bgcolor").val(),m=t("#uifm_frm_wiz_tab_cont_borcol").val();switch(this.setUiData2("wizard","enable_st",e),this.setUiData2("wizard","theme_type",i),i){case 0:this.setUiData4("wizard","theme",i,"skin_tab_cur_bgcolor",a),this.setUiData4("wizard","theme",i,"skin_tab_cur_txtcolor",o),this.setUiData4("wizard","theme",i,"skin_tab_cur_numtxtcolor",s),this.setUiData4("wizard","theme",i,"skin_tab_inac_bgcolor",r),this.setUiData4("wizard","theme",i,"skin_tab_inac_txtcolor",n),this.setUiData4("wizard","theme",i,"skin_tab_inac_numtxtcolor",c),this.setUiData4("wizard","theme",i,"skin_tab_done_bgcolor",f),this.setUiData4("wizard","theme",i,"skin_tab_done_txtcolor",l),this.setUiData4("wizard","theme",i,"skin_tab_done_numtxtcolor",d),this.setUiData4("wizard","theme",i,"skin_tab_cont_bgcolor",_),this.setUiData4("wizard","theme",i,"skin_tab_cont_borcol",m);break;case 1:var p=t("#uifm_frm_wiz_tab_active_bg_numtxt").val();this.setUiData4("wizard","theme",i,"skin_tab_cur_bgcolor",a),this.setUiData4("wizard","theme",i,"skin_tab_cur_txtcolor",o),this.setUiData4("wizard","theme",i,"skin_tab_cur_numtxtcolor",s),this.setUiData4("wizard","theme",i,"skin_tab_cur_bg_numtxt",p),this.setUiData4("wizard","theme",i,"skin_tab_inac_bgcolor",r),this.setUiData4("wizard","theme",i,"skin_tab_inac_txtcolor",n)}},arguments.callee.wizardtab_tabManualEvt=function(e,i){var a;if(i){var o=t(e).closest(".uifm_frm_skin_tab_content").attr("data-tab-nro");a=t(".uiform-step-list .uiform-steps a[data-tab-nro="+o+"]").parent()}else a=t(e);t("ul.uiform-steps li").removeClass("uifm-current").addClass("uifm-disabled"),a.addClass("uifm-current").removeClass("uifm-disabled"),t(".uiform-step-pane").hide();var s=a.find("a").attr("href");t(s).show()},arguments.callee.wizardtab_tabManageEvt=function(){t("ul.uiform-steps li").on("click",function(){return rocketform.wizardtab_tabManualEvt(this,!1),!1})},arguments.callee.fieldsetting_updateName=function(t,e,i){try{this.setUiData4("steps_src",String(t),String(e),"field_name",i)}catch(t){}},arguments.callee.fieldsetting_deleteField=function(e){var i=t("#"+e).closest(".uiform-step-pane").data("uifm-step");t("#"+e).remove(),rocketform.closeSettingTab(),rocketform.delUiData3("steps_src",i,e);var o,s=a.steps_src[i],r=s.length;for(o=0;o0){switch(t("#uifm_preview_form").removeData("bs.modal"),t("#uifm_preview_form").sfdc_modal("show"),parseInt(i)){case 1:t("#uifm_preview_form").find(".sfdc-modal-title").text(s);break;case 2:t("#uifm_preview_form").find(".sfdc-modal-title").text(r);break;case 3:t("#uifm_preview_form").find(".sfdc-modal-title").text(n)}zgfm_back_helper.tooltip_removeall(),t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"formbuilder/forms/ajax_load_preview_form",data:{action:"rocket_fbuilder_load_preview_form",page:"zgfm_cost_estimate",zgfm_security:uiform_vars.ajax_nonce,form_id:a,csrf_field_name:uiform_vars.csrf_field_name},success:function(e){t("#uifm_preview_form").find(".sfdc-modal-body").html(e),rocketform.previewform_resizeBox(i)}})}else bootbox.alert(o,function(){})},arguments.callee.previewform_onClosePopUp=function(){t(".uiform_popover_frontend").sfdc_popover("destroy")},arguments.callee.listform_duplicate=function(){if(t(".uiform-listform-chk-id").is(":checked")){var e=t("#uiform-form-listform").serialize();t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"formbuilder/forms/ajax_listform_duplicate",data:e+"&action=rocket_fbuilder_listform_duplicate&page=zgfm_cost_estimate&csrf_field_name="+uiform_vars.csrf_field_name,success:function(t){rocketform.redirect_tourl(uiform_vars.url_admin+"formbuilder/forms/list_uiforms")}})}else t("#uifm_modal_msg").sfdc_modal("show"),t("#uifm_modal_msg .sfdc-modal-title").html(t("#uifm_listform_popup_title").val()),t("#uifm_modal_msg .sfdc-modal-body").html("

    "+t("#uifm_listform_popup_notforms").val()+"

    ")},arguments.callee.listform_selectallforms=function(e){t(e).is(":checked")?t(".uiform-listform-chk-id").prop("checked",!0):t(".uiform-listform-chk-id").prop("checked",!1)},arguments.callee.modal_centerPos=function(e){e.each(function(e){var i=t(this).clone().css("display","block").appendTo("body"),a=Math.round((i.height()-i.find(".sfdc-modal-content").height())/2);a=a>0?a:0,i.remove(),t(this).find(".sfdc-modal-content").css("margin-top",a)})},arguments.callee.listform_updateStatus=function(e){if(t(".uiform-listform-chk-id").is(":checked")){var i=t("#uiform-form-listform").serialize();t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"formbuilder/forms/ajax_listform_updatest",data:i+"&action=rocket_fbuilder_listform_updatest&page=zgfm_cost_estimate&form_st="+e+"&csrf_field_name="+uiform_vars.csrf_field_name,success:function(t){rocketform.redirect_tourl(uiform_vars.url_admin+"formbuilder/forms/list_uiforms")}})}else t("#uifm_modal_msg").sfdc_modal("show"),t("#uifm_modal_msg .sfdc-modal-title").html(t("#uifm_listform_popup_title").val()),t("#uifm_modal_msg .sfdc-modal-body").html("

    "+t("#uifm_listform_popup_notforms").val()+"

    "),t("#uifm_modal_msg").on("show.bs.sfdc-modal",rocketform.modal_centerPos(t("#uifm_modal_msg")))},arguments.callee.listrecords_exportToCsv=function(){try{var e=t("#uifm-record-form-cmb").val();t("body").append("")}catch(t){}},arguments.callee.listform_deleteFormById=function(e){t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"formbuilder/forms/ajax_delete_form_byid",data:{action:"rocket_fbuilder_delete_form",page:"zgfm_cost_estimate",zgfm_security:uiform_vars.ajax_nonce,form_id:e,csrf_field_name:uiform_vars.csrf_field_name},success:function(t){rocketform.redirect_tourl(uiform_vars.url_admin+"formbuilder/forms/list_uiforms")}})},arguments.callee.input2settings_priceOption=function(e){var i=t(e).closest(".uifm-fld-inp2-options-row").data("opt-index"),a=t("#uifm-field-selected-id").val(),o=t("#uifm_frm_inp2_opt"+i+"_price").val(),s=t("#"+a).closest(".uiform-step-pane").data("uifm-step");rocketform.setUiData7("steps_src",parseInt(s),a,"input2","options",i,"price",o)},arguments.callee.input2settings_labelOption=function(e){var i=t(e).closest(".uifm-fld-inp2-options-row").data("opt-index"),a=t("#uifm-field-selected-id").val(),o=t("#uifm_frm_inp2_opt"+i+"_label").val(),s=t("#"+a).closest(".uiform-step-pane").data("uifm-step");rocketform.setUiData7("steps_src",parseInt(s),a,"input2","options",i,"label",o);var r=this.getUiData4("steps_src",s,a,"type");switch(parseInt(r)){case 8:t("#"+a).data("uiform_radiobtn").input2settings_preview_genAllOptions();break;case 9:t("#"+a).data("uiform_checkbox").input2settings_preview_genAllOptions();break;case 10:t("#"+a).data("uiform_select").input2settings_preview_genAllOptions();break;case 11:t("#"+a).data("uiform_multiselect").input2settings_preview_genAllOptions()}},arguments.callee.input2settings_stl1_quickcolor=function(e){var i=t("#uifm-field-selected-id").val(),a=t("#"+i).closest(".uiform-step-pane").data("uifm-step"),o=this.getUiData4("steps_src",a,i,"type");switch(parseInt(o)){case 10:t("#"+i).data("uiform_select").input2settings_stl1_quickcolor(e);break;case 11:t("#"+i).data("uiform_multiselect").input2settings_stl1_quickcolor(e)}},arguments.callee.input2settings_valueOption=function(e){var i=t(e).closest(".uifm-fld-inp2-options-row").data("opt-index"),a=t("#uifm-field-selected-id").val(),o=t("#uifm_frm_inp2_opt"+i+"_value").val(),s=t("#"+a).closest(".uiform-step-pane").data("uifm-step");rocketform.setUiData7("steps_src",parseInt(s),a,"input2","options",i,"value",o);this.getUiData4("steps_src",s,a,"type")},arguments.callee.input2settings_statusRdoOption=function(e){var i=t(e),a=t("#uifm-field-selected-id").val(),o=t("#uifm-field-selected-type").val();switch(parseInt(o)){case 8:t("#"+a).data("uiform_radiobtn").input2settings_statusRdoOption(i);break;case 9:t("#"+a).data("uiform_checkbox").input2settings_statusRdoOption(i);break;case 10:t("#"+a).data("uiform_select").input2settings_statusRdoOption(i);break;case 11:t("#"+a).data("uiform_multiselect").input2settings_statusRdoOption(i)}},arguments.callee.input17settings_deleteOption=function(e){var i=t(e),o=t("#uifm-field-selected-id").val(),s=i.closest(".uifm-fld-inp17-options-row").data("opt-index"),r=t("#"+o).closest(".uiform-step-pane").data("uifm-step");i.closest(".uifm-fld-inp17-options-row").remove(),rocketform.delUiData6("steps_src",parseInt(r),o,"input17","options",parseInt(s));var n,c=a.steps_src[parseInt(r)][o].input17.options,f=c.length;for(n=0;nObject.assign(t,{[e]:i}),{}),rocketform.setUiData5("steps_src",parseInt(a),i,"input2","options",_),parseInt(o)){case 8:t("#"+i).data("uiform_radiobtn").input2settings_preview_genAllOptions();break;case 9:t("#"+i).data("uiform_checkbox").input2settings_preview_genAllOptions();break;case 10:t("#"+i).data("uiform_select").input2settings_preview_genAllOptions();break;case 11:t("#"+i).data("uiform_multiselect").input2settings_preview_genAllOptions()}rocketform.input2settings_tabeditor_generateAllOptions(),t("#zgpb-modal1").sfdc_modal("hide")},arguments.callee.clogic_removeAll=function(){t("#uifm-conditional-logic-list").html("");var e=t("#uifm-field-selected-id").val(),i=t("#"+e).closest(".uiform-step-pane").data("uifm-step");rocketform.setUiData5("steps_src",parseInt(i),e,"clogic","list",[])},arguments.callee.clogic_tabeditor_generateAllOptions=function(e){var i,a;t("#uifm-conditional-logic-list").html("");var o=t("#uifm-conditional-logic-list");t.each(e,function(e,s){if(s&&0!=parseInt(t("#"+s.field_fire).length)){i=e,(a=t("#uiform-set-clogic-tmpl .uifm-conditional-row").clone()).attr("data-row-index",i),o.append(a),rocketform.clogic_getListField(a),a.find(".uifm_clogic_fieldsel").val(s.field_fire).trigger("chosen:updated");var r=rocketform.search_fieldById(s.field_fire);switch(rocketform.clogic_getTypeMatch(a,r.type),a.find(".uifm_clogic_mtype select").val(s.mtype).trigger("chosen:updated"),rocketform.clogic_getMatchInput(a,r),parseInt(r.type)){case 8:case 9:case 10:case 11:case 41:case 42:0!=parseInt(a.find(".uifm_clogic_minput_1").find('option[value="'+s.minput+'"]').length)?a.find(".uifm_clogic_minput_1").val(s.minput).trigger("chosen:updated"):rocketform.clogic_tabeditor_removeifnomatch(e);break;case 40:var n;n=1===parseInt(s.minput)?"1":"0",a.find(".uifm_clogic_minput_1").val(n).trigger("chosen:updated");break;case 16:case 18:a.find(".uifm_clogic_minput_2").val(s.minput)}}else rocketform.clogic_tabeditor_removeifnomatch(e)})},arguments.callee.clogic_tabeditor_removeifnomatch=function(e){var i=t("#uifm-field-selected-id").val(),o=t("#"+i).closest(".uiform-step-pane").data("uifm-step"),s=e;t("#uifm-conditional-logic-list").find('.uifm-conditional-row[data-row-index="'+e+'"]').remove(),rocketform.delUiData6("steps_src",parseInt(o),i,"clogic","list",parseInt(s));var r,n=a.steps_src[parseInt(o)][i].clogic.list,c=n.length;for(r=0;r'),rocketform.setUiData6("steps_src",parseInt(s),o,"input18","pane_background","image",a),this.input18settings_preview_genAllOptions(t("#"+o),"")},arguments.callee.input17settings_saveSrcImgOption=function(e,i){var a,o=e.closest(".uifm-fld-inp17-options-row"),s=o.attr("data-opt-index"),r=t("#uifm-field-selected-id").val(),n=t("#"+r).closest(".uiform-step-pane").data("uifm-step"),c=this.getUiData4("steps_src",n,r,"type"),f=this.getUiData5("steps_src",n,r,"input17","thopt_mode")||1;a=2===parseInt(f)?e.closest(".uifm_frm_inp17_opt2_imgwrap").attr("data-opt-index"):e.closest(".uifm_frm_inp17_opt_imgwrap").attr("data-opt-index");var l,d=i;switch(2===parseInt(f)?(o.find(".uifm_frm_inp17_opt_img_list_2_wrap").find("[data-opt-index='"+a+"']").find(".sfdc-img-thumbnail").attr("src",d),rocketform.setUiData9("steps_src",parseInt(n),r,"input17","options",parseInt(s),"img_list_2",parseInt(a),"img_full",d)):(o.find(".uifm_frm_inp17_opt_img_list_wrap").find("[data-opt-index='"+a+"']").find(".sfdc-img-thumbnail").attr("src",d),rocketform.setUiData9("steps_src",parseInt(n),r,"input17","options",parseInt(s),"img_list",parseInt(a),"img_full",d),rocketform.setUiData9("steps_src",parseInt(n),r,"input17","options",parseInt(s),"img_list",parseInt(a),"img_th_150x150",d)),parseInt(c)){case 41:l=t("#"+r).find(".uifm-dcheckbox-item[data-inp17-opt-index='"+s+"']");break;case 42:l=t("#"+r).find(".uifm-dradiobtn-item[data-inp17-opt-index='"+s+"']")}rocketform.input17settings_preview_refreshImgs(l)},arguments.callee.input17settings_changeSrcImg=function(i){var a=t(i);this.elfinder_showPopUp({windowURL:uiform_vars.url_elfinder2,windowName:"_blank",height:490,width:950,centerScreen:1,location:0}),e.processFile=function(t){rocketform.input17settings_saveSrcImgOption(a,t.url)}},arguments.callee.input18settings_changeSrcImg=function(i){var a=t(i);this.elfinder_showPopUp({windowURL:uiform_vars.url_elfinder2,windowName:"_blank",height:490,width:950,centerScreen:1,location:0}),e.processFile=function(t){rocketform.input18settings_savePaneBg(a,t.url)}},arguments.callee.elfinder_showPopUp=function(i){var a,o,s=t.extend({},{centerBrowser:0,centerScreen:0,height:500,left:0,location:0,menubar:0,resizable:0,scrollbars:0,status:0,width:500,windowName:null,windowURL:null,top:0,toolbar:0},i||{}),r="height="+s.height+",width="+s.width+",toolbar="+s.toolbar+",scrollbars="+s.scrollbars+",status="+s.status+",resizable="+s.resizable+",location="+s.location+",menuBar="+s.menubar;return s.windowName=this.name||s.windowName,s.windowURL=this.href||s.windowURL,s.centerBrowser?(t.browser.msie?(a=e.screenTop-120+((document.documentElement.clientHeight+120)/2-s.height/2),o=e.screenLeft+((document.body.offsetWidth+20)/2-s.width/2)):(a=e.screenY+(e.outerHeight/2-s.height/2),o=e.screenX+(e.outerWidth/2-s.width/2)),e.open(s.windowURL,s.windowName,r+",left="+o+",top="+a).focus()):s.centerScreen?(a=(screen.height-s.height)/2,o=(screen.width-s.width)/2,e.open(s.windowURL,s.windowName,r+",left="+o+",top="+a).focus()):e.open(s.windowURL,s.windowName,r+",left="+s.left+",top="+s.top).focus(),!1},arguments.callee.input18settings_deleteBgImagePane=function(){var e=t("#uifm-field-selected-id").val(),i=t("#"+e).closest(".uiform-step-pane").data("uifm-step");t("#uifm_frm_inp18_bg_srcimg_wrap").html(""),rocketform.setUiData6("steps_src",parseInt(i),e,"input18","pane_background","image",""),this.input18settings_preview_genAllOptions(t("#"+e),"")},arguments.callee.input17settings_tabeditor_generateAllOptions=function(){t("#uifm-fld-inp17-options-container").html("");var e,i,a=t("#uifm-field-selected-id").val(),o=t("#"+a).closest(".uiform-step-pane").data("uifm-step"),s=this.getUiData4("steps_src",o,a,"type"),r=this.getUiData5("steps_src",o,a,"input17","options"),n=this.getUiData5("steps_src",o,a,"input17","thopt_mode")||"1";switch(parseInt(s)){case 41:case 42:t.each(r,function(s,r){switch((e=t("#uifm_frm_inp17_templates").find(".uifm-fld-inp17-options-row").clone()).attr("data-opt-index",s),e.find(".uifm_frm_inp17_opt_label").val(r.label),e.find(".uifm_frm_inp17_opt_ckeck").prop("checked",parseInt(r.checked)),e.find(".uifm_frm_inp17_opt_price").val(r.price),e.find(".uifm_frm_inp17_opt_qty_st").bootstrapSwitchZgpb(),parseInt(r.qty_st)?e.find(".uifm_frm_inp17_opt_qty_st").bootstrapSwitchZgpb("state",!0):e.find(".uifm_frm_inp17_opt_qty_st").bootstrapSwitchZgpb("state",!1),e.find(".uifm_fld_inp17_spinner").TouchSpin({verticalbuttons:!0,min:0,max:1e9,stepinterval:1,verticalupclass:"sfdc-glyphicon sfdc-glyphicon-plus",verticaldownclass:"sfdc-glyphicon sfdc-glyphicon-minus"}),e.find(".uifm_frm_inp17_opt_qty_max").val(r.qty_max),parseInt(n)){case 2:r.img_list_2.length||(rocketform.addIndexUiData8("steps_src",parseInt(o),a,"input17","options",parseInt(s),"img_list_2",0),rocketform.setUiData8("steps_src",parseInt(o),a,"input17","options",parseInt(s),"img_list_2",0,{img_full:""}),rocketform.addIndexUiData8("steps_src",parseInt(o),a,"input17","options",parseInt(s),"img_list_2",1),rocketform.setUiData8("steps_src",parseInt(o),a,"input17","options",parseInt(s),"img_list_2",1,{img_full:""}),rocketform.addIndexUiData8("steps_src",parseInt(o),a,"input17","options",parseInt(s),"img_list_2",2),rocketform.setUiData8("steps_src",parseInt(o),a,"input17","options",parseInt(s),"img_list_2",2,{img_full:""}),r.img_list_2={0:{img_full:""},1:{img_full:""},2:{img_full:""}}),t.each(r.img_list_2,function(a,o){i=t("#uifm_frm_inp17_templates").find(".uifm_frm_inp17_opt2_imgwrap").clone(),o.img_full?i.find(".sfdc-img-thumbnail").attr("src",o.img_full):i.find(".sfdc-img-thumbnail").attr("src",uiform_vars.url_assets+"/common/imgs/uifm-question-mark.png"),i.attr("data-opt-index",a),e.find(".uifm_frm_inp17_opt_img_list_2_wrap").append(i)}),e.find('.uifm_frm_inp17_opt_img_list_2_wrap .uifm_frm_inp17_opt2_imgwrap[data-opt-index="0"]').find(".col-md-8 p").attr("class","alert alert-success").html("Checked"),e.find('.uifm_frm_inp17_opt_img_list_2_wrap .uifm_frm_inp17_opt2_imgwrap[data-opt-index="1"]').find(".col-md-8 p").attr("class","alert alert-warning").html("Hover"),e.find('.uifm_frm_inp17_opt_img_list_2_wrap .uifm_frm_inp17_opt2_imgwrap[data-opt-index="2"]').find(".col-md-8 p").attr("class","alert alert-info").html("Unchecked");break;case 1:default:r.img_list&&t.each(r.img_list,function(a,o){i=t("#uifm_frm_inp17_templates").find(".uifm_frm_inp17_opt_imgwrap").clone(),o.img_th_150x150?i.find(".sfdc-img-thumbnail").attr("src",o.img_th_150x150):i.find(".sfdc-img-thumbnail").attr("src",uiform_vars.url_assets+"/common/imgs/uifm-question-mark.png"),i.find(".uifm_frm_inp17_opt_imgitem_title").val(o.title),e.find(".uifm_frm_inp17_opt_img_list_wrap").append(i)})}t("#uifm-fld-inp17-options-container").append(e),t("#uifm-fld-inp17-options-container .autogrow").autogrow()})}rocketform.input17settings_showOptionbyLayMode(n),t("#uifm-fld-inp17-options-container .switch-field-17").on("switchChange.bootstrapSwitchZgpb",function(e,i){var a=i?1:0;rocketform.input17settings_updateOption(t(this),a,"qty_st")}),t("#uifm-fld-inp17-options-container .uifm_frm_inp17_opt_qty_max").on("change",function(e){var i=t(e.target).val();rocketform.input17settings_updateOption(t(e.target),i,"qty_max")})},arguments.callee.input17settings_showOptionbyLayMode=function(e){2===parseInt(e)?(t("#uifm-fld-inp17-options-container .uifm_frm_inp17_opt_img_list_1").hide(),t("#uifm-fld-inp17-options-container .uifm_frm_inp17_opt_img_list_2").show(),t("#uifm_fld_inp17_thopt_zoom_wrap").hide(),t("#uifm_fld_inp17_thopt_usethmb_wrap").hide(),t("#uifm_fld_inp17_thopt_showcheckb_wrap").show()):(t("#uifm-fld-inp17-options-container .uifm_frm_inp17_opt_img_list_1").show(),t("#uifm-fld-inp17-options-container .uifm_frm_inp17_opt_img_list_2").hide(),t("#uifm_fld_inp17_thopt_zoom_wrap").show(),t("#uifm_fld_inp17_thopt_usethmb_wrap").show(),t("#uifm_fld_inp17_thopt_showcheckb_wrap").hide())},arguments.callee.input17settings_enableCheckOption=function(e){var i=(e=t(e)).attr("data-option-store"),a=e.is(":checked")?1:0,o=t("#uifm-field-selected-id").val(),s=t("#"+o).closest(".uiform-step-pane").data("uifm-step"),r=this.getUiData4("steps_src",s,o,"type"),n=this.getUiData5("steps_src",s,o,"input17","thopt_mode")||"1";rocketform.input17settings_updateOption(e,a,i);var c,f=e.closest(".uifm-fld-inp17-options-row").attr("data-opt-index");switch(parseInt(r)){case 41:c=t("#"+o).find(".uifm-dcheckbox-item[data-inp17-opt-index='"+f+"']");break;case 42:c=t("#"+o).find(".uifm-dradiobtn-item[data-inp17-opt-index='"+f+"']")}switch(c.uiformDCheckbox("man_optChecked",a),parseInt(n)){case 2:c.uiformDCheckbox("man_mod2_refresh")}},arguments.callee.input17settings_onChangeOption=function(e){var i=(e=t(e)).attr("data-option-store"),a=e.val();rocketform.input17settings_updateOption(e,a,i);var o=t("#uifm-field-selected-id").val();rocketform.input17settings_preview_genAllOptions(t("#"+o),"input17")},arguments.callee.input17settings_updateOption=function(e,i,a){var o,s=e.closest(".uifm-fld-inp17-options-row").attr("data-opt-index"),r=t("#uifm-field-selected-id").val(),n=t("#"+r).closest(".uiform-step-pane").data("uifm-step"),c=this.getUiData4("steps_src",n,r,"type");switch(rocketform.setUiData7("steps_src",parseInt(n),r,"input17","options",parseInt(s),a,i),parseInt(c)){case 41:o=t("#"+r).find(".uifm-dcheckbox-item[data-inp17-opt-index='"+s+"']");break;case 42:o=t("#"+r).find(".uifm-dradiobtn-item[data-inp17-opt-index='"+s+"']")}switch(String(a)){case"qty_st":o.uiformDCheckbox("man_optQtySt",i);break;case"qty_max":o.uiformDCheckbox("man_optQtyMax",i)}},arguments.callee.input2settings_tabeditor_generateAllOptions=function(){t("#uifm-fld-inp2-options-container").html("");var e,i=t("#uifm-field-selected-id").val(),a=t("#"+i).closest(".uiform-step-pane").data("uifm-step"),o=this.getUiData4("steps_src",a,i,"type"),s=this.getUiData5("steps_src",a,i,"input2","options");switch(parseInt(o)){case 8:t.each(s,function(i,a){(e=t("#uifm_frm_inp2_templates").find(".uifm-fld-inp2-options-row").clone()).attr("data-opt-index",i),e.find(".uifm_frm_inp2_opt_checked").attr("id","uifm_frm_inp2_opt"+i+"_rdo"),e.find(".uifm_frm_inp2_opt_checked").prop("checked",parseInt(a.checked)),e.find(".uifm_frm_inp2_opt_checked").attr("type","radio"),e.find(".uifm_frm_inp2_opt_checked").attr("name","uifm_inp2_rdo"),e.find(".uifm_frm_inp2_opt_label_evt").attr("id","uifm_frm_inp2_opt"+i+"_label"),e.find(".uifm_frm_inp2_opt_label_evt").val(a.label),e.find(".uifm_frm_inp2_opt_value_evt").attr("id","uifm_frm_inp2_opt"+i+"_value"),e.find(".uifm_frm_inp2_opt_value_evt").val(a.value),e.find(".uifm_frm_inp2_opt_price_evt").attr("id","uifm_frm_inp2_opt"+i+"_price"),e.find(".uifm_frm_inp2_opt_price_evt").val(a.price),t("#uifm-fld-inp2-options-container").append(e)});break;case 9:t.each(s,function(i,a){(e=t("#uifm_frm_inp2_templates").find(".uifm-fld-inp2-options-row").clone()).attr("data-opt-index",i),e.find(".uifm_frm_inp2_opt_checked").attr("id","uifm_frm_inp2_opt"+i+"_chk"),e.find(".uifm_frm_inp2_opt_checked").prop("checked",parseInt(a.checked)),e.find(".uifm_frm_inp2_opt_checked").attr("name","uifm_inp2_chk"),e.find(".uifm_frm_inp2_opt_label_evt").attr("id","uifm_frm_inp2_opt"+i+"_label"),e.find(".uifm_frm_inp2_opt_label_evt").val(a.label),e.find(".uifm_frm_inp2_opt_value_evt").attr("id","uifm_frm_inp2_opt"+i+"_value"),e.find(".uifm_frm_inp2_opt_value_evt").val(a.value),e.find(".uifm_frm_inp2_opt_price_evt").attr("id","uifm_frm_inp2_opt"+i+"_price"),e.find(".uifm_frm_inp2_opt_price_evt").val(a.price),t("#uifm-fld-inp2-options-container").append(e)});break;case 10:t.each(s,function(i,a){(e=t("#uifm_frm_inp2_templates").find(".uifm-fld-inp2-options-row").clone()).attr("data-opt-index",i),e.find(".uifm_frm_inp2_opt_checked").attr("id","uifm_frm_inp2_opt"+i+"_rdo"),e.find(".uifm_frm_inp2_opt_checked").prop("checked",parseInt(a.checked)),e.find(".uifm_frm_inp2_opt_checked").attr("type","radio"),e.find(".uifm_frm_inp2_opt_checked").attr("name","uifm_inp2_rdo"),e.find(".uifm_frm_inp2_opt_label_evt").attr("id","uifm_frm_inp2_opt"+i+"_label"),e.find(".uifm_frm_inp2_opt_label_evt").val(a.label),e.find(".uifm_frm_inp2_opt_value_evt").attr("id","uifm_frm_inp2_opt"+i+"_value"),e.find(".uifm_frm_inp2_opt_value_evt").val(a.value),e.find(".uifm_frm_inp2_opt_price_evt").attr("id","uifm_frm_inp2_opt"+i+"_price"),e.find(".uifm_frm_inp2_opt_price_evt").val(a.price),t("#uifm-fld-inp2-options-container").append(e)});break;case 11:t.each(s,function(i,a){(e=t("#uifm_frm_inp2_templates").find(".uifm-fld-inp2-options-row").clone()).attr("data-opt-index",i),e.find(".uifm_frm_inp2_opt_checked").attr("id","uifm_frm_inp2_opt"+i+"_chk"),e.find(".uifm_frm_inp2_opt_checked").prop("checked",parseInt(a.checked)),e.find(".uifm_frm_inp2_opt_checked").attr("name","uifm_inp2_chk"),e.find(".uifm_frm_inp2_opt_label_evt").attr("id","uifm_frm_inp2_opt"+i+"_label"),e.find(".uifm_frm_inp2_opt_label_evt").val(a.label),e.find(".uifm_frm_inp2_opt_value_evt").attr("id","uifm_frm_inp2_opt"+i+"_value"),e.find(".uifm_frm_inp2_opt_value_evt").val(a.value),e.find(".uifm_frm_inp2_opt_price_evt").attr("id","uifm_frm_inp2_opt"+i+"_price"),e.find(".uifm_frm_inp2_opt_price_evt").val(a.price),t("#uifm-fld-inp2-options-container").append(e)})}zgfm_back_input2.input2settings_refreshSortable()},arguments.callee.input2settings_deleteOption=function(e){var i=t(e),o=t("#uifm-field-selected-id").val(),s=i.closest(".uifm-fld-inp2-options-row").data("opt-index"),r=t("#"+o).closest(".uiform-step-pane").data("uifm-step"),n=t("#uifm-field-selected-type").val();i.closest(".uifm-fld-inp2-options-row").remove(),rocketform.delUiData6("steps_src",parseInt(r),o,"input2","options",s);var c,f=a.steps_src[parseInt(r)][o].input2.options,l=f.length;for(c=0;c',o+="#"+s+" .uiform-divider-text::before {",o+="background:"+n+"!important;",o+="} ",o+="#"+s+" .uiform-divider-text::after {",o+="background:"+n+"!important;",o+="} ",o+="",t("head").append(o)):t("#"+s+"_prev_fld_divider").remove(),e.find(".uiform-divider-text").css("color",f),0!=parseInt(l.length)?e.find(".uiform-divider-text").show().html(l):e.find(".uiform-divider-text").hide(),rocketform.previewform_elementBackground(t(".uiform-main-form"),!1)}catch(t){}},arguments.callee.input9settings_updateField=function(e,i){e.data("typefield");var a,o=e.attr("id"),s=t("#"+o).closest(".uiform-step-pane").data("uifm-step"),r=this.getUiData5("steps_src",s,o,i,"txt_star1"),n=this.getUiData5("steps_src",s,o,i,"txt_star2"),c=this.getUiData5("steps_src",s,o,i,"txt_star3"),f=this.getUiData5("steps_src",s,o,i,"txt_star4"),l=this.getUiData5("steps_src",s,o,i,"txt_star5"),d=this.getUiData5("steps_src",s,o,i,"txt_norate");(a=e.find(".uifm-input-ratingstar")).data("rating")?t(a).rating("refresh",{starCaptions:{1:r,2:n,3:c,4:f,5:l},clearCaption:d}):t(a).rating({starCaptions:{1:r,2:n,3:c,4:f,5:l},clearCaption:d,starCaptionClasses:{1:"text-danger",2:"text-warning",3:"text-info",4:"text-primary",5:"text-success"}})},arguments.callee.input7settings_updateField=function(e,i,a){var o,s=e.data("typefield"),r=e.attr("id"),n=t("#"+r).closest(".uiform-step-pane").data("uifm-step"),c=this.getUiData5("steps_src",n,r,i,"language"),f=this.getUiData5("steps_src",n,r,i,"format");switch(parseInt(s)){case 24:(o=e.find(".uifm-input7-datepic")).data("DateTimePicker")||o.datetimepicker({format:"L"}),c&&o.data("DateTimePicker").locale(c),f&&(o.data("DateTimePicker").dayViewHeaderFormat(f),o.data("DateTimePicker").format(f));break;case 25:(o=e.find(".uifm-input7-timepic")).data("DateTimePicker")||o.datetimepicker({format:"LT"});break;case 26:(o=e.find(".uifm-input7-datetimepic")).data("DateTimePicker")||o.datetimepicker(),c?o.data("DateTimePicker").locale(c):o.data("DateTimePicker").locale("en"),f&&o.data("DateTimePicker").dayViewHeaderFormat(f)}},arguments.callee.input6settings_checkCaptcha=function(e,i,a){if(0!=parseInt(t(".uiform-main-form").find(".uiform-captcha").length)){var o=t(".uiform-main-form").find(".uifm-inp6-captcha");parseInt(o.length)>1&&o.each(function(e){0!=parseInt(e)&&t(this).removeClass("uifm-inp6-captcha").html("Captcha is loaded once. Remove this field")});var s=e.attr("id"),r=t("#"+s).closest(".uiform-step-pane").data("uifm-step"),n=this.getUiData5("steps_src",r,s,i,"txt_color_st"),c=this.getUiData5("steps_src",r,s,i,"txt_color"),f=this.getUiData5("steps_src",r,s,i,"background_st"),l=this.getUiData5("steps_src",r,s,i,"background_color"),d=this.getUiData5("steps_src",r,s,i,"distortion"),_=this.getUiData5("steps_src",r,s,i,"behind_lines_st"),m=this.getUiData5("steps_src",r,s,i,"behind_lines"),p=this.getUiData5("steps_src",r,s,i,"front_lines_st"),u=this.getUiData5("steps_src",r,s,i,"front_lines"),h=this.getUiData4("steps_src",r,s,i),b=CryptoJS.MD5(JSON.stringify(h)),g=t("#"+s).find(".uifm-inp6-captcha-inputcode").attr("data-check-hash");if(String(g)===String(b));else{t("#"+s).find(".uifm-inp6-captcha-inputcode").attr("data-check-hash",b);var k=e.find(".uifm-inp6-wrap-refrescaptcha a").data("rkurl");t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"formbuilder/fields/ajax_refresh_captcha",dataType:"json",data:{action:"rocket_backend_refreshcaptcha",txt_color_st:n,txt_color:c,background_st:f,background_color:l,distortion:d,behind_lines_st:_,behind_lines:m,front_lines_st:p,front_lines:u,zgfm_security:uiform_vars.ajax_nonce,page:"zgfm_cost_estimate",csrf_field_name:uiform_vars.csrf_field_name},success:function(t){e.find(".uifm-inp6-captcha-img").attr("src",k+t.rkver),e.find(".uifm-inp6-wrap-refrescaptcha a").attr("data-rkver",t.rkver)}})}}},arguments.callee.input5settings_checkRecaptcha=function(e,i,a){if(parseInt(t(".uiform-main-form").find(".uifm-input-recaptcha").length)>0){var o=t(".uiform-main-form").find(".uifm-input-recaptcha");parseInt(o.length)>1?o.each(function(e){0!=parseInt(e)?t(this).removeClass("g-recaptcha").html("ReCaptcha is loaded once. Remove this field"):t(this)}):o;var s=e.attr("id"),r=t("#"+s).closest(".uiform-step-pane").data("uifm-step"),n=(this.getUiData5("steps_src",r,s,"input5","g_key_public"),this.getUiData5("steps_src",r,s,i,"g_theme"));switch(t("#uifmobj-"+s).html(""),parseInt(n)){case 1:"dark",t("#uifmobj-"+s).html('');break;default:t("#uifmobj-"+s).html(''),"light"}}},arguments.callee.clogic_getListField=function(e){var i=t("#uiform-set-clogic-tmpl .uifm_clogic_fieldsel").clone(),a=this.getUiData("steps_src"),o=t("#uifm-field-selected-id").val(),s=[8,9,10,11,16,18,40,41,42],r="";t.each(a,function(e,i){t.each(i,function(e,i){String(o)!=String(i.id)&&t.inArray(parseInt(i.type),s)>=0&&(r+='")})}),i.append(r),e.find(".uifm_clogic_field").append(i),e.find(".uifm_clogic_fieldsel").chosen({width:"100%"})},arguments.callee.search_fieldById=function(t){var e=this.getUiData("steps_src");for(var i in e)for(var a in e[i])if(String(e[i][a].id)===String(t))return e[i][a];return!1},arguments.callee.viewchart_load=function(){var e=t("#uifm-record-form-cmb").val();rocketform.showLoader(1,!0,!0),t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"formbuilder/records/ajax_load_viewchart",data:{action:"rocket_fbuilder_loadchart_byform",page:"zgfm_cost_estimate",zgfm_security:uiform_vars.ajax_nonce,form_id:parseInt(e),csrf_field_name:uiform_vars.csrf_field_name},success:function(e){t("#uiform-viewchart-result").html(""),rocketform.viewchart_generate(e.data),rocketform.hideLoader()}})},arguments.callee.viewchart_generate=function(t){try{Morris.Area({element:"uiform-viewchart-result",data:t,xkey:"days",ykeys:["requests"],labels:["requests"],smooth:!1})}catch(t){}},arguments.callee.clogic_getTypeMatch=function(e,i){var a;switch(e.find(".uifm_clogic_mtype").html(""),e.find(".uifm_clogic_mtype").attr("data-loaded","0"),e.find(".uifm_clogic_mtype").append(''),e.find(".uifm_clogic_mtype").find(".sfdc-gly-spin").fadeOut("slow").remove(),parseInt(i)){case 8:case 9:case 10:case 11:case 40:case 41:case 42:a=t("#uiform-set-clogic-tmpl .uifm_clogic_mtypeinp_1").clone();break;case 16:case 18:a=t("#uiform-set-clogic-tmpl .uifm_clogic_mtypeinp_2").clone()}e.find(".uifm_clogic_mtype").append(a),e.find(".uifm_clogic_mtypeinp").chosen({width:"100%"}),e.find(".uifm_clogic_mtype").attr("data-loaded","1")},arguments.callee.clogic_getMatchInput=function(e,i){var a,o,s;switch(e.find(".uifm_clogic_minput").html(""),e.find(".uifm_clogic_minput").attr("data-loaded","0"),e.find(".uifm_clogic_minput").append(''),e.find(".uifm_clogic_minput").find(".sfdc-gly-spin").fadeOut("slow").remove(),parseInt(i.type)){case 8:case 9:case 10:case 11:a=t("#uiform-set-clogic-tmpl .uifm_clogic_minput_1").clone(),(s=i.input2.options)&&(o="",t.each(s,function(t,e){o+='"}),a.append(o)),e.find(".uifm_clogic_minput").append(a),e.find(".uifm_clogic_minput_1").chosen({width:"100%"});break;case 41:case 42:a=t("#uiform-set-clogic-tmpl .uifm_clogic_minput_1").clone(),(s=i.input17.options)&&(o="",t.each(s,function(t,e){o+='"}),a.append(o)),e.find(".uifm_clogic_minput").append(a),e.find(".uifm_clogic_minput_1").chosen({width:"100%"});break;case 40:a=t("#uiform-set-clogic-tmpl .uifm_clogic_minput_1").clone(),o="",o+='",o+='",a.append(o),e.find(".uifm_clogic_minput").append(a),e.find(".uifm_clogic_minput_1").chosen({width:"100%"});break;case 16:case 18:a=t("#uiform-set-clogic-tmpl .uifm_clogic_minput_2").clone();var r=i.input4.set_min,n=i.input4.set_max,c=i.input4.set_default,f=i.input4.set_step;e.find(".uifm_clogic_minput").append(a),e.find(".uifm_clogic_minput_2").TouchSpin({verticalbuttons:!0,min:parseFloat(r),max:parseFloat(n),stepinterval:parseFloat(f),verticalupclass:"sfdc-glyphicon sfdc-glyphicon-plus",verticaldownclass:"sfdc-glyphicon sfdc-glyphicon-minus",initval:parseFloat(c)})}e.find(".uifm_clogic_minput").attr("data-loaded","1")},arguments.callee.clogic_changeMtype=function(e){var i=t(e).closest(".uifm-conditional-row"),a=i.find(".uifm_clogic_mtype select").chosen().val(),o=i.data("row-index"),s=t("#uifm-field-selected-id").val(),r=t("#"+s).closest(".uiform-step-pane").data("uifm-step");rocketform.setUiData7("steps_src",parseInt(r),s,"clogic","list",parseInt(o),"mtype",a)},arguments.callee.clogic_changeMinput=function(e){var i,a=t(e).closest(".uifm-conditional-row"),o=a.data("row-index"),s=t("#uifm-field-selected-id").val(),r=t("#"+s).closest(".uiform-step-pane").data("uifm-step"),n=a.find(".uifm_clogic_fieldsel").chosen().val(),c=a.find('.uifm_clogic_fieldsel [value="'+n+'"]').data("type");switch(parseInt(c)){case 8:case 9:case 10:case 11:case 40:case 41:case 42:i=a.find(".uifm_clogic_minput_1").chosen().val();break;case 16:case 18:i=a.find(".uifm_clogic_minput_2").val()}rocketform.setUiData7("steps_src",parseInt(r),s,"clogic","list",parseInt(o),"minput",i)},arguments.callee.clogic_deleteConditional=function(e){var i=t(e),o=t("#uifm-field-selected-id").val(),s=i.closest(".uifm-conditional-row").data("row-index"),r=t("#"+o).closest(".uiform-step-pane").data("uifm-step");i.closest(".uifm-conditional-row").remove(),rocketform.delUiData6("steps_src",parseInt(r),o,"clogic","list",parseInt(s));var n,c=a.steps_src[parseInt(r)][o].clogic.list,f=c.length;for(n=0;n1?rocketform.fieldQuickOptions_selectField_MoreThanOne():(rocketform.closeSettingTab(),t(document).find(".uifm-highlight-edited")&&t(document).find(".uifm-highlight-edited").removeClass("uifm-highlight-edited"))},arguments.callee.fieldQuickOptions_EditField=function(e){var i=t(e).closest(".zgpb-fields-quick-options2").parent();parseInt(t(".uiform-main-form .uiform-fields-qopt-select input:checked").length)>0&&t(".uiform-main-form .uiform-fields-qopt-select input:checked").prop("checked",!1),t(".uiform-main-form .uiform-fields-qopt-select input").closest(".uiform-fields-quick-options").removeCss("display"),rocketform.previewfield_hidePopOver(),rocketform.previewfield_helpblock_hidetooltip(),rocketform.fieldQuickOptions_loadFieldSelected(i)},arguments.callee.fields2_fieldQuickOptions_EditField=function(e,i){t("#zgpb-editor-container .zgpb-fl-gs-block-style-hover").removeClass("zgpb-fl-gs-block-style-hover");var a,o=t(e),s=o.closest(".zgpb-field-template").attr("data-typefield"),r=o.closest(".zgpb-field-template").attr("id"),n=[],c=[];switch(parseInt(s)){case 1:case 2:case 3:case 4:case 5:if(i)n.block=0;else{var f=o.closest(".zgpb-fl-gs-block-style").attr("data-zgpb-blocknum")||0;n.block=f}a=t("#"+r).closest(".uiform-step-pane").data("uifm-step"),rocketform.enableSettingTabOnPick(r,s),c.id=r,c.typefield=s,c.step_pane=a,c.addt=n,c.oncreation=!1,rocketform.loadFieldSettingTab(c);break;default:s=(o=t(e)).closest(".uiform-field").attr("data-typefield"),r=o.closest(".uiform-field").attr("id"),n=[],a=t("#"+r).closest(".uiform-step-pane").data("uifm-step"),rocketform.enableSettingTabOnPick(r,s),c.id=r,c.typefield=s,c.step_pane=a,c.addt=n,c.oncreation=!1,rocketform.loadFieldSettingTab(c),rocketform.setHighlightPicked(t("#"+r))}},arguments.callee.fields2_fieldQuickOptions_DuplicateField=function(e){rocketform.setInnerVariable("fields_load_settings",2);var i,a,o,s,r,n,c=t("#"+e),f=c.attr("data-typefield"),l=t(".uiform-step-content .uiform-step-pane:visible").data("uifm-step");if(i={},a=c.data("iscontainer")?c.data("iscontainer"):0,i.iscontainer=parseInt(a),i.num_tab=0,i.type=f,i.id=e,1===a)rocketform.setInnerVariable("fields_flag_stored",[]),o=c.find(".zgpb-field-template").length,i.count_children=parseInt(o),s=c.find(".zgpb-field-template")||null,parseInt(o)>0&&(r=[],t(s).each(function(e,i){n=t(this).attr("id")?t(this).attr("id"):0,r.push(n)}),i.children_str=r.join(",")),i.inner=rocketform.getLayoutFormByStep_checkChildren(e,s,f,c,l),rocketform.setInnerVariable("fields_duplication_stored",i),rocketform.fields2_fieldQuickOptions_Duplicate_process(c,f);else{var d=t(".uiform-enable-fieldset").find('a[data-type="'+f+'"]'),_=t(d).clone();_.insertAfter(c);rocketform.getFieldsAfterDraggable(_,f,!0,c.attr("id"))}setTimeout(function(){rocketform.setInnerVariable("fields_load_settings",1)},1e3)},arguments.callee.fields2_fieldQuickOptions_Duplicate_process=function(e,i){var a=rocketform.getInnerVariable("fields_duplication_stored"),o=t(".uiform-enable-fieldset").find('a[data-type="'+i+'"]').first(),s=t(o).clone();s.insertAfter(e);var r,n,c,f,l,d,_=t(".uiform-step-content .uiform-step-pane:visible").data("uifm-step"),m=rocketform.getFieldsAfterDraggable(s,i,!0,e.attr("id"));switch(rocketform.enableFieldPlugin(_,m,i,rocketform.getUiData3("steps_src",_,m)),parseInt(i)){case 1:case 2:case 3:case 4:case 5:d=setInterval(function(){t("#"+m).find(".sfdc-container-fluid").length&&(0!=parseInt(a.inner.length)&&t.each(a.inner,function(e,i){c=t("#"+m).find("> .sfdc-container-fluid .zgpb-fl-gs-block-style:eq("+e+")"),f=c.find("> .zgpb-fl-gs-block-inner"),l=t.map(i.children,function(t,e){return e}).length,parseInt(l)>0&&t.each(i.children,function(t,e){r=e.id,n=e.type,rocketform.fieldQuickOptions_Duplicate_checkChildren(n,r,f)})}),clearInterval(d),d=null)},1e3);break;case 31:d=setInterval(function(){t("#"+m).find("> .uiform-field-wrap").length&&(0!=parseInt(a.inner.length)&&t.each(a.inner,function(e,i){c=t("#"+m).find("> .uiform-field-wrap").find(".uifm-input31-main-wrap").first(),f=c.find("> .uiform-grid-inner-col"),l=t.map(i.children,function(t,e){return e}).length,parseInt(l)>0&&t.each(i.children,function(t,e){r=e.id,n=e.type,rocketform.fieldQuickOptions_Duplicate_checkChildren(n,r,f)})}),clearInterval(d),d=null)},1e3)}},arguments.callee.fieldQuickOptions_Duplicate_checkChildren=function(e,i,a){var o,s,r,n,c,f,l,d,_;n=rocketform.getInnerVariable("fun_dupli_cur_field"),s=t(".uiform-enable-fieldset").find('a[data-type="'+e+'"]'),r=t(s).clone(),a.append(r),o=rocketform.getFieldsAfterDraggable(r,e,!0,i);var m,p=t(".uiform-step-content .uiform-step-pane:visible").data("uifm-step");switch(rocketform.enableFieldPlugin(p,o,e,rocketform.getUiData3("steps_src",p,o)),parseInt(e)){case 1:case 2:case 3:case 4:case 5:m=setInterval(function(){t("#"+o).find(".sfdc-container-fluid").length&&(n.hasOwnProperty("inner")&&0!=parseInt(n.inner.length)&&t.each(n.inner,function(e,i){c=t("#"+o).find("> .sfdc-container-fluid .zgpb-fl-gs-block-style:eq("+e+")"),f=c.find("> .zgpb-fl-gs-block-inner"),l=t.map(i.children,function(t,e){return e}).length,parseInt(l)>0&&t.each(i.children,function(t,e){d=e.id,_=e.type,rocketform.setInnerVariable("fun_dupli_cur_field",e),rocketform.fieldQuickOptions_Duplicate_checkChildren(_,d,f)})}),clearInterval(m),m=null)},1e3)}},arguments.callee.fields2_fieldQuickOptions_deleteField=function(e){var i=t("#zgpb_fld_del_box_title").val(),a=t("#zgpb_fld_del_box_msg").val(),o=t("#zgpb_fld_del_box_bt1_title").val(),s=t("#zgpb_fld_del_box_bt2_title").val();bootbox.dialog({message:a,title:i,buttons:{fld_del_opt1:{label:o,className:"sfdc-btn-default",callback:function(){t("body").removeClass("sfdc-modal-open")}},fld_del_opt2:{label:s,className:"sfdc-btn-primary",callback:function(){rocketform.fields2_fieldsetting_deleteField(e),rocketform.formvariables_removeFromlist(e),rocketform.fieldsdata_email_genListToIntMem(),zgfm_back_helper.tooltip_removeall(),t("body").removeClass("sfdc-modal-open")}}}})},arguments.callee.fields2_fieldsetting_deleteField=function(e){var i=t("#"+e).closest(".uiform-step-pane").data("uifm-step");i=parseInt(i),rocketform.delUiData3("steps_src",i,e),rocketform.closeSettingTab();var o,s=a.steps_src[i],r=s.length;for(o=0;o"+t("#uifm_guidetour_popup_notfound").val()+"

    ")}},arguments.callee.input4settings_generateField=function(e,i){var a,o,s=e.attr("id"),r=t("#"+s).closest(".uiform-step-pane").data("uifm-step"),n=this.getUiData5("steps_src",r,s,i,"set_min"),c=this.getUiData5("steps_src",r,s,i,"set_max"),f=this.getUiData5("steps_src",r,s,i,"set_default"),l=this.getUiData5("steps_src",r,s,i,"set_step"),d=this.getUiData4("steps_src",r,s,"type"),_=this.getUiData4("steps_src",r,s,i),m=CryptoJS.MD5(JSON.stringify(_)),p=t("#"+s).find(".uifm-inp4-fld").attr("data-check-hash");switch(parseInt(d)){case 16:null==(a=t("#"+s).find(".uifm-inp4-fld")).data("bootstrapSlider")&&(0!=parseInt(t("#"+s).find(".slider").find(".uifm-inp4-fld").length)&&(o=a.detach(),t("#"+s).find(".uifm-input4-wrap").append(o),a=t("#"+s).find(".uifm-inp4-fld")),a.parent().find(".slider").remove(),a.bootstrapSlider({step:parseFloat(l),min:parseFloat(n),max:parseFloat(c),value:parseFloat(f)}));break;case 17:a=t("#"+s).find(".uifm-inp4-fld");var u=this.getUiData5("steps_src",r,s,i,"set_range1"),h=this.getUiData5("steps_src",r,s,i,"set_range2");null==a.data("bootstrapSlider")&&(0!=parseInt(t("#"+s).find(".slider").find(".uifm-inp4-fld").length)&&(o=a.detach(),t("#"+s).find(".uifm-input4-wrap").append(o),a=t("#"+s).find(".uifm-inp4-fld")),a.parent().find(".slider").remove(),a.bootstrapSlider({step:parseFloat(l),min:parseFloat(n),max:parseFloat(c),range:!0,value:[parseFloat(u),parseFloat(h)]}))}if(String(p)===String(m));else switch(t("#"+s).find(".uifm-inp4-fld").attr("data-check-hash",m),parseInt(d)){case 16:a.bootstrapSlider("setAttribute","step",parseFloat(l)),a.bootstrapSlider("setAttribute","min",parseFloat(n)),a.bootstrapSlider("setAttribute","max",parseFloat(c)),a.bootstrapSlider("setAttribute","value",parseFloat(f)),a.bootstrapSlider("refresh"),t("#"+s).find(".uifm-inp4-number").html(f);break;case 17:a.bootstrapSlider("setAttribute","step",parseFloat(l)),a.bootstrapSlider("setAttribute","min",parseFloat(n)),a.bootstrapSlider("setAttribute","max",parseFloat(c)),a.bootstrapSlider("setAttribute","value",[parseFloat(u),parseFloat(h)]),a.bootstrapSlider("setAttribute","range",!0),a.bootstrapSlider("refresh");break;case 18:(a=t("#"+s).find(".uifm-input4-wrap")).find(".uifm-inp4-fld").val(parseFloat(f)),0!=parseInt(a.find(".bootstrap-touchspin").length)?a.find(".uifm-inp4-fld").trigger("touchspin.updatesettings",{min:parseFloat(n),max:parseFloat(c),stepinterval:parseFloat(l),initval:parseFloat(f)}):a.find(".uifm-inp4-fld").TouchSpin({verticalbuttons:!0,min:parseFloat(n),max:parseFloat(c),stepinterval:parseFloat(l),verticalupclass:"sfdc-glyphicon sfdc-glyphicon-plus",verticaldownclass:"sfdc-glyphicon sfdc-glyphicon-minus",initval:parseFloat(f)});var b=this.getUiData5("steps_src",r,s,i,"skin_maxwidth_st"),g=this.getUiData5("steps_src",r,s,i,"skin_maxwidth");1===parseInt(b)?(a.css("max-width",g+"px"),a.css("width","100%")):a.removeCss("max-width")}},arguments.callee.backup_deleteStoredFile=function(e){var i=e.attr("data-uifm-file");rocketform.loading_panelbox2(1),t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"formbuilder/settings/ajax_backup_deletefile",data:{action:"uiform_fbuilder_setting_delbackupfile",page:"zgfm_cost_estimate",zgfm_security:uiform_vars.ajax_nonce,uifm_frm_delfile:i,csrf_field_name:uiform_vars.csrf_field_name},success:function(){rocketform.loading_panelbox2(0);var t=uiform_vars.url_admin+"formbuilder/settings/backup_settings";rocketform.redirect_tourl(t)}})},arguments.callee.backup_restoreBackup=function(e){var i=e.attr("data-uifm-file");rocketform.loading_panelbox2(1),t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"formbuilder/settings/ajax_backup_restorefile",data:{action:"uiform_fbuilder_setting_restorebkpfile",page:"zgfm_cost_estimate",zgfm_security:uiform_vars.ajax_nonce,uifm_frm_resfile:i,csrf_field_name:uiform_vars.csrf_field_name},success:function(){rocketform.loading_panelbox2(0);var e=t("#uifm_bkp_msg_success_restore").val();t("#uifm-backup-response").html(rocketform.alerts_global_msg(1,e))}})},arguments.callee.backup_PopUpRestore=function(e){var i=t("#uifm_bkp_restore_box_title").val(),a=t("#uifm_fld_del_box_msg").val(),o=t("#uifm_fld_del_box_bt1_title").val(),s=t("#uifm_fld_del_box_bt2_title").val();bootbox.dialog({message:a,title:i,buttons:{fld_del_opt1:{label:o,className:"sfdc-btn-default",callback:function(){t("body").removeClass("sfdc-modal-open")}},fld_del_opt2:{label:s,className:"sfdc-btn-primary",callback:function(){rocketform.backup_restoreBackup(t(e)),t("body").removeClass("sfdc-modal-open")}}}})},arguments.callee.showFeatureLocked=function(e){t("#uifm_modal_msg").sfdc_modal("show"),t("#uifm_modal_msg .sfdc-modal-title").html("Feature locked");var i;i=t(e).attr("data-blocked-feature"),t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"formbuilder/settings/ajax_blocked_getmessage",data:{action:"uiform_fbuilder_blocked_getmessage",page:"zgfm_cost_estimate",zgfm_security:uiform_vars.ajax_nonce,message:i,csrf_field_name:uiform_vars.csrf_field_name},success:function(e){t("#uifm_modal_msg .sfdc-modal-body").html(e.msg)}})},arguments.callee.backup_PopUpDelete=function(e){var i=t("#uifm_bkp_del_box_title").val(),a=t("#uifm_fld_del_box_msg").val(),o=t("#uifm_fld_del_box_bt1_title").val(),s=t("#uifm_fld_del_box_bt2_title").val();bootbox.dialog({message:a,title:i,buttons:{fld_del_opt1:{label:o,className:"sfdc-btn-default",callback:function(){t("body").removeClass("sfdc-modal-open")}},fld_del_opt2:{label:s,className:"sfdc-btn-primary",callback:function(){rocketform.backup_deleteStoredFile(t(e)),t("body").removeClass("sfdc-modal-open")}}}})},arguments.callee.previewform_refreshsummbox=function(){var e=t("#uifm-sticky-sidebar-box"),i=this.getUiData3("summbox","setting","enable_st"),a=(this.getUiData3("summbox","setting","resp_pos"),this.getUiData3("summbox","skin_box","box_sd_width")),o=this.getUiData3("summbox","setting","pos"),s=this.getUiData3("summbox","skin_text","text"),r=this.getUiData3("summbox","skin_text","color"),n=this.getUiData3("summbox","skin_text","font"),c=this.getUiData3("summbox","skin_text","font_st");if(1===parseInt(i)){var f;switch(e.show(),parseInt(o)){case 1:f="right";break;case 2:f="left";break;case 3:f="bottom";break;case 4:f="topout";break;case 5:f="bottomout";break;case 0:default:f="top"}e.data("uiform_stickybox")?(e.data("uiform_stickybox").updateData({enable:0,orientation:f,form_container:t(".uiform-main-form"),main_container:t(".uiform-preview-base"),sticky:{width:a,height:"200"},resp_orientation:1,backend:1}),e.data("uiform_stickybox").init()):e.uiform_stickybox({enable:0,orientation:f,form_container:t(".uiform-main-form"),main_container:t(".uiform-preview-base"),sticky:{width:a,height:"200"},resp_orientation:1,backend:1});var l=decodeURIComponent(s);if(l=rocketform.pricesettings_processFormats(l),t("#uifm-sticky-sidebar-box-content").html(l),t("#uifm-sticky-sidebar-box-content").css({color:r}),1===parseInt(c)&&n){var d=JSON.parse(n);t("#uifm-sticky-sidebar-box-content").css("font-family",d.family)}else t("#uifm-sticky-sidebar-box-content").removeCss("font-family")}else e.hide(),t(".uiform-main-form").removeCss("width"),rocketform.previewform_skin_maxwidth();rocketform.guidedtour_showTextOnPreviewPane_recalc()},arguments.callee.pricesettings_processFormats=function(t){return t=rocketform.strings_replace_all(t,{"\\[uifm_symbol]":"$","\\[uifm_total]":"##","\\[uifm_price]":"##","\\[uifm_summary (.+?)]":" here goes summary content","\\[uifm_summary_link (.+?)]":'Show summary ',"\\[uifm_currency]":"USD"})},arguments.callee.strings_replace_all=function(e,i){var a,o=Object.keys(i);return t.each(o,function(t,o){a=new RegExp(o,"g"),e=e.replace(a,function(t){return i[o]})}),e},arguments.callee.testing_summbox=function(){},arguments.callee.backup_create=function(){rocketform.loading_panelbox2(1),t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"formbuilder/settings/ajax_backup_create",data:{action:"uiform_fbuilder_setting_backup",page:"zgfm_cost_estimate",zgfm_security:uiform_vars.ajax_nonce,uifm_frm_namebackup:t("#_uifm_backup_namebkp").val(),csrf_field_name:uiform_vars.csrf_field_name},success:function(){rocketform.loading_panelbox2(0),t("#_uifm_backup_namebkp").val("");var e=uiform_vars.url_admin+"formbuilder/settings/backup_settings";rocketform.redirect_tourl(e)},error:function(t,e,i){}})},arguments.callee.migrateToVersion3=function(){rocketform.loading_panelbox2(1),t.each(a.steps_src,function(e,i){t.isPlainObject(i)&&t.each(i,function(t,i){switch(parseInt(a.steps_src[e][t].type)){case 1:case 2:case 3:case 4:case 5:delete a.steps_src[e][t].skin;break;default:delete a.steps_src[e][t].skin}})}),this.migrateToVersion3_process()},arguments.callee.migrateToVersion3_process=function(){var e=a;t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"formbuilder/forms/ajax_refresh_previewpanel",data:{action:"rocket_fbuilder_refreshpreviewpanel",page:"zgfm_cost_estimate",zgfm_security:uiform_vars.ajax_nonce,uifm_frm_main_title:t("#uifm_frm_main_title").val(),uifm_frm_main_id:t("#uifm_frm_main_id").val(),form_data:encodeURIComponent(JSON.stringify(e)),csrf_field_name:uiform_vars.csrf_field_name},success:function(e){e.data.fmb_html_backend=decodeURIComponent(e.data.fmb_html_backend);var i,o,s,r={main:e.data.fmb_data.main,skin:e.data.fmb_data.skin,wizard:e.data.fmb_data.wizard,onsubm:e.data.fmb_data.onsubm,num_tabs:e.data.fmb_data.num_tabs,steps:e.data.fmb_data.steps,steps_src:e.data.fmb_data.steps_src};a=t.extend(!0,{},a,r),t(".uiform-preview-base").html(e.data.fmb_html_backend),t.each(a.steps_src,function(e,r){t.isPlainObject(r)&&t.each(r,function(r,n){switch(parseInt(a.steps_src[e][r].type)){case 1:case 2:case 3:case 4:case 5:switch(s=a.steps_src[e][r],i=a.steps_src[e][r].id,t("#"+i).zgpbld_gridsystem(),(o=t("#"+i).data("zgpbld_gridsystem")).setToDatalvl1("id",i),parseInt(a.steps_src[e][r].type)){case 1:o.setToDatalvl1("type",1),o.setToDatalvl1("type_n","grid1");break;case 2:o.setToDatalvl1("type",2),o.setToDatalvl1("type_n","grid2");break;case 3:o.setToDatalvl1("type",3),o.setToDatalvl1("type_n","grid3");break;case 4:o.setToDatalvl1("type",4),o.setToDatalvl1("type_n","grid4");break;case 5:o.setToDatalvl1("type",5),o.setToDatalvl1("type_n","grid6")}o.createBlockAttributes(),o.update_settingsData(s),o.setStep(e),o.updateVarData(i),o.setDataToCoreStore(e,i)}})}),e.data.fmb_data.steps_src=a.steps_src,rocketform.loadFormToEditPanel(e),rocketform.wizardform_refresh(),rocketform.loading_panelbox2(0)}})},arguments.callee.regenerateform=function(){rocketform.loading_panelbox2(1),this.refreshPreviewSection_process()},arguments.callee.refreshPreviewSection_process=function(){var e=a;t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"formbuilder/forms/ajax_refresh_previewpanel",data:{action:"rocket_fbuilder_refreshpreviewpanel",page:"zgfm_cost_estimate",zgfm_security:uiform_vars.ajax_nonce,uifm_frm_main_title:t("#uifm_frm_main_title").val(),uifm_frm_main_id:t("#uifm_frm_main_id").val(),form_data:encodeURIComponent(JSON.stringify(e)),csrf_field_name:uiform_vars.csrf_field_name},success:function(e){e.data.fmb_html_backend=decodeURIComponent(e.data.fmb_html_backend),rocketform.loadFormToEditPanel(e),rocketform.wizardform_refresh(),0!=parseInt(t.map(a.steps_src,function(t,e){return e}).length)&&t.each(a.steps_src,function(e,i){t.each(i,function(t,i){switch(parseInt(i.type)){case 1:case 2:case 3:case 4:case 5:break;case 8:case 9:case 10:case 11:var a=rocketform.getUiData5("steps_src",parseInt(e),i.id,"input2","options");for(var o in rocketform.setUiData5("steps_src",parseInt(e),i.id,"input2","options",{}),a)rocketform.addIndexUiData5("steps_src",parseInt(e),i.id,"input2","options",String(o)),rocketform.setUiData6("steps_src",parseInt(e),i.id,"input2","options",String(o),{value:a[o].value,label:a[o].label,checked:a[o].checked,price:a[o].price,order:a[o].order,id:a[o].id})}})}),rocketform.loading_panelbox2(0)}})},arguments.callee.refreshPreviewSection=function(){(rocketform.loading_panelbox2(1),rocketform.saveform_cleanForm(),t(document).find(".uifm-highlight-edited")&&t(document).find(".uifm-highlight-edited").removeClass("uifm-highlight-edited"),t(".uiform-main-form .uiform-fields-qopt-select input:checked").prop("checked",!1),t(".uiform-main-form .uiform-fields-qopt-select input:checked").closest(".uiform-fields-quick-options").removeCss("display"),this.closeSettingTab(),this.saveTabContent(),0!=parseInt(t(".uiform-main-form").find(".uifm-input-ratingstar").length))&&t(".uiform-main-form").find(".uifm-input-ratingstar").each(function(e){t(this).rating("destroy")});0!=parseInt(t(".uiform-main-form").find(".uifm-input-ratingstar").length)&&t(".uiform-main-form").find(".uifm-input-ratingstar").each(function(e){rocketform.input9settings_updateField(t(this).closest(".uiform-field"),"input9")}),this.refreshPreviewSection_process(),t(".sfdc-tooltip").hide()},arguments.callee.refreshPreviewSectionFromData=function(){rocketform.loading_panelbox2(1),t(document).find(".uifm-highlight-edited")&&t(document).find(".uifm-highlight-edited").removeClass("uifm-highlight-edited"),t(".uiform-main-form .uiform-fields-qopt-select input:checked").prop("checked",!1),t(".uiform-main-form .uiform-fields-qopt-select input:checked").closest(".uiform-fields-quick-options").removeCss("display"),this.closeSettingTab(),rocketform.showLoader(2,!0,!0);var e,i={},a=this.getUiData("steps_src");(t.each(a,function(t,a){(e={}).content=rocketform.getLayoutFormByStep(t),i[t]=e}),this.setUiData2("steps","tab_cont",i),0!=parseInt(t(".uiform-main-form").find(".uifm-input-ratingstar").length))&&t(".uiform-main-form").find(".uifm-input-ratingstar").each(function(e){t(this).rating("destroy")});0!=parseInt(t(".uiform-main-form").find(".uifm-input-ratingstar").length)&&t(".uiform-main-form").find(".uifm-input-ratingstar").each(function(e){rocketform.input9settings_updateField(t(this).closest(".uiform-field"),"input9")}),this.refreshPreviewSection_process(),t(".sfdc-tooltip").hide()},arguments.callee.gateway_saveoffline=function(){t("#uiform-form-editgateway").validate({errorClass:"help-inline",errorElement:"span",rules:{pg_name:{required:!0}},messages:{pg_name:{required:"Please specify a name"}},highlight:function(e){t(e).closest(".control-group").addClass("error").removeClass("success")},success:function(e){t(e).text("").closest(".control-group").addClass("success")},submitHandler:function(e){var i=t(e).serialize();t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"gateways/settings/ajax_save_options",data:i+"&action=rocket_fbuilder_setting_saveGateway&page=zgfm_cost_estimate&csrf_field_name="+uiform_vars.csrf_field_name,beforeSend:function(){rocketform.showLoader(3,!0,!0)},success:function(t){rocketform.hideLoader(),rocketform.gateway_gotoList()}})}}),t("#uiform-form-editgateway").submit()},arguments.callee.gateway_savepaypal=function(){t("#uiform-form-editgateway").validate({errorClass:"help-inline",errorElement:"span",rules:{pg_name:{required:!0},paypal_email:{required:!0,email:!0}},messages:{pg_name:{required:"Please specify a name"},paypal_email:{required:"We need a valid email address"}},highlight:function(e){t(e).closest(".control-group").addClass("error").removeClass("success")},success:function(e){t(e).text("").closest(".control-group").addClass("success")},submitHandler:function(e){var i=t(e).serialize();t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"gateways/settings/ajax_save_options",data:i+"&action=rocket_fbuilder_setting_saveGateway&page=zgfm_cost_estimate&csrf_field_name="+uiform_vars.csrf_field_name,beforeSend:function(){rocketform.showLoader(3,!0,!0)},success:function(t){rocketform.hideLoader(),rocketform.gateway_gotoList()}})}}),t("#uiform-form-editgateway").submit()},arguments.callee.gateway_gotoList=function(){var t=rockfm_vars.uifm_siteurl+"gateways/settings/view_settings";rocketform.redirect_tourl(t)},arguments.callee.form_getcode=function(e){t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"formbuilder/forms/getcode/",data:{action:"rocket_fbuilder_modal_form_getshorcodes",page:"zgfm_cost_estimate",zgfm_security:uiform_vars.ajax_nonce,form_id:e,csrf_field_name:uiform_vars.csrf_field_name},beforeSend:function(){t("#uifm_modal_msg .sfdc-modal-body").html(' ')},success:function(e){var i=JSON&&JSON.parse(e)||t.parseJSON(e);t("#uifm_modal_msg").sfdc_modal("show"),t("#uifm_modal_msg .sfdc-modal-title").html(i.html_title),t("#uifm_modal_msg .sfdc-modal-body").html(i.html)}})},arguments.callee.modal_close=function(){t("#modaltemplate").sfdc_modal("hide")},arguments.callee.formvariables_genListToIntMem=function(){rocketform.formvariables_generateTable()},arguments.callee.formvariables_addTolist=function(e){var i;i=this.getInnerVariable("form_rec_vars"),-1==t.inArray(e,i)&&i.push(e),this.setInnerVariable("form_rec_vars",i),rocketform.formvariables_generateTable()},arguments.callee.formvariables_removeFromlist=function(e){var i;i=this.getInnerVariable("form_rec_vars");var a=e;i=t.grep(i,function(t){return t!=a}),this.setInnerVariable("form_rec_vars",i),rocketform.formvariables_generateTable()},arguments.callee.formvariables_generateTable=function(){var e=t("#uifm_frm_main_id").val(),i=a;t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"formbuilder/forms/ajax_variables_emailpage",data:{action:"rocket_fbuilder_variables_emailpage",page:"zgfm_cost_estimate",zgfm_security:uiform_vars.ajax_nonce,form_id:e,form_data:encodeURIComponent(JSON.stringify(i)),csrf_field_name:uiform_vars.csrf_field_name},success:function(e){t("#uiform-form-mailset-vars-tab-1 .uifm-tab-inner-vars-1").html(e.message)}})},arguments.callee.formvariables_findFieldName=function(t){var e="";t:for(var i in a.steps_src)for(var o in a.steps_src[i])if(String(a.steps_src[i][o].id)===String(t)){e=a.steps_src[i][o].field_name;break t}return e},arguments.callee.formvariables_findFieldType=function(t){var e="";t:for(var i in a.steps_src)for(var o in a.steps_src[i])if(String(a.steps_src[i][o].id)===String(t)){e=a.steps_src[i][o].type;break t}return e},arguments.callee.fieldsdata_email_genListToIntMem=function(){rocketform.setInnerVariable("form_vars_fields_emailval",[]),0!=parseInt(t.map(a.steps_src,function(t,e){return e}).length)&&t.each(a.steps_src,function(e,i){t.each(i,function(e,i){if(0!=parseInt(t("#"+e).length))switch(parseInt(i.type)){case 6:case 28:case 29:case 30:4===parseInt(i.validate.typ_val)&&rocketform.fieldsdata_email_addTolist(i.id)}})}),rocketform.customeremail_generateHtml(),rocketform.adminemail_generateHtml()},arguments.callee.fieldsdata_email_addTolist=function(e){var i;i=this.getInnerVariable("form_vars_fields_emailval"),-1==t.inArray(e,i)&&i.push(e),this.setInnerVariable("form_vars_fields_emailval",i)},arguments.callee.customeremail_generateHtml=function(){t("#uifm_frm_email_usr_recipient").html(""),t("#uifm_frm_email_usr_recipient").append('");var e=this.getInnerVariable("form_vars_fields_emailval");t.each(e,function(e,i){t("#uifm_frm_email_usr_recipient").append('")});var i=rocketform.getUiData2("onsubm","mail_usr_recipient");parseInt(t("#uifm_frm_email_usr_recipient option[value='"+i+"']").length)>0?t("#uifm_frm_email_usr_recipient").val(i):(t("#uifm_frm_email_usr_recipient").val(""),rocketform.setUiData2("onsubm","mail_usr_recipient",""))},arguments.callee.adminemail_generateHtml=function(){t("#uifm_frm_email_replyto").html(""),t("#uifm_frm_email_replyto").append('");var e=this.getInnerVariable("form_vars_fields_emailval");t.each(e,function(e,i){t("#uifm_frm_email_replyto").append('")});var i=rocketform.getUiData2("onsubm","mail_replyto");parseInt(t("#uifm_frm_email_replyto option[value='"+i+"']").length)>0?t("#uifm_frm_email_replyto").val(i):(t("#uifm_frm_email_replyto").val(""),rocketform.setUiData2("onsubm","mail_replyto",""))},arguments.callee.invoiceoptions_genListToIntMem=function(){rocketform.setInnerVariable("form_vars_invoice_optto",[]),0!=parseInt(t.map(a.steps_src,function(t,e){return e}).length)&&t.each(a.steps_src,function(e,i){t.each(i,function(e,i){if(0!=parseInt(t("#"+e).length))switch(parseInt(i.type)){case 6:case 7:case 28:case 29:case 30:rocketform.invoiceoptions_addTolist(i.id)}})}),rocketform.invoiceoptions_generateHtml()},arguments.callee.invoiceoptions_addTolist=function(e){var i;i=this.getInnerVariable("form_vars_invoice_optto"),-1==t.inArray(e,i)&&i.push(e),this.setInnerVariable("form_vars_invoice_optto",i)},arguments.callee.invoiceoptions_generateHtml=function(){var e,i;t.each([1,2,3,4],function(a,o){t("#uifm_frm_inv_to_text"+o).html(""),t("#uifm_frm_inv_to_text"+o).append('"),e=rocketform.getInnerVariable("form_vars_invoice_optto"),t.each(e,function(e,i){t("#uifm_frm_inv_to_text"+o).append('")}),i=rocketform.getUiData2("invoice","to_text"+o),parseInt(t("#uifm_frm_inv_to_text"+o+" option[value='"+i+"']").length)>0?t("#uifm_frm_inv_to_text"+o).val(i):(t("#uifm_frm_inv_to_text"+o).val(""),rocketform.setUiData2("invoice","to_text"+o,""))})},arguments.callee.clogicgraph_popup=function(){t("#uiform-clogicgraph").dialog("open"),t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"formbuilder/forms/ajax_preview_clogic_graph",data:{action:"rocket_fbuilder_preview_clogic_graph",page:"zgfm_cost_estimate",zgfm_security:uiform_vars.ajax_nonce,form_data:encodeURIComponent(JSON.stringify(a)),csrf_field_name:uiform_vars.csrf_field_name},beforeSend:function(){t("#uiform-clogicgraph").html(' ')},success:function(e){var i=JSON&&JSON.parse(e)||t.parseJSON(e);t("#uiform-clogicgraph").html(i.html)}})},arguments.callee.loadFieldSettingTab=function(e){try{var i,a=e.id,o=e.typefield,s=(e.step_pane,e.addt);e.oncreation;switch(rocketform.loading_boxField("zgfm-panel-right-field-tabopt",1),t("#uiform-build-field-tab").addClass("zgfm-fieldtab-flag-loading"),parseInt(o)){case 1:case 2:case 3:case 4:case 5:i=s?s.block:0;break;default:i=0}var r=uiform_vars.fields_fastload;if(1!==parseInt(r)){var n;switch(parseInt(o)){case 1:case 2:case 3:case 4:case 5:case 8:case 9:case 10:case 11:n=wp.template("zgfm-field-opt-type-"+o);break;default:case 6:n=wp.template("zgfm-field-opt-type-6")}let s,r=t("
    ").html(n({site_url:rockfm_vars.uifm_baseurl})).text();s=0===parseInt(uiform_vars.app_is_lite)?{modal_body:r,field_id:a,field_type:o,field_block:i,addons:["func_anim"]}:{modal_body:r,field_id:a,field_type:o,field_block:i,addons:[]},zgfm_back_fld_options.load_on_selecteField(e,s)}else t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"formbuilder/fields/ajax_field_option",data:{action:"rocket_fbuilder_field_options",page:"zgfm_cost_estimate",csrf_field_name:uiform_vars.csrf_field_name,zgfm_security:uiform_vars.ajax_nonce,field_id:a,field_type:o,field_block:i},success:function(t){zgfm_back_fld_options.load_on_selecteField(e,t)}})}catch(t){}},arguments.callee.tinymceEvent_removeInst=function(){var e;t("#uiform-build-field-tab").find("#uifm_fld_msc_text")&&"undefined"!=typeof tinyMCE&&(e=tinyMCE.get("uifm_fld_msc_text"))&&e.remove(),t("#uiform-build-field-tab").find("#uifm_fld_price_lbl_format")&&"undefined"!=typeof tinyMCE&&(e=tinyMCE.get("uifm_fld_price_lbl_format"))&&e.remove(),t("#uiform-build-field-tab").find("#uifm_fld_inp3_html")&&"undefined"!=typeof tinyMCE&&(e=tinyMCE.get("uifm_fld_inp3_html"))&&e.remove(),t("#uiform-build-field-tab").find("#uifm_frm_inp18_txt_cont")&&"undefined"!=typeof tinyMCE&&(e=tinyMCE.get("uifm_frm_inp18_txt_cont"))&&e.remove()},arguments.callee.tinymceEvent_init=function(){},arguments.callee.checkIntegrityTinyMCE=function(t){var e=!1;try{return"undefined"!=typeof tinyMCE&&tinyMCE.activeEditor&&!tinyMCE.activeEditor.isHidden()&&(e=!0),e}catch(t){return!1}},arguments.callee.fields_events_bswitch=function(e){try{t(".switch-field").bootstrapSwitchZgpb(),t("#zgpb-editor-container .uifm-inp15-fld").bootstrapSwitchZgpb(),t("#uiform-build-field-tab .switch-field").on("switchChange.bootstrapSwitchZgpb",function(e,i){var a,o=t("#uifm-field-selected-id").val(),s=t(this).data("field-store"),r=s.split("-"),n=(r[0],r[1],i?1:0),c=t(".uiform-main-form .uiform-fields-qopt-select input:checked");if(parseInt(c.length)>1)f=c.closest(".uiform-field"),t.each(f,function(e,i){o=t(this).attr("id"),a=t("#"+o).closest(".uiform-step-pane").data("uifm-step"),rocketform.setDataOptToCoreData(a,o,s,n),t(this)&&rocketform.setDataOptToPrevField(t(this),s,n)});else{a=t("#"+o).closest(".uiform-step-pane").data("uifm-step"),rocketform.setDataOptToCoreData(a,o,s,n);var f=t("#"+o);f&&rocketform.setDataOptToPrevField(f,s,n)}})}catch(t){}},arguments.callee.fields_events_spinner=function(e){try{t(".uifm_fld_inp4_spinner").TouchSpin({verticalbuttons:!0,min:-1e9,max:1e9,decimals:3,step:.001,verticalupclass:"sfdc-glyphicon sfdc-glyphicon-plus",verticaldownclass:"sfdc-glyphicon sfdc-glyphicon-minus"}),t(".uifm_fld_inp6_spinner").TouchSpin({verticalbuttons:!0,min:0,max:5,stepinterval:1,verticalupclass:"sfdc-glyphicon sfdc-glyphicon-plus",verticaldownclass:"sfdc-glyphicon sfdc-glyphicon-minus"}),t(".uifm_fld_inp2_stl1").TouchSpin({verticalbuttons:!0,min:0,max:100,stepinterval:1,verticalupclass:"sfdc-glyphicon sfdc-glyphicon-plus",verticaldownclass:"sfdc-glyphicon sfdc-glyphicon-minus"}),t(".uifm_fld_input16_spinner").TouchSpin({verticalbuttons:!0,min:0,max:200,stepinterval:1,verticalupclass:"sfdc-glyphicon sfdc-glyphicon-plus",verticaldownclass:"sfdc-glyphicon sfdc-glyphicon-minus"}),t(".uifm_fld_inp17_thopt_spinner").TouchSpin({verticalbuttons:!0,min:35,max:1e3,stepinterval:1,verticalupclass:"sfdc-glyphicon sfdc-glyphicon-plus",verticaldownclass:"sfdc-glyphicon sfdc-glyphicon-minus"}),t(".uifm_fld_inp17_thopt_spinner_2").TouchSpin({verticalbuttons:!0,min:50,max:1e3,stepinterval:1,verticalupclass:"sfdc-glyphicon sfdc-glyphicon-plus",verticaldownclass:"sfdc-glyphicon sfdc-glyphicon-minus"}),t(".uifm_fld_inp4_spinner,.uifm_fld_inp6_spinner,.uifm_fld_inp4_spinner,.uifm_fld_input16_spinner,.uifm_fld_inp2_stl1").on("change",function(e){var i=t("#uifm-field-selected-id").val(),a=t(e.target).data("field-store"),o=a.split("-"),s=(o[0],o[1],t(e.target).val()),r=t("#"+i).closest(".uiform-step-pane").data("uifm-step");rocketform.setDataOptToCoreData(r,i,a,s);var n=t("#"+i);n&&rocketform.setDataOptToPrevField(n,a,s)})}catch(t){}},arguments.callee.fields_events_general=function(i){try{var a;t("#uiform-build-field-tab .uifm_tinymce_obj").html(""),tinymce.init({selector:".uifm_tinymce_obj",theme:"modern",menubar:!1,height:200,plugins:["advlist autolink lists link image charmap print preview anchor","searchreplace visualblocks code fullscreen","insertdatetime media contextmenu paste code"],relative_urls:!1,remove_script_host:!1,convert_urls:!0,browser_spellcheck:!0,codemirror:{indentOnInit:!0,path:"CodeMirror"},image_advtab:!0,toolbar1:"undo redo | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | styleselect",toolbar2:"| image | media | link unlink anchor | forecolor backcolor | print preview code | youtube | qrcode | flickr | picasa ",file_browser_callback:elFinderBrowser,setup:function(t){t.on("change KeyUp",function(e){rocketform.captureEventTinyMCE(t,e)})}}),uiformRefreshFontMenu(),jQuery("#uiform-build-field-tab select.sfm").chosen().change(function(){var e,i=jQuery(this).data("stylesFontMenu").uifm_preview_font_change(),a=t("#uifm-field-selected-id").val(),o=t(this).data("field-store"),s=o.split("-"),r=(s[0],s[1],JSON.stringify(i)),n=t(".uiform-main-form .uiform-fields-qopt-select input:checked");if(parseInt(n.length)>1)r&&(c=n.closest(".uiform-field"),t.each(c,function(i,s){a=t(this).attr("id"),e=t("#"+a).closest(".uiform-step-pane").data("uifm-step"),rocketform.setDataOptToCoreData(e,a,o,r),t(this)&&rocketform.setDataOptToPrevField(t(this),o,r)}));else{e=t("#"+a).closest(".uiform-step-pane").data("uifm-step"),rocketform.setDataOptToCoreData(e,a,o,r);var c=t("#"+a);c&&rocketform.setDataOptToPrevField(c,o,i.family)}}),t("#uiform-build-field-tab select.sfm").change(function(){}),t('button[role="iconpicker"],div[role="iconpicker"]').iconpicker(),t(document).on("change keyup focus keypress","#uifm_fld_main_fldname",function(e){var i=t("#uifm_fld_main_fldname").val(),a=t("#uifm-field-selected-id").val(),o=t("#"+a).closest(".uiform-step-pane").data("uifm-step");rocketform.fieldsetting_updateName(o,a,i)}),t("#uifm_fld_main_fldname").blur(function(){rocketform.formvariables_generateTable(),rocketform.customeremail_generateHtml();let t=uiform_vars.addon;var i,a;for(var o in t)if("fieldName_onBlur"===String(o))for(var s in t[o])for(var r in t[o][s])a=t[o][s][r].controller,i=t[o][s][r].function,e[a][i]()}),t(".uifm-fld-val-opts .sfdc-btn-group > .sfdc-btn[data-settings-option='group-checkboxes']").click(function(){var e,i,a=t(this),o=a.parent().parent(),s=t("#uifm-field-selected-id").val(),r=t(this).data("field-store"),n=r.split("-"),c=(n[0],n[1],t("#"+s).closest(".uiform-step-pane").data("uifm-step"));a.hasClass("sfdc-active")?(a.removeClass("sfdc-active"),e=a.data("field-select-box"),t("."+e).hide(),i=0):(t(".uifm-custom-validator").hide(),o.find(".uifm-f-setoption-gchecks").not(a).removeClass("sfdc-active"),a.addClass("sfdc-active"),e=a.data("field-select-box"),t("."+e).show(),i=parseInt(t(this).data("field-value"))),rocketform.setDataOptToCoreData(c,s,r,i);var f=t("#"+s);f&&rocketform.setDataOptToPrevField(f,r,i)}),t(".sfdc-btn-group > .sfdc-btn[data-settings-option='group-radiobutton']").click(function(e){var i=t(this);i.parent().children(".sfdc-btn[data-toggle-enable]").removeClass(function(){return"sfdc-active"}).addClass(function(){return""}).children("input").prop("checked",!1),i.addClass("sfdc-active"),i.children("input").prop("checked",!0)}),t(document).on("keyup focus","#uifm_fld_msc_text,#uifm_fld_inp3_html,#uifm_fld_price_lbl_format,#uifm_frm_inp18_txt_cont",function(t){rocketform.captureEventTinyMCE2(t)}),t(document).on("click",".uifm-f-setoption-btn",function(e){e&&(e.stopPropagation(),e.preventDefault());var i,a=t("#uifm-field-selected-id").val(),o=t(this).data("field-store"),s=o.split("-"),r=(s[0],s[1],t(this).find("input").val()),n=t(".uiform-main-form .uiform-fields-qopt-select input:checked");if(parseInt(n.length)>1)c=n.closest(".uiform-field"),t.each(c,function(e,s){a=t(this).attr("id"),i=t("#"+a).closest(".uiform-step-pane").data("uifm-step"),rocketform.setDataOptToCoreData(i,a,o,r),t(this)&&rocketform.setDataOptToPrevField(t(this),o,r)});else{i=t("#"+a).closest(".uiform-step-pane").data("uifm-step"),rocketform.setDataOptToCoreData(i,a,o,r);var c=t("#"+a);c&&rocketform.setDataOptToPrevField(c,o,r)}}),t(document).on("change","#uiform-build-field-tab .uifm-f-setoption-st",function(e){e&&(e.stopPropagation(),e.preventDefault());var i,a=t(".uiform-main-form .uiform-fields-qopt-select input:checked"),o=t("#uifm-field-selected-id").val(),s=t(this).data("field-store"),r=s.split("-"),n=(r[0],r[1],t(this).is(":checked"));if(n=n?1:0,parseInt(a.length)>1)c=a.closest(".uiform-field"),t.each(c,function(e,a){o=t(this).attr("id"),i=t("#"+o).closest(".uiform-step-pane").data("uifm-step"),rocketform.setDataOptToCoreData(i,o,s,n),t(this)&&rocketform.setDataOptToPrevField(t(this),s,n)});else{i=t("#"+o).closest(".uiform-step-pane").data("uifm-step"),rocketform.setDataOptToCoreData(i,o,s,n);var c=t("#"+o);c&&rocketform.setDataOptToPrevField(c,s,n)}}),t(document).on("change keyup",".uifm-f-setoption",function(e){e&&(e.stopPropagation(),e.preventDefault());var i,a=t("#uifm-field-selected-id").val(),o=t(this).data("field-store"),s=o.split("-"),r=(s[0],s[1],t(this).val()),n=t(".uiform-main-form .uiform-fields-qopt-select input:checked");if(parseInt(n.length)>1)c=n.closest(".uiform-field"),t.each(c,function(e,s){a=t(this).attr("id"),i=t("#"+a).closest(".uiform-step-pane").data("uifm-step"),rocketform.setDataOptToCoreData(i,a,o,r),t(this)&&rocketform.setDataOptToPrevField(t(this),o,r)});else{i=t("#"+a).closest(".uiform-step-pane").data("uifm-step"),rocketform.setDataOptToCoreData(i,a,o,r);var c=t("#"+a);c&&rocketform.setDataOptToPrevField(c,o,r)}}),t("#uifm_fld_inp2_style_type").on("change",function(e){var i=t(e.target).val();switch(parseInt(i)){case 1:t(".uifm-set-section-input2-stl1").show();break;default:t(".uifm-set-section-input2-stl1").hide()}}),t(document).on("change keyup",".uifm-f-setoption-font",function(e){e&&(e.stopPropagation(),e.preventDefault());var i,a=t("#uifm-field-selected-id").val(),o=t(this).parent().find("select").data("field-store"),s=o.split("-"),r=(s[0],s[1],t(this).val()),n=t(".uiform-main-form .uiform-fields-qopt-select input:checked");if(parseInt(n.length)>1)c=n.closest(".uiform-field"),t.each(c,function(e,s){a=t(this).attr("id"),i=t("#"+a).closest(".uiform-step-pane").data("uifm-step"),rocketform.setDataOptToCoreData(i,a,o,r),t(this)&&rocketform.setDataOptToPrevField(t(this),o,r)});else{i=t("#"+a).closest(".uiform-step-pane").data("uifm-step"),rocketform.setDataOptToCoreData(i,a,o,r);var c=t("#"+a);c&&rocketform.setDataOptToPrevField(c,o,r)}}),t(".sfdc-input-group-btn > .sfdc-btn").click(function(){var e=t(this),i=e.find("input");0===parseInt(i.val())?(e.addClass("sfdc-active"),i.val(1)):(e.removeClass("sfdc-active"),i.val(0))}),t("#uifm_fld_elbg_type_1").on("click",function(){t("#uifm_fld_elbg_color_1").closest(".sfdc-row").show(),t("#uifm_fld_elbg_color_2").closest(".sfdc-row").hide(),t("#uifm_fld_elbg_color_3").closest(".sfdc-row").hide()}),t("#uifm_fld_elbg_type_2").on("click",function(){t("#uifm_fld_elbg_color_1").closest(".sfdc-row").hide(),t("#uifm_fld_elbg_color_2").closest(".sfdc-row").show(),t("#uifm_fld_elbg_color_3").closest(".sfdc-row").show()}),t("#uifm_fld_val_reqicon_img,#uifm_fld_inp2_stl1_icmark").on("change",function(e){e&&(e.stopPropagation(),e.preventDefault());var i=t("#uifm-field-selected-id").val(),a=t(this).data("field-store"),o=a.split("-"),s=(o[0],o[1],e.icon),r=t("#"+i).closest(".uiform-step-pane").data("uifm-step");rocketform.setDataOptToCoreData(r,i,a,s);var n=t("#"+i);n&&rocketform.setDataOptToPrevField(n,a,s)}),t("#uifm_frm_clogic_st").on("switchChange.bootstrapSwitchZgpb",function(e,i){1===(i?1:0)?t("#uifm-show-conditional-logic").show():t("#uifm-show-conditional-logic").hide()}),t('[data-toggle="tooltip"]').tooltip({container:"body"}),t(".uiform-set-options-tabs ul.sfdc-nav-tabs").on("shown.bs.sfdc-tab",function(e){a=t(e.target).data("uifm-title"),rocketform.setInnerVariable("setfield_tab_active",a),rocketform.previewfield_hidePopOver(),rocketform.previewfield_helpblock_hidetooltip()}),t('.uiformc-menu-wrap ul.sfdc-nav-tabs a[data-toggle="sfdc-tab"],.uiform-set-options-tabs ul.sfdc-nav-tabs a[data-toggle="sfdc-tab"]').on("shown.bs.sfdc-tab",function(e){t(e.target).hasClass("uifm-tab-fld-validation")||t(".sfdc-popover").sfdc_popover("hide")}),t('.uiformc-menu-wrap ul.sfdc-nav-tabs a[data-toggle="sfdc-tab"],.uiform-set-options-tabs ul.sfdc-nav-tabs a[data-toggle="sfdc-tab"]').on("shown.bs.sfdc-tab",function(e){if(a=t(e.target).data("uifm-title"),rocketform.setInnerVariable("setfield_tab_active",a),"helpb"===String(a)){var i=t("#uifm-field-selected-id").val();rocketform.previewfield_elementTextarea(t("#"+i),"help_block")}else zgfm_back_helper.tooltip_removeall()}),t(".uifm_field_font_selectpicker").selectpicker({style:"btn-info",size:4})}catch(t){}},arguments.callee.fields2_events_cpicker=function(e){e.find(".zgpb-custom-color").data("colorpicker")||(e.find(".zgpb-custom-color").colorpicker(),e.find(".zgpb-custom-color").colorpicker().on("changeColor",function(e){var i=t(this).data("field-store"),a=t(this).find("input").val();rocketform.fields2_updateModalFieldCoreAndPreview(i,a)}))},arguments.callee.fields_events_cpicker=function(e){try{e.find(".uifm-custom-color").colorpicker(),t("#uiform-build-field-tab .uifm-custom-color").colorpicker().on("changeColor",function(e){var i,a,o=t("#uifm-field-selected-id").val(),s=t(this).data("field-store"),r=s.split("-"),n=(r[0],r[1],t(this).find("input").val()),c=t(".uiform-main-form .uiform-fields-qopt-select input:checked");parseInt(c.length)>1?n&&(a=c.closest(".uiform-field"),t.each(a,function(e,a){o=t(this).attr("id"),i=t("#"+o).closest(".uiform-step-pane").data("uifm-step"),rocketform.setDataOptToCoreData(i,o,s,n),t(this)&&rocketform.setDataOptToPrevField(t(this),s,n)})):n&&(i=t("#"+o).closest(".uiform-step-pane").data("uifm-step"),rocketform.setDataOptToCoreData(i,o,s,n),(a=t("#"+o))&&rocketform.setDataOptToPrevField(a,s,n))})}catch(t){}},arguments.callee.fields_events_select=function(t){try{t.find(".uifm_selectpicker").selectpicker({style:"btn-info",size:4}),t.find(".selectpicker").selectpicker()}catch(t){}},arguments.callee.fields_events_slider=function(e){try{e.find(".uiform-opt-slider").bootstrapSlider(),t("#uiform-build-field-tab .uiform-opt-slider").on("slide",function(e){var i,a=t("#uifm-field-selected-id").val(),o=t(this).data("field-store"),s=o.split("-"),r=(s[0],s[1],e.value),n=t(".uiform-main-form .uiform-fields-qopt-select input:checked");if(parseInt(n.length)>1)c=n.closest(".uiform-field"),t.each(c,function(e,s){a=t(this).attr("id"),i=t("#"+a).closest(".uiform-step-pane").data("uifm-step"),rocketform.setDataOptToCoreData(i,a,o,r),t(this)&&rocketform.setDataOptToPrevField(t(this),o,r)});else{i=t("#"+a).closest(".uiform-step-pane").data("uifm-step"),rocketform.setDataOptToCoreData(i,a,o,r);var c=t("#"+a);c&&rocketform.setDataOptToPrevField(c,o,r)}})}catch(t){}},arguments.callee.fields2_events_bswitch=function(e){e.find(".zgpb-switch-field").data("bootstrap-switch")||(e.find(".zgpb-switch-field").bootstrapSwitchZgpb(),e.find(".zgpb-switch-field").on("switchChange.bootstrapSwitchZgpb",function(e,i){var a=t(this).data("field-store"),o=i?1:0;rocketform.fields2_updateModalFieldCoreAndPreview(a,o)}))},arguments.callee.fields2_events_groupbtn=function(e){e.find(".sfdc-form-group").find(".zgpb-form-group-loaded").length||(e.find(".sfdc-form-group").addClass("zgpb-form-group-loaded"),e.find(".zgpb-col-setoption-btn").on("click",function(e){e&&(e.stopPropagation(),e.preventDefault()),e.preventDefault();var i=t(this);i.parent().children(".sfdc-btn[data-toggle-enable]").removeClass(function(){return t(this).data("toggle-enable")}).addClass(function(){return t(this).data("toggle-disable")}).children("input").prop("checked",!1),i.removeClass(t(this).data("toggle-disable")).addClass(i.data("toggle-enable")),i.children("input").prop("checked",!0)}),e.find(".zgpb-col-setoption-btn").on("click",function(e){e.preventDefault();var i=t(this).data("field-store"),a=parseInt(t(this).data("field-value"));rocketform.fields2_updateModalFieldCoreAndPreview(i,a)}))},arguments.callee.fields2_events_general=function(){t(document).on("change keyup focus keypress","#uifm_fld_main_fldname",function(e){var i=t("#uifm_fld_main_fldname").val(),a=t("#uifm-field-selected-id").val(),o=t("#"+a).closest(".uiform-step-pane").data("uifm-step");rocketform.fieldsetting_updateName(o,a,i)}),t("#uifm-field-opt-content").find('a[data-toggle="sfdc-tab"]').on("shown.bs.sfdc-tab",function(t){}),t(document).on("change","#uifm-field-opt-content .zgpb-f-setoption-st",function(e){e&&(e.stopPropagation(),e.preventDefault());var i=t(this).data("field-store"),a=t(this).is(":checked")?1:0;rocketform.fields2_updateModalFieldCoreAndPreview(i,a)}),t(document).on("change keyup","#uifm-field-opt-content .zgpb-f-setoption",function(e){e&&(e.stopPropagation(),e.preventDefault());var i=t(this).data("field-store"),a=t(this).val();rocketform.updateModalFieldCoreAndPreview(i,a)}),t(document).on("click","#uifm-field-opt-content .zgpb-f-setoption-btn",function(e){e&&(e.stopPropagation(),e.preventDefault());var i=t(this).data("field-store"),a=t(this).find("input").val();rocketform.fields2_updateModalFieldCoreAndPreview(i,a)})},arguments.callee.fields2_events_slider=function(e){e.find(".zgpb-custom-slider").bootstrapSlider(),e.find(".zgpb-custom-slider").on("slide",function(e){var i=t(this).data("field-store"),a=e.value;rocketform.fields2_updateModalFieldCoreAndPreview(i,a)})},arguments.callee.fields2_events_txts=function(e){e.find(".zgpb-field-col-event-txt").on("change keyup focus keypress",function(e){e&&e.stopPropagation();var i=t(this).data("field-store"),a=t(this).val();rocketform.fields2_updateModalFieldCoreAndPreview(i,a)})},arguments.callee.fields2_events_spinner=function(e){e.find(".zgpb_fld_settings_spinner").find(".bootstrap-touchspin-postfix").length||(e.find(".zgpb_fld_settings_spinner").TouchSpin({verticalbuttons:!0,min:0,max:1500,stepinterval:1,verticalupclass:"sfdc-glyphicon sfdc-glyphicon-plus",verticaldownclass:"sfdc-glyphicon sfdc-glyphicon-minus"}),e.find(".zgpb_fld_settings_spinner").on("change",function(e){e&&(e.stopPropagation(),e.preventDefault());var i=t(e.target).data("field-store"),a=t(e.target).val();rocketform.fields2_updateModalFieldCoreAndPreview(i,a)}))},arguments.callee.modal_editfield_col_bg_delimg=function(){t("#zgpb_fld_col_bg_srcimg_wrap").html(""),t("#zgpb_fld_col_bg_imgsource").val("");var e=t("#zgpb_fld_col_bg_imgsourcebtnadd").data("field-store");rocketform.fields2_updateModalFieldCoreAndPreview(e,"")},arguments.callee.fields2_events_bgimages=function(i){i.find("#zgpb_fld_col_bg_imgsourcebtnadd").on("click",function(i){i&&(i.stopPropagation(),i.preventDefault());var a=t(this);rocketform.elfinder_showPopUp({windowURL:uiform_vars.url_elfinder2,windowName:"_blank",height:490,width:950,centerScreen:1,location:0}),e.processFile=function(e){var i=e.url;t("#zgpb_fld_col_bg_imgsource").val(i),t("#zgpb_fld_col_bg_srcimg_wrap").html('');var o=a.data("field-store"),s=i;rocketform.fields2_updateModalFieldCoreAndPreview(o,s)}})},arguments.callee.fields2_updateModalFieldCoreAndPreview=function(e,i){try{var a,o;a=t("#uifm-field-selected-id").val(),o=t("#uifm-field-selected-type").val();var s=[];switch(parseInt(o)){case 1:case 2:case 3:case 4:case 5:var r=t("#zgpb-field-selected-block").val();s.block=r}rocketform.fields2_setDataOptToCoreData(a,o,e,i,s);var n=t("#"+a);n&&rocketform.fields2_setDataOptToPrevField(n,o,e,i,s)}catch(t){}},arguments.callee.fields2_setDataOptToCoreData=function(e,i,a,o,s){try{var r,n,c=t("#"+e);switch(parseInt(i)){case 1:case 2:case 3:case 4:case 5:r=[],n=a.split("-"),r.id=e,r.block=s.block,r.opt1=n[0],r.opt2=n[1],r.opt3=n[2],r.opt4=o,c.data("zgpbld_gridsystem").setDataToCore(r);break;case 6:default:switch(r=[],n=a.split("-"),r.id=e,r.opt1=n[0]||"",r.opt2=n[1]||"",r.opt3=n[2]||"",r.opt4=o,parseInt(i)){case 6:t("#"+e).data("uiform_textbox").setDataToCore(r);break;case 7:t("#"+e).data("uiform_textarea").setDataToCore(r);break;case 8:t("#"+e).data("uiform_radiobtn").setDataToCore(r);break;case 9:t("#"+e).data("uiform_checkbox").setDataToCore(r);break;case 10:t("#"+e).data("uiform_select").setDataToCore(r);break;case 11:t("#"+e).data("uiform_multiselect").setDataToCore(r);break;case 12:t("#"+e).data("uiform_fileupload").setDataToCore(r);break;case 13:t("#"+e).data("uiform_imageupload").setDataToCore(r);break;case 14:t("#"+e).data("uiform_customhtml").setDataToCore(r);break;case 15:t("#"+e).data("uiform_password").setDataToCore(r);break;case 16:t("#"+e).data("uiform_slider").setDataToCore(r);break;case 17:t("#"+e).data("uiform_range").setDataToCore(r);break;case 18:t("#"+e).data("uiform_spinner").setDataToCore(r);break;case 19:t("#"+e).data("uiform_captcha").setDataToCore(r);break;case 20:t("#"+e).data("uiform_submitbtn").setDataToCore(r);break;case 21:t("#"+e).data("uiform_hiddeninput").setDataToCore(r);break;case 22:t("#"+e).data("uiform_ratingstar").setDataToCore(r);break;case 23:t("#"+e).data("uiform_colorpicker").setDataToCore(r);break;case 24:t("#"+e).data("uiform_datepicker").setDataToCore(r);break;case 25:t("#"+e).data("uiform_timepicker").setDataToCore(r);break;case 26:t("#"+e).data("uiform_datetime").setDataToCore(r);break;case 27:t("#"+e).data("uiform_recaptcha").setDataToCore(r);break;case 28:t("#"+e).data("uiform_preptext").setDataToCore(r);break;case 29:t("#"+e).data("uiform_appetext").setDataToCore(r);break;case 30:t("#"+e).data("uiform_prepapptext").setDataToCore(r);break;case 31:t("#"+e).data("uiform_panelfld").setDataToCore(r);break;case 32:t("#"+e).data("uiform_divider").setDataToCore(r);break;case 33:case 34:case 35:case 36:case 37:case 38:t("#"+e).data("uiform_heading").setDataToCore(r);break;case 39:t("#"+e).data("uiform_wizardbtn").setDataToCore(r);break;case 40:t("#"+e).data("uiform_switch").setDataToCore(r);break;case 41:t("#"+e).data("uiform_dyncheckbox").setDataToCore(r);break;case 42:t("#"+e).data("uiform_dynradiobtn").setDataToCore(r);break;case 43:t("#"+e).data("uiform-datetime2").setDataToCore(r)}}}catch(t){}},arguments.callee.fields2_setDataOptToPrevField=function(t,e,i,a,o){try{switch(parseInt(e)){case 1:case 2:case 3:case 4:case 5:var s=[],r=i.split("-");s.block=o.block,s.opt1=r[0],s.opt2=r[1],s.opt3=r[2],s.opt4=a,t.data("zgpbld_gridsystem").setOptionsToPreview(s);break;default:s=[],r=i.split("-");rocketform.setDataOptToPrevField(t,i,a)}}catch(t){}},arguments.callee.rollback_openModal=function(){var e=t("#uifm_frm_main_id").val();try{rocketform.fields_showModalOptions(),t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"formbuilder/forms/ajax_rollback_openmodal",data:{action:"rocket_fbuilder_rollback_openmodal",page:"zgfm_cost_estimate",zgfm_security:uiform_vars.ajax_nonce,form_id:e,csrf_field_name:uiform_vars.csrf_field_name},success:function(e){t("#zgpb-modal1").find(".sfdc-modal-dialog").find(".zgpb-modal-header-inner").html(e.modal_header),t("#zgpb-modal1").find(".sfdc-modal-dialog").find(".sfdc-modal-body").html(e.modal_body),t("#zgpb-modal1").find(".sfdc-modal-dialog").find(".zgpb-modal-footer-wrap").html(e.modal_footer)}})}catch(t){}},arguments.callee.rollback_process=function(e){try{rocketform.fields_showModalOptions(),t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"formbuilder/forms/ajax_rollback_process",data:{action:"rocket_fbuilder_rollback_process",page:"zgfm_cost_estimate",zgfm_security:uiform_vars.ajax_nonce,log_id:e,csrf_field_name:uiform_vars.csrf_field_name},success:function(e){e.data.fmb_html_backend=decodeURIComponent(e.data.fmb_html_backend),rocketform.loadFormToEditPanel(e),rocketform.wizardform_refresh(),rocketform.loading_panelbox2(0),t("#zgpb-modal1").sfdc_modal("hide")}})}catch(t){}},arguments.callee.fields_showModalOptions=function(){var e='';t("#zgpb-modal1").find(".sfdc-modal-dialog").find(".zgpb-modal-header-inner").html(e),t("#zgpb-modal1").find(".sfdc-modal-dialog").find(".sfdc-modal-body").html(e),t("#zgpb-modal1").find(".sfdc-modal-dialog").find(".zgpb-modal-footer-wrap").html(e),t("#zgpb-modal1").find(".sfdc-modal-content").resizable({}),t("#zgpb-modal1").on("show.bs.sfdc-modal",function(){t(this).find(".sfdc-modal-body").css({"max-height":"100%"})}),t("#zgpb-modal1").sfdc_modal({show:!0,keyboard:!0})},arguments.callee.modal_field_loader=function(e){var i=t("#zgpb-modal1").find(".sfdc-modal-dialog .sfdc-modal-body");if(1===parseInt(e)){if(0===parseInt(i.find("#zgpb-modal-field-loader").length)){var a=wp.template("zgpb-modal-field-loader");i.append(a())}}else i.find("#zgpb-modal-field-loader")&&i.find("#zgpb-modal-field-loader").remove()},arguments.callee.check_fieldExist=function(t,e,i){try{return void 0!==a[t][e][i]}catch(t){return!1}},arguments.callee.variables_openModal=function(){var e=t("#uifm_frm_main_id").val();rocketform.fields_showModalOptions(),this.saveTabContent();var i=a;t.ajax({type:"POST",url:rockfm_vars.uifm_siteurl+"formbuilder/forms/ajax_variables_openmodal",data:{action:"rocket_fbuilder_variables_openmodal",page:"zgfm_cost_estimate",zgfm_security:uiform_vars.ajax_nonce,form_id:e,form_data:encodeURIComponent(JSON.stringify(i)),csrf_field_name:uiform_vars.csrf_field_name},success:function(e){t("#zgpb-modal1").find(".sfdc-modal-dialog").find(".zgpb-modal-header-inner").html(e.modal_header),t("#zgpb-modal1").find(".sfdc-modal-dialog").find(".sfdc-modal-body").html(e.modal_body),t("#zgpb-modal1").find(".sfdc-modal-dialog").find(".zgpb-modal-footer-wrap").html(e.modal_footer),t('[data-toggle="tooltip"]').tooltip({container:"body"})}})},arguments.callee.get_coreData=function(){return a}}}($uifm,window),rocketform(),function(t){var e=function(e,i){var a,o=null,s=!1,r=t(e),n=!0,c=this,f={skin:{align:{show_st:0,max_width:"1200",max_width_st:"1"},margin:{show_st:1,top:"0",bottom:"0",left:"0",right:"0"},padding:{show_st:1,top:"5",bottom:"5",left:"0",right:"0"},text:{color:""},background:{show_st:"0",type:"1",cl_start_color:"#eeeeee",cl_end_color:"#ffffff",cl_solid_color:"#eeeeee",img_source:"",img_repeat:"0",img_position:"Center",img_attachment:"Scroll",img_scale:"Fill",img_overlay_color:"",img_overlay_opacity:"",img_size_type:"3",img_size_len:"100% 100%",opacity:"100"},border:{show_st:"0",color:"#000",color_focus_st:"0",color_focus:"#000",type:"1",width:"1"},border_radius:{show_st:"0",size:"17"},custom_css:{ctm_id:"",ctm_class:"",ctm_additional:""},shadow:{show_st:"0",color:"#CCCCCC",h_shadow:"3",v_shadow:"3",blur:"10"}}},l=t.extend(!0,{},{data:{type:0,id:"",type_n:"Grid",field_name:"",main:{},blocks:{}}}),d=[];d.innerVars={};this.publicMethod=function(){},this.showSettingTab=function(t){};this.setOptionsToModal=function(e){var i=t("#uifm-field-opt-content"),a=e.opt1,o=e.opt2,s=e.opt3,r=e.opt4;switch(String(a)){case"skin":switch(String(o)){case"align":switch(String(s)){case"show_st":1===parseInt(r)?i.find("#zgpb_fld_col_style_st").bootstrapSwitchZgpb("state",!0):i.find("#zgpb_fld_col_style_st").bootstrapSwitchZgpb("state",!1);break;case"max_width_st":1===parseInt(r)?i.find("#zgpb_fld_col_style_maxwidth_st").prop("checked",!0):i.find("#zgpb_fld_col_style_maxwidth_st").prop("checked",!1);break;case"max_width":i.find("#zgpb_fld_col_style_maxwidth").val(r)}break;case"margin":switch(String(s)){case"top":i.find("#zgpb_fld_col_margin_top").val(r);break;case"bottom":i.find("#zgpb_fld_col_margin_bottom").val(r);break;case"left":i.find("#zgpb_fld_col_margin_left").val(r);break;case"right":i.find("#zgpb_fld_col_margin_right").val(r)}break;case"padding":switch(String(s)){case"top":i.find("#zgpb_fld_col_padding_top").val(r);break;case"bottom":i.find("#zgpb_fld_col_padding_bottom").val(r);break;case"left":i.find("#zgpb_fld_col_padding_left").val(r);break;case"right":i.find("#zgpb_fld_col_padding_right").val(r)}break;case"text":switch(String(s)){case"color":i.find("#zgpb_fld_col_text_color").parent().colorpicker("setValue",r),i.find("#zgpb_fld_col_text_color").val(r)}break;case"background":switch(String(s)){case"show_st":1===parseInt(r)?i.find("#zgpb_fld_col_bg_st").bootstrapSwitchZgpb("state",!0):i.find("#zgpb_fld_col_bg_st").bootstrapSwitchZgpb("state",!1);break;case"type":switch(parseInt(r)){case 2:i.find("#zgpb_fld_col_bg_type_2").addClass("sfdc-active"),i.find("#zgpb_fld_col_bg_type_1_cont").hide(),i.find("#zgpb_fld_col_bg_type_2_cont").show();break;case 1:default:i.find("#zgpb_fld_col_bg_type_1").addClass("sfdc-active"),i.find("#zgpb_fld_col_bg_type_1_cont").show(),i.find("#zgpb_fld_col_bg_type_2_cont").hide()}break;case"cl_start_color":i.find("#zgpb_fld_col_bg_clstartcolor").parent().colorpicker("setValue",r),i.find("#zgpb_fld_col_bg_clstartcolor").val(r);break;case"cl_end_color":i.find("#zgpb_fld_col_bg_clendcolor").parent().colorpicker("setValue",r),i.find("#zgpb_fld_col_bg_clendcolor").val(r);break;case"cl_solid_color":i.find("#zgpb_fld_col_bg_clsolidcolor").parent().colorpicker("setValue",r),i.find("#zgpb_fld_col_bg_clsolidcolor").val(r);break;case"img_source":i.find("#zgpb_fld_col_bg_imgsource").val(r),r&&i.find("#zgpb_fld_col_bg_srcimg_wrap").html("");break;case"img_size_type":i.find("#zgpb_fld_col_bg_sizetype").val(r),1===parseInt(r)||2===parseInt(r)?t("#zgpb_fld_col_bg_sizetype_len_wrap").show():t("#zgpb_fld_col_bg_sizetype_len_wrap").hide();break;case"img_size_len":i.find("#zgpb_fld_col_bg_sizetype_len").val(r);break;case"img_repeat":i.find("#zgpb_fld_col_bg_repeat").val(r);break;case"img_position":i.find("#zgpb_fld_col_bg_pos").val(r)}break;case"border":switch(String(s)){case"show_st":1===parseInt(r)?i.find("#zgpb_fld_col_border_st").bootstrapSwitchZgpb("state",!0):i.find("#zgpb_fld_col_border_st").bootstrapSwitchZgpb("state",!1);break;case"type":switch(parseInt(r)){case 2:i.find("#zgpb_fld_col_border_type_2").addClass("sfdc-active");break;case 1:default:i.find("#zgpb_fld_col_border_type_1").addClass("sfdc-active")}break;case"color":i.find("#zgpb_fld_col_border_color").parent().colorpicker("setValue",r),i.find("#zgpb_fld_col_border_color").val(r);break;case"width":i.find("#zgpb_fld_col_border_width").val(r)}break;case"border_radius":switch(String(s)){case"show_st":1===parseInt(r)?i.find("#zgpb_fld_col_bradius_st").bootstrapSwitchZgpb("state",!0):i.find("#zgpb_fld_col_bradius_st").bootstrapSwitchZgpb("state",!1);break;case"size":i.find("#zgpb_fld_col_bradius_size").val(r)}break;case"shadow":switch(String(s)){case"show_st":1===parseInt(r)?i.find("#zgpb_fld_col_shadow_st").bootstrapSwitchZgpb("state",!0):i.find("#zgpb_fld_col_shadow_st").bootstrapSwitchZgpb("state",!1);break;case"color":i.find("#zgpb_fld_col_shadow_color").val(r);break;case"h_shadow":i.find("#zgpb_fld_col_shadow_h").bootstrapSlider("setValue",parseInt(r));break;case"v_shadow":i.find("#zgpb_fld_col_shadow_v").bootstrapSlider("setValue",parseInt(r));break;case"blur":i.find("#zgpb_fld_col_shadow_blur").bootstrapSlider("setValue",parseInt(r))}break;case"custom_css":switch(String(s)){case"ctm_id":break;case"ctm_class":i.find("#zgpb_fld_col_ctmclass").val(r);break;case"ctm_additional":i.find("#zgpb_fld_ctmaddt").val(r)}}}},this.previewfield_maxwidth=function(e){var i,o,s,r,c;if(n&&(i=l.data.main.skin.align.show_st,o=l.data.main.skin.align.max_width,l.data.main.skin.align.max_width_st,r=l.data.main.skin.align,e.find(".sfdc-container-fluid"),s="#"+l.data.id+" > .sfdc-container-fluid"),c="zgpb_"+l.data.id+"_skin_align_"+a,h(c,r)&&(t("#"+c)&&t("#"+c).remove(),1===parseInt(i))){var f='",t("head").append(f)}},this.setOptionsToPreview=function(t){var e=r,i=t.block,o=t.opt1,s=t.opt2,c=t.opt3,f=t.opt4;switch(n=!0,a=0,parseInt(i)>0&&(n=!1,a=parseInt(i)),String(o)){case"skin":switch(String(s)){case"align":switch(String(c)){case"show_st":case"max_width":case"max_width_st":this.previewfield_maxwidth(e)}break;case"margin":switch(String(c)){case"top":n?e.find(">.sfdc-container-fluid").attr("style",function(t,e){return(e||"")+`margin-top: ${f}px !important;`}):e.find('.zgpb-fl-gs-block-style[data-zgpb-blocknum="'+i+'"] > .zgpb-fl-gs-block-inner').css("margin-top",f+"px");break;case"bottom":n?e.find(">.sfdc-container-fluid").attr("style",function(t,e){return(e||"")+`margin-bottom: ${f}px !important;`}):e.find('.zgpb-fl-gs-block-style[data-zgpb-blocknum="'+i+'"] > .zgpb-fl-gs-block-inner').css("margin-bottom",f+"px");break;case"left":n?e.find(">.sfdc-container-fluid").attr("style",function(t,e){return(e||"")+`margin-left: ${f}px !important;`}):e.find('.zgpb-fl-gs-block-style[data-zgpb-blocknum="'+i+'"] > .zgpb-fl-gs-block-inner').css("margin-left",f+"px");break;case"right":n?e.find(">.sfdc-container-fluid").attr("style",function(t,e){return(e||"")+`margin-right: ${f}px !important;`}):e.find('.zgpb-fl-gs-block-style[data-zgpb-blocknum="'+i+'"] > .zgpb-fl-gs-block-inner').css("margin-right",f+"px")}break;case"padding":switch(String(c)){case"top":n?e.find(">.sfdc-container-fluid").attr("style",function(t,e){return(e||"")+`padding-top: ${f}px !important;`}):e.find('.zgpb-fl-gs-block-style[data-zgpb-blocknum="'+i+'"] > .zgpb-fl-gs-block-inner').css("padding-top",f+"px");break;case"bottom":n?e.find(">.sfdc-container-fluid").attr("style",function(t,e){return(e||"")+`padding-bottom: ${f}px !important;`}):e.find('.zgpb-fl-gs-block-style[data-zgpb-blocknum="'+i+'"] > .zgpb-fl-gs-block-inner').css("padding-bottom",f+"px");break;case"left":n?e.find(">.sfdc-container-fluid").attr("style",function(t,e){return(e||"")+`padding-left: ${f}px !important;`}):e.find('.zgpb-fl-gs-block-style[data-zgpb-blocknum="'+i+'"] > .zgpb-fl-gs-block-inner').css("padding-left",f+"px");break;case"right":n?e.find(">.sfdc-container-fluid").attr("style",function(t,e){return(e||"")+`padding-right: ${f}px !important;`}):e.find('.zgpb-fl-gs-block-style[data-zgpb-blocknum="'+i+'"] > .zgpb-fl-gs-block-inner').css("padding-right",f+"px")}break;case"text":switch(String(c)){case"color":n?e.find(".sfdc-container-fluid").css("color",f):e.find('.zgpb-fl-gs-block-style[data-zgpb-blocknum="'+i+'"] >.zgpb-fl-gs-block-inner').css("color",f)}break;case"background":u(e);break;case"border":p(e);break;case"border_radius":m(e);break;case"shadow":_(e)}}};var _=function(e){var i,o,s,r,c,f,d,_;if(n?(i=l.data.main.skin.shadow.show_st,o=l.data.main.skin.shadow.color,s=l.data.main.skin.shadow.h_shadow,r=l.data.main.skin.shadow.v_shadow,c=l.data.main.skin.shadow.blur,d=l.data.main.skin.shadow,e.find(".sfdc-container-fluid"),f="#"+l.data.id+" > .sfdc-container-fluid"):(i=l.data.blocks[a].skin.shadow.show_st,o=l.data.blocks[a].skin.shadow.color,s=l.data.blocks[a].skin.shadow.h_shadow,r=l.data.blocks[a].skin.shadow.v_shadow,c=l.data.blocks[a].skin.shadow.blur,d=l.data.blocks[a].skin.shadow,e.find('.zgpb-fl-gs-block-style[data-zgpb-blocknum="'+a+'"] >.zgpb-fl-gs-block-inner'),f="#"+l.data.id+' > .sfdc-container-fluid > .sfdc-row > .zgpb-fl-gs-block-style[data-zgpb-blocknum="'+a+'"] >.zgpb-fl-gs-block-inner'),_="zgpb_"+l.data.id+"_skin_shadow_"+a,h(_,d)&&(t("#"+_)&&t("#"+_).remove(),1===parseInt(i))){var m='",t("head").append(m)}},m=function(e){var i,o,s,r,c;if(n?(i=l.data.main.skin.border_radius.show_st,o=l.data.main.skin.border_radius.size,r=l.data.main.skin.border_radius,e.find(".sfdc-container-fluid"),s="#"+l.data.id+" > .sfdc-container-fluid"):(i=l.data.blocks[a].skin.border_radius.show_st,o=l.data.blocks[a].skin.border_radius.size,r=l.data.blocks[a].skin.border_radius,e.find('.zgpb-fl-gs-block-style[data-zgpb-blocknum="'+a+'"] >.zgpb-fl-gs-block-inner'),s="#"+l.data.id+' .zgpb-fl-gs-block-style[data-zgpb-blocknum="'+a+'"] >.zgpb-fl-gs-block-inner'),c="zgpb_"+l.data.id+"_skin_borderradius_"+a,h(c,r)&&(t("#"+c)&&t("#"+c).remove(),1===parseInt(i))){var f='",t("head").append(f)}},p=function(e){var i,o,s,r,c,f,d,_;if((n?(i=l.data.main.skin.border.show_st,o=l.data.main.skin.border.color,l.data.main.skin.border.color_focus_st,l.data.main.skin.border.color_focus,s=l.data.main.skin.border.type,r=l.data.main.skin.border.width,f=l.data.main.skin.border,e.find(".sfdc-container-fluid"),c="#"+l.data.id+" > .sfdc-container-fluid"):(i=l.data.blocks[a].skin.border.show_st,o=l.data.blocks[a].skin.border.color,l.data.blocks[a].skin.border.color_focus_st,l.data.blocks[a].skin.border.color_focus,s=l.data.blocks[a].skin.border.type,r=l.data.blocks[a].skin.border.width,f=l.data.blocks[a].skin.border,e.find('.zgpb-fl-gs-block-style[data-zgpb-blocknum="'+a+'"] >.zgpb-fl-gs-block-inner'),c="#"+l.data.id+' > .sfdc-container-fluid > .sfdc-row > .zgpb-fl-gs-block-style[data-zgpb-blocknum="'+a+'"] >.zgpb-fl-gs-block-inner:first-child '),d="zgpb_"+l.data.id+"_skin_border_"+a,h(d,f))&&(t("#"+d)&&t("#"+d).remove(),1===parseInt(i))){var m='",t("head").append(m)}},u=function(e){var i,o,s,r,c,f,d,_,m,p,u,b,g;if(n?(i=l.data.main.skin.background.show_st,o=l.data.main.skin.background.type,s=l.data.main.skin.background.cl_start_color,r=l.data.main.skin.background.cl_end_color,c=l.data.main.skin.background.cl_solid_color,f=l.data.main.skin.background.img_source,d=l.data.main.skin.background.img_repeat,_=l.data.main.skin.background.img_position,l.data.main.skin.background.img_attachment,l.data.main.skin.background.img_scale,l.data.main.skin.background.img_overlay_color,l.data.main.skin.background.img_overlay_opacity,m=l.data.main.skin.background.img_size_type,p=l.data.main.skin.background.img_size_len,l.data.main.skin.background.opacity,b=l.data.main.skin.background,e.find(".sfdc-container-fluid"),u="#"+l.data.id+" > .sfdc-container-fluid"):(i=l.data.blocks[a].skin.background.show_st,o=l.data.blocks[a].skin.background.type,s=l.data.blocks[a].skin.background.cl_start_color,r=l.data.blocks[a].skin.background.cl_end_color,c=l.data.blocks[a].skin.background.cl_solid_color,f=l.data.blocks[a].skin.background.img_source,d=l.data.blocks[a].skin.background.img_repeat,_=l.data.blocks[a].skin.background.img_position,l.data.blocks[a].skin.background.img_attachment,l.data.blocks[a].skin.background.img_scale,l.data.blocks[a].skin.background.img_overlay_color,l.data.blocks[a].skin.background.img_overlay_opacity,m=l.data.main.skin.background.img_size_type,p=l.data.main.skin.background.img_size_len,l.data.blocks[a].skin.background.opacity,b=l.data.blocks[a].skin.background,e.find('.zgpb-fl-gs-block-style[data-zgpb-blocknum="'+a+'"] >.zgpb-fl-gs-block-inner'),u="#"+l.data.id+' .zgpb-fl-gs-block-style[data-zgpb-blocknum="'+a+'"] >.zgpb-fl-gs-block-inner'),g="zgpb_"+l.data.id+"_skin_background_"+a,h(g,b)&&(t("#"+g)&&t("#"+g).remove(),1===parseInt(i))){var k,v='",t("head").append(v)}},h=function(t,e){var i,a=t,o=CryptoJS.MD5(JSON.stringify(e)),s=(i=a,d.innerVars[i]?d.innerVars[i]:"");return String(s)!==String(o)&&(function(t,e){d.innerVars[t]=e}(a,CryptoJS.MD5(JSON.stringify(e))),!0)};this.updateVarData=function(e){t("#"+e).data("zgpb-settings",l)},this.update_previewfield=function(e){t("#"+e)&&this.enableSettingOptions_process(l.data,!1,!0,null)},this.setToDatalvl1=function(t,e){l.data[t]=e},this.setFieldName=function(t){l.data.field_name=l.data.type_n+t},this.setStep=function(t){o=t},this.setDataToCoreStore=function(t,e){rocketform.setUiData3("steps_src",t,e,l.data)},this.update_settingsData=function(e){var i=uifm_validate_field(e.hasOwnProperty("data")?t.extend(!0,{},l,e):t.extend(!0,{},l,{data:e}),l);l=i},this.createBlockAttributes=function(){var e=l.data.type,i={};switch(parseInt(e)){case 1:i[1]=t.extend(!0,{},f);break;case 2:i[1]=t.extend(!0,{},f),i[2]=t.extend(!0,{},f);break;case 3:i[1]=t.extend(!0,{},f),i[2]=t.extend(!0,{},f),i[3]=t.extend(!0,{},f);break;case 4:i[1]=t.extend(!0,{},f),i[2]=t.extend(!0,{},f),i[3]=t.extend(!0,{},f),i[4]=t.extend(!0,{},f);break;case 5:i[1]=t.extend(!0,{},f),i[2]=t.extend(!0,{},f),i[3]=t.extend(!0,{},f),i[4]=t.extend(!0,{},f),i[5]=t.extend(!0,{},f),i[6]=t.extend(!0,{},f);break;case 6:i[1]=t.extend(!0,{},f),i[2]=t.extend(!0,{},f),i[3]=t.extend(!0,{},f),i[4]=t.extend(!0,{},f),i[5]=t.extend(!0,{},f),i[6]=t.extend(!0,{},f),i[7]=t.extend(!0,{},f),i[8]=t.extend(!0,{},f),i[9]=t.extend(!0,{},f),i[10]=t.extend(!0,{},f),i[11]=t.extend(!0,{},f),i[12]=t.extend(!0,{},f)}l.data.main=t.extend(!0,{},f),l.data.blocks=i},this.setDataToCore=function(t){var e=t.id,i=t.block,a=t.opt1,s=t.opt2,r=t.opt3,n=t.opt4;if(parseInt(i)>0){var c=parseInt(i);rocketform.setUiData8("steps_src",o,String(e),"blocks",c,String(a),String(s),String(r),n)}else rocketform.setUiData7("steps_src",o,String(e),"main",String(a),String(s),String(r),n)},this.enableSettingOptions_process=function(e,i,a,o){if(i){var s=t("#uifm-field-opt-content");rocketform.fields2_events_bswitch(s),rocketform.fields2_events_groupbtn(s),rocketform.fields2_events_cpicker(s),rocketform.fields2_events_spinner(s),rocketform.fields2_events_bgimages(s),rocketform.fields2_events_slider(s),rocketform.fields2_events_txts(s),rocketform.fields2_events_general()}var r,n=o?o.block:0,f=!0;parseInt(n)>0&&(f=!1),f?t("#zgpb_fld_col_style_wrapper").show():t("#zgpb_fld_col_style_wrapper").hide();var d=l.data.field_name||"";if(f)d&&t("#uifm_fld_main_fldname").val(d);else{t("#zgfm-field-col-fldname-lbl-bl2").html();t("#zgfm-field-col-fldname-lbl-bl1").html(d+" - ")}t.each(e,function(e,o){t.isPlainObject(o)&&t.each(o,function(o,s){t.isPlainObject(s)&&t.each(s,function(s,l){t.isPlainObject(l)&&t.each(l,function(l,d){t.isPlainObject(d)?t.each(d,function(t,d){r=[],"main"===String(e)?r.block=0:r.block=parseInt(o),r.opt1=s,r.opt2=l,r.opt3=t,r.opt4=d,!1===f&&"blocks"===String(e)&&parseInt(n)===parseInt(o)&&i&&c.setOptionsToModal(r),a&&c.setOptionsToPreview(r)}):"main"===String(e)&&((r=[]).block=0,r.opt1=o,r.opt2=s,r.opt3=l,r.opt4=d,!0===f&&i&&c.setOptionsToModal(r),a&&c.setOptionsToPreview(r))})})})})},this.showSettingTab=function(e){var i=t("#uifm-field-selected-id").val();if(String(i)!=String(e)){rocketform.cleanSettingTab();t.each([".uifm-set-section-fieldname",".uifm-tab-fld-input",".uifm-tab-fld-moreopt"],function(){t(String(this)).removeClass("uifm-hide")}),t('.sfdc-nav-tabs a[href="#uiform-settings-tab-1"]').sfdc_tab("show")}},this.enableSettingOptions=function(t,e){this.showSettingTab(),this.enableSettingOptions_process(t,!0,!0,e),rocketform.loading_boxField("zgfm-panel-right-field-tabopt",0),s&&(rocketform.loading_boxField(t.id,0),s=!1)},this.getOnProcessStatus=function(){return!1},this.setVariables=function(t){s=t.oncreation||!1}};t.fn.zgpbld_gridsystem=function(i){return this.each(function(){var a=t(this);if(!a.data("zgpbld_gridsystem")){var o=new e(this,i);a.data("zgpbld_gridsystem",o)}})}}($uifm),function(t){var e,i=t(document),a=t("head"),o=null,s=[],r=0,n="px",c="JColResizer",f=parseInt,l=Math;try{e=sessionStorage}catch(t){}a.append("");destroy=function(t){var e=t.attr("id");(t=s[e])&&t.is("table")&&(t.removeClass(c).gc.remove(),delete s[e])};var d=function(i){var a=i.find(">thead>tr>th,>thead>tr>td");a.length||(a=i.find(">tbody>tr:first>th,>tr:first>th,>tbody>tr:first>td, >tr:first>td")),i.cg=i.find("col"),i.ln=a.length,i.p&&e&&e[i.id]&&_(i,a),a.each(function(e){var a=t(this),o=t(i.gc.append('
    ')[0].lastChild);o.t=i,o.i=e,o.c=a,a.w=a.width(),a.blocks=a.attr("data-blocks"),a.mpercent=a.attr("data-maxpercent"),i.g.push(o),i.c.push(a),a.width(a.w).removeAttr("width"),e
    '):o.addClass("JCLRLastGrip").removeClass("JCLRgrip"),o.data(c,{i:e,t:i.attr("id")})}),i.cg.removeAttr("width"),m(i),i.find("td, th").not(a).not("table th, table td").each(function(){t(this).removeAttr("width")})},_=function(t,i){var a,o=0,s=0,r=[];if(i){if(t.cg.removeAttr("width"),t.opt.flush)return void(e[t.id]="");for(a=e[t.id].split(";");s*{cursor:"+n.opt.dragCursor+"!important}"),f.addClass(n.opt.draggingClass),o=f,n.c[r.i].l)for(var l,d=0;d",liveDrag:!0,minWidth:15,headerOnly:!1,hoverCursor:"e-resize",dragCursor:"e-resize",postbackSafe:!1,flush:!1,marginLeft:null,marginRight:null,disable:!1,onDrag:null,onResize:null},e);return this.each(function(){t(window).resize(function(){v()}),function(e,i){var a=t(e);if(i.disable)return destroy(a);var o=a.id=a.attr("id")||c+r++;a.p=i.postbackSafe,a.is("table")&&!s[o]&&(a.addClass(c).attr("id",o).before('
    '),a.opt=i,a.g=[],a.c=[],a.w=a.width(),a.gc=a.prev(),i.marginLeft&&a.gc.css("marginLeft",i.marginLeft),i.marginRight&&a.gc.css("marginRight",i.marginRight),a.cs=f(a.css("border-spacing"))||2,a.b=f(a.css("border-left-width"))||1,s[o]=a,d(a))}(this,e)})}})}($uifm),function(t){var e,i,a,o=[],s=0,r=0,n=0,c=0,f=0,l=0,d=0,_=function(){(s=t(".uiform-editing-main").width())>=r?r=s:s=r,m()},m=function(){if(t("#uifm-panel-arrow-left").hasClass("uifm-layout-toggler-open")){var r=262;r+=17}else r=10;var _,m,p,u;_=(100*parseFloat(r)/parseFloat(s)).toFixed(3),m=t("#uifm-panel-arrow-right").hasClass("uifm-layout-toggler-open")?520:10,p=(100*parseFloat(m)/parseFloat(s)).toFixed(3),u=100-parseFloat(p)-parseFloat(_),e.find(".uifm-edit-panel-left").css("width",_+"%"),c=_,e.find(".uifm-edit-panel-center").css("width",u+"%"),n=u,e.find(".uifm-edit-panel-right").css("width",p+"%"),f=p;var h=i.height();if(0!==parseInt(h)&&0!==parseInt(o.left.find(".uiform-builder-fields").height())){var b=i.offset().top,g=parseFloat(b)+h;if(0!==parseInt(g)){var k,v,w,x,y=a.offset(),S=(y.left,y.top);if(S>g)l=h+(S-g)-100;else l=h;i.css("height",l+"px"),k=t(".uiformc-menu-wrap").first().height(),w=o.left.find(".uiform-builder-fields").height(),v=S>g&&(x=l-k-w)>0?w+x:w,d=v,o.left.find(".uiform-builder-fields").height(d),o.center.find(".uiform-builder-preview").height(d),o.right.find(".uiform-builder-data").height(d),t(".uiform-builder-maintab-container .uiform-tab-content").height(parseFloat(d-170))}}};t.fn.extend({ColumnToggle:function(l){l=t.extend({draggingClass:"",onResize:null},l);return this.each(function(){var l;t(window).resize(function(){_()}),t("#uifm-panel-arrow-left").click(function(){!function(){var i,a,o;t("#uifm-panel-arrow-left").hasClass("uifm-layout-toggler-open")?(t("#uifm-panel-arrow-left").removeClass("uifm-layout-toggler-open"),i=(100*parseFloat(10)/parseFloat(s)).toFixed(3),a=parseFloat(c)+parseFloat(n),o=parseFloat(a)-parseFloat(i),e.find(".uifm-edit-panel-left").css("width",i+"%"),e.find(".uifm-edit-panel-center").css("width",o+"%"),e.find(".uifm-edit-panel-left").addClass("uifm-panel-tog-left-closed"),t("#uifm-panel-arrow-left").find(".uifm-arrow-open").css("display","none"),t("#uifm-panel-arrow-left").find(".uifm-arrow-closed").css("display","block"),t(".uiform-editing-main .uiform-builder-fields").hide(),t("#uifm-panel-arrow-left").addClass("uifm-layout-toggler-close"),t("#uifm-panel-arrow-left").attr("title","Open")):(t("#uifm-panel-arrow-left").removeClass("uifm-layout-toggler-close"),e.find(".uifm-edit-panel-left").removeClass("uifm-panel-tog-left-closed"),i=(100*parseFloat(279)/parseFloat(s)).toFixed(3),a=parseFloat(c)+parseFloat(n),o=parseFloat(a)-parseFloat(i),e.find(".uifm-edit-panel-left").css("width",i+"%"),e.find(".uifm-edit-panel-center").css("width",o+"%"),t("#uifm-panel-arrow-left").find(".uifm-arrow-open").css("display","block"),t("#uifm-panel-arrow-left").find(".uifm-arrow-closed").css("display","none"),t(".uiform-editing-main .uiform-builder-fields").show(),t("#uifm-panel-arrow-left").addClass("uifm-layout-toggler-open"),t("#uifm-panel-arrow-left").attr("title","Close"));t(window).trigger("resize")}()}),t("#uifm-panel-arrow-right").click(function(){!function(){var i,a,o;t("#uifm-panel-arrow-right").hasClass("uifm-layout-toggler-open")?(t("#uifm-panel-arrow-right").removeClass("uifm-layout-toggler-open"),i=(100*parseFloat(10)/parseFloat(s)).toFixed(3),a=parseFloat(f)+parseFloat(n),o=parseFloat(a)-parseFloat(i),e.find(".uifm-edit-panel-right").css("width",i+"%"),e.find(".uifm-edit-panel-center").css("width",o+"%"),e.find(".uifm-edit-panel-right").addClass("uifm-panel-tog-right-closed"),t("#uifm-panel-arrow-right").find(".uifm-arrow-open").css("display","none"),t("#uifm-panel-arrow-right").find(".uifm-arrow-closed").css("display","block"),t(".uiform-editing-main .uiform-builder-data").hide(),t("#uifm-panel-arrow-right").addClass("uifm-layout-toggler-close"),t("#uifm-panel-arrow-right").attr("title","Open")):(t("#uifm-panel-arrow-right").removeClass("uifm-layout-toggler-close"),e.find(".uifm-edit-panel-right").removeClass("uifm-panel-tog-right-closed"),i=(100*parseFloat(520)/parseFloat(s)).toFixed(3),a=parseFloat(f)+parseFloat(n),o=parseFloat(a)-parseFloat(i),e.find(".uifm-edit-panel-right").css("width",i+"%"),e.find(".uifm-edit-panel-center").css("width",o+"%"),t("#uifm-panel-arrow-right").find(".uifm-arrow-open").css("display","block"),t("#uifm-panel-arrow-right").find(".uifm-arrow-closed").css("display","none"),t(".uiform-editing-main .uiform-builder-data").show(),t("#uifm-panel-arrow-right").addClass("uifm-layout-toggler-open"),t("#uifm-panel-arrow-right").attr("title","Close"));t(window).trigger("resize")}()}),l=this,i=t("#rocketform-bk-content"),a=t("#wpfooter")||null,e=t(l),o.left=e.find(".uifm-edit-panel-left"),o.center=e.find(".uifm-edit-panel-center"),o.right=e.find(".uifm-edit-panel-right"),r=s=t(".uiform-editing-main").width(),m()})}})}($uifm),void 0===$uifm&&($uifm=jQuery),function(t,e){e.uifmsetting=uifmsetting=t.uifmsetting||function(){arguments.callee.redirect=function(t){e.event?(e.event.returnValue=!1,e.location=t):location.href=t},arguments.callee.settings_saveFormSettings=function(){t("#frmform").validate({errorClass:"help-inline",errorElement:"span",rules:{site_title:{required:!0},admin_mail:{required:!0,email:!0}},messages:{site_title:{required:"Please specify site title"},admin_mail:{required:"We need email address"}},highlight:function(e){t(e).closest(".control-group").addClass("error").removeClass("success")},success:function(e){t(e).text("").closest(".control-group").addClass("success")},submitHandler:function(t){t.submit()}}),t("#frmform").submit()},arguments.callee.user_SaveUser=function(){t("#frmform").validate({errorClass:"help-inline",errorElement:"span",rules:{use_login:{required:!0},use_password:{required:!0,minlength:5},use_password2:{required:!0,equalTo:"#use_password",minlength:5}},messages:{nameform:{required:"Please specify your username"},descriptionform:{required:"We need your email address"}},highlight:function(e){t(e).closest(".control-group").addClass("error").removeClass("success")},success:function(e){t(e).text("").closest(".control-group").addClass("success")},submitHandler:function(t){t.submit()}}),t("#frmform").submit()},arguments.callee.user_CancelUser=function(){this.redirect(uiform_vars.url_admin+"user/intranet/index")}},uifmsetting()}($uifm,window),function(t){var e=function(e,i){var a=null,o=!1,s=t(e),r=this,n=null,c={data:{type:29,id:"",skin:{margin:{show_st:1,top:"5",bottom:"5",left:"0",right:"0"},padding:{show_st:1,top:"0",bottom:"0",left:"0",right:"0"},custom_css:{ctm_id:"",ctm_class:"",ctm_additional:""}},field_name:"",order_frm:"0",type_n:"appetext",input:{value:"",size:"14",bold:0,italic:0,underline:0,placeholder:"",color:"#000",font:"",font_st:1,val_align:"",append_txt:encodeURIComponent("@")},label:{text:"Text label",size:"14",bold:0,italic:0,underline:0,color:"#000",font:'{"family":"\'Comic Sans MS\', Arial, sans-serif","name":"Comic Sans MS","classname":"comicsansms"}',font_st:1,shadow_st:0,shadow_color:"#666",shadow_x:1,shadow_y:1,shadow_blur:3},sublabel:{text:"",size:"14",bold:1,italic:1,underline:0,color:"#000",font:'{"family":"\'Comic Sans MS\', Arial, sans-serif","name":"Comic Sans MS","classname":"comicsansms"}',font_st:1,shadow_st:0,shadow_color:"#666",shadow_x:1,shadow_y:1,shadow_blur:3},txt_block:{block_pos:"1",block_st:"1",block_align:"0",grid_layout:"2"},el_background:{show_st:"1",type:"1",start_color:"",end_color:"",solid_color:"#ffffff"},el_border_radius:{show_st:"1",size:"0"},el_border:{show_st:"1",color:"#ccc",color_focus_st:"0",color_focus:"#000",style:"1",width:"1"},help_block:{text:"here your content",show_st:"0",font:"",font_st:"0",pos:""},validate:{typ_val:"0",typ_val_custxt:"",customval_regex:"",pos:"0",tip_col:"#000000",tip_bg:"#ffffff",reqicon_st:"0",reqicon_pos:"0",reqicon_img:"glyphicon-asterisk"},clogic:{show_st:"0",f_show:"1",f_all:"1",list:[]}}},f=t.extend(!0,{},c,i);this.publicMethod=function(){};this.testingdata=function(){},this.updateVarData=function(e){t("#"+e).data("uifm-settings",f)},this.update_previewfield=function(e){t("#"+e)&&rocketform.loadForm_updatePreviewField(e,f.data)},this.loadSettingDataTab=function(t){this.showSettingTab(t)},this.onWholeHover=function(e){e&&(e.stopPropagation(),e.preventDefault());var i=wp.template("zgpb-quick-options");0===parseInt(t(this).find(".zgpb-fields-quick-options2").length)&&t(this).append(i({type:f.data.type,id:f.data.id})),n=s.find(".zgpb-fields-quick-options2"),r.refresh_quickopt_position()},this.offWholeHover=function(e){e&&(e.stopPropagation(),e.preventDefault()),parseInt(t(this).find(".zgpb-fields-quick-options2").length)>0&&t(this).find(".zgpb-fields-quick-options2").remove()},this.init_events=function(){s.on("mouseenter",r.onWholeHover),s.on("mouseleave",r.offWholeHover),t(window).scroll(function(){r.refresh_quickopt_position()})},this.refresh_quickopt_position=function(){if(n&&n.is(":visible")){var e,i=t(s).offset().top||null,a=i+t(s).height(),o=t(window).scrollTop(),r=o+t(window).height();e=i>o&&ao&&a>r?((r-i)/2).toString()+"px":ir?(o-i+t(window).height()/2).toString()+"px":"50%",n.css("top",e)}},this.enableSettingOptions=function(e,i){this.showSettingTab(),rocketform.checkIntegrityDataField(e.id)&&(this.enableSettingOptions_process(e,!0,!0),rocketform.setDataToSettingTabAndPreview(e.id,f.data),rocketform.loading_boxField("zgfm-panel-right-field-tabopt",0),o&&(rocketform.loading_boxField(e.id,0),o=!1),t("#uiform-build-field-tab").removeClass("zgfm-fieldtab-flag-loading"))},this.setVariables=function(t){o=t.oncreation||!1},this.enableSettingOptions_process=function(e,i,a){var o=t("#uifm-field-opt-content");rocketform.fields_events_bswitch(o),rocketform.fields_events_spinner(o),rocketform.fields2_events_spinner(o),rocketform.fields_events_general(),rocketform.fields_events_cpicker(o),rocketform.fields_events_slider(o),rocketform.fields_events_select(o),rocketform.fields2_events_txts(o)},this.showSettingTab=function(e){var i=t("#uifm-field-selected-id").val();if(String(i)!=String(e)){rocketform.cleanSettingTab();t.each([".uifm-set-section-fieldname",".uifm-tab-fld-label",".uifm-tab-fld-input",".uifm-tab-fld-helpblock",".uifm-tab-fld-validation",".uifm-tab-fld-logicrls",".uifm-set-section-label",".uifm-set-section-sublabel",".uifm-set-section-blocktxt",".uifm-set-section-input-valign",".uifm-set-section-input-placeh",".uifm-set-section-inputtextbox",".uifm-set-section-inputboxbg",".uifm-set-section-inputboxborder",".uifm-set-section-helpblock",".uifm-set-section-validator",".zgfm-set-section-custominput-box","#uifm-custom-val-req-btn","#uifm-custom-val-alpha-btn","#uifm-custom-val-alphanum-btn","#uifm-custom-val-num-btn","#uifm-custom-val-mail-btn",".uifm-set-section-inputappend",".uifm-set-section-label-lbltxt",".uifm-set-section-label-sublbltxt",".uifm-set-section-input1-txtvalue",".uifm-set-section-helpblock-text",".uifm-tab-fld-moreopt"],function(){t(String(this)).removeClass("uifm-hide")}),t('.sfdc-nav-tabs a[href="#uiform-settings-tab-1"]').sfdc_tab("show")}rocketform.checkScrollTab()},this.setToDatalvl1=function(t,e){f.data[t]=e},this.setFieldName=function(t){f.data.field_name=f.data.type_n+t},this.setDataToCoreStore=function(t,e){rocketform.setUiData3("steps_src",t,e,f.data)},this.update_settingsData=function(e){var i=uifm_validate_field(t.extend(!0,{},f,{data:e}),f);f=i},this.setDataToCore=function(t){var e=t.id,i=t.opt1,o=t.opt2,s=t.opt3,r=t.opt4;switch(String(i)){case"skin":default:rocketform.setUiData6("steps_src",a,String(e),String(i),String(o),String(s),r)}},this.setStep=function(t){a=t}};t.fn.uiform_appetext=function(i){return this.each(function(){var a=t(this);if(!a.data("uiform_appetext")){var o=new e(this,i);a.data("uiform_appetext",o)}})}}($uifm),function(t){var e=function(e,i){var a=null,o=!1,s=t(e),r=this,n=null,c={data:{type:19,id:"",skin:{margin:{show_st:1,top:"5",bottom:"5",left:"0",right:"0"},padding:{show_st:1,top:"0",bottom:"0",left:"0",right:"0"},custom_css:{ctm_id:"",ctm_class:"",ctm_additional:""}},field_name:"",order_frm:"0",type_n:"captcha",input6:{txt_color_st:"0",txt_color:"1000",background_st:"0",background_color:"",distortion:"1",behind_lines_st:"0",behind_lines:"2",front_lines_st:"0",front_lines:"2"},label:{text:"Text label",size:"14",bold:0,italic:0,underline:0,color:"#000",font:'{"family":"\'Comic Sans MS\', Arial, sans-serif","name":"Comic Sans MS","classname":"comicsansms"}',font_st:1,shadow_st:0,shadow_color:"#666",shadow_x:1,shadow_y:1,shadow_blur:3},sublabel:{text:"",size:"14",bold:1,italic:1,underline:0,color:"#000",font:'{"family":"\'Comic Sans MS\', Arial, sans-serif","name":"Comic Sans MS","classname":"comicsansms"}',font_st:1,shadow_st:0,shadow_color:"#666",shadow_x:1,shadow_y:1,shadow_blur:3},txt_block:{block_pos:"1",block_st:"1",block_align:"0",grid_layout:"2"},help_block:{text:"here your content",show_st:"0",font:"",font_st:"0",pos:""},validate:{typ_val:"0",typ_val_custxt:"",pos:"0",tip_col:"#000000",tip_bg:"#ffffff",reqicon_st:"0",reqicon_pos:"0",reqicon_img:"glyphicon-asterisk"},clogic:{show_st:"0",f_show:"1",f_all:"1",list:[]}}},f=t.extend(!0,{},c,i);this.publicMethod=function(){};this.testingdata=function(){},this.updateVarData=function(e){t("#"+e).data("uifm-settings",f)},this.update_previewfield=function(e){t("#"+e)&&rocketform.loadForm_updatePreviewField(e,f.data)},this.loadSettingDataTab=function(t){this.showSettingTab(t)},this.onWholeHover=function(e){e&&(e.stopPropagation(),e.preventDefault());var i=wp.template("zgpb-quick-options");0===parseInt(t(this).find(".zgpb-fields-quick-options2").length)&&t(this).append(i({type:f.data.type,id:f.data.id})),n=s.find(".zgpb-fields-quick-options2"),r.refresh_quickopt_position()},this.offWholeHover=function(e){e&&(e.stopPropagation(),e.preventDefault()),parseInt(t(this).find(".zgpb-fields-quick-options2").length)>0&&t(this).find(".zgpb-fields-quick-options2").remove()},this.init_events=function(){s.on("mouseenter",r.onWholeHover),s.on("mouseleave",r.offWholeHover),t(window).scroll(function(){r.refresh_quickopt_position()})},this.refresh_quickopt_position=function(){if(n&&n.is(":visible")){var e,i=t(s).offset().top||null,a=i+t(s).height(),o=t(window).scrollTop(),r=o+t(window).height();e=i>o&&ao&&a>r?((r-i)/2).toString()+"px":ir?(o-i+t(window).height()/2).toString()+"px":"50%",n.css("top",e)}},this.enableSettingOptions=function(e,i){this.showSettingTab(),rocketform.checkIntegrityDataField(e.id)&&(this.enableSettingOptions_process(e,!0,!0),rocketform.setDataToSettingTabAndPreview(e.id,f.data),rocketform.loading_boxField("zgfm-panel-right-field-tabopt",0),o&&(rocketform.loading_boxField(e.id,0),o=!1),t("#uiform-build-field-tab").removeClass("zgfm-fieldtab-flag-loading"))},this.setVariables=function(t){o=t.oncreation||!1},this.enableSettingOptions_process=function(e,i,a){var o=t("#uifm-field-opt-content");rocketform.fields_events_bswitch(o),rocketform.fields_events_spinner(o),rocketform.fields2_events_spinner(o),rocketform.fields_events_general(),rocketform.fields_events_cpicker(o),rocketform.fields_events_slider(o),rocketform.fields_events_select(o),rocketform.fields2_events_txts(o)},this.showSettingTab=function(e){var i=t("#uifm-field-selected-id").val();if(String(i)!=String(e)){rocketform.cleanSettingTab();t.each([".uifm-set-section-fieldname",".uifm-tab-fld-label",".uifm-tab-fld-input",".uifm-tab-fld-helpblock",".uifm-tab-fld-logicrls",".uifm-set-section-label",".uifm-set-section-sublabel",".uifm-set-section-blocktxt",".uifm-set-section-input6",".uifm-set-section-helpblock","#uifm-fld-inp2-block-align-box",".uifm-set-section-input4-defaultvalue",".uifm-set-section-label-lbltxt",".uifm-set-section-label-sublbltxt",".uifm-set-section-input1-txtvalue",".uifm-set-section-helpblock-text",".uifm-tab-fld-moreopt"],function(){t(String(this)).removeClass("uifm-hide")}),t('.sfdc-nav-tabs a[href="#uiform-settings-tab-1"]').sfdc_tab("show")}rocketform.checkScrollTab()},this.setToDatalvl1=function(t,e){f.data[t]=e},this.setDataToCoreStore=function(t,e){rocketform.setUiData3("steps_src",t,e,f.data)},this.update_settingsData=function(e){var i=uifm_validate_field(t.extend(!0,{},f,{data:e}),f);f=i},this.setDataToCore=function(t){var e=t.id,i=t.opt1,o=t.opt2,s=t.opt3,r=t.opt4;switch(String(i)){case"skin":default:rocketform.setUiData6("steps_src",a,String(e),String(i),String(o),String(s),r)}},this.setStep=function(t){a=t}};t.fn.uiform_captcha=function(i){return this.each(function(){var a=t(this);if(!a.data("uiform_captcha")){var o=new e(this,i);a.data("uiform_captcha",o)}})}}($uifm),function(t){var e=function(e,i){var a=null,o=!1,s=t(e),r=this,n=null,c={data:{type:9,id:"",skin:{margin:{show_st:1,top:"5",bottom:"5",left:"0",right:"0"},padding:{show_st:1,top:"0",bottom:"0",left:"0",right:"0"},custom_css:{ctm_id:"",ctm_class:"",ctm_additional:""}},field_name:"",order_frm:"0",type_n:"checkbox",cost_st:"1",input2:{size:"14",bold:0,italic:0,underline:0,color:"#000",font:"",font_st:1,block_align:0,style_type:1,options:{},stl1:{border_color:"#337ab7",bg_color:"#ffffff",icon_color:"#337ab7",icon_mark:"fa-check",size:"14"}},price:{enable_st:"1",lbl_show_st:"1",lbl_show_format:"%3Cp%3E(%5Buifm_symbol%5D%20%5Buifm_price%5D%20%5Buifm_currency%5D)%3C%2Fp%3E",color:"#FF0000",font:'{"family":"\'Comic Sans MS\', Arial, sans-serif","name":"Comic Sans MS","classname":"comicsansms"}',font_st:1},label:{text:"Text label",size:"14",bold:0,italic:0,underline:0,color:"#000",font:'{"family":"\'Comic Sans MS\', Arial, sans-serif","name":"Comic Sans MS","classname":"comicsansms"}',font_st:1,shadow_st:0,shadow_color:"#666",shadow_x:1,shadow_y:1,shadow_blur:3},sublabel:{text:"",size:"14",bold:1,italic:1,underline:0,color:"#000",font:'{"family":"\'Comic Sans MS\', Arial, sans-serif","name":"Comic Sans MS","classname":"comicsansms"}',font_st:1,shadow_st:0,shadow_color:"#666",shadow_x:1,shadow_y:1,shadow_blur:3},txt_block:{block_pos:"1",block_st:"1",block_align:"0",grid_layout:"2"},help_block:{text:"here your content",show_st:"0",font:"",font_st:"0",pos:""},validate:{typ_val:"0",typ_val_custxt:"",pos:"0",tip_col:"#000000",tip_bg:"#ffffff",reqicon_st:"0",reqicon_pos:"0",reqicon_img:"glyphicon-asterisk"},clogic:{show_st:"0",f_show:"1",f_all:"1",list:[]}}},f=t.extend(!0,{},c,i);this.publicMethod=function(){};this.testingdata=function(){},this.updateVarData=function(e){t("#"+e).data("uifm-settings",f)},this.update_previewfield=function(e){t("#"+e)&&rocketform.loadForm_updatePreviewField(e,f.data)},this.loadSettingDataTab=function(t){this.showSettingTab(t)},this.onWholeHover=function(e){e&&(e.stopPropagation(),e.preventDefault());var i=wp.template("zgpb-quick-options");0===parseInt(t(this).find(".zgpb-fields-quick-options2").length)&&t(this).append(i({type:f.data.type,id:f.data.id})),n=s.find(".zgpb-fields-quick-options2"),r.refresh_quickopt_position()},this.offWholeHover=function(e){e&&(e.stopPropagation(),e.preventDefault()),parseInt(t(this).find(".zgpb-fields-quick-options2").length)>0&&t(this).find(".zgpb-fields-quick-options2").remove()},this.init_events=function(){s.on("mouseenter",r.onWholeHover),s.on("mouseleave",r.offWholeHover),t(window).scroll(function(){r.refresh_quickopt_position()})},this.refresh_quickopt_position=function(){if(n&&n.is(":visible")){var e,i=t(s).offset().top||null,a=i+t(s).height(),o=t(window).scrollTop(),r=o+t(window).height();e=i>o&&ao&&a>r?((r-i)/2).toString()+"px":ir?(o-i+t(window).height()/2).toString()+"px":"50%",n.css("top",e)}},this.enableSettingOptions=function(e,i){this.showSettingTab(),rocketform.checkIntegrityDataField(e.id)&&(this.enableSettingOptions_process(e,!0,!0),rocketform.setDataToSettingTabAndPreview(e.id,f.data),rocketform.loading_boxField("zgfm-panel-right-field-tabopt",0),o&&(rocketform.loading_boxField(e.id,0),o=!1),t("#uiform-build-field-tab").removeClass("zgfm-fieldtab-flag-loading"))},this.setVariables=function(t){o=t.oncreation||!1},this.enableSettingOptions_process=function(e,i,a){var o=t("#uifm-field-opt-content");rocketform.fields_events_bswitch(o),rocketform.fields_events_spinner(o),rocketform.fields2_events_spinner(o),rocketform.fields_events_general(),rocketform.fields_events_cpicker(o),rocketform.fields_events_slider(o),rocketform.fields_events_select(o),rocketform.fields2_events_txts(o)},this.showSettingTab=function(e){var i=t("#uifm-field-selected-id").val();if(String(i)!=String(e)){rocketform.cleanSettingTab();t.each([".uifm-set-section-fieldname",".uifm-tab-fld-label",".uifm-tab-fld-input",".uifm-tab-fld-helpblock",".uifm-tab-fld-validation",".uifm-tab-fld-logicrls",".uifm-set-section-label",".uifm-set-section-sublabel",".uifm-set-section-blocktxt",".uifm-set-section-input2",".uifm-set-section-pricesetting",".uifm-set-section-pricesetting2",".uifm-set-section-helpblock",".uifm-set-section-validator","#uifm-custom-val-req-btn","#uifm-fld-inp2-block-align-box",".uifm-set-section-label-lbltxt",".uifm-set-section-label-sublbltxt",".uifm-set-section-helpblock-text",".uifm-tab-fld-moreopt"],function(){t(String(this)).removeClass("uifm-hide")}),t('.sfdc-nav-tabs a[href="#uiform-settings-tab-1"]').sfdc_tab("show")}rocketform.checkScrollTab()},this.setToDatalvl1=function(t,e){f.data[t]=e},this.setFieldName=function(t){f.data.field_name=f.data.type_n+t},this.setDataToCoreStore=function(t,e){rocketform.setUiData3("steps_src",t,e,f.data)},this.update_settingsData=function(e){var i=uifm_validate_field(t.extend(!0,{},f,{data:e}),f);f=i},this.setDataToCore=function(t){var e=t.id,i=t.opt1,o=t.opt2,s=t.opt3,r=t.opt4;switch(String(i)){case"skin":default:rocketform.setUiData6("steps_src",a,String(e),String(i),String(o),String(s),r)}},this.setStep=function(t){a=t},this.input2settings_preview_genAllOptions=function(){var e=f.data.id,i=t("#"+e),a=t("#"+e).closest(".uiform-step-pane").data("uifm-step"),o=rocketform.getUiData5("steps_src",a,e,"input2","block_align"),s=rocketform.getUiData4("steps_src",a,e,"type"),r=rocketform.getUiData5("steps_src",a,e,"input2","options"),n=rocketform.getUiData5("steps_src",a,e,"input2","style_type"),c=rocketform.getUiData4("steps_src",a,e,"input2"),l=CryptoJS.MD5(JSON.stringify(c)),d=t("#"+e).attr("data-zgfm-input2-hash");if(String(d)===String(l));else{var _;switch(t("#"+e).attr("data-zgfm-input2-hash",l),i.find(".uifm-input2-wrap").html(""),parseInt(s)){case 8:t.each(r,function(a,o){(_=t("#uifm_frm_inp2_templates").find(".sfdc-radio").clone()).attr("data-inp2-opt-index",a),_.find(".uifm-inp2-rdo").prop("checked",parseInt(o.checked)),_.find(".uifm-inp2-rdo").attr("name","uifm_"+e+"_opt"),_.find(".uifm-inp2-label").html(o.label),i.find(".uifm-input2-wrap").append(_.prop("outerHTML"))}),i.find(".uifm-input2-wrap").find("label .uifm_frm_price_lbl_cont").html(rocketform.pricesettings_labelformat(t("#"+e))),1===parseInt(o)?i.find(".uifm-input2-wrap .sfdc-radio").attr("class","sfdc-radio-inline"):i.find(".uifm-input2-wrap .sfdc-radio-inline").attr("class","sfdc-radio");break;case 9:t.each(r,function(a,o){(_=t("#uifm_frm_inp2_templates").find(".sfdc-checkbox").clone()).attr("data-inp2-opt-index",a),_.find(".uifm-inp2-chk").prop("checked",parseInt(o.checked)),_.find(".uifm-inp2-chk").attr("name","uifm_"+e+"_opt"),_.find(".uifm-inp2-label").html(o.label),i.find(".uifm-input2-wrap").append(_)}),i.find(".uifm-input2-wrap").find("label .uifm_frm_price_lbl_cont").html(rocketform.pricesettings_labelformat(t("#"+e))),1===parseInt(o)?i.find(".uifm-input2-wrap .sfdc-checkbox").attr("class","sfdc-checkbox-inline"):i.find(".uifm-input2-wrap .sfdc-checkbox-inline").attr("class","sfdc-checkbox"),t("#"+e).attr("data-zgfm-stl1-hash",""),1===parseInt(n)&&this.previewfield_input2_stl1();break;case 10:i.find(".uifm-input2-wrap").append(''),t.each(r,function(t,e){_='