Version Description
- Fixed: bug on "Save as Copy"
- Fixed: Line breaks in textarea after incorrect captcha
- Changed: Submissions page: display labels on buttons
- Changed: When the Pro version is installed, display a notification about automatically disabling Free version
Download this release
Release Info
| Developer | webdorado |
| Plugin | |
| Version | 1.8.40 |
| Comparing to | |
| See all releases | |
Code changes from version 1.8.39 to 1.8.40
- admin/controllers/FMControllerManage_fmc.php +1276 -1276
- admin/views/FMViewSubmissions_fmc.php +11 -5
- contact-form-maker.php +15 -2
- css/form_maker_tables.css +1144 -1142
- frontend/views/FMViewForm_maker_fmc.php +5157 -5157
- readme.txt +7 -1
admin/controllers/FMControllerManage_fmc.php
CHANGED
|
@@ -1,1277 +1,1277 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMControllerManage_fmc {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
-
// Constructor & Destructor //
|
| 15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
-
public function __construct() {
|
| 17 |
-
}
|
| 18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
-
// Public Methods //
|
| 20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
-
public function execute() {
|
| 22 |
-
$task = WDW_FMC_Library::get('task');
|
| 23 |
-
$id = (int)WDW_FMC_Library::get('current_id', 0);
|
| 24 |
-
$message = WDW_FMC_Library::get('message');
|
| 25 |
-
echo WDW_FMC_Library::message_id($message);
|
| 26 |
-
if (method_exists($this, $task)) {
|
| 27 |
-
check_admin_referer('nonce_fmc', 'nonce_fmc');
|
| 28 |
-
$this->$task($id);
|
| 29 |
-
}
|
| 30 |
-
else {
|
| 31 |
-
$this->display();
|
| 32 |
-
}
|
| 33 |
-
}
|
| 34 |
-
public function undo()
|
| 35 |
-
{
|
| 36 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
|
| 37 |
-
$model = new FMModelManage_fmc();
|
| 38 |
-
|
| 39 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
|
| 40 |
-
|
| 41 |
-
global $wpdb;
|
| 42 |
-
$backup_id = (int)WDW_FMC_Library::get('backup_id');
|
| 43 |
-
$id = (int)WDW_FMC_Library::get('id');
|
| 44 |
-
|
| 45 |
-
$query = "SELECT backup_id FROM ".$wpdb->prefix."formmaker_backup WHERE backup_id < $backup_id AND id = $id ORDER BY backup_id DESC LIMIT 0 , 1 ";
|
| 46 |
-
$backup_id = $wpdb->get_var($query);
|
| 47 |
-
|
| 48 |
-
$view = new FMViewManage_fmc($model);
|
| 49 |
-
$view->edit($backup_id);
|
| 50 |
-
|
| 51 |
-
}
|
| 52 |
-
public function redo()
|
| 53 |
-
{
|
| 54 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
|
| 55 |
-
$model = new FMModelManage_fmc();
|
| 56 |
-
|
| 57 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
|
| 58 |
-
global $wpdb;
|
| 59 |
-
$backup_id = (int)WDW_FMC_Library::get('backup_id');
|
| 60 |
-
$id = (int)WDW_FMC_Library::get('id');
|
| 61 |
-
|
| 62 |
-
$query = "SELECT backup_id FROM ".$wpdb->prefix."formmaker_backup WHERE backup_id > $backup_id AND id = $id ORDER BY backup_id ASC LIMIT 0 , 1 ";
|
| 63 |
-
$backup_id = $wpdb->get_var($query);
|
| 64 |
-
|
| 65 |
-
$view = new FMViewManage_fmc($model);
|
| 66 |
-
$view->edit($backup_id);
|
| 67 |
-
|
| 68 |
-
}
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
public function display() {
|
| 72 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
|
| 73 |
-
$model = new FMModelManage_fmc();
|
| 74 |
-
|
| 75 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
|
| 76 |
-
$view = new FMViewManage_fmc($model);
|
| 77 |
-
$view->display();
|
| 78 |
-
}
|
| 79 |
-
|
| 80 |
-
public function add() {
|
| 81 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
|
| 82 |
-
$model = new FMModelManage_fmc();
|
| 83 |
-
|
| 84 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
|
| 85 |
-
$view = new FMViewManage_fmc($model);
|
| 86 |
-
$view->edit(0);
|
| 87 |
-
}
|
| 88 |
-
|
| 89 |
-
public function edit() {
|
| 90 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
|
| 91 |
-
$model = new FMModelManage_fmc();
|
| 92 |
-
|
| 93 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
|
| 94 |
-
$view = new FMViewManage_fmc($model);
|
| 95 |
-
$id = (int)WDW_FMC_Library::get('current_id', 0);
|
| 96 |
-
|
| 97 |
-
global $wpdb;
|
| 98 |
-
$query = "SELECT backup_id FROM ".$wpdb->prefix."formmaker_backup WHERE cur=1 and id=".$id;
|
| 99 |
-
$backup_id = $wpdb->get_var($query);
|
| 100 |
-
|
| 101 |
-
if(!$backup_id)
|
| 102 |
-
{
|
| 103 |
-
$query = "SELECT max(backup_id) FROM ".$wpdb->prefix."formmaker_backup";
|
| 104 |
-
$backup_id = $wpdb->get_var($query);
|
| 105 |
-
if($backup_id)
|
| 106 |
-
$backup_id++;
|
| 107 |
-
else
|
| 108 |
-
$backup_id=1;
|
| 109 |
-
$query = "INSERT INTO ".$wpdb->prefix."formmaker_backup SELECT ".$backup_id." AS backup_id, 1 AS cur, formmakerbkup.id, formmakerbkup.title, formmakerbkup.mail, formmakerbkup.form_front, formmakerbkup.theme, formmakerbkup.javascript, formmakerbkup.submit_text, formmakerbkup.url, formmakerbkup.submit_text_type, formmakerbkup.script_mail, formmakerbkup.script_mail_user, formmakerbkup.counter, formmakerbkup.published, formmakerbkup.label_order, formmakerbkup.label_order_current, formmakerbkup.article_id, formmakerbkup.pagination, formmakerbkup.show_title, formmakerbkup.show_numbers, formmakerbkup.public_key, formmakerbkup.private_key, formmakerbkup.recaptcha_theme, formmakerbkup.paypal_mode, formmakerbkup.checkout_mode, formmakerbkup.paypal_email, formmakerbkup.payment_currency, formmakerbkup.tax, formmakerbkup.form_fields, formmakerbkup.savedb, formmakerbkup.sendemail, formmakerbkup.requiredmark, formmakerbkup.from_mail, formmakerbkup.from_name, formmakerbkup.reply_to, formmakerbkup.send_to, formmakerbkup.autogen_layout, formmakerbkup.custom_front, formmakerbkup.mail_from_user, formmakerbkup.mail_from_name_user, formmakerbkup.reply_to_user, formmakerbkup.condition, formmakerbkup.mail_cc, formmakerbkup.mail_cc_user, formmakerbkup.mail_bcc, formmakerbkup.mail_bcc_user, formmakerbkup.mail_subject, formmakerbkup.mail_subject_user, formmakerbkup.mail_mode, formmakerbkup.mail_mode_user, formmakerbkup.mail_attachment, formmakerbkup.mail_attachment_user, formmakerbkup.user_id_wd, formmakerbkup.sortable, formmakerbkup.frontend_submit_fields, formmakerbkup.frontend_submit_stat_fields, formmakerbkup.mail_emptyfields, formmakerbkup.mail_verify, formmakerbkup.mail_verify_expiretime, formmakerbkup.mail_verification_post_id, formmakerbkup.save_uploads FROM ".$wpdb->prefix."formmaker as formmakerbkup WHERE id=".$id;
|
| 110 |
-
$wpdb->query($query);
|
| 111 |
-
}
|
| 112 |
-
|
| 113 |
-
$view->edit($backup_id);
|
| 114 |
-
}
|
| 115 |
-
|
| 116 |
-
public function edit_old() {
|
| 117 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
|
| 118 |
-
$model = new FMModelManage_fmc();
|
| 119 |
-
|
| 120 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
|
| 121 |
-
$view = new FMViewManage_fmc($model);
|
| 122 |
-
$id = (int)WDW_FMC_Library::get('current_id', 0);
|
| 123 |
-
$view->edit_old($id);
|
| 124 |
-
}
|
| 125 |
-
|
| 126 |
-
public function form_options_old() {
|
| 127 |
-
if (!isset($_GET['task'])) {
|
| 128 |
-
$this->save_db();
|
| 129 |
-
}
|
| 130 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
|
| 131 |
-
$model = new FMModelManage_fmc();
|
| 132 |
-
|
| 133 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
|
| 134 |
-
$view = new FMViewManage_fmc($model);
|
| 135 |
-
global $wpdb;
|
| 136 |
-
$id = (int)WDW_FMC_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
|
| 137 |
-
$view->form_options_old($id);
|
| 138 |
-
}
|
| 139 |
-
|
| 140 |
-
public function save_options_old() {
|
| 141 |
-
$message = $this->save_db_options_old();
|
| 142 |
-
// $this->edit_old();
|
| 143 |
-
$page = WDW_FMC_Library::get('page');
|
| 144 |
-
$current_id = (int)WDW_FMC_Library::get('current_id', 0);
|
| 145 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit_old', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
|
| 146 |
-
}
|
| 147 |
-
|
| 148 |
-
public function apply_options_old() {
|
| 149 |
-
$message = $this->save_db_options_old();
|
| 150 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
|
| 151 |
-
$model = new FMModelManage_fmc();
|
| 152 |
-
|
| 153 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
|
| 154 |
-
$view = new FMViewManage_fmc($model);
|
| 155 |
-
$page = WDW_FMC_Library::get('page');
|
| 156 |
-
$current_id = (int)WDW_FMC_Library::get('current_id', 0);
|
| 157 |
-
$fieldset_id = WDW_FMC_Library::get('fieldset_id', 'general');
|
| 158 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'form_options_old', 'current_id' => $current_id, 'message' => $message, 'fieldset_id' => $fieldset_id), admin_url('admin.php')));
|
| 159 |
-
}
|
| 160 |
-
|
| 161 |
-
public function save_db_options_old() {
|
| 162 |
-
$javascript = "// Before the form is loaded.
|
| 163 |
-
function before_load() {
|
| 164 |
-
|
| 165 |
-
}
|
| 166 |
-
// Before form submit.
|
| 167 |
-
function before_submit() {
|
| 168 |
-
|
| 169 |
-
}
|
| 170 |
-
// Before form reset.
|
| 171 |
-
function before_reset() {
|
| 172 |
-
|
| 173 |
-
}";
|
| 174 |
-
global $wpdb;
|
| 175 |
-
$id = (int)WDW_FMC_Library::get('current_id', 0);
|
| 176 |
-
$mail = (isset($_POST['mail']) ? esc_html(stripslashes($_POST['mail'])) : '');
|
| 177 |
-
$theme = (isset($_POST['theme']) ? (int)esc_html(stripslashes($_POST['theme'])) : 1);
|
| 178 |
-
$javascript = (isset($_POST['javascript']) ? stripslashes($_POST['javascript']) : $javascript);
|
| 179 |
-
$script1 = (isset($_POST['script1']) ? esc_html(stripslashes($_POST['script1'])) : '');
|
| 180 |
-
$script2 = (isset($_POST['script2']) ? esc_html(stripslashes($_POST['script2'])) : '');
|
| 181 |
-
$script_user1 = (isset($_POST['script_user1']) ? esc_html(stripslashes($_POST['script_user1'])) : '');
|
| 182 |
-
$script_user2 = (isset($_POST['script_user2']) ? esc_html(stripslashes($_POST['script_user2'])) : '');
|
| 183 |
-
$submit_text = (isset($_POST['submit_text']) ? stripslashes($_POST['submit_text']) : '');
|
| 184 |
-
$url = (isset($_POST['url']) ? esc_html(stripslashes($_POST['url'])) : '');
|
| 185 |
-
$script_mail = (isset($_POST['script_mail']) ? stripslashes($_POST['script_mail']) : '%all%');
|
| 186 |
-
$script_mail_user = (isset($_POST['script_mail_user']) ? stripslashes($_POST['script_mail_user']) : '%all%');
|
| 187 |
-
$label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
|
| 188 |
-
$tax = (isset($_POST['tax']) ? esc_html(stripslashes($_POST['tax'])) : 0);
|
| 189 |
-
$payment_currency = (isset($_POST['payment_currency']) ? stripslashes($_POST['payment_currency']) : '');
|
| 190 |
-
$paypal_email = (isset($_POST['paypal_email']) ? esc_html(stripslashes($_POST['paypal_email'])) : '');
|
| 191 |
-
$checkout_mode = (isset($_POST['checkout_mode']) ? esc_html(stripslashes($_POST['checkout_mode'])) : 'testmode');
|
| 192 |
-
$paypal_mode = (isset($_POST['paypal_mode']) ? esc_html(stripslashes($_POST['paypal_mode'])) : 0);
|
| 193 |
-
$from_mail = (isset($_POST['from_mail']) ? esc_html(stripslashes($_POST['from_mail'])) : '');
|
| 194 |
-
$from_name = (isset($_POST['from_name']) ? esc_html(stripslashes($_POST['from_name'])) : '');
|
| 195 |
-
if (isset($_POST['submit_text_type'])) {
|
| 196 |
-
$submit_text_type = esc_html(stripslashes($_POST['submit_text_type']));
|
| 197 |
-
if ($submit_text_type == 5) {
|
| 198 |
-
$article_id = (isset($_POST['page_name']) ? esc_html(stripslashes($_POST['page_name'])) : 0);
|
| 199 |
-
}
|
| 200 |
-
else {
|
| 201 |
-
$article_id = (isset($_POST['post_name']) ? esc_html(stripslashes($_POST['post_name'])) : 0);
|
| 202 |
-
}
|
| 203 |
-
}
|
| 204 |
-
else {
|
| 205 |
-
$submit_text_type = 0;
|
| 206 |
-
$article_id = 0;
|
| 207 |
-
}
|
| 208 |
-
$save = $wpdb->update($wpdb->prefix . 'formmaker', array(
|
| 209 |
-
'mail' => $mail,
|
| 210 |
-
'theme' => $theme,
|
| 211 |
-
'javascript' => $javascript,
|
| 212 |
-
'submit_text' => $submit_text,
|
| 213 |
-
'url' => $url,
|
| 214 |
-
'submit_text_type' => $submit_text_type,
|
| 215 |
-
'script_mail' => $script_mail,
|
| 216 |
-
'script_mail_user' => $script_mail_user,
|
| 217 |
-
'article_id' => $article_id,
|
| 218 |
-
'paypal_mode' => $paypal_mode,
|
| 219 |
-
'checkout_mode' => $checkout_mode,
|
| 220 |
-
'paypal_email' => $paypal_email,
|
| 221 |
-
'payment_currency' => $payment_currency,
|
| 222 |
-
'tax' => $tax,
|
| 223 |
-
'from_mail' => $from_mail,
|
| 224 |
-
'from_name' => $from_name,
|
| 225 |
-
), array('id' => $id));
|
| 226 |
-
if ($save !== FALSE) {
|
| 227 |
-
return 8;
|
| 228 |
-
}
|
| 229 |
-
else {
|
| 230 |
-
return 2;
|
| 231 |
-
}
|
| 232 |
-
}
|
| 233 |
-
|
| 234 |
-
public function cancel_options_old() {
|
| 235 |
-
$this->edit_old();
|
| 236 |
-
}
|
| 237 |
-
|
| 238 |
-
public function form_layout() {
|
| 239 |
-
if (!isset($_GET['task'])) {
|
| 240 |
-
$this->save_db();
|
| 241 |
-
}
|
| 242 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
|
| 243 |
-
$model = new FMModelManage_fmc();
|
| 244 |
-
|
| 245 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
|
| 246 |
-
$view = new FMViewManage_fmc($model);
|
| 247 |
-
global $wpdb;
|
| 248 |
-
$id = (int)WDW_FMC_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
|
| 249 |
-
$view->form_layout($id);
|
| 250 |
-
}
|
| 251 |
-
|
| 252 |
-
public function save_layout() {
|
| 253 |
-
$message = $this->save_db_layout();
|
| 254 |
-
// $this->edit();
|
| 255 |
-
$page = WDW_FMC_Library::get('page');
|
| 256 |
-
$current_id = (int)WDW_FMC_Library::get('current_id', 0);
|
| 257 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
|
| 258 |
-
}
|
| 259 |
-
|
| 260 |
-
public function apply_layout() {
|
| 261 |
-
$message = $this->save_db_layout();
|
| 262 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
|
| 263 |
-
$model = new FMModelManage_fmc();
|
| 264 |
-
|
| 265 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
|
| 266 |
-
$view = new FMViewManage_fmc($model);
|
| 267 |
-
$page = WDW_FMC_Library::get('page');
|
| 268 |
-
$current_id = (int)WDW_FMC_Library::get('current_id', 0);
|
| 269 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'form_layout', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
|
| 270 |
-
// $view->form_layout($id);
|
| 271 |
-
}
|
| 272 |
-
|
| 273 |
-
public function save_db_layout() {
|
| 274 |
-
global $wpdb;
|
| 275 |
-
$id = (int)WDW_FMC_Library::get('current_id', 0);
|
| 276 |
-
$custom_front = (isset($_POST['custom_front']) ? stripslashes($_POST['custom_front']) : '');
|
| 277 |
-
$autogen_layout = (isset($_POST['autogen_layout']) ? 1 : 0);
|
| 278 |
-
$save = $wpdb->update($wpdb->prefix . 'formmaker', array(
|
| 279 |
-
'custom_front' => $custom_front,
|
| 280 |
-
'autogen_layout' => $autogen_layout
|
| 281 |
-
), array('id' => $id));
|
| 282 |
-
if ($save !== FALSE) {
|
| 283 |
-
return 1;
|
| 284 |
-
}
|
| 285 |
-
else {
|
| 286 |
-
return 2;
|
| 287 |
-
}
|
| 288 |
-
}
|
| 289 |
-
|
| 290 |
-
public function form_options() {
|
| 291 |
-
if (!isset($_GET['task'])) {
|
| 292 |
-
$this->save_db();
|
| 293 |
-
}
|
| 294 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
|
| 295 |
-
$model = new FMModelManage_fmc();
|
| 296 |
-
|
| 297 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
|
| 298 |
-
$view = new FMViewManage_fmc($model);
|
| 299 |
-
// $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
|
| 300 |
-
global $wpdb;
|
| 301 |
-
$id = (int)WDW_FMC_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
|
| 302 |
-
$view->form_options($id);
|
| 303 |
-
}
|
| 304 |
-
|
| 305 |
-
public function save_options() {
|
| 306 |
-
$message = $this->save_db_options();
|
| 307 |
-
// $this->edit();
|
| 308 |
-
$page = WDW_FMC_Library::get('page');
|
| 309 |
-
$current_id = (int)WDW_FMC_Library::get('current_id', 0);
|
| 310 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
|
| 311 |
-
}
|
| 312 |
-
|
| 313 |
-
public function apply_options() {
|
| 314 |
-
$message = $this->save_db_options();
|
| 315 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
|
| 316 |
-
$model = new FMModelManage_fmc();
|
| 317 |
-
|
| 318 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
|
| 319 |
-
$view = new FMViewManage_fmc($model);
|
| 320 |
-
// $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
|
| 321 |
-
// $view->form_options($id);
|
| 322 |
-
$page = WDW_FMC_Library::get('page');
|
| 323 |
-
$current_id = (int)WDW_FMC_Library::get('current_id', 0);
|
| 324 |
-
$fieldset_id = WDW_FMC_Library::get('fieldset_id', 'general');
|
| 325 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'form_options', 'current_id' => $current_id, 'message' => $message, 'fieldset_id' => $fieldset_id), admin_url('admin.php')));
|
| 326 |
-
}
|
| 327 |
-
|
| 328 |
-
public function remove_query() {
|
| 329 |
-
global $wpdb;
|
| 330 |
-
$cid = ((isset($_POST['cid']) && $_POST['cid'] != '') ? $_POST['cid'] : NULL);
|
| 331 |
-
if (count($cid)) {
|
| 332 |
-
array_walk($cid, create_function('&$value', '$value = (int)$value;'));
|
| 333 |
-
$cids = implode(',', $cid);
|
| 334 |
-
$query = 'DELETE FROM ' . $wpdb->prefix . 'formmaker_query WHERE id IN ( ' . $cids . ' )';
|
| 335 |
-
if ($wpdb->query($query)) {
|
| 336 |
-
echo WDW_FMC_Library::message('Items Succesfully Deleted.', 'updated');
|
| 337 |
-
}
|
| 338 |
-
else {
|
| 339 |
-
echo WDW_FMC_Library::message('Error. Please install plugin again.', 'error');
|
| 340 |
-
}
|
| 341 |
-
}
|
| 342 |
-
else {
|
| 343 |
-
echo WDW_FMC_Library::message('You must select at least one item.', 'error');
|
| 344 |
-
}
|
| 345 |
-
$this->apply_options();
|
| 346 |
-
}
|
| 347 |
-
|
| 348 |
-
public function cancel_options() {
|
| 349 |
-
$this->edit();
|
| 350 |
-
}
|
| 351 |
-
|
| 352 |
-
public function save_db_options() {
|
| 353 |
-
$javascript = "// Before the form is loaded.
|
| 354 |
-
function before_load() {
|
| 355 |
-
|
| 356 |
-
}
|
| 357 |
-
// Before form submit.
|
| 358 |
-
function before_submit() {
|
| 359 |
-
|
| 360 |
-
}
|
| 361 |
-
// Before form reset.
|
| 362 |
-
function before_reset() {
|
| 363 |
-
|
| 364 |
-
}";
|
| 365 |
-
global $wpdb;
|
| 366 |
-
// $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
|
| 367 |
-
$id = (int)WDW_FMC_Library::get('current_id', 0);
|
| 368 |
-
$published = (isset($_POST['published']) ? esc_html(stripslashes($_POST['published'])) : 1);
|
| 369 |
-
$savedb = (isset($_POST['savedb']) ? esc_html(stripslashes($_POST['savedb'])) : 1);
|
| 370 |
-
$theme = (int)((isset($_POST['theme']) && (esc_html($_POST['theme']) != 0)) ? esc_html(stripslashes($_POST['theme'])) : $wpdb->get_var("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE `default`='1'"));
|
| 371 |
-
$requiredmark = (isset($_POST['requiredmark']) ? esc_html(stripslashes($_POST['requiredmark'])) : '*');
|
| 372 |
-
$sendemail = (isset($_POST['sendemail']) ? esc_html(stripslashes($_POST['sendemail'])) : 1);
|
| 373 |
-
$save_uploads = (isset($_POST['save_uploads']) ? esc_html(stripslashes($_POST['save_uploads'])) : 1);
|
| 374 |
-
$mail = (isset($_POST['mail']) ? esc_html(stripslashes($_POST['mail'])) : '');
|
| 375 |
-
if (isset($_POST['mailToAdd']) && esc_html(stripslashes($_POST['mailToAdd'])) != '') {
|
| 376 |
-
$mail .= esc_html(stripslashes($_POST['mailToAdd'])) . ',';
|
| 377 |
-
}
|
| 378 |
-
$from_mail = (isset($_POST['from_mail']) ? esc_html(stripslashes($_POST['from_mail'])) : '');
|
| 379 |
-
$from_name = (isset($_POST['from_name']) ? esc_html(stripslashes($_POST['from_name'])) : '');
|
| 380 |
-
$reply_to = (isset($_POST['reply_to']) ? esc_html(stripslashes($_POST['reply_to'])) : '');
|
| 381 |
-
if ($from_mail == "other") {
|
| 382 |
-
$from_mail = (isset($_POST['mail_from_other']) ? esc_html(stripslashes($_POST['mail_from_other'])) : '');
|
| 383 |
-
}
|
| 384 |
-
if ($reply_to == "other") {
|
| 385 |
-
$reply_to = (isset($_POST['reply_to_other']) ? esc_html(stripslashes($_POST['reply_to_other'])) : '');
|
| 386 |
-
}
|
| 387 |
-
$script_mail = (isset($_POST['script_mail']) ? stripslashes($_POST['script_mail']) : '%all%');
|
| 388 |
-
$mail_from_user = (isset($_POST['mail_from_user']) ? esc_html(stripslashes($_POST['mail_from_user'])) : '');
|
| 389 |
-
$mail_from_name_user = (isset($_POST['mail_from_name_user']) ? esc_html(stripslashes($_POST['mail_from_name_user'])) : '');
|
| 390 |
-
$reply_to_user = (isset($_POST['reply_to_user']) ? esc_html(stripslashes($_POST['reply_to_user'])) : '');
|
| 391 |
-
$condition = (isset($_POST['condition']) ? esc_html(stripslashes($_POST['condition'])) : '');
|
| 392 |
-
$mail_cc = (isset($_POST['mail_cc']) ? esc_html(stripslashes($_POST['mail_cc'])) : '');
|
| 393 |
-
$mail_cc_user = (isset($_POST['mail_cc_user']) ? esc_html(stripslashes($_POST['mail_cc_user'])) : '');
|
| 394 |
-
$mail_bcc = (isset($_POST['mail_bcc']) ? esc_html(stripslashes($_POST['mail_bcc'])) : '');
|
| 395 |
-
$mail_bcc_user = (isset($_POST['mail_bcc_user']) ? esc_html(stripslashes($_POST['mail_bcc_user'])) : '');
|
| 396 |
-
$mail_subject = (isset($_POST['mail_subject']) ? esc_html(stripslashes($_POST['mail_subject'])) : '');
|
| 397 |
-
$mail_subject_user = (isset($_POST['mail_subject_user']) ? esc_html(stripslashes($_POST['mail_subject_user'])) : '');
|
| 398 |
-
$mail_mode = (isset($_POST['mail_mode']) ? esc_html(stripslashes($_POST['mail_mode'])) : 1);
|
| 399 |
-
$mail_mode_user = (isset($_POST['mail_mode_user']) ? esc_html(stripslashes($_POST['mail_mode_user'])) : 1);
|
| 400 |
-
$mail_attachment = (isset($_POST['mail_attachment']) ? esc_html(stripslashes($_POST['mail_attachment'])) : 1);
|
| 401 |
-
$mail_attachment_user = (isset($_POST['mail_attachment_user']) ? esc_html(stripslashes($_POST['mail_attachment_user'])) : 1);
|
| 402 |
-
$script_mail_user = (isset($_POST['script_mail_user']) ? stripslashes($_POST['script_mail_user']) : '%all%');
|
| 403 |
-
$submit_text = (isset($_POST['submit_text']) ? stripslashes($_POST['submit_text']) : '');
|
| 404 |
-
$url = (isset($_POST['url']) ? esc_html(stripslashes($_POST['url'])) : '');
|
| 405 |
-
$tax = (isset($_POST['tax']) ? esc_html(stripslashes($_POST['tax'])) : 0);
|
| 406 |
-
$payment_currency = (isset($_POST['payment_currency']) ? stripslashes($_POST['payment_currency']) : '');
|
| 407 |
-
$paypal_email = (isset($_POST['paypal_email']) ? esc_html(stripslashes($_POST['paypal_email'])) : '');
|
| 408 |
-
$checkout_mode = (isset($_POST['checkout_mode']) ? esc_html(stripslashes($_POST['checkout_mode'])) : 'testmode');
|
| 409 |
-
$paypal_mode = (isset($_POST['paypal_mode']) ? esc_html(stripslashes($_POST['paypal_mode'])) : 0);
|
| 410 |
-
$javascript = (isset($_POST['javascript']) ? stripslashes($_POST['javascript']) : $javascript);
|
| 411 |
-
$user_id_wd = (isset($_POST['user_id_wd']) ? stripslashes($_POST['user_id_wd']) : 'administrator,');
|
| 412 |
-
$frontend_submit_fields = (isset($_POST['frontend_submit_fields']) ? stripslashes($_POST['frontend_submit_fields']) : '');
|
| 413 |
-
$frontend_submit_stat_fields = (isset($_POST['frontend_submit_stat_fields']) ? stripslashes($_POST['frontend_submit_stat_fields']) : '');
|
| 414 |
-
$mail_emptyfields = (isset($_POST['mail_emptyfields']) ? esc_html(stripslashes($_POST['mail_emptyfields'])) : 0);
|
| 415 |
-
$mail_verify = (isset($_POST['mail_verify']) ? esc_html(stripslashes($_POST['mail_verify'])) : 0);
|
| 416 |
-
$mail_verify_expiretime = (isset($_POST['mail_verify_expiretime']) ? esc_html(stripslashes($_POST['mail_verify_expiretime'])) : '');
|
| 417 |
-
$send_to = '';
|
| 418 |
-
for ($i = 0; $i < 20; $i++) {
|
| 419 |
-
if (isset($_POST['send_to' . $i])) {
|
| 420 |
-
$send_to .= '*' . esc_html(stripslashes($_POST['send_to' . $i])) . '*';
|
| 421 |
-
}
|
| 422 |
-
}
|
| 423 |
-
if (isset($_POST['submit_text_type'])) {
|
| 424 |
-
$submit_text_type = esc_html(stripslashes($_POST['submit_text_type']));
|
| 425 |
-
if ($submit_text_type == 5) {
|
| 426 |
-
$article_id = (isset($_POST['page_name']) ? esc_html(stripslashes($_POST['page_name'])) : 0);
|
| 427 |
-
}
|
| 428 |
-
else {
|
| 429 |
-
$article_id = (isset($_POST['post_name']) ? esc_html(stripslashes($_POST['post_name'])) : 0);
|
| 430 |
-
}
|
| 431 |
-
}
|
| 432 |
-
else {
|
| 433 |
-
$submit_text_type = 0;
|
| 434 |
-
$article_id = 0;
|
| 435 |
-
}
|
| 436 |
-
|
| 437 |
-
$mail_verification_post_id = (int)$wpdb->get_var('SELECT mail_verification_post_id FROM ' . $wpdb->prefix . 'formmaker WHERE mail_verification_post_id!=0');
|
| 438 |
-
if($mail_verify) {
|
| 439 |
-
$email_verification_post = array(
|
| 440 |
-
'post_title' => 'Email Verification',
|
| 441 |
-
'post_content' => '[email_verification]',
|
| 442 |
-
'post_status' => 'publish',
|
| 443 |
-
'post_author' => 1,
|
| 444 |
-
'post_type' => 'fmemailverification',
|
| 445 |
-
);
|
| 446 |
-
|
| 447 |
-
if(!$mail_verification_post_id || get_post( $mail_verification_post_id )===NULL)
|
| 448 |
-
$mail_verification_post_id = wp_insert_post( $email_verification_post );
|
| 449 |
-
}
|
| 450 |
-
|
| 451 |
-
$save = $wpdb->update($wpdb->prefix . 'formmaker', array(
|
| 452 |
-
'published' => $published,
|
| 453 |
-
'savedb' => $savedb,
|
| 454 |
-
'theme' => $theme,
|
| 455 |
-
'requiredmark' => $requiredmark,
|
| 456 |
-
'sendemail' => $sendemail,
|
| 457 |
-
'save_uploads' => $save_uploads,
|
| 458 |
-
'mail' => $mail,
|
| 459 |
-
'from_mail' => $from_mail,
|
| 460 |
-
'from_name' => $from_name,
|
| 461 |
-
'reply_to' => $reply_to,
|
| 462 |
-
'script_mail' => $script_mail,
|
| 463 |
-
'mail_from_user' => $mail_from_user,
|
| 464 |
-
'mail_from_name_user' => $mail_from_name_user,
|
| 465 |
-
'reply_to_user' => $reply_to_user,
|
| 466 |
-
'condition' => $condition,
|
| 467 |
-
'mail_cc' => $mail_cc,
|
| 468 |
-
'mail_cc_user' => $mail_cc_user,
|
| 469 |
-
'mail_bcc' => $mail_bcc,
|
| 470 |
-
'mail_bcc_user' => $mail_bcc_user,
|
| 471 |
-
'mail_subject' => $mail_subject,
|
| 472 |
-
'mail_subject_user' => $mail_subject_user,
|
| 473 |
-
'mail_mode' => $mail_mode,
|
| 474 |
-
'mail_mode_user' => $mail_mode_user,
|
| 475 |
-
'mail_attachment' => $mail_attachment,
|
| 476 |
-
'mail_attachment_user' => $mail_attachment_user,
|
| 477 |
-
'script_mail_user' => $script_mail_user,
|
| 478 |
-
'submit_text' => $submit_text,
|
| 479 |
-
'url' => $url,
|
| 480 |
-
'submit_text_type' => $submit_text_type,
|
| 481 |
-
'article_id' => $article_id,
|
| 482 |
-
'tax' => $tax,
|
| 483 |
-
'payment_currency' => $payment_currency,
|
| 484 |
-
'paypal_email' => $paypal_email,
|
| 485 |
-
'checkout_mode' => $checkout_mode,
|
| 486 |
-
'paypal_mode' => $paypal_mode,
|
| 487 |
-
'javascript' => $javascript,
|
| 488 |
-
'user_id_wd' => $user_id_wd,
|
| 489 |
-
'send_to' => $send_to,
|
| 490 |
-
'frontend_submit_fields' => $frontend_submit_fields,
|
| 491 |
-
'frontend_submit_stat_fields' => $frontend_submit_stat_fields,
|
| 492 |
-
'mail_emptyfields' => $mail_emptyfields,
|
| 493 |
-
'mail_verify' => $mail_verify,
|
| 494 |
-
'mail_verify_expiretime' => $mail_verify_expiretime,
|
| 495 |
-
'mail_verification_post_id' => $mail_verification_post_id,
|
| 496 |
-
), array('id' => $id));
|
| 497 |
-
if ($save !== FALSE) {
|
| 498 |
-
$save_theme_in_backup = $wpdb->update($wpdb->prefix . 'formmaker_backup', array(
|
| 499 |
-
'theme' => $theme
|
| 500 |
-
), array('id' => $id));
|
| 501 |
-
return 8;
|
| 502 |
-
}
|
| 503 |
-
else {
|
| 504 |
-
return 2;
|
| 505 |
-
}
|
| 506 |
-
}
|
| 507 |
-
|
| 508 |
-
public function save_as_copy_old() {
|
| 509 |
-
$message = $this->save_db_as_copy_old();
|
| 510 |
-
// $this->display();
|
| 511 |
-
$page = WDW_FMC_Library::get('page');
|
| 512 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 513 |
-
}
|
| 514 |
-
|
| 515 |
-
public function save_old() {
|
| 516 |
-
$message = $this->save_db_old();
|
| 517 |
-
// $this->display();
|
| 518 |
-
$page = WDW_FMC_Library::get('page');
|
| 519 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 520 |
-
}
|
| 521 |
-
|
| 522 |
-
public function apply_old() {
|
| 523 |
-
global $wpdb;
|
| 524 |
-
$message = $this->save_db_old();
|
| 525 |
-
// $this->edit_old();
|
| 526 |
-
$id = (int) $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
|
| 527 |
-
$current_id = (int)WDW_FMC_Library::get('current_id', $id);
|
| 528 |
-
$page = WDW_FMC_Library::get('page');
|
| 529 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit_old', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
|
| 530 |
-
}
|
| 531 |
-
|
| 532 |
-
public function save_db_old() {
|
| 533 |
-
global $wpdb;
|
| 534 |
-
// $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
|
| 535 |
-
$id = (int)WDW_FMC_Library::get('current_id', 0);
|
| 536 |
-
$title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
|
| 537 |
-
$form = (isset($_POST['form']) ? stripslashes($_POST['form']) : '');
|
| 538 |
-
$form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
|
| 539 |
-
$counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
|
| 540 |
-
$label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
|
| 541 |
-
$label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
|
| 542 |
-
$pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
|
| 543 |
-
$show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
|
| 544 |
-
$show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
|
| 545 |
-
$public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
|
| 546 |
-
$private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
|
| 547 |
-
$recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
|
| 548 |
-
|
| 549 |
-
$save = $wpdb->update($wpdb->prefix . 'formmaker', array(
|
| 550 |
-
'title' => $title,
|
| 551 |
-
'form' => $form,
|
| 552 |
-
'form_front' => $form_front,
|
| 553 |
-
'counter' => $counter,
|
| 554 |
-
'label_order' => $label_order,
|
| 555 |
-
'label_order_current' => $label_order_current,
|
| 556 |
-
'pagination' => $pagination,
|
| 557 |
-
'show_title' => $show_title,
|
| 558 |
-
'show_numbers' => $show_numbers,
|
| 559 |
-
'public_key' => $public_key,
|
| 560 |
-
'private_key' => $private_key,
|
| 561 |
-
'recaptcha_theme' => $recaptcha_theme,
|
| 562 |
-
), array('id' => $id));
|
| 563 |
-
if ($save !== FALSE) {
|
| 564 |
-
return 1;
|
| 565 |
-
}
|
| 566 |
-
else {
|
| 567 |
-
return 2;
|
| 568 |
-
}
|
| 569 |
-
}
|
| 570 |
-
|
| 571 |
-
public function save_db_as_copy_old() {
|
| 572 |
-
global $wpdb;
|
| 573 |
-
// $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
|
| 574 |
-
$id = (int)WDW_FMC_Library::get('current_id', 0);
|
| 575 |
-
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
|
| 576 |
-
$title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
|
| 577 |
-
$form = (isset($_POST['form']) ? stripslashes($_POST['form']) : '');
|
| 578 |
-
$form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
|
| 579 |
-
$counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
|
| 580 |
-
$label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
|
| 581 |
-
$pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
|
| 582 |
-
$show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
|
| 583 |
-
$show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
|
| 584 |
-
$public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
|
| 585 |
-
$private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
|
| 586 |
-
$recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
|
| 587 |
-
|
| 588 |
-
$save = $wpdb->insert($wpdb->prefix . 'formmaker', array(
|
| 589 |
-
'title' => $title,
|
| 590 |
-
'mail' => $row->mail,
|
| 591 |
-
'form' => $form,
|
| 592 |
-
'form_front' => $form_front,
|
| 593 |
-
'theme' => $row->theme,
|
| 594 |
-
'counter' => $counter,
|
| 595 |
-
'label_order' => $label_order,
|
| 596 |
-
'pagination' => $pagination,
|
| 597 |
-
'show_title' => $show_title,
|
| 598 |
-
'show_numbers' => $show_numbers,
|
| 599 |
-
'public_key' => $public_key,
|
| 600 |
-
'private_key' => $private_key,
|
| 601 |
-
'recaptcha_theme' => $recaptcha_theme,
|
| 602 |
-
'javascript' => $row->javascript,
|
| 603 |
-
'script1' => $row->script1,
|
| 604 |
-
'script2' => $row->script2,
|
| 605 |
-
'script_user1' => $row->script_user1,
|
| 606 |
-
'script_user2' => $row->script_user2,
|
| 607 |
-
'submit_text' => $row->submit_text,
|
| 608 |
-
'url' => $row->url,
|
| 609 |
-
'article_id' => $row->article_id,
|
| 610 |
-
'submit_text_type' => $row->submit_text_type,
|
| 611 |
-
'script_mail' => $row->script_mail,
|
| 612 |
-
'script_mail_user' => $row->script_mail_user,
|
| 613 |
-
'paypal_mode' => $row->paypal_mode,
|
| 614 |
-
'checkout_mode' => $row->checkout_mode,
|
| 615 |
-
'paypal_email' => $row->paypal_email,
|
| 616 |
-
'payment_currency' => $row->payment_currency,
|
| 617 |
-
'tax' => $row->tax,
|
| 618 |
-
'label_order_current' => $row->label_order_current,
|
| 619 |
-
'from_mail' => $row->from_mail,
|
| 620 |
-
'from_name' => $row->from_name,
|
| 621 |
-
'reply_to_user' => $row->reply_to_user,
|
| 622 |
-
'mail_from_name_user' => $row->mail_from_name_user,
|
| 623 |
-
'mail_from_user' => $row->mail_from_user,
|
| 624 |
-
'custom_front' => $row->custom_front,
|
| 625 |
-
'autogen_layout' => $row->autogen_layout,
|
| 626 |
-
'send_to' => $row->send_to,
|
| 627 |
-
'reply_to' => $row->reply_to,
|
| 628 |
-
'requiredmark' => $row->requiredmark,
|
| 629 |
-
'sendemail' => $row->sendemail,
|
| 630 |
-
'savedb' => $row->savedb,
|
| 631 |
-
'form_fields' => $row->form_fields,
|
| 632 |
-
'published' => $row->published,
|
| 633 |
-
'save_uploads' => $row->save_uploads
|
| 634 |
-
), array(
|
| 635 |
-
'%s',
|
| 636 |
-
'%s',
|
| 637 |
-
'%s',
|
| 638 |
-
'%s',
|
| 639 |
-
'%d',
|
| 640 |
-
'%d',
|
| 641 |
-
'%s',
|
| 642 |
-
'%s',
|
| 643 |
-
'%s',
|
| 644 |
-
'%s',
|
| 645 |
-
'%s',
|
| 646 |
-
'%s',
|
| 647 |
-
'%s',
|
| 648 |
-
'%s',
|
| 649 |
-
'%s',
|
| 650 |
-
'%s',
|
| 651 |
-
'%s',
|
| 652 |
-
'%s',
|
| 653 |
-
'%s',
|
| 654 |
-
'%s',
|
| 655 |
-
'%s',
|
| 656 |
-
'%d',
|
| 657 |
-
'%s',
|
| 658 |
-
'%s',
|
| 659 |
-
'%d',
|
| 660 |
-
'%s',
|
| 661 |
-
'%s',
|
| 662 |
-
'%s',
|
| 663 |
-
'%s',
|
| 664 |
-
'%s',
|
| 665 |
-
'%s',
|
| 666 |
-
'%s',
|
| 667 |
-
'%s',
|
| 668 |
-
'%s',
|
| 669 |
-
'%s',
|
| 670 |
-
'%s',
|
| 671 |
-
'%d',
|
| 672 |
-
'%s',
|
| 673 |
-
'%s',
|
| 674 |
-
'%s',
|
| 675 |
-
'%d',
|
| 676 |
-
'%d',
|
| 677 |
-
'%s',
|
| 678 |
-
'%d'
|
| 679 |
-
));
|
| 680 |
-
$id = (int)$wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
|
| 681 |
-
update_option('contact_form_forms', ((get_option('contact_form_forms')) ? (get_option('contact_form_forms')) . ',' . $id : $id));
|
| 682 |
-
$wpdb->insert($wpdb->prefix . 'formmaker_views', array(
|
| 683 |
-
'form_id' => $id,
|
| 684 |
-
'views' => 0
|
| 685 |
-
), array(
|
| 686 |
-
'%d',
|
| 687 |
-
'%d'
|
| 688 |
-
));
|
| 689 |
-
if ($save !== FALSE) {
|
| 690 |
-
return 1;
|
| 691 |
-
}
|
| 692 |
-
else {
|
| 693 |
-
return 2;
|
| 694 |
-
}
|
| 695 |
-
}
|
| 696 |
-
|
| 697 |
-
public function save_as_copy() {
|
| 698 |
-
$message = $this->save_db_as_copy();
|
| 699 |
-
// $this->display();
|
| 700 |
-
$page = WDW_FMC_Library::get('page');
|
| 701 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 702 |
-
}
|
| 703 |
-
|
| 704 |
-
public function save() {
|
| 705 |
-
$message = $this->save_db();
|
| 706 |
-
// $this->display();
|
| 707 |
-
$page = WDW_FMC_Library::get('page');
|
| 708 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 709 |
-
}
|
| 710 |
-
|
| 711 |
-
public function apply() {
|
| 712 |
-
$message = $this->save_db();
|
| 713 |
-
// $this->edit();
|
| 714 |
-
global $wpdb;
|
| 715 |
-
$id = (int) $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
|
| 716 |
-
$current_id = (int)WDW_FMC_Library::get('current_id', $id);
|
| 717 |
-
$page = WDW_FMC_Library::get('page');
|
| 718 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
|
| 719 |
-
}
|
| 720 |
-
|
| 721 |
-
public function save_db() {
|
| 722 |
-
global $wpdb;
|
| 723 |
-
$javascript = "// before form is load
|
| 724 |
-
function before_load() {
|
| 725 |
-
}
|
| 726 |
-
// before form submit
|
| 727 |
-
function before_submit() {
|
| 728 |
-
}
|
| 729 |
-
// before form reset
|
| 730 |
-
function before_reset() {
|
| 731 |
-
}";
|
| 732 |
-
$id = (int)WDW_FMC_Library::get('current_id', 0);
|
| 733 |
-
$title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
|
| 734 |
-
$theme = (isset($_POST['theme']) ? esc_html(stripslashes($_POST['theme'])) : $wpdb->get_var("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE `default`='1'"));
|
| 735 |
-
$form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
|
| 736 |
-
$sortable = (isset($_POST['sortable']) ? stripslashes($_POST['sortable']) : 1);
|
| 737 |
-
$counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
|
| 738 |
-
$label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
|
| 739 |
-
$pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
|
| 740 |
-
$show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
|
| 741 |
-
$show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
|
| 742 |
-
$public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
|
| 743 |
-
$private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
|
| 744 |
-
$recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
|
| 745 |
-
$label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
|
| 746 |
-
$form_fields = (isset($_POST['form_fields']) ? stripslashes($_POST['form_fields']) : '');
|
| 747 |
-
if ($id != 0) {
|
| 748 |
-
$save = $wpdb->update($wpdb->prefix . 'formmaker', array(
|
| 749 |
-
'title' => $title,
|
| 750 |
-
'theme' => $theme,
|
| 751 |
-
'form_front' => $form_front,
|
| 752 |
-
'sortable' => $sortable,
|
| 753 |
-
'counter' => $counter,
|
| 754 |
-
'label_order' => $label_order,
|
| 755 |
-
'label_order_current' => $label_order_current,
|
| 756 |
-
'pagination' => $pagination,
|
| 757 |
-
'show_title' => $show_title,
|
| 758 |
-
'show_numbers' => $show_numbers,
|
| 759 |
-
'public_key' => $public_key,
|
| 760 |
-
'private_key' => $private_key,
|
| 761 |
-
'recaptcha_theme' => $recaptcha_theme,
|
| 762 |
-
'form_fields' => $form_fields,
|
| 763 |
-
), array('id' => $id));
|
| 764 |
-
}
|
| 765 |
-
else {
|
| 766 |
-
$save = $wpdb->insert($wpdb->prefix . 'formmaker', array(
|
| 767 |
-
'title' => $title,
|
| 768 |
-
'mail' => '',
|
| 769 |
-
'form_front' => $form_front,
|
| 770 |
-
'theme' => $theme,
|
| 771 |
-
'counter' => $counter,
|
| 772 |
-
'label_order' => $label_order,
|
| 773 |
-
'pagination' => $pagination,
|
| 774 |
-
'show_title' => $show_title,
|
| 775 |
-
'show_numbers' => $show_numbers,
|
| 776 |
-
'public_key' => $public_key,
|
| 777 |
-
'private_key' => $private_key,
|
| 778 |
-
'recaptcha_theme' => $recaptcha_theme,
|
| 779 |
-
'javascript' => $javascript,
|
| 780 |
-
'submit_text' => '',
|
| 781 |
-
'url' => '',
|
| 782 |
-
'article_id' => 0,
|
| 783 |
-
'submit_text_type' => 0,
|
| 784 |
-
'script_mail' => '%all%',
|
| 785 |
-
'script_mail_user' => '%all%',
|
| 786 |
-
'label_order_current' => $label_order_current,
|
| 787 |
-
'tax' => 0,
|
| 788 |
-
'payment_currency' => '',
|
| 789 |
-
'paypal_email' => '',
|
| 790 |
-
'checkout_mode' => 'testmode',
|
| 791 |
-
'paypal_mode' => 0,
|
| 792 |
-
'published' => 1,
|
| 793 |
-
'form_fields' => $form_fields,
|
| 794 |
-
'savedb' => 1,
|
| 795 |
-
'sendemail' => 1,
|
| 796 |
-
'requiredmark' => '*',
|
| 797 |
-
'from_mail' => '',
|
| 798 |
-
'from_name' => '',
|
| 799 |
-
'reply_to' => '',
|
| 800 |
-
'send_to' => '',
|
| 801 |
-
'autogen_layout' => 1,
|
| 802 |
-
'custom_front' => '',
|
| 803 |
-
'mail_from_user' => '',
|
| 804 |
-
'mail_from_name_user' => '',
|
| 805 |
-
'reply_to_user' => '',
|
| 806 |
-
'condition' => '',
|
| 807 |
-
'mail_cc' => '',
|
| 808 |
-
'mail_cc_user' => '',
|
| 809 |
-
'mail_bcc' => '',
|
| 810 |
-
'mail_bcc_user' => '',
|
| 811 |
-
'mail_subject' => '',
|
| 812 |
-
'mail_subject_user' => '',
|
| 813 |
-
'mail_mode' => 1,
|
| 814 |
-
'mail_mode_user' => 1,
|
| 815 |
-
'mail_attachment' => 1,
|
| 816 |
-
'mail_attachment_user' => 1,
|
| 817 |
-
'sortable' => $sortable,
|
| 818 |
-
'user_id_wd' => 'administrator,',
|
| 819 |
-
'frontend_submit_fields' => '',
|
| 820 |
-
'frontend_submit_stat_fields' => '',
|
| 821 |
-
'save_uploads' => 1,
|
| 822 |
-
), array(
|
| 823 |
-
'%s',
|
| 824 |
-
'%s',
|
| 825 |
-
'%s',
|
| 826 |
-
'%d',
|
| 827 |
-
'%d',
|
| 828 |
-
'%s',
|
| 829 |
-
'%s',
|
| 830 |
-
'%s',
|
| 831 |
-
'%s',
|
| 832 |
-
'%s',
|
| 833 |
-
'%s',
|
| 834 |
-
'%s',
|
| 835 |
-
'%s',
|
| 836 |
-
'%s',
|
| 837 |
-
'%s',
|
| 838 |
-
'%d',
|
| 839 |
-
'%d',
|
| 840 |
-
'%s',
|
| 841 |
-
'%s',
|
| 842 |
-
'%s',
|
| 843 |
-
'%s',
|
| 844 |
-
'%s',
|
| 845 |
-
'%s',
|
| 846 |
-
'%s',
|
| 847 |
-
'%d',
|
| 848 |
-
'%d',
|
| 849 |
-
'%s',
|
| 850 |
-
'%d',
|
| 851 |
-
'%d',
|
| 852 |
-
'%s',
|
| 853 |
-
'%s',
|
| 854 |
-
'%s',
|
| 855 |
-
'%s',
|
| 856 |
-
'%s',
|
| 857 |
-
'%d',
|
| 858 |
-
'%s',
|
| 859 |
-
'%s',
|
| 860 |
-
'%s',
|
| 861 |
-
'%s',
|
| 862 |
-
'%s',
|
| 863 |
-
'%s',
|
| 864 |
-
'%s',
|
| 865 |
-
'%s',
|
| 866 |
-
'%s',
|
| 867 |
-
'%s',
|
| 868 |
-
'%s',
|
| 869 |
-
'%d',
|
| 870 |
-
'%d',
|
| 871 |
-
'%d',
|
| 872 |
-
'%d',
|
| 873 |
-
'%d',
|
| 874 |
-
'%s',
|
| 875 |
-
'%s',
|
| 876 |
-
'%s',
|
| 877 |
-
'%d',
|
| 878 |
-
));
|
| 879 |
-
$id = (int)$wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
|
| 880 |
-
update_option('contact_form_forms', ((get_option('contact_form_forms')) ? (get_option('contact_form_forms')) . ',' . $id : $id));
|
| 881 |
-
// $_POST['current_id'] = $id;
|
| 882 |
-
$wpdb->insert($wpdb->prefix . 'formmaker_views', array(
|
| 883 |
-
'form_id' => $id,
|
| 884 |
-
'views' => 0
|
| 885 |
-
), array(
|
| 886 |
-
'%d',
|
| 887 |
-
'%d'
|
| 888 |
-
));
|
| 889 |
-
}
|
| 890 |
-
|
| 891 |
-
$backup_id = (isset($_POST['backup_id']) ? (int)esc_html(stripslashes($_POST['backup_id'])) : '');
|
| 892 |
-
|
| 893 |
-
if($backup_id)
|
| 894 |
-
{
|
| 895 |
-
$query = "SELECT backup_id FROM ".$wpdb->prefix."formmaker_backup WHERE backup_id > ".$backup_id." AND id = ".$id." ORDER BY backup_id ASC LIMIT 0 , 1 ";
|
| 896 |
-
|
| 897 |
-
if($wpdb->get_var($query))
|
| 898 |
-
{
|
| 899 |
-
$query = "DELETE FROM ".$wpdb->prefix."formmaker_backup WHERE backup_id > ".$backup_id." AND id = ".$id;
|
| 900 |
-
$wpdb->query($query);
|
| 901 |
-
}
|
| 902 |
-
|
| 903 |
-
$row = $wpdb->get_row($wpdb->prepare("SELECT form_fields, form_front FROM ".$wpdb->prefix."formmaker_backup WHERE backup_id = '%d'", $backup_id));
|
| 904 |
-
|
| 905 |
-
if($row->form_fields==$form_fields and $row->form_front==$form_front)
|
| 906 |
-
{
|
| 907 |
-
$save = $wpdb->update($wpdb->prefix . 'formmaker_backup', array(
|
| 908 |
-
'cur' => 1,
|
| 909 |
-
'title' => $title,
|
| 910 |
-
'theme' => $theme,
|
| 911 |
-
'form_front' => $form_front,
|
| 912 |
-
'sortable' => $sortable,
|
| 913 |
-
'counter' => $counter,
|
| 914 |
-
'label_order' => $label_order,
|
| 915 |
-
'label_order_current' => $label_order_current,
|
| 916 |
-
'pagination' => $pagination,
|
| 917 |
-
'show_title' => $show_title,
|
| 918 |
-
'show_numbers' => $show_numbers,
|
| 919 |
-
'public_key' => $public_key,
|
| 920 |
-
'private_key' => $private_key,
|
| 921 |
-
'recaptcha_theme' => $recaptcha_theme,
|
| 922 |
-
'form_fields' => $form_fields,
|
| 923 |
-
), array('backup_id' => $backup_id));
|
| 924 |
-
|
| 925 |
-
|
| 926 |
-
if ($save !== FALSE) {
|
| 927 |
-
return 1;
|
| 928 |
-
}
|
| 929 |
-
else {
|
| 930 |
-
return 2;
|
| 931 |
-
}
|
| 932 |
-
}
|
| 933 |
-
}
|
| 934 |
-
|
| 935 |
-
$wpdb->query("UPDATE ".$wpdb->prefix."formmaker_backup SET cur=0 WHERE id=".$id );
|
| 936 |
-
|
| 937 |
-
$save = $wpdb->insert($wpdb->prefix . 'formmaker_backup', array(
|
| 938 |
-
'cur' => 1,
|
| 939 |
-
'id' => $id,
|
| 940 |
-
'title' => $title,
|
| 941 |
-
'mail' => '',
|
| 942 |
-
'form_front' => $form_front,
|
| 943 |
-
'theme' => $theme,
|
| 944 |
-
'counter' => $counter,
|
| 945 |
-
'label_order' => $label_order,
|
| 946 |
-
'pagination' => $pagination,
|
| 947 |
-
'show_title' => $show_title,
|
| 948 |
-
'show_numbers' => $show_numbers,
|
| 949 |
-
'public_key' => $public_key,
|
| 950 |
-
'private_key' => $private_key,
|
| 951 |
-
'recaptcha_theme' => $recaptcha_theme,
|
| 952 |
-
'javascript' => $javascript,
|
| 953 |
-
'submit_text' => '',
|
| 954 |
-
'url' => '',
|
| 955 |
-
'article_id' => 0,
|
| 956 |
-
'submit_text_type' => 0,
|
| 957 |
-
'script_mail' => '%all%',
|
| 958 |
-
'script_mail_user' => '%all%',
|
| 959 |
-
'label_order_current' => $label_order_current,
|
| 960 |
-
'tax' => 0,
|
| 961 |
-
'payment_currency' => '',
|
| 962 |
-
'paypal_email' => '',
|
| 963 |
-
'checkout_mode' => 'testmode',
|
| 964 |
-
'paypal_mode' => 0,
|
| 965 |
-
'published' => 1,
|
| 966 |
-
'form_fields' => $form_fields,
|
| 967 |
-
'savedb' => 1,
|
| 968 |
-
'sendemail' => 1,
|
| 969 |
-
'requiredmark' => '*',
|
| 970 |
-
'from_mail' => '',
|
| 971 |
-
'from_name' => '',
|
| 972 |
-
'reply_to' => '',
|
| 973 |
-
'send_to' => '',
|
| 974 |
-
'autogen_layout' => 1,
|
| 975 |
-
'custom_front' => '',
|
| 976 |
-
'mail_from_user' => '',
|
| 977 |
-
'mail_from_name_user' => '',
|
| 978 |
-
'reply_to_user' => '',
|
| 979 |
-
'condition' => '',
|
| 980 |
-
'mail_cc' => '',
|
| 981 |
-
'mail_cc_user' => '',
|
| 982 |
-
'mail_bcc' => '',
|
| 983 |
-
'mail_bcc_user' => '',
|
| 984 |
-
'mail_subject' => '',
|
| 985 |
-
'mail_subject_user' => '',
|
| 986 |
-
'mail_mode' => 1,
|
| 987 |
-
'mail_mode_user' => 1,
|
| 988 |
-
'mail_attachment' => 1,
|
| 989 |
-
'mail_attachment_user' => 1,
|
| 990 |
-
'sortable' => $sortable,
|
| 991 |
-
'user_id_wd' => 'administrator,',
|
| 992 |
-
'frontend_submit_fields' => '',
|
| 993 |
-
'frontend_submit_stat_fields' => '',
|
| 994 |
-
), array(
|
| 995 |
-
'%d',
|
| 996 |
-
'%d',
|
| 997 |
-
'%s',
|
| 998 |
-
'%s',
|
| 999 |
-
'%s',
|
| 1000 |
-
'%d',
|
| 1001 |
-
'%d',
|
| 1002 |
-
'%s',
|
| 1003 |
-
'%s',
|
| 1004 |
-
'%s',
|
| 1005 |
-
'%s',
|
| 1006 |
-
'%s',
|
| 1007 |
-
'%s',
|
| 1008 |
-
'%s',
|
| 1009 |
-
'%s',
|
| 1010 |
-
'%s',
|
| 1011 |
-
'%s',
|
| 1012 |
-
'%d',
|
| 1013 |
-
'%d',
|
| 1014 |
-
'%s',
|
| 1015 |
-
'%s',
|
| 1016 |
-
'%s',
|
| 1017 |
-
'%s',
|
| 1018 |
-
'%s',
|
| 1019 |
-
'%s',
|
| 1020 |
-
'%s',
|
| 1021 |
-
'%d',
|
| 1022 |
-
'%d',
|
| 1023 |
-
'%s',
|
| 1024 |
-
'%d',
|
| 1025 |
-
'%d',
|
| 1026 |
-
'%s',
|
| 1027 |
-
'%s',
|
| 1028 |
-
'%s',
|
| 1029 |
-
'%s',
|
| 1030 |
-
'%s',
|
| 1031 |
-
'%d',
|
| 1032 |
-
'%s',
|
| 1033 |
-
'%s',
|
| 1034 |
-
'%s',
|
| 1035 |
-
'%s',
|
| 1036 |
-
'%s',
|
| 1037 |
-
'%s',
|
| 1038 |
-
'%s',
|
| 1039 |
-
'%s',
|
| 1040 |
-
'%s',
|
| 1041 |
-
'%s',
|
| 1042 |
-
'%s',
|
| 1043 |
-
'%d',
|
| 1044 |
-
'%d',
|
| 1045 |
-
'%d',
|
| 1046 |
-
'%d',
|
| 1047 |
-
'%d',
|
| 1048 |
-
'%s',
|
| 1049 |
-
'%s',
|
| 1050 |
-
'%s',
|
| 1051 |
-
)) ;
|
| 1052 |
-
|
| 1053 |
-
$query = "SELECT count(backup_id) FROM ".$wpdb->prefix."formmaker_backup WHERE id = ".$id;
|
| 1054 |
-
$wpdb->get_var($query);
|
| 1055 |
-
if($wpdb->get_var($query)>10)
|
| 1056 |
-
{
|
| 1057 |
-
$query = "DELETE FROM ".$wpdb->prefix."formmaker_backup WHERE id = ".$id." ORDER BY backup_id ASC LIMIT 1 ";
|
| 1058 |
-
$wpdb->query($query);
|
| 1059 |
-
}
|
| 1060 |
-
|
| 1061 |
-
if ($save !== FALSE) {
|
| 1062 |
-
return 1;
|
| 1063 |
-
}
|
| 1064 |
-
else {
|
| 1065 |
-
return 2;
|
| 1066 |
-
}
|
| 1067 |
-
}
|
| 1068 |
-
|
| 1069 |
-
public function save_db_as_copy() {
|
| 1070 |
-
global $wpdb;
|
| 1071 |
-
// $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
|
| 1072 |
-
$id = (int)WDW_FMC_Library::get('current_id', 0);
|
| 1073 |
-
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
|
| 1074 |
-
$title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
|
| 1075 |
-
$form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
|
| 1076 |
-
$sortable = (isset($_POST['sortable']) ? stripslashes($_POST['sortable']) : 1);
|
| 1077 |
-
$counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
|
| 1078 |
-
$label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
|
| 1079 |
-
$label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
|
| 1080 |
-
$pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
|
| 1081 |
-
$show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
|
| 1082 |
-
$show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
|
| 1083 |
-
$public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
|
| 1084 |
-
$private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
|
| 1085 |
-
$recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
|
| 1086 |
-
$form_fields = (isset($_POST['form_fields']) ? stripslashes($_POST['form_fields']) : '');
|
| 1087 |
-
|
| 1088 |
-
$save = $wpdb->insert($wpdb->prefix . 'formmaker', array(
|
| 1089 |
-
'title' => $title,
|
| 1090 |
-
'mail' => $row->mail,
|
| 1091 |
-
'form_front' => $form_front,
|
| 1092 |
-
'theme' => $row->theme,
|
| 1093 |
-
'counter' => $counter,
|
| 1094 |
-
'label_order' => $label_order,
|
| 1095 |
-
'pagination' => $pagination,
|
| 1096 |
-
'show_title' => $show_title,
|
| 1097 |
-
'show_numbers' => $show_numbers,
|
| 1098 |
-
'public_key' => $public_key,
|
| 1099 |
-
'private_key' => $private_key,
|
| 1100 |
-
'recaptcha_theme' => $recaptcha_theme,
|
| 1101 |
-
'javascript' => $row->javascript,
|
| 1102 |
-
'submit_text' => $row->submit_text,
|
| 1103 |
-
'url' => $row->url,
|
| 1104 |
-
'article_id' => $row->article_id,
|
| 1105 |
-
'submit_text_type' => $row->submit_text_type,
|
| 1106 |
-
'script_mail' => $row->script_mail,
|
| 1107 |
-
'script_mail_user' => $row->script_mail_user,
|
| 1108 |
-
'label_order_current' => $label_order_current,
|
| 1109 |
-
'tax' => $row->tax,
|
| 1110 |
-
'payment_currency' => $row->payment_currency,
|
| 1111 |
-
'paypal_email' => $row->paypal_email,
|
| 1112 |
-
'checkout_mode' => $row->checkout_mode,
|
| 1113 |
-
'paypal_mode' => $row->paypal_mode,
|
| 1114 |
-
'published' => $row->published,
|
| 1115 |
-
'form_fields' => $form_fields,
|
| 1116 |
-
'savedb' => $row->savedb,
|
| 1117 |
-
'sendemail' => $row->sendemail,
|
| 1118 |
-
'requiredmark' => $row->requiredmark,
|
| 1119 |
-
'from_mail' => $row->from_mail,
|
| 1120 |
-
'from_name' => $row->from_name,
|
| 1121 |
-
'reply_to' => $row->reply_to,
|
| 1122 |
-
'send_to' => $row->send_to,
|
| 1123 |
-
'autogen_layout' => $row->autogen_layout,
|
| 1124 |
-
'custom_front' => $row->custom_front,
|
| 1125 |
-
'mail_from_user' => $row->mail_from_user,
|
| 1126 |
-
'mail_from_name_user' => $row->mail_from_name_user,
|
| 1127 |
-
'reply_to_user' => $row->reply_to_user,
|
| 1128 |
-
'condition' => $row->condition,
|
| 1129 |
-
'mail_cc' => $row->mail_cc,
|
| 1130 |
-
'mail_cc_user' => $row->mail_cc_user,
|
| 1131 |
-
'mail_bcc' => $row->mail_bcc,
|
| 1132 |
-
'mail_bcc_user' => $row->mail_bcc_user,
|
| 1133 |
-
'mail_subject' => $row->mail_subject,
|
| 1134 |
-
'mail_subject_user' => $row->mail_subject_user,
|
| 1135 |
-
'mail_mode' => $row->mail_mode,
|
| 1136 |
-
'mail_mode_user' => $row->mail_mode_user,
|
| 1137 |
-
'mail_attachment' => $row->mail_attachment,
|
| 1138 |
-
'mail_attachment_user' => $row->mail_attachment_user,
|
| 1139 |
-
'sortable' => $sortable,
|
| 1140 |
-
'user_id_wd' => $row->user_id_wd,
|
| 1141 |
-
'frontend_submit_fields' => $row->frontend_submit_fields,
|
| 1142 |
-
'frontend_submit_stat_fields' => $row->frontend_submit_stat_fields,
|
| 1143 |
-
'save_uploads' => $row->save_uploads,
|
| 1144 |
-
), array(
|
| 1145 |
-
'%s',
|
| 1146 |
-
'%s',
|
| 1147 |
-
'%s',
|
| 1148 |
-
'%d',
|
| 1149 |
-
'%d',
|
| 1150 |
-
'%s',
|
| 1151 |
-
'%s',
|
| 1152 |
-
'%s',
|
| 1153 |
-
'%s',
|
| 1154 |
-
'%s',
|
| 1155 |
-
'%s',
|
| 1156 |
-
'%s',
|
| 1157 |
-
'%s',
|
| 1158 |
-
'%s',
|
| 1159 |
-
'%s',
|
| 1160 |
-
'%d',
|
| 1161 |
-
'%d',
|
| 1162 |
-
'%s',
|
| 1163 |
-
'%s',
|
| 1164 |
-
'%s',
|
| 1165 |
-
'%s',
|
| 1166 |
-
'%s',
|
| 1167 |
-
'%s',
|
| 1168 |
-
'%s',
|
| 1169 |
-
'%d',
|
| 1170 |
-
'%d',
|
| 1171 |
-
'%s',
|
| 1172 |
-
'%d',
|
| 1173 |
-
'%d',
|
| 1174 |
-
'%s',
|
| 1175 |
-
'%s',
|
| 1176 |
-
'%s',
|
| 1177 |
-
'%s',
|
| 1178 |
-
'%s',
|
| 1179 |
-
'%d',
|
| 1180 |
-
'%s',
|
| 1181 |
-
'%s',
|
| 1182 |
-
'%s',
|
| 1183 |
-
'%s',
|
| 1184 |
-
'%s',
|
| 1185 |
-
'%s',
|
| 1186 |
-
'%s',
|
| 1187 |
-
'%s',
|
| 1188 |
-
'%s',
|
| 1189 |
-
'%s',
|
| 1190 |
-
'%s',
|
| 1191 |
-
'%d',
|
| 1192 |
-
'%d',
|
| 1193 |
-
'%d',
|
| 1194 |
-
'%d',
|
| 1195 |
-
'%d',
|
| 1196 |
-
'%s',
|
| 1197 |
-
'%s',
|
| 1198 |
-
'%s',
|
| 1199 |
-
'%d',
|
| 1200 |
-
));
|
| 1201 |
-
$new_id = (int)$wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
|
| 1202 |
-
update_option('contact_form_forms', ((get_option('contact_form_forms')) ? (get_option('contact_form_forms')) . ',' . $
|
| 1203 |
-
$wpdb->insert($wpdb->prefix . 'formmaker_views', array(
|
| 1204 |
-
'form_id' => $new_id,
|
| 1205 |
-
'views' => 0
|
| 1206 |
-
), array(
|
| 1207 |
-
'%d',
|
| 1208 |
-
'%d'
|
| 1209 |
-
));
|
| 1210 |
-
if ($save !== FALSE) {
|
| 1211 |
-
|
| 1212 |
-
return 1;
|
| 1213 |
-
}
|
| 1214 |
-
else {
|
| 1215 |
-
return 2;
|
| 1216 |
-
}
|
| 1217 |
-
}
|
| 1218 |
-
|
| 1219 |
-
public function delete($id) {
|
| 1220 |
-
global $wpdb;
|
| 1221 |
-
$query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id);
|
| 1222 |
-
if ($wpdb->query($query)) {
|
| 1223 |
-
$arr = explode(',', get_option('contact_form_forms'));
|
| 1224 |
-
$arr = array_diff($arr, array($id));
|
| 1225 |
-
$arr = implode(',', $arr);
|
| 1226 |
-
update_option('contact_form_forms', $arr);
|
| 1227 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="%d"', $id));
|
| 1228 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id="%d"', $id));
|
| 1229 |
-
|
| 1230 |
-
$message = 3;
|
| 1231 |
-
}
|
| 1232 |
-
else {
|
| 1233 |
-
$message = 2;
|
| 1234 |
-
}
|
| 1235 |
-
// $this->display();
|
| 1236 |
-
$page = WDW_FMC_Library::get('page');
|
| 1237 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 1238 |
-
}
|
| 1239 |
-
|
| 1240 |
-
public function delete_all() {
|
| 1241 |
-
global $wpdb;
|
| 1242 |
-
$flag = FALSE;
|
| 1243 |
-
$isDefault = FALSE;
|
| 1244 |
-
$form_ids_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker');
|
| 1245 |
-
foreach ($form_ids_col as $form_id) {
|
| 1246 |
-
if (isset($_POST['check_' . $form_id])) {
|
| 1247 |
-
$flag = TRUE;
|
| 1248 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $form_id));
|
| 1249 |
-
$arr = explode(',', get_option('contact_form_forms'));
|
| 1250 |
-
$arr = array_diff($arr, array($form_id));
|
| 1251 |
-
$arr = implode(',', $arr);
|
| 1252 |
-
update_option('contact_form_forms', $arr);
|
| 1253 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="%d"', $form_id));
|
| 1254 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id="%d"', $form_id));
|
| 1255 |
-
}
|
| 1256 |
-
}
|
| 1257 |
-
if ($flag) {
|
| 1258 |
-
$message = 5;
|
| 1259 |
-
}
|
| 1260 |
-
else {
|
| 1261 |
-
$message = 6;
|
| 1262 |
-
}
|
| 1263 |
-
// $this->display();
|
| 1264 |
-
$page = WDW_FMC_Library::get('page');
|
| 1265 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 1266 |
-
}
|
| 1267 |
-
|
| 1268 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 1269 |
-
// Getters & Setters //
|
| 1270 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 1271 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 1272 |
-
// Private Methods //
|
| 1273 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 1274 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 1275 |
-
// Listeners //
|
| 1276 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 1277 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMControllerManage_fmc {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 14 |
+
// Constructor & Destructor //
|
| 15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 16 |
+
public function __construct() {
|
| 17 |
+
}
|
| 18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
+
// Public Methods //
|
| 20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 21 |
+
public function execute() {
|
| 22 |
+
$task = WDW_FMC_Library::get('task');
|
| 23 |
+
$id = (int)WDW_FMC_Library::get('current_id', 0);
|
| 24 |
+
$message = WDW_FMC_Library::get('message');
|
| 25 |
+
echo WDW_FMC_Library::message_id($message);
|
| 26 |
+
if (method_exists($this, $task)) {
|
| 27 |
+
check_admin_referer('nonce_fmc', 'nonce_fmc');
|
| 28 |
+
$this->$task($id);
|
| 29 |
+
}
|
| 30 |
+
else {
|
| 31 |
+
$this->display();
|
| 32 |
+
}
|
| 33 |
+
}
|
| 34 |
+
public function undo()
|
| 35 |
+
{
|
| 36 |
+
require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
|
| 37 |
+
$model = new FMModelManage_fmc();
|
| 38 |
+
|
| 39 |
+
require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
|
| 40 |
+
|
| 41 |
+
global $wpdb;
|
| 42 |
+
$backup_id = (int)WDW_FMC_Library::get('backup_id');
|
| 43 |
+
$id = (int)WDW_FMC_Library::get('id');
|
| 44 |
+
|
| 45 |
+
$query = "SELECT backup_id FROM ".$wpdb->prefix."formmaker_backup WHERE backup_id < $backup_id AND id = $id ORDER BY backup_id DESC LIMIT 0 , 1 ";
|
| 46 |
+
$backup_id = $wpdb->get_var($query);
|
| 47 |
+
|
| 48 |
+
$view = new FMViewManage_fmc($model);
|
| 49 |
+
$view->edit($backup_id);
|
| 50 |
+
|
| 51 |
+
}
|
| 52 |
+
public function redo()
|
| 53 |
+
{
|
| 54 |
+
require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
|
| 55 |
+
$model = new FMModelManage_fmc();
|
| 56 |
+
|
| 57 |
+
require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
|
| 58 |
+
global $wpdb;
|
| 59 |
+
$backup_id = (int)WDW_FMC_Library::get('backup_id');
|
| 60 |
+
$id = (int)WDW_FMC_Library::get('id');
|
| 61 |
+
|
| 62 |
+
$query = "SELECT backup_id FROM ".$wpdb->prefix."formmaker_backup WHERE backup_id > $backup_id AND id = $id ORDER BY backup_id ASC LIMIT 0 , 1 ";
|
| 63 |
+
$backup_id = $wpdb->get_var($query);
|
| 64 |
+
|
| 65 |
+
$view = new FMViewManage_fmc($model);
|
| 66 |
+
$view->edit($backup_id);
|
| 67 |
+
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
public function display() {
|
| 72 |
+
require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
|
| 73 |
+
$model = new FMModelManage_fmc();
|
| 74 |
+
|
| 75 |
+
require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
|
| 76 |
+
$view = new FMViewManage_fmc($model);
|
| 77 |
+
$view->display();
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
+
public function add() {
|
| 81 |
+
require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
|
| 82 |
+
$model = new FMModelManage_fmc();
|
| 83 |
+
|
| 84 |
+
require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
|
| 85 |
+
$view = new FMViewManage_fmc($model);
|
| 86 |
+
$view->edit(0);
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
public function edit() {
|
| 90 |
+
require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
|
| 91 |
+
$model = new FMModelManage_fmc();
|
| 92 |
+
|
| 93 |
+
require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
|
| 94 |
+
$view = new FMViewManage_fmc($model);
|
| 95 |
+
$id = (int)WDW_FMC_Library::get('current_id', 0);
|
| 96 |
+
|
| 97 |
+
global $wpdb;
|
| 98 |
+
$query = "SELECT backup_id FROM ".$wpdb->prefix."formmaker_backup WHERE cur=1 and id=".$id;
|
| 99 |
+
$backup_id = $wpdb->get_var($query);
|
| 100 |
+
|
| 101 |
+
if(!$backup_id)
|
| 102 |
+
{
|
| 103 |
+
$query = "SELECT max(backup_id) FROM ".$wpdb->prefix."formmaker_backup";
|
| 104 |
+
$backup_id = $wpdb->get_var($query);
|
| 105 |
+
if($backup_id)
|
| 106 |
+
$backup_id++;
|
| 107 |
+
else
|
| 108 |
+
$backup_id=1;
|
| 109 |
+
$query = "INSERT INTO ".$wpdb->prefix."formmaker_backup SELECT ".$backup_id." AS backup_id, 1 AS cur, formmakerbkup.id, formmakerbkup.title, formmakerbkup.mail, formmakerbkup.form_front, formmakerbkup.theme, formmakerbkup.javascript, formmakerbkup.submit_text, formmakerbkup.url, formmakerbkup.submit_text_type, formmakerbkup.script_mail, formmakerbkup.script_mail_user, formmakerbkup.counter, formmakerbkup.published, formmakerbkup.label_order, formmakerbkup.label_order_current, formmakerbkup.article_id, formmakerbkup.pagination, formmakerbkup.show_title, formmakerbkup.show_numbers, formmakerbkup.public_key, formmakerbkup.private_key, formmakerbkup.recaptcha_theme, formmakerbkup.paypal_mode, formmakerbkup.checkout_mode, formmakerbkup.paypal_email, formmakerbkup.payment_currency, formmakerbkup.tax, formmakerbkup.form_fields, formmakerbkup.savedb, formmakerbkup.sendemail, formmakerbkup.requiredmark, formmakerbkup.from_mail, formmakerbkup.from_name, formmakerbkup.reply_to, formmakerbkup.send_to, formmakerbkup.autogen_layout, formmakerbkup.custom_front, formmakerbkup.mail_from_user, formmakerbkup.mail_from_name_user, formmakerbkup.reply_to_user, formmakerbkup.condition, formmakerbkup.mail_cc, formmakerbkup.mail_cc_user, formmakerbkup.mail_bcc, formmakerbkup.mail_bcc_user, formmakerbkup.mail_subject, formmakerbkup.mail_subject_user, formmakerbkup.mail_mode, formmakerbkup.mail_mode_user, formmakerbkup.mail_attachment, formmakerbkup.mail_attachment_user, formmakerbkup.user_id_wd, formmakerbkup.sortable, formmakerbkup.frontend_submit_fields, formmakerbkup.frontend_submit_stat_fields, formmakerbkup.mail_emptyfields, formmakerbkup.mail_verify, formmakerbkup.mail_verify_expiretime, formmakerbkup.mail_verification_post_id, formmakerbkup.save_uploads FROM ".$wpdb->prefix."formmaker as formmakerbkup WHERE id=".$id;
|
| 110 |
+
$wpdb->query($query);
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
$view->edit($backup_id);
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
public function edit_old() {
|
| 117 |
+
require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
|
| 118 |
+
$model = new FMModelManage_fmc();
|
| 119 |
+
|
| 120 |
+
require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
|
| 121 |
+
$view = new FMViewManage_fmc($model);
|
| 122 |
+
$id = (int)WDW_FMC_Library::get('current_id', 0);
|
| 123 |
+
$view->edit_old($id);
|
| 124 |
+
}
|
| 125 |
+
|
| 126 |
+
public function form_options_old() {
|
| 127 |
+
if (!isset($_GET['task'])) {
|
| 128 |
+
$this->save_db();
|
| 129 |
+
}
|
| 130 |
+
require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
|
| 131 |
+
$model = new FMModelManage_fmc();
|
| 132 |
+
|
| 133 |
+
require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
|
| 134 |
+
$view = new FMViewManage_fmc($model);
|
| 135 |
+
global $wpdb;
|
| 136 |
+
$id = (int)WDW_FMC_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
|
| 137 |
+
$view->form_options_old($id);
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
+
public function save_options_old() {
|
| 141 |
+
$message = $this->save_db_options_old();
|
| 142 |
+
// $this->edit_old();
|
| 143 |
+
$page = WDW_FMC_Library::get('page');
|
| 144 |
+
$current_id = (int)WDW_FMC_Library::get('current_id', 0);
|
| 145 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit_old', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
|
| 146 |
+
}
|
| 147 |
+
|
| 148 |
+
public function apply_options_old() {
|
| 149 |
+
$message = $this->save_db_options_old();
|
| 150 |
+
require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
|
| 151 |
+
$model = new FMModelManage_fmc();
|
| 152 |
+
|
| 153 |
+
require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
|
| 154 |
+
$view = new FMViewManage_fmc($model);
|
| 155 |
+
$page = WDW_FMC_Library::get('page');
|
| 156 |
+
$current_id = (int)WDW_FMC_Library::get('current_id', 0);
|
| 157 |
+
$fieldset_id = WDW_FMC_Library::get('fieldset_id', 'general');
|
| 158 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'form_options_old', 'current_id' => $current_id, 'message' => $message, 'fieldset_id' => $fieldset_id), admin_url('admin.php')));
|
| 159 |
+
}
|
| 160 |
+
|
| 161 |
+
public function save_db_options_old() {
|
| 162 |
+
$javascript = "// Before the form is loaded.
|
| 163 |
+
function before_load() {
|
| 164 |
+
|
| 165 |
+
}
|
| 166 |
+
// Before form submit.
|
| 167 |
+
function before_submit() {
|
| 168 |
+
|
| 169 |
+
}
|
| 170 |
+
// Before form reset.
|
| 171 |
+
function before_reset() {
|
| 172 |
+
|
| 173 |
+
}";
|
| 174 |
+
global $wpdb;
|
| 175 |
+
$id = (int)WDW_FMC_Library::get('current_id', 0);
|
| 176 |
+
$mail = (isset($_POST['mail']) ? esc_html(stripslashes($_POST['mail'])) : '');
|
| 177 |
+
$theme = (isset($_POST['theme']) ? (int)esc_html(stripslashes($_POST['theme'])) : 1);
|
| 178 |
+
$javascript = (isset($_POST['javascript']) ? stripslashes($_POST['javascript']) : $javascript);
|
| 179 |
+
$script1 = (isset($_POST['script1']) ? esc_html(stripslashes($_POST['script1'])) : '');
|
| 180 |
+
$script2 = (isset($_POST['script2']) ? esc_html(stripslashes($_POST['script2'])) : '');
|
| 181 |
+
$script_user1 = (isset($_POST['script_user1']) ? esc_html(stripslashes($_POST['script_user1'])) : '');
|
| 182 |
+
$script_user2 = (isset($_POST['script_user2']) ? esc_html(stripslashes($_POST['script_user2'])) : '');
|
| 183 |
+
$submit_text = (isset($_POST['submit_text']) ? stripslashes($_POST['submit_text']) : '');
|
| 184 |
+
$url = (isset($_POST['url']) ? esc_html(stripslashes($_POST['url'])) : '');
|
| 185 |
+
$script_mail = (isset($_POST['script_mail']) ? stripslashes($_POST['script_mail']) : '%all%');
|
| 186 |
+
$script_mail_user = (isset($_POST['script_mail_user']) ? stripslashes($_POST['script_mail_user']) : '%all%');
|
| 187 |
+
$label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
|
| 188 |
+
$tax = (isset($_POST['tax']) ? esc_html(stripslashes($_POST['tax'])) : 0);
|
| 189 |
+
$payment_currency = (isset($_POST['payment_currency']) ? stripslashes($_POST['payment_currency']) : '');
|
| 190 |
+
$paypal_email = (isset($_POST['paypal_email']) ? esc_html(stripslashes($_POST['paypal_email'])) : '');
|
| 191 |
+
$checkout_mode = (isset($_POST['checkout_mode']) ? esc_html(stripslashes($_POST['checkout_mode'])) : 'testmode');
|
| 192 |
+
$paypal_mode = (isset($_POST['paypal_mode']) ? esc_html(stripslashes($_POST['paypal_mode'])) : 0);
|
| 193 |
+
$from_mail = (isset($_POST['from_mail']) ? esc_html(stripslashes($_POST['from_mail'])) : '');
|
| 194 |
+
$from_name = (isset($_POST['from_name']) ? esc_html(stripslashes($_POST['from_name'])) : '');
|
| 195 |
+
if (isset($_POST['submit_text_type'])) {
|
| 196 |
+
$submit_text_type = esc_html(stripslashes($_POST['submit_text_type']));
|
| 197 |
+
if ($submit_text_type == 5) {
|
| 198 |
+
$article_id = (isset($_POST['page_name']) ? esc_html(stripslashes($_POST['page_name'])) : 0);
|
| 199 |
+
}
|
| 200 |
+
else {
|
| 201 |
+
$article_id = (isset($_POST['post_name']) ? esc_html(stripslashes($_POST['post_name'])) : 0);
|
| 202 |
+
}
|
| 203 |
+
}
|
| 204 |
+
else {
|
| 205 |
+
$submit_text_type = 0;
|
| 206 |
+
$article_id = 0;
|
| 207 |
+
}
|
| 208 |
+
$save = $wpdb->update($wpdb->prefix . 'formmaker', array(
|
| 209 |
+
'mail' => $mail,
|
| 210 |
+
'theme' => $theme,
|
| 211 |
+
'javascript' => $javascript,
|
| 212 |
+
'submit_text' => $submit_text,
|
| 213 |
+
'url' => $url,
|
| 214 |
+
'submit_text_type' => $submit_text_type,
|
| 215 |
+
'script_mail' => $script_mail,
|
| 216 |
+
'script_mail_user' => $script_mail_user,
|
| 217 |
+
'article_id' => $article_id,
|
| 218 |
+
'paypal_mode' => $paypal_mode,
|
| 219 |
+
'checkout_mode' => $checkout_mode,
|
| 220 |
+
'paypal_email' => $paypal_email,
|
| 221 |
+
'payment_currency' => $payment_currency,
|
| 222 |
+
'tax' => $tax,
|
| 223 |
+
'from_mail' => $from_mail,
|
| 224 |
+
'from_name' => $from_name,
|
| 225 |
+
), array('id' => $id));
|
| 226 |
+
if ($save !== FALSE) {
|
| 227 |
+
return 8;
|
| 228 |
+
}
|
| 229 |
+
else {
|
| 230 |
+
return 2;
|
| 231 |
+
}
|
| 232 |
+
}
|
| 233 |
+
|
| 234 |
+
public function cancel_options_old() {
|
| 235 |
+
$this->edit_old();
|
| 236 |
+
}
|
| 237 |
+
|
| 238 |
+
public function form_layout() {
|
| 239 |
+
if (!isset($_GET['task'])) {
|
| 240 |
+
$this->save_db();
|
| 241 |
+
}
|
| 242 |
+
require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
|
| 243 |
+
$model = new FMModelManage_fmc();
|
| 244 |
+
|
| 245 |
+
require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
|
| 246 |
+
$view = new FMViewManage_fmc($model);
|
| 247 |
+
global $wpdb;
|
| 248 |
+
$id = (int)WDW_FMC_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
|
| 249 |
+
$view->form_layout($id);
|
| 250 |
+
}
|
| 251 |
+
|
| 252 |
+
public function save_layout() {
|
| 253 |
+
$message = $this->save_db_layout();
|
| 254 |
+
// $this->edit();
|
| 255 |
+
$page = WDW_FMC_Library::get('page');
|
| 256 |
+
$current_id = (int)WDW_FMC_Library::get('current_id', 0);
|
| 257 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
|
| 258 |
+
}
|
| 259 |
+
|
| 260 |
+
public function apply_layout() {
|
| 261 |
+
$message = $this->save_db_layout();
|
| 262 |
+
require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
|
| 263 |
+
$model = new FMModelManage_fmc();
|
| 264 |
+
|
| 265 |
+
require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
|
| 266 |
+
$view = new FMViewManage_fmc($model);
|
| 267 |
+
$page = WDW_FMC_Library::get('page');
|
| 268 |
+
$current_id = (int)WDW_FMC_Library::get('current_id', 0);
|
| 269 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'form_layout', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
|
| 270 |
+
// $view->form_layout($id);
|
| 271 |
+
}
|
| 272 |
+
|
| 273 |
+
public function save_db_layout() {
|
| 274 |
+
global $wpdb;
|
| 275 |
+
$id = (int)WDW_FMC_Library::get('current_id', 0);
|
| 276 |
+
$custom_front = (isset($_POST['custom_front']) ? stripslashes($_POST['custom_front']) : '');
|
| 277 |
+
$autogen_layout = (isset($_POST['autogen_layout']) ? 1 : 0);
|
| 278 |
+
$save = $wpdb->update($wpdb->prefix . 'formmaker', array(
|
| 279 |
+
'custom_front' => $custom_front,
|
| 280 |
+
'autogen_layout' => $autogen_layout
|
| 281 |
+
), array('id' => $id));
|
| 282 |
+
if ($save !== FALSE) {
|
| 283 |
+
return 1;
|
| 284 |
+
}
|
| 285 |
+
else {
|
| 286 |
+
return 2;
|
| 287 |
+
}
|
| 288 |
+
}
|
| 289 |
+
|
| 290 |
+
public function form_options() {
|
| 291 |
+
if (!isset($_GET['task'])) {
|
| 292 |
+
$this->save_db();
|
| 293 |
+
}
|
| 294 |
+
require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
|
| 295 |
+
$model = new FMModelManage_fmc();
|
| 296 |
+
|
| 297 |
+
require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
|
| 298 |
+
$view = new FMViewManage_fmc($model);
|
| 299 |
+
// $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
|
| 300 |
+
global $wpdb;
|
| 301 |
+
$id = (int)WDW_FMC_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
|
| 302 |
+
$view->form_options($id);
|
| 303 |
+
}
|
| 304 |
+
|
| 305 |
+
public function save_options() {
|
| 306 |
+
$message = $this->save_db_options();
|
| 307 |
+
// $this->edit();
|
| 308 |
+
$page = WDW_FMC_Library::get('page');
|
| 309 |
+
$current_id = (int)WDW_FMC_Library::get('current_id', 0);
|
| 310 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
|
| 311 |
+
}
|
| 312 |
+
|
| 313 |
+
public function apply_options() {
|
| 314 |
+
$message = $this->save_db_options();
|
| 315 |
+
require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
|
| 316 |
+
$model = new FMModelManage_fmc();
|
| 317 |
+
|
| 318 |
+
require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
|
| 319 |
+
$view = new FMViewManage_fmc($model);
|
| 320 |
+
// $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
|
| 321 |
+
// $view->form_options($id);
|
| 322 |
+
$page = WDW_FMC_Library::get('page');
|
| 323 |
+
$current_id = (int)WDW_FMC_Library::get('current_id', 0);
|
| 324 |
+
$fieldset_id = WDW_FMC_Library::get('fieldset_id', 'general');
|
| 325 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'form_options', 'current_id' => $current_id, 'message' => $message, 'fieldset_id' => $fieldset_id), admin_url('admin.php')));
|
| 326 |
+
}
|
| 327 |
+
|
| 328 |
+
public function remove_query() {
|
| 329 |
+
global $wpdb;
|
| 330 |
+
$cid = ((isset($_POST['cid']) && $_POST['cid'] != '') ? $_POST['cid'] : NULL);
|
| 331 |
+
if (count($cid)) {
|
| 332 |
+
array_walk($cid, create_function('&$value', '$value = (int)$value;'));
|
| 333 |
+
$cids = implode(',', $cid);
|
| 334 |
+
$query = 'DELETE FROM ' . $wpdb->prefix . 'formmaker_query WHERE id IN ( ' . $cids . ' )';
|
| 335 |
+
if ($wpdb->query($query)) {
|
| 336 |
+
echo WDW_FMC_Library::message('Items Succesfully Deleted.', 'updated');
|
| 337 |
+
}
|
| 338 |
+
else {
|
| 339 |
+
echo WDW_FMC_Library::message('Error. Please install plugin again.', 'error');
|
| 340 |
+
}
|
| 341 |
+
}
|
| 342 |
+
else {
|
| 343 |
+
echo WDW_FMC_Library::message('You must select at least one item.', 'error');
|
| 344 |
+
}
|
| 345 |
+
$this->apply_options();
|
| 346 |
+
}
|
| 347 |
+
|
| 348 |
+
public function cancel_options() {
|
| 349 |
+
$this->edit();
|
| 350 |
+
}
|
| 351 |
+
|
| 352 |
+
public function save_db_options() {
|
| 353 |
+
$javascript = "// Before the form is loaded.
|
| 354 |
+
function before_load() {
|
| 355 |
+
|
| 356 |
+
}
|
| 357 |
+
// Before form submit.
|
| 358 |
+
function before_submit() {
|
| 359 |
+
|
| 360 |
+
}
|
| 361 |
+
// Before form reset.
|
| 362 |
+
function before_reset() {
|
| 363 |
+
|
| 364 |
+
}";
|
| 365 |
+
global $wpdb;
|
| 366 |
+
// $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
|
| 367 |
+
$id = (int)WDW_FMC_Library::get('current_id', 0);
|
| 368 |
+
$published = (isset($_POST['published']) ? esc_html(stripslashes($_POST['published'])) : 1);
|
| 369 |
+
$savedb = (isset($_POST['savedb']) ? esc_html(stripslashes($_POST['savedb'])) : 1);
|
| 370 |
+
$theme = (int)((isset($_POST['theme']) && (esc_html($_POST['theme']) != 0)) ? esc_html(stripslashes($_POST['theme'])) : $wpdb->get_var("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE `default`='1'"));
|
| 371 |
+
$requiredmark = (isset($_POST['requiredmark']) ? esc_html(stripslashes($_POST['requiredmark'])) : '*');
|
| 372 |
+
$sendemail = (isset($_POST['sendemail']) ? esc_html(stripslashes($_POST['sendemail'])) : 1);
|
| 373 |
+
$save_uploads = (isset($_POST['save_uploads']) ? esc_html(stripslashes($_POST['save_uploads'])) : 1);
|
| 374 |
+
$mail = (isset($_POST['mail']) ? esc_html(stripslashes($_POST['mail'])) : '');
|
| 375 |
+
if (isset($_POST['mailToAdd']) && esc_html(stripslashes($_POST['mailToAdd'])) != '') {
|
| 376 |
+
$mail .= esc_html(stripslashes($_POST['mailToAdd'])) . ',';
|
| 377 |
+
}
|
| 378 |
+
$from_mail = (isset($_POST['from_mail']) ? esc_html(stripslashes($_POST['from_mail'])) : '');
|
| 379 |
+
$from_name = (isset($_POST['from_name']) ? esc_html(stripslashes($_POST['from_name'])) : '');
|
| 380 |
+
$reply_to = (isset($_POST['reply_to']) ? esc_html(stripslashes($_POST['reply_to'])) : '');
|
| 381 |
+
if ($from_mail == "other") {
|
| 382 |
+
$from_mail = (isset($_POST['mail_from_other']) ? esc_html(stripslashes($_POST['mail_from_other'])) : '');
|
| 383 |
+
}
|
| 384 |
+
if ($reply_to == "other") {
|
| 385 |
+
$reply_to = (isset($_POST['reply_to_other']) ? esc_html(stripslashes($_POST['reply_to_other'])) : '');
|
| 386 |
+
}
|
| 387 |
+
$script_mail = (isset($_POST['script_mail']) ? stripslashes($_POST['script_mail']) : '%all%');
|
| 388 |
+
$mail_from_user = (isset($_POST['mail_from_user']) ? esc_html(stripslashes($_POST['mail_from_user'])) : '');
|
| 389 |
+
$mail_from_name_user = (isset($_POST['mail_from_name_user']) ? esc_html(stripslashes($_POST['mail_from_name_user'])) : '');
|
| 390 |
+
$reply_to_user = (isset($_POST['reply_to_user']) ? esc_html(stripslashes($_POST['reply_to_user'])) : '');
|
| 391 |
+
$condition = (isset($_POST['condition']) ? esc_html(stripslashes($_POST['condition'])) : '');
|
| 392 |
+
$mail_cc = (isset($_POST['mail_cc']) ? esc_html(stripslashes($_POST['mail_cc'])) : '');
|
| 393 |
+
$mail_cc_user = (isset($_POST['mail_cc_user']) ? esc_html(stripslashes($_POST['mail_cc_user'])) : '');
|
| 394 |
+
$mail_bcc = (isset($_POST['mail_bcc']) ? esc_html(stripslashes($_POST['mail_bcc'])) : '');
|
| 395 |
+
$mail_bcc_user = (isset($_POST['mail_bcc_user']) ? esc_html(stripslashes($_POST['mail_bcc_user'])) : '');
|
| 396 |
+
$mail_subject = (isset($_POST['mail_subject']) ? esc_html(stripslashes($_POST['mail_subject'])) : '');
|
| 397 |
+
$mail_subject_user = (isset($_POST['mail_subject_user']) ? esc_html(stripslashes($_POST['mail_subject_user'])) : '');
|
| 398 |
+
$mail_mode = (isset($_POST['mail_mode']) ? esc_html(stripslashes($_POST['mail_mode'])) : 1);
|
| 399 |
+
$mail_mode_user = (isset($_POST['mail_mode_user']) ? esc_html(stripslashes($_POST['mail_mode_user'])) : 1);
|
| 400 |
+
$mail_attachment = (isset($_POST['mail_attachment']) ? esc_html(stripslashes($_POST['mail_attachment'])) : 1);
|
| 401 |
+
$mail_attachment_user = (isset($_POST['mail_attachment_user']) ? esc_html(stripslashes($_POST['mail_attachment_user'])) : 1);
|
| 402 |
+
$script_mail_user = (isset($_POST['script_mail_user']) ? stripslashes($_POST['script_mail_user']) : '%all%');
|
| 403 |
+
$submit_text = (isset($_POST['submit_text']) ? stripslashes($_POST['submit_text']) : '');
|
| 404 |
+
$url = (isset($_POST['url']) ? esc_html(stripslashes($_POST['url'])) : '');
|
| 405 |
+
$tax = (isset($_POST['tax']) ? esc_html(stripslashes($_POST['tax'])) : 0);
|
| 406 |
+
$payment_currency = (isset($_POST['payment_currency']) ? stripslashes($_POST['payment_currency']) : '');
|
| 407 |
+
$paypal_email = (isset($_POST['paypal_email']) ? esc_html(stripslashes($_POST['paypal_email'])) : '');
|
| 408 |
+
$checkout_mode = (isset($_POST['checkout_mode']) ? esc_html(stripslashes($_POST['checkout_mode'])) : 'testmode');
|
| 409 |
+
$paypal_mode = (isset($_POST['paypal_mode']) ? esc_html(stripslashes($_POST['paypal_mode'])) : 0);
|
| 410 |
+
$javascript = (isset($_POST['javascript']) ? stripslashes($_POST['javascript']) : $javascript);
|
| 411 |
+
$user_id_wd = (isset($_POST['user_id_wd']) ? stripslashes($_POST['user_id_wd']) : 'administrator,');
|
| 412 |
+
$frontend_submit_fields = (isset($_POST['frontend_submit_fields']) ? stripslashes($_POST['frontend_submit_fields']) : '');
|
| 413 |
+
$frontend_submit_stat_fields = (isset($_POST['frontend_submit_stat_fields']) ? stripslashes($_POST['frontend_submit_stat_fields']) : '');
|
| 414 |
+
$mail_emptyfields = (isset($_POST['mail_emptyfields']) ? esc_html(stripslashes($_POST['mail_emptyfields'])) : 0);
|
| 415 |
+
$mail_verify = (isset($_POST['mail_verify']) ? esc_html(stripslashes($_POST['mail_verify'])) : 0);
|
| 416 |
+
$mail_verify_expiretime = (isset($_POST['mail_verify_expiretime']) ? esc_html(stripslashes($_POST['mail_verify_expiretime'])) : '');
|
| 417 |
+
$send_to = '';
|
| 418 |
+
for ($i = 0; $i < 20; $i++) {
|
| 419 |
+
if (isset($_POST['send_to' . $i])) {
|
| 420 |
+
$send_to .= '*' . esc_html(stripslashes($_POST['send_to' . $i])) . '*';
|
| 421 |
+
}
|
| 422 |
+
}
|
| 423 |
+
if (isset($_POST['submit_text_type'])) {
|
| 424 |
+
$submit_text_type = esc_html(stripslashes($_POST['submit_text_type']));
|
| 425 |
+
if ($submit_text_type == 5) {
|
| 426 |
+
$article_id = (isset($_POST['page_name']) ? esc_html(stripslashes($_POST['page_name'])) : 0);
|
| 427 |
+
}
|
| 428 |
+
else {
|
| 429 |
+
$article_id = (isset($_POST['post_name']) ? esc_html(stripslashes($_POST['post_name'])) : 0);
|
| 430 |
+
}
|
| 431 |
+
}
|
| 432 |
+
else {
|
| 433 |
+
$submit_text_type = 0;
|
| 434 |
+
$article_id = 0;
|
| 435 |
+
}
|
| 436 |
+
|
| 437 |
+
$mail_verification_post_id = (int)$wpdb->get_var('SELECT mail_verification_post_id FROM ' . $wpdb->prefix . 'formmaker WHERE mail_verification_post_id!=0');
|
| 438 |
+
if($mail_verify) {
|
| 439 |
+
$email_verification_post = array(
|
| 440 |
+
'post_title' => 'Email Verification',
|
| 441 |
+
'post_content' => '[email_verification]',
|
| 442 |
+
'post_status' => 'publish',
|
| 443 |
+
'post_author' => 1,
|
| 444 |
+
'post_type' => 'fmemailverification',
|
| 445 |
+
);
|
| 446 |
+
|
| 447 |
+
if(!$mail_verification_post_id || get_post( $mail_verification_post_id )===NULL)
|
| 448 |
+
$mail_verification_post_id = wp_insert_post( $email_verification_post );
|
| 449 |
+
}
|
| 450 |
+
|
| 451 |
+
$save = $wpdb->update($wpdb->prefix . 'formmaker', array(
|
| 452 |
+
'published' => $published,
|
| 453 |
+
'savedb' => $savedb,
|
| 454 |
+
'theme' => $theme,
|
| 455 |
+
'requiredmark' => $requiredmark,
|
| 456 |
+
'sendemail' => $sendemail,
|
| 457 |
+
'save_uploads' => $save_uploads,
|
| 458 |
+
'mail' => $mail,
|
| 459 |
+
'from_mail' => $from_mail,
|
| 460 |
+
'from_name' => $from_name,
|
| 461 |
+
'reply_to' => $reply_to,
|
| 462 |
+
'script_mail' => $script_mail,
|
| 463 |
+
'mail_from_user' => $mail_from_user,
|
| 464 |
+
'mail_from_name_user' => $mail_from_name_user,
|
| 465 |
+
'reply_to_user' => $reply_to_user,
|
| 466 |
+
'condition' => $condition,
|
| 467 |
+
'mail_cc' => $mail_cc,
|
| 468 |
+
'mail_cc_user' => $mail_cc_user,
|
| 469 |
+
'mail_bcc' => $mail_bcc,
|
| 470 |
+
'mail_bcc_user' => $mail_bcc_user,
|
| 471 |
+
'mail_subject' => $mail_subject,
|
| 472 |
+
'mail_subject_user' => $mail_subject_user,
|
| 473 |
+
'mail_mode' => $mail_mode,
|
| 474 |
+
'mail_mode_user' => $mail_mode_user,
|
| 475 |
+
'mail_attachment' => $mail_attachment,
|
| 476 |
+
'mail_attachment_user' => $mail_attachment_user,
|
| 477 |
+
'script_mail_user' => $script_mail_user,
|
| 478 |
+
'submit_text' => $submit_text,
|
| 479 |
+
'url' => $url,
|
| 480 |
+
'submit_text_type' => $submit_text_type,
|
| 481 |
+
'article_id' => $article_id,
|
| 482 |
+
'tax' => $tax,
|
| 483 |
+
'payment_currency' => $payment_currency,
|
| 484 |
+
'paypal_email' => $paypal_email,
|
| 485 |
+
'checkout_mode' => $checkout_mode,
|
| 486 |
+
'paypal_mode' => $paypal_mode,
|
| 487 |
+
'javascript' => $javascript,
|
| 488 |
+
'user_id_wd' => $user_id_wd,
|
| 489 |
+
'send_to' => $send_to,
|
| 490 |
+
'frontend_submit_fields' => $frontend_submit_fields,
|
| 491 |
+
'frontend_submit_stat_fields' => $frontend_submit_stat_fields,
|
| 492 |
+
'mail_emptyfields' => $mail_emptyfields,
|
| 493 |
+
'mail_verify' => $mail_verify,
|
| 494 |
+
'mail_verify_expiretime' => $mail_verify_expiretime,
|
| 495 |
+
'mail_verification_post_id' => $mail_verification_post_id,
|
| 496 |
+
), array('id' => $id));
|
| 497 |
+
if ($save !== FALSE) {
|
| 498 |
+
$save_theme_in_backup = $wpdb->update($wpdb->prefix . 'formmaker_backup', array(
|
| 499 |
+
'theme' => $theme
|
| 500 |
+
), array('id' => $id));
|
| 501 |
+
return 8;
|
| 502 |
+
}
|
| 503 |
+
else {
|
| 504 |
+
return 2;
|
| 505 |
+
}
|
| 506 |
+
}
|
| 507 |
+
|
| 508 |
+
public function save_as_copy_old() {
|
| 509 |
+
$message = $this->save_db_as_copy_old();
|
| 510 |
+
// $this->display();
|
| 511 |
+
$page = WDW_FMC_Library::get('page');
|
| 512 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 513 |
+
}
|
| 514 |
+
|
| 515 |
+
public function save_old() {
|
| 516 |
+
$message = $this->save_db_old();
|
| 517 |
+
// $this->display();
|
| 518 |
+
$page = WDW_FMC_Library::get('page');
|
| 519 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 520 |
+
}
|
| 521 |
+
|
| 522 |
+
public function apply_old() {
|
| 523 |
+
global $wpdb;
|
| 524 |
+
$message = $this->save_db_old();
|
| 525 |
+
// $this->edit_old();
|
| 526 |
+
$id = (int) $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
|
| 527 |
+
$current_id = (int)WDW_FMC_Library::get('current_id', $id);
|
| 528 |
+
$page = WDW_FMC_Library::get('page');
|
| 529 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit_old', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
|
| 530 |
+
}
|
| 531 |
+
|
| 532 |
+
public function save_db_old() {
|
| 533 |
+
global $wpdb;
|
| 534 |
+
// $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
|
| 535 |
+
$id = (int)WDW_FMC_Library::get('current_id', 0);
|
| 536 |
+
$title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
|
| 537 |
+
$form = (isset($_POST['form']) ? stripslashes($_POST['form']) : '');
|
| 538 |
+
$form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
|
| 539 |
+
$counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
|
| 540 |
+
$label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
|
| 541 |
+
$label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
|
| 542 |
+
$pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
|
| 543 |
+
$show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
|
| 544 |
+
$show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
|
| 545 |
+
$public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
|
| 546 |
+
$private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
|
| 547 |
+
$recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
|
| 548 |
+
|
| 549 |
+
$save = $wpdb->update($wpdb->prefix . 'formmaker', array(
|
| 550 |
+
'title' => $title,
|
| 551 |
+
'form' => $form,
|
| 552 |
+
'form_front' => $form_front,
|
| 553 |
+
'counter' => $counter,
|
| 554 |
+
'label_order' => $label_order,
|
| 555 |
+
'label_order_current' => $label_order_current,
|
| 556 |
+
'pagination' => $pagination,
|
| 557 |
+
'show_title' => $show_title,
|
| 558 |
+
'show_numbers' => $show_numbers,
|
| 559 |
+
'public_key' => $public_key,
|
| 560 |
+
'private_key' => $private_key,
|
| 561 |
+
'recaptcha_theme' => $recaptcha_theme,
|
| 562 |
+
), array('id' => $id));
|
| 563 |
+
if ($save !== FALSE) {
|
| 564 |
+
return 1;
|
| 565 |
+
}
|
| 566 |
+
else {
|
| 567 |
+
return 2;
|
| 568 |
+
}
|
| 569 |
+
}
|
| 570 |
+
|
| 571 |
+
public function save_db_as_copy_old() {
|
| 572 |
+
global $wpdb;
|
| 573 |
+
// $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
|
| 574 |
+
$id = (int)WDW_FMC_Library::get('current_id', 0);
|
| 575 |
+
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
|
| 576 |
+
$title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
|
| 577 |
+
$form = (isset($_POST['form']) ? stripslashes($_POST['form']) : '');
|
| 578 |
+
$form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
|
| 579 |
+
$counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
|
| 580 |
+
$label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
|
| 581 |
+
$pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
|
| 582 |
+
$show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
|
| 583 |
+
$show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
|
| 584 |
+
$public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
|
| 585 |
+
$private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
|
| 586 |
+
$recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
|
| 587 |
+
|
| 588 |
+
$save = $wpdb->insert($wpdb->prefix . 'formmaker', array(
|
| 589 |
+
'title' => $title,
|
| 590 |
+
'mail' => $row->mail,
|
| 591 |
+
'form' => $form,
|
| 592 |
+
'form_front' => $form_front,
|
| 593 |
+
'theme' => $row->theme,
|
| 594 |
+
'counter' => $counter,
|
| 595 |
+
'label_order' => $label_order,
|
| 596 |
+
'pagination' => $pagination,
|
| 597 |
+
'show_title' => $show_title,
|
| 598 |
+
'show_numbers' => $show_numbers,
|
| 599 |
+
'public_key' => $public_key,
|
| 600 |
+
'private_key' => $private_key,
|
| 601 |
+
'recaptcha_theme' => $recaptcha_theme,
|
| 602 |
+
'javascript' => $row->javascript,
|
| 603 |
+
'script1' => $row->script1,
|
| 604 |
+
'script2' => $row->script2,
|
| 605 |
+
'script_user1' => $row->script_user1,
|
| 606 |
+
'script_user2' => $row->script_user2,
|
| 607 |
+
'submit_text' => $row->submit_text,
|
| 608 |
+
'url' => $row->url,
|
| 609 |
+
'article_id' => $row->article_id,
|
| 610 |
+
'submit_text_type' => $row->submit_text_type,
|
| 611 |
+
'script_mail' => $row->script_mail,
|
| 612 |
+
'script_mail_user' => $row->script_mail_user,
|
| 613 |
+
'paypal_mode' => $row->paypal_mode,
|
| 614 |
+
'checkout_mode' => $row->checkout_mode,
|
| 615 |
+
'paypal_email' => $row->paypal_email,
|
| 616 |
+
'payment_currency' => $row->payment_currency,
|
| 617 |
+
'tax' => $row->tax,
|
| 618 |
+
'label_order_current' => $row->label_order_current,
|
| 619 |
+
'from_mail' => $row->from_mail,
|
| 620 |
+
'from_name' => $row->from_name,
|
| 621 |
+
'reply_to_user' => $row->reply_to_user,
|
| 622 |
+
'mail_from_name_user' => $row->mail_from_name_user,
|
| 623 |
+
'mail_from_user' => $row->mail_from_user,
|
| 624 |
+
'custom_front' => $row->custom_front,
|
| 625 |
+
'autogen_layout' => $row->autogen_layout,
|
| 626 |
+
'send_to' => $row->send_to,
|
| 627 |
+
'reply_to' => $row->reply_to,
|
| 628 |
+
'requiredmark' => $row->requiredmark,
|
| 629 |
+
'sendemail' => $row->sendemail,
|
| 630 |
+
'savedb' => $row->savedb,
|
| 631 |
+
'form_fields' => $row->form_fields,
|
| 632 |
+
'published' => $row->published,
|
| 633 |
+
'save_uploads' => $row->save_uploads
|
| 634 |
+
), array(
|
| 635 |
+
'%s',
|
| 636 |
+
'%s',
|
| 637 |
+
'%s',
|
| 638 |
+
'%s',
|
| 639 |
+
'%d',
|
| 640 |
+
'%d',
|
| 641 |
+
'%s',
|
| 642 |
+
'%s',
|
| 643 |
+
'%s',
|
| 644 |
+
'%s',
|
| 645 |
+
'%s',
|
| 646 |
+
'%s',
|
| 647 |
+
'%s',
|
| 648 |
+
'%s',
|
| 649 |
+
'%s',
|
| 650 |
+
'%s',
|
| 651 |
+
'%s',
|
| 652 |
+
'%s',
|
| 653 |
+
'%s',
|
| 654 |
+
'%s',
|
| 655 |
+
'%s',
|
| 656 |
+
'%d',
|
| 657 |
+
'%s',
|
| 658 |
+
'%s',
|
| 659 |
+
'%d',
|
| 660 |
+
'%s',
|
| 661 |
+
'%s',
|
| 662 |
+
'%s',
|
| 663 |
+
'%s',
|
| 664 |
+
'%s',
|
| 665 |
+
'%s',
|
| 666 |
+
'%s',
|
| 667 |
+
'%s',
|
| 668 |
+
'%s',
|
| 669 |
+
'%s',
|
| 670 |
+
'%s',
|
| 671 |
+
'%d',
|
| 672 |
+
'%s',
|
| 673 |
+
'%s',
|
| 674 |
+
'%s',
|
| 675 |
+
'%d',
|
| 676 |
+
'%d',
|
| 677 |
+
'%s',
|
| 678 |
+
'%d'
|
| 679 |
+
));
|
| 680 |
+
$id = (int)$wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
|
| 681 |
+
update_option('contact_form_forms', ((get_option('contact_form_forms')) ? (get_option('contact_form_forms')) . ',' . $id : $id));
|
| 682 |
+
$wpdb->insert($wpdb->prefix . 'formmaker_views', array(
|
| 683 |
+
'form_id' => $id,
|
| 684 |
+
'views' => 0
|
| 685 |
+
), array(
|
| 686 |
+
'%d',
|
| 687 |
+
'%d'
|
| 688 |
+
));
|
| 689 |
+
if ($save !== FALSE) {
|
| 690 |
+
return 1;
|
| 691 |
+
}
|
| 692 |
+
else {
|
| 693 |
+
return 2;
|
| 694 |
+
}
|
| 695 |
+
}
|
| 696 |
+
|
| 697 |
+
public function save_as_copy() {
|
| 698 |
+
$message = $this->save_db_as_copy();
|
| 699 |
+
// $this->display();
|
| 700 |
+
$page = WDW_FMC_Library::get('page');
|
| 701 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 702 |
+
}
|
| 703 |
+
|
| 704 |
+
public function save() {
|
| 705 |
+
$message = $this->save_db();
|
| 706 |
+
// $this->display();
|
| 707 |
+
$page = WDW_FMC_Library::get('page');
|
| 708 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 709 |
+
}
|
| 710 |
+
|
| 711 |
+
public function apply() {
|
| 712 |
+
$message = $this->save_db();
|
| 713 |
+
// $this->edit();
|
| 714 |
+
global $wpdb;
|
| 715 |
+
$id = (int) $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
|
| 716 |
+
$current_id = (int)WDW_FMC_Library::get('current_id', $id);
|
| 717 |
+
$page = WDW_FMC_Library::get('page');
|
| 718 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
|
| 719 |
+
}
|
| 720 |
+
|
| 721 |
+
public function save_db() {
|
| 722 |
+
global $wpdb;
|
| 723 |
+
$javascript = "// before form is load
|
| 724 |
+
function before_load() {
|
| 725 |
+
}
|
| 726 |
+
// before form submit
|
| 727 |
+
function before_submit() {
|
| 728 |
+
}
|
| 729 |
+
// before form reset
|
| 730 |
+
function before_reset() {
|
| 731 |
+
}";
|
| 732 |
+
$id = (int)WDW_FMC_Library::get('current_id', 0);
|
| 733 |
+
$title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
|
| 734 |
+
$theme = (isset($_POST['theme']) ? esc_html(stripslashes($_POST['theme'])) : $wpdb->get_var("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE `default`='1'"));
|
| 735 |
+
$form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
|
| 736 |
+
$sortable = (isset($_POST['sortable']) ? stripslashes($_POST['sortable']) : 1);
|
| 737 |
+
$counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
|
| 738 |
+
$label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
|
| 739 |
+
$pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
|
| 740 |
+
$show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
|
| 741 |
+
$show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
|
| 742 |
+
$public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
|
| 743 |
+
$private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
|
| 744 |
+
$recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
|
| 745 |
+
$label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
|
| 746 |
+
$form_fields = (isset($_POST['form_fields']) ? stripslashes($_POST['form_fields']) : '');
|
| 747 |
+
if ($id != 0) {
|
| 748 |
+
$save = $wpdb->update($wpdb->prefix . 'formmaker', array(
|
| 749 |
+
'title' => $title,
|
| 750 |
+
'theme' => $theme,
|
| 751 |
+
'form_front' => $form_front,
|
| 752 |
+
'sortable' => $sortable,
|
| 753 |
+
'counter' => $counter,
|
| 754 |
+
'label_order' => $label_order,
|
| 755 |
+
'label_order_current' => $label_order_current,
|
| 756 |
+
'pagination' => $pagination,
|
| 757 |
+
'show_title' => $show_title,
|
| 758 |
+
'show_numbers' => $show_numbers,
|
| 759 |
+
'public_key' => $public_key,
|
| 760 |
+
'private_key' => $private_key,
|
| 761 |
+
'recaptcha_theme' => $recaptcha_theme,
|
| 762 |
+
'form_fields' => $form_fields,
|
| 763 |
+
), array('id' => $id));
|
| 764 |
+
}
|
| 765 |
+
else {
|
| 766 |
+
$save = $wpdb->insert($wpdb->prefix . 'formmaker', array(
|
| 767 |
+
'title' => $title,
|
| 768 |
+
'mail' => '',
|
| 769 |
+
'form_front' => $form_front,
|
| 770 |
+
'theme' => $theme,
|
| 771 |
+
'counter' => $counter,
|
| 772 |
+
'label_order' => $label_order,
|
| 773 |
+
'pagination' => $pagination,
|
| 774 |
+
'show_title' => $show_title,
|
| 775 |
+
'show_numbers' => $show_numbers,
|
| 776 |
+
'public_key' => $public_key,
|
| 777 |
+
'private_key' => $private_key,
|
| 778 |
+
'recaptcha_theme' => $recaptcha_theme,
|
| 779 |
+
'javascript' => $javascript,
|
| 780 |
+
'submit_text' => '',
|
| 781 |
+
'url' => '',
|
| 782 |
+
'article_id' => 0,
|
| 783 |
+
'submit_text_type' => 0,
|
| 784 |
+
'script_mail' => '%all%',
|
| 785 |
+
'script_mail_user' => '%all%',
|
| 786 |
+
'label_order_current' => $label_order_current,
|
| 787 |
+
'tax' => 0,
|
| 788 |
+
'payment_currency' => '',
|
| 789 |
+
'paypal_email' => '',
|
| 790 |
+
'checkout_mode' => 'testmode',
|
| 791 |
+
'paypal_mode' => 0,
|
| 792 |
+
'published' => 1,
|
| 793 |
+
'form_fields' => $form_fields,
|
| 794 |
+
'savedb' => 1,
|
| 795 |
+
'sendemail' => 1,
|
| 796 |
+
'requiredmark' => '*',
|
| 797 |
+
'from_mail' => '',
|
| 798 |
+
'from_name' => '',
|
| 799 |
+
'reply_to' => '',
|
| 800 |
+
'send_to' => '',
|
| 801 |
+
'autogen_layout' => 1,
|
| 802 |
+
'custom_front' => '',
|
| 803 |
+
'mail_from_user' => '',
|
| 804 |
+
'mail_from_name_user' => '',
|
| 805 |
+
'reply_to_user' => '',
|
| 806 |
+
'condition' => '',
|
| 807 |
+
'mail_cc' => '',
|
| 808 |
+
'mail_cc_user' => '',
|
| 809 |
+
'mail_bcc' => '',
|
| 810 |
+
'mail_bcc_user' => '',
|
| 811 |
+
'mail_subject' => '',
|
| 812 |
+
'mail_subject_user' => '',
|
| 813 |
+
'mail_mode' => 1,
|
| 814 |
+
'mail_mode_user' => 1,
|
| 815 |
+
'mail_attachment' => 1,
|
| 816 |
+
'mail_attachment_user' => 1,
|
| 817 |
+
'sortable' => $sortable,
|
| 818 |
+
'user_id_wd' => 'administrator,',
|
| 819 |
+
'frontend_submit_fields' => '',
|
| 820 |
+
'frontend_submit_stat_fields' => '',
|
| 821 |
+
'save_uploads' => 1,
|
| 822 |
+
), array(
|
| 823 |
+
'%s',
|
| 824 |
+
'%s',
|
| 825 |
+
'%s',
|
| 826 |
+
'%d',
|
| 827 |
+
'%d',
|
| 828 |
+
'%s',
|
| 829 |
+
'%s',
|
| 830 |
+
'%s',
|
| 831 |
+
'%s',
|
| 832 |
+
'%s',
|
| 833 |
+
'%s',
|
| 834 |
+
'%s',
|
| 835 |
+
'%s',
|
| 836 |
+
'%s',
|
| 837 |
+
'%s',
|
| 838 |
+
'%d',
|
| 839 |
+
'%d',
|
| 840 |
+
'%s',
|
| 841 |
+
'%s',
|
| 842 |
+
'%s',
|
| 843 |
+
'%s',
|
| 844 |
+
'%s',
|
| 845 |
+
'%s',
|
| 846 |
+
'%s',
|
| 847 |
+
'%d',
|
| 848 |
+
'%d',
|
| 849 |
+
'%s',
|
| 850 |
+
'%d',
|
| 851 |
+
'%d',
|
| 852 |
+
'%s',
|
| 853 |
+
'%s',
|
| 854 |
+
'%s',
|
| 855 |
+
'%s',
|
| 856 |
+
'%s',
|
| 857 |
+
'%d',
|
| 858 |
+
'%s',
|
| 859 |
+
'%s',
|
| 860 |
+
'%s',
|
| 861 |
+
'%s',
|
| 862 |
+
'%s',
|
| 863 |
+
'%s',
|
| 864 |
+
'%s',
|
| 865 |
+
'%s',
|
| 866 |
+
'%s',
|
| 867 |
+
'%s',
|
| 868 |
+
'%s',
|
| 869 |
+
'%d',
|
| 870 |
+
'%d',
|
| 871 |
+
'%d',
|
| 872 |
+
'%d',
|
| 873 |
+
'%d',
|
| 874 |
+
'%s',
|
| 875 |
+
'%s',
|
| 876 |
+
'%s',
|
| 877 |
+
'%d',
|
| 878 |
+
));
|
| 879 |
+
$id = (int)$wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
|
| 880 |
+
update_option('contact_form_forms', ((get_option('contact_form_forms')) ? (get_option('contact_form_forms')) . ',' . $id : $id));
|
| 881 |
+
// $_POST['current_id'] = $id;
|
| 882 |
+
$wpdb->insert($wpdb->prefix . 'formmaker_views', array(
|
| 883 |
+
'form_id' => $id,
|
| 884 |
+
'views' => 0
|
| 885 |
+
), array(
|
| 886 |
+
'%d',
|
| 887 |
+
'%d'
|
| 888 |
+
));
|
| 889 |
+
}
|
| 890 |
+
|
| 891 |
+
$backup_id = (isset($_POST['backup_id']) ? (int)esc_html(stripslashes($_POST['backup_id'])) : '');
|
| 892 |
+
|
| 893 |
+
if($backup_id)
|
| 894 |
+
{
|
| 895 |
+
$query = "SELECT backup_id FROM ".$wpdb->prefix."formmaker_backup WHERE backup_id > ".$backup_id." AND id = ".$id." ORDER BY backup_id ASC LIMIT 0 , 1 ";
|
| 896 |
+
|
| 897 |
+
if($wpdb->get_var($query))
|
| 898 |
+
{
|
| 899 |
+
$query = "DELETE FROM ".$wpdb->prefix."formmaker_backup WHERE backup_id > ".$backup_id." AND id = ".$id;
|
| 900 |
+
$wpdb->query($query);
|
| 901 |
+
}
|
| 902 |
+
|
| 903 |
+
$row = $wpdb->get_row($wpdb->prepare("SELECT form_fields, form_front FROM ".$wpdb->prefix."formmaker_backup WHERE backup_id = '%d'", $backup_id));
|
| 904 |
+
|
| 905 |
+
if($row->form_fields==$form_fields and $row->form_front==$form_front)
|
| 906 |
+
{
|
| 907 |
+
$save = $wpdb->update($wpdb->prefix . 'formmaker_backup', array(
|
| 908 |
+
'cur' => 1,
|
| 909 |
+
'title' => $title,
|
| 910 |
+
'theme' => $theme,
|
| 911 |
+
'form_front' => $form_front,
|
| 912 |
+
'sortable' => $sortable,
|
| 913 |
+
'counter' => $counter,
|
| 914 |
+
'label_order' => $label_order,
|
| 915 |
+
'label_order_current' => $label_order_current,
|
| 916 |
+
'pagination' => $pagination,
|
| 917 |
+
'show_title' => $show_title,
|
| 918 |
+
'show_numbers' => $show_numbers,
|
| 919 |
+
'public_key' => $public_key,
|
| 920 |
+
'private_key' => $private_key,
|
| 921 |
+
'recaptcha_theme' => $recaptcha_theme,
|
| 922 |
+
'form_fields' => $form_fields,
|
| 923 |
+
), array('backup_id' => $backup_id));
|
| 924 |
+
|
| 925 |
+
|
| 926 |
+
if ($save !== FALSE) {
|
| 927 |
+
return 1;
|
| 928 |
+
}
|
| 929 |
+
else {
|
| 930 |
+
return 2;
|
| 931 |
+
}
|
| 932 |
+
}
|
| 933 |
+
}
|
| 934 |
+
|
| 935 |
+
$wpdb->query("UPDATE ".$wpdb->prefix."formmaker_backup SET cur=0 WHERE id=".$id );
|
| 936 |
+
|
| 937 |
+
$save = $wpdb->insert($wpdb->prefix . 'formmaker_backup', array(
|
| 938 |
+
'cur' => 1,
|
| 939 |
+
'id' => $id,
|
| 940 |
+
'title' => $title,
|
| 941 |
+
'mail' => '',
|
| 942 |
+
'form_front' => $form_front,
|
| 943 |
+
'theme' => $theme,
|
| 944 |
+
'counter' => $counter,
|
| 945 |
+
'label_order' => $label_order,
|
| 946 |
+
'pagination' => $pagination,
|
| 947 |
+
'show_title' => $show_title,
|
| 948 |
+
'show_numbers' => $show_numbers,
|
| 949 |
+
'public_key' => $public_key,
|
| 950 |
+
'private_key' => $private_key,
|
| 951 |
+
'recaptcha_theme' => $recaptcha_theme,
|
| 952 |
+
'javascript' => $javascript,
|
| 953 |
+
'submit_text' => '',
|
| 954 |
+
'url' => '',
|
| 955 |
+
'article_id' => 0,
|
| 956 |
+
'submit_text_type' => 0,
|
| 957 |
+
'script_mail' => '%all%',
|
| 958 |
+
'script_mail_user' => '%all%',
|
| 959 |
+
'label_order_current' => $label_order_current,
|
| 960 |
+
'tax' => 0,
|
| 961 |
+
'payment_currency' => '',
|
| 962 |
+
'paypal_email' => '',
|
| 963 |
+
'checkout_mode' => 'testmode',
|
| 964 |
+
'paypal_mode' => 0,
|
| 965 |
+
'published' => 1,
|
| 966 |
+
'form_fields' => $form_fields,
|
| 967 |
+
'savedb' => 1,
|
| 968 |
+
'sendemail' => 1,
|
| 969 |
+
'requiredmark' => '*',
|
| 970 |
+
'from_mail' => '',
|
| 971 |
+
'from_name' => '',
|
| 972 |
+
'reply_to' => '',
|
| 973 |
+
'send_to' => '',
|
| 974 |
+
'autogen_layout' => 1,
|
| 975 |
+
'custom_front' => '',
|
| 976 |
+
'mail_from_user' => '',
|
| 977 |
+
'mail_from_name_user' => '',
|
| 978 |
+
'reply_to_user' => '',
|
| 979 |
+
'condition' => '',
|
| 980 |
+
'mail_cc' => '',
|
| 981 |
+
'mail_cc_user' => '',
|
| 982 |
+
'mail_bcc' => '',
|
| 983 |
+
'mail_bcc_user' => '',
|
| 984 |
+
'mail_subject' => '',
|
| 985 |
+
'mail_subject_user' => '',
|
| 986 |
+
'mail_mode' => 1,
|
| 987 |
+
'mail_mode_user' => 1,
|
| 988 |
+
'mail_attachment' => 1,
|
| 989 |
+
'mail_attachment_user' => 1,
|
| 990 |
+
'sortable' => $sortable,
|
| 991 |
+
'user_id_wd' => 'administrator,',
|
| 992 |
+
'frontend_submit_fields' => '',
|
| 993 |
+
'frontend_submit_stat_fields' => '',
|
| 994 |
+
), array(
|
| 995 |
+
'%d',
|
| 996 |
+
'%d',
|
| 997 |
+
'%s',
|
| 998 |
+
'%s',
|
| 999 |
+
'%s',
|
| 1000 |
+
'%d',
|
| 1001 |
+
'%d',
|
| 1002 |
+
'%s',
|
| 1003 |
+
'%s',
|
| 1004 |
+
'%s',
|
| 1005 |
+
'%s',
|
| 1006 |
+
'%s',
|
| 1007 |
+
'%s',
|
| 1008 |
+
'%s',
|
| 1009 |
+
'%s',
|
| 1010 |
+
'%s',
|
| 1011 |
+
'%s',
|
| 1012 |
+
'%d',
|
| 1013 |
+
'%d',
|
| 1014 |
+
'%s',
|
| 1015 |
+
'%s',
|
| 1016 |
+
'%s',
|
| 1017 |
+
'%s',
|
| 1018 |
+
'%s',
|
| 1019 |
+
'%s',
|
| 1020 |
+
'%s',
|
| 1021 |
+
'%d',
|
| 1022 |
+
'%d',
|
| 1023 |
+
'%s',
|
| 1024 |
+
'%d',
|
| 1025 |
+
'%d',
|
| 1026 |
+
'%s',
|
| 1027 |
+
'%s',
|
| 1028 |
+
'%s',
|
| 1029 |
+
'%s',
|
| 1030 |
+
'%s',
|
| 1031 |
+
'%d',
|
| 1032 |
+
'%s',
|
| 1033 |
+
'%s',
|
| 1034 |
+
'%s',
|
| 1035 |
+
'%s',
|
| 1036 |
+
'%s',
|
| 1037 |
+
'%s',
|
| 1038 |
+
'%s',
|
| 1039 |
+
'%s',
|
| 1040 |
+
'%s',
|
| 1041 |
+
'%s',
|
| 1042 |
+
'%s',
|
| 1043 |
+
'%d',
|
| 1044 |
+
'%d',
|
| 1045 |
+
'%d',
|
| 1046 |
+
'%d',
|
| 1047 |
+
'%d',
|
| 1048 |
+
'%s',
|
| 1049 |
+
'%s',
|
| 1050 |
+
'%s',
|
| 1051 |
+
)) ;
|
| 1052 |
+
|
| 1053 |
+
$query = "SELECT count(backup_id) FROM ".$wpdb->prefix."formmaker_backup WHERE id = ".$id;
|
| 1054 |
+
$wpdb->get_var($query);
|
| 1055 |
+
if($wpdb->get_var($query)>10)
|
| 1056 |
+
{
|
| 1057 |
+
$query = "DELETE FROM ".$wpdb->prefix."formmaker_backup WHERE id = ".$id." ORDER BY backup_id ASC LIMIT 1 ";
|
| 1058 |
+
$wpdb->query($query);
|
| 1059 |
+
}
|
| 1060 |
+
|
| 1061 |
+
if ($save !== FALSE) {
|
| 1062 |
+
return 1;
|
| 1063 |
+
}
|
| 1064 |
+
else {
|
| 1065 |
+
return 2;
|
| 1066 |
+
}
|
| 1067 |
+
}
|
| 1068 |
+
|
| 1069 |
+
public function save_db_as_copy() {
|
| 1070 |
+
global $wpdb;
|
| 1071 |
+
// $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
|
| 1072 |
+
$id = (int)WDW_FMC_Library::get('current_id', 0);
|
| 1073 |
+
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
|
| 1074 |
+
$title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
|
| 1075 |
+
$form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
|
| 1076 |
+
$sortable = (isset($_POST['sortable']) ? stripslashes($_POST['sortable']) : 1);
|
| 1077 |
+
$counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
|
| 1078 |
+
$label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
|
| 1079 |
+
$label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
|
| 1080 |
+
$pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
|
| 1081 |
+
$show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
|
| 1082 |
+
$show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
|
| 1083 |
+
$public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
|
| 1084 |
+
$private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
|
| 1085 |
+
$recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
|
| 1086 |
+
$form_fields = (isset($_POST['form_fields']) ? stripslashes($_POST['form_fields']) : '');
|
| 1087 |
+
|
| 1088 |
+
$save = $wpdb->insert($wpdb->prefix . 'formmaker', array(
|
| 1089 |
+
'title' => $title,
|
| 1090 |
+
'mail' => $row->mail,
|
| 1091 |
+
'form_front' => $form_front,
|
| 1092 |
+
'theme' => $row->theme,
|
| 1093 |
+
'counter' => $counter,
|
| 1094 |
+
'label_order' => $label_order,
|
| 1095 |
+
'pagination' => $pagination,
|
| 1096 |
+
'show_title' => $show_title,
|
| 1097 |
+
'show_numbers' => $show_numbers,
|
| 1098 |
+
'public_key' => $public_key,
|
| 1099 |
+
'private_key' => $private_key,
|
| 1100 |
+
'recaptcha_theme' => $recaptcha_theme,
|
| 1101 |
+
'javascript' => $row->javascript,
|
| 1102 |
+
'submit_text' => $row->submit_text,
|
| 1103 |
+
'url' => $row->url,
|
| 1104 |
+
'article_id' => $row->article_id,
|
| 1105 |
+
'submit_text_type' => $row->submit_text_type,
|
| 1106 |
+
'script_mail' => $row->script_mail,
|
| 1107 |
+
'script_mail_user' => $row->script_mail_user,
|
| 1108 |
+
'label_order_current' => $label_order_current,
|
| 1109 |
+
'tax' => $row->tax,
|
| 1110 |
+
'payment_currency' => $row->payment_currency,
|
| 1111 |
+
'paypal_email' => $row->paypal_email,
|
| 1112 |
+
'checkout_mode' => $row->checkout_mode,
|
| 1113 |
+
'paypal_mode' => $row->paypal_mode,
|
| 1114 |
+
'published' => $row->published,
|
| 1115 |
+
'form_fields' => $form_fields,
|
| 1116 |
+
'savedb' => $row->savedb,
|
| 1117 |
+
'sendemail' => $row->sendemail,
|
| 1118 |
+
'requiredmark' => $row->requiredmark,
|
| 1119 |
+
'from_mail' => $row->from_mail,
|
| 1120 |
+
'from_name' => $row->from_name,
|
| 1121 |
+
'reply_to' => $row->reply_to,
|
| 1122 |
+
'send_to' => $row->send_to,
|
| 1123 |
+
'autogen_layout' => $row->autogen_layout,
|
| 1124 |
+
'custom_front' => $row->custom_front,
|
| 1125 |
+
'mail_from_user' => $row->mail_from_user,
|
| 1126 |
+
'mail_from_name_user' => $row->mail_from_name_user,
|
| 1127 |
+
'reply_to_user' => $row->reply_to_user,
|
| 1128 |
+
'condition' => $row->condition,
|
| 1129 |
+
'mail_cc' => $row->mail_cc,
|
| 1130 |
+
'mail_cc_user' => $row->mail_cc_user,
|
| 1131 |
+
'mail_bcc' => $row->mail_bcc,
|
| 1132 |
+
'mail_bcc_user' => $row->mail_bcc_user,
|
| 1133 |
+
'mail_subject' => $row->mail_subject,
|
| 1134 |
+
'mail_subject_user' => $row->mail_subject_user,
|
| 1135 |
+
'mail_mode' => $row->mail_mode,
|
| 1136 |
+
'mail_mode_user' => $row->mail_mode_user,
|
| 1137 |
+
'mail_attachment' => $row->mail_attachment,
|
| 1138 |
+
'mail_attachment_user' => $row->mail_attachment_user,
|
| 1139 |
+
'sortable' => $sortable,
|
| 1140 |
+
'user_id_wd' => $row->user_id_wd,
|
| 1141 |
+
'frontend_submit_fields' => $row->frontend_submit_fields,
|
| 1142 |
+
'frontend_submit_stat_fields' => $row->frontend_submit_stat_fields,
|
| 1143 |
+
'save_uploads' => $row->save_uploads,
|
| 1144 |
+
), array(
|
| 1145 |
+
'%s',
|
| 1146 |
+
'%s',
|
| 1147 |
+
'%s',
|
| 1148 |
+
'%d',
|
| 1149 |
+
'%d',
|
| 1150 |
+
'%s',
|
| 1151 |
+
'%s',
|
| 1152 |
+
'%s',
|
| 1153 |
+
'%s',
|
| 1154 |
+
'%s',
|
| 1155 |
+
'%s',
|
| 1156 |
+
'%s',
|
| 1157 |
+
'%s',
|
| 1158 |
+
'%s',
|
| 1159 |
+
'%s',
|
| 1160 |
+
'%d',
|
| 1161 |
+
'%d',
|
| 1162 |
+
'%s',
|
| 1163 |
+
'%s',
|
| 1164 |
+
'%s',
|
| 1165 |
+
'%s',
|
| 1166 |
+
'%s',
|
| 1167 |
+
'%s',
|
| 1168 |
+
'%s',
|
| 1169 |
+
'%d',
|
| 1170 |
+
'%d',
|
| 1171 |
+
'%s',
|
| 1172 |
+
'%d',
|
| 1173 |
+
'%d',
|
| 1174 |
+
'%s',
|
| 1175 |
+
'%s',
|
| 1176 |
+
'%s',
|
| 1177 |
+
'%s',
|
| 1178 |
+
'%s',
|
| 1179 |
+
'%d',
|
| 1180 |
+
'%s',
|
| 1181 |
+
'%s',
|
| 1182 |
+
'%s',
|
| 1183 |
+
'%s',
|
| 1184 |
+
'%s',
|
| 1185 |
+
'%s',
|
| 1186 |
+
'%s',
|
| 1187 |
+
'%s',
|
| 1188 |
+
'%s',
|
| 1189 |
+
'%s',
|
| 1190 |
+
'%s',
|
| 1191 |
+
'%d',
|
| 1192 |
+
'%d',
|
| 1193 |
+
'%d',
|
| 1194 |
+
'%d',
|
| 1195 |
+
'%d',
|
| 1196 |
+
'%s',
|
| 1197 |
+
'%s',
|
| 1198 |
+
'%s',
|
| 1199 |
+
'%d',
|
| 1200 |
+
));
|
| 1201 |
+
$new_id = (int)$wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
|
| 1202 |
+
update_option('contact_form_forms', ((get_option('contact_form_forms')) ? (get_option('contact_form_forms')) . ',' . $new_id : $new_id));
|
| 1203 |
+
$wpdb->insert($wpdb->prefix . 'formmaker_views', array(
|
| 1204 |
+
'form_id' => $new_id,
|
| 1205 |
+
'views' => 0
|
| 1206 |
+
), array(
|
| 1207 |
+
'%d',
|
| 1208 |
+
'%d'
|
| 1209 |
+
));
|
| 1210 |
+
if ($save !== FALSE) {
|
| 1211 |
+
|
| 1212 |
+
return 1;
|
| 1213 |
+
}
|
| 1214 |
+
else {
|
| 1215 |
+
return 2;
|
| 1216 |
+
}
|
| 1217 |
+
}
|
| 1218 |
+
|
| 1219 |
+
public function delete($id) {
|
| 1220 |
+
global $wpdb;
|
| 1221 |
+
$query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id);
|
| 1222 |
+
if ($wpdb->query($query)) {
|
| 1223 |
+
$arr = explode(',', get_option('contact_form_forms'));
|
| 1224 |
+
$arr = array_diff($arr, array($id));
|
| 1225 |
+
$arr = implode(',', $arr);
|
| 1226 |
+
update_option('contact_form_forms', $arr);
|
| 1227 |
+
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="%d"', $id));
|
| 1228 |
+
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id="%d"', $id));
|
| 1229 |
+
|
| 1230 |
+
$message = 3;
|
| 1231 |
+
}
|
| 1232 |
+
else {
|
| 1233 |
+
$message = 2;
|
| 1234 |
+
}
|
| 1235 |
+
// $this->display();
|
| 1236 |
+
$page = WDW_FMC_Library::get('page');
|
| 1237 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 1238 |
+
}
|
| 1239 |
+
|
| 1240 |
+
public function delete_all() {
|
| 1241 |
+
global $wpdb;
|
| 1242 |
+
$flag = FALSE;
|
| 1243 |
+
$isDefault = FALSE;
|
| 1244 |
+
$form_ids_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker');
|
| 1245 |
+
foreach ($form_ids_col as $form_id) {
|
| 1246 |
+
if (isset($_POST['check_' . $form_id])) {
|
| 1247 |
+
$flag = TRUE;
|
| 1248 |
+
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $form_id));
|
| 1249 |
+
$arr = explode(',', get_option('contact_form_forms'));
|
| 1250 |
+
$arr = array_diff($arr, array($form_id));
|
| 1251 |
+
$arr = implode(',', $arr);
|
| 1252 |
+
update_option('contact_form_forms', $arr);
|
| 1253 |
+
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="%d"', $form_id));
|
| 1254 |
+
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id="%d"', $form_id));
|
| 1255 |
+
}
|
| 1256 |
+
}
|
| 1257 |
+
if ($flag) {
|
| 1258 |
+
$message = 5;
|
| 1259 |
+
}
|
| 1260 |
+
else {
|
| 1261 |
+
$message = 6;
|
| 1262 |
+
}
|
| 1263 |
+
// $this->display();
|
| 1264 |
+
$page = WDW_FMC_Library::get('page');
|
| 1265 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
| 1266 |
+
}
|
| 1267 |
+
|
| 1268 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 1269 |
+
// Getters & Setters //
|
| 1270 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 1271 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 1272 |
+
// Private Methods //
|
| 1273 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 1274 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 1275 |
+
// Listeners //
|
| 1276 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 1277 |
}
|
admin/views/FMViewSubmissions_fmc.php
CHANGED
|
@@ -342,14 +342,19 @@ class FMViewSubmissions_fmc {
|
|
| 342 |
</div>
|
| 343 |
<div class="tablenav top">
|
| 344 |
<div class="fm-filters">
|
| 345 |
-
<div class="fm-search-tools">
|
| 346 |
<input type="hidden" name="hide_label_list" value="<?php echo $lists['hide_label_list']; ?>">
|
| 347 |
-
<button class="fm-
|
| 348 |
<span></span>
|
|
|
|
| 349 |
</button>
|
| 350 |
-
<button class="fm-
|
|
|
|
|
|
|
| 351 |
</button>
|
| 352 |
-
<button class="fm-
|
|
|
|
|
|
|
| 353 |
</button>
|
| 354 |
</div>
|
| 355 |
<div class="fm-add-remove">
|
|
@@ -357,7 +362,8 @@ class FMViewSubmissions_fmc {
|
|
| 357 |
<button class="fm-button" onclick="toggleChBDiv(true); return false;">
|
| 358 |
Add/Remove Columns
|
| 359 |
</button>
|
| 360 |
-
<?php
|
|
|
|
| 361 |
<?php } ?>
|
| 362 |
<input type="hidden" name="pagination_clicked" id="pagination_clicked" value=""/>
|
| 363 |
</div>
|
| 342 |
</div>
|
| 343 |
<div class="tablenav top">
|
| 344 |
<div class="fm-filters">
|
| 345 |
+
<div class="fm-search-tools fm-page-actions" style="float:left !important;">
|
| 346 |
<input type="hidden" name="hide_label_list" value="<?php echo $lists['hide_label_list']; ?>">
|
| 347 |
+
<button class="fm-button show-filter-button medium" onclick="show_hide_filter(); return false;" title="Show Filters">
|
| 348 |
<span></span>
|
| 349 |
+
Show Filters
|
| 350 |
</button>
|
| 351 |
+
<button class="fm-button search-button small" onclick="fm_form_submit(event, 'admin_form'); return false;" title="Search">
|
| 352 |
+
<span></span>
|
| 353 |
+
Search
|
| 354 |
</button>
|
| 355 |
+
<button class="fm-button reset-button small" onclick="remove_all(); fm_form_submit(event, 'admin_form'); return false;" title="Reset">
|
| 356 |
+
<span></span>
|
| 357 |
+
Reset
|
| 358 |
</button>
|
| 359 |
</div>
|
| 360 |
<div class="fm-add-remove">
|
| 362 |
<button class="fm-button" onclick="toggleChBDiv(true); return false;">
|
| 363 |
Add/Remove Columns
|
| 364 |
</button>
|
| 365 |
+
<?php
|
| 366 |
+
WDW_FMC_Library::html_page_nav($lists['total'], $lists['limit'], 'admin_form'); ?>
|
| 367 |
<?php } ?>
|
| 368 |
<input type="hidden" name="pagination_clicked" id="pagination_clicked" value=""/>
|
| 369 |
</div>
|
contact-form-maker.php
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
* Plugin Name: Contact Form Maker
|
| 4 |
* Plugin URI: http://web-dorado.com/products/form-maker-wordpress.html
|
| 5 |
* Description: WordPress Contact Form Maker is a simple contact form builder, which allows the user with almost no knowledge of programming to create and edit different type of contact forms.
|
| 6 |
-
* Version: 1.8.
|
| 7 |
* Author: WebDorado
|
| 8 |
* Author URI: http://web-dorado.com/
|
| 9 |
* License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
|
@@ -246,10 +246,23 @@ function register_fmcemailverification_cpt(){
|
|
| 246 |
}
|
| 247 |
}
|
| 248 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 249 |
// Activate plugin.
|
| 250 |
function form_maker_activate_cfm() {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 251 |
$version = get_option("wd_form_maker_version");
|
| 252 |
-
$new_version = '1.8.
|
| 253 |
global $wpdb;
|
| 254 |
if (!$version) {
|
| 255 |
|
| 3 |
* Plugin Name: Contact Form Maker
|
| 4 |
* Plugin URI: http://web-dorado.com/products/form-maker-wordpress.html
|
| 5 |
* Description: WordPress Contact Form Maker is a simple contact form builder, which allows the user with almost no knowledge of programming to create and edit different type of contact forms.
|
| 6 |
+
* Version: 1.8.40
|
| 7 |
* Author: WebDorado
|
| 8 |
* Author URI: http://web-dorado.com/
|
| 9 |
* License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
|
| 246 |
}
|
| 247 |
}
|
| 248 |
|
| 249 |
+
function sample_admin_notice__success() {
|
| 250 |
+
echo '<style>div#message.updated{ display: none; }</style>';
|
| 251 |
+
?>
|
| 252 |
+
<div class="error notice-success is-dismissible">
|
| 253 |
+
<p><?php _e( "Contact Form Maker was deactivated because You have Form Maker Pro installed. Form Maker Pro includes all the functionality of Contact Form Maker and much more. Don't worry, you can still use and manage your old Contact Forms from Form Maker.", 'sample-text-domain' ); ?></p>
|
| 254 |
+
</div>
|
| 255 |
+
<?php
|
| 256 |
+
}
|
| 257 |
+
|
| 258 |
// Activate plugin.
|
| 259 |
function form_maker_activate_cfm() {
|
| 260 |
+
if(is_plugin_active("form-maker/form-maker.php")){
|
| 261 |
+
add_action( 'admin_notices', 'sample_admin_notice__success' );
|
| 262 |
+
return false;
|
| 263 |
+
}
|
| 264 |
$version = get_option("wd_form_maker_version");
|
| 265 |
+
$new_version = '1.8.40';
|
| 266 |
global $wpdb;
|
| 267 |
if (!$version) {
|
| 268 |
|
css/form_maker_tables.css
CHANGED
|
@@ -1,1142 +1,1144 @@
|
|
| 1 |
-
#main_div input[type="checkbox"], #main_div input[type="radio"] {
|
| 2 |
-
float: right !important;
|
| 3 |
-
margin: 3px 3px 3px 4px;
|
| 4 |
-
}
|
| 5 |
-
|
| 6 |
-
.wdform_column input[type="checkbox"],.wdform_column input[type="radio"] {
|
| 7 |
-
float: right !important;
|
| 8 |
-
margin: 3px 3px 3px 4px;
|
| 9 |
-
}
|
| 10 |
-
|
| 11 |
-
#take_temp .element_toolbar,
|
| 12 |
-
#take_temp .page_toolbar,
|
| 13 |
-
#take_temp .captcha_img,
|
| 14 |
-
#take_temp .wdform_stars {
|
| 15 |
-
display: none;
|
| 16 |
-
}
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
/*///////////////
|
| 20 |
-
new
|
| 21 |
-
//////////////*/
|
| 22 |
-
#TB_window,
|
| 23 |
-
#TB_overlay {
|
| 24 |
-
z-index: 10200;
|
| 25 |
-
}
|
| 26 |
-
|
| 27 |
-
fieldset input,
|
| 28 |
-
fieldset textarea,
|
| 29 |
-
fieldset select,
|
| 30 |
-
fieldset img,
|
| 31 |
-
fieldset button {
|
| 32 |
-
float:none !important;
|
| 33 |
-
}
|
| 34 |
-
|
| 35 |
-
fieldset input[type="text"],
|
| 36 |
-
fieldset input[type="password"],
|
| 37 |
-
fieldset input[type="number"],
|
| 38 |
-
fieldset select {
|
| 39 |
-
height: 27px !important;
|
| 40 |
-
margin: 2px 0 !important;
|
| 41 |
-
padding: 2px !important;
|
| 42 |
-
border-radius: 0;
|
| 43 |
-
width: 250px;
|
| 44 |
-
border: 1px solid #ccc;
|
| 45 |
-
box-shadow: none;
|
| 46 |
-
vertical-align: middle;
|
| 47 |
-
}
|
| 48 |
-
|
| 49 |
-
#when_edit {
|
| 50 |
-
position: absolute;
|
| 51 |
-
background-color: #666;
|
| 52 |
-
z-index: 101;
|
| 53 |
-
display: none;
|
| 54 |
-
width: 100%;
|
| 55 |
-
height: 100%;
|
| 56 |
-
opacity: 0.7;
|
| 57 |
-
filter: alpha(opacity=70);
|
| 58 |
-
}
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
#formMakerDiv {
|
| 62 |
-
position: fixed;
|
| 63 |
-
background-color: #666;
|
| 64 |
-
z-index: 100;
|
| 65 |
-
display: none;
|
| 66 |
-
left: 0;
|
| 67 |
-
top: 0;
|
| 68 |
-
width: 100%;
|
| 69 |
-
height: 100%;
|
| 70 |
-
opacity: 0.7;
|
| 71 |
-
filter: alpha(opacity=70);
|
| 72 |
-
}
|
| 73 |
-
|
| 74 |
-
#formMakerDiv1 {
|
| 75 |
-
padding-top: 20px;
|
| 76 |
-
position: fixed;
|
| 77 |
-
z-index: 10000;
|
| 78 |
-
top: 0;
|
| 79 |
-
left: 0;
|
| 80 |
-
display: none;
|
| 81 |
-
margin-left: 30px;
|
| 82 |
-
margin-top: 12px;
|
| 83 |
-
height: 93%;
|
| 84 |
-
overflow-y: scroll;
|
| 85 |
-
width:95%;
|
| 86 |
-
}
|
| 87 |
-
|
| 88 |
-
.formMakerDiv1_table {
|
| 89 |
-
font-family: Segoe UI !important;
|
| 90 |
-
background-color: #FFF;
|
| 91 |
-
}
|
| 92 |
-
|
| 93 |
-
#field_types {
|
| 94 |
-
border-right: 4px solid #E5E5E5;
|
| 95 |
-
background: #F2F2F2;
|
| 96 |
-
}
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
/* submissions */
|
| 101 |
-
|
| 102 |
-
#sbox-overlay {
|
| 103 |
-
z-index: 65555;
|
| 104 |
-
position: fixed;
|
| 105 |
-
top: 0px;
|
| 106 |
-
left: 0px;
|
| 107 |
-
visibility: visible;
|
| 108 |
-
zoom: 1;
|
| 109 |
-
background-color: #000000;
|
| 110 |
-
opacity: 0.7;
|
| 111 |
-
filter: alpha(opacity=70);
|
| 112 |
-
display: none;
|
| 113 |
-
}
|
| 114 |
-
|
| 115 |
-
#ChBDiv {
|
| 116 |
-
background-color: #FFFFFF;
|
| 117 |
-
width: 350px;
|
| 118 |
-
max-height: 350px;
|
| 119 |
-
overflow-y: auto;
|
| 120 |
-
padding: 20px;
|
| 121 |
-
position: fixed;
|
| 122 |
-
top: 100px;
|
| 123 |
-
display: none;
|
| 124 |
-
border: 2px solid #AAAAAA;
|
| 125 |
-
z-index: 65556;
|
| 126 |
-
}
|
| 127 |
-
|
| 128 |
-
.fm-submissions-page {
|
| 129 |
-
width:99%;
|
| 130 |
-
}
|
| 131 |
-
|
| 132 |
-
.submit_content {
|
| 133 |
-
overflow-x: auto;
|
| 134 |
-
}
|
| 135 |
-
|
| 136 |
-
.fm-reports {
|
| 137 |
-
text-align: left;
|
| 138 |
-
display:inline-block;
|
| 139 |
-
vertical-align: middle;
|
| 140 |
-
}
|
| 141 |
-
|
| 142 |
-
.fm-tools-button {
|
| 143 |
-
border: 1px solid;
|
| 144 |
-
border-radius: 0px;
|
| 145 |
-
text-align: left;
|
| 146 |
-
color: #0288C5;
|
| 147 |
-
height: 40px;
|
| 148 |
-
line-height: 40px;
|
| 149 |
-
display: inline-block;
|
| 150 |
-
padding: 0px 10px;
|
| 151 |
-
background: #F1F1F1;
|
| 152 |
-
border-color: #F1F1F1;
|
| 153 |
-
font-size:15px;
|
| 154 |
-
}
|
| 155 |
-
|
| 156 |
-
.fm-total_rate, .fm-total_entries, .fm-total_views {
|
| 157 |
-
display: inline-block;
|
| 158 |
-
line-height: 18px;
|
| 159 |
-
padding: 5px 10px;
|
| 160 |
-
border-radius: 37px;
|
| 161 |
-
font-size: 16px;
|
| 162 |
-
background: #fff;
|
| 163 |
-
border: none;
|
| 164 |
-
margin-right: 6px;
|
| 165 |
-
}
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
.fm-form-title {
|
| 169 |
-
text-align: left;
|
| 170 |
-
display: inline-block;
|
| 171 |
-
height: 46px;
|
| 172 |
-
line-height: 46px;
|
| 173 |
-
font-size: 28px;
|
| 174 |
-
font-weight: bold;
|
| 175 |
-
max-width: 450px;
|
| 176 |
-
overflow: hidden;
|
| 177 |
-
text-overflow: ellipsis;
|
| 178 |
-
white-space: nowrap;
|
| 179 |
-
}
|
| 180 |
-
|
| 181 |
-
.submissions-actions {
|
| 182 |
-
height: 70px;
|
| 183 |
-
line-height: 50px;
|
| 184 |
-
}
|
| 185 |
-
|
| 186 |
-
.submissions-toolbar {
|
| 187 |
-
background: #fff;
|
| 188 |
-
height: 100px;
|
| 189 |
-
line-height: 100px;
|
| 190 |
-
}
|
| 191 |
-
|
| 192 |
-
.submissions-tools {
|
| 193 |
-
padding: 0 10px;
|
| 194 |
-
}
|
| 195 |
-
|
| 196 |
-
.submissions-tools select {
|
| 197 |
-
height: 41px;
|
| 198 |
-
width:280px;
|
| 199 |
-
max-width: 280px;
|
| 200 |
-
border: 1px solid #f1f1f1;
|
| 201 |
-
font-style: italic;
|
| 202 |
-
border-radius: 0px;
|
| 203 |
-
margin-left:7px;
|
| 204 |
-
box-shadow:none;
|
| 205 |
-
}
|
| 206 |
-
|
| 207 |
-
.fm-export-tools {
|
| 208 |
-
float:right;
|
| 209 |
-
}
|
| 210 |
-
|
| 211 |
-
.fm-export-tools span {
|
| 212 |
-
display: inline-block;
|
| 213 |
-
font-size:15px;
|
| 214 |
-
color:#0288C5;
|
| 215 |
-
}
|
| 216 |
-
|
| 217 |
-
.fm-export-tools button{
|
| 218 |
-
cursor:pointer;
|
| 219 |
-
}
|
| 220 |
-
|
| 221 |
-
.fm-search-tools {
|
| 222 |
-
float:left;
|
| 223 |
-
}
|
| 224 |
-
|
| 225 |
-
.fm-search-tools button {
|
| 226 |
-
margin-right:2px;
|
| 227 |
-
}
|
| 228 |
-
|
| 229 |
-
.fm-add-remove{
|
| 230 |
-
float:right;
|
| 231 |
-
}
|
| 232 |
-
|
| 233 |
-
.fm-add-remove button {
|
| 234 |
-
font-size: 13px;
|
| 235 |
-
background: #4EC0D9;
|
| 236 |
-
width: 154px;
|
| 237 |
-
margin-right:15px;
|
| 238 |
-
}
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
.fm-statistics{
|
| 242 |
-
background: #fff;
|
| 243 |
-
padding: 10px 10px 20px 10px;
|
| 244 |
-
}
|
| 245 |
-
|
| 246 |
-
.fm-statistics .stats tr {
|
| 247 |
-
border: none !important;
|
| 248 |
-
}
|
| 249 |
-
|
| 250 |
-
.fm-statistics .stats td {
|
| 251 |
-
border: none !important;
|
| 252 |
-
padding: 5px 3px;
|
| 253 |
-
vertical-align: middle;
|
| 254 |
-
}
|
| 255 |
-
|
| 256 |
-
.fm-statistics .stats select{
|
| 257 |
-
height: 31px;
|
| 258 |
-
width: 298px;
|
| 259 |
-
max-width: 298px;
|
| 260 |
-
border: 1px solid #E6E4E4;
|
| 261 |
-
font-style: italic;
|
| 262 |
-
border-radius: 0px;
|
| 263 |
-
margin-left: 7px;
|
| 264 |
-
box-shadow: none;
|
| 265 |
-
}
|
| 266 |
-
|
| 267 |
-
.fm-statistics #div_stats .field-label {
|
| 268 |
-
font-size: 16px;
|
| 269 |
-
font-weight: bold;
|
| 270 |
-
}
|
| 271 |
-
|
| 272 |
-
.fm-statistics .stats button{
|
| 273 |
-
display: inline-block;
|
| 274 |
-
height: 27px;
|
| 275 |
-
line-height: 27px;
|
| 276 |
-
border-radius: 0px;
|
| 277 |
-
font-size: 12px;
|
| 278 |
-
font-weight: bold;
|
| 279 |
-
padding: 0 14px;
|
| 280 |
-
cursor: pointer;
|
| 281 |
-
text-align: center;
|
| 282 |
-
color: #fff;
|
| 283 |
-
border: none;
|
| 284 |
-
background: #4EC0D9;
|
| 285 |
-
}
|
| 286 |
-
|
| 287 |
-
.fm-statistics .stats input{
|
| 288 |
-
border-radius: 0px;
|
| 289 |
-
border: 1px solid #E6E4E4;
|
| 290 |
-
box-shadow: none;
|
| 291 |
-
vertical-align: middle;
|
| 292 |
-
}
|
| 293 |
-
|
| 294 |
-
.fm-statistics .stats label{
|
| 295 |
-
font-size:14px;
|
| 296 |
-
}
|
| 297 |
-
|
| 298 |
-
.fm-statistics .label0{
|
| 299 |
-
background:#4EC0D9;
|
| 300 |
-
border: 2px solid #4EC0D9;
|
| 301 |
-
}
|
| 302 |
-
|
| 303 |
-
.fm-statistics .label1
|
| 304 |
-
{
|
| 305 |
-
background:#DDCC7F;
|
| 306 |
-
border: 2px solid #DDCC7F;
|
| 307 |
-
}
|
| 308 |
-
|
| 309 |
-
.fm-statistics .bordered0:before
|
| 310 |
-
{
|
| 311 |
-
content: " ";
|
| 312 |
-
width:20px;
|
| 313 |
-
height:16px;
|
| 314 |
-
margin-left: -15px;
|
| 315 |
-
background:#5FE2FF;
|
| 316 |
-
display: inline-block;
|
| 317 |
-
-webkit-transform: scale(1) rotate(0deg) translateX(0px) translateY(0px) skewX(-25deg) skewY(0deg);
|
| 318 |
-
}
|
| 319 |
-
|
| 320 |
-
.fm-statistics .bordered1:before
|
| 321 |
-
{
|
| 322 |
-
content: " ";
|
| 323 |
-
width:20px;
|
| 324 |
-
height:16px;
|
| 325 |
-
margin-left: -15px;
|
| 326 |
-
background:#F9E89C;
|
| 327 |
-
display: inline-block;
|
| 328 |
-
-webkit-transform: scale(1) rotate(0deg) translateX(0px) translateY(0px) skewX(-25deg) skewY(0deg);
|
| 329 |
-
}
|
| 330 |
-
|
| 331 |
-
.fm-statistics .adminlist{
|
| 332 |
-
border-collapse: separate;
|
| 333 |
-
font-size:14px;
|
| 334 |
-
width: 100%;
|
| 335 |
-
}
|
| 336 |
-
|
| 337 |
-
.fm-statistics .adminlist th
|
| 338 |
-
{
|
| 339 |
-
font-size:14px;
|
| 340 |
-
padding: 10px 0;
|
| 341 |
-
}
|
| 342 |
-
|
| 343 |
-
.fm-statistics .adminlist td
|
| 344 |
-
{
|
| 345 |
-
border: none !important;
|
| 346 |
-
}
|
| 347 |
-
|
| 348 |
-
.fm-statistics .adminlist td:first-child
|
| 349 |
-
{
|
| 350 |
-
color:#fff;
|
| 351 |
-
padding: 4px;
|
| 352 |
-
}
|
| 353 |
-
|
| 354 |
-
|
| 355 |
-
.fm_layout {
|
| 356 |
-
width:99%;
|
| 357 |
-
padding:15px 0;
|
| 358 |
-
}
|
| 359 |
-
|
| 360 |
-
.fm-layout-actions:after {
|
| 361 |
-
clear:both;
|
| 362 |
-
content:'';
|
| 363 |
-
display:block;
|
| 364 |
-
}
|
| 365 |
-
|
| 366 |
-
.fm-layout-content {
|
| 367 |
-
background:#fff;
|
| 368 |
-
padding:10px 10px 20px 10px;
|
| 369 |
-
margin-top:15px;
|
| 370 |
-
}
|
| 371 |
-
/*///////////////
|
| 372 |
-
new end
|
| 373 |
-
//////////////*/
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
|
| 377 |
-
/* form options */
|
| 378 |
-
.fm-form-options {
|
| 379 |
-
background:#fff;
|
| 380 |
-
padding: 13px;
|
| 381 |
-
}
|
| 382 |
-
|
| 383 |
-
.submenu-box {
|
| 384 |
-
width: 100%;
|
| 385 |
-
padding: 15px 0;
|
| 386 |
-
}
|
| 387 |
-
|
| 388 |
-
.submenu-pad {
|
| 389 |
-
float:left;
|
| 390 |
-
}
|
| 391 |
-
|
| 392 |
-
.submenu-box:after {
|
| 393 |
-
display:block;
|
| 394 |
-
content:'';
|
| 395 |
-
clear:both;
|
| 396 |
-
}
|
| 397 |
-
|
| 398 |
-
#submenu {
|
| 399 |
-
margin: 0;
|
| 400 |
-
padding: 0;
|
| 401 |
-
}
|
| 402 |
-
|
| 403 |
-
#submenu li {
|
| 404 |
-
display: inline;
|
| 405 |
-
margin: 0;
|
| 406 |
-
padding: 0;
|
| 407 |
-
}
|
| 408 |
-
|
| 409 |
-
#submenu a:hover,
|
| 410 |
-
#submenu a.active,
|
| 411 |
-
#submenu span.nolink.active {
|
| 412 |
-
background: none repeat scroll 0 0 #FFFFFF;
|
| 413 |
-
border: 1px solid #46ACC3
|
| 414 |
-
}
|
| 415 |
-
|
| 416 |
-
#submenu a:focus {
|
| 417 |
-
box-shadow: none !important;
|
| 418 |
-
}
|
| 419 |
-
|
| 420 |
-
#submenu li a,
|
| 421 |
-
#submenu span.nolink {
|
| 422 |
-
border: 1px solid #F1F1F1;
|
| 423 |
-
color: #444;
|
| 424 |
-
cursor: pointer;
|
| 425 |
-
font-size: 13px;
|
| 426 |
-
font-weight: bold;
|
| 427 |
-
padding: 12px;
|
| 428 |
-
background: #fff;
|
| 429 |
-
text-decoration: none;
|
| 430 |
-
display:inline-block;
|
| 431 |
-
}
|
| 432 |
-
|
| 433 |
-
|
| 434 |
-
fieldset.adminform {
|
| 435 |
-
width: 99%;
|
| 436 |
-
margin: 10px 0;
|
| 437 |
-
}
|
| 438 |
-
|
| 439 |
-
fieldset.adminform legend {
|
| 440 |
-
color: #444;
|
| 441 |
-
font-weight: bold;
|
| 442 |
-
font-size: 16px;
|
| 443 |
-
padding: 10px 3px;
|
| 444 |
-
}
|
| 445 |
-
|
| 446 |
-
.wp-list-table td{
|
| 447 |
-
vertical-align: middle !important;
|
| 448 |
-
}
|
| 449 |
-
|
| 450 |
-
table.admintable td.key,
|
| 451 |
-
table.admintable td.paramlist_key {
|
| 452 |
-
background-color: #F6F6F6;
|
| 453 |
-
border-bottom: 1px solid #E9E9E9;
|
| 454 |
-
border-right: 1px solid #E9E9E9;
|
| 455 |
-
color: #666666;
|
| 456 |
-
font-weight: bold;
|
| 457 |
-
text-align: right;
|
| 458 |
-
width: 200px;
|
| 459 |
-
}
|
| 460 |
-
table.admintable {
|
| 461 |
-
width: 100%;
|
| 462 |
-
}
|
| 463 |
-
|
| 464 |
-
.fm-condition {
|
| 465 |
-
padding:20px 0;
|
| 466 |
-
display:table;
|
| 467 |
-
border-bottom:1px solid #00A0D2;
|
| 468 |
-
}
|
| 469 |
-
|
| 470 |
-
|
| 471 |
-
|
| 472 |
-
.fm_fieldset_active {
|
| 473 |
-
display: block;
|
| 474 |
-
}
|
| 475 |
-
|
| 476 |
-
.fm_fieldset_deactive {
|
| 477 |
-
display: none;
|
| 478 |
-
}
|
| 479 |
-
|
| 480 |
-
.wrap * {
|
| 481 |
-
font-size: 13px;
|
| 482 |
-
}
|
| 483 |
-
|
| 484 |
-
.add_tag_th {
|
| 485 |
-
padding-left: 21px;
|
| 486 |
-
font-size: 12px;
|
| 487 |
-
font-family: sans-serif;
|
| 488 |
-
}
|
| 489 |
-
|
| 490 |
-
.pointer{
|
| 491 |
-
cursor: pointer;
|
| 492 |
-
}
|
| 493 |
-
|
| 494 |
-
.table_small_col {
|
| 495 |
-
text-align: center !important;
|
| 496 |
-
width: 45px;
|
| 497 |
-
}
|
| 498 |
-
|
| 499 |
-
.table_medium_col {
|
| 500 |
-
text-align: center !important;
|
| 501 |
-
width: 70px;
|
| 502 |
-
}
|
| 503 |
-
|
| 504 |
-
.table_big_col {
|
| 505 |
-
text-align: center !important;
|
| 506 |
-
width: 80px;
|
| 507 |
-
}
|
| 508 |
-
|
| 509 |
-
.table_large_col {
|
| 510 |
-
text-align: center !important;
|
| 511 |
-
width: 200px;
|
| 512 |
-
}
|
| 513 |
-
|
| 514 |
-
.table_large_col input{
|
| 515 |
-
width: 180px;
|
| 516 |
-
}
|
| 517 |
-
|
| 518 |
-
.table_medium_col_uncenter {
|
| 519 |
-
width: 80px;
|
| 520 |
-
}
|
| 521 |
-
|
| 522 |
-
.table_extra_large_col {
|
| 523 |
-
padding: 4px !important;
|
| 524 |
-
width: 150px !important;
|
| 525 |
-
}
|
| 526 |
-
|
| 527 |
-
.first-page,
|
| 528 |
-
.prev-page,
|
| 529 |
-
.next-page,
|
| 530 |
-
.last-page,
|
| 531 |
-
.table_extra_large_col a,
|
| 532 |
-
.table_medium_col a,
|
| 533 |
-
.table_big_col a,
|
| 534 |
-
.table_small_col a {
|
| 535 |
-
cursor: pointer;
|
| 536 |
-
}
|
| 537 |
-
|
| 538 |
-
|
| 539 |
-
.handle {
|
| 540 |
-
background: url("../images/draggable.png") no-repeat /*scroll 6px 9px*/ transparent;
|
| 541 |
-
border: none;
|
| 542 |
-
height: 15px;
|
| 543 |
-
margin: 0 auto;
|
| 544 |
-
vertical-align: middle;
|
| 545 |
-
width: 15px;
|
| 546 |
-
}
|
| 547 |
-
|
| 548 |
-
.block_icon {
|
| 549 |
-
background: url("../images/buttons.png") no-repeat 15% 75%;
|
| 550 |
-
border: none;
|
| 551 |
-
display:inline-block;
|
| 552 |
-
height: 43px;
|
| 553 |
-
width: 31px;
|
| 554 |
-
vertical-align: middle;
|
| 555 |
-
}
|
| 556 |
-
|
| 557 |
-
.theme_icon {
|
| 558 |
-
background: url("../images/buttons.png") no-repeat 7% 77%;
|
| 559 |
-
border: none;
|
| 560 |
-
height: 42px;
|
| 561 |
-
width: 44px;
|
| 562 |
-
display: inline-block;
|
| 563 |
-
vertical-align: middle;
|
| 564 |
-
}
|
| 565 |
-
|
| 566 |
-
.uninstall_icon {
|
| 567 |
-
background: url("../images/buttons.png") no-repeat 0% 75%;
|
| 568 |
-
border: none;
|
| 569 |
-
height: 42px;
|
| 570 |
-
width: 37px;
|
| 571 |
-
display: inline-block;
|
| 572 |
-
vertical-align: middle;
|
| 573 |
-
}
|
| 574 |
-
|
| 575 |
-
.connectedSortable {
|
| 576 |
-
cursor: move;
|
| 577 |
-
}
|
| 578 |
-
|
| 579 |
-
.fm_label {
|
| 580 |
-
font-weight: bold;
|
| 581 |
-
width: 100px;
|
| 582 |
-
}
|
| 583 |
-
|
| 584 |
-
.fm_label_options {
|
| 585 |
-
font-weight: bold;
|
| 586 |
-
vertical-align: top;
|
| 587 |
-
width: 150px;
|
| 588 |
-
}
|
| 589 |
-
|
| 590 |
-
.fm_int_input {
|
| 591 |
-
width: 80px;
|
| 592 |
-
}
|
| 593 |
-
|
| 594 |
-
.fm_text_input {
|
| 595 |
-
width: 190px;
|
| 596 |
-
}
|
| 597 |
-
|
| 598 |
-
.updated,
|
| 599 |
-
.error {
|
| 600 |
-
margin: 5px 0 2px !important;
|
| 601 |
-
}
|
| 602 |
-
|
| 603 |
-
.theme_type {
|
| 604 |
-
background-color: #F4F4F4;
|
| 605 |
-
border: 1px solid #8F8D8D;
|
| 606 |
-
border-radius: 8px 8px 8px 8px;
|
| 607 |
-
cursor: pointer;
|
| 608 |
-
display: inline-block;
|
| 609 |
-
font-size: 16px;
|
| 610 |
-
height: 24px;
|
| 611 |
-
padding-top: 5px;
|
| 612 |
-
text-align: center;
|
| 613 |
-
vertical-align: middle;
|
| 614 |
-
width: 123px;
|
| 615 |
-
margin: 2px 0px 2px 0px;
|
| 616 |
-
}
|
| 617 |
-
|
| 618 |
-
.ui-slider-handle {
|
| 619 |
-
cursor: pointer !important;
|
| 620 |
-
}
|
| 621 |
-
|
| 622 |
-
.fm_search_value {
|
| 623 |
-
height: 2em;
|
| 624 |
-
margin: 0 0 4px;
|
| 625 |
-
}
|
| 626 |
-
|
| 627 |
-
|
| 628 |
-
|
| 629 |
-
#form_id_tempform_view_img1 td {
|
| 630 |
-
padding: 0;
|
| 631 |
-
}
|
| 632 |
-
|
| 633 |
-
|
| 634 |
-
.payment_info_fc {
|
| 635 |
-
width: 72px;
|
| 636 |
-
}
|
| 637 |
-
|
| 638 |
-
|
| 639 |
-
|
| 640 |
-
|
| 641 |
-
|
| 642 |
-
|
| 643 |
-
|
| 644 |
-
|
| 645 |
-
.sub-align {
|
| 646 |
-
vertical-align: middle !important;
|
| 647 |
-
}
|
| 648 |
-
|
| 649 |
-
.count_col {
|
| 650 |
-
padding: 7px 7px 8px;
|
| 651 |
-
min-width: 10px !important;
|
| 652 |
-
max-width: 30px !important;
|
| 653 |
-
text-align: right !important;
|
| 654 |
-
}
|
| 655 |
-
|
| 656 |
-
#fields_filter {
|
| 657 |
-
background-color: #FAFAFA;
|
| 658 |
-
}
|
| 659 |
-
|
| 660 |
-
#fields_filter input {
|
| 661 |
-
font-size: 12px;
|
| 662 |
-
padding: 0 !important;
|
| 663 |
-
margin: 0 !important;
|
| 664 |
-
vertical-align: middle;
|
| 665 |
-
}
|
| 666 |
-
|
| 667 |
-
#fields_filter td,
|
| 668 |
-
#fields_filter th {
|
| 669 |
-
font-size: 12px;
|
| 670 |
-
margin: 0 !important;
|
| 671 |
-
border: none;
|
| 672 |
-
vertical-align: middle;
|
| 673 |
-
}
|
| 674 |
-
|
| 675 |
-
.submitdate_fc * {
|
| 676 |
-
padding: 0 !important;
|
| 677 |
-
}
|
| 678 |
-
|
| 679 |
-
.submit_content pre {
|
| 680 |
-
font-family: sans-serif;
|
| 681 |
-
}
|
| 682 |
-
|
| 683 |
-
.submit_content .table_large_col {
|
| 684 |
-
text-align: left !important;
|
| 685 |
-
white-space: nowrap;
|
| 686 |
-
}
|
| 687 |
-
|
| 688 |
-
.submit_content table {
|
| 689 |
-
table-layout: auto;
|
| 690 |
-
}
|
| 691 |
-
|
| 692 |
-
.submit_content .column-autor {
|
| 693 |
-
max-width: 200px;
|
| 694 |
-
min-width: 120px;
|
| 695 |
-
}
|
| 696 |
-
|
| 697 |
-
.submitid_fc {
|
| 698 |
-
min-width: 10px !important;
|
| 699 |
-
max-width: 30px !important;
|
| 700 |
-
text-align: left !important;
|
| 701 |
-
}
|
| 702 |
-
|
| 703 |
-
.submitid_fc a {
|
| 704 |
-
padding-left: 2px;
|
| 705 |
-
}
|
| 706 |
-
|
| 707 |
-
.submit_content #cb,
|
| 708 |
-
.submit_content #cb * {
|
| 709 |
-
padding: 0;
|
| 710 |
-
vertical-align: middle;
|
| 711 |
-
}
|
| 712 |
-
|
| 713 |
-
.wdform-calendar-button {
|
| 714 |
-
padding: 0;
|
| 715 |
-
}
|
| 716 |
-
|
| 717 |
-
.fm_options_label,
|
| 718 |
-
.fm_options_value {
|
| 719 |
-
background-color: #FFFFFF;
|
| 720 |
-
border: 1px solid #cccccc !important;
|
| 721 |
-
padding: 15px;
|
| 722 |
-
}
|
| 723 |
-
.fm_options_label {
|
| 724 |
-
width: 170px;
|
| 725 |
-
}
|
| 726 |
-
.fm_delete_img {
|
| 727 |
-
cursor: pointer;
|
| 728 |
-
margin: 0 0 0 2px;
|
| 729 |
-
padding: 0;
|
| 730 |
-
vertical-align: middle;
|
| 731 |
-
}
|
| 732 |
-
|
| 733 |
-
|
| 734 |
-
|
| 735 |
-
|
| 736 |
-
|
| 737 |
-
|
| 738 |
-
|
| 739 |
-
|
| 740 |
-
|
| 741 |
-
button:focus {
|
| 742 |
-
outline:none !important;
|
| 743 |
-
}
|
| 744 |
-
|
| 745 |
-
|
| 746 |
-
.fm-button{
|
| 747 |
-
display: inline-block;
|
| 748 |
-
height: 40px;
|
| 749 |
-
line-height: 38px;
|
| 750 |
-
border-radius: 0px;
|
| 751 |
-
font-size: 15px;
|
| 752 |
-
font-weight: normal;
|
| 753 |
-
padding: 0;
|
| 754 |
-
cursor: pointer;
|
| 755 |
-
text-align: center;
|
| 756 |
-
color: #fff;
|
| 757 |
-
border: none;
|
| 758 |
-
}
|
| 759 |
-
|
| 760 |
-
.fm-button span{
|
| 761 |
-
width: 46px;
|
| 762 |
-
height: 40px;
|
| 763 |
-
display: inline-block;
|
| 764 |
-
background-size: contain;
|
| 765 |
-
background: transparent;
|
| 766 |
-
background-repeat: no-repeat;
|
| 767 |
-
background-position: 0 0;
|
| 768 |
-
border-radius: 0px;
|
| 769 |
-
float: left;
|
| 770 |
-
margin-top: -1px;
|
| 771 |
-
margin-left: -1px;
|
| 772 |
-
}
|
| 773 |
-
|
| 774 |
-
.fm-button.small {
|
| 775 |
-
width: 108px;
|
| 776 |
-
}
|
| 777 |
-
|
| 778 |
-
.fm-button.medium {
|
| 779 |
-
width: 150px;
|
| 780 |
-
}
|
| 781 |
-
|
| 782 |
-
.fm-button.large {
|
| 783 |
-
width: 170px;
|
| 784 |
-
}
|
| 785 |
-
|
| 786 |
-
.fm-button.add-button {
|
| 787 |
-
background-color: #4EC0D9;
|
| 788 |
-
border: 1px solid transparent;
|
| 789 |
-
}
|
| 790 |
-
|
| 791 |
-
.fm-button.add-button span{
|
| 792 |
-
background: url("../images/buttons.png") no-repeat 0% 0%;
|
| 793 |
-
}
|
| 794 |
-
|
| 795 |
-
.fm-button.add-new-button {
|
| 796 |
-
background-color: #4EC0D9;
|
| 797 |
-
border: 1px solid transparent;
|
| 798 |
-
}
|
| 799 |
-
|
| 800 |
-
.fm-button.add-new-button span{
|
| 801 |
-
background: url("../images/buttons.png") no-repeat 71.5% 0%;
|
| 802 |
-
}
|
| 803 |
-
|
| 804 |
-
|
| 805 |
-
.fm-icon {
|
| 806 |
-
width:35px;
|
| 807 |
-
height:36px;
|
| 808 |
-
border-radius: 0px;
|
| 809 |
-
cursor: pointer;
|
| 810 |
-
border: none;
|
| 811 |
-
vertical-align: middle;
|
| 812 |
-
}
|
| 813 |
-
|
| 814 |
-
|
| 815 |
-
|
| 816 |
-
|
| 817 |
-
|
| 818 |
-
|
| 819 |
-
|
| 820 |
-
|
| 821 |
-
|
| 822 |
-
|
| 823 |
-
|
| 824 |
-
|
| 825 |
-
|
| 826 |
-
|
| 827 |
-
|
| 828 |
-
|
| 829 |
-
|
| 830 |
-
|
| 831 |
-
|
| 832 |
-
|
| 833 |
-
|
| 834 |
-
|
| 835 |
-
|
| 836 |
-
|
| 837 |
-
|
| 838 |
-
|
| 839 |
-
|
| 840 |
-
|
| 841 |
-
|
| 842 |
-
|
| 843 |
-
|
| 844 |
-
|
| 845 |
-
|
| 846 |
-
|
| 847 |
-
|
| 848 |
-
|
| 849 |
-
|
| 850 |
-
|
| 851 |
-
|
| 852 |
-
|
| 853 |
-
|
| 854 |
-
|
| 855 |
-
|
| 856 |
-
|
| 857 |
-
|
| 858 |
-
|
| 859 |
-
|
| 860 |
-
|
| 861 |
-
|
| 862 |
-
|
| 863 |
-
|
| 864 |
-
|
| 865 |
-
|
| 866 |
-
|
| 867 |
-
|
| 868 |
-
|
| 869 |
-
|
| 870 |
-
|
| 871 |
-
|
| 872 |
-
|
| 873 |
-
|
| 874 |
-
|
| 875 |
-
|
| 876 |
-
|
| 877 |
-
|
| 878 |
-
|
| 879 |
-
|
| 880 |
-
|
| 881 |
-
|
| 882 |
-
|
| 883 |
-
|
| 884 |
-
|
| 885 |
-
|
| 886 |
-
|
| 887 |
-
|
| 888 |
-
|
| 889 |
-
|
| 890 |
-
|
| 891 |
-
|
| 892 |
-
|
| 893 |
-
|
| 894 |
-
|
| 895 |
-
|
| 896 |
-
|
| 897 |
-
|
| 898 |
-
|
| 899 |
-
|
| 900 |
-
|
| 901 |
-
.fm-
|
| 902 |
-
.fm-button.
|
| 903 |
-
.fm-button.
|
| 904 |
-
.fm-button.
|
| 905 |
-
|
| 906 |
-
|
| 907 |
-
|
| 908 |
-
|
| 909 |
-
|
| 910 |
-
|
| 911 |
-
|
| 912 |
-
|
| 913 |
-
|
| 914 |
-
|
| 915 |
-
|
| 916 |
-
|
| 917 |
-
|
| 918 |
-
|
| 919 |
-
|
| 920 |
-
|
| 921 |
-
|
| 922 |
-
|
| 923 |
-
|
| 924 |
-
|
| 925 |
-
|
| 926 |
-
|
| 927 |
-
|
| 928 |
-
|
| 929 |
-
|
| 930 |
-
|
| 931 |
-
|
| 932 |
-
|
| 933 |
-
|
| 934 |
-
|
| 935 |
-
|
| 936 |
-
|
| 937 |
-
|
| 938 |
-
|
| 939 |
-
|
| 940 |
-
|
| 941 |
-
|
| 942 |
-
|
| 943 |
-
|
| 944 |
-
|
| 945 |
-
|
| 946 |
-
|
| 947 |
-
|
| 948 |
-
|
| 949 |
-
|
| 950 |
-
|
| 951 |
-
|
| 952 |
-
|
| 953 |
-
|
| 954 |
-
|
| 955 |
-
|
| 956 |
-
|
| 957 |
-
|
| 958 |
-
|
| 959 |
-
|
| 960 |
-
|
| 961 |
-
|
| 962 |
-
|
| 963 |
-
|
| 964 |
-
|
| 965 |
-
|
| 966 |
-
|
| 967 |
-
|
| 968 |
-
|
| 969 |
-
|
| 970 |
-
|
| 971 |
-
|
| 972 |
-
|
| 973 |
-
|
| 974 |
-
|
| 975 |
-
|
| 976 |
-
|
| 977 |
-
|
| 978 |
-
|
| 979 |
-
|
| 980 |
-
|
| 981 |
-
|
| 982 |
-
|
| 983 |
-
|
| 984 |
-
|
| 985 |
-
|
| 986 |
-
|
| 987 |
-
|
| 988 |
-
|
| 989 |
-
|
| 990 |
-
|
| 991 |
-
|
| 992 |
-
|
| 993 |
-
|
| 994 |
-
|
| 995 |
-
|
| 996 |
-
|
| 997 |
-
|
| 998 |
-
|
| 999 |
-
|
| 1000 |
-
|
| 1001 |
-
|
| 1002 |
-
|
| 1003 |
-
|
| 1004 |
-
|
| 1005 |
-
|
| 1006 |
-
|
| 1007 |
-
|
| 1008 |
-
|
| 1009 |
-
|
| 1010 |
-
|
| 1011 |
-
|
| 1012 |
-
|
| 1013 |
-
|
| 1014 |
-
|
| 1015 |
-
|
| 1016 |
-
|
| 1017 |
-
|
| 1018 |
-
|
| 1019 |
-
|
| 1020 |
-
|
| 1021 |
-
|
| 1022 |
-
|
| 1023 |
-
|
| 1024 |
-
|
| 1025 |
-
|
| 1026 |
-
|
| 1027 |
-
|
| 1028 |
-
|
| 1029 |
-
|
| 1030 |
-
|
| 1031 |
-
|
| 1032 |
-
|
| 1033 |
-
|
| 1034 |
-
|
| 1035 |
-
|
| 1036 |
-
|
| 1037 |
-
|
| 1038 |
-
|
| 1039 |
-
|
| 1040 |
-
|
| 1041 |
-
|
| 1042 |
-
|
| 1043 |
-
|
| 1044 |
-
|
| 1045 |
-
|
| 1046 |
-
|
| 1047 |
-
|
| 1048 |
-
|
| 1049 |
-
|
| 1050 |
-
|
| 1051 |
-
|
| 1052 |
-
|
| 1053 |
-
|
| 1054 |
-
|
| 1055 |
-
|
| 1056 |
-
|
| 1057 |
-
|
| 1058 |
-
|
| 1059 |
-
|
| 1060 |
-
|
| 1061 |
-
|
| 1062 |
-
|
| 1063 |
-
|
| 1064 |
-
|
| 1065 |
-
|
| 1066 |
-
|
| 1067 |
-
|
| 1068 |
-
|
| 1069 |
-
|
| 1070 |
-
|
| 1071 |
-
|
| 1072 |
-
|
| 1073 |
-
|
| 1074 |
-
|
| 1075 |
-
|
| 1076 |
-
|
| 1077 |
-
|
| 1078 |
-
background
|
| 1079 |
-
|
| 1080 |
-
|
| 1081 |
-
|
| 1082 |
-
|
| 1083 |
-
|
| 1084 |
-
|
| 1085 |
-
background
|
| 1086 |
-
|
| 1087 |
-
|
| 1088 |
-
|
| 1089 |
-
|
| 1090 |
-
|
| 1091 |
-
|
| 1092 |
-
|
| 1093 |
-
|
| 1094 |
-
|
| 1095 |
-
|
| 1096 |
-
|
| 1097 |
-
|
| 1098 |
-
|
| 1099 |
-
|
| 1100 |
-
|
| 1101 |
-
|
| 1102 |
-
|
| 1103 |
-
|
| 1104 |
-
|
| 1105 |
-
|
| 1106 |
-
|
| 1107 |
-
|
| 1108 |
-
|
| 1109 |
-
|
| 1110 |
-
|
| 1111 |
-
|
| 1112 |
-
|
| 1113 |
-
|
| 1114 |
-
|
| 1115 |
-
|
| 1116 |
-
|
| 1117 |
-
|
| 1118 |
-
|
| 1119 |
-
|
| 1120 |
-
|
| 1121 |
-
|
| 1122 |
-
|
| 1123 |
-
|
| 1124 |
-
|
| 1125 |
-
|
| 1126 |
-
|
| 1127 |
-
|
| 1128 |
-
|
| 1129 |
-
|
| 1130 |
-
|
| 1131 |
-
|
| 1132 |
-
|
| 1133 |
-
|
| 1134 |
-
|
| 1135 |
-
|
| 1136 |
-
|
| 1137 |
-
|
| 1138 |
-
|
| 1139 |
-
|
| 1140 |
-
|
| 1141 |
-
|
| 1142 |
-
|
|
|
|
|
|
| 1 |
+
#main_div input[type="checkbox"], #main_div input[type="radio"] {
|
| 2 |
+
float: right !important;
|
| 3 |
+
margin: 3px 3px 3px 4px;
|
| 4 |
+
}
|
| 5 |
+
|
| 6 |
+
.wdform_column input[type="checkbox"],.wdform_column input[type="radio"] {
|
| 7 |
+
float: right !important;
|
| 8 |
+
margin: 3px 3px 3px 4px;
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
#take_temp .element_toolbar,
|
| 12 |
+
#take_temp .page_toolbar,
|
| 13 |
+
#take_temp .captcha_img,
|
| 14 |
+
#take_temp .wdform_stars {
|
| 15 |
+
display: none;
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
/*///////////////
|
| 20 |
+
new
|
| 21 |
+
//////////////*/
|
| 22 |
+
#TB_window,
|
| 23 |
+
#TB_overlay {
|
| 24 |
+
z-index: 10200;
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
fieldset input,
|
| 28 |
+
fieldset textarea,
|
| 29 |
+
fieldset select,
|
| 30 |
+
fieldset img,
|
| 31 |
+
fieldset button {
|
| 32 |
+
float:none !important;
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
fieldset input[type="text"],
|
| 36 |
+
fieldset input[type="password"],
|
| 37 |
+
fieldset input[type="number"],
|
| 38 |
+
fieldset select {
|
| 39 |
+
height: 27px !important;
|
| 40 |
+
margin: 2px 0 !important;
|
| 41 |
+
padding: 2px !important;
|
| 42 |
+
border-radius: 0;
|
| 43 |
+
width: 250px;
|
| 44 |
+
border: 1px solid #ccc;
|
| 45 |
+
box-shadow: none;
|
| 46 |
+
vertical-align: middle;
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
#when_edit {
|
| 50 |
+
position: absolute;
|
| 51 |
+
background-color: #666;
|
| 52 |
+
z-index: 101;
|
| 53 |
+
display: none;
|
| 54 |
+
width: 100%;
|
| 55 |
+
height: 100%;
|
| 56 |
+
opacity: 0.7;
|
| 57 |
+
filter: alpha(opacity=70);
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
#formMakerDiv {
|
| 62 |
+
position: fixed;
|
| 63 |
+
background-color: #666;
|
| 64 |
+
z-index: 100;
|
| 65 |
+
display: none;
|
| 66 |
+
left: 0;
|
| 67 |
+
top: 0;
|
| 68 |
+
width: 100%;
|
| 69 |
+
height: 100%;
|
| 70 |
+
opacity: 0.7;
|
| 71 |
+
filter: alpha(opacity=70);
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
#formMakerDiv1 {
|
| 75 |
+
padding-top: 20px;
|
| 76 |
+
position: fixed;
|
| 77 |
+
z-index: 10000;
|
| 78 |
+
top: 0;
|
| 79 |
+
left: 0;
|
| 80 |
+
display: none;
|
| 81 |
+
margin-left: 30px;
|
| 82 |
+
margin-top: 12px;
|
| 83 |
+
height: 93%;
|
| 84 |
+
overflow-y: scroll;
|
| 85 |
+
width:95%;
|
| 86 |
+
}
|
| 87 |
+
|
| 88 |
+
.formMakerDiv1_table {
|
| 89 |
+
font-family: Segoe UI !important;
|
| 90 |
+
background-color: #FFF;
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
#field_types {
|
| 94 |
+
border-right: 4px solid #E5E5E5;
|
| 95 |
+
background: #F2F2F2;
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
|
| 99 |
+
|
| 100 |
+
/* submissions */
|
| 101 |
+
|
| 102 |
+
#sbox-overlay {
|
| 103 |
+
z-index: 65555;
|
| 104 |
+
position: fixed;
|
| 105 |
+
top: 0px;
|
| 106 |
+
left: 0px;
|
| 107 |
+
visibility: visible;
|
| 108 |
+
zoom: 1;
|
| 109 |
+
background-color: #000000;
|
| 110 |
+
opacity: 0.7;
|
| 111 |
+
filter: alpha(opacity=70);
|
| 112 |
+
display: none;
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
#ChBDiv {
|
| 116 |
+
background-color: #FFFFFF;
|
| 117 |
+
width: 350px;
|
| 118 |
+
max-height: 350px;
|
| 119 |
+
overflow-y: auto;
|
| 120 |
+
padding: 20px;
|
| 121 |
+
position: fixed;
|
| 122 |
+
top: 100px;
|
| 123 |
+
display: none;
|
| 124 |
+
border: 2px solid #AAAAAA;
|
| 125 |
+
z-index: 65556;
|
| 126 |
+
}
|
| 127 |
+
|
| 128 |
+
.fm-submissions-page {
|
| 129 |
+
width:99%;
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
.submit_content {
|
| 133 |
+
overflow-x: auto;
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
.fm-reports {
|
| 137 |
+
text-align: left;
|
| 138 |
+
display:inline-block;
|
| 139 |
+
vertical-align: middle;
|
| 140 |
+
}
|
| 141 |
+
|
| 142 |
+
.fm-tools-button {
|
| 143 |
+
border: 1px solid;
|
| 144 |
+
border-radius: 0px;
|
| 145 |
+
text-align: left;
|
| 146 |
+
color: #0288C5;
|
| 147 |
+
height: 40px;
|
| 148 |
+
line-height: 40px;
|
| 149 |
+
display: inline-block;
|
| 150 |
+
padding: 0px 10px;
|
| 151 |
+
background: #F1F1F1;
|
| 152 |
+
border-color: #F1F1F1;
|
| 153 |
+
font-size:15px;
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
.fm-total_rate, .fm-total_entries, .fm-total_views {
|
| 157 |
+
display: inline-block;
|
| 158 |
+
line-height: 18px;
|
| 159 |
+
padding: 5px 10px;
|
| 160 |
+
border-radius: 37px;
|
| 161 |
+
font-size: 16px;
|
| 162 |
+
background: #fff;
|
| 163 |
+
border: none;
|
| 164 |
+
margin-right: 6px;
|
| 165 |
+
}
|
| 166 |
+
|
| 167 |
+
|
| 168 |
+
.fm-form-title {
|
| 169 |
+
text-align: left;
|
| 170 |
+
display: inline-block;
|
| 171 |
+
height: 46px;
|
| 172 |
+
line-height: 46px;
|
| 173 |
+
font-size: 28px;
|
| 174 |
+
font-weight: bold;
|
| 175 |
+
max-width: 450px;
|
| 176 |
+
overflow: hidden;
|
| 177 |
+
text-overflow: ellipsis;
|
| 178 |
+
white-space: nowrap;
|
| 179 |
+
}
|
| 180 |
+
|
| 181 |
+
.submissions-actions {
|
| 182 |
+
height: 70px;
|
| 183 |
+
line-height: 50px;
|
| 184 |
+
}
|
| 185 |
+
|
| 186 |
+
.submissions-toolbar {
|
| 187 |
+
background: #fff;
|
| 188 |
+
height: 100px;
|
| 189 |
+
line-height: 100px;
|
| 190 |
+
}
|
| 191 |
+
|
| 192 |
+
.submissions-tools {
|
| 193 |
+
padding: 0 10px;
|
| 194 |
+
}
|
| 195 |
+
|
| 196 |
+
.submissions-tools select {
|
| 197 |
+
height: 41px;
|
| 198 |
+
width:280px;
|
| 199 |
+
max-width: 280px;
|
| 200 |
+
border: 1px solid #f1f1f1;
|
| 201 |
+
font-style: italic;
|
| 202 |
+
border-radius: 0px;
|
| 203 |
+
margin-left:7px;
|
| 204 |
+
box-shadow:none;
|
| 205 |
+
}
|
| 206 |
+
|
| 207 |
+
.fm-export-tools {
|
| 208 |
+
float:right;
|
| 209 |
+
}
|
| 210 |
+
|
| 211 |
+
.fm-export-tools span {
|
| 212 |
+
display: inline-block;
|
| 213 |
+
font-size:15px;
|
| 214 |
+
color:#0288C5;
|
| 215 |
+
}
|
| 216 |
+
|
| 217 |
+
.fm-export-tools button{
|
| 218 |
+
cursor:pointer;
|
| 219 |
+
}
|
| 220 |
+
|
| 221 |
+
.fm-search-tools {
|
| 222 |
+
float:left;
|
| 223 |
+
}
|
| 224 |
+
|
| 225 |
+
.fm-search-tools button {
|
| 226 |
+
margin-right:2px;
|
| 227 |
+
}
|
| 228 |
+
|
| 229 |
+
.fm-add-remove{
|
| 230 |
+
float:right;
|
| 231 |
+
}
|
| 232 |
+
|
| 233 |
+
.fm-add-remove button {
|
| 234 |
+
font-size: 13px;
|
| 235 |
+
background: #4EC0D9;
|
| 236 |
+
width: 154px;
|
| 237 |
+
margin-right:15px;
|
| 238 |
+
}
|
| 239 |
+
|
| 240 |
+
|
| 241 |
+
.fm-statistics{
|
| 242 |
+
background: #fff;
|
| 243 |
+
padding: 10px 10px 20px 10px;
|
| 244 |
+
}
|
| 245 |
+
|
| 246 |
+
.fm-statistics .stats tr {
|
| 247 |
+
border: none !important;
|
| 248 |
+
}
|
| 249 |
+
|
| 250 |
+
.fm-statistics .stats td {
|
| 251 |
+
border: none !important;
|
| 252 |
+
padding: 5px 3px;
|
| 253 |
+
vertical-align: middle;
|
| 254 |
+
}
|
| 255 |
+
|
| 256 |
+
.fm-statistics .stats select{
|
| 257 |
+
height: 31px;
|
| 258 |
+
width: 298px;
|
| 259 |
+
max-width: 298px;
|
| 260 |
+
border: 1px solid #E6E4E4;
|
| 261 |
+
font-style: italic;
|
| 262 |
+
border-radius: 0px;
|
| 263 |
+
margin-left: 7px;
|
| 264 |
+
box-shadow: none;
|
| 265 |
+
}
|
| 266 |
+
|
| 267 |
+
.fm-statistics #div_stats .field-label {
|
| 268 |
+
font-size: 16px;
|
| 269 |
+
font-weight: bold;
|
| 270 |
+
}
|
| 271 |
+
|
| 272 |
+
.fm-statistics .stats button{
|
| 273 |
+
display: inline-block;
|
| 274 |
+
height: 27px;
|
| 275 |
+
line-height: 27px;
|
| 276 |
+
border-radius: 0px;
|
| 277 |
+
font-size: 12px;
|
| 278 |
+
font-weight: bold;
|
| 279 |
+
padding: 0 14px;
|
| 280 |
+
cursor: pointer;
|
| 281 |
+
text-align: center;
|
| 282 |
+
color: #fff;
|
| 283 |
+
border: none;
|
| 284 |
+
background: #4EC0D9;
|
| 285 |
+
}
|
| 286 |
+
|
| 287 |
+
.fm-statistics .stats input{
|
| 288 |
+
border-radius: 0px;
|
| 289 |
+
border: 1px solid #E6E4E4;
|
| 290 |
+
box-shadow: none;
|
| 291 |
+
vertical-align: middle;
|
| 292 |
+
}
|
| 293 |
+
|
| 294 |
+
.fm-statistics .stats label{
|
| 295 |
+
font-size:14px;
|
| 296 |
+
}
|
| 297 |
+
|
| 298 |
+
.fm-statistics .label0{
|
| 299 |
+
background:#4EC0D9;
|
| 300 |
+
border: 2px solid #4EC0D9;
|
| 301 |
+
}
|
| 302 |
+
|
| 303 |
+
.fm-statistics .label1
|
| 304 |
+
{
|
| 305 |
+
background:#DDCC7F;
|
| 306 |
+
border: 2px solid #DDCC7F;
|
| 307 |
+
}
|
| 308 |
+
|
| 309 |
+
.fm-statistics .bordered0:before
|
| 310 |
+
{
|
| 311 |
+
content: " ";
|
| 312 |
+
width:20px;
|
| 313 |
+
height:16px;
|
| 314 |
+
margin-left: -15px;
|
| 315 |
+
background:#5FE2FF;
|
| 316 |
+
display: inline-block;
|
| 317 |
+
-webkit-transform: scale(1) rotate(0deg) translateX(0px) translateY(0px) skewX(-25deg) skewY(0deg);
|
| 318 |
+
}
|
| 319 |
+
|
| 320 |
+
.fm-statistics .bordered1:before
|
| 321 |
+
{
|
| 322 |
+
content: " ";
|
| 323 |
+
width:20px;
|
| 324 |
+
height:16px;
|
| 325 |
+
margin-left: -15px;
|
| 326 |
+
background:#F9E89C;
|
| 327 |
+
display: inline-block;
|
| 328 |
+
-webkit-transform: scale(1) rotate(0deg) translateX(0px) translateY(0px) skewX(-25deg) skewY(0deg);
|
| 329 |
+
}
|
| 330 |
+
|
| 331 |
+
.fm-statistics .adminlist{
|
| 332 |
+
border-collapse: separate;
|
| 333 |
+
font-size:14px;
|
| 334 |
+
width: 100%;
|
| 335 |
+
}
|
| 336 |
+
|
| 337 |
+
.fm-statistics .adminlist th
|
| 338 |
+
{
|
| 339 |
+
font-size:14px;
|
| 340 |
+
padding: 10px 0;
|
| 341 |
+
}
|
| 342 |
+
|
| 343 |
+
.fm-statistics .adminlist td
|
| 344 |
+
{
|
| 345 |
+
border: none !important;
|
| 346 |
+
}
|
| 347 |
+
|
| 348 |
+
.fm-statistics .adminlist td:first-child
|
| 349 |
+
{
|
| 350 |
+
color:#fff;
|
| 351 |
+
padding: 4px;
|
| 352 |
+
}
|
| 353 |
+
|
| 354 |
+
|
| 355 |
+
.fm_layout {
|
| 356 |
+
width:99%;
|
| 357 |
+
padding:15px 0;
|
| 358 |
+
}
|
| 359 |
+
|
| 360 |
+
.fm-layout-actions:after {
|
| 361 |
+
clear:both;
|
| 362 |
+
content:'';
|
| 363 |
+
display:block;
|
| 364 |
+
}
|
| 365 |
+
|
| 366 |
+
.fm-layout-content {
|
| 367 |
+
background:#fff;
|
| 368 |
+
padding:10px 10px 20px 10px;
|
| 369 |
+
margin-top:15px;
|
| 370 |
+
}
|
| 371 |
+
/*///////////////
|
| 372 |
+
new end
|
| 373 |
+
//////////////*/
|
| 374 |
+
|
| 375 |
+
|
| 376 |
+
|
| 377 |
+
/* form options */
|
| 378 |
+
.fm-form-options {
|
| 379 |
+
background:#fff;
|
| 380 |
+
padding: 13px;
|
| 381 |
+
}
|
| 382 |
+
|
| 383 |
+
.submenu-box {
|
| 384 |
+
width: 100%;
|
| 385 |
+
padding: 15px 0;
|
| 386 |
+
}
|
| 387 |
+
|
| 388 |
+
.submenu-pad {
|
| 389 |
+
float:left;
|
| 390 |
+
}
|
| 391 |
+
|
| 392 |
+
.submenu-box:after {
|
| 393 |
+
display:block;
|
| 394 |
+
content:'';
|
| 395 |
+
clear:both;
|
| 396 |
+
}
|
| 397 |
+
|
| 398 |
+
#submenu {
|
| 399 |
+
margin: 0;
|
| 400 |
+
padding: 0;
|
| 401 |
+
}
|
| 402 |
+
|
| 403 |
+
#submenu li {
|
| 404 |
+
display: inline;
|
| 405 |
+
margin: 0;
|
| 406 |
+
padding: 0;
|
| 407 |
+
}
|
| 408 |
+
|
| 409 |
+
#submenu a:hover,
|
| 410 |
+
#submenu a.active,
|
| 411 |
+
#submenu span.nolink.active {
|
| 412 |
+
background: none repeat scroll 0 0 #FFFFFF;
|
| 413 |
+
border: 1px solid #46ACC3
|
| 414 |
+
}
|
| 415 |
+
|
| 416 |
+
#submenu a:focus {
|
| 417 |
+
box-shadow: none !important;
|
| 418 |
+
}
|
| 419 |
+
|
| 420 |
+
#submenu li a,
|
| 421 |
+
#submenu span.nolink {
|
| 422 |
+
border: 1px solid #F1F1F1;
|
| 423 |
+
color: #444;
|
| 424 |
+
cursor: pointer;
|
| 425 |
+
font-size: 13px;
|
| 426 |
+
font-weight: bold;
|
| 427 |
+
padding: 12px;
|
| 428 |
+
background: #fff;
|
| 429 |
+
text-decoration: none;
|
| 430 |
+
display:inline-block;
|
| 431 |
+
}
|
| 432 |
+
|
| 433 |
+
|
| 434 |
+
fieldset.adminform {
|
| 435 |
+
width: 99%;
|
| 436 |
+
margin: 10px 0;
|
| 437 |
+
}
|
| 438 |
+
|
| 439 |
+
fieldset.adminform legend {
|
| 440 |
+
color: #444;
|
| 441 |
+
font-weight: bold;
|
| 442 |
+
font-size: 16px;
|
| 443 |
+
padding: 10px 3px;
|
| 444 |
+
}
|
| 445 |
+
|
| 446 |
+
.wp-list-table td{
|
| 447 |
+
vertical-align: middle !important;
|
| 448 |
+
}
|
| 449 |
+
|
| 450 |
+
table.admintable td.key,
|
| 451 |
+
table.admintable td.paramlist_key {
|
| 452 |
+
background-color: #F6F6F6;
|
| 453 |
+
border-bottom: 1px solid #E9E9E9;
|
| 454 |
+
border-right: 1px solid #E9E9E9;
|
| 455 |
+
color: #666666;
|
| 456 |
+
font-weight: bold;
|
| 457 |
+
text-align: right;
|
| 458 |
+
width: 200px;
|
| 459 |
+
}
|
| 460 |
+
table.admintable {
|
| 461 |
+
width: 100%;
|
| 462 |
+
}
|
| 463 |
+
|
| 464 |
+
.fm-condition {
|
| 465 |
+
padding:20px 0;
|
| 466 |
+
display:table;
|
| 467 |
+
border-bottom:1px solid #00A0D2;
|
| 468 |
+
}
|
| 469 |
+
|
| 470 |
+
|
| 471 |
+
|
| 472 |
+
.fm_fieldset_active {
|
| 473 |
+
display: block;
|
| 474 |
+
}
|
| 475 |
+
|
| 476 |
+
.fm_fieldset_deactive {
|
| 477 |
+
display: none;
|
| 478 |
+
}
|
| 479 |
+
|
| 480 |
+
.wrap * {
|
| 481 |
+
font-size: 13px;
|
| 482 |
+
}
|
| 483 |
+
|
| 484 |
+
.add_tag_th {
|
| 485 |
+
padding-left: 21px;
|
| 486 |
+
font-size: 12px;
|
| 487 |
+
font-family: sans-serif;
|
| 488 |
+
}
|
| 489 |
+
|
| 490 |
+
.pointer{
|
| 491 |
+
cursor: pointer;
|
| 492 |
+
}
|
| 493 |
+
|
| 494 |
+
.table_small_col {
|
| 495 |
+
text-align: center !important;
|
| 496 |
+
width: 45px;
|
| 497 |
+
}
|
| 498 |
+
|
| 499 |
+
.table_medium_col {
|
| 500 |
+
text-align: center !important;
|
| 501 |
+
width: 70px;
|
| 502 |
+
}
|
| 503 |
+
|
| 504 |
+
.table_big_col {
|
| 505 |
+
text-align: center !important;
|
| 506 |
+
width: 80px;
|
| 507 |
+
}
|
| 508 |
+
|
| 509 |
+
.table_large_col {
|
| 510 |
+
text-align: center !important;
|
| 511 |
+
width: 200px;
|
| 512 |
+
}
|
| 513 |
+
|
| 514 |
+
.table_large_col input{
|
| 515 |
+
width: 180px;
|
| 516 |
+
}
|
| 517 |
+
|
| 518 |
+
.table_medium_col_uncenter {
|
| 519 |
+
width: 80px;
|
| 520 |
+
}
|
| 521 |
+
|
| 522 |
+
.table_extra_large_col {
|
| 523 |
+
padding: 4px !important;
|
| 524 |
+
width: 150px !important;
|
| 525 |
+
}
|
| 526 |
+
|
| 527 |
+
.first-page,
|
| 528 |
+
.prev-page,
|
| 529 |
+
.next-page,
|
| 530 |
+
.last-page,
|
| 531 |
+
.table_extra_large_col a,
|
| 532 |
+
.table_medium_col a,
|
| 533 |
+
.table_big_col a,
|
| 534 |
+
.table_small_col a {
|
| 535 |
+
cursor: pointer;
|
| 536 |
+
}
|
| 537 |
+
|
| 538 |
+
|
| 539 |
+
.handle {
|
| 540 |
+
background: url("../images/draggable.png") no-repeat /*scroll 6px 9px*/ transparent;
|
| 541 |
+
border: none;
|
| 542 |
+
height: 15px;
|
| 543 |
+
margin: 0 auto;
|
| 544 |
+
vertical-align: middle;
|
| 545 |
+
width: 15px;
|
| 546 |
+
}
|
| 547 |
+
|
| 548 |
+
.block_icon {
|
| 549 |
+
background: url("../images/buttons.png") no-repeat 15% 75%;
|
| 550 |
+
border: none;
|
| 551 |
+
display:inline-block;
|
| 552 |
+
height: 43px;
|
| 553 |
+
width: 31px;
|
| 554 |
+
vertical-align: middle;
|
| 555 |
+
}
|
| 556 |
+
|
| 557 |
+
.theme_icon {
|
| 558 |
+
background: url("../images/buttons.png") no-repeat 7% 77%;
|
| 559 |
+
border: none;
|
| 560 |
+
height: 42px;
|
| 561 |
+
width: 44px;
|
| 562 |
+
display: inline-block;
|
| 563 |
+
vertical-align: middle;
|
| 564 |
+
}
|
| 565 |
+
|
| 566 |
+
.uninstall_icon {
|
| 567 |
+
background: url("../images/buttons.png") no-repeat 0% 75%;
|
| 568 |
+
border: none;
|
| 569 |
+
height: 42px;
|
| 570 |
+
width: 37px;
|
| 571 |
+
display: inline-block;
|
| 572 |
+
vertical-align: middle;
|
| 573 |
+
}
|
| 574 |
+
|
| 575 |
+
.connectedSortable {
|
| 576 |
+
cursor: move;
|
| 577 |
+
}
|
| 578 |
+
|
| 579 |
+
.fm_label {
|
| 580 |
+
font-weight: bold;
|
| 581 |
+
width: 100px;
|
| 582 |
+
}
|
| 583 |
+
|
| 584 |
+
.fm_label_options {
|
| 585 |
+
font-weight: bold;
|
| 586 |
+
vertical-align: top;
|
| 587 |
+
width: 150px;
|
| 588 |
+
}
|
| 589 |
+
|
| 590 |
+
.fm_int_input {
|
| 591 |
+
width: 80px;
|
| 592 |
+
}
|
| 593 |
+
|
| 594 |
+
.fm_text_input {
|
| 595 |
+
width: 190px;
|
| 596 |
+
}
|
| 597 |
+
|
| 598 |
+
.updated,
|
| 599 |
+
.error {
|
| 600 |
+
margin: 5px 0 2px !important;
|
| 601 |
+
}
|
| 602 |
+
|
| 603 |
+
.theme_type {
|
| 604 |
+
background-color: #F4F4F4;
|
| 605 |
+
border: 1px solid #8F8D8D;
|
| 606 |
+
border-radius: 8px 8px 8px 8px;
|
| 607 |
+
cursor: pointer;
|
| 608 |
+
display: inline-block;
|
| 609 |
+
font-size: 16px;
|
| 610 |
+
height: 24px;
|
| 611 |
+
padding-top: 5px;
|
| 612 |
+
text-align: center;
|
| 613 |
+
vertical-align: middle;
|
| 614 |
+
width: 123px;
|
| 615 |
+
margin: 2px 0px 2px 0px;
|
| 616 |
+
}
|
| 617 |
+
|
| 618 |
+
.ui-slider-handle {
|
| 619 |
+
cursor: pointer !important;
|
| 620 |
+
}
|
| 621 |
+
|
| 622 |
+
.fm_search_value {
|
| 623 |
+
height: 2em;
|
| 624 |
+
margin: 0 0 4px;
|
| 625 |
+
}
|
| 626 |
+
|
| 627 |
+
|
| 628 |
+
|
| 629 |
+
#form_id_tempform_view_img1 td {
|
| 630 |
+
padding: 0;
|
| 631 |
+
}
|
| 632 |
+
|
| 633 |
+
|
| 634 |
+
.payment_info_fc {
|
| 635 |
+
width: 72px;
|
| 636 |
+
}
|
| 637 |
+
|
| 638 |
+
|
| 639 |
+
|
| 640 |
+
|
| 641 |
+
|
| 642 |
+
|
| 643 |
+
|
| 644 |
+
|
| 645 |
+
.sub-align {
|
| 646 |
+
vertical-align: middle !important;
|
| 647 |
+
}
|
| 648 |
+
|
| 649 |
+
.count_col {
|
| 650 |
+
padding: 7px 7px 8px;
|
| 651 |
+
min-width: 10px !important;
|
| 652 |
+
max-width: 30px !important;
|
| 653 |
+
text-align: right !important;
|
| 654 |
+
}
|
| 655 |
+
|
| 656 |
+
#fields_filter {
|
| 657 |
+
background-color: #FAFAFA;
|
| 658 |
+
}
|
| 659 |
+
|
| 660 |
+
#fields_filter input {
|
| 661 |
+
font-size: 12px;
|
| 662 |
+
padding: 0 !important;
|
| 663 |
+
margin: 0 !important;
|
| 664 |
+
vertical-align: middle;
|
| 665 |
+
}
|
| 666 |
+
|
| 667 |
+
#fields_filter td,
|
| 668 |
+
#fields_filter th {
|
| 669 |
+
font-size: 12px;
|
| 670 |
+
margin: 0 !important;
|
| 671 |
+
border: none;
|
| 672 |
+
vertical-align: middle;
|
| 673 |
+
}
|
| 674 |
+
|
| 675 |
+
.submitdate_fc * {
|
| 676 |
+
padding: 0 !important;
|
| 677 |
+
}
|
| 678 |
+
|
| 679 |
+
.submit_content pre {
|
| 680 |
+
font-family: sans-serif;
|
| 681 |
+
}
|
| 682 |
+
|
| 683 |
+
.submit_content .table_large_col {
|
| 684 |
+
text-align: left !important;
|
| 685 |
+
white-space: nowrap;
|
| 686 |
+
}
|
| 687 |
+
|
| 688 |
+
.submit_content table {
|
| 689 |
+
table-layout: auto;
|
| 690 |
+
}
|
| 691 |
+
|
| 692 |
+
.submit_content .column-autor {
|
| 693 |
+
max-width: 200px;
|
| 694 |
+
min-width: 120px;
|
| 695 |
+
}
|
| 696 |
+
|
| 697 |
+
.submitid_fc {
|
| 698 |
+
min-width: 10px !important;
|
| 699 |
+
max-width: 30px !important;
|
| 700 |
+
text-align: left !important;
|
| 701 |
+
}
|
| 702 |
+
|
| 703 |
+
.submitid_fc a {
|
| 704 |
+
padding-left: 2px;
|
| 705 |
+
}
|
| 706 |
+
|
| 707 |
+
.submit_content #cb,
|
| 708 |
+
.submit_content #cb * {
|
| 709 |
+
padding: 0;
|
| 710 |
+
vertical-align: middle;
|
| 711 |
+
}
|
| 712 |
+
|
| 713 |
+
.wdform-calendar-button {
|
| 714 |
+
padding: 0;
|
| 715 |
+
}
|
| 716 |
+
|
| 717 |
+
.fm_options_label,
|
| 718 |
+
.fm_options_value {
|
| 719 |
+
background-color: #FFFFFF;
|
| 720 |
+
border: 1px solid #cccccc !important;
|
| 721 |
+
padding: 15px;
|
| 722 |
+
}
|
| 723 |
+
.fm_options_label {
|
| 724 |
+
width: 170px;
|
| 725 |
+
}
|
| 726 |
+
.fm_delete_img {
|
| 727 |
+
cursor: pointer;
|
| 728 |
+
margin: 0 0 0 2px;
|
| 729 |
+
padding: 0;
|
| 730 |
+
vertical-align: middle;
|
| 731 |
+
}
|
| 732 |
+
|
| 733 |
+
|
| 734 |
+
|
| 735 |
+
|
| 736 |
+
|
| 737 |
+
|
| 738 |
+
|
| 739 |
+
|
| 740 |
+
|
| 741 |
+
button:focus {
|
| 742 |
+
outline:none !important;
|
| 743 |
+
}
|
| 744 |
+
|
| 745 |
+
|
| 746 |
+
.fm-button{
|
| 747 |
+
display: inline-block;
|
| 748 |
+
height: 40px;
|
| 749 |
+
line-height: 38px;
|
| 750 |
+
border-radius: 0px;
|
| 751 |
+
font-size: 15px;
|
| 752 |
+
font-weight: normal;
|
| 753 |
+
padding: 0;
|
| 754 |
+
cursor: pointer;
|
| 755 |
+
text-align: center;
|
| 756 |
+
color: #fff;
|
| 757 |
+
border: none;
|
| 758 |
+
}
|
| 759 |
+
|
| 760 |
+
.fm-button span{
|
| 761 |
+
width: 46px;
|
| 762 |
+
height: 40px;
|
| 763 |
+
display: inline-block;
|
| 764 |
+
background-size: contain;
|
| 765 |
+
background: transparent;
|
| 766 |
+
background-repeat: no-repeat;
|
| 767 |
+
background-position: 0 0;
|
| 768 |
+
border-radius: 0px;
|
| 769 |
+
float: left;
|
| 770 |
+
margin-top: -1px;
|
| 771 |
+
margin-left: -1px;
|
| 772 |
+
}
|
| 773 |
+
|
| 774 |
+
.fm-button.small {
|
| 775 |
+
width: 108px;
|
| 776 |
+
}
|
| 777 |
+
|
| 778 |
+
.fm-button.medium {
|
| 779 |
+
width: 150px;
|
| 780 |
+
}
|
| 781 |
+
|
| 782 |
+
.fm-button.large {
|
| 783 |
+
width: 170px;
|
| 784 |
+
}
|
| 785 |
+
|
| 786 |
+
.fm-button.add-button {
|
| 787 |
+
background-color: #4EC0D9;
|
| 788 |
+
border: 1px solid transparent;
|
| 789 |
+
}
|
| 790 |
+
|
| 791 |
+
.fm-button.add-button span{
|
| 792 |
+
background: url("../images/buttons.png") no-repeat 0% 0%;
|
| 793 |
+
}
|
| 794 |
+
|
| 795 |
+
.fm-button.add-new-button {
|
| 796 |
+
background-color: #4EC0D9;
|
| 797 |
+
border: 1px solid transparent;
|
| 798 |
+
}
|
| 799 |
+
|
| 800 |
+
.fm-button.add-new-button span{
|
| 801 |
+
background: url("../images/buttons.png") no-repeat 71.5% 0%;
|
| 802 |
+
}
|
| 803 |
+
|
| 804 |
+
|
| 805 |
+
.fm-icon {
|
| 806 |
+
width:35px;
|
| 807 |
+
height:36px;
|
| 808 |
+
border-radius: 0px;
|
| 809 |
+
cursor: pointer;
|
| 810 |
+
border: none;
|
| 811 |
+
vertical-align: middle;
|
| 812 |
+
}
|
| 813 |
+
|
| 814 |
+
|
| 815 |
+
.fm-button.search-button span{
|
| 816 |
+
background: #DDCC7F url("../images/buttons.png") no-repeat 55% 57%;
|
| 817 |
+
}
|
| 818 |
+
|
| 819 |
+
|
| 820 |
+
.fm-button.reset-button span{
|
| 821 |
+
background: #C1C1C1 url("../images/buttons.png") no-repeat 37.5% 57%;
|
| 822 |
+
}
|
| 823 |
+
|
| 824 |
+
.fm-icon.edit-icon{
|
| 825 |
+
background: #DDCC7F url("../images/buttons.png") no-repeat 33% 71%;
|
| 826 |
+
}
|
| 827 |
+
|
| 828 |
+
.fm-icon.delete-icon{
|
| 829 |
+
background: #E5705D url("../images/buttons.png") no-repeat 27.5% 71%;
|
| 830 |
+
}
|
| 831 |
+
|
| 832 |
+
.fm-button.show-filter-button span{
|
| 833 |
+
background: #DDCC7F url("../images/buttons.png") no-repeat 61% 18%;
|
| 834 |
+
}
|
| 835 |
+
|
| 836 |
+
.fm-icon.add-block-ip-icon{
|
| 837 |
+
background: #4EC0D9 url("../images/buttons.png") no-repeat 50% 50%;
|
| 838 |
+
}
|
| 839 |
+
|
| 840 |
+
.fm-button.edit-button span{
|
| 841 |
+
background: #DDCC7F url("../images/buttons.png") no-repeat 50% 50%;
|
| 842 |
+
}
|
| 843 |
+
|
| 844 |
+
.fm-button.block-button span {
|
| 845 |
+
background: url("../images/buttons.png") no-repeat 64.5% 0%;
|
| 846 |
+
}
|
| 847 |
+
|
| 848 |
+
.fm-button.unblock-button span {
|
| 849 |
+
background: url("../images/buttons.png") no-repeat 36% 0%;
|
| 850 |
+
}
|
| 851 |
+
|
| 852 |
+
.fm-button.delete-button span{
|
| 853 |
+
background:url("../images/buttons.png") no-repeat 93% 0%;
|
| 854 |
+
}
|
| 855 |
+
|
| 856 |
+
.fm-button.form-layout-button span{
|
| 857 |
+
background:url("../images/buttons.png") no-repeat 79% 0%;
|
| 858 |
+
}
|
| 859 |
+
|
| 860 |
+
.fm-button.form-options-button span{
|
| 861 |
+
background:url("../images/buttons.png") no-repeat 14.5% 0%;
|
| 862 |
+
}
|
| 863 |
+
|
| 864 |
+
.fm-button.undo-button span{
|
| 865 |
+
background:url("../images/buttons.png") no-repeat 29% 0%;
|
| 866 |
+
}
|
| 867 |
+
|
| 868 |
+
.fm-button.redo-button span{
|
| 869 |
+
background:url("../images/buttons.png") no-repeat 57% 0%;
|
| 870 |
+
}
|
| 871 |
+
|
| 872 |
+
.fm-button.save-button span{
|
| 873 |
+
background:url("../images/buttons.png") no-repeat 43% 0%;
|
| 874 |
+
}
|
| 875 |
+
|
| 876 |
+
.fm-button.save-as-copy-button span{
|
| 877 |
+
background:url("../images/buttons.png") no-repeat 50% 0%;
|
| 878 |
+
}
|
| 879 |
+
|
| 880 |
+
.field-save-button span,
|
| 881 |
+
.fm-button.apply-button span{
|
| 882 |
+
background:url("../images/buttons.png") no-repeat 86% 0%;
|
| 883 |
+
}
|
| 884 |
+
|
| 885 |
+
.fm-button.cancel-button span{
|
| 886 |
+
background:url("../images/buttons.png") no-repeat 100% 0%;
|
| 887 |
+
}
|
| 888 |
+
|
| 889 |
+
.fm-button.options-edit-button span {
|
| 890 |
+
background: url("../images/buttons.png") no-repeat 21.5% 0%;
|
| 891 |
+
}
|
| 892 |
+
|
| 893 |
+
.fm-button.preview-button span {
|
| 894 |
+
background: url("../images/buttons.png") no-repeat 7% 0%;
|
| 895 |
+
}
|
| 896 |
+
|
| 897 |
+
.fm-page-actions{
|
| 898 |
+
float:right;
|
| 899 |
+
}
|
| 900 |
+
|
| 901 |
+
.fm-page-actions .fm-button,
|
| 902 |
+
.fm-button.field-save-button,
|
| 903 |
+
.fm-button.cancel-button,
|
| 904 |
+
.fm-button.delete-button,
|
| 905 |
+
.fm-button.options-edit-button,
|
| 906 |
+
.fm-button.preview-button{
|
| 907 |
+
background: transparent;
|
| 908 |
+
color: #444;
|
| 909 |
+
border:1px solid #C5C6C7 !important;
|
| 910 |
+
}
|
| 911 |
+
|
| 912 |
+
.fm-page-banner {
|
| 913 |
+
background: #fff;
|
| 914 |
+
display: block;
|
| 915 |
+
height: 90px;
|
| 916 |
+
padding: 15px 10px;
|
| 917 |
+
}
|
| 918 |
+
|
| 919 |
+
.fm-theme-banner{
|
| 920 |
+
background: #fff;
|
| 921 |
+
display: block;
|
| 922 |
+
height: 40px;
|
| 923 |
+
padding: 10px;
|
| 924 |
+
}
|
| 925 |
+
|
| 926 |
+
.fm-theme-banner select{
|
| 927 |
+
height:40px;
|
| 928 |
+
line-height:40px;
|
| 929 |
+
border: 1px solid #919191;
|
| 930 |
+
}
|
| 931 |
+
|
| 932 |
+
.fm-theme-banner button {
|
| 933 |
+
vertical-align: middle;
|
| 934 |
+
}
|
| 935 |
+
|
| 936 |
+
.uninstall-banner {
|
| 937 |
+
background: #fff;
|
| 938 |
+
display: block;
|
| 939 |
+
padding: 15px 10px;
|
| 940 |
+
height: 38px;
|
| 941 |
+
}
|
| 942 |
+
|
| 943 |
+
.uninstall-banner .fm-logo-title{
|
| 944 |
+
width: 200px;
|
| 945 |
+
vertical-align: middle;
|
| 946 |
+
}
|
| 947 |
+
|
| 948 |
+
.blocked-ips-banner,
|
| 949 |
+
.themes-banner{
|
| 950 |
+
line-height: 80px;
|
| 951 |
+
}
|
| 952 |
+
|
| 953 |
+
.fm-clear {
|
| 954 |
+
content: '';
|
| 955 |
+
clear: both;
|
| 956 |
+
display: block;
|
| 957 |
+
}
|
| 958 |
+
|
| 959 |
+
.fm-logo {
|
| 960 |
+
display: inline-block;
|
| 961 |
+
background: url("../images/buttons.png") no-repeat 49% 100%;
|
| 962 |
+
background-repeat: no-repeat;
|
| 963 |
+
width: 100px;
|
| 964 |
+
height: 79px;
|
| 965 |
+
vertical-align: bottom;
|
| 966 |
+
margin-top: 10px;
|
| 967 |
+
}
|
| 968 |
+
|
| 969 |
+
.fm-logo-title {
|
| 970 |
+
text-transform: uppercase;
|
| 971 |
+
display: inline-block;
|
| 972 |
+
font-size: 16px;
|
| 973 |
+
vertical-align: middle;
|
| 974 |
+
width: 100px;
|
| 975 |
+
margin-left: 10px;
|
| 976 |
+
line-height: 22px;
|
| 977 |
+
}
|
| 978 |
+
|
| 979 |
+
.fm-title-edit-page{
|
| 980 |
+
text-transform: uppercase;
|
| 981 |
+
display: inline-block;
|
| 982 |
+
font-size: 15px;
|
| 983 |
+
vertical-align: top;
|
| 984 |
+
margin-left: 0px;
|
| 985 |
+
line-height: 22px;
|
| 986 |
+
}
|
| 987 |
+
|
| 988 |
+
.fm-logo-edit-page{
|
| 989 |
+
display: inline-block;
|
| 990 |
+
background: url("../images/buttons.png") no-repeat 0% 100%;
|
| 991 |
+
width: 65px;
|
| 992 |
+
height: 47px;
|
| 993 |
+
}
|
| 994 |
+
|
| 995 |
+
.fm-h2-message{
|
| 996 |
+
padding:0 !important;
|
| 997 |
+
margin:0 !important;
|
| 998 |
+
}
|
| 999 |
+
|
| 1000 |
+
.tablenav {
|
| 1001 |
+
margin:20px 0;
|
| 1002 |
+
}
|
| 1003 |
+
|
| 1004 |
+
.tablenav .fm-alternate {
|
| 1005 |
+
background-color: #F1F1F1;
|
| 1006 |
+
}
|
| 1007 |
+
|
| 1008 |
+
.fm-search label{
|
| 1009 |
+
font-size:14px;
|
| 1010 |
+
width:45px;
|
| 1011 |
+
display:inline-block;
|
| 1012 |
+
}
|
| 1013 |
+
|
| 1014 |
+
.fm-search input{
|
| 1015 |
+
width: 251px;
|
| 1016 |
+
padding: 4px;
|
| 1017 |
+
border: 1px solid #919191;
|
| 1018 |
+
height: 36px;
|
| 1019 |
+
background: transparent;
|
| 1020 |
+
margin: 0;
|
| 1021 |
+
display: inline-block;
|
| 1022 |
+
vertical-align: middle;
|
| 1023 |
+
font-size:14px;
|
| 1024 |
+
}
|
| 1025 |
+
|
| 1026 |
+
.fm-search input:focus{
|
| 1027 |
+
outline:none;
|
| 1028 |
+
}
|
| 1029 |
+
|
| 1030 |
+
.check-column {
|
| 1031 |
+
width: 2.2em;
|
| 1032 |
+
padding: 8px 10px !important;
|
| 1033 |
+
}
|
| 1034 |
+
|
| 1035 |
+
.fm-checkbox-radio-button {
|
| 1036 |
+
height: 16px;
|
| 1037 |
+
border-radius: 10px;
|
| 1038 |
+
cursor: pointer;
|
| 1039 |
+
text-align: center;
|
| 1040 |
+
padding: 1px;
|
| 1041 |
+
font-size: 12px;
|
| 1042 |
+
line-height: 12px;
|
| 1043 |
+
color: #fff;
|
| 1044 |
+
width:46px;
|
| 1045 |
+
min-width: 46px;
|
| 1046 |
+
position: relative;
|
| 1047 |
+
}
|
| 1048 |
+
|
| 1049 |
+
.fm-checkbox-radio-button span{
|
| 1050 |
+
width: 12px;
|
| 1051 |
+
height: 12px;
|
| 1052 |
+
display: inline-block;
|
| 1053 |
+
background-size: contain;
|
| 1054 |
+
background: #fff;
|
| 1055 |
+
border-radius: 6px;
|
| 1056 |
+
position: absolute;
|
| 1057 |
+
top: 1px;
|
| 1058 |
+
}
|
| 1059 |
+
|
| 1060 |
+
.fm-checkbox-radio-button label{
|
| 1061 |
+
line-height: 13px;
|
| 1062 |
+
margin-right:6px;
|
| 1063 |
+
}
|
| 1064 |
+
|
| 1065 |
+
.fm-checkbox-radio-button.small {
|
| 1066 |
+
width:46px;
|
| 1067 |
+
}
|
| 1068 |
+
|
| 1069 |
+
.fm-checkbox-radio-button.medium {
|
| 1070 |
+
width:60px;
|
| 1071 |
+
}
|
| 1072 |
+
|
| 1073 |
+
.fm-checkbox-radio-button.large {
|
| 1074 |
+
width:98px;
|
| 1075 |
+
}
|
| 1076 |
+
|
| 1077 |
+
.fm-yes{
|
| 1078 |
+
background:#46ACC3 url("../images/radio-yes.png");
|
| 1079 |
+
border: 1px solid #46ACC3;
|
| 1080 |
+
background-repeat: no-repeat;
|
| 1081 |
+
background-position: 35%;
|
| 1082 |
+
}
|
| 1083 |
+
|
| 1084 |
+
.fm-no{
|
| 1085 |
+
background:#A1A1A1;
|
| 1086 |
+
border: 1px solid #A1A1A1;
|
| 1087 |
+
background-repeat: no-repeat;
|
| 1088 |
+
background-position: 35%;
|
| 1089 |
+
}
|
| 1090 |
+
|
| 1091 |
+
.fm-text-yes span,
|
| 1092 |
+
.fm-yes span{
|
| 1093 |
+
right: 0px;
|
| 1094 |
+
}
|
| 1095 |
+
|
| 1096 |
+
.fm-text-no.small span,
|
| 1097 |
+
.fm-no span{
|
| 1098 |
+
right: 32px;
|
| 1099 |
+
}
|
| 1100 |
+
|
| 1101 |
+
.fm-text-no.medium span{
|
| 1102 |
+
right: 46px;
|
| 1103 |
+
}
|
| 1104 |
+
|
| 1105 |
+
.fm-text-no.large span{
|
| 1106 |
+
right: 84px;
|
| 1107 |
+
}
|
| 1108 |
+
|
| 1109 |
+
.fm-text-yes{
|
| 1110 |
+
background:#46ACC3;
|
| 1111 |
+
border: 1px solid #46ACC3;
|
| 1112 |
+
}
|
| 1113 |
+
|
| 1114 |
+
.fm-text-no{
|
| 1115 |
+
background:#A1A1A1;
|
| 1116 |
+
border: 1px solid #A1A1A1;
|
| 1117 |
+
}
|
| 1118 |
+
|
| 1119 |
+
.fm-text-no label{
|
| 1120 |
+
margin-left:12px;
|
| 1121 |
+
}
|
| 1122 |
+
|
| 1123 |
+
.fm-block-ip input[type="text"] {
|
| 1124 |
+
width: 160px;
|
| 1125 |
+
padding: 3px;
|
| 1126 |
+
border: 1px solid #ccc;
|
| 1127 |
+
margin: 0;
|
| 1128 |
+
height: 28px;
|
| 1129 |
+
vertical-align: middle;
|
| 1130 |
+
}
|
| 1131 |
+
|
| 1132 |
+
.fm-submissins-edit table{
|
| 1133 |
+
background:#fff;
|
| 1134 |
+
width:100%;
|
| 1135 |
+
padding:15px;
|
| 1136 |
+
}
|
| 1137 |
+
|
| 1138 |
+
.fm-submissins-edit .fm-key{
|
| 1139 |
+
width:190px;
|
| 1140 |
+
}
|
| 1141 |
+
|
| 1142 |
+
div.error_fm {
|
| 1143 |
+
border-left: 4px solid #dd3d36;
|
| 1144 |
+
}
|
frontend/views/FMViewForm_maker_fmc.php
CHANGED
|
@@ -1,5158 +1,5158 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
class FMViewForm_maker_fmc {
|
| 4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
-
// Events //
|
| 6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
-
// Constants //
|
| 9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
-
// Variables //
|
| 12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
-
private $model;
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 17 |
-
// Constructor & Destructor //
|
| 18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
-
public function __construct($model) {
|
| 20 |
-
$this->model = $model;
|
| 21 |
-
}
|
| 22 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 23 |
-
// Public Methods //
|
| 24 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 25 |
-
public function display($id) {
|
| 26 |
-
$fmc_settings = get_option('fmc_settings');
|
| 27 |
-
$current_url=htmlentities($_SERVER['REQUEST_URI']);
|
| 28 |
-
$form_maker_front_end = "";
|
| 29 |
-
$pattern = '/\/\/(.+)(\r\n|\r|\n)/';
|
| 30 |
-
$result = $this->model->showform($id);
|
| 31 |
-
if (!$result) {
|
| 32 |
-
return;
|
| 33 |
-
}
|
| 34 |
-
$ok = $this->model->savedata($result[0], $id);
|
| 35 |
-
if (is_numeric($ok)) {
|
| 36 |
-
$this->model->remove($ok);
|
| 37 |
-
}
|
| 38 |
-
$row = $result[0];
|
| 39 |
-
$label_id = $result[2];
|
| 40 |
-
$label_type = $result[3];
|
| 41 |
-
$form_theme = $result[4];
|
| 42 |
-
|
| 43 |
-
$old = FALSE;
|
| 44 |
-
if (isset($_SESSION['form_submit_type' . $id])) {
|
| 45 |
-
$type_and_id = $_SESSION['form_submit_type' . $id];
|
| 46 |
-
$type_and_id = explode(',', $type_and_id);
|
| 47 |
-
$form_get_type = $type_and_id[0];
|
| 48 |
-
$form_get_id = isset($type_and_id[1]) ? $type_and_id[1] : '';
|
| 49 |
-
$_SESSION['form_submit_type' . $id] = 0;
|
| 50 |
-
if ($form_get_type == 3) {
|
| 51 |
-
$_SESSION['massage_after_submit' . $id] = "";
|
| 52 |
-
$after_submission_text = $this->model->get_after_submission_text($form_get_id);
|
| 53 |
-
require_once(WD_FMC_DIR . '/framework/WDW_FMC_Library.php');
|
| 54 |
-
$form_maker_front_end .= WDW_FMC_Library::message(wpautop(html_entity_decode($after_submission_text)), 'warning', $id);
|
| 55 |
-
return $form_maker_front_end;
|
| 56 |
-
}
|
| 57 |
-
}
|
| 58 |
-
if (isset($_SESSION['redirect_paypal' . $id]) && ($_SESSION['redirect_paypal' . $id] == 1)) {
|
| 59 |
-
$_SESSION['redirect_paypal' . $id] = 0;
|
| 60 |
-
if (isset($_GET['succes'])) {
|
| 61 |
-
require_once(WD_FMC_DIR . '/framework/WDW_FMC_Library.php');
|
| 62 |
-
if ($_GET['succes'] == 0) {
|
| 63 |
-
$form_maker_front_end .= WDW_FMC_Library::message(__('Error, email was not sent.', 'form_maker'), 'error', $id);
|
| 64 |
-
}
|
| 65 |
-
else {
|
| 66 |
-
$form_maker_front_end .= WDW_FMC_Library::message(__('Your form was successfully submitted.', 'form_maker'), 'warning', $id);
|
| 67 |
-
}
|
| 68 |
-
}
|
| 69 |
-
}
|
| 70 |
-
elseif (isset($_SESSION['massage_after_submit' . $id]) && $_SESSION['massage_after_submit' . $id] != "") {
|
| 71 |
-
$message = $_SESSION['massage_after_submit' . $id];
|
| 72 |
-
$_SESSION['massage_after_submit' . $id] = "";
|
| 73 |
-
if ($_SESSION['error_or_no' . $id]) {
|
| 74 |
-
$error = 'error';
|
| 75 |
-
}
|
| 76 |
-
else {
|
| 77 |
-
$error = 'warning';
|
| 78 |
-
}
|
| 79 |
-
require_once(WD_FMC_DIR . '/framework/WDW_FMC_Library.php');
|
| 80 |
-
$form_maker_front_end .= WDW_FMC_Library::message($message, $error, $id);
|
| 81 |
-
}
|
| 82 |
-
|
| 83 |
-
if (isset($_SESSION['show_submit_text' . $id])) {
|
| 84 |
-
if ($_SESSION['show_submit_text' . $id] == 1) {
|
| 85 |
-
$_SESSION['show_submit_text' . $id] = 0;
|
| 86 |
-
$form_maker_front_end .= $row->submit_text;
|
| 87 |
-
return;
|
| 88 |
-
}
|
| 89 |
-
}
|
| 90 |
-
$this->model->increment_views_count($id);
|
| 91 |
-
if (isset($row->form)) {
|
| 92 |
-
$old = TRUE;
|
| 93 |
-
}
|
| 94 |
-
$article = $row->article_id;
|
| 95 |
-
|
| 96 |
-
$form_maker_front_end .= '<script type="text/javascript">' . preg_replace($pattern, ' ', $row->javascript) . '</script>';
|
| 97 |
-
$new_form_theme = explode('{', $form_theme);
|
| 98 |
-
$count_after_explod_theme = count($new_form_theme);
|
| 99 |
-
for ($i = 0; $i < $count_after_explod_theme; $i++) {
|
| 100 |
-
$body_or_classes[$i] = explode('}', $new_form_theme[$i]);
|
| 101 |
-
}
|
| 102 |
-
for ($i = 0; $i < $count_after_explod_theme; $i++) {
|
| 103 |
-
if ($i == 0) {
|
| 104 |
-
$body_or_classes[$i][0] = ".form" . $id . ' ' . str_replace(',', ", .form" . $id, $body_or_classes[$i][0]);
|
| 105 |
-
}
|
| 106 |
-
else {
|
| 107 |
-
$body_or_classes[$i][1] = ".form" . $id . ' ' . str_replace(',', ", .form" . $id, $body_or_classes[$i][1]);
|
| 108 |
-
}
|
| 109 |
-
}
|
| 110 |
-
for ($i = 0; $i < $count_after_explod_theme; $i++) {
|
| 111 |
-
$body_or_classes_implode[$i] = implode('}', $body_or_classes[$i]);
|
| 112 |
-
}
|
| 113 |
-
$form_theme = implode('{', $body_or_classes_implode);
|
| 114 |
-
$form_theme = preg_replace($pattern, ' ', $form_theme);
|
| 115 |
-
$form_maker_front_end .= '<style>' . str_replace('[SITE_ROOT]', WD_FMC_URL, $form_theme) . '</style>';
|
| 116 |
-
wp_print_scripts('main' . (($old == false || ($old == true && $row->form=='')) ? '_div' : '') . '_front_end', WD_FMC_URL . '/js/main' . (($old == false || ($old == true && $row->form=='')) ? '_div' : '') . '_front_end.js?ver='. get_option("wd_form_maker_version"));
|
| 117 |
-
$form_currency = '$';
|
| 118 |
-
$check_js = '';
|
| 119 |
-
$onload_js = '';
|
| 120 |
-
$onsubmit_js = '';
|
| 121 |
-
$currency_code = array('USD', 'EUR', 'GBP', 'JPY', 'CAD', 'MXN', 'HKD', 'HUF', 'NOK', 'NZD', 'SGD', 'SEK', 'PLN', 'AUD', 'DKK', 'CHF', 'CZK', 'ILS', 'BRL', 'TWD', 'MYR', 'PHP', 'THB');
|
| 122 |
-
$currency_sign = array('$', '€', '£', '¥', 'C$', 'Mex$', 'HK$', 'Ft', 'kr', 'NZ$', 'S$', 'kr', 'zl', 'A$', 'kr', 'CHF', 'Kc', '₪', 'R$', 'NT$', 'RM', '₱', '฿');
|
| 123 |
-
if ($row->payment_currency) {
|
| 124 |
-
$form_currency = $currency_sign[array_search($row->payment_currency, $currency_code)];
|
| 125 |
-
}
|
| 126 |
-
$form_paypal_tax = $row->tax;
|
| 127 |
-
$form_maker_front_end .= '<form name="form' . $id . '" action="' . $current_url . '" method="post" id="form' . $id . '" class="form' . $id . '" enctype="multipart/form-data" onsubmit="check_required(\'submit\', \'' . $id . '\'); return false;">
|
| 128 |
-
<div id="' . $id . 'pages" class="wdform_page_navigation" show_title="' . $row->show_title . '" show_numbers="' . $row->show_numbers . '" type="' . $row->pagination . '"></div>
|
| 129 |
-
<input type="hidden" id="counter' . $id . '" value="' . $row->counter . '" name="counter' . $id . '" />
|
| 130 |
-
<input type="hidden" id="Itemid' . $id . '" value="" name="Itemid' . $id . '" />';
|
| 131 |
-
if ($old == FALSE || ($old == TRUE && $row->form == '')) {
|
| 132 |
-
$is_type = array();
|
| 133 |
-
$id1s = array();
|
| 134 |
-
$types = array();
|
| 135 |
-
$labels = array();
|
| 136 |
-
$paramss = array();
|
| 137 |
-
$required_sym = $row->requiredmark;
|
| 138 |
-
$fields = explode('*:*new_field*:*', $row->form_fields);
|
| 139 |
-
$fields = array_slice($fields,0, count($fields) - 1);
|
| 140 |
-
foreach ($fields as $field) {
|
| 141 |
-
$temp = explode('*:*id*:*', $field);
|
| 142 |
-
array_push($id1s, $temp[0]);
|
| 143 |
-
$temp = explode('*:*type*:*', $temp[1]);
|
| 144 |
-
array_push($types, $temp[0]);
|
| 145 |
-
$temp = explode('*:*w_field_label*:*', $temp[1]);
|
| 146 |
-
array_push($labels, $temp[0]);
|
| 147 |
-
array_push($paramss, $temp[1]);
|
| 148 |
-
}
|
| 149 |
-
$form_id = $id;
|
| 150 |
-
|
| 151 |
-
$show_hide = array();
|
| 152 |
-
$field_label = array();
|
| 153 |
-
$all_any = array();
|
| 154 |
-
$condition_params = array();
|
| 155 |
-
$type_and_id = array();
|
| 156 |
-
|
| 157 |
-
$condition_js='';
|
| 158 |
-
if($row->condition!="")
|
| 159 |
-
{
|
| 160 |
-
$conditions=explode('*:*new_condition*:*',$row->condition);
|
| 161 |
-
$conditions = array_slice($conditions,0, count($conditions)-1);
|
| 162 |
-
$count_of_conditions = count($conditions);
|
| 163 |
-
|
| 164 |
-
foreach($conditions as $condition)
|
| 165 |
-
{
|
| 166 |
-
$temp=explode('*:*show_hide*:*',$condition);
|
| 167 |
-
array_push($show_hide, $temp[0]);
|
| 168 |
-
$temp=explode('*:*field_label*:*',$temp[1]);
|
| 169 |
-
array_push($field_label, $temp[0]);
|
| 170 |
-
$temp=explode('*:*all_any*:*',$temp[1]);
|
| 171 |
-
array_push($all_any, $temp[0]);
|
| 172 |
-
array_push($condition_params, $temp[1]);
|
| 173 |
-
}
|
| 174 |
-
|
| 175 |
-
foreach($id1s as $id1s_key => $id1)
|
| 176 |
-
{
|
| 177 |
-
$type_and_id[$id1]=$types[$id1s_key];
|
| 178 |
-
}
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
for($k=0; $k<$count_of_conditions; $k++)
|
| 182 |
-
{
|
| 183 |
-
if($show_hide[$k])
|
| 184 |
-
{
|
| 185 |
-
$display = 'removeAttr("style")';
|
| 186 |
-
$display_none = 'css("display", "none")';
|
| 187 |
-
}
|
| 188 |
-
else
|
| 189 |
-
{
|
| 190 |
-
$display = 'css("display", "none")';
|
| 191 |
-
$display_none = 'removeAttr("style")';
|
| 192 |
-
}
|
| 193 |
-
|
| 194 |
-
if($all_any[$k]=="and")
|
| 195 |
-
$or_and = '&&';
|
| 196 |
-
else
|
| 197 |
-
$or_and = '||';
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
if($condition_params[$k])
|
| 201 |
-
{
|
| 202 |
-
$cond_params =explode('*:*next_condition*:*',$condition_params[$k]);
|
| 203 |
-
$cond_params = array_slice($cond_params,0, count($cond_params)-1);
|
| 204 |
-
for($l=0; $l<count($cond_params); $l++)
|
| 205 |
-
{
|
| 206 |
-
$params_value = explode('***',$cond_params[$l]);
|
| 207 |
-
if(!isset($type_and_id[$params_value[0]]))
|
| 208 |
-
unset($cond_params[$l]);
|
| 209 |
-
}
|
| 210 |
-
$cond_params = array_values($cond_params);
|
| 211 |
-
|
| 212 |
-
$if = '';
|
| 213 |
-
$keyup = '';
|
| 214 |
-
$change = '';
|
| 215 |
-
$click = '';
|
| 216 |
-
|
| 217 |
-
for($m=0; $m<count($cond_params); $m++)
|
| 218 |
-
{
|
| 219 |
-
$params_value = explode('***',wp_specialchars_decode($cond_params[$m], 'single'));
|
| 220 |
-
switch($type_and_id[$params_value[0]])
|
| 221 |
-
{
|
| 222 |
-
case "type_text":
|
| 223 |
-
case "type_password":
|
| 224 |
-
case "type_textarea":
|
| 225 |
-
case "type_number":
|
| 226 |
-
case "type_submitter_mail":
|
| 227 |
-
case "type_spinner":
|
| 228 |
-
if($params_value[1] == "%" || $params_value[1] == "!%")
|
| 229 |
-
{
|
| 230 |
-
$like_or_not = ($params_value[1] == "%" ? ">" : "==");
|
| 231 |
-
$if .= ' jQuery("#wdform_'.$params_value[0].'_element'.$form_id.'").val().indexOf("'.$params_value[2].'")'.$like_or_not.'-1 ';
|
| 232 |
-
}
|
| 233 |
-
else
|
| 234 |
-
{
|
| 235 |
-
if($params_value[1] == "=" || $params_value[1] == "!")
|
| 236 |
-
{
|
| 237 |
-
$params_value[2] = "";
|
| 238 |
-
$params_value[1] = $params_value[1]."=";
|
| 239 |
-
}
|
| 240 |
-
$if .= ' jQuery("#wdform_'.$params_value[0].'_element'.$form_id.'").val()'.$params_value[1].'"'.$params_value[2].'" ';
|
| 241 |
-
}
|
| 242 |
-
|
| 243 |
-
$keyup .= '#wdform_'.$params_value[0].'_element'.$form_id.', ';
|
| 244 |
-
if($type_and_id[$params_value[0]] == "type_spinner")
|
| 245 |
-
$click .= '#wdform_'.$params_value[0].'_element'.$form_id.' ~ a, ';
|
| 246 |
-
break;
|
| 247 |
-
|
| 248 |
-
case "type_name":
|
| 249 |
-
if($params_value[1] == "%" || $params_value[1] == "!%")
|
| 250 |
-
{
|
| 251 |
-
$extended0 = '';
|
| 252 |
-
$extended1 = '';
|
| 253 |
-
$extended2 = '';
|
| 254 |
-
$extended3 = '';
|
| 255 |
-
$normal0 = '';
|
| 256 |
-
$normal1 = '';
|
| 257 |
-
$normal2 = '';
|
| 258 |
-
$normal3 = '';
|
| 259 |
-
|
| 260 |
-
$like_or_not = ($params_value[1] == "%" ? ">" : "==");
|
| 261 |
-
$name_fields = explode(' ',$params_value[2]);
|
| 262 |
-
if($name_fields[0]!='')
|
| 263 |
-
{
|
| 264 |
-
$extended0 = 'jQuery("#wdform_'.$params_value[0].'_element_title'.$form_id.'").val().indexOf("'.$name_fields[0].'")'.$like_or_not.'-1 ';
|
| 265 |
-
$normal0 = 'jQuery("#wdform_'.$params_value[0].'_element_first'.$form_id.'").val().indexOf("'.$name_fields[0].'")'.$like_or_not.'-1 ';
|
| 266 |
-
}
|
| 267 |
-
|
| 268 |
-
if(isset($name_fields[1]) && $name_fields[1]!='')
|
| 269 |
-
{
|
| 270 |
-
$extended1 = 'jQuery("#wdform_'.$params_value[0].'_element_first'.$form_id.'").val().indexOf("'.$name_fields[1].'")'.$like_or_not.'-1 ';
|
| 271 |
-
$normal1 = 'jQuery("#wdform_'.$params_value[0].'_element_last'.$form_id.'").val().indexOf("'.$name_fields[1].'")'.$like_or_not.'-1 ';
|
| 272 |
-
}
|
| 273 |
-
|
| 274 |
-
if(isset($name_fields[2]) && $name_fields[2]!='')
|
| 275 |
-
{
|
| 276 |
-
$extended2 = 'jQuery("#wdform_'.$params_value[0].'_element_last'.$form_id.'").val().indexOf("'.$name_fields[2].'")'.$like_or_not.'-1 ';
|
| 277 |
-
$normal2 = '';
|
| 278 |
-
}
|
| 279 |
-
|
| 280 |
-
if(isset($name_fields[3]) && $name_fields[3]!='')
|
| 281 |
-
{
|
| 282 |
-
$extended3 = 'jQuery("#wdform_'.$params_value[0].'_element_middle'.$form_id.'").val().indexOf("'.$name_fields[3].'")'.$like_or_not.'-1 ';
|
| 283 |
-
$normal3 = '';
|
| 284 |
-
}
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
if(isset($name_fields[3]))
|
| 288 |
-
{
|
| 289 |
-
$extended ='';
|
| 290 |
-
$normal ='';
|
| 291 |
-
if($extended0)
|
| 292 |
-
{
|
| 293 |
-
$extended = $extended0;
|
| 294 |
-
if($extended1)
|
| 295 |
-
{
|
| 296 |
-
$extended .= ' && '.$extended1;
|
| 297 |
-
if($extended2)
|
| 298 |
-
$extended .=' && '.$extended2;
|
| 299 |
-
|
| 300 |
-
if($extended3)
|
| 301 |
-
$extended .=' && '.$extended3;
|
| 302 |
-
}
|
| 303 |
-
else
|
| 304 |
-
{
|
| 305 |
-
if($extended2)
|
| 306 |
-
$extended .= ' && '.$extended2;
|
| 307 |
-
if($extended3)
|
| 308 |
-
$extended .= ' && '.$extended3;
|
| 309 |
-
}
|
| 310 |
-
}
|
| 311 |
-
else
|
| 312 |
-
{
|
| 313 |
-
if($extended1)
|
| 314 |
-
{
|
| 315 |
-
$extended = $extended1;
|
| 316 |
-
if($extended2)
|
| 317 |
-
$extended .=' && '.$extended2;
|
| 318 |
-
|
| 319 |
-
if($extended3)
|
| 320 |
-
$extended .=' && '.$extended3;
|
| 321 |
-
}
|
| 322 |
-
else
|
| 323 |
-
{
|
| 324 |
-
if($extended2)
|
| 325 |
-
{
|
| 326 |
-
$extended = $extended2;
|
| 327 |
-
if($extended3)
|
| 328 |
-
$extended .= ' && '.$extended3;
|
| 329 |
-
}
|
| 330 |
-
else
|
| 331 |
-
if($extended3)
|
| 332 |
-
$extended = $extended3;
|
| 333 |
-
}
|
| 334 |
-
}
|
| 335 |
-
|
| 336 |
-
if($normal0)
|
| 337 |
-
{
|
| 338 |
-
$normal = $normal0;
|
| 339 |
-
if($normal1)
|
| 340 |
-
$normal .= ' && '.$normal1;
|
| 341 |
-
}
|
| 342 |
-
else
|
| 343 |
-
{
|
| 344 |
-
if($normal1)
|
| 345 |
-
$normal = $normal1;
|
| 346 |
-
}
|
| 347 |
-
}
|
| 348 |
-
else
|
| 349 |
-
{
|
| 350 |
-
if(isset($name_fields[2]))
|
| 351 |
-
{
|
| 352 |
-
$extended ="";
|
| 353 |
-
$normal ="";
|
| 354 |
-
if($extended0)
|
| 355 |
-
{
|
| 356 |
-
$extended = $extended0;
|
| 357 |
-
if($extended1)
|
| 358 |
-
$extended .= ' && '.$extended1;
|
| 359 |
-
|
| 360 |
-
if($extended2)
|
| 361 |
-
$extended .=' && '.$extended2;
|
| 362 |
-
|
| 363 |
-
}
|
| 364 |
-
else
|
| 365 |
-
{
|
| 366 |
-
if($extended1)
|
| 367 |
-
{
|
| 368 |
-
$extended = $extended1;
|
| 369 |
-
if($extended2)
|
| 370 |
-
$extended .= ' && '.$extended2;
|
| 371 |
-
}
|
| 372 |
-
else
|
| 373 |
-
if($extended2)
|
| 374 |
-
$extended = $extended2;
|
| 375 |
-
}
|
| 376 |
-
|
| 377 |
-
|
| 378 |
-
if($normal0)
|
| 379 |
-
{
|
| 380 |
-
$normal = $normal0;
|
| 381 |
-
if($normal1)
|
| 382 |
-
$normal .= ' && '.$normal1;
|
| 383 |
-
}
|
| 384 |
-
else
|
| 385 |
-
{
|
| 386 |
-
if($normal1)
|
| 387 |
-
$normal = $normal1;
|
| 388 |
-
}
|
| 389 |
-
|
| 390 |
-
}
|
| 391 |
-
else
|
| 392 |
-
{
|
| 393 |
-
if(isset($name_fields[1]))
|
| 394 |
-
{
|
| 395 |
-
$extended ='';
|
| 396 |
-
$normal ='';
|
| 397 |
-
if($extended0)
|
| 398 |
-
{
|
| 399 |
-
if($extended1)
|
| 400 |
-
$extended = $extended0.' && '.$extended1;
|
| 401 |
-
else
|
| 402 |
-
$extended = $extended0;
|
| 403 |
-
}
|
| 404 |
-
else
|
| 405 |
-
{
|
| 406 |
-
if($extended1)
|
| 407 |
-
$extended = $extended1;
|
| 408 |
-
}
|
| 409 |
-
|
| 410 |
-
|
| 411 |
-
if($normal0)
|
| 412 |
-
{
|
| 413 |
-
if($normal1)
|
| 414 |
-
$normal = $normal0.' && '.$normal1;
|
| 415 |
-
else
|
| 416 |
-
$normal = $normal0;
|
| 417 |
-
}
|
| 418 |
-
else
|
| 419 |
-
{
|
| 420 |
-
if($normal1)
|
| 421 |
-
$normal = $normal1;
|
| 422 |
-
}
|
| 423 |
-
}
|
| 424 |
-
else
|
| 425 |
-
{
|
| 426 |
-
$extended = $extended0;
|
| 427 |
-
$normal = $normal0;
|
| 428 |
-
}
|
| 429 |
-
}
|
| 430 |
-
}
|
| 431 |
-
|
| 432 |
-
if($extended!="" && $normal!="")
|
| 433 |
-
$if .= ' ((jQuery("#wdform_'.$params_value[0].'_element_title'.$form_id.'").length != 0 || jQuery("#wdform_'.$params_value[0].'_element_middle'.$form_id.'").length != 0) ? '.$extended.' : '.$normal.') ';
|
| 434 |
-
else
|
| 435 |
-
$if .= ' true';
|
| 436 |
-
}
|
| 437 |
-
else
|
| 438 |
-
{
|
| 439 |
-
if($params_value[1] == "=" || $params_value[1] == "!")
|
| 440 |
-
{
|
| 441 |
-
$name_and_or = $params_value[1] == "=" ? "&&" : "||";
|
| 442 |
-
$name_empty_or_not = $params_value[1]."=";
|
| 443 |
-
$extended = ' (jQuery("#wdform_'.$params_value[0].'_element_title'.$form_id.'").val()'.$name_empty_or_not.'"" '.$name_and_or.' jQuery("#wdform_'.$params_value[0].'_element_first'.$form_id.'").val()'.$name_empty_or_not.'"" '.$name_and_or.' jQuery("#wdform_'.$params_value[0].'_element_last'.$form_id.'").val()'.$name_empty_or_not.'"" '.$name_and_or.' jQuery("#wdform_'.$params_value[0].'_element_middle'.$form_id.'").val()'.$name_empty_or_not.'"") ';
|
| 444 |
-
$normal = ' (jQuery("#wdform_'.$params_value[0].'_element_first'.$form_id.'").val()'.$name_empty_or_not.'"" '.$name_and_or.' jQuery("#wdform_'.$params_value[0].'_element_last'.$form_id.'").val()'.$name_empty_or_not.'"") ';
|
| 445 |
-
|
| 446 |
-
$if .= ' ((jQuery("#wdform_'.$params_value[0].'_element_title'.$form_id.'").length != 0 || jQuery("#wdform_'.$params_value[0].'_element_middle'.$form_id.'").length != 0) ? '.$extended.' : '.$normal.') ';
|
| 447 |
-
}
|
| 448 |
-
else
|
| 449 |
-
{
|
| 450 |
-
$extended0 = '';
|
| 451 |
-
$extended1 = '';
|
| 452 |
-
$extended2 = '';
|
| 453 |
-
$extended3 = '';
|
| 454 |
-
$normal0 = '';
|
| 455 |
-
$normal1 = '';
|
| 456 |
-
$normal2 = '';
|
| 457 |
-
$normal3 = '';
|
| 458 |
-
|
| 459 |
-
$name_fields = explode(' ',$params_value[2]);
|
| 460 |
-
if($name_fields[0]!='')
|
| 461 |
-
{
|
| 462 |
-
$extended0 = 'jQuery("#wdform_'.$params_value[0].'_element_title'.$form_id.'").val()'.$params_value[1].'"'.$name_fields[0].'"';
|
| 463 |
-
$normal0 = 'jQuery("#wdform_'.$params_value[0].'_element_first'.$form_id.'").val()'.$params_value[1].'"'.$name_fields[0].'"';
|
| 464 |
-
}
|
| 465 |
-
|
| 466 |
-
if(isset($name_fields[1]) && $name_fields[1]!='')
|
| 467 |
-
{
|
| 468 |
-
$extended1 = 'jQuery("#wdform_'.$params_value[0].'_element_first'.$form_id.'").val()'.$params_value[1].'"'.$name_fields[1].'"';
|
| 469 |
-
$normal1 = 'jQuery("#wdform_'.$params_value[0].'_element_last'.$form_id.'").val()'.$params_value[1].'"'.$name_fields[1].'"';
|
| 470 |
-
}
|
| 471 |
-
|
| 472 |
-
if(isset($name_fields[2]) && $name_fields[2]!='')
|
| 473 |
-
{
|
| 474 |
-
$extended2 = 'jQuery("#wdform_'.$params_value[0].'_element_last'.$form_id.'").val()'.$params_value[1].'"'.$name_fields[2].'"';
|
| 475 |
-
$normal2 = '';
|
| 476 |
-
}
|
| 477 |
-
|
| 478 |
-
if(isset($name_fields[3]) && $name_fields[3]!='')
|
| 479 |
-
{
|
| 480 |
-
$extended3 = 'jQuery("#wdform_'.$params_value[0].'_element_middle'.$form_id.'").val()'.$params_value[1].'"'.$name_fields[3].'"';
|
| 481 |
-
$normal3 = '';
|
| 482 |
-
}
|
| 483 |
-
|
| 484 |
-
|
| 485 |
-
if(isset($name_fields[3]))
|
| 486 |
-
{
|
| 487 |
-
$extended ='';
|
| 488 |
-
$normal ='';
|
| 489 |
-
|
| 490 |
-
if($extended0)
|
| 491 |
-
{
|
| 492 |
-
$extended = $extended0;
|
| 493 |
-
if($extended1)
|
| 494 |
-
{
|
| 495 |
-
$extended .= ' && '.$extended1;
|
| 496 |
-
if($extended2)
|
| 497 |
-
$extended .= ' && '.$extended2;
|
| 498 |
-
|
| 499 |
-
if($extended3)
|
| 500 |
-
$extended .= ' && '.$extended3;
|
| 501 |
-
}
|
| 502 |
-
else
|
| 503 |
-
{
|
| 504 |
-
if($extended2)
|
| 505 |
-
$extended .= ' && '.$extended2;
|
| 506 |
-
if($extended3)
|
| 507 |
-
$extended .= ' && '.$extended3;
|
| 508 |
-
}
|
| 509 |
-
}
|
| 510 |
-
else
|
| 511 |
-
{
|
| 512 |
-
if($extended1)
|
| 513 |
-
{
|
| 514 |
-
$extended = $extended1;
|
| 515 |
-
if($extended2)
|
| 516 |
-
$extended .= ' && '.$extended2;
|
| 517 |
-
|
| 518 |
-
if($extended3)
|
| 519 |
-
$extended .= ' && '.$extended3;
|
| 520 |
-
}
|
| 521 |
-
else
|
| 522 |
-
{
|
| 523 |
-
if($extended2)
|
| 524 |
-
{
|
| 525 |
-
$extended = $extended2;
|
| 526 |
-
if($extended3)
|
| 527 |
-
$extended .= ' && '.$extended3;
|
| 528 |
-
}
|
| 529 |
-
else
|
| 530 |
-
if($extended3)
|
| 531 |
-
$extended = $extended3;
|
| 532 |
-
}
|
| 533 |
-
}
|
| 534 |
-
|
| 535 |
-
if($normal0)
|
| 536 |
-
{
|
| 537 |
-
$normal = $normal0;
|
| 538 |
-
if($normal1)
|
| 539 |
-
$normal .= ' && '.$normal1;
|
| 540 |
-
}
|
| 541 |
-
else
|
| 542 |
-
{
|
| 543 |
-
if($normal1)
|
| 544 |
-
$normal = $normal1;
|
| 545 |
-
}
|
| 546 |
-
}
|
| 547 |
-
else
|
| 548 |
-
{
|
| 549 |
-
if(isset($name_fields[2]))
|
| 550 |
-
{
|
| 551 |
-
$extended ="";
|
| 552 |
-
$normal ="";
|
| 553 |
-
if($extended0)
|
| 554 |
-
{
|
| 555 |
-
$extended = $extended0;
|
| 556 |
-
if($extended1)
|
| 557 |
-
$extended .= ' && '.$extended1;
|
| 558 |
-
|
| 559 |
-
if($extended2)
|
| 560 |
-
$extended .= ' && '.$extended2;
|
| 561 |
-
|
| 562 |
-
}
|
| 563 |
-
else
|
| 564 |
-
{
|
| 565 |
-
if($extended1)
|
| 566 |
-
{
|
| 567 |
-
$extended = $extended1;
|
| 568 |
-
if($extended2)
|
| 569 |
-
$extended .= ' && '.$extended2;
|
| 570 |
-
}
|
| 571 |
-
else
|
| 572 |
-
if($extended2)
|
| 573 |
-
$extended = $extended2;
|
| 574 |
-
}
|
| 575 |
-
|
| 576 |
-
|
| 577 |
-
if($normal0)
|
| 578 |
-
{
|
| 579 |
-
$normal = $normal0;
|
| 580 |
-
if($normal1)
|
| 581 |
-
$normal .= ' && '.$normal1;
|
| 582 |
-
}
|
| 583 |
-
else
|
| 584 |
-
{
|
| 585 |
-
if($normal1)
|
| 586 |
-
$normal = $normal1;
|
| 587 |
-
}
|
| 588 |
-
|
| 589 |
-
}
|
| 590 |
-
else
|
| 591 |
-
{
|
| 592 |
-
if(isset($name_fields[1]))
|
| 593 |
-
{
|
| 594 |
-
$extended ='';
|
| 595 |
-
$normal ='';
|
| 596 |
-
if($extended0)
|
| 597 |
-
{
|
| 598 |
-
if($extended1)
|
| 599 |
-
$extended = $extended0.' && '.$extended1;
|
| 600 |
-
else
|
| 601 |
-
$extended = $extended0;
|
| 602 |
-
}
|
| 603 |
-
else
|
| 604 |
-
{
|
| 605 |
-
if($extended1)
|
| 606 |
-
$extended = $extended1;
|
| 607 |
-
}
|
| 608 |
-
|
| 609 |
-
|
| 610 |
-
if($normal0)
|
| 611 |
-
{
|
| 612 |
-
if($normal1)
|
| 613 |
-
$normal = $normal0.' && '.$normal1;
|
| 614 |
-
else
|
| 615 |
-
$normal = $normal0;
|
| 616 |
-
}
|
| 617 |
-
else
|
| 618 |
-
{
|
| 619 |
-
if($normal1)
|
| 620 |
-
$normal = $normal1;
|
| 621 |
-
}
|
| 622 |
-
}
|
| 623 |
-
else
|
| 624 |
-
{
|
| 625 |
-
$extended = $extended0;
|
| 626 |
-
$normal = $normal0;
|
| 627 |
-
}
|
| 628 |
-
}
|
| 629 |
-
}
|
| 630 |
-
|
| 631 |
-
if($extended!="" && $normal!="")
|
| 632 |
-
$if .= ' ((jQuery("#wdform_'.$params_value[0].'_element_title'.$form_id.'").length != 0 || jQuery("#wdform_'.$params_value[0].'_element_middle'.$form_id.'").length != 0) ? '.$extended.' : '.$normal.') ';
|
| 633 |
-
else
|
| 634 |
-
$if .= ' true';
|
| 635 |
-
}
|
| 636 |
-
}
|
| 637 |
-
$keyup .= '#wdform_'.$params_value[0].'_element_title'.$form_id.', #wdform_'.$params_value[0].'_element_first'.$form_id.', #wdform_'.$params_value[0].'_element_last'.$form_id.', #wdform_'.$params_value[0].'_element_middle'.$form_id.', ';
|
| 638 |
-
break;
|
| 639 |
-
|
| 640 |
-
case "type_phone":
|
| 641 |
-
if($params_value[1] == "==" || $params_value[1] == "!=")
|
| 642 |
-
{
|
| 643 |
-
$phone_fields = explode(' ',$params_value[2]);
|
| 644 |
-
if(isset($phone_fields[1]))
|
| 645 |
-
{
|
| 646 |
-
if($phone_fields[0]!='' && $phone_fields[1]!='')
|
| 647 |
-
$if .= ' (jQuery("#wdform_'.$params_value[0].'_element_first'.$form_id.'").val()'.$params_value[1].'"'.$phone_fields[0].'" && jQuery("#wdform_'.$params_value[0].'_element_last'.$form_id.'").val()'.$params_value[1].'"'.$phone_fields[1].'") ';
|
| 648 |
-
else
|
| 649 |
-
{
|
| 650 |
-
if($phone_fields[0]=='')
|
| 651 |
-
$if .= ' (jQuery("#wdform_'.$params_value[0].'_element_last'.$form_id.'").val()'.$params_value[1].'"'.$phone_fields[1].'") ';
|
| 652 |
-
else
|
| 653 |
-
if($phone_fields[1]=='')
|
| 654 |
-
$if .= ' (jQuery("#wdform_'.$params_value[0].'_element_first'.$form_id.'").val()'.$params_value[1].'"'.$phone_fields[1].'") ';
|
| 655 |
-
}
|
| 656 |
-
}
|
| 657 |
-
else
|
| 658 |
-
$if .= ' jQuery("#wdform_'.$params_value[0].'_element_first'.$form_id.'").val()'.$params_value[1].'"'.$params_value[2].'" ';
|
| 659 |
-
}
|
| 660 |
-
|
| 661 |
-
if($params_value[1] == "%" || $params_value[1] == "!%")
|
| 662 |
-
{
|
| 663 |
-
$like_or_not = ($params_value[1] == "%" ? ">" : "==");
|
| 664 |
-
$phone_fields = explode(' ',$params_value[2]);
|
| 665 |
-
if(isset($phone_fields[1]))
|
| 666 |
-
{
|
| 667 |
-
if($phone_fields[0]!='' && $phone_fields[1]!='')
|
| 668 |
-
$if .= ' (jQuery("#wdform_'.$params_value[0].'_element_first'.$form_id.'").val().indexOf("'.$phone_fields[0].'")'.$like_or_not.'-1 && jQuery("#wdform_'.$params_value[0].'_element_last'.$form_id.'").val().indexOf("'.$phone_fields[1].'")'.$like_or_not.'-1)';
|
| 669 |
-
else
|
| 670 |
-
{
|
| 671 |
-
if($phone_fields[0]=='')
|
| 672 |
-
$if .= ' (jQuery("#wdform_'.$params_value[0].'_element_last'.$form_id.'").val().indexOf("'.$phone_fields[1].'")'.$like_or_not.'-1) ';
|
| 673 |
-
else
|
| 674 |
-
if($phone_fields[1]=='')
|
| 675 |
-
$if .= ' (jQuery("#wdform_'.$params_value[0].'_element_first'.$form_id.'").val().indexOf("'.$phone_fields[0].'")'.$like_or_not.'-1) ';
|
| 676 |
-
}
|
| 677 |
-
}
|
| 678 |
-
else
|
| 679 |
-
$if .= ' (jQuery("#wdform_'.$params_value[0].'_element_first'.$form_id.'").val().indexOf("'.$phone_fields[0].'")'.$like_or_not.'-1) ';
|
| 680 |
-
}
|
| 681 |
-
|
| 682 |
-
if($params_value[1] == "=" || $params_value[1] == "!")
|
| 683 |
-
{
|
| 684 |
-
$params_value[2] = "";
|
| 685 |
-
$and_or_phone = ($params_value[1]=="=" ? "&&" : "||");
|
| 686 |
-
$params_value[1] = $params_value[1]."=";
|
| 687 |
-
|
| 688 |
-
$if .= ' (jQuery("#wdform_'.$params_value[0].'_element_first'.$form_id.'").val()'.$params_value[1].'"'.$params_value[2].'" '.$and_or_phone.' jQuery("#wdform_'.$params_value[0].'_element_last'.$form_id.'").val()'.$params_value[1].'"'.$params_value[2].'") ';
|
| 689 |
-
}
|
| 690 |
-
|
| 691 |
-
|
| 692 |
-
$keyup .= '#wdform_'.$params_value[0].'_element_first'.$form_id.', #wdform_'.$params_value[0].'_element_last'.$form_id.', ';
|
| 693 |
-
break;
|
| 694 |
-
|
| 695 |
-
case "type_paypal_price":
|
| 696 |
-
if($params_value[1] == "==" || $params_value[1] == "!=")
|
| 697 |
-
$if .= ' (jQuery("#wdform_'.$params_value[0].'_td_name_cents").attr("style")=="display: none;" ? jQuery("#wdform_'.$params_value[0].'_element_dollars'.$form_id.'").val()'.$params_value[1].'"'.$params_value[2].'" : parseFloat(jQuery("#wdform_'.$params_value[0].'_element_dollars'.$form_id.'").val()+"."+jQuery("#wdform_'.$params_value[0].'_element_cents'.$form_id.'").val())'.$params_value[1].'parseFloat("'.str_replace('.0', '.', $params_value[2]).'"))';
|
| 698 |
-
|
| 699 |
-
if($params_value[1] == "%" || $params_value[1] == "!%")
|
| 700 |
-
{
|
| 701 |
-
$like_or_not = ($params_value[1] == "%" ? ">" : "==");
|
| 702 |
-
$if .= ' (jQuery("#wdform_'.$params_value[0].'_td_name_cents").attr("style")=="display: none;" ? jQuery("#wdform_'.$params_value[0].'_element_dollars'.$form_id.'").val().indexOf("'.$params_value[2].'")'.$like_or_not.'-1 : (jQuery("#wdform_'.$params_value[0].'_element_dollars'.$form_id.'").val()+"."+jQuery("#wdform_'.$params_value[0].'_element_cents'.$form_id.'").val()).indexOf("'.str_replace('.0', '.', $params_value[2]).'")'.$like_or_not.'-1) ';
|
| 703 |
-
}
|
| 704 |
-
|
| 705 |
-
if($params_value[1] == "=" || $params_value[1] == "!")
|
| 706 |
-
{
|
| 707 |
-
$params_value[2] = "";
|
| 708 |
-
$and_or_price = ($params_value[1]=="=" ? "&&" : "||");
|
| 709 |
-
$params_value[1] = $params_value[1]."=";
|
| 710 |
-
$if .= ' (jQuery("#wdform_'.$params_value[0].'_td_name_cents").attr("style")=="display: none;" ? jQuery("#wdform_'.$params_value[0].'_element_dollars'.$form_id.'").val()'.$params_value[1].'"'.$params_value[2].'" : (jQuery("#wdform_'.$params_value[0].'_element_dollars'.$form_id.'").val()'.$params_value[1].'"'.$params_value[2].'" '.$and_or_price.' jQuery("#wdform_'.$params_value[0].'_element_cents'.$form_id.'").val()'.$params_value[1].'"'.$params_value[2].'"))';
|
| 711 |
-
}
|
| 712 |
-
|
| 713 |
-
$keyup .= '#wdform_'.$params_value[0].'_element_dollars'.$form_id.', #wdform_'.$params_value[0].'_element_cents'.$form_id.', ';
|
| 714 |
-
break;
|
| 715 |
-
|
| 716 |
-
case "type_own_select":
|
| 717 |
-
if($params_value[1] == "%" || $params_value[1] == "!%")
|
| 718 |
-
{
|
| 719 |
-
$like_or_not = ($params_value[1] == "%" ? ">" : "==");
|
| 720 |
-
$if .= ' jQuery("#wdform_'.$params_value[0].'_element'.$form_id.'").val().indexOf("'.$params_value[2].'")'.$like_or_not.'-1 ';
|
| 721 |
-
}
|
| 722 |
-
else
|
| 723 |
-
{
|
| 724 |
-
if($params_value[1] == "=" || $params_value[1] == "!")
|
| 725 |
-
{
|
| 726 |
-
$params_value[2] = "";
|
| 727 |
-
$params_value[1] = $params_value[1]."=";
|
| 728 |
-
}
|
| 729 |
-
$if .= ' jQuery("#wdform_'.$params_value[0].'_element'.$form_id.'").val()'.$params_value[1].'"'.$params_value[2].'" ';
|
| 730 |
-
}
|
| 731 |
-
$change .= '#wdform_'.$params_value[0].'_element'.$form_id.', ';
|
| 732 |
-
break;
|
| 733 |
-
|
| 734 |
-
case "type_paypal_select":
|
| 735 |
-
if($params_value[1] == "%" || $params_value[1] == "!%")
|
| 736 |
-
{
|
| 737 |
-
$like_or_not = ($params_value[1] == "%" ? ">" : "==");
|
| 738 |
-
$if .= ' jQuery("#wdform_'.$params_value[0].'_element'.$form_id.'").val().indexOf("'.$params_value[2].'")'.$like_or_not.'-1 ';
|
| 739 |
-
}
|
| 740 |
-
else
|
| 741 |
-
{
|
| 742 |
-
if($params_value[1] == "=" || $params_value[1] == "!")
|
| 743 |
-
{
|
| 744 |
-
$params_value[2] = "";
|
| 745 |
-
$params_value[1] = $params_value[1]."=";
|
| 746 |
-
$if .= ' jQuery("#wdform_'.$params_value[0].'_element'.$form_id.'").val()'.$params_value[1].'"'.$params_value[2].'"';
|
| 747 |
-
}
|
| 748 |
-
else
|
| 749 |
-
{
|
| 750 |
-
if ( strpos($params_value[2], '*:*value*:*') > -1 ) {
|
| 751 |
-
$and_or = $params_value[1] == "==" ? '&&' : '||';
|
| 752 |
-
$choise_and_value = explode("*:*value*:*", $params_value[2]);
|
| 753 |
-
$params_value[2] = $choise_and_value[1];
|
| 754 |
-
$params_label = $choise_and_value[0];
|
| 755 |
-
$if .= ' jQuery("#wdform_'.$params_value[0].'_element'.$form_id.'").val()'.$params_value[1].'"'.$params_value[2].'" '.$and_or.' jQuery("div[wdid='.$params_value[0].'] select option:selected").text()'.$params_value[1].'"'.$params_label.'" ';
|
| 756 |
-
} else {
|
| 757 |
-
$if .= ' jQuery("#wdform_'.$params_value[0].'_element'.$form_id.'").val()'.$params_value[1].'"'.$params_value[2].'" ';
|
| 758 |
-
}
|
| 759 |
-
}
|
| 760 |
-
}
|
| 761 |
-
$change .= '#wdform_'.$params_value[0].'_element'.$form_id.', ';
|
| 762 |
-
break;
|
| 763 |
-
case "type_address":
|
| 764 |
-
if($params_value[1] == "%" || $params_value[1] == "!%")
|
| 765 |
-
{
|
| 766 |
-
$like_or_not = ($params_value[1] == "%" ? ">" : "==");
|
| 767 |
-
$if .= ' jQuery("#wdform_'.$params_value[0].'_country'.$form_id.'").val().indexOf("'.$params_value[2].'")'.$like_or_not.'-1 ';
|
| 768 |
-
}
|
| 769 |
-
else
|
| 770 |
-
{
|
| 771 |
-
if($params_value[1] == "=" || $params_value[1] == "!")
|
| 772 |
-
{
|
| 773 |
-
$params_value[2] = "";
|
| 774 |
-
$params_value[1] = $params_value[1]."=";
|
| 775 |
-
}
|
| 776 |
-
$if .= ' jQuery("#wdform_'.$params_value[0].'_country'.$form_id.'").val()'.$params_value[1].'"'.$params_value[2].'" ';
|
| 777 |
-
}
|
| 778 |
-
$change .= '#wdform_'.$params_value[0].'_country'.$form_id.', ';
|
| 779 |
-
break;
|
| 780 |
-
case "type_country":
|
| 781 |
-
if($params_value[1] == "%" || $params_value[1] == "!%")
|
| 782 |
-
{
|
| 783 |
-
$like_or_not = ($params_value[1] == "%" ? ">" : "==");
|
| 784 |
-
$if .= ' wdformjQuery("#wdform_'.$params_value[0].'_element'.$form_id.'").val().indexOf("'.$params_value[2].'")'.$like_or_not.'-1 ';
|
| 785 |
-
}
|
| 786 |
-
else
|
| 787 |
-
{
|
| 788 |
-
if($params_value[1] == "=" || $params_value[1] == "!")
|
| 789 |
-
{
|
| 790 |
-
$params_value[2] = "";
|
| 791 |
-
$params_value[1] = $params_value[1]."=";
|
| 792 |
-
}
|
| 793 |
-
$if .= ' wdformjQuery("#wdform_'.$params_value[0].'_element'.$form_id.'").val()'.$params_value[1].'"'.$params_value[2].'" ';
|
| 794 |
-
}
|
| 795 |
-
$change .= '#wdform_'.$params_value[0].'_element'.$form_id.', ';
|
| 796 |
-
break;
|
| 797 |
-
|
| 798 |
-
case "type_radio":
|
| 799 |
-
case "type_paypal_radio":
|
| 800 |
-
case "type_paypal_shipping":
|
| 801 |
-
|
| 802 |
-
if($params_value[1] == "==" || $params_value[1] == "!=")
|
| 803 |
-
{
|
| 804 |
-
if ( strpos($params_value[2], '*:*value*:*') > -1 ) {
|
| 805 |
-
$and_or = $params_value[1] == "==" ? '&&' : '||';
|
| 806 |
-
$choise_and_value = explode("*:*value*:*", $params_value[2]);
|
| 807 |
-
$params_value[2] = $choise_and_value[1];
|
| 808 |
-
$params_label = $choise_and_value[0];
|
| 809 |
-
$if .= ' jQuery("input[name^=\'wdform_'.$params_value[0].'_element'.$form_id.'\']:checked").val()'.$params_value[1].'"'.$params_value[2].'" '.$and_or.' jQuery("input[name^=\'wdform_'.$params_value[0].'_element'.$form_id.'\']:checked").attr("title")'.$params_value[1].'"'.$params_label.'" ';
|
| 810 |
-
} else {
|
| 811 |
-
$if .= ' jQuery("input[name^=\'wdform_'.$params_value[0].'_element'.$form_id.'\']:checked").val()'.$params_value[1].'"'.$params_value[2].'" ';
|
| 812 |
-
}
|
| 813 |
-
|
| 814 |
-
$click .= 'div[wdid='.$params_value[0].'] input[type=\'radio\'], ';
|
| 815 |
-
}
|
| 816 |
-
|
| 817 |
-
if($params_value[1] == "%" || $params_value[1] == "!%")
|
| 818 |
-
{
|
| 819 |
-
$click .= 'div[wdid='.$params_value[0].'] input[type=\'radio\'], ';
|
| 820 |
-
$like_or_not = ($params_value[1] == "%" ? ">" : "==");
|
| 821 |
-
$if .= ' (jQuery("input[name^=\'wdform_'.$params_value[0].'_element'.$form_id.'\']:checked").val() ? (jQuery("input[name^=\'wdform_'.$params_value[0].'_element'.$form_id.'\']:checked").attr("other") ? false : (jQuery("input[name^=\'wdform_'.$params_value[0].'_element'.$form_id.'\']:checked").val().indexOf("'.$params_value[2].'")'.$like_or_not.'-1 )) : false) ';
|
| 822 |
-
|
| 823 |
-
}
|
| 824 |
-
|
| 825 |
-
if($params_value[1] == "=" || $params_value[1] == "!")
|
| 826 |
-
{
|
| 827 |
-
$ckecked_or_no = ($params_value[1] == "=" ? "!" : "");
|
| 828 |
-
$if .= ' '.$ckecked_or_no.'jQuery("input[name^=\'wdform_'.$params_value[0].'_element'.$form_id.'\']:checked").val()';
|
| 829 |
-
$click .= 'div[wdid='.$params_value[0].'] input[type=\'radio\'], ';
|
| 830 |
-
}
|
| 831 |
-
|
| 832 |
-
break;
|
| 833 |
-
|
| 834 |
-
case "type_checkbox":
|
| 835 |
-
case "type_paypal_checkbox":
|
| 836 |
-
if($params_value[1] == "==" || $params_value[1] == "!=")
|
| 837 |
-
{
|
| 838 |
-
if($params_value[2])
|
| 839 |
-
{
|
| 840 |
-
$choises = explode('@@@',$params_value[2]);
|
| 841 |
-
$choises = array_slice($choises,0, count($choises)-1);
|
| 842 |
-
|
| 843 |
-
if($params_value[1]=="!=")
|
| 844 |
-
$is = "!";
|
| 845 |
-
else
|
| 846 |
-
$is = "";
|
| 847 |
-
|
| 848 |
-
foreach($choises as $key1=>$choise)
|
| 849 |
-
{
|
| 850 |
-
if($type_and_id[$params_value[0]]=="type_paypal_checkbox")
|
| 851 |
-
{
|
| 852 |
-
$choise_and_value = explode("*:*value*:*",$choise);
|
| 853 |
-
$if .= ' '.$is.'(jQuery("div[wdid='.$params_value[0].'] input[value=\"'.$choise_and_value[1].'\"]").is(":checked") && jQuery("div[wdid='.$params_value[0].'] input[title=\"'.$choise_and_value[0].'\"]"))';
|
| 854 |
-
|
| 855 |
-
}
|
| 856 |
-
else
|
| 857 |
-
$if .= ' '.$is.'jQuery("div[wdid='.$params_value[0].'] input[value=\"'.$choise.'\"]").is(":checked") ';
|
| 858 |
-
|
| 859 |
-
if($key1!=count($choises)-1)
|
| 860 |
-
$if .= '&&';
|
| 861 |
-
}
|
| 862 |
-
|
| 863 |
-
$click .= 'div[wdid='.$params_value[0].'] input[type=\'checkbox\'], ';
|
| 864 |
-
}
|
| 865 |
-
else
|
| 866 |
-
{
|
| 867 |
-
if($or_and=='&&')
|
| 868 |
-
$if .= ' true';
|
| 869 |
-
else
|
| 870 |
-
$if .= ' false';
|
| 871 |
-
}
|
| 872 |
-
}
|
| 873 |
-
|
| 874 |
-
if($params_value[1] == "%" || $params_value[1] == "!%")
|
| 875 |
-
{
|
| 876 |
-
$like_or_not = ($params_value[1] == "%" ? ">" : "==");
|
| 877 |
-
if($params_value[2])
|
| 878 |
-
{
|
| 879 |
-
$choises = explode('@@@',$params_value[2]);
|
| 880 |
-
$choises = array_slice($choises,0, count($choises)-1);
|
| 881 |
-
|
| 882 |
-
if($type_and_id[$params_value[0]]=="type_paypal_checkbox")
|
| 883 |
-
{
|
| 884 |
-
foreach($choises as $key1=>$choise)
|
| 885 |
-
{
|
| 886 |
-
|
| 887 |
-
$choise_and_value = explode("*:*value*:*",$choise);
|
| 888 |
-
|
| 889 |
-
$if .= ' jQuery("div[wdid='.$params_value[0].'] input[type=\"checkbox\"]:checked").serialize().indexOf("'.$choise_and_value[1].'")'.$like_or_not.'-1 ';
|
| 890 |
-
|
| 891 |
-
if($key1!=count($choises)-1)
|
| 892 |
-
$if .= '&&';
|
| 893 |
-
}
|
| 894 |
-
}
|
| 895 |
-
else
|
| 896 |
-
{
|
| 897 |
-
foreach($choises as $key1=>$choise)
|
| 898 |
-
{
|
| 899 |
-
$if .= ' jQuery("div[wdid='.$params_value[0].'] input[type=\"checkbox\"]:checked").serialize().indexOf("'.str_replace(" ","+",$choise).'")'.$like_or_not.'-1 ';
|
| 900 |
-
|
| 901 |
-
if($key1!=count($choises)-1)
|
| 902 |
-
$if .= '&&';
|
| 903 |
-
}
|
| 904 |
-
}
|
| 905 |
-
|
| 906 |
-
|
| 907 |
-
|
| 908 |
-
|
| 909 |
-
$click .= 'div[wdid='.$params_value[0].'] input[type=\'checkbox\'], ';
|
| 910 |
-
}
|
| 911 |
-
else
|
| 912 |
-
{
|
| 913 |
-
if($or_and=='&&')
|
| 914 |
-
$if .= ' true';
|
| 915 |
-
else
|
| 916 |
-
$if .= ' false';
|
| 917 |
-
}
|
| 918 |
-
|
| 919 |
-
}
|
| 920 |
-
|
| 921 |
-
if($params_value[1] == "=" || $params_value[1] == "!")
|
| 922 |
-
{
|
| 923 |
-
$ckecked_or_no = ($params_value[1] == "=" ? "==" : ">");
|
| 924 |
-
$if .= ' jQuery("div[wdid='.$params_value[0].'] input[type=\"checkbox\"]:checked").length'.$ckecked_or_no.'0 ';
|
| 925 |
-
$click .= 'div[wdid='.$params_value[0].'] input[type=\'checkbox\'], ';
|
| 926 |
-
|
| 927 |
-
}
|
| 928 |
-
|
| 929 |
-
|
| 930 |
-
break;
|
| 931 |
-
}
|
| 932 |
-
|
| 933 |
-
if($m!=count($cond_params)-1)
|
| 934 |
-
{
|
| 935 |
-
$params_value_next = explode('***',$cond_params[$m+1]);
|
| 936 |
-
if(isset($type_and_id[$params_value_next[0]]))
|
| 937 |
-
$if .= $or_and;
|
| 938 |
-
}
|
| 939 |
-
|
| 940 |
-
}
|
| 941 |
-
|
| 942 |
-
if($if)
|
| 943 |
-
{
|
| 944 |
-
$condition_js .= '
|
| 945 |
-
|
| 946 |
-
if('.$if.')
|
| 947 |
-
jQuery("div[wdid='.$field_label[$k].']").'.$display .';
|
| 948 |
-
else
|
| 949 |
-
jQuery("div[wdid='.$field_label[$k].']").'.$display_none .';';
|
| 950 |
-
}
|
| 951 |
-
|
| 952 |
-
if($keyup)
|
| 953 |
-
$condition_js .= '
|
| 954 |
-
jQuery("'.substr($keyup,0,-2).'").keyup(function() {
|
| 955 |
-
|
| 956 |
-
if('.$if.')
|
| 957 |
-
jQuery("div[wdid='.$field_label[$k].']").'.$display .';
|
| 958 |
-
else
|
| 959 |
-
jQuery("div[wdid='.$field_label[$k].']").'.$display_none .'; });';
|
| 960 |
-
|
| 961 |
-
if($change)
|
| 962 |
-
$condition_js .= '
|
| 963 |
-
jQuery("'.substr($change,0,-2).'").change(function() {
|
| 964 |
-
if('.$if.')
|
| 965 |
-
jQuery("div[wdid='.$field_label[$k].']").'.$display .';
|
| 966 |
-
else
|
| 967 |
-
jQuery("div[wdid='.$field_label[$k].']").'.$display_none .'; });';
|
| 968 |
-
|
| 969 |
-
if($click)
|
| 970 |
-
{
|
| 971 |
-
$condition_js .= '
|
| 972 |
-
jQuery("'.substr($click,0,-2).'").click(function() {
|
| 973 |
-
if('.$if.')
|
| 974 |
-
jQuery("div[wdid='.$field_label[$k].']").'.$display .';
|
| 975 |
-
else
|
| 976 |
-
jQuery("div[wdid='.$field_label[$k].']").'.$display_none .'; });';
|
| 977 |
-
}
|
| 978 |
-
}
|
| 979 |
-
|
| 980 |
-
|
| 981 |
-
}
|
| 982 |
-
|
| 983 |
-
}
|
| 984 |
-
|
| 985 |
-
if ($row->autogen_layout == 0) {
|
| 986 |
-
$form=$row->custom_front;
|
| 987 |
-
}
|
| 988 |
-
else {
|
| 989 |
-
$form = $row->form_front;
|
| 990 |
-
}
|
| 991 |
-
foreach($id1s as $id1s_key => $id1) {
|
| 992 |
-
$label=$labels[$id1s_key];
|
| 993 |
-
$type=$types[$id1s_key];
|
| 994 |
-
$params=$paramss[$id1s_key];
|
| 995 |
-
if (strpos($form, '%'.$id1.' - '.$label.'%') || strpos($form, '%'.$id1.' -'.$label.'%')) {
|
| 996 |
-
$rep='';
|
| 997 |
-
$required=false;
|
| 998 |
-
$param=array();
|
| 999 |
-
$param['attributes'] = '';
|
| 1000 |
-
$is_type[$type]=true;
|
| 1001 |
-
switch($type) {
|
| 1002 |
-
case 'type_section_break': {
|
| 1003 |
-
$params_names=array('w_editor');
|
| 1004 |
-
$temp=$params;
|
| 1005 |
-
foreach($params_names as $params_name ) {
|
| 1006 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1007 |
-
$param[$params_name] = $temp[0];
|
| 1008 |
-
$temp=$temp[1];
|
| 1009 |
-
}
|
| 1010 |
-
$rep ='<div type="type_section_break" class="wdform-field-section-break"><div class="wdform_section_break">' . html_entity_decode($param['w_editor']) . '</div></div>';
|
| 1011 |
-
break;
|
| 1012 |
-
}
|
| 1013 |
-
case 'type_editor': {
|
| 1014 |
-
$params_names=array('w_editor');
|
| 1015 |
-
$temp=$params;
|
| 1016 |
-
foreach($params_names as $params_name ) {
|
| 1017 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1018 |
-
$param[$params_name] = $temp[0];
|
| 1019 |
-
$temp=$temp[1];
|
| 1020 |
-
}
|
| 1021 |
-
$rep ='<div type="type_editor" class="wdform-field">' . html_entity_decode($param['w_editor']) . '</div>';
|
| 1022 |
-
break;
|
| 1023 |
-
}
|
| 1024 |
-
case 'type_send_copy': {
|
| 1025 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_first_val','w_required');
|
| 1026 |
-
$temp=$params;
|
| 1027 |
-
foreach($params_names as $params_name ) {
|
| 1028 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1029 |
-
$param[$params_name] = $temp[0];
|
| 1030 |
-
$temp=$temp[1];
|
| 1031 |
-
}
|
| 1032 |
-
if($temp) {
|
| 1033 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1034 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1035 |
-
foreach($attrs as $attr) {
|
| 1036 |
-
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 1037 |
-
}
|
| 1038 |
-
}
|
| 1039 |
-
$input_active = ($param['w_first_val']=='true' ? "checked='checked'" : "");
|
| 1040 |
-
$post_value = isset($_POST["counter".$form_id]) ? esc_html($_POST["counter".$form_id]) : NULL;
|
| 1041 |
-
if(isset($post_value)) {
|
| 1042 |
-
$post_temp = isset($_POST['wdform_'.$id1.'_element'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element'.$form_id])) : "";
|
| 1043 |
-
$input_active = (isset($post_temp) ? "checked='checked'" : "");
|
| 1044 |
-
}
|
| 1045 |
-
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 1046 |
-
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 1047 |
-
$required = ($param['w_required']=="yes" ? true : false);
|
| 1048 |
-
$rep ='<div type="type_send_copy" class="wdform-field"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].' width: '.$param['w_field_label_size'].'px;"><span class="wdform-label"><label for="wdform_'.$id1.'_element'.$form_id.'">'.$label.'</label></span>';
|
| 1049 |
-
if($required) {
|
| 1050 |
-
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 1051 |
-
}
|
| 1052 |
-
$rep.='</div>
|
| 1053 |
-
<div class="wdform-element-section" style="'.$param['w_field_label_pos2'].'" >
|
| 1054 |
-
<div class="checkbox-div" style="left:3px">
|
| 1055 |
-
<input type="checkbox" id="wdform_'.$id1.'_element'.$form_id.'" name="wdform_'.$id1.'_element'.$form_id.'" '.$input_active.' '.$param['attributes'].'/>
|
| 1056 |
-
<label for="wdform_'.$id1.'_element'.$form_id.'"></label>
|
| 1057 |
-
</div>
|
| 1058 |
-
</div></div>';
|
| 1059 |
-
|
| 1060 |
-
$onsubmit_js.='
|
| 1061 |
-
if(!jQuery("#wdform_'.$id1.'_element'.$form_id.'").is(":checked"))
|
| 1062 |
-
jQuery("<input type=\"hidden\" name=\"wdform_send_copy_'.$form_id.'\" value = \"1\" />").appendTo("#form'.$form_id.'");';
|
| 1063 |
-
if($required) {
|
| 1064 |
-
$check_js.='
|
| 1065 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 1066 |
-
{
|
| 1067 |
-
if(x.find(jQuery("div[wdid='.$id1.'] input:checked")).length == 0)
|
| 1068 |
-
{
|
| 1069 |
-
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 1070 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 1071 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 1072 |
-
|
| 1073 |
-
return false;
|
| 1074 |
-
}
|
| 1075 |
-
}
|
| 1076 |
-
';
|
| 1077 |
-
}
|
| 1078 |
-
break;
|
| 1079 |
-
}
|
| 1080 |
-
case 'type_text': {
|
| 1081 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_required','w_unique');
|
| 1082 |
-
$temp=$params;
|
| 1083 |
-
if(strpos($temp, 'w_regExp_status') > -1)
|
| 1084 |
-
$params_names = array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_required', 'w_regExp_status', 'w_regExp_value', 'w_regExp_common', 'w_regExp_arg', 'w_regExp_alert', 'w_unique');
|
| 1085 |
-
foreach($params_names as $params_name ) {
|
| 1086 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1087 |
-
$param[$params_name] = $temp[0];
|
| 1088 |
-
$temp=$temp[1];
|
| 1089 |
-
}
|
| 1090 |
-
if($temp) {
|
| 1091 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1092 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1093 |
-
foreach($attrs as $attr)
|
| 1094 |
-
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 1095 |
-
}
|
| 1096 |
-
|
| 1097 |
-
$param['w_first_val'] = (isset($_POST['wdform_'.$id1.'_element'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element'.$form_id])) : $param['w_first_val']);
|
| 1098 |
-
|
| 1099 |
-
$wdformfieldsize = ($param['w_field_label_pos']=="left" ? $param['w_field_label_size']+$param['w_size'] + 10 : max($param['w_field_label_size'],$param['w_size']));
|
| 1100 |
-
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 1101 |
-
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 1102 |
-
|
| 1103 |
-
$input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active");
|
| 1104 |
-
$required = ($param['w_required']=="yes" ? true : false);
|
| 1105 |
-
|
| 1106 |
-
$param['w_regExp_status'] = (isset($param['w_regExp_status']) ? $param['w_regExp_status'] : "no");
|
| 1107 |
-
|
| 1108 |
-
$rep ='<div type="type_text" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].' width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 1109 |
-
if($required) {
|
| 1110 |
-
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 1111 |
-
}
|
| 1112 |
-
$rep.='</div><div class="wdform-element-section" style="'.$param['w_field_label_pos2'].' width: '.$param['w_size'].'px;" ><input type="text" class="'.$input_active.'" id="wdform_'.$id1.'_element'.$form_id.'" name="wdform_'.$id1.'_element'.$form_id.'" value="'.$param['w_first_val'].'" title="'.$param['w_title'].'" style="width: 100%;" '.$param['attributes'].'></div></div>';
|
| 1113 |
-
|
| 1114 |
-
if($required) {
|
| 1115 |
-
$check_js.='
|
| 1116 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 1117 |
-
{
|
| 1118 |
-
if(jQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="'.$param['w_title'].'" || jQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="")
|
| 1119 |
-
{
|
| 1120 |
-
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 1121 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'").addClass( "form-error" );
|
| 1122 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 1123 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 1124 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'").focus();
|
| 1125 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'").change(function() { if( jQuery(this).val()!="" ) jQuery(this).removeClass("form-error"); else jQuery(this).addClass("form-error");});
|
| 1126 |
-
return false;
|
| 1127 |
-
}
|
| 1128 |
-
}
|
| 1129 |
-
';
|
| 1130 |
-
}
|
| 1131 |
-
|
| 1132 |
-
if($param['w_regExp_status'] == 'yes') {
|
| 1133 |
-
$check_js .='
|
| 1134 |
-
var RegExpression = "";
|
| 1135 |
-
var rules = unescape("'.$param["w_regExp_value"].'");
|
| 1136 |
-
("'.$param["w_regExp_arg"].'".length <= 0) ? RegExpression = new RegExp(rules) : RegExpression = new RegExp(rules'.', "'.$param["w_regExp_arg"].'" );
|
| 1137 |
-
|
| 1138 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none") {
|
| 1139 |
-
if(jQuery("#wdform_'.$id1.'_element'.$form_id.'").val().length > 0){
|
| 1140 |
-
if (RegExpression.test(jQuery("#wdform_'.$id1.'_element'.$form_id.'").val()) != true)
|
| 1141 |
-
{
|
| 1142 |
-
alert( " '.$param["w_regExp_alert"].' ");
|
| 1143 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 1144 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 1145 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'").addClass( "form-error" );
|
| 1146 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'").focus();
|
| 1147 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'").change(function() { if( jQuery(this).val()!="" ) jQuery(this).removeClass("form-error"); else jQuery(this).addClass("form-error");});
|
| 1148 |
-
return false;
|
| 1149 |
-
}
|
| 1150 |
-
}
|
| 1151 |
-
}';
|
| 1152 |
-
}
|
| 1153 |
-
|
| 1154 |
-
break;
|
| 1155 |
-
}
|
| 1156 |
-
|
| 1157 |
-
case 'type_number': {
|
| 1158 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_required','w_unique','w_class');
|
| 1159 |
-
$temp=$params;
|
| 1160 |
-
foreach($params_names as $params_name ) {
|
| 1161 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1162 |
-
$param[$params_name] = $temp[0];
|
| 1163 |
-
$temp=$temp[1];
|
| 1164 |
-
}
|
| 1165 |
-
if($temp) {
|
| 1166 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1167 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1168 |
-
foreach($attrs as $attr) {
|
| 1169 |
-
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 1170 |
-
}
|
| 1171 |
-
}
|
| 1172 |
-
|
| 1173 |
-
$param['w_first_val']=(isset($_POST['wdform_'.$id1.'_element'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element'.$form_id])) : $param['w_first_val']);
|
| 1174 |
-
|
| 1175 |
-
$wdformfieldsize = ($param['w_field_label_pos']=="left" ? $param['w_field_label_size']+$param['w_size'] + 10 : max($param['w_field_label_size'],$param['w_size']));
|
| 1176 |
-
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 1177 |
-
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 1178 |
-
$input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active");
|
| 1179 |
-
$required = ($param['w_required']=="yes" ? true : false);
|
| 1180 |
-
|
| 1181 |
-
$rep ='<div type="type_number" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" class="'.$param['w_class'].'" style="'.$param['w_field_label_pos1'].' width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 1182 |
-
if($required) {
|
| 1183 |
-
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 1184 |
-
}
|
| 1185 |
-
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].' width: '.$param['w_size'].'px;"><input type="text" class="'.$input_active.'" id="wdform_'.$id1.'_element'.$form_id.'" name="wdform_'.$id1.'_element'.$form_id.'" value="'.$param['w_first_val'].'" title="'.$param['w_title'].'" style="width: 100%;" '.$param['attributes'].'></div></div>';
|
| 1186 |
-
|
| 1187 |
-
if($required) {
|
| 1188 |
-
$check_js.='
|
| 1189 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 1190 |
-
{
|
| 1191 |
-
if(jQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="'.$param['w_title'].'" || jQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="")
|
| 1192 |
-
{
|
| 1193 |
-
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 1194 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'").addClass( "form-error" );
|
| 1195 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 1196 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 1197 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'").focus();
|
| 1198 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'").change(function() { if( jQuery(this).val()!="" ) jQuery(this).removeClass("form-error"); else jQuery(this).addClass("form-error");});
|
| 1199 |
-
return false;
|
| 1200 |
-
}
|
| 1201 |
-
}
|
| 1202 |
-
';
|
| 1203 |
-
}
|
| 1204 |
-
break;
|
| 1205 |
-
}
|
| 1206 |
-
|
| 1207 |
-
case 'type_password': {
|
| 1208 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_required','w_unique','w_class');
|
| 1209 |
-
$temp=$params;
|
| 1210 |
-
foreach($params_names as $params_name ) {
|
| 1211 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1212 |
-
$param[$params_name] = $temp[0];
|
| 1213 |
-
$temp=$temp[1];
|
| 1214 |
-
}
|
| 1215 |
-
if($temp) {
|
| 1216 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1217 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1218 |
-
foreach($attrs as $attr) {
|
| 1219 |
-
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 1220 |
-
}
|
| 1221 |
-
}
|
| 1222 |
-
|
| 1223 |
-
$wdformfieldsize = ($param['w_field_label_pos']=="left" ? $param['w_field_label_size']+$param['w_size'] + 10 : max($param['w_field_label_size'],$param['w_size']));
|
| 1224 |
-
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 1225 |
-
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 1226 |
-
$required = ($param['w_required']=="yes" ? true : false);
|
| 1227 |
-
|
| 1228 |
-
$rep ='<div type="type_password" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" class="'.$param['w_class'].'" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 1229 |
-
if($required) {
|
| 1230 |
-
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 1231 |
-
}
|
| 1232 |
-
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].' width: '.$param['w_size'].'px;"><input type="password" id="wdform_'.$id1.'_element'.$form_id.'" name="wdform_'.$id1.'_element'.$form_id.'" style="width: 100%;" '.$param['attributes'].'></div></div>';
|
| 1233 |
-
|
| 1234 |
-
if($required) {
|
| 1235 |
-
$check_js.='
|
| 1236 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 1237 |
-
{
|
| 1238 |
-
if(jQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="")
|
| 1239 |
-
{
|
| 1240 |
-
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 1241 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'").addClass( "form-error" );
|
| 1242 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 1243 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 1244 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'").focus();
|
| 1245 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'").change(function() { if( jQuery(this).val()!="" ) jQuery(this).removeClass("form-error"); else jQuery(this).addClass("form-error");});
|
| 1246 |
-
return false;
|
| 1247 |
-
}
|
| 1248 |
-
}
|
| 1249 |
-
';
|
| 1250 |
-
}
|
| 1251 |
-
break;
|
| 1252 |
-
}
|
| 1253 |
-
|
| 1254 |
-
case 'type_textarea': {
|
| 1255 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_size_w','w_size_h','w_first_val','w_title','w_required','w_unique','w_class');
|
| 1256 |
-
$temp=$params;
|
| 1257 |
-
foreach($params_names as $params_name ) {
|
| 1258 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1259 |
-
$param[$params_name] = $temp[0];
|
| 1260 |
-
$temp=$temp[1];
|
| 1261 |
-
}
|
| 1262 |
-
if($temp) {
|
| 1263 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1264 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1265 |
-
foreach($attrs as $attr)
|
| 1266 |
-
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 1267 |
-
}
|
| 1268 |
-
|
| 1269 |
-
$param['w_first_val']=(isset($_POST['wdform_'.$id1.'_element'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element'.$form_id])) : $param['w_first_val']);
|
| 1270 |
-
|
| 1271 |
-
$wdformfieldsize = ($param['w_field_label_pos']=="left" ? $param['w_field_label_size']+$param['w_size_w'] + 10 : max($param['w_field_label_size'],$param['w_size_w']));
|
| 1272 |
-
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 1273 |
-
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 1274 |
-
$input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active");
|
| 1275 |
-
$required = ($param['w_required']=="yes" ? true : false);
|
| 1276 |
-
|
| 1277 |
-
$rep ='<div type="type_textarea" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 1278 |
-
if($required) {
|
| 1279 |
-
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 1280 |
-
}
|
| 1281 |
-
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].' width: '.$param['w_size_w'].'px"><textarea class="'.$input_active.'" id="wdform_'.$id1.'_element'.$form_id.'" name="wdform_'.$id1.'_element'.$form_id.'" title="'.$param['w_title'].'" style="width: 100%; height: '.$param['w_size_h'].'px;" '.$param['attributes'].'>'
|
| 1282 |
-
|
| 1283 |
-
if($required) {
|
| 1284 |
-
$check_js.='
|
| 1285 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 1286 |
-
{
|
| 1287 |
-
if(jQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="'.$param['w_title'].'" || jQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="")
|
| 1288 |
-
{
|
| 1289 |
-
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 1290 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'").addClass( "form-error" );
|
| 1291 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 1292 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 1293 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'").focus();
|
| 1294 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'").change(function() { if( jQuery(this).val()!="" ) jQuery(this).removeClass("form-error"); else jQuery(this).addClass("form-error");});
|
| 1295 |
-
return false;
|
| 1296 |
-
}
|
| 1297 |
-
}
|
| 1298 |
-
';
|
| 1299 |
-
}
|
| 1300 |
-
break;
|
| 1301 |
-
}
|
| 1302 |
-
|
| 1303 |
-
case 'type_wdeditor': {
|
| 1304 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_size_w','w_size_h','w_title','w_required','w_class');
|
| 1305 |
-
$temp=$params;
|
| 1306 |
-
foreach($params_names as $params_name ) {
|
| 1307 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1308 |
-
$param[$params_name] = $temp[0];
|
| 1309 |
-
$temp=$temp[1];
|
| 1310 |
-
}
|
| 1311 |
-
if($temp) {
|
| 1312 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1313 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1314 |
-
foreach($attrs as $attr)
|
| 1315 |
-
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 1316 |
-
}
|
| 1317 |
-
$wdformfieldsize = ($param['w_field_label_pos']=="left" ? $param['w_field_label_size']+$param['w_size_w']+10 : max($param['w_field_label_size'],$param['w_size_w']));
|
| 1318 |
-
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 1319 |
-
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 1320 |
-
|
| 1321 |
-
$required = ($param['w_required']=="yes" ? true : false);
|
| 1322 |
-
|
| 1323 |
-
$rep ='<div type="type_wdeditor" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 1324 |
-
if($required) {
|
| 1325 |
-
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 1326 |
-
}
|
| 1327 |
-
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].' width: '.$param['w_size_w'].'px">';
|
| 1328 |
-
|
| 1329 |
-
if(user_can_richedit()) {
|
| 1330 |
-
ob_start();
|
| 1331 |
-
wp_editor($param['w_title'], 'wdform_'.$id1.'_wd_editor'.$form_id, array('teeny' => FALSE, 'media_buttons' => FALSE, 'textarea_rows' => 5));
|
| 1332 |
-
$wd_editor = ob_get_clean();
|
| 1333 |
-
}
|
| 1334 |
-
else {
|
| 1335 |
-
$wd_editor = '<textarea class="'.$param['w_class'].'" name="wdform_'.$id1.'_wd_editor'.$form_id.'" id="wdform_'.$id1.'_wd_editor'.$form_id.'" style="width: '.$param['w_size_w'].'px; height: '.$param['w_size_h'].'px; " class="mce_editable" aria-hidden="true">'.$param['w_title'].'</textarea>';
|
| 1336 |
-
}
|
| 1337 |
-
$rep.= $wd_editor.'</div></div>';
|
| 1338 |
-
if($required) {
|
| 1339 |
-
$check_js.='
|
| 1340 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 1341 |
-
{
|
| 1342 |
-
if(tinyMCE.get("wdform_'.$id1.'_wd_editor'.$form_id.'").getContent()=="")
|
| 1343 |
-
{
|
| 1344 |
-
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 1345 |
-
jQuery("#wdform_'.$id1.'_wd_editor'.$form_id.'").addClass( "form-error" );
|
| 1346 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 1347 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 1348 |
-
jQuery("#wdform_'.$id1.'_wd_editor'.$form_id.'").focus();
|
| 1349 |
-
jQuery("#wdform_'.$id1.'_wd_editor'.$form_id.'").change(function() { if( jQuery(this).val()!="" ) jQuery(this).removeClass("form-error"); else jQuery(this).addClass("form-error");});
|
| 1350 |
-
return false;
|
| 1351 |
-
}
|
| 1352 |
-
}
|
| 1353 |
-
';
|
| 1354 |
-
}
|
| 1355 |
-
break;
|
| 1356 |
-
}
|
| 1357 |
-
|
| 1358 |
-
case 'type_phone': {
|
| 1359 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_mini_labels','w_required','w_unique', 'w_class');
|
| 1360 |
-
$temp=$params;
|
| 1361 |
-
foreach($params_names as $params_name ) {
|
| 1362 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1363 |
-
$param[$params_name] = $temp[0];
|
| 1364 |
-
$temp=$temp[1];
|
| 1365 |
-
}
|
| 1366 |
-
if($temp) {
|
| 1367 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1368 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1369 |
-
foreach($attrs as $attr) {
|
| 1370 |
-
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 1371 |
-
}
|
| 1372 |
-
}
|
| 1373 |
-
$w_first_val = explode('***',$param['w_first_val']);
|
| 1374 |
-
$w_title = explode('***',$param['w_title']);
|
| 1375 |
-
|
| 1376 |
-
$param['w_first_val']=(isset($_POST['wdform_'.$id1.'_element_first'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element_first'.$form_id])) : $w_first_val[0]).'***'.(isset($_POST['wdform_'.$id1.'_element_last'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element_last'.$form_id])) : $w_first_val[1]);
|
| 1377 |
-
|
| 1378 |
-
$wdformfieldsize = ($param['w_field_label_pos']=="left" ? ($param['w_field_label_size']+$param['w_size']+65) : max($param['w_field_label_size'],($param['w_size']+65)));
|
| 1379 |
-
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 1380 |
-
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 1381 |
-
$input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active");
|
| 1382 |
-
$required = ($param['w_required']=="yes" ? true : false);
|
| 1383 |
-
|
| 1384 |
-
$w_first_val = explode('***',$param['w_first_val']);
|
| 1385 |
-
$w_title = explode('***',$param['w_title']);
|
| 1386 |
-
$w_mini_labels = explode('***',$param['w_mini_labels']);
|
| 1387 |
-
|
| 1388 |
-
|
| 1389 |
-
$rep ='<div type="type_phone" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section '.$param['w_class'].'" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label" >'.$label.'</span>';
|
| 1390 |
-
if($required) {
|
| 1391 |
-
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 1392 |
-
}
|
| 1393 |
-
$rep.='
|
| 1394 |
-
</div>
|
| 1395 |
-
<div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].' width: '.($param['w_size']+65).'px;">
|
| 1396 |
-
<div style="display: table-cell;vertical-align: middle;">
|
| 1397 |
-
<div><input type="text" class="'.$input_active.'" id="wdform_'.$id1.'_element_first'.$form_id.'" name="wdform_'.$id1.'_element_first'.$form_id.'" value="'.$w_first_val[0].'" title="'.$w_title[0].'" style="width: 50px;" '.$param['attributes'].'></div>
|
| 1398 |
-
<div><label class="mini_label">'.$w_mini_labels[0].'</label></div>
|
| 1399 |
-
</div>
|
| 1400 |
-
<div style="display: table-cell;vertical-align: middle;">
|
| 1401 |
-
<div class="wdform_line" style="margin: 0px 4px 10px 4px; padding: 0px;">-</div>
|
| 1402 |
-
</div>
|
| 1403 |
-
<div style="display: table-cell;vertical-align: middle; width:100%;">
|
| 1404 |
-
<div><input type="text" class="'.$input_active.'" id="wdform_'.$id1.'_element_last'.$form_id.'" name="wdform_'.$id1.'_element_last'.$form_id.'" value="'.$w_first_val[1].'" title="'.$w_title[1].'" style="width: 100%;" '.$param['attributes'].'></div>
|
| 1405 |
-
<div><label class="mini_label">'.$w_mini_labels[1].'</label></div>
|
| 1406 |
-
</div>
|
| 1407 |
-
</div>
|
| 1408 |
-
</div>';
|
| 1409 |
-
|
| 1410 |
-
if($required) {
|
| 1411 |
-
$check_js.='
|
| 1412 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 1413 |
-
{
|
| 1414 |
-
if(jQuery("#wdform_'.$id1.'_element_first'.$form_id.'").val()=="'.$w_title[0].'" || jQuery("#wdform_'.$id1.'_element_first'.$form_id.'").val()=="" || jQuery("#wdform_'.$id1.'_element_last'.$form_id.'").val()=="'.$w_title[1].'" || jQuery("#wdform_'.$id1.'_element_last'.$form_id.'").val()=="")
|
| 1415 |
-
{
|
| 1416 |
-
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 1417 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 1418 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 1419 |
-
jQuery("#wdform_'.$id1.'_element_first'.$form_id.'").focus();
|
| 1420 |
-
return false;
|
| 1421 |
-
}
|
| 1422 |
-
|
| 1423 |
-
}
|
| 1424 |
-
';
|
| 1425 |
-
}
|
| 1426 |
-
break;
|
| 1427 |
-
}
|
| 1428 |
-
|
| 1429 |
-
case 'type_name': {
|
| 1430 |
-
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_title', 'w_mini_labels', 'w_size', 'w_name_format', 'w_required', 'w_unique', 'w_class');
|
| 1431 |
-
$temp = $params;
|
| 1432 |
-
if(strpos($temp, 'w_name_fields') > -1)
|
| 1433 |
-
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_title', 'w_mini_labels', 'w_size', 'w_name_format', 'w_required', 'w_unique', 'w_class', 'w_name_fields');
|
| 1434 |
-
foreach($params_names as $params_name ) {
|
| 1435 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1436 |
-
$param[$params_name] = $temp[0];
|
| 1437 |
-
$temp=$temp[1];
|
| 1438 |
-
}
|
| 1439 |
-
if($temp) {
|
| 1440 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1441 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1442 |
-
foreach($attrs as $attr) {
|
| 1443 |
-
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 1444 |
-
}
|
| 1445 |
-
}
|
| 1446 |
-
|
| 1447 |
-
$w_first_val = explode('***',$param['w_first_val']);
|
| 1448 |
-
$w_title = explode('***',$param['w_title']);
|
| 1449 |
-
|
| 1450 |
-
$w_mini_labels = explode('***',$param['w_mini_labels']);
|
| 1451 |
-
$param['w_name_fields'] = isset($param['w_name_fields']) ? $param['w_name_fields'] : ($param['w_name_format'] == 'normal' ? 'no***no' : 'yes***yes');
|
| 1452 |
-
$w_name_fields = explode('***', $param['w_name_fields']);
|
| 1453 |
-
|
| 1454 |
-
$element_title = isset($_POST['wdform_'.$id1.'_element_title'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element_title'.$form_id])) : NULL;
|
| 1455 |
-
$element_middle = isset($_POST['wdform_'.$id1.'_element_middle'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element_middle'.$form_id])) : NULL;
|
| 1456 |
-
$element_first = isset($_POST['wdform_'.$id1.'_element_first'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element_first'.$form_id])) : NULL;
|
| 1457 |
-
if(isset($element_title) || isset($element_middle)) {
|
| 1458 |
-
$param['w_first_val']=(isset($_POST['wdform_'.$id1.'_element_first'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element_first'.$form_id])) : $w_first_val[0]).'***'.(isset($_POST['wdform_'.$id1.'_element_last'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element_last'.$form_id])) : $w_first_val[1]).'***'.(isset($_POST['wdform_'.$id1.'_element_title'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element_title'.$form_id])) : $w_first_val[2]).'***'.(isset($_POST['wdform_'.$id1.'_element_middle'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element_middle'.$form_id])) : $w_first_val[3]);
|
| 1459 |
-
}
|
| 1460 |
-
else {
|
| 1461 |
-
if(isset($element_first)) {
|
| 1462 |
-
$param['w_first_val']=(isset($_POST['wdform_'.$id1.'_element_first'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element_first'.$form_id])) : $w_first_val[0]).'***'.(isset($_POST['wdform_'.$id1.'_element_last'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element_last'.$form_id])) : $w_first_val[1]);
|
| 1463 |
-
}
|
| 1464 |
-
}
|
| 1465 |
-
|
| 1466 |
-
$required = ($param['w_required']=="yes" ? true : false);
|
| 1467 |
-
$w_first_val = explode('***',$param['w_first_val']);
|
| 1468 |
-
|
| 1469 |
-
if($w_name_fields[0]== 'no' && $w_name_fields[1]== 'no' ) {
|
| 1470 |
-
$w_name_format = '
|
| 1471 |
-
<div style="display: table-cell; width:50%">
|
| 1472 |
-
<div><input type="text" class="'.($w_first_val[0] == $w_title[0] ? "input_deactive" : "input_active").'" id="wdform_'.$id1.'_element_first'.$form_id.'" name="wdform_'.$id1.'_element_first'.$form_id.'" value="'.$w_first_val[0].'" title="'.$w_title[0].'" style="width: 100%;"'.$param['attributes'].'></div>
|
| 1473 |
-
<div><label class="mini_label">'.$w_mini_labels[1].'</label></div>
|
| 1474 |
-
</div>
|
| 1475 |
-
<div style="display:table-cell;"><div style="margin: 0px 8px; padding: 0px;"></div></div>
|
| 1476 |
-
<div style="display: table-cell; width:50%">
|
| 1477 |
-
<div><input type="text" class="'.($w_first_val[1] == $w_title[1] ? "input_deactive" : "input_active").'" id="wdform_'.$id1.'_element_last'.$form_id.'" name="wdform_'.$id1.'_element_last'.$form_id.'" value="'.$w_first_val[1].'" title="'.$w_title[1].'" style="width: 100%;" '.$param['attributes'].'></div>
|
| 1478 |
-
<div><label class="mini_label">'.$w_mini_labels[2].'</label></div>
|
| 1479 |
-
</div>
|
| 1480 |
-
';
|
| 1481 |
-
$w_size=2*$param['w_size'];
|
| 1482 |
-
}
|
| 1483 |
-
else {
|
| 1484 |
-
$first_last_size = $w_name_fields[0] == 'yes' && $w_name_fields[1] == 'no' ? 45 : 30;
|
| 1485 |
-
$w_name_format = '
|
| 1486 |
-
<div style="display: table-cell; width:'.$first_last_size.'%">
|
| 1487 |
-
<div><input type="text" class="'.($w_first_val[0] == $w_title[0] ? "input_deactive" : "input_active").'" id="wdform_'.$id1.'_element_first'.$form_id.'" name="wdform_'.$id1.'_element_first'.$form_id.'" value="'.$w_first_val[0].'" title="'.$w_title[0].'" style="width:100%;"></div>
|
| 1488 |
-
<div><label class="mini_label">'.$w_mini_labels[1].'</label></div>
|
| 1489 |
-
</div>
|
| 1490 |
-
<div style="display:table-cell;"><div style="margin: 0px 4px; padding: 0px;"></div></div>
|
| 1491 |
-
<div style="display: table-cell; width:'.$first_last_size.'%">
|
| 1492 |
-
<div><input type="text" class="'.($w_first_val[1] == $w_title[1] ? "input_deactive" : "input_active").'" id="wdform_'.$id1.'_element_last'.$form_id.'" name="wdform_'.$id1.'_element_last'.$form_id.'" value="'.$w_first_val[1].'" title="'.$w_title[1].'" style="width: 100%;"></div>
|
| 1493 |
-
<div><label class="mini_label">'.$w_mini_labels[2].'</label></div>
|
| 1494 |
-
</div>';
|
| 1495 |
-
|
| 1496 |
-
$w_size = 2*$param['w_size'];
|
| 1497 |
-
if($w_name_fields[0] == 'yes') {
|
| 1498 |
-
$w_name_format = '
|
| 1499 |
-
<div style="display: table-cell;">
|
| 1500 |
-
<div><input type="text" class="'.($w_first_val[2] == $w_title[2] ? "input_deactive" : "input_active").'" id="wdform_'.$id1.'_element_title'.$form_id.'" name="wdform_'.$id1.'_element_title'.$form_id.'" value="'.$w_first_val[2].'" title="'.$w_title[2].'" style="width: 40px;"></div>
|
| 1501 |
-
<div><label class="mini_label">'.$w_mini_labels[0].'</label></div>
|
| 1502 |
-
</div>
|
| 1503 |
-
<div style="display:table-cell;"><div style="margin: 0px 1px; padding: 0px;"></div></div>'.$w_name_format;
|
| 1504 |
-
$w_size += 80;
|
| 1505 |
-
}
|
| 1506 |
-
if($w_name_fields[1] == 'yes') {
|
| 1507 |
-
$w_name_format = $w_name_format.'
|
| 1508 |
-
<div style="display:table-cell;"><div style="margin: 0px 4px; padding: 0px;"></div></div>
|
| 1509 |
-
<div style="display: table-cell; width:30%">
|
| 1510 |
-
<div><input type="text" class="'.($w_first_val[3] == $w_title[3] ? "input_deactive" : "input_active").'" id="wdform_'.$id1.'_element_middle'.$form_id.'" name="wdform_'.$id1.'_element_middle'.$form_id.'" value="'.$w_first_val[3].'" title="'.$w_title[3].'" style="width: 100%;"></div>
|
| 1511 |
-
<div><label class="mini_label">'.$w_mini_labels[3].'</label></div>
|
| 1512 |
-
</div>
|
| 1513 |
-
';
|
| 1514 |
-
$w_size += $param['w_size'];
|
| 1515 |
-
}
|
| 1516 |
-
}
|
| 1517 |
-
|
| 1518 |
-
$wdformfieldsize = ($param['w_field_label_pos']=="left" ? ($param['w_field_label_size']+$w_size) : max($param['w_field_label_size'],$w_size));
|
| 1519 |
-
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 1520 |
-
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 1521 |
-
|
| 1522 |
-
$rep ='<div type="type_name" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 1523 |
-
if($required) {
|
| 1524 |
-
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 1525 |
-
}
|
| 1526 |
-
$rep.='</div>
|
| 1527 |
-
<div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].' width: '.$w_size.'px;">'.$w_name_format.'</div></div>';
|
| 1528 |
-
|
| 1529 |
-
if($required) {
|
| 1530 |
-
$check_js.='
|
| 1531 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 1532 |
-
{
|
| 1533 |
-
if(jQuery("#wdform_'.$id1.'_element_first'.$form_id.'").val()=="'.$w_title[0].'" || jQuery("#wdform_'.$id1.'_element_first'.$form_id.'").val()=="" || jQuery("#wdform_'.$id1.'_element_last'.$form_id.'").val()=="'.$w_title[1].'" || jQuery("#wdform_'.$id1.'_element_last'.$form_id.'").val()=="" || (jQuery("#wdform_'.$id1.'_element_title'.$form_id.'").length != 0 && (jQuery("#wdform_'.$id1.'_element_title'.$form_id.'").val()=="'.(isset($w_title[2]) ? $w_title[2] : '').'" || jQuery("#wdform_'.$id1.'_element_title'.$form_id.'").val()=="")) || (jQuery("#wdform_'.$id1.'_element_middle'.$form_id.'").length != 0 && (jQuery("#wdform_'.$id1.'_element_middle'.$form_id.'").val()=="'.(isset($w_title[3]) ? $w_title[3] : '').'" || jQuery("#wdform_'.$id1.'_element_middle'.$form_id.'").val()=="")))
|
| 1534 |
-
{
|
| 1535 |
-
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 1536 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 1537 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 1538 |
-
jQuery("#wdform_'.$id1.'_element_first'.$form_id.'").focus();
|
| 1539 |
-
return false;
|
| 1540 |
-
}
|
| 1541 |
-
}
|
| 1542 |
-
';
|
| 1543 |
-
}
|
| 1544 |
-
break;
|
| 1545 |
-
}
|
| 1546 |
-
|
| 1547 |
-
case 'type_address': {
|
| 1548 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_mini_labels','w_disabled_fields','w_required','w_class');
|
| 1549 |
-
$temp=$params;
|
| 1550 |
-
foreach($params_names as $params_name ) {
|
| 1551 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1552 |
-
$param[$params_name] = $temp[0];
|
| 1553 |
-
$temp=$temp[1];
|
| 1554 |
-
}
|
| 1555 |
-
if($temp) {
|
| 1556 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1557 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1558 |
-
foreach($attrs as $attr) {
|
| 1559 |
-
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 1560 |
-
}
|
| 1561 |
-
}
|
| 1562 |
-
$wdformfieldsize = ($param['w_field_label_pos']=="left" ? ($param['w_field_label_size']+$param['w_size']) : max($param['w_field_label_size'], $param['w_size']));
|
| 1563 |
-
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 1564 |
-
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 1565 |
-
$required = ($param['w_required']=="yes" ? true : false);
|
| 1566 |
-
$w_mini_labels = explode('***',$param['w_mini_labels']);
|
| 1567 |
-
$w_disabled_fields = explode('***', $param['w_disabled_fields']);
|
| 1568 |
-
$rep ='<div type="type_address" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 1569 |
-
if ($required) {
|
| 1570 |
-
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 1571 |
-
}
|
| 1572 |
-
$address_fields = '';
|
| 1573 |
-
$g = 0;
|
| 1574 |
-
if (isset($w_disabled_fields[0]) && $w_disabled_fields[0] == 'no') {
|
| 1575 |
-
$g+=2;
|
| 1576 |
-
$address_fields .= '<span style="float: left; width: 100%; padding-bottom: 8px; display: block;"><input type="text" id="wdform_'.$id1.'_street1'.$form_id.'" name="wdform_'.$id1.'_street1'.$form_id.'" value="'.(isset($_POST['wdform_'.$id1.'_street1'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_street1'.$form_id])) : "").'" style="width: 100%;" '.$param['attributes'].'><label class="mini_label" >'.$w_mini_labels[0].'</label></span>';
|
| 1577 |
-
}
|
| 1578 |
-
if (isset($w_disabled_fields[1]) && $w_disabled_fields[1]=='no') {
|
| 1579 |
-
$g+=2;
|
| 1580 |
-
$address_fields .= '<span style="float: left; width: 100%; padding-bottom: 8px; display: block;"><input type="text" id="wdform_'.$id1.'_street2'.$form_id.'" name="wdform_'.($id1+1).'_street2'.$form_id.'" value="'.(isset($_POST['wdform_'.($id1+1).'_street2'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.($id1+1).'_street2'.$form_id])) : "").'" style="width: 100%;" '.$param['attributes'].'><label class="mini_label" >'.$w_mini_labels[1].'</label></span>';
|
| 1581 |
-
}
|
| 1582 |
-
if (isset($w_disabled_fields[2]) && $w_disabled_fields[2]=='no') {
|
| 1583 |
-
$g++;
|
| 1584 |
-
$address_fields .= '<span style="float: left; width: 48%; padding-bottom: 8px;"><input type="text" id="wdform_'.$id1.'_city'.$form_id.'" name="wdform_'.($id1+2).'_city'.$form_id.'" value="'.(isset($_POST['wdform_'.($id1+2).'_city'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.($id1+2).'_city'.$form_id])) : "").'" style="width: 100%;" '.$param['attributes'].'><label class="mini_label" >'.$w_mini_labels[2].'</label></span>';
|
| 1585 |
-
}
|
| 1586 |
-
if (isset($w_disabled_fields[3]) && $w_disabled_fields[3]=='no') {
|
| 1587 |
-
$g++;
|
| 1588 |
-
$w_states = array("","Alabama","Alaska", "Arizona","Arkansas","California","Colorado","Connecticut","Delaware","District Of Columbia","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming");
|
| 1589 |
-
$w_state_options = '';
|
| 1590 |
-
$post_state = isset($_POST['wdform_'.($id1+3).'_state'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.($id1+3).'_state'.$form_id])) : "";
|
| 1591 |
-
foreach($w_states as $w_state) {
|
| 1592 |
-
if($w_state == $post_state) {
|
| 1593 |
-
$selected = 'selected="selected"';
|
| 1594 |
-
}
|
| 1595 |
-
else {
|
| 1596 |
-
$selected = '';
|
| 1597 |
-
}
|
| 1598 |
-
$w_state_options .= '<option value="'.$w_state.'" '.$selected.'>'.$w_state.'</option>';
|
| 1599 |
-
}
|
| 1600 |
-
if(isset($w_disabled_fields[5]) && $w_disabled_fields[5]=='yes' && isset($w_disabled_fields[6]) && $w_disabled_fields[6]=='yes') {
|
| 1601 |
-
$address_fields .= '<span style="float: '.(($g%2==0) ? 'right' : 'left').'; width: 48%; padding-bottom: 8px;"><select type="text" id="wdform_'.$id1.'_state'.$form_id.'" name="wdform_'.($id1+3).'_state'.$form_id.'" style="width: 100%;" '.$param['attributes'].'>'.$w_state_options.'</select><label class="mini_label" style="display: block;" id="'.$id1.'_mini_label_state">'.$w_mini_labels[3].'</label></span>';
|
| 1602 |
-
}
|
| 1603 |
-
else {
|
| 1604 |
-
$address_fields .= '<span style="float: '.(($g%2==0) ? 'right' : 'left').'; width: 48%; padding-bottom: 8px;"><input type="text" id="wdform_'.$id1.'_state'.$form_id.'" name="wdform_'.($id1+3).'_state'.$form_id.'" value="'.(isset($_POST['wdform_'.($id1+3).'_state'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.($id1+3).'_state'.$form_id])) : "").'" style="width: 100%;" '.$param['attributes'].'><label class="mini_label">'.$w_mini_labels[3].'</label></span>';
|
| 1605 |
-
}
|
| 1606 |
-
}
|
| 1607 |
-
if (isset($w_disabled_fields[4]) && $w_disabled_fields[4]=='no') {
|
| 1608 |
-
$g++;
|
| 1609 |
-
$address_fields .= '<span style="float: '.(($g%2==0) ? 'right' : 'left').'; width: 48%; padding-bottom: 8px;"><input type="text" id="wdform_'.$id1.'_postal'.$form_id.'" name="wdform_'.($id1+4).'_postal'.$form_id.'" value="'.(isset($_POST['wdform_'.($id1+4).'_postal'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.($id1+4).'_postal'.$form_id])) : "").'" style="width: 100%;" '.$param['attributes'].'><label class="mini_label">'.$w_mini_labels[4].'</label></span>';
|
| 1610 |
-
}
|
| 1611 |
-
$w_countries = array("","Afghanistan","Albania","Algeria","Andorra","Angola","Antigua and Barbuda","Argentina","Armenia","Australia","Austria","Azerbaijan","Bahamas","Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bhutan","Bolivia","Bosnia and Herzegovina","Botswana","Brazil","Brunei","Bulgaria","Burkina Faso","Burundi","Cambodia","Cameroon","Canada","Cape Verde","Central African Republic","Chad","Chile","China","Colombia","Comoros","Congo (Brazzaville)","Congo","Costa Rica","Cote d'Ivoire","Croatia","Cuba","Cyprus","Czech Republic","Denmark","Djibouti","Dominica","Dominican Republic","East Timor (Timor Timur)","Ecuador","Egypt","El Salvador","Equatorial Guinea","Eritrea","Estonia","Ethiopia","Fiji","Finland","France","Gabon","Gambia, The","Georgia","Germany","Ghana","Greece","Grenada","Guatemala","Guinea","Guinea-Bissau","Guyana","Haiti","Honduras","Hungary","Iceland","India","Indonesia","Iran","Iraq","Ireland","Israel","Italy","Jamaica","Japan","Jordan","Kazakhstan","Kenya","Kiribati","Korea, North","Korea, South","Kuwait","Kyrgyzstan","Laos","Latvia","Lebanon","Lesotho","Liberia","Libya","Liechtenstein","Lithuania","Luxembourg","Macedonia","Madagascar","Malawi","Malaysia","Maldives","Mali","Malta","Marshall Islands","Mauritania","Mauritius","Mexico","Micronesia","Moldova","Monaco","Mongolia","Morocco","Mozambique","Myanmar","Namibia","Nauru","Nepal","Netherlands","New Zealand","Nicaragua","Niger","Nigeria","Norway","Oman","Pakistan","Palau","Panama","Papua New Guinea","Paraguay","Peru","Philippines","Poland","Portugal","Qatar","Romania","Russia","Rwanda","Saint Kitts and Nevis","Saint Lucia","Saint Vincent","Samoa","San Marino","Sao Tome and Principe","Saudi Arabia","Senegal","Serbia and Montenegro","Seychelles","Sierra Leone","Singapore","Slovakia","Slovenia","Solomon Islands","Somalia","South Africa","Spain","Sri Lanka","Sudan","Suriname","Swaziland","Sweden","Switzerland","Syria","Taiwan","Tajikistan","Tanzania","Thailand","Togo","Tonga","Trinidad and Tobago","Tunisia","Turkey","Turkmenistan","Tuvalu","Uganda","Ukraine","United Arab Emirates","United Kingdom","United States","Uruguay","Uzbekistan","Vanuatu","Vatican City","Venezuela","Vietnam","Yemen","Zambia","Zimbabwe");
|
| 1612 |
-
$w_options = '';
|
| 1613 |
-
$post_country = isset($_POST['wdform_'.($id1+5).'_country'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.($id1+5).'_country'.$form_id])) : "";
|
| 1614 |
-
foreach($w_countries as $w_country) {
|
| 1615 |
-
if($w_country == $post_country) {
|
| 1616 |
-
$selected = 'selected="selected"';
|
| 1617 |
-
}
|
| 1618 |
-
else {
|
| 1619 |
-
$selected = '';
|
| 1620 |
-
}
|
| 1621 |
-
$w_options .= '<option value="'.$w_country.'" '.$selected.'>'.$w_country.'</option>';
|
| 1622 |
-
}
|
| 1623 |
-
if (isset($w_disabled_fields[5]) && $w_disabled_fields[5]=='no') {
|
| 1624 |
-
$g++;
|
| 1625 |
-
$address_fields .= '<span style="float: '.(($g%2==0) ? 'right' : 'left').'; width: 48%; padding-bottom: 8px;display: inline-block;"><select type="text" id="wdform_'.$id1.'_country'.$form_id.'" name="wdform_'.($id1+5).'_country'.$form_id.'" style="width:100%" '.$param['attributes'].'>'.$w_options.'</select><label class="mini_label">'.$w_mini_labels[5].'</label></span>';
|
| 1626 |
-
}
|
| 1627 |
-
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].' width: '.$param['w_size'].'px;"><div>
|
| 1628 |
-
'.$address_fields.'</div></div></div>';
|
| 1629 |
-
|
| 1630 |
-
if ($required) {
|
| 1631 |
-
$check_js.='
|
| 1632 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 1633 |
-
{
|
| 1634 |
-
if(jQuery("#wdform_'.$id1.'_street1'.$form_id.'").val()=="" || (jQuery("#wdform_'.$id1.'_street1'.$form_id.'").val()=="" && jQuery("#wdform_'.$id1.'_street2'.$form_id.'").val()=="") || jQuery("#wdform_'.$id1.'_city'.$form_id.'").val()=="" || jQuery("#wdform_'.$id1.'_state'.$form_id.'").val()=="" || jQuery("#wdform_'.$id1.'_postal'.$form_id.'").val()=="" || jQuery("#wdform_'.$id1.'_country'.$form_id.'").val()=="")
|
| 1635 |
-
{
|
| 1636 |
-
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 1637 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 1638 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 1639 |
-
jQuery("#wdform_'.$id1.'_street1'.$form_id.'").focus();
|
| 1640 |
-
return false;
|
| 1641 |
-
}
|
| 1642 |
-
|
| 1643 |
-
}
|
| 1644 |
-
';
|
| 1645 |
-
}
|
| 1646 |
-
$post = isset($_POST['wdform_'.($id1+5).'_country'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.($id1+5).'_country'.$form_id])) : NULL;
|
| 1647 |
-
if(isset($post)) {
|
| 1648 |
-
$onload_js .=' jQuery("#wdform_'.$id1.'_country'.$form_id.'").val("'.(isset($_POST['wdform_'.($id1+5)."_country".$form_id]) ? esc_html(stripslashes($_POST['wdform_'.($id1+5)."_country".$form_id])) : '').'");';
|
| 1649 |
-
}
|
| 1650 |
-
if (isset($w_disabled_fields[6]) && $w_disabled_fields[6]=='yes') {
|
| 1651 |
-
$onload_js .=' jQuery("#wdform_'.$id1.'_country'.$form_id.'").change(function() {
|
| 1652 |
-
if( jQuery(this).val()=="United States")
|
| 1653 |
-
{
|
| 1654 |
-
jQuery("#wdform_'.$id1.'_state'.$form_id.'").parent().append("<select type=\"text\" id=\"wdform_'.$id1.'_state'.$form_id.'\" name=\"wdform_'.($id1+3).'_state'.$form_id.'\" style=\"width: 100%;\" '.$param['attributes'].'>'.addslashes($w_state_options).'</select><label class=\"mini_label\" style=\"display: block;\" id=\"'.$id1.'_mini_label_state\">'.$w_mini_labels[3].'</label>");
|
| 1655 |
-
jQuery("#wdform_'.$id1.'_state'.$form_id.'").parent().children("input:first, label:first").remove();
|
| 1656 |
-
}
|
| 1657 |
-
else
|
| 1658 |
-
{
|
| 1659 |
-
if(jQuery("#wdform_'.$id1.'_state'.$form_id.'").attr("tagName")=="SELECT")
|
| 1660 |
-
{
|
| 1661 |
-
|
| 1662 |
-
jQuery("#wdform_'.$id1.'_state'.$form_id.'").parent().append("<input type=\"text\" id=\"wdform_'.$id1.'_state'.$form_id.'\" name=\"wdform_'.($id1+3).'_state'.$form_id.'\" value=\"'.(isset($_POST['wdform_'.($id1+3).'_state'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.($id1+3).'_state'.$form_id])) : "").'\" style=\"width: 100%;\" '.$param['attributes'].'><label class=\"mini_label\">'.$w_mini_labels[3].'</label>");
|
| 1663 |
-
jQuery("#wdform_'.$id1.'_state'.$form_id.'").parent().children("select:first, label:first").remove();
|
| 1664 |
-
}
|
| 1665 |
-
}
|
| 1666 |
-
|
| 1667 |
-
});';
|
| 1668 |
-
}
|
| 1669 |
-
break;
|
| 1670 |
-
}
|
| 1671 |
-
|
| 1672 |
-
case 'type_submitter_mail': {
|
| 1673 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_required','w_unique', 'w_class');
|
| 1674 |
-
$temp=$params;
|
| 1675 |
-
foreach($params_names as $params_name ) {
|
| 1676 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1677 |
-
$param[$params_name] = $temp[0];
|
| 1678 |
-
$temp=$temp[1];
|
| 1679 |
-
}
|
| 1680 |
-
if($temp) {
|
| 1681 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1682 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1683 |
-
foreach($attrs as $attr) {
|
| 1684 |
-
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 1685 |
-
}
|
| 1686 |
-
}
|
| 1687 |
-
|
| 1688 |
-
$param['w_first_val']=(isset($_POST['wdform_'.$id1.'_element'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element'.$form_id])) : $param['w_first_val']);
|
| 1689 |
-
|
| 1690 |
-
$wdformfieldsize = ($param['w_field_label_pos']=="left" ? ($param['w_field_label_size']+$param['w_size']) : max($param['w_field_label_size'], $param['w_size']));
|
| 1691 |
-
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 1692 |
-
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 1693 |
-
$input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active");
|
| 1694 |
-
$required = ($param['w_required']=="yes" ? true : false);
|
| 1695 |
-
|
| 1696 |
-
$rep ='<div type="type_submitter_mail" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 1697 |
-
if($required) {
|
| 1698 |
-
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 1699 |
-
}
|
| 1700 |
-
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].' width: '.$param['w_size'].'px;"><input type="text" class="'.$input_active.'" id="wdform_'.$id1.'_element'.$form_id.'" name="wdform_'.$id1.'_element'.$form_id.'" value="'.$param['w_first_val'].'" title="'.$param['w_title'].'" style="width: 100%;" '.$param['attributes'].'></div></div>';
|
| 1701 |
-
|
| 1702 |
-
if($required) {
|
| 1703 |
-
$check_js.='
|
| 1704 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 1705 |
-
{
|
| 1706 |
-
if(jQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="'.$param['w_title'].'" || jQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="")
|
| 1707 |
-
{
|
| 1708 |
-
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 1709 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'").addClass( "form-error" );
|
| 1710 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 1711 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 1712 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'").focus();
|
| 1713 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'").change(function() { if( jQuery(this).val()!="" ) jQuery(this).removeClass("form-error"); else jQuery(this).addClass("form-error");});
|
| 1714 |
-
return false;
|
| 1715 |
-
}
|
| 1716 |
-
}
|
| 1717 |
-
';
|
| 1718 |
-
}
|
| 1719 |
-
$check_js.='
|
| 1720 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 1721 |
-
{
|
| 1722 |
-
|
| 1723 |
-
if(jQuery("#wdform_'.$id1.'_element'.$form_id.'").val()!="" && jQuery("#wdform_'.$id1.'_element'.$form_id.'").val().search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1 )
|
| 1724 |
-
{
|
| 1725 |
-
alert("' . addslashes(__("This is not a valid email address.", 'form_maker')) . '");
|
| 1726 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 1727 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 1728 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'").focus();
|
| 1729 |
-
return false;
|
| 1730 |
-
}
|
| 1731 |
-
|
| 1732 |
-
}
|
| 1733 |
-
';
|
| 1734 |
-
|
| 1735 |
-
break;
|
| 1736 |
-
}
|
| 1737 |
-
|
| 1738 |
-
case 'type_checkbox': {
|
| 1739 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_flow','w_choices','w_choices_checked','w_rowcol', 'w_required','w_randomize','w_allow_other','w_allow_other_num','w_class');
|
| 1740 |
-
$temp=$params;
|
| 1741 |
-
|
| 1742 |
-
if(strpos($temp, 'w_field_option_pos') > -1)
|
| 1743 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_field_option_pos','w_flow','w_choices','w_choices_checked','w_rowcol', 'w_required','w_randomize','w_allow_other','w_allow_other_num', 'w_value_disabled','w_choices_value', 'w_choices_params', 'w_class');
|
| 1744 |
-
foreach($params_names as $params_name ) {
|
| 1745 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1746 |
-
$param[$params_name] = $temp[0];
|
| 1747 |
-
$temp=$temp[1];
|
| 1748 |
-
}
|
| 1749 |
-
|
| 1750 |
-
if($temp) {
|
| 1751 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1752 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1753 |
-
foreach($attrs as $attr) {
|
| 1754 |
-
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 1755 |
-
}
|
| 1756 |
-
}
|
| 1757 |
-
|
| 1758 |
-
if(!isset($param['w_value_disabled']))
|
| 1759 |
-
$param['w_value_disabled'] = 'no';
|
| 1760 |
-
|
| 1761 |
-
if(!isset($param['w_field_option_pos']))
|
| 1762 |
-
$param['w_field_option_pos'] = 'left';
|
| 1763 |
-
|
| 1764 |
-
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 1765 |
-
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 1766 |
-
$param['w_field_option_pos1'] = ($param['w_field_option_pos']=="right" ? "style='float: none
|
| 1767 |
-
!important;'" : "");
|
| 1768 |
-
$param['w_field_option_pos2'] = ($param['w_field_option_pos']=="right" ? "style='float: left !important; margin:3px 8px 0 0 !important; display: inline-block !important;'" : "");
|
| 1769 |
-
$required = ($param['w_required']=="yes" ? true : false);
|
| 1770 |
-
$param['w_choices'] = explode('***',$param['w_choices']);
|
| 1771 |
-
$param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
|
| 1772 |
-
|
| 1773 |
-
if(isset($param['w_choices_value']))
|
| 1774 |
-
{
|
| 1775 |
-
$param['w_choices_value'] = explode('***',$param['w_choices_value']);
|
| 1776 |
-
$param['w_choices_params'] = explode('***',$param['w_choices_params']);
|
| 1777 |
-
}
|
| 1778 |
-
$post_value = isset($_POST["counter".$form_id]) ? esc_html($_POST["counter".$form_id]) : NULL;
|
| 1779 |
-
$is_other=false;
|
| 1780 |
-
|
| 1781 |
-
if (isset($post_value)) {
|
| 1782 |
-
if($param['w_allow_other']=="yes") {
|
| 1783 |
-
$is_other = FALSE;
|
| 1784 |
-
$other_element = isset($_POST['wdform_'.$id1."_other_input".$form_id]) ? esc_html($_POST['wdform_'.$id1."_other_input".$form_id]) : NULL;
|
| 1785 |
-
if (isset($other_element)) {
|
| 1786 |
-
$is_other = TRUE;
|
| 1787 |
-
}
|
| 1788 |
-
}
|
| 1789 |
-
}
|
| 1790 |
-
else {
|
| 1791 |
-
$is_other=($param['w_allow_other']=="yes" && $param['w_choices_checked'][$param['w_allow_other_num']]=='true') ;
|
| 1792 |
-
}
|
| 1793 |
-
$rep='<div type="type_checkbox" class="wdform-field"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 1794 |
-
if($required) {
|
| 1795 |
-
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 1796 |
-
}
|
| 1797 |
-
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].';">';
|
| 1798 |
-
|
| 1799 |
-
$rep.='<div style="display: '.($param['w_flow']=='hor' ? 'inline-block' : 'table-row' ).'; vertical-align:top">';
|
| 1800 |
-
|
| 1801 |
-
$total_queries = 0;
|
| 1802 |
-
foreach ($param['w_choices'] as $key => $choice) {
|
| 1803 |
-
|
| 1804 |
-
$key1 = $key + $total_queries;
|
| 1805 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
|
| 1806 |
-
{
|
| 1807 |
-
$choices_labels =array();
|
| 1808 |
-
$choices_values = array();
|
| 1809 |
-
|
| 1810 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
|
| 1811 |
-
$where = (str_replace(array('[',']'), '', $w_choices_params[0]) ? ' WHERE '.str_replace(array('[',']'), '', $w_choices_params[0]) : '');
|
| 1812 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 1813 |
-
|
| 1814 |
-
$order_by = str_replace(array('[',']'), '', $w_choices_params[0]);
|
| 1815 |
-
$db_info = str_replace(array('[',']'), '', $w_choices_params[1]);
|
| 1816 |
-
|
| 1817 |
-
|
| 1818 |
-
$label_table_and_column = explode(':',str_replace(array('[',']'), '', $choice));
|
| 1819 |
-
$table = $label_table_and_column[0];
|
| 1820 |
-
$label_column = $label_table_and_column[1];
|
| 1821 |
-
if($label_column)
|
| 1822 |
-
{
|
| 1823 |
-
$choices_labels = $this->model->select_data_from_db_for_labels($db_info, $label_column, $table, $where, $order_by);
|
| 1824 |
-
}
|
| 1825 |
-
|
| 1826 |
-
$value_table_and_column = explode(':',str_replace(array('[',']'), '', $param['w_choices_value'][$key]));
|
| 1827 |
-
$value_column = $value_table_and_column[1];
|
| 1828 |
-
|
| 1829 |
-
if($value_column)
|
| 1830 |
-
{
|
| 1831 |
-
$choices_values = $this->model->select_data_from_db_for_values($db_info, $value_column, $table, $where, $order_by);
|
| 1832 |
-
}
|
| 1833 |
-
$columns_count_checkbox = count($choices_labels)>0 ? count($choices_labels) : count($choices_values);
|
| 1834 |
-
|
| 1835 |
-
if(array_filter($choices_labels) || array_filter($choices_values))
|
| 1836 |
-
{
|
| 1837 |
-
$total_queries = $total_queries + $columns_count_checkbox-1;
|
| 1838 |
-
|
| 1839 |
-
if(!isset($post_value))
|
| 1840 |
-
$param['w_choices_checked'][$key]=($param['w_choices_checked'][$key]=='true' ? 'checked="checked"' : '');
|
| 1841 |
-
|
| 1842 |
-
for($k=0; $k<$columns_count_checkbox; $k++)
|
| 1843 |
-
{
|
| 1844 |
-
$choice_label = isset($choices_labels[$k]) ? $choices_labels[$k] : '';
|
| 1845 |
-
$choice_value = isset($choices_values[$k]) ? $choices_values[$k] : $choice_label;
|
| 1846 |
-
|
| 1847 |
-
if(($key1+$k)%$param['w_rowcol']==0 && ($key1+$k)>0)
|
| 1848 |
-
$rep.='</div><div style="display: '.($param['w_flow']=='hor' ? 'inline-block' : 'table-row' ).'; vertical-align:top">';
|
| 1849 |
-
|
| 1850 |
-
if(isset($post_value))
|
| 1851 |
-
{
|
| 1852 |
-
$post_valuetemp=$_REQUEST['wdform_'.$id1."_element".$form_id.($key1+$k)];
|
| 1853 |
-
$param['w_choices_checked'][$key]=(isset($post_valuetemp) ? 'checked="checked"' : '');
|
| 1854 |
-
}
|
| 1855 |
-
|
| 1856 |
-
$rep.='<div style="display: '.($param['w_flow']!='hor' ? 'table-cell' : 'table-row' ).';"><label class="wdform-ch-rad-label" for="wdform_'.$id1.'_element'.$form_id.''.($key1+$k).'" '.$param['w_field_option_pos1'].'>'.$choice_label[0].'</label><div class="checkbox-div forlabs" '.$param['w_field_option_pos2'].'><input type="checkbox" '.(($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key) ? 'other="1"' : '' ).' id="wdform_'.$id1.'_element'.$form_id.''.($key1+$k).'" name="wdform_'.$id1.'_element'.$form_id.''.($key1+$k).'" value="'.htmlspecialchars($choice_value[0]).'" '.(($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key) ? 'onclick="if(set_checked("wdform_'.$id1.'","'.($key1+$k).'","'.$form_id.'")) show_other_input("wdform_'.$id1.'","'.$form_id.'");"' : '').' '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label for="wdform_'.$id1.'_element'.$form_id.''.($key1+$k).'"></label></div></div>';
|
| 1857 |
-
|
| 1858 |
-
}
|
| 1859 |
-
}
|
| 1860 |
-
}
|
| 1861 |
-
else
|
| 1862 |
-
{
|
| 1863 |
-
if ($key1%$param['w_rowcol']==0 && $key1>0) {
|
| 1864 |
-
$rep.='</div><div style="display: '.($param['w_flow']=='hor' ? 'inline-block' : 'table-row' ).'; vertical-align:top">';
|
| 1865 |
-
}
|
| 1866 |
-
if(!isset($post_value)) {
|
| 1867 |
-
$param['w_choices_checked'][$key]=($param['w_choices_checked'][$key]=='true' ? 'checked="checked"' : '');
|
| 1868 |
-
}
|
| 1869 |
-
else {
|
| 1870 |
-
$post_valuetemp = isset($_POST['wdform_'.$id1."_element".$form_id.$key]) ? esc_html(stripslashes($_POST['wdform_'.$id1."_element".$form_id.$key])) : NULL;
|
| 1871 |
-
$param['w_choices_checked'][$key]=(isset($post_valuetemp) ? 'checked="checked"' : '');
|
| 1872 |
-
}
|
| 1873 |
-
$choice_value = isset($param['w_choices_value']) ? $param['w_choices_value'][$key] : $choice;
|
| 1874 |
-
|
| 1875 |
-
$rep.='<div style="display: '.($param['w_flow']!='hor' ? 'table-cell' : 'table-row' ).';"><label class="wdform-ch-rad-label" for="wdform_'.$id1.'_element'.$form_id.''.$key1.'" '.$param['w_field_option_pos1'].'>'.$choice.'</label><div class="checkbox-div forlabs" '.$param['w_field_option_pos2'].'><input type="checkbox" '.(($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key) ? 'other="1"' : '' ).' id="wdform_'.$id1.'_element'.$form_id.''.$key1.'" name="wdform_'.$id1.'_element'.$form_id.''.$key1.'" value="'.htmlspecialchars($choice_value).'" '.(($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key) ? 'onclick="if(set_checked("wdform_'.$id1.'","'.$key1.'","'.$form_id.'")) show_other_input("wdform_'.$id1.'","'.$form_id.'");"' : '').' '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label for="wdform_'.$id1.'_element'.$form_id.''.$key1.'"></label></div></div>';
|
| 1876 |
-
|
| 1877 |
-
$param['w_allow_other_num'] = $param['w_allow_other_num']==$key ? $key1 : $param['w_allow_other_num'];
|
| 1878 |
-
}
|
| 1879 |
-
}
|
| 1880 |
-
$rep.='</div>';
|
| 1881 |
-
|
| 1882 |
-
$rep.='</div></div>';
|
| 1883 |
-
|
| 1884 |
-
if($required) {
|
| 1885 |
-
$check_js.='
|
| 1886 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 1887 |
-
{
|
| 1888 |
-
if(x.find(jQuery("div[wdid='.$id1.'] input:checked")).length == 0 || jQuery("#wdform_'.$id1.'_other_input'.$form_id.'").val() == "")
|
| 1889 |
-
{
|
| 1890 |
-
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 1891 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 1892 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 1893 |
-
|
| 1894 |
-
return false;
|
| 1895 |
-
}
|
| 1896 |
-
}
|
| 1897 |
-
';
|
| 1898 |
-
}
|
| 1899 |
-
if($is_other) {
|
| 1900 |
-
$onload_js .='show_other_input("wdform_'.$id1.'","'.$form_id.'"); jQuery("#wdform_'.$id1.'_other_input'.$form_id.'").val("'.(isset($_POST['wdform_'.$id1."_other_input".$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1."_other_input".$form_id])) : '').'");';
|
| 1901 |
-
}
|
| 1902 |
-
if($param['w_randomize']=='yes')
|
| 1903 |
-
{
|
| 1904 |
-
$onload_js .='jQuery("#form'.$form_id.' div[wdid='.$id1.'] .wdform-element-section> div").shuffle();
|
| 1905 |
-
';
|
| 1906 |
-
}
|
| 1907 |
-
$onsubmit_js.='
|
| 1908 |
-
jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_allow_other'.$form_id.'\" value = \"'.$param['w_allow_other'].'\" />").appendTo("#form'.$form_id.'");
|
| 1909 |
-
jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_allow_other_num'.$form_id.'\" value = \"'.$param['w_allow_other_num'].'\" />").appendTo("#form'.$form_id.'");
|
| 1910 |
-
';
|
| 1911 |
-
break;
|
| 1912 |
-
}
|
| 1913 |
-
|
| 1914 |
-
case 'type_radio': {
|
| 1915 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_flow','w_choices','w_choices_checked','w_rowcol', 'w_required','w_randomize','w_allow_other','w_allow_other_num','w_class');
|
| 1916 |
-
$temp=$params;
|
| 1917 |
-
if(strpos($temp, 'w_field_option_pos') > -1)
|
| 1918 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_field_option_pos','w_flow','w_choices','w_choices_checked','w_rowcol', 'w_required','w_randomize','w_allow_other','w_allow_other_num','w_value_disabled','w_choices_value', 'w_choices_params','w_class');
|
| 1919 |
-
|
| 1920 |
-
foreach($params_names as $params_name ) {
|
| 1921 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1922 |
-
$param[$params_name] = $temp[0];
|
| 1923 |
-
$temp=$temp[1];
|
| 1924 |
-
}
|
| 1925 |
-
|
| 1926 |
-
if($temp) {
|
| 1927 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1928 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1929 |
-
foreach($attrs as $attr) {
|
| 1930 |
-
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 1931 |
-
}
|
| 1932 |
-
}
|
| 1933 |
-
if(!isset($param['w_value_disabled']))
|
| 1934 |
-
$param['w_value_disabled'] = 'no';
|
| 1935 |
-
|
| 1936 |
-
if(!isset($param['w_field_option_pos']))
|
| 1937 |
-
$param['w_field_option_pos'] = 'left';
|
| 1938 |
-
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 1939 |
-
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 1940 |
-
$param['w_field_option_pos1'] = ($param['w_field_option_pos']=="right" ? "style='float: none
|
| 1941 |
-
!important;'" : "");
|
| 1942 |
-
$param['w_field_option_pos2'] = ($param['w_field_option_pos']=="right" ? "style='float: left !important; margin:3px 8px 0 0 !important; display: inline-block !important;'" : "");
|
| 1943 |
-
$required = ($param['w_required']=="yes" ? true : false);
|
| 1944 |
-
$param['w_choices'] = explode('***',$param['w_choices']);
|
| 1945 |
-
$param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
|
| 1946 |
-
if(isset($param['w_choices_value']))
|
| 1947 |
-
{
|
| 1948 |
-
$param['w_choices_value'] = explode('***',$param['w_choices_value']);
|
| 1949 |
-
$param['w_choices_params'] = explode('***',$param['w_choices_params']);
|
| 1950 |
-
}
|
| 1951 |
-
$post_value = isset($_POST["counter".$form_id]) ? esc_html($_POST["counter".$form_id]) : NULL;
|
| 1952 |
-
$is_other=false;
|
| 1953 |
-
|
| 1954 |
-
if(isset($post_value)) {
|
| 1955 |
-
if($param['w_allow_other']=="yes") {
|
| 1956 |
-
$is_other=false;
|
| 1957 |
-
$other_element = isset($_POST['wdform_'.$id1."_other_input".$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1."_other_input".$form_id])) : "";
|
| 1958 |
-
if(isset($other_element)) {
|
| 1959 |
-
$is_other=true;
|
| 1960 |
-
}
|
| 1961 |
-
}
|
| 1962 |
-
}
|
| 1963 |
-
else {
|
| 1964 |
-
$is_other=($param['w_allow_other']=="yes" && $param['w_choices_checked'][$param['w_allow_other_num']]=='true') ;
|
| 1965 |
-
}
|
| 1966 |
-
$rep='<div type="type_radio" class="wdform-field"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 1967 |
-
if($required) {
|
| 1968 |
-
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 1969 |
-
}
|
| 1970 |
-
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].';">';
|
| 1971 |
-
|
| 1972 |
-
$rep.='<div style="display: '.($param['w_flow']=='hor' ? 'inline-block' : 'table-row' ).'; vertical-align:top">';
|
| 1973 |
-
|
| 1974 |
-
$total_queries =0;
|
| 1975 |
-
foreach($param['w_choices'] as $key => $choice) {
|
| 1976 |
-
|
| 1977 |
-
$key1 = $key + $total_queries;
|
| 1978 |
-
|
| 1979 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
|
| 1980 |
-
{
|
| 1981 |
-
$choices_labels =array();
|
| 1982 |
-
$choices_values =array();
|
| 1983 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
|
| 1984 |
-
$where = (str_replace(array('[',']'), '', $w_choices_params[0]) ? ' WHERE '.str_replace(array('[',']'), '', $w_choices_params[0]) : '');
|
| 1985 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 1986 |
-
$order_by = str_replace(array('[',']'), '', $w_choices_params[0]);
|
| 1987 |
-
$db_info = str_replace(array('[',']'), '', $w_choices_params[1]);
|
| 1988 |
-
|
| 1989 |
-
|
| 1990 |
-
$label_table_and_column = explode(':',str_replace(array('[',']'), '', $choice));
|
| 1991 |
-
$table = $label_table_and_column[0];
|
| 1992 |
-
$label_column = $label_table_and_column[1];
|
| 1993 |
-
if($label_column)
|
| 1994 |
-
{
|
| 1995 |
-
$choices_labels = $this->model->select_data_from_db_for_labels($db_info, $label_column, $table, $where, $order_by);
|
| 1996 |
-
}
|
| 1997 |
-
|
| 1998 |
-
$value_table_and_column = explode(':',str_replace(array('[',']'), '', $param['w_choices_value'][$key]));
|
| 1999 |
-
$value_column = $value_table_and_column[1];
|
| 2000 |
-
|
| 2001 |
-
if($value_column)
|
| 2002 |
-
{
|
| 2003 |
-
$choices_values = $this->model->select_data_from_db_for_values($db_info, $value_column, $table, $where, $order_by);
|
| 2004 |
-
}
|
| 2005 |
-
|
| 2006 |
-
$columns_count_radio = count($choices_labels)>0 ? count($choices_labels) : count($choices_values);
|
| 2007 |
-
if(array_filter($choices_labels) || array_filter($choices_values))
|
| 2008 |
-
{
|
| 2009 |
-
$total_queries = $total_queries + $columns_count_radio-1;
|
| 2010 |
-
|
| 2011 |
-
if(!isset($post_value))
|
| 2012 |
-
$param['w_choices_checked'][$key]=($param['w_choices_checked'][$key]=='true' ? 'checked="checked"' : '');
|
| 2013 |
-
|
| 2014 |
-
for($k=0; $k<$columns_count_radio; $k++)
|
| 2015 |
-
{
|
| 2016 |
-
$choice_label = isset($choices_labels[$k]) ? $choices_labels[$k] : '';
|
| 2017 |
-
$choice_value = isset($choices_values[$k]) ? $choices_values[$k] : $choice_label;
|
| 2018 |
-
|
| 2019 |
-
if(($key1+$k)%$param['w_rowcol']==0 && ($key1+$k)>0)
|
| 2020 |
-
$rep.='</div><div style="display: '.($param['w_flow']=='hor' ? 'inline-block' : 'table-row' ).'; vertical-align:top">';
|
| 2021 |
-
|
| 2022 |
-
if(isset($post_value))
|
| 2023 |
-
{
|
| 2024 |
-
$post_valuetemp=$_REQUEST['wdform_'.$id1."_element".$form_id];
|
| 2025 |
-
$param['w_choices_checked'][$key]=(isset($post_valuetemp) ? 'checked="checked"' : '');
|
| 2026 |
-
}
|
| 2027 |
-
|
| 2028 |
-
$rep.='<div style="display: '.($param['w_flow']!='hor' ? 'table-cell' : 'table-row' ).';"><label class="wdform-ch-rad-label" for="wdform_'.$id1.'_element'.$form_id.''.($key1+$k).'" '.$param['w_field_option_pos1'].'>'.$choice_label[0].'</label><div class="radio-div forlabs" '.$param['w_field_option_pos2'].'><input type="radio" '.(($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key) ? 'other="1"' : '' ).' id="wdform_'.$id1.'_element'.$form_id.''.($key1+$k).'" name="wdform_'.$id1.'_element'.$form_id.'" value="'.htmlspecialchars($choice_value[0]).'" onclick="set_default("wdform_'.$id1.'","'.($key1+$k).'","'.$form_id.'"); '.(($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key) ? 'show_other_input("wdform_'.$id1.'","'.$form_id.'");' : '').'" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label for="wdform_'.$id1.'_element'.$form_id.''.($key1+$k).'"></label></div></div>';
|
| 2029 |
-
}
|
| 2030 |
-
}
|
| 2031 |
-
}
|
| 2032 |
-
else
|
| 2033 |
-
{
|
| 2034 |
-
|
| 2035 |
-
if($key1%$param['w_rowcol']==0 && $key1>0) {
|
| 2036 |
-
$rep.='</div><div style="display: '.($param['w_flow']=='hor' ? 'inline-block' : 'table-row' ).'; vertical-align:top">';
|
| 2037 |
-
}
|
| 2038 |
-
if(!isset($post_value)) {
|
| 2039 |
-
$param['w_choices_checked'][$key]=($param['w_choices_checked'][$key]=='true' ? 'checked="checked"' : '');
|
| 2040 |
-
}
|
| 2041 |
-
else {
|
| 2042 |
-
$param['w_choices_checked'][$key] = (htmlspecialchars($choice) == htmlspecialchars(isset($_POST['wdform_'.$id1."_element".$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1."_element".$form_id])) : "") ? 'checked="checked"' : '');
|
| 2043 |
-
}
|
| 2044 |
-
$choice_value = isset($param['w_choices_value']) ? $param['w_choices_value'][$key] : $choice;
|
| 2045 |
-
$rep.='<div style="display: '.($param['w_flow']!='hor' ? 'table-cell' : 'table-row' ).';"><label class="wdform-ch-rad-label" for="wdform_'.$id1.'_element'.$form_id.''.$key1.'" '.$param['w_field_option_pos1'].'>'.$choice.'</label><div class="radio-div forlabs" '.$param['w_field_option_pos2'].'><input type="radio" '.(($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key) ? 'other="1"' : '' ).' id="wdform_'.$id1.'_element'.$form_id.''.$key1.'" name="wdform_'.$id1.'_element'.$form_id.'" value="'.htmlspecialchars($choice_value).'" onclick="set_default("wdform_'.$id1.'","'.$key1.'","'.$form_id.'"); '.(($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key) ? 'show_other_input("wdform_'.$id1.'","'.$form_id.'");' : '').'" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label for="wdform_'.$id1.'_element'.$form_id.''.$key1.'"></label></div></div>';
|
| 2046 |
-
$param['w_allow_other_num'] = $param['w_allow_other_num']==$key ? $key1 : $param['w_allow_other_num'];
|
| 2047 |
-
}
|
| 2048 |
-
}
|
| 2049 |
-
$rep.='</div>';
|
| 2050 |
-
|
| 2051 |
-
$rep.='</div></div>';
|
| 2052 |
-
|
| 2053 |
-
if($required) {
|
| 2054 |
-
$check_js.='
|
| 2055 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none") {
|
| 2056 |
-
if(x.find(jQuery("div[wdid='.$id1.'] input:checked")).length == 0 || jQuery("#wdform_'.$id1.'_other_input'.$form_id.'").val() == "") {
|
| 2057 |
-
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 2058 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 2059 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 2060 |
-
|
| 2061 |
-
return false;
|
| 2062 |
-
}
|
| 2063 |
-
}';
|
| 2064 |
-
}
|
| 2065 |
-
if($is_other) {
|
| 2066 |
-
$onload_js .='show_other_input("wdform_'.$id1.'","'.$form_id.'"); jQuery("#wdform_'.$id1.'_other_input'.$form_id.'").val("'.(isset($_POST['wdform_'.$id1."_other_input".$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1."_other_input".$form_id])) : '').'");';
|
| 2067 |
-
}
|
| 2068 |
-
if($param['w_randomize']=='yes')
|
| 2069 |
-
{
|
| 2070 |
-
$onload_js .='jQuery("#form'.$form_id.' div[wdid='.$id1.'] .wdform-element-section> div").shuffle();
|
| 2071 |
-
';
|
| 2072 |
-
}
|
| 2073 |
-
$onsubmit_js.='
|
| 2074 |
-
jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_allow_other'.$form_id.'\" value = \"'.$param['w_allow_other'].'\" />").appendTo("#form'.$form_id.'");
|
| 2075 |
-
jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_allow_other_num'.$form_id.'\" value = \"'.$param['w_allow_other_num'].'\" />").appendTo("#form'.$form_id.'");
|
| 2076 |
-
';
|
| 2077 |
-
break;
|
| 2078 |
-
}
|
| 2079 |
-
|
| 2080 |
-
case 'type_own_select': {
|
| 2081 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_choices','w_choices_checked', 'w_choices_disabled','w_required','w_class');
|
| 2082 |
-
$temp=$params;
|
| 2083 |
-
|
| 2084 |
-
if(strpos($temp, 'w_choices_value') > -1)
|
| 2085 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_choices','w_choices_checked', 'w_choices_disabled', 'w_required', 'w_value_disabled', 'w_choices_value', 'w_choices_params', 'w_class');
|
| 2086 |
-
|
| 2087 |
-
foreach($params_names as $params_name ) {
|
| 2088 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2089 |
-
$param[$params_name] = $temp[0];
|
| 2090 |
-
$temp=$temp[1];
|
| 2091 |
-
}
|
| 2092 |
-
if($temp) {
|
| 2093 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 2094 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2095 |
-
foreach($attrs as $attr)
|
| 2096 |
-
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 2097 |
-
}
|
| 2098 |
-
|
| 2099 |
-
$wdformfieldsize = ($param['w_field_label_pos']=="left" ? ($param['w_field_label_size']+$param['w_size']) : max($param['w_field_label_size'], $param['w_size']));
|
| 2100 |
-
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 2101 |
-
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 2102 |
-
$required = ($param['w_required']=="yes" ? true : false);
|
| 2103 |
-
$param['w_choices'] = explode('***',$param['w_choices']);
|
| 2104 |
-
$param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
|
| 2105 |
-
$param['w_choices_disabled'] = explode('***',$param['w_choices_disabled']);
|
| 2106 |
-
|
| 2107 |
-
if(isset($param['w_choices_value']))
|
| 2108 |
-
{
|
| 2109 |
-
$param['w_choices_value'] = explode('***',$param['w_choices_value']);
|
| 2110 |
-
$param['w_choices_params'] = explode('***',$param['w_choices_params']);
|
| 2111 |
-
}
|
| 2112 |
-
|
| 2113 |
-
if(!isset($param['w_value_disabled']))
|
| 2114 |
-
$param['w_value_disabled'] = 'no';
|
| 2115 |
-
|
| 2116 |
-
$post_value = isset($_POST["counter".$form_id]) ? esc_html($_POST["counter".$form_id]) : NULL;
|
| 2117 |
-
|
| 2118 |
-
$rep='<div type="type_own_select" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 2119 |
-
if($required) {
|
| 2120 |
-
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 2121 |
-
}
|
| 2122 |
-
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].' width: '.($param['w_size']).'px; "><select id="wdform_'.$id1.'_element'.$form_id.'" name="wdform_'.$id1.'_element'.$form_id.'" style="width: 100%" '.$param['attributes'].'>';
|
| 2123 |
-
foreach($param['w_choices'] as $key => $choice)
|
| 2124 |
-
{
|
| 2125 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
|
| 2126 |
-
{
|
| 2127 |
-
$choices_labels =array();
|
| 2128 |
-
$choices_values = array();
|
| 2129 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
|
| 2130 |
-
$where = (str_replace(array('[',']'), '', $w_choices_params[0]) ? ' WHERE '.str_replace(array('[',']'), '', $w_choices_params[0]) : '');
|
| 2131 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 2132 |
-
$order_by = str_replace(array('[',']'), '', $w_choices_params[0]);
|
| 2133 |
-
$db_info = str_replace(array('[',']'), '', $w_choices_params[1]);
|
| 2134 |
-
|
| 2135 |
-
|
| 2136 |
-
|
| 2137 |
-
$label_table_and_column = explode(':',str_replace(array('[',']'), '', $choice));
|
| 2138 |
-
$table = $label_table_and_column[0];
|
| 2139 |
-
$label_column = $label_table_and_column[1];
|
| 2140 |
-
if($label_column)
|
| 2141 |
-
{
|
| 2142 |
-
$choices_labels = $this->model->select_data_from_db_for_labels($db_info, $label_column, $table, $where, $order_by);
|
| 2143 |
-
}
|
| 2144 |
-
|
| 2145 |
-
$value_table_and_column = explode(':',str_replace(array('[',']'), '', $param['w_choices_value'][$key]));
|
| 2146 |
-
$value_column = $param['w_choices_disabled'][$key]=="true" ? '' : $value_table_and_column[1];
|
| 2147 |
-
|
| 2148 |
-
if($value_column)
|
| 2149 |
-
{
|
| 2150 |
-
$choices_values = $this->model->select_data_from_db_for_values($db_info, $value_column, $table, $where, $order_by);
|
| 2151 |
-
}
|
| 2152 |
-
|
| 2153 |
-
$columns_count = count($choices_labels)>0 ? count($choices_labels) : count($choices_values);
|
| 2154 |
-
if(array_filter($choices_labels) || array_filter($choices_values))
|
| 2155 |
-
for($k=0; $k<$columns_count; $k++)
|
| 2156 |
-
{
|
| 2157 |
-
$choice_label = isset($choices_labels[$k]) ? $choices_labels[$k] : '';
|
| 2158 |
-
$choice_value = isset($choices_values[$k]) ? $choices_values[$k] : ($param['w_choices_disabled'][$key]=="true" ? '' : $choice_label);
|
| 2159 |
-
if(!isset($post_value))
|
| 2160 |
-
$param['w_choices_checked'][$key]=(($param['w_choices_checked'][$key]=='true' && $k == 0) ? 'selected="selected"' : '');
|
| 2161 |
-
else
|
| 2162 |
-
$param['w_choices_checked'][$key]=($choice_value==htmlspecialchars($_REQUEST['wdform_'.$id1."_element".$form_id]) ? 'selected="selected"' : '');
|
| 2163 |
-
|
| 2164 |
-
$rep.='<option value="'.htmlspecialchars($choice_value[0]).'" '.$param['w_choices_checked'][$key].'>'.$choice_label[0].'</option>';
|
| 2165 |
-
|
| 2166 |
-
}
|
| 2167 |
-
}
|
| 2168 |
-
else
|
| 2169 |
-
{
|
| 2170 |
-
if(!isset($post_value))
|
| 2171 |
-
$param['w_choices_checked'][$key]=($param['w_choices_checked'][$key]=='true' ? 'selected="selected"' : '');
|
| 2172 |
-
else
|
| 2173 |
-
$param['w_choices_checked'][$key]=(htmlspecialchars($choice)==htmlspecialchars($_REQUEST['wdform_'.$id1."_element".$form_id]) ? 'selected="selected"' : '');
|
| 2174 |
-
|
| 2175 |
-
$choice_value = $param['w_choices_disabled'][$key]=="true" ? '' : (isset($param['w_choices_value']) ? $param['w_choices_value'][$key] : $choice);
|
| 2176 |
-
|
| 2177 |
-
$rep.='<option value="'.htmlspecialchars($choice_value).'" '.$param['w_choices_checked'][$key].'>'.$choice.'</option>';
|
| 2178 |
-
|
| 2179 |
-
}
|
| 2180 |
-
|
| 2181 |
-
}
|
| 2182 |
-
$rep.='</select></div></div>';
|
| 2183 |
-
|
| 2184 |
-
if($required) {
|
| 2185 |
-
$check_js.='
|
| 2186 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 2187 |
-
{
|
| 2188 |
-
if( jQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="")
|
| 2189 |
-
{
|
| 2190 |
-
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 2191 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'").addClass( "form-error" );
|
| 2192 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 2193 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 2194 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'").focus();
|
| 2195 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'").change(function() { if( jQuery(this).val()!="" ) jQuery(this).removeClass("form-error"); else jQuery(this).addClass("form-error");});
|
| 2196 |
-
return false;
|
| 2197 |
-
}
|
| 2198 |
-
}
|
| 2199 |
-
';
|
| 2200 |
-
}
|
| 2201 |
-
break;
|
| 2202 |
-
}
|
| 2203 |
-
|
| 2204 |
-
case 'type_country': {
|
| 2205 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_countries','w_required','w_class');
|
| 2206 |
-
$temp=$params;
|
| 2207 |
-
foreach($params_names as $params_name ) {
|
| 2208 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2209 |
-
$param[$params_name] = $temp[0];
|
| 2210 |
-
$temp=$temp[1];
|
| 2211 |
-
}
|
| 2212 |
-
if($temp) {
|
| 2213 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 2214 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2215 |
-
foreach($attrs as $attr) {
|
| 2216 |
-
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 2217 |
-
}
|
| 2218 |
-
}
|
| 2219 |
-
|
| 2220 |
-
$wdformfieldsize = ($param['w_field_label_pos']=="left" ? ($param['w_field_label_size']+$param['w_size']) : max($param['w_field_label_size'], $param['w_size']));
|
| 2221 |
-
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 2222 |
-
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 2223 |
-
$required = ($param['w_required']=="yes" ? true : false);
|
| 2224 |
-
$param['w_countries'] = explode('***',$param['w_countries']);
|
| 2225 |
-
|
| 2226 |
-
$post_value = isset($_POST["counter".$form_id]) ? esc_html($_POST["counter".$form_id]) : NULL;
|
| 2227 |
-
$selected='';
|
| 2228 |
-
|
| 2229 |
-
$rep='<div type="type_country" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 2230 |
-
if($required) {
|
| 2231 |
-
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 2232 |
-
}
|
| 2233 |
-
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].' width: '.$param['w_size'].'px;"><select id="wdform_'.$id1.'_element'.$form_id.'" name="wdform_'.$id1.'_element'.$form_id.'" style="width: 100%;" '.$param['attributes'].'>';
|
| 2234 |
-
foreach($param['w_countries'] as $key => $choice) {
|
| 2235 |
-
if(isset($post_value)) {
|
| 2236 |
-
$selected = (htmlspecialchars($choice) == htmlspecialchars(isset($_POST['wdform_'.$id1."_element".$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1."_element".$form_id])) : "") ? 'selected="selected"' : '');
|
| 2237 |
-
}
|
| 2238 |
-
$choice_value=$choice;
|
| 2239 |
-
$rep.='<option value="'.$choice_value.'" '.$selected.'>'.$choice.'</option>';
|
| 2240 |
-
}
|
| 2241 |
-
$rep.='</select></div></div>';
|
| 2242 |
-
|
| 2243 |
-
if($required) {
|
| 2244 |
-
$check_js.='
|
| 2245 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 2246 |
-
{
|
| 2247 |
-
if(jQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="")
|
| 2248 |
-
{
|
| 2249 |
-
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 2250 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'").addClass( "form-error" );
|
| 2251 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 2252 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 2253 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'").focus();
|
| 2254 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'").change(function() { if( jQuery(this).val()!="" ) jQuery(this).removeClass("form-error"); else jQuery(this).addClass("form-error");});
|
| 2255 |
-
return false;
|
| 2256 |
-
}
|
| 2257 |
-
}
|
| 2258 |
-
';
|
| 2259 |
-
}
|
| 2260 |
-
break;
|
| 2261 |
-
}
|
| 2262 |
-
|
| 2263 |
-
case 'type_time': {
|
| 2264 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_time_type','w_am_pm','w_sec','w_hh','w_mm','w_ss','w_mini_labels','w_required','w_class');
|
| 2265 |
-
$temp=$params;
|
| 2266 |
-
|
| 2267 |
-
foreach($params_names as $params_name ) {
|
| 2268 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2269 |
-
$param[$params_name] = $temp[0];
|
| 2270 |
-
$temp=$temp[1];
|
| 2271 |
-
}
|
| 2272 |
-
|
| 2273 |
-
if($temp) {
|
| 2274 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 2275 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2276 |
-
foreach($attrs as $attr) {
|
| 2277 |
-
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 2278 |
-
}
|
| 2279 |
-
}
|
| 2280 |
-
|
| 2281 |
-
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 2282 |
-
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 2283 |
-
$required = ($param['w_required']=="yes" ? true : false);
|
| 2284 |
-
$w_mini_labels = explode('***',$param['w_mini_labels']);
|
| 2285 |
-
|
| 2286 |
-
$w_sec = '';
|
| 2287 |
-
$w_sec_label='';
|
| 2288 |
-
|
| 2289 |
-
if($param['w_sec']=='1') {
|
| 2290 |
-
$w_sec = '<div align="center" style="display: table-cell;"><span class="wdform_colon" style="vertical-align: middle;"> : </span></div><div style="display: table-cell;"><input type="text" value="'.(isset($_POST['wdform_'.$id1."_ss".$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1."_ss".$form_id])) : $param['w_ss']).'" class="time_box" id="wdform_'.$id1.'_ss'.$form_id.'" name="wdform_'.$id1.'_ss'.$form_id.'" onkeypress="return check_second(event, "wdform_'.$id1.'_ss'.$form_id.'")" '.$param['attributes'].'></div>';
|
| 2291 |
-
|
| 2292 |
-
$w_sec_label='<div style="display: table-cell;"></div><div style="display: table-cell;"><label class="mini_label">'.$w_mini_labels[2].'</label></div>';
|
| 2293 |
-
}
|
| 2294 |
-
|
| 2295 |
-
if($param['w_time_type']=='12') {
|
| 2296 |
-
if((isset($_POST['wdform_'.$id1."_am_pm".$form_id]) ? esc_html($_POST['wdform_'.$id1."_am_pm".$form_id]) : $param['w_am_pm'])=='am') {
|
| 2297 |
-
$am_ = "selected=\"selected\"";
|
| 2298 |
-
$pm_ = "";
|
| 2299 |
-
}
|
| 2300 |
-
else {
|
| 2301 |
-
$am_ = "";
|
| 2302 |
-
$pm_ = "selected=\"selected\"";
|
| 2303 |
-
}
|
| 2304 |
-
|
| 2305 |
-
$w_time_type = '<div style="display: table-cell;"><select class="am_pm_select" name="wdform_'.$id1.'_am_pm'.$form_id.'" id="wdform_'.$id1.'_am_pm'.$form_id.'" '.$param['attributes'].'><option value="am" '.$am_.'>AM</option><option value="pm" '.$pm_.'>PM</option></select></div>';
|
| 2306 |
-
|
| 2307 |
-
$w_time_type_label = '<div ><label class="mini_label">'.$w_mini_labels[3].'</label></div>';
|
| 2308 |
-
}
|
| 2309 |
-
else {
|
| 2310 |
-
$w_time_type='';
|
| 2311 |
-
$w_time_type_label = '';
|
| 2312 |
-
}
|
| 2313 |
-
$rep ='<div type="type_time" class="wdform-field"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 2314 |
-
if($required) {
|
| 2315 |
-
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 2316 |
-
}
|
| 2317 |
-
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].';"><div style="display: table;"><div style="display: table-row;"><div style="display: table-cell;"><input type="text" value="'.(isset($_POST['wdform_'.$id1."_hh".$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1."_hh".$form_id])) : $param['w_hh']).'" class="time_box" id="wdform_'.$id1.'_hh'.$form_id.'" name="wdform_'.$id1.'_hh'.$form_id.'" onkeypress="return check_hour(event, "wdform_'.$id1.'_hh'.$form_id.'", "23")" '.$param['attributes'].'></div><div align="center" style="display: table-cell;"><span class="wdform_colon" style="vertical-align: middle;"> : </span></div><div style="display: table-cell;"><input type="text" value="'.(isset($_POST['wdform_'.$id1."_mm".$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1."_mm".$form_id])) : $param['w_mm']).'" class="time_box" id="wdform_'.$id1.'_mm'.$form_id.'" name="wdform_'.$id1.'_mm'.$form_id.'" onkeypress="return check_minute(event, "wdform_'.$id1.'_mm'.$form_id.'")" '.$param['attributes'].'></div>'.$w_sec.$w_time_type.'</div><div style="display: table-row;"><div style="display: table-cell;"><label class="mini_label">'.$w_mini_labels[0].'</label></div><div style="display: table-cell;"></div><div style="display: table-cell;"><label class="mini_label">'.$w_mini_labels[1].'</label></div>'.$w_sec_label.$w_time_type_label.'</div></div></div></div>';
|
| 2318 |
-
|
| 2319 |
-
if($required) {
|
| 2320 |
-
$check_js.='
|
| 2321 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 2322 |
-
{
|
| 2323 |
-
if(jQuery("#wdform_'.$id1.'_mm'.$form_id.'").val()=="" || jQuery("#wdform_'.$id1.'_hh'.$form_id.'").val()=="" || (jQuery("#wdform_'.$id1.'_ss'.$form_id.'").length != 0 ? jQuery("#wdform_'.$id1.'_ss'.$form_id.'").val()=="" : false))
|
| 2324 |
-
{
|
| 2325 |
-
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 2326 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 2327 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 2328 |
-
jQuery("#wdform_'.$id1.'_hh'.$form_id.'").focus();
|
| 2329 |
-
return false;
|
| 2330 |
-
}
|
| 2331 |
-
}
|
| 2332 |
-
';
|
| 2333 |
-
}
|
| 2334 |
-
break;
|
| 2335 |
-
}
|
| 2336 |
-
|
| 2337 |
-
case 'type_date': {
|
| 2338 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_date','w_required','w_class','w_format','w_but_val');
|
| 2339 |
-
$temp = $params;
|
| 2340 |
-
if(strpos($temp, 'w_disable_past_days') > -1)
|
| 2341 |
-
$params_names = array('w_field_label_size','w_field_label_pos','w_date','w_required','w_class','w_format','w_but_val', 'w_disable_past_days');
|
| 2342 |
-
|
| 2343 |
-
foreach($params_names as $params_name ) {
|
| 2344 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2345 |
-
$param[$params_name] = $temp[0];
|
| 2346 |
-
$temp=$temp[1];
|
| 2347 |
-
}
|
| 2348 |
-
if($temp) {
|
| 2349 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 2350 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2351 |
-
foreach($attrs as $attr) {
|
| 2352 |
-
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 2353 |
-
}
|
| 2354 |
-
}
|
| 2355 |
-
|
| 2356 |
-
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 2357 |
-
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 2358 |
-
$required = ($param['w_required']=="yes" ? true : false);
|
| 2359 |
-
|
| 2360 |
-
$param['w_disable_past_days'] = isset($param['w_disable_past_days']) ? $param['w_disable_past_days'] : 'no';
|
| 2361 |
-
$disable_past_days = $param['w_disable_past_days'] == 'yes' ? 'true' : 'false';
|
| 2362 |
-
$param['w_date']=(isset($_POST['wdform_'.$id1."_element".$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1."_element".$form_id])) : $param['w_date']);
|
| 2363 |
-
|
| 2364 |
-
$rep ='<div type="type_date" class="wdform-field"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 2365 |
-
if($required) {
|
| 2366 |
-
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 2367 |
-
}
|
| 2368 |
-
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].';"><input type="text" value="'.$param['w_date'].'" class="wdform-date" id="wdform_'.$id1.'_element'.$form_id.'" name="wdform_'.$id1.'_element'.$form_id.'" maxlength="10" '.$param['attributes'].'><input id="wdform_'.$id1.'_button'.$form_id.'" class="wdform-calendar-button" value="'.$param['w_but_val'].'" format="'.$param['w_format'].'" onclick="return showCalendar(\'wdform_'.$id1.'_element'.$form_id.'\' , \''.$param['w_format'].'\', '.$disable_past_days.')" '.$param['attributes'].' ></div></div>';
|
| 2369 |
-
|
| 2370 |
-
if($required) {
|
| 2371 |
-
$check_js.='
|
| 2372 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 2373 |
-
{
|
| 2374 |
-
if(jQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="")
|
| 2375 |
-
{
|
| 2376 |
-
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 2377 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'").addClass( "form-error" );
|
| 2378 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 2379 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 2380 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'").focus();
|
| 2381 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'").change(function() { if( jQuery(this).val()!="" ) jQuery(this).removeClass("form-error"); else jQuery(this).addClass("form-error");});
|
| 2382 |
-
return false;
|
| 2383 |
-
}
|
| 2384 |
-
}
|
| 2385 |
-
';
|
| 2386 |
-
}
|
| 2387 |
-
|
| 2388 |
-
if($disable_past_days == 'true') {
|
| 2389 |
-
$check_js.='
|
| 2390 |
-
var currentDate = new Date();
|
| 2391 |
-
if( Date.parse(jQuery("#wdform_'.$id1.'_element'.$form_id.'").val() + " 23:59:59") < currentDate.getTime() ) {
|
| 2392 |
-
alert("'.__('You cannot select former dates. Choose a date starting from the current one.', 'form_maker').'");
|
| 2393 |
-
return false;
|
| 2394 |
-
}
|
| 2395 |
-
';
|
| 2396 |
-
}
|
| 2397 |
-
break;
|
| 2398 |
-
}
|
| 2399 |
-
|
| 2400 |
-
case 'type_date_fields': {
|
| 2401 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_day','w_month','w_year','w_day_type','w_month_type','w_year_type','w_day_label','w_month_label','w_year_label','w_day_size','w_month_size','w_year_size','w_required','w_class','w_from','w_to','w_divider');
|
| 2402 |
-
$temp = $params;
|
| 2403 |
-
foreach($params_names as $params_name ) {
|
| 2404 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2405 |
-
$param[$params_name] = $temp[0];
|
| 2406 |
-
$temp=$temp[1];
|
| 2407 |
-
}
|
| 2408 |
-
if($temp) {
|
| 2409 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 2410 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2411 |
-
foreach($attrs as $attr) {
|
| 2412 |
-
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 2413 |
-
}
|
| 2414 |
-
}
|
| 2415 |
-
|
| 2416 |
-
$param['w_day']=(isset($_POST['wdform_'.$id1."_day".$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1."_day".$form_id])) : $param['w_day']);
|
| 2417 |
-
$param['w_month']=(isset($_POST['wdform_'.$id1."_month".$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1."_month".$form_id])) : $param['w_month']);
|
| 2418 |
-
$param['w_year']=(isset($_POST['wdform_'.$id1."_year".$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1."_year".$form_id])) : $param['w_year']);
|
| 2419 |
-
|
| 2420 |
-
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 2421 |
-
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 2422 |
-
$required = ($param['w_required']=="yes" ? true : false);
|
| 2423 |
-
|
| 2424 |
-
if($param['w_day_type']=="SELECT") {
|
| 2425 |
-
$w_day_type = '<select id="wdform_'.$id1.'_day'.$form_id.'" name="wdform_'.$id1.'_day'.$form_id.'" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].'><option value=""></option>';
|
| 2426 |
-
for($k=1; $k<=31; $k++) {
|
| 2427 |
-
if($k<10) {
|
| 2428 |
-
if($param['w_day']=='0'.$k) {
|
| 2429 |
-
$selected = "selected=\"selected\"";
|
| 2430 |
-
}
|
| 2431 |
-
else {
|
| 2432 |
-
$selected = "";
|
| 2433 |
-
}
|
| 2434 |
-
$w_day_type .= '<option value="0'.$k.'" '.$selected.'>0'.$k.'</option>';
|
| 2435 |
-
}
|
| 2436 |
-
else {
|
| 2437 |
-
if($param['w_day']==''.$k) {
|
| 2438 |
-
$selected = "selected=\"selected\"";
|
| 2439 |
-
}
|
| 2440 |
-
else {
|
| 2441 |
-
$selected = "";
|
| 2442 |
-
}
|
| 2443 |
-
$w_day_type .= '<option value="'.$k.'" '.$selected.'>'.$k.'</option>';
|
| 2444 |
-
}
|
| 2445 |
-
}
|
| 2446 |
-
$w_day_type .= '</select>';
|
| 2447 |
-
}
|
| 2448 |
-
else {
|
| 2449 |
-
$w_day_type = '<input type="text" value="'.$param['w_day'].'" id="wdform_'.$id1.'_day'.$form_id.'" name="wdform_'.$id1.'_day'.$form_id.'" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].'>';
|
| 2450 |
-
$onload_js .='jQuery("#wdform_'.$id1.'_day'.$form_id.'").blur(function() {if (jQuery(this).val()=="0") jQuery(this).val(""); else add_0(this)});';
|
| 2451 |
-
$onload_js .='jQuery("#wdform_'.$id1.'_day'.$form_id.'").keypress(function() {return check_day(event, this)});';
|
| 2452 |
-
}
|
| 2453 |
-
if($param['w_month_type']=="SELECT") {
|
| 2454 |
-
$w_month_type = '<select id="wdform_'.$id1.'_month'.$form_id.'" name="wdform_'.$id1.'_month'.$form_id.'" style="width: '.$param['w_month_size'].'px;" '.$param['attributes'].'><option value=""></option><option value="01" '.($param['w_month']=="01" ? "selected=\"selected\"": "").' >'.(__("January", 'form_maker')).'</option><option value="02" '.($param['w_month']=="02" ? "selected=\"selected\"": "").'>'.(__("February", 'form_maker')).'</option><option value="03" '.($param['w_month']=="03"? "selected=\"selected\"": "").'>'.(__("March", 'form_maker')).'</option><option value="04" '.($param['w_month']=="04" ? "selected=\"selected\"": "").' >'.(__("April", 'form_maker')).'</option><option value="05" '.($param['w_month']=="05" ? "selected=\"selected\"": "").' >'.(__("May", 'form_maker')).'</option><option value="06" '.($param['w_month']=="06" ? "selected=\"selected\"": "").' >'.(__("June", 'form_maker')).'</option><option value="07" '.($param['w_month']=="07" ? "selected=\"selected\"": "").' >'.(__("July", 'form_maker')).'</option><option value="08" '.($param['w_month']=="08" ? "selected=\"selected\"": "").' >'.(__("August", 'form_maker')).'</option><option value="09" '.($param['w_month']=="09" ? "selected=\"selected\"": "").' >'.(__("September", 'form_maker')).'</option><option value="10" '.($param['w_month']=="10" ? "selected=\"selected\"": "").' >'.(__("October", 'form_maker')).'</option><option value="11" '.($param['w_month']=="11" ? "selected=\"selected\"": "").'>'.(__("November", 'form_maker')).'</option><option value="12" '.($param['w_month']=="12" ? "selected=\"selected\"": "").' >'.(__("December", 'form_maker')).'</option></select>';
|
| 2455 |
-
}
|
| 2456 |
-
else {
|
| 2457 |
-
$w_month_type = '<input type="text" value="'.$param['w_month'].'" id="wdform_'.$id1.'_month'.$form_id.'" name="wdform_'.$id1.'_month'.$form_id.'" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].'>';
|
| 2458 |
-
$onload_js .='jQuery("#wdform_'.$id1.'_month'.$form_id.'").blur(function() {if (jQuery(this).val()=="0") jQuery(this).val(""); else add_0(this)});';
|
| 2459 |
-
$onload_js .='jQuery("#wdform_'.$id1.'_month'.$form_id.'").keypress(function() {return check_month(event, this)});';
|
| 2460 |
-
}
|
| 2461 |
-
if($param['w_year_type']=="SELECT") {
|
| 2462 |
-
$w_year_type = '<select id="wdform_'.$id1.'_year'.$form_id.'" name="wdform_'.$id1.'_year'.$form_id.'" from="'.$param['w_from'].'" to="'.$param['w_to'].'" style="width: '.$param['w_year_size'].'px;" '.$param['attributes'].'><option value=""></option>';
|
| 2463 |
-
|
| 2464 |
-
for($k=$param['w_to']; $k>=$param['w_from']; $k--) {
|
| 2465 |
-
if($param['w_year']==$k) {
|
| 2466 |
-
$selected = "selected=\"selected\"";
|
| 2467 |
-
}
|
| 2468 |
-
else {
|
| 2469 |
-
$selected = "";
|
| 2470 |
-
}
|
| 2471 |
-
$w_year_type .= '<option value="'.$k.'" '.$selected.'>'.$k.'</option>';
|
| 2472 |
-
}
|
| 2473 |
-
$w_year_type .= '</select>';
|
| 2474 |
-
}
|
| 2475 |
-
else {
|
| 2476 |
-
$w_year_type = '<input type="text" value="'.$param['w_year'].'" id="wdform_'.$id1.'_year'.$form_id.'" name="wdform_'.$id1.'_year'.$form_id.'" from="'.$param['w_from'].'" to="'.$param['w_to'].'" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].'>';
|
| 2477 |
-
$onload_js .='jQuery("#wdform_'.$id1.'_year'.$form_id.'").keypress(function() {return check_year1(event, this)});';
|
| 2478 |
-
$onload_js .='jQuery("#wdform_'.$id1.'_year'.$form_id.'").change(function() {change_year(this)});';
|
| 2479 |
-
}
|
| 2480 |
-
$rep ='<div type="type_date_fields" class="wdform-field"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 2481 |
-
if($required) {
|
| 2482 |
-
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 2483 |
-
}
|
| 2484 |
-
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].';"><div style="display: table;"><div style="display: table-row;"><div style="display: table-cell;">'.$w_day_type.'</div><div style="display: table-cell;"><span class="wdform_separator">'.$param['w_divider'].'</span></div><div style="display: table-cell;">'.$w_month_type.'</div><div style="display: table-cell;"><span class="wdform_separator">'.$param['w_divider'].'</span></div><div style="display: table-cell;">'.$w_year_type.'</div></div><div style="display: table-row;"><div style="display: table-cell;"><label class="mini_label">'.$param['w_day_label'].'</label></div><div style="display: table-cell;"></div><div style="display: table-cell;"><label class="mini_label" >'.$param['w_month_label'].'</label></div><div style="display: table-cell;"></div><div style="display: table-cell;"><label class="mini_label">'.$param['w_year_label'].'</label></div></div></div></div></div>';
|
| 2485 |
-
|
| 2486 |
-
if($required) {
|
| 2487 |
-
$check_js.='
|
| 2488 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 2489 |
-
{
|
| 2490 |
-
if(jQuery("#wdform_'.$id1.'_day'.$form_id.'").val()=="" || jQuery("#wdform_'.$id1.'_month'.$form_id.'").val()=="" || jQuery("#wdform_'.$id1.'_year'.$form_id.'").val()=="")
|
| 2491 |
-
{
|
| 2492 |
-
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 2493 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 2494 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 2495 |
-
jQuery("#wdform_'.$id1.'_day'.$form_id.'").focus();
|
| 2496 |
-
return false;
|
| 2497 |
-
}
|
| 2498 |
-
}
|
| 2499 |
-
';
|
| 2500 |
-
}
|
| 2501 |
-
break;
|
| 2502 |
-
}
|
| 2503 |
-
|
| 2504 |
-
case 'type_file_upload': {
|
| 2505 |
-
$params_names = array('w_field_label_size','w_field_label_pos','w_destination','w_extension','w_max_size','w_required','w_multiple','w_class');
|
| 2506 |
-
$temp = $params;
|
| 2507 |
-
foreach ($params_names as $params_name ) {
|
| 2508 |
-
$temp = explode('*:*'.$params_name.'*:*', $temp);
|
| 2509 |
-
$param[$params_name] = $temp[0];
|
| 2510 |
-
if (isset($temp[1])) {
|
| 2511 |
-
$temp = $temp[1];
|
| 2512 |
-
}
|
| 2513 |
-
else {
|
| 2514 |
-
$temp = '';
|
| 2515 |
-
}
|
| 2516 |
-
}
|
| 2517 |
-
if ($temp) {
|
| 2518 |
-
$temp = explode('*:*w_attr_name*:*',$temp);
|
| 2519 |
-
$attrs = array_slice($temp, 0, count($temp) - 1);
|
| 2520 |
-
foreach($attrs as $attr) {
|
| 2521 |
-
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 2522 |
-
}
|
| 2523 |
-
}
|
| 2524 |
-
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 2525 |
-
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 2526 |
-
$required = ($param['w_required']=="yes" ? true : false);
|
| 2527 |
-
$multiple = ($param['w_multiple']=="yes" ? "multiple='multiple'" : "");
|
| 2528 |
-
$rep ='<div type="type_file_upload" class="wdform-field"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 2529 |
-
if($required) {
|
| 2530 |
-
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 2531 |
-
}
|
| 2532 |
-
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].';"><label class="file-upload"><div class="file-picker"></div><input type="file" id="wdform_'.$id1.'_element'.$form_id.'" name="wdform_'.$id1.'_file'.$form_id.'[]" '.$multiple.' '.$param['attributes'].'></label></div></div>';
|
| 2533 |
-
|
| 2534 |
-
if($required) {
|
| 2535 |
-
$check_js.='
|
| 2536 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 2537 |
-
{
|
| 2538 |
-
if(jQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="")
|
| 2539 |
-
{
|
| 2540 |
-
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 2541 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 2542 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 2543 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'").focus();
|
| 2544 |
-
return false;
|
| 2545 |
-
}
|
| 2546 |
-
}
|
| 2547 |
-
';
|
| 2548 |
-
}
|
| 2549 |
-
$check_js.='
|
| 2550 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 2551 |
-
{
|
| 2552 |
-
ext_available=getfileextension(jQuery("#wdform_'.$id1.'_element'.$form_id.'").val(),"'.$param['w_extension'].'");
|
| 2553 |
-
if(!ext_available)
|
| 2554 |
-
{
|
| 2555 |
-
alert("'.addslashes(__("Sorry, you are not allowed to upload this type of file.", 'form_maker')).'");
|
| 2556 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 2557 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 2558 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'").focus();
|
| 2559 |
-
return false;
|
| 2560 |
-
}
|
| 2561 |
-
}
|
| 2562 |
-
';
|
| 2563 |
-
break;
|
| 2564 |
-
}
|
| 2565 |
-
|
| 2566 |
-
case 'type_captcha': {
|
| 2567 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_digit','w_class');
|
| 2568 |
-
$temp=$params;
|
| 2569 |
-
foreach($params_names as $params_name ) {
|
| 2570 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2571 |
-
$param[$params_name] = $temp[0];
|
| 2572 |
-
$temp=$temp[1];
|
| 2573 |
-
}
|
| 2574 |
-
if($temp) {
|
| 2575 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 2576 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2577 |
-
foreach($attrs as $attr) {
|
| 2578 |
-
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 2579 |
-
}
|
| 2580 |
-
}
|
| 2581 |
-
|
| 2582 |
-
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 2583 |
-
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 2584 |
-
|
| 2585 |
-
$rep ='<div type="type_captcha" class="wdform-field"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].' width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span></div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].'"><div style="display: table;"><div style="display: table-cell;vertical-align: middle;"><div valign="middle" style="display: table-cell; text-align: center;"><img type="captcha" digit="'.$param['w_digit'].'" src=" ' . add_query_arg(array('action' => 'formcontactwdcaptcha', 'digit' => $param['w_digit'], 'i' => $form_id), admin_url('admin-ajax.php')) . '" id="wd_captcha'.$form_id.'" class="captcha_img" style="display:none" '.$param['attributes'].'></div><div valign="middle" style="display: table-cell;"><div class="captcha_refresh" id="_element_refresh'.$form_id.'" '.$param['attributes'].'></div></div></div><div style="display: table-cell;vertical-align: middle;"><div style="display: table-cell;"><input type="text" class="captcha_input" id="wd_captcha_input'.$form_id.'" name="captcha_input" style="width: '.($param['w_digit']*10+15).'px;" '.$param['attributes'].'></div></div></div></div></div>';
|
| 2586 |
-
|
| 2587 |
-
$onload_js .='jQuery("#wd_captcha'.$form_id.'").click(function() {captcha_refresh("wd_captcha","'.$form_id.'")});';
|
| 2588 |
-
$onload_js .='jQuery("#_element_refresh'.$form_id.'").click(function() {captcha_refresh("wd_captcha","'.$form_id.'")});';
|
| 2589 |
-
|
| 2590 |
-
$check_js.='
|
| 2591 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 2592 |
-
{
|
| 2593 |
-
if(jQuery("#wd_captcha_input'.$form_id.'").val()=="")
|
| 2594 |
-
{
|
| 2595 |
-
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 2596 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 2597 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 2598 |
-
jQuery("#wd_captcha_input'.$form_id.'").focus();
|
| 2599 |
-
return false;
|
| 2600 |
-
}
|
| 2601 |
-
}
|
| 2602 |
-
';
|
| 2603 |
-
$onload_js.= 'captcha_refresh("wd_captcha", "'.$form_id.'");';
|
| 2604 |
-
break;
|
| 2605 |
-
}
|
| 2606 |
-
|
| 2607 |
-
|
| 2608 |
-
|
| 2609 |
-
case 'type_arithmetic_captcha':
|
| 2610 |
-
{
|
| 2611 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_count', 'w_operations','w_class', 'w_input_size');
|
| 2612 |
-
$temp=$params;
|
| 2613 |
-
foreach($params_names as $params_name )
|
| 2614 |
-
{
|
| 2615 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2616 |
-
$param[$params_name] = $temp[0];
|
| 2617 |
-
$temp=$temp[1];
|
| 2618 |
-
}
|
| 2619 |
-
|
| 2620 |
-
if($temp)
|
| 2621 |
-
{
|
| 2622 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 2623 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2624 |
-
foreach($attrs as $attr)
|
| 2625 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 2626 |
-
}
|
| 2627 |
-
|
| 2628 |
-
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 2629 |
-
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 2630 |
-
$param['w_count'] = $param['w_count'] ? $param['w_count'] : 1;
|
| 2631 |
-
$param['w_operations'] = $param['w_operations'] ? $param['w_operations'] : '+, -, *, /';
|
| 2632 |
-
$param['w_input_size'] = $param['w_input_size'] ? $param['w_input_size'] : 60;
|
| 2633 |
-
|
| 2634 |
-
$rep ='<div type="type_arithmetic_captcha" class="wdform-field">
|
| 2635 |
-
<div align="left" class="wdform-label-section" style="display:'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label" style="vertical-align: top;">'.$label.'</span></div><div class="wdform-element-section '.$param['w_class'].'" style="display: '.$param['w_field_label_pos2'].';"><div style="display: table;"><div style="display: table-row;"><div style="display: table-cell; vertical-align: middle;"><img type="captcha" operations_count="'.$param['w_count'].'" operations="'.$param['w_operations'].'" src="' . add_query_arg(array('action' => 'formcontactwdmathcaptcha', 'operations_count' => $param['w_count'], 'operations' => $param['w_operations'], 'i' => $form_id), admin_url('admin-ajax.php')) . '" id="wd_arithmetic_captcha'.$form_id.'" class="arithmetic_captcha_img" '.$param['attributes'].'></div><div style="display: table-cell;"><input type="text" class="arithmetic_captcha_input" id="wd_arithmetic_captcha_input'.$form_id.'" name="arithmetic_captcha_input" onkeypress="return check_isnum(event)" style="width: '.$param['w_input_size'].'px;" '.$param['attributes'].'/></div><div style="display: table-cell; vertical-align: middle;"><div class="captcha_refresh" id="_element_refresh'.$form_id.'" '.$param['attributes'].'></div></div></div></div></div></div>';
|
| 2636 |
-
|
| 2637 |
-
$onload_js .='jQuery("#wd_arithmetic_captcha'.$form_id.'").click(function() { captcha_refresh("wd_arithmetic_captcha","'.$form_id.'") });';
|
| 2638 |
-
$onload_js .='jQuery("#_element_refresh'.$form_id.'").click(function() {captcha_refresh("wd_arithmetic_captcha","'.$form_id.'")});';
|
| 2639 |
-
|
| 2640 |
-
$check_js.='
|
| 2641 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 2642 |
-
{
|
| 2643 |
-
if(jQuery("#wd_arithmetic_captcha_input'.$form_id.'").val()=="")
|
| 2644 |
-
{
|
| 2645 |
-
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 2646 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 2647 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 2648 |
-
jQuery("#wd_arithmetic_captcha_input'.$form_id.'").focus();
|
| 2649 |
-
return false;
|
| 2650 |
-
}
|
| 2651 |
-
}
|
| 2652 |
-
';
|
| 2653 |
-
$onload_js.= 'captcha_refresh("wd_arithmetic_captcha", "'.$form_id.'");';
|
| 2654 |
-
break;
|
| 2655 |
-
}
|
| 2656 |
-
|
| 2657 |
-
|
| 2658 |
-
case 'type_recaptcha': {
|
| 2659 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_public','w_private','w_class');
|
| 2660 |
-
$temp=$params;
|
| 2661 |
-
foreach($params_names as $params_name ) {
|
| 2662 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2663 |
-
$param[$params_name] = $temp[0];
|
| 2664 |
-
$temp=$temp[1];
|
| 2665 |
-
}
|
| 2666 |
-
if($temp) {
|
| 2667 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 2668 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2669 |
-
foreach($attrs as $attr) {
|
| 2670 |
-
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 2671 |
-
}
|
| 2672 |
-
}
|
| 2673 |
-
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 2674 |
-
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 2675 |
-
|
| 2676 |
-
$publickey= isset($fmc_settings['public_key']) ? $fmc_settings['public_key'] : '0';
|
| 2677 |
-
|
| 2678 |
-
$rep =' <script src="https://www.google.com/recaptcha/api.js"></script><div type="type_recaptcha" class="wdform-field"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span></div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].';"><div class="g-recaptcha" data-sitekey="'.$publickey.'"></div></div></div>';
|
| 2679 |
-
break;
|
| 2680 |
-
}
|
| 2681 |
-
|
| 2682 |
-
case 'type_hidden': {
|
| 2683 |
-
$params_names=array('w_name','w_value');
|
| 2684 |
-
$temp=$params;
|
| 2685 |
-
|
| 2686 |
-
foreach($params_names as $params_name ) {
|
| 2687 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2688 |
-
$param[$params_name] = $temp[0];
|
| 2689 |
-
$temp=$temp[1];
|
| 2690 |
-
}
|
| 2691 |
-
if($temp) {
|
| 2692 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 2693 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2694 |
-
foreach($attrs as $attr) {
|
| 2695 |
-
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 2696 |
-
}
|
| 2697 |
-
}
|
| 2698 |
-
$rep ='<div type="type_hidden" class="wdform-field"><div class="wdform-label-section" style="display: table-cell;"></div><div class="wdform-element-section" style="display: table-cell;"><input type="hidden" value="'.$param['w_value'].'" id="wdform_'.$id1.'_element'.$form_id.'" name="'.$param['w_name'].'" '.$param['attributes'].'></div></div>';
|
| 2699 |
-
break;
|
| 2700 |
-
}
|
| 2701 |
-
|
| 2702 |
-
case 'type_mark_map': {
|
| 2703 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_center_x','w_center_y','w_long','w_lat','w_zoom','w_width','w_height','w_info','w_class');
|
| 2704 |
-
$temp=$params;
|
| 2705 |
-
foreach($params_names as $params_name ) {
|
| 2706 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2707 |
-
$param[$params_name] = $temp[0];
|
| 2708 |
-
$temp=$temp[1];
|
| 2709 |
-
}
|
| 2710 |
-
if($temp) {
|
| 2711 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 2712 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2713 |
-
foreach($attrs as $attr) {
|
| 2714 |
-
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 2715 |
-
}
|
| 2716 |
-
}
|
| 2717 |
-
|
| 2718 |
-
$wdformfieldsize = ($param['w_field_label_pos']=="left" ? ($param['w_field_label_size']+$param['w_width']) : max($param['w_field_label_size'], $param['w_width']));
|
| 2719 |
-
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 2720 |
-
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 2721 |
-
|
| 2722 |
-
$rep ='<div type="type_mark_map" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span></div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].' width: '.$param['w_width'].'px;"><input type="hidden" id="wdform_'.$id1.'_long'.$form_id.'" name="wdform_'.$id1.'_long'.$form_id.'" value="'.$param['w_long'].'"><input type="hidden" id="wdform_'.$id1.'_lat'.$form_id.'" name="wdform_'.$id1.'_lat'.$form_id.'" value="'.$param['w_lat'].'"><div id="wdform_'.$id1.'_element'.$form_id.'" long0="'.$param['w_long'].'" lat0="'.$param['w_lat'].'" zoom="'.$param['w_zoom'].'" info0="'.str_replace(array("\r\n", "\n", "\r"), '<br />', $param['w_info']).'" center_x="'.$param['w_center_x'].'" center_y="'.$param['w_center_y'].'" style="width: 100%; height: '.$param['w_height'].'px;" '.$param['attributes'].'></div></div></div> ';
|
| 2723 |
-
|
| 2724 |
-
$onload_js .='if_gmap_init("wdform_'.$id1.'", '.$form_id.');';
|
| 2725 |
-
$onload_js .='add_marker_on_map("wdform_'.$id1.'", 0, "'.$param['w_long'].'", "'.$param['w_lat'].'", "'.str_replace(array("\r\n", "\n", "\r"), '<br />', $param['w_info']).'", '.$form_id.',true);';
|
| 2726 |
-
|
| 2727 |
-
break;
|
| 2728 |
-
}
|
| 2729 |
-
|
| 2730 |
-
case 'type_map': {
|
| 2731 |
-
$params_names=array('w_center_x','w_center_y','w_long','w_lat','w_zoom','w_width','w_height','w_info','w_class');
|
| 2732 |
-
$temp=$params;
|
| 2733 |
-
|
| 2734 |
-
foreach($params_names as $params_name) {
|
| 2735 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2736 |
-
$param[$params_name] = $temp[0];
|
| 2737 |
-
$temp=$temp[1];
|
| 2738 |
-
}
|
| 2739 |
-
if($temp) {
|
| 2740 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 2741 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2742 |
-
foreach($attrs as $attr) {
|
| 2743 |
-
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 2744 |
-
}
|
| 2745 |
-
}
|
| 2746 |
-
$marker='';
|
| 2747 |
-
$param['w_long'] = explode('***',$param['w_long']);
|
| 2748 |
-
$param['w_lat'] = explode('***',$param['w_lat']);
|
| 2749 |
-
$param['w_info'] = explode('***',$param['w_info']);
|
| 2750 |
-
foreach($param['w_long'] as $key => $w_long ) {
|
| 2751 |
-
$marker.='long'.$key.'="'.$w_long.'" lat'.$key.'="'.$param['w_lat'][$key].'" info'.$key.'="'.str_replace(array("\r\n", "\n", "\r"), '<br />', $param['w_info'][$key]).'"';
|
| 2752 |
-
}
|
| 2753 |
-
|
| 2754 |
-
$rep ='<div type="type_map" class="wdform-field" style="width:'.($param['w_width']).'px"><div class="wdform-label-section" style="display: table-cell;"><span id="wdform_'.$id1.'_element_label'.$form_id.'" style="display: none;">'.$label.'</span></div><div class="wdform-element-section '.$param['w_class'].'" style="width: '.$param['w_width'].'px;"><div id="wdform_'.$id1.'_element'.$form_id.'" zoom="'.$param['w_zoom'].'" center_x="'.$param['w_center_x'].'" center_y="'.$param['w_center_y'].'" style="width: 100%; height: '.$param['w_height'].'px;" '.$marker.' '.$param['attributes'].'></div></div></div>';
|
| 2755 |
-
|
| 2756 |
-
$onload_js .='if_gmap_init("wdform_'.$id1.'", '.$form_id.');';
|
| 2757 |
-
|
| 2758 |
-
foreach($param['w_long'] as $key => $w_long ) {
|
| 2759 |
-
$onload_js .='add_marker_on_map("wdform_'.$id1.'",'.$key.', "'.$w_long.'", "'.$param['w_lat'][$key].'", "'.str_replace(array("\r\n", "\n", "\r"), '<br />', $param['w_info'][$key]).'", '.$form_id.',false);';
|
| 2760 |
-
}
|
| 2761 |
-
break;
|
| 2762 |
-
}
|
| 2763 |
-
|
| 2764 |
-
case 'type_paypal_price': {
|
| 2765 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_first_val','w_title', 'w_mini_labels','w_size','w_required','w_hide_cents','w_class','w_range_min','w_range_max');
|
| 2766 |
-
$temp=$params;
|
| 2767 |
-
|
| 2768 |
-
foreach($params_names as $params_name ) {
|
| 2769 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2770 |
-
$param[$params_name] = $temp[0];
|
| 2771 |
-
$temp=$temp[1];
|
| 2772 |
-
}
|
| 2773 |
-
if($temp) {
|
| 2774 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 2775 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2776 |
-
foreach($attrs as $attr) {
|
| 2777 |
-
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 2778 |
-
}
|
| 2779 |
-
}
|
| 2780 |
-
|
| 2781 |
-
$w_first_val = explode('***',$param['w_first_val']);
|
| 2782 |
-
$w_title = explode('***',$param['w_title']);
|
| 2783 |
-
|
| 2784 |
-
$param['w_first_val']=(isset($_POST['wdform_'.$id1.'_element_dollars'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element_dollars'.$form_id])) : $w_first_val[0]).'***'.(isset($_POST['wdform_'.$id1.'_element_cents'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element_cents'.$form_id])) : $w_first_val[1]);
|
| 2785 |
-
|
| 2786 |
-
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 2787 |
-
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 2788 |
-
$input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active");
|
| 2789 |
-
$required = ($param['w_required']=="yes" ? true : false);
|
| 2790 |
-
$hide_cents = ($param['w_hide_cents']=="yes" ? "none;" : "table-cell;");
|
| 2791 |
-
|
| 2792 |
-
$w_first_val = explode('***',$param['w_first_val']);
|
| 2793 |
-
$w_title = explode('***',$param['w_title']);
|
| 2794 |
-
$w_mini_labels = explode('***',$param['w_mini_labels']);
|
| 2795 |
-
|
| 2796 |
-
$rep ='<div type="type_paypal_price" class="wdform-field"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 2797 |
-
if($required) {
|
| 2798 |
-
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 2799 |
-
}
|
| 2800 |
-
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].';"><input type="hidden" value="'.$param['w_range_min'].'" name="wdform_'.$id1.'_range_min'.$form_id.'" id="wdform_'.$id1.'_range_min'.$form_id.'"><input type="hidden" value="'.$param['w_range_max'].'" name="wdform_'.$id1.'_range_max'.$form_id.'" id="wdform_'.$id1.'_range_max'.$form_id.'"><div id="wdform_'.$id1.'_table_price" style="display: table;"><div id="wdform_'.$id1.'_tr_price1" style="display: table-row;"><div id="wdform_'.$id1.'_td_name_currency" style="display: table-cell;"><span class="wdform_colon" style="vertical-align: middle;"><!--repstart--> '.$form_currency.' <!--repend--></span></div><div id="wdform_'.$id1.'_td_name_dollars" style="display: table-cell;"><input type="text" class="'.$input_active.'" id="wdform_'.$id1.'_element_dollars'.$form_id.'" name="wdform_'.$id1.'_element_dollars'.$form_id.'" value="'.$w_first_val[0].'" title="'.$w_title[0].'" onkeypress="return check_isnum(event)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].'></div><div id="wdform_'.$id1.'_td_name_divider" style="display: '.$hide_cents.';"><span class="wdform_colon" style="vertical-align: middle;"> . </span></div><div id="wdform_'.$id1.'_td_name_cents" style="display: '.$hide_cents.'"><input type="text" class="'.$input_active.'" id="wdform_'.$id1.'_element_cents'.$form_id.'" name="wdform_'.$id1.'_element_cents'.$form_id.'" value="'.$w_first_val[1].'" title="'.$w_title[1].'" style="width: 30px;" '.$param['attributes'].'></div></div><div id="wdform_'.$id1.'_tr_price2" style="display: table-row;"><div style="display: table-cell;"><label class="mini_label"></label></div><div align="left" style="display: table-cell;"><label class="mini_label">'.$w_mini_labels[0].'</label></div><div id="wdform_'.$id1.'_td_name_label_divider" style="display: '.$hide_cents.'"><label class="mini_label"></label></div><div align="left" id="wdform_'.$id1.'_td_name_label_cents" style="display: '.$hide_cents.'"><label class="mini_label">'.$w_mini_labels[1].'</label></div></div></div></div></div>';
|
| 2801 |
-
|
| 2802 |
-
$onload_js .='jQuery("#wdform_'.$id1.'_element_cents'.$form_id.'").blur(function() {add_0(this)});';
|
| 2803 |
-
$onload_js .='jQuery("#wdform_'.$id1.'_element_cents'.$form_id.'").keypress(function(event) {return check_isnum_interval(event,this,0,99)});';
|
| 2804 |
-
|
| 2805 |
-
if($required) {
|
| 2806 |
-
$check_js.='
|
| 2807 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 2808 |
-
{
|
| 2809 |
-
if(jQuery("#wdform_'.$id1.'_element_dollars'.$form_id.'").val()=="'.$w_title[0].'" || jQuery("#wdform_'.$id1.'_element_dollars'.$form_id.'").val()=="")
|
| 2810 |
-
{
|
| 2811 |
-
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 2812 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 2813 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 2814 |
-
jQuery("#wdform_'.$id1.'_element_dollars'.$form_id.'").focus();
|
| 2815 |
-
return false;
|
| 2816 |
-
}
|
| 2817 |
-
}
|
| 2818 |
-
';
|
| 2819 |
-
}
|
| 2820 |
-
$check_js.='
|
| 2821 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 2822 |
-
{
|
| 2823 |
-
dollars=0;
|
| 2824 |
-
cents=0;
|
| 2825 |
-
|
| 2826 |
-
if(jQuery("#wdform_'.$id1.'_element_dollars'.$form_id.'").val()!="'.$w_title[0].'" || jQuery("#wdform_'.$id1.'_element_dollars'.$form_id.'").val())
|
| 2827 |
-
dollars =jQuery("#wdform_'.$id1.'_element_dollars'.$form_id.'").val();
|
| 2828 |
-
|
| 2829 |
-
if(jQuery("#wdform_'.$id1.'_element_cents'.$form_id.'").val()!="'.$w_title[1].'" || jQuery("#wdform_'.$id1.'_element_cents'.$form_id.'").val())
|
| 2830 |
-
cents =jQuery("#wdform_'.$id1.'_element_cents'.$form_id.'").val();
|
| 2831 |
-
|
| 2832 |
-
var price=dollars+"."+cents;
|
| 2833 |
-
|
| 2834 |
-
if(isNaN(price))
|
| 2835 |
-
{
|
| 2836 |
-
alert("Invalid value of number field");
|
| 2837 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 2838 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 2839 |
-
jQuery("#wdform_'.$id1.'_element_dollars'.$form_id.'").focus();
|
| 2840 |
-
return false;
|
| 2841 |
-
}
|
| 2842 |
-
|
| 2843 |
-
var range_min='.($param['w_range_min'] ? $param['w_range_min'] : 0).';
|
| 2844 |
-
var range_max='.($param['w_range_max'] ? $param['w_range_max'] : -1).';
|
| 2845 |
-
|
| 2846 |
-
|
| 2847 |
-
if('.($required ? 'true' : 'false').' || jQuery("#wdform_'.$id1.'_element_dollars'.$form_id.'").val()!="'.$w_title[0].'" || jQuery("#wdform_'.$id1.'_element_cents'.$form_id.'").val()!="'.$w_title[1].'")
|
| 2848 |
-
if((range_max!=-1 && parseFloat(price)>range_max) || parseFloat(price)<range_min)
|
| 2849 |
-
{
|
| 2850 |
-
alert("' . addslashes((__('The', 'form_maker')) . $label . (__('value must be between', 'form_maker')) . ($param['w_range_min'] ? $param['w_range_min'] : 0) . '-' . ($param['w_range_max'] ? $param['w_range_max'] : "any")) . '");
|
| 2851 |
-
|
| 2852 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 2853 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 2854 |
-
jQuery("#wdform_'.$id1.'_element_dollars'.$form_id.'").focus();
|
| 2855 |
-
return false;
|
| 2856 |
-
}
|
| 2857 |
-
}
|
| 2858 |
-
';
|
| 2859 |
-
|
| 2860 |
-
break;
|
| 2861 |
-
}
|
| 2862 |
-
|
| 2863 |
-
case 'type_paypal_select': {
|
| 2864 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_choices','w_choices_price','w_choices_checked', 'w_choices_disabled','w_required','w_quantity','w_quantity_value','w_class','w_property','w_property_values');
|
| 2865 |
-
$temp=$params;
|
| 2866 |
-
if(strpos($temp, 'w_choices_params') > -1)
|
| 2867 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_choices','w_choices_price','w_choices_checked', 'w_choices_disabled','w_required','w_quantity', 'w_quantity_value', 'w_choices_params','w_class','w_property','w_property_values');
|
| 2868 |
-
|
| 2869 |
-
foreach($params_names as $params_name ) {
|
| 2870 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2871 |
-
$param[$params_name] = $temp[0];
|
| 2872 |
-
$temp=$temp[1];
|
| 2873 |
-
}
|
| 2874 |
-
if($temp) {
|
| 2875 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 2876 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2877 |
-
foreach($attrs as $attr) {
|
| 2878 |
-
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 2879 |
-
}
|
| 2880 |
-
}
|
| 2881 |
-
$wdformfieldsize = ($param['w_field_label_pos']=="left" ? ($param['w_field_label_size']+$param['w_size']) : max($param['w_field_label_size'], $param['w_size']));
|
| 2882 |
-
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 2883 |
-
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 2884 |
-
$required = ($param['w_required']=="yes" ? true : false);
|
| 2885 |
-
$param['w_choices'] = explode('***',$param['w_choices']);
|
| 2886 |
-
$param['w_choices_price'] = explode('***',$param['w_choices_price']);
|
| 2887 |
-
$param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
|
| 2888 |
-
$param['w_choices_disabled'] = explode('***',$param['w_choices_disabled']);
|
| 2889 |
-
$param['w_property'] = explode('***',$param['w_property']);
|
| 2890 |
-
$param['w_property_values'] = explode('***',$param['w_property_values']);
|
| 2891 |
-
|
| 2892 |
-
if(isset($param['w_choices_params']))
|
| 2893 |
-
$param['w_choices_params'] = explode('***',$param['w_choices_params']);
|
| 2894 |
-
|
| 2895 |
-
$post_value = isset($_POST['wdform_'.$id1."_element".$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1."_element".$form_id])) : NULL;
|
| 2896 |
-
$rep='<div type="type_paypal_select" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 2897 |
-
if($required)
|
| 2898 |
-
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 2899 |
-
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].' width: '.$param['w_size'].'px;"><select id="wdform_'.$id1.'_element'.$form_id.'" name="wdform_'.$id1.'_element'.$form_id.'" style="width: 100%;" '.$param['attributes'].'>';
|
| 2900 |
-
foreach($param['w_choices'] as $key => $choice)
|
| 2901 |
-
{
|
| 2902 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
|
| 2903 |
-
{
|
| 2904 |
-
|
| 2905 |
-
$choices_labels =array();
|
| 2906 |
-
$choices_values =array();
|
| 2907 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
|
| 2908 |
-
$where = (str_replace(array('[',']'), '', $w_choices_params[0]) ? ' WHERE '.str_replace(array('[',']'), '', $w_choices_params[0]) : '');
|
| 2909 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 2910 |
-
$order_by = str_replace(array('[',']'), '', $w_choices_params[0]);
|
| 2911 |
-
$db_info = str_replace(array('[',']'), '', $w_choices_params[1]);
|
| 2912 |
-
|
| 2913 |
-
|
| 2914 |
-
|
| 2915 |
-
$label_table_and_column = explode(':',str_replace(array('[',']'), '', $choice));
|
| 2916 |
-
$table = $label_table_and_column[0];
|
| 2917 |
-
$label_column = $label_table_and_column[1];
|
| 2918 |
-
if($label_column)
|
| 2919 |
-
{
|
| 2920 |
-
|
| 2921 |
-
$choices_labels = $this->model->select_data_from_db_for_labels($db_info, $label_column, $table, $where, $order_by);
|
| 2922 |
-
}
|
| 2923 |
-
|
| 2924 |
-
$value_table_and_column = explode(':',str_replace(array('[',']'), '', $param['w_choices_price'][$key]));
|
| 2925 |
-
$value_column = $param['w_choices_disabled'][$key]=="true" ? '' : $value_table_and_column[1];
|
| 2926 |
-
|
| 2927 |
-
if($value_column)
|
| 2928 |
-
{
|
| 2929 |
-
$choices_values = $this->model->select_data_from_db_for_values($db_info, $value_column, $table, $where, $order_by);
|
| 2930 |
-
}
|
| 2931 |
-
|
| 2932 |
-
$columns_count = count($choices_labels)>0 ? count($choices_labels) : count($choices_values);
|
| 2933 |
-
|
| 2934 |
-
for($k=0; $k<$columns_count; $k++)
|
| 2935 |
-
{
|
| 2936 |
-
$choice_label = isset($choices_labels[$k]) ? $choices_labels[$k] : '';
|
| 2937 |
-
$choice_value = isset($choices_values[$k]) ? (float)$choices_values[$k][0] : '';
|
| 2938 |
-
|
| 2939 |
-
if(isset($post_value))
|
| 2940 |
-
{
|
| 2941 |
-
if($post_value==$choice_value && $choice_label==$_REQUEST["wdform_".$id1."_element_label".$form_id])
|
| 2942 |
-
$param['w_choices_checked'][$key]='selected="selected"';
|
| 2943 |
-
else
|
| 2944 |
-
$param['w_choices_checked'][$key]='';
|
| 2945 |
-
}
|
| 2946 |
-
else
|
| 2947 |
-
$param['w_choices_checked'][$key]=(($param['w_choices_checked'][$key]=='true' && $k == 0) ? 'selected="selected"' : '');
|
| 2948 |
-
|
| 2949 |
-
$rep.='<option value="'.$choice_value.'" '.$param['w_choices_checked'][$key].'>'.$choice_label[0].'</option>';
|
| 2950 |
-
}
|
| 2951 |
-
}
|
| 2952 |
-
else
|
| 2953 |
-
{
|
| 2954 |
-
$choice_value = $param['w_choices_disabled'][$key]=="true" ? '' : $param['w_choices_price'][$key];
|
| 2955 |
-
|
| 2956 |
-
if(isset($post_value))
|
| 2957 |
-
{
|
| 2958 |
-
if($post_value==$choice_value && $choice==$_REQUEST["wdform_".$id1."_element_label".$form_id])
|
| 2959 |
-
$param['w_choices_checked'][$key]='selected="selected"';
|
| 2960 |
-
else
|
| 2961 |
-
$param['w_choices_checked'][$key]='';
|
| 2962 |
-
}
|
| 2963 |
-
else
|
| 2964 |
-
{
|
| 2965 |
-
if($param['w_choices_checked'][$key]=='true')
|
| 2966 |
-
$param['w_choices_checked'][$key]='selected="selected"';
|
| 2967 |
-
else
|
| 2968 |
-
$param['w_choices_checked'][$key]='';
|
| 2969 |
-
}
|
| 2970 |
-
|
| 2971 |
-
$rep.='<option value="'.$choice_value.'" '.$param['w_choices_checked'][$key].'>'.$choice.'</option>';
|
| 2972 |
-
}
|
| 2973 |
-
}
|
| 2974 |
-
$rep.='</select><div id="wdform_'.$id1.'_div'.$form_id.'">';
|
| 2975 |
-
if($param['w_quantity']=="yes") {
|
| 2976 |
-
$rep.='<div class="paypal-property"><label class="mini_label" style="margin: 0px 5px;">'.(__("Quantity", 'form_maker')).'</label><input type="text" value="'.(isset($_POST['wdform_'.$id1."_element_quantity".$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1."_element_quantity".$form_id])) : $param['w_quantity_value']).'" id="wdform_'.$id1.'_element_quantity'.$form_id.'" name="wdform_'.$id1.'_element_quantity'.$form_id.'" class="wdform-quantity"></div>';
|
| 2977 |
-
}
|
| 2978 |
-
if($param['w_property'][0]) {
|
| 2979 |
-
foreach($param['w_property'] as $key => $property) {
|
| 2980 |
-
$rep.='
|
| 2981 |
-
<div id="wdform_'.$id1.'_property_'.$key.'" class="paypal-property">
|
| 2982 |
-
<div style="width:150px; display:inline-block;">
|
| 2983 |
-
<label class="mini_label" id="wdform_'.$id1.'_property_label_'.$form_id.''.$key.'" style="margin-right: 5px;">'.$property.'</label>
|
| 2984 |
-
<select id="wdform_'.$id1.'_property'.$form_id.''.$key.'" name="wdform_'.$id1.'_property'.$form_id.''.$key.'" style="margin: 2px 0px;">';
|
| 2985 |
-
$param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
|
| 2986 |
-
$param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
|
| 2987 |
-
foreach($param['w_property_values'][$key] as $subkey => $property_value) {
|
| 2988 |
-
$rep.='<option id="wdform_'.$id1.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'" '.(isset($_POST['wdform_'.$id1.'_property'.$form_id.''.$key]) && esc_html(stripslashes($_POST['wdform_'.$id1.'_property'.$form_id.''.$key])) == $property_value ? 'selected="selected"' : "").'>'.$property_value.'</option>';
|
| 2989 |
-
}
|
| 2990 |
-
$rep.='</select></div></div>';
|
| 2991 |
-
}
|
| 2992 |
-
}
|
| 2993 |
-
$rep.='</div></div></div>';
|
| 2994 |
-
|
| 2995 |
-
if($required) {
|
| 2996 |
-
$check_js.='
|
| 2997 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 2998 |
-
{
|
| 2999 |
-
if(jQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="")
|
| 3000 |
-
{
|
| 3001 |
-
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 3002 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'").addClass( "form-error" );
|
| 3003 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 3004 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 3005 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'").focus();
|
| 3006 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'").change(function() { if( jQuery(this).val()!="" ) jQuery(this).removeClass("form-error"); else jQuery(this).addClass("form-error");});
|
| 3007 |
-
return false;
|
| 3008 |
-
}
|
| 3009 |
-
}
|
| 3010 |
-
';
|
| 3011 |
-
}
|
| 3012 |
-
$onsubmit_js.='
|
| 3013 |
-
jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_element_label'.$form_id.'\" />").val(jQuery("#wdform_'.$id1.'_element'.$form_id.' option:selected").text()).appendTo("#form'.$form_id.'");
|
| 3014 |
-
';
|
| 3015 |
-
$onsubmit_js.='
|
| 3016 |
-
jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_element_quantity_label'.$form_id.'\" />").val("'.(__("Quantity", 'form_maker')).'").appendTo("#form'.$form_id.'");
|
| 3017 |
-
';
|
| 3018 |
-
foreach($param['w_property'] as $key => $property)
|
| 3019 |
-
{
|
| 3020 |
-
$onsubmit_js.='
|
| 3021 |
-
jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_element_property_label'.$form_id.$key.'\" />").val("'.$property.'").appendTo("#form'.$form_id.'");
|
| 3022 |
-
';
|
| 3023 |
-
|
| 3024 |
-
}
|
| 3025 |
-
break;
|
| 3026 |
-
}
|
| 3027 |
-
|
| 3028 |
-
case 'type_paypal_checkbox': {
|
| 3029 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num','w_class','w_property','w_property_values','w_quantity','w_quantity_value');
|
| 3030 |
-
$temp=$params;
|
| 3031 |
-
if(strpos($temp, 'w_field_option_pos') > -1)
|
| 3032 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_field_option_pos','w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num', 'w_choices_params', 'w_class','w_property','w_property_values','w_quantity','w_quantity_value');
|
| 3033 |
-
|
| 3034 |
-
foreach($params_names as $params_name ) {
|
| 3035 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 3036 |
-
$param[$params_name] = $temp[0];
|
| 3037 |
-
$temp=$temp[1];
|
| 3038 |
-
}
|
| 3039 |
-
if($temp) {
|
| 3040 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 3041 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 3042 |
-
foreach($attrs as $attr) {
|
| 3043 |
-
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 3044 |
-
}
|
| 3045 |
-
}
|
| 3046 |
-
if(!isset($param['w_field_option_pos']))
|
| 3047 |
-
$param['w_field_option_pos'] = 'left';
|
| 3048 |
-
|
| 3049 |
-
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 3050 |
-
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 3051 |
-
$param['w_field_option_pos1'] = ($param['w_field_option_pos']=="right" ? "style='float: none
|
| 3052 |
-
!important;'" : "");
|
| 3053 |
-
$param['w_field_option_pos2'] = ($param['w_field_option_pos']=="right" ? "style='float: left !important; margin:3px 8px 0 0 !important; display: inline-block !important;'" : "");
|
| 3054 |
-
$required = ($param['w_required']=="yes" ? true : false);
|
| 3055 |
-
$param['w_choices'] = explode('***',$param['w_choices']);
|
| 3056 |
-
$param['w_choices_price'] = explode('***',$param['w_choices_price']);
|
| 3057 |
-
$param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
|
| 3058 |
-
$param['w_property'] = explode('***',$param['w_property']);
|
| 3059 |
-
$param['w_property_values'] = explode('***',$param['w_property_values']);
|
| 3060 |
-
if(isset($param['w_choices_params']))
|
| 3061 |
-
$param['w_choices_params'] = explode('***',$param['w_choices_params']);
|
| 3062 |
-
|
| 3063 |
-
foreach($param['w_choices_checked'] as $key => $choices_checked ) {
|
| 3064 |
-
$param['w_choices_checked'][$key]=($choices_checked=='true' ? 'checked="checked"' : '');
|
| 3065 |
-
}
|
| 3066 |
-
$rep='<div type="type_paypal_checkbox" class="wdform-field"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 3067 |
-
if($required) {
|
| 3068 |
-
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 3069 |
-
}
|
| 3070 |
-
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].';">';
|
| 3071 |
-
$total_queries = 0;
|
| 3072 |
-
foreach($param['w_choices'] as $key => $choice)
|
| 3073 |
-
{
|
| 3074 |
-
$key1 = $key + $total_queries;
|
| 3075 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
|
| 3076 |
-
{
|
| 3077 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
|
| 3078 |
-
$where = (str_replace(array('[',']'), '', $w_choices_params[0]) ? ' WHERE '.str_replace(array('[',']'), '', $w_choices_params[0]) : '');
|
| 3079 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 3080 |
-
|
| 3081 |
-
$order_by = str_replace(array('[',']'), '', $w_choices_params[0]);
|
| 3082 |
-
$db_info = str_replace(array('[',']'), '', $w_choices_params[1]);
|
| 3083 |
-
|
| 3084 |
-
|
| 3085 |
-
|
| 3086 |
-
$label_table_and_column = explode(':',str_replace(array('[',']'), '', $choice));
|
| 3087 |
-
$table = $label_table_and_column[0];
|
| 3088 |
-
$label_column = $label_table_and_column[1];
|
| 3089 |
-
if($label_column)
|
| 3090 |
-
{
|
| 3091 |
-
$choices_labels = $this->model->select_data_from_db_for_labels($db_info, $label_column, $table, $where, $order_by);
|
| 3092 |
-
}
|
| 3093 |
-
|
| 3094 |
-
$value_table_and_column = explode(':',str_replace(array('[',']'), '', $param['w_choices_price'][$key]));
|
| 3095 |
-
$value_column = $value_table_and_column[1];
|
| 3096 |
-
|
| 3097 |
-
if($value_column)
|
| 3098 |
-
{
|
| 3099 |
-
$choices_values = $this->model->select_data_from_db_for_values($db_info, $value_column, $table, $where, $order_by);
|
| 3100 |
-
}
|
| 3101 |
-
|
| 3102 |
-
$columns_count = count($choices_labels)>0 ? count($choices_labels) : count($choices_values);
|
| 3103 |
-
|
| 3104 |
-
if(array_filter($choices_labels) || array_filter($choices_values))
|
| 3105 |
-
{
|
| 3106 |
-
$total_queries = $total_queries + $columns_count-1;
|
| 3107 |
-
if(!isset($post_value))
|
| 3108 |
-
$param['w_choices_checked'][$key]=($param['w_choices_checked'][$key]=='true' ? 'checked="checked"' : '');
|
| 3109 |
-
|
| 3110 |
-
for($k=0; $k<$columns_count; $k++)
|
| 3111 |
-
{
|
| 3112 |
-
$choice_label = isset($choices_labels) ? $choices_labels[$k] : '';
|
| 3113 |
-
$choice_value = isset($choices_values) ? (float)$choices_values[$k][0] : '';
|
| 3114 |
-
|
| 3115 |
-
if(isset($post_value))
|
| 3116 |
-
{
|
| 3117 |
-
$param['w_choices_checked'][$key]="";
|
| 3118 |
-
$checkedvalue = $_REQUEST['wdform_'.$id1."_element".$form_id.($key1+$k)];
|
| 3119 |
-
|
| 3120 |
-
if(isset($checkedvalue))
|
| 3121 |
-
$param['w_choices_checked'][$key]='checked="checked"';
|
| 3122 |
-
}
|
| 3123 |
-
|
| 3124 |
-
$rep.='<div style="display: '.($param['w_flow']=='hor' ? 'inline-block' : 'table-row' ).';"><label class="wdform-ch-rad-label" for="wdform_'.$id1.'_element'.$form_id.''.($key1+$k).'" '.$param['w_field_option_pos1'].'>'.$choice_label[0].'</label><div class="checkbox-div forlabs" '.$param['w_field_option_pos2'].'><input type="checkbox" id="wdform_'.$id1.'_element'.$form_id.''.($key1+$k).'" name="wdform_'.$id1.'_element'.$form_id.''.($key1+$k).'" value="'.$choice_value.'" title="'.htmlspecialchars($choice_label[0]).'" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label for="wdform_'.$id1.'_element'.$form_id.''.($key1+$k).'"></label></div><input type="hidden" name="wdform_'.$id1.'_element'.$form_id.($key1+$k).'_label" value="'.htmlspecialchars($choice_label[0]).'" /></div>';
|
| 3125 |
-
}
|
| 3126 |
-
}
|
| 3127 |
-
}
|
| 3128 |
-
else
|
| 3129 |
-
{
|
| 3130 |
-
if(isset($post_value))
|
| 3131 |
-
{
|
| 3132 |
-
$param['w_choices_checked'][$key]="";
|
| 3133 |
-
$checkedvalue=$_REQUEST['wdform_'.$id1."_element".$form_id.$key1];
|
| 3134 |
-
if(isset($checkedvalue))
|
| 3135 |
-
$param['w_choices_checked'][$key]='checked="checked"';
|
| 3136 |
-
}
|
| 3137 |
-
else
|
| 3138 |
-
$param['w_choices_checked'][$key]=($param['w_choices_checked'][$key]=='true' ? 'checked="checked"' : '');
|
| 3139 |
-
|
| 3140 |
-
$rep.='<div style="display: '.($param['w_flow']=='hor' ? 'inline-block' : 'table-row' ).';"><label class="wdform-ch-rad-label" for="wdform_'.$id1.'_element'.$form_id.''.$key1.'" '.$param['w_field_option_pos1'].'>'.$choice.'</label><div class="checkbox-div forlabs" '.$param['w_field_option_pos2'].'><input type="checkbox" id="wdform_'.$id1.'_element'.$form_id.''.$key1.'" name="wdform_'.$id1.'_element'.$form_id.''.$key1.'" value="'.$param['w_choices_price'][$key].'" title="'.htmlspecialchars($choice).'" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label for="wdform_'.$id1.'_element'.$form_id.''.$key1.'"></label></div><input type="hidden" name="wdform_'.$id1.'_element'.$form_id.$key1.'_label" value="'.htmlspecialchars($choice).'" /></div>';
|
| 3141 |
-
|
| 3142 |
-
}
|
| 3143 |
-
}
|
| 3144 |
-
|
| 3145 |
-
$rep.='<div id="wdform_'.$id1.'_div'.$form_id.'">';
|
| 3146 |
-
if($param['w_quantity']=="yes") {
|
| 3147 |
-
$rep.='<div class="paypal-property"><label class="mini_label" style="margin: 0px 5px;">'.(__("Quantity", 'form_maker')).'</label><input type="text" value="'.(isset($_POST['wdform_'.$id1."_element_quantity".$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1."_element_quantity".$form_id])) : $param['w_quantity_value']).'" id="wdform_'.$id1.'_element_quantity'.$form_id.'" name="wdform_'.$id1.'_element_quantity'.$form_id.'" class="wdform-quantity"></div>';
|
| 3148 |
-
}
|
| 3149 |
-
if($param['w_property'][0]) {
|
| 3150 |
-
foreach($param['w_property'] as $key => $property) {
|
| 3151 |
-
$rep.='
|
| 3152 |
-
<div class="paypal-property">
|
| 3153 |
-
<div style="display:inline-block;">
|
| 3154 |
-
<label class="mini_label" id="wdform_'.$id1.'_property_label_'.$form_id.''.$key.'" style="margin-right: 5px;">'.$property.'</label>
|
| 3155 |
-
<select id="wdform_'.$id1.'_property'.$form_id.''.$key.'" name="wdform_'.$id1.'_property'.$form_id.''.$key.'" style="margin: 2px 0px;">';
|
| 3156 |
-
$param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
|
| 3157 |
-
$param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
|
| 3158 |
-
foreach($param['w_property_values'][$key] as $subkey => $property_value) {
|
| 3159 |
-
$rep.='<option id="wdform_'.$id1.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'" '.(isset($_POST['wdform_'.$id1.'_property'.$form_id.''.$key]) && esc_html(stripslashes($_POST['wdform_'.$id1.'_property'.$form_id.''.$key])) == $property_value ? 'selected="selected"' : "").'>'.$property_value.'</option>';
|
| 3160 |
-
}
|
| 3161 |
-
$rep.='</select></div></div>';
|
| 3162 |
-
}
|
| 3163 |
-
}
|
| 3164 |
-
$rep.='</div></div></div>';
|
| 3165 |
-
if($required) {
|
| 3166 |
-
$check_js.='
|
| 3167 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 3168 |
-
{
|
| 3169 |
-
if(x.find(jQuery("div[wdid='.$id1.'] input:checked")).length == 0)
|
| 3170 |
-
{
|
| 3171 |
-
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 3172 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 3173 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 3174 |
-
|
| 3175 |
-
return false;
|
| 3176 |
-
}
|
| 3177 |
-
}
|
| 3178 |
-
';
|
| 3179 |
-
}
|
| 3180 |
-
$onsubmit_js.='
|
| 3181 |
-
jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_element_label'.$form_id.'\" />").val((x.find(jQuery("div[wdid='.$id1.'] input:checked")).length != 0) ? jQuery("#"+x.find(jQuery("div[wdid='.$id1.'] input:checked")).attr("id").replace("element", "elementlabel_")) : "").appendTo("#form'.$form_id.'");
|
| 3182 |
-
';
|
| 3183 |
-
$onsubmit_js.='
|
| 3184 |
-
jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_element_quantity_label'.$form_id.'\" />").val("'.(__("Quantity", 'form_maker')).'").appendTo("#form'.$form_id.'");
|
| 3185 |
-
';
|
| 3186 |
-
foreach($param['w_property'] as $key => $property)
|
| 3187 |
-
{
|
| 3188 |
-
$onsubmit_js.='
|
| 3189 |
-
jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_element_property_label'.$form_id.$key.'\" />").val("'.$property.'").appendTo("#form'.$form_id.'");
|
| 3190 |
-
';
|
| 3191 |
-
}
|
| 3192 |
-
break;
|
| 3193 |
-
}
|
| 3194 |
-
|
| 3195 |
-
case 'type_paypal_radio': {
|
| 3196 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num','w_class','w_property','w_property_values','w_quantity','w_quantity_value');
|
| 3197 |
-
$temp=$params;
|
| 3198 |
-
if(strpos($temp, 'w_field_option_pos') > -1)
|
| 3199 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_field_option_pos', 'w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num', 'w_choices_params', 'w_class', 'w_property','w_property_values','w_quantity','w_quantity_value');
|
| 3200 |
-
|
| 3201 |
-
foreach($params_names as $params_name ) {
|
| 3202 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 3203 |
-
$param[$params_name] = $temp[0];
|
| 3204 |
-
$temp=$temp[1];
|
| 3205 |
-
}
|
| 3206 |
-
if($temp) {
|
| 3207 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 3208 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 3209 |
-
foreach($attrs as $attr) {
|
| 3210 |
-
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 3211 |
-
}
|
| 3212 |
-
}
|
| 3213 |
-
if(!isset($param['w_field_option_pos']))
|
| 3214 |
-
$param['w_field_option_pos'] = 'left';
|
| 3215 |
-
|
| 3216 |
-
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 3217 |
-
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 3218 |
-
$param['w_field_option_pos1'] = ($param['w_field_option_pos']=="right" ? "style='float: none
|
| 3219 |
-
!important;'" : "");
|
| 3220 |
-
$param['w_field_option_pos2'] = ($param['w_field_option_pos']=="right" ? "style='float: left !important; margin-right: 8px !important; display: inline-block !important;'" : "");
|
| 3221 |
-
$required = ($param['w_required']=="yes" ? true : false);
|
| 3222 |
-
$param['w_choices'] = explode('***',$param['w_choices']);
|
| 3223 |
-
$param['w_choices_price'] = explode('***',$param['w_choices_price']);
|
| 3224 |
-
$param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
|
| 3225 |
-
$param['w_property'] = explode('***',$param['w_property']);
|
| 3226 |
-
$param['w_property_values'] = explode('***',$param['w_property_values']);
|
| 3227 |
-
if(isset($param['w_choices_params']))
|
| 3228 |
-
$param['w_choices_params'] = explode('***',$param['w_choices_params']);
|
| 3229 |
-
|
| 3230 |
-
foreach($param['w_choices_checked'] as $key => $choices_checked ) {
|
| 3231 |
-
$param['w_choices_checked'][$key]=($choices_checked=='true' ? 'checked="checked"' : '');
|
| 3232 |
-
}
|
| 3233 |
-
|
| 3234 |
-
$rep='<div type="type_paypal_radio" class="wdform-field"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 3235 |
-
if($required) {
|
| 3236 |
-
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 3237 |
-
}
|
| 3238 |
-
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].';">';
|
| 3239 |
-
|
| 3240 |
-
$total_queries = 0;
|
| 3241 |
-
foreach($param['w_choices'] as $key => $choice)
|
| 3242 |
-
{
|
| 3243 |
-
$key1 = $key + $total_queries;
|
| 3244 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
|
| 3245 |
-
{
|
| 3246 |
-
$choices_labels =array();
|
| 3247 |
-
$choices_values =array();
|
| 3248 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
|
| 3249 |
-
$where = (str_replace(array('[',']'), '', $w_choices_params[0]) ? ' WHERE '.str_replace(array('[',']'), '', $w_choices_params[0]) : '');
|
| 3250 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 3251 |
-
|
| 3252 |
-
$order_by = str_replace(array('[',']'), '', $w_choices_params[0]);
|
| 3253 |
-
$db_info = str_replace(array('[',']'), '', $w_choices_params[1]);
|
| 3254 |
-
|
| 3255 |
-
|
| 3256 |
-
$label_table_and_column = explode(':',str_replace(array('[',']'), '', $choice));
|
| 3257 |
-
$table = $label_table_and_column[0];
|
| 3258 |
-
$label_column = $label_table_and_column[1];
|
| 3259 |
-
if($label_column)
|
| 3260 |
-
{
|
| 3261 |
-
$choices_labels = $this->model->select_data_from_db_for_labels($db_info, $label_column, $table, $where, $order_by);
|
| 3262 |
-
}
|
| 3263 |
-
|
| 3264 |
-
$value_table_and_column = explode(':',str_replace(array('[',']'), '', $param['w_choices_price'][$key]));
|
| 3265 |
-
$value_column = $value_table_and_column[1];
|
| 3266 |
-
|
| 3267 |
-
if($value_column)
|
| 3268 |
-
{
|
| 3269 |
-
$choices_values = $this->model->select_data_from_db_for_values($db_info, $value_column, $table, $where, $order_by);
|
| 3270 |
-
}
|
| 3271 |
-
|
| 3272 |
-
$columns_count_radio = count($choices_labels)>0 ? count($choices_labels) : count($choices_values);
|
| 3273 |
-
|
| 3274 |
-
if(array_filter($choices_labels) || array_filter($choices_values))
|
| 3275 |
-
{
|
| 3276 |
-
$total_queries = $total_queries + $columns_count_radio-1;
|
| 3277 |
-
for($k=0; $k<$columns_count_radio; $k++)
|
| 3278 |
-
{
|
| 3279 |
-
$choice_label = isset($choices_labels) ? $choices_labels[$k] : '';
|
| 3280 |
-
$choice_value = isset($choices_values) ? (float)$choices_values[$k][0] : '';
|
| 3281 |
-
|
| 3282 |
-
if(isset($post_value))
|
| 3283 |
-
$param['w_choices_checked'][$key]=(($post_value==$choice_value && htmlspecialchars($choice_label)==htmlspecialchars($_REQUEST['wdform_'.$id1."_element_label".$form_id])) ? 'checked="checked"' : '');
|
| 3284 |
-
else
|
| 3285 |
-
$param['w_choices_checked'][$key]=($param['w_choices_checked'][$key]=='true' ? 'checked="checked"' : '');
|
| 3286 |
-
|
| 3287 |
-
$rep.='<div style="display: '.($param['w_flow']=='hor' ? 'inline-block' : 'table-row' ).';"><label class="wdform-ch-rad-label" for="wdform_'.$id1.'_element'.$form_id.''.($key1+$k).'" '.$param['w_field_option_pos1'].'>'.$choice_label[0].'</label><div class="radio-div forlabs" '.$param['w_field_option_pos2'].'><input type="radio" id="wdform_'.$id1.'_element'.$form_id.''.($key1+$k).'" name="wdform_'.$id1.'_element'.$form_id.'" value="'.$choice_value.'" title="'.htmlspecialchars($choice_label[0]).'" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label for="wdform_'.$id1.'_element'.$form_id.''.($key1+$k).'"></label></div></div>';
|
| 3288 |
-
}
|
| 3289 |
-
}
|
| 3290 |
-
}
|
| 3291 |
-
else
|
| 3292 |
-
{
|
| 3293 |
-
if(isset($post_value))
|
| 3294 |
-
$param['w_choices_checked'][$key]=(($post_value==$param['w_choices_price'][$key] && htmlspecialchars($choice)==htmlspecialchars($_REQUEST['wdform_'.$id1."_element_label".$form_id])) ? 'checked="checked"' : '');
|
| 3295 |
-
else
|
| 3296 |
-
$param['w_choices_checked'][$key]=($param['w_choices_checked'][$key]=='true' ? 'checked="checked"' : '');
|
| 3297 |
-
|
| 3298 |
-
$rep.='<div style="display: '.($param['w_flow']=='hor' ? 'inline-block' : 'table-row' ).';"><label class="wdform-ch-rad-label" for="wdform_'.$id1.'_element'.$form_id.''.$key1.'" '.$param['w_field_option_pos1'].'>'.$choice.'</label><div class="radio-div forlabs" '.$param['w_field_option_pos2'].'><input type="radio" id="wdform_'.$id1.'_element'.$form_id.''.$key1.'" name="wdform_'.$id1.'_element'.$form_id.'" value="'.$param['w_choices_price'][$key].'" title="'.htmlspecialchars($choice).'" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label for="wdform_'.$id1.'_element'.$form_id.''.$key1.'"></label></div></div>';
|
| 3299 |
-
}
|
| 3300 |
-
}
|
| 3301 |
-
$rep.='<div id="wdform_'.$id1.'_div'.$form_id.'">';
|
| 3302 |
-
if($param['w_quantity']=="yes") {
|
| 3303 |
-
$rep.='<div class="paypal-property"><label class="mini_label" style="margin: 0px 5px;">'.(__("Quantity", 'form_maker')).'</label><input type="text" value="'.(isset($_POST['wdform_'.$id1."_element_quantity".$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1."_element_quantity".$form_id])) : $param['w_quantity_value']).'" id="wdform_'.$id1.'_element_quantity'.$form_id.'" name="wdform_'.$id1.'_element_quantity'.$form_id.'" class="wdform-quantity"></div>';
|
| 3304 |
-
}
|
| 3305 |
-
if($param['w_property'][0]) {
|
| 3306 |
-
foreach($param['w_property'] as $key => $property) {
|
| 3307 |
-
$rep.='
|
| 3308 |
-
<div class="paypal-property">
|
| 3309 |
-
<div style="width:150px; display:inline-block;">
|
| 3310 |
-
<label class="mini_label" id="wdform_'.$id1.'_property_label_'.$form_id.''.$key.'" style="margin-right: 5px;">'.$property.'</label>
|
| 3311 |
-
<select id="wdform_'.$id1.'_property'.$form_id.''.$key.'" name="wdform_'.$id1.'_property'.$form_id.''.$key.'" style="margin: 2px 0px;">';
|
| 3312 |
-
$param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
|
| 3313 |
-
$param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
|
| 3314 |
-
foreach($param['w_property_values'][$key] as $subkey => $property_value) {
|
| 3315 |
-
$rep.='<option id="wdform_'.$id1.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'" '.(isset($_POST['wdform_'.$id1.'_property'.$form_id.''.$key]) && esc_html(stripslashes($_POST['wdform_'.$id1.'_property'.$form_id.''.$key])) == $property_value ? 'selected="selected"' : "").'>'.$property_value.'</option>';
|
| 3316 |
-
}
|
| 3317 |
-
$rep.='</select></div></div>';
|
| 3318 |
-
}
|
| 3319 |
-
}
|
| 3320 |
-
$rep.='</div></div></div>';
|
| 3321 |
-
|
| 3322 |
-
if($required) {
|
| 3323 |
-
$check_js.='
|
| 3324 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 3325 |
-
{
|
| 3326 |
-
if(x.find(jQuery("div[wdid='.$id1.'] input:checked")).length == 0)
|
| 3327 |
-
{
|
| 3328 |
-
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 3329 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 3330 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 3331 |
-
|
| 3332 |
-
return false;
|
| 3333 |
-
}
|
| 3334 |
-
}
|
| 3335 |
-
';
|
| 3336 |
-
}
|
| 3337 |
-
$onsubmit_js.='
|
| 3338 |
-
jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_element_label'.$form_id.'\" />").val(
|
| 3339 |
-
jQuery("label[for=\'"+jQuery("input[name^=\'wdform_'.$id1.'_element'.$form_id.'\']:checked").attr("id")+"\']").eq(0).text()
|
| 3340 |
-
).appendTo("#form'.$form_id.'");
|
| 3341 |
-
|
| 3342 |
-
';
|
| 3343 |
-
$onsubmit_js.='
|
| 3344 |
-
jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_element_quantity_label'.$form_id.'\" />").val("'.(__("Quantity", 'form_maker')).'").appendTo("#form'.$form_id.'");
|
| 3345 |
-
';
|
| 3346 |
-
foreach($param['w_property'] as $key => $property)
|
| 3347 |
-
{
|
| 3348 |
-
$onsubmit_js.='
|
| 3349 |
-
jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_element_property_label'.$form_id.$key.'\" />").val("'.$property.'").appendTo("#form'.$form_id.'");
|
| 3350 |
-
';
|
| 3351 |
-
}
|
| 3352 |
-
break;
|
| 3353 |
-
}
|
| 3354 |
-
|
| 3355 |
-
|
| 3356 |
-
case 'type_paypal_shipping': {
|
| 3357 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num','w_class');
|
| 3358 |
-
$temp=$params;
|
| 3359 |
-
if(strpos($temp, 'w_field_option_pos') > -1)
|
| 3360 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_field_option_pos', 'w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num','w_choices_params', 'w_class');
|
| 3361 |
-
|
| 3362 |
-
foreach($params_names as $params_name ) {
|
| 3363 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 3364 |
-
$param[$params_name] = $temp[0];
|
| 3365 |
-
$temp=$temp[1];
|
| 3366 |
-
}
|
| 3367 |
-
|
| 3368 |
-
if($temp) {
|
| 3369 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 3370 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 3371 |
-
foreach($attrs as $attr) {
|
| 3372 |
-
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 3373 |
-
}
|
| 3374 |
-
}
|
| 3375 |
-
if(!isset($param['w_field_option_pos']))
|
| 3376 |
-
$param['w_field_option_pos'] = 'left';
|
| 3377 |
-
|
| 3378 |
-
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 3379 |
-
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 3380 |
-
$param['w_field_option_pos1'] = ($param['w_field_option_pos']=="right" ? "style='float: none
|
| 3381 |
-
!important;'" : "");
|
| 3382 |
-
$param['w_field_option_pos2'] = ($param['w_field_option_pos']=="right" ? "style='float: left !important; margin:3px 8px 0 0 !important; display: inline-block !important;'" : "");
|
| 3383 |
-
|
| 3384 |
-
$required = ($param['w_required']=="yes" ? true : false);
|
| 3385 |
-
$param['w_choices'] = explode('***',$param['w_choices']);
|
| 3386 |
-
$param['w_choices_price'] = explode('***',$param['w_choices_price']);
|
| 3387 |
-
$param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
|
| 3388 |
-
if(isset($param['w_choices_params']))
|
| 3389 |
-
$param['w_choices_params'] = explode('***',$param['w_choices_params']);
|
| 3390 |
-
|
| 3391 |
-
foreach($param['w_choices_checked'] as $key => $choices_checked ) {
|
| 3392 |
-
$param['w_choices_checked'][$key]=($choices_checked=='true' ? 'checked="checked"' : '');
|
| 3393 |
-
}
|
| 3394 |
-
$rep='<div type="type_paypal_shipping" class="wdform-field"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 3395 |
-
if($required) {
|
| 3396 |
-
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 3397 |
-
}
|
| 3398 |
-
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].';">';
|
| 3399 |
-
$total_queries = 0;
|
| 3400 |
-
foreach($param['w_choices'] as $key => $choice)
|
| 3401 |
-
{
|
| 3402 |
-
$key1 = $key + $total_queries;
|
| 3403 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
|
| 3404 |
-
{
|
| 3405 |
-
$choices_labels =array();
|
| 3406 |
-
$choices_values =array();
|
| 3407 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
|
| 3408 |
-
$where = (str_replace(array('[',']'), '', $w_choices_params[0]) ? ' WHERE '.str_replace(array('[',']'), '', $w_choices_params[0]) : '');
|
| 3409 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 3410 |
-
|
| 3411 |
-
$order_by = str_replace(array('[',']'), '', $w_choices_params[0]);
|
| 3412 |
-
$db_info = str_replace(array('[',']'), '', $w_choices_params[1]);
|
| 3413 |
-
|
| 3414 |
-
|
| 3415 |
-
$label_table_and_column = explode(':',str_replace(array('[',']'), '', $choice));
|
| 3416 |
-
$table = $label_table_and_column[0];
|
| 3417 |
-
$label_column = $label_table_and_column[1];
|
| 3418 |
-
if($label_column)
|
| 3419 |
-
{
|
| 3420 |
-
$choices_labels = $this->model->select_data_from_db_for_labels($db_info, $label_column, $table, $where, $order_by);
|
| 3421 |
-
|
| 3422 |
-
}
|
| 3423 |
-
|
| 3424 |
-
$value_table_and_column = explode(':',str_replace(array('[',']'), '', $param['w_choices_price'][$key]));
|
| 3425 |
-
$value_column = $value_table_and_column[1];
|
| 3426 |
-
|
| 3427 |
-
if($value_column)
|
| 3428 |
-
{
|
| 3429 |
-
$choices_values = $this->model->select_data_from_db_for_values($db_info, $value_column, $table, $where, $order_by);
|
| 3430 |
-
}
|
| 3431 |
-
|
| 3432 |
-
$columns_count_shipping = count($choices_labels)>0 ? count($choices_labels) : count($choices_values);
|
| 3433 |
-
|
| 3434 |
-
if(array_filter($choices_labels) || array_filter($choices_values))
|
| 3435 |
-
{
|
| 3436 |
-
$total_queries = $total_queries + $columns_count_shipping-1;
|
| 3437 |
-
for($k=0; $k<$columns_count_shipping; $k++)
|
| 3438 |
-
{
|
| 3439 |
-
$choice_label = isset($choices_labels) ? $choices_labels[$k][0] : '';
|
| 3440 |
-
$choice_value = isset($choices_values) ? (float)$choices_values[$k][0] : '';
|
| 3441 |
-
|
| 3442 |
-
if(isset($post_value))
|
| 3443 |
-
$param['w_choices_checked'][$key]=(($post_value==$choice_value && htmlspecialchars($choice_label)==htmlspecialchars($_REQUEST['wdform_'.$id1."_element_label".$form_id])) ? 'checked="checked"' : '');
|
| 3444 |
-
else
|
| 3445 |
-
$param['w_choices_checked'][$key]=($param['w_choices_checked'][$key]=='true' ? 'checked="checked"' : '');
|
| 3446 |
-
|
| 3447 |
-
$rep.='<div style="display: '.($param['w_flow']=='hor' ? 'inline-block' : 'table-row' ).';"><label class="wdform-ch-rad-label" for="wdform_'.$id1.'_element'.$form_id.''.($key1+$k).'" '.$param['w_field_option_pos1'].'>'.$choice_label.'</label><div class="radio-div forlabs" '.$param['w_field_option_pos2'].'><input type="radio" id="wdform_'.$id1.'_element'.$form_id.''.($key1+$k).'" name="wdform_'.$id1.'_element'.$form_id.'" value="'.$choice_value.'" title="'.htmlspecialchars($choice_label[0]).'" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label for="wdform_'.$id1.'_element'.$form_id.''.($key1+$k).'"></label></div></div>';
|
| 3448 |
-
}
|
| 3449 |
-
}
|
| 3450 |
-
}
|
| 3451 |
-
else
|
| 3452 |
-
{
|
| 3453 |
-
if(isset($post_value))
|
| 3454 |
-
$param['w_choices_checked'][$key]=(($post_value==$param['w_choices_price'][$key] && htmlspecialchars($choice)==htmlspecialchars($_REQUEST['wdform_'.$id1."_element_label".$form_id])) ? 'checked="checked"' : '');
|
| 3455 |
-
else
|
| 3456 |
-
$param['w_choices_checked'][$key]=($param['w_choices_checked'][$key]=='true' ? 'checked="checked"' : '');
|
| 3457 |
-
|
| 3458 |
-
$rep.='<div style="display: '.($param['w_flow']=='hor' ? 'inline-block' : 'table-row' ).';"><label class="wdform-ch-rad-label" for="wdform_'.$id1.'_element'.$form_id.''.$key1.'" '.$param['w_field_option_pos1'].'>'.$choice.'</label><div class="radio-div forlabs" '.$param['w_field_option_pos2'].'><input type="radio" id="wdform_'.$id1.'_element'.$form_id.''.$key1.'" name="wdform_'.$id1.'_element'.$form_id.'" value="'.$param['w_choices_price'][$key].'" title="'.htmlspecialchars($choice).'" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label for="wdform_'.$id1.'_element'.$form_id.''.$key1.'"></label></div></div>';
|
| 3459 |
-
}
|
| 3460 |
-
}
|
| 3461 |
-
|
| 3462 |
-
$rep.='</div></div>';
|
| 3463 |
-
if($required) {
|
| 3464 |
-
$check_js.='
|
| 3465 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 3466 |
-
{
|
| 3467 |
-
if(x.find(jQuery("div[wdid='.$id1.'] input:checked")).length == 0)
|
| 3468 |
-
{
|
| 3469 |
-
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 3470 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 3471 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 3472 |
-
|
| 3473 |
-
return false;
|
| 3474 |
-
}
|
| 3475 |
-
}
|
| 3476 |
-
';
|
| 3477 |
-
}
|
| 3478 |
-
$onsubmit_js.='
|
| 3479 |
-
jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_element_label'.$form_id.'\" />").val(
|
| 3480 |
-
jQuery("label[for=\'"+jQuery("input[name^=\'wdform_'.$id1.'_element'.$form_id.'\']:checked").attr("id")+"\']").eq(0).text()
|
| 3481 |
-
).appendTo("#form'.$form_id.'");
|
| 3482 |
-
';
|
| 3483 |
-
break;
|
| 3484 |
-
}
|
| 3485 |
-
|
| 3486 |
-
case 'type_submit_reset': {
|
| 3487 |
-
$params_names=array('w_submit_title','w_reset_title','w_class','w_act');
|
| 3488 |
-
$temp=$params;
|
| 3489 |
-
foreach($params_names as $params_name ) {
|
| 3490 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 3491 |
-
$param[$params_name] = $temp[0];
|
| 3492 |
-
$temp=$temp[1];
|
| 3493 |
-
}
|
| 3494 |
-
if($temp) {
|
| 3495 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 3496 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 3497 |
-
foreach($attrs as $attr) {
|
| 3498 |
-
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 3499 |
-
}
|
| 3500 |
-
}
|
| 3501 |
-
$param['w_act'] = ($param['w_act']=="false" ? 'style="display: none;"' : "");
|
| 3502 |
-
$rep='<div type="type_submit_reset" class="wdform-field"><div class="wdform-label-section" style="display: table-cell;"></div><div class="wdform-element-section '.$param['w_class'].'" style="display: table-cell;"><button type="button" class="button-submit" onclick="check_required'.$form_id.'("submit", "'.$form_id.'");" '.$param['attributes'].'>'.$param['w_submit_title'].'</button><button type="button" class="button-reset" onclick="check_required'.$form_id.'("reset");" '.$param['w_act'].' '.$param['attributes'].'>'.$param['w_reset_title'].'</button></div></div>';
|
| 3503 |
-
break;
|
| 3504 |
-
}
|
| 3505 |
-
|
| 3506 |
-
case 'type_button': {
|
| 3507 |
-
$params_names=array('w_title','w_func','w_class');
|
| 3508 |
-
$temp=$params;
|
| 3509 |
-
foreach($params_names as $params_name ) {
|
| 3510 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 3511 |
-
$param[$params_name] = $temp[0];
|
| 3512 |
-
$temp=$temp[1];
|
| 3513 |
-
}
|
| 3514 |
-
if($temp) {
|
| 3515 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 3516 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 3517 |
-
foreach($attrs as $attr) {
|
| 3518 |
-
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 3519 |
-
}
|
| 3520 |
-
}
|
| 3521 |
-
$param['w_title'] = explode('***',$param['w_title']);
|
| 3522 |
-
$param['w_func'] = explode('***',$param['w_func']);
|
| 3523 |
-
$rep.='<div type="type_button" class="wdform-field"><div class="wdform-label-section" style="display: table-cell;"><span style="display: none;">button_'.$id1.'</span></div><div class="wdform-element-section '.$param['w_class'].'" style="display: table-cell;">';
|
| 3524 |
-
|
| 3525 |
-
foreach($param['w_title'] as $key => $title) {
|
| 3526 |
-
$rep.='<button type="button" name="wdform_'.$id1.'_element'.$form_id.''.$key.'" onclick="'.$param['w_func'][$key].'" '.$param['attributes'].'>'.$title.'</button>';
|
| 3527 |
-
}
|
| 3528 |
-
$rep.='</div></div>';
|
| 3529 |
-
break;
|
| 3530 |
-
}
|
| 3531 |
-
|
| 3532 |
-
case 'type_star_rating': {
|
| 3533 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_field_label_col','w_star_amount','w_required','w_class');
|
| 3534 |
-
$temp=$params;
|
| 3535 |
-
foreach($params_names as $params_name ) {
|
| 3536 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 3537 |
-
$param[$params_name] = $temp[0];
|
| 3538 |
-
$temp=$temp[1];
|
| 3539 |
-
}
|
| 3540 |
-
if($temp) {
|
| 3541 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 3542 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 3543 |
-
foreach($attrs as $attr) {
|
| 3544 |
-
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 3545 |
-
}
|
| 3546 |
-
}
|
| 3547 |
-
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 3548 |
-
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 3549 |
-
$required = ($param['w_required']=="yes" ? true : false);
|
| 3550 |
-
$images = '';
|
| 3551 |
-
for($i=0; $i<$param['w_star_amount']; $i++) {
|
| 3552 |
-
$images .= '<img id="wdform_'.$id1.'_star_'.$i.'_'.$form_id.'" src="' . WD_FMC_URL . '/images/star.png" >';
|
| 3553 |
-
$onload_js .='jQuery("#wdform_'.$id1.'_star_'.$i.'_'.$form_id.'").mouseover(function() {change_src('.$i.',"wdform_'.$id1.'", '.$form_id.', "'.$param['w_field_label_col'].'");});';
|
| 3554 |
-
$onload_js .='jQuery("#wdform_'.$id1.'_star_'.$i.'_'.$form_id.'").mouseout(function() {reset_src('.$i.',"wdform_'.$id1.'", '.$form_id.');});';
|
| 3555 |
-
$onload_js .='jQuery("#wdform_'.$id1.'_star_'.$i.'_'.$form_id.'").click(function() {select_star_rating('.$i.',"wdform_'.$id1.'", '.$form_id.',"'.$param['w_field_label_col'].'", "'.$param['w_star_amount'].'");});';
|
| 3556 |
-
}
|
| 3557 |
-
|
| 3558 |
-
$rep ='<div type="type_star_rating" class="wdform-field"><div class="wdform-label-section '.$param['w_class'].'" style="'.$param['w_field_label_pos1'].' width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 3559 |
-
if($required) {
|
| 3560 |
-
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 3561 |
-
}
|
| 3562 |
-
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].'"><div id="wdform_'.$id1.'_element'.$form_id.'" '.$param['attributes'].'>'.$images.'</div><input type="hidden" value="" id="wdform_'.$id1.'_selected_star_amount'.$form_id.'" name="wdform_'.$id1.'_selected_star_amount'.$form_id.'"></div></div>';
|
| 3563 |
-
|
| 3564 |
-
if($required) {
|
| 3565 |
-
$check_js.='
|
| 3566 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 3567 |
-
{
|
| 3568 |
-
if(jQuery("#wdform_'.$id1.'_selected_star_amount'.$form_id.'").val()=="")
|
| 3569 |
-
{
|
| 3570 |
-
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 3571 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 3572 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 3573 |
-
return false;
|
| 3574 |
-
}
|
| 3575 |
-
}
|
| 3576 |
-
';
|
| 3577 |
-
}
|
| 3578 |
-
$post = isset($_POST['wdform_'.$id1.'_selected_star_amount'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_selected_star_amount'.$form_id])) : NULL;
|
| 3579 |
-
if(isset($post)) {
|
| 3580 |
-
$onload_js .=' select_star_rating('.($post-1).',"wdform_'.$id1.'", '.$form_id.',"'.$param['w_field_label_col'].'", "'.$param['w_star_amount'].'");';
|
| 3581 |
-
}
|
| 3582 |
-
$onsubmit_js.='
|
| 3583 |
-
jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_star_amount'.$form_id.'\" value = \"'.$param['w_star_amount'].'\" />").appendTo("#form'.$form_id.'");
|
| 3584 |
-
';
|
| 3585 |
-
break;
|
| 3586 |
-
}
|
| 3587 |
-
case 'type_scale_rating': {
|
| 3588 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_mini_labels','w_scale_amount','w_required','w_class');
|
| 3589 |
-
$temp=$params;
|
| 3590 |
-
foreach($params_names as $params_name ) {
|
| 3591 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 3592 |
-
$param[$params_name] = $temp[0];
|
| 3593 |
-
$temp=$temp[1];
|
| 3594 |
-
}
|
| 3595 |
-
if($temp) {
|
| 3596 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 3597 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 3598 |
-
foreach($attrs as $attr) {
|
| 3599 |
-
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 3600 |
-
}
|
| 3601 |
-
}
|
| 3602 |
-
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 3603 |
-
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 3604 |
-
$required = ($param['w_required']=="yes" ? true : false);
|
| 3605 |
-
$w_mini_labels = explode('***',$param['w_mini_labels']);
|
| 3606 |
-
$numbers = '';
|
| 3607 |
-
$radio_buttons = '';
|
| 3608 |
-
$to_check=0;
|
| 3609 |
-
$post_value = isset($_POST['wdform_'.$id1.'_scale_radio'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_scale_radio'.$form_id])) : NULL;
|
| 3610 |
-
if(isset($post_value)) {
|
| 3611 |
-
$to_check=$post_value;
|
| 3612 |
-
}
|
| 3613 |
-
for($i=1; $i<=$param['w_scale_amount']; $i++) {
|
| 3614 |
-
$numbers.= '<div style="text-align: center; display: table-cell;"><span>'.$i.'</span></div>';
|
| 3615 |
-
$radio_buttons.= '<div style="text-align: center; display: table-cell;"><div class="radio-div"><input id="wdform_'.$id1.'_scale_radio'.$form_id.'_'.$i.'" name="wdform_'.$id1.'_scale_radio'.$form_id.'" value="'.$i.'" type="radio" '.( $to_check==$i ? 'checked="checked"' : '' ).'><label for="wdform_'.$id1.'_scale_radio'.$form_id.'_'.$i.'"></label></div></div>';
|
| 3616 |
-
}
|
| 3617 |
-
|
| 3618 |
-
$rep ='<div type="type_scale_rating" class="wdform-field"><div class="wdform-label-section '.$param['w_class'].'" style="'.$param['w_field_label_pos1'].' width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 3619 |
-
if($required) {
|
| 3620 |
-
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 3621 |
-
}
|
| 3622 |
-
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].'"><div id="wdform_'.$id1.'_element'.$form_id.'" style="float: left;" '.$param['attributes'].'><label class="mini_label">'.$w_mini_labels[0].'</label><div style="display: inline-table; vertical-align: middle;border-spacing: 7px;"><div style="display: table-row;">'.$numbers.'</div><div style="display: table-row;">'.$radio_buttons.'</div></div><label class="mini_label" >'.$w_mini_labels[1].'</label></div></div></div>';
|
| 3623 |
-
if($required) {
|
| 3624 |
-
$check_js.='
|
| 3625 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 3626 |
-
{
|
| 3627 |
-
if(x.find(jQuery("div[wdid='.$id1.'] input:checked")).length == 0)
|
| 3628 |
-
{
|
| 3629 |
-
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 3630 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 3631 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 3632 |
-
|
| 3633 |
-
return false;
|
| 3634 |
-
}
|
| 3635 |
-
}
|
| 3636 |
-
';
|
| 3637 |
-
}
|
| 3638 |
-
$onsubmit_js.='
|
| 3639 |
-
jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_scale_amount'.$form_id.'\" value = \"'.$param['w_scale_amount'].'\" />").appendTo("#form'.$form_id.'");
|
| 3640 |
-
';
|
| 3641 |
-
break;
|
| 3642 |
-
}
|
| 3643 |
-
|
| 3644 |
-
case 'type_spinner': {
|
| 3645 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_field_width','w_field_min_value','w_field_max_value', 'w_field_step', 'w_field_value', 'w_required','w_class');
|
| 3646 |
-
$temp=$params;
|
| 3647 |
-
foreach($params_names as $params_name ) {
|
| 3648 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 3649 |
-
$param[$params_name] = $temp[0];
|
| 3650 |
-
$temp=$temp[1];
|
| 3651 |
-
}
|
| 3652 |
-
if($temp) {
|
| 3653 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 3654 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 3655 |
-
foreach($attrs as $attr) {
|
| 3656 |
-
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 3657 |
-
}
|
| 3658 |
-
}
|
| 3659 |
-
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 3660 |
-
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 3661 |
-
$required = ($param['w_required']=="yes" ? true : false);
|
| 3662 |
-
$param['w_field_value']=(isset($_POST['wdform_'.$id1.'_element'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element'.$form_id])) : $param['w_field_value']);
|
| 3663 |
-
|
| 3664 |
-
$rep ='<div type="type_spinner" class="wdform-field"><div class="wdform-label-section '.$param['w_class'].'" style="'.$param['w_field_label_pos1'].' width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 3665 |
-
if($required) {
|
| 3666 |
-
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 3667 |
-
}
|
| 3668 |
-
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].'"><input type="text" value="'.($param['w_field_value']!= 'null' ? $param['w_field_value'] : '').'" name="wdform_'.$id1.'_element'.$form_id.'" id="wdform_'.$id1.'_element'.$form_id.'" style="width: '.$param['w_field_width'].'px;" '.$param['attributes'].'></div></div>';
|
| 3669 |
-
$onload_js .='
|
| 3670 |
-
jQuery("#form'.$form_id.' #wdform_'.$id1.'_element'.$form_id.'")[0].spin = null;
|
| 3671 |
-
spinner = jQuery("#form'.$form_id.' #wdform_'.$id1.'_element'.$form_id.'").spinner();
|
| 3672 |
-
spinner.spinner( "value", "'.($param['w_field_value']!= 'null' ? $param['w_field_value'] : '').'");
|
| 3673 |
-
jQuery("#form'.$form_id.' #wdform_'.$id1.'_element'.$form_id.'").spinner({ min: "'.$param['w_field_min_value'].'"});
|
| 3674 |
-
jQuery("#form'.$form_id.' #wdform_'.$id1.'_element'.$form_id.'").spinner({ max: "'.$param['w_field_max_value'].'"});
|
| 3675 |
-
jQuery("#form'.$form_id.' #wdform_'.$id1.'_element'.$form_id.'").spinner({ step: "'.$param['w_field_step'].'"});
|
| 3676 |
-
';
|
| 3677 |
-
|
| 3678 |
-
if($required) {
|
| 3679 |
-
$check_js.='
|
| 3680 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 3681 |
-
{
|
| 3682 |
-
if(jQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="")
|
| 3683 |
-
{
|
| 3684 |
-
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 3685 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'").addClass( "form-error" );
|
| 3686 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 3687 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 3688 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'").focus();
|
| 3689 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'").change(function() { if( jQuery(this).val()!="" ) jQuery(this).removeClass("form-error"); else jQuery(this).addClass("form-error");});
|
| 3690 |
-
return false;
|
| 3691 |
-
}
|
| 3692 |
-
}
|
| 3693 |
-
';
|
| 3694 |
-
}
|
| 3695 |
-
break;
|
| 3696 |
-
}
|
| 3697 |
-
|
| 3698 |
-
case 'type_slider': {
|
| 3699 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_field_width','w_field_min_value','w_field_max_value', 'w_field_value', 'w_required','w_class');
|
| 3700 |
-
$temp=$params;
|
| 3701 |
-
foreach($params_names as $params_name ) {
|
| 3702 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 3703 |
-
$param[$params_name] = $temp[0];
|
| 3704 |
-
$temp=$temp[1];
|
| 3705 |
-
}
|
| 3706 |
-
if($temp) {
|
| 3707 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 3708 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 3709 |
-
foreach($attrs as $attr) {
|
| 3710 |
-
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 3711 |
-
}
|
| 3712 |
-
}
|
| 3713 |
-
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 3714 |
-
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 3715 |
-
$required = ($param['w_required']=="yes" ? true : false);
|
| 3716 |
-
$param['w_field_value']=(isset($_POST['wdform_'.$id1.'_slider_value'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_slider_value'.$form_id])) : $param['w_field_value']);
|
| 3717 |
-
|
| 3718 |
-
$rep ='<div type="type_slider" class="wdform-field"><div class="wdform-label-section '.$param['w_class'].'" style="'.$param['w_field_label_pos1'].' width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 3719 |
-
if($required) {
|
| 3720 |
-
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 3721 |
-
}
|
| 3722 |
-
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].'"><input type="hidden" value="'.$param['w_field_value'].'" id="wdform_'.$id1.'_slider_value'.$form_id.'" name="wdform_'.$id1.'_slider_value'.$form_id.'"><div name="'.$id1.'_element'.$form_id.'" id="wdform_'.$id1.'_element'.$form_id.'" style="width: '.$param['w_field_width'].'px;" '.$param['attributes'].'"></div><div align="left" style="display: inline-block; width: 33.3%; text-align: left;"><span id="wdform_'.$id1.'_element_min'.$form_id.'" class="label">'.$param['w_field_min_value'].'</span></div><div align="right" style="display: inline-block; width: 33.3%; text-align: center;"><span id="wdform_'.$id1.'_element_value'.$form_id.'" class="label">'.$param['w_field_value'].'</span></div><div align="right" style="display: inline-block; width: 33.3%; text-align: right;"><span id="wdform_'.$id1.'_element_max'.$form_id.'" class="label">'.$param['w_field_max_value'].'</span></div></div></div>';
|
| 3723 |
-
$onload_js .='
|
| 3724 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'")[0].slide = null;
|
| 3725 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'").slider({
|
| 3726 |
-
range: "min",
|
| 3727 |
-
value: eval('.$param['w_field_value'].'),
|
| 3728 |
-
min: eval('.$param['w_field_min_value'].'),
|
| 3729 |
-
max: eval('.$param['w_field_max_value'].'),
|
| 3730 |
-
slide: function( event, ui ) {
|
| 3731 |
-
|
| 3732 |
-
jQuery("#wdform_'.$id1.'_element_value'.$form_id.'").html("" + ui.value);
|
| 3733 |
-
jQuery("#wdform_'.$id1.'_slider_value'.$form_id.'").val("" + ui.value);
|
| 3734 |
-
|
| 3735 |
-
}
|
| 3736 |
-
});
|
| 3737 |
-
';
|
| 3738 |
-
if($required) {
|
| 3739 |
-
$check_js.='
|
| 3740 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 3741 |
-
{
|
| 3742 |
-
if(jQuery("#wdform_'.$id1.'_slider_value'.$form_id.'").val()=='.$param['w_field_min_value'].')
|
| 3743 |
-
{
|
| 3744 |
-
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 3745 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 3746 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 3747 |
-
return false;
|
| 3748 |
-
}
|
| 3749 |
-
}
|
| 3750 |
-
';
|
| 3751 |
-
}
|
| 3752 |
-
break;
|
| 3753 |
-
}
|
| 3754 |
-
|
| 3755 |
-
case 'type_range': {
|
| 3756 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_field_range_width','w_field_range_step','w_field_value1', 'w_field_value2', 'w_mini_labels', 'w_required','w_class');
|
| 3757 |
-
$temp=$params;
|
| 3758 |
-
foreach($params_names as $params_name ) {
|
| 3759 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 3760 |
-
$param[$params_name] = $temp[0];
|
| 3761 |
-
$temp=$temp[1];
|
| 3762 |
-
}
|
| 3763 |
-
if($temp) {
|
| 3764 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 3765 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 3766 |
-
foreach($attrs as $attr) {
|
| 3767 |
-
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 3768 |
-
}
|
| 3769 |
-
}
|
| 3770 |
-
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 3771 |
-
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 3772 |
-
$required = ($param['w_required']=="yes" ? true : false);
|
| 3773 |
-
$param['w_field_value1']=(isset($_POST['wdform_'.$id1.'_element'.$form_id.'0']) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element'.$form_id.'0'])) : $param['w_field_value1']);
|
| 3774 |
-
$param['w_field_value2']=(isset($_POST['wdform_'.$id1.'_element'.$form_id.'1']) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element'.$form_id.'1'])) : $param['w_field_value2']);
|
| 3775 |
-
|
| 3776 |
-
$w_mini_labels = explode('***',$param['w_mini_labels']);
|
| 3777 |
-
$rep ='<div type="type_range" class="wdform-field"><div class="wdform-label-section '.$param['w_class'].'" style="'.$param['w_field_label_pos1'].' width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 3778 |
-
if($required) {
|
| 3779 |
-
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 3780 |
-
}
|
| 3781 |
-
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].'"><div style="display: table;"><div style="display: table-row;"><div valign="middle" align="left" style="display: table-cell;"><input type="text" value="'.($param['w_field_value1']!= 'null' ? $param['w_field_value1'] : '').'" name="wdform_'.$id1.'_element'.$form_id.'0" id="wdform_'.$id1.'_element'.$form_id.'0" style="width: '.$param['w_field_range_width'].'px;" '.$param['attributes'].'></div><div valign="middle" align="left" style="display: table-cell; padding-left: 4px;"><input type="text" value="'.($param['w_field_value2']!= 'null' ? $param['w_field_value2'] : '').'" name="wdform_'.$id1.'_element'.$form_id.'1" id="wdform_'.$id1.'_element'.$form_id.'1" style="width: '.$param['w_field_range_width'].'px;" '.$param['attributes'].'></div></div><div style="display: table-row;"><div valign="top" align="left" style="display: table-cell;"><label class="mini_label" id="wdform_'.$id1.'_mini_label_from">'.$w_mini_labels[0].'</label></div><div valign="top" align="left" style="display: table-cell;"><label class="mini_label" id="wdform_'.$id1.'_mini_label_to">'.$w_mini_labels[1].'</label></div></div></div></div></div>';
|
| 3782 |
-
$onload_js .='
|
| 3783 |
-
jQuery("#form'.$form_id.' #wdform_'.$id1.'_element'.$form_id.'0")[0].spin = null;
|
| 3784 |
-
jQuery("#form'.$form_id.' #wdform_'.$id1.'_element'.$form_id.'1")[0].spin = null;
|
| 3785 |
-
|
| 3786 |
-
spinner0 = jQuery("#form'.$form_id.' #wdform_'.$id1.'_element'.$form_id.'0").spinner();
|
| 3787 |
-
spinner0.spinner( "value", "'.($param['w_field_value1']!= 'null' ? $param['w_field_value1'] : '').'");
|
| 3788 |
-
jQuery("#form'.$form_id.' #wdform_'.$id1.'_element'.$form_id.'").spinner({ step: '.$param['w_field_range_step'].'});
|
| 3789 |
-
|
| 3790 |
-
spinner1 = jQuery("#form'.$form_id.' #wdform_'.$id1.'_element'.$form_id.'1").spinner();
|
| 3791 |
-
spinner1.spinner( "value", "'.($param['w_field_value2']!= 'null' ? $param['w_field_value2'] : '').'");
|
| 3792 |
-
jQuery("#form'.$form_id.' #wdform_'.$id1.'_element'.$form_id.'").spinner({ step: '.$param['w_field_range_step'].'});
|
| 3793 |
-
';
|
| 3794 |
-
|
| 3795 |
-
if($required) {
|
| 3796 |
-
$check_js.='
|
| 3797 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 3798 |
-
{
|
| 3799 |
-
if(jQuery("#wdform_'.$id1.'_element'.$form_id.'0").val()=="" || jQuery("#wdform_'.$id1.'_element'.$form_id.'1").val()=="")
|
| 3800 |
-
{
|
| 3801 |
-
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 3802 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 3803 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 3804 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'0").focus();
|
| 3805 |
-
return false;
|
| 3806 |
-
}
|
| 3807 |
-
}
|
| 3808 |
-
';
|
| 3809 |
-
}
|
| 3810 |
-
break;
|
| 3811 |
-
}
|
| 3812 |
-
|
| 3813 |
-
case 'type_grading': {
|
| 3814 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_items', 'w_total', 'w_required','w_class');
|
| 3815 |
-
$temp=$params;
|
| 3816 |
-
foreach($params_names as $params_name ) {
|
| 3817 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 3818 |
-
$param[$params_name] = $temp[0];
|
| 3819 |
-
$temp=$temp[1];
|
| 3820 |
-
}
|
| 3821 |
-
if($temp) {
|
| 3822 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 3823 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 3824 |
-
foreach($attrs as $attr) {
|
| 3825 |
-
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 3826 |
-
}
|
| 3827 |
-
}
|
| 3828 |
-
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 3829 |
-
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 3830 |
-
$required = ($param['w_required']=="yes" ? true : false);
|
| 3831 |
-
|
| 3832 |
-
$w_items = explode('***',$param['w_items']);
|
| 3833 |
-
$required_check='true';
|
| 3834 |
-
$w_items_labels =implode(':',$w_items);
|
| 3835 |
-
$grading_items ='';
|
| 3836 |
-
|
| 3837 |
-
for($i=0; $i<count($w_items); $i++) {
|
| 3838 |
-
$value=(isset($_POST['wdform_'.$id1.'_element'.$form_id.'_'.$i]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element'.$form_id.'_'.$i])) : '');
|
| 3839 |
-
$grading_items .= '<div class="wdform_grading"><input type="text" id="wdform_'.$id1.'_element'.$form_id.'_'.$i.'" name="wdform_'.$id1.'_element'.$form_id.'_'.$i.'" value="'.$value.'" '.$param['attributes'].'><label class="wdform-ch-rad-label" for="wdform_'.$id1.'_element'.$form_id.'_'.$i.'">'.$w_items[$i].'</label></div>';
|
| 3840 |
-
$required_check.=' && jQuery("#wdform_'.$id1.'_element'.$form_id.'_'.$i.'").val()==""';
|
| 3841 |
-
}
|
| 3842 |
-
$rep ='<div type="type_grading" class="wdform-field"><div class="wdform-label-section '.$param['w_class'].'" style="'.$param['w_field_label_pos1'].' width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 3843 |
-
if($required) {
|
| 3844 |
-
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 3845 |
-
}
|
| 3846 |
-
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].'"><input type="hidden" value="'.$param['w_total'].'" name="wdform_'.$id1.'_grading_total'.$form_id.'" id="wdform_'.$id1.'_grading_total'.$form_id.'"><div id="wdform_'.$id1.'_element'.$form_id.'">'.$grading_items.'<div id="wdform_'.$id1.'_element_total_div'.$form_id.'" class="grading_div">Total: <span id="wdform_'.$id1.'_sum_element'.$form_id.'">0</span>/<span id="wdform_'.$id1.'_total_element'.$form_id.'">'.$param['w_total'].'</span><span id="wdform_'.$id1.'_text_element'.$form_id.'"></span></div></div></div></div>';
|
| 3847 |
-
$onload_js.='
|
| 3848 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.' input").change(function() {sum_grading_values("wdform_'.$id1.'",'.$form_id.');});';
|
| 3849 |
-
$onload_js.='
|
| 3850 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.' input").keyup(function() {sum_grading_values("wdform_'.$id1.'",'.$form_id.');});';
|
| 3851 |
-
$onload_js.='
|
| 3852 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.' input").keyup(function() {sum_grading_values("wdform_'.$id1.'",'.$form_id.');});';
|
| 3853 |
-
$onload_js.='
|
| 3854 |
-
sum_grading_values("wdform_'.$id1.'",'.$form_id.');';
|
| 3855 |
-
if($required) {
|
| 3856 |
-
$check_js.='
|
| 3857 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 3858 |
-
{
|
| 3859 |
-
if('.$required_check.')
|
| 3860 |
-
{
|
| 3861 |
-
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 3862 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 3863 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 3864 |
-
jQuery("#wdform_'.$id1.'_element'.$form_id.'0").focus();
|
| 3865 |
-
return false;
|
| 3866 |
-
}
|
| 3867 |
-
}
|
| 3868 |
-
';
|
| 3869 |
-
}
|
| 3870 |
-
$check_js.='
|
| 3871 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 3872 |
-
{
|
| 3873 |
-
if(parseInt(jQuery("#wdform_'.$id1.'_sum_element'.$form_id.'").html()) > '.$param['w_total'].')
|
| 3874 |
-
{
|
| 3875 |
-
alert("' . addslashes(__("Your score should be less than", 'form_maker')) . $param['w_total'] . '");
|
| 3876 |
-
return false;
|
| 3877 |
-
}
|
| 3878 |
-
}
|
| 3879 |
-
';
|
| 3880 |
-
|
| 3881 |
-
$onsubmit_js.='
|
| 3882 |
-
jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_hidden_item'.$form_id.'\" value = \"'.$w_items_labels.':'.$param['w_total'].'\" />").appendTo("#form'.$form_id.'");
|
| 3883 |
-
';
|
| 3884 |
-
break;
|
| 3885 |
-
}
|
| 3886 |
-
case 'type_matrix': {
|
| 3887 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_field_input_type', 'w_rows', 'w_columns', 'w_required','w_class','w_textbox_size');
|
| 3888 |
-
$temp=$params;
|
| 3889 |
-
foreach($params_names as $params_name ) {
|
| 3890 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 3891 |
-
$param[$params_name] = $temp[0];
|
| 3892 |
-
$temp=$temp[1];
|
| 3893 |
-
}
|
| 3894 |
-
if($temp) {
|
| 3895 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 3896 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 3897 |
-
foreach($attrs as $attr) {
|
| 3898 |
-
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 3899 |
-
}
|
| 3900 |
-
}
|
| 3901 |
-
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 3902 |
-
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 3903 |
-
$required = ($param['w_required']=="yes" ? true : false);
|
| 3904 |
-
$param['w_textbox_size'] = isset($param['w_textbox_size']) ? $param['w_textbox_size'] : '120';
|
| 3905 |
-
$w_rows = explode('***',$param['w_rows']);
|
| 3906 |
-
$w_columns = explode('***',$param['w_columns']);
|
| 3907 |
-
$column_labels ='';
|
| 3908 |
-
|
| 3909 |
-
for($i=1; $i<count($w_columns); $i++) {
|
| 3910 |
-
$column_labels .= '<div><label class="wdform-ch-rad-label">'.$w_columns[$i].'</label></div>';
|
| 3911 |
-
}
|
| 3912 |
-
$rows_columns = '';
|
| 3913 |
-
for($i=1; $i<count($w_rows); $i++) {
|
| 3914 |
-
$rows_columns .= '<div class="wdform-matrix-row'.($i%2).'" row="'.$i.'"><div class="wdform-matrix-column"><label class="wdform-ch-rad-label" >'.$w_rows[$i].'</label></div>';
|
| 3915 |
-
for($k=1; $k<count($w_columns); $k++) {
|
| 3916 |
-
$rows_columns .= '<div class="wdform-matrix-cell">';
|
| 3917 |
-
if($param['w_field_input_type']=='radio') {
|
| 3918 |
-
$to_check=0;
|
| 3919 |
-
$post_value = isset($_POST['wdform_'.$id1.'_input_element'.$form_id.''.$i]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_input_element'.$form_id.''.$i])) : NULL;
|
| 3920 |
-
if(isset($post_value)) {
|
| 3921 |
-
$to_check=$post_value;
|
| 3922 |
-
}
|
| 3923 |
-
$rows_columns .= '<div class="radio-div"><input id="wdform_'.$id1.'_input_element'.$form_id.''.$i.'_'.$k.'" type="radio" name="wdform_'.$id1.'_input_element'.$form_id.''.$i.'" value="'.$i.'_'.$k.'" '.($to_check==$i.'_'.$k ? 'checked="checked"' : '').'><label for="wdform_'.$id1.'_input_element'.$form_id.''.$i.'_'.$k.'"></label></div>';
|
| 3924 |
-
}
|
| 3925 |
-
else {
|
| 3926 |
-
if($param['w_field_input_type']=='checkbox') {
|
| 3927 |
-
$to_check=0;
|
| 3928 |
-
$post_value = isset($_POST['wdform_'.$id1.'_input_element'.$form_id.''.$i.'_'.$k]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_input_element'.$form_id.''.$i.'_'.$k])) : NULL;
|
| 3929 |
-
if(isset($post_value)) {
|
| 3930 |
-
$to_check=$post_value;
|
| 3931 |
-
}
|
| 3932 |
-
$rows_columns .= '<div class="checkbox-div"><input id="wdform_'.$id1.'_input_element'.$form_id.''.$i.'_'.$k.'" type="checkbox" name="wdform_'.$id1.'_input_element'.$form_id.''.$i.'_'.$k.'" value="1" '.($to_check=="1" ? 'checked="checked"' : '').'><label for="wdform_'.$id1.'_input_element'.$form_id.''.$i.'_'.$k.'"></label></div>';
|
| 3933 |
-
}
|
| 3934 |
-
else {
|
| 3935 |
-
if($param['w_field_input_type']=='text') {
|
| 3936 |
-
$rows_columns .= '<input id="wdform_'.$id1.'_input_element'.$form_id.''.$i.'_'.$k.'" type="text" name="wdform_'.$id1.'_input_element'.$form_id.''.$i.'_'.$k.'" value="'.(isset($_POST['wdform_'.$id1.'_input_element'.$form_id.''.$i.'_'.$k]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_input_element'.$form_id.''.$i.'_'.$k])) : "").'" style="width:'.$param['w_textbox_size'].'px">';
|
| 3937 |
-
}
|
| 3938 |
-
else {
|
| 3939 |
-
if($param['w_field_input_type']=='select') {
|
| 3940 |
-
$rows_columns .= '<select id="wdform_'.$id1.'_select_yes_no'.$form_id.''.$i.'_'.$k.'" name="wdform_'.$id1.'_select_yes_no'.$form_id.''.$i.'_'.$k.'" ><option value="" '.(isset($_POST['wdform_'.$id1.'_select_yes_no'.$form_id.''.$i.'_'.$k]) && esc_html($_POST['wdform_'.$id1.'_select_yes_no'.$form_id.''.$i.'_'.$k]) == "" ? "selected=\"selected\"": "").'> </option><option value="yes" '.(isset($_POST['wdform_'.$id1.'_select_yes_no'.$form_id.''.$i.'_'.$k]) && esc_html($_POST['wdform_'.$id1.'_select_yes_no'.$form_id.''.$i.'_'.$k]) == "yes" ? "selected=\"selected\"": "").'>Yes</option><option value="no" '.(isset($_POST['wdform_'.$id1.'_select_yes_no'.$form_id.''.$i.'_'.$k]) && esc_html($_POST['wdform_'.$id1.'_select_yes_no'.$form_id.''.$i.'_'.$k]) == "no" ? "selected=\"selected\"": "").'>No</option></select>';
|
| 3941 |
-
}
|
| 3942 |
-
}
|
| 3943 |
-
}
|
| 3944 |
-
}
|
| 3945 |
-
$rows_columns.='</div>';
|
| 3946 |
-
}
|
| 3947 |
-
$rows_columns .= '</div>';
|
| 3948 |
-
}
|
| 3949 |
-
|
| 3950 |
-
$rep ='<div type="type_matrix" class="wdform-field"><div class="wdform-label-section '.$param['w_class'].'" style="'.$param['w_field_label_pos1'].' width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 3951 |
-
if($required) {
|
| 3952 |
-
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 3953 |
-
}
|
| 3954 |
-
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].'"><div id="wdform_'.$id1.'_element'.$form_id.'" class="wdform-matrix-table" '.$param['attributes'].'><div style="display: table-row-group;"><div class="wdform-matrix-head"><div style="display: table-cell;"></div>'.$column_labels.'</div>'.$rows_columns.'</div></div></div></div>';
|
| 3955 |
-
$onsubmit_js.='
|
| 3956 |
-
jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_input_type'.$form_id.'\" value = \"'.$param['w_field_input_type'].'\" /><input type=\"hidden\" name=\"wdform_'.$id1.'_hidden_row'.$form_id.'\" value = \"'.addslashes($param['w_rows']).'\" /><input type=\"hidden\" name=\"wdform_'.$id1.'_hidden_column'.$form_id.'\" value = \"'.addslashes($param['w_columns']).'\" />").appendTo("#form'.$form_id.'");
|
| 3957 |
-
';
|
| 3958 |
-
if($required) {
|
| 3959 |
-
if($param['w_field_input_type']=='radio') {
|
| 3960 |
-
$check_js.='
|
| 3961 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 3962 |
-
{
|
| 3963 |
-
var radio_checked=true;
|
| 3964 |
-
for(var k=1; k<'.count($w_rows).';k++)
|
| 3965 |
-
{
|
| 3966 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).find(jQuery("div[row="+k+"]")).find(jQuery("input[type=\'radio\']:checked")).length == 0)
|
| 3967 |
-
{
|
| 3968 |
-
radio_checked=false;
|
| 3969 |
-
break;
|
| 3970 |
-
}
|
| 3971 |
-
}
|
| 3972 |
-
|
| 3973 |
-
if(radio_checked==false)
|
| 3974 |
-
{
|
| 3975 |
-
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 3976 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 3977 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 3978 |
-
return false;
|
| 3979 |
-
}
|
| 3980 |
-
}
|
| 3981 |
-
';
|
| 3982 |
-
}
|
| 3983 |
-
if($param['w_field_input_type']=='checkbox') {
|
| 3984 |
-
$check_js.='
|
| 3985 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 3986 |
-
{
|
| 3987 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).find(jQuery("input[type=\'checkbox\']:checked")).length == 0)
|
| 3988 |
-
{
|
| 3989 |
-
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 3990 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 3991 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 3992 |
-
return false;
|
| 3993 |
-
}
|
| 3994 |
-
}
|
| 3995 |
-
|
| 3996 |
-
';
|
| 3997 |
-
}
|
| 3998 |
-
if($param['w_field_input_type']=='text') {
|
| 3999 |
-
$check_js.='
|
| 4000 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 4001 |
-
{
|
| 4002 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).find(jQuery("input[type=\'text\']")).filter(function() {return this.value.length !== 0;}).length == 0)
|
| 4003 |
-
{
|
| 4004 |
-
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 4005 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 4006 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 4007 |
-
return false;
|
| 4008 |
-
}
|
| 4009 |
-
}
|
| 4010 |
-
';
|
| 4011 |
-
}
|
| 4012 |
-
|
| 4013 |
-
if($param['w_field_input_type']=='select') {
|
| 4014 |
-
$check_js.='
|
| 4015 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 4016 |
-
{
|
| 4017 |
-
if(x.find(jQuery("div[wdid='.$id1.']")).find(jQuery("select")).filter(function() {return this.value.length !== 0;}).length == 0)
|
| 4018 |
-
{
|
| 4019 |
-
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 4020 |
-
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 4021 |
-
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 4022 |
-
return false;
|
| 4023 |
-
}
|
| 4024 |
-
}
|
| 4025 |
-
|
| 4026 |
-
';
|
| 4027 |
-
}
|
| 4028 |
-
}
|
| 4029 |
-
break;
|
| 4030 |
-
}
|
| 4031 |
-
|
| 4032 |
-
case 'type_paypal_total': {
|
| 4033 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_class');
|
| 4034 |
-
$temp=$params;
|
| 4035 |
-
foreach($params_names as $params_name ) {
|
| 4036 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 4037 |
-
$param[$params_name] = $temp[0];
|
| 4038 |
-
$temp=$temp[1];
|
| 4039 |
-
}
|
| 4040 |
-
if($temp) {
|
| 4041 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 4042 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
| 4043 |
-
foreach($attrs as $attr) {
|
| 4044 |
-
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 4045 |
-
}
|
| 4046 |
-
}
|
| 4047 |
-
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 4048 |
-
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 4049 |
-
$rep ='<div type="type_paypal_total" class="wdform-field"><div class="wdform-label-section '.$param['w_class'].'" style="'.$param['w_field_label_pos1'].' width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 4050 |
-
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].'"><div id="wdform_'.$id1.'paypal_total'.$form_id.'" class="wdform_paypal_total paypal_total'.$form_id.'"><input type="hidden" value="" name="wdform_'.$id1.'_paypal_total'.$form_id.'" class="input_paypal_total'.$form_id.'"><div id="wdform_'.$id1.'div_total'.$form_id.'" class="div_total'.$form_id.'" style="margin-bottom: 10px;"></div><div id="wdform_'.$id1.'paypal_products'.$form_id.'" class="paypal_products'.$form_id.'" style="border-spacing: 2px;"><div style="border-spacing: 2px;"></div><div style="border-spacing: 2px;"></div></div><div id="wdform_'.$id1.'paypal_tax'.$form_id.'" class="paypal_tax'.$form_id.'" style="border-spacing: 2px; margin-top: 7px;"></div></div></div></div>';
|
| 4051 |
-
$onload_js .='set_total_value('.$form_id.');';
|
| 4052 |
-
break;
|
| 4053 |
-
}
|
| 4054 |
-
}
|
| 4055 |
-
$form=str_replace('%'.$id1.' - '.$labels[$id1s_key].'%', $rep, $form);
|
| 4056 |
-
$form=str_replace('%'.$id1.' -'.$labels[$id1s_key].'%', $rep, $form);
|
| 4057 |
-
}
|
| 4058 |
-
}
|
| 4059 |
-
|
| 4060 |
-
$onsubmit_js.='
|
| 4061 |
-
var disabled_fields ="";
|
| 4062 |
-
jQuery("div[wdid]").each(function() {
|
| 4063 |
-
if(jQuery(this).css("display")=="none")
|
| 4064 |
-
{
|
| 4065 |
-
disabled_fields += jQuery(this).attr("wdid");
|
| 4066 |
-
disabled_fields += ",";
|
| 4067 |
-
}
|
| 4068 |
-
|
| 4069 |
-
if(disabled_fields)
|
| 4070 |
-
jQuery("<input type=\"hidden\" name=\"disabled_fields'.$form_id.'\" value =\""+disabled_fields+"\" />").appendTo("#form'.$form_id.'");
|
| 4071 |
-
|
| 4072 |
-
})';
|
| 4073 |
-
|
| 4074 |
-
$rep1=array('form_id_temp');
|
| 4075 |
-
$rep2=array($id);
|
| 4076 |
-
|
| 4077 |
-
$form = str_replace($rep1,$rep2,$form);
|
| 4078 |
-
|
| 4079 |
-
$form_maker_front_end .= $form;
|
| 4080 |
-
$form_maker_front_end .= '<div class="wdform_preload"></div>';
|
| 4081 |
-
$form_maker_front_end .= '</form>';
|
| 4082 |
-
?>
|
| 4083 |
-
<script type="text/javascript">
|
| 4084 |
-
var plugin_url = "<?php echo WD_FMC_URL; ?>";
|
| 4085 |
-
WDF_GRADING_TEXT ='<?php echo addslashes(__("Your score should be less than", 'form_maker')); ?>';
|
| 4086 |
-
WDF_INVALID_GRADING_<?php echo $id; ?> = '<?php echo addslashes(sprintf(__("Your score should be less than", 'form_maker'), '`grading_label`', '`grading_total`')); ?>';
|
| 4087 |
-
FormCurrency_<?php echo $id; ?> = '<?php echo $form_currency ?>';
|
| 4088 |
-
FormPaypalTax_<?php echo $id; ?> = '<?php echo $form_paypal_tax ?>';
|
| 4089 |
-
|
| 4090 |
-
function formOnload<?php echo $id; ?>() {
|
| 4091 |
-
if (navigator.userAgent.toLowerCase().indexOf('msie') != -1 && parseInt(navigator.userAgent.toLowerCase().split('msie')[1]) === 8) {
|
| 4092 |
-
jQuery("#form<?php echo $id; ?>").find(jQuery("input[type='radio']")).click(function() {jQuery("input[type='radio']+label").removeClass('if-ie-div-label'); jQuery("input[type='radio']:checked+label").addClass('if-ie-div-label')});
|
| 4093 |
-
jQuery("#form<?php echo $id; ?>").find(jQuery("input[type='radio']:checked+label")).addClass('if-ie-div-label');
|
| 4094 |
-
jQuery("#form<?php echo $id; ?>").find(jQuery("input[type='checkbox']")).click(function() {jQuery("input[type='checkbox']+label").removeClass('if-ie-div-label'); jQuery("input[type='checkbox']:checked+label").addClass('if-ie-div-label')});
|
| 4095 |
-
jQuery("#form<?php echo $id; ?>").find(jQuery("input[type='checkbox']:checked+label")).addClass('if-ie-div-label');
|
| 4096 |
-
}
|
| 4097 |
-
|
| 4098 |
-
jQuery("div[type='type_text'] input, div[type='type_number'] input, div[type='type_phone'] input, div[type='type_name'] input, div[type='type_submitter_mail'] input, div[type='type_paypal_price'] input, div[type='type_textarea'] textarea").focus(function() {delete_value(this)}).blur(function() {return_value(this)});
|
| 4099 |
-
jQuery("div[type='type_number'] input, div[type='type_phone'] input, div[type='type_spinner'] input, div[type='type_range'] input, .wdform-quantity").keypress(function(evt) {return check_isnum(evt)});
|
| 4100 |
-
|
| 4101 |
-
jQuery("div[type='type_grading'] input").keypress(function(evt) {return check_isnum_or_minus(evt)});
|
| 4102 |
-
|
| 4103 |
-
jQuery("div[type='type_paypal_checkbox'] input[type='checkbox'], div[type='type_paypal_radio'] input[type='radio'], div[type='type_paypal_shipping'] input[type='radio']").click(function() {set_total_value(<?php echo $form_id; ?>)});
|
| 4104 |
-
jQuery("div[type='type_paypal_select'] select, div[type='type_paypal_price'] input").change(function() {set_total_value(<?php echo $form_id; ?>)});
|
| 4105 |
-
jQuery(".wdform-quantity").change(function() {set_total_value(<?php echo $form_id; ?>)});
|
| 4106 |
-
|
| 4107 |
-
jQuery("div[type='type_address'] select").change(function() {set_total_value(<?php echo $form_id; ?>)});
|
| 4108 |
-
|
| 4109 |
-
jQuery("div[type='type_time'] input").blur(function() {add_0(this)});
|
| 4110 |
-
|
| 4111 |
-
jQuery('.wdform-element-section').each(function() {
|
| 4112 |
-
if(!jQuery(this).parent()[0].style.width && parseInt(jQuery(this).width())!=0)
|
| 4113 |
-
{
|
| 4114 |
-
|
| 4115 |
-
if(jQuery(this).css('display')=="table-cell")
|
| 4116 |
-
{
|
| 4117 |
-
if(jQuery(this).parent().attr('type')!="type_captcha")
|
| 4118 |
-
jQuery(this).parent().css('width', parseInt(jQuery(this).width()) + parseInt(jQuery(this).parent().find(jQuery(".wdform-label-section"))[0].style.width)+15);
|
| 4119 |
-
else
|
| 4120 |
-
jQuery(this).parent().css('width', (parseInt(jQuery(this).parent().find(jQuery(".captcha_input"))[0].style.width)*2+50) + parseInt(jQuery(this).parent().find(jQuery(".wdform-label-section"))[0].style.width)+15);
|
| 4121 |
-
}
|
| 4122 |
-
}
|
| 4123 |
-
if (!jQuery(this).parent()[0].style.width && parseInt(jQuery(this).width()) != 0) {
|
| 4124 |
-
if (jQuery(this).css('display') == "table-cell") {
|
| 4125 |
-
if (jQuery(this).parent().attr('type') != "type_captcha") {
|
| 4126 |
-
jQuery(this).parent().css('width', parseInt(jQuery(this).width()) + parseInt(jQuery(this).parent().find(jQuery(".wdform-label-section"))[0].style.width)+15);
|
| 4127 |
-
}
|
| 4128 |
-
else {
|
| 4129 |
-
jQuery(this).parent().css('width', (parseInt(jQuery(this).parent().find(jQuery(".captcha_input"))[0].style.width)*2+50) + parseInt(jQuery(this).parent().find(jQuery(".wdform-label-section"))[0].style.width)+15);
|
| 4130 |
-
}
|
| 4131 |
-
}
|
| 4132 |
-
}
|
| 4133 |
-
if(parseInt(jQuery(this)[0].style.width.replace('px', '')) < parseInt(jQuery(this).css('min-width').replace('px', '')))
|
| 4134 |
-
jQuery(this).css('min-width', parseInt(jQuery(this)[0].style.width.replace('px', ''))-10);
|
| 4135 |
-
});
|
| 4136 |
-
|
| 4137 |
-
jQuery('.wdform-label').each(function() {
|
| 4138 |
-
if(parseInt(jQuery(this).height()) >= 2*parseInt(jQuery(this).css('line-height').replace('px', '')))
|
| 4139 |
-
{
|
| 4140 |
-
jQuery(this).parent().css('max-width',jQuery(this).parent().width());
|
| 4141 |
-
jQuery(this).parent().css('width','');
|
| 4142 |
-
}
|
| 4143 |
-
});
|
| 4144 |
-
|
| 4145 |
-
(function(jQuery){
|
| 4146 |
-
jQuery.fn.shuffle = function() {
|
| 4147 |
-
var allElems = this.get(),
|
| 4148 |
-
getRandom = function(max) {
|
| 4149 |
-
return Math.floor(Math.random() * max);
|
| 4150 |
-
},
|
| 4151 |
-
shuffled = jQuery.map(allElems, function(){
|
| 4152 |
-
var random = getRandom(allElems.length),
|
| 4153 |
-
randEl = jQuery(allElems[parseInt(random)]).clone(true)[0];
|
| 4154 |
-
allElems.splice(random, 1);
|
| 4155 |
-
return randEl;
|
| 4156 |
-
});
|
| 4157 |
-
this.each(function(i){
|
| 4158 |
-
jQuery(this).replaceWith(jQuery(shuffled[i]));
|
| 4159 |
-
});
|
| 4160 |
-
return jQuery(shuffled);
|
| 4161 |
-
};
|
| 4162 |
-
})(jQuery);
|
| 4163 |
-
|
| 4164 |
-
<?php echo $onload_js; ?>
|
| 4165 |
-
<?php echo $condition_js; ?>
|
| 4166 |
-
|
| 4167 |
-
if(window.before_load)
|
| 4168 |
-
{
|
| 4169 |
-
before_load();
|
| 4170 |
-
}
|
| 4171 |
-
}
|
| 4172 |
-
|
| 4173 |
-
jQuery(window).load(function () {
|
| 4174 |
-
formOnload<?php echo $id ?>();
|
| 4175 |
-
});
|
| 4176 |
-
|
| 4177 |
-
form_view_count<?php echo $id ?>=0;
|
| 4178 |
-
jQuery(document).ready(function () {
|
| 4179 |
-
for(i=1; i<=30; i++) {
|
| 4180 |
-
if (document.getElementById('<?php echo $id ?>form_view'+i)) {
|
| 4181 |
-
form_view_count<?php echo $id ?>++;
|
| 4182 |
-
form_view_max<?php echo $id ?> = i;
|
| 4183 |
-
}
|
| 4184 |
-
}
|
| 4185 |
-
if (form_view_count<?php echo $id ?> > 1) {
|
| 4186 |
-
for (i = 1; i <= form_view_max<?php echo $id ?>; i++) {
|
| 4187 |
-
if (document.getElementById('<?php echo $id ?>form_view' + i)) {
|
| 4188 |
-
first_form_view<?php echo $id ?> = i;
|
| 4189 |
-
break;
|
| 4190 |
-
}
|
| 4191 |
-
}
|
| 4192 |
-
generate_page_nav(first_form_view<?php echo $id ?>, '<?php echo $id ?>', form_view_count<?php echo $id ?>, form_view_max<?php echo $id ?>);
|
| 4193 |
-
}
|
| 4194 |
-
});
|
| 4195 |
-
function check_required<?php echo $form_id ?>(but_type) {
|
| 4196 |
-
if (but_type == 'reset') {
|
| 4197 |
-
if (window.before_reset) {
|
| 4198 |
-
before_reset();
|
| 4199 |
-
}
|
| 4200 |
-
var types = <?php echo json_encode($types) ?>;
|
| 4201 |
-
var label_ids = <?php echo json_encode($id1s) ?>;
|
| 4202 |
-
jQuery.each(types, function (index, elem) {
|
| 4203 |
-
switch(elem) {
|
| 4204 |
-
case "type_text":
|
| 4205 |
-
case "type_password":
|
| 4206 |
-
case "type_textarea":
|
| 4207 |
-
case "type_number":
|
| 4208 |
-
case "type_submitter_mail":
|
| 4209 |
-
case "type_spinner":
|
| 4210 |
-
case 'type_own_select':
|
| 4211 |
-
case 'type_country':
|
| 4212 |
-
case 'type_date':
|
| 4213 |
-
case 'type_hidden':
|
| 4214 |
-
jQuery("#wdform_"+label_ids[index]+"_element<?php echo $id ?>").val('');
|
| 4215 |
-
break;
|
| 4216 |
-
|
| 4217 |
-
case 'type_send_copy':
|
| 4218 |
-
jQuery("#wdform_"+label_ids[index]+"_element<?php echo $id ?>").prop('checked', false);
|
| 4219 |
-
break;
|
| 4220 |
-
case 'type_phone':
|
| 4221 |
-
jQuery("#wdform_"+label_ids[index]+"_element_first<?php echo $id ?>, #wdform_"+label_ids[index]+"_element_last<?php echo $id ?>").val('');
|
| 4222 |
-
break;
|
| 4223 |
-
|
| 4224 |
-
case 'type_name':
|
| 4225 |
-
jQuery("#wdform_"+label_ids[index]+"_element_first<?php echo $id ?>, #wdform_"+label_ids[index]+"_element_last<?php echo $id ?>, #wdform_"+label_ids[index]+"_element_title<?php echo $id ?>, #wdform_"+label_ids[index]+"_element_middle<?php echo $id ?>").val('');
|
| 4226 |
-
break;
|
| 4227 |
-
|
| 4228 |
-
case 'type_address':
|
| 4229 |
-
jQuery("#wdform_"+label_ids[index]+"_street1<?php echo $id ?>, #wdform_"+label_ids[index]+"_street2<?php echo $id ?>, #wdform_"+label_ids[index]+"_city<?php echo $id ?>, #wdform_"+label_ids[index]+"_state<?php echo $id ?>, #wdform_"+label_ids[index]+"_postal<?php echo $id ?>, #wdform_"+label_ids[index]+"_country<?php echo $id ?>").val('');
|
| 4230 |
-
break;
|
| 4231 |
-
|
| 4232 |
-
case 'type_checkbox':
|
| 4233 |
-
jQuery("#form<?php echo $id ?> div[wdid='"+label_ids[index]+"'] .checkbox-div input").prop('checked', false);
|
| 4234 |
-
jQuery("#wdform_"+label_ids[index]+"_other_br<?php echo $id ?>").remove();
|
| 4235 |
-
jQuery("#wdform_"+label_ids[index]+"_other_input<?php echo $id ?>").remove();
|
| 4236 |
-
break;
|
| 4237 |
-
|
| 4238 |
-
case 'type_radio':
|
| 4239 |
-
jQuery("#form<?php echo $id ?> div[wdid='"+label_ids[index]+"'] .radio-div input").prop('checked', false);
|
| 4240 |
-
jQuery("#wdform_"+label_ids[index]+"_other_br<?php echo $id ?>").remove();
|
| 4241 |
-
jQuery("#wdform_"+label_ids[index]+"_other_input<?php echo $id ?>").remove();
|
| 4242 |
-
break;
|
| 4243 |
-
|
| 4244 |
-
case 'type_time':
|
| 4245 |
-
jQuery("#wdform_"+label_ids[index]+"_hh<?php echo $id ?>, #wdform_"+label_ids[index]+"_mm<?php echo $id ?>, #wdform_"+label_ids[index]+"_ss<?php echo $id ?>, #wdform_"+label_ids[index]+"_am_pm<?php echo $id ?>").val('');
|
| 4246 |
-
break;
|
| 4247 |
-
|
| 4248 |
-
case 'type_date_fields':
|
| 4249 |
-
jQuery("#wdform_"+label_ids[index]+"_day<?php echo $id ?>, #wdform_"+label_ids[index]+"_month<?php echo $id ?>, #wdform_"+label_ids[index]+"_year<?php echo $id ?>").val('');
|
| 4250 |
-
break;
|
| 4251 |
-
|
| 4252 |
-
case 'type_file_upload':
|
| 4253 |
-
jQuery("#wdform_"+label_ids[index]+"_element<?php echo $id ?>_save").remove();
|
| 4254 |
-
break;
|
| 4255 |
-
|
| 4256 |
-
case 'type_paypal_price':
|
| 4257 |
-
jQuery("#wdform_"+label_ids[index]+"_element_dollars<?php echo $id ?>, #wdform_"+label_ids[index]+"_element_cents<?php echo $id ?>").val('');
|
| 4258 |
-
break;
|
| 4259 |
-
|
| 4260 |
-
case 'type_paypal_select':
|
| 4261 |
-
jQuery("#wdform_"+label_ids[index]+"_element<?php echo $id ?>, #wdform_"+label_ids[index]+"_element_quantity<?php echo $id ?>, #form<?php echo $id ?> div[wdid='"+label_ids[index]+"'] .paypal-property select").val('');
|
| 4262 |
-
break;
|
| 4263 |
-
|
| 4264 |
-
case 'type_paypal_radio':
|
| 4265 |
-
jQuery("#wdform_"+label_ids[index]+"_element_quantity<?php echo $id ?>,#form<?php echo $id ?> div[wdid='"+label_ids[index]+"'] .paypal-property select").val('');
|
| 4266 |
-
jQuery("#form<?php echo $id ?> div[wdid='"+label_ids[index]+"'] .radio-div input").prop('checked', false);
|
| 4267 |
-
break;
|
| 4268 |
-
|
| 4269 |
-
case 'type_paypal_shipping':
|
| 4270 |
-
jQuery("#form<?php echo $id ?> div[wdid='"+label_ids[index]+"'] .radio-div input").prop('checked', false);
|
| 4271 |
-
break;
|
| 4272 |
-
|
| 4273 |
-
case 'type_paypal_checkbox':
|
| 4274 |
-
jQuery("#wdform_"+label_ids[index]+"_element_quantity<?php echo $id ?>,#form<?php echo $id ?> div[wdid='"+label_ids[index]+"'] .paypal-property select").val('');
|
| 4275 |
-
jQuery("#form<?php echo $id ?> div[wdid='"+label_ids[index]+"'] .checkbox-div input").prop('checked', false);
|
| 4276 |
-
break;
|
| 4277 |
-
|
| 4278 |
-
case 'type_star_rating':
|
| 4279 |
-
jQuery("#wdform_"+label_ids[index]+"_selected_star_amount<?php echo $id ?>").val('');
|
| 4280 |
-
jQuery("#wdform_"+label_ids[index]+"_element<?php echo $id ?> img").attr('src', plugin_url+'/images/star.png');
|
| 4281 |
-
break;
|
| 4282 |
-
|
| 4283 |
-
case 'type_scale_rating':
|
| 4284 |
-
jQuery("#form<?php echo $id ?> div[wdid='"+label_ids[index]+"'] .radio-div input").prop('checked', false);
|
| 4285 |
-
break;
|
| 4286 |
-
|
| 4287 |
-
case 'type_slider':
|
| 4288 |
-
jQuery("#wdform_"+label_ids[index]+"_element<?php echo $id ?>").slider({
|
| 4289 |
-
value: eval(0),
|
| 4290 |
-
});
|
| 4291 |
-
jQuery("#wdform_"+label_ids[index]+"_element_value<?php echo $id ?>").html('0');
|
| 4292 |
-
break;
|
| 4293 |
-
|
| 4294 |
-
case 'type_range':
|
| 4295 |
-
jQuery("#wdform_"+label_ids[index]+"_element<?php echo $id ?>0, #wdform_"+label_ids[index]+"_element<?php echo $id ?>1").val('');
|
| 4296 |
-
break;
|
| 4297 |
-
|
| 4298 |
-
case 'type_grading':
|
| 4299 |
-
jQuery("#wdform_"+label_ids[index]+"_element<?php echo $id ?> input").val('');
|
| 4300 |
-
break;
|
| 4301 |
-
|
| 4302 |
-
case 'type_matrix':
|
| 4303 |
-
jQuery("#wdform_"+label_ids[index]+"_element<?php echo $id ?> .radio-div input").prop('checked', false);
|
| 4304 |
-
jQuery("#wdform_"+label_ids[index]+"_element<?php echo $id ?> .checkbox-div input").prop('checked', false);
|
| 4305 |
-
jQuery("#wdform_"+label_ids[index]+"_element<?php echo $id ?> input[type='text']").val('');
|
| 4306 |
-
jQuery("#wdform_"+label_ids[index]+"_element<?php echo $id ?> select").val('');
|
| 4307 |
-
break;
|
| 4308 |
-
|
| 4309 |
-
case 'type_paypal_total':
|
| 4310 |
-
jQuery("#wdform_"+label_ids[index]+"div_total<?php echo $id ?>").html('$0');
|
| 4311 |
-
jQuery("#wdform_"+label_ids[index]+"paypal_products<?php echo $id ?>").empty();
|
| 4312 |
-
break;
|
| 4313 |
-
default:
|
| 4314 |
-
break;
|
| 4315 |
-
}
|
| 4316 |
-
});
|
| 4317 |
-
|
| 4318 |
-
return;
|
| 4319 |
-
}
|
| 4320 |
-
if (window.before_submit) {
|
| 4321 |
-
before_submit();
|
| 4322 |
-
}
|
| 4323 |
-
x = jQuery("#form<?php echo $form_id; ?>");
|
| 4324 |
-
<?php echo $check_js; ?>;
|
| 4325 |
-
var a = [];
|
| 4326 |
-
if (typeof a[<?php echo $form_id ?>] !== 'undefined' && a[<?php echo $form_id ?>] == 1) {
|
| 4327 |
-
return;
|
| 4328 |
-
}
|
| 4329 |
-
<?php echo $onsubmit_js; ?>;
|
| 4330 |
-
a[<?php echo $form_id ?>] = 1;
|
| 4331 |
-
document.getElementById("form"+<?php echo $form_id ?>).submit();
|
| 4332 |
-
}
|
| 4333 |
-
function check<?php echo $form_id ?>(id) {
|
| 4334 |
-
x = jQuery("#<?php echo $form_id ?>form_view"+id);
|
| 4335 |
-
<?php echo $check_js; ?>;
|
| 4336 |
-
return true;
|
| 4337 |
-
}
|
| 4338 |
-
</script>
|
| 4339 |
-
<?php
|
| 4340 |
-
}
|
| 4341 |
-
else {
|
| 4342 |
-
$captcha_url = 'components/com_formmaker/wd_captcha.php?digit=';
|
| 4343 |
-
$captcha_rep_url = 'components/com_formmaker/wd_captcha.php?r2=' . mt_rand(0, 1000) . '&digit=';
|
| 4344 |
-
$rep1 = array(
|
| 4345 |
-
"<!--repstart-->Title<!--repend-->",
|
| 4346 |
-
"<!--repstart-->First<!--repend-->",
|
| 4347 |
-
"<!--repstart-->Last<!--repend-->",
|
| 4348 |
-
"<!--repstart-->Middle<!--repend-->",
|
| 4349 |
-
"<!--repstart-->January<!--repend-->",
|
| 4350 |
-
"<!--repstart-->February<!--repend-->",
|
| 4351 |
-
"<!--repstart-->March<!--repend-->",
|
| 4352 |
-
"<!--repstart-->April<!--repend-->",
|
| 4353 |
-
"<!--repstart-->May<!--repend-->",
|
| 4354 |
-
"<!--repstart-->June<!--repend-->",
|
| 4355 |
-
"<!--repstart-->July<!--repend-->",
|
| 4356 |
-
"<!--repstart-->August<!--repend-->",
|
| 4357 |
-
"<!--repstart-->September<!--repend-->",
|
| 4358 |
-
"<!--repstart-->October<!--repend-->",
|
| 4359 |
-
"<!--repstart-->November<!--repend-->",
|
| 4360 |
-
"<!--repstart-->December<!--repend-->",
|
| 4361 |
-
"<!--repstart-->Street Address<!--repend-->",
|
| 4362 |
-
"<!--repstart-->Street Address Line 2<!--repend-->",
|
| 4363 |
-
"<!--repstart-->City<!--repend-->",
|
| 4364 |
-
"<!--repstart-->State / Province / Region<!--repend-->",
|
| 4365 |
-
"<!--repstart-->Postal / Zip Code<!--repend-->",
|
| 4366 |
-
"<!--repstart-->Country<!--repend-->",
|
| 4367 |
-
"<!--repstart-->Area Code<!--repend-->",
|
| 4368 |
-
"<!--repstart-->Phone Number<!--repend-->",
|
| 4369 |
-
"<!--repstart-->Dollars<!--repend-->",
|
| 4370 |
-
"<!--repstart-->Cents<!--repend-->",
|
| 4371 |
-
"<!--repstart--> $ <!--repend-->",
|
| 4372 |
-
"<!--repstart-->Quantity<!--repend-->",
|
| 4373 |
-
"<!--repstart-->From<!--repend-->",
|
| 4374 |
-
"<!--repstart-->To<!--repend-->",
|
| 4375 |
-
"<!--repstart-->$300<!--repend-->",
|
| 4376 |
-
"<!--repstart-->product 1 $100<!--repend-->",
|
| 4377 |
-
"<!--repstart-->product 2 $200<!--repend-->",
|
| 4378 |
-
$captcha_url,
|
| 4379 |
-
'class="captcha_img"',
|
| 4380 |
-
plugins_url("images/refresh.png", __FILE__),
|
| 4381 |
-
'form_id_temp',
|
| 4382 |
-
'style="padding-right:170px"'
|
| 4383 |
-
);
|
| 4384 |
-
$rep2 = array(
|
| 4385 |
-
addslashes(__("Title", 'form_maker')),
|
| 4386 |
-
addslashes(__("First", 'form_maker')),
|
| 4387 |
-
addslashes(__("Last", 'form_maker')),
|
| 4388 |
-
addslashes(__("Middle", 'form_maker')),
|
| 4389 |
-
addslashes(__("January", 'form_maker')),
|
| 4390 |
-
addslashes(__("February", 'form_maker')),
|
| 4391 |
-
addslashes(__("March", 'form_maker')),
|
| 4392 |
-
addslashes(__("April", 'form_maker')),
|
| 4393 |
-
addslashes(__("May", 'form_maker')),
|
| 4394 |
-
addslashes(__("June", 'form_maker')),
|
| 4395 |
-
addslashes(__("July", 'form_maker')),
|
| 4396 |
-
addslashes(__("August", 'form_maker')),
|
| 4397 |
-
addslashes(__("September", 'form_maker')),
|
| 4398 |
-
addslashes(__("October", 'form_maker')),
|
| 4399 |
-
addslashes(__("November", 'form_maker')),
|
| 4400 |
-
addslashes(__("December", 'form_maker')),
|
| 4401 |
-
addslashes(__("Street Address", 'form_maker')),
|
| 4402 |
-
addslashes(__("Street Address Line 2", 'form_maker')),
|
| 4403 |
-
addslashes(__("City", 'form_maker')),
|
| 4404 |
-
addslashes(__("State / Province / Region", 'form_maker')),
|
| 4405 |
-
addslashes(__("Postal / Zip Code", 'form_maker')),
|
| 4406 |
-
addslashes(__("Country", 'form_maker')),
|
| 4407 |
-
addslashes(__("Area Code", 'form_maker')),
|
| 4408 |
-
addslashes(__("Phone Number", 'form_maker')),
|
| 4409 |
-
addslashes(__("Dollars", 'form_maker')),
|
| 4410 |
-
addslashes(__("Cents", 'form_maker')),
|
| 4411 |
-
' ' . $form_currency . ' ',
|
| 4412 |
-
addslashes(__("Quantity", 'form_maker')),
|
| 4413 |
-
addslashes(__("From", 'form_maker')),
|
| 4414 |
-
addslashes(__("To", 'form_maker')),
|
| 4415 |
-
'',
|
| 4416 |
-
'',
|
| 4417 |
-
'',
|
| 4418 |
-
$captcha_rep_url,
|
| 4419 |
-
'class="captcha_img" style="display:none"',
|
| 4420 |
-
plugins_url("images/refresh.png", __FILE__),
|
| 4421 |
-
$id,
|
| 4422 |
-
''
|
| 4423 |
-
);
|
| 4424 |
-
$untilupload = str_replace($rep1, $rep2, $row->form_front);
|
| 4425 |
-
while (strpos($untilupload, "***destinationskizb") > 0) {
|
| 4426 |
-
$pos1 = strpos($untilupload, "***destinationskizb");
|
| 4427 |
-
$pos2 = strpos($untilupload, "***destinationverj");
|
| 4428 |
-
$untilupload = str_replace(substr($untilupload, $pos1, $pos2 - $pos1 + 22), "", $untilupload);
|
| 4429 |
-
}
|
| 4430 |
-
$form_maker_front_end .= $untilupload;
|
| 4431 |
-
$is_recaptcha = FALSE;
|
| 4432 |
-
$form_maker_front_end .= '<script type="text/javascript">';
|
| 4433 |
-
$form_maker_front_end .= 'WDF_FILE_TYPE_ERROR = \'' . addslashes(__("Sorry, you are not allowed to upload this type of file.", 'form_maker')) . '\';';
|
| 4434 |
-
$form_maker_front_end .= 'WDF_GRADING_TEXT = \'' . addslashes(__("Your score should be less than", 'form_maker')) . '\';';
|
| 4435 |
-
$form_maker_front_end .= 'WDF_INVALID_GRADING_' . $id . ' = \'' . addslashes(sprintf(__("Your score should be less than", 'form_maker'), '`grading_label`', '`grading_total`')) . '\';';
|
| 4436 |
-
$form_maker_front_end .= 'WDF_INVALID_EMAIL = \'' . addslashes(__("This is not a valid email address.", 'form_maker')) . '\';';
|
| 4437 |
-
$form_maker_front_end .= 'REQUEST_URI_' . $id . ' = "' . $current_url . '";';
|
| 4438 |
-
$form_maker_front_end .= 'ReqFieldMsg_' . $id . ' =\'`FIELDNAME` ' . addslashes(__('field is required.', 'form_maker')) . '\';';
|
| 4439 |
-
$form_maker_front_end .= 'RangeFieldMsg_' . $id . ' =\'' . addslashes(__('The', 'form_maker')) . ' `FIELDNAME` ' . addslashes(__('value must be between', 'form_maker')) . ' `FROM` - `TO`\';';
|
| 4440 |
-
$form_maker_front_end .= 'FormCurrency_' . $id . ' = "' . $form_currency . '";';
|
| 4441 |
-
$form_maker_front_end .= 'FormPaypalTax_' . $id . ' = ' . $form_paypal_tax . ';';
|
| 4442 |
-
$form_maker_front_end .= 'function formOnload' . $id . '()
|
| 4443 |
-
{';
|
| 4444 |
-
foreach ($label_type as $key => $type) {
|
| 4445 |
-
switch ($type) {
|
| 4446 |
-
case 'type_map':
|
| 4447 |
-
$form_maker_front_end .= 'if(document.getElementById("' . $label_id[$key] . '_element' . $id . '"))
|
| 4448 |
-
{
|
| 4449 |
-
if_gmap_init(' . $label_id[$key] . ',' . $id . ');
|
| 4450 |
-
for(q=0; q<20; q++)
|
| 4451 |
-
if(document.getElementById(' . $label_id[$key] . '+"_element"+' . $id . ').getAttribute("long"+q))
|
| 4452 |
-
{
|
| 4453 |
-
|
| 4454 |
-
w_long=parseFloat(document.getElementById(' . $label_id[$key] . '+"_element"+' . $id . ').getAttribute("long"+q));
|
| 4455 |
-
w_lat=parseFloat(document.getElementById(' . $label_id[$key] . '+"_element"+' . $id . ').getAttribute("lat"+q));
|
| 4456 |
-
w_info=parseFloat(document.getElementById(' . $label_id[$key] . '+"_element"+' . $id . ').getAttribute("info"+q));
|
| 4457 |
-
add_marker_on_map(' . $label_id[$key] . ',q, w_long, w_lat, w_info,' . $id . ',false);
|
| 4458 |
-
}
|
| 4459 |
-
}';
|
| 4460 |
-
break;
|
| 4461 |
-
case 'type_mark_map':
|
| 4462 |
-
$form_maker_front_end .= 'if(document.getElementById("' . $label_id[$key] . '_element' . $id . '"))
|
| 4463 |
-
if(!document.getElementById("' . $label_id[$key] . '_long' . $id . '"))
|
| 4464 |
-
{
|
| 4465 |
-
|
| 4466 |
-
var longit = document.createElement(\'input\');
|
| 4467 |
-
longit.setAttribute("type", \'hidden\');
|
| 4468 |
-
longit.setAttribute("id", \'' . $label_id[$key] . '_long' . $id . '\');
|
| 4469 |
-
longit.setAttribute("name", \'' . $label_id[$key] . '_long' . $id . '\');
|
| 4470 |
-
|
| 4471 |
-
var latit = document.createElement(\'input\');
|
| 4472 |
-
latit.setAttribute("type", \'hidden\');
|
| 4473 |
-
latit.setAttribute("id", \'' . $label_id[$key] . '_lat' . $id . '\');
|
| 4474 |
-
latit.setAttribute("name", \'' . $label_id[$key] . '_lat' . $id . '\');
|
| 4475 |
-
|
| 4476 |
-
document.getElementById("' . $label_id[$key] . '_element_section' . $id . '").appendChild(longit);
|
| 4477 |
-
document.getElementById("' . $label_id[$key] . '_element_section' . $id . '").appendChild(latit);
|
| 4478 |
-
|
| 4479 |
-
if_gmap_init(' . $label_id[$key] . ', ' . $id . ');
|
| 4480 |
-
|
| 4481 |
-
w_long=parseFloat(document.getElementById(' . $label_id[$key] . '+"_element"+' . $id . ').getAttribute("long0"));
|
| 4482 |
-
w_lat=parseFloat(document.getElementById(' . $label_id[$key] . '+"_element"+' . $id . ').getAttribute("lat0"));
|
| 4483 |
-
w_info=parseFloat(document.getElementById(' . $label_id[$key] . '+"_element"+' . $id . ').getAttribute("info0"));
|
| 4484 |
-
|
| 4485 |
-
|
| 4486 |
-
longit.value=w_long;
|
| 4487 |
-
latit.value=w_lat;
|
| 4488 |
-
add_marker_on_map(' . $label_id[$key] . ',0, w_long, w_lat, w_info, ' . $id . ', true);
|
| 4489 |
-
}';
|
| 4490 |
-
break;
|
| 4491 |
-
case 'type_captcha':
|
| 4492 |
-
$form_maker_front_end .= 'if(document.getElementById(\'_wd_captcha' . $id . '\'))
|
| 4493 |
-
captcha_refresh(\'_wd_captcha\', \'' . $id . '\');';
|
| 4494 |
-
break;
|
| 4495 |
-
case 'type_recaptcha':
|
| 4496 |
-
$is_recaptcha = TRUE;
|
| 4497 |
-
break;
|
| 4498 |
-
case 'type_radio':
|
| 4499 |
-
case 'type_checkbox':
|
| 4500 |
-
$form_maker_front_end .= 'if(document.getElementById(\'' . $label_id[$key] . '_randomize' . $id . '\'))
|
| 4501 |
-
if (document.getElementById(\'' . $label_id[$key] . '_randomize' . $id . '\').value == "yes") {
|
| 4502 |
-
choises_randomize(\'' . $label_id[$key] . '\', \'' . $id . '\');}';
|
| 4503 |
-
break;
|
| 4504 |
-
case 'type_spinner':
|
| 4505 |
-
$form_maker_front_end .= '
|
| 4506 |
-
if (document.getElementById(\'' . $label_id[$key] . '_element' . $id . '\')) {
|
| 4507 |
-
var spinner_value = document.getElementById(\'' . $label_id[$key] . '_element' . $id . '\').getAttribute(\'aria-valuenow\');
|
| 4508 |
-
}
|
| 4509 |
-
if (document.getElementById(\'' . $label_id[$key] . '_min_value' . $id . '\'))
|
| 4510 |
-
var spinner_min_value = document.getElementById(\'' . $label_id[$key] . '_min_value' . $id . '\').value;
|
| 4511 |
-
if (document.getElementById(\'' . $label_id[$key] . '_max_value' . $id . '\'))
|
| 4512 |
-
var spinner_max_value = document.getElementById(\'' . $label_id[$key] . '_max_value' . $id . '\').value;
|
| 4513 |
-
if (document.getElementById(\'' . $label_id[$key] . '_step' . $id . '\'))
|
| 4514 |
-
var spinner_step = document.getElementById(\'' . $label_id[$key] . '_step' . $id . '\').value;
|
| 4515 |
-
jQuery( \'' . $label_id[$key] . '_element' . $id . '\' ).removeClass( \'ui-spinner-input\')
|
| 4516 |
-
.attr( \'disabled\', false )
|
| 4517 |
-
.removeAttr( \'autocomplete\' )
|
| 4518 |
-
.removeAttr( \'role\' )
|
| 4519 |
-
.removeAttr( \'aria-valuemin\' )
|
| 4520 |
-
.removeAttr( \'aria-valuemax\' )
|
| 4521 |
-
.removeAttr( \'aria-valuenow\' );
|
| 4522 |
-
if (document.getElementById(\'' . $label_id[$key] . '_element' . $id . '\')) {
|
| 4523 |
-
span_ui= document.getElementById(\'' . $label_id[$key] . '_element' . $id . '\').parentNode;
|
| 4524 |
-
span_ui.parentNode.appendChild(document.getElementById(\'' . $label_id[$key] . '_element' . $id . '\'));
|
| 4525 |
-
span_ui.parentNode.removeChild(span_ui);
|
| 4526 |
-
jQuery(\'#' . $label_id[$key] . '_element' . $id . '\')[0].spin = null;
|
| 4527 |
-
}
|
| 4528 |
-
spinner = jQuery( \'#' . $label_id[$key] . '_element' . $id . '\' ).spinner();
|
| 4529 |
-
spinner.spinner( \'value\', spinner_value );
|
| 4530 |
-
jQuery( \'#' . $label_id[$key] . '_element' . $id . '\' ).spinner({ min: spinner_min_value});
|
| 4531 |
-
jQuery( \'#' . $label_id[$key] . '_element' . $id . '\' ).spinner({ max: spinner_max_value});
|
| 4532 |
-
jQuery( \'#' . $label_id[$key] . '_element' . $id . '\' ).spinner({ step: spinner_step});';
|
| 4533 |
-
break;
|
| 4534 |
-
case 'type_slider':
|
| 4535 |
-
$form_maker_front_end .= '
|
| 4536 |
-
if (document.getElementById(\'' . $label_id[$key] . '_slider_value' . $id . '\'))
|
| 4537 |
-
var slider_value = document.getElementById(\'' . $label_id[$key] . '_slider_value' . $id . '\').value;
|
| 4538 |
-
if (document.getElementById(\'' . $label_id[$key] . '_slider_min_value' . $id . '\'))
|
| 4539 |
-
var slider_min_value = document.getElementById(\'' . $label_id[$key] . '_slider_min_value' . $id . '\').value;
|
| 4540 |
-
if (document.getElementById(\'' . $label_id[$key] . '_slider_max_value' . $id . '\'))
|
| 4541 |
-
var slider_max_value = document.getElementById(\'' . $label_id[$key] . '_slider_max_value' . $id . '\').value;
|
| 4542 |
-
if (document.getElementById(\'' . $label_id[$key] . '_element_value' . $id . '\'))
|
| 4543 |
-
var slider_element_value = document.getElementById(\'' . $label_id[$key] . '_element_value' . $id . '\' );
|
| 4544 |
-
if (document.getElementById(\'' . $label_id[$key] . '_slider_value' . $id . '\'))
|
| 4545 |
-
var slider_value_save = document.getElementById( \'' . $label_id[$key] . '_slider_value' . $id . '\' );
|
| 4546 |
-
if (document.getElementById(\'' . $label_id[$key] . '_element' . $id . '\')) {
|
| 4547 |
-
document.getElementById(\'' . $label_id[$key] . '_element' . $id . '\').innerHTML = \'\';
|
| 4548 |
-
document.getElementById(\'' . $label_id[$key] . '_element' . $id . '\').removeAttribute( \'class\' );
|
| 4549 |
-
document.getElementById(\'' . $label_id[$key] . '_element' . $id . '\').removeAttribute( \'aria-disabled\' );
|
| 4550 |
-
}
|
| 4551 |
-
if (document.getElementById(\'' . $label_id[$key] . '_element' . $id . '\'))
|
| 4552 |
-
jQuery(\'#' . $label_id[$key] . '_element' . $id . '\')[0].slide = null;
|
| 4553 |
-
jQuery( \'#' . $label_id[$key] . '_element' . $id . '\').slider({
|
| 4554 |
-
range: \'min\',
|
| 4555 |
-
value: eval(slider_value),
|
| 4556 |
-
min: eval(slider_min_value),
|
| 4557 |
-
max: eval(slider_max_value),
|
| 4558 |
-
slide: function( event, ui ) {
|
| 4559 |
-
slider_element_value.innerHTML = \'\' + ui.value;
|
| 4560 |
-
slider_value_save.value = \'\' + ui.value;
|
| 4561 |
-
}
|
| 4562 |
-
});';
|
| 4563 |
-
break;
|
| 4564 |
-
case 'type_range':
|
| 4565 |
-
$form_maker_front_end .= '
|
| 4566 |
-
if (document.getElementById(\'' . $label_id[$key] . '_element' . $id . '0\'))
|
| 4567 |
-
var spinner_value0 = document.getElementById(\'' . $label_id[$key] . '_element' . $id . '0\').getAttribute( \'aria-valuenow\' );
|
| 4568 |
-
if (document.getElementById(\'' . $label_id[$key] . '_element' . $id . '1\'))
|
| 4569 |
-
var spinner_value1 = document.getElementById(\'' . $label_id[$key] . '_element' . $id . '1\').getAttribute( \'aria-valuenow\' );
|
| 4570 |
-
if (document.getElementById(\'' . $label_id[$key] . '_range_step' . $id . '\'))
|
| 4571 |
-
var spinner_step = document.getElementById(\'' . $label_id[$key] . '_range_step' . $id . '\').value;
|
| 4572 |
-
jQuery( \'#' . $label_id[$key] . '_element' . $id . '0\' ).removeClass( \'ui-spinner-input\' )
|
| 4573 |
-
.attr( \'disabled\', false )
|
| 4574 |
-
.removeAttr( \'autocomplete\' )
|
| 4575 |
-
.removeAttr( \'role\' )
|
| 4576 |
-
.removeAttr( \'aria-valuenow\' );
|
| 4577 |
-
if (document.getElementById(\'' . $label_id[$key] . '_element' . $id . '0\')) {
|
| 4578 |
-
span_ui= document.getElementById(\'' . $label_id[$key] . '_element' . $id . '0\').parentNode;
|
| 4579 |
-
span_ui.parentNode.appendChild(document.getElementById(\'' . $label_id[$key] . '_element' . $id . '0\'));
|
| 4580 |
-
span_ui.parentNode.removeChild(span_ui);
|
| 4581 |
-
jQuery(\'#' . $label_id[$key] . '_element' . $id . '0\')[0].spin = null;
|
| 4582 |
-
}
|
| 4583 |
-
spinner0 = jQuery( \'#' . $label_id[$key] . '_element' . $id . '0\' ).spinner();
|
| 4584 |
-
spinner0.spinner( \'value\', spinner_value0 );
|
| 4585 |
-
jQuery( \'#' . $label_id[$key] . '_element' . $id . '0\' ).spinner({ step: spinner_step});
|
| 4586 |
-
jQuery( \'#' . $label_id[$key] . '_element' . $id . '1\' ).removeClass( \'ui-spinner-input\' )
|
| 4587 |
-
.attr( \'disabled\', false )
|
| 4588 |
-
.removeAttr( \'autocomplete\' )
|
| 4589 |
-
.removeAttr( \'role\' )
|
| 4590 |
-
.removeAttr( \'aria-valuenow\' );
|
| 4591 |
-
if (document.getElementById(\'' . $label_id[$key] . '_element' . $id . '1\')) {
|
| 4592 |
-
span_ui1= document.getElementById(\'' . $label_id[$key] . '_element' . $id . '1\').parentNode;
|
| 4593 |
-
span_ui1.parentNode.appendChild(document.getElementById(\'' . $label_id[$key] . '_element' . $id . '1\'));
|
| 4594 |
-
span_ui1.parentNode.removeChild(span_ui1);
|
| 4595 |
-
jQuery(\'#' . $label_id[$key] . '_element' . $id . '1\')[0].spin = null;
|
| 4596 |
-
}
|
| 4597 |
-
spinner1 = jQuery( \'#' . $label_id[$key] . '_element' . $id . '1\' ).spinner();
|
| 4598 |
-
spinner1.spinner( \'value\', spinner_value1 );
|
| 4599 |
-
jQuery( \'#' . $label_id[$key] . '_element' . $id . '1\').spinner({ step: spinner_step});';
|
| 4600 |
-
break;
|
| 4601 |
-
case 'type_paypal_total':
|
| 4602 |
-
$form_maker_front_end .= '
|
| 4603 |
-
set_total_value(' . $label_id[$key] . ', ' . $id . ');';
|
| 4604 |
-
break;
|
| 4605 |
-
default:
|
| 4606 |
-
break;
|
| 4607 |
-
}
|
| 4608 |
-
}
|
| 4609 |
-
$form_maker_front_end .= '
|
| 4610 |
-
if (window.before_load) {
|
| 4611 |
-
before_load();
|
| 4612 |
-
}
|
| 4613 |
-
}';
|
| 4614 |
-
$form_maker_front_end .= '
|
| 4615 |
-
jQuery(window).load(function () {
|
| 4616 |
-
formOnload' . $id . '();
|
| 4617 |
-
});';
|
| 4618 |
-
if (isset($_POST["counter" . $id])) {
|
| 4619 |
-
$counter = esc_html($_POST["counter" . $id]);
|
| 4620 |
-
}
|
| 4621 |
-
$old_key = -1;
|
| 4622 |
-
if (isset($counter)) {
|
| 4623 |
-
foreach ($label_type as $key => $type) {
|
| 4624 |
-
switch ($type) {
|
| 4625 |
-
case "type_text":
|
| 4626 |
-
case "type_number":
|
| 4627 |
-
case "type_submitter_mail":
|
| 4628 |
-
{
|
| 4629 |
-
$form_maker_front_end .= "if(document.getElementById('" . $label_id[$key] . "_element" . $id . "'))
|
| 4630 |
-
if(document.getElementById('" . $label_id[$key] . "_element" . $id . "').title!='" . addslashes((isset($_POST[$label_id[$key] . "_element" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element" . $id])) : "")) . "')
|
| 4631 |
-
{ document.getElementById('" . $label_id[$key] . "_element" . $id . "').value='" . addslashes(isset($_POST[$label_id[$key] . "_element" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element" . $id])) : "") . "';
|
| 4632 |
-
document.getElementById('" . $label_id[$key] . "_element" . $id . "').className='input_active';
|
| 4633 |
-
}
|
| 4634 |
-
";
|
| 4635 |
-
break;
|
| 4636 |
-
}
|
| 4637 |
-
case "type_textarea":
|
| 4638 |
-
{
|
| 4639 |
-
$order = array(
|
| 4640 |
-
"\r\n",
|
| 4641 |
-
"\n",
|
| 4642 |
-
"\r"
|
| 4643 |
-
);
|
| 4644 |
-
$form_maker_front_end .= "if(document.getElementById('" . $label_id[$key] . "_element" . $id . "'))
|
| 4645 |
-
if(document.getElementById('" . $label_id[$key] . "_element" . $id . "').title!='" . str_replace($order, '\n', addslashes(isset($_POST[$label_id[$key] . "_element" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element" . $id])) : "")) . "')
|
| 4646 |
-
{ document.getElementById('" . $label_id[$key] . "_element" . $id . "').innerHTML='" . str_replace($order, '\n', addslashes(isset($_POST[$label_id[$key] . "_element" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element" . $id])) : "")) . "';
|
| 4647 |
-
document.getElementById('" . $label_id[$key] . "_element" . $id . "').className='input_active';
|
| 4648 |
-
}
|
| 4649 |
-
";
|
| 4650 |
-
break;
|
| 4651 |
-
}
|
| 4652 |
-
case "type_name":
|
| 4653 |
-
{
|
| 4654 |
-
$element_title = isset($_POST[$label_id[$key] . "_element_title" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element_title" . $id])) : "";
|
| 4655 |
-
if (isset($_POST[$label_id[$key] . "_element_title" . $id])) {
|
| 4656 |
-
$form_maker_front_end .= "if(document.getElementById('" . $label_id[$key] . "_element_first" . $id . "'))
|
| 4657 |
-
{
|
| 4658 |
-
if(document.getElementById('" . $label_id[$key] . "_element_title" . $id . "').title!='" . addslashes(isset($_POST[$label_id[$key] . "_element_title" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element_title" . $id])) : "") . "')
|
| 4659 |
-
{ document.getElementById('" . $label_id[$key] . "_element_title" . $id . "').value='" . addslashes(isset($_POST[$label_id[$key] . "_element_title" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element_title" . $id])) : "") . "';
|
| 4660 |
-
document.getElementById('" . $label_id[$key] . "_element_title" . $id . "').className='input_active';
|
| 4661 |
-
}
|
| 4662 |
-
|
| 4663 |
-
if(document.getElementById('" . $label_id[$key] . "_element_first" . $id . "').title!='" . addslashes(isset($_POST[$label_id[$key] . "_element_first" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element_first" . $id])) : "") . "')
|
| 4664 |
-
{ document.getElementById('" . $label_id[$key] . "_element_first" . $id . "').value='" . addslashes(isset($_POST[$label_id[$key] . "_element_first" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element_first" . $id])) : "") . "';
|
| 4665 |
-
document.getElementById('" . $label_id[$key] . "_element_first" . $id . "').className='input_active';
|
| 4666 |
-
}
|
| 4667 |
-
|
| 4668 |
-
if(document.getElementById('" . $label_id[$key] . "_element_last" . $id . "').title!='" . addslashes(isset($_POST[$label_id[$key] . "_element_last" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element_last" . $id])) : "") . "')
|
| 4669 |
-
{ document.getElementById('" . $label_id[$key] . "_element_last" . $id . "').value='" . addslashes(isset($_POST[$label_id[$key] . "_element_last" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element_last" . $id])) : "") . "';
|
| 4670 |
-
document.getElementById('" . $label_id[$key] . "_element_last" . $id . "').className='input_active';
|
| 4671 |
-
}
|
| 4672 |
-
|
| 4673 |
-
if(document.getElementById('" . $label_id[$key] . "_element_middle" . $id . "').title!='" . addslashes(isset($_POST[$label_id[$key] . "_element_middle" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element_middle" . $id])) : "") . "')
|
| 4674 |
-
{ document.getElementById('" . $label_id[$key] . "_element_middle" . $id . "').value='" . addslashes(isset($_POST[$label_id[$key] . "_element_middle" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element_middle" . $id])) : "") . "';
|
| 4675 |
-
document.getElementById('" . $label_id[$key] . "_element_middle" . $id . "').className='input_active';
|
| 4676 |
-
}
|
| 4677 |
-
|
| 4678 |
-
}";
|
| 4679 |
-
}
|
| 4680 |
-
else {
|
| 4681 |
-
$form_maker_front_end .= "if(document.getElementById('" . $label_id[$key] . "_element_first" . $id . "'))
|
| 4682 |
-
{
|
| 4683 |
-
|
| 4684 |
-
if(document.getElementById('" . $label_id[$key] . "_element_first" . $id . "').title!='" . addslashes(isset($_POST[$label_id[$key] . "_element_first" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element_first" . $id])) : "") . "')
|
| 4685 |
-
{ document.getElementById('" . $label_id[$key] . "_element_first" . $id . "').value='" . addslashes(isset($_POST[$label_id[$key] . "_element_first" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element_first" . $id])) : "") . "';
|
| 4686 |
-
document.getElementById('" . $label_id[$key] . "_element_first" . $id . "').className='input_active';
|
| 4687 |
-
}
|
| 4688 |
-
|
| 4689 |
-
if(document.getElementById('" . $label_id[$key] . "_element_last" . $id . "').title!='" . addslashes(isset($_POST[$label_id[$key] . "_element_last" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element_last" . $id])) : "") . "')
|
| 4690 |
-
{ document.getElementById('" . $label_id[$key] . "_element_last" . $id . "').value='" . addslashes(isset($_POST[$label_id[$key] . "_element_last" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element_last" . $id])) : "") . "';
|
| 4691 |
-
document.getElementById('" . $label_id[$key] . "_element_last" . $id . "').className='input_active';
|
| 4692 |
-
}
|
| 4693 |
-
|
| 4694 |
-
}";
|
| 4695 |
-
}
|
| 4696 |
-
break;
|
| 4697 |
-
}
|
| 4698 |
-
case "type_phone":
|
| 4699 |
-
{
|
| 4700 |
-
$form_maker_front_end .= "if(document.getElementById('" . $label_id[$key] . "_element_first" . $id . "'))
|
| 4701 |
-
{
|
| 4702 |
-
if(document.getElementById('" . $label_id[$key] . "_element_first" . $id . "').title!='" . addslashes(isset($_POST[$label_id[$key] . "_element_first" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element_first" . $id])) : "") . "')
|
| 4703 |
-
{ document.getElementById('" . $label_id[$key] . "_element_first" . $id . "').value='" . addslashes(isset($_POST[$label_id[$key] . "_element_first" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element_first" . $id])) : "") . "';
|
| 4704 |
-
document.getElementById('" . $label_id[$key] . "_element_first" . $id . "').className='input_active';
|
| 4705 |
-
}
|
| 4706 |
-
|
| 4707 |
-
if(document.getElementById('" . $label_id[$key] . "_element_last" . $id . "').title!='" . addslashes(isset($_POST[$label_id[$key] . "_element_last" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element_last" . $id])) : "") . "')
|
| 4708 |
-
{ document.getElementById('" . $label_id[$key] . "_element_last" . $id . "').value='" . addslashes(isset($_POST[$label_id[$key] . "_element_last" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element_last" . $id])) : "") . "';
|
| 4709 |
-
document.getElementById('" . $label_id[$key] . "_element_last" . $id . "').className='input_active';
|
| 4710 |
-
}
|
| 4711 |
-
}";
|
| 4712 |
-
break;
|
| 4713 |
-
}
|
| 4714 |
-
|
| 4715 |
-
case "type_paypal_price": {
|
| 4716 |
-
$form_maker_front_end .= "if(document.getElementById('".$label_id[$key]."_element_dollars".$id."'))
|
| 4717 |
-
{
|
| 4718 |
-
if(document.getElementById('".$label_id[$key]."_element_dollars".$id."').title!='".addslashes(isset($_POST[$label_id[$key]."_element_dollars".$id]) ? esc_html(stripslashes($_POST[$label_id[$key]."_element_dollars".$id])) : "")."')
|
| 4719 |
-
{ document.getElementById('".$label_id[$key]."_element_dollars".$id."').value='".addslashes(isset($_POST[$label_id[$key]."_element_dollars".$id]) ? esc_html(stripslashes($_POST[$label_id[$key]."_element_dollars".$id])) : "")."';
|
| 4720 |
-
document.getElementById('".$label_id[$key]."_element_dollars".$id."').className='input_active';
|
| 4721 |
-
}
|
| 4722 |
-
|
| 4723 |
-
if(document.getElementById('".$label_id[$key]."_element_cents".$id."').title!='".addslashes(isset($_POST[$label_id[$key]."_element_cents".$id]) ? esc_html(stripslashes($_POST[$label_id[$key]."_element_cents".$id])) : "")."')
|
| 4724 |
-
{ document.getElementById('".$label_id[$key]."_element_cents".$id."').value='".addslashes(isset($_POST[$label_id[$key]."_element_cents".$id]) ? esc_html(stripslashes($_POST[$label_id[$key]."_element_cents".$id])) : "")."';
|
| 4725 |
-
document.getElementById('".$label_id[$key]."_element_cents".$id."').className='input_active';
|
| 4726 |
-
}
|
| 4727 |
-
}";
|
| 4728 |
-
|
| 4729 |
-
break;
|
| 4730 |
-
}
|
| 4731 |
-
|
| 4732 |
-
case "type_paypal_select":{
|
| 4733 |
-
|
| 4734 |
-
$form_maker_front_end .=
|
| 4735 |
-
"if(document.getElementById('".$label_id[$key]."_element".$id."')){
|
| 4736 |
-
document.getElementById('".$label_id[$key]."_element".$id."').value='".addslashes(isset($_POST[$label_id[$key]."_element".$id]) ? esc_html(stripslashes($_POST[$label_id[$key]."_element".$id])) : "")."';
|
| 4737 |
-
|
| 4738 |
-
if(document.getElementById('".$label_id[$key]."_element_quantity".$id."'))
|
| 4739 |
-
document.getElementById('".$label_id[$key]."_element_quantity".$id."').value='".((isset($_POST[$label_id[$key]."_element_quantity".$id]) && ((int) $_POST[$label_id[$key]."_element_quantity".$id] >= 1)) ? addslashes($_POST[$label_id[$key]."_element_quantity".$id]) : 1)."';
|
| 4740 |
-
";
|
| 4741 |
-
for($j=0; $j<100; $j++)
|
| 4742 |
-
{
|
| 4743 |
-
$element = isset($_POST[$label_id[$key]."_property".$id.$j]) ? esc_html(stripslashes($_POST[$label_id[$key]."_property".$id.$j])) : NULL;
|
| 4744 |
-
if(isset($element))
|
| 4745 |
-
{
|
| 4746 |
-
$form_maker_front_end .=
|
| 4747 |
-
"document.getElementById('".$label_id[$key]."_property".$id.$j."').value='".addslashes($element)."';
|
| 4748 |
-
";
|
| 4749 |
-
}
|
| 4750 |
-
}
|
| 4751 |
-
$form_maker_front_end .= "
|
| 4752 |
-
}";
|
| 4753 |
-
|
| 4754 |
-
|
| 4755 |
-
break;
|
| 4756 |
-
}
|
| 4757 |
-
case "type_paypal_checkbox":{
|
| 4758 |
-
|
| 4759 |
-
$form_maker_front_end .=
|
| 4760 |
-
"
|
| 4761 |
-
for(k=0; k<30; k++)
|
| 4762 |
-
if(document.getElementById('".$label_id[$key]."_element".$id."'+k))
|
| 4763 |
-
document.getElementById('".$label_id[$key]."_element".$id."'+k).removeAttribute('checked');
|
| 4764 |
-
else break;
|
| 4765 |
-
";
|
| 4766 |
-
for($j=0; $j<100; $j++)
|
| 4767 |
-
{
|
| 4768 |
-
$element = isset($_POST[$label_id[$key]."_element".$id.$j]) ? esc_html(stripslashes($_POST[$label_id[$key]."_element".$id.$j])) : NULL;
|
| 4769 |
-
if(isset($element))
|
| 4770 |
-
{
|
| 4771 |
-
$form_maker_front_end .=
|
| 4772 |
-
"document.getElementById('".$label_id[$key]."_element".$id.$j."').setAttribute('checked', 'checked');
|
| 4773 |
-
";
|
| 4774 |
-
}
|
| 4775 |
-
}
|
| 4776 |
-
|
| 4777 |
-
$form_maker_front_end .=
|
| 4778 |
-
"
|
| 4779 |
-
if(document.getElementById('".$label_id[$key]."_element_quantity".$id."'))
|
| 4780 |
-
document.getElementById('".$label_id[$key]."_element_quantity".$id."').value='".((isset($_POST[$label_id[$key]."_element_quantity".$id])) ? addslashes($_POST[$label_id[$key]."_element_quantity".$id]) : 1)."';
|
| 4781 |
-
";
|
| 4782 |
-
for($j=0; $j<100; $j++)
|
| 4783 |
-
{
|
| 4784 |
-
$element = isset($_POST[$label_id[$key]."_property".$id.$j]) ? esc_html(stripslashes($_POST[$label_id[$key]."_property".$id.$j])) : NULL;
|
| 4785 |
-
if(isset($element))
|
| 4786 |
-
{
|
| 4787 |
-
$form_maker_front_end .=
|
| 4788 |
-
"document.getElementById('".$label_id[$key]."_property".$id.$j."').value='".addslashes($element)."';
|
| 4789 |
-
";
|
| 4790 |
-
}
|
| 4791 |
-
};
|
| 4792 |
-
break;
|
| 4793 |
-
}
|
| 4794 |
-
case "type_paypal_radio":{
|
| 4795 |
-
|
| 4796 |
-
$form_maker_front_end .=
|
| 4797 |
-
"
|
| 4798 |
-
for(k=0; k<50; k++)
|
| 4799 |
-
if(document.getElementById('".$label_id[$key]."_element".$id."'+k))
|
| 4800 |
-
{
|
| 4801 |
-
document.getElementById('".$label_id[$key]."_element".$id."'+k).removeAttribute('checked');
|
| 4802 |
-
if(document.getElementById('".$label_id[$key]."_element".$id."'+k).value=='".addslashes(isset($_POST[$label_id[$key]."_element".$id]) ? esc_html(stripslashes($_POST[$label_id[$key]."_element".$id])) : "")."')
|
| 4803 |
-
{
|
| 4804 |
-
document.getElementById('".$label_id[$key]."_element".$id."'+k).setAttribute('checked', 'checked');
|
| 4805 |
-
|
| 4806 |
-
}
|
| 4807 |
-
}
|
| 4808 |
-
|
| 4809 |
-
|
| 4810 |
-
if(document.getElementById('".$label_id[$key]."_element_quantity".$id."'))
|
| 4811 |
-
document.getElementById('".$label_id[$key]."_element_quantity".$id."').value='".((isset($_POST[$label_id[$key]."_element_quantity".$id])) ? esc_html(stripslashes($_POST[$label_id[$key]."_element_quantity".$id])) : 1)."';
|
| 4812 |
-
";
|
| 4813 |
-
for($j=0; $j<100; $j++)
|
| 4814 |
-
{
|
| 4815 |
-
$element = isset($_POST[$label_id[$key]."_property".$id.$j]) ? esc_html(stripslashes($_POST[$label_id[$key]."_property".$id.$j])) : NULL;
|
| 4816 |
-
if(isset($element))
|
| 4817 |
-
{
|
| 4818 |
-
$form_maker_front_end .=
|
| 4819 |
-
"document.getElementById('".$label_id[$key]."_property".$id.$j."').value='".addslashes($element)."';
|
| 4820 |
-
";
|
| 4821 |
-
}
|
| 4822 |
-
};
|
| 4823 |
-
|
| 4824 |
-
|
| 4825 |
-
|
| 4826 |
-
break;
|
| 4827 |
-
}
|
| 4828 |
-
|
| 4829 |
-
case "type_paypal_shipping":{
|
| 4830 |
-
|
| 4831 |
-
$form_maker_front_end .=
|
| 4832 |
-
"
|
| 4833 |
-
for(k=0; k<50; k++)
|
| 4834 |
-
if(document.getElementById('".$label_id[$key]."_element".$id."'+k))
|
| 4835 |
-
{
|
| 4836 |
-
document.getElementById('".$label_id[$key]."_element".$id."'+k).removeAttribute('checked');
|
| 4837 |
-
if(document.getElementById('".$label_id[$key]."_element".$id."'+k).value=='".addslashes(isset($_POST[$label_id[$key]."_element".$id]) ? esc_html(stripslashes($_POST[$label_id[$key]."_element".$id])) : "")."')
|
| 4838 |
-
{
|
| 4839 |
-
document.getElementById('".$label_id[$key]."_element".$id."'+k).setAttribute('checked', 'checked');
|
| 4840 |
-
|
| 4841 |
-
}
|
| 4842 |
-
}
|
| 4843 |
-
|
| 4844 |
-
";
|
| 4845 |
-
|
| 4846 |
-
break;
|
| 4847 |
-
}
|
| 4848 |
-
case "type_star_rating": {
|
| 4849 |
-
$form_maker_front_end .=
|
| 4850 |
-
"if(document.getElementById('".$label_id[$key]."_element".$id."')) {
|
| 4851 |
-
document.getElementById('".$label_id[$key]."_selected_star_amount".$id."').value='".addslashes(isset($_POST[$label_id[$key]."_selected_star_amount".$id]) ? esc_html(stripslashes($_POST[$label_id[$key]."_selected_star_amount".$id])) : "")."';
|
| 4852 |
-
if (document.getElementById('".$label_id[$key]."_selected_star_amount".$id."').value)
|
| 4853 |
-
select_star_rating((document.getElementById('".$label_id[$key]."_selected_star_amount".$id."').value-1),".$label_id[$key].",".$id.");
|
| 4854 |
-
}";
|
| 4855 |
-
break;
|
| 4856 |
-
|
| 4857 |
-
}
|
| 4858 |
-
|
| 4859 |
-
case "type_scale_rating": {
|
| 4860 |
-
$form_maker_front_end .=
|
| 4861 |
-
"for (k=0; k<100; k++) {
|
| 4862 |
-
if (document.getElementById('".$label_id[$key]."_scale_radio".$id."_'+k)) {
|
| 4863 |
-
document.getElementById('".$label_id[$key]."_scale_radio".$id."_'+k).removeAttribute('checked');
|
| 4864 |
-
if (document.getElementById('".$label_id[$key]."_scale_radio".$id."_'+k).value=='".(isset($_POST[$label_id[$key]."_scale_radio".$id]) ? esc_html(stripslashes($_POST[$label_id[$key]."_scale_radio".$id])) : "")."')
|
| 4865 |
-
document.getElementById('".$label_id[$key]."_scale_radio".$id."_'+k).setAttribute('checked', 'checked');
|
| 4866 |
-
}
|
| 4867 |
-
}";
|
| 4868 |
-
break;
|
| 4869 |
-
|
| 4870 |
-
}
|
| 4871 |
-
case "type_spinner": {
|
| 4872 |
-
$form_maker_front_end .=
|
| 4873 |
-
"if (document.getElementById('".$label_id[$key]."_element".$id."')) {
|
| 4874 |
-
document.getElementById('".$label_id[$key]."_element".$id."').setAttribute('aria-valuenow','".(isset($_POST[$label_id[$key]."_element".$id]) ? esc_html(stripslashes($_POST[$label_id[$key]."_element".$id])) : "")."');
|
| 4875 |
-
}";
|
| 4876 |
-
break;
|
| 4877 |
-
|
| 4878 |
-
}
|
| 4879 |
-
case "type_slider": {
|
| 4880 |
-
$form_maker_front_end .=
|
| 4881 |
-
"if (document.getElementById('".$label_id[$key]."_element".$id."'))
|
| 4882 |
-
document.getElementById('".$label_id[$key]."_element".$id."').setAttribute('aria-valuenow','".(isset($_POST[$label_id[$key]."_slider_value".$id]) ? esc_html(stripslashes($_POST[$label_id[$key]."_slider_value".$id])) : "")."');
|
| 4883 |
-
if (document.getElementById('".$label_id[$key]."_slider_value".$id."'))
|
| 4884 |
-
document.getElementById('".$label_id[$key]."_slider_value".$id."').value='".(isset($_POST[$label_id[$key]."_slider_value".$id]) ? esc_html(stripslashes($_POST[$label_id[$key]."_slider_value".$id])) : "")."';
|
| 4885 |
-
if (document.getElementById('".$label_id[$key]."_element_value".$id."'))
|
| 4886 |
-
document.getElementById('".$label_id[$key]."_element_value".$id."').innerHTML='".(isset($_POST[$label_id[$key]."_slider_value".$id]) ? esc_html(stripslashes($_POST[$label_id[$key]."_slider_value".$id])) : "")."';";
|
| 4887 |
-
break;
|
| 4888 |
-
|
| 4889 |
-
}
|
| 4890 |
-
case "type_range": {
|
| 4891 |
-
$form_maker_front_end .=
|
| 4892 |
-
"if (document.getElementById('".$label_id[$key]."_element".$id."0'))
|
| 4893 |
-
document.getElementById('".$label_id[$key]."_element".$id."0').setAttribute('aria-valuenow','".(isset($_POST[$label_id[$key]."_element".$id."0"]) ? esc_html(stripslashes($_POST[$label_id[$key]."_element".$id."0"])) : "")."');
|
| 4894 |
-
if (document.getElementById('".$label_id[$key]."_element".$id."1'))
|
| 4895 |
-
document.getElementById('".$label_id[$key]."_element".$id."1').setAttribute('aria-valuenow','".(isset($_POST[$label_id[$key]."_element".$id."1"]) ? esc_html(stripslashes($_POST[$label_id[$key]."_element".$id."1"])) : "")."');";
|
| 4896 |
-
break;
|
| 4897 |
-
|
| 4898 |
-
}
|
| 4899 |
-
case "type_grading": {
|
| 4900 |
-
for ($k = 0; $k < 100; $k++) {
|
| 4901 |
-
$form_maker_front_end .= "if (document.getElementById('".$label_id[$key]."_element".$id.$k."')) {
|
| 4902 |
-
document.getElementById('".$label_id[$key]."_element".$id.$k."').value='".(isset($_POST[$label_id[$key]."_element".$id.$k]) ? esc_html(stripslashes($_POST[$label_id[$key]."_element".$id.$k])) : "")."';}";
|
| 4903 |
-
}
|
| 4904 |
-
$form_maker_front_end .= "sum_grading_values(".$label_id[$key].",".$id.");";
|
| 4905 |
-
break;
|
| 4906 |
-
|
| 4907 |
-
}
|
| 4908 |
-
case "type_matrix": {
|
| 4909 |
-
$form_maker_front_end .=
|
| 4910 |
-
"if (document.getElementById('".$label_id[$key]."_input_type".$id."').value == 'radio') {";
|
| 4911 |
-
for ($k = 1; $k < 40; $k++) {
|
| 4912 |
-
for ($l = 1; $l < 40; $l++) {
|
| 4913 |
-
$form_maker_front_end .=
|
| 4914 |
-
"if (document.getElementById('".$label_id[$key]."_input_element".$id.$k."_".$l."')) {
|
| 4915 |
-
document.getElementById('".$label_id[$key]."_input_element".$id.$k."_".$l."').removeAttribute('checked');
|
| 4916 |
-
if (document.getElementById('".$label_id[$key]."_input_element".$id.$k."_".$l."').value=='".(isset($_POST[$label_id[$key]."_input_element".$id.$k]) ? esc_html(stripslashes($_POST[$label_id[$key]."_input_element".$id.$k])) : "")."')
|
| 4917 |
-
document.getElementById('".$label_id[$key]."_input_element".$id.$k."_".$l."').setAttribute('checked', 'checked');
|
| 4918 |
-
}";
|
| 4919 |
-
}
|
| 4920 |
-
}
|
| 4921 |
-
$form_maker_front_end .=
|
| 4922 |
-
"}
|
| 4923 |
-
else
|
| 4924 |
-
if (document.getElementById('".$label_id[$key]."_input_type".$id."').value == 'checkbox') {";
|
| 4925 |
-
for ($k = 1; $k < 40; $k++) {
|
| 4926 |
-
for ($l = 1; $l < 40; $l++) {
|
| 4927 |
-
$form_maker_front_end .=
|
| 4928 |
-
"if (document.getElementById('".$label_id[$key]."_input_element".$id.$k."_".$l."')) {
|
| 4929 |
-
document.getElementById('".$label_id[$key]."_input_element".$id.$k."_".$l."').removeAttribute('checked');
|
| 4930 |
-
if (document.getElementById('".$label_id[$key]."_input_element".$id.$k."_".$l."').value=='".(isset($_POST[$label_id[$key]."_input_element".$id.$k."_".$l]) ? esc_html(stripslashes($_POST[$label_id[$key]."_input_element".$id.$k."_".$l])) : "")."')
|
| 4931 |
-
document.getElementById('".$label_id[$key]."_input_element".$id.$k."_".$l."').setAttribute('checked', 'checked');
|
| 4932 |
-
}";
|
| 4933 |
-
}
|
| 4934 |
-
}
|
| 4935 |
-
$form_maker_front_end .=
|
| 4936 |
-
"}
|
| 4937 |
-
else
|
| 4938 |
-
if (document.getElementById('".$label_id[$key]."_input_type".$id."').value == 'text') {";
|
| 4939 |
-
for ($k = 1; $k < 40; $k++) {
|
| 4940 |
-
for ($l = 1; $l < 40; $l++) {
|
| 4941 |
-
$form_maker_front_end .=
|
| 4942 |
-
"if (document.getElementById('".$label_id[$key]."_input_element".$id.$k."_".$l."'))
|
| 4943 |
-
document.getElementById('".$label_id[$key]."_input_element".$id.$k."_".$l."').value='".(isset($_POST[$label_id[$key]."_input_element".$id.$k."_".$l]) ? esc_html(stripslashes($_POST[$label_id[$key]."_input_element".$id.$k."_".$l])) : "")."';";
|
| 4944 |
-
}
|
| 4945 |
-
}
|
| 4946 |
-
$form_maker_front_end .= "
|
| 4947 |
-
}
|
| 4948 |
-
else
|
| 4949 |
-
if (document.getElementById('".$label_id[$key]."_input_type".$id."').value == 'select') {";
|
| 4950 |
-
for ($k = 1; $k < 40; $k++) {
|
| 4951 |
-
for ($l = 1; $l < 40; $l++) {
|
| 4952 |
-
$form_maker_front_end .=
|
| 4953 |
-
"if (document.getElementById('".$label_id[$key]."_select_yes_no".$id.$k."_".$l."'))
|
| 4954 |
-
document.getElementById('".$label_id[$key]."_select_yes_no".$id.$k."_".$l."').value='".(isset($_POST[$label_id[$key]."_select_yes_no".$id.$k."_".$l]) ? esc_html(stripslashes($_POST[$label_id[$key]."_select_yes_no".$id.$k."_".$l])) : "")."';";
|
| 4955 |
-
}
|
| 4956 |
-
}
|
| 4957 |
-
$form_maker_front_end .=
|
| 4958 |
-
"}";
|
| 4959 |
-
break;
|
| 4960 |
-
|
| 4961 |
-
}
|
| 4962 |
-
case "type_address":
|
| 4963 |
-
{
|
| 4964 |
-
if ($key > $old_key) {
|
| 4965 |
-
$form_maker_front_end .= "if(document.getElementById('" . $label_id[$key] . "_street1" . $id . "'))
|
| 4966 |
-
{
|
| 4967 |
-
document.getElementById('" . $label_id[$key] . "_street1" . $id . "').value='" . addslashes(isset($_POST[$label_id[$key] . "_street1" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_street1" . $id])) : "") . "';
|
| 4968 |
-
document.getElementById('" . $label_id[$key] . "_street2" . $id . "').value='" . addslashes(isset($_POST[$label_id[$key + 1] . "_street2" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key + 1] . "_street2" . $id])) : "") . "';
|
| 4969 |
-
document.getElementById('" . $label_id[$key] . "_city" . $id . "').value='" . addslashes(isset($_POST[$label_id[$key + 2] . "_city" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key + 2] . "_city" . $id])) : "") . "';
|
| 4970 |
-
document.getElementById('" . $label_id[$key] . "_state" . $id . "').value='" . addslashes(isset($_POST[$label_id[$key + 3] . "_state" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key + 3] . "_state" . $id])) : "") . "';
|
| 4971 |
-
document.getElementById('" . $label_id[$key] . "_postal" . $id . "').value='" . addslashes(isset($_POST[$label_id[$key + 4] . "_postal" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key + 4] . "_postal" . $id])) : "") . "';
|
| 4972 |
-
document.getElementById('" . $label_id[$key] . "_country" . $id . "').value='" . addslashes(isset($_POST[$label_id[$key + 5] . "_country" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key + 5] . "_country" . $id])) : "") . "';
|
| 4973 |
-
|
| 4974 |
-
}";
|
| 4975 |
-
$old_key = $key + 5;
|
| 4976 |
-
}
|
| 4977 |
-
break;
|
| 4978 |
-
}
|
| 4979 |
-
case "type_checkbox":
|
| 4980 |
-
{
|
| 4981 |
-
$is_other = FALSE;
|
| 4982 |
-
if (isset($_POST[$label_id[$key] . "_allow_other" . $id]) && esc_html(stripslashes($_POST[$label_id[$key] . "_allow_other" . $id])) == "yes") {
|
| 4983 |
-
$other_element = isset($_POST[$label_id[$key] . "_other_input" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_other_input" . $id])) : "";
|
| 4984 |
-
$other_element_id = isset($_POST[$label_id[$key] . "_allow_other_num" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_allow_other_num" . $id])) : NULL;
|
| 4985 |
-
if (isset($_POST[$label_id[$key] . "_allow_other_num" . $id]))
|
| 4986 |
-
$is_other = TRUE;
|
| 4987 |
-
}
|
| 4988 |
-
$form_maker_front_end .= "
|
| 4989 |
-
if(document.getElementById('" . $label_id[$key] . "_other_input" . $id . "'))
|
| 4990 |
-
{
|
| 4991 |
-
document.getElementById('" . $label_id[$key] . "_other_input" . $id . "').parentNode.removeChild(document.getElementById('" . $label_id[$key] . "_other_br" . $id . "'));
|
| 4992 |
-
document.getElementById('" . $label_id[$key] . "_other_input" . $id . "').parentNode.removeChild(document.getElementById('" . $label_id[$key] . "_other_input" . $id . "'));
|
| 4993 |
-
}
|
| 4994 |
-
for(k=0; k<30; k++)
|
| 4995 |
-
if(document.getElementById('" . $label_id[$key] . "_element" . $id . "'+k))
|
| 4996 |
-
document.getElementById('" . $label_id[$key] . "_element" . $id . "'+k).removeAttribute('checked');
|
| 4997 |
-
else break;
|
| 4998 |
-
";
|
| 4999 |
-
for ($j = 0; $j < 100; $j++) {
|
| 5000 |
-
$element = isset($_POST[$label_id[$key] . "_element" . $id . $j]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element" . $id . $j])) : NULL;
|
| 5001 |
-
if (isset($_POST[$label_id[$key] . "_element" . $id . $j])) {
|
| 5002 |
-
$form_maker_front_end .= "document.getElementById('" . $label_id[$key] . "_element" . $id . $j . "').setAttribute('checked', 'checked');
|
| 5003 |
-
";
|
| 5004 |
-
}
|
| 5005 |
-
}
|
| 5006 |
-
if ($is_other)
|
| 5007 |
-
$form_maker_front_end .= "
|
| 5008 |
-
show_other_input('" . $label_id[$key] . "','" . $id . "');
|
| 5009 |
-
document.getElementById('" . $label_id[$key] . "_other_input" . $id . "').value='" . (isset($_POST[$label_id[$key] . "_other_input" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_other_input" . $id])) : "") . "';
|
| 5010 |
-
";
|
| 5011 |
-
break;
|
| 5012 |
-
}
|
| 5013 |
-
case "type_radio":
|
| 5014 |
-
{
|
| 5015 |
-
$is_other = FALSE;
|
| 5016 |
-
if (isset($_POST[$label_id[$key] . "_allow_other" . $id]) && esc_html(stripslashes($_POST[$label_id[$key] . "_allow_other" . $id])) == "yes") {
|
| 5017 |
-
$other_element = isset($_POST[$label_id[$key] . "_other_input" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_other_input" . $id])) : "";
|
| 5018 |
-
if (isset($_POST[$label_id[$key] . "_other_input" . $id]))
|
| 5019 |
-
$is_other = TRUE;
|
| 5020 |
-
}
|
| 5021 |
-
$form_maker_front_end .= "
|
| 5022 |
-
if(document.getElementById('" . $label_id[$key] . "_other_input" . $id . "'))
|
| 5023 |
-
{
|
| 5024 |
-
document.getElementById('" . $label_id[$key] . "_other_input" . $id . "').parentNode.removeChild(document.getElementById('" . $label_id[$key] . "_other_br" . $id . "'));
|
| 5025 |
-
document.getElementById('" . $label_id[$key] . "_other_input" . $id . "').parentNode.removeChild(document.getElementById('" . $label_id[$key] . "_other_input" . $id . "'));
|
| 5026 |
-
}
|
| 5027 |
-
|
| 5028 |
-
for(k=0; k<50; k++)
|
| 5029 |
-
if(document.getElementById('" . $label_id[$key] . "_element" . $id . "'+k))
|
| 5030 |
-
{
|
| 5031 |
-
document.getElementById('" . $label_id[$key] . "_element" . $id . "'+k).removeAttribute('checked');
|
| 5032 |
-
if(document.getElementById('" . $label_id[$key] . "_element" . $id . "'+k).value=='" . addslashes(isset($_POST[$label_id[$key] . "_element" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element" . $id])) : "") . "')
|
| 5033 |
-
{
|
| 5034 |
-
document.getElementById('" . $label_id[$key] . "_element" . $id . "'+k).setAttribute('checked', 'checked');
|
| 5035 |
-
|
| 5036 |
-
}
|
| 5037 |
-
}
|
| 5038 |
-
else break;
|
| 5039 |
-
";
|
| 5040 |
-
if ($is_other)
|
| 5041 |
-
$form_maker_front_end .= "
|
| 5042 |
-
show_other_input('" . $label_id[$key] . "','" . $id . "');
|
| 5043 |
-
document.getElementById('" . $label_id[$key] . "_other_input" . $id . "').value='" . (isset($_POST[$label_id[$key] . "_other_input" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_other_input" . $id])) : "") . "';
|
| 5044 |
-
";
|
| 5045 |
-
break;
|
| 5046 |
-
}
|
| 5047 |
-
case "type_time":
|
| 5048 |
-
{
|
| 5049 |
-
$ss = isset($_POST[$label_id[$key] . "_ss" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_ss" . $id])) : "";
|
| 5050 |
-
if (isset($_POST[$label_id[$key] . "_ss" . $id])) {
|
| 5051 |
-
$form_maker_front_end .= "if(document.getElementById('" . $label_id[$key] . "_hh" . $id . "'))
|
| 5052 |
-
{
|
| 5053 |
-
document.getElementById('" . $label_id[$key] . "_hh" . $id . "').value='" . (isset($_POST[$label_id[$key] . "_hh" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_hh" . $id])) : "") . "';
|
| 5054 |
-
document.getElementById('" . $label_id[$key] . "_mm" . $id . "').value='" . (isset($_POST[$label_id[$key] . "_mm" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_mm" . $id])) : "") . "';
|
| 5055 |
-
document.getElementById('" . $label_id[$key] . "_ss" . $id . "').value='" . (isset($_POST[$label_id[$key] . "_ss" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_ss" . $id])) : "") . "';
|
| 5056 |
-
}";
|
| 5057 |
-
}
|
| 5058 |
-
else {
|
| 5059 |
-
$form_maker_front_end .= "if(document.getElementById('" . $label_id[$key] . "_hh" . $id . "'))
|
| 5060 |
-
{
|
| 5061 |
-
document.getElementById('" . $label_id[$key] . "_hh" . $id . "').value='" . (isset($_POST[$label_id[$key] . "_hh" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_hh" . $id])) : "") . "';
|
| 5062 |
-
document.getElementById('" . $label_id[$key] . "_mm" . $id . "').value='" . (isset($_POST[$label_id[$key] . "_mm" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_mm" . $id])) : "") . "';
|
| 5063 |
-
}";
|
| 5064 |
-
}
|
| 5065 |
-
$am_pm = isset($_POST[$label_id[$key] . "_am_pm" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_am_pm" . $id])) : NULL;
|
| 5066 |
-
if (isset($am_pm))
|
| 5067 |
-
$form_maker_front_end .= "if(document.getElementById('" . $label_id[$key] . "_am_pm" . $id . "'))
|
| 5068 |
-
document.getElementById('" . $label_id[$key] . "_am_pm" . $id . "').value='" . $am_pm . "';
|
| 5069 |
-
";
|
| 5070 |
-
break;
|
| 5071 |
-
}
|
| 5072 |
-
case "type_date_fields":
|
| 5073 |
-
{
|
| 5074 |
-
$form_maker_front_end .= "if(document.getElementById('" . $label_id[$key] . "_day" . $id . "'))
|
| 5075 |
-
{
|
| 5076 |
-
document.getElementById('" . $label_id[$key] . "_day" . $id . "').value='" . (isset($_POST[$label_id[$key] . "_day" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_day" . $id])) : "") . "';
|
| 5077 |
-
document.getElementById('" . $label_id[$key] . "_month" . $id . "').value='" . (isset($_POST[$label_id[$key] . "_month" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_month" . $id])) : "") . "';
|
| 5078 |
-
document.getElementById('" . $label_id[$key] . "_year" . $id . "').value='" . (isset($_POST[$label_id[$key] . "_year" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_year" . $id])) : "") . "';
|
| 5079 |
-
}";
|
| 5080 |
-
break;
|
| 5081 |
-
}
|
| 5082 |
-
case "type_date":
|
| 5083 |
-
case "type_own_select":
|
| 5084 |
-
case "type_country":
|
| 5085 |
-
{
|
| 5086 |
-
$form_maker_front_end .= "if(document.getElementById('" . $label_id[$key] . "_element" . $id . "'))
|
| 5087 |
-
document.getElementById('" . $label_id[$key] . "_element" . $id . "').value='" . addslashes(isset($_POST[$label_id[$key] . "_element" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element" . $id])) : "") . "';
|
| 5088 |
-
";
|
| 5089 |
-
break;
|
| 5090 |
-
}
|
| 5091 |
-
default:
|
| 5092 |
-
{
|
| 5093 |
-
break;
|
| 5094 |
-
}
|
| 5095 |
-
}
|
| 5096 |
-
}
|
| 5097 |
-
}
|
| 5098 |
-
$form_maker_front_end .= ' form_view_count' . $id . '=0;
|
| 5099 |
-
for(i=1; i<=30; i++)
|
| 5100 |
-
{
|
| 5101 |
-
if(document.getElementById(\'' . $id . 'form_view\'+i))
|
| 5102 |
-
{
|
| 5103 |
-
form_view_count' . $id . '++;
|
| 5104 |
-
form_view_max' . $id . '=i;
|
| 5105 |
-
document.getElementById(\'' . $id . 'form_view\'+i).parentNode.removeAttribute(\'style\');
|
| 5106 |
-
}
|
| 5107 |
-
}
|
| 5108 |
-
if(form_view_count' . $id . '>1)
|
| 5109 |
-
{
|
| 5110 |
-
for(i=1; i<=form_view_max' . $id . '; i++)
|
| 5111 |
-
{
|
| 5112 |
-
if(document.getElementById(\'' . $id . 'form_view\'+i))
|
| 5113 |
-
{
|
| 5114 |
-
first_form_view' . $id . '=i;
|
| 5115 |
-
break;
|
| 5116 |
-
}
|
| 5117 |
-
}
|
| 5118 |
-
generate_page_nav(first_form_view' . $id . ', \'' . $id . '\', form_view_count' . $id . ', form_view_max' . $id . ');
|
| 5119 |
-
}
|
| 5120 |
-
var RecaptchaOptions = {
|
| 5121 |
-
theme: "' . $row->recaptcha_theme . '"
|
| 5122 |
-
};
|
| 5123 |
-
</script>
|
| 5124 |
-
</form>';
|
| 5125 |
-
if ($is_recaptcha) {
|
| 5126 |
-
$form_maker_front_end .= '<div id="main_recaptcha" style="display:none;">';
|
| 5127 |
-
if ($row->public_key)
|
| 5128 |
-
$publickey = $row->public_key;
|
| 5129 |
-
else
|
| 5130 |
-
$publickey = '0';
|
| 5131 |
-
$error = NULL;
|
| 5132 |
-
require_once(WD_FMC_DIR . '/recaptchalib.php');
|
| 5133 |
-
$form_maker_front_end .= recaptcha_get_html($publickey, $error);
|
| 5134 |
-
$form_maker_front_end .= '</div>
|
| 5135 |
-
<script>
|
| 5136 |
-
recaptcha_html = document.getElementById(\'main_recaptcha\').innerHTML.replace(\'Recaptcha.widget = Recaptcha.$("recaptcha_widget_div"); Recaptcha.challenge_callback();\',"");
|
| 5137 |
-
document.getElementById(\'main_recaptcha\').innerHTML="";
|
| 5138 |
-
if (document.getElementById(\'wd_recaptcha' . $id . '\')) {
|
| 5139 |
-
document.getElementById(\'wd_recaptcha' . $id . '\').innerHTML=recaptcha_html;
|
| 5140 |
-
Recaptcha.widget = Recaptcha.$("recaptcha_widget_div");
|
| 5141 |
-
Recaptcha.challenge_callback();
|
| 5142 |
-
}
|
| 5143 |
-
</script>';
|
| 5144 |
-
}
|
| 5145 |
-
}
|
| 5146 |
-
return $form_maker_front_end;
|
| 5147 |
-
}
|
| 5148 |
-
|
| 5149 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5150 |
-
// Getters & Setters //
|
| 5151 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5152 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5153 |
-
// Private Methods //
|
| 5154 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5155 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5156 |
-
// Listeners //
|
| 5157 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
| 5158 |
}
|
| 1 |
+
<?php
|
| 2 |
+
|
| 3 |
+
class FMViewForm_maker_fmc {
|
| 4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5 |
+
// Events //
|
| 6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 8 |
+
// Constants //
|
| 9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 11 |
+
// Variables //
|
| 12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 13 |
+
private $model;
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 17 |
+
// Constructor & Destructor //
|
| 18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 19 |
+
public function __construct($model) {
|
| 20 |
+
$this->model = $model;
|
| 21 |
+
}
|
| 22 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 23 |
+
// Public Methods //
|
| 24 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 25 |
+
public function display($id) {
|
| 26 |
+
$fmc_settings = get_option('fmc_settings');
|
| 27 |
+
$current_url=htmlentities($_SERVER['REQUEST_URI']);
|
| 28 |
+
$form_maker_front_end = "";
|
| 29 |
+
$pattern = '/\/\/(.+)(\r\n|\r|\n)/';
|
| 30 |
+
$result = $this->model->showform($id);
|
| 31 |
+
if (!$result) {
|
| 32 |
+
return;
|
| 33 |
+
}
|
| 34 |
+
$ok = $this->model->savedata($result[0], $id);
|
| 35 |
+
if (is_numeric($ok)) {
|
| 36 |
+
$this->model->remove($ok);
|
| 37 |
+
}
|
| 38 |
+
$row = $result[0];
|
| 39 |
+
$label_id = $result[2];
|
| 40 |
+
$label_type = $result[3];
|
| 41 |
+
$form_theme = $result[4];
|
| 42 |
+
|
| 43 |
+
$old = FALSE;
|
| 44 |
+
if (isset($_SESSION['form_submit_type' . $id])) {
|
| 45 |
+
$type_and_id = $_SESSION['form_submit_type' . $id];
|
| 46 |
+
$type_and_id = explode(',', $type_and_id);
|
| 47 |
+
$form_get_type = $type_and_id[0];
|
| 48 |
+
$form_get_id = isset($type_and_id[1]) ? $type_and_id[1] : '';
|
| 49 |
+
$_SESSION['form_submit_type' . $id] = 0;
|
| 50 |
+
if ($form_get_type == 3) {
|
| 51 |
+
$_SESSION['massage_after_submit' . $id] = "";
|
| 52 |
+
$after_submission_text = $this->model->get_after_submission_text($form_get_id);
|
| 53 |
+
require_once(WD_FMC_DIR . '/framework/WDW_FMC_Library.php');
|
| 54 |
+
$form_maker_front_end .= WDW_FMC_Library::message(wpautop(html_entity_decode($after_submission_text)), 'warning', $id);
|
| 55 |
+
return $form_maker_front_end;
|
| 56 |
+
}
|
| 57 |
+
}
|
| 58 |
+
if (isset($_SESSION['redirect_paypal' . $id]) && ($_SESSION['redirect_paypal' . $id] == 1)) {
|
| 59 |
+
$_SESSION['redirect_paypal' . $id] = 0;
|
| 60 |
+
if (isset($_GET['succes'])) {
|
| 61 |
+
require_once(WD_FMC_DIR . '/framework/WDW_FMC_Library.php');
|
| 62 |
+
if ($_GET['succes'] == 0) {
|
| 63 |
+
$form_maker_front_end .= WDW_FMC_Library::message(__('Error, email was not sent.', 'form_maker'), 'error', $id);
|
| 64 |
+
}
|
| 65 |
+
else {
|
| 66 |
+
$form_maker_front_end .= WDW_FMC_Library::message(__('Your form was successfully submitted.', 'form_maker'), 'warning', $id);
|
| 67 |
+
}
|
| 68 |
+
}
|
| 69 |
+
}
|
| 70 |
+
elseif (isset($_SESSION['massage_after_submit' . $id]) && $_SESSION['massage_after_submit' . $id] != "") {
|
| 71 |
+
$message = $_SESSION['massage_after_submit' . $id];
|
| 72 |
+
$_SESSION['massage_after_submit' . $id] = "";
|
| 73 |
+
if ($_SESSION['error_or_no' . $id]) {
|
| 74 |
+
$error = 'error';
|
| 75 |
+
}
|
| 76 |
+
else {
|
| 77 |
+
$error = 'warning';
|
| 78 |
+
}
|
| 79 |
+
require_once(WD_FMC_DIR . '/framework/WDW_FMC_Library.php');
|
| 80 |
+
$form_maker_front_end .= WDW_FMC_Library::message($message, $error, $id);
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
if (isset($_SESSION['show_submit_text' . $id])) {
|
| 84 |
+
if ($_SESSION['show_submit_text' . $id] == 1) {
|
| 85 |
+
$_SESSION['show_submit_text' . $id] = 0;
|
| 86 |
+
$form_maker_front_end .= $row->submit_text;
|
| 87 |
+
return;
|
| 88 |
+
}
|
| 89 |
+
}
|
| 90 |
+
$this->model->increment_views_count($id);
|
| 91 |
+
if (isset($row->form)) {
|
| 92 |
+
$old = TRUE;
|
| 93 |
+
}
|
| 94 |
+
$article = $row->article_id;
|
| 95 |
+
|
| 96 |
+
$form_maker_front_end .= '<script type="text/javascript">' . preg_replace($pattern, ' ', $row->javascript) . '</script>';
|
| 97 |
+
$new_form_theme = explode('{', $form_theme);
|
| 98 |
+
$count_after_explod_theme = count($new_form_theme);
|
| 99 |
+
for ($i = 0; $i < $count_after_explod_theme; $i++) {
|
| 100 |
+
$body_or_classes[$i] = explode('}', $new_form_theme[$i]);
|
| 101 |
+
}
|
| 102 |
+
for ($i = 0; $i < $count_after_explod_theme; $i++) {
|
| 103 |
+
if ($i == 0) {
|
| 104 |
+
$body_or_classes[$i][0] = ".form" . $id . ' ' . str_replace(',', ", .form" . $id, $body_or_classes[$i][0]);
|
| 105 |
+
}
|
| 106 |
+
else {
|
| 107 |
+
$body_or_classes[$i][1] = ".form" . $id . ' ' . str_replace(',', ", .form" . $id, $body_or_classes[$i][1]);
|
| 108 |
+
}
|
| 109 |
+
}
|
| 110 |
+
for ($i = 0; $i < $count_after_explod_theme; $i++) {
|
| 111 |
+
$body_or_classes_implode[$i] = implode('}', $body_or_classes[$i]);
|
| 112 |
+
}
|
| 113 |
+
$form_theme = implode('{', $body_or_classes_implode);
|
| 114 |
+
$form_theme = preg_replace($pattern, ' ', $form_theme);
|
| 115 |
+
$form_maker_front_end .= '<style>' . str_replace('[SITE_ROOT]', WD_FMC_URL, $form_theme) . '</style>';
|
| 116 |
+
wp_print_scripts('main' . (($old == false || ($old == true && $row->form=='')) ? '_div' : '') . '_front_end', WD_FMC_URL . '/js/main' . (($old == false || ($old == true && $row->form=='')) ? '_div' : '') . '_front_end.js?ver='. get_option("wd_form_maker_version"));
|
| 117 |
+
$form_currency = '$';
|
| 118 |
+
$check_js = '';
|
| 119 |
+
$onload_js = '';
|
| 120 |
+
$onsubmit_js = '';
|
| 121 |
+
$currency_code = array('USD', 'EUR', 'GBP', 'JPY', 'CAD', 'MXN', 'HKD', 'HUF', 'NOK', 'NZD', 'SGD', 'SEK', 'PLN', 'AUD', 'DKK', 'CHF', 'CZK', 'ILS', 'BRL', 'TWD', 'MYR', 'PHP', 'THB');
|
| 122 |
+
$currency_sign = array('$', '€', '£', '¥', 'C$', 'Mex$', 'HK$', 'Ft', 'kr', 'NZ$', 'S$', 'kr', 'zl', 'A$', 'kr', 'CHF', 'Kc', '₪', 'R$', 'NT$', 'RM', '₱', '฿');
|
| 123 |
+
if ($row->payment_currency) {
|
| 124 |
+
$form_currency = $currency_sign[array_search($row->payment_currency, $currency_code)];
|
| 125 |
+
}
|
| 126 |
+
$form_paypal_tax = $row->tax;
|
| 127 |
+
$form_maker_front_end .= '<form name="form' . $id . '" action="' . $current_url . '" method="post" id="form' . $id . '" class="form' . $id . '" enctype="multipart/form-data" onsubmit="check_required(\'submit\', \'' . $id . '\'); return false;">
|
| 128 |
+
<div id="' . $id . 'pages" class="wdform_page_navigation" show_title="' . $row->show_title . '" show_numbers="' . $row->show_numbers . '" type="' . $row->pagination . '"></div>
|
| 129 |
+
<input type="hidden" id="counter' . $id . '" value="' . $row->counter . '" name="counter' . $id . '" />
|
| 130 |
+
<input type="hidden" id="Itemid' . $id . '" value="" name="Itemid' . $id . '" />';
|
| 131 |
+
if ($old == FALSE || ($old == TRUE && $row->form == '')) {
|
| 132 |
+
$is_type = array();
|
| 133 |
+
$id1s = array();
|
| 134 |
+
$types = array();
|
| 135 |
+
$labels = array();
|
| 136 |
+
$paramss = array();
|
| 137 |
+
$required_sym = $row->requiredmark;
|
| 138 |
+
$fields = explode('*:*new_field*:*', $row->form_fields);
|
| 139 |
+
$fields = array_slice($fields,0, count($fields) - 1);
|
| 140 |
+
foreach ($fields as $field) {
|
| 141 |
+
$temp = explode('*:*id*:*', $field);
|
| 142 |
+
array_push($id1s, $temp[0]);
|
| 143 |
+
$temp = explode('*:*type*:*', $temp[1]);
|
| 144 |
+
array_push($types, $temp[0]);
|
| 145 |
+
$temp = explode('*:*w_field_label*:*', $temp[1]);
|
| 146 |
+
array_push($labels, $temp[0]);
|
| 147 |
+
array_push($paramss, $temp[1]);
|
| 148 |
+
}
|
| 149 |
+
$form_id = $id;
|
| 150 |
+
|
| 151 |
+
$show_hide = array();
|
| 152 |
+
$field_label = array();
|
| 153 |
+
$all_any = array();
|
| 154 |
+
$condition_params = array();
|
| 155 |
+
$type_and_id = array();
|
| 156 |
+
|
| 157 |
+
$condition_js='';
|
| 158 |
+
if($row->condition!="")
|
| 159 |
+
{
|
| 160 |
+
$conditions=explode('*:*new_condition*:*',$row->condition);
|
| 161 |
+
$conditions = array_slice($conditions,0, count($conditions)-1);
|
| 162 |
+
$count_of_conditions = count($conditions);
|
| 163 |
+
|
| 164 |
+
foreach($conditions as $condition)
|
| 165 |
+
{
|
| 166 |
+
$temp=explode('*:*show_hide*:*',$condition);
|
| 167 |
+
array_push($show_hide, $temp[0]);
|
| 168 |
+
$temp=explode('*:*field_label*:*',$temp[1]);
|
| 169 |
+
array_push($field_label, $temp[0]);
|
| 170 |
+
$temp=explode('*:*all_any*:*',$temp[1]);
|
| 171 |
+
array_push($all_any, $temp[0]);
|
| 172 |
+
array_push($condition_params, $temp[1]);
|
| 173 |
+
}
|
| 174 |
+
|
| 175 |
+
foreach($id1s as $id1s_key => $id1)
|
| 176 |
+
{
|
| 177 |
+
$type_and_id[$id1]=$types[$id1s_key];
|
| 178 |
+
}
|
| 179 |
+
|
| 180 |
+
|
| 181 |
+
for($k=0; $k<$count_of_conditions; $k++)
|
| 182 |
+
{
|
| 183 |
+
if($show_hide[$k])
|
| 184 |
+
{
|
| 185 |
+
$display = 'removeAttr("style")';
|
| 186 |
+
$display_none = 'css("display", "none")';
|
| 187 |
+
}
|
| 188 |
+
else
|
| 189 |
+
{
|
| 190 |
+
$display = 'css("display", "none")';
|
| 191 |
+
$display_none = 'removeAttr("style")';
|
| 192 |
+
}
|
| 193 |
+
|
| 194 |
+
if($all_any[$k]=="and")
|
| 195 |
+
$or_and = '&&';
|
| 196 |
+
else
|
| 197 |
+
$or_and = '||';
|
| 198 |
+
|
| 199 |
+
|
| 200 |
+
if($condition_params[$k])
|
| 201 |
+
{
|
| 202 |
+
$cond_params =explode('*:*next_condition*:*',$condition_params[$k]);
|
| 203 |
+
$cond_params = array_slice($cond_params,0, count($cond_params)-1);
|
| 204 |
+
for($l=0; $l<count($cond_params); $l++)
|
| 205 |
+
{
|
| 206 |
+
$params_value = explode('***',$cond_params[$l]);
|
| 207 |
+
if(!isset($type_and_id[$params_value[0]]))
|
| 208 |
+
unset($cond_params[$l]);
|
| 209 |
+
}
|
| 210 |
+
$cond_params = array_values($cond_params);
|
| 211 |
+
|
| 212 |
+
$if = '';
|
| 213 |
+
$keyup = '';
|
| 214 |
+
$change = '';
|
| 215 |
+
$click = '';
|
| 216 |
+
|
| 217 |
+
for($m=0; $m<count($cond_params); $m++)
|
| 218 |
+
{
|
| 219 |
+
$params_value = explode('***',wp_specialchars_decode($cond_params[$m], 'single'));
|
| 220 |
+
switch($type_and_id[$params_value[0]])
|
| 221 |
+
{
|
| 222 |
+
case "type_text":
|
| 223 |
+
case "type_password":
|
| 224 |
+
case "type_textarea":
|
| 225 |
+
case "type_number":
|
| 226 |
+
case "type_submitter_mail":
|
| 227 |
+
case "type_spinner":
|
| 228 |
+
if($params_value[1] == "%" || $params_value[1] == "!%")
|
| 229 |
+
{
|
| 230 |
+
$like_or_not = ($params_value[1] == "%" ? ">" : "==");
|
| 231 |
+
$if .= ' jQuery("#wdform_'.$params_value[0].'_element'.$form_id.'").val().indexOf("'.$params_value[2].'")'.$like_or_not.'-1 ';
|
| 232 |
+
}
|
| 233 |
+
else
|
| 234 |
+
{
|
| 235 |
+
if($params_value[1] == "=" || $params_value[1] == "!")
|
| 236 |
+
{
|
| 237 |
+
$params_value[2] = "";
|
| 238 |
+
$params_value[1] = $params_value[1]."=";
|
| 239 |
+
}
|
| 240 |
+
$if .= ' jQuery("#wdform_'.$params_value[0].'_element'.$form_id.'").val()'.$params_value[1].'"'.$params_value[2].'" ';
|
| 241 |
+
}
|
| 242 |
+
|
| 243 |
+
$keyup .= '#wdform_'.$params_value[0].'_element'.$form_id.', ';
|
| 244 |
+
if($type_and_id[$params_value[0]] == "type_spinner")
|
| 245 |
+
$click .= '#wdform_'.$params_value[0].'_element'.$form_id.' ~ a, ';
|
| 246 |
+
break;
|
| 247 |
+
|
| 248 |
+
case "type_name":
|
| 249 |
+
if($params_value[1] == "%" || $params_value[1] == "!%")
|
| 250 |
+
{
|
| 251 |
+
$extended0 = '';
|
| 252 |
+
$extended1 = '';
|
| 253 |
+
$extended2 = '';
|
| 254 |
+
$extended3 = '';
|
| 255 |
+
$normal0 = '';
|
| 256 |
+
$normal1 = '';
|
| 257 |
+
$normal2 = '';
|
| 258 |
+
$normal3 = '';
|
| 259 |
+
|
| 260 |
+
$like_or_not = ($params_value[1] == "%" ? ">" : "==");
|
| 261 |
+
$name_fields = explode(' ',$params_value[2]);
|
| 262 |
+
if($name_fields[0]!='')
|
| 263 |
+
{
|
| 264 |
+
$extended0 = 'jQuery("#wdform_'.$params_value[0].'_element_title'.$form_id.'").val().indexOf("'.$name_fields[0].'")'.$like_or_not.'-1 ';
|
| 265 |
+
$normal0 = 'jQuery("#wdform_'.$params_value[0].'_element_first'.$form_id.'").val().indexOf("'.$name_fields[0].'")'.$like_or_not.'-1 ';
|
| 266 |
+
}
|
| 267 |
+
|
| 268 |
+
if(isset($name_fields[1]) && $name_fields[1]!='')
|
| 269 |
+
{
|
| 270 |
+
$extended1 = 'jQuery("#wdform_'.$params_value[0].'_element_first'.$form_id.'").val().indexOf("'.$name_fields[1].'")'.$like_or_not.'-1 ';
|
| 271 |
+
$normal1 = 'jQuery("#wdform_'.$params_value[0].'_element_last'.$form_id.'").val().indexOf("'.$name_fields[1].'")'.$like_or_not.'-1 ';
|
| 272 |
+
}
|
| 273 |
+
|
| 274 |
+
if(isset($name_fields[2]) && $name_fields[2]!='')
|
| 275 |
+
{
|
| 276 |
+
$extended2 = 'jQuery("#wdform_'.$params_value[0].'_element_last'.$form_id.'").val().indexOf("'.$name_fields[2].'")'.$like_or_not.'-1 ';
|
| 277 |
+
$normal2 = '';
|
| 278 |
+
}
|
| 279 |
+
|
| 280 |
+
if(isset($name_fields[3]) && $name_fields[3]!='')
|
| 281 |
+
{
|
| 282 |
+
$extended3 = 'jQuery("#wdform_'.$params_value[0].'_element_middle'.$form_id.'").val().indexOf("'.$name_fields[3].'")'.$like_or_not.'-1 ';
|
| 283 |
+
$normal3 = '';
|
| 284 |
+
}
|
| 285 |
+
|
| 286 |
+
|
| 287 |
+
if(isset($name_fields[3]))
|
| 288 |
+
{
|
| 289 |
+
$extended ='';
|
| 290 |
+
$normal ='';
|
| 291 |
+
if($extended0)
|
| 292 |
+
{
|
| 293 |
+
$extended = $extended0;
|
| 294 |
+
if($extended1)
|
| 295 |
+
{
|
| 296 |
+
$extended .= ' && '.$extended1;
|
| 297 |
+
if($extended2)
|
| 298 |
+
$extended .=' && '.$extended2;
|
| 299 |
+
|
| 300 |
+
if($extended3)
|
| 301 |
+
$extended .=' && '.$extended3;
|
| 302 |
+
}
|
| 303 |
+
else
|
| 304 |
+
{
|
| 305 |
+
if($extended2)
|
| 306 |
+
$extended .= ' && '.$extended2;
|
| 307 |
+
if($extended3)
|
| 308 |
+
$extended .= ' && '.$extended3;
|
| 309 |
+
}
|
| 310 |
+
}
|
| 311 |
+
else
|
| 312 |
+
{
|
| 313 |
+
if($extended1)
|
| 314 |
+
{
|
| 315 |
+
$extended = $extended1;
|
| 316 |
+
if($extended2)
|
| 317 |
+
$extended .=' && '.$extended2;
|
| 318 |
+
|
| 319 |
+
if($extended3)
|
| 320 |
+
$extended .=' && '.$extended3;
|
| 321 |
+
}
|
| 322 |
+
else
|
| 323 |
+
{
|
| 324 |
+
if($extended2)
|
| 325 |
+
{
|
| 326 |
+
$extended = $extended2;
|
| 327 |
+
if($extended3)
|
| 328 |
+
$extended .= ' && '.$extended3;
|
| 329 |
+
}
|
| 330 |
+
else
|
| 331 |
+
if($extended3)
|
| 332 |
+
$extended = $extended3;
|
| 333 |
+
}
|
| 334 |
+
}
|
| 335 |
+
|
| 336 |
+
if($normal0)
|
| 337 |
+
{
|
| 338 |
+
$normal = $normal0;
|
| 339 |
+
if($normal1)
|
| 340 |
+
$normal .= ' && '.$normal1;
|
| 341 |
+
}
|
| 342 |
+
else
|
| 343 |
+
{
|
| 344 |
+
if($normal1)
|
| 345 |
+
$normal = $normal1;
|
| 346 |
+
}
|
| 347 |
+
}
|
| 348 |
+
else
|
| 349 |
+
{
|
| 350 |
+
if(isset($name_fields[2]))
|
| 351 |
+
{
|
| 352 |
+
$extended ="";
|
| 353 |
+
$normal ="";
|
| 354 |
+
if($extended0)
|
| 355 |
+
{
|
| 356 |
+
$extended = $extended0;
|
| 357 |
+
if($extended1)
|
| 358 |
+
$extended .= ' && '.$extended1;
|
| 359 |
+
|
| 360 |
+
if($extended2)
|
| 361 |
+
$extended .=' && '.$extended2;
|
| 362 |
+
|
| 363 |
+
}
|
| 364 |
+
else
|
| 365 |
+
{
|
| 366 |
+
if($extended1)
|
| 367 |
+
{
|
| 368 |
+
$extended = $extended1;
|
| 369 |
+
if($extended2)
|
| 370 |
+
$extended .= ' && '.$extended2;
|
| 371 |
+
}
|
| 372 |
+
else
|
| 373 |
+
if($extended2)
|
| 374 |
+
$extended = $extended2;
|
| 375 |
+
}
|
| 376 |
+
|
| 377 |
+
|
| 378 |
+
if($normal0)
|
| 379 |
+
{
|
| 380 |
+
$normal = $normal0;
|
| 381 |
+
if($normal1)
|
| 382 |
+
$normal .= ' && '.$normal1;
|
| 383 |
+
}
|
| 384 |
+
else
|
| 385 |
+
{
|
| 386 |
+
if($normal1)
|
| 387 |
+
$normal = $normal1;
|
| 388 |
+
}
|
| 389 |
+
|
| 390 |
+
}
|
| 391 |
+
else
|
| 392 |
+
{
|
| 393 |
+
if(isset($name_fields[1]))
|
| 394 |
+
{
|
| 395 |
+
$extended ='';
|
| 396 |
+
$normal ='';
|
| 397 |
+
if($extended0)
|
| 398 |
+
{
|
| 399 |
+
if($extended1)
|
| 400 |
+
$extended = $extended0.' && '.$extended1;
|
| 401 |
+
else
|
| 402 |
+
$extended = $extended0;
|
| 403 |
+
}
|
| 404 |
+
else
|
| 405 |
+
{
|
| 406 |
+
if($extended1)
|
| 407 |
+
$extended = $extended1;
|
| 408 |
+
}
|
| 409 |
+
|
| 410 |
+
|
| 411 |
+
if($normal0)
|
| 412 |
+
{
|
| 413 |
+
if($normal1)
|
| 414 |
+
$normal = $normal0.' && '.$normal1;
|
| 415 |
+
else
|
| 416 |
+
$normal = $normal0;
|
| 417 |
+
}
|
| 418 |
+
else
|
| 419 |
+
{
|
| 420 |
+
if($normal1)
|
| 421 |
+
$normal = $normal1;
|
| 422 |
+
}
|
| 423 |
+
}
|
| 424 |
+
else
|
| 425 |
+
{
|
| 426 |
+
$extended = $extended0;
|
| 427 |
+
$normal = $normal0;
|
| 428 |
+
}
|
| 429 |
+
}
|
| 430 |
+
}
|
| 431 |
+
|
| 432 |
+
if($extended!="" && $normal!="")
|
| 433 |
+
$if .= ' ((jQuery("#wdform_'.$params_value[0].'_element_title'.$form_id.'").length != 0 || jQuery("#wdform_'.$params_value[0].'_element_middle'.$form_id.'").length != 0) ? '.$extended.' : '.$normal.') ';
|
| 434 |
+
else
|
| 435 |
+
$if .= ' true';
|
| 436 |
+
}
|
| 437 |
+
else
|
| 438 |
+
{
|
| 439 |
+
if($params_value[1] == "=" || $params_value[1] == "!")
|
| 440 |
+
{
|
| 441 |
+
$name_and_or = $params_value[1] == "=" ? "&&" : "||";
|
| 442 |
+
$name_empty_or_not = $params_value[1]."=";
|
| 443 |
+
$extended = ' (jQuery("#wdform_'.$params_value[0].'_element_title'.$form_id.'").val()'.$name_empty_or_not.'"" '.$name_and_or.' jQuery("#wdform_'.$params_value[0].'_element_first'.$form_id.'").val()'.$name_empty_or_not.'"" '.$name_and_or.' jQuery("#wdform_'.$params_value[0].'_element_last'.$form_id.'").val()'.$name_empty_or_not.'"" '.$name_and_or.' jQuery("#wdform_'.$params_value[0].'_element_middle'.$form_id.'").val()'.$name_empty_or_not.'"") ';
|
| 444 |
+
$normal = ' (jQuery("#wdform_'.$params_value[0].'_element_first'.$form_id.'").val()'.$name_empty_or_not.'"" '.$name_and_or.' jQuery("#wdform_'.$params_value[0].'_element_last'.$form_id.'").val()'.$name_empty_or_not.'"") ';
|
| 445 |
+
|
| 446 |
+
$if .= ' ((jQuery("#wdform_'.$params_value[0].'_element_title'.$form_id.'").length != 0 || jQuery("#wdform_'.$params_value[0].'_element_middle'.$form_id.'").length != 0) ? '.$extended.' : '.$normal.') ';
|
| 447 |
+
}
|
| 448 |
+
else
|
| 449 |
+
{
|
| 450 |
+
$extended0 = '';
|
| 451 |
+
$extended1 = '';
|
| 452 |
+
$extended2 = '';
|
| 453 |
+
$extended3 = '';
|
| 454 |
+
$normal0 = '';
|
| 455 |
+
$normal1 = '';
|
| 456 |
+
$normal2 = '';
|
| 457 |
+
$normal3 = '';
|
| 458 |
+
|
| 459 |
+
$name_fields = explode(' ',$params_value[2]);
|
| 460 |
+
if($name_fields[0]!='')
|
| 461 |
+
{
|
| 462 |
+
$extended0 = 'jQuery("#wdform_'.$params_value[0].'_element_title'.$form_id.'").val()'.$params_value[1].'"'.$name_fields[0].'"';
|
| 463 |
+
$normal0 = 'jQuery("#wdform_'.$params_value[0].'_element_first'.$form_id.'").val()'.$params_value[1].'"'.$name_fields[0].'"';
|
| 464 |
+
}
|
| 465 |
+
|
| 466 |
+
if(isset($name_fields[1]) && $name_fields[1]!='')
|
| 467 |
+
{
|
| 468 |
+
$extended1 = 'jQuery("#wdform_'.$params_value[0].'_element_first'.$form_id.'").val()'.$params_value[1].'"'.$name_fields[1].'"';
|
| 469 |
+
$normal1 = 'jQuery("#wdform_'.$params_value[0].'_element_last'.$form_id.'").val()'.$params_value[1].'"'.$name_fields[1].'"';
|
| 470 |
+
}
|
| 471 |
+
|
| 472 |
+
if(isset($name_fields[2]) && $name_fields[2]!='')
|
| 473 |
+
{
|
| 474 |
+
$extended2 = 'jQuery("#wdform_'.$params_value[0].'_element_last'.$form_id.'").val()'.$params_value[1].'"'.$name_fields[2].'"';
|
| 475 |
+
$normal2 = '';
|
| 476 |
+
}
|
| 477 |
+
|
| 478 |
+
if(isset($name_fields[3]) && $name_fields[3]!='')
|
| 479 |
+
{
|
| 480 |
+
$extended3 = 'jQuery("#wdform_'.$params_value[0].'_element_middle'.$form_id.'").val()'.$params_value[1].'"'.$name_fields[3].'"';
|
| 481 |
+
$normal3 = '';
|
| 482 |
+
}
|
| 483 |
+
|
| 484 |
+
|
| 485 |
+
if(isset($name_fields[3]))
|
| 486 |
+
{
|
| 487 |
+
$extended ='';
|
| 488 |
+
$normal ='';
|
| 489 |
+
|
| 490 |
+
if($extended0)
|
| 491 |
+
{
|
| 492 |
+
$extended = $extended0;
|
| 493 |
+
if($extended1)
|
| 494 |
+
{
|
| 495 |
+
$extended .= ' && '.$extended1;
|
| 496 |
+
if($extended2)
|
| 497 |
+
$extended .= ' && '.$extended2;
|
| 498 |
+
|
| 499 |
+
if($extended3)
|
| 500 |
+
$extended .= ' && '.$extended3;
|
| 501 |
+
}
|
| 502 |
+
else
|
| 503 |
+
{
|
| 504 |
+
if($extended2)
|
| 505 |
+
$extended .= ' && '.$extended2;
|
| 506 |
+
if($extended3)
|
| 507 |
+
$extended .= ' && '.$extended3;
|
| 508 |
+
}
|
| 509 |
+
}
|
| 510 |
+
else
|
| 511 |
+
{
|
| 512 |
+
if($extended1)
|
| 513 |
+
{
|
| 514 |
+
$extended = $extended1;
|
| 515 |
+
if($extended2)
|
| 516 |
+
$extended .= ' && '.$extended2;
|
| 517 |
+
|
| 518 |
+
if($extended3)
|
| 519 |
+
$extended .= ' && '.$extended3;
|
| 520 |
+
}
|
| 521 |
+
else
|
| 522 |
+
{
|
| 523 |
+
if($extended2)
|
| 524 |
+
{
|
| 525 |
+
$extended = $extended2;
|
| 526 |
+
if($extended3)
|
| 527 |
+
$extended .= ' && '.$extended3;
|
| 528 |
+
}
|
| 529 |
+
else
|
| 530 |
+
if($extended3)
|
| 531 |
+
$extended = $extended3;
|
| 532 |
+
}
|
| 533 |
+
}
|
| 534 |
+
|
| 535 |
+
if($normal0)
|
| 536 |
+
{
|
| 537 |
+
$normal = $normal0;
|
| 538 |
+
if($normal1)
|
| 539 |
+
$normal .= ' && '.$normal1;
|
| 540 |
+
}
|
| 541 |
+
else
|
| 542 |
+
{
|
| 543 |
+
if($normal1)
|
| 544 |
+
$normal = $normal1;
|
| 545 |
+
}
|
| 546 |
+
}
|
| 547 |
+
else
|
| 548 |
+
{
|
| 549 |
+
if(isset($name_fields[2]))
|
| 550 |
+
{
|
| 551 |
+
$extended ="";
|
| 552 |
+
$normal ="";
|
| 553 |
+
if($extended0)
|
| 554 |
+
{
|
| 555 |
+
$extended = $extended0;
|
| 556 |
+
if($extended1)
|
| 557 |
+
$extended .= ' && '.$extended1;
|
| 558 |
+
|
| 559 |
+
if($extended2)
|
| 560 |
+
$extended .= ' && '.$extended2;
|
| 561 |
+
|
| 562 |
+
}
|
| 563 |
+
else
|
| 564 |
+
{
|
| 565 |
+
if($extended1)
|
| 566 |
+
{
|
| 567 |
+
$extended = $extended1;
|
| 568 |
+
if($extended2)
|
| 569 |
+
$extended .= ' && '.$extended2;
|
| 570 |
+
}
|
| 571 |
+
else
|
| 572 |
+
if($extended2)
|
| 573 |
+
$extended = $extended2;
|
| 574 |
+
}
|
| 575 |
+
|
| 576 |
+
|
| 577 |
+
if($normal0)
|
| 578 |
+
{
|
| 579 |
+
$normal = $normal0;
|
| 580 |
+
if($normal1)
|
| 581 |
+
$normal .= ' && '.$normal1;
|
| 582 |
+
}
|
| 583 |
+
else
|
| 584 |
+
{
|
| 585 |
+
if($normal1)
|
| 586 |
+
$normal = $normal1;
|
| 587 |
+
}
|
| 588 |
+
|
| 589 |
+
}
|
| 590 |
+
else
|
| 591 |
+
{
|
| 592 |
+
if(isset($name_fields[1]))
|
| 593 |
+
{
|
| 594 |
+
$extended ='';
|
| 595 |
+
$normal ='';
|
| 596 |
+
if($extended0)
|
| 597 |
+
{
|
| 598 |
+
if($extended1)
|
| 599 |
+
$extended = $extended0.' && '.$extended1;
|
| 600 |
+
else
|
| 601 |
+
$extended = $extended0;
|
| 602 |
+
}
|
| 603 |
+
else
|
| 604 |
+
{
|
| 605 |
+
if($extended1)
|
| 606 |
+
$extended = $extended1;
|
| 607 |
+
}
|
| 608 |
+
|
| 609 |
+
|
| 610 |
+
if($normal0)
|
| 611 |
+
{
|
| 612 |
+
if($normal1)
|
| 613 |
+
$normal = $normal0.' && '.$normal1;
|
| 614 |
+
else
|
| 615 |
+
$normal = $normal0;
|
| 616 |
+
}
|
| 617 |
+
else
|
| 618 |
+
{
|
| 619 |
+
if($normal1)
|
| 620 |
+
$normal = $normal1;
|
| 621 |
+
}
|
| 622 |
+
}
|
| 623 |
+
else
|
| 624 |
+
{
|
| 625 |
+
$extended = $extended0;
|
| 626 |
+
$normal = $normal0;
|
| 627 |
+
}
|
| 628 |
+
}
|
| 629 |
+
}
|
| 630 |
+
|
| 631 |
+
if($extended!="" && $normal!="")
|
| 632 |
+
$if .= ' ((jQuery("#wdform_'.$params_value[0].'_element_title'.$form_id.'").length != 0 || jQuery("#wdform_'.$params_value[0].'_element_middle'.$form_id.'").length != 0) ? '.$extended.' : '.$normal.') ';
|
| 633 |
+
else
|
| 634 |
+
$if .= ' true';
|
| 635 |
+
}
|
| 636 |
+
}
|
| 637 |
+
$keyup .= '#wdform_'.$params_value[0].'_element_title'.$form_id.', #wdform_'.$params_value[0].'_element_first'.$form_id.', #wdform_'.$params_value[0].'_element_last'.$form_id.', #wdform_'.$params_value[0].'_element_middle'.$form_id.', ';
|
| 638 |
+
break;
|
| 639 |
+
|
| 640 |
+
case "type_phone":
|
| 641 |
+
if($params_value[1] == "==" || $params_value[1] == "!=")
|
| 642 |
+
{
|
| 643 |
+
$phone_fields = explode(' ',$params_value[2]);
|
| 644 |
+
if(isset($phone_fields[1]))
|
| 645 |
+
{
|
| 646 |
+
if($phone_fields[0]!='' && $phone_fields[1]!='')
|
| 647 |
+
$if .= ' (jQuery("#wdform_'.$params_value[0].'_element_first'.$form_id.'").val()'.$params_value[1].'"'.$phone_fields[0].'" && jQuery("#wdform_'.$params_value[0].'_element_last'.$form_id.'").val()'.$params_value[1].'"'.$phone_fields[1].'") ';
|
| 648 |
+
else
|
| 649 |
+
{
|
| 650 |
+
if($phone_fields[0]=='')
|
| 651 |
+
$if .= ' (jQuery("#wdform_'.$params_value[0].'_element_last'.$form_id.'").val()'.$params_value[1].'"'.$phone_fields[1].'") ';
|
| 652 |
+
else
|
| 653 |
+
if($phone_fields[1]=='')
|
| 654 |
+
$if .= ' (jQuery("#wdform_'.$params_value[0].'_element_first'.$form_id.'").val()'.$params_value[1].'"'.$phone_fields[1].'") ';
|
| 655 |
+
}
|
| 656 |
+
}
|
| 657 |
+
else
|
| 658 |
+
$if .= ' jQuery("#wdform_'.$params_value[0].'_element_first'.$form_id.'").val()'.$params_value[1].'"'.$params_value[2].'" ';
|
| 659 |
+
}
|
| 660 |
+
|
| 661 |
+
if($params_value[1] == "%" || $params_value[1] == "!%")
|
| 662 |
+
{
|
| 663 |
+
$like_or_not = ($params_value[1] == "%" ? ">" : "==");
|
| 664 |
+
$phone_fields = explode(' ',$params_value[2]);
|
| 665 |
+
if(isset($phone_fields[1]))
|
| 666 |
+
{
|
| 667 |
+
if($phone_fields[0]!='' && $phone_fields[1]!='')
|
| 668 |
+
$if .= ' (jQuery("#wdform_'.$params_value[0].'_element_first'.$form_id.'").val().indexOf("'.$phone_fields[0].'")'.$like_or_not.'-1 && jQuery("#wdform_'.$params_value[0].'_element_last'.$form_id.'").val().indexOf("'.$phone_fields[1].'")'.$like_or_not.'-1)';
|
| 669 |
+
else
|
| 670 |
+
{
|
| 671 |
+
if($phone_fields[0]=='')
|
| 672 |
+
$if .= ' (jQuery("#wdform_'.$params_value[0].'_element_last'.$form_id.'").val().indexOf("'.$phone_fields[1].'")'.$like_or_not.'-1) ';
|
| 673 |
+
else
|
| 674 |
+
if($phone_fields[1]=='')
|
| 675 |
+
$if .= ' (jQuery("#wdform_'.$params_value[0].'_element_first'.$form_id.'").val().indexOf("'.$phone_fields[0].'")'.$like_or_not.'-1) ';
|
| 676 |
+
}
|
| 677 |
+
}
|
| 678 |
+
else
|
| 679 |
+
$if .= ' (jQuery("#wdform_'.$params_value[0].'_element_first'.$form_id.'").val().indexOf("'.$phone_fields[0].'")'.$like_or_not.'-1) ';
|
| 680 |
+
}
|
| 681 |
+
|
| 682 |
+
if($params_value[1] == "=" || $params_value[1] == "!")
|
| 683 |
+
{
|
| 684 |
+
$params_value[2] = "";
|
| 685 |
+
$and_or_phone = ($params_value[1]=="=" ? "&&" : "||");
|
| 686 |
+
$params_value[1] = $params_value[1]."=";
|
| 687 |
+
|
| 688 |
+
$if .= ' (jQuery("#wdform_'.$params_value[0].'_element_first'.$form_id.'").val()'.$params_value[1].'"'.$params_value[2].'" '.$and_or_phone.' jQuery("#wdform_'.$params_value[0].'_element_last'.$form_id.'").val()'.$params_value[1].'"'.$params_value[2].'") ';
|
| 689 |
+
}
|
| 690 |
+
|
| 691 |
+
|
| 692 |
+
$keyup .= '#wdform_'.$params_value[0].'_element_first'.$form_id.', #wdform_'.$params_value[0].'_element_last'.$form_id.', ';
|
| 693 |
+
break;
|
| 694 |
+
|
| 695 |
+
case "type_paypal_price":
|
| 696 |
+
if($params_value[1] == "==" || $params_value[1] == "!=")
|
| 697 |
+
$if .= ' (jQuery("#wdform_'.$params_value[0].'_td_name_cents").attr("style")=="display: none;" ? jQuery("#wdform_'.$params_value[0].'_element_dollars'.$form_id.'").val()'.$params_value[1].'"'.$params_value[2].'" : parseFloat(jQuery("#wdform_'.$params_value[0].'_element_dollars'.$form_id.'").val()+"."+jQuery("#wdform_'.$params_value[0].'_element_cents'.$form_id.'").val())'.$params_value[1].'parseFloat("'.str_replace('.0', '.', $params_value[2]).'"))';
|
| 698 |
+
|
| 699 |
+
if($params_value[1] == "%" || $params_value[1] == "!%")
|
| 700 |
+
{
|
| 701 |
+
$like_or_not = ($params_value[1] == "%" ? ">" : "==");
|
| 702 |
+
$if .= ' (jQuery("#wdform_'.$params_value[0].'_td_name_cents").attr("style")=="display: none;" ? jQuery("#wdform_'.$params_value[0].'_element_dollars'.$form_id.'").val().indexOf("'.$params_value[2].'")'.$like_or_not.'-1 : (jQuery("#wdform_'.$params_value[0].'_element_dollars'.$form_id.'").val()+"."+jQuery("#wdform_'.$params_value[0].'_element_cents'.$form_id.'").val()).indexOf("'.str_replace('.0', '.', $params_value[2]).'")'.$like_or_not.'-1) ';
|
| 703 |
+
}
|
| 704 |
+
|
| 705 |
+
if($params_value[1] == "=" || $params_value[1] == "!")
|
| 706 |
+
{
|
| 707 |
+
$params_value[2] = "";
|
| 708 |
+
$and_or_price = ($params_value[1]=="=" ? "&&" : "||");
|
| 709 |
+
$params_value[1] = $params_value[1]."=";
|
| 710 |
+
$if .= ' (jQuery("#wdform_'.$params_value[0].'_td_name_cents").attr("style")=="display: none;" ? jQuery("#wdform_'.$params_value[0].'_element_dollars'.$form_id.'").val()'.$params_value[1].'"'.$params_value[2].'" : (jQuery("#wdform_'.$params_value[0].'_element_dollars'.$form_id.'").val()'.$params_value[1].'"'.$params_value[2].'" '.$and_or_price.' jQuery("#wdform_'.$params_value[0].'_element_cents'.$form_id.'").val()'.$params_value[1].'"'.$params_value[2].'"))';
|
| 711 |
+
}
|
| 712 |
+
|
| 713 |
+
$keyup .= '#wdform_'.$params_value[0].'_element_dollars'.$form_id.', #wdform_'.$params_value[0].'_element_cents'.$form_id.', ';
|
| 714 |
+
break;
|
| 715 |
+
|
| 716 |
+
case "type_own_select":
|
| 717 |
+
if($params_value[1] == "%" || $params_value[1] == "!%")
|
| 718 |
+
{
|
| 719 |
+
$like_or_not = ($params_value[1] == "%" ? ">" : "==");
|
| 720 |
+
$if .= ' jQuery("#wdform_'.$params_value[0].'_element'.$form_id.'").val().indexOf("'.$params_value[2].'")'.$like_or_not.'-1 ';
|
| 721 |
+
}
|
| 722 |
+
else
|
| 723 |
+
{
|
| 724 |
+
if($params_value[1] == "=" || $params_value[1] == "!")
|
| 725 |
+
{
|
| 726 |
+
$params_value[2] = "";
|
| 727 |
+
$params_value[1] = $params_value[1]."=";
|
| 728 |
+
}
|
| 729 |
+
$if .= ' jQuery("#wdform_'.$params_value[0].'_element'.$form_id.'").val()'.$params_value[1].'"'.$params_value[2].'" ';
|
| 730 |
+
}
|
| 731 |
+
$change .= '#wdform_'.$params_value[0].'_element'.$form_id.', ';
|
| 732 |
+
break;
|
| 733 |
+
|
| 734 |
+
case "type_paypal_select":
|
| 735 |
+
if($params_value[1] == "%" || $params_value[1] == "!%")
|
| 736 |
+
{
|
| 737 |
+
$like_or_not = ($params_value[1] == "%" ? ">" : "==");
|
| 738 |
+
$if .= ' jQuery("#wdform_'.$params_value[0].'_element'.$form_id.'").val().indexOf("'.$params_value[2].'")'.$like_or_not.'-1 ';
|
| 739 |
+
}
|
| 740 |
+
else
|
| 741 |
+
{
|
| 742 |
+
if($params_value[1] == "=" || $params_value[1] == "!")
|
| 743 |
+
{
|
| 744 |
+
$params_value[2] = "";
|
| 745 |
+
$params_value[1] = $params_value[1]."=";
|
| 746 |
+
$if .= ' jQuery("#wdform_'.$params_value[0].'_element'.$form_id.'").val()'.$params_value[1].'"'.$params_value[2].'"';
|
| 747 |
+
}
|
| 748 |
+
else
|
| 749 |
+
{
|
| 750 |
+
if ( strpos($params_value[2], '*:*value*:*') > -1 ) {
|
| 751 |
+
$and_or = $params_value[1] == "==" ? '&&' : '||';
|
| 752 |
+
$choise_and_value = explode("*:*value*:*", $params_value[2]);
|
| 753 |
+
$params_value[2] = $choise_and_value[1];
|
| 754 |
+
$params_label = $choise_and_value[0];
|
| 755 |
+
$if .= ' jQuery("#wdform_'.$params_value[0].'_element'.$form_id.'").val()'.$params_value[1].'"'.$params_value[2].'" '.$and_or.' jQuery("div[wdid='.$params_value[0].'] select option:selected").text()'.$params_value[1].'"'.$params_label.'" ';
|
| 756 |
+
} else {
|
| 757 |
+
$if .= ' jQuery("#wdform_'.$params_value[0].'_element'.$form_id.'").val()'.$params_value[1].'"'.$params_value[2].'" ';
|
| 758 |
+
}
|
| 759 |
+
}
|
| 760 |
+
}
|
| 761 |
+
$change .= '#wdform_'.$params_value[0].'_element'.$form_id.', ';
|
| 762 |
+
break;
|
| 763 |
+
case "type_address":
|
| 764 |
+
if($params_value[1] == "%" || $params_value[1] == "!%")
|
| 765 |
+
{
|
| 766 |
+
$like_or_not = ($params_value[1] == "%" ? ">" : "==");
|
| 767 |
+
$if .= ' jQuery("#wdform_'.$params_value[0].'_country'.$form_id.'").val().indexOf("'.$params_value[2].'")'.$like_or_not.'-1 ';
|
| 768 |
+
}
|
| 769 |
+
else
|
| 770 |
+
{
|
| 771 |
+
if($params_value[1] == "=" || $params_value[1] == "!")
|
| 772 |
+
{
|
| 773 |
+
$params_value[2] = "";
|
| 774 |
+
$params_value[1] = $params_value[1]."=";
|
| 775 |
+
}
|
| 776 |
+
$if .= ' jQuery("#wdform_'.$params_value[0].'_country'.$form_id.'").val()'.$params_value[1].'"'.$params_value[2].'" ';
|
| 777 |
+
}
|
| 778 |
+
$change .= '#wdform_'.$params_value[0].'_country'.$form_id.', ';
|
| 779 |
+
break;
|
| 780 |
+
case "type_country":
|
| 781 |
+
if($params_value[1] == "%" || $params_value[1] == "!%")
|
| 782 |
+
{
|
| 783 |
+
$like_or_not = ($params_value[1] == "%" ? ">" : "==");
|
| 784 |
+
$if .= ' wdformjQuery("#wdform_'.$params_value[0].'_element'.$form_id.'").val().indexOf("'.$params_value[2].'")'.$like_or_not.'-1 ';
|
| 785 |
+
}
|
| 786 |
+
else
|
| 787 |
+
{
|
| 788 |
+
if($params_value[1] == "=" || $params_value[1] == "!")
|
| 789 |
+
{
|
| 790 |
+
$params_value[2] = "";
|
| 791 |
+
$params_value[1] = $params_value[1]."=";
|
| 792 |
+
}
|
| 793 |
+
$if .= ' wdformjQuery("#wdform_'.$params_value[0].'_element'.$form_id.'").val()'.$params_value[1].'"'.$params_value[2].'" ';
|
| 794 |
+
}
|
| 795 |
+
$change .= '#wdform_'.$params_value[0].'_element'.$form_id.', ';
|
| 796 |
+
break;
|
| 797 |
+
|
| 798 |
+
case "type_radio":
|
| 799 |
+
case "type_paypal_radio":
|
| 800 |
+
case "type_paypal_shipping":
|
| 801 |
+
|
| 802 |
+
if($params_value[1] == "==" || $params_value[1] == "!=")
|
| 803 |
+
{
|
| 804 |
+
if ( strpos($params_value[2], '*:*value*:*') > -1 ) {
|
| 805 |
+
$and_or = $params_value[1] == "==" ? '&&' : '||';
|
| 806 |
+
$choise_and_value = explode("*:*value*:*", $params_value[2]);
|
| 807 |
+
$params_value[2] = $choise_and_value[1];
|
| 808 |
+
$params_label = $choise_and_value[0];
|
| 809 |
+
$if .= ' jQuery("input[name^=\'wdform_'.$params_value[0].'_element'.$form_id.'\']:checked").val()'.$params_value[1].'"'.$params_value[2].'" '.$and_or.' jQuery("input[name^=\'wdform_'.$params_value[0].'_element'.$form_id.'\']:checked").attr("title")'.$params_value[1].'"'.$params_label.'" ';
|
| 810 |
+
} else {
|
| 811 |
+
$if .= ' jQuery("input[name^=\'wdform_'.$params_value[0].'_element'.$form_id.'\']:checked").val()'.$params_value[1].'"'.$params_value[2].'" ';
|
| 812 |
+
}
|
| 813 |
+
|
| 814 |
+
$click .= 'div[wdid='.$params_value[0].'] input[type=\'radio\'], ';
|
| 815 |
+
}
|
| 816 |
+
|
| 817 |
+
if($params_value[1] == "%" || $params_value[1] == "!%")
|
| 818 |
+
{
|
| 819 |
+
$click .= 'div[wdid='.$params_value[0].'] input[type=\'radio\'], ';
|
| 820 |
+
$like_or_not = ($params_value[1] == "%" ? ">" : "==");
|
| 821 |
+
$if .= ' (jQuery("input[name^=\'wdform_'.$params_value[0].'_element'.$form_id.'\']:checked").val() ? (jQuery("input[name^=\'wdform_'.$params_value[0].'_element'.$form_id.'\']:checked").attr("other") ? false : (jQuery("input[name^=\'wdform_'.$params_value[0].'_element'.$form_id.'\']:checked").val().indexOf("'.$params_value[2].'")'.$like_or_not.'-1 )) : false) ';
|
| 822 |
+
|
| 823 |
+
}
|
| 824 |
+
|
| 825 |
+
if($params_value[1] == "=" || $params_value[1] == "!")
|
| 826 |
+
{
|
| 827 |
+
$ckecked_or_no = ($params_value[1] == "=" ? "!" : "");
|
| 828 |
+
$if .= ' '.$ckecked_or_no.'jQuery("input[name^=\'wdform_'.$params_value[0].'_element'.$form_id.'\']:checked").val()';
|
| 829 |
+
$click .= 'div[wdid='.$params_value[0].'] input[type=\'radio\'], ';
|
| 830 |
+
}
|
| 831 |
+
|
| 832 |
+
break;
|
| 833 |
+
|
| 834 |
+
case "type_checkbox":
|
| 835 |
+
case "type_paypal_checkbox":
|
| 836 |
+
if($params_value[1] == "==" || $params_value[1] == "!=")
|
| 837 |
+
{
|
| 838 |
+
if($params_value[2])
|
| 839 |
+
{
|
| 840 |
+
$choises = explode('@@@',$params_value[2]);
|
| 841 |
+
$choises = array_slice($choises,0, count($choises)-1);
|
| 842 |
+
|
| 843 |
+
if($params_value[1]=="!=")
|
| 844 |
+
$is = "!";
|
| 845 |
+
else
|
| 846 |
+
$is = "";
|
| 847 |
+
|
| 848 |
+
foreach($choises as $key1=>$choise)
|
| 849 |
+
{
|
| 850 |
+
if($type_and_id[$params_value[0]]=="type_paypal_checkbox")
|
| 851 |
+
{
|
| 852 |
+
$choise_and_value = explode("*:*value*:*",$choise);
|
| 853 |
+
$if .= ' '.$is.'(jQuery("div[wdid='.$params_value[0].'] input[value=\"'.$choise_and_value[1].'\"]").is(":checked") && jQuery("div[wdid='.$params_value[0].'] input[title=\"'.$choise_and_value[0].'\"]"))';
|
| 854 |
+
|
| 855 |
+
}
|
| 856 |
+
else
|
| 857 |
+
$if .= ' '.$is.'jQuery("div[wdid='.$params_value[0].'] input[value=\"'.$choise.'\"]").is(":checked") ';
|
| 858 |
+
|
| 859 |
+
if($key1!=count($choises)-1)
|
| 860 |
+
$if .= '&&';
|
| 861 |
+
}
|
| 862 |
+
|
| 863 |
+
$click .= 'div[wdid='.$params_value[0].'] input[type=\'checkbox\'], ';
|
| 864 |
+
}
|
| 865 |
+
else
|
| 866 |
+
{
|
| 867 |
+
if($or_and=='&&')
|
| 868 |
+
$if .= ' true';
|
| 869 |
+
else
|
| 870 |
+
$if .= ' false';
|
| 871 |
+
}
|
| 872 |
+
}
|
| 873 |
+
|
| 874 |
+
if($params_value[1] == "%" || $params_value[1] == "!%")
|
| 875 |
+
{
|
| 876 |
+
$like_or_not = ($params_value[1] == "%" ? ">" : "==");
|
| 877 |
+
if($params_value[2])
|
| 878 |
+
{
|
| 879 |
+
$choises = explode('@@@',$params_value[2]);
|
| 880 |
+
$choises = array_slice($choises,0, count($choises)-1);
|
| 881 |
+
|
| 882 |
+
if($type_and_id[$params_value[0]]=="type_paypal_checkbox")
|
| 883 |
+
{
|
| 884 |
+
foreach($choises as $key1=>$choise)
|
| 885 |
+
{
|
| 886 |
+
|
| 887 |
+
$choise_and_value = explode("*:*value*:*",$choise);
|
| 888 |
+
|
| 889 |
+
$if .= ' jQuery("div[wdid='.$params_value[0].'] input[type=\"checkbox\"]:checked").serialize().indexOf("'.$choise_and_value[1].'")'.$like_or_not.'-1 ';
|
| 890 |
+
|
| 891 |
+
if($key1!=count($choises)-1)
|
| 892 |
+
$if .= '&&';
|
| 893 |
+
}
|
| 894 |
+
}
|
| 895 |
+
else
|
| 896 |
+
{
|
| 897 |
+
foreach($choises as $key1=>$choise)
|
| 898 |
+
{
|
| 899 |
+
$if .= ' jQuery("div[wdid='.$params_value[0].'] input[type=\"checkbox\"]:checked").serialize().indexOf("'.str_replace(" ","+",$choise).'")'.$like_or_not.'-1 ';
|
| 900 |
+
|
| 901 |
+
if($key1!=count($choises)-1)
|
| 902 |
+
$if .= '&&';
|
| 903 |
+
}
|
| 904 |
+
}
|
| 905 |
+
|
| 906 |
+
|
| 907 |
+
|
| 908 |
+
|
| 909 |
+
$click .= 'div[wdid='.$params_value[0].'] input[type=\'checkbox\'], ';
|
| 910 |
+
}
|
| 911 |
+
else
|
| 912 |
+
{
|
| 913 |
+
if($or_and=='&&')
|
| 914 |
+
$if .= ' true';
|
| 915 |
+
else
|
| 916 |
+
$if .= ' false';
|
| 917 |
+
}
|
| 918 |
+
|
| 919 |
+
}
|
| 920 |
+
|
| 921 |
+
if($params_value[1] == "=" || $params_value[1] == "!")
|
| 922 |
+
{
|
| 923 |
+
$ckecked_or_no = ($params_value[1] == "=" ? "==" : ">");
|
| 924 |
+
$if .= ' jQuery("div[wdid='.$params_value[0].'] input[type=\"checkbox\"]:checked").length'.$ckecked_or_no.'0 ';
|
| 925 |
+
$click .= 'div[wdid='.$params_value[0].'] input[type=\'checkbox\'], ';
|
| 926 |
+
|
| 927 |
+
}
|
| 928 |
+
|
| 929 |
+
|
| 930 |
+
break;
|
| 931 |
+
}
|
| 932 |
+
|
| 933 |
+
if($m!=count($cond_params)-1)
|
| 934 |
+
{
|
| 935 |
+
$params_value_next = explode('***',$cond_params[$m+1]);
|
| 936 |
+
if(isset($type_and_id[$params_value_next[0]]))
|
| 937 |
+
$if .= $or_and;
|
| 938 |
+
}
|
| 939 |
+
|
| 940 |
+
}
|
| 941 |
+
|
| 942 |
+
if($if)
|
| 943 |
+
{
|
| 944 |
+
$condition_js .= '
|
| 945 |
+
|
| 946 |
+
if('.$if.')
|
| 947 |
+
jQuery("div[wdid='.$field_label[$k].']").'.$display .';
|
| 948 |
+
else
|
| 949 |
+
jQuery("div[wdid='.$field_label[$k].']").'.$display_none .';';
|
| 950 |
+
}
|
| 951 |
+
|
| 952 |
+
if($keyup)
|
| 953 |
+
$condition_js .= '
|
| 954 |
+
jQuery("'.substr($keyup,0,-2).'").keyup(function() {
|
| 955 |
+
|
| 956 |
+
if('.$if.')
|
| 957 |
+
jQuery("div[wdid='.$field_label[$k].']").'.$display .';
|
| 958 |
+
else
|
| 959 |
+
jQuery("div[wdid='.$field_label[$k].']").'.$display_none .'; });';
|
| 960 |
+
|
| 961 |
+
if($change)
|
| 962 |
+
$condition_js .= '
|
| 963 |
+
jQuery("'.substr($change,0,-2).'").change(function() {
|
| 964 |
+
if('.$if.')
|
| 965 |
+
jQuery("div[wdid='.$field_label[$k].']").'.$display .';
|
| 966 |
+
else
|
| 967 |
+
jQuery("div[wdid='.$field_label[$k].']").'.$display_none .'; });';
|
| 968 |
+
|
| 969 |
+
if($click)
|
| 970 |
+
{
|
| 971 |
+
$condition_js .= '
|
| 972 |
+
jQuery("'.substr($click,0,-2).'").click(function() {
|
| 973 |
+
if('.$if.')
|
| 974 |
+
jQuery("div[wdid='.$field_label[$k].']").'.$display .';
|
| 975 |
+
else
|
| 976 |
+
jQuery("div[wdid='.$field_label[$k].']").'.$display_none .'; });';
|
| 977 |
+
}
|
| 978 |
+
}
|
| 979 |
+
|
| 980 |
+
|
| 981 |
+
}
|
| 982 |
+
|
| 983 |
+
}
|
| 984 |
+
|
| 985 |
+
if ($row->autogen_layout == 0) {
|
| 986 |
+
$form=$row->custom_front;
|
| 987 |
+
}
|
| 988 |
+
else {
|
| 989 |
+
$form = $row->form_front;
|
| 990 |
+
}
|
| 991 |
+
foreach($id1s as $id1s_key => $id1) {
|
| 992 |
+
$label=$labels[$id1s_key];
|
| 993 |
+
$type=$types[$id1s_key];
|
| 994 |
+
$params=$paramss[$id1s_key];
|
| 995 |
+
if (strpos($form, '%'.$id1.' - '.$label.'%') || strpos($form, '%'.$id1.' -'.$label.'%')) {
|
| 996 |
+
$rep='';
|
| 997 |
+
$required=false;
|
| 998 |
+
$param=array();
|
| 999 |
+
$param['attributes'] = '';
|
| 1000 |
+
$is_type[$type]=true;
|
| 1001 |
+
switch($type) {
|
| 1002 |
+
case 'type_section_break': {
|
| 1003 |
+
$params_names=array('w_editor');
|
| 1004 |
+
$temp=$params;
|
| 1005 |
+
foreach($params_names as $params_name ) {
|
| 1006 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1007 |
+
$param[$params_name] = $temp[0];
|
| 1008 |
+
$temp=$temp[1];
|
| 1009 |
+
}
|
| 1010 |
+
$rep ='<div type="type_section_break" class="wdform-field-section-break"><div class="wdform_section_break">' . html_entity_decode($param['w_editor']) . '</div></div>';
|
| 1011 |
+
break;
|
| 1012 |
+
}
|
| 1013 |
+
case 'type_editor': {
|
| 1014 |
+
$params_names=array('w_editor');
|
| 1015 |
+
$temp=$params;
|
| 1016 |
+
foreach($params_names as $params_name ) {
|
| 1017 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1018 |
+
$param[$params_name] = $temp[0];
|
| 1019 |
+
$temp=$temp[1];
|
| 1020 |
+
}
|
| 1021 |
+
$rep ='<div type="type_editor" class="wdform-field">' . html_entity_decode($param['w_editor']) . '</div>';
|
| 1022 |
+
break;
|
| 1023 |
+
}
|
| 1024 |
+
case 'type_send_copy': {
|
| 1025 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_first_val','w_required');
|
| 1026 |
+
$temp=$params;
|
| 1027 |
+
foreach($params_names as $params_name ) {
|
| 1028 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1029 |
+
$param[$params_name] = $temp[0];
|
| 1030 |
+
$temp=$temp[1];
|
| 1031 |
+
}
|
| 1032 |
+
if($temp) {
|
| 1033 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1034 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1035 |
+
foreach($attrs as $attr) {
|
| 1036 |
+
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 1037 |
+
}
|
| 1038 |
+
}
|
| 1039 |
+
$input_active = ($param['w_first_val']=='true' ? "checked='checked'" : "");
|
| 1040 |
+
$post_value = isset($_POST["counter".$form_id]) ? esc_html($_POST["counter".$form_id]) : NULL;
|
| 1041 |
+
if(isset($post_value)) {
|
| 1042 |
+
$post_temp = isset($_POST['wdform_'.$id1.'_element'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element'.$form_id])) : "";
|
| 1043 |
+
$input_active = (isset($post_temp) ? "checked='checked'" : "");
|
| 1044 |
+
}
|
| 1045 |
+
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 1046 |
+
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 1047 |
+
$required = ($param['w_required']=="yes" ? true : false);
|
| 1048 |
+
$rep ='<div type="type_send_copy" class="wdform-field"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].' width: '.$param['w_field_label_size'].'px;"><span class="wdform-label"><label for="wdform_'.$id1.'_element'.$form_id.'">'.$label.'</label></span>';
|
| 1049 |
+
if($required) {
|
| 1050 |
+
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 1051 |
+
}
|
| 1052 |
+
$rep.='</div>
|
| 1053 |
+
<div class="wdform-element-section" style="'.$param['w_field_label_pos2'].'" >
|
| 1054 |
+
<div class="checkbox-div" style="left:3px">
|
| 1055 |
+
<input type="checkbox" id="wdform_'.$id1.'_element'.$form_id.'" name="wdform_'.$id1.'_element'.$form_id.'" '.$input_active.' '.$param['attributes'].'/>
|
| 1056 |
+
<label for="wdform_'.$id1.'_element'.$form_id.'"></label>
|
| 1057 |
+
</div>
|
| 1058 |
+
</div></div>';
|
| 1059 |
+
|
| 1060 |
+
$onsubmit_js.='
|
| 1061 |
+
if(!jQuery("#wdform_'.$id1.'_element'.$form_id.'").is(":checked"))
|
| 1062 |
+
jQuery("<input type=\"hidden\" name=\"wdform_send_copy_'.$form_id.'\" value = \"1\" />").appendTo("#form'.$form_id.'");';
|
| 1063 |
+
if($required) {
|
| 1064 |
+
$check_js.='
|
| 1065 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 1066 |
+
{
|
| 1067 |
+
if(x.find(jQuery("div[wdid='.$id1.'] input:checked")).length == 0)
|
| 1068 |
+
{
|
| 1069 |
+
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 1070 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 1071 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 1072 |
+
|
| 1073 |
+
return false;
|
| 1074 |
+
}
|
| 1075 |
+
}
|
| 1076 |
+
';
|
| 1077 |
+
}
|
| 1078 |
+
break;
|
| 1079 |
+
}
|
| 1080 |
+
case 'type_text': {
|
| 1081 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_required','w_unique');
|
| 1082 |
+
$temp=$params;
|
| 1083 |
+
if(strpos($temp, 'w_regExp_status') > -1)
|
| 1084 |
+
$params_names = array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_required', 'w_regExp_status', 'w_regExp_value', 'w_regExp_common', 'w_regExp_arg', 'w_regExp_alert', 'w_unique');
|
| 1085 |
+
foreach($params_names as $params_name ) {
|
| 1086 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1087 |
+
$param[$params_name] = $temp[0];
|
| 1088 |
+
$temp=$temp[1];
|
| 1089 |
+
}
|
| 1090 |
+
if($temp) {
|
| 1091 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1092 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1093 |
+
foreach($attrs as $attr)
|
| 1094 |
+
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 1095 |
+
}
|
| 1096 |
+
|
| 1097 |
+
$param['w_first_val'] = (isset($_POST['wdform_'.$id1.'_element'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element'.$form_id])) : $param['w_first_val']);
|
| 1098 |
+
|
| 1099 |
+
$wdformfieldsize = ($param['w_field_label_pos']=="left" ? $param['w_field_label_size']+$param['w_size'] + 10 : max($param['w_field_label_size'],$param['w_size']));
|
| 1100 |
+
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 1101 |
+
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 1102 |
+
|
| 1103 |
+
$input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active");
|
| 1104 |
+
$required = ($param['w_required']=="yes" ? true : false);
|
| 1105 |
+
|
| 1106 |
+
$param['w_regExp_status'] = (isset($param['w_regExp_status']) ? $param['w_regExp_status'] : "no");
|
| 1107 |
+
|
| 1108 |
+
$rep ='<div type="type_text" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].' width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 1109 |
+
if($required) {
|
| 1110 |
+
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 1111 |
+
}
|
| 1112 |
+
$rep.='</div><div class="wdform-element-section" style="'.$param['w_field_label_pos2'].' width: '.$param['w_size'].'px;" ><input type="text" class="'.$input_active.'" id="wdform_'.$id1.'_element'.$form_id.'" name="wdform_'.$id1.'_element'.$form_id.'" value="'.$param['w_first_val'].'" title="'.$param['w_title'].'" style="width: 100%;" '.$param['attributes'].'></div></div>';
|
| 1113 |
+
|
| 1114 |
+
if($required) {
|
| 1115 |
+
$check_js.='
|
| 1116 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 1117 |
+
{
|
| 1118 |
+
if(jQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="'.$param['w_title'].'" || jQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="")
|
| 1119 |
+
{
|
| 1120 |
+
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 1121 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'").addClass( "form-error" );
|
| 1122 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 1123 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 1124 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'").focus();
|
| 1125 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'").change(function() { if( jQuery(this).val()!="" ) jQuery(this).removeClass("form-error"); else jQuery(this).addClass("form-error");});
|
| 1126 |
+
return false;
|
| 1127 |
+
}
|
| 1128 |
+
}
|
| 1129 |
+
';
|
| 1130 |
+
}
|
| 1131 |
+
|
| 1132 |
+
if($param['w_regExp_status'] == 'yes') {
|
| 1133 |
+
$check_js .='
|
| 1134 |
+
var RegExpression = "";
|
| 1135 |
+
var rules = unescape("'.$param["w_regExp_value"].'");
|
| 1136 |
+
("'.$param["w_regExp_arg"].'".length <= 0) ? RegExpression = new RegExp(rules) : RegExpression = new RegExp(rules'.', "'.$param["w_regExp_arg"].'" );
|
| 1137 |
+
|
| 1138 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none") {
|
| 1139 |
+
if(jQuery("#wdform_'.$id1.'_element'.$form_id.'").val().length > 0){
|
| 1140 |
+
if (RegExpression.test(jQuery("#wdform_'.$id1.'_element'.$form_id.'").val()) != true)
|
| 1141 |
+
{
|
| 1142 |
+
alert( " '.$param["w_regExp_alert"].' ");
|
| 1143 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 1144 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 1145 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'").addClass( "form-error" );
|
| 1146 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'").focus();
|
| 1147 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'").change(function() { if( jQuery(this).val()!="" ) jQuery(this).removeClass("form-error"); else jQuery(this).addClass("form-error");});
|
| 1148 |
+
return false;
|
| 1149 |
+
}
|
| 1150 |
+
}
|
| 1151 |
+
}';
|
| 1152 |
+
}
|
| 1153 |
+
|
| 1154 |
+
break;
|
| 1155 |
+
}
|
| 1156 |
+
|
| 1157 |
+
case 'type_number': {
|
| 1158 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_required','w_unique','w_class');
|
| 1159 |
+
$temp=$params;
|
| 1160 |
+
foreach($params_names as $params_name ) {
|
| 1161 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1162 |
+
$param[$params_name] = $temp[0];
|
| 1163 |
+
$temp=$temp[1];
|
| 1164 |
+
}
|
| 1165 |
+
if($temp) {
|
| 1166 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1167 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1168 |
+
foreach($attrs as $attr) {
|
| 1169 |
+
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 1170 |
+
}
|
| 1171 |
+
}
|
| 1172 |
+
|
| 1173 |
+
$param['w_first_val']=(isset($_POST['wdform_'.$id1.'_element'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element'.$form_id])) : $param['w_first_val']);
|
| 1174 |
+
|
| 1175 |
+
$wdformfieldsize = ($param['w_field_label_pos']=="left" ? $param['w_field_label_size']+$param['w_size'] + 10 : max($param['w_field_label_size'],$param['w_size']));
|
| 1176 |
+
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 1177 |
+
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 1178 |
+
$input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active");
|
| 1179 |
+
$required = ($param['w_required']=="yes" ? true : false);
|
| 1180 |
+
|
| 1181 |
+
$rep ='<div type="type_number" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" class="'.$param['w_class'].'" style="'.$param['w_field_label_pos1'].' width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 1182 |
+
if($required) {
|
| 1183 |
+
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 1184 |
+
}
|
| 1185 |
+
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].' width: '.$param['w_size'].'px;"><input type="text" class="'.$input_active.'" id="wdform_'.$id1.'_element'.$form_id.'" name="wdform_'.$id1.'_element'.$form_id.'" value="'.$param['w_first_val'].'" title="'.$param['w_title'].'" style="width: 100%;" '.$param['attributes'].'></div></div>';
|
| 1186 |
+
|
| 1187 |
+
if($required) {
|
| 1188 |
+
$check_js.='
|
| 1189 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 1190 |
+
{
|
| 1191 |
+
if(jQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="'.$param['w_title'].'" || jQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="")
|
| 1192 |
+
{
|
| 1193 |
+
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 1194 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'").addClass( "form-error" );
|
| 1195 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 1196 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 1197 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'").focus();
|
| 1198 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'").change(function() { if( jQuery(this).val()!="" ) jQuery(this).removeClass("form-error"); else jQuery(this).addClass("form-error");});
|
| 1199 |
+
return false;
|
| 1200 |
+
}
|
| 1201 |
+
}
|
| 1202 |
+
';
|
| 1203 |
+
}
|
| 1204 |
+
break;
|
| 1205 |
+
}
|
| 1206 |
+
|
| 1207 |
+
case 'type_password': {
|
| 1208 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_required','w_unique','w_class');
|
| 1209 |
+
$temp=$params;
|
| 1210 |
+
foreach($params_names as $params_name ) {
|
| 1211 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1212 |
+
$param[$params_name] = $temp[0];
|
| 1213 |
+
$temp=$temp[1];
|
| 1214 |
+
}
|
| 1215 |
+
if($temp) {
|
| 1216 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1217 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1218 |
+
foreach($attrs as $attr) {
|
| 1219 |
+
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 1220 |
+
}
|
| 1221 |
+
}
|
| 1222 |
+
|
| 1223 |
+
$wdformfieldsize = ($param['w_field_label_pos']=="left" ? $param['w_field_label_size']+$param['w_size'] + 10 : max($param['w_field_label_size'],$param['w_size']));
|
| 1224 |
+
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 1225 |
+
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 1226 |
+
$required = ($param['w_required']=="yes" ? true : false);
|
| 1227 |
+
|
| 1228 |
+
$rep ='<div type="type_password" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" class="'.$param['w_class'].'" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 1229 |
+
if($required) {
|
| 1230 |
+
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 1231 |
+
}
|
| 1232 |
+
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].' width: '.$param['w_size'].'px;"><input type="password" id="wdform_'.$id1.'_element'.$form_id.'" name="wdform_'.$id1.'_element'.$form_id.'" style="width: 100%;" '.$param['attributes'].'></div></div>';
|
| 1233 |
+
|
| 1234 |
+
if($required) {
|
| 1235 |
+
$check_js.='
|
| 1236 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 1237 |
+
{
|
| 1238 |
+
if(jQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="")
|
| 1239 |
+
{
|
| 1240 |
+
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 1241 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'").addClass( "form-error" );
|
| 1242 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 1243 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 1244 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'").focus();
|
| 1245 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'").change(function() { if( jQuery(this).val()!="" ) jQuery(this).removeClass("form-error"); else jQuery(this).addClass("form-error");});
|
| 1246 |
+
return false;
|
| 1247 |
+
}
|
| 1248 |
+
}
|
| 1249 |
+
';
|
| 1250 |
+
}
|
| 1251 |
+
break;
|
| 1252 |
+
}
|
| 1253 |
+
|
| 1254 |
+
case 'type_textarea': {
|
| 1255 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_size_w','w_size_h','w_first_val','w_title','w_required','w_unique','w_class');
|
| 1256 |
+
$temp=$params;
|
| 1257 |
+
foreach($params_names as $params_name ) {
|
| 1258 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1259 |
+
$param[$params_name] = $temp[0];
|
| 1260 |
+
$temp=$temp[1];
|
| 1261 |
+
}
|
| 1262 |
+
if($temp) {
|
| 1263 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1264 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1265 |
+
foreach($attrs as $attr)
|
| 1266 |
+
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 1267 |
+
}
|
| 1268 |
+
|
| 1269 |
+
$param['w_first_val']=(isset($_POST['wdform_'.$id1.'_element'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element'.$form_id])) : $param['w_first_val']);
|
| 1270 |
+
|
| 1271 |
+
$wdformfieldsize = ($param['w_field_label_pos']=="left" ? $param['w_field_label_size']+$param['w_size_w'] + 10 : max($param['w_field_label_size'],$param['w_size_w']));
|
| 1272 |
+
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 1273 |
+
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 1274 |
+
$input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active");
|
| 1275 |
+
$required = ($param['w_required']=="yes" ? true : false);
|
| 1276 |
+
|
| 1277 |
+
$rep ='<div type="type_textarea" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 1278 |
+
if($required) {
|
| 1279 |
+
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 1280 |
+
}
|
| 1281 |
+
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].' width: '.$param['w_size_w'].'px"><textarea class="'.$input_active.'" id="wdform_'.$id1.'_element'.$form_id.'" name="wdform_'.$id1.'_element'.$form_id.'" title="'.$param['w_title'].'" style="width: 100%; height: '.$param['w_size_h'].'px;" '.$param['attributes'].'>'.str_replace(array("\r\n", "\n\r", "\n", "\r"), " ", $param['w_first_val']).'</textarea></div></div>';
|
| 1282 |
+
|
| 1283 |
+
if($required) {
|
| 1284 |
+
$check_js.='
|
| 1285 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 1286 |
+
{
|
| 1287 |
+
if(jQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="'.$param['w_title'].'" || jQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="")
|
| 1288 |
+
{
|
| 1289 |
+
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 1290 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'").addClass( "form-error" );
|
| 1291 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 1292 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 1293 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'").focus();
|
| 1294 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'").change(function() { if( jQuery(this).val()!="" ) jQuery(this).removeClass("form-error"); else jQuery(this).addClass("form-error");});
|
| 1295 |
+
return false;
|
| 1296 |
+
}
|
| 1297 |
+
}
|
| 1298 |
+
';
|
| 1299 |
+
}
|
| 1300 |
+
break;
|
| 1301 |
+
}
|
| 1302 |
+
|
| 1303 |
+
case 'type_wdeditor': {
|
| 1304 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_size_w','w_size_h','w_title','w_required','w_class');
|
| 1305 |
+
$temp=$params;
|
| 1306 |
+
foreach($params_names as $params_name ) {
|
| 1307 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1308 |
+
$param[$params_name] = $temp[0];
|
| 1309 |
+
$temp=$temp[1];
|
| 1310 |
+
}
|
| 1311 |
+
if($temp) {
|
| 1312 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1313 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1314 |
+
foreach($attrs as $attr)
|
| 1315 |
+
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 1316 |
+
}
|
| 1317 |
+
$wdformfieldsize = ($param['w_field_label_pos']=="left" ? $param['w_field_label_size']+$param['w_size_w']+10 : max($param['w_field_label_size'],$param['w_size_w']));
|
| 1318 |
+
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 1319 |
+
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 1320 |
+
|
| 1321 |
+
$required = ($param['w_required']=="yes" ? true : false);
|
| 1322 |
+
|
| 1323 |
+
$rep ='<div type="type_wdeditor" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 1324 |
+
if($required) {
|
| 1325 |
+
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 1326 |
+
}
|
| 1327 |
+
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].' width: '.$param['w_size_w'].'px">';
|
| 1328 |
+
|
| 1329 |
+
if(user_can_richedit()) {
|
| 1330 |
+
ob_start();
|
| 1331 |
+
wp_editor($param['w_title'], 'wdform_'.$id1.'_wd_editor'.$form_id, array('teeny' => FALSE, 'media_buttons' => FALSE, 'textarea_rows' => 5));
|
| 1332 |
+
$wd_editor = ob_get_clean();
|
| 1333 |
+
}
|
| 1334 |
+
else {
|
| 1335 |
+
$wd_editor = '<textarea class="'.$param['w_class'].'" name="wdform_'.$id1.'_wd_editor'.$form_id.'" id="wdform_'.$id1.'_wd_editor'.$form_id.'" style="width: '.$param['w_size_w'].'px; height: '.$param['w_size_h'].'px; " class="mce_editable" aria-hidden="true">'.$param['w_title'].'</textarea>';
|
| 1336 |
+
}
|
| 1337 |
+
$rep.= $wd_editor.'</div></div>';
|
| 1338 |
+
if($required) {
|
| 1339 |
+
$check_js.='
|
| 1340 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 1341 |
+
{
|
| 1342 |
+
if(tinyMCE.get("wdform_'.$id1.'_wd_editor'.$form_id.'").getContent()=="")
|
| 1343 |
+
{
|
| 1344 |
+
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 1345 |
+
jQuery("#wdform_'.$id1.'_wd_editor'.$form_id.'").addClass( "form-error" );
|
| 1346 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 1347 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 1348 |
+
jQuery("#wdform_'.$id1.'_wd_editor'.$form_id.'").focus();
|
| 1349 |
+
jQuery("#wdform_'.$id1.'_wd_editor'.$form_id.'").change(function() { if( jQuery(this).val()!="" ) jQuery(this).removeClass("form-error"); else jQuery(this).addClass("form-error");});
|
| 1350 |
+
return false;
|
| 1351 |
+
}
|
| 1352 |
+
}
|
| 1353 |
+
';
|
| 1354 |
+
}
|
| 1355 |
+
break;
|
| 1356 |
+
}
|
| 1357 |
+
|
| 1358 |
+
case 'type_phone': {
|
| 1359 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_mini_labels','w_required','w_unique', 'w_class');
|
| 1360 |
+
$temp=$params;
|
| 1361 |
+
foreach($params_names as $params_name ) {
|
| 1362 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1363 |
+
$param[$params_name] = $temp[0];
|
| 1364 |
+
$temp=$temp[1];
|
| 1365 |
+
}
|
| 1366 |
+
if($temp) {
|
| 1367 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1368 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1369 |
+
foreach($attrs as $attr) {
|
| 1370 |
+
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 1371 |
+
}
|
| 1372 |
+
}
|
| 1373 |
+
$w_first_val = explode('***',$param['w_first_val']);
|
| 1374 |
+
$w_title = explode('***',$param['w_title']);
|
| 1375 |
+
|
| 1376 |
+
$param['w_first_val']=(isset($_POST['wdform_'.$id1.'_element_first'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element_first'.$form_id])) : $w_first_val[0]).'***'.(isset($_POST['wdform_'.$id1.'_element_last'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element_last'.$form_id])) : $w_first_val[1]);
|
| 1377 |
+
|
| 1378 |
+
$wdformfieldsize = ($param['w_field_label_pos']=="left" ? ($param['w_field_label_size']+$param['w_size']+65) : max($param['w_field_label_size'],($param['w_size']+65)));
|
| 1379 |
+
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 1380 |
+
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 1381 |
+
$input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active");
|
| 1382 |
+
$required = ($param['w_required']=="yes" ? true : false);
|
| 1383 |
+
|
| 1384 |
+
$w_first_val = explode('***',$param['w_first_val']);
|
| 1385 |
+
$w_title = explode('***',$param['w_title']);
|
| 1386 |
+
$w_mini_labels = explode('***',$param['w_mini_labels']);
|
| 1387 |
+
|
| 1388 |
+
|
| 1389 |
+
$rep ='<div type="type_phone" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section '.$param['w_class'].'" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label" >'.$label.'</span>';
|
| 1390 |
+
if($required) {
|
| 1391 |
+
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 1392 |
+
}
|
| 1393 |
+
$rep.='
|
| 1394 |
+
</div>
|
| 1395 |
+
<div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].' width: '.($param['w_size']+65).'px;">
|
| 1396 |
+
<div style="display: table-cell;vertical-align: middle;">
|
| 1397 |
+
<div><input type="text" class="'.$input_active.'" id="wdform_'.$id1.'_element_first'.$form_id.'" name="wdform_'.$id1.'_element_first'.$form_id.'" value="'.$w_first_val[0].'" title="'.$w_title[0].'" style="width: 50px;" '.$param['attributes'].'></div>
|
| 1398 |
+
<div><label class="mini_label">'.$w_mini_labels[0].'</label></div>
|
| 1399 |
+
</div>
|
| 1400 |
+
<div style="display: table-cell;vertical-align: middle;">
|
| 1401 |
+
<div class="wdform_line" style="margin: 0px 4px 10px 4px; padding: 0px;">-</div>
|
| 1402 |
+
</div>
|
| 1403 |
+
<div style="display: table-cell;vertical-align: middle; width:100%;">
|
| 1404 |
+
<div><input type="text" class="'.$input_active.'" id="wdform_'.$id1.'_element_last'.$form_id.'" name="wdform_'.$id1.'_element_last'.$form_id.'" value="'.$w_first_val[1].'" title="'.$w_title[1].'" style="width: 100%;" '.$param['attributes'].'></div>
|
| 1405 |
+
<div><label class="mini_label">'.$w_mini_labels[1].'</label></div>
|
| 1406 |
+
</div>
|
| 1407 |
+
</div>
|
| 1408 |
+
</div>';
|
| 1409 |
+
|
| 1410 |
+
if($required) {
|
| 1411 |
+
$check_js.='
|
| 1412 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 1413 |
+
{
|
| 1414 |
+
if(jQuery("#wdform_'.$id1.'_element_first'.$form_id.'").val()=="'.$w_title[0].'" || jQuery("#wdform_'.$id1.'_element_first'.$form_id.'").val()=="" || jQuery("#wdform_'.$id1.'_element_last'.$form_id.'").val()=="'.$w_title[1].'" || jQuery("#wdform_'.$id1.'_element_last'.$form_id.'").val()=="")
|
| 1415 |
+
{
|
| 1416 |
+
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 1417 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 1418 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 1419 |
+
jQuery("#wdform_'.$id1.'_element_first'.$form_id.'").focus();
|
| 1420 |
+
return false;
|
| 1421 |
+
}
|
| 1422 |
+
|
| 1423 |
+
}
|
| 1424 |
+
';
|
| 1425 |
+
}
|
| 1426 |
+
break;
|
| 1427 |
+
}
|
| 1428 |
+
|
| 1429 |
+
case 'type_name': {
|
| 1430 |
+
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_title', 'w_mini_labels', 'w_size', 'w_name_format', 'w_required', 'w_unique', 'w_class');
|
| 1431 |
+
$temp = $params;
|
| 1432 |
+
if(strpos($temp, 'w_name_fields') > -1)
|
| 1433 |
+
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_title', 'w_mini_labels', 'w_size', 'w_name_format', 'w_required', 'w_unique', 'w_class', 'w_name_fields');
|
| 1434 |
+
foreach($params_names as $params_name ) {
|
| 1435 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1436 |
+
$param[$params_name] = $temp[0];
|
| 1437 |
+
$temp=$temp[1];
|
| 1438 |
+
}
|
| 1439 |
+
if($temp) {
|
| 1440 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1441 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1442 |
+
foreach($attrs as $attr) {
|
| 1443 |
+
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 1444 |
+
}
|
| 1445 |
+
}
|
| 1446 |
+
|
| 1447 |
+
$w_first_val = explode('***',$param['w_first_val']);
|
| 1448 |
+
$w_title = explode('***',$param['w_title']);
|
| 1449 |
+
|
| 1450 |
+
$w_mini_labels = explode('***',$param['w_mini_labels']);
|
| 1451 |
+
$param['w_name_fields'] = isset($param['w_name_fields']) ? $param['w_name_fields'] : ($param['w_name_format'] == 'normal' ? 'no***no' : 'yes***yes');
|
| 1452 |
+
$w_name_fields = explode('***', $param['w_name_fields']);
|
| 1453 |
+
|
| 1454 |
+
$element_title = isset($_POST['wdform_'.$id1.'_element_title'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element_title'.$form_id])) : NULL;
|
| 1455 |
+
$element_middle = isset($_POST['wdform_'.$id1.'_element_middle'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element_middle'.$form_id])) : NULL;
|
| 1456 |
+
$element_first = isset($_POST['wdform_'.$id1.'_element_first'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element_first'.$form_id])) : NULL;
|
| 1457 |
+
if(isset($element_title) || isset($element_middle)) {
|
| 1458 |
+
$param['w_first_val']=(isset($_POST['wdform_'.$id1.'_element_first'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element_first'.$form_id])) : $w_first_val[0]).'***'.(isset($_POST['wdform_'.$id1.'_element_last'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element_last'.$form_id])) : $w_first_val[1]).'***'.(isset($_POST['wdform_'.$id1.'_element_title'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element_title'.$form_id])) : $w_first_val[2]).'***'.(isset($_POST['wdform_'.$id1.'_element_middle'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element_middle'.$form_id])) : $w_first_val[3]);
|
| 1459 |
+
}
|
| 1460 |
+
else {
|
| 1461 |
+
if(isset($element_first)) {
|
| 1462 |
+
$param['w_first_val']=(isset($_POST['wdform_'.$id1.'_element_first'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element_first'.$form_id])) : $w_first_val[0]).'***'.(isset($_POST['wdform_'.$id1.'_element_last'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element_last'.$form_id])) : $w_first_val[1]);
|
| 1463 |
+
}
|
| 1464 |
+
}
|
| 1465 |
+
|
| 1466 |
+
$required = ($param['w_required']=="yes" ? true : false);
|
| 1467 |
+
$w_first_val = explode('***',$param['w_first_val']);
|
| 1468 |
+
|
| 1469 |
+
if($w_name_fields[0]== 'no' && $w_name_fields[1]== 'no' ) {
|
| 1470 |
+
$w_name_format = '
|
| 1471 |
+
<div style="display: table-cell; width:50%">
|
| 1472 |
+
<div><input type="text" class="'.($w_first_val[0] == $w_title[0] ? "input_deactive" : "input_active").'" id="wdform_'.$id1.'_element_first'.$form_id.'" name="wdform_'.$id1.'_element_first'.$form_id.'" value="'.$w_first_val[0].'" title="'.$w_title[0].'" style="width: 100%;"'.$param['attributes'].'></div>
|
| 1473 |
+
<div><label class="mini_label">'.$w_mini_labels[1].'</label></div>
|
| 1474 |
+
</div>
|
| 1475 |
+
<div style="display:table-cell;"><div style="margin: 0px 8px; padding: 0px;"></div></div>
|
| 1476 |
+
<div style="display: table-cell; width:50%">
|
| 1477 |
+
<div><input type="text" class="'.($w_first_val[1] == $w_title[1] ? "input_deactive" : "input_active").'" id="wdform_'.$id1.'_element_last'.$form_id.'" name="wdform_'.$id1.'_element_last'.$form_id.'" value="'.$w_first_val[1].'" title="'.$w_title[1].'" style="width: 100%;" '.$param['attributes'].'></div>
|
| 1478 |
+
<div><label class="mini_label">'.$w_mini_labels[2].'</label></div>
|
| 1479 |
+
</div>
|
| 1480 |
+
';
|
| 1481 |
+
$w_size=2*$param['w_size'];
|
| 1482 |
+
}
|
| 1483 |
+
else {
|
| 1484 |
+
$first_last_size = $w_name_fields[0] == 'yes' && $w_name_fields[1] == 'no' ? 45 : 30;
|
| 1485 |
+
$w_name_format = '
|
| 1486 |
+
<div style="display: table-cell; width:'.$first_last_size.'%">
|
| 1487 |
+
<div><input type="text" class="'.($w_first_val[0] == $w_title[0] ? "input_deactive" : "input_active").'" id="wdform_'.$id1.'_element_first'.$form_id.'" name="wdform_'.$id1.'_element_first'.$form_id.'" value="'.$w_first_val[0].'" title="'.$w_title[0].'" style="width:100%;"></div>
|
| 1488 |
+
<div><label class="mini_label">'.$w_mini_labels[1].'</label></div>
|
| 1489 |
+
</div>
|
| 1490 |
+
<div style="display:table-cell;"><div style="margin: 0px 4px; padding: 0px;"></div></div>
|
| 1491 |
+
<div style="display: table-cell; width:'.$first_last_size.'%">
|
| 1492 |
+
<div><input type="text" class="'.($w_first_val[1] == $w_title[1] ? "input_deactive" : "input_active").'" id="wdform_'.$id1.'_element_last'.$form_id.'" name="wdform_'.$id1.'_element_last'.$form_id.'" value="'.$w_first_val[1].'" title="'.$w_title[1].'" style="width: 100%;"></div>
|
| 1493 |
+
<div><label class="mini_label">'.$w_mini_labels[2].'</label></div>
|
| 1494 |
+
</div>';
|
| 1495 |
+
|
| 1496 |
+
$w_size = 2*$param['w_size'];
|
| 1497 |
+
if($w_name_fields[0] == 'yes') {
|
| 1498 |
+
$w_name_format = '
|
| 1499 |
+
<div style="display: table-cell;">
|
| 1500 |
+
<div><input type="text" class="'.($w_first_val[2] == $w_title[2] ? "input_deactive" : "input_active").'" id="wdform_'.$id1.'_element_title'.$form_id.'" name="wdform_'.$id1.'_element_title'.$form_id.'" value="'.$w_first_val[2].'" title="'.$w_title[2].'" style="width: 40px;"></div>
|
| 1501 |
+
<div><label class="mini_label">'.$w_mini_labels[0].'</label></div>
|
| 1502 |
+
</div>
|
| 1503 |
+
<div style="display:table-cell;"><div style="margin: 0px 1px; padding: 0px;"></div></div>'.$w_name_format;
|
| 1504 |
+
$w_size += 80;
|
| 1505 |
+
}
|
| 1506 |
+
if($w_name_fields[1] == 'yes') {
|
| 1507 |
+
$w_name_format = $w_name_format.'
|
| 1508 |
+
<div style="display:table-cell;"><div style="margin: 0px 4px; padding: 0px;"></div></div>
|
| 1509 |
+
<div style="display: table-cell; width:30%">
|
| 1510 |
+
<div><input type="text" class="'.($w_first_val[3] == $w_title[3] ? "input_deactive" : "input_active").'" id="wdform_'.$id1.'_element_middle'.$form_id.'" name="wdform_'.$id1.'_element_middle'.$form_id.'" value="'.$w_first_val[3].'" title="'.$w_title[3].'" style="width: 100%;"></div>
|
| 1511 |
+
<div><label class="mini_label">'.$w_mini_labels[3].'</label></div>
|
| 1512 |
+
</div>
|
| 1513 |
+
';
|
| 1514 |
+
$w_size += $param['w_size'];
|
| 1515 |
+
}
|
| 1516 |
+
}
|
| 1517 |
+
|
| 1518 |
+
$wdformfieldsize = ($param['w_field_label_pos']=="left" ? ($param['w_field_label_size']+$w_size) : max($param['w_field_label_size'],$w_size));
|
| 1519 |
+
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 1520 |
+
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 1521 |
+
|
| 1522 |
+
$rep ='<div type="type_name" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 1523 |
+
if($required) {
|
| 1524 |
+
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 1525 |
+
}
|
| 1526 |
+
$rep.='</div>
|
| 1527 |
+
<div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].' width: '.$w_size.'px;">'.$w_name_format.'</div></div>';
|
| 1528 |
+
|
| 1529 |
+
if($required) {
|
| 1530 |
+
$check_js.='
|
| 1531 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 1532 |
+
{
|
| 1533 |
+
if(jQuery("#wdform_'.$id1.'_element_first'.$form_id.'").val()=="'.$w_title[0].'" || jQuery("#wdform_'.$id1.'_element_first'.$form_id.'").val()=="" || jQuery("#wdform_'.$id1.'_element_last'.$form_id.'").val()=="'.$w_title[1].'" || jQuery("#wdform_'.$id1.'_element_last'.$form_id.'").val()=="" || (jQuery("#wdform_'.$id1.'_element_title'.$form_id.'").length != 0 && (jQuery("#wdform_'.$id1.'_element_title'.$form_id.'").val()=="'.(isset($w_title[2]) ? $w_title[2] : '').'" || jQuery("#wdform_'.$id1.'_element_title'.$form_id.'").val()=="")) || (jQuery("#wdform_'.$id1.'_element_middle'.$form_id.'").length != 0 && (jQuery("#wdform_'.$id1.'_element_middle'.$form_id.'").val()=="'.(isset($w_title[3]) ? $w_title[3] : '').'" || jQuery("#wdform_'.$id1.'_element_middle'.$form_id.'").val()=="")))
|
| 1534 |
+
{
|
| 1535 |
+
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 1536 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 1537 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 1538 |
+
jQuery("#wdform_'.$id1.'_element_first'.$form_id.'").focus();
|
| 1539 |
+
return false;
|
| 1540 |
+
}
|
| 1541 |
+
}
|
| 1542 |
+
';
|
| 1543 |
+
}
|
| 1544 |
+
break;
|
| 1545 |
+
}
|
| 1546 |
+
|
| 1547 |
+
case 'type_address': {
|
| 1548 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_mini_labels','w_disabled_fields','w_required','w_class');
|
| 1549 |
+
$temp=$params;
|
| 1550 |
+
foreach($params_names as $params_name ) {
|
| 1551 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1552 |
+
$param[$params_name] = $temp[0];
|
| 1553 |
+
$temp=$temp[1];
|
| 1554 |
+
}
|
| 1555 |
+
if($temp) {
|
| 1556 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1557 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1558 |
+
foreach($attrs as $attr) {
|
| 1559 |
+
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 1560 |
+
}
|
| 1561 |
+
}
|
| 1562 |
+
$wdformfieldsize = ($param['w_field_label_pos']=="left" ? ($param['w_field_label_size']+$param['w_size']) : max($param['w_field_label_size'], $param['w_size']));
|
| 1563 |
+
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 1564 |
+
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 1565 |
+
$required = ($param['w_required']=="yes" ? true : false);
|
| 1566 |
+
$w_mini_labels = explode('***',$param['w_mini_labels']);
|
| 1567 |
+
$w_disabled_fields = explode('***', $param['w_disabled_fields']);
|
| 1568 |
+
$rep ='<div type="type_address" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 1569 |
+
if ($required) {
|
| 1570 |
+
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 1571 |
+
}
|
| 1572 |
+
$address_fields = '';
|
| 1573 |
+
$g = 0;
|
| 1574 |
+
if (isset($w_disabled_fields[0]) && $w_disabled_fields[0] == 'no') {
|
| 1575 |
+
$g+=2;
|
| 1576 |
+
$address_fields .= '<span style="float: left; width: 100%; padding-bottom: 8px; display: block;"><input type="text" id="wdform_'.$id1.'_street1'.$form_id.'" name="wdform_'.$id1.'_street1'.$form_id.'" value="'.(isset($_POST['wdform_'.$id1.'_street1'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_street1'.$form_id])) : "").'" style="width: 100%;" '.$param['attributes'].'><label class="mini_label" >'.$w_mini_labels[0].'</label></span>';
|
| 1577 |
+
}
|
| 1578 |
+
if (isset($w_disabled_fields[1]) && $w_disabled_fields[1]=='no') {
|
| 1579 |
+
$g+=2;
|
| 1580 |
+
$address_fields .= '<span style="float: left; width: 100%; padding-bottom: 8px; display: block;"><input type="text" id="wdform_'.$id1.'_street2'.$form_id.'" name="wdform_'.($id1+1).'_street2'.$form_id.'" value="'.(isset($_POST['wdform_'.($id1+1).'_street2'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.($id1+1).'_street2'.$form_id])) : "").'" style="width: 100%;" '.$param['attributes'].'><label class="mini_label" >'.$w_mini_labels[1].'</label></span>';
|
| 1581 |
+
}
|
| 1582 |
+
if (isset($w_disabled_fields[2]) && $w_disabled_fields[2]=='no') {
|
| 1583 |
+
$g++;
|
| 1584 |
+
$address_fields .= '<span style="float: left; width: 48%; padding-bottom: 8px;"><input type="text" id="wdform_'.$id1.'_city'.$form_id.'" name="wdform_'.($id1+2).'_city'.$form_id.'" value="'.(isset($_POST['wdform_'.($id1+2).'_city'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.($id1+2).'_city'.$form_id])) : "").'" style="width: 100%;" '.$param['attributes'].'><label class="mini_label" >'.$w_mini_labels[2].'</label></span>';
|
| 1585 |
+
}
|
| 1586 |
+
if (isset($w_disabled_fields[3]) && $w_disabled_fields[3]=='no') {
|
| 1587 |
+
$g++;
|
| 1588 |
+
$w_states = array("","Alabama","Alaska", "Arizona","Arkansas","California","Colorado","Connecticut","Delaware","District Of Columbia","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming");
|
| 1589 |
+
$w_state_options = '';
|
| 1590 |
+
$post_state = isset($_POST['wdform_'.($id1+3).'_state'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.($id1+3).'_state'.$form_id])) : "";
|
| 1591 |
+
foreach($w_states as $w_state) {
|
| 1592 |
+
if($w_state == $post_state) {
|
| 1593 |
+
$selected = 'selected="selected"';
|
| 1594 |
+
}
|
| 1595 |
+
else {
|
| 1596 |
+
$selected = '';
|
| 1597 |
+
}
|
| 1598 |
+
$w_state_options .= '<option value="'.$w_state.'" '.$selected.'>'.$w_state.'</option>';
|
| 1599 |
+
}
|
| 1600 |
+
if(isset($w_disabled_fields[5]) && $w_disabled_fields[5]=='yes' && isset($w_disabled_fields[6]) && $w_disabled_fields[6]=='yes') {
|
| 1601 |
+
$address_fields .= '<span style="float: '.(($g%2==0) ? 'right' : 'left').'; width: 48%; padding-bottom: 8px;"><select type="text" id="wdform_'.$id1.'_state'.$form_id.'" name="wdform_'.($id1+3).'_state'.$form_id.'" style="width: 100%;" '.$param['attributes'].'>'.$w_state_options.'</select><label class="mini_label" style="display: block;" id="'.$id1.'_mini_label_state">'.$w_mini_labels[3].'</label></span>';
|
| 1602 |
+
}
|
| 1603 |
+
else {
|
| 1604 |
+
$address_fields .= '<span style="float: '.(($g%2==0) ? 'right' : 'left').'; width: 48%; padding-bottom: 8px;"><input type="text" id="wdform_'.$id1.'_state'.$form_id.'" name="wdform_'.($id1+3).'_state'.$form_id.'" value="'.(isset($_POST['wdform_'.($id1+3).'_state'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.($id1+3).'_state'.$form_id])) : "").'" style="width: 100%;" '.$param['attributes'].'><label class="mini_label">'.$w_mini_labels[3].'</label></span>';
|
| 1605 |
+
}
|
| 1606 |
+
}
|
| 1607 |
+
if (isset($w_disabled_fields[4]) && $w_disabled_fields[4]=='no') {
|
| 1608 |
+
$g++;
|
| 1609 |
+
$address_fields .= '<span style="float: '.(($g%2==0) ? 'right' : 'left').'; width: 48%; padding-bottom: 8px;"><input type="text" id="wdform_'.$id1.'_postal'.$form_id.'" name="wdform_'.($id1+4).'_postal'.$form_id.'" value="'.(isset($_POST['wdform_'.($id1+4).'_postal'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.($id1+4).'_postal'.$form_id])) : "").'" style="width: 100%;" '.$param['attributes'].'><label class="mini_label">'.$w_mini_labels[4].'</label></span>';
|
| 1610 |
+
}
|
| 1611 |
+
$w_countries = array("","Afghanistan","Albania","Algeria","Andorra","Angola","Antigua and Barbuda","Argentina","Armenia","Australia","Austria","Azerbaijan","Bahamas","Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bhutan","Bolivia","Bosnia and Herzegovina","Botswana","Brazil","Brunei","Bulgaria","Burkina Faso","Burundi","Cambodia","Cameroon","Canada","Cape Verde","Central African Republic","Chad","Chile","China","Colombia","Comoros","Congo (Brazzaville)","Congo","Costa Rica","Cote d'Ivoire","Croatia","Cuba","Cyprus","Czech Republic","Denmark","Djibouti","Dominica","Dominican Republic","East Timor (Timor Timur)","Ecuador","Egypt","El Salvador","Equatorial Guinea","Eritrea","Estonia","Ethiopia","Fiji","Finland","France","Gabon","Gambia, The","Georgia","Germany","Ghana","Greece","Grenada","Guatemala","Guinea","Guinea-Bissau","Guyana","Haiti","Honduras","Hungary","Iceland","India","Indonesia","Iran","Iraq","Ireland","Israel","Italy","Jamaica","Japan","Jordan","Kazakhstan","Kenya","Kiribati","Korea, North","Korea, South","Kuwait","Kyrgyzstan","Laos","Latvia","Lebanon","Lesotho","Liberia","Libya","Liechtenstein","Lithuania","Luxembourg","Macedonia","Madagascar","Malawi","Malaysia","Maldives","Mali","Malta","Marshall Islands","Mauritania","Mauritius","Mexico","Micronesia","Moldova","Monaco","Mongolia","Morocco","Mozambique","Myanmar","Namibia","Nauru","Nepal","Netherlands","New Zealand","Nicaragua","Niger","Nigeria","Norway","Oman","Pakistan","Palau","Panama","Papua New Guinea","Paraguay","Peru","Philippines","Poland","Portugal","Qatar","Romania","Russia","Rwanda","Saint Kitts and Nevis","Saint Lucia","Saint Vincent","Samoa","San Marino","Sao Tome and Principe","Saudi Arabia","Senegal","Serbia and Montenegro","Seychelles","Sierra Leone","Singapore","Slovakia","Slovenia","Solomon Islands","Somalia","South Africa","Spain","Sri Lanka","Sudan","Suriname","Swaziland","Sweden","Switzerland","Syria","Taiwan","Tajikistan","Tanzania","Thailand","Togo","Tonga","Trinidad and Tobago","Tunisia","Turkey","Turkmenistan","Tuvalu","Uganda","Ukraine","United Arab Emirates","United Kingdom","United States","Uruguay","Uzbekistan","Vanuatu","Vatican City","Venezuela","Vietnam","Yemen","Zambia","Zimbabwe");
|
| 1612 |
+
$w_options = '';
|
| 1613 |
+
$post_country = isset($_POST['wdform_'.($id1+5).'_country'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.($id1+5).'_country'.$form_id])) : "";
|
| 1614 |
+
foreach($w_countries as $w_country) {
|
| 1615 |
+
if($w_country == $post_country) {
|
| 1616 |
+
$selected = 'selected="selected"';
|
| 1617 |
+
}
|
| 1618 |
+
else {
|
| 1619 |
+
$selected = '';
|
| 1620 |
+
}
|
| 1621 |
+
$w_options .= '<option value="'.$w_country.'" '.$selected.'>'.$w_country.'</option>';
|
| 1622 |
+
}
|
| 1623 |
+
if (isset($w_disabled_fields[5]) && $w_disabled_fields[5]=='no') {
|
| 1624 |
+
$g++;
|
| 1625 |
+
$address_fields .= '<span style="float: '.(($g%2==0) ? 'right' : 'left').'; width: 48%; padding-bottom: 8px;display: inline-block;"><select type="text" id="wdform_'.$id1.'_country'.$form_id.'" name="wdform_'.($id1+5).'_country'.$form_id.'" style="width:100%" '.$param['attributes'].'>'.$w_options.'</select><label class="mini_label">'.$w_mini_labels[5].'</label></span>';
|
| 1626 |
+
}
|
| 1627 |
+
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].' width: '.$param['w_size'].'px;"><div>
|
| 1628 |
+
'.$address_fields.'</div></div></div>';
|
| 1629 |
+
|
| 1630 |
+
if ($required) {
|
| 1631 |
+
$check_js.='
|
| 1632 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 1633 |
+
{
|
| 1634 |
+
if(jQuery("#wdform_'.$id1.'_street1'.$form_id.'").val()=="" || (jQuery("#wdform_'.$id1.'_street1'.$form_id.'").val()=="" && jQuery("#wdform_'.$id1.'_street2'.$form_id.'").val()=="") || jQuery("#wdform_'.$id1.'_city'.$form_id.'").val()=="" || jQuery("#wdform_'.$id1.'_state'.$form_id.'").val()=="" || jQuery("#wdform_'.$id1.'_postal'.$form_id.'").val()=="" || jQuery("#wdform_'.$id1.'_country'.$form_id.'").val()=="")
|
| 1635 |
+
{
|
| 1636 |
+
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 1637 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 1638 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 1639 |
+
jQuery("#wdform_'.$id1.'_street1'.$form_id.'").focus();
|
| 1640 |
+
return false;
|
| 1641 |
+
}
|
| 1642 |
+
|
| 1643 |
+
}
|
| 1644 |
+
';
|
| 1645 |
+
}
|
| 1646 |
+
$post = isset($_POST['wdform_'.($id1+5).'_country'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.($id1+5).'_country'.$form_id])) : NULL;
|
| 1647 |
+
if(isset($post)) {
|
| 1648 |
+
$onload_js .=' jQuery("#wdform_'.$id1.'_country'.$form_id.'").val("'.(isset($_POST['wdform_'.($id1+5)."_country".$form_id]) ? esc_html(stripslashes($_POST['wdform_'.($id1+5)."_country".$form_id])) : '').'");';
|
| 1649 |
+
}
|
| 1650 |
+
if (isset($w_disabled_fields[6]) && $w_disabled_fields[6]=='yes') {
|
| 1651 |
+
$onload_js .=' jQuery("#wdform_'.$id1.'_country'.$form_id.'").change(function() {
|
| 1652 |
+
if( jQuery(this).val()=="United States")
|
| 1653 |
+
{
|
| 1654 |
+
jQuery("#wdform_'.$id1.'_state'.$form_id.'").parent().append("<select type=\"text\" id=\"wdform_'.$id1.'_state'.$form_id.'\" name=\"wdform_'.($id1+3).'_state'.$form_id.'\" style=\"width: 100%;\" '.$param['attributes'].'>'.addslashes($w_state_options).'</select><label class=\"mini_label\" style=\"display: block;\" id=\"'.$id1.'_mini_label_state\">'.$w_mini_labels[3].'</label>");
|
| 1655 |
+
jQuery("#wdform_'.$id1.'_state'.$form_id.'").parent().children("input:first, label:first").remove();
|
| 1656 |
+
}
|
| 1657 |
+
else
|
| 1658 |
+
{
|
| 1659 |
+
if(jQuery("#wdform_'.$id1.'_state'.$form_id.'").attr("tagName")=="SELECT")
|
| 1660 |
+
{
|
| 1661 |
+
|
| 1662 |
+
jQuery("#wdform_'.$id1.'_state'.$form_id.'").parent().append("<input type=\"text\" id=\"wdform_'.$id1.'_state'.$form_id.'\" name=\"wdform_'.($id1+3).'_state'.$form_id.'\" value=\"'.(isset($_POST['wdform_'.($id1+3).'_state'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.($id1+3).'_state'.$form_id])) : "").'\" style=\"width: 100%;\" '.$param['attributes'].'><label class=\"mini_label\">'.$w_mini_labels[3].'</label>");
|
| 1663 |
+
jQuery("#wdform_'.$id1.'_state'.$form_id.'").parent().children("select:first, label:first").remove();
|
| 1664 |
+
}
|
| 1665 |
+
}
|
| 1666 |
+
|
| 1667 |
+
});';
|
| 1668 |
+
}
|
| 1669 |
+
break;
|
| 1670 |
+
}
|
| 1671 |
+
|
| 1672 |
+
case 'type_submitter_mail': {
|
| 1673 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_required','w_unique', 'w_class');
|
| 1674 |
+
$temp=$params;
|
| 1675 |
+
foreach($params_names as $params_name ) {
|
| 1676 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1677 |
+
$param[$params_name] = $temp[0];
|
| 1678 |
+
$temp=$temp[1];
|
| 1679 |
+
}
|
| 1680 |
+
if($temp) {
|
| 1681 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1682 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1683 |
+
foreach($attrs as $attr) {
|
| 1684 |
+
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 1685 |
+
}
|
| 1686 |
+
}
|
| 1687 |
+
|
| 1688 |
+
$param['w_first_val']=(isset($_POST['wdform_'.$id1.'_element'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element'.$form_id])) : $param['w_first_val']);
|
| 1689 |
+
|
| 1690 |
+
$wdformfieldsize = ($param['w_field_label_pos']=="left" ? ($param['w_field_label_size']+$param['w_size']) : max($param['w_field_label_size'], $param['w_size']));
|
| 1691 |
+
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 1692 |
+
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 1693 |
+
$input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active");
|
| 1694 |
+
$required = ($param['w_required']=="yes" ? true : false);
|
| 1695 |
+
|
| 1696 |
+
$rep ='<div type="type_submitter_mail" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 1697 |
+
if($required) {
|
| 1698 |
+
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 1699 |
+
}
|
| 1700 |
+
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].' width: '.$param['w_size'].'px;"><input type="text" class="'.$input_active.'" id="wdform_'.$id1.'_element'.$form_id.'" name="wdform_'.$id1.'_element'.$form_id.'" value="'.$param['w_first_val'].'" title="'.$param['w_title'].'" style="width: 100%;" '.$param['attributes'].'></div></div>';
|
| 1701 |
+
|
| 1702 |
+
if($required) {
|
| 1703 |
+
$check_js.='
|
| 1704 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 1705 |
+
{
|
| 1706 |
+
if(jQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="'.$param['w_title'].'" || jQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="")
|
| 1707 |
+
{
|
| 1708 |
+
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 1709 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'").addClass( "form-error" );
|
| 1710 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 1711 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 1712 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'").focus();
|
| 1713 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'").change(function() { if( jQuery(this).val()!="" ) jQuery(this).removeClass("form-error"); else jQuery(this).addClass("form-error");});
|
| 1714 |
+
return false;
|
| 1715 |
+
}
|
| 1716 |
+
}
|
| 1717 |
+
';
|
| 1718 |
+
}
|
| 1719 |
+
$check_js.='
|
| 1720 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 1721 |
+
{
|
| 1722 |
+
|
| 1723 |
+
if(jQuery("#wdform_'.$id1.'_element'.$form_id.'").val()!="" && jQuery("#wdform_'.$id1.'_element'.$form_id.'").val().search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1 )
|
| 1724 |
+
{
|
| 1725 |
+
alert("' . addslashes(__("This is not a valid email address.", 'form_maker')) . '");
|
| 1726 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 1727 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 1728 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'").focus();
|
| 1729 |
+
return false;
|
| 1730 |
+
}
|
| 1731 |
+
|
| 1732 |
+
}
|
| 1733 |
+
';
|
| 1734 |
+
|
| 1735 |
+
break;
|
| 1736 |
+
}
|
| 1737 |
+
|
| 1738 |
+
case 'type_checkbox': {
|
| 1739 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_flow','w_choices','w_choices_checked','w_rowcol', 'w_required','w_randomize','w_allow_other','w_allow_other_num','w_class');
|
| 1740 |
+
$temp=$params;
|
| 1741 |
+
|
| 1742 |
+
if(strpos($temp, 'w_field_option_pos') > -1)
|
| 1743 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_field_option_pos','w_flow','w_choices','w_choices_checked','w_rowcol', 'w_required','w_randomize','w_allow_other','w_allow_other_num', 'w_value_disabled','w_choices_value', 'w_choices_params', 'w_class');
|
| 1744 |
+
foreach($params_names as $params_name ) {
|
| 1745 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1746 |
+
$param[$params_name] = $temp[0];
|
| 1747 |
+
$temp=$temp[1];
|
| 1748 |
+
}
|
| 1749 |
+
|
| 1750 |
+
if($temp) {
|
| 1751 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1752 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1753 |
+
foreach($attrs as $attr) {
|
| 1754 |
+
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 1755 |
+
}
|
| 1756 |
+
}
|
| 1757 |
+
|
| 1758 |
+
if(!isset($param['w_value_disabled']))
|
| 1759 |
+
$param['w_value_disabled'] = 'no';
|
| 1760 |
+
|
| 1761 |
+
if(!isset($param['w_field_option_pos']))
|
| 1762 |
+
$param['w_field_option_pos'] = 'left';
|
| 1763 |
+
|
| 1764 |
+
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 1765 |
+
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 1766 |
+
$param['w_field_option_pos1'] = ($param['w_field_option_pos']=="right" ? "style='float: none
|
| 1767 |
+
!important;'" : "");
|
| 1768 |
+
$param['w_field_option_pos2'] = ($param['w_field_option_pos']=="right" ? "style='float: left !important; margin:3px 8px 0 0 !important; display: inline-block !important;'" : "");
|
| 1769 |
+
$required = ($param['w_required']=="yes" ? true : false);
|
| 1770 |
+
$param['w_choices'] = explode('***',$param['w_choices']);
|
| 1771 |
+
$param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
|
| 1772 |
+
|
| 1773 |
+
if(isset($param['w_choices_value']))
|
| 1774 |
+
{
|
| 1775 |
+
$param['w_choices_value'] = explode('***',$param['w_choices_value']);
|
| 1776 |
+
$param['w_choices_params'] = explode('***',$param['w_choices_params']);
|
| 1777 |
+
}
|
| 1778 |
+
$post_value = isset($_POST["counter".$form_id]) ? esc_html($_POST["counter".$form_id]) : NULL;
|
| 1779 |
+
$is_other=false;
|
| 1780 |
+
|
| 1781 |
+
if (isset($post_value)) {
|
| 1782 |
+
if($param['w_allow_other']=="yes") {
|
| 1783 |
+
$is_other = FALSE;
|
| 1784 |
+
$other_element = isset($_POST['wdform_'.$id1."_other_input".$form_id]) ? esc_html($_POST['wdform_'.$id1."_other_input".$form_id]) : NULL;
|
| 1785 |
+
if (isset($other_element)) {
|
| 1786 |
+
$is_other = TRUE;
|
| 1787 |
+
}
|
| 1788 |
+
}
|
| 1789 |
+
}
|
| 1790 |
+
else {
|
| 1791 |
+
$is_other=($param['w_allow_other']=="yes" && $param['w_choices_checked'][$param['w_allow_other_num']]=='true') ;
|
| 1792 |
+
}
|
| 1793 |
+
$rep='<div type="type_checkbox" class="wdform-field"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 1794 |
+
if($required) {
|
| 1795 |
+
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 1796 |
+
}
|
| 1797 |
+
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].';">';
|
| 1798 |
+
|
| 1799 |
+
$rep.='<div style="display: '.($param['w_flow']=='hor' ? 'inline-block' : 'table-row' ).'; vertical-align:top">';
|
| 1800 |
+
|
| 1801 |
+
$total_queries = 0;
|
| 1802 |
+
foreach ($param['w_choices'] as $key => $choice) {
|
| 1803 |
+
|
| 1804 |
+
$key1 = $key + $total_queries;
|
| 1805 |
+
if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
|
| 1806 |
+
{
|
| 1807 |
+
$choices_labels =array();
|
| 1808 |
+
$choices_values = array();
|
| 1809 |
+
|
| 1810 |
+
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
|
| 1811 |
+
$where = (str_replace(array('[',']'), '', $w_choices_params[0]) ? ' WHERE '.str_replace(array('[',']'), '', $w_choices_params[0]) : '');
|
| 1812 |
+
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 1813 |
+
|
| 1814 |
+
$order_by = str_replace(array('[',']'), '', $w_choices_params[0]);
|
| 1815 |
+
$db_info = str_replace(array('[',']'), '', $w_choices_params[1]);
|
| 1816 |
+
|
| 1817 |
+
|
| 1818 |
+
$label_table_and_column = explode(':',str_replace(array('[',']'), '', $choice));
|
| 1819 |
+
$table = $label_table_and_column[0];
|
| 1820 |
+
$label_column = $label_table_and_column[1];
|
| 1821 |
+
if($label_column)
|
| 1822 |
+
{
|
| 1823 |
+
$choices_labels = $this->model->select_data_from_db_for_labels($db_info, $label_column, $table, $where, $order_by);
|
| 1824 |
+
}
|
| 1825 |
+
|
| 1826 |
+
$value_table_and_column = explode(':',str_replace(array('[',']'), '', $param['w_choices_value'][$key]));
|
| 1827 |
+
$value_column = $value_table_and_column[1];
|
| 1828 |
+
|
| 1829 |
+
if($value_column)
|
| 1830 |
+
{
|
| 1831 |
+
$choices_values = $this->model->select_data_from_db_for_values($db_info, $value_column, $table, $where, $order_by);
|
| 1832 |
+
}
|
| 1833 |
+
$columns_count_checkbox = count($choices_labels)>0 ? count($choices_labels) : count($choices_values);
|
| 1834 |
+
|
| 1835 |
+
if(array_filter($choices_labels) || array_filter($choices_values))
|
| 1836 |
+
{
|
| 1837 |
+
$total_queries = $total_queries + $columns_count_checkbox-1;
|
| 1838 |
+
|
| 1839 |
+
if(!isset($post_value))
|
| 1840 |
+
$param['w_choices_checked'][$key]=($param['w_choices_checked'][$key]=='true' ? 'checked="checked"' : '');
|
| 1841 |
+
|
| 1842 |
+
for($k=0; $k<$columns_count_checkbox; $k++)
|
| 1843 |
+
{
|
| 1844 |
+
$choice_label = isset($choices_labels[$k]) ? $choices_labels[$k] : '';
|
| 1845 |
+
$choice_value = isset($choices_values[$k]) ? $choices_values[$k] : $choice_label;
|
| 1846 |
+
|
| 1847 |
+
if(($key1+$k)%$param['w_rowcol']==0 && ($key1+$k)>0)
|
| 1848 |
+
$rep.='</div><div style="display: '.($param['w_flow']=='hor' ? 'inline-block' : 'table-row' ).'; vertical-align:top">';
|
| 1849 |
+
|
| 1850 |
+
if(isset($post_value))
|
| 1851 |
+
{
|
| 1852 |
+
$post_valuetemp=$_REQUEST['wdform_'.$id1."_element".$form_id.($key1+$k)];
|
| 1853 |
+
$param['w_choices_checked'][$key]=(isset($post_valuetemp) ? 'checked="checked"' : '');
|
| 1854 |
+
}
|
| 1855 |
+
|
| 1856 |
+
$rep.='<div style="display: '.($param['w_flow']!='hor' ? 'table-cell' : 'table-row' ).';"><label class="wdform-ch-rad-label" for="wdform_'.$id1.'_element'.$form_id.''.($key1+$k).'" '.$param['w_field_option_pos1'].'>'.$choice_label[0].'</label><div class="checkbox-div forlabs" '.$param['w_field_option_pos2'].'><input type="checkbox" '.(($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key) ? 'other="1"' : '' ).' id="wdform_'.$id1.'_element'.$form_id.''.($key1+$k).'" name="wdform_'.$id1.'_element'.$form_id.''.($key1+$k).'" value="'.htmlspecialchars($choice_value[0]).'" '.(($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key) ? 'onclick="if(set_checked("wdform_'.$id1.'","'.($key1+$k).'","'.$form_id.'")) show_other_input("wdform_'.$id1.'","'.$form_id.'");"' : '').' '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label for="wdform_'.$id1.'_element'.$form_id.''.($key1+$k).'"></label></div></div>';
|
| 1857 |
+
|
| 1858 |
+
}
|
| 1859 |
+
}
|
| 1860 |
+
}
|
| 1861 |
+
else
|
| 1862 |
+
{
|
| 1863 |
+
if ($key1%$param['w_rowcol']==0 && $key1>0) {
|
| 1864 |
+
$rep.='</div><div style="display: '.($param['w_flow']=='hor' ? 'inline-block' : 'table-row' ).'; vertical-align:top">';
|
| 1865 |
+
}
|
| 1866 |
+
if(!isset($post_value)) {
|
| 1867 |
+
$param['w_choices_checked'][$key]=($param['w_choices_checked'][$key]=='true' ? 'checked="checked"' : '');
|
| 1868 |
+
}
|
| 1869 |
+
else {
|
| 1870 |
+
$post_valuetemp = isset($_POST['wdform_'.$id1."_element".$form_id.$key]) ? esc_html(stripslashes($_POST['wdform_'.$id1."_element".$form_id.$key])) : NULL;
|
| 1871 |
+
$param['w_choices_checked'][$key]=(isset($post_valuetemp) ? 'checked="checked"' : '');
|
| 1872 |
+
}
|
| 1873 |
+
$choice_value = isset($param['w_choices_value']) ? $param['w_choices_value'][$key] : $choice;
|
| 1874 |
+
|
| 1875 |
+
$rep.='<div style="display: '.($param['w_flow']!='hor' ? 'table-cell' : 'table-row' ).';"><label class="wdform-ch-rad-label" for="wdform_'.$id1.'_element'.$form_id.''.$key1.'" '.$param['w_field_option_pos1'].'>'.$choice.'</label><div class="checkbox-div forlabs" '.$param['w_field_option_pos2'].'><input type="checkbox" '.(($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key) ? 'other="1"' : '' ).' id="wdform_'.$id1.'_element'.$form_id.''.$key1.'" name="wdform_'.$id1.'_element'.$form_id.''.$key1.'" value="'.htmlspecialchars($choice_value).'" '.(($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key) ? 'onclick="if(set_checked("wdform_'.$id1.'","'.$key1.'","'.$form_id.'")) show_other_input("wdform_'.$id1.'","'.$form_id.'");"' : '').' '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label for="wdform_'.$id1.'_element'.$form_id.''.$key1.'"></label></div></div>';
|
| 1876 |
+
|
| 1877 |
+
$param['w_allow_other_num'] = $param['w_allow_other_num']==$key ? $key1 : $param['w_allow_other_num'];
|
| 1878 |
+
}
|
| 1879 |
+
}
|
| 1880 |
+
$rep.='</div>';
|
| 1881 |
+
|
| 1882 |
+
$rep.='</div></div>';
|
| 1883 |
+
|
| 1884 |
+
if($required) {
|
| 1885 |
+
$check_js.='
|
| 1886 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 1887 |
+
{
|
| 1888 |
+
if(x.find(jQuery("div[wdid='.$id1.'] input:checked")).length == 0 || jQuery("#wdform_'.$id1.'_other_input'.$form_id.'").val() == "")
|
| 1889 |
+
{
|
| 1890 |
+
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 1891 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 1892 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 1893 |
+
|
| 1894 |
+
return false;
|
| 1895 |
+
}
|
| 1896 |
+
}
|
| 1897 |
+
';
|
| 1898 |
+
}
|
| 1899 |
+
if($is_other) {
|
| 1900 |
+
$onload_js .='show_other_input("wdform_'.$id1.'","'.$form_id.'"); jQuery("#wdform_'.$id1.'_other_input'.$form_id.'").val("'.(isset($_POST['wdform_'.$id1."_other_input".$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1."_other_input".$form_id])) : '').'");';
|
| 1901 |
+
}
|
| 1902 |
+
if($param['w_randomize']=='yes')
|
| 1903 |
+
{
|
| 1904 |
+
$onload_js .='jQuery("#form'.$form_id.' div[wdid='.$id1.'] .wdform-element-section> div").shuffle();
|
| 1905 |
+
';
|
| 1906 |
+
}
|
| 1907 |
+
$onsubmit_js.='
|
| 1908 |
+
jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_allow_other'.$form_id.'\" value = \"'.$param['w_allow_other'].'\" />").appendTo("#form'.$form_id.'");
|
| 1909 |
+
jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_allow_other_num'.$form_id.'\" value = \"'.$param['w_allow_other_num'].'\" />").appendTo("#form'.$form_id.'");
|
| 1910 |
+
';
|
| 1911 |
+
break;
|
| 1912 |
+
}
|
| 1913 |
+
|
| 1914 |
+
case 'type_radio': {
|
| 1915 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_flow','w_choices','w_choices_checked','w_rowcol', 'w_required','w_randomize','w_allow_other','w_allow_other_num','w_class');
|
| 1916 |
+
$temp=$params;
|
| 1917 |
+
if(strpos($temp, 'w_field_option_pos') > -1)
|
| 1918 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_field_option_pos','w_flow','w_choices','w_choices_checked','w_rowcol', 'w_required','w_randomize','w_allow_other','w_allow_other_num','w_value_disabled','w_choices_value', 'w_choices_params','w_class');
|
| 1919 |
+
|
| 1920 |
+
foreach($params_names as $params_name ) {
|
| 1921 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 1922 |
+
$param[$params_name] = $temp[0];
|
| 1923 |
+
$temp=$temp[1];
|
| 1924 |
+
}
|
| 1925 |
+
|
| 1926 |
+
if($temp) {
|
| 1927 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 1928 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 1929 |
+
foreach($attrs as $attr) {
|
| 1930 |
+
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 1931 |
+
}
|
| 1932 |
+
}
|
| 1933 |
+
if(!isset($param['w_value_disabled']))
|
| 1934 |
+
$param['w_value_disabled'] = 'no';
|
| 1935 |
+
|
| 1936 |
+
if(!isset($param['w_field_option_pos']))
|
| 1937 |
+
$param['w_field_option_pos'] = 'left';
|
| 1938 |
+
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 1939 |
+
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 1940 |
+
$param['w_field_option_pos1'] = ($param['w_field_option_pos']=="right" ? "style='float: none
|
| 1941 |
+
!important;'" : "");
|
| 1942 |
+
$param['w_field_option_pos2'] = ($param['w_field_option_pos']=="right" ? "style='float: left !important; margin:3px 8px 0 0 !important; display: inline-block !important;'" : "");
|
| 1943 |
+
$required = ($param['w_required']=="yes" ? true : false);
|
| 1944 |
+
$param['w_choices'] = explode('***',$param['w_choices']);
|
| 1945 |
+
$param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
|
| 1946 |
+
if(isset($param['w_choices_value']))
|
| 1947 |
+
{
|
| 1948 |
+
$param['w_choices_value'] = explode('***',$param['w_choices_value']);
|
| 1949 |
+
$param['w_choices_params'] = explode('***',$param['w_choices_params']);
|
| 1950 |
+
}
|
| 1951 |
+
$post_value = isset($_POST["counter".$form_id]) ? esc_html($_POST["counter".$form_id]) : NULL;
|
| 1952 |
+
$is_other=false;
|
| 1953 |
+
|
| 1954 |
+
if(isset($post_value)) {
|
| 1955 |
+
if($param['w_allow_other']=="yes") {
|
| 1956 |
+
$is_other=false;
|
| 1957 |
+
$other_element = isset($_POST['wdform_'.$id1."_other_input".$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1."_other_input".$form_id])) : "";
|
| 1958 |
+
if(isset($other_element)) {
|
| 1959 |
+
$is_other=true;
|
| 1960 |
+
}
|
| 1961 |
+
}
|
| 1962 |
+
}
|
| 1963 |
+
else {
|
| 1964 |
+
$is_other=($param['w_allow_other']=="yes" && $param['w_choices_checked'][$param['w_allow_other_num']]=='true') ;
|
| 1965 |
+
}
|
| 1966 |
+
$rep='<div type="type_radio" class="wdform-field"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 1967 |
+
if($required) {
|
| 1968 |
+
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 1969 |
+
}
|
| 1970 |
+
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].';">';
|
| 1971 |
+
|
| 1972 |
+
$rep.='<div style="display: '.($param['w_flow']=='hor' ? 'inline-block' : 'table-row' ).'; vertical-align:top">';
|
| 1973 |
+
|
| 1974 |
+
$total_queries =0;
|
| 1975 |
+
foreach($param['w_choices'] as $key => $choice) {
|
| 1976 |
+
|
| 1977 |
+
$key1 = $key + $total_queries;
|
| 1978 |
+
|
| 1979 |
+
if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
|
| 1980 |
+
{
|
| 1981 |
+
$choices_labels =array();
|
| 1982 |
+
$choices_values =array();
|
| 1983 |
+
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
|
| 1984 |
+
$where = (str_replace(array('[',']'), '', $w_choices_params[0]) ? ' WHERE '.str_replace(array('[',']'), '', $w_choices_params[0]) : '');
|
| 1985 |
+
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 1986 |
+
$order_by = str_replace(array('[',']'), '', $w_choices_params[0]);
|
| 1987 |
+
$db_info = str_replace(array('[',']'), '', $w_choices_params[1]);
|
| 1988 |
+
|
| 1989 |
+
|
| 1990 |
+
$label_table_and_column = explode(':',str_replace(array('[',']'), '', $choice));
|
| 1991 |
+
$table = $label_table_and_column[0];
|
| 1992 |
+
$label_column = $label_table_and_column[1];
|
| 1993 |
+
if($label_column)
|
| 1994 |
+
{
|
| 1995 |
+
$choices_labels = $this->model->select_data_from_db_for_labels($db_info, $label_column, $table, $where, $order_by);
|
| 1996 |
+
}
|
| 1997 |
+
|
| 1998 |
+
$value_table_and_column = explode(':',str_replace(array('[',']'), '', $param['w_choices_value'][$key]));
|
| 1999 |
+
$value_column = $value_table_and_column[1];
|
| 2000 |
+
|
| 2001 |
+
if($value_column)
|
| 2002 |
+
{
|
| 2003 |
+
$choices_values = $this->model->select_data_from_db_for_values($db_info, $value_column, $table, $where, $order_by);
|
| 2004 |
+
}
|
| 2005 |
+
|
| 2006 |
+
$columns_count_radio = count($choices_labels)>0 ? count($choices_labels) : count($choices_values);
|
| 2007 |
+
if(array_filter($choices_labels) || array_filter($choices_values))
|
| 2008 |
+
{
|
| 2009 |
+
$total_queries = $total_queries + $columns_count_radio-1;
|
| 2010 |
+
|
| 2011 |
+
if(!isset($post_value))
|
| 2012 |
+
$param['w_choices_checked'][$key]=($param['w_choices_checked'][$key]=='true' ? 'checked="checked"' : '');
|
| 2013 |
+
|
| 2014 |
+
for($k=0; $k<$columns_count_radio; $k++)
|
| 2015 |
+
{
|
| 2016 |
+
$choice_label = isset($choices_labels[$k]) ? $choices_labels[$k] : '';
|
| 2017 |
+
$choice_value = isset($choices_values[$k]) ? $choices_values[$k] : $choice_label;
|
| 2018 |
+
|
| 2019 |
+
if(($key1+$k)%$param['w_rowcol']==0 && ($key1+$k)>0)
|
| 2020 |
+
$rep.='</div><div style="display: '.($param['w_flow']=='hor' ? 'inline-block' : 'table-row' ).'; vertical-align:top">';
|
| 2021 |
+
|
| 2022 |
+
if(isset($post_value))
|
| 2023 |
+
{
|
| 2024 |
+
$post_valuetemp=$_REQUEST['wdform_'.$id1."_element".$form_id];
|
| 2025 |
+
$param['w_choices_checked'][$key]=(isset($post_valuetemp) ? 'checked="checked"' : '');
|
| 2026 |
+
}
|
| 2027 |
+
|
| 2028 |
+
$rep.='<div style="display: '.($param['w_flow']!='hor' ? 'table-cell' : 'table-row' ).';"><label class="wdform-ch-rad-label" for="wdform_'.$id1.'_element'.$form_id.''.($key1+$k).'" '.$param['w_field_option_pos1'].'>'.$choice_label[0].'</label><div class="radio-div forlabs" '.$param['w_field_option_pos2'].'><input type="radio" '.(($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key) ? 'other="1"' : '' ).' id="wdform_'.$id1.'_element'.$form_id.''.($key1+$k).'" name="wdform_'.$id1.'_element'.$form_id.'" value="'.htmlspecialchars($choice_value[0]).'" onclick="set_default("wdform_'.$id1.'","'.($key1+$k).'","'.$form_id.'"); '.(($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key) ? 'show_other_input("wdform_'.$id1.'","'.$form_id.'");' : '').'" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label for="wdform_'.$id1.'_element'.$form_id.''.($key1+$k).'"></label></div></div>';
|
| 2029 |
+
}
|
| 2030 |
+
}
|
| 2031 |
+
}
|
| 2032 |
+
else
|
| 2033 |
+
{
|
| 2034 |
+
|
| 2035 |
+
if($key1%$param['w_rowcol']==0 && $key1>0) {
|
| 2036 |
+
$rep.='</div><div style="display: '.($param['w_flow']=='hor' ? 'inline-block' : 'table-row' ).'; vertical-align:top">';
|
| 2037 |
+
}
|
| 2038 |
+
if(!isset($post_value)) {
|
| 2039 |
+
$param['w_choices_checked'][$key]=($param['w_choices_checked'][$key]=='true' ? 'checked="checked"' : '');
|
| 2040 |
+
}
|
| 2041 |
+
else {
|
| 2042 |
+
$param['w_choices_checked'][$key] = (htmlspecialchars($choice) == htmlspecialchars(isset($_POST['wdform_'.$id1."_element".$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1."_element".$form_id])) : "") ? 'checked="checked"' : '');
|
| 2043 |
+
}
|
| 2044 |
+
$choice_value = isset($param['w_choices_value']) ? $param['w_choices_value'][$key] : $choice;
|
| 2045 |
+
$rep.='<div style="display: '.($param['w_flow']!='hor' ? 'table-cell' : 'table-row' ).';"><label class="wdform-ch-rad-label" for="wdform_'.$id1.'_element'.$form_id.''.$key1.'" '.$param['w_field_option_pos1'].'>'.$choice.'</label><div class="radio-div forlabs" '.$param['w_field_option_pos2'].'><input type="radio" '.(($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key) ? 'other="1"' : '' ).' id="wdform_'.$id1.'_element'.$form_id.''.$key1.'" name="wdform_'.$id1.'_element'.$form_id.'" value="'.htmlspecialchars($choice_value).'" onclick="set_default("wdform_'.$id1.'","'.$key1.'","'.$form_id.'"); '.(($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key) ? 'show_other_input("wdform_'.$id1.'","'.$form_id.'");' : '').'" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label for="wdform_'.$id1.'_element'.$form_id.''.$key1.'"></label></div></div>';
|
| 2046 |
+
$param['w_allow_other_num'] = $param['w_allow_other_num']==$key ? $key1 : $param['w_allow_other_num'];
|
| 2047 |
+
}
|
| 2048 |
+
}
|
| 2049 |
+
$rep.='</div>';
|
| 2050 |
+
|
| 2051 |
+
$rep.='</div></div>';
|
| 2052 |
+
|
| 2053 |
+
if($required) {
|
| 2054 |
+
$check_js.='
|
| 2055 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none") {
|
| 2056 |
+
if(x.find(jQuery("div[wdid='.$id1.'] input:checked")).length == 0 || jQuery("#wdform_'.$id1.'_other_input'.$form_id.'").val() == "") {
|
| 2057 |
+
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 2058 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 2059 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 2060 |
+
|
| 2061 |
+
return false;
|
| 2062 |
+
}
|
| 2063 |
+
}';
|
| 2064 |
+
}
|
| 2065 |
+
if($is_other) {
|
| 2066 |
+
$onload_js .='show_other_input("wdform_'.$id1.'","'.$form_id.'"); jQuery("#wdform_'.$id1.'_other_input'.$form_id.'").val("'.(isset($_POST['wdform_'.$id1."_other_input".$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1."_other_input".$form_id])) : '').'");';
|
| 2067 |
+
}
|
| 2068 |
+
if($param['w_randomize']=='yes')
|
| 2069 |
+
{
|
| 2070 |
+
$onload_js .='jQuery("#form'.$form_id.' div[wdid='.$id1.'] .wdform-element-section> div").shuffle();
|
| 2071 |
+
';
|
| 2072 |
+
}
|
| 2073 |
+
$onsubmit_js.='
|
| 2074 |
+
jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_allow_other'.$form_id.'\" value = \"'.$param['w_allow_other'].'\" />").appendTo("#form'.$form_id.'");
|
| 2075 |
+
jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_allow_other_num'.$form_id.'\" value = \"'.$param['w_allow_other_num'].'\" />").appendTo("#form'.$form_id.'");
|
| 2076 |
+
';
|
| 2077 |
+
break;
|
| 2078 |
+
}
|
| 2079 |
+
|
| 2080 |
+
case 'type_own_select': {
|
| 2081 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_choices','w_choices_checked', 'w_choices_disabled','w_required','w_class');
|
| 2082 |
+
$temp=$params;
|
| 2083 |
+
|
| 2084 |
+
if(strpos($temp, 'w_choices_value') > -1)
|
| 2085 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_choices','w_choices_checked', 'w_choices_disabled', 'w_required', 'w_value_disabled', 'w_choices_value', 'w_choices_params', 'w_class');
|
| 2086 |
+
|
| 2087 |
+
foreach($params_names as $params_name ) {
|
| 2088 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2089 |
+
$param[$params_name] = $temp[0];
|
| 2090 |
+
$temp=$temp[1];
|
| 2091 |
+
}
|
| 2092 |
+
if($temp) {
|
| 2093 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 2094 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2095 |
+
foreach($attrs as $attr)
|
| 2096 |
+
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 2097 |
+
}
|
| 2098 |
+
|
| 2099 |
+
$wdformfieldsize = ($param['w_field_label_pos']=="left" ? ($param['w_field_label_size']+$param['w_size']) : max($param['w_field_label_size'], $param['w_size']));
|
| 2100 |
+
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 2101 |
+
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 2102 |
+
$required = ($param['w_required']=="yes" ? true : false);
|
| 2103 |
+
$param['w_choices'] = explode('***',$param['w_choices']);
|
| 2104 |
+
$param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
|
| 2105 |
+
$param['w_choices_disabled'] = explode('***',$param['w_choices_disabled']);
|
| 2106 |
+
|
| 2107 |
+
if(isset($param['w_choices_value']))
|
| 2108 |
+
{
|
| 2109 |
+
$param['w_choices_value'] = explode('***',$param['w_choices_value']);
|
| 2110 |
+
$param['w_choices_params'] = explode('***',$param['w_choices_params']);
|
| 2111 |
+
}
|
| 2112 |
+
|
| 2113 |
+
if(!isset($param['w_value_disabled']))
|
| 2114 |
+
$param['w_value_disabled'] = 'no';
|
| 2115 |
+
|
| 2116 |
+
$post_value = isset($_POST["counter".$form_id]) ? esc_html($_POST["counter".$form_id]) : NULL;
|
| 2117 |
+
|
| 2118 |
+
$rep='<div type="type_own_select" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 2119 |
+
if($required) {
|
| 2120 |
+
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 2121 |
+
}
|
| 2122 |
+
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].' width: '.($param['w_size']).'px; "><select id="wdform_'.$id1.'_element'.$form_id.'" name="wdform_'.$id1.'_element'.$form_id.'" style="width: 100%" '.$param['attributes'].'>';
|
| 2123 |
+
foreach($param['w_choices'] as $key => $choice)
|
| 2124 |
+
{
|
| 2125 |
+
if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
|
| 2126 |
+
{
|
| 2127 |
+
$choices_labels =array();
|
| 2128 |
+
$choices_values = array();
|
| 2129 |
+
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
|
| 2130 |
+
$where = (str_replace(array('[',']'), '', $w_choices_params[0]) ? ' WHERE '.str_replace(array('[',']'), '', $w_choices_params[0]) : '');
|
| 2131 |
+
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 2132 |
+
$order_by = str_replace(array('[',']'), '', $w_choices_params[0]);
|
| 2133 |
+
$db_info = str_replace(array('[',']'), '', $w_choices_params[1]);
|
| 2134 |
+
|
| 2135 |
+
|
| 2136 |
+
|
| 2137 |
+
$label_table_and_column = explode(':',str_replace(array('[',']'), '', $choice));
|
| 2138 |
+
$table = $label_table_and_column[0];
|
| 2139 |
+
$label_column = $label_table_and_column[1];
|
| 2140 |
+
if($label_column)
|
| 2141 |
+
{
|
| 2142 |
+
$choices_labels = $this->model->select_data_from_db_for_labels($db_info, $label_column, $table, $where, $order_by);
|
| 2143 |
+
}
|
| 2144 |
+
|
| 2145 |
+
$value_table_and_column = explode(':',str_replace(array('[',']'), '', $param['w_choices_value'][$key]));
|
| 2146 |
+
$value_column = $param['w_choices_disabled'][$key]=="true" ? '' : $value_table_and_column[1];
|
| 2147 |
+
|
| 2148 |
+
if($value_column)
|
| 2149 |
+
{
|
| 2150 |
+
$choices_values = $this->model->select_data_from_db_for_values($db_info, $value_column, $table, $where, $order_by);
|
| 2151 |
+
}
|
| 2152 |
+
|
| 2153 |
+
$columns_count = count($choices_labels)>0 ? count($choices_labels) : count($choices_values);
|
| 2154 |
+
if(array_filter($choices_labels) || array_filter($choices_values))
|
| 2155 |
+
for($k=0; $k<$columns_count; $k++)
|
| 2156 |
+
{
|
| 2157 |
+
$choice_label = isset($choices_labels[$k]) ? $choices_labels[$k] : '';
|
| 2158 |
+
$choice_value = isset($choices_values[$k]) ? $choices_values[$k] : ($param['w_choices_disabled'][$key]=="true" ? '' : $choice_label);
|
| 2159 |
+
if(!isset($post_value))
|
| 2160 |
+
$param['w_choices_checked'][$key]=(($param['w_choices_checked'][$key]=='true' && $k == 0) ? 'selected="selected"' : '');
|
| 2161 |
+
else
|
| 2162 |
+
$param['w_choices_checked'][$key]=($choice_value==htmlspecialchars($_REQUEST['wdform_'.$id1."_element".$form_id]) ? 'selected="selected"' : '');
|
| 2163 |
+
|
| 2164 |
+
$rep.='<option value="'.htmlspecialchars($choice_value[0]).'" '.$param['w_choices_checked'][$key].'>'.$choice_label[0].'</option>';
|
| 2165 |
+
|
| 2166 |
+
}
|
| 2167 |
+
}
|
| 2168 |
+
else
|
| 2169 |
+
{
|
| 2170 |
+
if(!isset($post_value))
|
| 2171 |
+
$param['w_choices_checked'][$key]=($param['w_choices_checked'][$key]=='true' ? 'selected="selected"' : '');
|
| 2172 |
+
else
|
| 2173 |
+
$param['w_choices_checked'][$key]=(htmlspecialchars($choice)==htmlspecialchars($_REQUEST['wdform_'.$id1."_element".$form_id]) ? 'selected="selected"' : '');
|
| 2174 |
+
|
| 2175 |
+
$choice_value = $param['w_choices_disabled'][$key]=="true" ? '' : (isset($param['w_choices_value']) ? $param['w_choices_value'][$key] : $choice);
|
| 2176 |
+
|
| 2177 |
+
$rep.='<option value="'.htmlspecialchars($choice_value).'" '.$param['w_choices_checked'][$key].'>'.$choice.'</option>';
|
| 2178 |
+
|
| 2179 |
+
}
|
| 2180 |
+
|
| 2181 |
+
}
|
| 2182 |
+
$rep.='</select></div></div>';
|
| 2183 |
+
|
| 2184 |
+
if($required) {
|
| 2185 |
+
$check_js.='
|
| 2186 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 2187 |
+
{
|
| 2188 |
+
if( jQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="")
|
| 2189 |
+
{
|
| 2190 |
+
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 2191 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'").addClass( "form-error" );
|
| 2192 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 2193 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 2194 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'").focus();
|
| 2195 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'").change(function() { if( jQuery(this).val()!="" ) jQuery(this).removeClass("form-error"); else jQuery(this).addClass("form-error");});
|
| 2196 |
+
return false;
|
| 2197 |
+
}
|
| 2198 |
+
}
|
| 2199 |
+
';
|
| 2200 |
+
}
|
| 2201 |
+
break;
|
| 2202 |
+
}
|
| 2203 |
+
|
| 2204 |
+
case 'type_country': {
|
| 2205 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_countries','w_required','w_class');
|
| 2206 |
+
$temp=$params;
|
| 2207 |
+
foreach($params_names as $params_name ) {
|
| 2208 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2209 |
+
$param[$params_name] = $temp[0];
|
| 2210 |
+
$temp=$temp[1];
|
| 2211 |
+
}
|
| 2212 |
+
if($temp) {
|
| 2213 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 2214 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2215 |
+
foreach($attrs as $attr) {
|
| 2216 |
+
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 2217 |
+
}
|
| 2218 |
+
}
|
| 2219 |
+
|
| 2220 |
+
$wdformfieldsize = ($param['w_field_label_pos']=="left" ? ($param['w_field_label_size']+$param['w_size']) : max($param['w_field_label_size'], $param['w_size']));
|
| 2221 |
+
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 2222 |
+
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 2223 |
+
$required = ($param['w_required']=="yes" ? true : false);
|
| 2224 |
+
$param['w_countries'] = explode('***',$param['w_countries']);
|
| 2225 |
+
|
| 2226 |
+
$post_value = isset($_POST["counter".$form_id]) ? esc_html($_POST["counter".$form_id]) : NULL;
|
| 2227 |
+
$selected='';
|
| 2228 |
+
|
| 2229 |
+
$rep='<div type="type_country" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 2230 |
+
if($required) {
|
| 2231 |
+
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 2232 |
+
}
|
| 2233 |
+
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].' width: '.$param['w_size'].'px;"><select id="wdform_'.$id1.'_element'.$form_id.'" name="wdform_'.$id1.'_element'.$form_id.'" style="width: 100%;" '.$param['attributes'].'>';
|
| 2234 |
+
foreach($param['w_countries'] as $key => $choice) {
|
| 2235 |
+
if(isset($post_value)) {
|
| 2236 |
+
$selected = (htmlspecialchars($choice) == htmlspecialchars(isset($_POST['wdform_'.$id1."_element".$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1."_element".$form_id])) : "") ? 'selected="selected"' : '');
|
| 2237 |
+
}
|
| 2238 |
+
$choice_value=$choice;
|
| 2239 |
+
$rep.='<option value="'.$choice_value.'" '.$selected.'>'.$choice.'</option>';
|
| 2240 |
+
}
|
| 2241 |
+
$rep.='</select></div></div>';
|
| 2242 |
+
|
| 2243 |
+
if($required) {
|
| 2244 |
+
$check_js.='
|
| 2245 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 2246 |
+
{
|
| 2247 |
+
if(jQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="")
|
| 2248 |
+
{
|
| 2249 |
+
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 2250 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'").addClass( "form-error" );
|
| 2251 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 2252 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 2253 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'").focus();
|
| 2254 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'").change(function() { if( jQuery(this).val()!="" ) jQuery(this).removeClass("form-error"); else jQuery(this).addClass("form-error");});
|
| 2255 |
+
return false;
|
| 2256 |
+
}
|
| 2257 |
+
}
|
| 2258 |
+
';
|
| 2259 |
+
}
|
| 2260 |
+
break;
|
| 2261 |
+
}
|
| 2262 |
+
|
| 2263 |
+
case 'type_time': {
|
| 2264 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_time_type','w_am_pm','w_sec','w_hh','w_mm','w_ss','w_mini_labels','w_required','w_class');
|
| 2265 |
+
$temp=$params;
|
| 2266 |
+
|
| 2267 |
+
foreach($params_names as $params_name ) {
|
| 2268 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2269 |
+
$param[$params_name] = $temp[0];
|
| 2270 |
+
$temp=$temp[1];
|
| 2271 |
+
}
|
| 2272 |
+
|
| 2273 |
+
if($temp) {
|
| 2274 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 2275 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2276 |
+
foreach($attrs as $attr) {
|
| 2277 |
+
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 2278 |
+
}
|
| 2279 |
+
}
|
| 2280 |
+
|
| 2281 |
+
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 2282 |
+
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 2283 |
+
$required = ($param['w_required']=="yes" ? true : false);
|
| 2284 |
+
$w_mini_labels = explode('***',$param['w_mini_labels']);
|
| 2285 |
+
|
| 2286 |
+
$w_sec = '';
|
| 2287 |
+
$w_sec_label='';
|
| 2288 |
+
|
| 2289 |
+
if($param['w_sec']=='1') {
|
| 2290 |
+
$w_sec = '<div align="center" style="display: table-cell;"><span class="wdform_colon" style="vertical-align: middle;"> : </span></div><div style="display: table-cell;"><input type="text" value="'.(isset($_POST['wdform_'.$id1."_ss".$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1."_ss".$form_id])) : $param['w_ss']).'" class="time_box" id="wdform_'.$id1.'_ss'.$form_id.'" name="wdform_'.$id1.'_ss'.$form_id.'" onkeypress="return check_second(event, "wdform_'.$id1.'_ss'.$form_id.'")" '.$param['attributes'].'></div>';
|
| 2291 |
+
|
| 2292 |
+
$w_sec_label='<div style="display: table-cell;"></div><div style="display: table-cell;"><label class="mini_label">'.$w_mini_labels[2].'</label></div>';
|
| 2293 |
+
}
|
| 2294 |
+
|
| 2295 |
+
if($param['w_time_type']=='12') {
|
| 2296 |
+
if((isset($_POST['wdform_'.$id1."_am_pm".$form_id]) ? esc_html($_POST['wdform_'.$id1."_am_pm".$form_id]) : $param['w_am_pm'])=='am') {
|
| 2297 |
+
$am_ = "selected=\"selected\"";
|
| 2298 |
+
$pm_ = "";
|
| 2299 |
+
}
|
| 2300 |
+
else {
|
| 2301 |
+
$am_ = "";
|
| 2302 |
+
$pm_ = "selected=\"selected\"";
|
| 2303 |
+
}
|
| 2304 |
+
|
| 2305 |
+
$w_time_type = '<div style="display: table-cell;"><select class="am_pm_select" name="wdform_'.$id1.'_am_pm'.$form_id.'" id="wdform_'.$id1.'_am_pm'.$form_id.'" '.$param['attributes'].'><option value="am" '.$am_.'>AM</option><option value="pm" '.$pm_.'>PM</option></select></div>';
|
| 2306 |
+
|
| 2307 |
+
$w_time_type_label = '<div ><label class="mini_label">'.$w_mini_labels[3].'</label></div>';
|
| 2308 |
+
}
|
| 2309 |
+
else {
|
| 2310 |
+
$w_time_type='';
|
| 2311 |
+
$w_time_type_label = '';
|
| 2312 |
+
}
|
| 2313 |
+
$rep ='<div type="type_time" class="wdform-field"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 2314 |
+
if($required) {
|
| 2315 |
+
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 2316 |
+
}
|
| 2317 |
+
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].';"><div style="display: table;"><div style="display: table-row;"><div style="display: table-cell;"><input type="text" value="'.(isset($_POST['wdform_'.$id1."_hh".$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1."_hh".$form_id])) : $param['w_hh']).'" class="time_box" id="wdform_'.$id1.'_hh'.$form_id.'" name="wdform_'.$id1.'_hh'.$form_id.'" onkeypress="return check_hour(event, "wdform_'.$id1.'_hh'.$form_id.'", "23")" '.$param['attributes'].'></div><div align="center" style="display: table-cell;"><span class="wdform_colon" style="vertical-align: middle;"> : </span></div><div style="display: table-cell;"><input type="text" value="'.(isset($_POST['wdform_'.$id1."_mm".$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1."_mm".$form_id])) : $param['w_mm']).'" class="time_box" id="wdform_'.$id1.'_mm'.$form_id.'" name="wdform_'.$id1.'_mm'.$form_id.'" onkeypress="return check_minute(event, "wdform_'.$id1.'_mm'.$form_id.'")" '.$param['attributes'].'></div>'.$w_sec.$w_time_type.'</div><div style="display: table-row;"><div style="display: table-cell;"><label class="mini_label">'.$w_mini_labels[0].'</label></div><div style="display: table-cell;"></div><div style="display: table-cell;"><label class="mini_label">'.$w_mini_labels[1].'</label></div>'.$w_sec_label.$w_time_type_label.'</div></div></div></div>';
|
| 2318 |
+
|
| 2319 |
+
if($required) {
|
| 2320 |
+
$check_js.='
|
| 2321 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 2322 |
+
{
|
| 2323 |
+
if(jQuery("#wdform_'.$id1.'_mm'.$form_id.'").val()=="" || jQuery("#wdform_'.$id1.'_hh'.$form_id.'").val()=="" || (jQuery("#wdform_'.$id1.'_ss'.$form_id.'").length != 0 ? jQuery("#wdform_'.$id1.'_ss'.$form_id.'").val()=="" : false))
|
| 2324 |
+
{
|
| 2325 |
+
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 2326 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 2327 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 2328 |
+
jQuery("#wdform_'.$id1.'_hh'.$form_id.'").focus();
|
| 2329 |
+
return false;
|
| 2330 |
+
}
|
| 2331 |
+
}
|
| 2332 |
+
';
|
| 2333 |
+
}
|
| 2334 |
+
break;
|
| 2335 |
+
}
|
| 2336 |
+
|
| 2337 |
+
case 'type_date': {
|
| 2338 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_date','w_required','w_class','w_format','w_but_val');
|
| 2339 |
+
$temp = $params;
|
| 2340 |
+
if(strpos($temp, 'w_disable_past_days') > -1)
|
| 2341 |
+
$params_names = array('w_field_label_size','w_field_label_pos','w_date','w_required','w_class','w_format','w_but_val', 'w_disable_past_days');
|
| 2342 |
+
|
| 2343 |
+
foreach($params_names as $params_name ) {
|
| 2344 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2345 |
+
$param[$params_name] = $temp[0];
|
| 2346 |
+
$temp=$temp[1];
|
| 2347 |
+
}
|
| 2348 |
+
if($temp) {
|
| 2349 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 2350 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2351 |
+
foreach($attrs as $attr) {
|
| 2352 |
+
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 2353 |
+
}
|
| 2354 |
+
}
|
| 2355 |
+
|
| 2356 |
+
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 2357 |
+
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 2358 |
+
$required = ($param['w_required']=="yes" ? true : false);
|
| 2359 |
+
|
| 2360 |
+
$param['w_disable_past_days'] = isset($param['w_disable_past_days']) ? $param['w_disable_past_days'] : 'no';
|
| 2361 |
+
$disable_past_days = $param['w_disable_past_days'] == 'yes' ? 'true' : 'false';
|
| 2362 |
+
$param['w_date']=(isset($_POST['wdform_'.$id1."_element".$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1."_element".$form_id])) : $param['w_date']);
|
| 2363 |
+
|
| 2364 |
+
$rep ='<div type="type_date" class="wdform-field"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 2365 |
+
if($required) {
|
| 2366 |
+
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 2367 |
+
}
|
| 2368 |
+
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].';"><input type="text" value="'.$param['w_date'].'" class="wdform-date" id="wdform_'.$id1.'_element'.$form_id.'" name="wdform_'.$id1.'_element'.$form_id.'" maxlength="10" '.$param['attributes'].'><input id="wdform_'.$id1.'_button'.$form_id.'" class="wdform-calendar-button" value="'.$param['w_but_val'].'" format="'.$param['w_format'].'" onclick="return showCalendar(\'wdform_'.$id1.'_element'.$form_id.'\' , \''.$param['w_format'].'\', '.$disable_past_days.')" '.$param['attributes'].' ></div></div>';
|
| 2369 |
+
|
| 2370 |
+
if($required) {
|
| 2371 |
+
$check_js.='
|
| 2372 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 2373 |
+
{
|
| 2374 |
+
if(jQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="")
|
| 2375 |
+
{
|
| 2376 |
+
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 2377 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'").addClass( "form-error" );
|
| 2378 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 2379 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 2380 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'").focus();
|
| 2381 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'").change(function() { if( jQuery(this).val()!="" ) jQuery(this).removeClass("form-error"); else jQuery(this).addClass("form-error");});
|
| 2382 |
+
return false;
|
| 2383 |
+
}
|
| 2384 |
+
}
|
| 2385 |
+
';
|
| 2386 |
+
}
|
| 2387 |
+
|
| 2388 |
+
if($disable_past_days == 'true') {
|
| 2389 |
+
$check_js.='
|
| 2390 |
+
var currentDate = new Date();
|
| 2391 |
+
if( Date.parse(jQuery("#wdform_'.$id1.'_element'.$form_id.'").val() + " 23:59:59") < currentDate.getTime() ) {
|
| 2392 |
+
alert("'.__('You cannot select former dates. Choose a date starting from the current one.', 'form_maker').'");
|
| 2393 |
+
return false;
|
| 2394 |
+
}
|
| 2395 |
+
';
|
| 2396 |
+
}
|
| 2397 |
+
break;
|
| 2398 |
+
}
|
| 2399 |
+
|
| 2400 |
+
case 'type_date_fields': {
|
| 2401 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_day','w_month','w_year','w_day_type','w_month_type','w_year_type','w_day_label','w_month_label','w_year_label','w_day_size','w_month_size','w_year_size','w_required','w_class','w_from','w_to','w_divider');
|
| 2402 |
+
$temp = $params;
|
| 2403 |
+
foreach($params_names as $params_name ) {
|
| 2404 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2405 |
+
$param[$params_name] = $temp[0];
|
| 2406 |
+
$temp=$temp[1];
|
| 2407 |
+
}
|
| 2408 |
+
if($temp) {
|
| 2409 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 2410 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2411 |
+
foreach($attrs as $attr) {
|
| 2412 |
+
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 2413 |
+
}
|
| 2414 |
+
}
|
| 2415 |
+
|
| 2416 |
+
$param['w_day']=(isset($_POST['wdform_'.$id1."_day".$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1."_day".$form_id])) : $param['w_day']);
|
| 2417 |
+
$param['w_month']=(isset($_POST['wdform_'.$id1."_month".$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1."_month".$form_id])) : $param['w_month']);
|
| 2418 |
+
$param['w_year']=(isset($_POST['wdform_'.$id1."_year".$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1."_year".$form_id])) : $param['w_year']);
|
| 2419 |
+
|
| 2420 |
+
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 2421 |
+
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 2422 |
+
$required = ($param['w_required']=="yes" ? true : false);
|
| 2423 |
+
|
| 2424 |
+
if($param['w_day_type']=="SELECT") {
|
| 2425 |
+
$w_day_type = '<select id="wdform_'.$id1.'_day'.$form_id.'" name="wdform_'.$id1.'_day'.$form_id.'" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].'><option value=""></option>';
|
| 2426 |
+
for($k=1; $k<=31; $k++) {
|
| 2427 |
+
if($k<10) {
|
| 2428 |
+
if($param['w_day']=='0'.$k) {
|
| 2429 |
+
$selected = "selected=\"selected\"";
|
| 2430 |
+
}
|
| 2431 |
+
else {
|
| 2432 |
+
$selected = "";
|
| 2433 |
+
}
|
| 2434 |
+
$w_day_type .= '<option value="0'.$k.'" '.$selected.'>0'.$k.'</option>';
|
| 2435 |
+
}
|
| 2436 |
+
else {
|
| 2437 |
+
if($param['w_day']==''.$k) {
|
| 2438 |
+
$selected = "selected=\"selected\"";
|
| 2439 |
+
}
|
| 2440 |
+
else {
|
| 2441 |
+
$selected = "";
|
| 2442 |
+
}
|
| 2443 |
+
$w_day_type .= '<option value="'.$k.'" '.$selected.'>'.$k.'</option>';
|
| 2444 |
+
}
|
| 2445 |
+
}
|
| 2446 |
+
$w_day_type .= '</select>';
|
| 2447 |
+
}
|
| 2448 |
+
else {
|
| 2449 |
+
$w_day_type = '<input type="text" value="'.$param['w_day'].'" id="wdform_'.$id1.'_day'.$form_id.'" name="wdform_'.$id1.'_day'.$form_id.'" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].'>';
|
| 2450 |
+
$onload_js .='jQuery("#wdform_'.$id1.'_day'.$form_id.'").blur(function() {if (jQuery(this).val()=="0") jQuery(this).val(""); else add_0(this)});';
|
| 2451 |
+
$onload_js .='jQuery("#wdform_'.$id1.'_day'.$form_id.'").keypress(function() {return check_day(event, this)});';
|
| 2452 |
+
}
|
| 2453 |
+
if($param['w_month_type']=="SELECT") {
|
| 2454 |
+
$w_month_type = '<select id="wdform_'.$id1.'_month'.$form_id.'" name="wdform_'.$id1.'_month'.$form_id.'" style="width: '.$param['w_month_size'].'px;" '.$param['attributes'].'><option value=""></option><option value="01" '.($param['w_month']=="01" ? "selected=\"selected\"": "").' >'.(__("January", 'form_maker')).'</option><option value="02" '.($param['w_month']=="02" ? "selected=\"selected\"": "").'>'.(__("February", 'form_maker')).'</option><option value="03" '.($param['w_month']=="03"? "selected=\"selected\"": "").'>'.(__("March", 'form_maker')).'</option><option value="04" '.($param['w_month']=="04" ? "selected=\"selected\"": "").' >'.(__("April", 'form_maker')).'</option><option value="05" '.($param['w_month']=="05" ? "selected=\"selected\"": "").' >'.(__("May", 'form_maker')).'</option><option value="06" '.($param['w_month']=="06" ? "selected=\"selected\"": "").' >'.(__("June", 'form_maker')).'</option><option value="07" '.($param['w_month']=="07" ? "selected=\"selected\"": "").' >'.(__("July", 'form_maker')).'</option><option value="08" '.($param['w_month']=="08" ? "selected=\"selected\"": "").' >'.(__("August", 'form_maker')).'</option><option value="09" '.($param['w_month']=="09" ? "selected=\"selected\"": "").' >'.(__("September", 'form_maker')).'</option><option value="10" '.($param['w_month']=="10" ? "selected=\"selected\"": "").' >'.(__("October", 'form_maker')).'</option><option value="11" '.($param['w_month']=="11" ? "selected=\"selected\"": "").'>'.(__("November", 'form_maker')).'</option><option value="12" '.($param['w_month']=="12" ? "selected=\"selected\"": "").' >'.(__("December", 'form_maker')).'</option></select>';
|
| 2455 |
+
}
|
| 2456 |
+
else {
|
| 2457 |
+
$w_month_type = '<input type="text" value="'.$param['w_month'].'" id="wdform_'.$id1.'_month'.$form_id.'" name="wdform_'.$id1.'_month'.$form_id.'" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].'>';
|
| 2458 |
+
$onload_js .='jQuery("#wdform_'.$id1.'_month'.$form_id.'").blur(function() {if (jQuery(this).val()=="0") jQuery(this).val(""); else add_0(this)});';
|
| 2459 |
+
$onload_js .='jQuery("#wdform_'.$id1.'_month'.$form_id.'").keypress(function() {return check_month(event, this)});';
|
| 2460 |
+
}
|
| 2461 |
+
if($param['w_year_type']=="SELECT") {
|
| 2462 |
+
$w_year_type = '<select id="wdform_'.$id1.'_year'.$form_id.'" name="wdform_'.$id1.'_year'.$form_id.'" from="'.$param['w_from'].'" to="'.$param['w_to'].'" style="width: '.$param['w_year_size'].'px;" '.$param['attributes'].'><option value=""></option>';
|
| 2463 |
+
|
| 2464 |
+
for($k=$param['w_to']; $k>=$param['w_from']; $k--) {
|
| 2465 |
+
if($param['w_year']==$k) {
|
| 2466 |
+
$selected = "selected=\"selected\"";
|
| 2467 |
+
}
|
| 2468 |
+
else {
|
| 2469 |
+
$selected = "";
|
| 2470 |
+
}
|
| 2471 |
+
$w_year_type .= '<option value="'.$k.'" '.$selected.'>'.$k.'</option>';
|
| 2472 |
+
}
|
| 2473 |
+
$w_year_type .= '</select>';
|
| 2474 |
+
}
|
| 2475 |
+
else {
|
| 2476 |
+
$w_year_type = '<input type="text" value="'.$param['w_year'].'" id="wdform_'.$id1.'_year'.$form_id.'" name="wdform_'.$id1.'_year'.$form_id.'" from="'.$param['w_from'].'" to="'.$param['w_to'].'" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].'>';
|
| 2477 |
+
$onload_js .='jQuery("#wdform_'.$id1.'_year'.$form_id.'").keypress(function() {return check_year1(event, this)});';
|
| 2478 |
+
$onload_js .='jQuery("#wdform_'.$id1.'_year'.$form_id.'").change(function() {change_year(this)});';
|
| 2479 |
+
}
|
| 2480 |
+
$rep ='<div type="type_date_fields" class="wdform-field"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 2481 |
+
if($required) {
|
| 2482 |
+
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 2483 |
+
}
|
| 2484 |
+
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].';"><div style="display: table;"><div style="display: table-row;"><div style="display: table-cell;">'.$w_day_type.'</div><div style="display: table-cell;"><span class="wdform_separator">'.$param['w_divider'].'</span></div><div style="display: table-cell;">'.$w_month_type.'</div><div style="display: table-cell;"><span class="wdform_separator">'.$param['w_divider'].'</span></div><div style="display: table-cell;">'.$w_year_type.'</div></div><div style="display: table-row;"><div style="display: table-cell;"><label class="mini_label">'.$param['w_day_label'].'</label></div><div style="display: table-cell;"></div><div style="display: table-cell;"><label class="mini_label" >'.$param['w_month_label'].'</label></div><div style="display: table-cell;"></div><div style="display: table-cell;"><label class="mini_label">'.$param['w_year_label'].'</label></div></div></div></div></div>';
|
| 2485 |
+
|
| 2486 |
+
if($required) {
|
| 2487 |
+
$check_js.='
|
| 2488 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 2489 |
+
{
|
| 2490 |
+
if(jQuery("#wdform_'.$id1.'_day'.$form_id.'").val()=="" || jQuery("#wdform_'.$id1.'_month'.$form_id.'").val()=="" || jQuery("#wdform_'.$id1.'_year'.$form_id.'").val()=="")
|
| 2491 |
+
{
|
| 2492 |
+
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 2493 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 2494 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 2495 |
+
jQuery("#wdform_'.$id1.'_day'.$form_id.'").focus();
|
| 2496 |
+
return false;
|
| 2497 |
+
}
|
| 2498 |
+
}
|
| 2499 |
+
';
|
| 2500 |
+
}
|
| 2501 |
+
break;
|
| 2502 |
+
}
|
| 2503 |
+
|
| 2504 |
+
case 'type_file_upload': {
|
| 2505 |
+
$params_names = array('w_field_label_size','w_field_label_pos','w_destination','w_extension','w_max_size','w_required','w_multiple','w_class');
|
| 2506 |
+
$temp = $params;
|
| 2507 |
+
foreach ($params_names as $params_name ) {
|
| 2508 |
+
$temp = explode('*:*'.$params_name.'*:*', $temp);
|
| 2509 |
+
$param[$params_name] = $temp[0];
|
| 2510 |
+
if (isset($temp[1])) {
|
| 2511 |
+
$temp = $temp[1];
|
| 2512 |
+
}
|
| 2513 |
+
else {
|
| 2514 |
+
$temp = '';
|
| 2515 |
+
}
|
| 2516 |
+
}
|
| 2517 |
+
if ($temp) {
|
| 2518 |
+
$temp = explode('*:*w_attr_name*:*',$temp);
|
| 2519 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
| 2520 |
+
foreach($attrs as $attr) {
|
| 2521 |
+
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 2522 |
+
}
|
| 2523 |
+
}
|
| 2524 |
+
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 2525 |
+
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 2526 |
+
$required = ($param['w_required']=="yes" ? true : false);
|
| 2527 |
+
$multiple = ($param['w_multiple']=="yes" ? "multiple='multiple'" : "");
|
| 2528 |
+
$rep ='<div type="type_file_upload" class="wdform-field"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 2529 |
+
if($required) {
|
| 2530 |
+
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 2531 |
+
}
|
| 2532 |
+
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].';"><label class="file-upload"><div class="file-picker"></div><input type="file" id="wdform_'.$id1.'_element'.$form_id.'" name="wdform_'.$id1.'_file'.$form_id.'[]" '.$multiple.' '.$param['attributes'].'></label></div></div>';
|
| 2533 |
+
|
| 2534 |
+
if($required) {
|
| 2535 |
+
$check_js.='
|
| 2536 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 2537 |
+
{
|
| 2538 |
+
if(jQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="")
|
| 2539 |
+
{
|
| 2540 |
+
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 2541 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 2542 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 2543 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'").focus();
|
| 2544 |
+
return false;
|
| 2545 |
+
}
|
| 2546 |
+
}
|
| 2547 |
+
';
|
| 2548 |
+
}
|
| 2549 |
+
$check_js.='
|
| 2550 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 2551 |
+
{
|
| 2552 |
+
ext_available=getfileextension(jQuery("#wdform_'.$id1.'_element'.$form_id.'").val(),"'.$param['w_extension'].'");
|
| 2553 |
+
if(!ext_available)
|
| 2554 |
+
{
|
| 2555 |
+
alert("'.addslashes(__("Sorry, you are not allowed to upload this type of file.", 'form_maker')).'");
|
| 2556 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 2557 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 2558 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'").focus();
|
| 2559 |
+
return false;
|
| 2560 |
+
}
|
| 2561 |
+
}
|
| 2562 |
+
';
|
| 2563 |
+
break;
|
| 2564 |
+
}
|
| 2565 |
+
|
| 2566 |
+
case 'type_captcha': {
|
| 2567 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_digit','w_class');
|
| 2568 |
+
$temp=$params;
|
| 2569 |
+
foreach($params_names as $params_name ) {
|
| 2570 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2571 |
+
$param[$params_name] = $temp[0];
|
| 2572 |
+
$temp=$temp[1];
|
| 2573 |
+
}
|
| 2574 |
+
if($temp) {
|
| 2575 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 2576 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2577 |
+
foreach($attrs as $attr) {
|
| 2578 |
+
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 2579 |
+
}
|
| 2580 |
+
}
|
| 2581 |
+
|
| 2582 |
+
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 2583 |
+
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 2584 |
+
|
| 2585 |
+
$rep ='<div type="type_captcha" class="wdform-field"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].' width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span></div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].'"><div style="display: table;"><div style="display: table-cell;vertical-align: middle;"><div valign="middle" style="display: table-cell; text-align: center;"><img type="captcha" digit="'.$param['w_digit'].'" src=" ' . add_query_arg(array('action' => 'formcontactwdcaptcha', 'digit' => $param['w_digit'], 'i' => $form_id), admin_url('admin-ajax.php')) . '" id="wd_captcha'.$form_id.'" class="captcha_img" style="display:none" '.$param['attributes'].'></div><div valign="middle" style="display: table-cell;"><div class="captcha_refresh" id="_element_refresh'.$form_id.'" '.$param['attributes'].'></div></div></div><div style="display: table-cell;vertical-align: middle;"><div style="display: table-cell;"><input type="text" class="captcha_input" id="wd_captcha_input'.$form_id.'" name="captcha_input" style="width: '.($param['w_digit']*10+15).'px;" '.$param['attributes'].'></div></div></div></div></div>';
|
| 2586 |
+
|
| 2587 |
+
$onload_js .='jQuery("#wd_captcha'.$form_id.'").click(function() {captcha_refresh("wd_captcha","'.$form_id.'")});';
|
| 2588 |
+
$onload_js .='jQuery("#_element_refresh'.$form_id.'").click(function() {captcha_refresh("wd_captcha","'.$form_id.'")});';
|
| 2589 |
+
|
| 2590 |
+
$check_js.='
|
| 2591 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 2592 |
+
{
|
| 2593 |
+
if(jQuery("#wd_captcha_input'.$form_id.'").val()=="")
|
| 2594 |
+
{
|
| 2595 |
+
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 2596 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 2597 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 2598 |
+
jQuery("#wd_captcha_input'.$form_id.'").focus();
|
| 2599 |
+
return false;
|
| 2600 |
+
}
|
| 2601 |
+
}
|
| 2602 |
+
';
|
| 2603 |
+
$onload_js.= 'captcha_refresh("wd_captcha", "'.$form_id.'");';
|
| 2604 |
+
break;
|
| 2605 |
+
}
|
| 2606 |
+
|
| 2607 |
+
|
| 2608 |
+
|
| 2609 |
+
case 'type_arithmetic_captcha':
|
| 2610 |
+
{
|
| 2611 |
+
$params_names=array('w_field_label_size','w_field_label_pos', 'w_count', 'w_operations','w_class', 'w_input_size');
|
| 2612 |
+
$temp=$params;
|
| 2613 |
+
foreach($params_names as $params_name )
|
| 2614 |
+
{
|
| 2615 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2616 |
+
$param[$params_name] = $temp[0];
|
| 2617 |
+
$temp=$temp[1];
|
| 2618 |
+
}
|
| 2619 |
+
|
| 2620 |
+
if($temp)
|
| 2621 |
+
{
|
| 2622 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 2623 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2624 |
+
foreach($attrs as $attr)
|
| 2625 |
+
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
| 2626 |
+
}
|
| 2627 |
+
|
| 2628 |
+
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 2629 |
+
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 2630 |
+
$param['w_count'] = $param['w_count'] ? $param['w_count'] : 1;
|
| 2631 |
+
$param['w_operations'] = $param['w_operations'] ? $param['w_operations'] : '+, -, *, /';
|
| 2632 |
+
$param['w_input_size'] = $param['w_input_size'] ? $param['w_input_size'] : 60;
|
| 2633 |
+
|
| 2634 |
+
$rep ='<div type="type_arithmetic_captcha" class="wdform-field">
|
| 2635 |
+
<div align="left" class="wdform-label-section" style="display:'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label" style="vertical-align: top;">'.$label.'</span></div><div class="wdform-element-section '.$param['w_class'].'" style="display: '.$param['w_field_label_pos2'].';"><div style="display: table;"><div style="display: table-row;"><div style="display: table-cell; vertical-align: middle;"><img type="captcha" operations_count="'.$param['w_count'].'" operations="'.$param['w_operations'].'" src="' . add_query_arg(array('action' => 'formcontactwdmathcaptcha', 'operations_count' => $param['w_count'], 'operations' => $param['w_operations'], 'i' => $form_id), admin_url('admin-ajax.php')) . '" id="wd_arithmetic_captcha'.$form_id.'" class="arithmetic_captcha_img" '.$param['attributes'].'></div><div style="display: table-cell;"><input type="text" class="arithmetic_captcha_input" id="wd_arithmetic_captcha_input'.$form_id.'" name="arithmetic_captcha_input" onkeypress="return check_isnum(event)" style="width: '.$param['w_input_size'].'px;" '.$param['attributes'].'/></div><div style="display: table-cell; vertical-align: middle;"><div class="captcha_refresh" id="_element_refresh'.$form_id.'" '.$param['attributes'].'></div></div></div></div></div></div>';
|
| 2636 |
+
|
| 2637 |
+
$onload_js .='jQuery("#wd_arithmetic_captcha'.$form_id.'").click(function() { captcha_refresh("wd_arithmetic_captcha","'.$form_id.'") });';
|
| 2638 |
+
$onload_js .='jQuery("#_element_refresh'.$form_id.'").click(function() {captcha_refresh("wd_arithmetic_captcha","'.$form_id.'")});';
|
| 2639 |
+
|
| 2640 |
+
$check_js.='
|
| 2641 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 2642 |
+
{
|
| 2643 |
+
if(jQuery("#wd_arithmetic_captcha_input'.$form_id.'").val()=="")
|
| 2644 |
+
{
|
| 2645 |
+
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 2646 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 2647 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 2648 |
+
jQuery("#wd_arithmetic_captcha_input'.$form_id.'").focus();
|
| 2649 |
+
return false;
|
| 2650 |
+
}
|
| 2651 |
+
}
|
| 2652 |
+
';
|
| 2653 |
+
$onload_js.= 'captcha_refresh("wd_arithmetic_captcha", "'.$form_id.'");';
|
| 2654 |
+
break;
|
| 2655 |
+
}
|
| 2656 |
+
|
| 2657 |
+
|
| 2658 |
+
case 'type_recaptcha': {
|
| 2659 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_public','w_private','w_class');
|
| 2660 |
+
$temp=$params;
|
| 2661 |
+
foreach($params_names as $params_name ) {
|
| 2662 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2663 |
+
$param[$params_name] = $temp[0];
|
| 2664 |
+
$temp=$temp[1];
|
| 2665 |
+
}
|
| 2666 |
+
if($temp) {
|
| 2667 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 2668 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2669 |
+
foreach($attrs as $attr) {
|
| 2670 |
+
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 2671 |
+
}
|
| 2672 |
+
}
|
| 2673 |
+
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 2674 |
+
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 2675 |
+
|
| 2676 |
+
$publickey= isset($fmc_settings['public_key']) ? $fmc_settings['public_key'] : '0';
|
| 2677 |
+
|
| 2678 |
+
$rep =' <script src="https://www.google.com/recaptcha/api.js"></script><div type="type_recaptcha" class="wdform-field"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span></div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].';"><div class="g-recaptcha" data-sitekey="'.$publickey.'"></div></div></div>';
|
| 2679 |
+
break;
|
| 2680 |
+
}
|
| 2681 |
+
|
| 2682 |
+
case 'type_hidden': {
|
| 2683 |
+
$params_names=array('w_name','w_value');
|
| 2684 |
+
$temp=$params;
|
| 2685 |
+
|
| 2686 |
+
foreach($params_names as $params_name ) {
|
| 2687 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2688 |
+
$param[$params_name] = $temp[0];
|
| 2689 |
+
$temp=$temp[1];
|
| 2690 |
+
}
|
| 2691 |
+
if($temp) {
|
| 2692 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 2693 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2694 |
+
foreach($attrs as $attr) {
|
| 2695 |
+
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 2696 |
+
}
|
| 2697 |
+
}
|
| 2698 |
+
$rep ='<div type="type_hidden" class="wdform-field"><div class="wdform-label-section" style="display: table-cell;"></div><div class="wdform-element-section" style="display: table-cell;"><input type="hidden" value="'.$param['w_value'].'" id="wdform_'.$id1.'_element'.$form_id.'" name="'.$param['w_name'].'" '.$param['attributes'].'></div></div>';
|
| 2699 |
+
break;
|
| 2700 |
+
}
|
| 2701 |
+
|
| 2702 |
+
case 'type_mark_map': {
|
| 2703 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_center_x','w_center_y','w_long','w_lat','w_zoom','w_width','w_height','w_info','w_class');
|
| 2704 |
+
$temp=$params;
|
| 2705 |
+
foreach($params_names as $params_name ) {
|
| 2706 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2707 |
+
$param[$params_name] = $temp[0];
|
| 2708 |
+
$temp=$temp[1];
|
| 2709 |
+
}
|
| 2710 |
+
if($temp) {
|
| 2711 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 2712 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2713 |
+
foreach($attrs as $attr) {
|
| 2714 |
+
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 2715 |
+
}
|
| 2716 |
+
}
|
| 2717 |
+
|
| 2718 |
+
$wdformfieldsize = ($param['w_field_label_pos']=="left" ? ($param['w_field_label_size']+$param['w_width']) : max($param['w_field_label_size'], $param['w_width']));
|
| 2719 |
+
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 2720 |
+
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 2721 |
+
|
| 2722 |
+
$rep ='<div type="type_mark_map" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span></div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].' width: '.$param['w_width'].'px;"><input type="hidden" id="wdform_'.$id1.'_long'.$form_id.'" name="wdform_'.$id1.'_long'.$form_id.'" value="'.$param['w_long'].'"><input type="hidden" id="wdform_'.$id1.'_lat'.$form_id.'" name="wdform_'.$id1.'_lat'.$form_id.'" value="'.$param['w_lat'].'"><div id="wdform_'.$id1.'_element'.$form_id.'" long0="'.$param['w_long'].'" lat0="'.$param['w_lat'].'" zoom="'.$param['w_zoom'].'" info0="'.str_replace(array("\r\n", "\n", "\r"), '<br />', $param['w_info']).'" center_x="'.$param['w_center_x'].'" center_y="'.$param['w_center_y'].'" style="width: 100%; height: '.$param['w_height'].'px;" '.$param['attributes'].'></div></div></div> ';
|
| 2723 |
+
|
| 2724 |
+
$onload_js .='if_gmap_init("wdform_'.$id1.'", '.$form_id.');';
|
| 2725 |
+
$onload_js .='add_marker_on_map("wdform_'.$id1.'", 0, "'.$param['w_long'].'", "'.$param['w_lat'].'", "'.str_replace(array("\r\n", "\n", "\r"), '<br />', $param['w_info']).'", '.$form_id.',true);';
|
| 2726 |
+
|
| 2727 |
+
break;
|
| 2728 |
+
}
|
| 2729 |
+
|
| 2730 |
+
case 'type_map': {
|
| 2731 |
+
$params_names=array('w_center_x','w_center_y','w_long','w_lat','w_zoom','w_width','w_height','w_info','w_class');
|
| 2732 |
+
$temp=$params;
|
| 2733 |
+
|
| 2734 |
+
foreach($params_names as $params_name) {
|
| 2735 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2736 |
+
$param[$params_name] = $temp[0];
|
| 2737 |
+
$temp=$temp[1];
|
| 2738 |
+
}
|
| 2739 |
+
if($temp) {
|
| 2740 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 2741 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2742 |
+
foreach($attrs as $attr) {
|
| 2743 |
+
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 2744 |
+
}
|
| 2745 |
+
}
|
| 2746 |
+
$marker='';
|
| 2747 |
+
$param['w_long'] = explode('***',$param['w_long']);
|
| 2748 |
+
$param['w_lat'] = explode('***',$param['w_lat']);
|
| 2749 |
+
$param['w_info'] = explode('***',$param['w_info']);
|
| 2750 |
+
foreach($param['w_long'] as $key => $w_long ) {
|
| 2751 |
+
$marker.='long'.$key.'="'.$w_long.'" lat'.$key.'="'.$param['w_lat'][$key].'" info'.$key.'="'.str_replace(array("\r\n", "\n", "\r"), '<br />', $param['w_info'][$key]).'"';
|
| 2752 |
+
}
|
| 2753 |
+
|
| 2754 |
+
$rep ='<div type="type_map" class="wdform-field" style="width:'.($param['w_width']).'px"><div class="wdform-label-section" style="display: table-cell;"><span id="wdform_'.$id1.'_element_label'.$form_id.'" style="display: none;">'.$label.'</span></div><div class="wdform-element-section '.$param['w_class'].'" style="width: '.$param['w_width'].'px;"><div id="wdform_'.$id1.'_element'.$form_id.'" zoom="'.$param['w_zoom'].'" center_x="'.$param['w_center_x'].'" center_y="'.$param['w_center_y'].'" style="width: 100%; height: '.$param['w_height'].'px;" '.$marker.' '.$param['attributes'].'></div></div></div>';
|
| 2755 |
+
|
| 2756 |
+
$onload_js .='if_gmap_init("wdform_'.$id1.'", '.$form_id.');';
|
| 2757 |
+
|
| 2758 |
+
foreach($param['w_long'] as $key => $w_long ) {
|
| 2759 |
+
$onload_js .='add_marker_on_map("wdform_'.$id1.'",'.$key.', "'.$w_long.'", "'.$param['w_lat'][$key].'", "'.str_replace(array("\r\n", "\n", "\r"), '<br />', $param['w_info'][$key]).'", '.$form_id.',false);';
|
| 2760 |
+
}
|
| 2761 |
+
break;
|
| 2762 |
+
}
|
| 2763 |
+
|
| 2764 |
+
case 'type_paypal_price': {
|
| 2765 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_first_val','w_title', 'w_mini_labels','w_size','w_required','w_hide_cents','w_class','w_range_min','w_range_max');
|
| 2766 |
+
$temp=$params;
|
| 2767 |
+
|
| 2768 |
+
foreach($params_names as $params_name ) {
|
| 2769 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2770 |
+
$param[$params_name] = $temp[0];
|
| 2771 |
+
$temp=$temp[1];
|
| 2772 |
+
}
|
| 2773 |
+
if($temp) {
|
| 2774 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 2775 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2776 |
+
foreach($attrs as $attr) {
|
| 2777 |
+
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 2778 |
+
}
|
| 2779 |
+
}
|
| 2780 |
+
|
| 2781 |
+
$w_first_val = explode('***',$param['w_first_val']);
|
| 2782 |
+
$w_title = explode('***',$param['w_title']);
|
| 2783 |
+
|
| 2784 |
+
$param['w_first_val']=(isset($_POST['wdform_'.$id1.'_element_dollars'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element_dollars'.$form_id])) : $w_first_val[0]).'***'.(isset($_POST['wdform_'.$id1.'_element_cents'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element_cents'.$form_id])) : $w_first_val[1]);
|
| 2785 |
+
|
| 2786 |
+
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 2787 |
+
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 2788 |
+
$input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active");
|
| 2789 |
+
$required = ($param['w_required']=="yes" ? true : false);
|
| 2790 |
+
$hide_cents = ($param['w_hide_cents']=="yes" ? "none;" : "table-cell;");
|
| 2791 |
+
|
| 2792 |
+
$w_first_val = explode('***',$param['w_first_val']);
|
| 2793 |
+
$w_title = explode('***',$param['w_title']);
|
| 2794 |
+
$w_mini_labels = explode('***',$param['w_mini_labels']);
|
| 2795 |
+
|
| 2796 |
+
$rep ='<div type="type_paypal_price" class="wdform-field"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 2797 |
+
if($required) {
|
| 2798 |
+
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 2799 |
+
}
|
| 2800 |
+
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].';"><input type="hidden" value="'.$param['w_range_min'].'" name="wdform_'.$id1.'_range_min'.$form_id.'" id="wdform_'.$id1.'_range_min'.$form_id.'"><input type="hidden" value="'.$param['w_range_max'].'" name="wdform_'.$id1.'_range_max'.$form_id.'" id="wdform_'.$id1.'_range_max'.$form_id.'"><div id="wdform_'.$id1.'_table_price" style="display: table;"><div id="wdform_'.$id1.'_tr_price1" style="display: table-row;"><div id="wdform_'.$id1.'_td_name_currency" style="display: table-cell;"><span class="wdform_colon" style="vertical-align: middle;"><!--repstart--> '.$form_currency.' <!--repend--></span></div><div id="wdform_'.$id1.'_td_name_dollars" style="display: table-cell;"><input type="text" class="'.$input_active.'" id="wdform_'.$id1.'_element_dollars'.$form_id.'" name="wdform_'.$id1.'_element_dollars'.$form_id.'" value="'.$w_first_val[0].'" title="'.$w_title[0].'" onkeypress="return check_isnum(event)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].'></div><div id="wdform_'.$id1.'_td_name_divider" style="display: '.$hide_cents.';"><span class="wdform_colon" style="vertical-align: middle;"> . </span></div><div id="wdform_'.$id1.'_td_name_cents" style="display: '.$hide_cents.'"><input type="text" class="'.$input_active.'" id="wdform_'.$id1.'_element_cents'.$form_id.'" name="wdform_'.$id1.'_element_cents'.$form_id.'" value="'.$w_first_val[1].'" title="'.$w_title[1].'" style="width: 30px;" '.$param['attributes'].'></div></div><div id="wdform_'.$id1.'_tr_price2" style="display: table-row;"><div style="display: table-cell;"><label class="mini_label"></label></div><div align="left" style="display: table-cell;"><label class="mini_label">'.$w_mini_labels[0].'</label></div><div id="wdform_'.$id1.'_td_name_label_divider" style="display: '.$hide_cents.'"><label class="mini_label"></label></div><div align="left" id="wdform_'.$id1.'_td_name_label_cents" style="display: '.$hide_cents.'"><label class="mini_label">'.$w_mini_labels[1].'</label></div></div></div></div></div>';
|
| 2801 |
+
|
| 2802 |
+
$onload_js .='jQuery("#wdform_'.$id1.'_element_cents'.$form_id.'").blur(function() {add_0(this)});';
|
| 2803 |
+
$onload_js .='jQuery("#wdform_'.$id1.'_element_cents'.$form_id.'").keypress(function(event) {return check_isnum_interval(event,this,0,99)});';
|
| 2804 |
+
|
| 2805 |
+
if($required) {
|
| 2806 |
+
$check_js.='
|
| 2807 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 2808 |
+
{
|
| 2809 |
+
if(jQuery("#wdform_'.$id1.'_element_dollars'.$form_id.'").val()=="'.$w_title[0].'" || jQuery("#wdform_'.$id1.'_element_dollars'.$form_id.'").val()=="")
|
| 2810 |
+
{
|
| 2811 |
+
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 2812 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 2813 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 2814 |
+
jQuery("#wdform_'.$id1.'_element_dollars'.$form_id.'").focus();
|
| 2815 |
+
return false;
|
| 2816 |
+
}
|
| 2817 |
+
}
|
| 2818 |
+
';
|
| 2819 |
+
}
|
| 2820 |
+
$check_js.='
|
| 2821 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 2822 |
+
{
|
| 2823 |
+
dollars=0;
|
| 2824 |
+
cents=0;
|
| 2825 |
+
|
| 2826 |
+
if(jQuery("#wdform_'.$id1.'_element_dollars'.$form_id.'").val()!="'.$w_title[0].'" || jQuery("#wdform_'.$id1.'_element_dollars'.$form_id.'").val())
|
| 2827 |
+
dollars =jQuery("#wdform_'.$id1.'_element_dollars'.$form_id.'").val();
|
| 2828 |
+
|
| 2829 |
+
if(jQuery("#wdform_'.$id1.'_element_cents'.$form_id.'").val()!="'.$w_title[1].'" || jQuery("#wdform_'.$id1.'_element_cents'.$form_id.'").val())
|
| 2830 |
+
cents =jQuery("#wdform_'.$id1.'_element_cents'.$form_id.'").val();
|
| 2831 |
+
|
| 2832 |
+
var price=dollars+"."+cents;
|
| 2833 |
+
|
| 2834 |
+
if(isNaN(price))
|
| 2835 |
+
{
|
| 2836 |
+
alert("Invalid value of number field");
|
| 2837 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 2838 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 2839 |
+
jQuery("#wdform_'.$id1.'_element_dollars'.$form_id.'").focus();
|
| 2840 |
+
return false;
|
| 2841 |
+
}
|
| 2842 |
+
|
| 2843 |
+
var range_min='.($param['w_range_min'] ? $param['w_range_min'] : 0).';
|
| 2844 |
+
var range_max='.($param['w_range_max'] ? $param['w_range_max'] : -1).';
|
| 2845 |
+
|
| 2846 |
+
|
| 2847 |
+
if('.($required ? 'true' : 'false').' || jQuery("#wdform_'.$id1.'_element_dollars'.$form_id.'").val()!="'.$w_title[0].'" || jQuery("#wdform_'.$id1.'_element_cents'.$form_id.'").val()!="'.$w_title[1].'")
|
| 2848 |
+
if((range_max!=-1 && parseFloat(price)>range_max) || parseFloat(price)<range_min)
|
| 2849 |
+
{
|
| 2850 |
+
alert("' . addslashes((__('The', 'form_maker')) . $label . (__('value must be between', 'form_maker')) . ($param['w_range_min'] ? $param['w_range_min'] : 0) . '-' . ($param['w_range_max'] ? $param['w_range_max'] : "any")) . '");
|
| 2851 |
+
|
| 2852 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 2853 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 2854 |
+
jQuery("#wdform_'.$id1.'_element_dollars'.$form_id.'").focus();
|
| 2855 |
+
return false;
|
| 2856 |
+
}
|
| 2857 |
+
}
|
| 2858 |
+
';
|
| 2859 |
+
|
| 2860 |
+
break;
|
| 2861 |
+
}
|
| 2862 |
+
|
| 2863 |
+
case 'type_paypal_select': {
|
| 2864 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_choices','w_choices_price','w_choices_checked', 'w_choices_disabled','w_required','w_quantity','w_quantity_value','w_class','w_property','w_property_values');
|
| 2865 |
+
$temp=$params;
|
| 2866 |
+
if(strpos($temp, 'w_choices_params') > -1)
|
| 2867 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_choices','w_choices_price','w_choices_checked', 'w_choices_disabled','w_required','w_quantity', 'w_quantity_value', 'w_choices_params','w_class','w_property','w_property_values');
|
| 2868 |
+
|
| 2869 |
+
foreach($params_names as $params_name ) {
|
| 2870 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 2871 |
+
$param[$params_name] = $temp[0];
|
| 2872 |
+
$temp=$temp[1];
|
| 2873 |
+
}
|
| 2874 |
+
if($temp) {
|
| 2875 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 2876 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 2877 |
+
foreach($attrs as $attr) {
|
| 2878 |
+
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 2879 |
+
}
|
| 2880 |
+
}
|
| 2881 |
+
$wdformfieldsize = ($param['w_field_label_pos']=="left" ? ($param['w_field_label_size']+$param['w_size']) : max($param['w_field_label_size'], $param['w_size']));
|
| 2882 |
+
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 2883 |
+
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 2884 |
+
$required = ($param['w_required']=="yes" ? true : false);
|
| 2885 |
+
$param['w_choices'] = explode('***',$param['w_choices']);
|
| 2886 |
+
$param['w_choices_price'] = explode('***',$param['w_choices_price']);
|
| 2887 |
+
$param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
|
| 2888 |
+
$param['w_choices_disabled'] = explode('***',$param['w_choices_disabled']);
|
| 2889 |
+
$param['w_property'] = explode('***',$param['w_property']);
|
| 2890 |
+
$param['w_property_values'] = explode('***',$param['w_property_values']);
|
| 2891 |
+
|
| 2892 |
+
if(isset($param['w_choices_params']))
|
| 2893 |
+
$param['w_choices_params'] = explode('***',$param['w_choices_params']);
|
| 2894 |
+
|
| 2895 |
+
$post_value = isset($_POST['wdform_'.$id1."_element".$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1."_element".$form_id])) : NULL;
|
| 2896 |
+
$rep='<div type="type_paypal_select" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 2897 |
+
if($required)
|
| 2898 |
+
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 2899 |
+
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].' width: '.$param['w_size'].'px;"><select id="wdform_'.$id1.'_element'.$form_id.'" name="wdform_'.$id1.'_element'.$form_id.'" style="width: 100%;" '.$param['attributes'].'>';
|
| 2900 |
+
foreach($param['w_choices'] as $key => $choice)
|
| 2901 |
+
{
|
| 2902 |
+
if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
|
| 2903 |
+
{
|
| 2904 |
+
|
| 2905 |
+
$choices_labels =array();
|
| 2906 |
+
$choices_values =array();
|
| 2907 |
+
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
|
| 2908 |
+
$where = (str_replace(array('[',']'), '', $w_choices_params[0]) ? ' WHERE '.str_replace(array('[',']'), '', $w_choices_params[0]) : '');
|
| 2909 |
+
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 2910 |
+
$order_by = str_replace(array('[',']'), '', $w_choices_params[0]);
|
| 2911 |
+
$db_info = str_replace(array('[',']'), '', $w_choices_params[1]);
|
| 2912 |
+
|
| 2913 |
+
|
| 2914 |
+
|
| 2915 |
+
$label_table_and_column = explode(':',str_replace(array('[',']'), '', $choice));
|
| 2916 |
+
$table = $label_table_and_column[0];
|
| 2917 |
+
$label_column = $label_table_and_column[1];
|
| 2918 |
+
if($label_column)
|
| 2919 |
+
{
|
| 2920 |
+
|
| 2921 |
+
$choices_labels = $this->model->select_data_from_db_for_labels($db_info, $label_column, $table, $where, $order_by);
|
| 2922 |
+
}
|
| 2923 |
+
|
| 2924 |
+
$value_table_and_column = explode(':',str_replace(array('[',']'), '', $param['w_choices_price'][$key]));
|
| 2925 |
+
$value_column = $param['w_choices_disabled'][$key]=="true" ? '' : $value_table_and_column[1];
|
| 2926 |
+
|
| 2927 |
+
if($value_column)
|
| 2928 |
+
{
|
| 2929 |
+
$choices_values = $this->model->select_data_from_db_for_values($db_info, $value_column, $table, $where, $order_by);
|
| 2930 |
+
}
|
| 2931 |
+
|
| 2932 |
+
$columns_count = count($choices_labels)>0 ? count($choices_labels) : count($choices_values);
|
| 2933 |
+
|
| 2934 |
+
for($k=0; $k<$columns_count; $k++)
|
| 2935 |
+
{
|
| 2936 |
+
$choice_label = isset($choices_labels[$k]) ? $choices_labels[$k] : '';
|
| 2937 |
+
$choice_value = isset($choices_values[$k]) ? (float)$choices_values[$k][0] : '';
|
| 2938 |
+
|
| 2939 |
+
if(isset($post_value))
|
| 2940 |
+
{
|
| 2941 |
+
if($post_value==$choice_value && $choice_label==$_REQUEST["wdform_".$id1."_element_label".$form_id])
|
| 2942 |
+
$param['w_choices_checked'][$key]='selected="selected"';
|
| 2943 |
+
else
|
| 2944 |
+
$param['w_choices_checked'][$key]='';
|
| 2945 |
+
}
|
| 2946 |
+
else
|
| 2947 |
+
$param['w_choices_checked'][$key]=(($param['w_choices_checked'][$key]=='true' && $k == 0) ? 'selected="selected"' : '');
|
| 2948 |
+
|
| 2949 |
+
$rep.='<option value="'.$choice_value.'" '.$param['w_choices_checked'][$key].'>'.$choice_label[0].'</option>';
|
| 2950 |
+
}
|
| 2951 |
+
}
|
| 2952 |
+
else
|
| 2953 |
+
{
|
| 2954 |
+
$choice_value = $param['w_choices_disabled'][$key]=="true" ? '' : $param['w_choices_price'][$key];
|
| 2955 |
+
|
| 2956 |
+
if(isset($post_value))
|
| 2957 |
+
{
|
| 2958 |
+
if($post_value==$choice_value && $choice==$_REQUEST["wdform_".$id1."_element_label".$form_id])
|
| 2959 |
+
$param['w_choices_checked'][$key]='selected="selected"';
|
| 2960 |
+
else
|
| 2961 |
+
$param['w_choices_checked'][$key]='';
|
| 2962 |
+
}
|
| 2963 |
+
else
|
| 2964 |
+
{
|
| 2965 |
+
if($param['w_choices_checked'][$key]=='true')
|
| 2966 |
+
$param['w_choices_checked'][$key]='selected="selected"';
|
| 2967 |
+
else
|
| 2968 |
+
$param['w_choices_checked'][$key]='';
|
| 2969 |
+
}
|
| 2970 |
+
|
| 2971 |
+
$rep.='<option value="'.$choice_value.'" '.$param['w_choices_checked'][$key].'>'.$choice.'</option>';
|
| 2972 |
+
}
|
| 2973 |
+
}
|
| 2974 |
+
$rep.='</select><div id="wdform_'.$id1.'_div'.$form_id.'">';
|
| 2975 |
+
if($param['w_quantity']=="yes") {
|
| 2976 |
+
$rep.='<div class="paypal-property"><label class="mini_label" style="margin: 0px 5px;">'.(__("Quantity", 'form_maker')).'</label><input type="text" value="'.(isset($_POST['wdform_'.$id1."_element_quantity".$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1."_element_quantity".$form_id])) : $param['w_quantity_value']).'" id="wdform_'.$id1.'_element_quantity'.$form_id.'" name="wdform_'.$id1.'_element_quantity'.$form_id.'" class="wdform-quantity"></div>';
|
| 2977 |
+
}
|
| 2978 |
+
if($param['w_property'][0]) {
|
| 2979 |
+
foreach($param['w_property'] as $key => $property) {
|
| 2980 |
+
$rep.='
|
| 2981 |
+
<div id="wdform_'.$id1.'_property_'.$key.'" class="paypal-property">
|
| 2982 |
+
<div style="width:150px; display:inline-block;">
|
| 2983 |
+
<label class="mini_label" id="wdform_'.$id1.'_property_label_'.$form_id.''.$key.'" style="margin-right: 5px;">'.$property.'</label>
|
| 2984 |
+
<select id="wdform_'.$id1.'_property'.$form_id.''.$key.'" name="wdform_'.$id1.'_property'.$form_id.''.$key.'" style="margin: 2px 0px;">';
|
| 2985 |
+
$param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
|
| 2986 |
+
$param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
|
| 2987 |
+
foreach($param['w_property_values'][$key] as $subkey => $property_value) {
|
| 2988 |
+
$rep.='<option id="wdform_'.$id1.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'" '.(isset($_POST['wdform_'.$id1.'_property'.$form_id.''.$key]) && esc_html(stripslashes($_POST['wdform_'.$id1.'_property'.$form_id.''.$key])) == $property_value ? 'selected="selected"' : "").'>'.$property_value.'</option>';
|
| 2989 |
+
}
|
| 2990 |
+
$rep.='</select></div></div>';
|
| 2991 |
+
}
|
| 2992 |
+
}
|
| 2993 |
+
$rep.='</div></div></div>';
|
| 2994 |
+
|
| 2995 |
+
if($required) {
|
| 2996 |
+
$check_js.='
|
| 2997 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 2998 |
+
{
|
| 2999 |
+
if(jQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="")
|
| 3000 |
+
{
|
| 3001 |
+
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 3002 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'").addClass( "form-error" );
|
| 3003 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 3004 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 3005 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'").focus();
|
| 3006 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'").change(function() { if( jQuery(this).val()!="" ) jQuery(this).removeClass("form-error"); else jQuery(this).addClass("form-error");});
|
| 3007 |
+
return false;
|
| 3008 |
+
}
|
| 3009 |
+
}
|
| 3010 |
+
';
|
| 3011 |
+
}
|
| 3012 |
+
$onsubmit_js.='
|
| 3013 |
+
jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_element_label'.$form_id.'\" />").val(jQuery("#wdform_'.$id1.'_element'.$form_id.' option:selected").text()).appendTo("#form'.$form_id.'");
|
| 3014 |
+
';
|
| 3015 |
+
$onsubmit_js.='
|
| 3016 |
+
jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_element_quantity_label'.$form_id.'\" />").val("'.(__("Quantity", 'form_maker')).'").appendTo("#form'.$form_id.'");
|
| 3017 |
+
';
|
| 3018 |
+
foreach($param['w_property'] as $key => $property)
|
| 3019 |
+
{
|
| 3020 |
+
$onsubmit_js.='
|
| 3021 |
+
jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_element_property_label'.$form_id.$key.'\" />").val("'.$property.'").appendTo("#form'.$form_id.'");
|
| 3022 |
+
';
|
| 3023 |
+
|
| 3024 |
+
}
|
| 3025 |
+
break;
|
| 3026 |
+
}
|
| 3027 |
+
|
| 3028 |
+
case 'type_paypal_checkbox': {
|
| 3029 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num','w_class','w_property','w_property_values','w_quantity','w_quantity_value');
|
| 3030 |
+
$temp=$params;
|
| 3031 |
+
if(strpos($temp, 'w_field_option_pos') > -1)
|
| 3032 |
+
$params_names=array('w_field_label_size','w_field_label_pos', 'w_field_option_pos','w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num', 'w_choices_params', 'w_class','w_property','w_property_values','w_quantity','w_quantity_value');
|
| 3033 |
+
|
| 3034 |
+
foreach($params_names as $params_name ) {
|
| 3035 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 3036 |
+
$param[$params_name] = $temp[0];
|
| 3037 |
+
$temp=$temp[1];
|
| 3038 |
+
}
|
| 3039 |
+
if($temp) {
|
| 3040 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 3041 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 3042 |
+
foreach($attrs as $attr) {
|
| 3043 |
+
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 3044 |
+
}
|
| 3045 |
+
}
|
| 3046 |
+
if(!isset($param['w_field_option_pos']))
|
| 3047 |
+
$param['w_field_option_pos'] = 'left';
|
| 3048 |
+
|
| 3049 |
+
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 3050 |
+
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 3051 |
+
$param['w_field_option_pos1'] = ($param['w_field_option_pos']=="right" ? "style='float: none
|
| 3052 |
+
!important;'" : "");
|
| 3053 |
+
$param['w_field_option_pos2'] = ($param['w_field_option_pos']=="right" ? "style='float: left !important; margin:3px 8px 0 0 !important; display: inline-block !important;'" : "");
|
| 3054 |
+
$required = ($param['w_required']=="yes" ? true : false);
|
| 3055 |
+
$param['w_choices'] = explode('***',$param['w_choices']);
|
| 3056 |
+
$param['w_choices_price'] = explode('***',$param['w_choices_price']);
|
| 3057 |
+
$param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
|
| 3058 |
+
$param['w_property'] = explode('***',$param['w_property']);
|
| 3059 |
+
$param['w_property_values'] = explode('***',$param['w_property_values']);
|
| 3060 |
+
if(isset($param['w_choices_params']))
|
| 3061 |
+
$param['w_choices_params'] = explode('***',$param['w_choices_params']);
|
| 3062 |
+
|
| 3063 |
+
foreach($param['w_choices_checked'] as $key => $choices_checked ) {
|
| 3064 |
+
$param['w_choices_checked'][$key]=($choices_checked=='true' ? 'checked="checked"' : '');
|
| 3065 |
+
}
|
| 3066 |
+
$rep='<div type="type_paypal_checkbox" class="wdform-field"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 3067 |
+
if($required) {
|
| 3068 |
+
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 3069 |
+
}
|
| 3070 |
+
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].';">';
|
| 3071 |
+
$total_queries = 0;
|
| 3072 |
+
foreach($param['w_choices'] as $key => $choice)
|
| 3073 |
+
{
|
| 3074 |
+
$key1 = $key + $total_queries;
|
| 3075 |
+
if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
|
| 3076 |
+
{
|
| 3077 |
+
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
|
| 3078 |
+
$where = (str_replace(array('[',']'), '', $w_choices_params[0]) ? ' WHERE '.str_replace(array('[',']'), '', $w_choices_params[0]) : '');
|
| 3079 |
+
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 3080 |
+
|
| 3081 |
+
$order_by = str_replace(array('[',']'), '', $w_choices_params[0]);
|
| 3082 |
+
$db_info = str_replace(array('[',']'), '', $w_choices_params[1]);
|
| 3083 |
+
|
| 3084 |
+
|
| 3085 |
+
|
| 3086 |
+
$label_table_and_column = explode(':',str_replace(array('[',']'), '', $choice));
|
| 3087 |
+
$table = $label_table_and_column[0];
|
| 3088 |
+
$label_column = $label_table_and_column[1];
|
| 3089 |
+
if($label_column)
|
| 3090 |
+
{
|
| 3091 |
+
$choices_labels = $this->model->select_data_from_db_for_labels($db_info, $label_column, $table, $where, $order_by);
|
| 3092 |
+
}
|
| 3093 |
+
|
| 3094 |
+
$value_table_and_column = explode(':',str_replace(array('[',']'), '', $param['w_choices_price'][$key]));
|
| 3095 |
+
$value_column = $value_table_and_column[1];
|
| 3096 |
+
|
| 3097 |
+
if($value_column)
|
| 3098 |
+
{
|
| 3099 |
+
$choices_values = $this->model->select_data_from_db_for_values($db_info, $value_column, $table, $where, $order_by);
|
| 3100 |
+
}
|
| 3101 |
+
|
| 3102 |
+
$columns_count = count($choices_labels)>0 ? count($choices_labels) : count($choices_values);
|
| 3103 |
+
|
| 3104 |
+
if(array_filter($choices_labels) || array_filter($choices_values))
|
| 3105 |
+
{
|
| 3106 |
+
$total_queries = $total_queries + $columns_count-1;
|
| 3107 |
+
if(!isset($post_value))
|
| 3108 |
+
$param['w_choices_checked'][$key]=($param['w_choices_checked'][$key]=='true' ? 'checked="checked"' : '');
|
| 3109 |
+
|
| 3110 |
+
for($k=0; $k<$columns_count; $k++)
|
| 3111 |
+
{
|
| 3112 |
+
$choice_label = isset($choices_labels) ? $choices_labels[$k] : '';
|
| 3113 |
+
$choice_value = isset($choices_values) ? (float)$choices_values[$k][0] : '';
|
| 3114 |
+
|
| 3115 |
+
if(isset($post_value))
|
| 3116 |
+
{
|
| 3117 |
+
$param['w_choices_checked'][$key]="";
|
| 3118 |
+
$checkedvalue = $_REQUEST['wdform_'.$id1."_element".$form_id.($key1+$k)];
|
| 3119 |
+
|
| 3120 |
+
if(isset($checkedvalue))
|
| 3121 |
+
$param['w_choices_checked'][$key]='checked="checked"';
|
| 3122 |
+
}
|
| 3123 |
+
|
| 3124 |
+
$rep.='<div style="display: '.($param['w_flow']=='hor' ? 'inline-block' : 'table-row' ).';"><label class="wdform-ch-rad-label" for="wdform_'.$id1.'_element'.$form_id.''.($key1+$k).'" '.$param['w_field_option_pos1'].'>'.$choice_label[0].'</label><div class="checkbox-div forlabs" '.$param['w_field_option_pos2'].'><input type="checkbox" id="wdform_'.$id1.'_element'.$form_id.''.($key1+$k).'" name="wdform_'.$id1.'_element'.$form_id.''.($key1+$k).'" value="'.$choice_value.'" title="'.htmlspecialchars($choice_label[0]).'" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label for="wdform_'.$id1.'_element'.$form_id.''.($key1+$k).'"></label></div><input type="hidden" name="wdform_'.$id1.'_element'.$form_id.($key1+$k).'_label" value="'.htmlspecialchars($choice_label[0]).'" /></div>';
|
| 3125 |
+
}
|
| 3126 |
+
}
|
| 3127 |
+
}
|
| 3128 |
+
else
|
| 3129 |
+
{
|
| 3130 |
+
if(isset($post_value))
|
| 3131 |
+
{
|
| 3132 |
+
$param['w_choices_checked'][$key]="";
|
| 3133 |
+
$checkedvalue=$_REQUEST['wdform_'.$id1."_element".$form_id.$key1];
|
| 3134 |
+
if(isset($checkedvalue))
|
| 3135 |
+
$param['w_choices_checked'][$key]='checked="checked"';
|
| 3136 |
+
}
|
| 3137 |
+
else
|
| 3138 |
+
$param['w_choices_checked'][$key]=($param['w_choices_checked'][$key]=='true' ? 'checked="checked"' : '');
|
| 3139 |
+
|
| 3140 |
+
$rep.='<div style="display: '.($param['w_flow']=='hor' ? 'inline-block' : 'table-row' ).';"><label class="wdform-ch-rad-label" for="wdform_'.$id1.'_element'.$form_id.''.$key1.'" '.$param['w_field_option_pos1'].'>'.$choice.'</label><div class="checkbox-div forlabs" '.$param['w_field_option_pos2'].'><input type="checkbox" id="wdform_'.$id1.'_element'.$form_id.''.$key1.'" name="wdform_'.$id1.'_element'.$form_id.''.$key1.'" value="'.$param['w_choices_price'][$key].'" title="'.htmlspecialchars($choice).'" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label for="wdform_'.$id1.'_element'.$form_id.''.$key1.'"></label></div><input type="hidden" name="wdform_'.$id1.'_element'.$form_id.$key1.'_label" value="'.htmlspecialchars($choice).'" /></div>';
|
| 3141 |
+
|
| 3142 |
+
}
|
| 3143 |
+
}
|
| 3144 |
+
|
| 3145 |
+
$rep.='<div id="wdform_'.$id1.'_div'.$form_id.'">';
|
| 3146 |
+
if($param['w_quantity']=="yes") {
|
| 3147 |
+
$rep.='<div class="paypal-property"><label class="mini_label" style="margin: 0px 5px;">'.(__("Quantity", 'form_maker')).'</label><input type="text" value="'.(isset($_POST['wdform_'.$id1."_element_quantity".$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1."_element_quantity".$form_id])) : $param['w_quantity_value']).'" id="wdform_'.$id1.'_element_quantity'.$form_id.'" name="wdform_'.$id1.'_element_quantity'.$form_id.'" class="wdform-quantity"></div>';
|
| 3148 |
+
}
|
| 3149 |
+
if($param['w_property'][0]) {
|
| 3150 |
+
foreach($param['w_property'] as $key => $property) {
|
| 3151 |
+
$rep.='
|
| 3152 |
+
<div class="paypal-property">
|
| 3153 |
+
<div style="display:inline-block;">
|
| 3154 |
+
<label class="mini_label" id="wdform_'.$id1.'_property_label_'.$form_id.''.$key.'" style="margin-right: 5px;">'.$property.'</label>
|
| 3155 |
+
<select id="wdform_'.$id1.'_property'.$form_id.''.$key.'" name="wdform_'.$id1.'_property'.$form_id.''.$key.'" style="margin: 2px 0px;">';
|
| 3156 |
+
$param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
|
| 3157 |
+
$param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
|
| 3158 |
+
foreach($param['w_property_values'][$key] as $subkey => $property_value) {
|
| 3159 |
+
$rep.='<option id="wdform_'.$id1.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'" '.(isset($_POST['wdform_'.$id1.'_property'.$form_id.''.$key]) && esc_html(stripslashes($_POST['wdform_'.$id1.'_property'.$form_id.''.$key])) == $property_value ? 'selected="selected"' : "").'>'.$property_value.'</option>';
|
| 3160 |
+
}
|
| 3161 |
+
$rep.='</select></div></div>';
|
| 3162 |
+
}
|
| 3163 |
+
}
|
| 3164 |
+
$rep.='</div></div></div>';
|
| 3165 |
+
if($required) {
|
| 3166 |
+
$check_js.='
|
| 3167 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 3168 |
+
{
|
| 3169 |
+
if(x.find(jQuery("div[wdid='.$id1.'] input:checked")).length == 0)
|
| 3170 |
+
{
|
| 3171 |
+
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 3172 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 3173 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 3174 |
+
|
| 3175 |
+
return false;
|
| 3176 |
+
}
|
| 3177 |
+
}
|
| 3178 |
+
';
|
| 3179 |
+
}
|
| 3180 |
+
$onsubmit_js.='
|
| 3181 |
+
jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_element_label'.$form_id.'\" />").val((x.find(jQuery("div[wdid='.$id1.'] input:checked")).length != 0) ? jQuery("#"+x.find(jQuery("div[wdid='.$id1.'] input:checked")).attr("id").replace("element", "elementlabel_")) : "").appendTo("#form'.$form_id.'");
|
| 3182 |
+
';
|
| 3183 |
+
$onsubmit_js.='
|
| 3184 |
+
jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_element_quantity_label'.$form_id.'\" />").val("'.(__("Quantity", 'form_maker')).'").appendTo("#form'.$form_id.'");
|
| 3185 |
+
';
|
| 3186 |
+
foreach($param['w_property'] as $key => $property)
|
| 3187 |
+
{
|
| 3188 |
+
$onsubmit_js.='
|
| 3189 |
+
jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_element_property_label'.$form_id.$key.'\" />").val("'.$property.'").appendTo("#form'.$form_id.'");
|
| 3190 |
+
';
|
| 3191 |
+
}
|
| 3192 |
+
break;
|
| 3193 |
+
}
|
| 3194 |
+
|
| 3195 |
+
case 'type_paypal_radio': {
|
| 3196 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num','w_class','w_property','w_property_values','w_quantity','w_quantity_value');
|
| 3197 |
+
$temp=$params;
|
| 3198 |
+
if(strpos($temp, 'w_field_option_pos') > -1)
|
| 3199 |
+
$params_names=array('w_field_label_size','w_field_label_pos', 'w_field_option_pos', 'w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num', 'w_choices_params', 'w_class', 'w_property','w_property_values','w_quantity','w_quantity_value');
|
| 3200 |
+
|
| 3201 |
+
foreach($params_names as $params_name ) {
|
| 3202 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 3203 |
+
$param[$params_name] = $temp[0];
|
| 3204 |
+
$temp=$temp[1];
|
| 3205 |
+
}
|
| 3206 |
+
if($temp) {
|
| 3207 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 3208 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 3209 |
+
foreach($attrs as $attr) {
|
| 3210 |
+
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 3211 |
+
}
|
| 3212 |
+
}
|
| 3213 |
+
if(!isset($param['w_field_option_pos']))
|
| 3214 |
+
$param['w_field_option_pos'] = 'left';
|
| 3215 |
+
|
| 3216 |
+
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 3217 |
+
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 3218 |
+
$param['w_field_option_pos1'] = ($param['w_field_option_pos']=="right" ? "style='float: none
|
| 3219 |
+
!important;'" : "");
|
| 3220 |
+
$param['w_field_option_pos2'] = ($param['w_field_option_pos']=="right" ? "style='float: left !important; margin-right: 8px !important; display: inline-block !important;'" : "");
|
| 3221 |
+
$required = ($param['w_required']=="yes" ? true : false);
|
| 3222 |
+
$param['w_choices'] = explode('***',$param['w_choices']);
|
| 3223 |
+
$param['w_choices_price'] = explode('***',$param['w_choices_price']);
|
| 3224 |
+
$param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
|
| 3225 |
+
$param['w_property'] = explode('***',$param['w_property']);
|
| 3226 |
+
$param['w_property_values'] = explode('***',$param['w_property_values']);
|
| 3227 |
+
if(isset($param['w_choices_params']))
|
| 3228 |
+
$param['w_choices_params'] = explode('***',$param['w_choices_params']);
|
| 3229 |
+
|
| 3230 |
+
foreach($param['w_choices_checked'] as $key => $choices_checked ) {
|
| 3231 |
+
$param['w_choices_checked'][$key]=($choices_checked=='true' ? 'checked="checked"' : '');
|
| 3232 |
+
}
|
| 3233 |
+
|
| 3234 |
+
$rep='<div type="type_paypal_radio" class="wdform-field"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 3235 |
+
if($required) {
|
| 3236 |
+
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 3237 |
+
}
|
| 3238 |
+
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].';">';
|
| 3239 |
+
|
| 3240 |
+
$total_queries = 0;
|
| 3241 |
+
foreach($param['w_choices'] as $key => $choice)
|
| 3242 |
+
{
|
| 3243 |
+
$key1 = $key + $total_queries;
|
| 3244 |
+
if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
|
| 3245 |
+
{
|
| 3246 |
+
$choices_labels =array();
|
| 3247 |
+
$choices_values =array();
|
| 3248 |
+
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
|
| 3249 |
+
$where = (str_replace(array('[',']'), '', $w_choices_params[0]) ? ' WHERE '.str_replace(array('[',']'), '', $w_choices_params[0]) : '');
|
| 3250 |
+
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 3251 |
+
|
| 3252 |
+
$order_by = str_replace(array('[',']'), '', $w_choices_params[0]);
|
| 3253 |
+
$db_info = str_replace(array('[',']'), '', $w_choices_params[1]);
|
| 3254 |
+
|
| 3255 |
+
|
| 3256 |
+
$label_table_and_column = explode(':',str_replace(array('[',']'), '', $choice));
|
| 3257 |
+
$table = $label_table_and_column[0];
|
| 3258 |
+
$label_column = $label_table_and_column[1];
|
| 3259 |
+
if($label_column)
|
| 3260 |
+
{
|
| 3261 |
+
$choices_labels = $this->model->select_data_from_db_for_labels($db_info, $label_column, $table, $where, $order_by);
|
| 3262 |
+
}
|
| 3263 |
+
|
| 3264 |
+
$value_table_and_column = explode(':',str_replace(array('[',']'), '', $param['w_choices_price'][$key]));
|
| 3265 |
+
$value_column = $value_table_and_column[1];
|
| 3266 |
+
|
| 3267 |
+
if($value_column)
|
| 3268 |
+
{
|
| 3269 |
+
$choices_values = $this->model->select_data_from_db_for_values($db_info, $value_column, $table, $where, $order_by);
|
| 3270 |
+
}
|
| 3271 |
+
|
| 3272 |
+
$columns_count_radio = count($choices_labels)>0 ? count($choices_labels) : count($choices_values);
|
| 3273 |
+
|
| 3274 |
+
if(array_filter($choices_labels) || array_filter($choices_values))
|
| 3275 |
+
{
|
| 3276 |
+
$total_queries = $total_queries + $columns_count_radio-1;
|
| 3277 |
+
for($k=0; $k<$columns_count_radio; $k++)
|
| 3278 |
+
{
|
| 3279 |
+
$choice_label = isset($choices_labels) ? $choices_labels[$k] : '';
|
| 3280 |
+
$choice_value = isset($choices_values) ? (float)$choices_values[$k][0] : '';
|
| 3281 |
+
|
| 3282 |
+
if(isset($post_value))
|
| 3283 |
+
$param['w_choices_checked'][$key]=(($post_value==$choice_value && htmlspecialchars($choice_label)==htmlspecialchars($_REQUEST['wdform_'.$id1."_element_label".$form_id])) ? 'checked="checked"' : '');
|
| 3284 |
+
else
|
| 3285 |
+
$param['w_choices_checked'][$key]=($param['w_choices_checked'][$key]=='true' ? 'checked="checked"' : '');
|
| 3286 |
+
|
| 3287 |
+
$rep.='<div style="display: '.($param['w_flow']=='hor' ? 'inline-block' : 'table-row' ).';"><label class="wdform-ch-rad-label" for="wdform_'.$id1.'_element'.$form_id.''.($key1+$k).'" '.$param['w_field_option_pos1'].'>'.$choice_label[0].'</label><div class="radio-div forlabs" '.$param['w_field_option_pos2'].'><input type="radio" id="wdform_'.$id1.'_element'.$form_id.''.($key1+$k).'" name="wdform_'.$id1.'_element'.$form_id.'" value="'.$choice_value.'" title="'.htmlspecialchars($choice_label[0]).'" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label for="wdform_'.$id1.'_element'.$form_id.''.($key1+$k).'"></label></div></div>';
|
| 3288 |
+
}
|
| 3289 |
+
}
|
| 3290 |
+
}
|
| 3291 |
+
else
|
| 3292 |
+
{
|
| 3293 |
+
if(isset($post_value))
|
| 3294 |
+
$param['w_choices_checked'][$key]=(($post_value==$param['w_choices_price'][$key] && htmlspecialchars($choice)==htmlspecialchars($_REQUEST['wdform_'.$id1."_element_label".$form_id])) ? 'checked="checked"' : '');
|
| 3295 |
+
else
|
| 3296 |
+
$param['w_choices_checked'][$key]=($param['w_choices_checked'][$key]=='true' ? 'checked="checked"' : '');
|
| 3297 |
+
|
| 3298 |
+
$rep.='<div style="display: '.($param['w_flow']=='hor' ? 'inline-block' : 'table-row' ).';"><label class="wdform-ch-rad-label" for="wdform_'.$id1.'_element'.$form_id.''.$key1.'" '.$param['w_field_option_pos1'].'>'.$choice.'</label><div class="radio-div forlabs" '.$param['w_field_option_pos2'].'><input type="radio" id="wdform_'.$id1.'_element'.$form_id.''.$key1.'" name="wdform_'.$id1.'_element'.$form_id.'" value="'.$param['w_choices_price'][$key].'" title="'.htmlspecialchars($choice).'" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label for="wdform_'.$id1.'_element'.$form_id.''.$key1.'"></label></div></div>';
|
| 3299 |
+
}
|
| 3300 |
+
}
|
| 3301 |
+
$rep.='<div id="wdform_'.$id1.'_div'.$form_id.'">';
|
| 3302 |
+
if($param['w_quantity']=="yes") {
|
| 3303 |
+
$rep.='<div class="paypal-property"><label class="mini_label" style="margin: 0px 5px;">'.(__("Quantity", 'form_maker')).'</label><input type="text" value="'.(isset($_POST['wdform_'.$id1."_element_quantity".$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1."_element_quantity".$form_id])) : $param['w_quantity_value']).'" id="wdform_'.$id1.'_element_quantity'.$form_id.'" name="wdform_'.$id1.'_element_quantity'.$form_id.'" class="wdform-quantity"></div>';
|
| 3304 |
+
}
|
| 3305 |
+
if($param['w_property'][0]) {
|
| 3306 |
+
foreach($param['w_property'] as $key => $property) {
|
| 3307 |
+
$rep.='
|
| 3308 |
+
<div class="paypal-property">
|
| 3309 |
+
<div style="width:150px; display:inline-block;">
|
| 3310 |
+
<label class="mini_label" id="wdform_'.$id1.'_property_label_'.$form_id.''.$key.'" style="margin-right: 5px;">'.$property.'</label>
|
| 3311 |
+
<select id="wdform_'.$id1.'_property'.$form_id.''.$key.'" name="wdform_'.$id1.'_property'.$form_id.''.$key.'" style="margin: 2px 0px;">';
|
| 3312 |
+
$param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
|
| 3313 |
+
$param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
|
| 3314 |
+
foreach($param['w_property_values'][$key] as $subkey => $property_value) {
|
| 3315 |
+
$rep.='<option id="wdform_'.$id1.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'" '.(isset($_POST['wdform_'.$id1.'_property'.$form_id.''.$key]) && esc_html(stripslashes($_POST['wdform_'.$id1.'_property'.$form_id.''.$key])) == $property_value ? 'selected="selected"' : "").'>'.$property_value.'</option>';
|
| 3316 |
+
}
|
| 3317 |
+
$rep.='</select></div></div>';
|
| 3318 |
+
}
|
| 3319 |
+
}
|
| 3320 |
+
$rep.='</div></div></div>';
|
| 3321 |
+
|
| 3322 |
+
if($required) {
|
| 3323 |
+
$check_js.='
|
| 3324 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 3325 |
+
{
|
| 3326 |
+
if(x.find(jQuery("div[wdid='.$id1.'] input:checked")).length == 0)
|
| 3327 |
+
{
|
| 3328 |
+
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 3329 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 3330 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 3331 |
+
|
| 3332 |
+
return false;
|
| 3333 |
+
}
|
| 3334 |
+
}
|
| 3335 |
+
';
|
| 3336 |
+
}
|
| 3337 |
+
$onsubmit_js.='
|
| 3338 |
+
jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_element_label'.$form_id.'\" />").val(
|
| 3339 |
+
jQuery("label[for=\'"+jQuery("input[name^=\'wdform_'.$id1.'_element'.$form_id.'\']:checked").attr("id")+"\']").eq(0).text()
|
| 3340 |
+
).appendTo("#form'.$form_id.'");
|
| 3341 |
+
|
| 3342 |
+
';
|
| 3343 |
+
$onsubmit_js.='
|
| 3344 |
+
jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_element_quantity_label'.$form_id.'\" />").val("'.(__("Quantity", 'form_maker')).'").appendTo("#form'.$form_id.'");
|
| 3345 |
+
';
|
| 3346 |
+
foreach($param['w_property'] as $key => $property)
|
| 3347 |
+
{
|
| 3348 |
+
$onsubmit_js.='
|
| 3349 |
+
jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_element_property_label'.$form_id.$key.'\" />").val("'.$property.'").appendTo("#form'.$form_id.'");
|
| 3350 |
+
';
|
| 3351 |
+
}
|
| 3352 |
+
break;
|
| 3353 |
+
}
|
| 3354 |
+
|
| 3355 |
+
|
| 3356 |
+
case 'type_paypal_shipping': {
|
| 3357 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num','w_class');
|
| 3358 |
+
$temp=$params;
|
| 3359 |
+
if(strpos($temp, 'w_field_option_pos') > -1)
|
| 3360 |
+
$params_names=array('w_field_label_size','w_field_label_pos', 'w_field_option_pos', 'w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num','w_choices_params', 'w_class');
|
| 3361 |
+
|
| 3362 |
+
foreach($params_names as $params_name ) {
|
| 3363 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 3364 |
+
$param[$params_name] = $temp[0];
|
| 3365 |
+
$temp=$temp[1];
|
| 3366 |
+
}
|
| 3367 |
+
|
| 3368 |
+
if($temp) {
|
| 3369 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 3370 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 3371 |
+
foreach($attrs as $attr) {
|
| 3372 |
+
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 3373 |
+
}
|
| 3374 |
+
}
|
| 3375 |
+
if(!isset($param['w_field_option_pos']))
|
| 3376 |
+
$param['w_field_option_pos'] = 'left';
|
| 3377 |
+
|
| 3378 |
+
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 3379 |
+
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 3380 |
+
$param['w_field_option_pos1'] = ($param['w_field_option_pos']=="right" ? "style='float: none
|
| 3381 |
+
!important;'" : "");
|
| 3382 |
+
$param['w_field_option_pos2'] = ($param['w_field_option_pos']=="right" ? "style='float: left !important; margin:3px 8px 0 0 !important; display: inline-block !important;'" : "");
|
| 3383 |
+
|
| 3384 |
+
$required = ($param['w_required']=="yes" ? true : false);
|
| 3385 |
+
$param['w_choices'] = explode('***',$param['w_choices']);
|
| 3386 |
+
$param['w_choices_price'] = explode('***',$param['w_choices_price']);
|
| 3387 |
+
$param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
|
| 3388 |
+
if(isset($param['w_choices_params']))
|
| 3389 |
+
$param['w_choices_params'] = explode('***',$param['w_choices_params']);
|
| 3390 |
+
|
| 3391 |
+
foreach($param['w_choices_checked'] as $key => $choices_checked ) {
|
| 3392 |
+
$param['w_choices_checked'][$key]=($choices_checked=='true' ? 'checked="checked"' : '');
|
| 3393 |
+
}
|
| 3394 |
+
$rep='<div type="type_paypal_shipping" class="wdform-field"><div class="wdform-label-section" style="'.$param['w_field_label_pos1'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 3395 |
+
if($required) {
|
| 3396 |
+
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 3397 |
+
}
|
| 3398 |
+
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].';">';
|
| 3399 |
+
$total_queries = 0;
|
| 3400 |
+
foreach($param['w_choices'] as $key => $choice)
|
| 3401 |
+
{
|
| 3402 |
+
$key1 = $key + $total_queries;
|
| 3403 |
+
if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
|
| 3404 |
+
{
|
| 3405 |
+
$choices_labels =array();
|
| 3406 |
+
$choices_values =array();
|
| 3407 |
+
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
|
| 3408 |
+
$where = (str_replace(array('[',']'), '', $w_choices_params[0]) ? ' WHERE '.str_replace(array('[',']'), '', $w_choices_params[0]) : '');
|
| 3409 |
+
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
| 3410 |
+
|
| 3411 |
+
$order_by = str_replace(array('[',']'), '', $w_choices_params[0]);
|
| 3412 |
+
$db_info = str_replace(array('[',']'), '', $w_choices_params[1]);
|
| 3413 |
+
|
| 3414 |
+
|
| 3415 |
+
$label_table_and_column = explode(':',str_replace(array('[',']'), '', $choice));
|
| 3416 |
+
$table = $label_table_and_column[0];
|
| 3417 |
+
$label_column = $label_table_and_column[1];
|
| 3418 |
+
if($label_column)
|
| 3419 |
+
{
|
| 3420 |
+
$choices_labels = $this->model->select_data_from_db_for_labels($db_info, $label_column, $table, $where, $order_by);
|
| 3421 |
+
|
| 3422 |
+
}
|
| 3423 |
+
|
| 3424 |
+
$value_table_and_column = explode(':',str_replace(array('[',']'), '', $param['w_choices_price'][$key]));
|
| 3425 |
+
$value_column = $value_table_and_column[1];
|
| 3426 |
+
|
| 3427 |
+
if($value_column)
|
| 3428 |
+
{
|
| 3429 |
+
$choices_values = $this->model->select_data_from_db_for_values($db_info, $value_column, $table, $where, $order_by);
|
| 3430 |
+
}
|
| 3431 |
+
|
| 3432 |
+
$columns_count_shipping = count($choices_labels)>0 ? count($choices_labels) : count($choices_values);
|
| 3433 |
+
|
| 3434 |
+
if(array_filter($choices_labels) || array_filter($choices_values))
|
| 3435 |
+
{
|
| 3436 |
+
$total_queries = $total_queries + $columns_count_shipping-1;
|
| 3437 |
+
for($k=0; $k<$columns_count_shipping; $k++)
|
| 3438 |
+
{
|
| 3439 |
+
$choice_label = isset($choices_labels) ? $choices_labels[$k][0] : '';
|
| 3440 |
+
$choice_value = isset($choices_values) ? (float)$choices_values[$k][0] : '';
|
| 3441 |
+
|
| 3442 |
+
if(isset($post_value))
|
| 3443 |
+
$param['w_choices_checked'][$key]=(($post_value==$choice_value && htmlspecialchars($choice_label)==htmlspecialchars($_REQUEST['wdform_'.$id1."_element_label".$form_id])) ? 'checked="checked"' : '');
|
| 3444 |
+
else
|
| 3445 |
+
$param['w_choices_checked'][$key]=($param['w_choices_checked'][$key]=='true' ? 'checked="checked"' : '');
|
| 3446 |
+
|
| 3447 |
+
$rep.='<div style="display: '.($param['w_flow']=='hor' ? 'inline-block' : 'table-row' ).';"><label class="wdform-ch-rad-label" for="wdform_'.$id1.'_element'.$form_id.''.($key1+$k).'" '.$param['w_field_option_pos1'].'>'.$choice_label.'</label><div class="radio-div forlabs" '.$param['w_field_option_pos2'].'><input type="radio" id="wdform_'.$id1.'_element'.$form_id.''.($key1+$k).'" name="wdform_'.$id1.'_element'.$form_id.'" value="'.$choice_value.'" title="'.htmlspecialchars($choice_label[0]).'" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label for="wdform_'.$id1.'_element'.$form_id.''.($key1+$k).'"></label></div></div>';
|
| 3448 |
+
}
|
| 3449 |
+
}
|
| 3450 |
+
}
|
| 3451 |
+
else
|
| 3452 |
+
{
|
| 3453 |
+
if(isset($post_value))
|
| 3454 |
+
$param['w_choices_checked'][$key]=(($post_value==$param['w_choices_price'][$key] && htmlspecialchars($choice)==htmlspecialchars($_REQUEST['wdform_'.$id1."_element_label".$form_id])) ? 'checked="checked"' : '');
|
| 3455 |
+
else
|
| 3456 |
+
$param['w_choices_checked'][$key]=($param['w_choices_checked'][$key]=='true' ? 'checked="checked"' : '');
|
| 3457 |
+
|
| 3458 |
+
$rep.='<div style="display: '.($param['w_flow']=='hor' ? 'inline-block' : 'table-row' ).';"><label class="wdform-ch-rad-label" for="wdform_'.$id1.'_element'.$form_id.''.$key1.'" '.$param['w_field_option_pos1'].'>'.$choice.'</label><div class="radio-div forlabs" '.$param['w_field_option_pos2'].'><input type="radio" id="wdform_'.$id1.'_element'.$form_id.''.$key1.'" name="wdform_'.$id1.'_element'.$form_id.'" value="'.$param['w_choices_price'][$key].'" title="'.htmlspecialchars($choice).'" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label for="wdform_'.$id1.'_element'.$form_id.''.$key1.'"></label></div></div>';
|
| 3459 |
+
}
|
| 3460 |
+
}
|
| 3461 |
+
|
| 3462 |
+
$rep.='</div></div>';
|
| 3463 |
+
if($required) {
|
| 3464 |
+
$check_js.='
|
| 3465 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 3466 |
+
{
|
| 3467 |
+
if(x.find(jQuery("div[wdid='.$id1.'] input:checked")).length == 0)
|
| 3468 |
+
{
|
| 3469 |
+
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 3470 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 3471 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 3472 |
+
|
| 3473 |
+
return false;
|
| 3474 |
+
}
|
| 3475 |
+
}
|
| 3476 |
+
';
|
| 3477 |
+
}
|
| 3478 |
+
$onsubmit_js.='
|
| 3479 |
+
jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_element_label'.$form_id.'\" />").val(
|
| 3480 |
+
jQuery("label[for=\'"+jQuery("input[name^=\'wdform_'.$id1.'_element'.$form_id.'\']:checked").attr("id")+"\']").eq(0).text()
|
| 3481 |
+
).appendTo("#form'.$form_id.'");
|
| 3482 |
+
';
|
| 3483 |
+
break;
|
| 3484 |
+
}
|
| 3485 |
+
|
| 3486 |
+
case 'type_submit_reset': {
|
| 3487 |
+
$params_names=array('w_submit_title','w_reset_title','w_class','w_act');
|
| 3488 |
+
$temp=$params;
|
| 3489 |
+
foreach($params_names as $params_name ) {
|
| 3490 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 3491 |
+
$param[$params_name] = $temp[0];
|
| 3492 |
+
$temp=$temp[1];
|
| 3493 |
+
}
|
| 3494 |
+
if($temp) {
|
| 3495 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 3496 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 3497 |
+
foreach($attrs as $attr) {
|
| 3498 |
+
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 3499 |
+
}
|
| 3500 |
+
}
|
| 3501 |
+
$param['w_act'] = ($param['w_act']=="false" ? 'style="display: none;"' : "");
|
| 3502 |
+
$rep='<div type="type_submit_reset" class="wdform-field"><div class="wdform-label-section" style="display: table-cell;"></div><div class="wdform-element-section '.$param['w_class'].'" style="display: table-cell;"><button type="button" class="button-submit" onclick="check_required'.$form_id.'("submit", "'.$form_id.'");" '.$param['attributes'].'>'.$param['w_submit_title'].'</button><button type="button" class="button-reset" onclick="check_required'.$form_id.'("reset");" '.$param['w_act'].' '.$param['attributes'].'>'.$param['w_reset_title'].'</button></div></div>';
|
| 3503 |
+
break;
|
| 3504 |
+
}
|
| 3505 |
+
|
| 3506 |
+
case 'type_button': {
|
| 3507 |
+
$params_names=array('w_title','w_func','w_class');
|
| 3508 |
+
$temp=$params;
|
| 3509 |
+
foreach($params_names as $params_name ) {
|
| 3510 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 3511 |
+
$param[$params_name] = $temp[0];
|
| 3512 |
+
$temp=$temp[1];
|
| 3513 |
+
}
|
| 3514 |
+
if($temp) {
|
| 3515 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 3516 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 3517 |
+
foreach($attrs as $attr) {
|
| 3518 |
+
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 3519 |
+
}
|
| 3520 |
+
}
|
| 3521 |
+
$param['w_title'] = explode('***',$param['w_title']);
|
| 3522 |
+
$param['w_func'] = explode('***',$param['w_func']);
|
| 3523 |
+
$rep.='<div type="type_button" class="wdform-field"><div class="wdform-label-section" style="display: table-cell;"><span style="display: none;">button_'.$id1.'</span></div><div class="wdform-element-section '.$param['w_class'].'" style="display: table-cell;">';
|
| 3524 |
+
|
| 3525 |
+
foreach($param['w_title'] as $key => $title) {
|
| 3526 |
+
$rep.='<button type="button" name="wdform_'.$id1.'_element'.$form_id.''.$key.'" onclick="'.$param['w_func'][$key].'" '.$param['attributes'].'>'.$title.'</button>';
|
| 3527 |
+
}
|
| 3528 |
+
$rep.='</div></div>';
|
| 3529 |
+
break;
|
| 3530 |
+
}
|
| 3531 |
+
|
| 3532 |
+
case 'type_star_rating': {
|
| 3533 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_field_label_col','w_star_amount','w_required','w_class');
|
| 3534 |
+
$temp=$params;
|
| 3535 |
+
foreach($params_names as $params_name ) {
|
| 3536 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 3537 |
+
$param[$params_name] = $temp[0];
|
| 3538 |
+
$temp=$temp[1];
|
| 3539 |
+
}
|
| 3540 |
+
if($temp) {
|
| 3541 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 3542 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 3543 |
+
foreach($attrs as $attr) {
|
| 3544 |
+
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 3545 |
+
}
|
| 3546 |
+
}
|
| 3547 |
+
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 3548 |
+
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 3549 |
+
$required = ($param['w_required']=="yes" ? true : false);
|
| 3550 |
+
$images = '';
|
| 3551 |
+
for($i=0; $i<$param['w_star_amount']; $i++) {
|
| 3552 |
+
$images .= '<img id="wdform_'.$id1.'_star_'.$i.'_'.$form_id.'" src="' . WD_FMC_URL . '/images/star.png" >';
|
| 3553 |
+
$onload_js .='jQuery("#wdform_'.$id1.'_star_'.$i.'_'.$form_id.'").mouseover(function() {change_src('.$i.',"wdform_'.$id1.'", '.$form_id.', "'.$param['w_field_label_col'].'");});';
|
| 3554 |
+
$onload_js .='jQuery("#wdform_'.$id1.'_star_'.$i.'_'.$form_id.'").mouseout(function() {reset_src('.$i.',"wdform_'.$id1.'", '.$form_id.');});';
|
| 3555 |
+
$onload_js .='jQuery("#wdform_'.$id1.'_star_'.$i.'_'.$form_id.'").click(function() {select_star_rating('.$i.',"wdform_'.$id1.'", '.$form_id.',"'.$param['w_field_label_col'].'", "'.$param['w_star_amount'].'");});';
|
| 3556 |
+
}
|
| 3557 |
+
|
| 3558 |
+
$rep ='<div type="type_star_rating" class="wdform-field"><div class="wdform-label-section '.$param['w_class'].'" style="'.$param['w_field_label_pos1'].' width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 3559 |
+
if($required) {
|
| 3560 |
+
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 3561 |
+
}
|
| 3562 |
+
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].'"><div id="wdform_'.$id1.'_element'.$form_id.'" '.$param['attributes'].'>'.$images.'</div><input type="hidden" value="" id="wdform_'.$id1.'_selected_star_amount'.$form_id.'" name="wdform_'.$id1.'_selected_star_amount'.$form_id.'"></div></div>';
|
| 3563 |
+
|
| 3564 |
+
if($required) {
|
| 3565 |
+
$check_js.='
|
| 3566 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 3567 |
+
{
|
| 3568 |
+
if(jQuery("#wdform_'.$id1.'_selected_star_amount'.$form_id.'").val()=="")
|
| 3569 |
+
{
|
| 3570 |
+
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 3571 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 3572 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 3573 |
+
return false;
|
| 3574 |
+
}
|
| 3575 |
+
}
|
| 3576 |
+
';
|
| 3577 |
+
}
|
| 3578 |
+
$post = isset($_POST['wdform_'.$id1.'_selected_star_amount'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_selected_star_amount'.$form_id])) : NULL;
|
| 3579 |
+
if(isset($post)) {
|
| 3580 |
+
$onload_js .=' select_star_rating('.($post-1).',"wdform_'.$id1.'", '.$form_id.',"'.$param['w_field_label_col'].'", "'.$param['w_star_amount'].'");';
|
| 3581 |
+
}
|
| 3582 |
+
$onsubmit_js.='
|
| 3583 |
+
jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_star_amount'.$form_id.'\" value = \"'.$param['w_star_amount'].'\" />").appendTo("#form'.$form_id.'");
|
| 3584 |
+
';
|
| 3585 |
+
break;
|
| 3586 |
+
}
|
| 3587 |
+
case 'type_scale_rating': {
|
| 3588 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_mini_labels','w_scale_amount','w_required','w_class');
|
| 3589 |
+
$temp=$params;
|
| 3590 |
+
foreach($params_names as $params_name ) {
|
| 3591 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 3592 |
+
$param[$params_name] = $temp[0];
|
| 3593 |
+
$temp=$temp[1];
|
| 3594 |
+
}
|
| 3595 |
+
if($temp) {
|
| 3596 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 3597 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 3598 |
+
foreach($attrs as $attr) {
|
| 3599 |
+
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 3600 |
+
}
|
| 3601 |
+
}
|
| 3602 |
+
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 3603 |
+
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 3604 |
+
$required = ($param['w_required']=="yes" ? true : false);
|
| 3605 |
+
$w_mini_labels = explode('***',$param['w_mini_labels']);
|
| 3606 |
+
$numbers = '';
|
| 3607 |
+
$radio_buttons = '';
|
| 3608 |
+
$to_check=0;
|
| 3609 |
+
$post_value = isset($_POST['wdform_'.$id1.'_scale_radio'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_scale_radio'.$form_id])) : NULL;
|
| 3610 |
+
if(isset($post_value)) {
|
| 3611 |
+
$to_check=$post_value;
|
| 3612 |
+
}
|
| 3613 |
+
for($i=1; $i<=$param['w_scale_amount']; $i++) {
|
| 3614 |
+
$numbers.= '<div style="text-align: center; display: table-cell;"><span>'.$i.'</span></div>';
|
| 3615 |
+
$radio_buttons.= '<div style="text-align: center; display: table-cell;"><div class="radio-div"><input id="wdform_'.$id1.'_scale_radio'.$form_id.'_'.$i.'" name="wdform_'.$id1.'_scale_radio'.$form_id.'" value="'.$i.'" type="radio" '.( $to_check==$i ? 'checked="checked"' : '' ).'><label for="wdform_'.$id1.'_scale_radio'.$form_id.'_'.$i.'"></label></div></div>';
|
| 3616 |
+
}
|
| 3617 |
+
|
| 3618 |
+
$rep ='<div type="type_scale_rating" class="wdform-field"><div class="wdform-label-section '.$param['w_class'].'" style="'.$param['w_field_label_pos1'].' width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 3619 |
+
if($required) {
|
| 3620 |
+
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 3621 |
+
}
|
| 3622 |
+
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].'"><div id="wdform_'.$id1.'_element'.$form_id.'" style="float: left;" '.$param['attributes'].'><label class="mini_label">'.$w_mini_labels[0].'</label><div style="display: inline-table; vertical-align: middle;border-spacing: 7px;"><div style="display: table-row;">'.$numbers.'</div><div style="display: table-row;">'.$radio_buttons.'</div></div><label class="mini_label" >'.$w_mini_labels[1].'</label></div></div></div>';
|
| 3623 |
+
if($required) {
|
| 3624 |
+
$check_js.='
|
| 3625 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 3626 |
+
{
|
| 3627 |
+
if(x.find(jQuery("div[wdid='.$id1.'] input:checked")).length == 0)
|
| 3628 |
+
{
|
| 3629 |
+
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 3630 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 3631 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 3632 |
+
|
| 3633 |
+
return false;
|
| 3634 |
+
}
|
| 3635 |
+
}
|
| 3636 |
+
';
|
| 3637 |
+
}
|
| 3638 |
+
$onsubmit_js.='
|
| 3639 |
+
jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_scale_amount'.$form_id.'\" value = \"'.$param['w_scale_amount'].'\" />").appendTo("#form'.$form_id.'");
|
| 3640 |
+
';
|
| 3641 |
+
break;
|
| 3642 |
+
}
|
| 3643 |
+
|
| 3644 |
+
case 'type_spinner': {
|
| 3645 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_field_width','w_field_min_value','w_field_max_value', 'w_field_step', 'w_field_value', 'w_required','w_class');
|
| 3646 |
+
$temp=$params;
|
| 3647 |
+
foreach($params_names as $params_name ) {
|
| 3648 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 3649 |
+
$param[$params_name] = $temp[0];
|
| 3650 |
+
$temp=$temp[1];
|
| 3651 |
+
}
|
| 3652 |
+
if($temp) {
|
| 3653 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 3654 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 3655 |
+
foreach($attrs as $attr) {
|
| 3656 |
+
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 3657 |
+
}
|
| 3658 |
+
}
|
| 3659 |
+
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 3660 |
+
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 3661 |
+
$required = ($param['w_required']=="yes" ? true : false);
|
| 3662 |
+
$param['w_field_value']=(isset($_POST['wdform_'.$id1.'_element'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element'.$form_id])) : $param['w_field_value']);
|
| 3663 |
+
|
| 3664 |
+
$rep ='<div type="type_spinner" class="wdform-field"><div class="wdform-label-section '.$param['w_class'].'" style="'.$param['w_field_label_pos1'].' width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 3665 |
+
if($required) {
|
| 3666 |
+
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 3667 |
+
}
|
| 3668 |
+
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].'"><input type="text" value="'.($param['w_field_value']!= 'null' ? $param['w_field_value'] : '').'" name="wdform_'.$id1.'_element'.$form_id.'" id="wdform_'.$id1.'_element'.$form_id.'" style="width: '.$param['w_field_width'].'px;" '.$param['attributes'].'></div></div>';
|
| 3669 |
+
$onload_js .='
|
| 3670 |
+
jQuery("#form'.$form_id.' #wdform_'.$id1.'_element'.$form_id.'")[0].spin = null;
|
| 3671 |
+
spinner = jQuery("#form'.$form_id.' #wdform_'.$id1.'_element'.$form_id.'").spinner();
|
| 3672 |
+
spinner.spinner( "value", "'.($param['w_field_value']!= 'null' ? $param['w_field_value'] : '').'");
|
| 3673 |
+
jQuery("#form'.$form_id.' #wdform_'.$id1.'_element'.$form_id.'").spinner({ min: "'.$param['w_field_min_value'].'"});
|
| 3674 |
+
jQuery("#form'.$form_id.' #wdform_'.$id1.'_element'.$form_id.'").spinner({ max: "'.$param['w_field_max_value'].'"});
|
| 3675 |
+
jQuery("#form'.$form_id.' #wdform_'.$id1.'_element'.$form_id.'").spinner({ step: "'.$param['w_field_step'].'"});
|
| 3676 |
+
';
|
| 3677 |
+
|
| 3678 |
+
if($required) {
|
| 3679 |
+
$check_js.='
|
| 3680 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 3681 |
+
{
|
| 3682 |
+
if(jQuery("#wdform_'.$id1.'_element'.$form_id.'").val()=="")
|
| 3683 |
+
{
|
| 3684 |
+
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 3685 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'").addClass( "form-error" );
|
| 3686 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 3687 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 3688 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'").focus();
|
| 3689 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'").change(function() { if( jQuery(this).val()!="" ) jQuery(this).removeClass("form-error"); else jQuery(this).addClass("form-error");});
|
| 3690 |
+
return false;
|
| 3691 |
+
}
|
| 3692 |
+
}
|
| 3693 |
+
';
|
| 3694 |
+
}
|
| 3695 |
+
break;
|
| 3696 |
+
}
|
| 3697 |
+
|
| 3698 |
+
case 'type_slider': {
|
| 3699 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_field_width','w_field_min_value','w_field_max_value', 'w_field_value', 'w_required','w_class');
|
| 3700 |
+
$temp=$params;
|
| 3701 |
+
foreach($params_names as $params_name ) {
|
| 3702 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 3703 |
+
$param[$params_name] = $temp[0];
|
| 3704 |
+
$temp=$temp[1];
|
| 3705 |
+
}
|
| 3706 |
+
if($temp) {
|
| 3707 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 3708 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 3709 |
+
foreach($attrs as $attr) {
|
| 3710 |
+
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 3711 |
+
}
|
| 3712 |
+
}
|
| 3713 |
+
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 3714 |
+
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 3715 |
+
$required = ($param['w_required']=="yes" ? true : false);
|
| 3716 |
+
$param['w_field_value']=(isset($_POST['wdform_'.$id1.'_slider_value'.$form_id]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_slider_value'.$form_id])) : $param['w_field_value']);
|
| 3717 |
+
|
| 3718 |
+
$rep ='<div type="type_slider" class="wdform-field"><div class="wdform-label-section '.$param['w_class'].'" style="'.$param['w_field_label_pos1'].' width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 3719 |
+
if($required) {
|
| 3720 |
+
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 3721 |
+
}
|
| 3722 |
+
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].'"><input type="hidden" value="'.$param['w_field_value'].'" id="wdform_'.$id1.'_slider_value'.$form_id.'" name="wdform_'.$id1.'_slider_value'.$form_id.'"><div name="'.$id1.'_element'.$form_id.'" id="wdform_'.$id1.'_element'.$form_id.'" style="width: '.$param['w_field_width'].'px;" '.$param['attributes'].'"></div><div align="left" style="display: inline-block; width: 33.3%; text-align: left;"><span id="wdform_'.$id1.'_element_min'.$form_id.'" class="label">'.$param['w_field_min_value'].'</span></div><div align="right" style="display: inline-block; width: 33.3%; text-align: center;"><span id="wdform_'.$id1.'_element_value'.$form_id.'" class="label">'.$param['w_field_value'].'</span></div><div align="right" style="display: inline-block; width: 33.3%; text-align: right;"><span id="wdform_'.$id1.'_element_max'.$form_id.'" class="label">'.$param['w_field_max_value'].'</span></div></div></div>';
|
| 3723 |
+
$onload_js .='
|
| 3724 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'")[0].slide = null;
|
| 3725 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'").slider({
|
| 3726 |
+
range: "min",
|
| 3727 |
+
value: eval('.$param['w_field_value'].'),
|
| 3728 |
+
min: eval('.$param['w_field_min_value'].'),
|
| 3729 |
+
max: eval('.$param['w_field_max_value'].'),
|
| 3730 |
+
slide: function( event, ui ) {
|
| 3731 |
+
|
| 3732 |
+
jQuery("#wdform_'.$id1.'_element_value'.$form_id.'").html("" + ui.value);
|
| 3733 |
+
jQuery("#wdform_'.$id1.'_slider_value'.$form_id.'").val("" + ui.value);
|
| 3734 |
+
|
| 3735 |
+
}
|
| 3736 |
+
});
|
| 3737 |
+
';
|
| 3738 |
+
if($required) {
|
| 3739 |
+
$check_js.='
|
| 3740 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 3741 |
+
{
|
| 3742 |
+
if(jQuery("#wdform_'.$id1.'_slider_value'.$form_id.'").val()=='.$param['w_field_min_value'].')
|
| 3743 |
+
{
|
| 3744 |
+
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 3745 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 3746 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 3747 |
+
return false;
|
| 3748 |
+
}
|
| 3749 |
+
}
|
| 3750 |
+
';
|
| 3751 |
+
}
|
| 3752 |
+
break;
|
| 3753 |
+
}
|
| 3754 |
+
|
| 3755 |
+
case 'type_range': {
|
| 3756 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_field_range_width','w_field_range_step','w_field_value1', 'w_field_value2', 'w_mini_labels', 'w_required','w_class');
|
| 3757 |
+
$temp=$params;
|
| 3758 |
+
foreach($params_names as $params_name ) {
|
| 3759 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 3760 |
+
$param[$params_name] = $temp[0];
|
| 3761 |
+
$temp=$temp[1];
|
| 3762 |
+
}
|
| 3763 |
+
if($temp) {
|
| 3764 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 3765 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 3766 |
+
foreach($attrs as $attr) {
|
| 3767 |
+
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 3768 |
+
}
|
| 3769 |
+
}
|
| 3770 |
+
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 3771 |
+
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 3772 |
+
$required = ($param['w_required']=="yes" ? true : false);
|
| 3773 |
+
$param['w_field_value1']=(isset($_POST['wdform_'.$id1.'_element'.$form_id.'0']) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element'.$form_id.'0'])) : $param['w_field_value1']);
|
| 3774 |
+
$param['w_field_value2']=(isset($_POST['wdform_'.$id1.'_element'.$form_id.'1']) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element'.$form_id.'1'])) : $param['w_field_value2']);
|
| 3775 |
+
|
| 3776 |
+
$w_mini_labels = explode('***',$param['w_mini_labels']);
|
| 3777 |
+
$rep ='<div type="type_range" class="wdform-field"><div class="wdform-label-section '.$param['w_class'].'" style="'.$param['w_field_label_pos1'].' width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 3778 |
+
if($required) {
|
| 3779 |
+
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 3780 |
+
}
|
| 3781 |
+
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].'"><div style="display: table;"><div style="display: table-row;"><div valign="middle" align="left" style="display: table-cell;"><input type="text" value="'.($param['w_field_value1']!= 'null' ? $param['w_field_value1'] : '').'" name="wdform_'.$id1.'_element'.$form_id.'0" id="wdform_'.$id1.'_element'.$form_id.'0" style="width: '.$param['w_field_range_width'].'px;" '.$param['attributes'].'></div><div valign="middle" align="left" style="display: table-cell; padding-left: 4px;"><input type="text" value="'.($param['w_field_value2']!= 'null' ? $param['w_field_value2'] : '').'" name="wdform_'.$id1.'_element'.$form_id.'1" id="wdform_'.$id1.'_element'.$form_id.'1" style="width: '.$param['w_field_range_width'].'px;" '.$param['attributes'].'></div></div><div style="display: table-row;"><div valign="top" align="left" style="display: table-cell;"><label class="mini_label" id="wdform_'.$id1.'_mini_label_from">'.$w_mini_labels[0].'</label></div><div valign="top" align="left" style="display: table-cell;"><label class="mini_label" id="wdform_'.$id1.'_mini_label_to">'.$w_mini_labels[1].'</label></div></div></div></div></div>';
|
| 3782 |
+
$onload_js .='
|
| 3783 |
+
jQuery("#form'.$form_id.' #wdform_'.$id1.'_element'.$form_id.'0")[0].spin = null;
|
| 3784 |
+
jQuery("#form'.$form_id.' #wdform_'.$id1.'_element'.$form_id.'1")[0].spin = null;
|
| 3785 |
+
|
| 3786 |
+
spinner0 = jQuery("#form'.$form_id.' #wdform_'.$id1.'_element'.$form_id.'0").spinner();
|
| 3787 |
+
spinner0.spinner( "value", "'.($param['w_field_value1']!= 'null' ? $param['w_field_value1'] : '').'");
|
| 3788 |
+
jQuery("#form'.$form_id.' #wdform_'.$id1.'_element'.$form_id.'").spinner({ step: '.$param['w_field_range_step'].'});
|
| 3789 |
+
|
| 3790 |
+
spinner1 = jQuery("#form'.$form_id.' #wdform_'.$id1.'_element'.$form_id.'1").spinner();
|
| 3791 |
+
spinner1.spinner( "value", "'.($param['w_field_value2']!= 'null' ? $param['w_field_value2'] : '').'");
|
| 3792 |
+
jQuery("#form'.$form_id.' #wdform_'.$id1.'_element'.$form_id.'").spinner({ step: '.$param['w_field_range_step'].'});
|
| 3793 |
+
';
|
| 3794 |
+
|
| 3795 |
+
if($required) {
|
| 3796 |
+
$check_js.='
|
| 3797 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 3798 |
+
{
|
| 3799 |
+
if(jQuery("#wdform_'.$id1.'_element'.$form_id.'0").val()=="" || jQuery("#wdform_'.$id1.'_element'.$form_id.'1").val()=="")
|
| 3800 |
+
{
|
| 3801 |
+
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 3802 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 3803 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 3804 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'0").focus();
|
| 3805 |
+
return false;
|
| 3806 |
+
}
|
| 3807 |
+
}
|
| 3808 |
+
';
|
| 3809 |
+
}
|
| 3810 |
+
break;
|
| 3811 |
+
}
|
| 3812 |
+
|
| 3813 |
+
case 'type_grading': {
|
| 3814 |
+
$params_names=array('w_field_label_size','w_field_label_pos', 'w_items', 'w_total', 'w_required','w_class');
|
| 3815 |
+
$temp=$params;
|
| 3816 |
+
foreach($params_names as $params_name ) {
|
| 3817 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 3818 |
+
$param[$params_name] = $temp[0];
|
| 3819 |
+
$temp=$temp[1];
|
| 3820 |
+
}
|
| 3821 |
+
if($temp) {
|
| 3822 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 3823 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 3824 |
+
foreach($attrs as $attr) {
|
| 3825 |
+
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 3826 |
+
}
|
| 3827 |
+
}
|
| 3828 |
+
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 3829 |
+
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 3830 |
+
$required = ($param['w_required']=="yes" ? true : false);
|
| 3831 |
+
|
| 3832 |
+
$w_items = explode('***',$param['w_items']);
|
| 3833 |
+
$required_check='true';
|
| 3834 |
+
$w_items_labels =implode(':',$w_items);
|
| 3835 |
+
$grading_items ='';
|
| 3836 |
+
|
| 3837 |
+
for($i=0; $i<count($w_items); $i++) {
|
| 3838 |
+
$value=(isset($_POST['wdform_'.$id1.'_element'.$form_id.'_'.$i]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_element'.$form_id.'_'.$i])) : '');
|
| 3839 |
+
$grading_items .= '<div class="wdform_grading"><input type="text" id="wdform_'.$id1.'_element'.$form_id.'_'.$i.'" name="wdform_'.$id1.'_element'.$form_id.'_'.$i.'" value="'.$value.'" '.$param['attributes'].'><label class="wdform-ch-rad-label" for="wdform_'.$id1.'_element'.$form_id.'_'.$i.'">'.$w_items[$i].'</label></div>';
|
| 3840 |
+
$required_check.=' && jQuery("#wdform_'.$id1.'_element'.$form_id.'_'.$i.'").val()==""';
|
| 3841 |
+
}
|
| 3842 |
+
$rep ='<div type="type_grading" class="wdform-field"><div class="wdform-label-section '.$param['w_class'].'" style="'.$param['w_field_label_pos1'].' width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 3843 |
+
if($required) {
|
| 3844 |
+
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 3845 |
+
}
|
| 3846 |
+
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].'"><input type="hidden" value="'.$param['w_total'].'" name="wdform_'.$id1.'_grading_total'.$form_id.'" id="wdform_'.$id1.'_grading_total'.$form_id.'"><div id="wdform_'.$id1.'_element'.$form_id.'">'.$grading_items.'<div id="wdform_'.$id1.'_element_total_div'.$form_id.'" class="grading_div">Total: <span id="wdform_'.$id1.'_sum_element'.$form_id.'">0</span>/<span id="wdform_'.$id1.'_total_element'.$form_id.'">'.$param['w_total'].'</span><span id="wdform_'.$id1.'_text_element'.$form_id.'"></span></div></div></div></div>';
|
| 3847 |
+
$onload_js.='
|
| 3848 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.' input").change(function() {sum_grading_values("wdform_'.$id1.'",'.$form_id.');});';
|
| 3849 |
+
$onload_js.='
|
| 3850 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.' input").keyup(function() {sum_grading_values("wdform_'.$id1.'",'.$form_id.');});';
|
| 3851 |
+
$onload_js.='
|
| 3852 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.' input").keyup(function() {sum_grading_values("wdform_'.$id1.'",'.$form_id.');});';
|
| 3853 |
+
$onload_js.='
|
| 3854 |
+
sum_grading_values("wdform_'.$id1.'",'.$form_id.');';
|
| 3855 |
+
if($required) {
|
| 3856 |
+
$check_js.='
|
| 3857 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 3858 |
+
{
|
| 3859 |
+
if('.$required_check.')
|
| 3860 |
+
{
|
| 3861 |
+
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 3862 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 3863 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 3864 |
+
jQuery("#wdform_'.$id1.'_element'.$form_id.'0").focus();
|
| 3865 |
+
return false;
|
| 3866 |
+
}
|
| 3867 |
+
}
|
| 3868 |
+
';
|
| 3869 |
+
}
|
| 3870 |
+
$check_js.='
|
| 3871 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 3872 |
+
{
|
| 3873 |
+
if(parseInt(jQuery("#wdform_'.$id1.'_sum_element'.$form_id.'").html()) > '.$param['w_total'].')
|
| 3874 |
+
{
|
| 3875 |
+
alert("' . addslashes(__("Your score should be less than", 'form_maker')) . $param['w_total'] . '");
|
| 3876 |
+
return false;
|
| 3877 |
+
}
|
| 3878 |
+
}
|
| 3879 |
+
';
|
| 3880 |
+
|
| 3881 |
+
$onsubmit_js.='
|
| 3882 |
+
jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_hidden_item'.$form_id.'\" value = \"'.$w_items_labels.':'.$param['w_total'].'\" />").appendTo("#form'.$form_id.'");
|
| 3883 |
+
';
|
| 3884 |
+
break;
|
| 3885 |
+
}
|
| 3886 |
+
case 'type_matrix': {
|
| 3887 |
+
$params_names=array('w_field_label_size','w_field_label_pos', 'w_field_input_type', 'w_rows', 'w_columns', 'w_required','w_class','w_textbox_size');
|
| 3888 |
+
$temp=$params;
|
| 3889 |
+
foreach($params_names as $params_name ) {
|
| 3890 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 3891 |
+
$param[$params_name] = $temp[0];
|
| 3892 |
+
$temp=$temp[1];
|
| 3893 |
+
}
|
| 3894 |
+
if($temp) {
|
| 3895 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 3896 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 3897 |
+
foreach($attrs as $attr) {
|
| 3898 |
+
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 3899 |
+
}
|
| 3900 |
+
}
|
| 3901 |
+
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 3902 |
+
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 3903 |
+
$required = ($param['w_required']=="yes" ? true : false);
|
| 3904 |
+
$param['w_textbox_size'] = isset($param['w_textbox_size']) ? $param['w_textbox_size'] : '120';
|
| 3905 |
+
$w_rows = explode('***',$param['w_rows']);
|
| 3906 |
+
$w_columns = explode('***',$param['w_columns']);
|
| 3907 |
+
$column_labels ='';
|
| 3908 |
+
|
| 3909 |
+
for($i=1; $i<count($w_columns); $i++) {
|
| 3910 |
+
$column_labels .= '<div><label class="wdform-ch-rad-label">'.$w_columns[$i].'</label></div>';
|
| 3911 |
+
}
|
| 3912 |
+
$rows_columns = '';
|
| 3913 |
+
for($i=1; $i<count($w_rows); $i++) {
|
| 3914 |
+
$rows_columns .= '<div class="wdform-matrix-row'.($i%2).'" row="'.$i.'"><div class="wdform-matrix-column"><label class="wdform-ch-rad-label" >'.$w_rows[$i].'</label></div>';
|
| 3915 |
+
for($k=1; $k<count($w_columns); $k++) {
|
| 3916 |
+
$rows_columns .= '<div class="wdform-matrix-cell">';
|
| 3917 |
+
if($param['w_field_input_type']=='radio') {
|
| 3918 |
+
$to_check=0;
|
| 3919 |
+
$post_value = isset($_POST['wdform_'.$id1.'_input_element'.$form_id.''.$i]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_input_element'.$form_id.''.$i])) : NULL;
|
| 3920 |
+
if(isset($post_value)) {
|
| 3921 |
+
$to_check=$post_value;
|
| 3922 |
+
}
|
| 3923 |
+
$rows_columns .= '<div class="radio-div"><input id="wdform_'.$id1.'_input_element'.$form_id.''.$i.'_'.$k.'" type="radio" name="wdform_'.$id1.'_input_element'.$form_id.''.$i.'" value="'.$i.'_'.$k.'" '.($to_check==$i.'_'.$k ? 'checked="checked"' : '').'><label for="wdform_'.$id1.'_input_element'.$form_id.''.$i.'_'.$k.'"></label></div>';
|
| 3924 |
+
}
|
| 3925 |
+
else {
|
| 3926 |
+
if($param['w_field_input_type']=='checkbox') {
|
| 3927 |
+
$to_check=0;
|
| 3928 |
+
$post_value = isset($_POST['wdform_'.$id1.'_input_element'.$form_id.''.$i.'_'.$k]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_input_element'.$form_id.''.$i.'_'.$k])) : NULL;
|
| 3929 |
+
if(isset($post_value)) {
|
| 3930 |
+
$to_check=$post_value;
|
| 3931 |
+
}
|
| 3932 |
+
$rows_columns .= '<div class="checkbox-div"><input id="wdform_'.$id1.'_input_element'.$form_id.''.$i.'_'.$k.'" type="checkbox" name="wdform_'.$id1.'_input_element'.$form_id.''.$i.'_'.$k.'" value="1" '.($to_check=="1" ? 'checked="checked"' : '').'><label for="wdform_'.$id1.'_input_element'.$form_id.''.$i.'_'.$k.'"></label></div>';
|
| 3933 |
+
}
|
| 3934 |
+
else {
|
| 3935 |
+
if($param['w_field_input_type']=='text') {
|
| 3936 |
+
$rows_columns .= '<input id="wdform_'.$id1.'_input_element'.$form_id.''.$i.'_'.$k.'" type="text" name="wdform_'.$id1.'_input_element'.$form_id.''.$i.'_'.$k.'" value="'.(isset($_POST['wdform_'.$id1.'_input_element'.$form_id.''.$i.'_'.$k]) ? esc_html(stripslashes($_POST['wdform_'.$id1.'_input_element'.$form_id.''.$i.'_'.$k])) : "").'" style="width:'.$param['w_textbox_size'].'px">';
|
| 3937 |
+
}
|
| 3938 |
+
else {
|
| 3939 |
+
if($param['w_field_input_type']=='select') {
|
| 3940 |
+
$rows_columns .= '<select id="wdform_'.$id1.'_select_yes_no'.$form_id.''.$i.'_'.$k.'" name="wdform_'.$id1.'_select_yes_no'.$form_id.''.$i.'_'.$k.'" ><option value="" '.(isset($_POST['wdform_'.$id1.'_select_yes_no'.$form_id.''.$i.'_'.$k]) && esc_html($_POST['wdform_'.$id1.'_select_yes_no'.$form_id.''.$i.'_'.$k]) == "" ? "selected=\"selected\"": "").'> </option><option value="yes" '.(isset($_POST['wdform_'.$id1.'_select_yes_no'.$form_id.''.$i.'_'.$k]) && esc_html($_POST['wdform_'.$id1.'_select_yes_no'.$form_id.''.$i.'_'.$k]) == "yes" ? "selected=\"selected\"": "").'>Yes</option><option value="no" '.(isset($_POST['wdform_'.$id1.'_select_yes_no'.$form_id.''.$i.'_'.$k]) && esc_html($_POST['wdform_'.$id1.'_select_yes_no'.$form_id.''.$i.'_'.$k]) == "no" ? "selected=\"selected\"": "").'>No</option></select>';
|
| 3941 |
+
}
|
| 3942 |
+
}
|
| 3943 |
+
}
|
| 3944 |
+
}
|
| 3945 |
+
$rows_columns.='</div>';
|
| 3946 |
+
}
|
| 3947 |
+
$rows_columns .= '</div>';
|
| 3948 |
+
}
|
| 3949 |
+
|
| 3950 |
+
$rep ='<div type="type_matrix" class="wdform-field"><div class="wdform-label-section '.$param['w_class'].'" style="'.$param['w_field_label_pos1'].' width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 3951 |
+
if($required) {
|
| 3952 |
+
$rep.='<span class="wdform-required">'.$required_sym.'</span>';
|
| 3953 |
+
}
|
| 3954 |
+
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].'"><div id="wdform_'.$id1.'_element'.$form_id.'" class="wdform-matrix-table" '.$param['attributes'].'><div style="display: table-row-group;"><div class="wdform-matrix-head"><div style="display: table-cell;"></div>'.$column_labels.'</div>'.$rows_columns.'</div></div></div></div>';
|
| 3955 |
+
$onsubmit_js.='
|
| 3956 |
+
jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_input_type'.$form_id.'\" value = \"'.$param['w_field_input_type'].'\" /><input type=\"hidden\" name=\"wdform_'.$id1.'_hidden_row'.$form_id.'\" value = \"'.addslashes($param['w_rows']).'\" /><input type=\"hidden\" name=\"wdform_'.$id1.'_hidden_column'.$form_id.'\" value = \"'.addslashes($param['w_columns']).'\" />").appendTo("#form'.$form_id.'");
|
| 3957 |
+
';
|
| 3958 |
+
if($required) {
|
| 3959 |
+
if($param['w_field_input_type']=='radio') {
|
| 3960 |
+
$check_js.='
|
| 3961 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 3962 |
+
{
|
| 3963 |
+
var radio_checked=true;
|
| 3964 |
+
for(var k=1; k<'.count($w_rows).';k++)
|
| 3965 |
+
{
|
| 3966 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).find(jQuery("div[row="+k+"]")).find(jQuery("input[type=\'radio\']:checked")).length == 0)
|
| 3967 |
+
{
|
| 3968 |
+
radio_checked=false;
|
| 3969 |
+
break;
|
| 3970 |
+
}
|
| 3971 |
+
}
|
| 3972 |
+
|
| 3973 |
+
if(radio_checked==false)
|
| 3974 |
+
{
|
| 3975 |
+
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 3976 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 3977 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 3978 |
+
return false;
|
| 3979 |
+
}
|
| 3980 |
+
}
|
| 3981 |
+
';
|
| 3982 |
+
}
|
| 3983 |
+
if($param['w_field_input_type']=='checkbox') {
|
| 3984 |
+
$check_js.='
|
| 3985 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 3986 |
+
{
|
| 3987 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).find(jQuery("input[type=\'checkbox\']:checked")).length == 0)
|
| 3988 |
+
{
|
| 3989 |
+
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 3990 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 3991 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 3992 |
+
return false;
|
| 3993 |
+
}
|
| 3994 |
+
}
|
| 3995 |
+
|
| 3996 |
+
';
|
| 3997 |
+
}
|
| 3998 |
+
if($param['w_field_input_type']=='text') {
|
| 3999 |
+
$check_js.='
|
| 4000 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 4001 |
+
{
|
| 4002 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).find(jQuery("input[type=\'text\']")).filter(function() {return this.value.length !== 0;}).length == 0)
|
| 4003 |
+
{
|
| 4004 |
+
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 4005 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 4006 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 4007 |
+
return false;
|
| 4008 |
+
}
|
| 4009 |
+
}
|
| 4010 |
+
';
|
| 4011 |
+
}
|
| 4012 |
+
|
| 4013 |
+
if($param['w_field_input_type']=='select') {
|
| 4014 |
+
$check_js.='
|
| 4015 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).length != 0 && x.find(jQuery("div[wdid='.$id1.']")).css("display") != "none")
|
| 4016 |
+
{
|
| 4017 |
+
if(x.find(jQuery("div[wdid='.$id1.']")).find(jQuery("select")).filter(function() {return this.value.length !== 0;}).length == 0)
|
| 4018 |
+
{
|
| 4019 |
+
alert("' .addslashes($label. ' ' . __('field is required.', 'form_maker')) . '");
|
| 4020 |
+
old_bg=x.find(jQuery("div[wdid='.$id1.']")).css("background-color");
|
| 4021 |
+
x.find(jQuery("div[wdid='.$id1.']")).effect( "shake", {}, 500 ).css("background-color","#FF8F8B").animate({backgroundColor: old_bg}, {duration: 500, queue: false });
|
| 4022 |
+
return false;
|
| 4023 |
+
}
|
| 4024 |
+
}
|
| 4025 |
+
|
| 4026 |
+
';
|
| 4027 |
+
}
|
| 4028 |
+
}
|
| 4029 |
+
break;
|
| 4030 |
+
}
|
| 4031 |
+
|
| 4032 |
+
case 'type_paypal_total': {
|
| 4033 |
+
$params_names=array('w_field_label_size','w_field_label_pos','w_class');
|
| 4034 |
+
$temp=$params;
|
| 4035 |
+
foreach($params_names as $params_name ) {
|
| 4036 |
+
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
| 4037 |
+
$param[$params_name] = $temp[0];
|
| 4038 |
+
$temp=$temp[1];
|
| 4039 |
+
}
|
| 4040 |
+
if($temp) {
|
| 4041 |
+
$temp =explode('*:*w_attr_name*:*',$temp);
|
| 4042 |
+
$attrs = array_slice($temp,0, count($temp)-1);
|
| 4043 |
+
foreach($attrs as $attr) {
|
| 4044 |
+
$param['attributes'] = $param['attributes'].' '.$attr;
|
| 4045 |
+
}
|
| 4046 |
+
}
|
| 4047 |
+
$param['w_field_label_pos1'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "");
|
| 4048 |
+
$param['w_field_label_pos2'] = ($param['w_field_label_pos']=="left" ? "" : "display:block;");
|
| 4049 |
+
$rep ='<div type="type_paypal_total" class="wdform-field"><div class="wdform-label-section '.$param['w_class'].'" style="'.$param['w_field_label_pos1'].' width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
|
| 4050 |
+
$rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos2'].'"><div id="wdform_'.$id1.'paypal_total'.$form_id.'" class="wdform_paypal_total paypal_total'.$form_id.'"><input type="hidden" value="" name="wdform_'.$id1.'_paypal_total'.$form_id.'" class="input_paypal_total'.$form_id.'"><div id="wdform_'.$id1.'div_total'.$form_id.'" class="div_total'.$form_id.'" style="margin-bottom: 10px;"></div><div id="wdform_'.$id1.'paypal_products'.$form_id.'" class="paypal_products'.$form_id.'" style="border-spacing: 2px;"><div style="border-spacing: 2px;"></div><div style="border-spacing: 2px;"></div></div><div id="wdform_'.$id1.'paypal_tax'.$form_id.'" class="paypal_tax'.$form_id.'" style="border-spacing: 2px; margin-top: 7px;"></div></div></div></div>';
|
| 4051 |
+
$onload_js .='set_total_value('.$form_id.');';
|
| 4052 |
+
break;
|
| 4053 |
+
}
|
| 4054 |
+
}
|
| 4055 |
+
$form=str_replace('%'.$id1.' - '.$labels[$id1s_key].'%', $rep, $form);
|
| 4056 |
+
$form=str_replace('%'.$id1.' -'.$labels[$id1s_key].'%', $rep, $form);
|
| 4057 |
+
}
|
| 4058 |
+
}
|
| 4059 |
+
|
| 4060 |
+
$onsubmit_js.='
|
| 4061 |
+
var disabled_fields ="";
|
| 4062 |
+
jQuery("div[wdid]").each(function() {
|
| 4063 |
+
if(jQuery(this).css("display")=="none")
|
| 4064 |
+
{
|
| 4065 |
+
disabled_fields += jQuery(this).attr("wdid");
|
| 4066 |
+
disabled_fields += ",";
|
| 4067 |
+
}
|
| 4068 |
+
|
| 4069 |
+
if(disabled_fields)
|
| 4070 |
+
jQuery("<input type=\"hidden\" name=\"disabled_fields'.$form_id.'\" value =\""+disabled_fields+"\" />").appendTo("#form'.$form_id.'");
|
| 4071 |
+
|
| 4072 |
+
})';
|
| 4073 |
+
|
| 4074 |
+
$rep1=array('form_id_temp');
|
| 4075 |
+
$rep2=array($id);
|
| 4076 |
+
|
| 4077 |
+
$form = str_replace($rep1,$rep2,$form);
|
| 4078 |
+
|
| 4079 |
+
$form_maker_front_end .= $form;
|
| 4080 |
+
$form_maker_front_end .= '<div class="wdform_preload"></div>';
|
| 4081 |
+
$form_maker_front_end .= '</form>';
|
| 4082 |
+
?>
|
| 4083 |
+
<script type="text/javascript">
|
| 4084 |
+
var plugin_url = "<?php echo WD_FMC_URL; ?>";
|
| 4085 |
+
WDF_GRADING_TEXT ='<?php echo addslashes(__("Your score should be less than", 'form_maker')); ?>';
|
| 4086 |
+
WDF_INVALID_GRADING_<?php echo $id; ?> = '<?php echo addslashes(sprintf(__("Your score should be less than", 'form_maker'), '`grading_label`', '`grading_total`')); ?>';
|
| 4087 |
+
FormCurrency_<?php echo $id; ?> = '<?php echo $form_currency ?>';
|
| 4088 |
+
FormPaypalTax_<?php echo $id; ?> = '<?php echo $form_paypal_tax ?>';
|
| 4089 |
+
|
| 4090 |
+
function formOnload<?php echo $id; ?>() {
|
| 4091 |
+
if (navigator.userAgent.toLowerCase().indexOf('msie') != -1 && parseInt(navigator.userAgent.toLowerCase().split('msie')[1]) === 8) {
|
| 4092 |
+
jQuery("#form<?php echo $id; ?>").find(jQuery("input[type='radio']")).click(function() {jQuery("input[type='radio']+label").removeClass('if-ie-div-label'); jQuery("input[type='radio']:checked+label").addClass('if-ie-div-label')});
|
| 4093 |
+
jQuery("#form<?php echo $id; ?>").find(jQuery("input[type='radio']:checked+label")).addClass('if-ie-div-label');
|
| 4094 |
+
jQuery("#form<?php echo $id; ?>").find(jQuery("input[type='checkbox']")).click(function() {jQuery("input[type='checkbox']+label").removeClass('if-ie-div-label'); jQuery("input[type='checkbox']:checked+label").addClass('if-ie-div-label')});
|
| 4095 |
+
jQuery("#form<?php echo $id; ?>").find(jQuery("input[type='checkbox']:checked+label")).addClass('if-ie-div-label');
|
| 4096 |
+
}
|
| 4097 |
+
|
| 4098 |
+
jQuery("div[type='type_text'] input, div[type='type_number'] input, div[type='type_phone'] input, div[type='type_name'] input, div[type='type_submitter_mail'] input, div[type='type_paypal_price'] input, div[type='type_textarea'] textarea").focus(function() {delete_value(this)}).blur(function() {return_value(this)});
|
| 4099 |
+
jQuery("div[type='type_number'] input, div[type='type_phone'] input, div[type='type_spinner'] input, div[type='type_range'] input, .wdform-quantity").keypress(function(evt) {return check_isnum(evt)});
|
| 4100 |
+
|
| 4101 |
+
jQuery("div[type='type_grading'] input").keypress(function(evt) {return check_isnum_or_minus(evt)});
|
| 4102 |
+
|
| 4103 |
+
jQuery("div[type='type_paypal_checkbox'] input[type='checkbox'], div[type='type_paypal_radio'] input[type='radio'], div[type='type_paypal_shipping'] input[type='radio']").click(function() {set_total_value(<?php echo $form_id; ?>)});
|
| 4104 |
+
jQuery("div[type='type_paypal_select'] select, div[type='type_paypal_price'] input").change(function() {set_total_value(<?php echo $form_id; ?>)});
|
| 4105 |
+
jQuery(".wdform-quantity").change(function() {set_total_value(<?php echo $form_id; ?>)});
|
| 4106 |
+
|
| 4107 |
+
jQuery("div[type='type_address'] select").change(function() {set_total_value(<?php echo $form_id; ?>)});
|
| 4108 |
+
|
| 4109 |
+
jQuery("div[type='type_time'] input").blur(function() {add_0(this)});
|
| 4110 |
+
|
| 4111 |
+
jQuery('.wdform-element-section').each(function() {
|
| 4112 |
+
if(!jQuery(this).parent()[0].style.width && parseInt(jQuery(this).width())!=0)
|
| 4113 |
+
{
|
| 4114 |
+
|
| 4115 |
+
if(jQuery(this).css('display')=="table-cell")
|
| 4116 |
+
{
|
| 4117 |
+
if(jQuery(this).parent().attr('type')!="type_captcha")
|
| 4118 |
+
jQuery(this).parent().css('width', parseInt(jQuery(this).width()) + parseInt(jQuery(this).parent().find(jQuery(".wdform-label-section"))[0].style.width)+15);
|
| 4119 |
+
else
|
| 4120 |
+
jQuery(this).parent().css('width', (parseInt(jQuery(this).parent().find(jQuery(".captcha_input"))[0].style.width)*2+50) + parseInt(jQuery(this).parent().find(jQuery(".wdform-label-section"))[0].style.width)+15);
|
| 4121 |
+
}
|
| 4122 |
+
}
|
| 4123 |
+
if (!jQuery(this).parent()[0].style.width && parseInt(jQuery(this).width()) != 0) {
|
| 4124 |
+
if (jQuery(this).css('display') == "table-cell") {
|
| 4125 |
+
if (jQuery(this).parent().attr('type') != "type_captcha") {
|
| 4126 |
+
jQuery(this).parent().css('width', parseInt(jQuery(this).width()) + parseInt(jQuery(this).parent().find(jQuery(".wdform-label-section"))[0].style.width)+15);
|
| 4127 |
+
}
|
| 4128 |
+
else {
|
| 4129 |
+
jQuery(this).parent().css('width', (parseInt(jQuery(this).parent().find(jQuery(".captcha_input"))[0].style.width)*2+50) + parseInt(jQuery(this).parent().find(jQuery(".wdform-label-section"))[0].style.width)+15);
|
| 4130 |
+
}
|
| 4131 |
+
}
|
| 4132 |
+
}
|
| 4133 |
+
if(parseInt(jQuery(this)[0].style.width.replace('px', '')) < parseInt(jQuery(this).css('min-width').replace('px', '')))
|
| 4134 |
+
jQuery(this).css('min-width', parseInt(jQuery(this)[0].style.width.replace('px', ''))-10);
|
| 4135 |
+
});
|
| 4136 |
+
|
| 4137 |
+
jQuery('.wdform-label').each(function() {
|
| 4138 |
+
if(parseInt(jQuery(this).height()) >= 2*parseInt(jQuery(this).css('line-height').replace('px', '')))
|
| 4139 |
+
{
|
| 4140 |
+
jQuery(this).parent().css('max-width',jQuery(this).parent().width());
|
| 4141 |
+
jQuery(this).parent().css('width','');
|
| 4142 |
+
}
|
| 4143 |
+
});
|
| 4144 |
+
|
| 4145 |
+
(function(jQuery){
|
| 4146 |
+
jQuery.fn.shuffle = function() {
|
| 4147 |
+
var allElems = this.get(),
|
| 4148 |
+
getRandom = function(max) {
|
| 4149 |
+
return Math.floor(Math.random() * max);
|
| 4150 |
+
},
|
| 4151 |
+
shuffled = jQuery.map(allElems, function(){
|
| 4152 |
+
var random = getRandom(allElems.length),
|
| 4153 |
+
randEl = jQuery(allElems[parseInt(random)]).clone(true)[0];
|
| 4154 |
+
allElems.splice(random, 1);
|
| 4155 |
+
return randEl;
|
| 4156 |
+
});
|
| 4157 |
+
this.each(function(i){
|
| 4158 |
+
jQuery(this).replaceWith(jQuery(shuffled[i]));
|
| 4159 |
+
});
|
| 4160 |
+
return jQuery(shuffled);
|
| 4161 |
+
};
|
| 4162 |
+
})(jQuery);
|
| 4163 |
+
|
| 4164 |
+
<?php echo $onload_js; ?>
|
| 4165 |
+
<?php echo $condition_js; ?>
|
| 4166 |
+
|
| 4167 |
+
if(window.before_load)
|
| 4168 |
+
{
|
| 4169 |
+
before_load();
|
| 4170 |
+
}
|
| 4171 |
+
}
|
| 4172 |
+
|
| 4173 |
+
jQuery(window).load(function () {
|
| 4174 |
+
formOnload<?php echo $id ?>();
|
| 4175 |
+
});
|
| 4176 |
+
|
| 4177 |
+
form_view_count<?php echo $id ?>=0;
|
| 4178 |
+
jQuery(document).ready(function () {
|
| 4179 |
+
for(i=1; i<=30; i++) {
|
| 4180 |
+
if (document.getElementById('<?php echo $id ?>form_view'+i)) {
|
| 4181 |
+
form_view_count<?php echo $id ?>++;
|
| 4182 |
+
form_view_max<?php echo $id ?> = i;
|
| 4183 |
+
}
|
| 4184 |
+
}
|
| 4185 |
+
if (form_view_count<?php echo $id ?> > 1) {
|
| 4186 |
+
for (i = 1; i <= form_view_max<?php echo $id ?>; i++) {
|
| 4187 |
+
if (document.getElementById('<?php echo $id ?>form_view' + i)) {
|
| 4188 |
+
first_form_view<?php echo $id ?> = i;
|
| 4189 |
+
break;
|
| 4190 |
+
}
|
| 4191 |
+
}
|
| 4192 |
+
generate_page_nav(first_form_view<?php echo $id ?>, '<?php echo $id ?>', form_view_count<?php echo $id ?>, form_view_max<?php echo $id ?>);
|
| 4193 |
+
}
|
| 4194 |
+
});
|
| 4195 |
+
function check_required<?php echo $form_id ?>(but_type) {
|
| 4196 |
+
if (but_type == 'reset') {
|
| 4197 |
+
if (window.before_reset) {
|
| 4198 |
+
before_reset();
|
| 4199 |
+
}
|
| 4200 |
+
var types = <?php echo json_encode($types) ?>;
|
| 4201 |
+
var label_ids = <?php echo json_encode($id1s) ?>;
|
| 4202 |
+
jQuery.each(types, function (index, elem) {
|
| 4203 |
+
switch(elem) {
|
| 4204 |
+
case "type_text":
|
| 4205 |
+
case "type_password":
|
| 4206 |
+
case "type_textarea":
|
| 4207 |
+
case "type_number":
|
| 4208 |
+
case "type_submitter_mail":
|
| 4209 |
+
case "type_spinner":
|
| 4210 |
+
case 'type_own_select':
|
| 4211 |
+
case 'type_country':
|
| 4212 |
+
case 'type_date':
|
| 4213 |
+
case 'type_hidden':
|
| 4214 |
+
jQuery("#wdform_"+label_ids[index]+"_element<?php echo $id ?>").val('');
|
| 4215 |
+
break;
|
| 4216 |
+
|
| 4217 |
+
case 'type_send_copy':
|
| 4218 |
+
jQuery("#wdform_"+label_ids[index]+"_element<?php echo $id ?>").prop('checked', false);
|
| 4219 |
+
break;
|
| 4220 |
+
case 'type_phone':
|
| 4221 |
+
jQuery("#wdform_"+label_ids[index]+"_element_first<?php echo $id ?>, #wdform_"+label_ids[index]+"_element_last<?php echo $id ?>").val('');
|
| 4222 |
+
break;
|
| 4223 |
+
|
| 4224 |
+
case 'type_name':
|
| 4225 |
+
jQuery("#wdform_"+label_ids[index]+"_element_first<?php echo $id ?>, #wdform_"+label_ids[index]+"_element_last<?php echo $id ?>, #wdform_"+label_ids[index]+"_element_title<?php echo $id ?>, #wdform_"+label_ids[index]+"_element_middle<?php echo $id ?>").val('');
|
| 4226 |
+
break;
|
| 4227 |
+
|
| 4228 |
+
case 'type_address':
|
| 4229 |
+
jQuery("#wdform_"+label_ids[index]+"_street1<?php echo $id ?>, #wdform_"+label_ids[index]+"_street2<?php echo $id ?>, #wdform_"+label_ids[index]+"_city<?php echo $id ?>, #wdform_"+label_ids[index]+"_state<?php echo $id ?>, #wdform_"+label_ids[index]+"_postal<?php echo $id ?>, #wdform_"+label_ids[index]+"_country<?php echo $id ?>").val('');
|
| 4230 |
+
break;
|
| 4231 |
+
|
| 4232 |
+
case 'type_checkbox':
|
| 4233 |
+
jQuery("#form<?php echo $id ?> div[wdid='"+label_ids[index]+"'] .checkbox-div input").prop('checked', false);
|
| 4234 |
+
jQuery("#wdform_"+label_ids[index]+"_other_br<?php echo $id ?>").remove();
|
| 4235 |
+
jQuery("#wdform_"+label_ids[index]+"_other_input<?php echo $id ?>").remove();
|
| 4236 |
+
break;
|
| 4237 |
+
|
| 4238 |
+
case 'type_radio':
|
| 4239 |
+
jQuery("#form<?php echo $id ?> div[wdid='"+label_ids[index]+"'] .radio-div input").prop('checked', false);
|
| 4240 |
+
jQuery("#wdform_"+label_ids[index]+"_other_br<?php echo $id ?>").remove();
|
| 4241 |
+
jQuery("#wdform_"+label_ids[index]+"_other_input<?php echo $id ?>").remove();
|
| 4242 |
+
break;
|
| 4243 |
+
|
| 4244 |
+
case 'type_time':
|
| 4245 |
+
jQuery("#wdform_"+label_ids[index]+"_hh<?php echo $id ?>, #wdform_"+label_ids[index]+"_mm<?php echo $id ?>, #wdform_"+label_ids[index]+"_ss<?php echo $id ?>, #wdform_"+label_ids[index]+"_am_pm<?php echo $id ?>").val('');
|
| 4246 |
+
break;
|
| 4247 |
+
|
| 4248 |
+
case 'type_date_fields':
|
| 4249 |
+
jQuery("#wdform_"+label_ids[index]+"_day<?php echo $id ?>, #wdform_"+label_ids[index]+"_month<?php echo $id ?>, #wdform_"+label_ids[index]+"_year<?php echo $id ?>").val('');
|
| 4250 |
+
break;
|
| 4251 |
+
|
| 4252 |
+
case 'type_file_upload':
|
| 4253 |
+
jQuery("#wdform_"+label_ids[index]+"_element<?php echo $id ?>_save").remove();
|
| 4254 |
+
break;
|
| 4255 |
+
|
| 4256 |
+
case 'type_paypal_price':
|
| 4257 |
+
jQuery("#wdform_"+label_ids[index]+"_element_dollars<?php echo $id ?>, #wdform_"+label_ids[index]+"_element_cents<?php echo $id ?>").val('');
|
| 4258 |
+
break;
|
| 4259 |
+
|
| 4260 |
+
case 'type_paypal_select':
|
| 4261 |
+
jQuery("#wdform_"+label_ids[index]+"_element<?php echo $id ?>, #wdform_"+label_ids[index]+"_element_quantity<?php echo $id ?>, #form<?php echo $id ?> div[wdid='"+label_ids[index]+"'] .paypal-property select").val('');
|
| 4262 |
+
break;
|
| 4263 |
+
|
| 4264 |
+
case 'type_paypal_radio':
|
| 4265 |
+
jQuery("#wdform_"+label_ids[index]+"_element_quantity<?php echo $id ?>,#form<?php echo $id ?> div[wdid='"+label_ids[index]+"'] .paypal-property select").val('');
|
| 4266 |
+
jQuery("#form<?php echo $id ?> div[wdid='"+label_ids[index]+"'] .radio-div input").prop('checked', false);
|
| 4267 |
+
break;
|
| 4268 |
+
|
| 4269 |
+
case 'type_paypal_shipping':
|
| 4270 |
+
jQuery("#form<?php echo $id ?> div[wdid='"+label_ids[index]+"'] .radio-div input").prop('checked', false);
|
| 4271 |
+
break;
|
| 4272 |
+
|
| 4273 |
+
case 'type_paypal_checkbox':
|
| 4274 |
+
jQuery("#wdform_"+label_ids[index]+"_element_quantity<?php echo $id ?>,#form<?php echo $id ?> div[wdid='"+label_ids[index]+"'] .paypal-property select").val('');
|
| 4275 |
+
jQuery("#form<?php echo $id ?> div[wdid='"+label_ids[index]+"'] .checkbox-div input").prop('checked', false);
|
| 4276 |
+
break;
|
| 4277 |
+
|
| 4278 |
+
case 'type_star_rating':
|
| 4279 |
+
jQuery("#wdform_"+label_ids[index]+"_selected_star_amount<?php echo $id ?>").val('');
|
| 4280 |
+
jQuery("#wdform_"+label_ids[index]+"_element<?php echo $id ?> img").attr('src', plugin_url+'/images/star.png');
|
| 4281 |
+
break;
|
| 4282 |
+
|
| 4283 |
+
case 'type_scale_rating':
|
| 4284 |
+
jQuery("#form<?php echo $id ?> div[wdid='"+label_ids[index]+"'] .radio-div input").prop('checked', false);
|
| 4285 |
+
break;
|
| 4286 |
+
|
| 4287 |
+
case 'type_slider':
|
| 4288 |
+
jQuery("#wdform_"+label_ids[index]+"_element<?php echo $id ?>").slider({
|
| 4289 |
+
value: eval(0),
|
| 4290 |
+
});
|
| 4291 |
+
jQuery("#wdform_"+label_ids[index]+"_element_value<?php echo $id ?>").html('0');
|
| 4292 |
+
break;
|
| 4293 |
+
|
| 4294 |
+
case 'type_range':
|
| 4295 |
+
jQuery("#wdform_"+label_ids[index]+"_element<?php echo $id ?>0, #wdform_"+label_ids[index]+"_element<?php echo $id ?>1").val('');
|
| 4296 |
+
break;
|
| 4297 |
+
|
| 4298 |
+
case 'type_grading':
|
| 4299 |
+
jQuery("#wdform_"+label_ids[index]+"_element<?php echo $id ?> input").val('');
|
| 4300 |
+
break;
|
| 4301 |
+
|
| 4302 |
+
case 'type_matrix':
|
| 4303 |
+
jQuery("#wdform_"+label_ids[index]+"_element<?php echo $id ?> .radio-div input").prop('checked', false);
|
| 4304 |
+
jQuery("#wdform_"+label_ids[index]+"_element<?php echo $id ?> .checkbox-div input").prop('checked', false);
|
| 4305 |
+
jQuery("#wdform_"+label_ids[index]+"_element<?php echo $id ?> input[type='text']").val('');
|
| 4306 |
+
jQuery("#wdform_"+label_ids[index]+"_element<?php echo $id ?> select").val('');
|
| 4307 |
+
break;
|
| 4308 |
+
|
| 4309 |
+
case 'type_paypal_total':
|
| 4310 |
+
jQuery("#wdform_"+label_ids[index]+"div_total<?php echo $id ?>").html('$0');
|
| 4311 |
+
jQuery("#wdform_"+label_ids[index]+"paypal_products<?php echo $id ?>").empty();
|
| 4312 |
+
break;
|
| 4313 |
+
default:
|
| 4314 |
+
break;
|
| 4315 |
+
}
|
| 4316 |
+
});
|
| 4317 |
+
|
| 4318 |
+
return;
|
| 4319 |
+
}
|
| 4320 |
+
if (window.before_submit) {
|
| 4321 |
+
before_submit();
|
| 4322 |
+
}
|
| 4323 |
+
x = jQuery("#form<?php echo $form_id; ?>");
|
| 4324 |
+
<?php echo $check_js; ?>;
|
| 4325 |
+
var a = [];
|
| 4326 |
+
if (typeof a[<?php echo $form_id ?>] !== 'undefined' && a[<?php echo $form_id ?>] == 1) {
|
| 4327 |
+
return;
|
| 4328 |
+
}
|
| 4329 |
+
<?php echo $onsubmit_js; ?>;
|
| 4330 |
+
a[<?php echo $form_id ?>] = 1;
|
| 4331 |
+
document.getElementById("form"+<?php echo $form_id ?>).submit();
|
| 4332 |
+
}
|
| 4333 |
+
function check<?php echo $form_id ?>(id) {
|
| 4334 |
+
x = jQuery("#<?php echo $form_id ?>form_view"+id);
|
| 4335 |
+
<?php echo $check_js; ?>;
|
| 4336 |
+
return true;
|
| 4337 |
+
}
|
| 4338 |
+
</script>
|
| 4339 |
+
<?php
|
| 4340 |
+
}
|
| 4341 |
+
else {
|
| 4342 |
+
$captcha_url = 'components/com_formmaker/wd_captcha.php?digit=';
|
| 4343 |
+
$captcha_rep_url = 'components/com_formmaker/wd_captcha.php?r2=' . mt_rand(0, 1000) . '&digit=';
|
| 4344 |
+
$rep1 = array(
|
| 4345 |
+
"<!--repstart-->Title<!--repend-->",
|
| 4346 |
+
"<!--repstart-->First<!--repend-->",
|
| 4347 |
+
"<!--repstart-->Last<!--repend-->",
|
| 4348 |
+
"<!--repstart-->Middle<!--repend-->",
|
| 4349 |
+
"<!--repstart-->January<!--repend-->",
|
| 4350 |
+
"<!--repstart-->February<!--repend-->",
|
| 4351 |
+
"<!--repstart-->March<!--repend-->",
|
| 4352 |
+
"<!--repstart-->April<!--repend-->",
|
| 4353 |
+
"<!--repstart-->May<!--repend-->",
|
| 4354 |
+
"<!--repstart-->June<!--repend-->",
|
| 4355 |
+
"<!--repstart-->July<!--repend-->",
|
| 4356 |
+
"<!--repstart-->August<!--repend-->",
|
| 4357 |
+
"<!--repstart-->September<!--repend-->",
|
| 4358 |
+
"<!--repstart-->October<!--repend-->",
|
| 4359 |
+
"<!--repstart-->November<!--repend-->",
|
| 4360 |
+
"<!--repstart-->December<!--repend-->",
|
| 4361 |
+
"<!--repstart-->Street Address<!--repend-->",
|
| 4362 |
+
"<!--repstart-->Street Address Line 2<!--repend-->",
|
| 4363 |
+
"<!--repstart-->City<!--repend-->",
|
| 4364 |
+
"<!--repstart-->State / Province / Region<!--repend-->",
|
| 4365 |
+
"<!--repstart-->Postal / Zip Code<!--repend-->",
|
| 4366 |
+
"<!--repstart-->Country<!--repend-->",
|
| 4367 |
+
"<!--repstart-->Area Code<!--repend-->",
|
| 4368 |
+
"<!--repstart-->Phone Number<!--repend-->",
|
| 4369 |
+
"<!--repstart-->Dollars<!--repend-->",
|
| 4370 |
+
"<!--repstart-->Cents<!--repend-->",
|
| 4371 |
+
"<!--repstart--> $ <!--repend-->",
|
| 4372 |
+
"<!--repstart-->Quantity<!--repend-->",
|
| 4373 |
+
"<!--repstart-->From<!--repend-->",
|
| 4374 |
+
"<!--repstart-->To<!--repend-->",
|
| 4375 |
+
"<!--repstart-->$300<!--repend-->",
|
| 4376 |
+
"<!--repstart-->product 1 $100<!--repend-->",
|
| 4377 |
+
"<!--repstart-->product 2 $200<!--repend-->",
|
| 4378 |
+
$captcha_url,
|
| 4379 |
+
'class="captcha_img"',
|
| 4380 |
+
plugins_url("images/refresh.png", __FILE__),
|
| 4381 |
+
'form_id_temp',
|
| 4382 |
+
'style="padding-right:170px"'
|
| 4383 |
+
);
|
| 4384 |
+
$rep2 = array(
|
| 4385 |
+
addslashes(__("Title", 'form_maker')),
|
| 4386 |
+
addslashes(__("First", 'form_maker')),
|
| 4387 |
+
addslashes(__("Last", 'form_maker')),
|
| 4388 |
+
addslashes(__("Middle", 'form_maker')),
|
| 4389 |
+
addslashes(__("January", 'form_maker')),
|
| 4390 |
+
addslashes(__("February", 'form_maker')),
|
| 4391 |
+
addslashes(__("March", 'form_maker')),
|
| 4392 |
+
addslashes(__("April", 'form_maker')),
|
| 4393 |
+
addslashes(__("May", 'form_maker')),
|
| 4394 |
+
addslashes(__("June", 'form_maker')),
|
| 4395 |
+
addslashes(__("July", 'form_maker')),
|
| 4396 |
+
addslashes(__("August", 'form_maker')),
|
| 4397 |
+
addslashes(__("September", 'form_maker')),
|
| 4398 |
+
addslashes(__("October", 'form_maker')),
|
| 4399 |
+
addslashes(__("November", 'form_maker')),
|
| 4400 |
+
addslashes(__("December", 'form_maker')),
|
| 4401 |
+
addslashes(__("Street Address", 'form_maker')),
|
| 4402 |
+
addslashes(__("Street Address Line 2", 'form_maker')),
|
| 4403 |
+
addslashes(__("City", 'form_maker')),
|
| 4404 |
+
addslashes(__("State / Province / Region", 'form_maker')),
|
| 4405 |
+
addslashes(__("Postal / Zip Code", 'form_maker')),
|
| 4406 |
+
addslashes(__("Country", 'form_maker')),
|
| 4407 |
+
addslashes(__("Area Code", 'form_maker')),
|
| 4408 |
+
addslashes(__("Phone Number", 'form_maker')),
|
| 4409 |
+
addslashes(__("Dollars", 'form_maker')),
|
| 4410 |
+
addslashes(__("Cents", 'form_maker')),
|
| 4411 |
+
' ' . $form_currency . ' ',
|
| 4412 |
+
addslashes(__("Quantity", 'form_maker')),
|
| 4413 |
+
addslashes(__("From", 'form_maker')),
|
| 4414 |
+
addslashes(__("To", 'form_maker')),
|
| 4415 |
+
'',
|
| 4416 |
+
'',
|
| 4417 |
+
'',
|
| 4418 |
+
$captcha_rep_url,
|
| 4419 |
+
'class="captcha_img" style="display:none"',
|
| 4420 |
+
plugins_url("images/refresh.png", __FILE__),
|
| 4421 |
+
$id,
|
| 4422 |
+
''
|
| 4423 |
+
);
|
| 4424 |
+
$untilupload = str_replace($rep1, $rep2, $row->form_front);
|
| 4425 |
+
while (strpos($untilupload, "***destinationskizb") > 0) {
|
| 4426 |
+
$pos1 = strpos($untilupload, "***destinationskizb");
|
| 4427 |
+
$pos2 = strpos($untilupload, "***destinationverj");
|
| 4428 |
+
$untilupload = str_replace(substr($untilupload, $pos1, $pos2 - $pos1 + 22), "", $untilupload);
|
| 4429 |
+
}
|
| 4430 |
+
$form_maker_front_end .= $untilupload;
|
| 4431 |
+
$is_recaptcha = FALSE;
|
| 4432 |
+
$form_maker_front_end .= '<script type="text/javascript">';
|
| 4433 |
+
$form_maker_front_end .= 'WDF_FILE_TYPE_ERROR = \'' . addslashes(__("Sorry, you are not allowed to upload this type of file.", 'form_maker')) . '\';';
|
| 4434 |
+
$form_maker_front_end .= 'WDF_GRADING_TEXT = \'' . addslashes(__("Your score should be less than", 'form_maker')) . '\';';
|
| 4435 |
+
$form_maker_front_end .= 'WDF_INVALID_GRADING_' . $id . ' = \'' . addslashes(sprintf(__("Your score should be less than", 'form_maker'), '`grading_label`', '`grading_total`')) . '\';';
|
| 4436 |
+
$form_maker_front_end .= 'WDF_INVALID_EMAIL = \'' . addslashes(__("This is not a valid email address.", 'form_maker')) . '\';';
|
| 4437 |
+
$form_maker_front_end .= 'REQUEST_URI_' . $id . ' = "' . $current_url . '";';
|
| 4438 |
+
$form_maker_front_end .= 'ReqFieldMsg_' . $id . ' =\'`FIELDNAME` ' . addslashes(__('field is required.', 'form_maker')) . '\';';
|
| 4439 |
+
$form_maker_front_end .= 'RangeFieldMsg_' . $id . ' =\'' . addslashes(__('The', 'form_maker')) . ' `FIELDNAME` ' . addslashes(__('value must be between', 'form_maker')) . ' `FROM` - `TO`\';';
|
| 4440 |
+
$form_maker_front_end .= 'FormCurrency_' . $id . ' = "' . $form_currency . '";';
|
| 4441 |
+
$form_maker_front_end .= 'FormPaypalTax_' . $id . ' = ' . $form_paypal_tax . ';';
|
| 4442 |
+
$form_maker_front_end .= 'function formOnload' . $id . '()
|
| 4443 |
+
{';
|
| 4444 |
+
foreach ($label_type as $key => $type) {
|
| 4445 |
+
switch ($type) {
|
| 4446 |
+
case 'type_map':
|
| 4447 |
+
$form_maker_front_end .= 'if(document.getElementById("' . $label_id[$key] . '_element' . $id . '"))
|
| 4448 |
+
{
|
| 4449 |
+
if_gmap_init(' . $label_id[$key] . ',' . $id . ');
|
| 4450 |
+
for(q=0; q<20; q++)
|
| 4451 |
+
if(document.getElementById(' . $label_id[$key] . '+"_element"+' . $id . ').getAttribute("long"+q))
|
| 4452 |
+
{
|
| 4453 |
+
|
| 4454 |
+
w_long=parseFloat(document.getElementById(' . $label_id[$key] . '+"_element"+' . $id . ').getAttribute("long"+q));
|
| 4455 |
+
w_lat=parseFloat(document.getElementById(' . $label_id[$key] . '+"_element"+' . $id . ').getAttribute("lat"+q));
|
| 4456 |
+
w_info=parseFloat(document.getElementById(' . $label_id[$key] . '+"_element"+' . $id . ').getAttribute("info"+q));
|
| 4457 |
+
add_marker_on_map(' . $label_id[$key] . ',q, w_long, w_lat, w_info,' . $id . ',false);
|
| 4458 |
+
}
|
| 4459 |
+
}';
|
| 4460 |
+
break;
|
| 4461 |
+
case 'type_mark_map':
|
| 4462 |
+
$form_maker_front_end .= 'if(document.getElementById("' . $label_id[$key] . '_element' . $id . '"))
|
| 4463 |
+
if(!document.getElementById("' . $label_id[$key] . '_long' . $id . '"))
|
| 4464 |
+
{
|
| 4465 |
+
|
| 4466 |
+
var longit = document.createElement(\'input\');
|
| 4467 |
+
longit.setAttribute("type", \'hidden\');
|
| 4468 |
+
longit.setAttribute("id", \'' . $label_id[$key] . '_long' . $id . '\');
|
| 4469 |
+
longit.setAttribute("name", \'' . $label_id[$key] . '_long' . $id . '\');
|
| 4470 |
+
|
| 4471 |
+
var latit = document.createElement(\'input\');
|
| 4472 |
+
latit.setAttribute("type", \'hidden\');
|
| 4473 |
+
latit.setAttribute("id", \'' . $label_id[$key] . '_lat' . $id . '\');
|
| 4474 |
+
latit.setAttribute("name", \'' . $label_id[$key] . '_lat' . $id . '\');
|
| 4475 |
+
|
| 4476 |
+
document.getElementById("' . $label_id[$key] . '_element_section' . $id . '").appendChild(longit);
|
| 4477 |
+
document.getElementById("' . $label_id[$key] . '_element_section' . $id . '").appendChild(latit);
|
| 4478 |
+
|
| 4479 |
+
if_gmap_init(' . $label_id[$key] . ', ' . $id . ');
|
| 4480 |
+
|
| 4481 |
+
w_long=parseFloat(document.getElementById(' . $label_id[$key] . '+"_element"+' . $id . ').getAttribute("long0"));
|
| 4482 |
+
w_lat=parseFloat(document.getElementById(' . $label_id[$key] . '+"_element"+' . $id . ').getAttribute("lat0"));
|
| 4483 |
+
w_info=parseFloat(document.getElementById(' . $label_id[$key] . '+"_element"+' . $id . ').getAttribute("info0"));
|
| 4484 |
+
|
| 4485 |
+
|
| 4486 |
+
longit.value=w_long;
|
| 4487 |
+
latit.value=w_lat;
|
| 4488 |
+
add_marker_on_map(' . $label_id[$key] . ',0, w_long, w_lat, w_info, ' . $id . ', true);
|
| 4489 |
+
}';
|
| 4490 |
+
break;
|
| 4491 |
+
case 'type_captcha':
|
| 4492 |
+
$form_maker_front_end .= 'if(document.getElementById(\'_wd_captcha' . $id . '\'))
|
| 4493 |
+
captcha_refresh(\'_wd_captcha\', \'' . $id . '\');';
|
| 4494 |
+
break;
|
| 4495 |
+
case 'type_recaptcha':
|
| 4496 |
+
$is_recaptcha = TRUE;
|
| 4497 |
+
break;
|
| 4498 |
+
case 'type_radio':
|
| 4499 |
+
case 'type_checkbox':
|
| 4500 |
+
$form_maker_front_end .= 'if(document.getElementById(\'' . $label_id[$key] . '_randomize' . $id . '\'))
|
| 4501 |
+
if (document.getElementById(\'' . $label_id[$key] . '_randomize' . $id . '\').value == "yes") {
|
| 4502 |
+
choises_randomize(\'' . $label_id[$key] . '\', \'' . $id . '\');}';
|
| 4503 |
+
break;
|
| 4504 |
+
case 'type_spinner':
|
| 4505 |
+
$form_maker_front_end .= '
|
| 4506 |
+
if (document.getElementById(\'' . $label_id[$key] . '_element' . $id . '\')) {
|
| 4507 |
+
var spinner_value = document.getElementById(\'' . $label_id[$key] . '_element' . $id . '\').getAttribute(\'aria-valuenow\');
|
| 4508 |
+
}
|
| 4509 |
+
if (document.getElementById(\'' . $label_id[$key] . '_min_value' . $id . '\'))
|
| 4510 |
+
var spinner_min_value = document.getElementById(\'' . $label_id[$key] . '_min_value' . $id . '\').value;
|
| 4511 |
+
if (document.getElementById(\'' . $label_id[$key] . '_max_value' . $id . '\'))
|
| 4512 |
+
var spinner_max_value = document.getElementById(\'' . $label_id[$key] . '_max_value' . $id . '\').value;
|
| 4513 |
+
if (document.getElementById(\'' . $label_id[$key] . '_step' . $id . '\'))
|
| 4514 |
+
var spinner_step = document.getElementById(\'' . $label_id[$key] . '_step' . $id . '\').value;
|
| 4515 |
+
jQuery( \'' . $label_id[$key] . '_element' . $id . '\' ).removeClass( \'ui-spinner-input\')
|
| 4516 |
+
.attr( \'disabled\', false )
|
| 4517 |
+
.removeAttr( \'autocomplete\' )
|
| 4518 |
+
.removeAttr( \'role\' )
|
| 4519 |
+
.removeAttr( \'aria-valuemin\' )
|
| 4520 |
+
.removeAttr( \'aria-valuemax\' )
|
| 4521 |
+
.removeAttr( \'aria-valuenow\' );
|
| 4522 |
+
if (document.getElementById(\'' . $label_id[$key] . '_element' . $id . '\')) {
|
| 4523 |
+
span_ui= document.getElementById(\'' . $label_id[$key] . '_element' . $id . '\').parentNode;
|
| 4524 |
+
span_ui.parentNode.appendChild(document.getElementById(\'' . $label_id[$key] . '_element' . $id . '\'));
|
| 4525 |
+
span_ui.parentNode.removeChild(span_ui);
|
| 4526 |
+
jQuery(\'#' . $label_id[$key] . '_element' . $id . '\')[0].spin = null;
|
| 4527 |
+
}
|
| 4528 |
+
spinner = jQuery( \'#' . $label_id[$key] . '_element' . $id . '\' ).spinner();
|
| 4529 |
+
spinner.spinner( \'value\', spinner_value );
|
| 4530 |
+
jQuery( \'#' . $label_id[$key] . '_element' . $id . '\' ).spinner({ min: spinner_min_value});
|
| 4531 |
+
jQuery( \'#' . $label_id[$key] . '_element' . $id . '\' ).spinner({ max: spinner_max_value});
|
| 4532 |
+
jQuery( \'#' . $label_id[$key] . '_element' . $id . '\' ).spinner({ step: spinner_step});';
|
| 4533 |
+
break;
|
| 4534 |
+
case 'type_slider':
|
| 4535 |
+
$form_maker_front_end .= '
|
| 4536 |
+
if (document.getElementById(\'' . $label_id[$key] . '_slider_value' . $id . '\'))
|
| 4537 |
+
var slider_value = document.getElementById(\'' . $label_id[$key] . '_slider_value' . $id . '\').value;
|
| 4538 |
+
if (document.getElementById(\'' . $label_id[$key] . '_slider_min_value' . $id . '\'))
|
| 4539 |
+
var slider_min_value = document.getElementById(\'' . $label_id[$key] . '_slider_min_value' . $id . '\').value;
|
| 4540 |
+
if (document.getElementById(\'' . $label_id[$key] . '_slider_max_value' . $id . '\'))
|
| 4541 |
+
var slider_max_value = document.getElementById(\'' . $label_id[$key] . '_slider_max_value' . $id . '\').value;
|
| 4542 |
+
if (document.getElementById(\'' . $label_id[$key] . '_element_value' . $id . '\'))
|
| 4543 |
+
var slider_element_value = document.getElementById(\'' . $label_id[$key] . '_element_value' . $id . '\' );
|
| 4544 |
+
if (document.getElementById(\'' . $label_id[$key] . '_slider_value' . $id . '\'))
|
| 4545 |
+
var slider_value_save = document.getElementById( \'' . $label_id[$key] . '_slider_value' . $id . '\' );
|
| 4546 |
+
if (document.getElementById(\'' . $label_id[$key] . '_element' . $id . '\')) {
|
| 4547 |
+
document.getElementById(\'' . $label_id[$key] . '_element' . $id . '\').innerHTML = \'\';
|
| 4548 |
+
document.getElementById(\'' . $label_id[$key] . '_element' . $id . '\').removeAttribute( \'class\' );
|
| 4549 |
+
document.getElementById(\'' . $label_id[$key] . '_element' . $id . '\').removeAttribute( \'aria-disabled\' );
|
| 4550 |
+
}
|
| 4551 |
+
if (document.getElementById(\'' . $label_id[$key] . '_element' . $id . '\'))
|
| 4552 |
+
jQuery(\'#' . $label_id[$key] . '_element' . $id . '\')[0].slide = null;
|
| 4553 |
+
jQuery( \'#' . $label_id[$key] . '_element' . $id . '\').slider({
|
| 4554 |
+
range: \'min\',
|
| 4555 |
+
value: eval(slider_value),
|
| 4556 |
+
min: eval(slider_min_value),
|
| 4557 |
+
max: eval(slider_max_value),
|
| 4558 |
+
slide: function( event, ui ) {
|
| 4559 |
+
slider_element_value.innerHTML = \'\' + ui.value;
|
| 4560 |
+
slider_value_save.value = \'\' + ui.value;
|
| 4561 |
+
}
|
| 4562 |
+
});';
|
| 4563 |
+
break;
|
| 4564 |
+
case 'type_range':
|
| 4565 |
+
$form_maker_front_end .= '
|
| 4566 |
+
if (document.getElementById(\'' . $label_id[$key] . '_element' . $id . '0\'))
|
| 4567 |
+
var spinner_value0 = document.getElementById(\'' . $label_id[$key] . '_element' . $id . '0\').getAttribute( \'aria-valuenow\' );
|
| 4568 |
+
if (document.getElementById(\'' . $label_id[$key] . '_element' . $id . '1\'))
|
| 4569 |
+
var spinner_value1 = document.getElementById(\'' . $label_id[$key] . '_element' . $id . '1\').getAttribute( \'aria-valuenow\' );
|
| 4570 |
+
if (document.getElementById(\'' . $label_id[$key] . '_range_step' . $id . '\'))
|
| 4571 |
+
var spinner_step = document.getElementById(\'' . $label_id[$key] . '_range_step' . $id . '\').value;
|
| 4572 |
+
jQuery( \'#' . $label_id[$key] . '_element' . $id . '0\' ).removeClass( \'ui-spinner-input\' )
|
| 4573 |
+
.attr( \'disabled\', false )
|
| 4574 |
+
.removeAttr( \'autocomplete\' )
|
| 4575 |
+
.removeAttr( \'role\' )
|
| 4576 |
+
.removeAttr( \'aria-valuenow\' );
|
| 4577 |
+
if (document.getElementById(\'' . $label_id[$key] . '_element' . $id . '0\')) {
|
| 4578 |
+
span_ui= document.getElementById(\'' . $label_id[$key] . '_element' . $id . '0\').parentNode;
|
| 4579 |
+
span_ui.parentNode.appendChild(document.getElementById(\'' . $label_id[$key] . '_element' . $id . '0\'));
|
| 4580 |
+
span_ui.parentNode.removeChild(span_ui);
|
| 4581 |
+
jQuery(\'#' . $label_id[$key] . '_element' . $id . '0\')[0].spin = null;
|
| 4582 |
+
}
|
| 4583 |
+
spinner0 = jQuery( \'#' . $label_id[$key] . '_element' . $id . '0\' ).spinner();
|
| 4584 |
+
spinner0.spinner( \'value\', spinner_value0 );
|
| 4585 |
+
jQuery( \'#' . $label_id[$key] . '_element' . $id . '0\' ).spinner({ step: spinner_step});
|
| 4586 |
+
jQuery( \'#' . $label_id[$key] . '_element' . $id . '1\' ).removeClass( \'ui-spinner-input\' )
|
| 4587 |
+
.attr( \'disabled\', false )
|
| 4588 |
+
.removeAttr( \'autocomplete\' )
|
| 4589 |
+
.removeAttr( \'role\' )
|
| 4590 |
+
.removeAttr( \'aria-valuenow\' );
|
| 4591 |
+
if (document.getElementById(\'' . $label_id[$key] . '_element' . $id . '1\')) {
|
| 4592 |
+
span_ui1= document.getElementById(\'' . $label_id[$key] . '_element' . $id . '1\').parentNode;
|
| 4593 |
+
span_ui1.parentNode.appendChild(document.getElementById(\'' . $label_id[$key] . '_element' . $id . '1\'));
|
| 4594 |
+
span_ui1.parentNode.removeChild(span_ui1);
|
| 4595 |
+
jQuery(\'#' . $label_id[$key] . '_element' . $id . '1\')[0].spin = null;
|
| 4596 |
+
}
|
| 4597 |
+
spinner1 = jQuery( \'#' . $label_id[$key] . '_element' . $id . '1\' ).spinner();
|
| 4598 |
+
spinner1.spinner( \'value\', spinner_value1 );
|
| 4599 |
+
jQuery( \'#' . $label_id[$key] . '_element' . $id . '1\').spinner({ step: spinner_step});';
|
| 4600 |
+
break;
|
| 4601 |
+
case 'type_paypal_total':
|
| 4602 |
+
$form_maker_front_end .= '
|
| 4603 |
+
set_total_value(' . $label_id[$key] . ', ' . $id . ');';
|
| 4604 |
+
break;
|
| 4605 |
+
default:
|
| 4606 |
+
break;
|
| 4607 |
+
}
|
| 4608 |
+
}
|
| 4609 |
+
$form_maker_front_end .= '
|
| 4610 |
+
if (window.before_load) {
|
| 4611 |
+
before_load();
|
| 4612 |
+
}
|
| 4613 |
+
}';
|
| 4614 |
+
$form_maker_front_end .= '
|
| 4615 |
+
jQuery(window).load(function () {
|
| 4616 |
+
formOnload' . $id . '();
|
| 4617 |
+
});';
|
| 4618 |
+
if (isset($_POST["counter" . $id])) {
|
| 4619 |
+
$counter = esc_html($_POST["counter" . $id]);
|
| 4620 |
+
}
|
| 4621 |
+
$old_key = -1;
|
| 4622 |
+
if (isset($counter)) {
|
| 4623 |
+
foreach ($label_type as $key => $type) {
|
| 4624 |
+
switch ($type) {
|
| 4625 |
+
case "type_text":
|
| 4626 |
+
case "type_number":
|
| 4627 |
+
case "type_submitter_mail":
|
| 4628 |
+
{
|
| 4629 |
+
$form_maker_front_end .= "if(document.getElementById('" . $label_id[$key] . "_element" . $id . "'))
|
| 4630 |
+
if(document.getElementById('" . $label_id[$key] . "_element" . $id . "').title!='" . addslashes((isset($_POST[$label_id[$key] . "_element" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element" . $id])) : "")) . "')
|
| 4631 |
+
{ document.getElementById('" . $label_id[$key] . "_element" . $id . "').value='" . addslashes(isset($_POST[$label_id[$key] . "_element" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element" . $id])) : "") . "';
|
| 4632 |
+
document.getElementById('" . $label_id[$key] . "_element" . $id . "').className='input_active';
|
| 4633 |
+
}
|
| 4634 |
+
";
|
| 4635 |
+
break;
|
| 4636 |
+
}
|
| 4637 |
+
case "type_textarea":
|
| 4638 |
+
{
|
| 4639 |
+
$order = array(
|
| 4640 |
+
"\r\n",
|
| 4641 |
+
"\n",
|
| 4642 |
+
"\r"
|
| 4643 |
+
);
|
| 4644 |
+
$form_maker_front_end .= "if(document.getElementById('" . $label_id[$key] . "_element" . $id . "'))
|
| 4645 |
+
if(document.getElementById('" . $label_id[$key] . "_element" . $id . "').title!='" . str_replace($order, '\n', addslashes(isset($_POST[$label_id[$key] . "_element" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element" . $id])) : "")) . "')
|
| 4646 |
+
{ document.getElementById('" . $label_id[$key] . "_element" . $id . "').innerHTML='" . str_replace($order, '\n', addslashes(isset($_POST[$label_id[$key] . "_element" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element" . $id])) : "")) . "';
|
| 4647 |
+
document.getElementById('" . $label_id[$key] . "_element" . $id . "').className='input_active';
|
| 4648 |
+
}
|
| 4649 |
+
";
|
| 4650 |
+
break;
|
| 4651 |
+
}
|
| 4652 |
+
case "type_name":
|
| 4653 |
+
{
|
| 4654 |
+
$element_title = isset($_POST[$label_id[$key] . "_element_title" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element_title" . $id])) : "";
|
| 4655 |
+
if (isset($_POST[$label_id[$key] . "_element_title" . $id])) {
|
| 4656 |
+
$form_maker_front_end .= "if(document.getElementById('" . $label_id[$key] . "_element_first" . $id . "'))
|
| 4657 |
+
{
|
| 4658 |
+
if(document.getElementById('" . $label_id[$key] . "_element_title" . $id . "').title!='" . addslashes(isset($_POST[$label_id[$key] . "_element_title" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element_title" . $id])) : "") . "')
|
| 4659 |
+
{ document.getElementById('" . $label_id[$key] . "_element_title" . $id . "').value='" . addslashes(isset($_POST[$label_id[$key] . "_element_title" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element_title" . $id])) : "") . "';
|
| 4660 |
+
document.getElementById('" . $label_id[$key] . "_element_title" . $id . "').className='input_active';
|
| 4661 |
+
}
|
| 4662 |
+
|
| 4663 |
+
if(document.getElementById('" . $label_id[$key] . "_element_first" . $id . "').title!='" . addslashes(isset($_POST[$label_id[$key] . "_element_first" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element_first" . $id])) : "") . "')
|
| 4664 |
+
{ document.getElementById('" . $label_id[$key] . "_element_first" . $id . "').value='" . addslashes(isset($_POST[$label_id[$key] . "_element_first" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element_first" . $id])) : "") . "';
|
| 4665 |
+
document.getElementById('" . $label_id[$key] . "_element_first" . $id . "').className='input_active';
|
| 4666 |
+
}
|
| 4667 |
+
|
| 4668 |
+
if(document.getElementById('" . $label_id[$key] . "_element_last" . $id . "').title!='" . addslashes(isset($_POST[$label_id[$key] . "_element_last" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element_last" . $id])) : "") . "')
|
| 4669 |
+
{ document.getElementById('" . $label_id[$key] . "_element_last" . $id . "').value='" . addslashes(isset($_POST[$label_id[$key] . "_element_last" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element_last" . $id])) : "") . "';
|
| 4670 |
+
document.getElementById('" . $label_id[$key] . "_element_last" . $id . "').className='input_active';
|
| 4671 |
+
}
|
| 4672 |
+
|
| 4673 |
+
if(document.getElementById('" . $label_id[$key] . "_element_middle" . $id . "').title!='" . addslashes(isset($_POST[$label_id[$key] . "_element_middle" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element_middle" . $id])) : "") . "')
|
| 4674 |
+
{ document.getElementById('" . $label_id[$key] . "_element_middle" . $id . "').value='" . addslashes(isset($_POST[$label_id[$key] . "_element_middle" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element_middle" . $id])) : "") . "';
|
| 4675 |
+
document.getElementById('" . $label_id[$key] . "_element_middle" . $id . "').className='input_active';
|
| 4676 |
+
}
|
| 4677 |
+
|
| 4678 |
+
}";
|
| 4679 |
+
}
|
| 4680 |
+
else {
|
| 4681 |
+
$form_maker_front_end .= "if(document.getElementById('" . $label_id[$key] . "_element_first" . $id . "'))
|
| 4682 |
+
{
|
| 4683 |
+
|
| 4684 |
+
if(document.getElementById('" . $label_id[$key] . "_element_first" . $id . "').title!='" . addslashes(isset($_POST[$label_id[$key] . "_element_first" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element_first" . $id])) : "") . "')
|
| 4685 |
+
{ document.getElementById('" . $label_id[$key] . "_element_first" . $id . "').value='" . addslashes(isset($_POST[$label_id[$key] . "_element_first" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element_first" . $id])) : "") . "';
|
| 4686 |
+
document.getElementById('" . $label_id[$key] . "_element_first" . $id . "').className='input_active';
|
| 4687 |
+
}
|
| 4688 |
+
|
| 4689 |
+
if(document.getElementById('" . $label_id[$key] . "_element_last" . $id . "').title!='" . addslashes(isset($_POST[$label_id[$key] . "_element_last" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element_last" . $id])) : "") . "')
|
| 4690 |
+
{ document.getElementById('" . $label_id[$key] . "_element_last" . $id . "').value='" . addslashes(isset($_POST[$label_id[$key] . "_element_last" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element_last" . $id])) : "") . "';
|
| 4691 |
+
document.getElementById('" . $label_id[$key] . "_element_last" . $id . "').className='input_active';
|
| 4692 |
+
}
|
| 4693 |
+
|
| 4694 |
+
}";
|
| 4695 |
+
}
|
| 4696 |
+
break;
|
| 4697 |
+
}
|
| 4698 |
+
case "type_phone":
|
| 4699 |
+
{
|
| 4700 |
+
$form_maker_front_end .= "if(document.getElementById('" . $label_id[$key] . "_element_first" . $id . "'))
|
| 4701 |
+
{
|
| 4702 |
+
if(document.getElementById('" . $label_id[$key] . "_element_first" . $id . "').title!='" . addslashes(isset($_POST[$label_id[$key] . "_element_first" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element_first" . $id])) : "") . "')
|
| 4703 |
+
{ document.getElementById('" . $label_id[$key] . "_element_first" . $id . "').value='" . addslashes(isset($_POST[$label_id[$key] . "_element_first" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element_first" . $id])) : "") . "';
|
| 4704 |
+
document.getElementById('" . $label_id[$key] . "_element_first" . $id . "').className='input_active';
|
| 4705 |
+
}
|
| 4706 |
+
|
| 4707 |
+
if(document.getElementById('" . $label_id[$key] . "_element_last" . $id . "').title!='" . addslashes(isset($_POST[$label_id[$key] . "_element_last" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element_last" . $id])) : "") . "')
|
| 4708 |
+
{ document.getElementById('" . $label_id[$key] . "_element_last" . $id . "').value='" . addslashes(isset($_POST[$label_id[$key] . "_element_last" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element_last" . $id])) : "") . "';
|
| 4709 |
+
document.getElementById('" . $label_id[$key] . "_element_last" . $id . "').className='input_active';
|
| 4710 |
+
}
|
| 4711 |
+
}";
|
| 4712 |
+
break;
|
| 4713 |
+
}
|
| 4714 |
+
|
| 4715 |
+
case "type_paypal_price": {
|
| 4716 |
+
$form_maker_front_end .= "if(document.getElementById('".$label_id[$key]."_element_dollars".$id."'))
|
| 4717 |
+
{
|
| 4718 |
+
if(document.getElementById('".$label_id[$key]."_element_dollars".$id."').title!='".addslashes(isset($_POST[$label_id[$key]."_element_dollars".$id]) ? esc_html(stripslashes($_POST[$label_id[$key]."_element_dollars".$id])) : "")."')
|
| 4719 |
+
{ document.getElementById('".$label_id[$key]."_element_dollars".$id."').value='".addslashes(isset($_POST[$label_id[$key]."_element_dollars".$id]) ? esc_html(stripslashes($_POST[$label_id[$key]."_element_dollars".$id])) : "")."';
|
| 4720 |
+
document.getElementById('".$label_id[$key]."_element_dollars".$id."').className='input_active';
|
| 4721 |
+
}
|
| 4722 |
+
|
| 4723 |
+
if(document.getElementById('".$label_id[$key]."_element_cents".$id."').title!='".addslashes(isset($_POST[$label_id[$key]."_element_cents".$id]) ? esc_html(stripslashes($_POST[$label_id[$key]."_element_cents".$id])) : "")."')
|
| 4724 |
+
{ document.getElementById('".$label_id[$key]."_element_cents".$id."').value='".addslashes(isset($_POST[$label_id[$key]."_element_cents".$id]) ? esc_html(stripslashes($_POST[$label_id[$key]."_element_cents".$id])) : "")."';
|
| 4725 |
+
document.getElementById('".$label_id[$key]."_element_cents".$id."').className='input_active';
|
| 4726 |
+
}
|
| 4727 |
+
}";
|
| 4728 |
+
|
| 4729 |
+
break;
|
| 4730 |
+
}
|
| 4731 |
+
|
| 4732 |
+
case "type_paypal_select":{
|
| 4733 |
+
|
| 4734 |
+
$form_maker_front_end .=
|
| 4735 |
+
"if(document.getElementById('".$label_id[$key]."_element".$id."')){
|
| 4736 |
+
document.getElementById('".$label_id[$key]."_element".$id."').value='".addslashes(isset($_POST[$label_id[$key]."_element".$id]) ? esc_html(stripslashes($_POST[$label_id[$key]."_element".$id])) : "")."';
|
| 4737 |
+
|
| 4738 |
+
if(document.getElementById('".$label_id[$key]."_element_quantity".$id."'))
|
| 4739 |
+
document.getElementById('".$label_id[$key]."_element_quantity".$id."').value='".((isset($_POST[$label_id[$key]."_element_quantity".$id]) && ((int) $_POST[$label_id[$key]."_element_quantity".$id] >= 1)) ? addslashes($_POST[$label_id[$key]."_element_quantity".$id]) : 1)."';
|
| 4740 |
+
";
|
| 4741 |
+
for($j=0; $j<100; $j++)
|
| 4742 |
+
{
|
| 4743 |
+
$element = isset($_POST[$label_id[$key]."_property".$id.$j]) ? esc_html(stripslashes($_POST[$label_id[$key]."_property".$id.$j])) : NULL;
|
| 4744 |
+
if(isset($element))
|
| 4745 |
+
{
|
| 4746 |
+
$form_maker_front_end .=
|
| 4747 |
+
"document.getElementById('".$label_id[$key]."_property".$id.$j."').value='".addslashes($element)."';
|
| 4748 |
+
";
|
| 4749 |
+
}
|
| 4750 |
+
}
|
| 4751 |
+
$form_maker_front_end .= "
|
| 4752 |
+
}";
|
| 4753 |
+
|
| 4754 |
+
|
| 4755 |
+
break;
|
| 4756 |
+
}
|
| 4757 |
+
case "type_paypal_checkbox":{
|
| 4758 |
+
|
| 4759 |
+
$form_maker_front_end .=
|
| 4760 |
+
"
|
| 4761 |
+
for(k=0; k<30; k++)
|
| 4762 |
+
if(document.getElementById('".$label_id[$key]."_element".$id."'+k))
|
| 4763 |
+
document.getElementById('".$label_id[$key]."_element".$id."'+k).removeAttribute('checked');
|
| 4764 |
+
else break;
|
| 4765 |
+
";
|
| 4766 |
+
for($j=0; $j<100; $j++)
|
| 4767 |
+
{
|
| 4768 |
+
$element = isset($_POST[$label_id[$key]."_element".$id.$j]) ? esc_html(stripslashes($_POST[$label_id[$key]."_element".$id.$j])) : NULL;
|
| 4769 |
+
if(isset($element))
|
| 4770 |
+
{
|
| 4771 |
+
$form_maker_front_end .=
|
| 4772 |
+
"document.getElementById('".$label_id[$key]."_element".$id.$j."').setAttribute('checked', 'checked');
|
| 4773 |
+
";
|
| 4774 |
+
}
|
| 4775 |
+
}
|
| 4776 |
+
|
| 4777 |
+
$form_maker_front_end .=
|
| 4778 |
+
"
|
| 4779 |
+
if(document.getElementById('".$label_id[$key]."_element_quantity".$id."'))
|
| 4780 |
+
document.getElementById('".$label_id[$key]."_element_quantity".$id."').value='".((isset($_POST[$label_id[$key]."_element_quantity".$id])) ? addslashes($_POST[$label_id[$key]."_element_quantity".$id]) : 1)."';
|
| 4781 |
+
";
|
| 4782 |
+
for($j=0; $j<100; $j++)
|
| 4783 |
+
{
|
| 4784 |
+
$element = isset($_POST[$label_id[$key]."_property".$id.$j]) ? esc_html(stripslashes($_POST[$label_id[$key]."_property".$id.$j])) : NULL;
|
| 4785 |
+
if(isset($element))
|
| 4786 |
+
{
|
| 4787 |
+
$form_maker_front_end .=
|
| 4788 |
+
"document.getElementById('".$label_id[$key]."_property".$id.$j."').value='".addslashes($element)."';
|
| 4789 |
+
";
|
| 4790 |
+
}
|
| 4791 |
+
};
|
| 4792 |
+
break;
|
| 4793 |
+
}
|
| 4794 |
+
case "type_paypal_radio":{
|
| 4795 |
+
|
| 4796 |
+
$form_maker_front_end .=
|
| 4797 |
+
"
|
| 4798 |
+
for(k=0; k<50; k++)
|
| 4799 |
+
if(document.getElementById('".$label_id[$key]."_element".$id."'+k))
|
| 4800 |
+
{
|
| 4801 |
+
document.getElementById('".$label_id[$key]."_element".$id."'+k).removeAttribute('checked');
|
| 4802 |
+
if(document.getElementById('".$label_id[$key]."_element".$id."'+k).value=='".addslashes(isset($_POST[$label_id[$key]."_element".$id]) ? esc_html(stripslashes($_POST[$label_id[$key]."_element".$id])) : "")."')
|
| 4803 |
+
{
|
| 4804 |
+
document.getElementById('".$label_id[$key]."_element".$id."'+k).setAttribute('checked', 'checked');
|
| 4805 |
+
|
| 4806 |
+
}
|
| 4807 |
+
}
|
| 4808 |
+
|
| 4809 |
+
|
| 4810 |
+
if(document.getElementById('".$label_id[$key]."_element_quantity".$id."'))
|
| 4811 |
+
document.getElementById('".$label_id[$key]."_element_quantity".$id."').value='".((isset($_POST[$label_id[$key]."_element_quantity".$id])) ? esc_html(stripslashes($_POST[$label_id[$key]."_element_quantity".$id])) : 1)."';
|
| 4812 |
+
";
|
| 4813 |
+
for($j=0; $j<100; $j++)
|
| 4814 |
+
{
|
| 4815 |
+
$element = isset($_POST[$label_id[$key]."_property".$id.$j]) ? esc_html(stripslashes($_POST[$label_id[$key]."_property".$id.$j])) : NULL;
|
| 4816 |
+
if(isset($element))
|
| 4817 |
+
{
|
| 4818 |
+
$form_maker_front_end .=
|
| 4819 |
+
"document.getElementById('".$label_id[$key]."_property".$id.$j."').value='".addslashes($element)."';
|
| 4820 |
+
";
|
| 4821 |
+
}
|
| 4822 |
+
};
|
| 4823 |
+
|
| 4824 |
+
|
| 4825 |
+
|
| 4826 |
+
break;
|
| 4827 |
+
}
|
| 4828 |
+
|
| 4829 |
+
case "type_paypal_shipping":{
|
| 4830 |
+
|
| 4831 |
+
$form_maker_front_end .=
|
| 4832 |
+
"
|
| 4833 |
+
for(k=0; k<50; k++)
|
| 4834 |
+
if(document.getElementById('".$label_id[$key]."_element".$id."'+k))
|
| 4835 |
+
{
|
| 4836 |
+
document.getElementById('".$label_id[$key]."_element".$id."'+k).removeAttribute('checked');
|
| 4837 |
+
if(document.getElementById('".$label_id[$key]."_element".$id."'+k).value=='".addslashes(isset($_POST[$label_id[$key]."_element".$id]) ? esc_html(stripslashes($_POST[$label_id[$key]."_element".$id])) : "")."')
|
| 4838 |
+
{
|
| 4839 |
+
document.getElementById('".$label_id[$key]."_element".$id."'+k).setAttribute('checked', 'checked');
|
| 4840 |
+
|
| 4841 |
+
}
|
| 4842 |
+
}
|
| 4843 |
+
|
| 4844 |
+
";
|
| 4845 |
+
|
| 4846 |
+
break;
|
| 4847 |
+
}
|
| 4848 |
+
case "type_star_rating": {
|
| 4849 |
+
$form_maker_front_end .=
|
| 4850 |
+
"if(document.getElementById('".$label_id[$key]."_element".$id."')) {
|
| 4851 |
+
document.getElementById('".$label_id[$key]."_selected_star_amount".$id."').value='".addslashes(isset($_POST[$label_id[$key]."_selected_star_amount".$id]) ? esc_html(stripslashes($_POST[$label_id[$key]."_selected_star_amount".$id])) : "")."';
|
| 4852 |
+
if (document.getElementById('".$label_id[$key]."_selected_star_amount".$id."').value)
|
| 4853 |
+
select_star_rating((document.getElementById('".$label_id[$key]."_selected_star_amount".$id."').value-1),".$label_id[$key].",".$id.");
|
| 4854 |
+
}";
|
| 4855 |
+
break;
|
| 4856 |
+
|
| 4857 |
+
}
|
| 4858 |
+
|
| 4859 |
+
case "type_scale_rating": {
|
| 4860 |
+
$form_maker_front_end .=
|
| 4861 |
+
"for (k=0; k<100; k++) {
|
| 4862 |
+
if (document.getElementById('".$label_id[$key]."_scale_radio".$id."_'+k)) {
|
| 4863 |
+
document.getElementById('".$label_id[$key]."_scale_radio".$id."_'+k).removeAttribute('checked');
|
| 4864 |
+
if (document.getElementById('".$label_id[$key]."_scale_radio".$id."_'+k).value=='".(isset($_POST[$label_id[$key]."_scale_radio".$id]) ? esc_html(stripslashes($_POST[$label_id[$key]."_scale_radio".$id])) : "")."')
|
| 4865 |
+
document.getElementById('".$label_id[$key]."_scale_radio".$id."_'+k).setAttribute('checked', 'checked');
|
| 4866 |
+
}
|
| 4867 |
+
}";
|
| 4868 |
+
break;
|
| 4869 |
+
|
| 4870 |
+
}
|
| 4871 |
+
case "type_spinner": {
|
| 4872 |
+
$form_maker_front_end .=
|
| 4873 |
+
"if (document.getElementById('".$label_id[$key]."_element".$id."')) {
|
| 4874 |
+
document.getElementById('".$label_id[$key]."_element".$id."').setAttribute('aria-valuenow','".(isset($_POST[$label_id[$key]."_element".$id]) ? esc_html(stripslashes($_POST[$label_id[$key]."_element".$id])) : "")."');
|
| 4875 |
+
}";
|
| 4876 |
+
break;
|
| 4877 |
+
|
| 4878 |
+
}
|
| 4879 |
+
case "type_slider": {
|
| 4880 |
+
$form_maker_front_end .=
|
| 4881 |
+
"if (document.getElementById('".$label_id[$key]."_element".$id."'))
|
| 4882 |
+
document.getElementById('".$label_id[$key]."_element".$id."').setAttribute('aria-valuenow','".(isset($_POST[$label_id[$key]."_slider_value".$id]) ? esc_html(stripslashes($_POST[$label_id[$key]."_slider_value".$id])) : "")."');
|
| 4883 |
+
if (document.getElementById('".$label_id[$key]."_slider_value".$id."'))
|
| 4884 |
+
document.getElementById('".$label_id[$key]."_slider_value".$id."').value='".(isset($_POST[$label_id[$key]."_slider_value".$id]) ? esc_html(stripslashes($_POST[$label_id[$key]."_slider_value".$id])) : "")."';
|
| 4885 |
+
if (document.getElementById('".$label_id[$key]."_element_value".$id."'))
|
| 4886 |
+
document.getElementById('".$label_id[$key]."_element_value".$id."').innerHTML='".(isset($_POST[$label_id[$key]."_slider_value".$id]) ? esc_html(stripslashes($_POST[$label_id[$key]."_slider_value".$id])) : "")."';";
|
| 4887 |
+
break;
|
| 4888 |
+
|
| 4889 |
+
}
|
| 4890 |
+
case "type_range": {
|
| 4891 |
+
$form_maker_front_end .=
|
| 4892 |
+
"if (document.getElementById('".$label_id[$key]."_element".$id."0'))
|
| 4893 |
+
document.getElementById('".$label_id[$key]."_element".$id."0').setAttribute('aria-valuenow','".(isset($_POST[$label_id[$key]."_element".$id."0"]) ? esc_html(stripslashes($_POST[$label_id[$key]."_element".$id."0"])) : "")."');
|
| 4894 |
+
if (document.getElementById('".$label_id[$key]."_element".$id."1'))
|
| 4895 |
+
document.getElementById('".$label_id[$key]."_element".$id."1').setAttribute('aria-valuenow','".(isset($_POST[$label_id[$key]."_element".$id."1"]) ? esc_html(stripslashes($_POST[$label_id[$key]."_element".$id."1"])) : "")."');";
|
| 4896 |
+
break;
|
| 4897 |
+
|
| 4898 |
+
}
|
| 4899 |
+
case "type_grading": {
|
| 4900 |
+
for ($k = 0; $k < 100; $k++) {
|
| 4901 |
+
$form_maker_front_end .= "if (document.getElementById('".$label_id[$key]."_element".$id.$k."')) {
|
| 4902 |
+
document.getElementById('".$label_id[$key]."_element".$id.$k."').value='".(isset($_POST[$label_id[$key]."_element".$id.$k]) ? esc_html(stripslashes($_POST[$label_id[$key]."_element".$id.$k])) : "")."';}";
|
| 4903 |
+
}
|
| 4904 |
+
$form_maker_front_end .= "sum_grading_values(".$label_id[$key].",".$id.");";
|
| 4905 |
+
break;
|
| 4906 |
+
|
| 4907 |
+
}
|
| 4908 |
+
case "type_matrix": {
|
| 4909 |
+
$form_maker_front_end .=
|
| 4910 |
+
"if (document.getElementById('".$label_id[$key]."_input_type".$id."').value == 'radio') {";
|
| 4911 |
+
for ($k = 1; $k < 40; $k++) {
|
| 4912 |
+
for ($l = 1; $l < 40; $l++) {
|
| 4913 |
+
$form_maker_front_end .=
|
| 4914 |
+
"if (document.getElementById('".$label_id[$key]."_input_element".$id.$k."_".$l."')) {
|
| 4915 |
+
document.getElementById('".$label_id[$key]."_input_element".$id.$k."_".$l."').removeAttribute('checked');
|
| 4916 |
+
if (document.getElementById('".$label_id[$key]."_input_element".$id.$k."_".$l."').value=='".(isset($_POST[$label_id[$key]."_input_element".$id.$k]) ? esc_html(stripslashes($_POST[$label_id[$key]."_input_element".$id.$k])) : "")."')
|
| 4917 |
+
document.getElementById('".$label_id[$key]."_input_element".$id.$k."_".$l."').setAttribute('checked', 'checked');
|
| 4918 |
+
}";
|
| 4919 |
+
}
|
| 4920 |
+
}
|
| 4921 |
+
$form_maker_front_end .=
|
| 4922 |
+
"}
|
| 4923 |
+
else
|
| 4924 |
+
if (document.getElementById('".$label_id[$key]."_input_type".$id."').value == 'checkbox') {";
|
| 4925 |
+
for ($k = 1; $k < 40; $k++) {
|
| 4926 |
+
for ($l = 1; $l < 40; $l++) {
|
| 4927 |
+
$form_maker_front_end .=
|
| 4928 |
+
"if (document.getElementById('".$label_id[$key]."_input_element".$id.$k."_".$l."')) {
|
| 4929 |
+
document.getElementById('".$label_id[$key]."_input_element".$id.$k."_".$l."').removeAttribute('checked');
|
| 4930 |
+
if (document.getElementById('".$label_id[$key]."_input_element".$id.$k."_".$l."').value=='".(isset($_POST[$label_id[$key]."_input_element".$id.$k."_".$l]) ? esc_html(stripslashes($_POST[$label_id[$key]."_input_element".$id.$k."_".$l])) : "")."')
|
| 4931 |
+
document.getElementById('".$label_id[$key]."_input_element".$id.$k."_".$l."').setAttribute('checked', 'checked');
|
| 4932 |
+
}";
|
| 4933 |
+
}
|
| 4934 |
+
}
|
| 4935 |
+
$form_maker_front_end .=
|
| 4936 |
+
"}
|
| 4937 |
+
else
|
| 4938 |
+
if (document.getElementById('".$label_id[$key]."_input_type".$id."').value == 'text') {";
|
| 4939 |
+
for ($k = 1; $k < 40; $k++) {
|
| 4940 |
+
for ($l = 1; $l < 40; $l++) {
|
| 4941 |
+
$form_maker_front_end .=
|
| 4942 |
+
"if (document.getElementById('".$label_id[$key]."_input_element".$id.$k."_".$l."'))
|
| 4943 |
+
document.getElementById('".$label_id[$key]."_input_element".$id.$k."_".$l."').value='".(isset($_POST[$label_id[$key]."_input_element".$id.$k."_".$l]) ? esc_html(stripslashes($_POST[$label_id[$key]."_input_element".$id.$k."_".$l])) : "")."';";
|
| 4944 |
+
}
|
| 4945 |
+
}
|
| 4946 |
+
$form_maker_front_end .= "
|
| 4947 |
+
}
|
| 4948 |
+
else
|
| 4949 |
+
if (document.getElementById('".$label_id[$key]."_input_type".$id."').value == 'select') {";
|
| 4950 |
+
for ($k = 1; $k < 40; $k++) {
|
| 4951 |
+
for ($l = 1; $l < 40; $l++) {
|
| 4952 |
+
$form_maker_front_end .=
|
| 4953 |
+
"if (document.getElementById('".$label_id[$key]."_select_yes_no".$id.$k."_".$l."'))
|
| 4954 |
+
document.getElementById('".$label_id[$key]."_select_yes_no".$id.$k."_".$l."').value='".(isset($_POST[$label_id[$key]."_select_yes_no".$id.$k."_".$l]) ? esc_html(stripslashes($_POST[$label_id[$key]."_select_yes_no".$id.$k."_".$l])) : "")."';";
|
| 4955 |
+
}
|
| 4956 |
+
}
|
| 4957 |
+
$form_maker_front_end .=
|
| 4958 |
+
"}";
|
| 4959 |
+
break;
|
| 4960 |
+
|
| 4961 |
+
}
|
| 4962 |
+
case "type_address":
|
| 4963 |
+
{
|
| 4964 |
+
if ($key > $old_key) {
|
| 4965 |
+
$form_maker_front_end .= "if(document.getElementById('" . $label_id[$key] . "_street1" . $id . "'))
|
| 4966 |
+
{
|
| 4967 |
+
document.getElementById('" . $label_id[$key] . "_street1" . $id . "').value='" . addslashes(isset($_POST[$label_id[$key] . "_street1" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_street1" . $id])) : "") . "';
|
| 4968 |
+
document.getElementById('" . $label_id[$key] . "_street2" . $id . "').value='" . addslashes(isset($_POST[$label_id[$key + 1] . "_street2" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key + 1] . "_street2" . $id])) : "") . "';
|
| 4969 |
+
document.getElementById('" . $label_id[$key] . "_city" . $id . "').value='" . addslashes(isset($_POST[$label_id[$key + 2] . "_city" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key + 2] . "_city" . $id])) : "") . "';
|
| 4970 |
+
document.getElementById('" . $label_id[$key] . "_state" . $id . "').value='" . addslashes(isset($_POST[$label_id[$key + 3] . "_state" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key + 3] . "_state" . $id])) : "") . "';
|
| 4971 |
+
document.getElementById('" . $label_id[$key] . "_postal" . $id . "').value='" . addslashes(isset($_POST[$label_id[$key + 4] . "_postal" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key + 4] . "_postal" . $id])) : "") . "';
|
| 4972 |
+
document.getElementById('" . $label_id[$key] . "_country" . $id . "').value='" . addslashes(isset($_POST[$label_id[$key + 5] . "_country" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key + 5] . "_country" . $id])) : "") . "';
|
| 4973 |
+
|
| 4974 |
+
}";
|
| 4975 |
+
$old_key = $key + 5;
|
| 4976 |
+
}
|
| 4977 |
+
break;
|
| 4978 |
+
}
|
| 4979 |
+
case "type_checkbox":
|
| 4980 |
+
{
|
| 4981 |
+
$is_other = FALSE;
|
| 4982 |
+
if (isset($_POST[$label_id[$key] . "_allow_other" . $id]) && esc_html(stripslashes($_POST[$label_id[$key] . "_allow_other" . $id])) == "yes") {
|
| 4983 |
+
$other_element = isset($_POST[$label_id[$key] . "_other_input" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_other_input" . $id])) : "";
|
| 4984 |
+
$other_element_id = isset($_POST[$label_id[$key] . "_allow_other_num" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_allow_other_num" . $id])) : NULL;
|
| 4985 |
+
if (isset($_POST[$label_id[$key] . "_allow_other_num" . $id]))
|
| 4986 |
+
$is_other = TRUE;
|
| 4987 |
+
}
|
| 4988 |
+
$form_maker_front_end .= "
|
| 4989 |
+
if(document.getElementById('" . $label_id[$key] . "_other_input" . $id . "'))
|
| 4990 |
+
{
|
| 4991 |
+
document.getElementById('" . $label_id[$key] . "_other_input" . $id . "').parentNode.removeChild(document.getElementById('" . $label_id[$key] . "_other_br" . $id . "'));
|
| 4992 |
+
document.getElementById('" . $label_id[$key] . "_other_input" . $id . "').parentNode.removeChild(document.getElementById('" . $label_id[$key] . "_other_input" . $id . "'));
|
| 4993 |
+
}
|
| 4994 |
+
for(k=0; k<30; k++)
|
| 4995 |
+
if(document.getElementById('" . $label_id[$key] . "_element" . $id . "'+k))
|
| 4996 |
+
document.getElementById('" . $label_id[$key] . "_element" . $id . "'+k).removeAttribute('checked');
|
| 4997 |
+
else break;
|
| 4998 |
+
";
|
| 4999 |
+
for ($j = 0; $j < 100; $j++) {
|
| 5000 |
+
$element = isset($_POST[$label_id[$key] . "_element" . $id . $j]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element" . $id . $j])) : NULL;
|
| 5001 |
+
if (isset($_POST[$label_id[$key] . "_element" . $id . $j])) {
|
| 5002 |
+
$form_maker_front_end .= "document.getElementById('" . $label_id[$key] . "_element" . $id . $j . "').setAttribute('checked', 'checked');
|
| 5003 |
+
";
|
| 5004 |
+
}
|
| 5005 |
+
}
|
| 5006 |
+
if ($is_other)
|
| 5007 |
+
$form_maker_front_end .= "
|
| 5008 |
+
show_other_input('" . $label_id[$key] . "','" . $id . "');
|
| 5009 |
+
document.getElementById('" . $label_id[$key] . "_other_input" . $id . "').value='" . (isset($_POST[$label_id[$key] . "_other_input" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_other_input" . $id])) : "") . "';
|
| 5010 |
+
";
|
| 5011 |
+
break;
|
| 5012 |
+
}
|
| 5013 |
+
case "type_radio":
|
| 5014 |
+
{
|
| 5015 |
+
$is_other = FALSE;
|
| 5016 |
+
if (isset($_POST[$label_id[$key] . "_allow_other" . $id]) && esc_html(stripslashes($_POST[$label_id[$key] . "_allow_other" . $id])) == "yes") {
|
| 5017 |
+
$other_element = isset($_POST[$label_id[$key] . "_other_input" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_other_input" . $id])) : "";
|
| 5018 |
+
if (isset($_POST[$label_id[$key] . "_other_input" . $id]))
|
| 5019 |
+
$is_other = TRUE;
|
| 5020 |
+
}
|
| 5021 |
+
$form_maker_front_end .= "
|
| 5022 |
+
if(document.getElementById('" . $label_id[$key] . "_other_input" . $id . "'))
|
| 5023 |
+
{
|
| 5024 |
+
document.getElementById('" . $label_id[$key] . "_other_input" . $id . "').parentNode.removeChild(document.getElementById('" . $label_id[$key] . "_other_br" . $id . "'));
|
| 5025 |
+
document.getElementById('" . $label_id[$key] . "_other_input" . $id . "').parentNode.removeChild(document.getElementById('" . $label_id[$key] . "_other_input" . $id . "'));
|
| 5026 |
+
}
|
| 5027 |
+
|
| 5028 |
+
for(k=0; k<50; k++)
|
| 5029 |
+
if(document.getElementById('" . $label_id[$key] . "_element" . $id . "'+k))
|
| 5030 |
+
{
|
| 5031 |
+
document.getElementById('" . $label_id[$key] . "_element" . $id . "'+k).removeAttribute('checked');
|
| 5032 |
+
if(document.getElementById('" . $label_id[$key] . "_element" . $id . "'+k).value=='" . addslashes(isset($_POST[$label_id[$key] . "_element" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element" . $id])) : "") . "')
|
| 5033 |
+
{
|
| 5034 |
+
document.getElementById('" . $label_id[$key] . "_element" . $id . "'+k).setAttribute('checked', 'checked');
|
| 5035 |
+
|
| 5036 |
+
}
|
| 5037 |
+
}
|
| 5038 |
+
else break;
|
| 5039 |
+
";
|
| 5040 |
+
if ($is_other)
|
| 5041 |
+
$form_maker_front_end .= "
|
| 5042 |
+
show_other_input('" . $label_id[$key] . "','" . $id . "');
|
| 5043 |
+
document.getElementById('" . $label_id[$key] . "_other_input" . $id . "').value='" . (isset($_POST[$label_id[$key] . "_other_input" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_other_input" . $id])) : "") . "';
|
| 5044 |
+
";
|
| 5045 |
+
break;
|
| 5046 |
+
}
|
| 5047 |
+
case "type_time":
|
| 5048 |
+
{
|
| 5049 |
+
$ss = isset($_POST[$label_id[$key] . "_ss" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_ss" . $id])) : "";
|
| 5050 |
+
if (isset($_POST[$label_id[$key] . "_ss" . $id])) {
|
| 5051 |
+
$form_maker_front_end .= "if(document.getElementById('" . $label_id[$key] . "_hh" . $id . "'))
|
| 5052 |
+
{
|
| 5053 |
+
document.getElementById('" . $label_id[$key] . "_hh" . $id . "').value='" . (isset($_POST[$label_id[$key] . "_hh" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_hh" . $id])) : "") . "';
|
| 5054 |
+
document.getElementById('" . $label_id[$key] . "_mm" . $id . "').value='" . (isset($_POST[$label_id[$key] . "_mm" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_mm" . $id])) : "") . "';
|
| 5055 |
+
document.getElementById('" . $label_id[$key] . "_ss" . $id . "').value='" . (isset($_POST[$label_id[$key] . "_ss" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_ss" . $id])) : "") . "';
|
| 5056 |
+
}";
|
| 5057 |
+
}
|
| 5058 |
+
else {
|
| 5059 |
+
$form_maker_front_end .= "if(document.getElementById('" . $label_id[$key] . "_hh" . $id . "'))
|
| 5060 |
+
{
|
| 5061 |
+
document.getElementById('" . $label_id[$key] . "_hh" . $id . "').value='" . (isset($_POST[$label_id[$key] . "_hh" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_hh" . $id])) : "") . "';
|
| 5062 |
+
document.getElementById('" . $label_id[$key] . "_mm" . $id . "').value='" . (isset($_POST[$label_id[$key] . "_mm" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_mm" . $id])) : "") . "';
|
| 5063 |
+
}";
|
| 5064 |
+
}
|
| 5065 |
+
$am_pm = isset($_POST[$label_id[$key] . "_am_pm" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_am_pm" . $id])) : NULL;
|
| 5066 |
+
if (isset($am_pm))
|
| 5067 |
+
$form_maker_front_end .= "if(document.getElementById('" . $label_id[$key] . "_am_pm" . $id . "'))
|
| 5068 |
+
document.getElementById('" . $label_id[$key] . "_am_pm" . $id . "').value='" . $am_pm . "';
|
| 5069 |
+
";
|
| 5070 |
+
break;
|
| 5071 |
+
}
|
| 5072 |
+
case "type_date_fields":
|
| 5073 |
+
{
|
| 5074 |
+
$form_maker_front_end .= "if(document.getElementById('" . $label_id[$key] . "_day" . $id . "'))
|
| 5075 |
+
{
|
| 5076 |
+
document.getElementById('" . $label_id[$key] . "_day" . $id . "').value='" . (isset($_POST[$label_id[$key] . "_day" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_day" . $id])) : "") . "';
|
| 5077 |
+
document.getElementById('" . $label_id[$key] . "_month" . $id . "').value='" . (isset($_POST[$label_id[$key] . "_month" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_month" . $id])) : "") . "';
|
| 5078 |
+
document.getElementById('" . $label_id[$key] . "_year" . $id . "').value='" . (isset($_POST[$label_id[$key] . "_year" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_year" . $id])) : "") . "';
|
| 5079 |
+
}";
|
| 5080 |
+
break;
|
| 5081 |
+
}
|
| 5082 |
+
case "type_date":
|
| 5083 |
+
case "type_own_select":
|
| 5084 |
+
case "type_country":
|
| 5085 |
+
{
|
| 5086 |
+
$form_maker_front_end .= "if(document.getElementById('" . $label_id[$key] . "_element" . $id . "'))
|
| 5087 |
+
document.getElementById('" . $label_id[$key] . "_element" . $id . "').value='" . addslashes(isset($_POST[$label_id[$key] . "_element" . $id]) ? esc_html(stripslashes($_POST[$label_id[$key] . "_element" . $id])) : "") . "';
|
| 5088 |
+
";
|
| 5089 |
+
break;
|
| 5090 |
+
}
|
| 5091 |
+
default:
|
| 5092 |
+
{
|
| 5093 |
+
break;
|
| 5094 |
+
}
|
| 5095 |
+
}
|
| 5096 |
+
}
|
| 5097 |
+
}
|
| 5098 |
+
$form_maker_front_end .= ' form_view_count' . $id . '=0;
|
| 5099 |
+
for(i=1; i<=30; i++)
|
| 5100 |
+
{
|
| 5101 |
+
if(document.getElementById(\'' . $id . 'form_view\'+i))
|
| 5102 |
+
{
|
| 5103 |
+
form_view_count' . $id . '++;
|
| 5104 |
+
form_view_max' . $id . '=i;
|
| 5105 |
+
document.getElementById(\'' . $id . 'form_view\'+i).parentNode.removeAttribute(\'style\');
|
| 5106 |
+
}
|
| 5107 |
+
}
|
| 5108 |
+
if(form_view_count' . $id . '>1)
|
| 5109 |
+
{
|
| 5110 |
+
for(i=1; i<=form_view_max' . $id . '; i++)
|
| 5111 |
+
{
|
| 5112 |
+
if(document.getElementById(\'' . $id . 'form_view\'+i))
|
| 5113 |
+
{
|
| 5114 |
+
first_form_view' . $id . '=i;
|
| 5115 |
+
break;
|
| 5116 |
+
}
|
| 5117 |
+
}
|
| 5118 |
+
generate_page_nav(first_form_view' . $id . ', \'' . $id . '\', form_view_count' . $id . ', form_view_max' . $id . ');
|
| 5119 |
+
}
|
| 5120 |
+
var RecaptchaOptions = {
|
| 5121 |
+
theme: "' . $row->recaptcha_theme . '"
|
| 5122 |
+
};
|
| 5123 |
+
</script>
|
| 5124 |
+
</form>';
|
| 5125 |
+
if ($is_recaptcha) {
|
| 5126 |
+
$form_maker_front_end .= '<div id="main_recaptcha" style="display:none;">';
|
| 5127 |
+
if ($row->public_key)
|
| 5128 |
+
$publickey = $row->public_key;
|
| 5129 |
+
else
|
| 5130 |
+
$publickey = '0';
|
| 5131 |
+
$error = NULL;
|
| 5132 |
+
require_once(WD_FMC_DIR . '/recaptchalib.php');
|
| 5133 |
+
$form_maker_front_end .= recaptcha_get_html($publickey, $error);
|
| 5134 |
+
$form_maker_front_end .= '</div>
|
| 5135 |
+
<script>
|
| 5136 |
+
recaptcha_html = document.getElementById(\'main_recaptcha\').innerHTML.replace(\'Recaptcha.widget = Recaptcha.$("recaptcha_widget_div"); Recaptcha.challenge_callback();\',"");
|
| 5137 |
+
document.getElementById(\'main_recaptcha\').innerHTML="";
|
| 5138 |
+
if (document.getElementById(\'wd_recaptcha' . $id . '\')) {
|
| 5139 |
+
document.getElementById(\'wd_recaptcha' . $id . '\').innerHTML=recaptcha_html;
|
| 5140 |
+
Recaptcha.widget = Recaptcha.$("recaptcha_widget_div");
|
| 5141 |
+
Recaptcha.challenge_callback();
|
| 5142 |
+
}
|
| 5143 |
+
</script>';
|
| 5144 |
+
}
|
| 5145 |
+
}
|
| 5146 |
+
return $form_maker_front_end;
|
| 5147 |
+
}
|
| 5148 |
+
|
| 5149 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5150 |
+
// Getters & Setters //
|
| 5151 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5152 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5153 |
+
// Private Methods //
|
| 5154 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5155 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5156 |
+
// Listeners //
|
| 5157 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
| 5158 |
}
|
readme.txt
CHANGED
|
@@ -4,7 +4,7 @@ Donate link: http://web-dorado.com/products/wordpress-contact-form-maker-plugin.
|
|
| 4 |
Tags: captcha, contact, contact form, contact forms, custom form, email, feedback, form, form builder, form manager, forms, survey
|
| 5 |
Requires at least: 3.4
|
| 6 |
Tested up to: 4.7
|
| 7 |
-
Stable tag: 1.8.
|
| 8 |
License: GPLv2 or later
|
| 9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
| 10 |
|
|
@@ -146,6 +146,12 @@ If you want to update the plugin while preserving your existing contact forms, y
|
|
| 146 |
|
| 147 |
== Changelog ==
|
| 148 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 149 |
= 1.8.39 =
|
| 150 |
* Fixed: Bug with Hidden field in custom text in Email
|
| 151 |
* Fixed: Bug on email verification custom post
|
| 4 |
Tags: captcha, contact, contact form, contact forms, custom form, email, feedback, form, form builder, form manager, forms, survey
|
| 5 |
Requires at least: 3.4
|
| 6 |
Tested up to: 4.7
|
| 7 |
+
Stable tag: 1.8.40
|
| 8 |
License: GPLv2 or later
|
| 9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
| 10 |
|
| 146 |
|
| 147 |
== Changelog ==
|
| 148 |
|
| 149 |
+
= 1.8.40 =
|
| 150 |
+
* Fixed: bug on "Save as Copy"
|
| 151 |
+
* Fixed: Line breaks in textarea after incorrect captcha
|
| 152 |
+
* Changed: Submissions page: display labels on buttons
|
| 153 |
+
* Changed: When the Pro version is installed, display a notification about automatically disabling Free version
|
| 154 |
+
|
| 155 |
= 1.8.39 =
|
| 156 |
* Fixed: Bug with Hidden field in custom text in Email
|
| 157 |
* Fixed: Bug on email verification custom post
|
