Form Maker by WD – user-friendly drag & drop Form Builder plugin - Version 1.7.35

Version Description

New: Email empty fields option

Download this release

Release Info

Developer webdorado
Plugin Icon 128x128 Form Maker by WD – user-friendly drag & drop Form Builder plugin
Version 1.7.35
Comparing to
See all releases

Code changes from version 1.7.34 to 1.7.35

admin/controllers/FMControllerManage_fm.php CHANGED
@@ -358,7 +358,8 @@ function before_reset() {
358
  $user_id_wd = (isset($_POST['user_id_wd']) ? stripslashes($_POST['user_id_wd']) : 'administrator,');
359
  $frontend_submit_fields = (isset($_POST['frontend_submit_fields']) ? stripslashes($_POST['frontend_submit_fields']) : '');
360
  $frontend_submit_stat_fields = (isset($_POST['frontend_submit_stat_fields']) ? stripslashes($_POST['frontend_submit_stat_fields']) : '');
361
- $send_to = '';
 
362
  for ($i = 0; $i < 20; $i++) {
363
  if (isset($_POST['send_to' . $i])) {
364
  $send_to .= '*' . esc_html(stripslashes($_POST['send_to' . $i])) . '*';
@@ -417,6 +418,7 @@ function before_reset() {
417
  'send_to' => $send_to,
418
  'frontend_submit_fields' => $frontend_submit_fields,
419
  'frontend_submit_stat_fields' => $frontend_submit_stat_fields,
 
420
  ), array('id' => $id));
421
  if ($save !== FALSE) {
422
  return 8;
358
  $user_id_wd = (isset($_POST['user_id_wd']) ? stripslashes($_POST['user_id_wd']) : 'administrator,');
359
  $frontend_submit_fields = (isset($_POST['frontend_submit_fields']) ? stripslashes($_POST['frontend_submit_fields']) : '');
360
  $frontend_submit_stat_fields = (isset($_POST['frontend_submit_stat_fields']) ? stripslashes($_POST['frontend_submit_stat_fields']) : '');
361
+ $mail_emptyfields = (isset($_POST['mail_emptyfields']) ? esc_html(stripslashes($_POST['mail_emptyfields'])) : 0);
362
+ $send_to = '';
363
  for ($i = 0; $i < 20; $i++) {
364
  if (isset($_POST['send_to' . $i])) {
365
  $send_to .= '*' . esc_html(stripslashes($_POST['send_to' . $i])) . '*';
418
  'send_to' => $send_to,
419
  'frontend_submit_fields' => $frontend_submit_fields,
420
  'frontend_submit_stat_fields' => $frontend_submit_stat_fields,
421
+ 'mail_emptyfields' => $mail_emptyfields,
422
  ), array('id' => $id));
423
  if ($save !== FALSE) {
424
  return 8;
admin/views/FMViewManage_fm.php CHANGED
@@ -3238,6 +3238,15 @@ class FMViewManage_fm {
3238
  <input type="radio" disabled="disabled" name="mail_attachment" id="dis_attach" value="0" <?php if($row->mail_attachment==0 ) echo "checked" ?> /> <label for="dis_attach">No</label>
3239
  <div class="error" style="padding: 5px; font-size: 14px;">File attach is disabled in free version.</div>
3240
  </td>
 
 
 
 
 
 
 
 
 
3241
  </tr>
3242
  <tr>
3243
  <td class="fm_options_label" valign="top">
3238
  <input type="radio" disabled="disabled" name="mail_attachment" id="dis_attach" value="0" <?php if($row->mail_attachment==0 ) echo "checked" ?> /> <label for="dis_attach">No</label>
3239
  <div class="error" style="padding: 5px; font-size: 14px;">File attach is disabled in free version.</div>
3240
  </td>
3241
+ </tr>
3242
+ <tr valign="top">
3243
+ <td class="fm_options_label" style="vertical-align: middle;">
3244
+ <label> Email empty fields: </label>
3245
+ </td>
3246
+ <td class="fm_options_value">
3247
+ <input type="radio" name="mail_emptyfields" value="1" id="en_mail_emptyfields" <?php if($row->mail_emptyfields==1 ) echo "checked" ?> /> <label for="en_mail_emptyfields">Yes</label>
3248
+ <input type="radio" name="mail_emptyfields" id="dis_mail_emptyfields" value="0" <?php if($row->mail_emptyfields==0 ) echo "checked" ?> /> <label for="dis_mail_emptyfields">No</label>
3249
+ </td>
3250
  </tr>
3251
  <tr>
3252
  <td class="fm_options_label" valign="top">
form-maker.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Form Maker
4
  * Plugin URI: http://web-dorado.com/products/form-maker-wordpress.html
5
  * Description: This plugin is a modern and advanced tool for easy and fast creating of a WordPress Form. The backend interface is intuitive and user friendly which allows users far from scripting and programming to create WordPress Forms.
6
- * Version: 1.7.34
7
  * Author: WebDorado
8
  * Author URI: http://web-dorado.com/
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
@@ -207,7 +207,7 @@ if (class_exists('WP_Widget')) {
207
  // Activate plugin.
208
  function form_maker_activate() {
209
  $version = get_option("wd_form_maker_version");
210
- $new_version = '1.7.34';
211
  if (!$version) {
212
  add_option("wd_form_maker_version", $new_version, '', 'no');
213
  global $wpdb;
3
  * Plugin Name: Form Maker
4
  * Plugin URI: http://web-dorado.com/products/form-maker-wordpress.html
5
  * Description: This plugin is a modern and advanced tool for easy and fast creating of a WordPress Form. The backend interface is intuitive and user friendly which allows users far from scripting and programming to create WordPress Forms.
6
+ * Version: 1.7.35
7
  * Author: WebDorado
8
  * Author URI: http://web-dorado.com/
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
207
  // Activate plugin.
208
  function form_maker_activate() {
209
  $version = get_option("wd_form_maker_version");
210
+ $new_version = '1.7.35';
211
  if (!$version) {
212
  add_option("wd_form_maker_version", $new_version, '', 'no');
213
  global $wpdb;
form_maker_insert.php CHANGED
@@ -58,6 +58,7 @@ function from_maker_insert() {
58
  `sortable` int(11) NOT NULL,
59
  `frontend_submit_fields` text NOT NULL,
60
  `frontend_submit_stat_fields` text NOT NULL,
 
61
  PRIMARY KEY (`id`)
62
  ) DEFAULT CHARSET=utf8;";
63
  $wpdb->query($formmaker);
@@ -184,15 +185,15 @@ function install_demo_forms() {
184
  global $wpdb;
185
  $form_maker_row = $wpdb->get_var("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE `id` NOT IN (" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ")");
186
  if (!$form_maker_row) {
187
- $wpdb->query('INSERT INTO `' . $wpdb->prefix . 'formmaker` VALUES(NULL, \'Contact\', \'\', \'<div class="wdform-page-and-images" style="display:table; border-top:0px solid black;"><div id="form_id_tempform_view1" class="wdform_page" page_title="Untitled page" next_title="Next" next_type="text" next_class="wdform-page-button" next_checkable="false" previous_title="Previous" previous_type="text" previous_class="wdform-page-button" previous_checkable="false"><div class="wdform_section"><div class="wdform_column"><div wdid="1" class="wdform_row">%1 - Name:%</div><div wdid="2" class="wdform_row">%2 - E-mail:%</div><div wdid="3" class="wdform_row">%3 - Subject:%</div><div wdid="4" class="wdform_row">%4 - Message:%</div><div wdid="5" class="wdform_row">%5 - type_submit_reset_5%</div></div></div><div valign="top" class="wdform_footer" style="width: 100%;"><div style="width: 100%;"><div style="width: 100%; display: table;"><div style="display: table-row-group;"><div id="form_id_temppage_nav1" style="display: table-row;"></div></div></div></div></div></div></div>\', 1, \'// Occurs before the form is loaded\r\nfunction before_load()\r\n{\r\n\r\n}\r\n\r\n// Occurs just before submitting the form\r\nfunction before_submit()\r\n{\r\n\r\n}\r\n\r\n// Occurs just before resetting the form\r\nfunction before_reset()\r\n{\r\n\r\n}\', \'\', \'\', 0, \'%all%\', \'%all%\', 6, 1, \'1#**id**#Name:#**label**#type_name#****#2#**id**#E-mail:#**label**#type_submitter_mail#****#3#**id**#Subject:#**label**#type_text#****#4#**id**#Message:#**label**#type_textarea#****#5#**id**#type_submit_reset_5#**label**#type_submit_reset#****#\', \'1#**id**#Name:#**label**#type_name#****#2#**id**#E-mail:#**label**#type_submitter_mail#****#3#**id**#Subject:#**label**#type_text#****#4#**id**#Message:#**label**#type_textarea#****#5#**id**#type_submit_reset_5#**label**#type_submit_reset#****#\', 0, \'none\', \'false\', \'true\', \'\', \'\', \'\', 0, \'\', \'\', \'USD\', 0, \'1*:*id*:*type_name*:*type*:*Name:*:*w_field_label*:*70*:*w_field_label_size*:*left*:*w_field_label_pos*:*****:*w_first_val*:*****:*w_title*:*Title***First***Last***Middle*:*w_mini_labels*:*100*:*w_size*:*normal*:*w_name_format*:*yes*:*w_required*:*no*:*w_unique*:**:*w_class*:**:*new_field*:*2*:*id*:*type_submitter_mail*:*type*:*E-mail:*:*w_field_label*:*70*:*w_field_label_size*:*left*:*w_field_label_pos*:*200*:*w_size*:**:*w_first_val*:**:*w_title*:*no*:*w_required*:**:*w_unique*:**:*w_class*:**:*new_field*:*3*:*id*:*type_text*:*type*:*Subject:*:*w_field_label*:*70*:*w_field_label_size*:*left*:*w_field_label_pos*:*200*:*w_size*:**:*w_first_val*:**:*w_title*:*no*:*w_required*:*no*:*w_unique*:**:*new_field*:*4*:*id*:*type_textarea*:*type*:*Message:*:*w_field_label*:*70*:*w_field_label_size*:*left*:*w_field_label_pos*:*200*:*w_size_w*:*100*:*w_size_h*:**:*w_first_val*:**:*w_title*:*no*:*w_required*:*no*:*w_unique*:**:*w_class*:**:*new_field*:*5*:*id*:*type_submit_reset*:*type*:*type_submit_reset_5*:*w_field_label*:*Submit*:*w_submit_title*:*Reset*:*w_reset_title*:**:*w_class*:*true*:*w_act*:**:*new_field*:*\', 1, 1, \'*\', \'\', \'\', \'\', \'\', 1, \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', 1, 1, 1, 1,\'administrator,\',1,\'\',\'\')');
188
- $wpdb->query('INSERT INTO `' . $wpdb->prefix . 'formmaker` VALUES(NULL, \'Fill Form To Get Admission\', \'\', \'<div class="wdform-page-and-images" style="display:table; border-top:0px solid black;"><div id="form_id_tempform_view1" class="wdform_page" page_title="Untitled page" next_title="Next" next_type="text" next_class="wdform-page-button" next_checkable="false" previous_title="Previous" previous_type="text" previous_class="wdform-page-button" previous_checkable="false"><div class="wdform_section"><div class="wdform_column"><div wdid="1" class="wdform_row">%1 - Name:%</div><div wdid="2" class="wdform_row">%2 - E-mail:%</div><div wdid="4" class="wdform_row">%4 - Phone Number:%</div><div wdid="5" class="wdform_row">%5 - SELECT COLLEGE%</div><div wdid="6" class="wdform_row">%6 - OTHER SPECIFY HERE%</div><div wdid="7" class="wdform_row">%7 - Word Verification:%</div><div wdid="8" class="wdform_row">%8 - type_submit_reset_8%</div></div></div><div valign="top" class="wdform_footer" style="width: 100%;"><div style="width: 100%;"><div style="width: 100%; display: table;"><div style="display: table-row-group;"><div id="form_id_temppage_nav1" style="display: table-row;"></div></div></div></div></div></div></div>\', 8, \'// Occurs before the form is loaded\r\nfunction before_load()\r\n{\r\n\r\n}\r\n\r\n// Occurs just before submitting the form\r\nfunction before_submit()\r\n{\r\n\r\n}\r\n\r\n// Occurs just before resetting the form\r\nfunction before_reset()\r\n{\r\n\r\n}\', \'\', \'\', 0, \'%all%\', \'%all%\', 9, 1, \'1#**id**#Name:#**label**#type_name#****#2#**id**#E-mail:#**label**#type_submitter_mail#****#4#**id**#Phone Number:#**label**#type_number#****#5#**id**#SELECT COLLEGE#**label**#type_own_select#****#6#**id**#OTHER SPECIFY HERE#**label**#type_text#****#7#**id**#Word Verification:#**label**#type_captcha#****#8#**id**#type_submit_reset_8#**label**#type_submit_reset#****#\', \'1#**id**#Name:#**label**#type_name#****#2#**id**#E-mail:#**label**#type_submitter_mail#****#4#**id**#Phone Number:#**label**#type_number#****#5#**id**#SELECT COLLEGE#**label**#type_own_select#****#6#**id**#OTHER SPECIFY HERE#**label**#type_text#****#7#**id**#Word Verification:#**label**#type_captcha#****#8#**id**#type_submit_reset_8#**label**#type_submit_reset#****#\', 0, \'none\', \'false\', \'true\', \'\', \'\', \'\', 0, \'\', \'\', \'USD\', 0, \'1*:*id*:*type_name*:*type*:*Name:*:*w_field_label*:*160*:*w_field_label_size*:*left*:*w_field_label_pos*:***********:*w_first_val*:***********:*w_title*:*Title***First***Last***Middle*:*w_mini_labels*:*100*:*w_size*:*extended*:*w_name_format*:*no*:*w_required*:*no*:*w_unique*:**:*w_class*:**:*new_field*:*2*:*id*:*type_submitter_mail*:*type*:*E-mail:*:*w_field_label*:*160*:*w_field_label_size*:*left*:*w_field_label_pos*:*200*:*w_size*:**:*w_first_val*:**:*w_title*:*yes*:*w_required*:**:*w_unique*:**:*w_class*:**:*new_field*:*4*:*id*:*type_number*:*type*:*Phone Number:*:*w_field_label*:*160*:*w_field_label_size*:*left*:*w_field_label_pos*:*200*:*w_size*:**:*w_first_val*:**:*w_title*:*no*:*w_required*:*no*:*w_unique*:**:*w_class*:**:*new_field*:*5*:*id*:*type_own_select*:*type*:*SELECT COLLEGE*:*w_field_label*:*160*:*w_field_label_size*:*left*:*w_field_label_pos*:*200*:*w_size*:**** GGSCMT,KHARAR*** DOABA KHARAR *** CAMBRIDGE COLLEGE FATEHGARH *** INDOGLOBAL *** QUEST COLLEGE *** UNIVERSAL ,LALRU *** OTHER PLEASE SPECIFY BELOW *:*w_choices*:*true***false***false***false***false***false***false***false*:*w_choices_checked*:*true***false***false***false***false***false***false***false*:*w_choices_disabled*:*yes*:*w_required*:*wdform_select*:*w_class*:**:*new_field*:*6*:*id*:*type_text*:*type*:*OTHER SPECIFY HERE*:*w_field_label*:*160*:*w_field_label_size*:*left*:*w_field_label_pos*:*200*:*w_size*:**:*w_first_val*:**:*w_title*:*no*:*w_required*:*no*:*w_unique*:**:*new_field*:*7*:*id*:*type_captcha*:*type*:*Word Verification:*:*w_field_label*:*160*:*w_field_label_size*:*left*:*w_field_label_pos*:*6*:*w_digit*:**:*w_class*:**:*new_field*:*8*:*id*:*type_submit_reset*:*type*:*type_submit_reset_8*:*w_field_label*:*Submit*:*w_submit_title*:*Reset*:*w_reset_title*:**:*w_class*:*true*:*w_act*:**:*new_field*:*\', 1, 1, \'*\', \'\', \'\', \'\', \'\', 1, \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', 1, 1, 1, 1,\'administrator,\',1,\'\',\'\')');
189
- $wpdb->query('INSERT INTO `' . $wpdb->prefix . 'formmaker` VALUES(NULL, \'Camp Registration Form\', \'\', \'<div class="wdform-page-and-images" style="display:table; border-top:0px solid black;"><div id="form_id_tempform_view1" class="wdform_page" page_title="Untitled page" next_title="Next" next_type="text" next_class="wdform-page-button" next_checkable="false" previous_title="Previous" previous_type="text" previous_class="wdform-page-button" previous_checkable="false"><div class="wdform_section"><div class="wdform_column"><div wdid="1" class="wdform_row">%1 - Camper Name:%</div><div wdid="2" class="wdform_row">%2 - Camper Age Group:%</div><div wdid="3" class="wdform_row">%3 - Desire Cabin:%</div><div wdid="4" class="wdform_row">%4 - Does any one have allergies?%</div><div wdid="5" class="wdform_row">%5 - Has the camper been camping before?%</div><div wdid="6" class="wdform_row">%6 - Any questions or concern:%</div><div wdid="7" class="wdform_row">%7 - type_submit_reset_7%</div></div></div><div valign="top" class="wdform_footer" style="width: 100%;"><div style="width: 100%;"><div style="width: 100%; display: table;"><div style="display: table-row-group;"><div id="form_id_temppage_nav1" style="display: table-row;"></div></div></div></div></div></div></div>\', 15, \'// Occurs before the form is loaded\r\nfunction before_load()\r\n{\r\n\r\n}\r\n\r\n// Occurs just before submitting the form\r\nfunction before_submit()\r\n{\r\n\r\n}\r\n\r\n// Occurs just before resetting the form\r\nfunction before_reset()\r\n{\r\n\r\n}\', \'\', \'\', 0, \'%all%\', \'%all%\', 8, 1, \'1#**id**#Camper Name:#**label**#type_name#****#2#**id**#Camper Age Group:#**label**#type_own_select#****#3#**id**#Desire Cabin:#**label**#type_radio#****#4#**id**#Does any one have allergies?#**label**#type_radio#****#5#**id**#Has the camper been camping before?#**label**#type_radio#****#6#**id**#Any questions or concern:#**label**#type_textarea#****#7#**id**#type_submit_reset_7#**label**#type_submit_reset#****#\', \'1#**id**#Camper Name:#**label**#type_name#****#2#**id**#Camper Age Group:#**label**#type_own_select#****#3#**id**#Desire Cabin:#**label**#type_radio#****#4#**id**#Does any one have allergies?#**label**#type_radio#****#5#**id**#Has the camper been camping before?#**label**#type_radio#****#6#**id**#Any questions or concern:#**label**#type_textarea#****#7#**id**#type_submit_reset_7#**label**#type_submit_reset#****#\', 0, \'none\', \'false\', \'true\', \'\', \'\', \'\', 0, \'\', \'\', \'USD\', 0, \'1*:*id*:*type_name*:*type*:*Camper Name:*:*w_field_label*:*250*:*w_field_label_size*:*left*:*w_field_label_pos*:*****:*w_first_val*:*****:*w_title*:*Title***First***Last***Middle*:*w_mini_labels*:*100*:*w_size*:*normal*:*w_name_format*:*no*:*w_required*:*no*:*w_unique*:**:*w_class*:**:*new_field*:*2*:*id*:*type_own_select*:*type*:*Camper Age Group:*:*w_field_label*:*250*:*w_field_label_size*:*left*:*w_field_label_pos*:*200*:*w_size*:****6-8***8-12***12-15*:*w_choices*:*true***false***false***false*:*w_choices_checked*:*true***false***false***false*:*w_choices_disabled*:*no*:*w_required*:*wdform_select*:*w_class*:**:*new_field*:*3*:*id*:*type_radio*:*type*:*Desire Cabin:*:*w_field_label*:*250*:*w_field_label_size*:*left*:*w_field_label_pos*:*ver*:*w_flow*:*Cabin 1***Cabin 2***Cabin 3***Cabin 4***Cabin 5***Cabin 6***Cabin 7*:*w_choices*:*false***false***false***false***false***false***false*:*w_choices_checked*:*1*:*w_rowcol*:*no*:*w_required*:*no*:*w_randomize*:*no*:*w_allow_other*:*0*:*w_allow_other_num*:**:*w_class*:**:*new_field*:*4*:*id*:*type_radio*:*type*:*Does any one have allergies?*:*w_field_label*:*250*:*w_field_label_size*:*left*:*w_field_label_pos*:*ver*:*w_flow*:*Yes***No*:*w_choices*:*false***false*:*w_choices_checked*:*1*:*w_rowcol*:*no*:*w_required*:*no*:*w_randomize*:*no*:*w_allow_other*:*0*:*w_allow_other_num*:**:*w_class*:**:*new_field*:*5*:*id*:*type_radio*:*type*:*Has the camper been camping before?*:*w_field_label*:*250*:*w_field_label_size*:*left*:*w_field_label_pos*:*ver*:*w_flow*:*Yes***No*:*w_choices*:*false***false*:*w_choices_checked*:*1*:*w_rowcol*:*no*:*w_required*:*no*:*w_randomize*:*no*:*w_allow_other*:*0*:*w_allow_other_num*:**:*w_class*:**:*new_field*:*6*:*id*:*type_textarea*:*type*:*Any questions or concern:*:*w_field_label*:*250*:*w_field_label_size*:*left*:*w_field_label_pos*:*200*:*w_size_w*:*100*:*w_size_h*:**:*w_first_val*:**:*w_title*:*no*:*w_required*:*no*:*w_unique*:**:*w_class*:**:*new_field*:*7*:*id*:*type_submit_reset*:*type*:*type_submit_reset_7*:*w_field_label*:*Submit*:*w_submit_title*:*Reset*:*w_reset_title*:**:*w_class*:*false*:*w_act*:**:*new_field*:*\', 1, 1, \'*\', \'\', \'\', \'\', \'\', 1, \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', 1, 1, 1, 1,\'administrator,\',1,\'\',\'\')');
190
- $wpdb->query('INSERT INTO `' . $wpdb->prefix . 'formmaker` VALUES(NULL, \'Business Demographic Survey\', \'\', \'<div class="wdform-page-and-images" style="display:table; border-top:0px solid black;"><div id="form_id_tempform_view1" class="wdform_page" page_title="Untitled page" next_title="Next" next_type="text" next_class="wdform-page-button" next_checkable="false" previous_title="Previous" previous_type="text" previous_class="wdform-page-button" previous_checkable="false"><div class="wdform_section"><div class="wdform_column"></div></div><div wdid="1" type="type_section_break" class="wdform_tr_section_break">%1 - custom_1%</div><div class="wdform_section"><div class="wdform_column"><div wdid="2" class="wdform_row">%2 - <b>What is your employment status?</b>%</div><div wdid="3" class="wdform_row">%3 - <b>What is your level of education?</b>%</div><div wdid="4" class="wdform_row">%4 - <b>In which industry do you work?</b>%</div><div wdid="5" class="wdform_row">%5 - <b>What is the annual revenue of your company?</b>%</div><div wdid="6" class="wdform_row">%6 - Word Verification:%</div><div wdid="7" class="wdform_row">%7 - type_submit_reset_7%</div></div></div><div valign="top" class="wdform_footer" style="width: 100%;"><div style="width: 100%;"><div style="width: 100%; display: table;"><div style="display: table-row-group;"><div id="form_id_temppage_nav1" style="display: table-row;"></div></div></div></div></div></div></div>\', 10, \'// Occurs before the form is loaded\r\nfunction before_load()\r\n{\r\n\r\n}\r\n\r\n// Occurs just before submitting the form\r\nfunction before_submit()\r\n{\r\n\r\n}\r\n\r\n// Occurs just before resetting the form\r\nfunction before_reset()\r\n{\r\n\r\n}\', \'\', \'\', 1, \'<p>%all%</p>\', \'<p>%all%</p>\', 8, 1, \'2#**id**#What is your employment status?#**label**#type_radio#****#3#**id**#What is your level of education?#**label**#type_radio#****#4#**id**#In which industry do you work?#**label**#type_own_select#****#5#**id**#What is the annual revenue of your company?#**label**#type_radio#****#6#**id**#Word Verification:#**label**#type_captcha#****#7#**id**#type_submit_reset_7#**label**#type_submit_reset#****#\', \'2#**id**#What is your employment status?#**label**#type_radio#****#3#**id**#What is your level of education?#**label**#type_radio#****#4#**id**#In which industry do you work?#**label**#type_own_select#****#5#**id**#What is the annual revenue of your company?#**label**#type_radio#****#6#**id**#Word Verification:#**label**#type_captcha#****#7#**id**#type_submit_reset_7#**label**#type_submit_reset#****#\', 0, \'none\', \'false\', \'true\', \'\', \'\', \'\', 0, \'\', \'\', \'USD\', 0, \'1*:*id*:*type_section_break*:*type*:*custom_1*:*w_field_label*:*<h2 id="header_1" style="font-size: 1.285714286rem; font-family: Helvetica, Arial, sans-serif; color: rgb(68, 68, 68); clear: both; line-height: 1.6; margin: 1.714285714rem 0px;">Business Demographic Survey</h2><p style="line-height: 1.714285714; margin: 0px 0px 1.714285714rem; color: rgb(68, 68, 68); font-family: Helvetica, Arial, sans-serif; font-size: 14px;"></p><div id="subHeader_1" style="color: rgb(68, 68, 68); font-family: Helvetica, Arial, sans-serif; font-size: 14px; line-height: 14px;">Thank you for joining our business demographic survey. Please give us your feedback by filling in the information bellow.</div><p><br></p>*:*w_editor*:**:*new_field*:*2*:*id*:*type_radio*:*type*:*<b>What is your employment status?</b>*:*w_field_label*:*600*:*w_field_label_size*:*top*:*w_field_label_pos*:*ver*:*w_flow*:*Employed full time***Trade or Vocational degree***Not employed, but looking for work***Not employed and not looking for work***Retired***Student***Homemaker***Prefer not to answer*:*w_choices*:*false***false***false***false***false***false***false***false*:*w_choices_checked*:*1*:*w_rowcol*:*no*:*w_required*:*no*:*w_randomize*:*no*:*w_allow_other*:*0*:*w_allow_other_num*:**:*w_class*:**:*new_field*:*3*:*id*:*type_radio*:*type*:*<b>What is your level of education?</b>*:*w_field_label*:*600*:*w_field_label_size*:*top*:*w_field_label_pos*:*ver*:*w_flow*:*Some high school***High school graduate or equivalent***Trade or Vocational Degree***Some college***Associate degree***Bachelor&#39;s degree***Graduate or Professional degree***Prefer not to answer*:*w_choices*:*false***false***false***false***false***false***false***false*:*w_choices_checked*:*1*:*w_rowcol*:*no*:*w_required*:*no*:*w_randomize*:*no*:*w_allow_other*:*0*:*w_allow_other_num*:**:*w_class*:**:*new_field*:*4*:*id*:*type_own_select*:*type*:*<b>In which industry do you work?</b>*:*w_field_label*:*500*:*w_field_label_size*:*top*:*w_field_label_pos*:*200*:*w_size*:****option 1***option 2***option 3*:*w_choices*:*true***false***false***false*:*w_choices_checked*:*true***false***false***false*:*w_choices_disabled*:*no*:*w_required*:*wdform_select*:*w_class*:**:*new_field*:*5*:*id*:*type_radio*:*type*:*<b>What is the annual revenue of your company?</b>*:*w_field_label*:*600*:*w_field_label_size*:*top*:*w_field_label_pos*:*ver*:*w_flow*:*Under $10,000***$10,001 to $50,000***$50,001 to $100,000***$100,001 to $500,000***$500,001 to $1 Million***$1 Million to $10 Million***$10 Million to $50 Million***$50 Million to $100 Million***Over $100 Million*:*w_choices*:*false***false***false***false***false***false***false***false***false*:*w_choices_checked*:*1*:*w_rowcol*:*no*:*w_required*:*no*:*w_randomize*:*no*:*w_allow_other*:*0*:*w_allow_other_num*:**:*w_class*:**:*new_field*:*6*:*id*:*type_captcha*:*type*:*Word Verification:*:*w_field_label*:*500*:*w_field_label_size*:*top*:*w_field_label_pos*:*6*:*w_digit*:**:*w_class*:**:*new_field*:*7*:*id*:*type_submit_reset*:*type*:*type_submit_reset_7*:*w_field_label*:*Submit*:*w_submit_title*:*Reset*:*w_reset_title*:**:*w_class*:*false*:*w_act*:**:*new_field*:*\', 1, 1, \'*\', \'\', \'\', \'\', \'\', 1, \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', 1, 1, 1, 1,\'administrator,\',1,\'\',\'\')');
191
- $wpdb->query('INSERT INTO `' . $wpdb->prefix . 'formmaker` VALUES(NULL, \'Register Your Business\', \'\', \'<div class="wdform-page-and-images" style="display:table; border-top:0px solid black;"><div id="form_id_tempform_view1" class="wdform_page" page_title="Untitled page" next_title="Next" next_type="text" next_class="wdform-page-button" next_checkable="false" previous_title="Previous" previous_type="text" previous_class="wdform-page-button" previous_checkable="false"><div class="wdform_section"><div class="wdform_column"><div wdid="1" class="wdform_row">%1 - Business Owner %</div><div wdid="2" class="wdform_row">%2 - Business Name%</div><div wdid="3" class="wdform_row">%3 - E-mail%</div><div wdid="4" class="wdform_row">%4 - Address:%</div><div wdid="10" class="wdform_row">%10 - Type of Business%</div><div wdid="11" class="wdform_row">%11 - Message%</div><div wdid="12" class="wdform_row">%12 - type_submit_reset_12%</div></div></div><div valign="top" class="wdform_footer" style="width: 100%;"><div style="width: 100%;"><div style="width: 100%; display: table;"><div style="display: table-row-group;"><div id="form_id_temppage_nav1" style="display: table-row;"></div></div></div></div></div></div></div>\', 26, \'// Occurs before the form is loaded\r\nfunction before_load()\r\n{\r\n\r\n}\r\n\r\n// Occurs just before submitting the form\r\nfunction before_submit()\r\n{\r\n\r\n}\r\n\r\n// Occurs just before resetting the form\r\nfunction before_reset()\r\n{\r\n\r\n}\', \'\', \'\', 0, \'%all%\', \'%all%\', 13, 1, \'1#**id**#Business Owner #**label**#type_name#****#2#**id**#Business Name#**label**#type_text#****#3#**id**#E-mail#**label**#type_submitter_mail#****#4#**id**#Street Address#**label**#type_address#****#5#**id**#Street Address Line 2#**label**#type_address#****#6#**id**#City#**label**#type_address#****#7#**id**#State / Province / Region#**label**#type_address#****#8#**id**#Postal / Zip Code#**label**#type_address#****#9#**id**#Country#**label**#type_address#****#10#**id**#Type of Business#**label**#type_own_select#****#11#**id**#Message#**label**#type_textarea#****#12#**id**#type_submit_reset_12#**label**#type_submit_reset#****#\', \'1#**id**#Business Owner #**label**#type_name#****#2#**id**#Business Name#**label**#type_text#****#3#**id**#E-mail#**label**#type_submitter_mail#****#4#**id**#Street Address#**label**#type_address#****#5#**id**#Street Address Line 2#**label**#type_address#****#6#**id**#City#**label**#type_address#****#7#**id**#State / Province / Region#**label**#type_address#****#8#**id**#Postal / Zip Code#**label**#type_address#****#9#**id**#Country#**label**#type_address#****#10#**id**#Type of Business#**label**#type_own_select#****#11#**id**#Message#**label**#type_textarea#****#12#**id**#type_submit_reset_12#**label**#type_submit_reset#****#\', 0, \'none\', \'false\', \'true\', \'\', \'\', \'\', 0, \'\', \'\', \'USD\', 0, \'1*:*id*:*type_name*:*type*:*Business Owner *:*w_field_label*:*150*:*w_field_label_size*:*left*:*w_field_label_pos*:*****:*w_first_val*:*****:*w_title*:*Title***First***Last***Middle*:*w_mini_labels*:*100*:*w_size*:*normal*:*w_name_format*:*yes*:*w_required*:*no*:*w_unique*:**:*w_class*:**:*new_field*:*2*:*id*:*type_text*:*type*:*Business Name*:*w_field_label*:*150*:*w_field_label_size*:*left*:*w_field_label_pos*:*200*:*w_size*:**:*w_first_val*:**:*w_title*:*yes*:*w_required*:*no*:*w_unique*:**:*new_field*:*3*:*id*:*type_submitter_mail*:*type*:*E-mail*:*w_field_label*:*150*:*w_field_label_size*:*left*:*w_field_label_pos*:*200*:*w_size*:**:*w_first_val*:**:*w_title*:*yes*:*w_required*:**:*w_unique*:**:*w_class*:**:*new_field*:*4*:*id*:*type_address*:*type*:*Address:*:*w_field_label*:*150*:*w_field_label_size*:*left*:*w_field_label_pos*:*300*:*w_size*:*Street Address***Street Address Line 2***City***State / Province / Region***Postal / Zip Code***Country*:*w_mini_labels*:*no***no***no***no***no***no****:*w_disabled_fields*:*no*:*w_required*:*wdform_address*:*w_class*:**:*new_field*:*10*:*id*:*type_own_select*:*type*:*Type of Business*:*w_field_label*:*150*:*w_field_label_size*:*left*:*w_field_label_pos*:*200*:*w_size*:*Select value***option 1***option 2*:*w_choices*:*true***false***false*:*w_choices_checked*:*true***false***false*:*w_choices_disabled*:*yes*:*w_required*:*wdform_select*:*w_class*:**:*new_field*:*11*:*id*:*type_textarea*:*type*:*Message*:*w_field_label*:*150*:*w_field_label_size*:*left*:*w_field_label_pos*:*200*:*w_size_w*:*100*:*w_size_h*:**:*w_first_val*:**:*w_title*:*no*:*w_required*:*no*:*w_unique*:**:*w_class*:**:*new_field*:*12*:*id*:*type_submit_reset*:*type*:*type_submit_reset_12*:*w_field_label*:*Submit*:*w_submit_title*:*Reset*:*w_reset_title*:**:*w_class*:*false*:*w_act*:**:*new_field*:*\', 1, 1, \'*\', \'\', \'\', \'\', \'\', 1, \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', 1, 1, 1, 1,\'administrator,\',1,\'\',\'\')');
192
- $wpdb->query('INSERT INTO `' . $wpdb->prefix . 'formmaker` VALUES(NULL, \'Cupcake Order Form\', \'\', \'<div class="wdform-page-and-images" style="display:table; border-top:0px solid black;"><div id="form_id_tempform_view1" class="wdform_page" page_title="Untitled page" next_title="Next" next_type="text" next_class="wdform-page-button" next_checkable="false" previous_title="Previous" previous_type="text" previous_class="wdform-page-button" previous_checkable="false"><div class="wdform_section"><div class="wdform_column"><div wdid="1" class="wdform_row">%1 - Date%</div><div wdid="2" class="wdform_row">%2 - Name%</div><div wdid="3" class="wdform_row">%3 - E-mail:%</div><div wdid="4" class="wdform_row">%4 - <b>Cupcakes <br> Flavors (1 doz. minimum)</b>%</div><div wdid="5" class="wdform_row">%5 - Quantity%</div><div wdid="6" class="wdform_row">%6 - Details (if any)%</div><div wdid="7" class="wdform_row">%7 - type_submit_reset_7%</div></div></div><div valign="top" class="wdform_footer" style="width: 100%;"><div style="width: 100%;"><div style="width: 100%; display: table;"><div style="display: table-row-group;"><div id="form_id_temppage_nav1" style="display: table-row;"></div></div></div></div></div></div></div>\', 6, \'// Occurs before the form is loaded\r\nfunction before_load()\r\n{\r\n\r\n}\r\n\r\n// Occurs just before submitting the form\r\nfunction before_submit()\r\n{\r\n\r\n}\r\n\r\n// Occurs just before resetting the form\r\nfunction before_reset()\r\n{\r\n\r\n}\', \'\', \'\', 0, \'%all%\', \'%all%\', 8, 1, \'1#**id**#Date#**label**#type_date#****#2#**id**#Name#**label**#type_name#****#3#**id**#E-mail:#**label**#type_submitter_mail#****#4#**id**#Cupcakes Flavors (1 doz. minimum)#**label**#type_checkbox#****#5#**id**#Quantity#**label**#type_own_select#****#6#**id**#Details (if any)#**label**#type_textarea#****#7#**id**#type_submit_reset_7#**label**#type_submit_reset#****#\', \'1#**id**#Date#**label**#type_date#****#2#**id**#Name#**label**#type_name#****#3#**id**#E-mail:#**label**#type_submitter_mail#****#4#**id**#Cupcakes Flavors (1 doz. minimum)#**label**#type_checkbox#****#5#**id**#Quantity#**label**#type_own_select#****#6#**id**#Details (if any)#**label**#type_textarea#****#7#**id**#type_submit_reset_7#**label**#type_submit_reset#****#\', 0, \'none\', \'false\', \'true\', \'\', \'\', \'\', 0, \'\', \'\', \'USD\', 0, \'1*:*id*:*type_date*:*type*:*Date*:*w_field_label*:*150*:*w_field_label_size*:*left*:*w_field_label_pos*:**:*w_date*:*yes*:*w_required*:**:*w_class*:*%Y-%m-%d*:*w_format*:*...*:*w_but_val*:**:*new_field*:*2*:*id*:*type_name*:*type*:*Name*:*w_field_label*:*150*:*w_field_label_size*:*left*:*w_field_label_pos*:*****:*w_first_val*:*****:*w_title*:*Title***First***Last***Middle*:*w_mini_labels*:*100*:*w_size*:*normal*:*w_name_format*:*yes*:*w_required*:*no*:*w_unique*:**:*w_class*:**:*new_field*:*3*:*id*:*type_submitter_mail*:*type*:*E-mail:*:*w_field_label*:*150*:*w_field_label_size*:*left*:*w_field_label_pos*:*200*:*w_size*:**:*w_first_val*:**:*w_title*:*yes*:*w_required*:**:*w_unique*:**:*w_class*:**:*new_field*:*4*:*id*:*type_checkbox*:*type*:*<b>Cupcakes <br> Flavors (1 doz. minimum)</b>*:*w_field_label*:*150*:*w_field_label_size*:*left*:*w_field_label_pos*:*ver*:*w_flow*:*Red Velvet ($150.00 TTD)***Vanilla ($100.00 TTD)***Chocolate ($120.00 TTD)***Guinness ($150.00 TTD)***Coconut ($120.00 TTD)***Lemon ($100.00 TTD)***Chocolate Mint ($120.00 TTD)*:*w_choices*:*false***false***false***false***false***false***false*:*w_choices_checked*:*1*:*w_rowcol*:*no*:*w_required*:*no*:*w_randomize*:*no*:*w_allow_other*:*0*:*w_allow_other_num*:**:*w_class*:**:*new_field*:*5*:*id*:*type_own_select*:*type*:*Quantity*:*w_field_label*:*150*:*w_field_label_size*:*left*:*w_field_label_pos*:*50*:*w_size*:****1***2***3***4***5***6***7***8***9***10*:*w_choices*:*true***false***false***false***false***false***false***false***false***false***false*:*w_choices_checked*:*true***false***false***false***false***false***false***false***false***false***false*:*w_choices_disabled*:*no*:*w_required*:*wdform_select*:*w_class*:**:*new_field*:*6*:*id*:*type_textarea*:*type*:*Details (if any)*:*w_field_label*:*150*:*w_field_label_size*:*left*:*w_field_label_pos*:*200*:*w_size_w*:*100*:*w_size_h*:**:*w_first_val*:**:*w_title*:*no*:*w_required*:*no*:*w_unique*:**:*w_class*:**:*new_field*:*7*:*id*:*type_submit_reset*:*type*:*type_submit_reset_7*:*w_field_label*:*Submit*:*w_submit_title*:*Reset*:*w_reset_title*:**:*w_class*:*false*:*w_act*:**:*new_field*:*\', 1, 1, \'*\', \'\', \'\', \'\', \'\', 1, \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', 1, 1, 1, 1,\'administrator,\',1,\'\',\'\')');
193
- $wpdb->query('INSERT INTO `' . $wpdb->prefix . 'formmaker` VALUES(NULL, \'Seminar Evaluation Survey\', \'\', \'<div class="wdform-page-and-images" style="display:table; border-top:0px solid black;"><div id="form_id_tempform_view1" class="wdform_page" page_title="Untitled page" next_title="Next" next_type="text" next_class="wdform-page-button" next_checkable="false" previous_title="Previous" previous_type="text" previous_class="wdform-page-button" previous_checkable="false"><div class="wdform_section"><div class="wdform_column"></div></div><div wdid="1" type="type_section_break" class="wdform_tr_section_break">%1 - custom_1%</div><div class="wdform_section"><div class="wdform_column"><div wdid="2" class="wdform_row">%2 - <b>Company</b>%</div><div wdid="3" class="wdform_row">%3 - <b>Occupation</b>%</div><div wdid="4" class="wdform_row">%4 - <b>Was it worth its money?</b>%</div><div wdid="5" class="wdform_row">%5 - <b>On average how would you rate the seminar?</b>%</div><div wdid="6" class="wdform_row">%6 - type_submit_reset_6%</div></div></div><div valign="top" class="wdform_footer" style="width: 100%;"><div style="width: 100%;"><div style="width: 100%; display: table;"><div style="display: table-row-group;"><div id="form_id_temppage_nav1" style="display: table-row;"></div></div></div></div></div></div></div>\', 16, \'// Occurs before the form is loaded\r\nfunction before_load()\r\n{\r\n\r\n}\r\n\r\n// Occurs just before submitting the form\r\nfunction before_submit()\r\n{\r\n\r\n}\r\n\r\n// Occurs just before resetting the form\r\nfunction before_reset()\r\n{\r\n\r\n}\', \'\', \'\', 0, \'%all%\', \'%all%\', 7, 1, \'2#**id**#Company#**label**#type_text#****#3#**id**#Occupation#**label**#type_text#****#4#**id**#Was it worth its money?#**label**#type_radio#****#5#**id**#On average how would you rate the seminar?#**label**#type_radio#****#6#**id**#type_submit_reset_6#**label**#type_submit_reset#****#\', \'2#**id**#Company#**label**#type_text#****#3#**id**#Occupation#**label**#type_text#****#4#**id**#Was it worth its money?#**label**#type_radio#****#5#**id**#On average how would you rate the seminar?#**label**#type_radio#****#6#**id**#type_submit_reset_6#**label**#type_submit_reset#****#\', 0, \'none\', \'false\', \'true\', \'\', \'\', \'\', 0, \'\', \'\', \'USD\', 0, \'1*:*id*:*type_section_break*:*type*:*custom_1*:*w_field_label*:*<h1 id="header_1" style="font-size: 1.5rem; font-family: Helvetica, Arial, sans-serif; color: rgb(68, 68, 68); clear: both; line-height: 1.5; margin: 1.714285714rem 0px;">Seminar Evaluation Survey</h1><div id="subHeader_1" style="color: rgb(68, 68, 68); font-family: Helvetica, Arial, sans-serif; font-size: 14px; line-height: 14px;">Please take a few minutes to complete this evaluation survey</div>*:*w_editor*:**:*new_field*:*2*:*id*:*type_text*:*type*:*<b>Company</b>*:*w_field_label*:*150*:*w_field_label_size*:*top*:*w_field_label_pos*:*200*:*w_size*:**:*w_first_val*:**:*w_title*:*no*:*w_required*:*no*:*w_unique*:**:*new_field*:*3*:*id*:*type_text*:*type*:*<b>Occupation</b>*:*w_field_label*:*150*:*w_field_label_size*:*top*:*w_field_label_pos*:*200*:*w_size*:**:*w_first_val*:**:*w_title*:*no*:*w_required*:*no*:*w_unique*:**:*new_field*:*4*:*id*:*type_radio*:*type*:*<b>Was it worth its money?</b>*:*w_field_label*:*200*:*w_field_label_size*:*top*:*w_field_label_pos*:*ver*:*w_flow*:*Yes***No*:*w_choices*:*false***false*:*w_choices_checked*:*1*:*w_rowcol*:*no*:*w_required*:*no*:*w_randomize*:*no*:*w_allow_other*:*0*:*w_allow_other_num*:**:*w_class*:**:*new_field*:*5*:*id*:*type_radio*:*type*:*<b>On average how would you rate the seminar?</b>*:*w_field_label*:*400*:*w_field_label_size*:*top*:*w_field_label_pos*:*ver*:*w_flow*:*Very good***Good***Neutral***Bad***Very bad*:*w_choices*:*false***false***false***false***false*:*w_choices_checked*:*1*:*w_rowcol*:*no*:*w_required*:*no*:*w_randomize*:*no*:*w_allow_other*:*0*:*w_allow_other_num*:**:*w_class*:**:*new_field*:*6*:*id*:*type_submit_reset*:*type*:*type_submit_reset_6*:*w_field_label*:*Submit*:*w_submit_title*:*Reset*:*w_reset_title*:**:*w_class*:*false*:*w_act*:**:*new_field*:*\', 1, 1, \'*\', \'\', \'\', \'\', \'\', 1, \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', 1, 1, 1, 1,\'administrator,\',1,\'\',\'\')');
194
- $wpdb->query('INSERT INTO `' . $wpdb->prefix . 'formmaker` VALUES(NULL, \'Restaurant Evaluation Survey\', \'\', \'<div class="wdform-page-and-images" style="display:table; border-top:0px solid black;"><div id="form_id_tempform_view1" class="wdform_page" page_title="Untitled page" next_title="Next" next_type="text" next_class="wdform-page-button" next_checkable="false" previous_title="Previous" previous_type="text" previous_class="wdform-page-button" previous_checkable="false"><div class="wdform_section"><div class="wdform_column"></div></div><div wdid="1" type="type_section_break" class="wdform_tr_section_break">%1 - custom_1%</div><div class="wdform_section"><div class="wdform_column"><div wdid="2" class="wdform_row">%2 - Day Visited:%</div><div wdid="3" class="wdform_row">%3 - <b>Dine In / Take Out:</b>%</div><div wdid="4" class="wdform_row">%4 - <b>Food Quality:</b>%</div><div wdid="5" class="wdform_row">%5 - <b>Speed of Service:</b>%</div><div wdid="6" class="wdform_row">%6 - <b>Any comments, questions or suggestions?</b>%</div><div wdid="7" class="wdform_row">%7 - type_submit_reset_7%</div></div></div><div valign="top" class="wdform_footer" style="width: 100%;"><div style="width: 100%;"><div style="width: 100%; display: table;"><div style="display: table-row-group;"><div id="form_id_temppage_nav1" style="display: table-row;"></div></div></div></div></div></div></div>\', 21, \'// Occurs before the form is loaded\r\nfunction before_load()\r\n{\r\n\r\n}\r\n\r\n// Occurs just before submitting the form\r\nfunction before_submit()\r\n{\r\n\r\n}\r\n\r\n// Occurs just before resetting the form\r\nfunction before_reset()\r\n{\r\n\r\n}\', \'\', \'\', 0, \'%all%\', \'%all%\', 8, 1, \'2#**id**#Day Visited:#**label**#type_date#****#3#**id**#Dine In / Take Out:#**label**#type_radio#****#4#**id**#Food Quality:#**label**#type_radio#****#5#**id**#Speed of Service:#**label**#type_radio#****#6#**id**#Any comments, questions or suggestions?#**label**#type_textarea#****#7#**id**#type_submit_reset_7#**label**#type_submit_reset#****#\', \'2#**id**#Day Visited:#**label**#type_date#****#3#**id**#Dine In / Take Out:#**label**#type_radio#****#4#**id**#Food Quality:#**label**#type_radio#****#5#**id**#Speed of Service:#**label**#type_radio#****#6#**id**#Any comments, questions or suggestions?#**label**#type_textarea#****#7#**id**#type_submit_reset_7#**label**#type_submit_reset#****#\', 0, \'none\', \'false\', \'true\', \'\', \'\', \'\', 0, \'\', \'\', \'USD\', 0, \'1*:*id*:*type_section_break*:*type*:*custom_1*:*w_field_label*:*<h2 id="header_21" style="font-size: 1.285714286rem; font-family: Helvetica, Arial, sans-serif; color: rgb(68, 68, 68); clear: both; line-height: 1.6; margin: 1.714285714rem 0px;">Restaurant Evaluation Survey</h2><div id="subHeader_21" style="color: rgb(68, 68, 68); font-family: Helvetica, Arial, sans-serif; font-size: 14px; line-height: 14px;">Please let us know how was the food and service.</div><p><br></p>*:*w_editor*:**:*new_field*:*2*:*id*:*type_date*:*type*:*Day Visited:*:*w_field_label*:*150*:*w_field_label_size*:*left*:*w_field_label_pos*:**:*w_date*:*no*:*w_required*:**:*w_class*:*%Y-%m-%d*:*w_format*:*...*:*w_but_val*:**:*new_field*:*3*:*id*:*type_radio*:*type*:*<b>Dine In / Take Out:</b>*:*w_field_label*:*150*:*w_field_label_size*:*left*:*w_field_label_pos*:*ver*:*w_flow*:*Dine In***Dine Out*:*w_choices*:*false***false*:*w_choices_checked*:*1*:*w_rowcol*:*no*:*w_required*:*no*:*w_randomize*:*no*:*w_allow_other*:*0*:*w_allow_other_num*:**:*w_class*:**:*new_field*:*4*:*id*:*type_radio*:*type*:*<b>Food Quality:</b>*:*w_field_label*:*150*:*w_field_label_size*:*left*:*w_field_label_pos*:*ver*:*w_flow*:*Excellent***Good***Average***Dissatisfied*:*w_choices*:*false***false***false***false*:*w_choices_checked*:*1*:*w_rowcol*:*no*:*w_required*:*no*:*w_randomize*:*no*:*w_allow_other*:*0*:*w_allow_other_num*:**:*w_class*:**:*new_field*:*5*:*id*:*type_radio*:*type*:*<b>Speed of Service:</b>*:*w_field_label*:*150*:*w_field_label_size*:*left*:*w_field_label_pos*:*ver*:*w_flow*:*Excellent***Good***Average***Dissatisfied*:*w_choices*:*false***false***false***false*:*w_choices_checked*:*1*:*w_rowcol*:*no*:*w_required*:*no*:*w_randomize*:*no*:*w_allow_other*:*0*:*w_allow_other_num*:**:*w_class*:**:*new_field*:*6*:*id*:*type_textarea*:*type*:*<b>Any comments, questions or suggestions?</b>*:*w_field_label*:*300*:*w_field_label_size*:*top*:*w_field_label_pos*:*300*:*w_size_w*:*100*:*w_size_h*:**:*w_first_val*:**:*w_title*:*no*:*w_required*:*no*:*w_unique*:**:*w_class*:**:*new_field*:*7*:*id*:*type_submit_reset*:*type*:*type_submit_reset_7*:*w_field_label*:*Submit*:*w_submit_title*:*Reset*:*w_reset_title*:**:*w_class*:*false*:*w_act*:**:*new_field*:*\', 1, 1, \'*\', \'\', \'\', \'\', \'\', 1, \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', 1, 1, 1, 1,\'administrator,\',1,\'\',\'\')');
195
- $wpdb->query('INSERT INTO `' . $wpdb->prefix . 'formmaker` VALUES(NULL, \'Product Survey\', \'\', \'<div class="wdform-page-and-images" style="display:table; border-top:0px solid black;"><div id="form_id_tempform_view1" class="wdform_page" page_title="Untitled page" next_title="Next" next_type="text" next_class="wdform-page-button" next_checkable="false" previous_title="Previous" previous_type="text" previous_class="wdform-page-button" previous_checkable="false"><div class="wdform_section"><div class="wdform_column"></div></div><div wdid="1" type="type_section_break" class="wdform_tr_section_break">%1 - custom_1%</div><div class="wdform_section"><div class="wdform_column"><div wdid="2" class="wdform_row">%2 - 1. Please indicate if you agree or disagree with the following statements%</div><div wdid="3" class="wdform_row">%3 - 2. How likely are you to recommend [Product/Service] to a friend or co-worker?%</div><div wdid="4" class="wdform_row">%4 - 3. What is the amount you would ever pay for a product like ours%</div><div wdid="5" class="wdform_row">%5 - 4. Please rate the product %</div><div wdid="6" class="wdform_row">%6 - type_submit_reset_6%</div></div></div><div valign="top" class="wdform_footer" style="width: 100%;"><div style="width: 100%;"><div style="width: 100%; display: table;"><div style="display: table-row-group;"><div id="form_id_temppage_nav1" style="display: table-row;"></div></div></div></div></div></div></div>\', 29, \'// Occurs before the form is loaded\r\nfunction before_load()\r\n{\r\n\r\n}\r\n\r\n// Occurs just before submitting the form\r\nfunction before_submit()\r\n{\r\n\r\n}\r\n\r\n// Occurs just before resetting the form\r\nfunction before_reset()\r\n{\r\n\r\n}\', \'\', \'\', 0, \'%all%\', \'%all%\', 7, 1, \'2#**id**#1. Please indicate if you agree or disagree with the following statements#**label**#type_matrix#****#3#**id**#2. How likely are you to recommend [Product/Service] to a friend or co-worker?#**label**#type_scale_rating#****#4#**id**#3. What is the amount you would ever pay for a product like ours#**label**#type_range#****#5#**id**#4. Please rate the product #**label**#type_star_rating#****#6#**id**#type_submit_reset_6#**label**#type_submit_reset#****#\', \'2#**id**#1. Please indicate if you agree or disagree with the following statements#**label**#type_matrix#****#3#**id**#2. How likely are you to recommend [Product/Service] to a friend or co-worker?#**label**#type_scale_rating#****#4#**id**#3. What is the amount you would ever pay for a product like ours#**label**#type_range#****#5#**id**#4. Please rate the product #**label**#type_star_rating#****#6#**id**#type_submit_reset_6#**label**#type_submit_reset#****#\', 0, \'none\', \'false\', \'true\', \'\', \'\', \'\', 0, \'\', \'\', \'USD\', 0, \'1*:*id*:*type_section_break*:*type*:*custom_1*:*w_field_label*:*<h1 class="sg-title" data-mce-style="font-size: 2.2em; color: #fff; font-weight: normal; line-height: normal;" style="font-size: 2.2em; font-weight: normal; color: rgb(255, 255, 255); line-height: normal;">Product Survey</h1>*:*w_editor*:**:*new_field*:*2*:*id*:*type_matrix*:*type*:*1. Please indicate if you agree or disagree with the following statements*:*w_field_label*:*600*:*w_field_label_size*:*top*:*w_field_label_pos*:*radio*:*w_field_input_type*:****Product is affordable***Product is valuable***Product is better<br> than other products on<br> the market***Product is easy to use*:*w_rows*:****Strongly Disagree***Disagree***Neutral***Agree***Strongly Agree*:*w_columns*:*no*:*w_required*:*wdform_matrix*:*w_class*:**:*new_field*:*3*:*id*:*type_scale_rating*:*type*:*2. How likely are you to recommend [Product/Service] to a friend or co-worker?*:*w_field_label*:*600*:*w_field_label_size*:*top*:*w_field_label_pos*:*Will not recommend *** I will recommend*:*w_mini_labels*:*5*:*w_scale_amount*:*no*:*w_required*:*wdform_scale_rating*:*w_class*:**:*new_field*:*4*:*id*:*type_range*:*type*:*3. What is the amount you would ever pay for a product like ours*:*w_field_label*:*600*:*w_field_label_size*:*top*:*w_field_label_pos*:*40*:*w_field_range_width*:*1*:*w_field_range_step*:*null*:*w_field_value1*:*null*:*w_field_value2*:*From***To*:*w_mini_labels*:*no*:*w_required*:**:*w_class*:**:*new_field*:*5*:*id*:*type_star_rating*:*type*:*4. Please rate the product *:*w_field_label*:*150*:*w_field_label_size*:*top*:*w_field_label_pos*:*yellow*:*w_field_label_col*:*10*:*w_star_amount*:*no*:*w_required*:*wdform_star_rating*:*w_class*:**:*new_field*:*6*:*id*:*type_submit_reset*:*type*:*type_submit_reset_6*:*w_field_label*:*Submit*:*w_submit_title*:*Reset*:*w_reset_title*:**:*w_class*:*true*:*w_act*:**:*new_field*:*\', 1, 1, \'*\', \'\', \'\', \'\', \'\', 1, \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', 1, 1, 1, 1,\'administrator,\',1,\'\',\'\')');
196
  }
197
  }
198
 
58
  `sortable` int(11) NOT NULL,
59
  `frontend_submit_fields` text NOT NULL,
60
  `frontend_submit_stat_fields` text NOT NULL,
61
+ `mail_emptyfields` tinyint(4) NOT NULL DEFAULT '0',
62
  PRIMARY KEY (`id`)
63
  ) DEFAULT CHARSET=utf8;";
64
  $wpdb->query($formmaker);
185
  global $wpdb;
186
  $form_maker_row = $wpdb->get_var("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE `id` NOT IN (" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ")");
187
  if (!$form_maker_row) {
188
+ $wpdb->query('INSERT INTO `' . $wpdb->prefix . 'formmaker` VALUES(NULL, \'Contact\', \'\', \'<div class="wdform-page-and-images" style="display:table; border-top:0px solid black;"><div id="form_id_tempform_view1" class="wdform_page" page_title="Untitled page" next_title="Next" next_type="text" next_class="wdform-page-button" next_checkable="false" previous_title="Previous" previous_type="text" previous_class="wdform-page-button" previous_checkable="false"><div class="wdform_section"><div class="wdform_column"><div wdid="1" class="wdform_row">%1 - Name:%</div><div wdid="2" class="wdform_row">%2 - E-mail:%</div><div wdid="3" class="wdform_row">%3 - Subject:%</div><div wdid="4" class="wdform_row">%4 - Message:%</div><div wdid="5" class="wdform_row">%5 - type_submit_reset_5%</div></div></div><div valign="top" class="wdform_footer" style="width: 100%;"><div style="width: 100%;"><div style="width: 100%; display: table;"><div style="display: table-row-group;"><div id="form_id_temppage_nav1" style="display: table-row;"></div></div></div></div></div></div></div>\', 1, \'// Occurs before the form is loaded\r\nfunction before_load()\r\n{\r\n\r\n}\r\n\r\n// Occurs just before submitting the form\r\nfunction before_submit()\r\n{\r\n\r\n}\r\n\r\n// Occurs just before resetting the form\r\nfunction before_reset()\r\n{\r\n\r\n}\', \'\', \'\', 0, \'%all%\', \'%all%\', 6, 1, \'1#**id**#Name:#**label**#type_name#****#2#**id**#E-mail:#**label**#type_submitter_mail#****#3#**id**#Subject:#**label**#type_text#****#4#**id**#Message:#**label**#type_textarea#****#5#**id**#type_submit_reset_5#**label**#type_submit_reset#****#\', \'1#**id**#Name:#**label**#type_name#****#2#**id**#E-mail:#**label**#type_submitter_mail#****#3#**id**#Subject:#**label**#type_text#****#4#**id**#Message:#**label**#type_textarea#****#5#**id**#type_submit_reset_5#**label**#type_submit_reset#****#\', 0, \'none\', \'false\', \'true\', \'\', \'\', \'\', 0, \'\', \'\', \'USD\', 0, \'1*:*id*:*type_name*:*type*:*Name:*:*w_field_label*:*70*:*w_field_label_size*:*left*:*w_field_label_pos*:*****:*w_first_val*:*****:*w_title*:*Title***First***Last***Middle*:*w_mini_labels*:*100*:*w_size*:*normal*:*w_name_format*:*yes*:*w_required*:*no*:*w_unique*:**:*w_class*:**:*new_field*:*2*:*id*:*type_submitter_mail*:*type*:*E-mail:*:*w_field_label*:*70*:*w_field_label_size*:*left*:*w_field_label_pos*:*200*:*w_size*:**:*w_first_val*:**:*w_title*:*no*:*w_required*:**:*w_unique*:**:*w_class*:**:*new_field*:*3*:*id*:*type_text*:*type*:*Subject:*:*w_field_label*:*70*:*w_field_label_size*:*left*:*w_field_label_pos*:*200*:*w_size*:**:*w_first_val*:**:*w_title*:*no*:*w_required*:*no*:*w_unique*:**:*new_field*:*4*:*id*:*type_textarea*:*type*:*Message:*:*w_field_label*:*70*:*w_field_label_size*:*left*:*w_field_label_pos*:*200*:*w_size_w*:*100*:*w_size_h*:**:*w_first_val*:**:*w_title*:*no*:*w_required*:*no*:*w_unique*:**:*w_class*:**:*new_field*:*5*:*id*:*type_submit_reset*:*type*:*type_submit_reset_5*:*w_field_label*:*Submit*:*w_submit_title*:*Reset*:*w_reset_title*:**:*w_class*:*true*:*w_act*:**:*new_field*:*\', 1, 1, \'*\', \'\', \'\', \'\', \'\', 1, \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', 1, 1, 1, 1,\'administrator,\',1,\'\',\'\', 0)');
189
+ $wpdb->query('INSERT INTO `' . $wpdb->prefix . 'formmaker` VALUES(NULL, \'Fill Form To Get Admission\', \'\', \'<div class="wdform-page-and-images" style="display:table; border-top:0px solid black;"><div id="form_id_tempform_view1" class="wdform_page" page_title="Untitled page" next_title="Next" next_type="text" next_class="wdform-page-button" next_checkable="false" previous_title="Previous" previous_type="text" previous_class="wdform-page-button" previous_checkable="false"><div class="wdform_section"><div class="wdform_column"><div wdid="1" class="wdform_row">%1 - Name:%</div><div wdid="2" class="wdform_row">%2 - E-mail:%</div><div wdid="4" class="wdform_row">%4 - Phone Number:%</div><div wdid="5" class="wdform_row">%5 - SELECT COLLEGE%</div><div wdid="6" class="wdform_row">%6 - OTHER SPECIFY HERE%</div><div wdid="7" class="wdform_row">%7 - Word Verification:%</div><div wdid="8" class="wdform_row">%8 - type_submit_reset_8%</div></div></div><div valign="top" class="wdform_footer" style="width: 100%;"><div style="width: 100%;"><div style="width: 100%; display: table;"><div style="display: table-row-group;"><div id="form_id_temppage_nav1" style="display: table-row;"></div></div></div></div></div></div></div>\', 8, \'// Occurs before the form is loaded\r\nfunction before_load()\r\n{\r\n\r\n}\r\n\r\n// Occurs just before submitting the form\r\nfunction before_submit()\r\n{\r\n\r\n}\r\n\r\n// Occurs just before resetting the form\r\nfunction before_reset()\r\n{\r\n\r\n}\', \'\', \'\', 0, \'%all%\', \'%all%\', 9, 1, \'1#**id**#Name:#**label**#type_name#****#2#**id**#E-mail:#**label**#type_submitter_mail#****#4#**id**#Phone Number:#**label**#type_number#****#5#**id**#SELECT COLLEGE#**label**#type_own_select#****#6#**id**#OTHER SPECIFY HERE#**label**#type_text#****#7#**id**#Word Verification:#**label**#type_captcha#****#8#**id**#type_submit_reset_8#**label**#type_submit_reset#****#\', \'1#**id**#Name:#**label**#type_name#****#2#**id**#E-mail:#**label**#type_submitter_mail#****#4#**id**#Phone Number:#**label**#type_number#****#5#**id**#SELECT COLLEGE#**label**#type_own_select#****#6#**id**#OTHER SPECIFY HERE#**label**#type_text#****#7#**id**#Word Verification:#**label**#type_captcha#****#8#**id**#type_submit_reset_8#**label**#type_submit_reset#****#\', 0, \'none\', \'false\', \'true\', \'\', \'\', \'\', 0, \'\', \'\', \'USD\', 0, \'1*:*id*:*type_name*:*type*:*Name:*:*w_field_label*:*160*:*w_field_label_size*:*left*:*w_field_label_pos*:***********:*w_first_val*:***********:*w_title*:*Title***First***Last***Middle*:*w_mini_labels*:*100*:*w_size*:*extended*:*w_name_format*:*no*:*w_required*:*no*:*w_unique*:**:*w_class*:**:*new_field*:*2*:*id*:*type_submitter_mail*:*type*:*E-mail:*:*w_field_label*:*160*:*w_field_label_size*:*left*:*w_field_label_pos*:*200*:*w_size*:**:*w_first_val*:**:*w_title*:*yes*:*w_required*:**:*w_unique*:**:*w_class*:**:*new_field*:*4*:*id*:*type_number*:*type*:*Phone Number:*:*w_field_label*:*160*:*w_field_label_size*:*left*:*w_field_label_pos*:*200*:*w_size*:**:*w_first_val*:**:*w_title*:*no*:*w_required*:*no*:*w_unique*:**:*w_class*:**:*new_field*:*5*:*id*:*type_own_select*:*type*:*SELECT COLLEGE*:*w_field_label*:*160*:*w_field_label_size*:*left*:*w_field_label_pos*:*200*:*w_size*:**** GGSCMT,KHARAR*** DOABA KHARAR *** CAMBRIDGE COLLEGE FATEHGARH *** INDOGLOBAL *** QUEST COLLEGE *** UNIVERSAL ,LALRU *** OTHER PLEASE SPECIFY BELOW *:*w_choices*:*true***false***false***false***false***false***false***false*:*w_choices_checked*:*true***false***false***false***false***false***false***false*:*w_choices_disabled*:*yes*:*w_required*:*wdform_select*:*w_class*:**:*new_field*:*6*:*id*:*type_text*:*type*:*OTHER SPECIFY HERE*:*w_field_label*:*160*:*w_field_label_size*:*left*:*w_field_label_pos*:*200*:*w_size*:**:*w_first_val*:**:*w_title*:*no*:*w_required*:*no*:*w_unique*:**:*new_field*:*7*:*id*:*type_captcha*:*type*:*Word Verification:*:*w_field_label*:*160*:*w_field_label_size*:*left*:*w_field_label_pos*:*6*:*w_digit*:**:*w_class*:**:*new_field*:*8*:*id*:*type_submit_reset*:*type*:*type_submit_reset_8*:*w_field_label*:*Submit*:*w_submit_title*:*Reset*:*w_reset_title*:**:*w_class*:*true*:*w_act*:**:*new_field*:*\', 1, 1, \'*\', \'\', \'\', \'\', \'\', 1, \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', 1, 1, 1, 1,\'administrator,\',1,\'\',\'\', 0)');
190
+ $wpdb->query('INSERT INTO `' . $wpdb->prefix . 'formmaker` VALUES(NULL, \'Camp Registration Form\', \'\', \'<div class="wdform-page-and-images" style="display:table; border-top:0px solid black;"><div id="form_id_tempform_view1" class="wdform_page" page_title="Untitled page" next_title="Next" next_type="text" next_class="wdform-page-button" next_checkable="false" previous_title="Previous" previous_type="text" previous_class="wdform-page-button" previous_checkable="false"><div class="wdform_section"><div class="wdform_column"><div wdid="1" class="wdform_row">%1 - Camper Name:%</div><div wdid="2" class="wdform_row">%2 - Camper Age Group:%</div><div wdid="3" class="wdform_row">%3 - Desire Cabin:%</div><div wdid="4" class="wdform_row">%4 - Does any one have allergies?%</div><div wdid="5" class="wdform_row">%5 - Has the camper been camping before?%</div><div wdid="6" class="wdform_row">%6 - Any questions or concern:%</div><div wdid="7" class="wdform_row">%7 - type_submit_reset_7%</div></div></div><div valign="top" class="wdform_footer" style="width: 100%;"><div style="width: 100%;"><div style="width: 100%; display: table;"><div style="display: table-row-group;"><div id="form_id_temppage_nav1" style="display: table-row;"></div></div></div></div></div></div></div>\', 15, \'// Occurs before the form is loaded\r\nfunction before_load()\r\n{\r\n\r\n}\r\n\r\n// Occurs just before submitting the form\r\nfunction before_submit()\r\n{\r\n\r\n}\r\n\r\n// Occurs just before resetting the form\r\nfunction before_reset()\r\n{\r\n\r\n}\', \'\', \'\', 0, \'%all%\', \'%all%\', 8, 1, \'1#**id**#Camper Name:#**label**#type_name#****#2#**id**#Camper Age Group:#**label**#type_own_select#****#3#**id**#Desire Cabin:#**label**#type_radio#****#4#**id**#Does any one have allergies?#**label**#type_radio#****#5#**id**#Has the camper been camping before?#**label**#type_radio#****#6#**id**#Any questions or concern:#**label**#type_textarea#****#7#**id**#type_submit_reset_7#**label**#type_submit_reset#****#\', \'1#**id**#Camper Name:#**label**#type_name#****#2#**id**#Camper Age Group:#**label**#type_own_select#****#3#**id**#Desire Cabin:#**label**#type_radio#****#4#**id**#Does any one have allergies?#**label**#type_radio#****#5#**id**#Has the camper been camping before?#**label**#type_radio#****#6#**id**#Any questions or concern:#**label**#type_textarea#****#7#**id**#type_submit_reset_7#**label**#type_submit_reset#****#\', 0, \'none\', \'false\', \'true\', \'\', \'\', \'\', 0, \'\', \'\', \'USD\', 0, \'1*:*id*:*type_name*:*type*:*Camper Name:*:*w_field_label*:*250*:*w_field_label_size*:*left*:*w_field_label_pos*:*****:*w_first_val*:*****:*w_title*:*Title***First***Last***Middle*:*w_mini_labels*:*100*:*w_size*:*normal*:*w_name_format*:*no*:*w_required*:*no*:*w_unique*:**:*w_class*:**:*new_field*:*2*:*id*:*type_own_select*:*type*:*Camper Age Group:*:*w_field_label*:*250*:*w_field_label_size*:*left*:*w_field_label_pos*:*200*:*w_size*:****6-8***8-12***12-15*:*w_choices*:*true***false***false***false*:*w_choices_checked*:*true***false***false***false*:*w_choices_disabled*:*no*:*w_required*:*wdform_select*:*w_class*:**:*new_field*:*3*:*id*:*type_radio*:*type*:*Desire Cabin:*:*w_field_label*:*250*:*w_field_label_size*:*left*:*w_field_label_pos*:*ver*:*w_flow*:*Cabin 1***Cabin 2***Cabin 3***Cabin 4***Cabin 5***Cabin 6***Cabin 7*:*w_choices*:*false***false***false***false***false***false***false*:*w_choices_checked*:*1*:*w_rowcol*:*no*:*w_required*:*no*:*w_randomize*:*no*:*w_allow_other*:*0*:*w_allow_other_num*:**:*w_class*:**:*new_field*:*4*:*id*:*type_radio*:*type*:*Does any one have allergies?*:*w_field_label*:*250*:*w_field_label_size*:*left*:*w_field_label_pos*:*ver*:*w_flow*:*Yes***No*:*w_choices*:*false***false*:*w_choices_checked*:*1*:*w_rowcol*:*no*:*w_required*:*no*:*w_randomize*:*no*:*w_allow_other*:*0*:*w_allow_other_num*:**:*w_class*:**:*new_field*:*5*:*id*:*type_radio*:*type*:*Has the camper been camping before?*:*w_field_label*:*250*:*w_field_label_size*:*left*:*w_field_label_pos*:*ver*:*w_flow*:*Yes***No*:*w_choices*:*false***false*:*w_choices_checked*:*1*:*w_rowcol*:*no*:*w_required*:*no*:*w_randomize*:*no*:*w_allow_other*:*0*:*w_allow_other_num*:**:*w_class*:**:*new_field*:*6*:*id*:*type_textarea*:*type*:*Any questions or concern:*:*w_field_label*:*250*:*w_field_label_size*:*left*:*w_field_label_pos*:*200*:*w_size_w*:*100*:*w_size_h*:**:*w_first_val*:**:*w_title*:*no*:*w_required*:*no*:*w_unique*:**:*w_class*:**:*new_field*:*7*:*id*:*type_submit_reset*:*type*:*type_submit_reset_7*:*w_field_label*:*Submit*:*w_submit_title*:*Reset*:*w_reset_title*:**:*w_class*:*false*:*w_act*:**:*new_field*:*\', 1, 1, \'*\', \'\', \'\', \'\', \'\', 1, \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', 1, 1, 1, 1,\'administrator,\',1,\'\',\'\', 0)');
191
+ $wpdb->query('INSERT INTO `' . $wpdb->prefix . 'formmaker` VALUES(NULL, \'Business Demographic Survey\', \'\', \'<div class="wdform-page-and-images" style="display:table; border-top:0px solid black;"><div id="form_id_tempform_view1" class="wdform_page" page_title="Untitled page" next_title="Next" next_type="text" next_class="wdform-page-button" next_checkable="false" previous_title="Previous" previous_type="text" previous_class="wdform-page-button" previous_checkable="false"><div class="wdform_section"><div class="wdform_column"></div></div><div wdid="1" type="type_section_break" class="wdform_tr_section_break">%1 - custom_1%</div><div class="wdform_section"><div class="wdform_column"><div wdid="2" class="wdform_row">%2 - <b>What is your employment status?</b>%</div><div wdid="3" class="wdform_row">%3 - <b>What is your level of education?</b>%</div><div wdid="4" class="wdform_row">%4 - <b>In which industry do you work?</b>%</div><div wdid="5" class="wdform_row">%5 - <b>What is the annual revenue of your company?</b>%</div><div wdid="6" class="wdform_row">%6 - Word Verification:%</div><div wdid="7" class="wdform_row">%7 - type_submit_reset_7%</div></div></div><div valign="top" class="wdform_footer" style="width: 100%;"><div style="width: 100%;"><div style="width: 100%; display: table;"><div style="display: table-row-group;"><div id="form_id_temppage_nav1" style="display: table-row;"></div></div></div></div></div></div></div>\', 10, \'// Occurs before the form is loaded\r\nfunction before_load()\r\n{\r\n\r\n}\r\n\r\n// Occurs just before submitting the form\r\nfunction before_submit()\r\n{\r\n\r\n}\r\n\r\n// Occurs just before resetting the form\r\nfunction before_reset()\r\n{\r\n\r\n}\', \'\', \'\', 1, \'<p>%all%</p>\', \'<p>%all%</p>\', 8, 1, \'2#**id**#What is your employment status?#**label**#type_radio#****#3#**id**#What is your level of education?#**label**#type_radio#****#4#**id**#In which industry do you work?#**label**#type_own_select#****#5#**id**#What is the annual revenue of your company?#**label**#type_radio#****#6#**id**#Word Verification:#**label**#type_captcha#****#7#**id**#type_submit_reset_7#**label**#type_submit_reset#****#\', \'2#**id**#What is your employment status?#**label**#type_radio#****#3#**id**#What is your level of education?#**label**#type_radio#****#4#**id**#In which industry do you work?#**label**#type_own_select#****#5#**id**#What is the annual revenue of your company?#**label**#type_radio#****#6#**id**#Word Verification:#**label**#type_captcha#****#7#**id**#type_submit_reset_7#**label**#type_submit_reset#****#\', 0, \'none\', \'false\', \'true\', \'\', \'\', \'\', 0, \'\', \'\', \'USD\', 0, \'1*:*id*:*type_section_break*:*type*:*custom_1*:*w_field_label*:*<h2 id="header_1" style="font-size: 1.285714286rem; font-family: Helvetica, Arial, sans-serif; color: rgb(68, 68, 68); clear: both; line-height: 1.6; margin: 1.714285714rem 0px;">Business Demographic Survey</h2><p style="line-height: 1.714285714; margin: 0px 0px 1.714285714rem; color: rgb(68, 68, 68); font-family: Helvetica, Arial, sans-serif; font-size: 14px;"></p><div id="subHeader_1" style="color: rgb(68, 68, 68); font-family: Helvetica, Arial, sans-serif; font-size: 14px; line-height: 14px;">Thank you for joining our business demographic survey. Please give us your feedback by filling in the information bellow.</div><p><br></p>*:*w_editor*:**:*new_field*:*2*:*id*:*type_radio*:*type*:*<b>What is your employment status?</b>*:*w_field_label*:*600*:*w_field_label_size*:*top*:*w_field_label_pos*:*ver*:*w_flow*:*Employed full time***Trade or Vocational degree***Not employed, but looking for work***Not employed and not looking for work***Retired***Student***Homemaker***Prefer not to answer*:*w_choices*:*false***false***false***false***false***false***false***false*:*w_choices_checked*:*1*:*w_rowcol*:*no*:*w_required*:*no*:*w_randomize*:*no*:*w_allow_other*:*0*:*w_allow_other_num*:**:*w_class*:**:*new_field*:*3*:*id*:*type_radio*:*type*:*<b>What is your level of education?</b>*:*w_field_label*:*600*:*w_field_label_size*:*top*:*w_field_label_pos*:*ver*:*w_flow*:*Some high school***High school graduate or equivalent***Trade or Vocational Degree***Some college***Associate degree***Bachelor&#39;s degree***Graduate or Professional degree***Prefer not to answer*:*w_choices*:*false***false***false***false***false***false***false***false*:*w_choices_checked*:*1*:*w_rowcol*:*no*:*w_required*:*no*:*w_randomize*:*no*:*w_allow_other*:*0*:*w_allow_other_num*:**:*w_class*:**:*new_field*:*4*:*id*:*type_own_select*:*type*:*<b>In which industry do you work?</b>*:*w_field_label*:*500*:*w_field_label_size*:*top*:*w_field_label_pos*:*200*:*w_size*:****option 1***option 2***option 3*:*w_choices*:*true***false***false***false*:*w_choices_checked*:*true***false***false***false*:*w_choices_disabled*:*no*:*w_required*:*wdform_select*:*w_class*:**:*new_field*:*5*:*id*:*type_radio*:*type*:*<b>What is the annual revenue of your company?</b>*:*w_field_label*:*600*:*w_field_label_size*:*top*:*w_field_label_pos*:*ver*:*w_flow*:*Under $10,000***$10,001 to $50,000***$50,001 to $100,000***$100,001 to $500,000***$500,001 to $1 Million***$1 Million to $10 Million***$10 Million to $50 Million***$50 Million to $100 Million***Over $100 Million*:*w_choices*:*false***false***false***false***false***false***false***false***false*:*w_choices_checked*:*1*:*w_rowcol*:*no*:*w_required*:*no*:*w_randomize*:*no*:*w_allow_other*:*0*:*w_allow_other_num*:**:*w_class*:**:*new_field*:*6*:*id*:*type_captcha*:*type*:*Word Verification:*:*w_field_label*:*500*:*w_field_label_size*:*top*:*w_field_label_pos*:*6*:*w_digit*:**:*w_class*:**:*new_field*:*7*:*id*:*type_submit_reset*:*type*:*type_submit_reset_7*:*w_field_label*:*Submit*:*w_submit_title*:*Reset*:*w_reset_title*:**:*w_class*:*false*:*w_act*:**:*new_field*:*\', 1, 1, \'*\', \'\', \'\', \'\', \'\', 1, \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', 1, 1, 1, 1,\'administrator,\',1,\'\',\'\', 0)');
192
+ $wpdb->query('INSERT INTO `' . $wpdb->prefix . 'formmaker` VALUES(NULL, \'Register Your Business\', \'\', \'<div class="wdform-page-and-images" style="display:table; border-top:0px solid black;"><div id="form_id_tempform_view1" class="wdform_page" page_title="Untitled page" next_title="Next" next_type="text" next_class="wdform-page-button" next_checkable="false" previous_title="Previous" previous_type="text" previous_class="wdform-page-button" previous_checkable="false"><div class="wdform_section"><div class="wdform_column"><div wdid="1" class="wdform_row">%1 - Business Owner %</div><div wdid="2" class="wdform_row">%2 - Business Name%</div><div wdid="3" class="wdform_row">%3 - E-mail%</div><div wdid="4" class="wdform_row">%4 - Address:%</div><div wdid="10" class="wdform_row">%10 - Type of Business%</div><div wdid="11" class="wdform_row">%11 - Message%</div><div wdid="12" class="wdform_row">%12 - type_submit_reset_12%</div></div></div><div valign="top" class="wdform_footer" style="width: 100%;"><div style="width: 100%;"><div style="width: 100%; display: table;"><div style="display: table-row-group;"><div id="form_id_temppage_nav1" style="display: table-row;"></div></div></div></div></div></div></div>\', 26, \'// Occurs before the form is loaded\r\nfunction before_load()\r\n{\r\n\r\n}\r\n\r\n// Occurs just before submitting the form\r\nfunction before_submit()\r\n{\r\n\r\n}\r\n\r\n// Occurs just before resetting the form\r\nfunction before_reset()\r\n{\r\n\r\n}\', \'\', \'\', 0, \'%all%\', \'%all%\', 13, 1, \'1#**id**#Business Owner #**label**#type_name#****#2#**id**#Business Name#**label**#type_text#****#3#**id**#E-mail#**label**#type_submitter_mail#****#4#**id**#Street Address#**label**#type_address#****#5#**id**#Street Address Line 2#**label**#type_address#****#6#**id**#City#**label**#type_address#****#7#**id**#State / Province / Region#**label**#type_address#****#8#**id**#Postal / Zip Code#**label**#type_address#****#9#**id**#Country#**label**#type_address#****#10#**id**#Type of Business#**label**#type_own_select#****#11#**id**#Message#**label**#type_textarea#****#12#**id**#type_submit_reset_12#**label**#type_submit_reset#****#\', \'1#**id**#Business Owner #**label**#type_name#****#2#**id**#Business Name#**label**#type_text#****#3#**id**#E-mail#**label**#type_submitter_mail#****#4#**id**#Street Address#**label**#type_address#****#5#**id**#Street Address Line 2#**label**#type_address#****#6#**id**#City#**label**#type_address#****#7#**id**#State / Province / Region#**label**#type_address#****#8#**id**#Postal / Zip Code#**label**#type_address#****#9#**id**#Country#**label**#type_address#****#10#**id**#Type of Business#**label**#type_own_select#****#11#**id**#Message#**label**#type_textarea#****#12#**id**#type_submit_reset_12#**label**#type_submit_reset#****#\', 0, \'none\', \'false\', \'true\', \'\', \'\', \'\', 0, \'\', \'\', \'USD\', 0, \'1*:*id*:*type_name*:*type*:*Business Owner *:*w_field_label*:*150*:*w_field_label_size*:*left*:*w_field_label_pos*:*****:*w_first_val*:*****:*w_title*:*Title***First***Last***Middle*:*w_mini_labels*:*100*:*w_size*:*normal*:*w_name_format*:*yes*:*w_required*:*no*:*w_unique*:**:*w_class*:**:*new_field*:*2*:*id*:*type_text*:*type*:*Business Name*:*w_field_label*:*150*:*w_field_label_size*:*left*:*w_field_label_pos*:*200*:*w_size*:**:*w_first_val*:**:*w_title*:*yes*:*w_required*:*no*:*w_unique*:**:*new_field*:*3*:*id*:*type_submitter_mail*:*type*:*E-mail*:*w_field_label*:*150*:*w_field_label_size*:*left*:*w_field_label_pos*:*200*:*w_size*:**:*w_first_val*:**:*w_title*:*yes*:*w_required*:**:*w_unique*:**:*w_class*:**:*new_field*:*4*:*id*:*type_address*:*type*:*Address:*:*w_field_label*:*150*:*w_field_label_size*:*left*:*w_field_label_pos*:*300*:*w_size*:*Street Address***Street Address Line 2***City***State / Province / Region***Postal / Zip Code***Country*:*w_mini_labels*:*no***no***no***no***no***no****:*w_disabled_fields*:*no*:*w_required*:*wdform_address*:*w_class*:**:*new_field*:*10*:*id*:*type_own_select*:*type*:*Type of Business*:*w_field_label*:*150*:*w_field_label_size*:*left*:*w_field_label_pos*:*200*:*w_size*:*Select value***option 1***option 2*:*w_choices*:*true***false***false*:*w_choices_checked*:*true***false***false*:*w_choices_disabled*:*yes*:*w_required*:*wdform_select*:*w_class*:**:*new_field*:*11*:*id*:*type_textarea*:*type*:*Message*:*w_field_label*:*150*:*w_field_label_size*:*left*:*w_field_label_pos*:*200*:*w_size_w*:*100*:*w_size_h*:**:*w_first_val*:**:*w_title*:*no*:*w_required*:*no*:*w_unique*:**:*w_class*:**:*new_field*:*12*:*id*:*type_submit_reset*:*type*:*type_submit_reset_12*:*w_field_label*:*Submit*:*w_submit_title*:*Reset*:*w_reset_title*:**:*w_class*:*false*:*w_act*:**:*new_field*:*\', 1, 1, \'*\', \'\', \'\', \'\', \'\', 1, \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', 1, 1, 1, 1,\'administrator,\',1,\'\',\'\', 0)');
193
+ $wpdb->query('INSERT INTO `' . $wpdb->prefix . 'formmaker` VALUES(NULL, \'Cupcake Order Form\', \'\', \'<div class="wdform-page-and-images" style="display:table; border-top:0px solid black;"><div id="form_id_tempform_view1" class="wdform_page" page_title="Untitled page" next_title="Next" next_type="text" next_class="wdform-page-button" next_checkable="false" previous_title="Previous" previous_type="text" previous_class="wdform-page-button" previous_checkable="false"><div class="wdform_section"><div class="wdform_column"><div wdid="1" class="wdform_row">%1 - Date%</div><div wdid="2" class="wdform_row">%2 - Name%</div><div wdid="3" class="wdform_row">%3 - E-mail:%</div><div wdid="4" class="wdform_row">%4 - <b>Cupcakes <br> Flavors (1 doz. minimum)</b>%</div><div wdid="5" class="wdform_row">%5 - Quantity%</div><div wdid="6" class="wdform_row">%6 - Details (if any)%</div><div wdid="7" class="wdform_row">%7 - type_submit_reset_7%</div></div></div><div valign="top" class="wdform_footer" style="width: 100%;"><div style="width: 100%;"><div style="width: 100%; display: table;"><div style="display: table-row-group;"><div id="form_id_temppage_nav1" style="display: table-row;"></div></div></div></div></div></div></div>\', 6, \'// Occurs before the form is loaded\r\nfunction before_load()\r\n{\r\n\r\n}\r\n\r\n// Occurs just before submitting the form\r\nfunction before_submit()\r\n{\r\n\r\n}\r\n\r\n// Occurs just before resetting the form\r\nfunction before_reset()\r\n{\r\n\r\n}\', \'\', \'\', 0, \'%all%\', \'%all%\', 8, 1, \'1#**id**#Date#**label**#type_date#****#2#**id**#Name#**label**#type_name#****#3#**id**#E-mail:#**label**#type_submitter_mail#****#4#**id**#Cupcakes Flavors (1 doz. minimum)#**label**#type_checkbox#****#5#**id**#Quantity#**label**#type_own_select#****#6#**id**#Details (if any)#**label**#type_textarea#****#7#**id**#type_submit_reset_7#**label**#type_submit_reset#****#\', \'1#**id**#Date#**label**#type_date#****#2#**id**#Name#**label**#type_name#****#3#**id**#E-mail:#**label**#type_submitter_mail#****#4#**id**#Cupcakes Flavors (1 doz. minimum)#**label**#type_checkbox#****#5#**id**#Quantity#**label**#type_own_select#****#6#**id**#Details (if any)#**label**#type_textarea#****#7#**id**#type_submit_reset_7#**label**#type_submit_reset#****#\', 0, \'none\', \'false\', \'true\', \'\', \'\', \'\', 0, \'\', \'\', \'USD\', 0, \'1*:*id*:*type_date*:*type*:*Date*:*w_field_label*:*150*:*w_field_label_size*:*left*:*w_field_label_pos*:**:*w_date*:*yes*:*w_required*:**:*w_class*:*%Y-%m-%d*:*w_format*:*...*:*w_but_val*:**:*new_field*:*2*:*id*:*type_name*:*type*:*Name*:*w_field_label*:*150*:*w_field_label_size*:*left*:*w_field_label_pos*:*****:*w_first_val*:*****:*w_title*:*Title***First***Last***Middle*:*w_mini_labels*:*100*:*w_size*:*normal*:*w_name_format*:*yes*:*w_required*:*no*:*w_unique*:**:*w_class*:**:*new_field*:*3*:*id*:*type_submitter_mail*:*type*:*E-mail:*:*w_field_label*:*150*:*w_field_label_size*:*left*:*w_field_label_pos*:*200*:*w_size*:**:*w_first_val*:**:*w_title*:*yes*:*w_required*:**:*w_unique*:**:*w_class*:**:*new_field*:*4*:*id*:*type_checkbox*:*type*:*<b>Cupcakes <br> Flavors (1 doz. minimum)</b>*:*w_field_label*:*150*:*w_field_label_size*:*left*:*w_field_label_pos*:*ver*:*w_flow*:*Red Velvet ($150.00 TTD)***Vanilla ($100.00 TTD)***Chocolate ($120.00 TTD)***Guinness ($150.00 TTD)***Coconut ($120.00 TTD)***Lemon ($100.00 TTD)***Chocolate Mint ($120.00 TTD)*:*w_choices*:*false***false***false***false***false***false***false*:*w_choices_checked*:*1*:*w_rowcol*:*no*:*w_required*:*no*:*w_randomize*:*no*:*w_allow_other*:*0*:*w_allow_other_num*:**:*w_class*:**:*new_field*:*5*:*id*:*type_own_select*:*type*:*Quantity*:*w_field_label*:*150*:*w_field_label_size*:*left*:*w_field_label_pos*:*50*:*w_size*:****1***2***3***4***5***6***7***8***9***10*:*w_choices*:*true***false***false***false***false***false***false***false***false***false***false*:*w_choices_checked*:*true***false***false***false***false***false***false***false***false***false***false*:*w_choices_disabled*:*no*:*w_required*:*wdform_select*:*w_class*:**:*new_field*:*6*:*id*:*type_textarea*:*type*:*Details (if any)*:*w_field_label*:*150*:*w_field_label_size*:*left*:*w_field_label_pos*:*200*:*w_size_w*:*100*:*w_size_h*:**:*w_first_val*:**:*w_title*:*no*:*w_required*:*no*:*w_unique*:**:*w_class*:**:*new_field*:*7*:*id*:*type_submit_reset*:*type*:*type_submit_reset_7*:*w_field_label*:*Submit*:*w_submit_title*:*Reset*:*w_reset_title*:**:*w_class*:*false*:*w_act*:**:*new_field*:*\', 1, 1, \'*\', \'\', \'\', \'\', \'\', 1, \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', 1, 1, 1, 1,\'administrator,\',1,\'\',\'\', 0)');
194
+ $wpdb->query('INSERT INTO `' . $wpdb->prefix . 'formmaker` VALUES(NULL, \'Seminar Evaluation Survey\', \'\', \'<div class="wdform-page-and-images" style="display:table; border-top:0px solid black;"><div id="form_id_tempform_view1" class="wdform_page" page_title="Untitled page" next_title="Next" next_type="text" next_class="wdform-page-button" next_checkable="false" previous_title="Previous" previous_type="text" previous_class="wdform-page-button" previous_checkable="false"><div class="wdform_section"><div class="wdform_column"></div></div><div wdid="1" type="type_section_break" class="wdform_tr_section_break">%1 - custom_1%</div><div class="wdform_section"><div class="wdform_column"><div wdid="2" class="wdform_row">%2 - <b>Company</b>%</div><div wdid="3" class="wdform_row">%3 - <b>Occupation</b>%</div><div wdid="4" class="wdform_row">%4 - <b>Was it worth its money?</b>%</div><div wdid="5" class="wdform_row">%5 - <b>On average how would you rate the seminar?</b>%</div><div wdid="6" class="wdform_row">%6 - type_submit_reset_6%</div></div></div><div valign="top" class="wdform_footer" style="width: 100%;"><div style="width: 100%;"><div style="width: 100%; display: table;"><div style="display: table-row-group;"><div id="form_id_temppage_nav1" style="display: table-row;"></div></div></div></div></div></div></div>\', 16, \'// Occurs before the form is loaded\r\nfunction before_load()\r\n{\r\n\r\n}\r\n\r\n// Occurs just before submitting the form\r\nfunction before_submit()\r\n{\r\n\r\n}\r\n\r\n// Occurs just before resetting the form\r\nfunction before_reset()\r\n{\r\n\r\n}\', \'\', \'\', 0, \'%all%\', \'%all%\', 7, 1, \'2#**id**#Company#**label**#type_text#****#3#**id**#Occupation#**label**#type_text#****#4#**id**#Was it worth its money?#**label**#type_radio#****#5#**id**#On average how would you rate the seminar?#**label**#type_radio#****#6#**id**#type_submit_reset_6#**label**#type_submit_reset#****#\', \'2#**id**#Company#**label**#type_text#****#3#**id**#Occupation#**label**#type_text#****#4#**id**#Was it worth its money?#**label**#type_radio#****#5#**id**#On average how would you rate the seminar?#**label**#type_radio#****#6#**id**#type_submit_reset_6#**label**#type_submit_reset#****#\', 0, \'none\', \'false\', \'true\', \'\', \'\', \'\', 0, \'\', \'\', \'USD\', 0, \'1*:*id*:*type_section_break*:*type*:*custom_1*:*w_field_label*:*<h1 id="header_1" style="font-size: 1.5rem; font-family: Helvetica, Arial, sans-serif; color: rgb(68, 68, 68); clear: both; line-height: 1.5; margin: 1.714285714rem 0px;">Seminar Evaluation Survey</h1><div id="subHeader_1" style="color: rgb(68, 68, 68); font-family: Helvetica, Arial, sans-serif; font-size: 14px; line-height: 14px;">Please take a few minutes to complete this evaluation survey</div>*:*w_editor*:**:*new_field*:*2*:*id*:*type_text*:*type*:*<b>Company</b>*:*w_field_label*:*150*:*w_field_label_size*:*top*:*w_field_label_pos*:*200*:*w_size*:**:*w_first_val*:**:*w_title*:*no*:*w_required*:*no*:*w_unique*:**:*new_field*:*3*:*id*:*type_text*:*type*:*<b>Occupation</b>*:*w_field_label*:*150*:*w_field_label_size*:*top*:*w_field_label_pos*:*200*:*w_size*:**:*w_first_val*:**:*w_title*:*no*:*w_required*:*no*:*w_unique*:**:*new_field*:*4*:*id*:*type_radio*:*type*:*<b>Was it worth its money?</b>*:*w_field_label*:*200*:*w_field_label_size*:*top*:*w_field_label_pos*:*ver*:*w_flow*:*Yes***No*:*w_choices*:*false***false*:*w_choices_checked*:*1*:*w_rowcol*:*no*:*w_required*:*no*:*w_randomize*:*no*:*w_allow_other*:*0*:*w_allow_other_num*:**:*w_class*:**:*new_field*:*5*:*id*:*type_radio*:*type*:*<b>On average how would you rate the seminar?</b>*:*w_field_label*:*400*:*w_field_label_size*:*top*:*w_field_label_pos*:*ver*:*w_flow*:*Very good***Good***Neutral***Bad***Very bad*:*w_choices*:*false***false***false***false***false*:*w_choices_checked*:*1*:*w_rowcol*:*no*:*w_required*:*no*:*w_randomize*:*no*:*w_allow_other*:*0*:*w_allow_other_num*:**:*w_class*:**:*new_field*:*6*:*id*:*type_submit_reset*:*type*:*type_submit_reset_6*:*w_field_label*:*Submit*:*w_submit_title*:*Reset*:*w_reset_title*:**:*w_class*:*false*:*w_act*:**:*new_field*:*\', 1, 1, \'*\', \'\', \'\', \'\', \'\', 1, \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', 1, 1, 1, 1,\'administrator,\',1,\'\',\'\', 0)');
195
+ $wpdb->query('INSERT INTO `' . $wpdb->prefix . 'formmaker` VALUES(NULL, \'Restaurant Evaluation Survey\', \'\', \'<div class="wdform-page-and-images" style="display:table; border-top:0px solid black;"><div id="form_id_tempform_view1" class="wdform_page" page_title="Untitled page" next_title="Next" next_type="text" next_class="wdform-page-button" next_checkable="false" previous_title="Previous" previous_type="text" previous_class="wdform-page-button" previous_checkable="false"><div class="wdform_section"><div class="wdform_column"></div></div><div wdid="1" type="type_section_break" class="wdform_tr_section_break">%1 - custom_1%</div><div class="wdform_section"><div class="wdform_column"><div wdid="2" class="wdform_row">%2 - Day Visited:%</div><div wdid="3" class="wdform_row">%3 - <b>Dine In / Take Out:</b>%</div><div wdid="4" class="wdform_row">%4 - <b>Food Quality:</b>%</div><div wdid="5" class="wdform_row">%5 - <b>Speed of Service:</b>%</div><div wdid="6" class="wdform_row">%6 - <b>Any comments, questions or suggestions?</b>%</div><div wdid="7" class="wdform_row">%7 - type_submit_reset_7%</div></div></div><div valign="top" class="wdform_footer" style="width: 100%;"><div style="width: 100%;"><div style="width: 100%; display: table;"><div style="display: table-row-group;"><div id="form_id_temppage_nav1" style="display: table-row;"></div></div></div></div></div></div></div>\', 21, \'// Occurs before the form is loaded\r\nfunction before_load()\r\n{\r\n\r\n}\r\n\r\n// Occurs just before submitting the form\r\nfunction before_submit()\r\n{\r\n\r\n}\r\n\r\n// Occurs just before resetting the form\r\nfunction before_reset()\r\n{\r\n\r\n}\', \'\', \'\', 0, \'%all%\', \'%all%\', 8, 1, \'2#**id**#Day Visited:#**label**#type_date#****#3#**id**#Dine In / Take Out:#**label**#type_radio#****#4#**id**#Food Quality:#**label**#type_radio#****#5#**id**#Speed of Service:#**label**#type_radio#****#6#**id**#Any comments, questions or suggestions?#**label**#type_textarea#****#7#**id**#type_submit_reset_7#**label**#type_submit_reset#****#\', \'2#**id**#Day Visited:#**label**#type_date#****#3#**id**#Dine In / Take Out:#**label**#type_radio#****#4#**id**#Food Quality:#**label**#type_radio#****#5#**id**#Speed of Service:#**label**#type_radio#****#6#**id**#Any comments, questions or suggestions?#**label**#type_textarea#****#7#**id**#type_submit_reset_7#**label**#type_submit_reset#****#\', 0, \'none\', \'false\', \'true\', \'\', \'\', \'\', 0, \'\', \'\', \'USD\', 0, \'1*:*id*:*type_section_break*:*type*:*custom_1*:*w_field_label*:*<h2 id="header_21" style="font-size: 1.285714286rem; font-family: Helvetica, Arial, sans-serif; color: rgb(68, 68, 68); clear: both; line-height: 1.6; margin: 1.714285714rem 0px;">Restaurant Evaluation Survey</h2><div id="subHeader_21" style="color: rgb(68, 68, 68); font-family: Helvetica, Arial, sans-serif; font-size: 14px; line-height: 14px;">Please let us know how was the food and service.</div><p><br></p>*:*w_editor*:**:*new_field*:*2*:*id*:*type_date*:*type*:*Day Visited:*:*w_field_label*:*150*:*w_field_label_size*:*left*:*w_field_label_pos*:**:*w_date*:*no*:*w_required*:**:*w_class*:*%Y-%m-%d*:*w_format*:*...*:*w_but_val*:**:*new_field*:*3*:*id*:*type_radio*:*type*:*<b>Dine In / Take Out:</b>*:*w_field_label*:*150*:*w_field_label_size*:*left*:*w_field_label_pos*:*ver*:*w_flow*:*Dine In***Dine Out*:*w_choices*:*false***false*:*w_choices_checked*:*1*:*w_rowcol*:*no*:*w_required*:*no*:*w_randomize*:*no*:*w_allow_other*:*0*:*w_allow_other_num*:**:*w_class*:**:*new_field*:*4*:*id*:*type_radio*:*type*:*<b>Food Quality:</b>*:*w_field_label*:*150*:*w_field_label_size*:*left*:*w_field_label_pos*:*ver*:*w_flow*:*Excellent***Good***Average***Dissatisfied*:*w_choices*:*false***false***false***false*:*w_choices_checked*:*1*:*w_rowcol*:*no*:*w_required*:*no*:*w_randomize*:*no*:*w_allow_other*:*0*:*w_allow_other_num*:**:*w_class*:**:*new_field*:*5*:*id*:*type_radio*:*type*:*<b>Speed of Service:</b>*:*w_field_label*:*150*:*w_field_label_size*:*left*:*w_field_label_pos*:*ver*:*w_flow*:*Excellent***Good***Average***Dissatisfied*:*w_choices*:*false***false***false***false*:*w_choices_checked*:*1*:*w_rowcol*:*no*:*w_required*:*no*:*w_randomize*:*no*:*w_allow_other*:*0*:*w_allow_other_num*:**:*w_class*:**:*new_field*:*6*:*id*:*type_textarea*:*type*:*<b>Any comments, questions or suggestions?</b>*:*w_field_label*:*300*:*w_field_label_size*:*top*:*w_field_label_pos*:*300*:*w_size_w*:*100*:*w_size_h*:**:*w_first_val*:**:*w_title*:*no*:*w_required*:*no*:*w_unique*:**:*w_class*:**:*new_field*:*7*:*id*:*type_submit_reset*:*type*:*type_submit_reset_7*:*w_field_label*:*Submit*:*w_submit_title*:*Reset*:*w_reset_title*:**:*w_class*:*false*:*w_act*:**:*new_field*:*\', 1, 1, \'*\', \'\', \'\', \'\', \'\', 1, \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', 1, 1, 1, 1,\'administrator,\',1,\'\',\'\', 0)');
196
+ $wpdb->query('INSERT INTO `' . $wpdb->prefix . 'formmaker` VALUES(NULL, \'Product Survey\', \'\', \'<div class="wdform-page-and-images" style="display:table; border-top:0px solid black;"><div id="form_id_tempform_view1" class="wdform_page" page_title="Untitled page" next_title="Next" next_type="text" next_class="wdform-page-button" next_checkable="false" previous_title="Previous" previous_type="text" previous_class="wdform-page-button" previous_checkable="false"><div class="wdform_section"><div class="wdform_column"></div></div><div wdid="1" type="type_section_break" class="wdform_tr_section_break">%1 - custom_1%</div><div class="wdform_section"><div class="wdform_column"><div wdid="2" class="wdform_row">%2 - 1. Please indicate if you agree or disagree with the following statements%</div><div wdid="3" class="wdform_row">%3 - 2. How likely are you to recommend [Product/Service] to a friend or co-worker?%</div><div wdid="4" class="wdform_row">%4 - 3. What is the amount you would ever pay for a product like ours%</div><div wdid="5" class="wdform_row">%5 - 4. Please rate the product %</div><div wdid="6" class="wdform_row">%6 - type_submit_reset_6%</div></div></div><div valign="top" class="wdform_footer" style="width: 100%;"><div style="width: 100%;"><div style="width: 100%; display: table;"><div style="display: table-row-group;"><div id="form_id_temppage_nav1" style="display: table-row;"></div></div></div></div></div></div></div>\', 29, \'// Occurs before the form is loaded\r\nfunction before_load()\r\n{\r\n\r\n}\r\n\r\n// Occurs just before submitting the form\r\nfunction before_submit()\r\n{\r\n\r\n}\r\n\r\n// Occurs just before resetting the form\r\nfunction before_reset()\r\n{\r\n\r\n}\', \'\', \'\', 0, \'%all%\', \'%all%\', 7, 1, \'2#**id**#1. Please indicate if you agree or disagree with the following statements#**label**#type_matrix#****#3#**id**#2. How likely are you to recommend [Product/Service] to a friend or co-worker?#**label**#type_scale_rating#****#4#**id**#3. What is the amount you would ever pay for a product like ours#**label**#type_range#****#5#**id**#4. Please rate the product #**label**#type_star_rating#****#6#**id**#type_submit_reset_6#**label**#type_submit_reset#****#\', \'2#**id**#1. Please indicate if you agree or disagree with the following statements#**label**#type_matrix#****#3#**id**#2. How likely are you to recommend [Product/Service] to a friend or co-worker?#**label**#type_scale_rating#****#4#**id**#3. What is the amount you would ever pay for a product like ours#**label**#type_range#****#5#**id**#4. Please rate the product #**label**#type_star_rating#****#6#**id**#type_submit_reset_6#**label**#type_submit_reset#****#\', 0, \'none\', \'false\', \'true\', \'\', \'\', \'\', 0, \'\', \'\', \'USD\', 0, \'1*:*id*:*type_section_break*:*type*:*custom_1*:*w_field_label*:*<h1 class="sg-title" data-mce-style="font-size: 2.2em; color: #fff; font-weight: normal; line-height: normal;" style="font-size: 2.2em; font-weight: normal; color: rgb(255, 255, 255); line-height: normal;">Product Survey</h1>*:*w_editor*:**:*new_field*:*2*:*id*:*type_matrix*:*type*:*1. Please indicate if you agree or disagree with the following statements*:*w_field_label*:*600*:*w_field_label_size*:*top*:*w_field_label_pos*:*radio*:*w_field_input_type*:****Product is affordable***Product is valuable***Product is better<br> than other products on<br> the market***Product is easy to use*:*w_rows*:****Strongly Disagree***Disagree***Neutral***Agree***Strongly Agree*:*w_columns*:*no*:*w_required*:*wdform_matrix*:*w_class*:**:*new_field*:*3*:*id*:*type_scale_rating*:*type*:*2. How likely are you to recommend [Product/Service] to a friend or co-worker?*:*w_field_label*:*600*:*w_field_label_size*:*top*:*w_field_label_pos*:*Will not recommend *** I will recommend*:*w_mini_labels*:*5*:*w_scale_amount*:*no*:*w_required*:*wdform_scale_rating*:*w_class*:**:*new_field*:*4*:*id*:*type_range*:*type*:*3. What is the amount you would ever pay for a product like ours*:*w_field_label*:*600*:*w_field_label_size*:*top*:*w_field_label_pos*:*40*:*w_field_range_width*:*1*:*w_field_range_step*:*null*:*w_field_value1*:*null*:*w_field_value2*:*From***To*:*w_mini_labels*:*no*:*w_required*:**:*w_class*:**:*new_field*:*5*:*id*:*type_star_rating*:*type*:*4. Please rate the product *:*w_field_label*:*150*:*w_field_label_size*:*top*:*w_field_label_pos*:*yellow*:*w_field_label_col*:*10*:*w_star_amount*:*no*:*w_required*:*wdform_star_rating*:*w_class*:**:*new_field*:*6*:*id*:*type_submit_reset*:*type*:*type_submit_reset_6*:*w_field_label*:*Submit*:*w_submit_title*:*Reset*:*w_reset_title*:**:*w_class*:*true*:*w_act*:**:*new_field*:*\', 1, 1, \'*\', \'\', \'\', \'\', \'\', 1, \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', 1, 1, 1, 1,\'administrator,\',1,\'\',\'\', 0)');
197
  }
198
  }
199
 
form_maker_update.php CHANGED
@@ -96,6 +96,9 @@ function form_maker_update($version) {
96
  $wpdb->query("ALTER TABLE `" . $wpdb->prefix . "formmaker` ADD `frontend_submit_stat_fields` text NOT NULL DEFAULT ''");
97
  $wpdb->query('UPDATE ' . $wpdb->prefix . 'formmaker_themes SET `css` = CONCAT(css,"\r\n.wdform_column {\r\n border-right: none !important;\r\n }")');
98
  }
 
 
 
99
  return;
100
  }
101
 
96
  $wpdb->query("ALTER TABLE `" . $wpdb->prefix . "formmaker` ADD `frontend_submit_stat_fields` text NOT NULL DEFAULT ''");
97
  $wpdb->query('UPDATE ' . $wpdb->prefix . 'formmaker_themes SET `css` = CONCAT(css,"\r\n.wdform_column {\r\n border-right: none !important;\r\n }")');
98
  }
99
+ if (version_compare($version, '1.7.35') == -1) {
100
+ $wpdb->query("ALTER TABLE `" . $wpdb->prefix . "formmaker` ADD `mail_emptyfields` tinyint(4) NOT NULL DEFAULT '0'");
101
+ }
102
  return;
103
  }
104
 
frontend/models/FMModelForm_maker.php CHANGED
@@ -1410,2531 +1410,2577 @@ class FMModelForm_maker {
1410
  }
1411
  }
1412
 
1413
- public function gen_mail($counter, $all_files, $id, $str) {
1414
- $ip = $_SERVER['REMOTE_ADDR'];
1415
- $replyto = '';
1416
- global $wpdb;
1417
- $row = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id=%d", $id));
1418
- if (!$row->form_front) {
1419
- $id = '';
1420
- }
1421
-
1422
- $custom_fields = array('ip', 'useremail', 'username', 'subid', 'all' );
1423
- $subid = $wpdb->get_var("SELECT MAX( group_id ) FROM " . $wpdb->prefix ."formmaker_submits" );
1424
 
1425
- $current_user = wp_get_current_user();
1426
- if ($current_user->ID != 0)
1427
- {
1428
- $username = $current_user->display_name;
1429
- $useremail = $current_user->user_email;
1430
- }
1431
- else
1432
- {
1433
- $username = '';
1434
- $useremail = '';
1435
- }
1436
 
1437
- $label_order_original = array();
1438
- $label_order_ids = array();
1439
- $label_label = array();
1440
- $label_type = array();
1441
- $total = 0;
1442
- $form_currency = '$';
1443
- $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');
1444
- $currency_sign = array('$', '&#8364;', '&#163;', '&#165;', 'C$', 'Mex$', 'HK$', 'Ft', 'kr', 'NZ$', 'S$', 'kr', 'zl', 'A$', 'kr', 'CHF', 'Kc', '&#8362;', 'R$', 'NT$', 'RM', '&#8369;', '&#xe3f;');
1445
- if ($row->payment_currency) {
1446
- $form_currency = $currency_sign[array_search($row->payment_currency, $currency_code)];
1447
- }
1448
-
1449
- $old = false;
1450
  if(isset($row->form)) {
1451
  $old = true;
1452
- }
1453
-
1454
- $cc = array();
1455
- $row_mail_one_time = 1;
1456
-
1457
- $label_type= array();
1458
-
1459
  if($old == false || ($old == true && $row->form == '')) {
1460
  $label_all = explode('#****#',$row->label_order_current);
1461
- }
1462
  else {
1463
  $label_all = explode('#****#',$row->label_order);
1464
- }
1465
- $label_all = array_slice($label_all, 0, count($label_all) - 1);
1466
- foreach ($label_all as $key => $label_each) {
1467
- $label_id_each = explode('#**id**#', $label_each);
1468
- $label_id = $label_id_each[0];
1469
- array_push($label_order_ids, $label_id);
1470
- $label_order_each = explode('#**label**#', $label_id_each[1]);
1471
- $label_order_original[$label_id] = $label_order_each[0];
1472
- $label_type[$label_id] = $label_order_each[1];
1473
- array_push($label_label, $label_order_each[0]);
1474
- array_push($label_type, $label_order_each[1]);
1475
- }
1476
-
1477
- $disabled_fields = explode(',', isset($_REQUEST["disabled_fields".$id]) ? $_REQUEST["disabled_fields".$id] : "");
1478
- $disabled_fields = array_slice($disabled_fields,0, count($disabled_fields)-1);
1479
 
 
 
 
1480
  $list='<table border="1" cellpadding="3" cellspacing="0" style="width:600px;">';
1481
  $list_text_mode = '';
1482
-
1483
- if($old == false || ($old == true && $row->form == '')) {
1484
- foreach($label_order_ids as $key => $label_order_id) {
1485
  $i = $label_order_id;
1486
  $type = $label_type[$i];
1487
 
1488
  if($type != "type_map" and $type != "type_submit_reset" and $type != "type_editor" and $type != "type_captcha" and $type != "type_recaptcha" and $type != "type_button") {
1489
  $element_label=$label_order_original[$i];
1490
- if(!in_array($i,$disabled_fields)) {
1491
- switch ($type) {
1492
- case 'type_text':
1493
- case 'type_password':
1494
- case 'type_textarea':
1495
- case "type_date":
1496
- case "type_own_select":
1497
- case "type_country":
1498
- case "type_number": {
1499
- $element = isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL;
1500
- if(isset($element)) {
1501
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td><pre style="margin:0px; padding:0px">' . $element . '</pre></td></tr>';
1502
- $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n";
1503
- }
1504
- break;
1505
- }
1506
- case "type_wdeditor": {
1507
- $element = isset($_POST['wdform_'.$i.'_wd_editor'.$id]) ? $_POST['wdform_'.$i.'_wd_editor'.$id] : NULL;
1508
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td><pre style="margin:0px; padding:0px">' . $element . '</pre></td></tr>';
1509
- $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n";
1510
- break;
1511
- }
1512
- case "type_hidden": {
1513
- $element = isset($_POST[$element_label]) ? $_POST[$element_label] : NULL;
1514
- if(isset($element)) {
1515
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td><pre style="margin:0px; padding:0px">' . $element . '</pre></td></tr>';
1516
- $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n";
1517
- }
1518
- break;
1519
- }
1520
- case "type_mark_map": {
1521
- $element = isset($_POST['wdform_'.$i."_long".$id]) ? $_POST['wdform_'.$i."_long".$id] : NULL;
1522
- if(isset($element)) {
1523
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td>Longitude:' . $element . '<br/>Latitude:' . (isset($_POST['wdform_'.$i."_lat".$id]) ? $_POST['wdform_'.$i."_lat".$id] : "") . '</td></tr>';
1524
- $list_text_mode=$list_text_mode.$element_label.' - Longitude:'.$element.' Latitude:'.(isset($_POST['wdform_'.$i."_lat".$id]) ? $_POST['wdform_'.$i."_lat".$id] : "")."\r\n";
1525
- }
1526
- break;
1527
- }
1528
- case "type_submitter_mail": {
1529
- $element = isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL;
1530
- if(isset($element)) {
1531
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $element . '</pre></td></tr>';
1532
- $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n";
1533
- }
1534
- break;
1535
- }
1536
- case "type_time": {
1537
- $hh = isset($_POST['wdform_'.$i."_hh".$id]) ? $_POST['wdform_'.$i."_hh".$id] : NULL;
1538
- if(isset($hh)) {
1539
- $ss = isset($_POST['wdform_'.$i."_ss".$id]) ? $_POST['wdform_'.$i."_ss".$id] : NULL;
1540
- if(isset($ss)) {
1541
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $hh . ':' . (isset($_POST['wdform_'.$i."_mm".$id]) ? $_POST['wdform_'.$i."_mm".$id] : "") . ':' . $ss;
1542
- $list_text_mode=$list_text_mode.$element_label.' - '.$hh.':'.(isset($_POST['wdform_'.$i."_mm".$id]) ? $_POST['wdform_'.$i."_mm".$id] : "").':'.$ss;
1543
- }
1544
- else {
1545
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $hh . ':' . (isset($_POST['wdform_'.$i."_mm".$id]) ? $_POST['wdform_'.$i."_mm".$id] : "");
1546
- $list_text_mode=$list_text_mode.$element_label.' - '.$hh.':'.(isset($_POST['wdform_'.$i."_mm".$id]) ? $_POST['wdform_'.$i."_mm".$id] : "");
1547
- }
1548
- $am_pm = isset($_POST['wdform_'.$i."_am_pm".$id]) ? $_POST['wdform_'.$i."_am_pm".$id] : NULL;
1549
- if(isset($am_pm)) {
1550
- $list = $list . ' ' . $am_pm . '</td></tr>';
1551
- $list_text_mode=$list_text_mode.$am_pm."\r\n";
1552
- }
1553
- else {
1554
- $list = $list.'</td></tr>';
1555
- $list_text_mode=$list_text_mode."\r\n";
1556
- }
1557
- }
1558
- break;
1559
- }
1560
-
1561
- case "type_phone": {
1562
- $element_first = isset($_POST['wdform_'.$i."_element_first".$id]) ? $_POST['wdform_'.$i."_element_first".$id] : NULL;
1563
- if(isset($element_first)) {
1564
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $element_first . ' ' . (isset($_POST['wdform_'.$i."_element_last".$id]) ? $_POST['wdform_'.$i."_element_last".$id] : "") . '</td></tr>';
1565
- $list_text_mode=$list_text_mode.$element_label.' - '.$element_first.' '.(isset($_POST['wdform_'.$i."_element_last".$id]) ? $_POST['wdform_'.$i."_element_last".$id] : "")."\r\n";
1566
- }
1567
- break;
1568
- }
1569
-
1570
- case "type_name": {
1571
- $element_first = isset($_POST['wdform_'.$i."_element_first".$id]) ? $_POST['wdform_'.$i."_element_first".$id] : NULL;
1572
- if(isset($element_first)) {
1573
- $element_title = isset($_POST['wdform_'.$i."_element_title".$id]) ? $_POST['wdform_'.$i."_element_title".$id] : NULL;
1574
- if(isset($element_title)) {
1575
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $element_title . ' ' . $element_first . ' ' . (isset($_POST['wdform_'.$i."_element_last".$id]) ? $_POST['wdform_'.$i."_element_last".$id] : "") . ' ' . (isset($_POST['wdform_'.$i."_element_middle".$id]) ? $_POST['wdform_'.$i."_element_middle".$id] : "") . '</td></tr>';
1576
- $list_text_mode=$list_text_mode.$element_label.' - '.$element_title.' '.$element_first.' '.(isset($_POST['wdform_'.$i."_element_last".$id]) ? $_POST['wdform_'.$i."_element_last".$id] : "").' '.(isset($_POST['wdform_'.$i."_element_middle".$id]) ? $_POST['wdform_'.$i."_element_middle".$id] : "")."\r\n";
1577
- }
1578
- else {
1579
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $element_first . ' ' . (isset($_POST['wdform_'.$i."_element_last".$id]) ? $_POST['wdform_'.$i."_element_last".$id] : "") . '</td></tr>';
1580
- $list_text_mode=$list_text_mode.$element_label.' - '.$element_first.' '.(isset($_POST['wdform_'.$i."_element_last".$id]) ? $_POST['wdform_'.$i."_element_last".$id] : "")."\r\n";
1581
- }
1582
- }
1583
- break;
1584
- }
1585
-
1586
- case "type_address": {
1587
- $element = isset($_POST['wdform_'.$i."_street1".$id]) ? $_POST['wdform_'.$i."_street1".$id] : NULL;
1588
- if(isset($element)) {
1589
- $list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $element . '</td></tr>';
1590
- $list_text_mode=$list_text_mode.$label_order_original[$i].' - '.$element."\r\n";
1591
- break;
1592
- }
1593
- $element = isset($_POST['wdform_'.$i."_street2".$id]) ? $_POST['wdform_'.$i."_street2".$id] : NULL;
1594
- if(isset($element)) {
1595
- $list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $element . '</td></tr>';
1596
- $list_text_mode=$list_text_mode.$label_order_original[$i].' - '.$element."\r\n";
1597
- break;
1598
- }
1599
- $element = isset($_POST['wdform_'.$i."_city".$id]) ? $_POST['wdform_'.$i."_city".$id] : NULL;
1600
- if(isset($element)) {
1601
- $list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $element . '</td></tr>';
1602
- $list_text_mode=$list_text_mode.$label_order_original[$i].' - '.$element."\r\n";
1603
- break;
1604
- }
1605
- $element = isset($_POST['wdform_'.$i."_state".$id]) ? $_POST['wdform_'.$i."_state".$id] : NULL;
1606
- if(isset($element)) {
1607
- $list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $element . '</td></tr>';
1608
- $list_text_mode=$list_text_mode.$label_order_original[$i].' - '.$element."\r\n";
1609
- break;
1610
- }
1611
- $element = isset($_POST['wdform_'.$i."_postal".$id]) ? $_POST['wdform_'.$i."_postal".$id] : NULL;
1612
- if(isset($element)) {
1613
- $list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $element . '</td></tr>';
1614
- $list_text_mode=$list_text_mode.$label_order_original[$i].' - '.$element."\r\n";
1615
- break;
1616
- }
1617
- $element = isset($_POST['wdform_'.$i."_country".$id]) ? $_POST['wdform_'.$i."_country".$id] : NULL;
1618
- if(isset($element)) {
1619
- $list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $element . '</td></tr>';
1620
- $list_text_mode=$list_text_mode.$label_order_original[$i].' - '.$element."\r\n";
1621
- break;
1622
- }
1623
- break;
1624
- }
1625
- case "type_date_fields": {
1626
- $day = isset($_POST['wdform_'.$i."_day".$id]) ? $_POST['wdform_'.$i."_day".$id] : NULL;
1627
- $month = isset($_POST['wdform_'.$i."_month".$id]) ? $_POST['wdform_'.$i."_month".$id] : "";
1628
- $year = isset($_POST['wdform_'.$i."_year".$id]) ? $_POST['wdform_'.$i."_year".$id] : "";
1629
- if(isset($day)) {
1630
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' .(($day || $month || $year) ? $day . '-' . $month . '-' . $year : '' ). '</td></tr>';
1631
- $list_text_mode=$list_text_mode.$element_label.(($day || $month || $year) ? $day.'-'.$month.'-'.$year : '')."\r\n";
1632
- }
1633
- break;
1634
- }
1635
- case "type_radio": {
1636
- $element = isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : NULL;
1637
- if(isset($element)) {
1638
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $element . '</td></tr>';
1639
- $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n";
1640
- break;
1641
- }
1642
- $element = isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL;
1643
- if(isset($element)) {
1644
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $element . '</pre></td></tr>';
1645
- $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n";
1646
- }
1647
- break;
1648
- }
1649
- case "type_checkbox": {
1650
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >';
1651
- $list_text_mode=$list_text_mode.$element_label.' - ';
1652
- $start = -1;
1653
- for($j = 0; $j < 100; $j++) {
1654
- $element = isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL;
1655
- if(isset($element)) {
1656
- $start = $j;
1657
- break;
1658
- }
1659
- }
1660
- $other_element_id = -1;
1661
- $is_other = isset($_POST['wdform_'.$i."_allow_other".$id]) ? $_POST['wdform_'.$i."_allow_other".$id] : "";
1662
- if($is_other == "yes") {
1663
- $other_element_id = isset($_POST['wdform_'.$i."_allow_other_num".$id]) ? $_POST['wdform_'.$i."_allow_other_num".$id] : "";
1664
- }
1665
- if($start != -1) {
1666
- for($j = $start; $j < 100; $j++) {
1667
- $element = isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL;
1668
- if(isset($element)) {
1669
- if($j == $other_element_id) {
1670
- $list = $list . (isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : "") . '<br>';
1671
- $list_text_mode=$list_text_mode.(isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : "").', ';
1672
- }
1673
- else {
1674
- $list = $list . (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : "") . '<br>';
1675
- $list_text_mode=$list_text_mode.(isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : "").', ';
1676
- }
1677
- }
1678
- }
1679
- $list = $list . '</td></tr>';
1680
- $list_text_mode=$list_text_mode."\r\n";
1681
- }
1682
- break;
1683
- }
1684
- case "type_paypal_price": {
1685
- $value = 0;
1686
- if(isset($_POST['wdform_'.$i."_element_dollars".$id])) {
1687
- $value = $_POST['wdform_'.$i."_element_dollars".$id];
1688
- }
1689
- if(isset($_POST['wdform_'.$i."_element_cents".$id])) {
1690
- $value = $value . '.' . $_POST['wdform_'.$i."_element_cents".$id];
1691
- }
1692
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $value . $form_currency . '</td></tr>';
1693
- $list_text_mode=$list_text_mode.$element_label.' - '.$value.$form_currency."\r\n";
1694
- break;
1695
- }
1696
-
1697
- case "type_paypal_select": {
1698
- if(isset($_POST['wdform_'.$i."_element_label".$id]) && $_POST['wdform_'.$i."_element".$id] != '') {
1699
- $value = $_POST['wdform_'.$i."_element_label".$id] . ' : ' . (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : "") . $form_currency;
1700
- }
1701
- else {
1702
- $value='';
1703
- }
1704
- $element_quantity_label = (isset($_POST['wdform_'.$i."_element_quantity_label".$id]) && $_POST['wdform_'.$i."_element_quantity_label".$id]) ? $_POST['wdform_'.$i."_element_quantity_label".$id] : NULL;
1705
- $element_quantity = (isset($_POST['wdform_'.$i."_element_quantity".$id]) && $_POST['wdform_'.$i."_element_quantity".$id]) ? $_POST['wdform_'.$i."_element_quantity".$id] : NULL;
1706
- if($value != '' && isset($element_quantity)) {
1707
- $value .= '<br/>' . $element_quantity_label . ': ' . $element_quantity;
1708
- }
1709
- for($k = 0; $k < 50; $k++) {
1710
- $temp_val = isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL;
1711
- if(isset($temp_val)) {
1712
- $value .= '<br/>' . (isset($_POST['wdform_'.$i."_element_property_label".$id.$k]) ? $_POST['wdform_'.$i."_element_property_label".$id.$k] : "") . ': ' . $temp_val;
1713
- }
1714
- }
1715
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $value . '</pre></td></tr>';
1716
- $list_text_mode=$list_text_mode.$element_label.' - '.str_replace('<br/>',', ',$value)."\r\n";
1717
- break;
1718
- }
1719
-
1720
- case "type_paypal_radio": {
1721
- if(isset($_POST['wdform_'.$i."_element_label".$id])) {
1722
- $value = $_POST['wdform_'.$i."_element_label".$id] . ' : ' . (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : "") . $form_currency;
1723
- }
1724
- else {
1725
- $value='';
1726
- }
1727
- $element_quantity_label = isset($_POST['wdform_'.$i."_element_quantity_label".$id]) ? $_POST['wdform_'.$i."_element_quantity_label".$id] : NULL;
1728
- $element_quantity = (isset($_POST['wdform_'.$i."_element_quantity".$id]) && $_POST['wdform_'.$i."_element_quantity".$id]) ? $_POST['wdform_'.$i."_element_quantity".$id] : NULL;
1729
- if (isset($element_quantity)) {
1730
- $value .= '<br/>' . $element_quantity_label . ': ' . $element_quantity;
1731
- }
1732
- for($k = 0; $k < 50; $k++) {
1733
- $temp_val = isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL;
1734
- if(isset($temp_val)) {
1735
- $value .= '<br/>' . (isset($_POST['wdform_'.$i."_element_property_label".$id.$k]) ? $_POST['wdform_'.$i."_element_property_label".$id.$k] : "") . ': ' . $temp_val;
1736
- }
1737
- }
1738
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $value . '</pre></td></tr>';
1739
- $list_text_mode=$list_text_mode.$element_label.' - '.str_replace('<br/>',', ',$value)."\r\n";
1740
- break;
1741
- }
1742
 
1743
- case "type_paypal_shipping": {
1744
- if(isset($_POST['wdform_'.$i."_element_label".$id])) {
1745
- $value = $_POST['wdform_'.$i."_element_label".$id] . ' : ' . (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : "") . $form_currency;
1746
- }
1747
- else {
1748
- $value='';
1749
- }
1750
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $value . '</pre></td></tr>';
1751
- $list_text_mode=$list_text_mode.$element_label.' - '.$value."\r\n";
1752
- break;
1753
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1754
 
1755
- case "type_paypal_checkbox": {
1756
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >';
1757
- $list_text_mode=$list_text_mode.$element_label.' - ';
1758
- $start = -1;
1759
- for($j = 0; $j < 100; $j++) {
1760
- $element = isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL;
1761
- if(isset($element)) {
1762
- $start=$j;
1763
- break;
1764
- }
1765
- }
1766
-
1767
- if($start!=-1) {
1768
- for($j = $start; $j < 100; $j++) {
1769
- $element = isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL;
1770
- if(isset($element)) {
1771
- $list = $list . (isset($_POST['wdform_'.$i."_element".$id.$j."_label"]) ? $_POST['wdform_'.$i."_element".$id.$j."_label"] : "") . ' - ' . ($element == '' ? '0' . $form_currency : $element) . $form_currency . '<br>';
1772
- $list_text_mode=$list_text_mode.(isset($_POST['wdform_'.$i."_element".$id.$j."_label"]) ? $_POST['wdform_'.$i."_element".$id.$j."_label"] : "").' - '.($element == '' ? '0' . $form_currency : $element).$form_currency.', ';
1773
- }
1774
- }
1775
- }
1776
- $element_quantity_label = isset($_POST['wdform_'.$i."_element_quantity_label".$id]) ? $_POST['wdform_'.$i."_element_quantity_label".$id] : NULL;
1777
- $element_quantity = (isset($_POST['wdform_'.$i."_element_quantity".$id]) && $_POST['wdform_'.$i."_element_quantity".$id]) ? $_POST['wdform_'.$i."_element_quantity".$id] : NULL;
1778
- if (isset($element_quantity)) {
1779
- $list = $list . '<br/>' . $element_quantity_label . ': ' . $element_quantity;
1780
- $list_text_mode=$list_text_mode.$element_quantity_label . ': ' . $element_quantity.', ';
1781
- }
1782
- for($k = 0; $k < 50; $k++) {
1783
- $temp_val = isset($_POST['wdform_'.$i."_element_property_value".$id.$k]) ? $_POST['wdform_'.$i."_element_property_value".$id.$k] : NULL;
1784
- if(isset($temp_val)) {
1785
- $list = $list . '<br/>' . (isset($_POST['wdform_'.$i."_element_property_label".$id.$k]) ? $_POST['wdform_'.$i."_element_property_label".$id.$k] : "") . ': ' . $temp_val;
1786
- $list_text_mode=$list_text_mode.(isset($_POST['wdform_'.$i."_element_property_label".$id.$k]) ? $_POST['wdform_'.$i."_element_property_label".$id.$k] : "") . ': ' . $temp_val.', ';
1787
- }
1788
- }
1789
- $list = $list . '</td></tr>';
1790
- $list_text_mode=$list_text_mode."\r\n";
1791
- break;
1792
- }
1793
-
1794
- case "type_paypal_total": {
1795
- $element = isset($_POST['wdform_'.$i."_paypal_total".$id]) ? $_POST['wdform_'.$i."_paypal_total".$id] : "";
1796
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $element . '</pre></td></tr>';
1797
- $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n";
1798
- break;
1799
- }
1800
- case "type_star_rating": {
1801
- $element = isset($_POST['wdform_'.$i."_star_amount".$id]) ? $_POST['wdform_'.$i."_star_amount".$id] : NULL;
1802
- $selected = isset($_POST['wdform_'.$i."_selected_star_amount".$id]) ? $_POST['wdform_'.$i."_selected_star_amount".$id] : 0;
1803
- if(isset($element)) {
1804
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $selected . '/' . $element . '</pre></td></tr>';
1805
- $list_text_mode=$list_text_mode.$element_label.' - '.$selected.'/'.$element."\r\n";
1806
- }
1807
- break;
1808
- }
1809
- case "type_scale_rating": {
1810
- $element = isset($_POST['wdform_'.$i."_scale_amount".$id]) ? $_POST['wdform_'.$i."_scale_amount".$id] : NULL;
1811
- $selected = isset($_POST['wdform_'.$i."_scale_radio".$id]) ? $_POST['wdform_'.$i."_scale_radio".$id] : 0;
1812
- if(isset($element)) {
1813
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $selected . '/' . $element . '</pre></td></tr>';
1814
- $list_text_mode=$list_text_mode.$element_label.' - '.$selected.'/'.$element."\r\n";
1815
- }
1816
- break;
1817
- }
1818
-
1819
- case "type_spinner": {
1820
- $element = isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL;
1821
- if(isset($element)) {
1822
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $element . '</pre></td></tr>';
1823
- $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n";
1824
- }
1825
- break;
1826
- }
1827
-
1828
- case "type_slider": {
1829
- $element = isset($_POST['wdform_'.$i."_slider_value".$id]) ? $_POST['wdform_'.$i."_slider_value".$id] : NULL;
1830
- if(isset($element)) {
1831
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $element . '</pre></td></tr>';
1832
- $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n";
1833
- }
1834
- break;
1835
- }
1836
- case "type_range": {
1837
- $element0 = isset($_POST['wdform_'.$i."_element".$id.'0']) ? $_POST['wdform_'.$i."_element".$id.'0'] : NULL;
1838
- $element1 = isset($_POST['wdform_'.$i."_element".$id.'1']) ? $_POST['wdform_'.$i."_element".$id.'1'] : NULL;
1839
- if(isset($element0) || isset($element1)) {
1840
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">From:' . $element0 . '<span style="margin-left:6px">To</span>:' . $element1 . '</pre></td></tr>';
1841
- $list_text_mode=$list_text_mode.$element_label.' - From:'.$element0.' To:'.$element1."\r\n";
1842
- }
1843
- break;
1844
- }
1845
-
1846
- case "type_grading": {
1847
- $element = isset($_POST['wdform_'.$i."_hidden_item".$id]) ? $_POST['wdform_'.$i."_hidden_item".$id] : "";
1848
- $grading = explode(":", $element);
1849
- $items_count = sizeof($grading) - 1;
1850
- $element = "";
1851
- $total = "";
1852
- for($k = 0;$k < $items_count; $k++) {
1853
- $element .= $grading[$k] . ":" . (isset($_POST['wdform_'.$i."_element".$id.'_'.$k]) ? $_POST['wdform_'.$i."_element".$id.'_'.$k] : "") . " ";
1854
- $total += (isset($_POST['wdform_'.$i."_element".$id.'_'.$k]) ? $_POST['wdform_'.$i."_element".$id.'_'.$k] : 0);
1855
- }
1856
- $element .= "Total:" . $total;
1857
- if(isset($element)) {
1858
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $element . '</pre></td></tr>';
1859
- $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n";
1860
- }
1861
- break;
1862
- }
1863
- case "type_matrix": {
1864
- $input_type = isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : "";
1865
- $mat_rows = explode("***", isset($_POST['wdform_'.$i."_hidden_row".$id]) ? $_POST['wdform_'.$i."_hidden_row".$id] : "");
1866
- $rows_count = sizeof($mat_rows) - 1;
1867
- $mat_columns = explode("***", isset($_POST['wdform_'.$i."_hidden_column".$id]) ? $_POST['wdform_'.$i."_hidden_column".$id] : "");
1868
- $columns_count = sizeof($mat_columns) - 1;
1869
- $matrix = "<table>";
1870
- $matrix .= '<tr><td></td>';
1871
- for($k = 1; $k < count($mat_columns); $k++) {
1872
- $matrix .= '<td style="background-color:#BBBBBB; padding:5px; ">' . $mat_columns[$k] . '</td>';
1873
- }
1874
- $matrix .= '</tr>';
1875
- $aaa = Array();
1876
- for($k = 1; $k <= $rows_count; $k++) {
1877
- $matrix .= '<tr><td style="background-color:#BBBBBB; padding:5px;">' . $mat_rows[$k] . '</td>';
1878
- if($input_type == "radio") {
1879
- $mat_radio = isset($_POST['wdform_'.$i."_input_element".$id.$k]) ? $_POST['wdform_'.$i."_input_element".$id.$k] : 0;
1880
- if($mat_radio == 0) {
1881
- $checked = "";
1882
- $aaa[1] = "";
1883
- }
1884
- else {
1885
- $aaa = explode("_", $mat_radio);
1886
- }
1887
- for($j = 1; $j <= $columns_count; $j++) {
1888
- if($aaa[1] == $j) {
1889
- $checked = "checked";
1890
- }
1891
- else {
1892
- $checked = "";
1893
- }
1894
- $matrix .= '<td style="text-align:center"><input type="radio" ' . $checked . ' disabled /></td>';
1895
- }
1896
- }
1897
- else {
1898
- if($input_type == "checkbox") {
1899
- for($j = 1; $j <= $columns_count; $j++) {
1900
- $checked = isset($_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j]) ? $_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j] : "";
1901
- if($checked == 1) {
1902
- $checked = "checked";
1903
- }
1904
- else {
1905
- $checked = "";
1906
- }
1907
- $matrix .= '<td style="text-align:center"><input type="checkbox" ' . $checked . ' disabled /></td>';
1908
- }
1909
- }
1910
- else {
1911
- if($input_type == "text") {
1912
- for($j = 1; $j <= $columns_count; $j++) {
1913
- $checked = isset($_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j]) ? $_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j] : "";
1914
- $matrix .= '<td style="text-align:center"><input type="text" value="' . $checked . '" disabled /></td>';
1915
- }
1916
- }
1917
- else {
1918
- for($j = 1; $j <= $columns_count; $j++) {
1919
- $checked = isset($_POST['wdform_'.$i."_select_yes_no".$id.$k.'_'.$j]) ? $_POST['wdform_'.$i."_select_yes_no".$id.$k.'_'.$j] : "";
1920
- $matrix .= '<td style="text-align:center">' . $checked . '</td>';
1921
- }
1922
- }
1923
- }
1924
- }
1925
- $matrix .= '</tr>';
1926
- }
1927
- $matrix .= '</table>';
1928
- if(isset($matrix)) {
1929
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $matrix . '</pre></td></tr>';
1930
- }
1931
- break;
1932
- }
1933
- default: break;
1934
- }
1935
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1936
  }
1937
  }
1938
-
1939
- //////
1940
- $list = $list . '</table>';
1941
  if($row->sendemail)
1942
- if($row->send_to) {
1943
- $fromname = $row->mail_from_name_user;
1944
- if($row->mail_subject_user)
1945
- $subject = $row->mail_subject_user;
1946
- else
1947
- $subject = $row->title;
1948
- if($row->reply_to_user) {
1949
- $replyto = $row->reply_to_user;
1950
- }
1951
- $attachment_user = array();
1952
- if ($row->mail_attachment_user) {
1953
- for ($k = 0; $k < count($all_files); $k++) {
1954
- if (isset($all_files[$k]['tmp_name'])) {
1955
- $attachment_user[$k] = $all_files[$k]['tmp_name'];
1956
- }
 
1957
  }
1958
- }
1959
- if ($row->mail_mode_user) {
1960
- $content_type = "text/html";
1961
- $mode = 1;
1962
- $list_user = wordwrap($list, 70, "\n", true);
1963
- $new_script = wpautop($row->script_mail_user);
1964
- }
1965
- else {
1966
- $content_type = "text/plain";
1967
- $mode = 0;
1968
- $list_user = wordwrap($list_text_mode, 1000, "\n", true);
1969
- $new_script = str_replace(array('<p>','</p>'),'',$row->script_mail_user);
1970
- }
1971
- foreach($label_order_original as $key => $label_each) {
1972
- $type=$label_type[$key];
1973
- if(strpos($row->script_mail_user, "%".$label_each."%")>-1) {
1974
- $new_value = $this->custom_fields_mail($type, $key, $id, $attachment_user);
1975
- $new_script = str_replace("%".$label_each."%", $new_value, $new_script);
1976
- }
1977
- if(strpos($fromname, "%".$label_each."%")>-1) {
1978
- $new_value = str_replace('<br>',', ',$this->custom_fields_mail($type, $key, $id, ''));
1979
- if(substr($new_value, -2)==', ') {
1980
- $new_value = substr($new_value, 0, -2);
1981
- }
1982
- $fromname = str_replace("%".$label_each."%", $new_value, $fromname);
1983
- }
1984
- if(strpos($subject, "%".$label_each."%")>-1) {
1985
- $new_value = str_replace('<br>',', ',$this->custom_fields_mail($type, $key, $id, ''));
1986
- if(substr($new_value, -2)==', ') {
1987
- $new_value = substr($new_value, 0, -2);
1988
- }
1989
- $subject = str_replace("%".$label_each."%", $new_value, $subject);
1990
- }
1991
- }
1992
-
1993
- $recipient = '';
1994
- $cca = $row->mail_cc_user;
1995
- $bcc = $row->mail_bcc_user;
1996
- $send_tos=explode('**',$row->send_to);
1997
- if ($row->mail_from_user != '') {
1998
- if ($fromname != '') {
1999
- $from = "From: '" . $fromname . "' <" . $row->mail_from_user . ">" . "\r\n";
2000
- }
2001
- else {
2002
- $from = "From: '' <" . $row->mail_from_user . ">" . "\r\n";
2003
- }
2004
- }
2005
- else {
2006
- $from = '';
2007
- }
2008
- $headers = "MIME-Version: 1.0\n" . $from . " Content-Type: " . $content_type . "; charset=\"" . get_option('blog_charset') . "\"\n";
2009
- if ($replyto) {
2010
- $headers .= "Reply-To: <" . $replyto . ">\r\n";
2011
- }
2012
- if ($cca) {
2013
- $headers .= "Cc: <" . $cca . ">\r\n";
2014
- }
2015
- if ($bcc) {
2016
- $headers .= "Bcc: <" . $bcc . ">\r\n";
2017
- }
2018
-
2019
- $custom_fields_value = array( $ip, $useremail, $username, $subid, $list );
2020
-
2021
- foreach($custom_fields as $key=>$custom_field)
2022
- {
2023
- if(strpos($new_script, "%".$custom_field."%")>-1)
2024
- $new_script = str_replace("%".$custom_field."%", $custom_fields_value[$key], $new_script);
2025
-
2026
- if($key==2 || $key==3)
2027
- {
2028
- if(strpos($fromname, "%".$custom_field."%")>-1)
2029
- $fromname = str_replace("%".$custom_field."%", $custom_fields_value[$key], $fromname);
2030
 
2031
- if(strpos($subject, "%".$custom_field."%")>-1)
2032
- $subject = str_replace("%".$custom_field."%", $custom_fields_value[$key], $subject);
2033
- }
2034
- }
2035
- $body = $new_script;
2036
-
2037
- $send_copy = isset($_POST["wdform_send_copy_".$id]) ? $_POST["wdform_send_copy_".$id] : NULL;
2038
-
2039
- if(isset($send_copy)) {
2040
- $send=true;
2041
- }
2042
- else {
2043
- foreach($send_tos as $send_to) {
2044
- $recipient = isset($_POST['wdform_'.str_replace('*', '', $send_to)."_element".$id]) ? $_POST['wdform_'.str_replace('*', '', $send_to)."_element".$id] : NULL;
2045
- if($recipient) {
2046
- $send = wp_mail(str_replace(' ', '', $recipient), $subject, stripslashes($body), $headers, $attachment_user);
2047
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2048
  }
2049
  }
2050
- }
2051
-
2052
  if($row->sendemail)
2053
- if ($row->mail) {
2054
- if($row->reply_to) {
2055
- $replyto = isset($_POST['wdform_'.$row->reply_to."_element".$id]) ? $_POST['wdform_'.$row->reply_to."_element".$id] : NULL;
2056
- if(!isset($replyto)) {
2057
- $replyto = $row->reply_to;
2058
- }
2059
- }
2060
- $recipient = $row->mail;
2061
- if($row->mail_subject) {
2062
- $subject = $row->mail_subject;
2063
- }
2064
- else {
2065
- $subject = $row->title;
2066
- }
2067
-
2068
- if ($row->from_name) {
2069
- $fromname = $row->from_name;
2070
- }
2071
- else {
2072
- $fromname = '';
2073
- }
2074
- $attachment = array();
2075
- if ($row->mail_attachment) {
2076
- for ($k = 0; $k < count($all_files); $k++) {
2077
- if (isset($all_files[$k]['tmp_name'])) {
2078
- $attachment[$k] = $all_files[$k]['tmp_name'];
2079
- }
2080
- }
2081
- }
2082
-
2083
- if ($row->mail_mode) {
2084
- $content_type = "text/html";
2085
- $mode = 1;
2086
- $list = wordwrap($list, 70, "\n", true);
2087
- $new_script = wpautop($row->script_mail);
2088
- }
2089
- else {
2090
- $content_type = "text/plain";
2091
- $mode = 0;
2092
- $list = $list_text_mode;
2093
- $list = wordwrap($list, 1000, "\n", true);
2094
- $new_script = str_replace(array('<p>','</p>'),'',$row->script_mail);
2095
- }
2096
-
2097
- foreach($label_order_original as $key => $label_each) {
2098
- $type=$label_type[$key];
2099
- if(strpos($row->script_mail, "%".$label_each."%")>-1) {
2100
- $new_value = $this->custom_fields_mail($type, $key, $id, $attachment);
2101
- $new_script = str_replace("%".$label_each."%", $new_value, $new_script);
2102
- }
2103
-
2104
- if(strpos($fromname, "%".$label_each."%")>-1) {
2105
- $new_value = str_replace('<br>',', ',$this->custom_fields_mail($type, $key, $id, ''));
2106
- if(substr($new_value, -2)==', ') {
2107
- $new_value = substr($new_value, 0, -2);
2108
- }
2109
- $fromname = str_replace("%".$label_each."%", $new_value, $fromname);
2110
- }
2111
- if(strpos($fromname, "%username%")>-1){
2112
- $fromname = str_replace("%username%", $username, $fromname);
2113
- }
2114
-
2115
- if(strpos($subject, "%".$label_each."%")>-1) {
2116
- $new_value = str_replace('<br>',', ',$this->custom_fields_mail($type, $key, $id, ''));
2117
- if(substr($new_value, -2)==', ') {
2118
- $new_value = substr($new_value, 0, -2);
2119
- }
2120
- $subject = str_replace("%".$label_each."%", $new_value, $subject);
2121
- }
2122
- }
2123
-
2124
- if ($row->from_mail) {
2125
- $from = isset($_POST['wdform_'.$row->from_mail."_element".$id]) ? $_POST['wdform_'.$row->from_mail."_element".$id] : NULL;
2126
- if (!isset($from)) {
2127
- $from = $row->from_mail;
2128
- }
2129
- $from = "From: '" . $fromname . "' <" . $from . ">" . "\r\n";
2130
- }
2131
- else {
2132
- $from = "";
2133
- }
2134
- $headers = "MIME-Version: 1.0\n" . $from . " Content-Type: " . $content_type . "; charset=\"" . get_option('blog_charset') . "\"\n";
2135
- if ($replyto) {
2136
- $headers .= "Reply-To: <" . $replyto . ">\r\n";
2137
- }
2138
- $cca = $row->mail_cc;
2139
- $bcc = $row->mail_bcc;
2140
- if ($cca) {
2141
- $headers .= "Cc: <" . $cca . ">\r\n";
2142
- }
2143
- if ($bcc) {
2144
- $headers .= "Bcc: <" . $bcc . ">\r\n";
2145
- }
2146
-
2147
- $custom_fields_value = array( $ip, $useremail, $username, $subid, $list );
2148
-
2149
- foreach($custom_fields as $key=>$custom_field)
2150
- {
2151
- if(strpos($new_script, "%".$custom_field."%")>-1)
2152
- $new_script = str_replace("%".$custom_field."%", $custom_fields_value[$key], $new_script);
2153
-
2154
- if($key==2 || $key==3)
2155
- {
2156
- if(strpos($fromname, "%".$custom_field."%")>-1)
2157
- $fromname = str_replace("%".$custom_field."%", $custom_fields_value[$key], $fromname);
2158
 
2159
- if(strpos($subject, "%".$custom_field."%")>-1)
2160
- $subject = str_replace("%".$custom_field."%", $custom_fields_value[$key], $subject);
2161
- }
2162
- }
2163
- $body = $new_script;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2164
 
2165
- if($row->sendemail) {
2166
- $send = wp_mail(str_replace(' ', '', $recipient), $subject, stripslashes($body), $headers, $attachment);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2167
  }
2168
- }
2169
  $_SESSION['error_or_no' . $id] = 0;
2170
- $msg = addslashes(__('Your form was successfully submitted.', 'form_maker'));
2171
  $succes = 1;
2172
 
2173
  if($row->sendemail)
2174
- if($row->mail || $row->send_to) {
2175
- if ($send) {
2176
- if ($send !== true ) {
2177
- $_SESSION['error_or_no' . $id] = 1;
2178
- $msg = addslashes(__('Error, email was not sent.', 'form_maker'));
2179
- $succes = 0;
 
 
 
 
 
2180
  }
2181
- else {
2182
- $_SESSION['error_or_no' . $id] = 0;
2183
- $msg = addslashes(__('Your form was successfully submitted.', 'form_maker'));
2184
- }
2185
  }
2186
- }
2187
- }
2188
- else { /* Old form.*/
2189
- foreach ($label_order_ids as $key => $label_order_id) {
2190
- $i = $label_order_id;
2191
- $type = $_POST[$i . "_type" . $id];
2192
- if (isset($_POST[$i . "_type" . $id]))
2193
- if ($type != "type_map" and $type != "type_submit_reset" and $type != "type_editor" and $type != "type_captcha" and $type != "type_recaptcha" and $type != "type_button") {
2194
- $element_label = $label_order_original[$i];
2195
- switch ($type) {
2196
- case 'type_text':
2197
- case 'type_password':
2198
- case 'type_textarea':
2199
- case "type_date":
2200
- case "type_own_select":
2201
- case "type_country":
2202
- case "type_number":
2203
- {
2204
- $element = $_POST[$i . "_element" . $id];
2205
- if (isset($_POST[$i . "_element" . $id])) {
2206
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $element . '</pre></td></tr>';
2207
- }
2208
- break;
2209
- }
2210
- case "type_hidden": {
2211
- $element = $_POST[$element_label];
2212
- if (isset($element)) {
2213
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $element . '</pre></td></tr>';
2214
- }
2215
- break;
2216
- }
2217
- case "type_submitter_mail":
2218
- {
2219
- $element = $_POST[$i . "_element" . $id];
2220
- if (isset($_POST[$i . "_element" . $id])) {
2221
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $element . '</pre></td></tr>';
2222
- if ($_POST[$i . "_send" . $id] == "yes")
2223
- array_push($cc, $element);
2224
- }
2225
- break;
2226
- }
2227
- case "type_time":
2228
- {
2229
- $hh = $_POST[$i . "_hh" . $id];
2230
- if (isset($_POST[$i . "_hh" . $id])) {
2231
- $ss = $_POST[$i . "_ss" . $id];
2232
- if (isset($_POST[$i . "_ss" . $id]))
2233
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $_POST[$i . "_hh" . $id] . ':' . $_POST[$i . "_mm" . $id] . ':' . $_POST[$i . "_ss" . $id];
2234
- else
2235
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $_POST[$i . "_hh" . $id] . ':' . $_POST[$i . "_mm" . $id];
2236
- $am_pm = $_POST[$i . "_am_pm" . $id];
2237
- if (isset($_POST[$i . "_am_pm" . $id]))
2238
- $list = $list . ' ' . $_POST[$i . "_am_pm" . $id] . '</td></tr>';
2239
- else
2240
- $list = $list . '</td></tr>';
2241
- }
2242
- break;
2243
- }
2244
- case "type_phone":
2245
- {
2246
- $element_first = $_POST[$i . "_element_first" . $id];
2247
- if (isset($_POST[$i . "_element_first" . $id])) {
2248
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $_POST[$i . "_element_first" . $id] . ' ' . $_POST[$i . "_element_last" . $id] . '</td></tr>';
2249
- }
2250
- break;
2251
- }
2252
- case "type_name":
2253
- {
2254
- $element_first = $_POST[$i . "_element_first" . $id];
2255
- if (isset($_POST[$i . "_element_first" . $id])) {
2256
- $element_title = $_POST[$i . "_element_title" . $id];
2257
- if (isset($_POST[$i . "_element_title" . $id]))
2258
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $_POST[$i . "_element_title" . $id] . ' ' . $_POST[$i . "_element_first" . $id] . ' ' . $_POST[$i . "_element_last" . $id] . ' ' . $_POST[$i . "_element_middle" . $id] . '</td></tr>';
2259
- else
2260
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $_POST[$i . "_element_first" . $id] . ' ' . $_POST[$i . "_element_last" . $id] . '</td></tr>';
2261
- }
2262
- break;
2263
- }
2264
- case "type_mark_map":
2265
- {
2266
- if (isset($_POST[$i . "_long" . $id])) {
2267
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >Longitude:' . $_POST[$i . "_long" . $id] . '<br/>Latitude:' . $_POST[$i . "_lat" . $id] . '</td></tr>';
2268
- }
2269
- break;
2270
- }
2271
- case "type_address":
2272
- {
2273
- if (isset($_POST[$i . "_street1" . $id]))
2274
- $list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $_POST[$i . "_street1" . $id] . '</td></tr>';
2275
- $i++;
2276
- if (isset($_POST[$i."_street2".$id]))
2277
- $list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $_POST[$i . "_street2" . $id] . '</td></tr>';
2278
- $i++;
2279
- if (isset($_POST[$i."_city".$id]))
2280
- $list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $_POST[$i . "_city" . $id] . '</td></tr>';
2281
- $i++;
2282
- if (isset($_POST[$i."_state".$id]))
2283
- $list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $_POST[$i . "_state" . $id] . '</td></tr>';
2284
- $i++;
2285
- if (isset($_POST[$i."_postal".$id]))
2286
- $list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $_POST[$i . "_postal" . $id] . '</td></tr>';
2287
- $i++;
2288
- if (isset($_POST[$i."_country".$id]))
2289
- $list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $_POST[$i . "_country" . $id] . '</td></tr>';
2290
- $i++;
2291
- break;
2292
- }
2293
- case "type_date_fields":
2294
- {
2295
- $day = $_POST[$i . "_day" . $id];
2296
- if (isset($_POST[$i . "_day" . $id])) {
2297
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $_POST[$i . "_day" . $id] . '-' . $_POST[$i . "_month" . $id] . '-' . $_POST[$i . "_year" . $id] . '</td></tr>';
2298
- }
2299
- break;
2300
- }
2301
- case "type_radio":
2302
- {
2303
- $element = $_POST[$i . "_other_input" . $id];
2304
- if (isset($_POST[$i . "_other_input" . $id])) {
2305
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $_POST[$i . "_other_input" . $id] . '</td></tr>';
2306
- break;
2307
- }
2308
- $element = $_POST[$i . "_element" . $id];
2309
- if (isset($_POST[$i . "_element" . $id])) {
2310
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $element . '</pre></td></tr>';
2311
- }
2312
- break;
2313
- }
2314
- case "type_checkbox":
2315
- {
2316
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >';
2317
- $start = -1;
2318
- for ($j = 0; $j < 100; $j++) {
2319
- if (isset($_POST[$i . "_element" . $id . $j])) {
2320
- $start = $j;
2321
- break;
2322
- }
2323
- }
2324
- $other_element_id = -1;
2325
- $is_other = $_POST[$i . "_allow_other" . $id];
2326
- if ($is_other == "yes") {
2327
- $other_element_id = $_POST[$i . "_allow_other_num" . $id];
2328
- }
2329
- if ($start != -1) {
2330
- for ($j = $start; $j < 100; $j++) {
2331
- $element = $_POST[$i . "_element" . $id . $j];
2332
- if (isset($_POST[$i . "_element" . $id . $j]))
2333
- if ($j == $other_element_id) {
2334
- $list = $list . $_POST[$i . "_other_input" . $id] . '<br>';
2335
- }
2336
- else
2337
-
2338
- $list = $list . $_POST[$i . "_element" . $id . $j] . '<br>';
2339
- }
2340
- $list = $list . '</td></tr>';
2341
- }
2342
- break;
2343
- }
2344
- case "type_paypal_price": {
2345
- $value = 0;
2346
- if ($_POST[$i."_element_dollars".$id]) {
2347
- $value = $_POST[$i."_element_dollars".$id];
2348
- }
2349
- if ($_POST[$i."_element_cents".$id]) {
2350
- $value = $value.'.'.$_POST[$i."_element_cents".$id];
2351
- }
2352
- $list = $list.'<tr valign="top"><td >'.$element_label.'</td><td >'.$value.$form_currency.'</td></tr>';
2353
- break;
2354
- }
2355
- case "type_paypal_select": {
2356
- $value = $_POST[$i."_element_label".$id].':'.$_POST[$i."_element".$id].$form_currency;
2357
- $element_quantity_label = $_POST[$i."_element_quantity_label".$id];
2358
- if (isset($element_quantity_label)) {
2359
- $quantity = ((isset($_POST[$i . "_element_quantity" . $id]) && ($_POST[$i . "_element_quantity" . $id] >= 1)) ? $_POST[$i . "_element_quantity" . $id] : 1);
2360
- $value .= '<br/>'.$_POST[$i."_element_quantity_label".$id].': '.$quantity;
2361
- }
2362
- for ($k = 0; $k < 50; $k++) {
2363
- $temp_val = $_POST[$i."_element_property_value".$id.$k];
2364
- if (isset($temp_val)) {
2365
- $value .= '<br/>'.$_POST[$i."_element_property_label".$id.$k].': '.$_POST[$i."_element_property_value".$id.$k];
2366
- }
2367
- }
2368
- $list = $list.'<tr valign="top"><td >'.$element_label.'</td><td ><pre style="margin:0px; padding:0px">'.$value.'</pre></td></tr>';
2369
- break;
2370
- }
2371
- case "type_paypal_radio": {
2372
- $value = $_POST[$i."_element_label".$id].' - '.$_POST[$i."_element".$id].$form_currency;
2373
- $element_quantity_label = $_POST[$i."_element_quantity_label".$id];
2374
- if (isset($element_quantity_label)) {
2375
- $quantity = ((isset($_POST[$i . "_element_quantity" . $id]) && ($_POST[$i . "_element_quantity" . $id] >= 1)) ? $_POST[$i . "_element_quantity" . $id] : 1);
2376
- $value .= '<br/>' . $_POST[$i."_element_quantity_label".$id] . ': ' . $quantity;
2377
- }
2378
- for ($k = 0; $k < 50; $k++) {
2379
- $temp_val = $_POST[$i."_element_property_value".$id.$k];
2380
- if (isset($temp_val)) {
2381
- $value .= '<br/>'.$_POST[$i."_element_property_label".$id.$k].': '.$_POST[$i."_element_property_value".$id.$k];
2382
- }
2383
- }
2384
- $list = $list.'<tr valign="top"><td >'.$element_label.'</td><td ><pre style="margin:0px; padding:0px">'.$value.'</pre></td></tr>';
2385
- break;
2386
- }
2387
- case "type_paypal_shipping": {
2388
- $value = $_POST[$i."_element_label".$id].' - '.$_POST[$i."_element".$id].$form_currency;
2389
- $list = $list.'<tr valign="top"><td >'.$element_label.'</td><td ><pre style="margin:0px; padding:0px">'.$value.'</pre></td></tr>';
2390
- break;
2391
- }
2392
- case "type_paypal_checkbox": {
2393
- $list = $list.'<tr valign="top"><td >'.$element_label.'</td><td >';
2394
- $start = -1;
2395
- for ($j = 0; $j < 100; $j++) {
2396
- $element = $_POST[$i."_element".$id.$j];
2397
- if (isset($element)) {
2398
- $start = $j;
2399
- break;
2400
- }
2401
- }
2402
- if ($start != -1) {
2403
- for ($j = $start; $j < 100; $j++) {
2404
- $element = $_POST[$i."_element".$id.$j];
2405
- if (isset($element)) {
2406
- $list = $list.$_POST[$i."_element".$id.$j."_label"].' - '.($_POST[$i."_element".$id.$j]=='' ? '0'.$form_currency : $_POST[$i."_element".$id.$j]).$form_currency.'<br>';
2407
- }
2408
- }
2409
- }
2410
- $element_quantity_label = $_POST[$i."_element_quantity_label".$id];
2411
- if (isset($element_quantity_label)) {
2412
- $quantity = ((isset($_POST[$i . "_element_quantity" . $id]) && ($_POST[$i . "_element_quantity" . $id] >= 1)) ? $_POST[$i . "_element_quantity" . $id] : 1);
2413
- $list = $list.'<br/>'.$_POST[$i."_element_quantity_label".$id].': '.$quantity;
2414
- }
2415
- for ($k = 0; $k < 50; $k++) {
2416
- $temp_val = $_POST[$i."_element_property_value".$id.$k];
2417
- if (isset($temp_val)) {
2418
- $list = $list.'<br/>'.$_POST[$i."_element_property_label".$id.$k].': '.$_POST[$i."_element_property_value".$id.$k];
2419
- }
2420
- }
2421
- $list = $list.'</td></tr>';
2422
- break;
2423
- }
2424
- case "type_star_rating": {
2425
- $selected = (isset($_POST[$i."_selected_star_amount".$id]) ? $_POST[$i."_selected_star_amount".$id] : 0);
2426
- if (isset($_POST[$i."_star_amount".$id])) {
2427
- $list = $list.'<tr valign="top"><td >'.$element_label.'</td><td ><pre style="margin:0px; padding:0px">'.$selected.'/'.$_POST[$i."_star_amount".$id].'</pre></td></tr>';
2428
- }
2429
- break;
2430
- }
2431
- case "type_scale_rating": {
2432
- $selected = (isset($_POST[$i."_scale_radio".$id]) ? $_POST[$i."_scale_radio".$id] : 0);
2433
- if (isset($_POST[$i."_scale_amount".$id])) {
2434
- $list = $list.'<tr valign="top"><td >'.$element_label.'</td><td ><pre style="margin:0px; padding:0px">'.$selected.'/'.$_POST[$i."_scale_radio".$id].'</pre></td></tr>';
2435
- }
2436
- break;
2437
- }
2438
- case "type_spinner": {
2439
- if (isset($_POST[$i."_element".$id])) {
2440
- $list=$list.'<tr valign="top"><td >'.$element_label.'</td><td ><pre style="margin:0px; padding:0px">'.$_POST[$i."_element".$id].'</pre></td></tr>';
2441
- }
2442
- break;
2443
- }
2444
- case "type_slider": {
2445
- if (isset($_POST[$i."_slider_value".$id])) {
2446
- $list=$list.'<tr valign="top"><td >'.$element_label.'</td><td ><pre style="margin:0px; padding:0px">'.$_POST[$i."_slider_value".$id].'</pre></td></tr>';
2447
- }
2448
- break;
2449
- }
2450
- case "type_range": {
2451
- if(isset($_POST[$i."_element".$id.'0']) || isset($_POST[$i."_element".$id.'1'])) {
2452
- $list = $list.'<tr valign="top"><td >'.$element_label.'</td><td ><pre style="margin:0px; padding:0px">From:'.$_POST[$i."_element".$id.'0'].'<span style="margin-left:6px">To</span>:'.$_POST[$i."_element".$id.'1'].'</pre></td></tr>';
2453
- }
2454
- break;
2455
- }
2456
- case "type_grading": {
2457
- if (isset($_POST[$i."_hidden_item".$id])) {
2458
- $element = $_POST[$i."_hidden_item".$id];
2459
- $grading = explode(":", $element);
2460
- $items_count = sizeof($grading) - 1;
2461
- $total = "";
2462
- for ($k = 0; $k < $items_count; $k++) {
2463
- if (isset($_POST[$i."_element".$id.$k])) {
2464
- $element .= $grading[$k].":".$_POST[$i."_element".$id.$k]." ";
2465
- $total += $_POST[$i."_element".$id.$k];
2466
- }
2467
- }
2468
- $element .= "Total:".$total;
2469
- $list = $list.'<tr valign="top"><td >'.$element_label.'</td><td ><pre style="margin:0px; padding:0px">'.$element.'</pre></td></tr>';
2470
- }
2471
- break;
2472
- }
2473
- case "type_matrix": {
2474
- $input_type=$_POST[$i."_input_type".$id];
2475
-
2476
- $mat_rows = $_POST[$i."_hidden_row".$id];
2477
- $mat_rows = explode('***', $mat_rows);
2478
- $mat_rows = array_slice($mat_rows,0, count($mat_rows)-1);
2479
- $mat_columns = $_POST[$i."_hidden_column".$id];
2480
- $mat_columns = explode('***', $mat_columns);
2481
- $mat_columns = array_slice($mat_columns,0, count($mat_columns)-1);
2482
- $row_ids=explode(",",substr($_POST[$i."_row_ids".$id], 0, -1));
2483
- $column_ids=explode(",",substr($_POST[$i."_column_ids".$id], 0, -1));
2484
- $matrix = "<table>";
2485
- $matrix .= '<tr><td></td>';
2486
- for ($k = 0; $k < count($mat_columns); $k++) {
2487
- $matrix .='<td style="background-color:#BBBBBB; padding:5px; ">'.$mat_columns[$k].'</td>';
2488
- }
2489
- $matrix .= '</tr>';
2490
- $aaa = Array();
2491
- $k = 0;
2492
- foreach ($row_ids as $row_id) {
2493
- $matrix .= '<tr><td style="background-color:#BBBBBB; padding:5px;">'.$mat_rows[$k].'</td>';
2494
- if ($input_type=="radio") {
2495
- $mat_radio = (isset($_POST[$i."_input_element".$id.$row_id]) ? $_POST[$i."_input_element".$id.$row_id] : 0);
2496
- if ($mat_radio == 0) {
2497
- $checked = "";
2498
- $aaa[1] = "";
2499
- }
2500
- else {
2501
- $aaa = explode("_", $mat_radio);
2502
- }
2503
- foreach ($column_ids as $column_id) {
2504
- if ($aaa[1] == $column_id) {
2505
- $checked = "checked";
2506
- }
2507
- else {
2508
- $checked = "";
2509
- }
2510
- $matrix .= '<td style="text-align:center"><input type="radio" '.$checked.' disabled /></td>';
2511
- }
2512
- }
2513
- else {
2514
- if ($input_type=="checkbox") {
2515
- foreach($column_ids as $column_id) {
2516
- $checked = $_POST[$i."_input_element".$id.$row_id.'_'.$column_id];
2517
- if ($checked == 1) {
2518
- $checked = "checked";
2519
- }
2520
- else {
2521
- $checked = "";
2522
- }
2523
- $matrix .= '<td style="text-align:center"><input type="checkbox" '.$checked.' disabled /></td>';
2524
- }
2525
- }
2526
- else {
2527
- if ($input_type=="text") {
2528
- foreach ($column_ids as $column_id) {
2529
- $checked = $_POST[$i."_input_element".$id.$row_id.'_'.$column_id];
2530
- $matrix .='<td style="text-align:center"><input type="text" value="'.$checked.'" disabled /></td>';
2531
- }
2532
- }
2533
- else {
2534
- foreach ($column_ids as $column_id) {
2535
- $checked = $_POST[$i."_select_yes_no".$id.$row_id.'_'.$column_id];
2536
- $matrix .='<td style="text-align:center">'.$checked.'</td>';
2537
- }
2538
- }
2539
- }
2540
- }
2541
- $matrix .= '</tr>';
2542
- $k++;
2543
- }
2544
- $matrix .= '</table>';
2545
- if (isset($matrix)) {
2546
- $list = $list.'<tr valign="top"><td >'.$element_label.'</td><td ><pre style="margin:0px; padding:0px">'.$matrix.'</pre></td></tr>';
2547
- }
2548
- break;
2549
- }
2550
- default:
2551
- break;
2552
- }
2553
- }
2554
- }
2555
- $list = $list . '</table>';
2556
- $list = wordwrap($list, 70, "\n", TRUE);
2557
- // add_filter('wp_mail_content_type', create_function('', 'return "text/html";'));
2558
- if ($row->from_mail != '') {
2559
- if ($row->from_name != '') {
2560
- $from_mail = "From: '" . $row->from_name . "' <" . $row->from_mail . ">" . "\r\n";
2561
- }
2562
- else {
2563
- $from_mail = "From: '' <" . $row->from_mail . ">" . "\r\n";
2564
- }
2565
- }
2566
- else {
2567
- $from_mail = '';
2568
- }
2569
- $headers = "MIME-Version: 1.0\n" . $from_mail . " Content-Type: text/html; charset=\"" . get_option('blog_charset') . "\"\n";
2570
- for ($k = 0; $k < count($all_files); $k++) {
2571
- // $attachment[$k] = dirname(__FILE__) . '/uploads/' . $all_files[$k]['name'];
2572
- $attachment[$k]= $all_files[$k]['name'];
2573
- }
2574
- if (isset($cc[0])) {
2575
- foreach ($cc as $c) {
2576
- if ($c) {
2577
- $recipient = $c;
2578
- $subject = $row->title;
2579
- $new_script = wpautop($row->script_mail_user);
2580
- foreach ($label_order_original as $key => $label_each) {
2581
- if (strpos($row->script_mail_user, "%" . $label_each . "%") !== FALSE) {
2582
- $type = $label_type[$key];
2583
- if ($type != "type_submit_reset" or $type != "type_map" or $type != "type_editor" or $type != "type_captcha" or $type != "type_recaptcha" or $type != "type_button") {
2584
- $new_value = "";
2585
- switch ($type) {
2586
- case 'type_text':
2587
- case 'type_password':
2588
- case 'type_textarea':
2589
- case "type_date":
2590
- case "type_own_select":
2591
- case "type_country":
2592
- case "type_number": {
2593
- $element = $_POST[$key."_element".$id];
2594
- if (isset($element)) {
2595
- $new_value = $element;
2596
- }
2597
- break;
2598
- }
2599
- case "type_hidden": {
2600
- $element = $_POST[$element_label];
2601
- if (isset($element)) {
2602
- $new_value = $element;
2603
- }
2604
- break;
2605
- }
2606
- case "type_mark_map": {
2607
- $element = $_POST[$key."_long".$id];
2608
- if (isset($element)) {
2609
- $new_value = 'Longitude:'.$_POST[$key."_long".$id].'<br/>Latitude:' . $_POST[$key."_lat".$id];
2610
- }
2611
- break;
2612
- }
2613
- case "type_submitter_mail": {
2614
- $element = $_POST[$key."_element".$id];
2615
- if (isset($element)) {
2616
- $new_value = $element;
2617
- }
2618
- break;
2619
- }
2620
- case "type_time": {
2621
- $hh = $_POST[$key."_hh".$id];
2622
- if (isset($hh)) {
2623
- $ss = $_POST[$key."_ss".$id];
2624
- if (isset($ss)) {
2625
- $new_value = $_POST[$key."_hh".$id].':'.$_POST[$key."_mm".$id].':'.$_POST[$key."_ss".$id];
2626
- }
2627
- else {
2628
- $new_value = $_POST[$key."_hh".$id].':'.$_POST[$key."_mm".$id];
2629
- }
2630
- $am_pm = $_POST[$key."_am_pm".$id];
2631
- if (isset($am_pm)) {
2632
- $new_value = $new_value.' '.$_POST[$key."_am_pm".$id];
2633
- }
2634
- }
2635
- break;
2636
- }
2637
- case "type_phone": {
2638
- $element_first = $_POST[$key."_element_first".$id];
2639
- if (isset($element_first)) {
2640
- $new_value = $_POST[$key."_element_first".$id].' '.$_POST[$key."_element_last".$id];
2641
- }
2642
- break;
2643
- }
2644
- case "type_name": {
2645
- $element_first = $_POST[$key."_element_first".$id];
2646
- if (isset($element_first)) {
2647
- $element_title = $_POST[$key."_element_title".$id];
2648
- if (isset($element_title)) {
2649
- $new_value = $_POST[$key."_element_title".$id].' '.$_POST[$key."_element_first".$id].' '.$_POST[$key."_element_last".$id].' '.$_POST[$key."_element_middle".$id];
2650
- }
2651
- else {
2652
- $new_value = $_POST[$key."_element_first".$id].' '.$_POST[$key."_element_last".$id];
2653
- }
2654
- }
2655
- break;
2656
- }
2657
- case "type_address": {
2658
- if (isset($_POST[$key."_street1".$id])) {
2659
- $new_value = $new_value.$_POST[$key."_street1".$id];
2660
- break;
2661
- }
2662
- if (isset($_POST[$key."_street2".$id])) {
2663
- $new_value = $new_value.$_POST[$key."_street2".$id];
2664
- break;
2665
- }
2666
- if (isset($_POST[$key."_city".$id])) {
2667
- $new_value = $new_value.$_POST[$key."_city".$id];
2668
- break;
2669
- }
2670
- if (isset($_POST[$key."_state".$id])) {
2671
- $new_value = $new_value.$_POST[$key."_state".$id];
2672
- break;
2673
- }
2674
- if (isset($_POST[$key."_postal".$id])) {
2675
- $new_value = $new_value.$_POST[$key."_postal".$id];
2676
- break;
2677
- }
2678
- if (isset($_POST[$key."_country".$id])) {
2679
- $new_value = $new_value.$_POST[$key."_country".$id];
2680
- break;
2681
- }
2682
- }
2683
- case "type_date_fields": {
2684
- $day = $_POST[$key."_day".$id];
2685
- if (isset($day)) {
2686
- $new_value = $_POST[$key."_day".$id].'-'.$_POST[$key."_month".$id].'-'.$_POST[$key."_year".$id];
2687
- }
2688
- break;
2689
- }
2690
- case "type_radio": {
2691
- $element = $_POST[$key."_other_input".$id];
2692
- if (isset($element)) {
2693
- $new_value = $_POST[$key."_other_input".$id];
2694
- break;
2695
- }
2696
- $element = $_POST[$key."_element".$id];
2697
- if (isset($element)) {
2698
- $new_value = $element;
2699
- }
2700
- break;
2701
- }
2702
- case "type_checkbox": {
2703
- $start = -1;
2704
- for ($j = 0; $j < 100; $j++) {
2705
- $element = $_POST[$key."_element".$id.$j];
2706
- if (isset($element)) {
2707
- $start = $j;
2708
- break;
2709
- }
2710
- }
2711
- $other_element_id = -1;
2712
- $is_other = $_POST[$key."_allow_other".$id];
2713
- if ($is_other == "yes") {
2714
- $other_element_id = $_POST[$key."_allow_other_num".$id];
2715
- }
2716
- if ($start != -1) {
2717
- for ($j = $start; $j < 100; $j++) {
2718
- $element = $_POST[$key."_element".$id.$j];
2719
- if (isset($element)) {
2720
- if ($j == $other_element_id) {
2721
- $new_value = $new_value.$_POST[$key."_other_input".$id].'<br>';
2722
- }
2723
- else {
2724
- $new_value = $new_value.$_POST[$key."_element".$id.$j].'<br>';
2725
- }
2726
- }
2727
- }
2728
- }
2729
- break;
2730
- }
2731
- case "type_paypal_price": {
2732
- $new_value = 0;
2733
- if ($_POST[$key."_element_dollars".$id]) {
2734
- $new_value = $_POST[$key."_element_dollars".$id];
2735
- }
2736
- if ($_POST[$key."_element_cents".$id]) {
2737
- $new_value = $new_value.'.'.$_POST[$key."_element_cents".$id];
2738
- }
2739
- $new_value = $new_value.$form_currency;
2740
- break;
2741
- }
2742
- case "type_paypal_select": {
2743
- $new_value = $_POST[$key."_element_label".$id].':'.$_POST[$key."_element".$id].$form_currency;
2744
- $element_quantity_label = $_POST[$key."_element_quantity_label".$id];
2745
- if (isset($element_quantity_label)) {
2746
- $quantity = ((isset($_POST[$key . "_element_quantity" . $id]) && ($_POST[$key . "_element_quantity" . $id] >= 1)) ? $_POST[$key . "_element_quantity" . $id] : 1);
2747
- $new_value.='<br/>'.$_POST[$key."_element_quantity_label".$id].': '.$quantity;
2748
- }
2749
- for ($k = 0; $k < 50; $k++) {
2750
- $temp_val = $_POST[$key."_element_property_value".$id.$k];
2751
- if (isset($temp_val)) {
2752
- $new_value .= '<br/>'.$_POST[$key."_element_property_label".$id.$k].': '.$_POST[$i."_element_property_value".$id.$k];
2753
- }
2754
- }
2755
- break;
2756
- }
2757
- case "type_paypal_radio": {
2758
- $new_value = $_POST[$key."_element_label".$id].' - '.$_POST[$key."_element".$id].$form_currency;
2759
- $element_quantity_label = $_POST[$key."_element_quantity_label".$id];
2760
- if (isset($element_quantity_label)) {
2761
- $quantity = ((isset($_POST[$key . "_element_quantity" . $id]) && ($_POST[$key . "_element_quantity" . $id] >= 1)) ? $_POST[$key . "_element_quantity" . $id] : 1);
2762
- $new_value .= '<br/>'.$_POST[$key."_element_quantity_label".$id].': '.$quantity;
2763
- }
2764
- for ($k = 0; $k < 50; $k++) {
2765
- $temp_val = $_POST[$key."_element_property_value".$id.$k];
2766
- if (isset($temp_val)) {
2767
- $new_value .= '<br/>' . $_POST[$key."_element_property_label".$id.$k].': '.$_POST[$key."_element_property_value".$id.$k];
2768
- }
2769
- }
2770
- break;
2771
- }
2772
- case "type_paypal_shipping": {
2773
- $new_value = $_POST[$key."_element_label".$id].' : '.$_POST[$key."_element".$id].$form_currency;
2774
- break;
2775
- }
2776
- case "type_paypal_checkbox": {
2777
- $start = -1;
2778
- for($j = 0; $j < 100; $j++) {
2779
- $element = $_POST[$key."_element".$id.$j];
2780
- if (isset($element)) {
2781
- $start = $j;
2782
- break;
2783
- }
2784
- }
2785
- if ($start != -1) {
2786
- for ($j = $start; $j<100; $j++) {
2787
- $element = $_POST[$key."_element".$id.$j];
2788
- if (isset($element)) {
2789
- $new_value = $new_value.$_POST[$key."_element".$id.$j."_label"].' - '.(($_POST[$key."_element".$id.$j] == '') ? '0'.$form_currency : $_POST[$key."_element".$id.$j]).$form_currency.'<br>';
2790
- }
2791
- }
2792
- }
2793
- $element_quantity_label = $_POST[$key."_element_quantity_label".$id];
2794
- if (isset($element_quantity_label)) {
2795
- $quantity = ((isset($_POST[$key . "_element_quantity" . $id]) && ($_POST[$key . "_element_quantity" . $id] >= 1)) ? $_POST[$key . "_element_quantity" . $id] : 1);
2796
- $new_value .= '<br/>'.$_POST[$key."_element_quantity_label".$id].': '.$quantity;
2797
- }
2798
- for ($k = 0; $k < 50; $k++) {
2799
- $temp_val = $_POST[$key."_element_property_value".$id.$k];
2800
- if (isset($temp_val)) {
2801
- $new_value .= '<br/>'.$_POST[$key."_element_property_label".$id.$k].': '.$_POST[$key."_element_property_value".$id.$k];
2802
- }
2803
- }
2804
- break;
2805
- }
2806
- case "type_star_rating":
2807
- {
2808
- $element=$_POST[$key."_star_amount".$id];
2809
- $selected=(isset($_POST[$key."_selected_star_amount".$id]) ? $_POST[$key."_selected_star_amount".$id] : 0);
2810
-
2811
-
2812
- if(isset($element))
2813
- {
2814
- $new_value=$new_value.$selected.'/'.$element;
2815
- }
2816
- break;
2817
- }
2818
-
2819
 
2820
- case "type_scale_rating":
2821
- {
2822
- $element=$_POST[$key."_scale_amount".$id];
2823
- $selected=(isset($_POST[$key."_scale_radio".$id]) ? $_POST[$key."_scale_radio".$id] : 0);
2824
-
2825
-
2826
- if(isset($element))
2827
- {
2828
- $new_value=$new_value.$selected.'/'.$element;
2829
- }
2830
- break;
2831
- }
2832
-
2833
- case "type_spinner":
2834
- {
2835
 
2836
- if (isset($_POST[$key."_element".$id])) {
2837
- $new_value = $new_value . $_POST[$key."_element".$id];
2838
- }
2839
- break;
2840
- }
2841
-
2842
- case "type_slider":
2843
- {
2844
 
2845
- $element=$_POST[$key."_slider_value".$id];
2846
- if(isset($element))
2847
- {
2848
- $new_value=$new_value.$element;
2849
- }
2850
- break;
2851
- }
2852
- case "type_range":
2853
- {
2854
 
2855
- $element0=$_POST[$key."_element".$id.'0'];
2856
- $element1=$_POST[$key."_element".$id.'1'];
2857
- if(isset($element0) || isset($element1))
2858
- {
2859
- $new_value=$new_value.$element0.'-'.$element1;
2860
- }
2861
- break;
2862
- }
2863
-
2864
- case "type_grading":
2865
- {
2866
- $element=$_POST[$key."_hidden_item".$id];
2867
- $grading = explode(":",$element);
2868
- $items_count = sizeof($grading)-1;
2869
-
2870
- $element = "";
2871
- $total = "";
2872
-
2873
- for($k=0;$k<$items_count;$k++)
2874
 
2875
- {
2876
- $element .= $grading[$k].":".$_POST[$key."_element".$id.$k]." ";
2877
- $total += $_POST[$key."_element".$id.$k];
2878
- }
2879
 
2880
- $element .="Total:".$total;
2881
 
2882
-
2883
- if(isset($element))
2884
- {
2885
- $new_value=$new_value.$element;
2886
- }
2887
- break;
2888
- }
2889
-
2890
- case "type_matrix":
2891
- {
2892
-
2893
-
2894
- $input_type=$_POST[$key."_input_type".$id];
2895
-
2896
- $mat_rows = $_POST[$key."_hidden_row".$id];
2897
- $mat_rows = explode('***', $mat_rows);
2898
- $mat_rows = array_slice($mat_rows,0, count($mat_rows)-1);
2899
-
2900
- $mat_columns = $_POST[$key."_hidden_column".$id];
2901
- $mat_columns = explode('***', $mat_columns);
2902
- $mat_columns = array_slice($mat_columns,0, count($mat_columns)-1);
2903
-
2904
- $row_ids=explode(",",substr($_POST[$key."_row_ids".$id], 0, -1));
2905
- $column_ids=explode(",",substr($_POST[$key."_column_ids".$id], 0, -1));
2906
-
2907
-
2908
- $matrix="<table>";
2909
-
2910
- $matrix .='<tr><td></td>';
2911
-
2912
- for( $k=0;$k< count($mat_columns) ;$k++)
2913
- $matrix .='<td style="background-color:#BBBBBB; padding:5px; ">'.$mat_columns[$k].'</td>';
2914
- $matrix .='</tr>';
2915
-
2916
- $aaa=Array();
2917
- $k=0;
2918
- foreach( $row_ids as $row_id){
2919
- $matrix .='<tr><td style="background-color:#BBBBBB; padding:5px;">'.$mat_rows[$k].'</td>';
2920
-
2921
- if($input_type=="radio"){
2922
-
2923
- $mat_radio = (isset($_POST[$key."_input_element".$id.$row_id]) ? $_POST[$key."_input_element".$id.$row_id] : 0);
2924
- if($mat_radio==0){
2925
- $checked="";
2926
- $aaa[1]="";
2927
- }
2928
- else{
2929
- $aaa=explode("_",$mat_radio);
2930
- }
2931
-
2932
- foreach( $column_ids as $column_id){
2933
- if($aaa[1]==$column_id)
2934
- $checked="checked";
2935
- else
2936
- $checked="";
2937
- $matrix .='<td style="text-align:center"><input type="radio" '.$checked.' disabled /></td>';
2938
-
2939
- }
2940
-
2941
- }
2942
- else{
2943
- if($input_type=="checkbox")
2944
- {
2945
- foreach( $column_ids as $column_id){
2946
- $checked = $_POST[$key."_input_element".$id.$row_id.'_'.$column_id];
2947
- if($checked==1)
2948
- $checked = "checked";
2949
- else
2950
- $checked = "";
2951
 
2952
- $matrix .='<td style="text-align:center"><input type="checkbox" '.$checked.' disabled /></td>';
2953
-
2954
- }
2955
-
2956
- }
2957
- else
2958
- {
2959
- if($input_type=="text")
2960
- {
2961
-
2962
- foreach( $column_ids as $column_id){
2963
- $checked = $_POST[$key."_input_element".$id.$row_id.'_'.$column_id];
2964
-
2965
- $matrix .='<td style="text-align:center"><input type="text" value="'.$checked.'" disabled /></td>';
2966
-
2967
- }
2968
-
2969
- }
2970
- else{
2971
- foreach( $column_ids as $column_id){
2972
- $checked = $_POST[$key."_select_yes_no".$id.$row_id.'_'.$column_id];
2973
- $matrix .='<td style="text-align:center">'.$checked.'</td>';
2974
-
2975
-
2976
-
2977
- }
2978
- }
2979
-
2980
- }
2981
-
2982
- }
2983
- $matrix .='</tr>';
2984
- $k++;
2985
- }
2986
- $matrix .='</table>';
2987
 
2988
-
2989
-
2990
-
2991
-
2992
- if(isset($matrix))
2993
- {
2994
- $new_value=$new_value.$matrix;
2995
- }
2996
-
2997
- break;
2998
- }
2999
- default: break;
3000
- }
3001
- $new_script = str_replace("%".$label_each."%", $new_value, $new_script);
3002
- }
3003
- }
3004
- }
3005
- if (strpos($new_script, "%all%") !== FALSE) {
3006
- $new_script = str_replace("%all%", $list, $new_script);
3007
- }
3008
- $body = $new_script;
3009
- $send = wp_mail(str_replace(' ', '', $recipient), $subject, stripslashes($body), $headers, $attachment);
3010
- }
3011
- if ($row->mail) {
3012
- if ($c) {
3013
- // $headers_form_mail = "From: " . $c . " <" . $c . ">" . "\r\n";
3014
- $headers = "MIME-Version: 1.0\n" . "From: '" . $c . "' <" . $c . ">" . "\r\n" . "Content-Type: text/html; charset=\"" . get_option('blog_charset') . "\"\n";
3015
- }
3016
- // else {
3017
- // $headers_form_mail = "";
3018
- // }
3019
- if ($row_mail_one_time) {
3020
- $recipient = $row->mail;
3021
- $subject = $row->title;
3022
- $new_script = wpautop($row->script_mail);
3023
- foreach($label_order_original as $key => $label_each) {
3024
- if (strpos($row->script_mail, "%" . $label_each . "%") !== FALSE) {
3025
- $type = $label_type[$key];
3026
- if ($type != "type_submit_reset" or $type!="type_map" or $type!="type_editor" or $type!="type_captcha" or $type!="type_recaptcha" or $type!="type_button") {
3027
- $new_value ="";
3028
- switch ($type) {
3029
- case 'type_text':
3030
- case 'type_password':
3031
- case 'type_textarea':
3032
- case "type_date":
3033
- case "type_own_select":
3034
- case "type_country":
3035
- case "type_number": {
3036
- $element = $_POST[$key."_element".$id];
3037
- if (isset($element)) {
3038
- $new_value = $element;
3039
- }
3040
- break;
3041
- }
3042
- case "type_hidden": {
3043
- $element = $_POST[$element_label];
3044
- if(isset($element))
3045
- {
3046
- $new_value = $element;
3047
- }
3048
- break;
3049
- }
3050
- case "type_mark_map": {
3051
- $element = $_POST[$key."_long".$id];
3052
- if (isset($element)) {
3053
- $new_value = 'Longitude:'.$_POST[$key."_long".$id].'<br/>Latitude:'.$_POST[$key."_lat".$id];
3054
- }
3055
- break;
3056
- }
3057
- case "type_submitter_mail": {
3058
- $element = $_POST[$key."_element".$id];
3059
- if (isset($element)) {
3060
- $new_value = $element;
3061
- }
3062
- break;
3063
- }
3064
- case "type_time": {
3065
- $hh = $_POST[$key."_hh".$id];
3066
- if (isset($hh)) {
3067
- $ss = $_POST[$key."_ss".$id];
3068
- if (isset($ss)) {
3069
- $new_value = $_POST[$key."_hh".$id].':'.$_POST[$key."_mm".$id].':'.$_POST[$key."_ss".$id];
3070
- }
3071
- else {
3072
- $new_value = $_POST[$key."_hh".$id].':'.$_POST[$key."_mm".$id];
3073
- }
3074
- $am_pm = $_POST[$key."_am_pm".$id];
3075
- if (isset($am_pm)) {
3076
- $new_value = $new_value.' '.$_POST[$key."_am_pm".$id];
3077
- }
3078
- }
3079
- break;
3080
- }
3081
- case "type_phone": {
3082
- $element_first = $_POST[$key."_element_first".$id];
3083
- if (isset($element_first)) {
3084
- $new_value = $_POST[$key."_element_first".$id].' '.$_POST[$key."_element_last".$id];
3085
- }
3086
- break;
3087
- }
3088
- case "type_name": {
3089
- $element_first = $_POST[$key."_element_first".$id];
3090
- if (isset($element_first)) {
3091
- $element_title = $_POST[$key."_element_title".$id];
3092
- if (isset($element_title)) {
3093
- $new_value = $_POST[$key."_element_title".$id].' '.$_POST[$key."_element_first".$id].' '.$_POST[$key."_element_last".$id].' '.$_POST[$key."_element_middle".$id];
3094
- }
3095
- else {
3096
- $new_value = $_POST[$key."_element_first".$id].' '.$_POST[$key."_element_last".$id];
3097
- }
3098
- }
3099
- break;
3100
- }
3101
- case "type_address": {
3102
- $street1 = $_POST[$key."_street1".$id];
3103
- if (isset($_POST[$key."_street1".$id])) {
3104
- $new_value = $new_value.$_POST[$key."_street1".$id];
3105
- break;
3106
- }
3107
- if (isset($_POST[$key."_street2".$id])) {
3108
- $new_value=$new_value.$_POST[$key."_street2".$id];
3109
- break;
3110
- }
3111
- if (isset($_POST[$key."_city".$id])) {
3112
- $new_value=$new_value.$_POST[$key."_city".$id];
3113
- break;
3114
- }
3115
- if (isset($_POST[$key."_state".$id])) {
3116
- $new_value=$new_value.$_POST[$key."_state".$id];
3117
- break;
3118
- }
3119
- if (isset($_POST[$key."_postal".$id])) {
3120
- $new_value=$new_value.$_POST[$key."_postal".$id];
3121
- break;
3122
- }
3123
- if (isset($_POST[$key."_country".$id])) {
3124
- $new_value=$new_value.$_POST[$key."_country".$id];
3125
- break;
3126
- }
3127
- }
3128
- case "type_date_fields": {
3129
- $day = $_POST[$key."_day".$id];
3130
- if (isset($day)) {
3131
- $new_value = $_POST[$key."_day".$id].'-'.$_POST[$key."_month".$id].'-'.$_POST[$key."_year".$id];
3132
- }
3133
- break;
3134
- }
3135
- case "type_radio": {
3136
- $element = $_POST[$key."_other_input".$id];
3137
- if (isset($element)) {
3138
- $new_value = $_POST[$key."_other_input".$id];
3139
- break;
3140
- }
3141
- $element = $_POST[$key."_element".$id];
3142
- if (isset($element)) {
3143
- $new_value = $element;
3144
- }
3145
- break;
3146
- }
3147
- case "type_checkbox": {
3148
- $start = -1;
3149
- for ($j=0; $j<100; $j++) {
3150
- $element = $_POST[$key."_element".$id.$j];
3151
- if (isset($element)) {
3152
- $start = $j;
3153
- break;
3154
- }
3155
- }
3156
- $other_element_id=-1;
3157
- $is_other = $_POST[$key."_allow_other".$id];
3158
- if ($is_other == "yes") {
3159
- $other_element_id = $_POST[$key."_allow_other_num".$id];
3160
- }
3161
- if ($start != -1) {
3162
- for ($j = $start; $j < 100; $j++) {
3163
- $element = $_POST[$key."_element".$id.$j];
3164
- if (isset($element)) {
3165
- if ($j == $other_element_id) {
3166
- $new_value = $new_value.$_POST[$key."_other_input".$id].'<br>';
3167
- }
3168
- else {
3169
- $new_value = $new_value.$_POST[$key."_element".$id.$j].'<br>';
3170
- }
3171
- }
3172
- }
3173
- }
3174
- break;
3175
- }
3176
- case "type_paypal_price": {
3177
- $new_value = 0;
3178
- if ($_POST[$key."_element_dollars".$id]) {
3179
- $new_value = $_POST[$key."_element_dollars".$id];
3180
- }
3181
- if ($_POST[$key."_element_cents".$id]) {
3182
- $new_value = $new_value.'.'.$_POST[$key."_element_cents".$id];
3183
- }
3184
- $new_value = $new_value.$form_currency;
3185
- break;
3186
- }
3187
- case "type_paypal_select": {
3188
- $new_value = $_POST[$key."_element_label".$id].':'.$_POST[$key."_element".$id].$form_currency;
3189
- $element_quantity_label = $_POST[$key."_element_quantity_label".$id];
3190
- if (isset($element_quantity_label)) {
3191
- $quantity = ((isset($_POST[$key . "_element_quantity" . $id]) && ($_POST[$key . "_element_quantity" . $id] >= 1)) ? $_POST[$key . "_element_quantity" . $id] : 1);
3192
- $new_value .= '<br/>'.$_POST[$key."_element_quantity_label".$id].': '.$quantity;
3193
- }
3194
- for($k = 0; $k < 50; $k++) {
3195
- $temp_val = $_POST[$key."_element_property_value".$id.$k];
3196
- if (isset($temp_val)) {
3197
- $new_value .= '<br/>'.$_POST[$key."_element_property_label".$id.$k].': '.$_POST[$key."_element_property_value".$id.$k];
3198
- }
3199
- }
3200
- break;
3201
- }
3202
- case "type_paypal_radio": {
3203
- $new_value = $_POST[$key."_element_label".$id].' - '.$_POST[$key."_element".$id].$form_currency;
3204
- $element_quantity_label = $_POST[$key."_element_quantity_label".$id];
3205
- if (isset($element_quantity_label)) {
3206
- $quantity = ((isset($_POST[$key . "_element_quantity" . $id]) && ($_POST[$key . "_element_quantity" . $id] >= 1)) ? $_POST[$key . "_element_quantity" . $id] : 1);
3207
- $new_value .= '<br/>'.$_POST[$key."_element_quantity_label".$id].': '.$quantity;
3208
- }
3209
- for ($k = 0; $k < 50; $k++) {
3210
- $temp_val = $_POST[$key."_element_property_value".$id.$k];
3211
- if (isset($temp_val)) {
3212
- $new_value .= '<br/>'.$_POST[$key."_element_property_label".$id.$k].': '.$_POST[$key."_element_property_value".$id.$k];
3213
- }
3214
- }
3215
- break;
3216
- }
3217
- case "type_paypal_shipping": {
3218
- $new_value = $_POST[$key."_element_label".$id].' : '.$_POST[$key."_element".$id].$form_currency;
3219
- break;
3220
- }
3221
- case "type_paypal_checkbox": {
3222
- $start = -1;
3223
- for ($j = 0; $j < 100; $j++) {
3224
- $element = $_POST[$key."_element".$id.$j];
3225
- if (isset($element)) {
3226
- $start = $j;
3227
- break;
3228
- }
3229
- }
3230
- if ($start != -1) {
3231
- for ($j = $start; $j < 100; $j++) {
3232
- $element = $_POST[$key."_element".$id.$j];
3233
- if (isset($element)) {
3234
- $new_value = $new_value.$_POST[$key."_element".$id.$j."_label"].' - '.(($_POST[$key."_element".$id.$j] == '') ? '0'.$form_currency : $_POST[$key."_element".$id.$j]).$form_currency.'<br>';
3235
- }
3236
- }
3237
- }
3238
- $element_quantity_label = $_POST[$key."_element_quantity_label".$id];
3239
- if (isset($element_quantity_label)) {
3240
- $quantity = ((isset($_POST[$key . "_element_quantity" . $id]) && ($_POST[$key . "_element_quantity" . $id] >= 1)) ? $_POST[$key . "_element_quantity" . $id] : 1);
3241
- $new_value .= '<br/>'.$_POST[$key."_element_quantity_label".$id].': '.$quantity;
3242
- }
3243
- for ($k = 0; $k < 50; $k++) {
3244
- $temp_val = $_POST[$key."_element_property_value".$id.$k];
3245
- if (isset($temp_val)) {
3246
- $new_value .= '<br/>'.$_POST[$key."_element_property_label".$id.$k].': '.$_POST[$key."_element_property_value".$id.$k];
3247
- }
3248
- }
3249
- break;
3250
- }
3251
- case "type_star_rating": {
3252
- if (isset($_POST[$key."_star_amount".$id])) {
3253
- $selected = (isset($_POST[$key."_selected_star_amount".$id]) ? $_POST[$key."_selected_star_amount".$id] : 0);
3254
- $new_value = $new_value.$selected.'/'.$_POST[$key."_star_amount".$id];
3255
- }
3256
- break;
3257
- }
3258
- case "type_scale_rating": {
3259
- if (isset($_POST[$key."_scale_amount".$id])) {
3260
- $selected = (isset($_POST[$key."_scale_radio".$id]) ? $_POST[$key."_scale_radio".$id] : 0);
3261
- $new_value=$new_value.$selected.'/'.$_POST[$key."_scale_amount".$id];
3262
- }
3263
- break;
3264
- }
3265
- case "type_spinner": {
3266
- if(isset($_POST[$key."_element".$id])) {
3267
- $new_value = $new_value.$_POST[$key."_element".$id];
3268
- }
3269
- break;
3270
- }
3271
- case "type_slider": {
3272
- if (isset($_POST[$key."_slider_value".$id])) {
3273
- $new_value = $new_value.$_POST[$key."_slider_value".$id];
3274
- }
3275
- break;
3276
- }
3277
- case "type_range": {
3278
- if (isset($_POST[$key."_element".$id.'0']) || isset($_POST[$key."_element".$id.'1'])) {
3279
- $new_value=$new_value.$_POST[$key."_element".$id.'0'].'-'.$_POST[$key."_element".$id.'1'];
3280
- }
3281
- break;
3282
- }
3283
-
3284
- case "type_grading":
3285
- {
3286
- $element=$_POST[$key."_hidden_item".$id];
3287
- $grading = explode(":",$element);
3288
- $items_count = sizeof($grading)-1;
3289
-
3290
- $element = "";
3291
- $total = "";
3292
-
3293
- for($k=0;$k<$items_count;$k++) {
3294
- $element .= $grading[$k].":".$_POST[$key."_element".$id.$k]." ";
3295
- $total += $_POST[$key."_element".$id.$k];
3296
- }
3297
 
3298
- $element .="Total:".$total;
3299
 
3300
-
3301
- if(isset($element))
3302
- {
3303
- $new_value=$new_value.$element;
3304
- }
3305
- break;
3306
- }
3307
-
3308
- case "type_matrix":
3309
- {
3310
-
3311
-
3312
- $input_type=$_POST[$key."_input_type".$id];
3313
-
3314
- $mat_rows = $_POST[$key."_hidden_row".$id];
3315
- $mat_rows = explode('***', $mat_rows);
3316
- $mat_rows = array_slice($mat_rows,0, count($mat_rows)-1);
3317
-
3318
- $mat_columns = $_POST[$key."_hidden_column".$id];
3319
- $mat_columns = explode('***', $mat_columns);
3320
- $mat_columns = array_slice($mat_columns,0, count($mat_columns)-1);
3321
-
3322
- $row_ids=explode(",",substr($_POST[$key."_row_ids".$id], 0, -1));
3323
- $column_ids=explode(",",substr($_POST[$key."_column_ids".$id], 0, -1));
3324
- $matrix="<table>";
3325
-
3326
- $matrix .='<tr><td></td>';
3327
-
3328
- for( $k=0;$k< count($mat_columns) ;$k++)
3329
- $matrix .='<td style="background-color:#BBBBBB; padding:5px; ">'.$mat_columns[$k].'</td>';
3330
- $matrix .='</tr>';
3331
-
3332
- $aaa=Array();
3333
- $k=0;
3334
- foreach( $row_ids as $row_id){
3335
- $matrix .='<tr><td style="background-color:#BBBBBB; padding:5px;">'.$mat_rows[$k].'</td>';
3336
-
3337
- if($input_type=="radio"){
3338
-
3339
- $mat_radio = (isset($_POST[$key."_input_element".$id.$row_id]) ? $_POST[$key."_input_element".$id.$row_id] : 0);
3340
- if($mat_radio==0){
3341
- $checked="";
3342
- $aaa[1]="";
3343
- }
3344
- else{
3345
- $aaa=explode("_",$mat_radio);
3346
- }
3347
-
3348
- foreach( $column_ids as $column_id){
3349
- if($aaa[1]==$column_id)
3350
- $checked="checked";
3351
- else
3352
- $checked="";
3353
- $matrix .='<td style="text-align:center"><input type="radio" '.$checked.' disabled /></td>';
3354
-
3355
- }
3356
-
3357
- }
3358
- else{
3359
- if($input_type=="checkbox")
3360
- {
3361
- foreach( $column_ids as $column_id){
3362
- $checked = $_POST[$key."_input_element".$id.$row_id.'_'.$column_id];
3363
- if($checked==1)
3364
- $checked = "checked";
3365
- else
3366
- $checked = "";
3367
 
3368
- $matrix .='<td style="text-align:center"><input type="checkbox" '.$checked.' disabled /></td>';
3369
-
3370
- }
3371
-
3372
- }
3373
- else
3374
- {
3375
- if($input_type=="text")
3376
- {
3377
-
3378
- foreach( $column_ids as $column_id){
3379
- $checked = $_POST[$key."_input_element".$id.$row_id.'_'.$column_id];
3380
-
3381
- $matrix .='<td style="text-align:center"><input type="text" value="'.$checked.'" disabled /></td>';
3382
-
3383
- }
3384
-
3385
- }
3386
- else{
3387
- foreach( $column_ids as $column_id){
3388
- $checked = $_POST[$key."_select_yes_no".$id.$row_id.'_'.$column_id];
3389
- $matrix .='<td style="text-align:center">'.$checked.'</td>';
3390
-
3391
-
3392
-
3393
- }
3394
- }
3395
-
3396
- }
3397
-
3398
- }
3399
- $matrix .='</tr>';
3400
- $k++;
3401
- }
3402
- $matrix .='</table>';
3403
 
3404
-
3405
-
3406
-
3407
-
3408
- if(isset($matrix))
3409
- {
3410
- $new_value=$new_value.$matrix;
3411
- }
3412
-
3413
- break;
3414
- }
3415
- default: break;
3416
- }
3417
- $new_script = str_replace("%".$label_each."%", $new_value, $new_script);
3418
- }
3419
- }
3420
- }
3421
- if (strpos($new_script, "%all%") !== FALSE) {
3422
- $new_script = str_replace("%all%", $list, $new_script);
3423
- }
3424
- $body = $new_script;
3425
- $mode = 1;
3426
- $send = wp_mail(str_replace(' ', '', $recipient), $subject, stripslashes($body), $headers, $attachment);
3427
- $row_mail_one_time = 0;
3428
- }
3429
- }
3430
- }
3431
- }
3432
- else {
3433
- if ($row->mail) {
3434
- $recipient = $row->mail;
3435
- $subject = $row->title;
3436
- $new_script = wpautop($row->script_mail);
3437
- foreach($label_order_original as $key => $label_each) {
3438
- if (strpos($row->script_mail, "%" . $label_each . "%") !== FALSE) {
3439
- $type = $label_type[$key];
3440
- if ($type != "type_submit_reset" or $type != "type_map" or $type != "type_editor" or $type!="type_captcha" or $type!="type_recaptcha" or $type!="type_button") {
3441
- $new_value = "";
3442
- switch ($type) {
3443
- case 'type_text':
3444
- case 'type_password':
3445
- case 'type_textarea':
3446
- case "type_date":
3447
- case "type_own_select":
3448
- case "type_country":
3449
- case "type_number": {
3450
- $element = $_POST[$key."_element".$id];
3451
- if (isset($element)) {
3452
- $new_value = $element;
3453
- }
3454
- break;
3455
- }
3456
- case "type_hidden": {
3457
- $element = $_POST[$element_label];
3458
- if (isset($element)) {
3459
- $new_value = $element;
3460
- }
3461
- break;
3462
- }
3463
- case "type_mark_map": {
3464
- $element = $_POST[$key."_long".$id];
3465
- if (isset($element)) {
3466
- $new_value = 'Longitude:'.$_POST[$key."_long".$id].'<br/>Latitude:'.$_POST[$key."_lat".$id];
3467
- }
3468
- break;
3469
- }
3470
- case "type_submitter_mail": {
3471
- $element = $_POST[$key."_element".$id];
3472
- if (isset($element)) {
3473
- $new_value = $element;
3474
- }
3475
- break;
3476
- }
3477
- case "type_time": {
3478
- $hh = $_POST[$key."_hh".$id];
3479
- if (isset($hh)) {
3480
- $ss = $_POST[$key."_ss".$id];
3481
- if (isset($ss)) {
3482
- $new_value = $_POST[$key."_hh".$id].':'.$_POST[$key."_mm".$id].':'.$_POST[$key."_ss".$id];
3483
- }
3484
- else {
3485
- $new_value = $_POST[$key."_hh".$id].':'.$_POST[$key."_mm".$id];
3486
- }
3487
- $am_pm = $_POST[$key."_am_pm".$id];
3488
- if (isset($am_pm)) {
3489
- $new_value = $new_value.' '.$_POST[$key."_am_pm".$id];
3490
- }
3491
- }
3492
- break;
3493
- }
3494
- case "type_phone": {
3495
- $element_first = $_POST[$key."_element_first".$id];
3496
- if (isset($element_first)) {
3497
- $new_value = $_POST[$key."_element_first".$id].' '.$_POST[$key."_element_last".$id];
3498
- }
3499
- break;
3500
- }
3501
- case "type_name": {
3502
- $element_first = $_POST[$key."_element_first".$id];
3503
- if (isset($element_first)) {
3504
- $element_title = $_POST[$key."_element_title".$id];
3505
- if (isset($element_title)) {
3506
- $new_value = $_POST[$key."_element_title".$id].' '.$_POST[$key."_element_first".$id].' '.$_POST[$key."_element_last".$id].' '.$_POST[$key."_element_middle".$id];
3507
- }
3508
- else {
3509
- $new_value = $_POST[$key."_element_first".$id].' '.$_POST[$key."_element_last".$id];
3510
- }
3511
- }
3512
- break;
3513
- }
3514
- case "type_address": {
3515
- if (isset($_POST[$key."_street1".$id])) {
3516
- $new_value = $new_value.$_POST[$key."_street1".$id];
3517
- break;
3518
- }
3519
- if (isset($_POST[$key."_street2".$id])) {
3520
- $new_value = $new_value.$_POST[$key."_street2".$id];
3521
- break;
3522
- }
3523
- if (isset($_POST[$key."_city".$id])) {
3524
- $new_value = $new_value.$_POST[$key."_city".$id];
3525
- break;
3526
- }
3527
- if (isset($_POST[$key."_state".$id])) {
3528
- $new_value = $new_value.$_POST[$key."_state".$id];
3529
- break;
3530
- }
3531
- if (isset($_POST[$key."_postal".$id])) {
3532
- $new_value = $new_value.$_POST[$key."_postal".$id];
3533
- break;
3534
- }
3535
- if (isset($_POST[$key."_country".$id])) {
3536
- $new_value = $new_value.$_POST[$key."_country".$id];
3537
- break;
3538
- }
3539
- }
3540
- case "type_date_fields": {
3541
- $day = $_POST[$key."_day".$id];
3542
- if (isset($day)) {
3543
- $new_value = $_POST[$key."_day".$id].'-'.$_POST[$key."_month".$id].'-'.$_POST[$key."_year".$id];
3544
- }
3545
- break;
3546
- }
3547
- case "type_radio": {
3548
- $element = $_POST[$key."_other_input".$id];
3549
- if (isset($element)) {
3550
- $new_value = $_POST[$key."_other_input".$id];
3551
- break;
3552
- }
3553
- $element = $_POST[$key."_element".$id];
3554
- if (isset($element)) {
3555
- $new_value = $element;
3556
- }
3557
- break;
3558
- }
3559
- case "type_checkbox": {
3560
- $start = -1;
3561
- for ($j = 0; $j < 100; $j++) {
3562
- $element = $_POST[$key."_element".$id.$j];
3563
- if (isset($element)) {
3564
- $start = $j;
3565
- break;
3566
- }
3567
- }
3568
- $other_element_id = -1;
3569
- $is_other = $_POST[$key."_allow_other".$id];
3570
- if ($is_other == "yes") {
3571
- $other_element_id = $_POST[$key."_allow_other_num".$id];
3572
- }
3573
- if ($start != -1) {
3574
- for ($j = $start; $j < 100; $j++) {
3575
- $element = $_POST[$key."_element".$id.$j];
3576
- if (isset($element)) {
3577
- if ($j == $other_element_id) {
3578
- $new_value = $new_value.$_POST[$key."_other_input".$id].'<br>';
3579
- }
3580
- else {
3581
- $new_value = $new_value.$_POST[$key."_element".$id.$j].'<br>';
3582
- }
3583
- }
3584
- }
3585
- }
3586
- break;
3587
- }
3588
- case "type_paypal_price": {
3589
- $new_value = 0;
3590
- if ($_POST[$key."_element_dollars".$id]) {
3591
- $new_value = $_POST[$key."_element_dollars".$id];
3592
- }
3593
- if ($_POST[$key."_element_cents".$id]) {
3594
- $new_value = $new_value.'.'.$_POST[$key."_element_cents".$id];
3595
- }
3596
- $new_value = $new_value.$form_currency;
3597
- break;
3598
- }
3599
- case "type_paypal_select": {
3600
- $new_value = $_POST[$key."_element_label".$id].':'.$_POST[$key."_element".$id].$form_currency;
3601
- $element_quantity_label = $_POST[$key."_element_quantity_label".$id];
3602
- if (isset($element_quantity_label)) {
3603
- $quantity = ((isset($_POST[$key . "_element_quantity" . $id]) && ($_POST[$key . "_element_quantity" . $id] >= 1)) ? $_POST[$key . "_element_quantity" . $id] : 1);
3604
- $new_value .= '<br/>'.$_POST[$key."_element_quantity_label".$id].': '.$quantity;
3605
- }
3606
- for ($k = 0; $k < 50; $k++) {
3607
- $temp_val = $_POST[$key."_element_property_value".$id.$k];
3608
- if (isset($temp_val)) {
3609
- $new_value .= '<br/>'.$_POST[$key."_element_property_label".$id.$k].': '.$_POST[$key."_element_property_value".$id.$k];
3610
- }
3611
- }
3612
- break;
3613
- }
3614
- case "type_paypal_radio": {
3615
- $new_value = $_POST[$key."_element_label".$id].' - '.$_POST[$key."_element".$id].$form_currency;
3616
- $element_quantity_label = $_POST[$key."_element_quantity_label".$id];
3617
- if (isset($element_quantity_label)) {
3618
- $quantity = ((isset($_POST[$key . "_element_quantity" . $id]) && ($_POST[$key . "_element_quantity" . $id] >= 1)) ? $_POST[$key . "_element_quantity" . $id] : 1);
3619
- $new_value .= '<br/>'.$_POST[$key."_element_quantity_label".$id].': '.$quantity;
3620
- }
3621
- for ($k = 0; $k < 50; $k++) {
3622
- $temp_val = $_POST[$key."_element_property_value".$id.$k];
3623
- if (isset($temp_val)) {
3624
- $new_value .= '<br/>'.$_POST[$key."_element_property_label".$id.$k].': '.$_POST[$key."_element_property_value".$id.$k];
3625
- }
3626
- }
3627
- break;
3628
- }
3629
- case "type_paypal_shipping": {
3630
- $new_value = $_POST[$key."_element_label".$id].' : '.$_POST[$key."_element".$id].$form_currency;
3631
- break;
3632
- }
3633
- case "type_paypal_checkbox": {
3634
- $start = -1;
3635
- for ($j = 0; $j < 100; $j++) {
3636
- $element = $_POST[$key."_element".$id.$j];
3637
- if (isset($element)) {
3638
- $start = $j;
3639
- break;
3640
- }
3641
- }
3642
- if ($start != -1) {
3643
- for ($j = $start; $j < 100; $j++) {
3644
- $element = $_POST[$key."_element".$id.$j];
3645
- if (isset($element)) {
3646
- $new_value = $new_value.$_POST[$key."_element".$id.$j."_label"].' - '.(($_POST[$key."_element".$id.$j] == '') ? '0'.$form_currency : $_POST[$key."_element".$id.$j]).$form_currency.'<br>';
3647
- }
3648
- }
3649
- }
3650
- $element_quantity_label = $_POST[$key."_element_quantity_label".$id];
3651
- if (isset($element_quantity_label)) {
3652
- $quantity = ((isset($_POST[$key . "_element_quantity" . $id]) && ($_POST[$key . "_element_quantity" . $id] >= 1)) ? $_POST[$key . "_element_quantity" . $id] : 1);
3653
- $new_value .= '<br/>'.$_POST[$key."_element_quantity_label".$id].': '.$quantity;
3654
- }
3655
- for ($k = 0; $k < 50; $k++) {
3656
- $temp_val = $_POST[$key."_element_property_value".$id.$k];
3657
- if (isset($temp_val)) {
3658
- $new_value .= '<br/>'.$_POST[$key."_element_property_label".$id.$k].': '.$_POST[$key."_element_property_value".$id.$k];
3659
- }
3660
- }
3661
- break;
3662
- }
3663
- case "type_star_rating":
3664
- {
3665
- $element=$_POST[$key."_star_amount".$id];
3666
- $selected=(isset($_POST[$key."_selected_star_amount".$id]) ? $_POST[$key."_selected_star_amount".$id] : 0);
3667
- if(isset($element))
3668
- {
3669
- $new_value=$new_value.$selected.'/'.$element;
3670
- }
3671
- break;
3672
- }
3673
-
3674
 
3675
- case "type_scale_rating":
3676
- {
3677
- $element=$_POST[$key."_scale_amount".$id];
3678
- $selected=(isset($_POST[$key."_scale_radio".$id]) ? $_POST[$key."_scale_radio".$id] : 0);
3679
-
3680
-
3681
- if(isset($element))
3682
- {
3683
- $new_value=$new_value.$selected.'/'.$element;
3684
- }
3685
- break;
3686
- }
3687
-
3688
- case "type_spinner":
3689
- {
3690
 
3691
- if(isset($_POST[$key."_element".$id]))
3692
- {
3693
- $new_value=$new_value.$_POST[$key."_element".$id];
3694
- }
3695
- break;
3696
- }
3697
-
3698
- case "type_slider":
3699
- {
3700
 
3701
- $element=$_POST[$key."_slider_value".$id];
3702
- if(isset($element))
3703
- {
3704
- $new_value=$new_value.$element;
3705
- }
3706
- break;
3707
- }
3708
- case "type_range":
3709
- {
3710
 
3711
- $element0=$_POST[$key."_element".$id.'0'];
3712
- $element1=$_POST[$key."_element".$id.'1'];
3713
- if(isset($element0) || isset($element1))
3714
- {
3715
- $new_value=$new_value.$element0.'-'.$element1;
3716
- }
3717
- break;
3718
- }
3719
-
3720
- case "type_grading":
3721
- {
3722
- $element=$_POST[$key."_hidden_item".$id];
3723
- $grading = explode(":",$element);
3724
- $items_count = sizeof($grading)-1;
3725
-
3726
- $element = "";
3727
- $total = "";
3728
-
3729
- for($k=0;$k<$items_count;$k++)
3730
 
3731
- {
3732
- $element .= $grading[$k].":".$_POST[$key."_element".$id.$k]." ";
3733
- $total += $_POST[$key."_element".$id.$k];
3734
- }
3735
 
3736
- $element .="Total:".$total;
3737
 
3738
-
3739
- if(isset($element))
3740
- {
3741
- $new_value=$new_value.$element;
3742
- }
3743
- break;
3744
- }
3745
-
3746
- case "type_matrix":
3747
- {
3748
-
3749
-
3750
- $input_type=$_POST[$key."_input_type".$id];
3751
-
3752
- $mat_rows = $_POST[$key."_hidden_row".$id];
3753
- $mat_rows = explode('***', $mat_rows);
3754
- $mat_rows = array_slice($mat_rows,0, count($mat_rows)-1);
3755
-
3756
- $mat_columns = $_POST[$key."_hidden_column".$id];
3757
- $mat_columns = explode('***', $mat_columns);
3758
- $mat_columns = array_slice($mat_columns,0, count($mat_columns)-1);
3759
-
3760
- $row_ids=explode(",",substr($_POST[$key."_row_ids".$id], 0, -1));
3761
- $column_ids=explode(",",substr($_POST[$key."_column_ids".$id], 0, -1));
3762
-
3763
-
3764
- $matrix="<table>";
3765
-
3766
- $matrix .='<tr><td></td>';
3767
-
3768
- for( $k=0;$k< count($mat_columns) ;$k++)
3769
- $matrix .='<td style="background-color:#BBBBBB; padding:5px; ">'.$mat_columns[$k].'</td>';
3770
- $matrix .='</tr>';
3771
-
3772
- $aaa=Array();
3773
- $k=0;
3774
- foreach($row_ids as $row_id)
3775
- {
3776
- $matrix .='<tr><td style="background-color:#BBBBBB; padding:5px;">'.$mat_rows[$k].'</td>';
3777
-
3778
- if($input_type=="radio"){
3779
-
3780
- $mat_radio = (isset($_POST[$key."_input_element".$id.$row_id]) ? $_POST[$key."_input_element".$id.$row_id] : 0);
3781
- if($mat_radio==0){
3782
- $checked="";
3783
- $aaa[1]="";
3784
- }
3785
- else{
3786
- $aaa=explode("_",$mat_radio);
3787
- }
3788
-
3789
- foreach($column_ids as $column_id){
3790
- if($aaa[1]==$column_id)
3791
- $checked="checked";
3792
- else
3793
- $checked="";
3794
- $matrix .='<td style="text-align:center"><input type="radio" '.$checked.' disabled /></td>';
3795
-
3796
- }
3797
-
3798
- }
3799
- else{
3800
- if($input_type=="checkbox")
3801
- {
3802
- foreach($column_ids as $column_id){
3803
- $checked = $_POST[$key."_input_element".$id.$row_id.'_'.$column_id];
3804
- if($checked==1)
3805
- $checked = "checked";
3806
- else
3807
- $checked = "";
3808
 
3809
- $matrix .='<td style="text-align:center"><input type="checkbox" '.$checked.' disabled /></td>';
3810
-
3811
- }
3812
-
3813
- }
3814
- else
3815
- {
3816
- if($input_type=="text")
3817
- {
3818
-
3819
- foreach($column_ids as $column_id){
3820
- $checked = $_POST[$key."_input_element".$id.$row_id.'_'.$column_id];
3821
-
3822
- $matrix .='<td style="text-align:center"><input type="text" value="'.$checked.'" disabled /></td>';
3823
-
3824
- }
3825
-
3826
- }
3827
- else{
3828
- foreach($column_ids as $column_id){
3829
- $checked = $_POST[$i."_select_yes_no".$id.$row_id.'_'.$column_id];
3830
- $matrix .='<td style="text-align:center">'.$checked.'</td>';
3831
-
3832
-
3833
-
3834
- }
3835
- }
3836
-
3837
- }
3838
-
3839
- }
3840
- $matrix .='</tr>';
3841
- $k++;
3842
- }
3843
- $matrix .='</table>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3844
 
3845
-
3846
-
3847
-
3848
-
3849
- if(isset($matrix))
3850
- {
3851
- $new_value=$new_value.$matrix;
3852
- }
3853
-
3854
- break;
3855
- }
3856
- default: break;
3857
- }
3858
- $new_script = str_replace("%".$label_each."%", $new_value, $new_script);
3859
- }
3860
- }
3861
- }
3862
- if (strpos($new_script, "%all%") !== FALSE) {
3863
- $new_script = str_replace("%all%", $list, $new_script);
3864
- }
3865
- $body = $new_script;
3866
- $send = wp_mail(str_replace(' ', '', $recipient), $subject, stripslashes($body), $headers, $attachment);
3867
- }
3868
- }
3869
- if ($row->mail) {
3870
- if ($send != TRUE) {
3871
- $_SESSION['error_or_no' . $id] = 1;
3872
- $msg = addslashes(__('Error, email was not sent.', 'form_maker'));
3873
- }
3874
- else {
3875
- $_SESSION['error_or_no' . $id] = 0;
3876
- $msg = addslashes(__('Your form was successfully submitted.', 'form_maker'));
3877
- }
3878
- }
3879
- else {
3880
- $_SESSION['error_or_no' . $id] = 0;
3881
- $msg = addslashes(__('Your form was successfully submitted.', 'form_maker'));
3882
- }
3883
- }
3884
- $https = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://');
3885
- switch ($row->submit_text_type) {
3886
- case "2":
3887
- case "5": {
3888
- if ($row->submit_text_type != 4) {
3889
- $_SESSION['massage_after_submit' . $id] = $msg;
3890
- }
3891
- $_SESSION['form_submit_type' . $id] = $row->submit_text_type . "," . $row->id;
3892
- if ($row->article_id) {
3893
- $redirect_url = $row->article_id;
3894
- }
3895
- else {
3896
- $redirect_url = $https . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
3897
- }
3898
- break;
3899
- }
3900
- case "3": {
3901
- if ($row->submit_text_type != 4) {
3902
- $_SESSION['massage_after_submit' . $id] = $msg;
3903
- }
3904
- $_SESSION['form_submit_type' . $id] = $row->submit_text_type . "," . $row->id;
3905
- $redirect_url = $https . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
3906
- break;
3907
- }
3908
- case "4": {
3909
- if ($row->submit_text_type != 4) {
3910
- $_SESSION['massage_after_submit' . $id] = $msg;
3911
- }
3912
- $_SESSION['form_submit_type' . $id] = $row->submit_text_type . "," . $row->id;
3913
- $redirect_url = $row->url;
3914
- break;
3915
- }
3916
- default: {
3917
- if ($row->submit_text_type != 4) {
3918
- $_SESSION['massage_after_submit' . $id] = $msg;
3919
- }
3920
- $_SESSION['form_submit_type' . $id] = $row->submit_text_type . "," . $row->id;
3921
- $redirect_url = $https . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
3922
- break;
3923
- }
3924
- }
3925
- if (!$str) {
3926
- wp_redirect($redirect_url);
3927
- exit;
3928
- }
3929
- else {
3930
- $_SESSION['redirect_paypal'.$id] = 1;
3931
-
3932
- $str .= "&return=" . urlencode($redirect_url);
3933
- wp_redirect($str);
3934
- exit;
3935
- }
3936
- }
3937
-
3938
  function custom_fields_mail($type, $key, $id, $attachment)
3939
  {
3940
  $new_value ="";
@@ -4333,6 +4379,13 @@ class FMModelForm_maker {
4333
  return $new_value;
4334
  }
4335
 
 
 
 
 
 
 
 
4336
  ////////////////////////////////////////////////////////////////////////////////////////
4337
  // Getters & Setters //
4338
  ////////////////////////////////////////////////////////////////////////////////////////
1410
  }
1411
  }
1412
 
1413
+ public function gen_mail($counter, $all_files, $id, $str) {
1414
+ $ip = $_SERVER['REMOTE_ADDR'];
1415
+ $replyto = '';
1416
+ global $wpdb;
1417
+ $row = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id=%d", $id));
1418
+ if (!$row->form_front) {
1419
+ $id = '';
1420
+ }
1421
+
1422
+ $custom_fields = array('ip', 'useremail', 'username', 'subid', 'all' );
1423
+ $subid = $wpdb->get_var("SELECT MAX( group_id ) FROM " . $wpdb->prefix ."formmaker_submits" );
1424
 
1425
+ $current_user = wp_get_current_user();
1426
+ if ($current_user->ID != 0)
1427
+ {
1428
+ $username = $current_user->display_name;
1429
+ $useremail = $current_user->user_email;
1430
+ }
1431
+ else
1432
+ {
1433
+ $username = '';
1434
+ $useremail = '';
1435
+ }
1436
 
1437
+ $label_order_original = array();
1438
+ $label_order_ids = array();
1439
+ $label_label = array();
1440
+ $label_type = array();
1441
+ $total = 0;
1442
+ $form_currency = '$';
1443
+ $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');
1444
+ $currency_sign = array('$', '&#8364;', '&#163;', '&#165;', 'C$', 'Mex$', 'HK$', 'Ft', 'kr', 'NZ$', 'S$', 'kr', 'zl', 'A$', 'kr', 'CHF', 'Kc', '&#8362;', 'R$', 'NT$', 'RM', '&#8369;', '&#xe3f;');
1445
+ if ($row->payment_currency) {
1446
+ $form_currency = $currency_sign[array_search($row->payment_currency, $currency_code)];
1447
+ }
1448
+
1449
+ $old = false;
1450
  if(isset($row->form)) {
1451
  $old = true;
1452
+ }
1453
+
1454
+ $cc = array();
1455
+ $row_mail_one_time = 1;
1456
+ $label_type = array();
1457
+
 
1458
  if($old == false || ($old == true && $row->form == '')) {
1459
  $label_all = explode('#****#',$row->label_order_current);
1460
+ }
1461
  else {
1462
  $label_all = explode('#****#',$row->label_order);
1463
+ }
1464
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
1465
+ foreach ($label_all as $key => $label_each) {
1466
+ $label_id_each = explode('#**id**#', $label_each);
1467
+ $label_id = $label_id_each[0];
1468
+ array_push($label_order_ids, $label_id);
1469
+ $label_order_each = explode('#**label**#', $label_id_each[1]);
1470
+ $label_order_original[$label_id] = $label_order_each[0];
1471
+ $label_type[$label_id] = $label_order_each[1];
1472
+ array_push($label_label, $label_order_each[0]);
1473
+ array_push($label_type, $label_order_each[1]);
1474
+ }
 
 
 
1475
 
1476
+ $disabled_fields = explode(',', isset($_REQUEST["disabled_fields".$id]) ? $_REQUEST["disabled_fields".$id] : "");
1477
+ $disabled_fields = array_slice($disabled_fields,0, count($disabled_fields)-1);
1478
+
1479
  $list='<table border="1" cellpadding="3" cellspacing="0" style="width:600px;">';
1480
  $list_text_mode = '';
1481
+ if($old == false || ($old == true && $row->form == '')) {
1482
+ foreach($label_order_ids as $key => $label_order_id) {
 
1483
  $i = $label_order_id;
1484
  $type = $label_type[$i];
1485
 
1486
  if($type != "type_map" and $type != "type_submit_reset" and $type != "type_editor" and $type != "type_captcha" and $type != "type_recaptcha" and $type != "type_button") {
1487
  $element_label=$label_order_original[$i];
1488
+ if(!in_array($i,$disabled_fields)) {
1489
+ switch ($type) {
1490
+ case 'type_text':
1491
+ case 'type_password':
1492
+ case 'type_textarea':
1493
+ case "type_date":
1494
+ case "type_own_select":
1495
+ case "type_country":
1496
+ case "type_number": {
1497
+ $element = isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL;
1498
+ if(isset($element) && $this->empty_field($element, $row->mail_emptyfields)) {
1499
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td><pre style="margin:0px; padding:0px">' . $element . '</pre></td></tr>';
1500
+ $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n";
1501
+ }
1502
+
1503
+ break;
1504
+ }
1505
+ case "type_hidden": {
1506
+ $element = isset($_POST[$element_label]) ? $_POST[$element_label] : NULL;
1507
+ if(isset($element) && $this->empty_field($element, $row->mail_emptyfields)) {
1508
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td><pre style="margin:0px; padding:0px">' . $element . '</pre></td></tr>';
1509
+ $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n";
1510
+ }
1511
+ break;
1512
+ }
1513
+ case "type_mark_map": {
1514
+ $element = isset($_POST['wdform_'.$i."_long".$id]) ? $_POST['wdform_'.$i."_long".$id] : NULL;
1515
+ if(isset($element) && $this->empty_field($element, $row->mail_emptyfields)) {
1516
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td>Longitude:' . $element . '<br/>Latitude:' . (isset($_POST['wdform_'.$i."_lat".$id]) ? $_POST['wdform_'.$i."_lat".$id] : "") . '</td></tr>';
1517
+ $list_text_mode=$list_text_mode.$element_label.' - Longitude:'.$element.' Latitude:'.(isset($_POST['wdform_'.$i."_lat".$id]) ? $_POST['wdform_'.$i."_lat".$id] : "")."\r\n";
1518
+ }
1519
+ break;
1520
+ }
1521
+ case "type_submitter_mail": {
1522
+ $element = isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL;
1523
+ if(isset($element) && $this->empty_field($element, $row->mail_emptyfields)) {
1524
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $element . '</pre></td></tr>';
1525
+ $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n";
1526
+ }
1527
+ break;
1528
+ }
1529
+
1530
+ case "type_time": {
1531
+ $hh = isset($_POST['wdform_'.$i."_hh".$id]) ? $_POST['wdform_'.$i."_hh".$id] : NULL;
1532
+ if(isset($hh) && ($this->empty_field($hh, $row->mail_emptyfields) || $this->empty_field($_POST['wdform_'.$i."_mm".$id], $row->mail_emptyfields) || $this->empty_field($_POST['wdform_'.$i."_ss".$id], $row->mail_emptyfields))) {
1533
+ $ss = isset($_POST['wdform_'.$i."_ss".$id]) ? $_POST['wdform_'.$i."_ss".$id] : NULL;
1534
+ if(isset($ss)) {
1535
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $hh . ':' . (isset($_POST['wdform_'.$i."_mm".$id]) ? $_POST['wdform_'.$i."_mm".$id] : "") . ':' . $ss;
1536
+ $list_text_mode=$list_text_mode.$element_label.' - '.$hh.':'.(isset($_POST['wdform_'.$i."_mm".$id]) ? $_POST['wdform_'.$i."_mm".$id] : "").':'.$ss;
1537
+ }
1538
+ else {
1539
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $hh . ':' . (isset($_POST['wdform_'.$i."_mm".$id]) ? $_POST['wdform_'.$i."_mm".$id] : "");
1540
+ $list_text_mode=$list_text_mode.$element_label.' - '.$hh.':'.(isset($_POST['wdform_'.$i."_mm".$id]) ? $_POST['wdform_'.$i."_mm".$id] : "");
1541
+ }
1542
+ $am_pm = isset($_POST['wdform_'.$i."_am_pm".$id]) ? $_POST['wdform_'.$i."_am_pm".$id] : NULL;
1543
+ if(isset($am_pm)) {
1544
+ $list = $list . ' ' . $am_pm . '</td></tr>';
1545
+ $list_text_mode=$list_text_mode.$am_pm."\r\n";
1546
+ }
1547
+ else {
1548
+ $list = $list.'</td></tr>';
1549
+ $list_text_mode=$list_text_mode."\r\n";
1550
+ }
1551
+ }
1552
+ break;
1553
+ }
1554
+
1555
+ case "type_phone": {
1556
+ $element_first = isset($_POST['wdform_'.$i."_element_first".$id]) ? $_POST['wdform_'.$i."_element_first".$id] : NULL;
1557
+ if(isset($element_first) && $this->empty_field($element_first, $row->mail_emptyfields)) {
1558
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $element_first . ' ' . (isset($_POST['wdform_'.$i."_element_last".$id]) ? $_POST['wdform_'.$i."_element_last".$id] : "") . '</td></tr>';
1559
+ $list_text_mode=$list_text_mode.$element_label.' - '.$element_first.' '.(isset($_POST['wdform_'.$i."_element_last".$id]) ? $_POST['wdform_'.$i."_element_last".$id] : "")."\r\n";
1560
+ }
1561
+ break;
1562
+ }
1563
+
1564
+ case "type_name": {
1565
+ $element_first = isset($_POST['wdform_'.$i."_element_first".$id]) ? $_POST['wdform_'.$i."_element_first".$id] : NULL;
1566
+ if(isset($element_first)) {
1567
+ $element_title = isset($_POST['wdform_'.$i."_element_title".$id]) ? $_POST['wdform_'.$i."_element_title".$id] : NULL;
1568
+ if(isset($element_title) && ($this->empty_field($element_title, $row->mail_emptyfields) || $this->empty_field($element_first, $row->mail_emptyfields) || $this->empty_field($_POST['wdform_'.$i."_element_last".$id], $row->mail_emptyfields) || $this->empty_field($_POST['wdform_'.$i."_element_middle".$id], $row->mail_emptyfields))) {
1569
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $element_title . ' ' . $element_first . ' ' . (isset($_POST['wdform_'.$i."_element_last".$id]) ? $_POST['wdform_'.$i."_element_last".$id] : "") . ' ' . (isset($_POST['wdform_'.$i."_element_middle".$id]) ? $_POST['wdform_'.$i."_element_middle".$id] : "") . '</td></tr>';
1570
+ $list_text_mode=$list_text_mode.$element_label.' - '.$element_title.' '.$element_first.' '.(isset($_POST['wdform_'.$i."_element_last".$id]) ? $_POST['wdform_'.$i."_element_last".$id] : "").' '.(isset($_POST['wdform_'.$i."_element_middle".$id]) ? $_POST['wdform_'.$i."_element_middle".$id] : "")."\r\n";
1571
+ }
1572
+ else {
1573
+ if($this->empty_field($element_first, $row->mail_emptyfields) || $this->empty_field($_POST['wdform_'.$i."_element_last".$id], $row->mail_emptyfields)) {
1574
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $element_first . ' ' . (isset($_POST['wdform_'.$i."_element_last".$id]) ? $_POST['wdform_'.$i."_element_last".$id] : "") . '</td></tr>';
1575
+ $list_text_mode=$list_text_mode.$element_label.' - '.$element_first.' '.(isset($_POST['wdform_'.$i."_element_last".$id]) ? $_POST['wdform_'.$i."_element_last".$id] : "")."\r\n";
1576
+ }
1577
+ }
1578
+ }
1579
+ break;
1580
+ }
1581
+
1582
+ case "type_address": {
1583
+ $element = isset($_POST['wdform_'.$i."_street1".$id]) ? $_POST['wdform_'.$i."_street1".$id] : NULL;
1584
+ if(isset($element) && $this->empty_field($element, $row->mail_emptyfields)) {
1585
+ $list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $element . '</td></tr>';
1586
+ $list_text_mode=$list_text_mode.$label_order_original[$i].' - '.$element."\r\n";
1587
+ break;
1588
+ }
1589
+ $element = isset($_POST['wdform_'.$i."_street2".$id]) ? $_POST['wdform_'.$i."_street2".$id] : NULL;
1590
+ if(isset($element) && $this->empty_field($element, $row->mail_emptyfields)) {
1591
+ $list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $element . '</td></tr>';
1592
+ $list_text_mode=$list_text_mode.$label_order_original[$i].' - '.$element."\r\n";
1593
+ break;
1594
+ }
1595
+ $element = isset($_POST['wdform_'.$i."_city".$id]) ? $_POST['wdform_'.$i."_city".$id] : NULL;
1596
+ if(isset($element) && $this->empty_field($element, $row->mail_emptyfields)) {
1597
+ $list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $element . '</td></tr>';
1598
+ $list_text_mode=$list_text_mode.$label_order_original[$i].' - '.$element."\r\n";
1599
+ break;
1600
+ }
1601
+ $element = isset($_POST['wdform_'.$i."_state".$id]) ? $_POST['wdform_'.$i."_state".$id] : NULL;
1602
+ if(isset($element) && $this->empty_field($element, $row->mail_emptyfields)) {
1603
+ $list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $element . '</td></tr>';
1604
+ $list_text_mode=$list_text_mode.$label_order_original[$i].' - '.$element."\r\n";
1605
+ break;
1606
+ }
1607
+ $element = isset($_POST['wdform_'.$i."_postal".$id]) ? $_POST['wdform_'.$i."_postal".$id] : NULL;
1608
+ if(isset($element) && $this->empty_field($element, $row->mail_emptyfields)) {
1609
+ $list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $element . '</td></tr>';
1610
+ $list_text_mode=$list_text_mode.$label_order_original[$i].' - '.$element."\r\n";
1611
+ break;
1612
+ }
1613
+ $element = isset($_POST['wdform_'.$i."_country".$id]) ? $_POST['wdform_'.$i."_country".$id] : NULL;
1614
+ if(isset($element) && $this->empty_field($element, $row->mail_emptyfields)) {
1615
+ $list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $element . '</td></tr>';
1616
+ $list_text_mode=$list_text_mode.$label_order_original[$i].' - '.$element."\r\n";
1617
+ break;
1618
+ }
1619
+ break;
1620
+ }
1621
+
1622
+ case "type_date_fields": {
1623
+ $day = isset($_POST['wdform_'.$i."_day".$id]) ? $_POST['wdform_'.$i."_day".$id] : NULL;
1624
+ $month = isset($_POST['wdform_'.$i."_month".$id]) ? $_POST['wdform_'.$i."_month".$id] : "";
1625
+ $year = isset($_POST['wdform_'.$i."_year".$id]) ? $_POST['wdform_'.$i."_year".$id] : "";
1626
+ if(isset($day) && $this->empty_field($day, $row->mail_emptyfields)) {
1627
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' .(($day || $month || $year) ? $day . '-' . $month . '-' . $year : '' ). '</td></tr>';
1628
+ $list_text_mode=$list_text_mode.$element_label.(($day || $month || $year) ? $day.'-'.$month.'-'.$year : '')."\r\n";
1629
+ }
1630
+ break;
1631
+ }
1632
+
1633
+ case "type_radio": {
1634
+ $element = isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : NULL;
1635
+ if(isset($element) && $this->empty_field($element, $row->mail_emptyfields)) {
1636
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $element . '</td></tr>';
1637
+ $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n";
1638
+ break;
1639
+ }
1640
+ $element = isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL;
1641
+ if(isset($element) && $this->empty_field($element, $row->mail_emptyfields)) {
1642
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $element . '</pre></td></tr>';
1643
+ $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n";
1644
+ }
1645
+ break;
1646
+ }
1647
+
1648
+ case "type_checkbox": {
1649
+ $start = -1;
1650
+ for($j = 0; $j < 100; $j++) {
1651
+ $element = isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL;
1652
+ if(isset($element)) {
1653
+ $start = $j;
1654
+ break;
1655
+ }
1656
+ }
1657
+ $other_element_id = -1;
1658
+ $is_other = isset($_POST['wdform_'.$i."_allow_other".$id]) ? $_POST['wdform_'.$i."_allow_other".$id] : "";
1659
+ if($is_other == "yes") {
1660
+ $other_element_id = isset($_POST['wdform_'.$i."_allow_other_num".$id]) ? $_POST['wdform_'.$i."_allow_other_num".$id] : "";
1661
+ }
1662
+
1663
+ if($start != -1 || ($start == -1 && $row->mail_emptyfields))
1664
+ {
1665
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >';
1666
+ $list_text_mode=$list_text_mode.$element_label.' - ';
1667
+ }
1668
+
1669
+ if($start != -1) {
1670
+ for($j = $start; $j < 100; $j++) {
1671
+ $element = isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL;
1672
+ if(isset($element)) {
1673
+ if($j == $other_element_id) {
1674
+ $list = $list . (isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : "") . '<br>';
1675
+ $list_text_mode=$list_text_mode.(isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : "").', ';
1676
+ }
1677
+ else {
1678
+ $list = $list . (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : "") . '<br>';
1679
+ $list_text_mode=$list_text_mode.(isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : "").', ';
1680
+ }
1681
+ }
1682
+ }
1683
+ }
1684
+
1685
+ if($start != -1 || ($start == -1 && $row->mail_emptyfields))
1686
+ {
1687
+ $list = $list . '</td></tr>';
1688
+ $list_text_mode=$list_text_mode."\r\n";
1689
+ }
1690
+ break;
1691
+ }
1692
+
1693
+ case "type_paypal_price": {
1694
+ $value = 0;
1695
+ if(isset($_POST['wdform_'.$i."_element_dollars".$id])) {
1696
+ $value = $_POST['wdform_'.$i."_element_dollars".$id];
1697
+ }
1698
+ if(isset($_POST['wdform_'.$i."_element_cents".$id]) && $_POST['wdform_'.$i."_element_cents".$id]) {
1699
+ $value = $value . '.' . $_POST['wdform_'.$i."_element_cents".$id];
1700
+ }
1701
+
1702
+ if($this->empty_field($value, $row->mail_emptyfields) && $value!='.')
1703
+ {
1704
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $value . $form_currency . '</td></tr>';
1705
+ $list_text_mode=$list_text_mode.$element_label.' - '.$value.$form_currency."\r\n";
1706
+ }
1707
+ break;
1708
+ }
1709
+
1710
+ case "type_paypal_select": {
1711
+ if(isset($_POST['wdform_'.$i."_element_label".$id]) && $_POST['wdform_'.$i."_element".$id] != '') {
1712
+ $value = $_POST['wdform_'.$i."_element_label".$id] . ' : ' . (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : "") . $form_currency;
1713
+ }
1714
+ else {
1715
+ $value='';
1716
+ }
1717
+ $element_quantity_label = (isset($_POST['wdform_'.$i."_element_quantity_label".$id]) && $_POST['wdform_'.$i."_element_quantity_label".$id]) ? $_POST['wdform_'.$i."_element_quantity_label".$id] : NULL;
1718
+ $element_quantity = (isset($_POST['wdform_'.$i."_element_quantity".$id]) && $_POST['wdform_'.$i."_element_quantity".$id]) ? $_POST['wdform_'.$i."_element_quantity".$id] : NULL;
1719
+ if($value != '' && isset($element_quantity)) {
1720
+ $value .= '<br/>' . $element_quantity_label . ': ' . $element_quantity;
1721
+ }
1722
+ for($k = 0; $k < 50; $k++) {
1723
+ $temp_val = isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL;
1724
+ if(isset($temp_val)) {
1725
+ $value .= '<br/>' . (isset($_POST['wdform_'.$i."_element_property_label".$id.$k]) ? $_POST['wdform_'.$i."_element_property_label".$id.$k] : "") . ': ' . $temp_val;
1726
+ }
1727
+ }
 
 
 
 
 
 
 
 
 
 
 
 
1728
 
1729
+ if($this->empty_field($value, $row->mail_emptyfields))
1730
+ {
1731
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $value . '</pre></td></tr>';
1732
+ $list_text_mode=$list_text_mode.$element_label.' - '.str_replace('<br/>',', ',$value)."\r\n";
1733
+ }
1734
+ break;
1735
+ }
1736
+
1737
+ case "type_paypal_radio": {
1738
+ if(isset($_POST['wdform_'.$i."_element".$id])) {
1739
+ $value = $_POST['wdform_'.$i."_element_label".$id] . ' : ' . (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : "") . $form_currency;
1740
+
1741
+ $element_quantity_label = isset($_POST['wdform_'.$i."_element_quantity_label".$id]) ? $_POST['wdform_'.$i."_element_quantity_label".$id] : NULL;
1742
+ $element_quantity = (isset($_POST['wdform_'.$i."_element_quantity".$id]) && $_POST['wdform_'.$i."_element_quantity".$id]) ? $_POST['wdform_'.$i."_element_quantity".$id] : NULL;
1743
+ if (isset($element_quantity)) {
1744
+ $value .= '<br/>' . $element_quantity_label . ': ' . $element_quantity;
1745
+ }
1746
+ for($k = 0; $k < 50; $k++) {
1747
+ $temp_val = isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL;
1748
+ if(isset($temp_val)) {
1749
+ $value .= '<br/>' . (isset($_POST['wdform_'.$i."_element_property_label".$id.$k]) ? $_POST['wdform_'.$i."_element_property_label".$id.$k] : "") . ': ' . $temp_val;
1750
+ }
1751
+ }
1752
+ }
1753
+ else {
1754
+ $value='';
1755
+ }
1756
 
1757
+ if($this->empty_field($value, $row->mail_emptyfields))
1758
+ {
1759
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $value . '</pre></td></tr>';
1760
+ $list_text_mode=$list_text_mode.$element_label.' - '.str_replace('<br/>',', ',$value)."\r\n";
1761
+ }
1762
+ break;
1763
+ }
1764
+
1765
+ case "type_paypal_shipping": {
1766
+ if(isset($_POST['wdform_'.$i."_element".$id])) {
1767
+ $value = $_POST['wdform_'.$i."_element_label".$id] . ' : ' . (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : "") . $form_currency;
1768
+
1769
+ if($this->empty_field($value, $row->mail_emptyfields))
1770
+ {
1771
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $value . '</pre></td></tr>';
1772
+ $list_text_mode=$list_text_mode.$element_label.' - '.$value."\r\n";
1773
+ }
1774
+ }
1775
+ else {
1776
+ $value='';
1777
+ }
1778
+
1779
+ break;
1780
+ }
1781
+
1782
+ case "type_paypal_checkbox": {
1783
+
1784
+ $start = -1;
1785
+ for($j = 0; $j < 100; $j++) {
1786
+ $element = isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL;
1787
+ if(isset($element)) {
1788
+ $start=$j;
1789
+ break;
1790
+ }
1791
+ }
1792
+
1793
+ if($start != -1 || ($start == -1 && $row->mail_emptyfields))
1794
+ {
1795
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >';
1796
+ $list_text_mode=$list_text_mode.$element_label.' - ';
1797
+ }
1798
+ if($start!=-1) {
1799
+ for($j = $start; $j < 100; $j++) {
1800
+ $element = isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL;
1801
+ if(isset($element)) {
1802
+ $list = $list . (isset($_POST['wdform_'.$i."_element".$id.$j."_label"]) ? $_POST['wdform_'.$i."_element".$id.$j."_label"] : "") . ' - ' . ($element == '' ? '0' . $form_currency : $element) . $form_currency . '<br>';
1803
+ $list_text_mode=$list_text_mode.(isset($_POST['wdform_'.$i."_element".$id.$j."_label"]) ? $_POST['wdform_'.$i."_element".$id.$j."_label"] : "").' - '.($element == '' ? '0' . $form_currency : $element).$form_currency.', ';
1804
+ }
1805
+ }
1806
+ }
1807
+ $element_quantity_label = isset($_POST['wdform_'.$i."_element_quantity_label".$id]) ? $_POST['wdform_'.$i."_element_quantity_label".$id] : NULL;
1808
+ $element_quantity = (isset($_POST['wdform_'.$i."_element_quantity".$id]) && $_POST['wdform_'.$i."_element_quantity".$id]) ? $_POST['wdform_'.$i."_element_quantity".$id] : NULL;
1809
+ if (isset($element_quantity)) {
1810
+ $list = $list . '<br/>' . $element_quantity_label . ': ' . $element_quantity;
1811
+ $list_text_mode=$list_text_mode.$element_quantity_label . ': ' . $element_quantity.', ';
1812
+ }
1813
+ for($k = 0; $k < 50; $k++) {
1814
+ $temp_val = isset($_POST['wdform_'.$i."_element_property_value".$id.$k]) ? $_POST['wdform_'.$i."_element_property_value".$id.$k] : NULL;
1815
+ if(isset($temp_val)) {
1816
+ $list = $list . '<br/>' . (isset($_POST['wdform_'.$i."_element_property_label".$id.$k]) ? $_POST['wdform_'.$i."_element_property_label".$id.$k] : "") . ': ' . $temp_val;
1817
+ $list_text_mode=$list_text_mode.(isset($_POST['wdform_'.$i."_element_property_label".$id.$k]) ? $_POST['wdform_'.$i."_element_property_label".$id.$k] : "") . ': ' . $temp_val.', ';
1818
+ }
1819
+ }
1820
+ if($start != -1 || ($start == -1 && $row->mail_emptyfields))
1821
+ {
1822
+ $list = $list . '</td></tr>';
1823
+ $list_text_mode=$list_text_mode."\r\n";
1824
+ }
1825
+ break;
1826
+ }
1827
+
1828
+ case "type_paypal_total": {
1829
+ $element = isset($_POST['wdform_'.$i."_paypal_total".$id]) ? $_POST['wdform_'.$i."_paypal_total".$id] : "";
1830
+ if($this->empty_field($element, $row->mail_emptyfields))
1831
+ {
1832
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $element . '</pre></td></tr>';
1833
+ $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n";
1834
+ }
1835
+ break;
1836
+ }
1837
+
1838
+ case "type_star_rating": {
1839
+ $element = isset($_POST['wdform_'.$i."_star_amount".$id]) ? $_POST['wdform_'.$i."_star_amount".$id] : NULL;
1840
+ $selected = isset($_POST['wdform_'.$i."_selected_star_amount".$id]) ? $_POST['wdform_'.$i."_selected_star_amount".$id] : 0;
1841
+ if(isset($element) && $this->empty_field($selected, $row->mail_emptyfields)) {
1842
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $selected . '/' . $element . '</pre></td></tr>';
1843
+ $list_text_mode=$list_text_mode.$element_label.' - '.$selected.'/'.$element."\r\n";
1844
+ }
1845
+ break;
1846
+ }
1847
+
1848
+ case "type_scale_rating": {
1849
+ $element = isset($_POST['wdform_'.$i."_scale_amount".$id]) ? $_POST['wdform_'.$i."_scale_amount".$id] : NULL;
1850
+ $selected = isset($_POST['wdform_'.$i."_scale_radio".$id]) ? $_POST['wdform_'.$i."_scale_radio".$id] : 0;
1851
+ if(isset($element) && $this->empty_field($selected, $row->mail_emptyfields)) {
1852
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $selected . '/' . $element . '</pre></td></tr>';
1853
+ $list_text_mode=$list_text_mode.$element_label.' - '.$selected.'/'.$element."\r\n";
1854
+ }
1855
+ break;
1856
+ }
1857
+
1858
+ case "type_spinner": {
1859
+ $element = isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL;
1860
+ if(isset($element) && $this->empty_field($element, $row->mail_emptyfields)) {
1861
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $element . '</pre></td></tr>';
1862
+ $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n";
1863
+ }
1864
+ break;
1865
+ }
1866
+
1867
+ case "type_slider": {
1868
+ $element = isset($_POST['wdform_'.$i."_slider_value".$id]) ? $_POST['wdform_'.$i."_slider_value".$id] : NULL;
1869
+ if(isset($element) && $this->empty_field($element, $row->mail_emptyfields)) {
1870
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $element . '</pre></td></tr>';
1871
+ $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n";
1872
+ }
1873
+ break;
1874
+ }
1875
+
1876
+ case "type_range": {
1877
+ $element0 = isset($_POST['wdform_'.$i."_element".$id.'0']) ? $_POST['wdform_'.$i."_element".$id.'0'] : NULL;
1878
+ $element1 = isset($_POST['wdform_'.$i."_element".$id.'1']) ? $_POST['wdform_'.$i."_element".$id.'1'] : NULL;
1879
+ if((isset($element0) && $this->empty_field($element0, $row->mail_emptyfields)) || (isset($element1) && $this->empty_field($element1, $row->mail_emptyfields))) {
1880
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">From:' . $element0 . '<span style="margin-left:6px">To</span>:' . $element1 . '</pre></td></tr>';
1881
+ $list_text_mode=$list_text_mode.$element_label.' - From:'.$element0.' To:'.$element1."\r\n";
1882
+ }
1883
+ break;
1884
+ }
1885
+
1886
+ case "type_grading": {
1887
+ $element = isset($_POST['wdform_'.$i."_hidden_item".$id]) ? $_POST['wdform_'.$i."_hidden_item".$id] : "";
1888
+ $grading = explode(":", $element);
1889
+ $items_count = sizeof($grading) - 1;
1890
+ $element = "";
1891
+ $total = "";
1892
+ $form_empty_field = 1;
1893
+ for($k = 0;$k < $items_count; $k++) {
1894
+ $element .= $grading[$k] . ":" . (isset($_POST['wdform_'.$i."_element".$id.'_'.$k]) ? $_POST['wdform_'.$i."_element".$id.'_'.$k] : "") . " ";
1895
+ $total += (isset($_POST['wdform_'.$i."_element".$id.'_'.$k]) ? $_POST['wdform_'.$i."_element".$id.'_'.$k] : 0);
1896
+ if(isset($_POST['wdform_'.$i."_element".$id.'_'.$k]))
1897
+ $form_empty_field = 0;
1898
+ }
1899
+ $element .= "Total:" . $total;
1900
+ if(isset($element) && $this->empty_field($form_empty_field, $row->mail_emptyfields)) {
1901
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $element . '</pre></td></tr>';
1902
+ $list_text_mode=$list_text_mode.$element_label.' - '.$element."\r\n";
1903
+ }
1904
+ break;
1905
+ }
1906
+
1907
+ case "type_matrix": {
1908
+ $input_type = isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : "";
1909
+ $mat_rows = explode("***", isset($_POST['wdform_'.$i."_hidden_row".$id]) ? $_POST['wdform_'.$i."_hidden_row".$id] : "");
1910
+ $rows_count = sizeof($mat_rows) - 1;
1911
+ $mat_columns = explode("***", isset($_POST['wdform_'.$i."_hidden_column".$id]) ? $_POST['wdform_'.$i."_hidden_column".$id] : "");
1912
+ $columns_count = sizeof($mat_columns) - 1;
1913
+ $matrix = "<table>";
1914
+ $matrix .= '<tr><td></td>';
1915
+ for($k = 1; $k < count($mat_columns); $k++) {
1916
+ $matrix .= '<td style="background-color:#BBBBBB; padding:5px; ">' . $mat_columns[$k] . '</td>';
1917
+ }
1918
+ $matrix .= '</tr>';
1919
+ $aaa = Array();
1920
+ for($k = 1; $k <= $rows_count; $k++) {
1921
+ $matrix .= '<tr><td style="background-color:#BBBBBB; padding:5px;">' . $mat_rows[$k] . '</td>';
1922
+ if($input_type == "radio") {
1923
+ $mat_radio = isset($_POST['wdform_'.$i."_input_element".$id.$k]) ? $_POST['wdform_'.$i."_input_element".$id.$k] : 0;
1924
+ if($mat_radio == 0) {
1925
+ $checked = "";
1926
+ $aaa[1] = "";
1927
+ }
1928
+ else {
1929
+ $aaa = explode("_", $mat_radio);
1930
+ }
1931
+ for($j = 1; $j <= $columns_count; $j++) {
1932
+ if($aaa[1] == $j) {
1933
+ $checked = "checked";
1934
+ }
1935
+ else {
1936
+ $checked = "";
1937
+ }
1938
+ $matrix .= '<td style="text-align:center"><input type="radio" ' . $checked . ' disabled /></td>';
1939
+ }
1940
+ }
1941
+ else {
1942
+ if($input_type == "checkbox") {
1943
+ for($j = 1; $j <= $columns_count; $j++) {
1944
+ $checked = isset($_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j]) ? $_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j] : "";
1945
+ if($checked == 1) {
1946
+ $checked = "checked";
1947
+ }
1948
+ else {
1949
+ $checked = "";
1950
+ }
1951
+ $matrix .= '<td style="text-align:center"><input type="checkbox" ' . $checked . ' disabled /></td>';
1952
+ }
1953
+ }
1954
+ else {
1955
+ if($input_type == "text") {
1956
+ for($j = 1; $j <= $columns_count; $j++) {
1957
+ $checked = isset($_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j]) ? $_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j] : "";
1958
+ $matrix .= '<td style="text-align:center"><input type="text" value="' . $checked . '" disabled /></td>';
1959
+ }
1960
+ }
1961
+ else {
1962
+ for($j = 1; $j <= $columns_count; $j++) {
1963
+ $checked = isset($_POST['wdform_'.$i."_select_yes_no".$id.$k.'_'.$j]) ? $_POST['wdform_'.$i."_select_yes_no".$id.$k.'_'.$j] : "";
1964
+ $matrix .= '<td style="text-align:center">' . $checked . '</td>';
1965
+ }
1966
+ }
1967
+ }
1968
+ }
1969
+ $matrix .= '</tr>';
1970
+ }
1971
+ $matrix .= '</table>';
1972
+ if(isset($matrix)) {
1973
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $matrix . '</pre></td></tr>';
1974
+ }
1975
+ break;
1976
+ }
1977
+ default: break;
1978
+ }
1979
+ }
1980
  }
1981
  }
1982
+
1983
+ $list = $list . '</table>';
 
1984
  if($row->sendemail)
1985
+ if($row->send_to) {
1986
+ $fromname = $row->mail_from_name_user;
1987
+ if($row->mail_subject_user)
1988
+ $subject = $row->mail_subject_user;
1989
+ else
1990
+ $subject = $row->title;
1991
+ if($row->reply_to_user) {
1992
+ $replyto = $row->reply_to_user;
1993
+ }
1994
+ $attachment_user = array();
1995
+ if ($row->mail_attachment_user) {
1996
+ for ($k = 0; $k < count($all_files); $k++) {
1997
+ if (isset($all_files[$k]['tmp_name'])) {
1998
+ $attachment_user[$k] = $all_files[$k]['tmp_name'];
1999
+ }
2000
+ }
2001
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2002
 
2003
+ if ($row->mail_mode_user) {
2004
+ $content_type = "text/html";
2005
+ $mode = 1;
2006
+ $list_user = wordwrap($list, 70, "\n", true);
2007
+ $new_script = wpautop($row->script_mail_user);
2008
+ }
2009
+ else {
2010
+ $content_type = "text/plain";
2011
+ $mode = 0;
2012
+ $list_user = wordwrap($list_text_mode, 1000, "\n", true);
2013
+ $new_script = str_replace(array('<p>','</p>'),'',$row->script_mail_user);
2014
+ }
2015
+
2016
+ foreach($label_order_original as $key => $label_each) {
2017
+ $type=$label_type[$key];
2018
+ if(strpos($row->script_mail_user, "%".$label_each."%")>-1) {
2019
+ $new_value = $this->custom_fields_mail($type, $key, $id, $attachment_user);
2020
+ $new_script = str_replace("%".$label_each."%", $new_value, $new_script);
2021
+ }
2022
+
2023
+ if(strpos($fromname, "%".$label_each."%")>-1) {
2024
+ $new_value = str_replace('<br>',', ',$this->custom_fields_mail($type, $key, $id, ''));
2025
+ if(substr($new_value, -2)==', ') {
2026
+ $new_value = substr($new_value, 0, -2);
2027
+ }
2028
+ $fromname = str_replace("%".$label_each."%", $new_value, $fromname);
2029
+ }
2030
+
2031
+ if(strpos($subject, "%".$label_each."%")>-1) {
2032
+ $new_value = str_replace('<br>',', ',$this->custom_fields_mail($type, $key, $id, ''));
2033
+ if(substr($new_value, -2)==', ') {
2034
+ $new_value = substr($new_value, 0, -2);
2035
+ }
2036
+ $subject = str_replace("%".$label_each."%", $new_value, $subject);
2037
+ }
2038
+ }
2039
+
2040
+ $recipient = '';
2041
+ $cca = $row->mail_cc_user;
2042
+ $bcc = $row->mail_bcc_user;
2043
+ $send_tos=explode('**',$row->send_to);
2044
+ if ($row->mail_from_user != '') {
2045
+ if ($fromname != '') {
2046
+ $from = "From: '" . $fromname . "' <" . $row->mail_from_user . ">" . "\r\n";
2047
+ }
2048
+ else {
2049
+ $from = "From: '' <" . $row->mail_from_user . ">" . "\r\n";
2050
+ }
2051
+ }
2052
+ else {
2053
+ $from = '';
2054
+ }
2055
+
2056
+ $headers = "MIME-Version: 1.0\n" . $from . " Content-Type: " . $content_type . "; charset=\"" . get_option('blog_charset') . "\"\n";
2057
+ if ($replyto) {
2058
+ $headers .= "Reply-To: <" . $replyto . ">\r\n";
2059
+ }
2060
+ if ($cca) {
2061
+ $headers .= "Cc: <" . $cca . ">\r\n";
2062
+ }
2063
+ if ($bcc) {
2064
+ $headers .= "Bcc: <" . $bcc . ">\r\n";
2065
+ }
2066
+
2067
+ $custom_fields_value = array( $ip, $useremail, $username, $subid, $list );
2068
+ foreach($custom_fields as $key=>$custom_field)
2069
+ {
2070
+ if(strpos($new_script, "%".$custom_field."%")>-1)
2071
+ $new_script = str_replace("%".$custom_field."%", $custom_fields_value[$key], $new_script);
2072
+
2073
+ if($key==2 || $key==3)
2074
+ {
2075
+ if(strpos($fromname, "%".$custom_field."%")>-1)
2076
+ $fromname = str_replace("%".$custom_field."%", $custom_fields_value[$key], $fromname);
2077
+
2078
+ if(strpos($subject, "%".$custom_field."%")>-1)
2079
+ $subject = str_replace("%".$custom_field."%", $custom_fields_value[$key], $subject);
2080
+ }
2081
+ }
2082
+ $body = $new_script;
2083
+ $send_copy = isset($_POST["wdform_send_copy_".$id]) ? $_POST["wdform_send_copy_".$id] : NULL;
2084
+
2085
+ if(isset($send_copy)) {
2086
+ $send=true;
2087
+ }
2088
+ else {
2089
+ foreach($send_tos as $send_to) {
2090
+ $recipient = isset($_POST['wdform_'.str_replace('*', '', $send_to)."_element".$id]) ? $_POST['wdform_'.str_replace('*', '', $send_to)."_element".$id] : NULL;
2091
+ if($recipient) {
2092
+ $send = wp_mail(str_replace(' ', '', $recipient), $subject, stripslashes($body), $headers, $attachment_user);
2093
+ }
2094
+ }
2095
  }
2096
  }
2097
+
 
2098
  if($row->sendemail)
2099
+ if ($row->mail) {
2100
+ if($row->reply_to) {
2101
+ $replyto = isset($_POST['wdform_'.$row->reply_to."_element".$id]) ? $_POST['wdform_'.$row->reply_to."_element".$id] : NULL;
2102
+ if(!isset($replyto)) {
2103
+ $replyto = $row->reply_to;
2104
+ }
2105
+ }
2106
+ $recipient = $row->mail;
2107
+ if($row->mail_subject) {
2108
+ $subject = $row->mail_subject;
2109
+ }
2110
+ else {
2111
+ $subject = $row->title;
2112
+ }
2113
+
2114
+ if ($row->from_name) {
2115
+ $fromname = $row->from_name;
2116
+ }
2117
+ else {
2118
+ $fromname = '';
2119
+ }
2120
+ $attachment = array();
2121
+ if ($row->mail_attachment) {
2122
+ for ($k = 0; $k < count($all_files); $k++) {
2123
+ if (isset($all_files[$k]['tmp_name'])) {
2124
+ $attachment[$k] = $all_files[$k]['tmp_name'];
2125
+ }
2126
+ }
2127
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2128
 
2129
+ if ($row->mail_mode) {
2130
+ $content_type = "text/html";
2131
+ $mode = 1;
2132
+ $list = wordwrap($list, 70, "\n", true);
2133
+ $new_script = wpautop($row->script_mail);
2134
+ }
2135
+ else {
2136
+ $content_type = "text/plain";
2137
+ $mode = 0;
2138
+ $list = $list_text_mode;
2139
+ $list = wordwrap($list, 1000, "\n", true);
2140
+ $new_script = str_replace(array('<p>','</p>'),'',$row->script_mail);
2141
+ }
2142
+
2143
+ foreach($label_order_original as $key => $label_each) {
2144
+ $type=$label_type[$key];
2145
+ if(strpos($row->script_mail, "%".$label_each."%")>-1) {
2146
+ $new_value = $this->custom_fields_mail($type, $key, $id, $attachment);
2147
+ $new_script = str_replace("%".$label_each."%", $new_value, $new_script);
2148
+ }
2149
+
2150
+ if(strpos($fromname, "%".$label_each."%")>-1) {
2151
+ $new_value = str_replace('<br>',', ',$this->custom_fields_mail($type, $key, $id, ''));
2152
+ if(substr($new_value, -2)==', ') {
2153
+ $new_value = substr($new_value, 0, -2);
2154
+ }
2155
+ $fromname = str_replace("%".$label_each."%", $new_value, $fromname);
2156
+ }
2157
+
2158
+ if(strpos($fromname, "%username%")>-1){
2159
+ $fromname = str_replace("%username%", $username, $fromname);
2160
+ }
2161
+
2162
+ if(strpos($subject, "%".$label_each."%")>-1) {
2163
+ $new_value = str_replace('<br>',', ',$this->custom_fields_mail($type, $key, $id, ''));
2164
+ if(substr($new_value, -2)==', ') {
2165
+ $new_value = substr($new_value, 0, -2);
2166
+ }
2167
+ $subject = str_replace("%".$label_each."%", $new_value, $subject);
2168
+ }
2169
+ }
2170
+
2171
+ if ($row->from_mail) {
2172
+ $from = isset($_POST['wdform_'.$row->from_mail."_element".$id]) ? $_POST['wdform_'.$row->from_mail."_element".$id] : NULL;
2173
+ if (!isset($from)) {
2174
+ $from = $row->from_mail;
2175
+ }
2176
+ $from = "From: '" . $fromname . "' <" . $from . ">" . "\r\n";
2177
+ }
2178
+ else {
2179
+ $from = "";
2180
+ }
2181
+
2182
+ $headers = "MIME-Version: 1.0\n" . $from . " Content-Type: " . $content_type . "; charset=\"" . get_option('blog_charset') . "\"\n";
2183
+ if ($replyto) {
2184
+ $headers .= "Reply-To: <" . $replyto . ">\r\n";
2185
+ }
2186
+ $cca = $row->mail_cc;
2187
+ $bcc = $row->mail_bcc;
2188
+ if ($cca) {
2189
+ $headers .= "Cc: <" . $cca . ">\r\n";
2190
+ }
2191
+ if ($bcc) {
2192
+ $headers .= "Bcc: <" . $bcc . ">\r\n";
2193
+ }
2194
 
2195
+ $custom_fields_value = array( $ip, $useremail, $username, $subid, $list );
2196
+ foreach($custom_fields as $key=>$custom_field)
2197
+ {
2198
+ if(strpos($new_script, "%".$custom_field."%")>-1)
2199
+ $new_script = str_replace("%".$custom_field."%", $custom_fields_value[$key], $new_script);
2200
+
2201
+ if($key==2 || $key==3)
2202
+ {
2203
+ if(strpos($fromname, "%".$custom_field."%")>-1)
2204
+ $fromname = str_replace("%".$custom_field."%", $custom_fields_value[$key], $fromname);
2205
+
2206
+ if(strpos($subject, "%".$custom_field."%")>-1)
2207
+ $subject = str_replace("%".$custom_field."%", $custom_fields_value[$key], $subject);
2208
+ }
2209
+ }
2210
+ $body = $new_script;
2211
+
2212
+ if($row->sendemail) {
2213
+ $send = wp_mail(str_replace(' ', '', $recipient), $subject, stripslashes($body), $headers, $attachment);
2214
+ }
2215
  }
2216
+
2217
  $_SESSION['error_or_no' . $id] = 0;
2218
+ $msg = addslashes(__('Your form was successfully submitted.', 'form_maker'));
2219
  $succes = 1;
2220
 
2221
  if($row->sendemail)
2222
+ if($row->mail || $row->send_to) {
2223
+ if ($send) {
2224
+ if ($send !== true ) {
2225
+ $_SESSION['error_or_no' . $id] = 1;
2226
+ $msg = addslashes(__('Error, email was not sent.', 'form_maker'));
2227
+ $succes = 0;
2228
+ }
2229
+ else {
2230
+ $_SESSION['error_or_no' . $id] = 0;
2231
+ $msg = addslashes(__('Your form was successfully submitted.', 'form_maker'));
2232
+ }
2233
  }
 
 
 
 
2234
  }
2235
+ }
2236
+ else { /* Old form.*/
2237
+ foreach ($label_order_ids as $key => $label_order_id) {
2238
+ $i = $label_order_id;
2239
+ $type = $_POST[$i . "_type" . $id];
2240
+ if (isset($_POST[$i . "_type" . $id]))
2241
+ if ($type != "type_map" and $type != "type_submit_reset" and $type != "type_editor" and $type != "type_captcha" and $type != "type_recaptcha" and $type != "type_button") {
2242
+ $element_label = $label_order_original[$i];
2243
+ switch ($type) {
2244
+ case 'type_text':
2245
+ case 'type_password':
2246
+ case 'type_textarea':
2247
+ case "type_date":
2248
+ case "type_own_select":
2249
+ case "type_country":
2250
+ case "type_number":
2251
+ {
2252
+ $element = $_POST[$i . "_element" . $id];
2253
+ if (isset($_POST[$i . "_element" . $id])) {
2254
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $element . '</pre></td></tr>';
2255
+ }
2256
+ break;
2257
+ }
2258
+ case "type_hidden": {
2259
+ $element = $_POST[$element_label];
2260
+ if (isset($element)) {
2261
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $element . '</pre></td></tr>';
2262
+ }
2263
+ break;
2264
+ }
2265
+ case "type_submitter_mail":
2266
+ {
2267
+ $element = $_POST[$i . "_element" . $id];
2268
+ if (isset($_POST[$i . "_element" . $id])) {
2269
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $element . '</pre></td></tr>';
2270
+ if ($_POST[$i . "_send" . $id] == "yes")
2271
+ array_push($cc, $element);
2272
+ }
2273
+ break;
2274
+ }
2275
+ case "type_time":
2276
+ {
2277
+ $hh = $_POST[$i . "_hh" . $id];
2278
+ if (isset($_POST[$i . "_hh" . $id])) {
2279
+ $ss = $_POST[$i . "_ss" . $id];
2280
+ if (isset($_POST[$i . "_ss" . $id]))
2281
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $_POST[$i . "_hh" . $id] . ':' . $_POST[$i . "_mm" . $id] . ':' . $_POST[$i . "_ss" . $id];
2282
+ else
2283
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $_POST[$i . "_hh" . $id] . ':' . $_POST[$i . "_mm" . $id];
2284
+ $am_pm = $_POST[$i . "_am_pm" . $id];
2285
+ if (isset($_POST[$i . "_am_pm" . $id]))
2286
+ $list = $list . ' ' . $_POST[$i . "_am_pm" . $id] . '</td></tr>';
2287
+ else
2288
+ $list = $list . '</td></tr>';
2289
+ }
2290
+ break;
2291
+ }
2292
+ case "type_phone":
2293
+ {
2294
+ $element_first = $_POST[$i . "_element_first" . $id];
2295
+ if (isset($_POST[$i . "_element_first" . $id])) {
2296
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $_POST[$i . "_element_first" . $id] . ' ' . $_POST[$i . "_element_last" . $id] . '</td></tr>';
2297
+ }
2298
+ break;
2299
+ }
2300
+ case "type_name":
2301
+ {
2302
+ $element_first = $_POST[$i . "_element_first" . $id];
2303
+ if (isset($_POST[$i . "_element_first" . $id])) {
2304
+ $element_title = $_POST[$i . "_element_title" . $id];
2305
+ if (isset($_POST[$i . "_element_title" . $id]))
2306
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $_POST[$i . "_element_title" . $id] . ' ' . $_POST[$i . "_element_first" . $id] . ' ' . $_POST[$i . "_element_last" . $id] . ' ' . $_POST[$i . "_element_middle" . $id] . '</td></tr>';
2307
+ else
2308
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $_POST[$i . "_element_first" . $id] . ' ' . $_POST[$i . "_element_last" . $id] . '</td></tr>';
2309
+ }
2310
+ break;
2311
+ }
2312
+ case "type_mark_map":
2313
+ {
2314
+ if (isset($_POST[$i . "_long" . $id])) {
2315
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >Longitude:' . $_POST[$i . "_long" . $id] . '<br/>Latitude:' . $_POST[$i . "_lat" . $id] . '</td></tr>';
2316
+ }
2317
+ break;
2318
+ }
2319
+ case "type_address":
2320
+ {
2321
+ if (isset($_POST[$i . "_street1" . $id]))
2322
+ $list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $_POST[$i . "_street1" . $id] . '</td></tr>';
2323
+ $i++;
2324
+ if (isset($_POST[$i."_street2".$id]))
2325
+ $list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $_POST[$i . "_street2" . $id] . '</td></tr>';
2326
+ $i++;
2327
+ if (isset($_POST[$i."_city".$id]))
2328
+ $list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $_POST[$i . "_city" . $id] . '</td></tr>';
2329
+ $i++;
2330
+ if (isset($_POST[$i."_state".$id]))
2331
+ $list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $_POST[$i . "_state" . $id] . '</td></tr>';
2332
+ $i++;
2333
+ if (isset($_POST[$i."_postal".$id]))
2334
+ $list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $_POST[$i . "_postal" . $id] . '</td></tr>';
2335
+ $i++;
2336
+ if (isset($_POST[$i."_country".$id]))
2337
+ $list = $list . '<tr valign="top"><td >' . $label_order_original[$i] . '</td><td >' . $_POST[$i . "_country" . $id] . '</td></tr>';
2338
+ $i++;
2339
+ break;
2340
+ }
2341
+ case "type_date_fields":
2342
+ {
2343
+ $day = $_POST[$i . "_day" . $id];
2344
+ if (isset($_POST[$i . "_day" . $id])) {
2345
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $_POST[$i . "_day" . $id] . '-' . $_POST[$i . "_month" . $id] . '-' . $_POST[$i . "_year" . $id] . '</td></tr>';
2346
+ }
2347
+ break;
2348
+ }
2349
+ case "type_radio":
2350
+ {
2351
+ $element = $_POST[$i . "_other_input" . $id];
2352
+ if (isset($_POST[$i . "_other_input" . $id])) {
2353
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $_POST[$i . "_other_input" . $id] . '</td></tr>';
2354
+ break;
2355
+ }
2356
+ $element = $_POST[$i . "_element" . $id];
2357
+ if (isset($_POST[$i . "_element" . $id])) {
2358
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td ><pre style="margin:0px; padding:0px">' . $element . '</pre></td></tr>';
2359
+ }
2360
+ break;
2361
+ }
2362
+ case "type_checkbox":
2363
+ {
2364
+ $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >';
2365
+ $start = -1;
2366
+ for ($j = 0; $j < 100; $j++) {
2367
+ if (isset($_POST[$i . "_element" . $id . $j])) {
2368
+ $start = $j;
2369
+ break;
2370
+ }
2371
+ }
2372
+ $other_element_id = -1;
2373
+ $is_other = $_POST[$i . "_allow_other" . $id];
2374
+ if ($is_other == "yes") {
2375
+ $other_element_id = $_POST[$i . "_allow_other_num" . $id];
2376
+ }
2377
+ if ($start != -1) {
2378
+ for ($j = $start; $j < 100; $j++) {
2379
+ $element = $_POST[$i . "_element" . $id . $j];
2380
+ if (isset($_POST[$i . "_element" . $id . $j]))
2381
+ if ($j == $other_element_id) {
2382
+ $list = $list . $_POST[$i . "_other_input" . $id] . '<br>';
2383
+ }
2384
+ else
2385
+ $list = $list . $_POST[$i . "_element" . $id . $j] . '<br>';
2386
+ }
2387
+ $list = $list . '</td></tr>';
2388
+ }
2389
+ break;
2390
+ }
2391
+ case "type_paypal_price": {
2392
+ $value = 0;
2393
+ if ($_POST[$i."_element_dollars".$id]) {
2394
+ $value = $_POST[$i."_element_dollars".$id];
2395
+ }
2396
+ if ($_POST[$i."_element_cents".$id]) {
2397
+ $value = $value.'.'.$_POST[$i."_element_cents".$id];
2398
+ }
2399
+ $list = $list.'<tr valign="top"><td >'.$element_label.'</td><td >'.$value.$form_currency.'</td></tr>';
2400
+ break;
2401
+ }
2402
+ case "type_paypal_select": {
2403
+ $value = $_POST[$i."_element_label".$id].':'.$_POST[$i."_element".$id].$form_currency;
2404
+ $element_quantity_label = $_POST[$i."_element_quantity_label".$id];
2405
+ if (isset($element_quantity_label)) {
2406
+ $quantity = ((isset($_POST[$i . "_element_quantity" . $id]) && ($_POST[$i . "_element_quantity" . $id] >= 1)) ? $_POST[$i . "_element_quantity" . $id] : 1);
2407
+ $value .= '<br/>'.$_POST[$i."_element_quantity_label".$id].': '.$quantity;
2408
+ }
2409
+ for ($k = 0; $k < 50; $k++) {
2410
+ $temp_val = $_POST[$i."_element_property_value".$id.$k];
2411
+ if (isset($temp_val)) {
2412
+ $value .= '<br/>'.$_POST[$i."_element_property_label".$id.$k].': '.$_POST[$i."_element_property_value".$id.$k];
2413
+ }
2414
+ }
2415
+ $list = $list.'<tr valign="top"><td >'.$element_label.'</td><td ><pre style="margin:0px; padding:0px">'.$value.'</pre></td></tr>';
2416
+ break;
2417
+ }
2418
+ case "type_paypal_radio": {
2419
+ $value = $_POST[$i."_element_label".$id].' - '.$_POST[$i."_element".$id].$form_currency;
2420
+ $element_quantity_label = $_POST[$i."_element_quantity_label".$id];
2421
+ if (isset($element_quantity_label)) {
2422
+ $quantity = ((isset($_POST[$i . "_element_quantity" . $id]) && ($_POST[$i . "_element_quantity" . $id] >= 1)) ? $_POST[$i . "_element_quantity" . $id] : 1);
2423
+ $value .= '<br/>' . $_POST[$i."_element_quantity_label".$id] . ': ' . $quantity;
2424
+ }
2425
+ for ($k = 0; $k < 50; $k++) {
2426
+ $temp_val = $_POST[$i."_element_property_value".$id.$k];
2427
+ if (isset($temp_val)) {
2428
+ $value .= '<br/>'.$_POST[$i."_element_property_label".$id.$k].': '.$_POST[$i."_element_property_value".$id.$k];
2429
+ }
2430
+ }
2431
+ $list = $list.'<tr valign="top"><td >'.$element_label.'</td><td ><pre style="margin:0px; padding:0px">'.$value.'</pre></td></tr>';
2432
+ break;
2433
+ }
2434
+ case "type_paypal_shipping": {
2435
+ $value = $_POST[$i."_element_label".$id].' - '.$_POST[$i."_element".$id].$form_currency;
2436
+ $list = $list.'<tr valign="top"><td >'.$element_label.'</td><td ><pre style="margin:0px; padding:0px">'.$value.'</pre></td></tr>';
2437
+ break;
2438
+ }
2439
+ case "type_paypal_checkbox": {
2440
+ $list = $list.'<tr valign="top"><td >'.$element_label.'</td><td >';
2441
+ $start = -1;
2442
+ for ($j = 0; $j < 100; $j++) {
2443
+ $element = $_POST[$i."_element".$id.$j];
2444
+ if (isset($element)) {
2445
+ $start = $j;
2446
+ break;
2447
+ }
2448
+ }
2449
+ if ($start != -1) {
2450
+ for ($j = $start; $j < 100; $j++) {
2451
+ $element = $_POST[$i."_element".$id.$j];
2452
+ if (isset($element)) {
2453
+ $list = $list.$_POST[$i."_element".$id.$j."_label"].' - '.($_POST[$i."_element".$id.$j]=='' ? '0'.$form_currency : $_POST[$i."_element".$id.$j]).$form_currency.'<br>';
2454
+ }
2455
+ }
2456
+ }
2457
+ $element_quantity_label = $_POST[$i."_element_quantity_label".$id];
2458
+ if (isset($element_quantity_label)) {
2459
+ $quantity = ((isset($_POST[$i . "_element_quantity" . $id]) && ($_POST[$i . "_element_quantity" . $id] >= 1)) ? $_POST[$i . "_element_quantity" . $id] : 1);
2460
+ $list = $list.'<br/>'.$_POST[$i."_element_quantity_label".$id].': '.$quantity;
2461
+ }
2462
+ for ($k = 0; $k < 50; $k++) {
2463
+ $temp_val = $_POST[$i."_element_property_value".$id.$k];
2464
+ if (isset($temp_val)) {
2465
+ $list = $list.'<br/>'.$_POST[$i."_element_property_label".$id.$k].': '.$_POST[$i."_element_property_value".$id.$k];
2466
+ }
2467
+ }
2468
+ $list = $list.'</td></tr>';
2469
+ break;
2470
+ }
2471
+ case "type_star_rating": {
2472
+ $selected = (isset($_POST[$i."_selected_star_amount".$id]) ? $_POST[$i."_selected_star_amount".$id] : 0);
2473
+ if (isset($_POST[$i."_star_amount".$id])) {
2474
+ $list = $list.'<tr valign="top"><td >'.$element_label.'</td><td ><pre style="margin:0px; padding:0px">'.$selected.'/'.$_POST[$i."_star_amount".$id].'</pre></td></tr>';
2475
+ }
2476
+ break;
2477
+ }
2478
+ case "type_scale_rating": {
2479
+ $selected = (isset($_POST[$i."_scale_radio".$id]) ? $_POST[$i."_scale_radio".$id] : 0);
2480
+ if (isset($_POST[$i."_scale_amount".$id])) {
2481
+ $list = $list.'<tr valign="top"><td >'.$element_label.'</td><td ><pre style="margin:0px; padding:0px">'.$selected.'/'.$_POST[$i."_scale_radio".$id].'</pre></td></tr>';
2482
+ }
2483
+ break;
2484
+ }
2485
+ case "type_spinner": {
2486
+ if (isset($_POST[$i."_element".$id])) {
2487
+ $list=$list.'<tr valign="top"><td >'.$element_label.'</td><td ><pre style="margin:0px; padding:0px">'.$_POST[$i."_element".$id].'</pre></td></tr>';
2488
+ }
2489
+ break;
2490
+ }
2491
+ case "type_slider": {
2492
+ if (isset($_POST[$i."_slider_value".$id])) {
2493
+ $list=$list.'<tr valign="top"><td >'.$element_label.'</td><td ><pre style="margin:0px; padding:0px">'.$_POST[$i."_slider_value".$id].'</pre></td></tr>';
2494
+ }
2495
+ break;
2496
+ }
2497
+ case "type_range": {
2498
+ if(isset($_POST[$i."_element".$id.'0']) || isset($_POST[$i."_element".$id.'1'])) {
2499
+ $list = $list.'<tr valign="top"><td >'.$element_label.'</td><td ><pre style="margin:0px; padding:0px">From:'.$_POST[$i."_element".$id.'0'].'<span style="margin-left:6px">To</span>:'.$_POST[$i."_element".$id.'1'].'</pre></td></tr>';
2500
+ }
2501
+ break;
2502
+ }
2503
+ case "type_grading": {
2504
+ if (isset($_POST[$i."_hidden_item".$id])) {
2505
+ $element = $_POST[$i."_hidden_item".$id];
2506
+ $grading = explode(":", $element);
2507
+ $items_count = sizeof($grading) - 1;
2508
+ $total = "";
2509
+ for ($k = 0; $k < $items_count; $k++) {
2510
+ if (isset($_POST[$i."_element".$id.$k])) {
2511
+ $element .= $grading[$k].":".$_POST[$i."_element".$id.$k]." ";
2512
+ $total += $_POST[$i."_element".$id.$k];
2513
+ }
2514
+ }
2515
+ $element .= "Total:".$total;
2516
+ $list = $list.'<tr valign="top"><td >'.$element_label.'</td><td ><pre style="margin:0px; padding:0px">'.$element.'</pre></td></tr>';
2517
+ }
2518
+ break;
2519
+ }
2520
+ case "type_matrix": {
2521
+ $input_type=$_POST[$i."_input_type".$id];
2522
+ $mat_rows = $_POST[$i."_hidden_row".$id];
2523
+ $mat_rows = explode('***', $mat_rows);
2524
+ $mat_rows = array_slice($mat_rows,0, count($mat_rows)-1);
2525
+ $mat_columns = $_POST[$i."_hidden_column".$id];
2526
+ $mat_columns = explode('***', $mat_columns);
2527
+ $mat_columns = array_slice($mat_columns,0, count($mat_columns)-1);
2528
+ $row_ids=explode(",",substr($_POST[$i."_row_ids".$id], 0, -1));
2529
+ $column_ids=explode(",",substr($_POST[$i."_column_ids".$id], 0, -1));
2530
+ $matrix = "<table>";
2531
+ $matrix .= '<tr><td></td>';
2532
+ for ($k = 0; $k < count($mat_columns); $k++) {
2533
+ $matrix .='<td style="background-color:#BBBBBB; padding:5px; ">'.$mat_columns[$k].'</td>';
2534
+ }
2535
+ $matrix .= '</tr>';
2536
+ $aaa = Array();
2537
+ $k = 0;
2538
+ foreach ($row_ids as $row_id) {
2539
+ $matrix .= '<tr><td style="background-color:#BBBBBB; padding:5px;">'.$mat_rows[$k].'</td>';
2540
+ if ($input_type=="radio") {
2541
+ $mat_radio = (isset($_POST[$i."_input_element".$id.$row_id]) ? $_POST[$i."_input_element".$id.$row_id] : 0);
2542
+ if ($mat_radio == 0) {
2543
+ $checked = "";
2544
+ $aaa[1] = "";
2545
+ }
2546
+ else {
2547
+ $aaa = explode("_", $mat_radio);
2548
+ }
2549
+ foreach ($column_ids as $column_id) {
2550
+ if ($aaa[1] == $column_id) {
2551
+ $checked = "checked";
2552
+ }
2553
+ else {
2554
+ $checked = "";
2555
+ }
2556
+ $matrix .= '<td style="text-align:center"><input type="radio" '.$checked.' disabled /></td>';
2557
+ }
2558
+ }
2559
+ else {
2560
+ if ($input_type=="checkbox") {
2561
+ foreach($column_ids as $column_id) {
2562
+ $checked = $_POST[$i."_input_element".$id.$row_id.'_'.$column_id];
2563
+ if ($checked == 1) {
2564
+ $checked = "checked";
2565
+ }
2566
+ else {
2567
+ $checked = "";
2568
+ }
2569
+ $matrix .= '<td style="text-align:center"><input type="checkbox" '.$checked.' disabled /></td>';
2570
+ }
2571
+ }
2572
+ else {
2573
+ if ($input_type=="text") {
2574
+ foreach ($column_ids as $column_id) {
2575
+ $checked = $_POST[$i."_input_element".$id.$row_id.'_'.$column_id];
2576
+ $matrix .='<td style="text-align:center"><input type="text" value="'.$checked.'" disabled /></td>';
2577
+ }
2578
+ }
2579
+ else {
2580
+ foreach ($column_ids as $column_id) {
2581
+ $checked = $_POST[$i."_select_yes_no".$id.$row_id.'_'.$column_id];
2582
+ $matrix .='<td style="text-align:center">'.$checked.'</td>';
2583
+ }
2584
+ }
2585
+ }
2586
+ }
2587
+ $matrix .= '</tr>';
2588
+ $k++;
2589
+ }
2590
+ $matrix .= '</table>';
2591
+ if (isset($matrix)) {
2592
+ $list = $list.'<tr valign="top"><td >'.$element_label.'</td><td ><pre style="margin:0px; padding:0px">'.$matrix.'</pre></td></tr>';
2593
+ }
2594
+ break;
2595
+ }
2596
+ default:
2597
+ break;
2598
+ }
2599
+ }
2600
+ }
2601
+ $list = $list . '</table>';
2602
+ $list = wordwrap($list, 70, "\n", TRUE);
2603
+ // add_filter('wp_mail_content_type', create_function('', 'return "text/html";'));
2604
+ if ($row->from_mail != '') {
2605
+ if ($row->from_name != '') {
2606
+ $from_mail = "From: '" . $row->from_name . "' <" . $row->from_mail . ">" . "\r\n";
2607
+ }
2608
+ else {
2609
+ $from_mail = "From: '' <" . $row->from_mail . ">" . "\r\n";
2610
+ }
2611
+ }
2612
+ else {
2613
+ $from_mail = '';
2614
+ }
2615
+ $headers = "MIME-Version: 1.0\n" . $from_mail . " Content-Type: text/html; charset=\"" . get_option('blog_charset') . "\"\n";
2616
+ for ($k = 0; $k < count($all_files); $k++) {
2617
+ // $attachment[$k] = dirname(__FILE__) . '/uploads/' . $all_files[$k]['name'];
2618
+ $attachment[$k]= $all_files[$k]['name'];
2619
+ }
2620
+ if (isset($cc[0])) {
2621
+ foreach ($cc as $c) {
2622
+ if ($c) {
2623
+ $recipient = $c;
2624
+ $subject = $row->title;
2625
+ $new_script = wpautop($row->script_mail_user);
2626
+ foreach ($label_order_original as $key => $label_each) {
2627
+ if (strpos($row->script_mail_user, "%" . $label_each . "%") !== FALSE) {
2628
+ $type = $label_type[$key];
2629
+ if ($type != "type_submit_reset" or $type != "type_map" or $type != "type_editor" or $type != "type_captcha" or $type != "type_recaptcha" or $type != "type_button") {
2630
+ $new_value = "";
2631
+ switch ($type) {
2632
+ case 'type_text':
2633
+ case 'type_password':
2634
+ case 'type_textarea':
2635
+ case "type_date":
2636
+ case "type_own_select":
2637
+ case "type_country":
2638
+ case "type_number": {
2639
+ $element = $_POST[$key."_element".$id];
2640
+ if (isset($element)) {
2641
+ $new_value = $element;
2642
+ }
2643
+ break;
2644
+ }
2645
+ case "type_hidden": {
2646
+ $element = $_POST[$element_label];
2647
+ if (isset($element)) {
2648
+ $new_value = $element;
2649
+ }
2650
+ break;
2651
+ }
2652
+ case "type_mark_map": {
2653
+ $element = $_POST[$key."_long".$id];
2654
+ if (isset($element)) {
2655
+ $new_value = 'Longitude:'.$_POST[$key."_long".$id].'<br/>Latitude:' . $_POST[$key."_lat".$id];
2656
+ }
2657
+ break;
2658
+ }
2659
+ case "type_submitter_mail": {
2660
+ $element = $_POST[$key."_element".$id];
2661
+ if (isset($element)) {
2662
+ $new_value = $element;
2663
+ }
2664
+ break;
2665
+ }
2666
+ case "type_time": {
2667
+ $hh = $_POST[$key."_hh".$id];
2668
+ if (isset($hh)) {
2669
+ $ss = $_POST[$key."_ss".$id];
2670
+ if (isset($ss)) {
2671
+ $new_value = $_POST[$key."_hh".$id].':'.$_POST[$key."_mm".$id].':'.$_POST[$key."_ss".$id];
2672
+ }
2673
+ else {
2674
+ $new_value = $_POST[$key."_hh".$id].':'.$_POST[$key."_mm".$id];
2675
+ }
2676
+ $am_pm = $_POST[$key."_am_pm".$id];
2677
+ if (isset($am_pm)) {
2678
+ $new_value = $new_value.' '.$_POST[$key."_am_pm".$id];
2679
+ }
2680
+ }
2681
+ break;
2682
+ }
2683
+ case "type_phone": {
2684
+ $element_first = $_POST[$key."_element_first".$id];
2685
+ if (isset($element_first)) {
2686
+ $new_value = $_POST[$key."_element_first".$id].' '.$_POST[$key."_element_last".$id];
2687
+ }
2688
+ break;
2689
+ }
2690
+ case "type_name": {
2691
+ $element_first = $_POST[$key."_element_first".$id];
2692
+ if (isset($element_first)) {
2693
+ $element_title = $_POST[$key."_element_title".$id];
2694
+ if (isset($element_title)) {
2695
+ $new_value = $_POST[$key."_element_title".$id].' '.$_POST[$key."_element_first".$id].' '.$_POST[$key."_element_last".$id].' '.$_POST[$key."_element_middle".$id];
2696
+ }
2697
+ else {
2698
+ $new_value = $_POST[$key."_element_first".$id].' '.$_POST[$key."_element_last".$id];
2699
+ }
2700
+ }
2701
+ break;
2702
+ }
2703
+ case "type_address": {
2704
+ if (isset($_POST[$key."_street1".$id])) {
2705
+ $new_value = $new_value.$_POST[$key."_street1".$id];
2706
+ break;
2707
+ }
2708
+ if (isset($_POST[$key."_street2".$id])) {
2709
+ $new_value = $new_value.$_POST[$key."_street2".$id];
2710
+ break;
2711
+ }
2712
+ if (isset($_POST[$key."_city".$id])) {
2713
+ $new_value = $new_value.$_POST[$key."_city".$id];
2714
+ break;
2715
+ }
2716
+ if (isset($_POST[$key."_state".$id])) {
2717
+ $new_value = $new_value.$_POST[$key."_state".$id];
2718
+ break;
2719
+ }
2720
+ if (isset($_POST[$key."_postal".$id])) {
2721
+ $new_value = $new_value.$_POST[$key."_postal".$id];
2722
+ break;
2723
+ }
2724
+ if (isset($_POST[$key."_country".$id])) {
2725
+ $new_value = $new_value.$_POST[$key."_country".$id];
2726
+ break;
2727
+ }
2728
+ }
2729
+ case "type_date_fields": {
2730
+ $day = $_POST[$key."_day".$id];
2731
+ if (isset($day)) {
2732
+ $new_value = $_POST[$key."_day".$id].'-'.$_POST[$key."_month".$id].'-'.$_POST[$key."_year".$id];
2733
+ }
2734
+ break;
2735
+ }
2736
+ case "type_radio": {
2737
+ $element = $_POST[$key."_other_input".$id];
2738
+ if (isset($element)) {
2739
+ $new_value = $_POST[$key."_other_input".$id];
2740
+ break;
2741
+ }
2742
+ $element = $_POST[$key."_element".$id];
2743
+ if (isset($element)) {
2744
+ $new_value = $element;
2745
+ }
2746
+ break;
2747
+ }
2748
+ case "type_checkbox": {
2749
+ $start = -1;
2750
+ for ($j = 0; $j < 100; $j++) {
2751
+ $element = $_POST[$key."_element".$id.$j];
2752
+ if (isset($element)) {
2753
+ $start = $j;
2754
+ break;
2755
+ }
2756
+ }
2757
+ $other_element_id = -1;
2758
+ $is_other = $_POST[$key."_allow_other".$id];
2759
+ if ($is_other == "yes") {
2760
+ $other_element_id = $_POST[$key."_allow_other_num".$id];
2761
+ }
2762
+ if ($start != -1) {
2763
+ for ($j = $start; $j < 100; $j++) {
2764
+ $element = $_POST[$key."_element".$id.$j];
2765
+ if (isset($element)) {
2766
+ if ($j == $other_element_id) {
2767
+ $new_value = $new_value.$_POST[$key."_other_input".$id].'<br>';
2768
+ }
2769
+ else {
2770
+ $new_value = $new_value.$_POST[$key."_element".$id.$j].'<br>';
2771
+ }
2772
+ }
2773
+ }
2774
+ }
2775
+ break;
2776
+ }
2777
+ case "type_paypal_price": {
2778
+ $new_value = 0;
2779
+ if ($_POST[$key."_element_dollars".$id]) {
2780
+ $new_value = $_POST[$key."_element_dollars".$id];
2781
+ }
2782
+ if ($_POST[$key."_element_cents".$id]) {
2783
+ $new_value = $new_value.'.'.$_POST[$key."_element_cents".$id];
2784
+ }
2785
+ $new_value = $new_value.$form_currency;
2786
+ break;
2787
+ }
2788
+ case "type_paypal_select": {
2789
+ $new_value = $_POST[$key."_element_label".$id].':'.$_POST[$key."_element".$id].$form_currency;
2790
+ $element_quantity_label = $_POST[$key."_element_quantity_label".$id];
2791
+ if (isset($element_quantity_label)) {
2792
+ $quantity = ((isset($_POST[$key . "_element_quantity" . $id]) && ($_POST[$key . "_element_quantity" . $id] >= 1)) ? $_POST[$key . "_element_quantity" . $id] : 1);
2793
+ $new_value.='<br/>'.$_POST[$key."_element_quantity_label".$id].': '.$quantity;
2794
+ }
2795
+ for ($k = 0; $k < 50; $k++) {
2796
+ $temp_val = $_POST[$key."_element_property_value".$id.$k];
2797
+ if (isset($temp_val)) {
2798
+ $new_value .= '<br/>'.$_POST[$key."_element_property_label".$id.$k].': '.$_POST[$i."_element_property_value".$id.$k];
2799
+ }
2800
+ }
2801
+ break;
2802
+ }
2803
+ case "type_paypal_radio": {
2804
+ $new_value = $_POST[$key."_element_label".$id].' - '.$_POST[$key."_element".$id].$form_currency;
2805
+ $element_quantity_label = $_POST[$key."_element_quantity_label".$id];
2806
+ if (isset($element_quantity_label)) {
2807
+ $quantity = ((isset($_POST[$key . "_element_quantity" . $id]) && ($_POST[$key . "_element_quantity" . $id] >= 1)) ? $_POST[$key . "_element_quantity" . $id] : 1);
2808
+ $new_value .= '<br/>'.$_POST[$key."_element_quantity_label".$id].': '.$quantity;
2809
+ }
2810
+ for ($k = 0; $k < 50; $k++) {
2811
+ $temp_val = $_POST[$key."_element_property_value".$id.$k];
2812
+ if (isset($temp_val)) {
2813
+ $new_value .= '<br/>' . $_POST[$key."_element_property_label".$id.$k].': '.$_POST[$key."_element_property_value".$id.$k];
2814
+ }
2815
+ }
2816
+ break;
2817
+ }
2818
+ case "type_paypal_shipping": {
2819
+ $new_value = $_POST[$key."_element_label".$id].' : '.$_POST[$key."_element".$id].$form_currency;
2820
+ break;
2821
+ }
2822
+ case "type_paypal_checkbox": {
2823
+ $start = -1;
2824
+ for($j = 0; $j < 100; $j++) {
2825
+ $element = $_POST[$key."_element".$id.$j];
2826
+ if (isset($element)) {
2827
+ $start = $j;
2828
+ break;
2829
+ }
2830
+ }
2831
+ if ($start != -1) {
2832
+ for ($j = $start; $j<100; $j++) {
2833
+ $element = $_POST[$key."_element".$id.$j];
2834
+ if (isset($element)) {
2835
+ $new_value = $new_value.$_POST[$key."_element".$id.$j."_label"].' - '.(($_POST[$key."_element".$id.$j] == '') ? '0'.$form_currency : $_POST[$key."_element".$id.$j]).$form_currency.'<br>';
2836
+ }
2837
+ }
2838
+ }
2839
+ $element_quantity_label = $_POST[$key."_element_quantity_label".$id];
2840
+ if (isset($element_quantity_label)) {
2841
+ $quantity = ((isset($_POST[$key . "_element_quantity" . $id]) && ($_POST[$key . "_element_quantity" . $id] >= 1)) ? $_POST[$key . "_element_quantity" . $id] : 1);
2842
+ $new_value .= '<br/>'.$_POST[$key."_element_quantity_label".$id].': '.$quantity;
2843
+ }
2844
+ for ($k = 0; $k < 50; $k++) {
2845
+ $temp_val = $_POST[$key."_element_property_value".$id.$k];
2846
+ if (isset($temp_val)) {
2847
+ $new_value .= '<br/>'.$_POST[$key."_element_property_label".$id.$k].': '.$_POST[$key."_element_property_value".$id.$k];
2848
+ }
2849
+ }
2850
+ break;
2851
+ }
2852
+ case "type_star_rating":
2853
+ {
2854
+ $element=$_POST[$key."_star_amount".$id];
2855
+ $selected=(isset($_POST[$key."_selected_star_amount".$id]) ? $_POST[$key."_selected_star_amount".$id] : 0);
2856
+
2857
+
2858
+ if(isset($element))
2859
+ {
2860
+ $new_value=$new_value.$selected.'/'.$element;
2861
+ }
2862
+ break;
2863
+ }
2864
+
 
 
 
2865
 
2866
+ case "type_scale_rating":
2867
+ {
2868
+ $element=$_POST[$key."_scale_amount".$id];
2869
+ $selected=(isset($_POST[$key."_scale_radio".$id]) ? $_POST[$key."_scale_radio".$id] : 0);
2870
+
2871
+
2872
+ if(isset($element))
2873
+ {
2874
+ $new_value=$new_value.$selected.'/'.$element;
2875
+ }
2876
+ break;
2877
+ }
2878
+
2879
+ case "type_spinner":
2880
+ {
2881
 
2882
+ if (isset($_POST[$key."_element".$id])) {
2883
+ $new_value = $new_value . $_POST[$key."_element".$id];
2884
+ }
2885
+ break;
2886
+ }
2887
+
2888
+ case "type_slider":
2889
+ {
2890
 
2891
+ $element=$_POST[$key."_slider_value".$id];
2892
+ if(isset($element))
2893
+ {
2894
+ $new_value=$new_value.$element;
2895
+ }
2896
+ break;
2897
+ }
2898
+ case "type_range":
2899
+ {
2900
 
2901
+ $element0=$_POST[$key."_element".$id.'0'];
2902
+ $element1=$_POST[$key."_element".$id.'1'];
2903
+ if(isset($element0) || isset($element1))
2904
+ {
2905
+ $new_value=$new_value.$element0.'-'.$element1;
2906
+ }
2907
+ break;
2908
+ }
2909
+
2910
+ case "type_grading":
2911
+ {
2912
+ $element=$_POST[$key."_hidden_item".$id];
2913
+ $grading = explode(":",$element);
2914
+ $items_count = sizeof($grading)-1;
2915
+
2916
+ $element = "";
2917
+ $total = "";
2918
+
2919
+ for($k=0;$k<$items_count;$k++)
2920
 
2921
+ {
2922
+ $element .= $grading[$k].":".$_POST[$key."_element".$id.$k]." ";
2923
+ $total += $_POST[$key."_element".$id.$k];
2924
+ }
2925
 
2926
+ $element .="Total:".$total;
2927
 
2928
+
2929
+ if(isset($element))
2930
+ {
2931
+ $new_value=$new_value.$element;
2932
+ }
2933
+ break;
2934
+ }
2935
+
2936
+ case "type_matrix":
2937
+ {
2938
+
2939
+
2940
+ $input_type=$_POST[$key."_input_type".$id];
2941
+
2942
+ $mat_rows = $_POST[$key."_hidden_row".$id];
2943
+ $mat_rows = explode('***', $mat_rows);
2944
+ $mat_rows = array_slice($mat_rows,0, count($mat_rows)-1);
2945
+
2946
+ $mat_columns = $_POST[$key."_hidden_column".$id];
2947
+ $mat_columns = explode('***', $mat_columns);
2948
+ $mat_columns = array_slice($mat_columns,0, count($mat_columns)-1);
2949
+
2950
+ $row_ids=explode(",",substr($_POST[$key."_row_ids".$id], 0, -1));
2951
+ $column_ids=explode(",",substr($_POST[$key."_column_ids".$id], 0, -1));
2952
+
2953
+
2954
+ $matrix="<table>";
2955
+
2956
+ $matrix .='<tr><td></td>';
2957
+
2958
+ for( $k=0;$k< count($mat_columns) ;$k++)
2959
+ $matrix .='<td style="background-color:#BBBBBB; padding:5px; ">'.$mat_columns[$k].'</td>';
2960
+ $matrix .='</tr>';
2961
+
2962
+ $aaa=Array();
2963
+ $k=0;
2964
+ foreach( $row_ids as $row_id){
2965
+ $matrix .='<tr><td style="background-color:#BBBBBB; padding:5px;">'.$mat_rows[$k].'</td>';
2966
+
2967
+ if($input_type=="radio"){
2968
+
2969
+ $mat_radio = (isset($_POST[$key."_input_element".$id.$row_id]) ? $_POST[$key."_input_element".$id.$row_id] : 0);
2970
+ if($mat_radio==0){
2971
+ $checked="";
2972
+ $aaa[1]="";
2973
+ }
2974
+ else{
2975
+ $aaa=explode("_",$mat_radio);
2976
+ }
2977
+
2978
+ foreach( $column_ids as $column_id){
2979
+ if($aaa[1]==$column_id)
2980
+ $checked="checked";
2981
+ else
2982
+ $checked="";
2983
+ $matrix .='<td style="text-align:center"><input type="radio" '.$checked.' disabled /></td>';
2984
+
2985
+ }
2986
+
2987
+ }
2988
+ else{
2989
+ if($input_type=="checkbox")
2990
+ {
2991
+ foreach( $column_ids as $column_id){
2992
+ $checked = $_POST[$key."_input_element".$id.$row_id.'_'.$column_id];
2993
+ if($checked==1)
2994
+ $checked = "checked";
2995
+ else
2996
+ $checked = "";
2997
 
2998
+ $matrix .='<td style="text-align:center"><input type="checkbox" '.$checked.' disabled /></td>';
2999
+
3000
+ }
3001
+
3002
+ }
3003
+ else
3004
+ {
3005
+ if($input_type=="text")
3006
+ {
3007
+
3008
+ foreach( $column_ids as $column_id){
3009
+ $checked = $_POST[$key."_input_element".$id.$row_id.'_'.$column_id];
3010
+
3011
+ $matrix .='<td style="text-align:center"><input type="text" value="'.$checked.'" disabled /></td>';
3012
+
3013
+ }
3014
+
3015
+ }
3016
+ else{
3017
+ foreach( $column_ids as $column_id){
3018
+ $checked = $_POST[$key."_select_yes_no".$id.$row_id.'_'.$column_id];
3019
+ $matrix .='<td style="text-align:center">'.$checked.'</td>';
3020
+
3021
+
3022
+
3023
+ }
3024
+ }
3025
+
3026
+ }
3027
+
3028
+ }
3029
+ $matrix .='</tr>';
3030
+ $k++;
3031
+ }
3032
+ $matrix .='</table>';
3033
 
3034
+
3035
+
3036
+
3037
+
3038
+ if(isset($matrix))
3039
+ {
3040
+ $new_value=$new_value.$matrix;
3041
+ }
3042
+
3043
+ break;
3044
+ }
3045
+ default: break;
3046
+ }
3047
+ $new_script = str_replace("%".$label_each."%", $new_value, $new_script);
3048
+ }
3049
+ }
3050
+ }
3051
+ if (strpos($new_script, "%all%") !== FALSE) {
3052
+ $new_script = str_replace("%all%", $list, $new_script);
3053
+ }
3054
+ $body = $new_script;
3055
+ $send = wp_mail(str_replace(' ', '', $recipient), $subject, stripslashes($body), $headers, $attachment);
3056
+ }
3057
+ if ($row->mail) {
3058
+ if ($c) {
3059
+ // $headers_form_mail = "From: " . $c . " <" . $c . ">" . "\r\n";
3060
+ $headers = "MIME-Version: 1.0\n" . "From: '" . $c . "' <" . $c . ">" . "\r\n" . "Content-Type: text/html; charset=\"" . get_option('blog_charset') . "\"\n";
3061
+ }
3062
+ // else {
3063
+ // $headers_form_mail = "";
3064
+ // }
3065
+ if ($row_mail_one_time) {
3066
+ $recipient = $row->mail;
3067
+ $subject = $row->title;
3068
+ $new_script = wpautop($row->script_mail);
3069
+ foreach($label_order_original as $key => $label_each) {
3070
+ if (strpos($row->script_mail, "%" . $label_each . "%") !== FALSE) {
3071
+ $type = $label_type[$key];
3072
+ if ($type != "type_submit_reset" or $type!="type_map" or $type!="type_editor" or $type!="type_captcha" or $type!="type_recaptcha" or $type!="type_button") {
3073
+ $new_value ="";
3074
+ switch ($type) {
3075
+ case 'type_text':
3076
+ case 'type_password':
3077
+ case 'type_textarea':
3078
+ case "type_date":
3079
+ case "type_own_select":
3080
+ case "type_country":
3081
+ case "type_number": {
3082
+ $element = $_POST[$key."_element".$id];
3083
+ if (isset($element)) {
3084
+ $new_value = $element;
3085
+ }
3086
+ break;
3087
+ }
3088
+ case "type_hidden": {
3089
+ $element = $_POST[$element_label];
3090
+ if(isset($element))
3091
+ {
3092
+ $new_value = $element;
3093
+ }
3094
+ break;
3095
+ }
3096
+ case "type_mark_map": {
3097
+ $element = $_POST[$key."_long".$id];
3098
+ if (isset($element)) {
3099
+ $new_value = 'Longitude:'.$_POST[$key."_long".$id].'<br/>Latitude:'.$_POST[$key."_lat".$id];
3100
+ }
3101
+ break;
3102
+ }
3103
+ case "type_submitter_mail": {
3104
+ $element = $_POST[$key."_element".$id];
3105
+ if (isset($element)) {
3106
+ $new_value = $element;
3107
+ }
3108
+ break;
3109
+ }
3110
+ case "type_time": {
3111
+ $hh = $_POST[$key."_hh".$id];
3112
+ if (isset($hh)) {
3113
+ $ss = $_POST[$key."_ss".$id];
3114
+ if (isset($ss)) {
3115
+ $new_value = $_POST[$key."_hh".$id].':'.$_POST[$key."_mm".$id].':'.$_POST[$key."_ss".$id];
3116
+ }
3117
+ else {
3118
+ $new_value = $_POST[$key."_hh".$id].':'.$_POST[$key."_mm".$id];
3119
+ }
3120
+ $am_pm = $_POST[$key."_am_pm".$id];
3121
+ if (isset($am_pm)) {
3122
+ $new_value = $new_value.' '.$_POST[$key."_am_pm".$id];
3123
+ }
3124
+ }
3125
+ break;
3126
+ }
3127
+ case "type_phone": {
3128
+ $element_first = $_POST[$key."_element_first".$id];
3129
+ if (isset($element_first)) {
3130
+ $new_value = $_POST[$key."_element_first".$id].' '.$_POST[$key."_element_last".$id];
3131
+ }
3132
+ break;
3133
+ }
3134
+ case "type_name": {
3135
+ $element_first = $_POST[$key."_element_first".$id];
3136
+ if (isset($element_first)) {
3137
+ $element_title = $_POST[$key."_element_title".$id];
3138
+ if (isset($element_title)) {
3139
+ $new_value = $_POST[$key."_element_title".$id].' '.$_POST[$key."_element_first".$id].' '.$_POST[$key."_element_last".$id].' '.$_POST[$key."_element_middle".$id];
3140
+ }
3141
+ else {
3142
+ $new_value = $_POST[$key."_element_first".$id].' '.$_POST[$key."_element_last".$id];
3143
+ }
3144
+ }
3145
+ break;
3146
+ }
3147
+ case "type_address": {
3148
+ $street1 = $_POST[$key."_street1".$id];
3149
+ if (isset($_POST[$key."_street1".$id])) {
3150
+ $new_value = $new_value.$_POST[$key."_street1".$id];
3151
+ break;
3152
+ }
3153
+ if (isset($_POST[$key."_street2".$id])) {
3154
+ $new_value=$new_value.$_POST[$key."_street2".$id];
3155
+ break;
3156
+ }
3157
+ if (isset($_POST[$key."_city".$id])) {
3158
+ $new_value=$new_value.$_POST[$key."_city".$id];
3159
+ break;
3160
+ }
3161
+ if (isset($_POST[$key."_state".$id])) {
3162
+ $new_value=$new_value.$_POST[$key."_state".$id];
3163
+ break;
3164
+ }
3165
+ if (isset($_POST[$key."_postal".$id])) {
3166
+ $new_value=$new_value.$_POST[$key."_postal".$id];
3167
+ break;
3168
+ }
3169
+ if (isset($_POST[$key."_country".$id])) {
3170
+ $new_value=$new_value.$_POST[$key."_country".$id];
3171
+ break;
3172
+ }
3173
+ }
3174
+ case "type_date_fields": {
3175
+ $day = $_POST[$key."_day".$id];
3176
+ if (isset($day)) {
3177
+ $new_value = $_POST[$key."_day".$id].'-'.$_POST[$key."_month".$id].'-'.$_POST[$key."_year".$id];
3178
+ }
3179
+ break;
3180
+ }
3181
+ case "type_radio": {
3182
+ $element = $_POST[$key."_other_input".$id];
3183
+ if (isset($element)) {
3184
+ $new_value = $_POST[$key."_other_input".$id];
3185
+ break;
3186
+ }
3187
+ $element = $_POST[$key."_element".$id];
3188
+ if (isset($element)) {
3189
+ $new_value = $element;
3190
+ }
3191
+ break;
3192
+ }
3193
+ case "type_checkbox": {
3194
+ $start = -1;
3195
+ for ($j=0; $j<100; $j++) {
3196
+ $element = $_POST[$key."_element".$id.$j];
3197
+ if (isset($element)) {
3198
+ $start = $j;
3199
+ break;
3200
+ }
3201
+ }
3202
+ $other_element_id=-1;
3203
+ $is_other = $_POST[$key."_allow_other".$id];
3204
+ if ($is_other == "yes") {
3205
+ $other_element_id = $_POST[$key."_allow_other_num".$id];
3206
+ }
3207
+ if ($start != -1) {
3208
+ for ($j = $start; $j < 100; $j++) {
3209
+ $element = $_POST[$key."_element".$id.$j];
3210
+ if (isset($element)) {
3211
+ if ($j == $other_element_id) {
3212
+ $new_value = $new_value.$_POST[$key."_other_input".$id].'<br>';
3213
+ }
3214
+ else {
3215
+ $new_value = $new_value.$_POST[$key."_element".$id.$j].'<br>';
3216
+ }
3217
+ }
3218
+ }
3219
+ }
3220
+ break;
3221
+ }
3222
+ case "type_paypal_price": {
3223
+ $new_value = 0;
3224
+ if ($_POST[$key."_element_dollars".$id]) {
3225
+ $new_value = $_POST[$key."_element_dollars".$id];
3226
+ }
3227
+ if ($_POST[$key."_element_cents".$id]) {
3228
+ $new_value = $new_value.'.'.$_POST[$key."_element_cents".$id];
3229
+ }
3230
+ $new_value = $new_value.$form_currency;
3231
+ break;
3232
+ }
3233
+ case "type_paypal_select": {
3234
+ $new_value = $_POST[$key."_element_label".$id].':'.$_POST[$key."_element".$id].$form_currency;
3235
+ $element_quantity_label = $_POST[$key."_element_quantity_label".$id];
3236
+ if (isset($element_quantity_label)) {
3237
+ $quantity = ((isset($_POST[$key . "_element_quantity" . $id]) && ($_POST[$key . "_element_quantity" . $id] >= 1)) ? $_POST[$key . "_element_quantity" . $id] : 1);
3238
+ $new_value .= '<br/>'.$_POST[$key."_element_quantity_label".$id].': '.$quantity;
3239
+ }
3240
+ for($k = 0; $k < 50; $k++) {
3241
+ $temp_val = $_POST[$key."_element_property_value".$id.$k];
3242
+ if (isset($temp_val)) {
3243
+ $new_value .= '<br/>'.$_POST[$key."_element_property_label".$id.$k].': '.$_POST[$key."_element_property_value".$id.$k];
3244
+ }
3245
+ }
3246
+ break;
3247
+ }
3248
+ case "type_paypal_radio": {
3249
+ $new_value = $_POST[$key."_element_label".$id].' - '.$_POST[$key."_element".$id].$form_currency;
3250
+ $element_quantity_label = $_POST[$key."_element_quantity_label".$id];
3251
+ if (isset($element_quantity_label)) {
3252
+ $quantity = ((isset($_POST[$key . "_element_quantity" . $id]) && ($_POST[$key . "_element_quantity" . $id] >= 1)) ? $_POST[$key . "_element_quantity" . $id] : 1);
3253
+ $new_value .= '<br/>'.$_POST[$key."_element_quantity_label".$id].': '.$quantity;
3254
+ }
3255
+ for ($k = 0; $k < 50; $k++) {
3256
+ $temp_val = $_POST[$key."_element_property_value".$id.$k];
3257
+ if (isset($temp_val)) {
3258
+ $new_value .= '<br/>'.$_POST[$key."_element_property_label".$id.$k].': '.$_POST[$key."_element_property_value".$id.$k];
3259
+ }
3260
+ }
3261
+ break;
3262
+ }
3263
+ case "type_paypal_shipping": {
3264
+ $new_value = $_POST[$key."_element_label".$id].' : '.$_POST[$key."_element".$id].$form_currency;
3265
+ break;
3266
+ }
3267
+ case "type_paypal_checkbox": {
3268
+ $start = -1;
3269
+ for ($j = 0; $j < 100; $j++) {
3270
+ $element = $_POST[$key."_element".$id.$j];
3271
+ if (isset($element)) {
3272
+ $start = $j;
3273
+ break;
3274
+ }
3275
+ }
3276
+ if ($start != -1) {
3277
+ for ($j = $start; $j < 100; $j++) {
3278
+ $element = $_POST[$key."_element".$id.$j];
3279
+ if (isset($element)) {
3280
+ $new_value = $new_value.$_POST[$key."_element".$id.$j."_label"].' - '.(($_POST[$key."_element".$id.$j] == '') ? '0'.$form_currency : $_POST[$key."_element".$id.$j]).$form_currency.'<br>';
3281
+ }
3282
+ }
3283
+ }
3284
+ $element_quantity_label = $_POST[$key."_element_quantity_label".$id];
3285
+ if (isset($element_quantity_label)) {
3286
+ $quantity = ((isset($_POST[$key . "_element_quantity" . $id]) && ($_POST[$key . "_element_quantity" . $id] >= 1)) ? $_POST[$key . "_element_quantity" . $id] : 1);
3287
+ $new_value .= '<br/>'.$_POST[$key."_element_quantity_label".$id].': '.$quantity;
3288
+ }
3289
+ for ($k = 0; $k < 50; $k++) {
3290
+ $temp_val = $_POST[$key."_element_property_value".$id.$k];
3291
+ if (isset($temp_val)) {
3292
+ $new_value .= '<br/>'.$_POST[$key."_element_property_label".$id.$k].': '.$_POST[$key."_element_property_value".$id.$k];
3293
+ }
3294
+ }
3295
+ break;
3296
+ }
3297
+ case "type_star_rating": {
3298
+ if (isset($_POST[$key."_star_amount".$id])) {
3299
+ $selected = (isset($_POST[$key."_selected_star_amount".$id]) ? $_POST[$key."_selected_star_amount".$id] : 0);
3300
+ $new_value = $new_value.$selected.'/'.$_POST[$key."_star_amount".$id];
3301
+ }
3302
+ break;
3303
+ }
3304
+ case "type_scale_rating": {
3305
+ if (isset($_POST[$key."_scale_amount".$id])) {
3306
+ $selected = (isset($_POST[$key."_scale_radio".$id]) ? $_POST[$key."_scale_radio".$id] : 0);
3307
+ $new_value=$new_value.$selected.'/'.$_POST[$key."_scale_amount".$id];
3308
+ }
3309
+ break;
3310
+ }
3311
+ case "type_spinner": {
3312
+ if(isset($_POST[$key."_element".$id])) {
3313
+ $new_value = $new_value.$_POST[$key."_element".$id];
3314
+ }
3315
+ break;
3316
+ }
3317
+ case "type_slider": {
3318
+ if (isset($_POST[$key."_slider_value".$id])) {
3319
+ $new_value = $new_value.$_POST[$key."_slider_value".$id];
3320
+ }
3321
+ break;
3322
+ }
3323
+ case "type_range": {
3324
+ if (isset($_POST[$key."_element".$id.'0']) || isset($_POST[$key."_element".$id.'1'])) {
3325
+ $new_value=$new_value.$_POST[$key."_element".$id.'0'].'-'.$_POST[$key."_element".$id.'1'];
3326
+ }
3327
+ break;
3328
+ }
3329
+
3330
+ case "type_grading":
3331
+ {
3332
+ $element=$_POST[$key."_hidden_item".$id];
3333
+ $grading = explode(":",$element);
3334
+ $items_count = sizeof($grading)-1;
3335
+
3336
+ $element = "";
3337
+ $total = "";
3338
+
3339
+ for($k=0;$k<$items_count;$k++) {
3340
+ $element .= $grading[$k].":".$_POST[$key."_element".$id.$k]." ";
3341
+ $total += $_POST[$key."_element".$id.$k];
3342
+ }
3343
 
3344
+ $element .="Total:".$total;
3345
 
3346
+
3347
+ if(isset($element))
3348
+ {
3349
+ $new_value=$new_value.$element;
3350
+ }
3351
+ break;
3352
+ }
3353
+
3354
+ case "type_matrix":
3355
+ {
3356
+
3357
+
3358
+ $input_type=$_POST[$key."_input_type".$id];
3359
+
3360
+ $mat_rows = $_POST[$key."_hidden_row".$id];
3361
+ $mat_rows = explode('***', $mat_rows);
3362
+ $mat_rows = array_slice($mat_rows,0, count($mat_rows)-1);
3363
+
3364
+ $mat_columns = $_POST[$key."_hidden_column".$id];
3365
+ $mat_columns = explode('***', $mat_columns);
3366
+ $mat_columns = array_slice($mat_columns,0, count($mat_columns)-1);
3367
+
3368
+ $row_ids=explode(",",substr($_POST[$key."_row_ids".$id], 0, -1));
3369
+ $column_ids=explode(",",substr($_POST[$key."_column_ids".$id], 0, -1));
3370
+ $matrix="<table>";
3371
+
3372
+ $matrix .='<tr><td></td>';
3373
+
3374
+ for( $k=0;$k< count($mat_columns) ;$k++)
3375
+ $matrix .='<td style="background-color:#BBBBBB; padding:5px; ">'.$mat_columns[$k].'</td>';
3376
+ $matrix .='</tr>';
3377
+
3378
+ $aaa=Array();
3379
+ $k=0;
3380
+ foreach( $row_ids as $row_id){
3381
+ $matrix .='<tr><td style="background-color:#BBBBBB; padding:5px;">'.$mat_rows[$k].'</td>';
3382
+
3383
+ if($input_type=="radio"){
3384
+
3385
+ $mat_radio = (isset($_POST[$key."_input_element".$id.$row_id]) ? $_POST[$key."_input_element".$id.$row_id] : 0);
3386
+ if($mat_radio==0){
3387
+ $checked="";
3388
+ $aaa[1]="";
3389
+ }
3390
+ else{
3391
+ $aaa=explode("_",$mat_radio);
3392
+ }
3393
+
3394
+ foreach( $column_ids as $column_id){
3395
+ if($aaa[1]==$column_id)
3396
+ $checked="checked";
3397
+ else
3398
+ $checked="";
3399
+ $matrix .='<td style="text-align:center"><input type="radio" '.$checked.' disabled /></td>';
3400
+
3401
+ }
3402
+
3403
+ }
3404
+ else{
3405
+ if($input_type=="checkbox")
3406
+ {
3407
+ foreach( $column_ids as $column_id){
3408
+ $checked = $_POST[$key."_input_element".$id.$row_id.'_'.$column_id];
3409
+ if($checked==1)
3410
+ $checked = "checked";
3411
+ else
3412
+ $checked = "";
3413
 
3414
+ $matrix .='<td style="text-align:center"><input type="checkbox" '.$checked.' disabled /></td>';
3415
+
3416
+ }
3417
+
3418
+ }
3419
+ else
3420
+ {
3421
+ if($input_type=="text")
3422
+ {
3423
+
3424
+ foreach( $column_ids as $column_id){
3425
+ $checked = $_POST[$key."_input_element".$id.$row_id.'_'.$column_id];
3426
+
3427
+ $matrix .='<td style="text-align:center"><input type="text" value="'.$checked.'" disabled /></td>';
3428
+
3429
+ }
3430
+
3431
+ }
3432
+ else{
3433
+ foreach( $column_ids as $column_id){
3434
+ $checked = $_POST[$key."_select_yes_no".$id.$row_id.'_'.$column_id];
3435
+ $matrix .='<td style="text-align:center">'.$checked.'</td>';
3436
+
3437
+
3438
+
3439
+ }
3440
+ }
3441
+
3442
+ }
3443
+
3444
+ }
3445
+ $matrix .='</tr>';
3446
+ $k++;
3447
+ }
3448
+ $matrix .='</table>';
3449
 
3450
+
3451
+
3452
+
3453
+
3454
+ if(isset($matrix))
3455
+ {
3456
+ $new_value=$new_value.$matrix;
3457
+ }
3458
+
3459
+ break;
3460
+ }
3461
+ default: break;
3462
+ }
3463
+ $new_script = str_replace("%".$label_each."%", $new_value, $new_script);
3464
+ }
3465
+ }
3466
+ }
3467
+ if (strpos($new_script, "%all%") !== FALSE) {
3468
+ $new_script = str_replace("%all%", $list, $new_script);
3469
+ }
3470
+ $body = $new_script;
3471
+ $mode = 1;
3472
+ $send = wp_mail(str_replace(' ', '', $recipient), $subject, stripslashes($body), $headers, $attachment);
3473
+ $row_mail_one_time = 0;
3474
+ }
3475
+ }
3476
+ }
3477
+ }
3478
+ else {
3479
+ if ($row->mail) {
3480
+ $recipient = $row->mail;
3481
+ $subject = $row->title;
3482
+ $new_script = wpautop($row->script_mail);
3483
+ foreach($label_order_original as $key => $label_each) {
3484
+ if (strpos($row->script_mail, "%" . $label_each . "%") !== FALSE) {
3485
+ $type = $label_type[$key];
3486
+ if ($type != "type_submit_reset" or $type != "type_map" or $type != "type_editor" or $type!="type_captcha" or $type!="type_recaptcha" or $type!="type_button") {
3487
+ $new_value = "";
3488
+ switch ($type) {
3489
+ case 'type_text':
3490
+ case 'type_password':
3491
+ case 'type_textarea':
3492
+ case "type_date":
3493
+ case "type_own_select":
3494
+ case "type_country":
3495
+ case "type_number": {
3496
+ $element = $_POST[$key."_element".$id];
3497
+ if (isset($element)) {
3498
+ $new_value = $element;
3499
+ }
3500
+ break;
3501
+ }
3502
+ case "type_hidden": {
3503
+ $element = $_POST[$element_label];
3504
+ if (isset($element)) {
3505
+ $new_value = $element;
3506
+ }
3507
+ break;
3508
+ }
3509
+ case "type_mark_map": {
3510
+ $element = $_POST[$key."_long".$id];
3511
+ if (isset($element)) {
3512
+ $new_value = 'Longitude:'.$_POST[$key."_long".$id].'<br/>Latitude:'.$_POST[$key."_lat".$id];
3513
+ }
3514
+ break;
3515
+ }
3516
+ case "type_submitter_mail": {
3517
+ $element = $_POST[$key."_element".$id];
3518
+ if (isset($element)) {
3519
+ $new_value = $element;
3520
+ }
3521
+ break;
3522
+ }
3523
+ case "type_time": {
3524
+ $hh = $_POST[$key."_hh".$id];
3525
+ if (isset($hh)) {
3526
+ $ss = $_POST[$key."_ss".$id];
3527
+ if (isset($ss)) {
3528
+ $new_value = $_POST[$key."_hh".$id].':'.$_POST[$key."_mm".$id].':'.$_POST[$key."_ss".$id];
3529
+ }
3530
+ else {
3531
+ $new_value = $_POST[$key."_hh".$id].':'.$_POST[$key."_mm".$id];
3532
+ }
3533
+ $am_pm = $_POST[$key."_am_pm".$id];
3534
+ if (isset($am_pm)) {
3535
+ $new_value = $new_value.' '.$_POST[$key."_am_pm".$id];
3536
+ }
3537
+ }
3538
+ break;
3539
+ }
3540
+ case "type_phone": {
3541
+ $element_first = $_POST[$key."_element_first".$id];
3542
+ if (isset($element_first)) {
3543
+ $new_value = $_POST[$key."_element_first".$id].' '.$_POST[$key."_element_last".$id];
3544
+ }
3545
+ break;
3546
+ }
3547
+ case "type_name": {
3548
+ $element_first = $_POST[$key."_element_first".$id];
3549
+ if (isset($element_first)) {
3550
+ $element_title = $_POST[$key."_element_title".$id];
3551
+ if (isset($element_title)) {
3552
+ $new_value = $_POST[$key."_element_title".$id].' '.$_POST[$key."_element_first".$id].' '.$_POST[$key."_element_last".$id].' '.$_POST[$key."_element_middle".$id];
3553
+ }
3554
+ else {
3555
+ $new_value = $_POST[$key."_element_first".$id].' '.$_POST[$key."_element_last".$id];
3556
+ }
3557
+ }
3558
+ break;
3559
+ }
3560
+ case "type_address": {
3561
+ if (isset($_POST[$key."_street1".$id])) {
3562
+ $new_value = $new_value.$_POST[$key."_street1".$id];
3563
+ break;
3564
+ }
3565
+ if (isset($_POST[$key."_street2".$id])) {
3566
+ $new_value = $new_value.$_POST[$key."_street2".$id];
3567
+ break;
3568
+ }
3569
+ if (isset($_POST[$key."_city".$id])) {
3570
+ $new_value = $new_value.$_POST[$key."_city".$id];
3571
+ break;
3572
+ }
3573
+ if (isset($_POST[$key."_state".$id])) {
3574
+ $new_value = $new_value.$_POST[$key."_state".$id];
3575
+ break;
3576
+ }
3577
+ if (isset($_POST[$key."_postal".$id])) {
3578
+ $new_value = $new_value.$_POST[$key."_postal".$id];
3579
+ break;
3580
+ }
3581
+ if (isset($_POST[$key."_country".$id])) {
3582
+ $new_value = $new_value.$_POST[$key."_country".$id];
3583
+ break;
3584
+ }
3585
+ }
3586
+ case "type_date_fields": {
3587
+ $day = $_POST[$key."_day".$id];
3588
+ if (isset($day)) {
3589
+ $new_value = $_POST[$key."_day".$id].'-'.$_POST[$key."_month".$id].'-'.$_POST[$key."_year".$id];
3590
+ }
3591
+ break;
3592
+ }
3593
+ case "type_radio": {
3594
+ $element = $_POST[$key."_other_input".$id];
3595
+ if (isset($element)) {
3596
+ $new_value = $_POST[$key."_other_input".$id];
3597
+ break;
3598
+ }
3599
+ $element = $_POST[$key."_element".$id];
3600
+ if (isset($element)) {
3601
+ $new_value = $element;
3602
+ }
3603
+ break;
3604
+ }
3605
+ case "type_checkbox": {
3606
+ $start = -1;
3607
+ for ($j = 0; $j < 100; $j++) {
3608
+ $element = $_POST[$key."_element".$id.$j];
3609
+ if (isset($element)) {
3610
+ $start = $j;
3611
+ break;
3612
+ }
3613
+ }
3614
+ $other_element_id = -1;
3615
+ $is_other = $_POST[$key."_allow_other".$id];
3616
+ if ($is_other == "yes") {
3617
+ $other_element_id = $_POST[$key."_allow_other_num".$id];
3618
+ }
3619
+ if ($start != -1) {
3620
+ for ($j = $start; $j < 100; $j++) {
3621
+ $element = $_POST[$key."_element".$id.$j];
3622
+ if (isset($element)) {
3623
+ if ($j == $other_element_id) {
3624
+ $new_value = $new_value.$_POST[$key."_other_input".$id].'<br>';
3625
+ }
3626
+ else {
3627
+ $new_value = $new_value.$_POST[$key."_element".$id.$j].'<br>';
3628
+ }
3629
+ }
3630
+ }
3631
+ }
3632
+ break;
3633
+ }
3634
+ case "type_paypal_price": {
3635
+ $new_value = 0;
3636
+ if ($_POST[$key."_element_dollars".$id]) {
3637
+ $new_value = $_POST[$key."_element_dollars".$id];
3638
+ }
3639
+ if ($_POST[$key."_element_cents".$id]) {
3640
+ $new_value = $new_value.'.'.$_POST[$key."_element_cents".$id];
3641
+ }
3642
+ $new_value = $new_value.$form_currency;
3643
+ break;
3644
+ }
3645
+ case "type_paypal_select": {
3646
+ $new_value = $_POST[$key."_element_label".$id].':'.$_POST[$key."_element".$id].$form_currency;
3647
+ $element_quantity_label = $_POST[$key."_element_quantity_label".$id];
3648
+ if (isset($element_quantity_label)) {
3649
+ $quantity = ((isset($_POST[$key . "_element_quantity" . $id]) && ($_POST[$key . "_element_quantity" . $id] >= 1)) ? $_POST[$key . "_element_quantity" . $id] : 1);
3650
+ $new_value .= '<br/>'.$_POST[$key."_element_quantity_label".$id].': '.$quantity;
3651
+ }
3652
+ for ($k = 0; $k < 50; $k++) {
3653
+ $temp_val = $_POST[$key."_element_property_value".$id.$k];
3654
+ if (isset($temp_val)) {
3655
+ $new_value .= '<br/>'.$_POST[$key."_element_property_label".$id.$k].': '.$_POST[$key."_element_property_value".$id.$k];
3656
+ }
3657
+ }
3658
+ break;
3659
+ }
3660
+ case "type_paypal_radio": {
3661
+ $new_value = $_POST[$key."_element_label".$id].' - '.$_POST[$key."_element".$id].$form_currency;
3662
+ $element_quantity_label = $_POST[$key."_element_quantity_label".$id];
3663
+ if (isset($element_quantity_label)) {
3664
+ $quantity = ((isset($_POST[$key . "_element_quantity" . $id]) && ($_POST[$key . "_element_quantity" . $id] >= 1)) ? $_POST[$key . "_element_quantity" . $id] : 1);
3665
+ $new_value .= '<br/>'.$_POST[$key."_element_quantity_label".$id].': '.$quantity;
3666
+ }
3667
+ for ($k = 0; $k < 50; $k++) {
3668
+ $temp_val = $_POST[$key."_element_property_value".$id.$k];
3669
+ if (isset($temp_val)) {
3670
+ $new_value .= '<br/>'.$_POST[$key."_element_property_label".$id.$k].': '.$_POST[$key."_element_property_value".$id.$k];
3671
+ }
3672
+ }
3673
+ break;
3674
+ }
3675
+ case "type_paypal_shipping": {
3676
+ $new_value = $_POST[$key."_element_label".$id].' : '.$_POST[$key."_element".$id].$form_currency;
3677
+ break;
3678
+ }
3679
+ case "type_paypal_checkbox": {
3680
+ $start = -1;
3681
+ for ($j = 0; $j < 100; $j++) {
3682
+ $element = $_POST[$key."_element".$id.$j];
3683
+ if (isset($element)) {
3684
+ $start = $j;
3685
+ break;
3686
+ }
3687
+ }
3688
+ if ($start != -1) {
3689
+ for ($j = $start; $j < 100; $j++) {
3690
+ $element = $_POST[$key."_element".$id.$j];
3691
+ if (isset($element)) {
3692
+ $new_value = $new_value.$_POST[$key."_element".$id.$j."_label"].' - '.(($_POST[$key."_element".$id.$j] == '') ? '0'.$form_currency : $_POST[$key."_element".$id.$j]).$form_currency.'<br>';
3693
+ }
3694
+ }
3695
+ }
3696
+ $element_quantity_label = $_POST[$key."_element_quantity_label".$id];
3697
+ if (isset($element_quantity_label)) {
3698
+ $quantity = ((isset($_POST[$key . "_element_quantity" . $id]) && ($_POST[$key . "_element_quantity" . $id] >= 1)) ? $_POST[$key . "_element_quantity" . $id] : 1);
3699
+ $new_value .= '<br/>'.$_POST[$key."_element_quantity_label".$id].': '.$quantity;
3700
+ }
3701
+ for ($k = 0; $k < 50; $k++) {
3702
+ $temp_val = $_POST[$key."_element_property_value".$id.$k];
3703
+ if (isset($temp_val)) {
3704
+ $new_value .= '<br/>'.$_POST[$key."_element_property_label".$id.$k].': '.$_POST[$key."_element_property_value".$id.$k];
3705
+ }
3706
+ }
3707
+ break;
3708
+ }
3709
+ case "type_star_rating":
3710
+ {
3711
+ $element=$_POST[$key."_star_amount".$id];
3712
+ $selected=(isset($_POST[$key."_selected_star_amount".$id]) ? $_POST[$key."_selected_star_amount".$id] : 0);
3713
+ if(isset($element))
3714
+ {
3715
+ $new_value=$new_value.$selected.'/'.$element;
3716
+ }
3717
+ break;
3718
+ }
3719
+
3720
 
3721
+ case "type_scale_rating":
3722
+ {
3723
+ $element=$_POST[$key."_scale_amount".$id];
3724
+ $selected=(isset($_POST[$key."_scale_radio".$id]) ? $_POST[$key."_scale_radio".$id] : 0);
3725
+
3726
+
3727
+ if(isset($element))
3728
+ {
3729
+ $new_value=$new_value.$selected.'/'.$element;
3730
+ }
3731
+ break;
3732
+ }
3733
+
3734
+ case "type_spinner":
3735
+ {
3736
 
3737
+ if(isset($_POST[$key."_element".$id]))
3738
+ {
3739
+ $new_value=$new_value.$_POST[$key."_element".$id];
3740
+ }
3741
+ break;
3742
+ }
3743
+
3744
+ case "type_slider":
3745
+ {
3746
 
3747
+ $element=$_POST[$key."_slider_value".$id];
3748
+ if(isset($element))
3749
+ {
3750
+ $new_value=$new_value.$element;
3751
+ }
3752
+ break;
3753
+ }
3754
+ case "type_range":
3755
+ {
3756
 
3757
+ $element0=$_POST[$key."_element".$id.'0'];
3758
+ $element1=$_POST[$key."_element".$id.'1'];
3759
+ if(isset($element0) || isset($element1))
3760
+ {
3761
+ $new_value=$new_value.$element0.'-'.$element1;
3762
+ }
3763
+ break;
3764
+ }
3765
+
3766
+ case "type_grading":
3767
+ {
3768
+ $element=$_POST[$key."_hidden_item".$id];
3769
+ $grading = explode(":",$element);
3770
+ $items_count = sizeof($grading)-1;
3771
+
3772
+ $element = "";
3773
+ $total = "";
3774
+
3775
+ for($k=0;$k<$items_count;$k++)
3776
 
3777
+ {
3778
+ $element .= $grading[$k].":".$_POST[$key."_element".$id.$k]." ";
3779
+ $total += $_POST[$key."_element".$id.$k];
3780
+ }
3781
 
3782
+ $element .="Total:".$total;
3783
 
3784
+
3785
+ if(isset($element))
3786
+ {
3787
+ $new_value=$new_value.$element;
3788
+ }
3789
+ break;
3790
+ }
3791
+
3792
+ case "type_matrix":
3793
+ {
3794
+
3795
+
3796
+ $input_type=$_POST[$key."_input_type".$id];
3797
+
3798
+ $mat_rows = $_POST[$key."_hidden_row".$id];
3799
+ $mat_rows = explode('***', $mat_rows);
3800
+ $mat_rows = array_slice($mat_rows,0, count($mat_rows)-1);
3801
+
3802
+ $mat_columns = $_POST[$key."_hidden_column".$id];
3803
+ $mat_columns = explode('***', $mat_columns);
3804
+ $mat_columns = array_slice($mat_columns,0, count($mat_columns)-1);
3805
+
3806
+ $row_ids=explode(",",substr($_POST[$key."_row_ids".$id], 0, -1));
3807
+ $column_ids=explode(",",substr($_POST[$key."_column_ids".$id], 0, -1));
3808
+
3809
+
3810
+ $matrix="<table>";
3811
+
3812
+ $matrix .='<tr><td></td>';
3813
+
3814
+ for( $k=0;$k< count($mat_columns) ;$k++)
3815
+ $matrix .='<td style="background-color:#BBBBBB; padding:5px; ">'.$mat_columns[$k].'</td>';
3816
+ $matrix .='</tr>';
3817
+
3818
+ $aaa=Array();
3819
+ $k=0;
3820
+ foreach($row_ids as $row_id)
3821
+ {
3822
+ $matrix .='<tr><td style="background-color:#BBBBBB; padding:5px;">'.$mat_rows[$k].'</td>';
3823
+
3824
+ if($input_type=="radio"){
3825
+
3826
+ $mat_radio = (isset($_POST[$key."_input_element".$id.$row_id]) ? $_POST[$key."_input_element".$id.$row_id] : 0);
3827
+ if($mat_radio==0){
3828
+ $checked="";
3829
+ $aaa[1]="";
3830
+ }
3831
+ else{
3832
+ $aaa=explode("_",$mat_radio);
3833
+ }
3834
+
3835
+ foreach($column_ids as $column_id){
3836
+ if($aaa[1]==$column_id)
3837
+ $checked="checked";
3838
+ else
3839
+ $checked="";
3840
+ $matrix .='<td style="text-align:center"><input type="radio" '.$checked.' disabled /></td>';
3841
+
3842
+ }
3843
+
3844
+ }
3845
+ else{
3846
+ if($input_type=="checkbox")
3847
+ {
3848
+ foreach($column_ids as $column_id){
3849
+ $checked = $_POST[$key."_input_element".$id.$row_id.'_'.$column_id];
3850
+ if($checked==1)
3851
+ $checked = "checked";
3852
+ else
3853
+ $checked = "";
3854
 
3855
+ $matrix .='<td style="text-align:center"><input type="checkbox" '.$checked.' disabled /></td>';
3856
+
3857
+ }
3858
+
3859
+ }
3860
+ else
3861
+ {
3862
+ if($input_type=="text")
3863
+ {
3864
+
3865
+ foreach($column_ids as $column_id){
3866
+ $checked = $_POST[$key."_input_element".$id.$row_id.'_'.$column_id];
3867
+
3868
+ $matrix .='<td style="text-align:center"><input type="text" value="'.$checked.'" disabled /></td>';
3869
+
3870
+ }
3871
+
3872
+ }
3873
+ else{
3874
+ foreach($column_ids as $column_id){
3875
+ $checked = $_POST[$i."_select_yes_no".$id.$row_id.'_'.$column_id];
3876
+ $matrix .='<td style="text-align:center">'.$checked.'</td>';
3877
+
3878
+
3879
+
3880
+ }
3881
+ }
3882
+
3883
+ }
3884
+
3885
+ }
3886
+ $matrix .='</tr>';
3887
+ $k++;
3888
+ }
3889
+ $matrix .='</table>';
3890
+
3891
+
3892
+
3893
+
3894
+
3895
+ if(isset($matrix))
3896
+ {
3897
+ $new_value=$new_value.$matrix;
3898
+ }
3899
+
3900
+ break;
3901
+ }
3902
+ default: break;
3903
+ }
3904
+ $new_script = str_replace("%".$label_each."%", $new_value, $new_script);
3905
+ }
3906
+ }
3907
+ }
3908
+ if (strpos($new_script, "%all%") !== FALSE) {
3909
+ $new_script = str_replace("%all%", $list, $new_script);
3910
+ }
3911
+ $body = $new_script;
3912
+ $send = wp_mail(str_replace(' ', '', $recipient), $subject, stripslashes($body), $headers, $attachment);
3913
+ }
3914
+ }
3915
+ if ($row->mail) {
3916
+ if ($send != TRUE) {
3917
+ $_SESSION['error_or_no' . $id] = 1;
3918
+ $msg = addslashes(__('Error, email was not sent.', 'form_maker'));
3919
+ }
3920
+ else {
3921
+ $_SESSION['error_or_no' . $id] = 0;
3922
+ $msg = addslashes(__('Your form was successfully submitted.', 'form_maker'));
3923
+ }
3924
+ }
3925
+ else {
3926
+ $_SESSION['error_or_no' . $id] = 0;
3927
+ $msg = addslashes(__('Your form was successfully submitted.', 'form_maker'));
3928
+ }
3929
+ }
3930
+ $https = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://');
3931
+ switch ($row->submit_text_type) {
3932
+ case "2":
3933
+ case "5": {
3934
+ if ($row->submit_text_type != 4) {
3935
+ $_SESSION['massage_after_submit' . $id] = $msg;
3936
+ }
3937
+ $_SESSION['form_submit_type' . $id] = $row->submit_text_type . "," . $row->id;
3938
+ if ($row->article_id) {
3939
+ $redirect_url = $row->article_id;
3940
+ }
3941
+ else {
3942
+ $redirect_url = $https . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
3943
+ }
3944
+ break;
3945
+ }
3946
+ case "3": {
3947
+ if ($row->submit_text_type != 4) {
3948
+ $_SESSION['massage_after_submit' . $id] = $msg;
3949
+ }
3950
+ $_SESSION['form_submit_type' . $id] = $row->submit_text_type . "," . $row->id;
3951
+ $redirect_url = $https . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
3952
+ break;
3953
+ }
3954
+ case "4": {
3955
+ if ($row->submit_text_type != 4) {
3956
+ $_SESSION['massage_after_submit' . $id] = $msg;
3957
+ }
3958
+ $_SESSION['form_submit_type' . $id] = $row->submit_text_type . "," . $row->id;
3959
+ $redirect_url = $row->url;
3960
+ break;
3961
+ }
3962
+ default: {
3963
+ if ($row->submit_text_type != 4) {
3964
+ $_SESSION['massage_after_submit' . $id] = $msg;
3965
+ }
3966
+ $_SESSION['form_submit_type' . $id] = $row->submit_text_type . "," . $row->id;
3967
+ $redirect_url = $https . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
3968
+ break;
3969
+ }
3970
+ }
3971
+ if (!$str) {
3972
+ wp_redirect($redirect_url);
3973
+ exit;
3974
+ }
3975
+ else {
3976
+ $_SESSION['redirect_paypal'.$id] = 1;
3977
+
3978
+ $str .= "&return=" . urlencode($redirect_url);
3979
+ wp_redirect($str);
3980
+ exit;
3981
+ }
3982
+ }
3983
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3984
  function custom_fields_mail($type, $key, $id, $attachment)
3985
  {
3986
  $new_value ="";
4379
  return $new_value;
4380
  }
4381
 
4382
+ public function empty_field($element, $mail_emptyfields) {
4383
+ if(!$mail_emptyfields)
4384
+ if(empty($element))
4385
+ return 0;
4386
+
4387
+ return 1;
4388
+ }
4389
  ////////////////////////////////////////////////////////////////////////////////////////
4390
  // Getters & Setters //
4391
  ////////////////////////////////////////////////////////////////////////////////////////
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://web-dorado.com/products/wordpress-form.html
4
  Tags: form, forms, form builder, form maker, form manager, form plugin, form with recaptcha, forms plugin, multiple forms, paypal form, survey form, feedback form, feedback forms, contact form,contact form plugin, contact form builder, form creator, email form, secure form, web form, form to email, contact forms, custom forms, form widget, captcha form, wordpress contact form ,recaptcha contact form, form creation, contact form with auto reply, widget contact form, builder, feedback, contacts form plugin , custom contact form, contact us form, formular, formulario, admin, captcha, contact, database, email, javascript, jquery, page, plugin, survey, widget, custom form, forms creator, input, validation, send copy, form with captcha
5
  Requires at least: 3.4
6
  Tested up to: 4.1
7
- Stable tag: 1.7.34
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -277,6 +277,9 @@ The Form Maker (Pro version) has simple PayPal integration. This allows the user
277
 
278
  == Changelog ==
279
 
 
 
 
280
  = 1.7.34 =
281
  New: Validation (Regular Exp.)
282
  Fixed: Select field duplication
4
  Tags: form, forms, form builder, form maker, form manager, form plugin, form with recaptcha, forms plugin, multiple forms, paypal form, survey form, feedback form, feedback forms, contact form,contact form plugin, contact form builder, form creator, email form, secure form, web form, form to email, contact forms, custom forms, form widget, captcha form, wordpress contact form ,recaptcha contact form, form creation, contact form with auto reply, widget contact form, builder, feedback, contacts form plugin , custom contact form, contact us form, formular, formulario, admin, captcha, contact, database, email, javascript, jquery, page, plugin, survey, widget, custom form, forms creator, input, validation, send copy, form with captcha
5
  Requires at least: 3.4
6
  Tested up to: 4.1
7
+ Stable tag: 1.7.35
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
277
 
278
  == Changelog ==
279
 
280
+ = 1.7.35 =
281
+ New: Email empty fields option
282
+
283
  = 1.7.34 =
284
  New: Validation (Regular Exp.)
285
  Fixed: Select field duplication