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

Version Description

  • Improved: CSV, XML export.
  • Improved: default email design
  • Improved: Minor improvements in email options
  • Fixed: PHP validation for email.
  • Fixed: Preserve the list of columns displayed when changing the page.
  • Fixed: Do not display ScrollBox form after Successful submission.
Download this release

Release Info

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

Code changes from version 1.12.29 to 1.12.31

Files changed (72) hide show
  1. admin/controllers/Addons_fm.php +1 -0
  2. admin/controllers/Blocked_ips_fm.php +26 -8
  3. admin/controllers/FMShortocde.php +5 -2
  4. admin/controllers/FormMakerSQLMapping.php +10 -4
  5. admin/controllers/FormMakerSubmits.php +1 -0
  6. admin/controllers/Generete_csv.php +92 -91
  7. admin/controllers/Generete_xml.php +53 -40
  8. admin/controllers/Manage_fm.php +77 -51
  9. admin/controllers/Options_fm.php +1 -0
  10. admin/controllers/Pricing_fm.php +5 -5
  11. admin/controllers/Select_data_from_db.php +3 -3
  12. admin/controllers/Submissions_fm.php +17 -14
  13. admin/controllers/Themes_fm.php +30 -18
  14. admin/controllers/Widget.php +21 -4
  15. admin/models/Blocked_ips_fm.php +11 -9
  16. admin/models/Checkpaypal.php +6 -9
  17. admin/models/FMPaypalInfo.php +1 -2
  18. admin/models/FMSelectDataFromDb.php +4 -4
  19. admin/models/FMShortocde.php +1 -0
  20. admin/models/FMSqlMapping.php +3 -4
  21. admin/models/FormMakerSubmits.php +15 -2
  22. admin/models/Manage_fm.php +148 -49
  23. admin/models/Options_fm.php +4 -1
  24. admin/models/Submissions_fm.php +217 -49
  25. admin/models/Themes_fm.php +18 -14
  26. admin/models/Uninstall_fm.php +2 -1
  27. admin/views/Addons_fm.php +6 -1
  28. admin/views/Blocked_ips_fm.php +5 -3
  29. admin/views/Checkpaypal.php +1 -2
  30. admin/views/FMCaptcha.php +2 -2
  31. admin/views/FMEditCountryinPopup.php +2 -1
  32. admin/views/FMIpinfoinPopup.php +1 -1
  33. admin/views/FMMapEditinPopup.php +1 -1
  34. admin/views/FMMathCaptcha.php +15 -3
  35. admin/views/FMPaypalInfo.php +17 -17
  36. admin/views/FMProductOption.php +1 -1
  37. admin/views/FMSelectDataFromDb.php +3 -3
  38. admin/views/FMShortocde.php +2 -2
  39. admin/views/FMShowMatrix.php +1 -1
  40. admin/views/FMSqlMapping.php +25 -4
  41. admin/views/FormMakerSubmits.php +7 -1
  42. admin/views/Manage_fm.php +125 -87
  43. admin/views/Options_fm.php +10 -2
  44. admin/views/Pricing_fm.php +7 -1
  45. admin/views/Submissions_fm.php +244 -192
  46. admin/views/Themes_fm.php +6 -4
  47. admin/views/Uninstall_fm.php +18 -5
  48. admin/views/Widget.php +19 -3
  49. admin/views/view.php +10 -4
  50. css/form_maker_tables.css +28 -7
  51. css/style.css +20 -16
  52. css/style_submissions.css +4 -0
  53. form-maker.php +37 -12
  54. form_maker_insert.php +8 -6
  55. form_maker_update.php +5 -0
  56. framework/WDW_FM_Library.php +159 -60
  57. frontend/controllers/form_maker.php +24 -10
  58. frontend/models/form_maker.php +229 -197
  59. frontend/models/verify_email.php +4 -4
  60. frontend/views/form_maker.php +285 -101
  61. frontend/views/verify_email.php +2 -2
  62. js/add_field.js +27 -27
  63. js/form_maker_admin.js +77 -3
  64. js/form_maker_form_options.js +4 -4
  65. js/form_maker_manage.js +42 -9
  66. js/form_maker_submissions.js +135 -9
  67. js/frontend/.gitignore +0 -0
  68. js/main_div_front_end.js +1 -1
  69. readme.txt +15 -5
  70. wd/assets/css/img/close.svg +16 -0
  71. wd/assets/js/deactivate_popup.js +112 -124
  72. wd/templates/display_deactivation_popup.php +2 -2
admin/controllers/Addons_fm.php CHANGED
@@ -3,6 +3,7 @@
3
  * Class FMControllerAddons_fm
4
  */
5
  class FMControllerAddons_fm extends FMAdminController {
 
6
  /**
7
  * @var $model
8
  */
3
  * Class FMControllerAddons_fm
4
  */
5
  class FMControllerAddons_fm extends FMAdminController {
6
+
7
  /**
8
  * @var $model
9
  */
admin/controllers/Blocked_ips_fm.php CHANGED
@@ -73,9 +73,9 @@ class FMControllerBlocked_ips_fm extends FMAdminController {
73
  /**
74
  * Bulk actions.
75
  *
76
- * @param $task
77
  */
78
- public function bulk_action($task) {
79
  $message = 0;
80
  $successfully_updated = 0;
81
  $check = WDW_FM_Library(self::PLUGIN)->get('check', '');
@@ -101,6 +101,9 @@ class FMControllerBlocked_ips_fm extends FMAdminController {
101
  ), admin_url('admin.php')));
102
  }
103
 
 
 
 
104
  public function insert_blocked_ip() {
105
 
106
  $page = WDW_FM_Library(self::PLUGIN)->get('page');
@@ -118,7 +121,12 @@ class FMControllerBlocked_ips_fm extends FMAdminController {
118
  }
119
  }
120
 
121
- public function delete_blocked_ip( $id ) {
 
 
 
 
 
122
  $page = WDW_FM_Library(self::PLUGIN)->get('page');
123
  // check id for db
124
  if(isset($id) && $id != "") {
@@ -149,11 +157,14 @@ class FMControllerBlocked_ips_fm extends FMAdminController {
149
 
150
  echo '<div id="total_for_paging">'.$total/$this->items_per_page.'</div>'; // send to JS page number
151
  }
152
-
153
-
154
  }
155
 
156
- public function update_blocked_ip( $id ) {
 
 
 
 
 
157
  $page = WDW_FM_Library(self::PLUGIN)->get('page');
158
 
159
  // check id for db
@@ -180,10 +191,17 @@ class FMControllerBlocked_ips_fm extends FMAdminController {
180
  'message' => $message,
181
  ), admin_url('admin.php')));
182
  }
183
-
184
  }
185
 
186
- public function delete( $id, $bulk = FALSE ) {
 
 
 
 
 
 
 
 
187
  if ( $this->model->delete_data($id) ) {
188
  $message = 3;
189
  }
73
  /**
74
  * Bulk actions.
75
  *
76
+ * @param string $task
77
  */
78
+ public function bulk_action( $task = '' ) {
79
  $message = 0;
80
  $successfully_updated = 0;
81
  $check = WDW_FM_Library(self::PLUGIN)->get('check', '');
101
  ), admin_url('admin.php')));
102
  }
103
 
104
+ /**
105
+ * Insert blocked ip
106
+ */
107
  public function insert_blocked_ip() {
108
 
109
  $page = WDW_FM_Library(self::PLUGIN)->get('page');
121
  }
122
  }
123
 
124
+ /**
125
+ * Delete blocked ip.
126
+ *
127
+ * @param int $id
128
+ */
129
+ public function delete_blocked_ip( $id = 0 ) {
130
  $page = WDW_FM_Library(self::PLUGIN)->get('page');
131
  // check id for db
132
  if(isset($id) && $id != "") {
157
 
158
  echo '<div id="total_for_paging">'.$total/$this->items_per_page.'</div>'; // send to JS page number
159
  }
 
 
160
  }
161
 
162
+ /**
163
+ * Update blocked ip.
164
+ *
165
+ * @param int $id
166
+ */
167
+ public function update_blocked_ip( $id = 0 ) {
168
  $page = WDW_FM_Library(self::PLUGIN)->get('page');
169
 
170
  // check id for db
191
  'message' => $message,
192
  ), admin_url('admin.php')));
193
  }
 
194
  }
195
 
196
+ /**
197
+ *
198
+ * Delete.
199
+ *
200
+ * @param int $id
201
+ * @param bool $bulk
202
+ * @return int
203
+ */
204
+ public function delete( $id = 0, $bulk = FALSE ) {
205
  if ( $this->model->delete_data($id) ) {
206
  $message = 3;
207
  }
admin/controllers/FMShortocde.php CHANGED
@@ -4,6 +4,7 @@
4
  * Class FMControllerFMShortocde
5
  */
6
  class FMControllerFMShortocde extends FMAdminController {
 
7
  private $model;
8
  private $view;
9
 
@@ -28,8 +29,10 @@ class FMControllerFMShortocde extends FMAdminController {
28
 
29
  /**
30
  * Display.
 
 
31
  */
32
- public function display($task) {
33
  // Get forms.
34
  $forms = $this->model->get_form_data();
35
 
@@ -37,7 +40,7 @@ class FMControllerFMShortocde extends FMAdminController {
37
  $this->view->$task($forms);
38
  }
39
  else {
40
- $this->view->form($forms);
41
  }
42
  }
43
  }
4
  * Class FMControllerFMShortocde
5
  */
6
  class FMControllerFMShortocde extends FMAdminController {
7
+
8
  private $model;
9
  private $view;
10
 
29
 
30
  /**
31
  * Display.
32
+ *
33
+ * @param string $task
34
  */
35
+ public function display( $task = '' ) {
36
  // Get forms.
37
  $forms = $this->model->get_form_data();
38
 
40
  $this->view->$task($forms);
41
  }
42
  else {
43
+ $this->view->forms($forms);
44
  }
45
  }
46
  }
admin/controllers/FormMakerSQLMapping.php CHANGED
@@ -50,7 +50,7 @@ class FMControllerFormMakerSQLMapping extends FMAdminController {
50
  *
51
  * @param int $form_id
52
  */
53
- public function add_query( $form_id ) {
54
  // Get labels by form id.
55
  $label = $this->model->get_labels($form_id);
56
  // Set params for view.
@@ -66,7 +66,7 @@ class FMControllerFormMakerSQLMapping extends FMAdminController {
66
  * @param int $id
67
  * @param int $form_id
68
  */
69
- public function edit_query( $id, $form_id ) {
70
  // Get labels by form id.
71
  $label = $this->model->get_labels($form_id);
72
  // Get query by id.
@@ -106,7 +106,7 @@ class FMControllerFormMakerSQLMapping extends FMAdminController {
106
  *
107
  * @param int $form_id
108
  */
109
- public function db_tables( $form_id ) {
110
  // Get all tables.
111
  $tables = $this->model->get_tables();
112
  // Set params for view.
@@ -121,7 +121,7 @@ class FMControllerFormMakerSQLMapping extends FMAdminController {
121
  *
122
  * @param int $form_id
123
  */
124
- public function db_table_struct( $form_id ) {
125
  $con_method = WDW_FM_Library(self::PLUGIN)->get('con_method', '');
126
  // Get labels by form id.
127
  $label = $this->model->get_labels($form_id);
@@ -136,6 +136,9 @@ class FMControllerFormMakerSQLMapping extends FMAdminController {
136
  $this->view->db_table_struct($params);
137
  }
138
 
 
 
 
139
  public function save_query() {
140
  global $wpdb;
141
  $form_id = ((isset($_GET['form_id'])) ? (int) $_GET['form_id'] : 0);
@@ -152,6 +155,9 @@ class FMControllerFormMakerSQLMapping extends FMAdminController {
152
  ));
153
  }
154
 
 
 
 
155
  public function update_query() {
156
  global $wpdb;
157
  $id = ((isset($_GET['id'])) ? (int) $_GET['id'] : 0);
50
  *
51
  * @param int $form_id
52
  */
53
+ public function add_query( $form_id = 0 ) {
54
  // Get labels by form id.
55
  $label = $this->model->get_labels($form_id);
56
  // Set params for view.
66
  * @param int $id
67
  * @param int $form_id
68
  */
69
+ public function edit_query( $id = 0, $form_id = 0 ) {
70
  // Get labels by form id.
71
  $label = $this->model->get_labels($form_id);
72
  // Get query by id.
106
  *
107
  * @param int $form_id
108
  */
109
+ public function db_tables( $form_id = 0 ) {
110
  // Get all tables.
111
  $tables = $this->model->get_tables();
112
  // Set params for view.
121
  *
122
  * @param int $form_id
123
  */
124
+ public function db_table_struct( $form_id = 0 ) {
125
  $con_method = WDW_FM_Library(self::PLUGIN)->get('con_method', '');
126
  // Get labels by form id.
127
  $label = $this->model->get_labels($form_id);
136
  $this->view->db_table_struct($params);
137
  }
138
 
139
+ /**
140
+ * Save query.
141
+ */
142
  public function save_query() {
143
  global $wpdb;
144
  $form_id = ((isset($_GET['form_id'])) ? (int) $_GET['form_id'] : 0);
155
  ));
156
  }
157
 
158
+ /**
159
+ * Update query.
160
+ */
161
  public function update_query() {
162
  global $wpdb;
163
  $id = ((isset($_GET['id'])) ? (int) $_GET['id'] : 0);
admin/controllers/FormMakerSubmits.php CHANGED
@@ -4,6 +4,7 @@
4
  * Class FMControllerFormMakerSubmits
5
  */
6
  class FMControllerFormMakerSubmits extends FMAdminController {
 
7
  private $model;
8
  private $view;
9
 
4
  * Class FMControllerFormMakerSubmits
5
  */
6
  class FMControllerFormMakerSubmits extends FMAdminController {
7
+
8
  private $model;
9
  private $view;
10
 
admin/controllers/Generete_csv.php CHANGED
@@ -4,115 +4,116 @@
4
  * Class FMControllerGenerete_csv
5
  */
6
  class FMControllerGenerete_csv extends FMAdminController {
 
7
  /**
8
  * Execute.
9
  */
10
  public function execute() {
11
- $this->display();
 
12
  }
13
 
14
  /**
15
- * display.
16
  */
17
  public function display() {
18
  // Get form maker settings
19
- $fm_settings = get_option(WDFMInstance(self::PLUGIN)->is_free == 2 ? 'fmc_settings' : 'fm_settings');
 
 
 
 
 
 
 
20
  $csv_delimiter = isset($fm_settings['csv_delimiter']) ? $fm_settings['csv_delimiter'] : ',';
21
  $form_id = (int) $_REQUEST['form_id'];
22
  $limitstart = (int) $_REQUEST['limitstart'];
23
  $send_header = (int) $_REQUEST['send_header'];
24
  $params = WDW_FM_Library(self::PLUGIN)->get_submissions_to_export();
25
- $data = $params[0];
26
- $title = $params[1];
27
-
28
- $labels_parameters = WDW_FM_Library(self::PLUGIN)->get_labels_parameters( $form_id );
29
-
30
- $sorted_label_names_original = $labels_parameters[4];
31
- $sorted_label_names_original = array_merge(array(
32
- 'ID',
33
- "Submit date",
34
- "Submitter's IP",
35
- "Submitter's Username",
36
- "Submitter's Email Address",
37
- ), $sorted_label_names_original);
38
-
39
- if (($key = array_search('stripe', $sorted_label_names_original)) !== false) {
40
- unset($sorted_label_names_original[$key]);
41
- }
42
-
43
- $sorted_label_names = array();
44
- function unique_label($sorted_label_names, $label) {
45
- if ( in_array($label, $sorted_label_names) ) {
46
- return unique_label($sorted_label_names, $label . '(1)');
47
- }
48
- else {
49
- return $label;
50
- }
51
- }
52
- foreach ( $sorted_label_names_original as $key => $label ) {
53
- $sorted_label_names[] = unique_label($sorted_label_names, $label);
54
- }
55
-
56
- foreach ( $data as $key => $row ) {
57
- $sorted_data = array();
58
- foreach ( $sorted_label_names as $label ) {
59
- if ( !array_key_exists($label, $row) ) {
60
- $sorted_data[$label] = '';
61
- }
62
- else {
63
- $sorted_data[$label] = $row[$label];
64
- }
65
- }
66
 
67
- $data[$key] = $sorted_data;
68
- }
69
-
70
-
71
- foreach ( $sorted_label_names as $label ) {
72
- if ( !array_key_exists($label, $row) ) {
73
- $row[$label] = '';
74
- }
75
- }
76
-
77
- $upload_dir = wp_upload_dir();
78
- $file_path = $upload_dir['basedir'] . '/form-maker';
79
- if ( !is_dir($file_path) ) {
80
- mkdir($file_path, 0777);
81
- }
82
- $tempfile = $file_path . '/export' . $form_id . '.txt';
83
- if ( $limitstart == 0 && file_exists($tempfile) ) {
84
- unlink($tempfile);
85
- }
86
- $output = fopen($tempfile, "a");
87
 
88
- if ( $limitstart == 0 ) {
89
- foreach ($sorted_label_names_original as $i => $rec) {
90
- $sorted_label_names_original[$i] = ltrim($rec, '=+-@');
91
- }
92
- fputcsv($output, $sorted_label_names_original, $csv_delimiter);
93
- }
94
- foreach ( $data as $record ) {
95
- foreach ($record as $i => $rec) {
96
- $record[$i] = ltrim($rec, '=+-@');
97
- }
98
- fputcsv($output, $record, $csv_delimiter);
99
- }
100
 
101
- fclose($output);
 
 
 
 
 
 
 
 
 
 
 
102
 
103
- if ( $send_header == 1 ) {
104
- $txtfile = fopen($tempfile, "r");
105
- $txtfilecontent = fread($txtfile, filesize($tempfile));
106
- fclose($txtfile);
107
- $filename = $title . "_" . date('Ymd') . ".csv";
108
- header('Content-Encoding: UTF-8');
109
- header('content-type: application/csv; charset=UTF-8');
110
- header("Content-Disposition: attachment; filename=\"$filename\"");
111
- // Set UTF-8 BOM
112
- echo "\xEF\xBB\xBF";
113
- echo $txtfilecontent;
114
- unlink($tempfile);
115
- }
116
- die();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
  }
118
  }
4
  * Class FMControllerGenerete_csv
5
  */
6
  class FMControllerGenerete_csv extends FMAdminController {
7
+
8
  /**
9
  * Execute.
10
  */
11
  public function execute() {
12
+ $this->display();
13
+ die();
14
  }
15
 
16
  /**
17
+ * Display.
18
  */
19
  public function display() {
20
  // Get form maker settings
21
+ $option_key = WDFMInstance(self::PLUGIN)->is_free == 2 ? 'fmc_settings' : 'fm_settings';
22
+ $fm_settings = get_option($option_key);
23
+ // Update export per_page.
24
+ $page_num_update = WDW_FM_Library(self::PLUGIN)->get('page_num_update');
25
+ if ( $page_num_update ) {
26
+ $fm_settings['ajax_export_per_page'] = WDW_FM_Library(self::PLUGIN)->get('page_num');
27
+ update_option( $option_key, $fm_settings );
28
+ }
29
  $csv_delimiter = isset($fm_settings['csv_delimiter']) ? $fm_settings['csv_delimiter'] : ',';
30
  $form_id = (int) $_REQUEST['form_id'];
31
  $limitstart = (int) $_REQUEST['limitstart'];
32
  $send_header = (int) $_REQUEST['send_header'];
33
  $params = WDW_FM_Library(self::PLUGIN)->get_submissions_to_export();
34
+ if ( !empty($params) ) {
35
+ $data = $params[0];
36
+ $title = $params[1];
37
+ if ( !empty( $data ) ) {
38
+ $labels_parameters = WDW_FM_Library(self::PLUGIN)->get_labels_parameters( $form_id );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
 
40
+ $sorted_label_names_original = $labels_parameters[4];
41
+ $sorted_label_names_original = array_merge(array(
42
+ 'ID',
43
+ "Submit date",
44
+ "Submitter's IP",
45
+ "Submitter's Username",
46
+ "Submitter's Email Address",
47
+ ), $sorted_label_names_original);
 
 
 
 
 
 
 
 
 
 
 
 
48
 
49
+ if (($key = array_search('stripe', $sorted_label_names_original)) !== false) {
50
+ unset($sorted_label_names_original[$key]);
51
+ }
 
 
 
 
 
 
 
 
 
52
 
53
+ $sorted_label_names = array();
54
+ function unique_label($sorted_label_names, $label) {
55
+ if ( in_array($label, $sorted_label_names) ) {
56
+ return unique_label($sorted_label_names, $label . '(1)');
57
+ }
58
+ else {
59
+ return $label;
60
+ }
61
+ }
62
+ foreach ( $sorted_label_names_original as $key => $label ) {
63
+ $sorted_label_names[] = unique_label($sorted_label_names, $label);
64
+ }
65
 
66
+ foreach ( $data as $key => $row ) {
67
+ $sorted_data = array();
68
+ foreach ( $sorted_label_names as $label ) {
69
+ if ( !array_key_exists($label, $row) ) {
70
+ $sorted_data[$label] = '';
71
+ }
72
+ else {
73
+ $sorted_data[$label] = $row[$label];
74
+ }
75
+ }
76
+ $data[$key] = $sorted_data;
77
+ }
78
+ $upload_dir = wp_upload_dir();
79
+ $file_path = $upload_dir['basedir'] . '/form-maker';
80
+ if ( !is_dir($file_path) ) {
81
+ mkdir($file_path, 0777);
82
+ }
83
+ $tempfile = $file_path . '/export' . $form_id . '.txt';
84
+ if ( $limitstart == 0 && file_exists($tempfile) ) {
85
+ unlink($tempfile);
86
+ }
87
+ $output = fopen($tempfile, "a");
88
+ if ( $limitstart == 0 ) {
89
+ foreach ($sorted_label_names_original as $i => $rec) {
90
+ $sorted_label_names_original[$i] = ltrim($rec, '=+-@');
91
+ }
92
+ fputcsv($output, $sorted_label_names_original, $csv_delimiter);
93
+ }
94
+ foreach ( $data as $index => $record ) {
95
+ foreach ( $record as $i => $rec ) {
96
+ $record[$i] = ltrim($rec, '=+-@');
97
+ }
98
+ if ( !empty($index) ) {
99
+ fputcsv($output, $record, $csv_delimiter);
100
+ }
101
+ }
102
+ fclose($output);
103
+ if ( $send_header == 1 ) {
104
+ $txtfile = fopen($tempfile, "r");
105
+ $txtfilecontent = fread($txtfile, filesize($tempfile));
106
+ fclose($txtfile);
107
+ $filename = $title . "_" . date('Ymd') . ".csv";
108
+ header('Content-Encoding: UTF-8');
109
+ header('content-type: application/csv; charset=UTF-8');
110
+ header("Content-Disposition: attachment; filename=\"$filename\"");
111
+ // Set UTF-8 BOM
112
+ echo "\xEF\xBB\xBF";
113
+ echo $txtfilecontent;
114
+ unlink($tempfile);
115
+ }
116
+ }
117
+ }
118
  }
119
  }
admin/controllers/Generete_xml.php CHANGED
@@ -4,58 +4,71 @@
4
  * Class FMControllerGenerete_xml
5
  */
6
  class FMControllerGenerete_xml extends FMAdminController {
 
7
  /**
8
  * Execute.
9
  */
10
  public function execute() {
11
  $this->display();
 
12
  }
13
 
14
  public function display() {
 
 
 
 
 
 
 
 
 
15
  $form_id = (int) $_REQUEST['form_id'];
16
  $limitstart = (int) $_REQUEST['limitstart'];
17
  $send_header = (int) $_REQUEST['send_header'];
18
  $params = WDW_FM_Library(self::PLUGIN)->get_submissions_to_export();
19
- $data = $params[0];
20
- $title = $params[1];
21
- define('PHP_TAB', "\t");
22
- $upload_dir = wp_upload_dir();
23
- $file_path = $upload_dir['basedir'] . '/form-maker';
24
- if ( !is_dir($file_path) ) {
25
- mkdir($file_path, 0777);
26
- }
27
- $tempfile = $file_path . '/export' . $form_id . '.txt';
28
- if ( $limitstart == 0 && file_exists($tempfile) ) {
29
- unlink($tempfile);
30
- }
31
- $output = fopen($tempfile, "a");
32
- if ( $limitstart == 0 ) {
33
- fwrite($output, '<?xml version="1.0" encoding="utf-8" ?>' . PHP_EOL);
34
- fwrite($output, '<form title="' . $title . '">' . PHP_EOL);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  }
36
- foreach ( $data as $key1 => $value1 ) {
37
- fwrite($output, PHP_TAB . '<submission id="' . $key1 . '">' . PHP_EOL);
38
- foreach ( $value1 as $key => $value ) {
39
- fwrite($output, PHP_TAB . PHP_TAB . '<field title="' . $key . '">' . PHP_EOL);
40
- fwrite($output, PHP_TAB . PHP_TAB . PHP_TAB . '<![CDATA[' . $value . ']]>' . PHP_EOL);
41
- fwrite($output, PHP_TAB . PHP_TAB . '</field>' . PHP_EOL);
42
- }
43
- fwrite($output, PHP_TAB . '</submission>' . PHP_EOL);
44
- }
45
- if ( $send_header == 1 ) {
46
- fwrite($output, '</form>');
47
- fclose($output);
48
- $txtfile = fopen($tempfile, "r");
49
- $txtfilecontent = fread($txtfile, filesize($tempfile));
50
- fclose($txtfile);
51
- $filename = $title . "_" . date('Ymd') . ".xml";
52
- header('Content-Encoding: Windows-1252');
53
- header('Content-type: text/xml; charset=utf-8');
54
- header("Content-Disposition: attachment; filename=\"$filename\"");
55
- echo $txtfilecontent;
56
- unlink($tempfile);
57
- }
58
-
59
- die();
60
  }
61
  }
4
  * Class FMControllerGenerete_xml
5
  */
6
  class FMControllerGenerete_xml extends FMAdminController {
7
+
8
  /**
9
  * Execute.
10
  */
11
  public function execute() {
12
  $this->display();
13
+ die();
14
  }
15
 
16
  public function display() {
17
+ // Get form maker settings
18
+ $option_key = WDFMInstance(self::PLUGIN)->is_free == 2 ? 'fmc_settings' : 'fm_settings';
19
+ $fm_settings = get_option($option_key);
20
+ // Update export per_page.
21
+ $page_num_update = WDW_FM_Library(self::PLUGIN)->get('page_num_update');
22
+ if ( $page_num_update ) {
23
+ $fm_settings['ajax_export_per_page'] = WDW_FM_Library(self::PLUGIN)->get('page_num');
24
+ update_option( $option_key, $fm_settings );
25
+ }
26
  $form_id = (int) $_REQUEST['form_id'];
27
  $limitstart = (int) $_REQUEST['limitstart'];
28
  $send_header = (int) $_REQUEST['send_header'];
29
  $params = WDW_FM_Library(self::PLUGIN)->get_submissions_to_export();
30
+ if (!empty($params) ) {
31
+ $data = $params[0];
32
+ $title = $params[1];
33
+ define('PHP_TAB', "\t");
34
+ $upload_dir = wp_upload_dir();
35
+ $file_path = $upload_dir['basedir'] . '/form-maker';
36
+ if ( !is_dir($file_path) ) {
37
+ mkdir($file_path, 0777);
38
+ }
39
+ $tempfile = $file_path . '/export' . $form_id . '.txt';
40
+ if ( $limitstart == 0 && file_exists($tempfile) ) {
41
+ unlink($tempfile);
42
+ }
43
+ $output = fopen($tempfile, "a");
44
+ if ( $limitstart == 0 ) {
45
+ fwrite($output, '<?xml version="1.0" encoding="utf-8" ?>' . PHP_EOL);
46
+ fwrite($output, '<form title="' . $title . '">' . PHP_EOL);
47
+ }
48
+ foreach ( $data as $key1 => $value1 ) {
49
+ if ( !empty($key1) ) {
50
+ fwrite($output, PHP_TAB . '<submission id="' . $key1 . '">' . PHP_EOL);
51
+ foreach ( $value1 as $key => $value ) {
52
+ fwrite($output, PHP_TAB . PHP_TAB . '<field title="' . $key . '">' . PHP_EOL);
53
+ fwrite($output, PHP_TAB . PHP_TAB . PHP_TAB . '<![CDATA[' . $value . ']]>' . PHP_EOL);
54
+ fwrite($output, PHP_TAB . PHP_TAB . '</field>' . PHP_EOL);
55
+ }
56
+ fwrite($output, PHP_TAB . '</submission>' . PHP_EOL);
57
+ }
58
+ }
59
+ if ( $send_header == 1 ) {
60
+ fwrite($output, '</form>');
61
+ fclose($output);
62
+ $txtfile = fopen($tempfile, "r");
63
+ $txtfilecontent = fread($txtfile, filesize($tempfile));
64
+ fclose($txtfile);
65
+ $filename = $title . "_" . date('Ymd') . ".xml";
66
+ header('Content-Encoding: Windows-1252');
67
+ header('Content-type: text/xml; charset=utf-8');
68
+ header("Content-Disposition: attachment; filename=\"$filename\"");
69
+ echo $txtfilecontent;
70
+ unlink($tempfile);
71
+ }
72
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  }
74
  }
admin/controllers/Manage_fm.php CHANGED
@@ -1,5 +1,6 @@
1
  <?php
2
  class FMControllerManage_fm extends FMAdminController {
 
3
  private $model;
4
  private $view;
5
  private $page;
@@ -132,9 +133,9 @@ class FMControllerManage_fm extends FMAdminController {
132
  /**
133
  * Bulk actions.
134
  *
135
- * @param $task
136
  */
137
- public function bulk_action($task) {
138
  $message = 0;
139
  $successfully_updated = 0;
140
 
@@ -167,12 +168,12 @@ class FMControllerManage_fm extends FMAdminController {
167
  /**
168
  * Delete form by id.
169
  *
170
- * @param $id
171
  * @param bool $bulk
172
  *
173
  * @return int
174
  */
175
- public function delete( $id, $bulk = FALSE ) {
176
  if ( $this->model->delete_rows(array( "table" => "formmaker", "where" => "id = " . $id )) ) {
177
  $this->model->delete_rows(array( "table" => "formmaker_views", "where" => "form_id = " . $id ));
178
  $this->model->delete_rows(array( "table" => "formmaker_submits", "where" => "form_id = " . $id ));
@@ -210,12 +211,12 @@ class FMControllerManage_fm extends FMAdminController {
210
  /**
211
  * Publish by id.
212
  *
213
- * @param $id
214
  * @param bool $bulk
215
  *
216
  * @return int
217
  */
218
- public function publish( $id, $bulk = FALSE ) {
219
  $updated = $this->model->update_data("formmaker", array('published' => 1), array('id' => $id));
220
  if ( $updated !== FALSE ) {
221
  $message = 9;
@@ -239,12 +240,12 @@ class FMControllerManage_fm extends FMAdminController {
239
  /**
240
  * Unpublish by id.
241
  *
242
- * @param $id
243
  * @param bool $bulk
244
  *
245
  * @return int
246
  */
247
- public function unpublish( $id, $bulk = FALSE ) {
248
  $updated = $this->model->update_data("formmaker", array('published' => 0), array('id' => $id));
249
  if ( $updated !== FALSE ) {
250
  $message = 10;
@@ -268,12 +269,12 @@ class FMControllerManage_fm extends FMAdminController {
268
  /**
269
  * Duplicate by id.
270
  *
271
- * @param $id
272
  * @param bool $bulk
273
  *
274
  * @return int
275
  */
276
- public function duplicate( $id, $bulk = FALSE ) {
277
  $message = 2;
278
  $row = $this->model->select_rows("get_row", array(
279
  "selection" => "*",
@@ -350,7 +351,13 @@ class FMControllerManage_fm extends FMAdminController {
350
  $this->view->edit($params);
351
  }
352
 
353
- public function edit($id = 0, $backup_id = 0) {
 
 
 
 
 
 
354
  $fm_settings = get_option(WDFMInstance(self::PLUGIN)->is_free == 2 ? 'fmc_settings' : 'fm_settings');
355
  $fm_advanced_layout = isset($fm_settings['fm_advanced_layout']) && $fm_settings['fm_advanced_layout'] == '1' ? 1 : 0;
356
  if ( $id && !$fm_advanced_layout ) {
@@ -453,7 +460,7 @@ class FMControllerManage_fm extends FMAdminController {
453
  *
454
  * @param int $id
455
  */
456
- public function form_options( $id ) {
457
  // Set params for view.
458
  $params = array();
459
  $params[ 'id' ] = $id;
@@ -578,10 +585,9 @@ class FMControllerManage_fm extends FMAdminController {
578
  * Get active addons.
579
  *
580
  * @param $params
581
- *
582
  * @return mixed|void
583
  */
584
- private function get_addon_tabs( $params ) {
585
  $addons = array('tabs' => array(), 'html' => array());
586
  if (WDFMInstance(self::PLUGIN)->is_free != 2) {
587
  $addons = apply_filters('fm_get_addon_init', $addons, $params);
@@ -594,7 +600,7 @@ class FMControllerManage_fm extends FMAdminController {
594
  *
595
  * @param int $id
596
  */
597
- public function apply_form_options( $id ) {
598
  $fieldset_id = WDW_FM_Library(self::PLUGIN)->get('fieldset_id', 'general');
599
  $message = $this->save_db_form_options( $id );
600
  WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
@@ -610,10 +616,9 @@ class FMControllerManage_fm extends FMAdminController {
610
  * Save db Form options.
611
  *
612
  * @param int $id
613
- *
614
  * @return int $id_message
615
  */
616
- public function save_db_form_options( $id ) {
617
  $javascript = "// Occurs before the form is loaded
618
  function before_load() {
619
 
@@ -633,15 +638,12 @@ function after_submit() {
633
 
634
  $published = stripslashes(WDW_FM_Library(self::PLUGIN)->get('published', ''));
635
  $savedb = stripslashes(WDW_FM_Library(self::PLUGIN)->get('savedb', ''));
636
- $theme = (int) WDW_FM_Library(self::PLUGIN)->get('theme', 0);
637
- $theme = ($theme) ? $theme : $this->model->get_default_theme_id();
638
  $requiredmark = stripslashes(WDW_FM_Library(self::PLUGIN)->get('requiredmark', '*'));
639
  $sendemail = stripslashes(WDW_FM_Library(self::PLUGIN)->get('sendemail', ''));
640
  $save_uploads = stripslashes(WDW_FM_Library(self::PLUGIN)->get('save_uploads', ''));
641
  $mail = stripslashes(WDW_FM_Library(self::PLUGIN)->get('mail', ''));
642
- if ( isset($_POST['mailToAdd']) && esc_html(stripslashes($_POST['mailToAdd'])) != '' ) {
643
- $mail .= esc_html(stripslashes($_POST['mailToAdd'])) . ',';
644
- }
645
  $from_mail = stripslashes(WDW_FM_Library(self::PLUGIN)->get('from_mail', ''));
646
  $from_name = stripslashes(WDW_FM_Library(self::PLUGIN)->get('from_name', ''));
647
  $reply_to = stripslashes(WDW_FM_Library(self::PLUGIN)->get('reply_to', ''));
@@ -716,6 +718,14 @@ function after_submit() {
716
  $article_id = 0;
717
  }
718
  $mail_verification_post_id = (int) $this->model->get_mail_verification_post_id();
 
 
 
 
 
 
 
 
719
  if ( $mail_verify ) {
720
  $email_verification_post = array(
721
  'post_title' => 'Email Verification',
@@ -729,7 +739,7 @@ function after_submit() {
729
  }
730
  }
731
 
732
- $data = array(
733
  'published' => $published,
734
  'savedb' => $savedb,
735
  'theme' => $theme,
@@ -774,9 +784,10 @@ function after_submit() {
774
  'mail_verify' => $mail_verify,
775
  'mail_verify_expiretime' => $mail_verify_expiretime,
776
  'mail_verification_post_id' => $mail_verification_post_id,
 
777
  );
778
 
779
- $message_id = 2;
780
  $save = $this->model->update_data('formmaker', $data, array( 'id' => $id ));
781
  if ( $save !== FALSE ) {
782
  $this->model->update_data("formmaker_backup", array(
@@ -786,25 +797,26 @@ function after_submit() {
786
  if (WDFMInstance(self::PLUGIN)->is_free != 2) {
787
  $save_addon = do_action('fm_save_addon_init', $id);
788
  }
789
- $message_id = 8;
790
- }
791
- return $message_id;
 
792
  }
793
-
794
  /**
795
  * Form layout.
796
  *
797
- * @param int $id
798
  */
799
- public function form_layout( $id ) {
800
  $ids = array();
801
  $types = array();
802
  $labels = array();
803
-
804
  $row = $this->model->get_row_data( $id );
805
- if ( empty($row) ) {
806
- WDW_FM_Library(self::PLUGIN)->fm_redirect( add_query_arg( array('page' => $this->page, 'task' => 'display'), admin_url('admin.php') ) );
807
- }
808
  $fields = explode('*:*new_field*:*', $row->form_fields);
809
  $fields = array_slice($fields, 0, count($fields) - 1);
810
  foreach ( $fields as $field ) {
@@ -815,7 +827,7 @@ function after_submit() {
815
  $temp = explode('*:*w_field_label*:*', $temp[1]);
816
  array_push($labels, $temp[0]);
817
  }
818
-
819
  // Set params for view.
820
  $params = array();
821
  $params['id'] = $id;
@@ -830,8 +842,13 @@ function after_submit() {
830
  $this->view->form_layout($params);
831
  }
832
 
833
- public function apply_layout( $id ) {
834
- $message = $this->save_db_layout( $id );
 
 
 
 
 
835
  WDW_FM_Library(self::PLUGIN)->fm_redirect( add_query_arg( array('page' => $this->page, 'task' => 'form_layout', 'current_id' => $id, 'message' => $message), admin_url('admin.php') ) );
836
  }
837
 
@@ -839,10 +856,9 @@ function after_submit() {
839
  * Save db layout.
840
  *
841
  * @param int $id
842
- *
843
  * @return int $id_message
844
  */
845
- public function save_db_layout( $id ) {
846
  $custom_front = WDW_FM_Library(self::PLUGIN)->get('custom_front', '', false);
847
  $autogen_layout = WDW_FM_Library(self::PLUGIN)->get('autogen_layout', '');
848
 
@@ -868,7 +884,8 @@ function after_submit() {
868
  $params['row'] = $this->model->get_display_options($id);
869
  $params['page_title'] = '"'. $params['row_form']->title . '" ' . __('display options', WDFMInstance(self::PLUGIN)->prefix);
870
  $params['animation_effects'] = $this->animation_effects;
871
- $params['posts_and_pages'] = $this->model->fm_posts_query();
 
872
  $params['categories'] = $this->model->fm_categories_query();
873
  $params['selected_categories'] = explode(',', $params['row']->display_on_categories);
874
  $params['current_categories_array'] = explode(',', $params['row']->current_categories);
@@ -915,9 +932,9 @@ function after_submit() {
915
 
916
  /**
917
  * Remove query for MySQL Mapping.
918
- * @param int $id
919
  */
920
- public function remove_query( $id ) {
921
  $fieldset_id = WDW_FM_Library(self::PLUGIN)->get('fieldset_id', 'general');
922
  $query_id = WDW_FM_Library(self::PLUGIN)->get('query_id',0);
923
  $message = 2;
@@ -938,10 +955,9 @@ function after_submit() {
938
  * Check if loading_delay or frequency is positive numbers
939
  *
940
  * @param int $delay
941
- *
942
  * @return int
943
  */
944
- public function set_delay_freq_positive_val( $delay ) {
945
  if( $delay < 0 ) return 0;
946
  return $delay;
947
  }
@@ -1121,13 +1137,13 @@ function after_submit() {
1121
  'savedb' => 1,
1122
  'sendemail' => 1,
1123
  'requiredmark' => '*',
1124
- 'from_mail' => '',
1125
  'from_name' => '',
1126
  'reply_to' => '',
1127
  'send_to' => '',
1128
  'autogen_layout' => 1,
1129
  'custom_front' => '',
1130
- 'mail_from_user' => '',
1131
  'mail_from_name_user' => '',
1132
  'reply_to_user' => '',
1133
  'condition' => '',
@@ -1151,6 +1167,7 @@ function after_submit() {
1151
  'header_image_url' => $header_image_url,
1152
  'header_image_animation' => $header_image_animation,
1153
  'header_hide_image' => $header_hide_image,
 
1154
  ));
1155
  $id = (int) $this->model->get_max_row('formmaker', 'id');
1156
  if (WDFMInstance(self::PLUGIN)->is_free == 2) {
@@ -1297,6 +1314,7 @@ function after_submit() {
1297
  'header_image_url' => $header_image_url,
1298
  'header_image_animation' => $header_image_animation,
1299
  'header_hide_image' => $header_hide_image,
 
1300
  ));
1301
 
1302
  $backup_count = $this->model->get_count(array(
@@ -1340,6 +1358,11 @@ function after_submit() {
1340
  die($output);
1341
  }
1342
 
 
 
 
 
 
1343
  public function fm_posts_query( $args = array(), $include_post_type = '' ) {
1344
  if ( 'only_pages' === $include_post_type ) {
1345
  $pt_names = array( 'page' );
@@ -1388,7 +1411,11 @@ function after_submit() {
1388
  return $results;
1389
  }
1390
 
1391
- public function update_form_title( $id ) {
 
 
 
 
1392
  $page = WDW_FM_Library(self::PLUGIN)->get('page');
1393
  $form_name = WDW_FM_Library(self::PLUGIN)->get('form_name', '');
1394
 
@@ -1417,15 +1444,14 @@ function after_submit() {
1417
 
1418
  return $message = 1;
1419
  }
 
1420
  /**
1421
  * Get stripe addon.
1422
  *
1423
  * @param int $id
1424
- *
1425
- * @return array $data
1426
  */
1427
- private function get_stripe_addon($id) {
1428
  return apply_filters('fm_stripe_display_init', array('form_id' => $id) );
1429
  }
1430
-
1431
  }
1
  <?php
2
  class FMControllerManage_fm extends FMAdminController {
3
+
4
  private $model;
5
  private $view;
6
  private $page;
133
  /**
134
  * Bulk actions.
135
  *
136
+ * @param string $task
137
  */
138
+ public function bulk_action( $task = '' ) {
139
  $message = 0;
140
  $successfully_updated = 0;
141
 
168
  /**
169
  * Delete form by id.
170
  *
171
+ * @param int $id
172
  * @param bool $bulk
173
  *
174
  * @return int
175
  */
176
+ public function delete( $id = 0, $bulk = FALSE ) {
177
  if ( $this->model->delete_rows(array( "table" => "formmaker", "where" => "id = " . $id )) ) {
178
  $this->model->delete_rows(array( "table" => "formmaker_views", "where" => "form_id = " . $id ));
179
  $this->model->delete_rows(array( "table" => "formmaker_submits", "where" => "form_id = " . $id ));
211
  /**
212
  * Publish by id.
213
  *
214
+ * @param int $id
215
  * @param bool $bulk
216
  *
217
  * @return int
218
  */
219
+ public function publish( $id = 0, $bulk = FALSE ) {
220
  $updated = $this->model->update_data("formmaker", array('published' => 1), array('id' => $id));
221
  if ( $updated !== FALSE ) {
222
  $message = 9;
240
  /**
241
  * Unpublish by id.
242
  *
243
+ * @param int $id
244
  * @param bool $bulk
245
  *
246
  * @return int
247
  */
248
+ public function unpublish( $id = 0, $bulk = FALSE ) {
249
  $updated = $this->model->update_data("formmaker", array('published' => 0), array('id' => $id));
250
  if ( $updated !== FALSE ) {
251
  $message = 10;
269
  /**
270
  * Duplicate by id.
271
  *
272
+ * @param int $id
273
  * @param bool $bulk
274
  *
275
  * @return int
276
  */
277
+ public function duplicate( $id = 0, $bulk = FALSE ) {
278
  $message = 2;
279
  $row = $this->model->select_rows("get_row", array(
280
  "selection" => "*",
351
  $this->view->edit($params);
352
  }
353
 
354
+ /**
355
+ * Edit.
356
+ *
357
+ * @param int $id
358
+ * @param int $backup_id
359
+ */
360
+ public function edit( $id = 0, $backup_id = 0 ) {
361
  $fm_settings = get_option(WDFMInstance(self::PLUGIN)->is_free == 2 ? 'fmc_settings' : 'fm_settings');
362
  $fm_advanced_layout = isset($fm_settings['fm_advanced_layout']) && $fm_settings['fm_advanced_layout'] == '1' ? 1 : 0;
363
  if ( $id && !$fm_advanced_layout ) {
460
  *
461
  * @param int $id
462
  */
463
+ public function form_options( $id = 0 ) {
464
  // Set params for view.
465
  $params = array();
466
  $params[ 'id' ] = $id;
585
  * Get active addons.
586
  *
587
  * @param $params
 
588
  * @return mixed|void
589
  */
590
+ private function get_addon_tabs( $params = array() ) {
591
  $addons = array('tabs' => array(), 'html' => array());
592
  if (WDFMInstance(self::PLUGIN)->is_free != 2) {
593
  $addons = apply_filters('fm_get_addon_init', $addons, $params);
600
  *
601
  * @param int $id
602
  */
603
+ public function apply_form_options( $id = 0 ) {
604
  $fieldset_id = WDW_FM_Library(self::PLUGIN)->get('fieldset_id', 'general');
605
  $message = $this->save_db_form_options( $id );
606
  WDW_FM_Library(self::PLUGIN)->fm_redirect(add_query_arg(array(
616
  * Save db Form options.
617
  *
618
  * @param int $id
 
619
  * @return int $id_message
620
  */
621
+ public function save_db_form_options( $id = 0 ) {
622
  $javascript = "// Occurs before the form is loaded
623
  function before_load() {
624
 
638
 
639
  $published = stripslashes(WDW_FM_Library(self::PLUGIN)->get('published', ''));
640
  $savedb = stripslashes(WDW_FM_Library(self::PLUGIN)->get('savedb', ''));
641
+ $theme = (int) WDW_FM_Library(self::PLUGIN)->get('theme', 0);
642
+ $theme = ($theme) ? $theme : $this->model->get_default_theme_id();
643
  $requiredmark = stripslashes(WDW_FM_Library(self::PLUGIN)->get('requiredmark', '*'));
644
  $sendemail = stripslashes(WDW_FM_Library(self::PLUGIN)->get('sendemail', ''));
645
  $save_uploads = stripslashes(WDW_FM_Library(self::PLUGIN)->get('save_uploads', ''));
646
  $mail = stripslashes(WDW_FM_Library(self::PLUGIN)->get('mail', ''));
 
 
 
647
  $from_mail = stripslashes(WDW_FM_Library(self::PLUGIN)->get('from_mail', ''));
648
  $from_name = stripslashes(WDW_FM_Library(self::PLUGIN)->get('from_name', ''));
649
  $reply_to = stripslashes(WDW_FM_Library(self::PLUGIN)->get('reply_to', ''));
718
  $article_id = 0;
719
  }
720
  $mail_verification_post_id = (int) $this->model->get_mail_verification_post_id();
721
+
722
+ $privacy_arr = array(
723
+ 'save_ip' => WDW_FM_Library(self::PLUGIN)->get('save_ip', 1),
724
+ 'save_user_id' => WDW_FM_Library(self::PLUGIN)->get('save_user_id', 1),
725
+ );
726
+
727
+ $privacy = json_encode($privacy_arr);
728
+
729
  if ( $mail_verify ) {
730
  $email_verification_post = array(
731
  'post_title' => 'Email Verification',
739
  }
740
  }
741
 
742
+ $data = array(
743
  'published' => $published,
744
  'savedb' => $savedb,
745
  'theme' => $theme,
784
  'mail_verify' => $mail_verify,
785
  'mail_verify_expiretime' => $mail_verify_expiretime,
786
  'mail_verification_post_id' => $mail_verification_post_id,
787
+ 'privacy' => $privacy,
788
  );
789
 
790
+ $message_id = 2;
791
  $save = $this->model->update_data('formmaker', $data, array( 'id' => $id ));
792
  if ( $save !== FALSE ) {
793
  $this->model->update_data("formmaker_backup", array(
797
  if (WDFMInstance(self::PLUGIN)->is_free != 2) {
798
  $save_addon = do_action('fm_save_addon_init', $id);
799
  }
800
+ $message_id = 8;
801
+ }
802
+
803
+ return $message_id;
804
  }
805
+
806
  /**
807
  * Form layout.
808
  *
809
+ * @param int $id
810
  */
811
+ public function form_layout( $id = 0 ) {
812
  $ids = array();
813
  $types = array();
814
  $labels = array();
815
+
816
  $row = $this->model->get_row_data( $id );
817
+ if ( empty($row) ) {
818
+ WDW_FM_Library(self::PLUGIN)->fm_redirect( add_query_arg( array('page' => $this->page, 'task' => 'display'), admin_url('admin.php') ) );
819
+ }
820
  $fields = explode('*:*new_field*:*', $row->form_fields);
821
  $fields = array_slice($fields, 0, count($fields) - 1);
822
  foreach ( $fields as $field ) {
827
  $temp = explode('*:*w_field_label*:*', $temp[1]);
828
  array_push($labels, $temp[0]);
829
  }
830
+
831
  // Set params for view.
832
  $params = array();
833
  $params['id'] = $id;
842
  $this->view->form_layout($params);
843
  }
844
 
845
+ /**
846
+ * Apply layout.
847
+ *
848
+ * @param int $id
849
+ */
850
+ public function apply_layout( $id = 0 ) {
851
+ $message = $this->save_db_layout( $id );
852
  WDW_FM_Library(self::PLUGIN)->fm_redirect( add_query_arg( array('page' => $this->page, 'task' => 'form_layout', 'current_id' => $id, 'message' => $message), admin_url('admin.php') ) );
853
  }
854
 
856
  * Save db layout.
857
  *
858
  * @param int $id
 
859
  * @return int $id_message
860
  */
861
+ public function save_db_layout( $id = 0 ) {
862
  $custom_front = WDW_FM_Library(self::PLUGIN)->get('custom_front', '', false);
863
  $autogen_layout = WDW_FM_Library(self::PLUGIN)->get('autogen_layout', '');
864
 
884
  $params['row'] = $this->model->get_display_options($id);
885
  $params['page_title'] = '"'. $params['row_form']->title . '" ' . __('display options', WDFMInstance(self::PLUGIN)->prefix);
886
  $params['animation_effects'] = $this->animation_effects;
887
+ $params['posts_and_pages'] = $this->model->fm_posts_query();
888
+ $params['all_display_posts'] = $this->model->get_all_display_posts();
889
  $params['categories'] = $this->model->fm_categories_query();
890
  $params['selected_categories'] = explode(',', $params['row']->display_on_categories);
891
  $params['current_categories_array'] = explode(',', $params['row']->current_categories);
932
 
933
  /**
934
  * Remove query for MySQL Mapping.
935
+ * @param int $id
936
  */
937
+ public function remove_query( $id = 0 ) {
938
  $fieldset_id = WDW_FM_Library(self::PLUGIN)->get('fieldset_id', 'general');
939
  $query_id = WDW_FM_Library(self::PLUGIN)->get('query_id',0);
940
  $message = 2;
955
  * Check if loading_delay or frequency is positive numbers
956
  *
957
  * @param int $delay
 
958
  * @return int
959
  */
960
+ public function set_delay_freq_positive_val( $delay = 0 ) {
961
  if( $delay < 0 ) return 0;
962
  return $delay;
963
  }
1137
  'savedb' => 1,
1138
  'sendemail' => 1,
1139
  'requiredmark' => '*',
1140
+ 'from_mail' => '{adminemail}',
1141
  'from_name' => '',
1142
  'reply_to' => '',
1143
  'send_to' => '',
1144
  'autogen_layout' => 1,
1145
  'custom_front' => '',
1146
+ 'mail_from_user' => '{adminemail}',
1147
  'mail_from_name_user' => '',
1148
  'reply_to_user' => '',
1149
  'condition' => '',
1167
  'header_image_url' => $header_image_url,
1168
  'header_image_animation' => $header_image_animation,
1169
  'header_hide_image' => $header_hide_image,
1170
+ 'privacy' => '',
1171
  ));
1172
  $id = (int) $this->model->get_max_row('formmaker', 'id');
1173
  if (WDFMInstance(self::PLUGIN)->is_free == 2) {
1314
  'header_image_url' => $header_image_url,
1315
  'header_image_animation' => $header_image_animation,
1316
  'header_hide_image' => $header_hide_image,
1317
+ 'privacy' => '',
1318
  ));
1319
 
1320
  $backup_count = $this->model->get_count(array(
1358
  die($output);
1359
  }
1360
 
1361
+ /**
1362
+ * @param array $args
1363
+ * @param string $include_post_type
1364
+ * @return array|bool
1365
+ */
1366
  public function fm_posts_query( $args = array(), $include_post_type = '' ) {
1367
  if ( 'only_pages' === $include_post_type ) {
1368
  $pt_names = array( 'page' );
1411
  return $results;
1412
  }
1413
 
1414
+ /**
1415
+ * @param int $id
1416
+ * @return int
1417
+ */
1418
+ public function update_form_title( $id = 0 ) {
1419
  $page = WDW_FM_Library(self::PLUGIN)->get('page');
1420
  $form_name = WDW_FM_Library(self::PLUGIN)->get('form_name', '');
1421
 
1444
 
1445
  return $message = 1;
1446
  }
1447
+
1448
  /**
1449
  * Get stripe addon.
1450
  *
1451
  * @param int $id
1452
+ * @return array $data
 
1453
  */
1454
+ private function get_stripe_addon( $id = 0 ) {
1455
  return apply_filters('fm_stripe_display_init', array('form_id' => $id) );
1456
  }
 
1457
  }
admin/controllers/Options_fm.php CHANGED
@@ -4,6 +4,7 @@
4
  * Class FMControllerOptions_fm
5
  */
6
  class FMControllerOptions_fm extends FMAdminController {
 
7
  private $model;
8
  private $view;
9
 
4
  * Class FMControllerOptions_fm
5
  */
6
  class FMControllerOptions_fm extends FMAdminController {
7
+
8
  private $model;
9
  private $view;
10
 
admin/controllers/Pricing_fm.php CHANGED
@@ -45,10 +45,10 @@ class FMControllerPricing_fm extends FMAdminController {
45
  * Display.
46
  */
47
  public function display() {
48
- // Set params for view.
49
- $params = array();
50
- $params['page'] = $this->page;
51
- $params['page_url'] = $this->page_url;
52
- $this->view->display( $params );
53
  }
54
  }
45
  * Display.
46
  */
47
  public function display() {
48
+ // Set params for view.
49
+ $params = array();
50
+ $params['page'] = $this->page;
51
+ $params['page_url'] = $this->page_url;
52
+ $this->view->display( $params );
53
  }
54
  }
admin/controllers/Select_data_from_db.php CHANGED
@@ -49,7 +49,7 @@ class FMControllerSelect_data_from_db extends FMAdminController {
49
  * @param string $field_type
50
  * @param int $value_disabled
51
  */
52
- public function display( $id, $form_id, $field_id, $field_type, $value_disabled ) {
53
  // Set params for view.
54
  $params = array();
55
  $params['id'] = $id;
@@ -66,7 +66,7 @@ class FMControllerSelect_data_from_db extends FMAdminController {
66
  * @param int $form_id
67
  * @param string $field_type
68
  */
69
- public function db_tables( $form_id, $field_type ) {
70
  // Get tables.
71
  $tables = $this->model->get_tables();
72
  // Set params for view.
@@ -77,7 +77,7 @@ class FMControllerSelect_data_from_db extends FMAdminController {
77
  $this->view->db_tables($params);
78
  }
79
 
80
- public function db_table_struct_select( $form_id, $field_type ) {
81
  // Get labels by form id.
82
  $label = $this->model->get_labels($form_id);
83
  // Get table struct.
49
  * @param string $field_type
50
  * @param int $value_disabled
51
  */
52
+ public function display( $id = 0, $form_id = 0, $field_id = 0, $field_type = '', $value_disabled = 0 ) {
53
  // Set params for view.
54
  $params = array();
55
  $params['id'] = $id;
66
  * @param int $form_id
67
  * @param string $field_type
68
  */
69
+ public function db_tables( $form_id = 0, $field_type = '' ) {
70
  // Get tables.
71
  $tables = $this->model->get_tables();
72
  // Set params for view.
77
  $this->view->db_tables($params);
78
  }
79
 
80
+ public function db_table_struct_select( $form_id = 0, $field_type = '' ) {
81
  // Get labels by form id.
82
  $label = $this->model->get_labels($form_id);
83
  // Get table struct.
admin/controllers/Submissions_fm.php CHANGED
@@ -101,9 +101,9 @@ class FMControllerSubmissions_fm extends FMAdminController {
101
  /**
102
  * Bulk actions.
103
  *
104
- * @param $task
105
  */
106
- public function bulk_action($task) {
107
  $form_id = WDW_FM_Library(self::PLUGIN)->get('form_id', 0);
108
  $check = WDW_FM_Library(self::PLUGIN)->get('check', '');
109
 
@@ -132,7 +132,7 @@ class FMControllerSubmissions_fm extends FMAdminController {
132
  * Forms.
133
  * @param int $id
134
  */
135
- public function forms($id) {
136
  // Set params for view.
137
  $params = array();
138
  $params['id'] = $id;
@@ -163,7 +163,7 @@ class FMControllerSubmissions_fm extends FMAdminController {
163
  $page = (int) WDW_FM_Library(self::PLUGIN)->get('paged', 1);
164
  $page_num = $page ? ($page - 1) * $params['page_per_num'] : 0;
165
 
166
- $params['forms'] = $this->model->get_forms();
167
  $params['statistics'] = $this->model->get_statistics( $id );
168
  $params['blocked_ips'] = $this->model->blocked_ips();
169
 
@@ -182,8 +182,8 @@ class FMControllerSubmissions_fm extends FMAdminController {
182
  $params['group_id_s'] = $this->model->sort_group_ids(count($params['sorted_label_names']), $group_ids);
183
  $params['where_choices'] = $labels_parameters[7];
184
  $params['searched_ids'] = $labels_parameters[8] ? implode(',', $labels_parameters[8]) : '';
185
-
186
- $params['order_by'] = (isset($_POST['order_by']) ? esc_html(stripslashes($_POST['order_by'])) : 'group_id');
187
  $params['asc_or_desc'] = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'asc') ? 'asc' : 'desc');
188
 
189
  $lists = $labels_parameters[2];
@@ -212,6 +212,9 @@ class FMControllerSubmissions_fm extends FMAdminController {
212
  $params['rows'] = $labels_parameters[5];
213
  $params['subs_count'] = $labels_parameters[2]['total'];
214
 
 
 
 
215
  // Check is active pdf-integration add-on.
216
  $params['pdf_data'] = array();
217
  if ( defined('WD_FM_PDF') && is_plugin_active(constant('WD_FM_PDF')) ) {
@@ -276,7 +279,7 @@ class FMControllerSubmissions_fm extends FMAdminController {
276
  * Edit.
277
  * @param int $id
278
  */
279
- public function edit( $id=0 ) {
280
  $form_id = WDW_FM_Library(self::PLUGIN)->get('form_id', 0);
281
  $data = $this->model->get_data_of_group_id( $id );
282
  if ( empty($data[0]) ) {
@@ -330,7 +333,7 @@ class FMControllerSubmissions_fm extends FMAdminController {
330
  * @param int $id
331
  * @param int $form_id
332
  */
333
- public function save_db( $id, $form_id) {
334
  $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
335
  $date = esc_html($_POST['date']);
336
  $ip = esc_html($_POST['ip']);
@@ -456,12 +459,12 @@ class FMControllerSubmissions_fm extends FMAdminController {
456
  /**
457
  * Delete form by id.
458
  *
459
- * @param $id
460
  * @param bool $bulk
461
  *
462
  * @return int
463
  */
464
- public function delete( $id, $bulk = FALSE ) {
465
  $form_id = (int) WDW_FM_Library(self::PLUGIN)->get('form_id', 0);
466
  $delete = $this->model->delete_row($id);
467
  $message = 2;
@@ -484,12 +487,12 @@ class FMControllerSubmissions_fm extends FMAdminController {
484
  /**
485
  * Block IP form by id.
486
  *
487
- * @param $id
488
  * @param bool $bulk
489
  *
490
  * @return int
491
  */
492
- public function block_ip( $id, $bulk = FALSE ) {
493
  global $wpdb;
494
 
495
  $form_id = (int) WDW_FM_Library(self::PLUGIN)->get('form_id', 0);
@@ -521,12 +524,12 @@ class FMControllerSubmissions_fm extends FMAdminController {
521
  /**
522
  * Unblock IP form by id.
523
  *
524
- * @param $id
525
  * @param bool $bulk
526
  *
527
  * @return int
528
  */
529
- public function unblock_ip( $id, $bulk = FALSE ) {
530
  global $wpdb;
531
 
532
  $form_id = (int) WDW_FM_Library(self::PLUGIN)->get('form_id', 0);
101
  /**
102
  * Bulk actions.
103
  *
104
+ * @param string $task
105
  */
106
+ public function bulk_action( $task = '' ) {
107
  $form_id = WDW_FM_Library(self::PLUGIN)->get('form_id', 0);
108
  $check = WDW_FM_Library(self::PLUGIN)->get('check', '');
109
 
132
  * Forms.
133
  * @param int $id
134
  */
135
+ public function forms( $id = 0 ) {
136
  // Set params for view.
137
  $params = array();
138
  $params['id'] = $id;
163
  $page = (int) WDW_FM_Library(self::PLUGIN)->get('paged', 1);
164
  $page_num = $page ? ($page - 1) * $params['page_per_num'] : 0;
165
 
166
+ $params['forms'] = $this->model->get_forms();
167
  $params['statistics'] = $this->model->get_statistics( $id );
168
  $params['blocked_ips'] = $this->model->blocked_ips();
169
 
182
  $params['group_id_s'] = $this->model->sort_group_ids(count($params['sorted_label_names']), $group_ids);
183
  $params['where_choices'] = $labels_parameters[7];
184
  $params['searched_ids'] = $labels_parameters[8] ? implode(',', $labels_parameters[8]) : '';
185
+ $params['groupids'] = $labels_parameters[8] ? array_reverse($labels_parameters[8]) : array();
186
+ $params['order_by'] = (isset($_POST['order_by']) ? esc_html(stripslashes($_POST['order_by'])) : 'group_id');
187
  $params['asc_or_desc'] = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'asc') ? 'asc' : 'desc');
188
 
189
  $lists = $labels_parameters[2];
212
  $params['rows'] = $labels_parameters[5];
213
  $params['subs_count'] = $labels_parameters[2]['total'];
214
 
215
+ $option_key = (WDFMInstance(self::PLUGIN)->is_free == 2 ? 'fmc_settings' : 'fm_settings');
216
+ $params['fm_settings'] = get_option($option_key);
217
+
218
  // Check is active pdf-integration add-on.
219
  $params['pdf_data'] = array();
220
  if ( defined('WD_FM_PDF') && is_plugin_active(constant('WD_FM_PDF')) ) {
279
  * Edit.
280
  * @param int $id
281
  */
282
+ public function edit( $id = 0 ) {
283
  $form_id = WDW_FM_Library(self::PLUGIN)->get('form_id', 0);
284
  $data = $this->model->get_data_of_group_id( $id );
285
  if ( empty($data[0]) ) {
333
  * @param int $id
334
  * @param int $form_id
335
  */
336
+ public function save_db( $id = 0, $form_id = 0 ) {
337
  $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
338
  $date = esc_html($_POST['date']);
339
  $ip = esc_html($_POST['ip']);
459
  /**
460
  * Delete form by id.
461
  *
462
+ * @param int $id
463
  * @param bool $bulk
464
  *
465
  * @return int
466
  */
467
+ public function delete( $id = 0, $bulk = FALSE ) {
468
  $form_id = (int) WDW_FM_Library(self::PLUGIN)->get('form_id', 0);
469
  $delete = $this->model->delete_row($id);
470
  $message = 2;
487
  /**
488
  * Block IP form by id.
489
  *
490
+ * @param int $id
491
  * @param bool $bulk
492
  *
493
  * @return int
494
  */
495
+ public function block_ip( $id = 0, $bulk = FALSE ) {
496
  global $wpdb;
497
 
498
  $form_id = (int) WDW_FM_Library(self::PLUGIN)->get('form_id', 0);
524
  /**
525
  * Unblock IP form by id.
526
  *
527
+ * @param int $id
528
  * @param bool $bulk
529
  *
530
  * @return int
531
  */
532
+ public function unblock_ip( $id = 0, $bulk = FALSE ) {
533
  global $wpdb;
534
 
535
  $form_id = (int) WDW_FM_Library(self::PLUGIN)->get('form_id', 0);
admin/controllers/Themes_fm.php CHANGED
@@ -102,9 +102,9 @@ class FMControllerThemes_fm extends FMAdminController {
102
  /**
103
  * Bulk actions.
104
  *
105
- * @param $task
106
  */
107
- public function bulk_action($task) {
108
  $message = 0;
109
  $successfully_updated = 0;
110
 
@@ -112,17 +112,17 @@ class FMControllerThemes_fm extends FMAdminController {
112
 
113
  if ( $check ) {
114
  foreach ( $check as $form_id => $item ) {
115
- if ( method_exists($this, $task) ) {
116
- $message = $this->$task($form_id, TRUE);
117
- if ( $message != 2 ) {
118
- // Increase successfully updated items count, if action doesn't failed.
119
- $successfully_updated++;
120
- }
121
- }
122
  }
123
  if ( $successfully_updated ) {
124
- $block_action = $this->bulk_action_name;
125
- $message = sprintf(_n('%s item successfully %s.', '%s items successfully %s.', $successfully_updated, WDFMInstance(self::PLUGIN)->prefix), $successfully_updated, $this->actions[$task][$block_action]);
126
  }
127
  }
128
 
@@ -137,12 +137,12 @@ class FMControllerThemes_fm extends FMAdminController {
137
  /**
138
  * Delete form by id.
139
  *
140
- * @param $id
141
  * @param bool $bulk
142
  *
143
  * @return int
144
  */
145
- public function delete( $id, $bulk = FALSE ) {
146
  $isDefault = $this->model->get_default($id);
147
  if ( $isDefault ) {
148
  $message = 4;
@@ -169,12 +169,12 @@ class FMControllerThemes_fm extends FMAdminController {
169
  /**
170
  * Duplicate by id.
171
  *
172
- * @param $id
173
  * @param bool $bulk
174
  *
175
  * @return int
176
  */
177
- public function duplicate( $id, $bulk = FALSE ) {
178
  $message = 2;
179
  $table = 'formmaker_themes';
180
  $row = $this->model->select_rows("get_row", array(
@@ -208,7 +208,7 @@ class FMControllerThemes_fm extends FMAdminController {
208
  *
209
  * @param int $id
210
  */
211
- public function edit($id = 0) {
212
  $params = array();
213
  $params['id'] = (int) $id;
214
  $params['row'] = $this->model->get_row_data($params['id'], FALSE);
@@ -300,8 +300,20 @@ class FMControllerThemes_fm extends FMAdminController {
300
  $this->view->edit($params);
301
  }
302
 
303
- // set all params in array
304
- public function all_params( $param_values, $borders, $border_types, $font_weights, $position_types, $aligns, $bg_repeats, $font_families ) {
 
 
 
 
 
 
 
 
 
 
 
 
305
  $all_params = array(
306
  'global' => array(
307
  array(
102
  /**
103
  * Bulk actions.
104
  *
105
+ * @param string $task
106
  */
107
+ public function bulk_action( $task = '' ) {
108
  $message = 0;
109
  $successfully_updated = 0;
110
 
112
 
113
  if ( $check ) {
114
  foreach ( $check as $form_id => $item ) {
115
+ if ( method_exists($this, $task) ) {
116
+ $message = $this->$task($form_id, TRUE);
117
+ if ( $message != 2 ) {
118
+ // Increase successfully updated items count, if action doesn't failed.
119
+ $successfully_updated++;
120
+ }
121
+ }
122
  }
123
  if ( $successfully_updated ) {
124
+ $block_action = $this->bulk_action_name;
125
+ $message = sprintf(_n('%s item successfully %s.', '%s items successfully %s.', $successfully_updated, WDFMInstance(self::PLUGIN)->prefix), $successfully_updated, $this->actions[$task][$block_action]);
126
  }
127
  }
128
 
137
  /**
138
  * Delete form by id.
139
  *
140
+ * @param int $id
141
  * @param bool $bulk
142
  *
143
  * @return int
144
  */
145
+ public function delete( $id = 0, $bulk = FALSE ) {
146
  $isDefault = $this->model->get_default($id);
147
  if ( $isDefault ) {
148
  $message = 4;
169
  /**
170
  * Duplicate by id.
171
  *
172
+ * @param int $id
173
  * @param bool $bulk
174
  *
175
  * @return int
176
  */
177
+ public function duplicate( $id = 0, $bulk = FALSE ) {
178
  $message = 2;
179
  $table = 'formmaker_themes';
180
  $row = $this->model->select_rows("get_row", array(
208
  *
209
  * @param int $id
210
  */
211
+ public function edit( $id = 0 ) {
212
  $params = array();
213
  $params['id'] = (int) $id;
214
  $params['row'] = $this->model->get_row_data($params['id'], FALSE);
300
  $this->view->edit($params);
301
  }
302
 
303
+ /**
304
+ * all params.
305
+ *
306
+ * @param array $param_values
307
+ * @param array $borders
308
+ * @param array $border_types
309
+ * @param array $font_weights
310
+ * @param array $position_types
311
+ * @param array $aligns
312
+ * @param array $bg_repeats
313
+ * @param array $font_families
314
+ * @return array
315
+ */
316
+ public function all_params( $param_values = array(), $borders = array(), $border_types = array(), $font_weights = array(), $position_types = array(), $aligns = array(), $bg_repeats = array(), $font_families = array() ) {
317
  $all_params = array(
318
  'global' => array(
319
  array(
admin/controllers/Widget.php CHANGED
@@ -27,7 +27,13 @@ class FMControllerWidget extends WP_Widget {
27
  $this->view = new FMViewWidget($this->model);
28
  }
29
 
30
- public function widget( $args, $instance ) {
 
 
 
 
 
 
31
  if( get_the_title() == 'Preview' && get_post_type() == 'form-maker' . WDFMInstance(self::PLUGIN)->plugin_postfix ) {
32
  return;
33
  }
@@ -55,13 +61,24 @@ class FMControllerWidget extends WP_Widget {
55
  $this->view->widget($args, $instance, $execute);
56
  }
57
 
58
- public function form( $instance ) {
 
 
 
 
 
59
  $ids_FM = $this->model->get_gallery_rows_data(); // ids_Form_Maker
60
  $this->view->form($instance, $ids_FM, parent::get_field_id('title'), parent::get_field_name('title'), parent::get_field_id('form_id'), parent::get_field_name('form_id'));
61
  }
62
 
63
- // Update Settings.
64
- public function update( $new_instance, $old_instance ) {
 
 
 
 
 
 
65
  $instance['title'] = $new_instance['title'];
66
  $instance['form_id'] = $new_instance['form_id'];
67
 
27
  $this->view = new FMViewWidget($this->model);
28
  }
29
 
30
+ /**
31
+ * Widget.
32
+ *
33
+ * @param array $args
34
+ * @param array $instance
35
+ */
36
+ public function widget( $args = array(), $instance = array() ) {
37
  if( get_the_title() == 'Preview' && get_post_type() == 'form-maker' . WDFMInstance(self::PLUGIN)->plugin_postfix ) {
38
  return;
39
  }
61
  $this->view->widget($args, $instance, $execute);
62
  }
63
 
64
+ /**
65
+ * Form.
66
+ *
67
+ * @param array $instance
68
+ */
69
+ public function form( $instance = array() ) {
70
  $ids_FM = $this->model->get_gallery_rows_data(); // ids_Form_Maker
71
  $this->view->form($instance, $ids_FM, parent::get_field_id('title'), parent::get_field_name('title'), parent::get_field_id('form_id'), parent::get_field_name('form_id'));
72
  }
73
 
74
+ /**
75
+ * Update.
76
+ *
77
+ * @param $new_instance
78
+ * @param $old_instance
79
+ * @return mixed
80
+ */
81
+ public function update( $new_instance = array(), $old_instance = array() ) {
82
  $instance['title'] = $new_instance['title'];
83
  $instance['form_id'] = $new_instance['form_id'];
84
 
admin/models/Blocked_ips_fm.php CHANGED
@@ -8,10 +8,9 @@ class FMModelBlocked_ips_fm extends FMAdminModel {
8
  * Get blocked Ips.
9
  *
10
  * @param $params
11
- *
12
  * @return array|null|object
13
  */
14
- public function get_rows_data($params) {
15
  $order = $params['order'];
16
  $orderby = $params['orderby'];
17
  $items_per_page = $params['items_per_page'];
@@ -31,7 +30,13 @@ class FMModelBlocked_ips_fm extends FMAdminModel {
31
  return $rows;
32
  }
33
 
34
- public function get_row_data( $id ) {
 
 
 
 
 
 
35
  global $wpdb;
36
  if ( $id != 0 ) {
37
  $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $id));
@@ -68,10 +73,9 @@ class FMModelBlocked_ips_fm extends FMAdminModel {
68
  *
69
  * @param array $params
70
  * @param array $where
71
- *
72
  * @return bool
73
  */
74
- public function update_fm_blocked( $params, $where ) {
75
  global $wpdb;
76
  return $wpdb->update($wpdb->prefix . 'formmaker_blocked', $params, $where);
77
  }
@@ -81,10 +85,9 @@ class FMModelBlocked_ips_fm extends FMAdminModel {
81
  *
82
  * @param array $param_ins
83
  * @param array $param_type
84
- *
85
  * @return bool
86
  */
87
- public function insert_fm_blocked( $param_ins, $param_type ) {
88
  global $wpdb;
89
  return $wpdb->insert($wpdb->prefix . 'formmaker_blocked', $param_ins, $param_type);
90
  }
@@ -103,10 +106,9 @@ class FMModelBlocked_ips_fm extends FMAdminModel {
103
  * Delete blocked IP.
104
  *
105
  * @param int $id
106
- *
107
  * @return array
108
  */
109
- public function delete_data( $id ) {
110
  global $wpdb;
111
  return $wpdb->query($wpdb->prepare('DELETE FROM `' . $wpdb->prefix . 'formmaker_blocked` WHERE id="%d"', $id));
112
  }
8
  * Get blocked Ips.
9
  *
10
  * @param $params
 
11
  * @return array|null|object
12
  */
13
+ public function get_rows_data( $params = array() ) {
14
  $order = $params['order'];
15
  $orderby = $params['orderby'];
16
  $items_per_page = $params['items_per_page'];
30
  return $rows;
31
  }
32
 
33
+ /**
34
+ * Get row data.
35
+ *
36
+ * @param int $id
37
+ * @return stdClass
38
+ */
39
+ public function get_row_data( $id = 0 ) {
40
  global $wpdb;
41
  if ( $id != 0 ) {
42
  $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $id));
73
  *
74
  * @param array $params
75
  * @param array $where
 
76
  * @return bool
77
  */
78
+ public function update_fm_blocked( $params = array(), $where = array() ) {
79
  global $wpdb;
80
  return $wpdb->update($wpdb->prefix . 'formmaker_blocked', $params, $where);
81
  }
85
  *
86
  * @param array $param_ins
87
  * @param array $param_type
 
88
  * @return bool
89
  */
90
+ public function insert_fm_blocked( $param_ins = array(), $param_type = array() ) {
91
  global $wpdb;
92
  return $wpdb->insert($wpdb->prefix . 'formmaker_blocked', $param_ins, $param_type);
93
  }
106
  * Delete blocked IP.
107
  *
108
  * @param int $id
 
109
  * @return array
110
  */
111
+ public function delete_data( $id = 0 ) {
112
  global $wpdb;
113
  return $wpdb->query($wpdb->prepare('DELETE FROM `' . $wpdb->prefix . 'formmaker_blocked` WHERE id="%d"', $id));
114
  }
admin/models/Checkpaypal.php CHANGED
@@ -8,10 +8,9 @@ class FMModelCheckpaypal extends FMAdminModel {
8
  * Get form by id.
9
  *
10
  * @param int $id
11
- *
12
  * @return object $row
13
  */
14
- public function get_form_by_id( $id ) {
15
  global $wpdb;
16
  $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
17
 
@@ -22,10 +21,9 @@ class FMModelCheckpaypal extends FMAdminModel {
22
  * Get form session by group id.
23
  *
24
  * @param int $id
25
- *
26
  * @return object $row
27
  */
28
- public function get_form_session_by_group_id( $id ) {
29
  global $wpdb;
30
  $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_sessions WHERE group_id="%d"', $id));
31
 
@@ -38,7 +36,7 @@ class FMModelCheckpaypal extends FMAdminModel {
38
  * @param int $payment_status
39
  * @param int $group_id
40
  */
41
- public function update_submission_status( $payment_status, $group_id ) {
42
  global $wpdb;
43
  $wpdb->update($wpdb->prefix . "formmaker_submits", array(
44
  'element_value' => $payment_status,
@@ -54,10 +52,9 @@ class FMModelCheckpaypal extends FMAdminModel {
54
  * Connect PayPal.
55
  *
56
  * @param array $params
57
- *
58
  * @return array $response
59
  */
60
- public function connect_to_paypal( $params ) {
61
  // Set paypal action, default connect to sandbox.
62
  if ( $params['checkout_mode'] == 1 || $params['checkout_mode'] == 'production' ) {
63
  $action = "https://www.paypal.com/cgi-bin/webscr";
@@ -81,7 +78,7 @@ class FMModelCheckpaypal extends FMAdminModel {
81
  *
82
  * @param array $data
83
  */
84
- public function add_formmaker_sessions( $data ) {
85
  global $wpdb;
86
  $wpdb->insert($wpdb->prefix . "formmaker_sessions", $data);
87
 
@@ -94,7 +91,7 @@ class FMModelCheckpaypal extends FMAdminModel {
94
  * @param int $group_id
95
  * @param array $data
96
  */
97
- public function update_formmaker_sessions_by_group_id( $group_id, $data ) {
98
  global $wpdb;
99
  $wpdb->update($wpdb->prefix . "formmaker_sessions", $data, array( 'group_id' => $group_id ));
100
 
8
  * Get form by id.
9
  *
10
  * @param int $id
 
11
  * @return object $row
12
  */
13
+ public function get_form_by_id( $id = 0 ) {
14
  global $wpdb;
15
  $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
16
 
21
  * Get form session by group id.
22
  *
23
  * @param int $id
 
24
  * @return object $row
25
  */
26
+ public function get_form_session_by_group_id( $id = 0 ) {
27
  global $wpdb;
28
  $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_sessions WHERE group_id="%d"', $id));
29
 
36
  * @param int $payment_status
37
  * @param int $group_id
38
  */
39
+ public function update_submission_status( $payment_status = 0, $group_id = 0 ) {
40
  global $wpdb;
41
  $wpdb->update($wpdb->prefix . "formmaker_submits", array(
42
  'element_value' => $payment_status,
52
  * Connect PayPal.
53
  *
54
  * @param array $params
 
55
  * @return array $response
56
  */
57
+ public function connect_to_paypal( $params = array() ) {
58
  // Set paypal action, default connect to sandbox.
59
  if ( $params['checkout_mode'] == 1 || $params['checkout_mode'] == 'production' ) {
60
  $action = "https://www.paypal.com/cgi-bin/webscr";
78
  *
79
  * @param array $data
80
  */
81
+ public function add_formmaker_sessions( $data = array() ) {
82
  global $wpdb;
83
  $wpdb->insert($wpdb->prefix . "formmaker_sessions", $data);
84
 
91
  * @param int $group_id
92
  * @param array $data
93
  */
94
+ public function update_formmaker_sessions_by_group_id( $group_id = 0, $data = array() ) {
95
  global $wpdb;
96
  $wpdb->update($wpdb->prefix . "formmaker_sessions", $data, array( 'group_id' => $group_id ));
97
 
admin/models/FMPaypalInfo.php CHANGED
@@ -8,10 +8,9 @@ class FMModelPaypal_info extends FMAdminModel {
8
  * Get form session.
9
  *
10
  * @param int $id
11
- *
12
  * @return object $row
13
  */
14
- public function get_form_session( $id ) {
15
  global $wpdb;
16
  $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_sessions WHERE group_id="%d"', $id));
17
 
8
  * Get form session.
9
  *
10
  * @param int $id
 
11
  * @return object $row
12
  */
13
+ public function get_form_session( $id = 0 ) {
14
  global $wpdb;
15
  $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_sessions WHERE group_id="%d"', $id));
16
 
admin/models/FMSelectDataFromDb.php CHANGED
@@ -4,6 +4,7 @@
4
  * Class FMModelSelect_data_from_db
5
  */
6
  class FMModelSelect_data_from_db extends FMAdminModel {
 
7
  /**
8
  * Get labels by form id.
9
  *
@@ -11,7 +12,7 @@ class FMModelSelect_data_from_db extends FMAdminModel {
11
  *
12
  * @return (string|null) $rows
13
  */
14
- function get_labels( $id ) {
15
  global $wpdb;
16
  $rows = $wpdb->get_var("SELECT label_order_current FROM " . $wpdb->prefix . "formmaker where id=" . $id);
17
 
@@ -56,7 +57,7 @@ class FMModelSelect_data_from_db extends FMAdminModel {
56
  *
57
  * @return object $tables
58
  */
59
- function get_tables_saved( $con_type, $username, $password, $database, $host ) {
60
  global $wpdb;
61
  if ( $con_type == 'local' ) {
62
  $query = "SHOW TABLES";
@@ -112,10 +113,9 @@ class FMModelSelect_data_from_db extends FMAdminModel {
112
  * @param string $host
113
  * @param string $name
114
  * @param string $con_method
115
- *
116
  * @return object $table_struct
117
  */
118
- function get_table_struct_saved( $con_type, $username, $password, $database, $host, $name, $con_method ) {
119
  global $wpdb;
120
  if ( !$name ) {
121
  return array();
4
  * Class FMModelSelect_data_from_db
5
  */
6
  class FMModelSelect_data_from_db extends FMAdminModel {
7
+
8
  /**
9
  * Get labels by form id.
10
  *
12
  *
13
  * @return (string|null) $rows
14
  */
15
+ function get_labels( $id = 0 ) {
16
  global $wpdb;
17
  $rows = $wpdb->get_var("SELECT label_order_current FROM " . $wpdb->prefix . "formmaker where id=" . $id);
18
 
57
  *
58
  * @return object $tables
59
  */
60
+ function get_tables_saved( $con_type = '', $username = '', $password = '', $database = '', $host = '' ) {
61
  global $wpdb;
62
  if ( $con_type == 'local' ) {
63
  $query = "SHOW TABLES";
113
  * @param string $host
114
  * @param string $name
115
  * @param string $con_method
 
116
  * @return object $table_struct
117
  */
118
+ function get_table_struct_saved( $con_type = '', $username = '', $password = '', $database = '', $host = '', $name = '', $con_method = '' ) {
119
  global $wpdb;
120
  if ( !$name ) {
121
  return array();
admin/models/FMShortocde.php CHANGED
@@ -4,6 +4,7 @@
4
  * Class FMModelFMShortocde
5
  */
6
  class FMModelFMShortocde extends FMAdminModel {
 
7
  /**
8
  * Get forms.
9
  *
4
  * Class FMModelFMShortocde
5
  */
6
  class FMModelFMShortocde extends FMAdminModel {
7
+
8
  /**
9
  * Get forms.
10
  *
admin/models/FMSqlMapping.php CHANGED
@@ -4,14 +4,14 @@
4
  * Class FMModelFormMakerSQLMapping
5
  */
6
  class FMModelFormMakerSQLMapping extends FMAdminModel {
 
7
  /**
8
  * Get query by id.
9
  *
10
  * @param $id
11
- *
12
  * @return array|null|object|void
13
  */
14
- function get_query( $id ) {
15
  global $wpdb;
16
  $rows = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker_query where id=" . $id);
17
 
@@ -22,10 +22,9 @@ class FMModelFormMakerSQLMapping extends FMAdminModel {
22
  * Get labels by id.
23
  *
24
  * @param int $id
25
- *
26
  * @return (string|null) $rows
27
  */
28
- function get_labels( $id ) {
29
  global $wpdb;
30
  $rows = $wpdb->get_var("SELECT label_order_current FROM " . $wpdb->prefix . "formmaker where id=" . $id);
31
 
4
  * Class FMModelFormMakerSQLMapping
5
  */
6
  class FMModelFormMakerSQLMapping extends FMAdminModel {
7
+
8
  /**
9
  * Get query by id.
10
  *
11
  * @param $id
 
12
  * @return array|null|object|void
13
  */
14
+ function get_query( $id = 0 ) {
15
  global $wpdb;
16
  $rows = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker_query where id=" . $id);
17
 
22
  * Get labels by id.
23
  *
24
  * @param int $id
 
25
  * @return (string|null) $rows
26
  */
27
+ function get_labels( $id = 0 ) {
28
  global $wpdb;
29
  $rows = $wpdb->get_var("SELECT label_order_current FROM " . $wpdb->prefix . "formmaker where id=" . $id);
30
 
admin/models/FormMakerSubmits.php CHANGED
@@ -4,14 +4,27 @@
4
  * Class FMModelFormMakerSubmits
5
  */
6
  class FMModelFormMakerSubmits extends FMAdminModel {
7
- public function get_from_label_order( $form_id ) {
 
 
 
 
 
 
 
8
  global $wpdb;
9
  $label_order = $wpdb->get_var($wpdb->prepare('SELECT `label_order` FROM `' . $wpdb->prefix . 'formmaker` WHERE id="%d"', $form_id));
10
 
11
  return $label_order;
12
  }
13
 
14
- public function get_submissions( $group_id ) {
 
 
 
 
 
 
15
  global $wpdb;
16
  $row = $wpdb->get_results($wpdb->prepare('SELECT * FROM `' . $wpdb->prefix . 'formmaker_submits` WHERE group_id="%d"', $group_id));
17
 
4
  * Class FMModelFormMakerSubmits
5
  */
6
  class FMModelFormMakerSubmits extends FMAdminModel {
7
+
8
+ /**
9
+ * Get from label order.
10
+ *
11
+ * @param int $form_id
12
+ * @return mixed
13
+ */
14
+ public function get_from_label_order( $form_id = 0 ) {
15
  global $wpdb;
16
  $label_order = $wpdb->get_var($wpdb->prepare('SELECT `label_order` FROM `' . $wpdb->prefix . 'formmaker` WHERE id="%d"', $form_id));
17
 
18
  return $label_order;
19
  }
20
 
21
+ /**
22
+ * Get submissions.
23
+ *
24
+ * @param int $group_id
25
+ * @return mixed
26
+ */
27
+ public function get_submissions( $group_id = 0 ) {
28
  global $wpdb;
29
  $row = $wpdb->get_results($wpdb->prepare('SELECT * FROM `' . $wpdb->prefix . 'formmaker_submits` WHERE group_id="%d"', $group_id));
30
 
admin/models/Manage_fm.php CHANGED
@@ -4,6 +4,7 @@
4
  * Class FMModelManage_fm
5
  */
6
  class FMModelManage_fm extends FMAdminModel {
 
7
  /**
8
  * Get forms.
9
  *
@@ -11,7 +12,7 @@ class FMModelManage_fm extends FMAdminModel {
11
  *
12
  * @return array|null|object
13
  */
14
- public function get_rows_data($params) {
15
  $order = $params['order'];
16
  $orderby = $params['orderby'];
17
  $items_per_page = $params['items_per_page'];
@@ -38,10 +39,27 @@ class FMModelManage_fm extends FMAdminModel {
38
  return $rows;
39
  }
40
 
41
- public function get_row_data( $id ) {
 
 
 
 
 
 
42
  global $wpdb;
43
  if ( $id != 0 ) {
44
  $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
 
 
 
 
 
 
 
 
 
 
 
45
  }
46
  else {
47
  // Add "Submit" button to new forms.
@@ -97,15 +115,34 @@ class FMModelManage_fm extends FMAdminModel {
97
  $row->header_image_url = '';
98
  $row->header_image_animation = '';
99
  $row->header_hide_image = '';
 
 
100
  }
101
 
102
  return $row;
103
  }
104
 
105
- public function get_row_data_new( $id ) {
 
 
 
 
 
 
106
  global $wpdb;
107
  if ( $id != 0 ) {
108
  $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_backup WHERE backup_id="%d"', $id));
 
 
 
 
 
 
 
 
 
 
 
109
  }
110
  else {
111
  // Add "Submit" button to new forms.
@@ -180,7 +217,9 @@ class FMModelManage_fm extends FMAdminModel {
180
  $row->mail_emptyfields = 0;
181
  $row->mail_verify = 0;
182
  $row->mail_verify_expiretime = 0;
183
- $row->mail_verification_post_id = 0;
 
 
184
  }
185
 
186
  $labels2 = array();
@@ -248,7 +287,7 @@ class FMModelManage_fm extends FMAdminModel {
248
  case 'type_recaptcha': {
249
  $arrows = '<div id="wdform_arrows' . $id . '" class="wdform_arrows" style="display: none;">
250
  <div class="wdform_arrows_basic wdform_arrows_container">
251
- <span id="edit_' . $id . '" valign="middle" class="element_toolbar">
252
  <span title="Edit the field" class="page_toolbar dashicons dashicons-edit" onclick="edit(&quot;' . $id . '&quot;)"></span>
253
  </span>
254
  <span id="duplicate_' . $id . '" valign="middle" class="element_toolbar"></span>
@@ -256,7 +295,7 @@ class FMModelManage_fm extends FMAdminModel {
256
  <span title="Remove the field" class="page_toolbar dashicons dashicons-no-alt" onclick="remove_row(&quot;' . $id . '&quot;)"></span>
257
  </span>
258
  </div>
259
- <div class="wdform_arrows_advanced wdform_arrows_container" style="display: none;">
260
  <span id="left_' . $id . '" valign="middle" class="element_toolbar">
261
  <span title="Move the field to the left" class="page_toolbar dashicons dashicons-arrow-left-alt" onclick="left_row(&quot;' . $id . '&quot;)"></span>
262
  </span>
@@ -291,7 +330,7 @@ class FMModelManage_fm extends FMAdminModel {
291
  <span title="Remove the field" class="page_toolbar dashicons dashicons-no-alt" onclick="remove_row(&quot;' . $id . '&quot;)"></span>
292
  </span>
293
  </div>
294
- <div class="wdform_arrows_advanced wdform_arrows_container" style="display: none;">
295
  <span id="left_' . $id . '" valign="middle" class="element_toolbar">
296
  <span title="Move the field to the left" class="page_toolbar dashicons dashicons-arrow-left-alt" onclick="left_row(&quot;' . $id . '&quot;)"></span>
297
  </span>
@@ -454,7 +493,7 @@ class FMModelManage_fm extends FMAdminModel {
454
  $param['w_readonly'] = (isset($param['w_readonly']) ? $param['w_readonly'] : "no");
455
  $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
456
  $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
457
- $rep = '<div id="wdform_field' . $id . '" type="type_text" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" style="display: ' . $param['w_field_label_pos'] . '"><input type="hidden" value="type_text" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp" /><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp" /><input type="hidden" value="' . $param['w_readonly'] . '" name="' . $id . '_readonlyform_id_temp" id="' . $id . '_readonlyform_id_temp"/><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_regExp_status'] . '" name="' . $id . '_regExpStatusform_id_temp" id="' . $id . '_regExpStatusform_id_temp"><input type="hidden" value="' . $param['w_regExp_value'] . '" name="' . $id . '_regExp_valueform_id_temp" id="' . $id . '_regExp_valueform_id_temp"><input type="hidden" value="' . $param['w_regExp_common'] . '" name="' . $id . '_regExp_commonform_id_temp" id="' . $id . '_regExp_commonform_id_temp"><input type="hidden" value="' . $param['w_regExp_alert'] . '" name="' . $id . '_regExp_alertform_id_temp" id="' . $id . '_regExp_alertform_id_temp"><input type="hidden" value="' . $param['w_regExp_arg'] . '" name="' . $id . '_regArgumentform_id_temp" id="' . $id . '_regArgumentform_id_temp"><input type="hidden" value="' . $param['w_unique'] . '" name="' . $id . '_uniqueform_id_temp" id="' . $id . '_uniqueform_id_temp" /><input type="text" id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" value="' . $param['w_first_val'] . '" title="' . $param['w_title'] . '" placeholder="' . $param['w_title'] . '" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled /></div></div>';
458
  break;
459
  }
460
  case 'type_number': {
@@ -483,7 +522,7 @@ class FMModelManage_fm extends FMAdminModel {
483
  }
484
  $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
485
  $required_sym = ($param['w_required'] == "yes" ? " *" : "");
486
- $rep = '<div id="wdform_field' . $id . '" type="type_number" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '"><input type="hidden" value="type_number" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_unique'] . '" name="' . $id . '_uniqueform_id_temp" id="' . $id . '_uniqueform_id_temp"><input type="text" id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" value="' . $param['w_first_val'] . '" title="' . $param['w_title'] . '" onkeypress="return check_isnum(event)" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled /></div></div>';
487
  break;
488
  }
489
  case 'type_password': {
@@ -607,7 +646,7 @@ class FMModelManage_fm extends FMAdminModel {
607
  $required_sym = ($param['w_required'] == "yes" ? " *" : "");
608
  $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
609
  $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
610
- $rep = '<div id="wdform_field' . $id . '" type="type_textarea" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '"><input type="hidden" value="type_textarea" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_unique'] . '" name="' . $id . '_uniqueform_id_temp" id="' . $id . '_uniqueform_id_temp"><textarea id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" title="' . $param['w_title'] . '" placeholder="' . $param['w_title'] . '" style="width: ' . $param['w_size_w'] . 'px; height: ' . $param['w_size_h'] . 'px;" ' . $param['attributes'] . ' disabled>' . $param['w_first_val'] . '</textarea></div></div>';
611
  break;
612
  }
613
  case 'type_phone': {
@@ -656,7 +695,7 @@ class FMModelManage_fm extends FMAdminModel {
656
  $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
657
  $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
658
  $required_sym = ($param['w_required'] == "yes" ? " *" : "");
659
- $rep = '<div id="wdform_field' . $id . '" type="type_phone" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_phone" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_unique'] . '" name="' . $id . '_uniqueform_id_temp" id="' . $id . '_uniqueform_id_temp"><div id="' . $id . '_table_name" style="display: table;"><div id="' . $id . '_tr_name1" style="display: table-row;"><div id="' . $id . '_td_name_input_first" style="display: table-cell;"><input type="text" id="' . $id . '_element_firstform_id_temp" name="' . $id . '_element_firstform_id_temp" value="' . $w_first_val[0] . '" title="' . $w_title[0] . '" placeholder="' . $w_title[0] . '" onkeypress="return check_isnum(event)"style="width: 50px;" ' . $param['attributes'] . ' disabled /><span class="wdform_line" style="margin: 0px 4px; padding: 0px;">-</span></div><div id="' . $id . '_td_name_input_last" style="display: table-cell;"><input type="text" id="' . $id . '_element_lastform_id_temp" name="' . $id . '_element_lastform_id_temp" value="' . $w_first_val[1] . '" title="' . $w_title[1] . '" placeholder="' . $w_title[1] . '" onkeypress="return check_isnum(event)"style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled /></div></div><div id="' . $id . '_tr_name2" style="display: table-row;"><div id="' . $id . '_td_name_label_first" align="left" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_area_code">' . $w_mini_labels[0] . '</label></div><div id="' . $id . '_td_name_label_last" align="left" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_phone_number">' . $w_mini_labels[1] . '</label></div></div></div></div></div>';
660
  break;
661
  }
662
  case 'type_phone_new': {
@@ -688,7 +727,7 @@ class FMModelManage_fm extends FMAdminModel {
688
  $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
689
  $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
690
  $required_sym = ($param['w_required'] == "yes" ? " *" : "");
691
- $rep = '<div id="wdform_field' . $id . '" type="type_phone_new" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_phone_new" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"><input type="hidden" value="' . $param['w_unique'] . '" name="' . $id . '_uniqueform_id_temp" id="' . $id . '_uniqueform_id_temp"><div id="' . $id . '_table_name" style="display: table;"><div id="' . $id . '_tr_name1" style="display: table-row;"><div id="' . $id . '_td_name_input_first" style="display: table-cell;"><input type="text" id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" value="' . $param['w_first_val'] . '" top-country = "' . $param['w_top_country'] . '" onkeypress="return check_isnum(&quot;' . $id . '_elementform_id_temp&quot;)" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled></div></div></div></div></div>';
692
  break;
693
  }
694
  case 'type_name': {
@@ -775,14 +814,14 @@ class FMModelManage_fm extends FMAdminModel {
775
  $param['w_name_fields'] = isset($param['w_name_fields']) ? $param['w_name_fields'] : ($param['w_name_format'] == 'normal' ? 'no***no' : 'yes***yes');
776
  $w_name_fields = explode('***', $param['w_name_fields']);
777
  $param['w_autofill'] = isset($param['w_autofill']) ? $param['w_autofill'] : 'no';
778
- $w_name_format = '<div id="' . $id . '_td_name_input_first" style="display: table-cell;"><input type="text" id="' . $id . '_element_firstform_id_temp" name="' . $id . '_element_firstform_id_temp" value="' . $w_first_val[0] . '" title="' . $w_title[0] . '" placeholder="' . $w_title[0] . '" style="margin-right: 10px; width: ' . $param['w_size'] . 'px;"' . $param['attributes'] . ' disabled /></div><div id="' . $id . '_td_name_input_last" style="display: table-cell;"><input type="text" id="' . $id . '_element_lastform_id_temp" name="' . $id . '_element_lastform_id_temp" value="' . $w_first_val[1] . '" title="' . $w_title[1] . '" placeholder="' . $w_title[1] . '" style="margin-right: 10px; width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled /></div>';
779
  $w_name_format_mini_labels = '<div id="' . $id . '_td_name_label_first" align="left" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_first">' . $w_mini_labels[1] . '</label></div><div id="' . $id . '_td_name_label_last" align="left" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_last">' . $w_mini_labels[2] . '</label></div>';
780
  if ( $w_name_fields[0] == 'yes' ) {
781
- $w_name_format = '<div id="' . $id . '_td_name_input_title" style="display: table-cell;"><input type="text" id="' . $id . '_element_titleform_id_temp" name="' . $id . '_element_titleform_id_temp" value="' . $w_first_val[2] . '" title="' . $w_title[2] . '" style="margin: 0px 10px 0px 0px; width: 40px;" disabled /></div>' . $w_name_format;
782
  $w_name_format_mini_labels = '<div id="' . $id . '_td_name_label_title" align="left" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_title">' . $w_mini_labels[0] . '</label></div>' . $w_name_format_mini_labels;
783
  }
784
  if ( $w_name_fields[1] == 'yes' ) {
785
- $w_name_format = $w_name_format . '<div id="' . $id . '_td_name_input_middle" style="display: table-cell;"><input type="text" id="' . $id . '_element_middleform_id_temp" name="' . $id . '_element_middleform_id_temp" value="' . $w_first_val[3] . '" title="' . $w_title[3] . '" style="width: ' . $param['w_size'] . 'px;" disabled /></div>';
786
  $w_name_format_mini_labels = $w_name_format_mini_labels . '<div id="' . $id . '_td_name_label_middle" align="left" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_middle">' . $w_mini_labels[3] . '</label></div>';
787
  }
788
  $rep = '<div id="wdform_field' . $id . '" type="type_name" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_name" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_unique'] . '" name="' . $id . '_uniqueform_id_temp" id="' . $id . '_uniqueform_id_temp"><input type="hidden" value="' . $param['w_autofill'] . '" name="' . $id . '_autofillform_id_temp" id="' . $id . '_autofillform_id_temp"><input type="hidden" name="' . $id . '_enable_fieldsform_id_temp" id="' . $id . '_enable_fieldsform_id_temp" title="' . $w_name_fields[0] . '" first="yes" last="yes" middle="' . $w_name_fields[1] . '"><div id="' . $id . '_table_name" cellpadding="0" cellspacing="0" style="display: table;"><div id="' . $id . '_tr_name1" style="display: table-row;">' . $w_name_format . '</div><div id="' . $id . '_tr_name2" style="display: table-row;">' . $w_name_format_mini_labels . '</div></div></div></div>';
@@ -968,7 +1007,7 @@ class FMModelManage_fm extends FMAdminModel {
968
  $param['w_verification_label'] = isset($param['w_verification_label']) ? $param['w_verification_label'] : "E-mail confirmation:";
969
  $param['w_verification_placeholder'] = isset($param['w_verification_placeholder']) ? $param['w_verification_placeholder'] : "";
970
  $confirm_emeil = '<br><div align="left" id="' . $id . '_1_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label_confirm . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_1_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $param['w_verification_label'] . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_1_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_element_confirm . ';"><input type="hidden" value="' . $param['w_verification'] . '" name="' . $id . '_verification_id_temp" id="' . $id . '_verification_id_temp"><input type="text" id="' . $id . '_1_elementform_id_temp" name="' . $id . '_1_elementform_id_temp" value="' . $param['w_verification_placeholder'] . '" title="' . $param['w_verification_placeholder'] . '" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled /></div>';
971
- $rep = '<div id="wdform_field' . $id . '" type="type_submitter_mail" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_submitter_mail" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_unique'] . '" name="' . $id . '_uniqueform_id_temp" id="' . $id . '_uniqueform_id_temp"><input type="hidden" value="' . $param['w_autofill'] . '" name="' . $id . '_autofillform_id_temp" id="' . $id . '_autofillform_id_temp"><input type="hidden" value="' . $param['w_verification'] . '" name="' . $id . '_verification_id_temp" id="' . $id . '_verification_id_temp"><input type="text" id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" value="' . $param['w_first_val'] . '" title="' . $param['w_title'] . '" placeholder="' . $param['w_title'] . '" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled /></div>' . $confirm_emeil . '</div>';
972
  break;
973
  }
974
  case 'type_checkbox': {
@@ -1083,6 +1122,7 @@ class FMModelManage_fm extends FMAdminModel {
1083
  else {
1084
  $choise_value = $param['w_choices'][(int) $param['w_rowcol'] * $l + $i];
1085
  }
 
1086
  if ( isset($param['w_choices_params']) && $param['w_choices_params'][(int) $param['w_rowcol'] * $l + $i] ) {
1087
  $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][(int) $param['w_rowcol'] * $l + $i]);
1088
  $where = 'where="' . $w_choices_params[0] . '"';
@@ -1115,6 +1155,7 @@ class FMModelManage_fm extends FMAdminModel {
1115
  else {
1116
  $choise_value = $param['w_choices'][(int) $param['w_rowcol'] * $i + $l];
1117
  }
 
1118
  if ( isset($param['w_choices_params']) && $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l] ) {
1119
  $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l]);
1120
  $where = 'where="' . $w_choices_params[0] . '"';
@@ -1142,6 +1183,7 @@ class FMModelManage_fm extends FMAdminModel {
1142
  else {
1143
  $choise_value = $param['w_choices'][(int) $param['w_rowcol'] * $i + $l];
1144
  }
 
1145
  if ( isset($param['w_choices_params']) && $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l] ) {
1146
  $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l]);
1147
  $where = 'where="' . $w_choices_params[0] . '"';
@@ -1172,6 +1214,7 @@ class FMModelManage_fm extends FMAdminModel {
1172
  else {
1173
  $choise_value = $param['w_choices'][$l];
1174
  }
 
1175
  if ( isset($param['w_choices_params']) && $param['w_choices_params'][$l] ) {
1176
  $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$l]);
1177
  $where = 'where="' . $w_choices_params[0] . '"';
@@ -1300,6 +1343,7 @@ class FMModelManage_fm extends FMAdminModel {
1300
  else {
1301
  $choise_value = $param['w_choices'][(int) $param['w_rowcol'] * $l + $i];
1302
  }
 
1303
  if ( isset($param['w_choices_params']) && $param['w_choices_params'][(int) $param['w_rowcol'] * $l + $i] ) {
1304
  $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][(int) $param['w_rowcol'] * $l + $i]);
1305
  $where = 'where="' . $w_choices_params[0] . '"';
@@ -1332,6 +1376,7 @@ class FMModelManage_fm extends FMAdminModel {
1332
  else {
1333
  $choise_value = $param['w_choices'][(int) $param['w_rowcol'] * $i + $l];
1334
  }
 
1335
  if ( isset($param['w_choices_params']) && $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l] ) {
1336
  $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l]);
1337
  $where = 'where="' . $w_choices_params[0] . '"';
@@ -1358,6 +1403,7 @@ class FMModelManage_fm extends FMAdminModel {
1358
  else {
1359
  $choise_value = $param['w_choices'][(int) $param['w_rowcol'] * $i + $l];
1360
  }
 
1361
  if ( isset($param['w_choices_params']) && $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l] ) {
1362
  $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l]);
1363
  $where = 'where="' . $w_choices_params[0] . '"';
@@ -1388,6 +1434,7 @@ class FMModelManage_fm extends FMAdminModel {
1388
  else {
1389
  $choise_value = $param['w_choices'][$l];
1390
  }
 
1391
  if ( isset($param['w_choices_params']) && $param['w_choices_params'][$l] ) {
1392
  $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$l]);
1393
  $where = 'where="' . $w_choices_params[0] . '"';
@@ -2289,7 +2336,7 @@ class FMModelManage_fm extends FMAdminModel {
2289
  $w_first_val = explode('***', $param['w_first_val']);
2290
  $w_title = explode('***', $param['w_title']);
2291
  $w_mini_labels = explode('***', $param['w_mini_labels']);
2292
- $rep = '<div id="wdform_field' . $id . '" type="type_paypal_price" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required"style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_paypal_price" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_range_min'] . '" name="' . $id . '_range_minform_id_temp" id="' . $id . '_range_minform_id_temp"><input type="hidden" value="' . $param['w_range_max'] . '" name="' . $id . '_range_maxform_id_temp" id="' . $id . '_range_maxform_id_temp"><div id="' . $id . '_table_price" style="display: table;"><div id="' . $id . '_tr_price1" style="display: table-row;"><div id="' . $id . '_td_name_currency" style="display: table-cell;"><span class="wdform_colon" style="vertical-align: middle;"><!--repstart-->&nbsp;$&nbsp;<!--repend--></span></div><div id="' . $id . '_td_name_dollars" style="display: table-cell;"><input type="text" id="' . $id . '_element_dollarsform_id_temp" name="' . $id . '_element_dollarsform_id_temp" value="' . $w_first_val[0] . '" title="' . $w_title[0] . '" onkeypress="return check_isnum(event)" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled/></div><div id="' . $id . '_td_name_divider" style="display: ' . $hide_cents . ';"><span class="wdform_colon" style="vertical-align: middle;">&nbsp;.&nbsp;</span></div><div id="' . $id . '_td_name_cents" style="display: ' . $hide_cents . '"><input type="text" id="' . $id . '_element_centsform_id_temp" name="' . $id . '_element_centsform_id_temp" value="' . $w_first_val[1] . '" title="' . $w_title[1] . '" onblur="add_0(&quot;' . $id . '_element_centsform_id_temp&quot;)" onkeypress="return check_isnum_interval(event,&quot;' . $id . '_element_centsform_id_temp&quot;,0,99)"style="width: 30px;" ' . $param['attributes'] . ' disabled/></div></div><div id="' . $id . '_tr_price2" style="display: table-row;"><div style="display: table-cell;"><label class="mini_label"></label></div><div align="left" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_dollars">' . $w_mini_labels[0] . '</label></div><div id="' . $id . '_td_name_label_divider" style="display: ' . $hide_cents . '"><label class="mini_label"></label></div><div align="left" id="' . $id . '_td_name_label_cents" style="display: ' . $hide_cents . '"><label class="mini_label" id="' . $id . '_mini_label_cents">' . $w_mini_labels[1] . '</label></div></div></div></div></div>';
2293
  break;
2294
  }
2295
  case 'type_paypal_price_new': {
@@ -2341,7 +2388,7 @@ class FMModelManage_fm extends FMAdminModel {
2341
  $required_sym = ($param['w_required'] == "yes" ? " *" : "");
2342
  $currency_sumbol = ($param['w_currency'] == "yes" ? "display:none;" : "display: table-cell;");
2343
  $param['w_readonly'] = (isset($param['w_readonly']) ? $param['w_readonly'] : "no");
2344
- $rep = '<div id="wdform_field' . $id . '" type="type_paypal_price_new" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required"style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_paypal_price_new" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_readonly'] . '" name="' . $id . '_readonlyform_id_temp" id="' . $id . '_readonlyform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_range_min'] . '" name="' . $id . '_range_minform_id_temp" id="' . $id . '_range_minform_id_temp"><input type="hidden" value="' . $param['w_range_max'] . '" name="' . $id . '_range_maxform_id_temp" id="' . $id . '_range_maxform_id_temp"><div id="' . $id . '_table_price" style="display: table;"><div id="' . $id . '_tr_price1" style="display: table-row;"><div id="' . $id . '_td_name_currency" style="' . $currency_sumbol . '"><span class="wdform_colon" style="vertical-align: middle;"><!--repstart-->&nbsp;$&nbsp;<!--repend--></span></div><div id="' . $id . '_td_name_dollars" style="display: table-cell;"><input type="text" id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" value="' . $param['w_first_val'] . '" title="' . $param['w_title'] . '" placeholder="' . $param['w_title'] . '" onkeypress="return check_isnum(event)" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled/></div></div></div></div></div>';
2345
  break;
2346
  }
2347
  case 'type_paypal_select': {
@@ -3347,7 +3394,7 @@ class FMModelManage_fm extends FMAdminModel {
3347
  $param['w_func'] = explode('***', $param['w_func']);
3348
  $rep .= '<div id="wdform_field' . $id . '" type="type_button" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: table-cell;"><span id="' . $id . '_element_labelform_id_temp" style="display: none;">button_' . $id . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: table-cell;"><input type="hidden" value="type_button" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp">';
3349
  foreach ( $param['w_title'] as $key => $title ) {
3350
- $rep .= '<button type="button" class="button button-secondary button-large" id="' . $id . '_elementform_id_temp' . $key . '" name="' . $id . '_elementform_id_temp' . $key . '" value="' . $title . '" onclick="' . $param['w_func'][$key] . '" ' . $param['attributes'] . '>' . $title . '</button>';
3351
  }
3352
  $rep .= '</div></div>';
3353
  break;
@@ -3362,6 +3409,12 @@ class FMModelManage_fm extends FMAdminModel {
3362
  return $row;
3363
  }
3364
 
 
 
 
 
 
 
3365
  public function get_theme_rows_data( $old = '' ) {
3366
  global $wpdb;
3367
  $rows = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker_themes ORDER BY `default` DESC, `version` DESC, `id` ASC");
@@ -3369,21 +3422,39 @@ class FMModelManage_fm extends FMAdminModel {
3369
  return $rows;
3370
  }
3371
 
3372
- public function get_queries_rows_data( $id ) {
 
 
 
 
 
 
3373
  global $wpdb;
3374
  $rows = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker_query WHERE form_id=" . $id . " ORDER BY id ASC");
3375
 
3376
  return $rows;
3377
  }
3378
 
3379
- public function get_labels( $id ) {
 
 
 
 
 
 
3380
  global $wpdb;
3381
  $rows = $wpdb->get_col("SELECT DISTINCT `element_label` FROM " . $wpdb->prefix . "formmaker_submits WHERE form_id=" . $id);
3382
 
3383
  return $rows;
3384
  }
3385
 
3386
- public function is_paypal( $id ) {
 
 
 
 
 
 
3387
  global $wpdb;
3388
  $rows = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker_sessions WHERE form_id=" . $id);
3389
 
@@ -3418,7 +3489,7 @@ class FMModelManage_fm extends FMAdminModel {
3418
  *
3419
  * @return string
3420
  */
3421
- public function get_display_options( $id ) {
3422
  global $wpdb;
3423
  $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_display_options WHERE form_id="%d"', $id));
3424
  if ( !$row ) {
@@ -3441,7 +3512,7 @@ class FMModelManage_fm extends FMAdminModel {
3441
  $row->scrollbox_closing = 1;
3442
  $row->scrollbox_minimize = 1;
3443
  $row->scrollbox_minimize_text = '';
3444
- $row->display_on = 'everything';
3445
  $row->posts_include = '';
3446
  $row->pages_include = '';
3447
  $row->display_on_categories = '';
@@ -3452,6 +3523,29 @@ class FMModelManage_fm extends FMAdminModel {
3452
  return $row;
3453
  }
3454
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3455
  public function fm_posts_query() {
3456
  $default_post_types = array( 'post', 'page' );
3457
  $custom_post_types = get_post_types(array(
@@ -3475,13 +3569,15 @@ class FMModelManage_fm extends FMAdminModel {
3475
  }
3476
  $results = array();
3477
  foreach ( $posts as $post ) {
3478
- $results[(int) $post->ID] = array(
3479
- 'title' => trim(esc_html(strip_tags(get_the_title($post)))),
3480
- 'post_type' => $post->post_type,
3481
- );
 
 
 
3482
  }
3483
  wp_reset_postdata();
3484
-
3485
  return $results;
3486
  }
3487
 
@@ -3507,7 +3603,7 @@ class FMModelManage_fm extends FMAdminModel {
3507
  *
3508
  * @return int
3509
  */
3510
- public function get_undo_redo_id( $backup_id, $id, $type ) {
3511
  global $wpdb;
3512
  if ( $type == 1 ) {
3513
  $query = "SELECT backup_id FROM " . $wpdb->prefix . "formmaker_backup WHERE backup_id > $backup_id AND id = $id ORDER BY backup_id ASC LIMIT 0 , 1 ";
@@ -3527,7 +3623,7 @@ class FMModelManage_fm extends FMAdminModel {
3527
  *
3528
  * @return int
3529
  */
3530
- public function get_max_row( $table, $column ) {
3531
  global $wpdb;
3532
  $query = "SELECT max(" . $column . ") FROM " . $wpdb->prefix . $table;
3533
 
@@ -3541,7 +3637,7 @@ class FMModelManage_fm extends FMAdminModel {
3541
  *
3542
  * @return bool
3543
  */
3544
- public function delete_formmaker_query( $id ) {
3545
  global $wpdb;
3546
  $query = 'DELETE FROM ' . $wpdb->prefix . 'formmaker_query WHERE id =' . $id;
3547
  return $wpdb->query($query);
@@ -3564,7 +3660,7 @@ class FMModelManage_fm extends FMAdminModel {
3564
  *
3565
  * @return bool
3566
  */
3567
- public function update_data( $table, $data_params = array(), $where_data_params = array() ) {
3568
  global $wpdb;
3569
  return $wpdb->update($wpdb->prefix . $table, $data_params, $where_data_params);
3570
  }
@@ -3573,11 +3669,11 @@ class FMModelManage_fm extends FMAdminModel {
3573
  * Get request value.
3574
  *
3575
  * @param string $table
3576
- * @param array $data
3577
  *
3578
- * @return array
3579
  */
3580
- public function insert_data_to_db( $table, $data ) {
3581
  global $wpdb;
3582
  $query = $wpdb->insert($wpdb->prefix . $table, $data);
3583
  $wpdb->show_errors();
@@ -3603,7 +3699,7 @@ class FMModelManage_fm extends FMAdminModel {
3603
  *
3604
  * @return bool
3605
  */
3606
- public function replace_display_options( $data ) {
3607
  global $wpdb;
3608
 
3609
  return $wpdb->replace($wpdb->prefix . 'formmaker_display_options', $data);
@@ -3617,7 +3713,7 @@ class FMModelManage_fm extends FMAdminModel {
3617
  *
3618
  * @return int
3619
  */
3620
- public function get_prev_backup_id( $backup_id, $id ) {
3621
  global $wpdb;
3622
  $query = "SELECT backup_id FROM " . $wpdb->prefix . "formmaker_backup WHERE backup_id < " . $backup_id . " AND id = " . $id . " ORDER BY backup_id DESC LIMIT 0 , 1 ";
3623
 
@@ -3632,14 +3728,14 @@ class FMModelManage_fm extends FMAdminModel {
3632
  *
3633
  * @return int
3634
  */
3635
- public function get_backup_id( $backup_id, $id ) {
3636
  global $wpdb;
3637
  $query = "SELECT backup_id FROM " . $wpdb->prefix . "formmaker_backup WHERE backup_id > " . $backup_id . " AND id = " . $id . " ORDER BY backup_id ASC LIMIT 0 , 1 ";
3638
 
3639
  return $wpdb->get_var($query);
3640
  }
3641
 
3642
- public function get_autogen_layout( $id ) {
3643
  global $wpdb;
3644
  $autogen_layout = $wpdb->get_var($wpdb->prepare('SELECT autogen_layout FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
3645
  return $autogen_layout == '1';
@@ -3653,7 +3749,7 @@ class FMModelManage_fm extends FMAdminModel {
3653
  *
3654
  * @return int
3655
  */
3656
- public function get_count( $params ) {
3657
  global $wpdb;
3658
  $query = "SELECT count(" . $params['selection'] . ") FROM " . $wpdb->prefix . $params['table'];
3659
  if ( isset($params['where']) ) {
@@ -3671,7 +3767,7 @@ class FMModelManage_fm extends FMAdminModel {
3671
  *
3672
  * @return array
3673
  */
3674
- public function delete_rows( $params ) {
3675
  global $wpdb;
3676
  $query = "DELETE FROM " . $wpdb->prefix . $params['table'];
3677
  if ( isset($params['where']) ) {
@@ -3691,12 +3787,12 @@ class FMModelManage_fm extends FMAdminModel {
3691
  * Get row(s) from db.
3692
  *
3693
  * @param string $get_type
3694
- * @param array $params
3695
  * params = [selection, table, where, order_by, limit]
3696
  *
3697
  * @return array
3698
  */
3699
- public function select_rows( $get_type, $params ) {
3700
  global $wpdb;
3701
  $query = "SELECT " . $params['selection'] . " FROM " . $wpdb->prefix . $params['table'];
3702
  if ( isset($params['where']) ) {
@@ -3718,7 +3814,10 @@ class FMModelManage_fm extends FMAdminModel {
3718
  return $wpdb->get_row($query);
3719
  }
3720
 
3721
- public function create_js( $form_id ) {
 
 
 
3722
  WDW_FM_Library(self::PLUGIN)->create_js($form_id, true);
3723
  $jsversion = rand();
3724
  global $wpdb;
@@ -3735,9 +3834,9 @@ class FMModelManage_fm extends FMAdminModel {
3735
  *
3736
  * @return bool
3737
  */
3738
- public function insert_formmaker_backup( $backup_id, $id ) {
3739
  global $wpdb;
3740
- $query = "INSERT INTO " . $wpdb->prefix . "formmaker_backup (backup_id, cur, id, title, `type`, mail, form_front, theme, javascript, submit_text, url, submit_text_type, script_mail, script_mail_user, counter, published, label_order, label_order_current, article_id, pagination, show_title, show_numbers, public_key, private_key, recaptcha_theme, paypal_mode, checkout_mode, paypal_email, payment_currency, tax, form_fields, savedb, sendemail, requiredmark, from_mail, from_name, reply_to, send_to, autogen_layout, custom_front, mail_from_user, mail_from_name_user, reply_to_user, `condition`, mail_cc, mail_cc_user, mail_bcc, mail_bcc_user, mail_subject, mail_subject_user, mail_mode, mail_mode_user, mail_attachment, mail_attachment_user, user_id_wd, sortable, frontend_submit_fields, frontend_submit_stat_fields, mail_emptyfields, mail_verify, mail_verify_expiretime, mail_verification_post_id, save_uploads, header_title, header_description, header_image_url, header_image_animation, header_hide_image) SELECT " . $backup_id . ", 1, formmakerbkup.id, formmakerbkup.title, formmakerbkup.type, formmakerbkup.mail, formmakerbkup.form_front, formmakerbkup.theme, formmakerbkup.javascript, formmakerbkup.submit_text, formmakerbkup.url, formmakerbkup.submit_text_type, formmakerbkup.script_mail, formmakerbkup.script_mail_user, formmakerbkup.counter, formmakerbkup.published, formmakerbkup.label_order, formmakerbkup.label_order_current, formmakerbkup.article_id, formmakerbkup.pagination, formmakerbkup.show_title, formmakerbkup.show_numbers, formmakerbkup.public_key, formmakerbkup.private_key, formmakerbkup.recaptcha_theme, formmakerbkup.paypal_mode, formmakerbkup.checkout_mode, formmakerbkup.paypal_email, formmakerbkup.payment_currency, formmakerbkup.tax, formmakerbkup.form_fields, formmakerbkup.savedb, formmakerbkup.sendemail, formmakerbkup.requiredmark, formmakerbkup.from_mail, formmakerbkup.from_name, formmakerbkup.reply_to, formmakerbkup.send_to, formmakerbkup.autogen_layout, formmakerbkup.custom_front, formmakerbkup.mail_from_user, formmakerbkup.mail_from_name_user, formmakerbkup.reply_to_user, formmakerbkup.condition, formmakerbkup.mail_cc, formmakerbkup.mail_cc_user, formmakerbkup.mail_bcc, formmakerbkup.mail_bcc_user, formmakerbkup.mail_subject, formmakerbkup.mail_subject_user, formmakerbkup.mail_mode, formmakerbkup.mail_mode_user, formmakerbkup.mail_attachment, formmakerbkup.mail_attachment_user, formmakerbkup.user_id_wd, formmakerbkup.sortable, formmakerbkup.frontend_submit_fields, formmakerbkup.frontend_submit_stat_fields, formmakerbkup.mail_emptyfields, formmakerbkup.mail_verify, formmakerbkup.mail_verify_expiretime, formmakerbkup.mail_verification_post_id, formmakerbkup.save_uploads, formmakerbkup.header_title, formmakerbkup.header_description, formmakerbkup.header_image_url, formmakerbkup.header_image_animation, formmakerbkup.header_hide_image FROM " . $wpdb->prefix . "formmaker as formmakerbkup WHERE id=" . $id;
3741
 
3742
  return $wpdb->query($query);
3743
  }
@@ -3749,7 +3848,7 @@ class FMModelManage_fm extends FMAdminModel {
3749
  *
3750
  * @return bool
3751
  */
3752
- public function update_emailverification_id( $id ) {
3753
  global $wpdb;
3754
  $sql = "UPDATE " . $wpdb->prefix . "formmaker SET mail_verification_post_id = " . $id . " WHERE mail_verification_post_id != 0";
3755
 
@@ -3763,7 +3862,7 @@ class FMModelManage_fm extends FMAdminModel {
3763
  *
3764
  * @return bool
3765
  */
3766
- public function check_mailverification_id_posts_vs_fm( $id ) {
3767
  global $wpdb;
3768
  $rows = $wpdb->get_results('SELECT mail_verification_post_id FROM ' . $wpdb->prefix . 'formmaker WHERE mail_verification_post_id = ' . $id);
3769
  if ( $rows ) {
4
  * Class FMModelManage_fm
5
  */
6
  class FMModelManage_fm extends FMAdminModel {
7
+
8
  /**
9
  * Get forms.
10
  *
12
  *
13
  * @return array|null|object
14
  */
15
+ public function get_rows_data( $params = array() ) {
16
  $order = $params['order'];
17
  $orderby = $params['orderby'];
18
  $items_per_page = $params['items_per_page'];
39
  return $rows;
40
  }
41
 
42
+ /**
43
+ * Get row data.
44
+ *
45
+ * @param int $id
46
+ * @return stdClass
47
+ */
48
+ public function get_row_data( $id = 0 ) {
49
  global $wpdb;
50
  if ( $id != 0 ) {
51
  $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
52
+ if ( $row ) {
53
+ $row->save_ip = 1;
54
+ $row->save_user_id = 1;
55
+ if ( isset($row->privacy) ) {
56
+ if ( $row->privacy ) {
57
+ $privacy = json_decode($row->privacy);
58
+ $row->save_ip = isset($privacy->save_ip) ? $privacy->save_ip : 1;
59
+ $row->save_user_id = isset($privacy->save_user_id) ? $privacy->save_user_id : 1;
60
+ }
61
+ }
62
+ }
63
  }
64
  else {
65
  // Add "Submit" button to new forms.
115
  $row->header_image_url = '';
116
  $row->header_image_animation = '';
117
  $row->header_hide_image = '';
118
+ $row->save_ip = 1;
119
+ $row->save_user_id = 1;
120
  }
121
 
122
  return $row;
123
  }
124
 
125
+ /**
126
+ * get row data new.
127
+ *
128
+ * @param int $id
129
+ * @return stdClass
130
+ */
131
+ public function get_row_data_new( $id = 0 ) {
132
  global $wpdb;
133
  if ( $id != 0 ) {
134
  $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_backup WHERE backup_id="%d"', $id));
135
+ if ( $row ) {
136
+ $row->save_ip = 1;
137
+ $row->save_user_id = 1;
138
+ if ( isset($row->privacy) ) {
139
+ if ( $row->privacy ) {
140
+ $privacy = json_decode($row->privacy);
141
+ $row->save_ip = isset($privacy->save_ip) ? $privacy->save_ip : 1;
142
+ $row->save_user_id = isset($privacy->save_user_id) ? $privacy->save_user_id : 1;
143
+ }
144
+ }
145
+ }
146
  }
147
  else {
148
  // Add "Submit" button to new forms.
217
  $row->mail_emptyfields = 0;
218
  $row->mail_verify = 0;
219
  $row->mail_verify_expiretime = 0;
220
+ $row->mail_verification_post_id = 0;
221
+ $row->save_ip = 1;
222
+ $row->save_user_id = 1;
223
  }
224
 
225
  $labels2 = array();
287
  case 'type_recaptcha': {
288
  $arrows = '<div id="wdform_arrows' . $id . '" class="wdform_arrows" style="display: none;">
289
  <div class="wdform_arrows_basic wdform_arrows_container">
290
+ <span id="edit_' . $id . '" valign="middle" class="element_toolbar">
291
  <span title="Edit the field" class="page_toolbar dashicons dashicons-edit" onclick="edit(&quot;' . $id . '&quot;)"></span>
292
  </span>
293
  <span id="duplicate_' . $id . '" valign="middle" class="element_toolbar"></span>
295
  <span title="Remove the field" class="page_toolbar dashicons dashicons-no-alt" onclick="remove_row(&quot;' . $id . '&quot;)"></span>
296
  </span>
297
  </div>
298
+ <div class="wdform_arrows_advanced wdform_arrows_container" style="display: none;">
299
  <span id="left_' . $id . '" valign="middle" class="element_toolbar">
300
  <span title="Move the field to the left" class="page_toolbar dashicons dashicons-arrow-left-alt" onclick="left_row(&quot;' . $id . '&quot;)"></span>
301
  </span>
330
  <span title="Remove the field" class="page_toolbar dashicons dashicons-no-alt" onclick="remove_row(&quot;' . $id . '&quot;)"></span>
331
  </span>
332
  </div>
333
+ <div class="wdform_arrows_advanced wdform_arrows_container" style="display: none;">
334
  <span id="left_' . $id . '" valign="middle" class="element_toolbar">
335
  <span title="Move the field to the left" class="page_toolbar dashicons dashicons-arrow-left-alt" onclick="left_row(&quot;' . $id . '&quot;)"></span>
336
  </span>
493
  $param['w_readonly'] = (isset($param['w_readonly']) ? $param['w_readonly'] : "no");
494
  $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
495
  $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
496
+ $rep = '<div id="wdform_field' . $id . '" type="type_text" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" style="display: ' . $param['w_field_label_pos'] . '"><input type="hidden" value="type_text" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp" /><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp" /><input type="hidden" value="' . $param['w_readonly'] . '" name="' . $id . '_readonlyform_id_temp" id="' . $id . '_readonlyform_id_temp"/><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_regExp_status'] . '" name="' . $id . '_regExpStatusform_id_temp" id="' . $id . '_regExpStatusform_id_temp"><input type="hidden" value="' . $param['w_regExp_value'] . '" name="' . $id . '_regExp_valueform_id_temp" id="' . $id . '_regExp_valueform_id_temp"><input type="hidden" value="' . $param['w_regExp_common'] . '" name="' . $id . '_regExp_commonform_id_temp" id="' . $id . '_regExp_commonform_id_temp"><input type="hidden" value="' . $param['w_regExp_alert'] . '" name="' . $id . '_regExp_alertform_id_temp" id="' . $id . '_regExp_alertform_id_temp"><input type="hidden" value="' . $param['w_regExp_arg'] . '" name="' . $id . '_regArgumentform_id_temp" id="' . $id . '_regArgumentform_id_temp"><input type="hidden" value="' . $param['w_unique'] . '" name="' . $id . '_uniqueform_id_temp" id="' . $id . '_uniqueform_id_temp" /><input type="text" id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" value="' . htmlentities($param['w_first_val'], ENT_COMPAT) . '" title="' . htmlentities($param['w_title'], ENT_COMPAT) . '" placeholder="' . htmlentities($param['w_title'], ENT_COMPAT) . '" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled /></div></div>';
497
  break;
498
  }
499
  case 'type_number': {
522
  }
523
  $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
524
  $required_sym = ($param['w_required'] == "yes" ? " *" : "");
525
+ $rep = '<div id="wdform_field' . $id . '" type="type_number" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '"><input type="hidden" value="type_number" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_unique'] . '" name="' . $id . '_uniqueform_id_temp" id="' . $id . '_uniqueform_id_temp"><input type="text" id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" value="' . htmlentities($param['w_first_val'], ENT_COMPAT) . '" title="' . htmlentities($param['w_title'], ENT_COMPAT) . '" onkeypress="return check_isnum(event)" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled /></div></div>';
526
  break;
527
  }
528
  case 'type_password': {
646
  $required_sym = ($param['w_required'] == "yes" ? " *" : "");
647
  $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
648
  $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
649
+ $rep = '<div id="wdform_field' . $id . '" type="type_textarea" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '"><input type="hidden" value="type_textarea" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_unique'] . '" name="' . $id . '_uniqueform_id_temp" id="' . $id . '_uniqueform_id_temp"><textarea id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" title="' . htmlentities($param['w_title'], ENT_COMPAT) . '" placeholder="' . htmlentities($param['w_title'], ENT_COMPAT) . '" style="width: ' . $param['w_size_w'] . 'px; height: ' . $param['w_size_h'] . 'px;" ' . $param['attributes'] . ' disabled>' . htmlentities($param['w_first_val'], ENT_COMPAT) . '</textarea></div></div>';
650
  break;
651
  }
652
  case 'type_phone': {
695
  $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
696
  $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
697
  $required_sym = ($param['w_required'] == "yes" ? " *" : "");
698
+ $rep = '<div id="wdform_field' . $id . '" type="type_phone" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_phone" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_unique'] . '" name="' . $id . '_uniqueform_id_temp" id="' . $id . '_uniqueform_id_temp"><div id="' . $id . '_table_name" style="display: table;"><div id="' . $id . '_tr_name1" style="display: table-row;"><div id="' . $id . '_td_name_input_first" style="display: table-cell;"><input type="text" id="' . $id . '_element_firstform_id_temp" name="' . $id . '_element_firstform_id_temp" value="' . htmlentities($w_first_val[0], ENT_COMPAT) . '" title="' . htmlentities($w_title[0], ENT_COMPAT) . '" placeholder="' . htmlentities($w_title[0], ENT_COMPAT) . '" onkeypress="return check_isnum(event)"style="width: 50px;" ' . $param['attributes'] . ' disabled /><span class="wdform_line" style="margin: 0px 4px; padding: 0px;">-</span></div><div id="' . $id . '_td_name_input_last" style="display: table-cell;"><input type="text" id="' . $id . '_element_lastform_id_temp" name="' . $id . '_element_lastform_id_temp" value="' . htmlentities($w_first_val[1], ENT_COMPAT) . '" title="' . htmlentities($w_title[1], ENT_COMPAT) . '" placeholder="' . htmlentities($w_title[1], ENT_COMPAT) . '" onkeypress="return check_isnum(event)"style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled /></div></div><div id="' . $id . '_tr_name2" style="display: table-row;"><div id="' . $id . '_td_name_label_first" align="left" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_area_code">' . $w_mini_labels[0] . '</label></div><div id="' . $id . '_td_name_label_last" align="left" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_phone_number">' . $w_mini_labels[1] . '</label></div></div></div></div></div>';
699
  break;
700
  }
701
  case 'type_phone_new': {
727
  $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
728
  $display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
729
  $required_sym = ($param['w_required'] == "yes" ? " *" : "");
730
+ $rep = '<div id="wdform_field' . $id . '" type="type_phone_new" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_phone_new" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"><input type="hidden" value="' . $param['w_unique'] . '" name="' . $id . '_uniqueform_id_temp" id="' . $id . '_uniqueform_id_temp"><div id="' . $id . '_table_name" style="display: table;"><div id="' . $id . '_tr_name1" style="display: table-row;"><div id="' . $id . '_td_name_input_first" style="display: table-cell;"><input type="text" id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" value="' . htmlentities($param['w_first_val'], ENT_COMPAT) . '" top-country = "' . $param['w_top_country'] . '" onkeypress="return check_isnum(&quot;' . $id . '_elementform_id_temp&quot;)" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled></div></div></div></div></div>';
731
  break;
732
  }
733
  case 'type_name': {
814
  $param['w_name_fields'] = isset($param['w_name_fields']) ? $param['w_name_fields'] : ($param['w_name_format'] == 'normal' ? 'no***no' : 'yes***yes');
815
  $w_name_fields = explode('***', $param['w_name_fields']);
816
  $param['w_autofill'] = isset($param['w_autofill']) ? $param['w_autofill'] : 'no';
817
+ $w_name_format = '<div id="' . $id . '_td_name_input_first" style="display: table-cell;"><input type="text" id="' . $id . '_element_firstform_id_temp" name="' . $id . '_element_firstform_id_temp" value="' . htmlentities($w_first_val[0], ENT_COMPAT) . '" title="' . htmlentities($w_title[0], ENT_COMPAT) . '" placeholder="' . htmlentities($w_title[0], ENT_COMPAT) . '" style="margin-right: 10px; width: ' . $param['w_size'] . 'px;"' . $param['attributes'] . ' disabled /></div><div id="' . $id . '_td_name_input_last" style="display: table-cell;"><input type="text" id="' . $id . '_element_lastform_id_temp" name="' . $id . '_element_lastform_id_temp" value="' . htmlentities($w_first_val[1], ENT_COMPAT) . '" title="' . htmlentities($w_title[1], ENT_COMPAT) . '" placeholder="' . htmlentities($w_title[1], ENT_COMPAT) . '" style="margin-right: 10px; width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled /></div>';
818
  $w_name_format_mini_labels = '<div id="' . $id . '_td_name_label_first" align="left" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_first">' . $w_mini_labels[1] . '</label></div><div id="' . $id . '_td_name_label_last" align="left" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_last">' . $w_mini_labels[2] . '</label></div>';
819
  if ( $w_name_fields[0] == 'yes' ) {
820
+ $w_name_format = '<div id="' . $id . '_td_name_input_title" style="display: table-cell;"><input type="text" id="' . $id . '_element_titleform_id_temp" name="' . $id . '_element_titleform_id_temp" value="' . htmlentities($w_first_val[2], ENT_COMPAT) . '" title="' . htmlentities($w_title[2], ENT_COMPAT) . '" style="margin: 0px 10px 0px 0px; width: 40px;" disabled /></div>' . $w_name_format;
821
  $w_name_format_mini_labels = '<div id="' . $id . '_td_name_label_title" align="left" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_title">' . $w_mini_labels[0] . '</label></div>' . $w_name_format_mini_labels;
822
  }
823
  if ( $w_name_fields[1] == 'yes' ) {
824
+ $w_name_format = $w_name_format . '<div id="' . $id . '_td_name_input_middle" style="display: table-cell;"><input type="text" id="' . $id . '_element_middleform_id_temp" name="' . $id . '_element_middleform_id_temp" value="' . htmlentities($w_first_val[3], ENT_COMPAT) . '" title="' . htmlentities($w_title[3], ENT_COMPAT) . '" style="width: ' . $param['w_size'] . 'px;" disabled /></div>';
825
  $w_name_format_mini_labels = $w_name_format_mini_labels . '<div id="' . $id . '_td_name_label_middle" align="left" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_middle">' . $w_mini_labels[3] . '</label></div>';
826
  }
827
  $rep = '<div id="wdform_field' . $id . '" type="type_name" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_name" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_unique'] . '" name="' . $id . '_uniqueform_id_temp" id="' . $id . '_uniqueform_id_temp"><input type="hidden" value="' . $param['w_autofill'] . '" name="' . $id . '_autofillform_id_temp" id="' . $id . '_autofillform_id_temp"><input type="hidden" name="' . $id . '_enable_fieldsform_id_temp" id="' . $id . '_enable_fieldsform_id_temp" title="' . $w_name_fields[0] . '" first="yes" last="yes" middle="' . $w_name_fields[1] . '"><div id="' . $id . '_table_name" cellpadding="0" cellspacing="0" style="display: table;"><div id="' . $id . '_tr_name1" style="display: table-row;">' . $w_name_format . '</div><div id="' . $id . '_tr_name2" style="display: table-row;">' . $w_name_format_mini_labels . '</div></div></div></div>';
1007
  $param['w_verification_label'] = isset($param['w_verification_label']) ? $param['w_verification_label'] : "E-mail confirmation:";
1008
  $param['w_verification_placeholder'] = isset($param['w_verification_placeholder']) ? $param['w_verification_placeholder'] : "";
1009
  $confirm_emeil = '<br><div align="left" id="' . $id . '_1_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label_confirm . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_1_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $param['w_verification_label'] . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_1_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_element_confirm . ';"><input type="hidden" value="' . $param['w_verification'] . '" name="' . $id . '_verification_id_temp" id="' . $id . '_verification_id_temp"><input type="text" id="' . $id . '_1_elementform_id_temp" name="' . $id . '_1_elementform_id_temp" value="' . $param['w_verification_placeholder'] . '" title="' . $param['w_verification_placeholder'] . '" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled /></div>';
1010
+ $rep = '<div id="wdform_field' . $id . '" type="type_submitter_mail" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_submitter_mail" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_unique'] . '" name="' . $id . '_uniqueform_id_temp" id="' . $id . '_uniqueform_id_temp"><input type="hidden" value="' . $param['w_autofill'] . '" name="' . $id . '_autofillform_id_temp" id="' . $id . '_autofillform_id_temp"><input type="hidden" value="' . $param['w_verification'] . '" name="' . $id . '_verification_id_temp" id="' . $id . '_verification_id_temp"><input type="text" id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" value="' . htmlentities($param['w_first_val'], ENT_COMPAT) . '" title="' . htmlentities($param['w_title'], ENT_COMPAT) . '" placeholder="' . htmlentities($param['w_title'], ENT_COMPAT) . '" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled /></div>' . $confirm_emeil . '</div>';
1011
  break;
1012
  }
1013
  case 'type_checkbox': {
1122
  else {
1123
  $choise_value = $param['w_choices'][(int) $param['w_rowcol'] * $l + $i];
1124
  }
1125
+ $choise_value = htmlentities($choise_value, ENT_COMPAT);
1126
  if ( isset($param['w_choices_params']) && $param['w_choices_params'][(int) $param['w_rowcol'] * $l + $i] ) {
1127
  $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][(int) $param['w_rowcol'] * $l + $i]);
1128
  $where = 'where="' . $w_choices_params[0] . '"';
1155
  else {
1156
  $choise_value = $param['w_choices'][(int) $param['w_rowcol'] * $i + $l];
1157
  }
1158
+ $choise_value = htmlentities($choise_value, ENT_COMPAT);
1159
  if ( isset($param['w_choices_params']) && $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l] ) {
1160
  $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l]);
1161
  $where = 'where="' . $w_choices_params[0] . '"';
1183
  else {
1184
  $choise_value = $param['w_choices'][(int) $param['w_rowcol'] * $i + $l];
1185
  }
1186
+ $choise_value = htmlentities($choise_value, ENT_COMPAT);
1187
  if ( isset($param['w_choices_params']) && $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l] ) {
1188
  $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l]);
1189
  $where = 'where="' . $w_choices_params[0] . '"';
1214
  else {
1215
  $choise_value = $param['w_choices'][$l];
1216
  }
1217
+ $choise_value = htmlentities($choise_value, ENT_COMPAT);
1218
  if ( isset($param['w_choices_params']) && $param['w_choices_params'][$l] ) {
1219
  $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$l]);
1220
  $where = 'where="' . $w_choices_params[0] . '"';
1343
  else {
1344
  $choise_value = $param['w_choices'][(int) $param['w_rowcol'] * $l + $i];
1345
  }
1346
+ $choise_value = htmlentities($choise_value, ENT_COMPAT);
1347
  if ( isset($param['w_choices_params']) && $param['w_choices_params'][(int) $param['w_rowcol'] * $l + $i] ) {
1348
  $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][(int) $param['w_rowcol'] * $l + $i]);
1349
  $where = 'where="' . $w_choices_params[0] . '"';
1376
  else {
1377
  $choise_value = $param['w_choices'][(int) $param['w_rowcol'] * $i + $l];
1378
  }
1379
+ $choise_value = htmlentities($choise_value, ENT_COMPAT);
1380
  if ( isset($param['w_choices_params']) && $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l] ) {
1381
  $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l]);
1382
  $where = 'where="' . $w_choices_params[0] . '"';
1403
  else {
1404
  $choise_value = $param['w_choices'][(int) $param['w_rowcol'] * $i + $l];
1405
  }
1406
+ $choise_value = htmlentities($choise_value, ENT_COMPAT);
1407
  if ( isset($param['w_choices_params']) && $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l] ) {
1408
  $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l]);
1409
  $where = 'where="' . $w_choices_params[0] . '"';
1434
  else {
1435
  $choise_value = $param['w_choices'][$l];
1436
  }
1437
+ $choise_value = htmlentities($choise_value, ENT_COMPAT);
1438
  if ( isset($param['w_choices_params']) && $param['w_choices_params'][$l] ) {
1439
  $w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$l]);
1440
  $where = 'where="' . $w_choices_params[0] . '"';
2336
  $w_first_val = explode('***', $param['w_first_val']);
2337
  $w_title = explode('***', $param['w_title']);
2338
  $w_mini_labels = explode('***', $param['w_mini_labels']);
2339
+ $rep = '<div id="wdform_field' . $id . '" type="type_paypal_price" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required"style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_paypal_price" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_range_min'] . '" name="' . $id . '_range_minform_id_temp" id="' . $id . '_range_minform_id_temp"><input type="hidden" value="' . $param['w_range_max'] . '" name="' . $id . '_range_maxform_id_temp" id="' . $id . '_range_maxform_id_temp"><div id="' . $id . '_table_price" style="display: table;"><div id="' . $id . '_tr_price1" style="display: table-row;"><div id="' . $id . '_td_name_currency" style="display: table-cell;"><span class="wdform_colon" style="vertical-align: middle;"><!--repstart-->&nbsp;$&nbsp;<!--repend--></span></div><div id="' . $id . '_td_name_dollars" style="display: table-cell;"><input type="text" id="' . $id . '_element_dollarsform_id_temp" name="' . $id . '_element_dollarsform_id_temp" value="' . htmlentities($w_first_val[0], ENT_COMPAT) . '" title="' . htmlentities($w_title[0], ENT_COMPAT) . '" onkeypress="return check_isnum(event)" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled/></div><div id="' . $id . '_td_name_divider" style="display: ' . $hide_cents . ';"><span class="wdform_colon" style="vertical-align: middle;">&nbsp;.&nbsp;</span></div><div id="' . $id . '_td_name_cents" style="display: ' . $hide_cents . '"><input type="text" id="' . $id . '_element_centsform_id_temp" name="' . $id . '_element_centsform_id_temp" value="' . htmlentities($w_first_val[1], ENT_COMPAT) . '" title="' . htmlentities($w_title[1], ENT_COMPAT) . '" onblur="add_0(&quot;' . $id . '_element_centsform_id_temp&quot;)" onkeypress="return check_isnum_interval(event,&quot;' . $id . '_element_centsform_id_temp&quot;,0,99)"style="width: 30px;" ' . $param['attributes'] . ' disabled/></div></div><div id="' . $id . '_tr_price2" style="display: table-row;"><div style="display: table-cell;"><label class="mini_label"></label></div><div align="left" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_dollars">' . $w_mini_labels[0] . '</label></div><div id="' . $id . '_td_name_label_divider" style="display: ' . $hide_cents . '"><label class="mini_label"></label></div><div align="left" id="' . $id . '_td_name_label_cents" style="display: ' . $hide_cents . '"><label class="mini_label" id="' . $id . '_mini_label_cents">' . $w_mini_labels[1] . '</label></div></div></div></div></div>';
2340
  break;
2341
  }
2342
  case 'type_paypal_price_new': {
2388
  $required_sym = ($param['w_required'] == "yes" ? " *" : "");
2389
  $currency_sumbol = ($param['w_currency'] == "yes" ? "display:none;" : "display: table-cell;");
2390
  $param['w_readonly'] = (isset($param['w_readonly']) ? $param['w_readonly'] : "no");
2391
+ $rep = '<div id="wdform_field' . $id . '" type="type_paypal_price_new" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required"style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_paypal_price_new" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_readonly'] . '" name="' . $id . '_readonlyform_id_temp" id="' . $id . '_readonlyform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_range_min'] . '" name="' . $id . '_range_minform_id_temp" id="' . $id . '_range_minform_id_temp"><input type="hidden" value="' . $param['w_range_max'] . '" name="' . $id . '_range_maxform_id_temp" id="' . $id . '_range_maxform_id_temp"><div id="' . $id . '_table_price" style="display: table;"><div id="' . $id . '_tr_price1" style="display: table-row;"><div id="' . $id . '_td_name_currency" style="' . $currency_sumbol . '"><span class="wdform_colon" style="vertical-align: middle;"><!--repstart-->&nbsp;$&nbsp;<!--repend--></span></div><div id="' . $id . '_td_name_dollars" style="display: table-cell;"><input type="text" id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" value="' . htmlentities($param['w_first_val'], ENT_COMPAT) . '" title="' . htmlentities($param['w_title'], ENT_COMPAT) . '" placeholder="' . htmlentities($param['w_title'], ENT_COMPAT) . '" onkeypress="return check_isnum(event)" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled/></div></div></div></div></div>';
2392
  break;
2393
  }
2394
  case 'type_paypal_select': {
3394
  $param['w_func'] = explode('***', $param['w_func']);
3395
  $rep .= '<div id="wdform_field' . $id . '" type="type_button" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: table-cell;"><span id="' . $id . '_element_labelform_id_temp" style="display: none;">button_' . $id . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: table-cell;"><input type="hidden" value="type_button" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp">';
3396
  foreach ( $param['w_title'] as $key => $title ) {
3397
+ $rep .= '<button type="button" class="button button-secondary button-large" id="' . $id . '_elementform_id_temp' . $key . '" name="' . $id . '_elementform_id_temp' . $key . '" value="' . htmlentities($title, ENT_COMPAT) . '" onclick="' . $param['w_func'][$key] . '" ' . $param['attributes'] . '>' . $title . '</button>';
3398
  }
3399
  $rep .= '</div></div>';
3400
  break;
3409
  return $row;
3410
  }
3411
 
3412
+ /**
3413
+ * Get theme rows data.
3414
+ *
3415
+ * @param string $old
3416
+ * @return mixed
3417
+ */
3418
  public function get_theme_rows_data( $old = '' ) {
3419
  global $wpdb;
3420
  $rows = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker_themes ORDER BY `default` DESC, `version` DESC, `id` ASC");
3422
  return $rows;
3423
  }
3424
 
3425
+ /**
3426
+ * Get queries rows data.
3427
+ *
3428
+ * @param int $id
3429
+ * @return mixed
3430
+ */
3431
+ public function get_queries_rows_data( $id = 0 ) {
3432
  global $wpdb;
3433
  $rows = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker_query WHERE form_id=" . $id . " ORDER BY id ASC");
3434
 
3435
  return $rows;
3436
  }
3437
 
3438
+ /**
3439
+ * Get labels.
3440
+ *
3441
+ * @param $id
3442
+ * @return mixed
3443
+ */
3444
+ public function get_labels( $id = 0 ) {
3445
  global $wpdb;
3446
  $rows = $wpdb->get_col("SELECT DISTINCT `element_label` FROM " . $wpdb->prefix . "formmaker_submits WHERE form_id=" . $id);
3447
 
3448
  return $rows;
3449
  }
3450
 
3451
+ /**
3452
+ * Is paypal.
3453
+ *
3454
+ * @param int $id
3455
+ * @return mixed
3456
+ */
3457
+ public function is_paypal( $id = 0 ) {
3458
  global $wpdb;
3459
  $rows = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker_sessions WHERE form_id=" . $id);
3460
 
3489
  *
3490
  * @return string
3491
  */
3492
+ public function get_display_options( $id = 0 ) {
3493
  global $wpdb;
3494
  $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_display_options WHERE form_id="%d"', $id));
3495
  if ( !$row ) {
3512
  $row->scrollbox_closing = 1;
3513
  $row->scrollbox_minimize = 1;
3514
  $row->scrollbox_minimize_text = '';
3515
+ $row->display_on = 'home,post,page';
3516
  $row->posts_include = '';
3517
  $row->pages_include = '';
3518
  $row->display_on_categories = '';
3523
  return $row;
3524
  }
3525
 
3526
+ /**
3527
+ * Get all display posts.
3528
+ *
3529
+ * @return $post_types array
3530
+ */
3531
+ public function get_all_display_posts() {
3532
+ $def_post_types = array('everything' => 'All', 'home' => 'Homepage', 'archive' => 'Archives', 'post' => 'Post', 'page' => 'Page');
3533
+ $custom_post_types = get_post_types( array(
3534
+ 'public' => true,
3535
+ '_builtin' => false,
3536
+ ) );
3537
+
3538
+ if ( !empty($custom_post_types) ) {
3539
+ foreach ( WDW_FM_Library(self::PLUGIN)->not_display_posts() as $key ) {
3540
+ if ( isset($custom_post_types[$key]) ) {
3541
+ unset($custom_post_types[$key]);
3542
+ }
3543
+ }
3544
+ }
3545
+ $post_types = array_merge($def_post_types, $custom_post_types);
3546
+ return $post_types;
3547
+ }
3548
+
3549
  public function fm_posts_query() {
3550
  $default_post_types = array( 'post', 'page' );
3551
  $custom_post_types = get_post_types(array(
3569
  }
3570
  $results = array();
3571
  foreach ( $posts as $post ) {
3572
+ $post_id = (int) $post->ID;
3573
+ $post_type = $post->post_type;
3574
+ $post_title = trim(esc_html(strip_tags(get_the_title($post))));
3575
+ $results[$post_id] = array(
3576
+ 'title' => $post_title,
3577
+ 'post_type' => $post->post_type,
3578
+ );
3579
  }
3580
  wp_reset_postdata();
 
3581
  return $results;
3582
  }
3583
 
3603
  *
3604
  * @return int
3605
  */
3606
+ public function get_undo_redo_id( $backup_id = 0, $id = 0, $type = '' ) {
3607
  global $wpdb;
3608
  if ( $type == 1 ) {
3609
  $query = "SELECT backup_id FROM " . $wpdb->prefix . "formmaker_backup WHERE backup_id > $backup_id AND id = $id ORDER BY backup_id ASC LIMIT 0 , 1 ";
3623
  *
3624
  * @return int
3625
  */
3626
+ public function get_max_row( $table = '', $column = '' ) {
3627
  global $wpdb;
3628
  $query = "SELECT max(" . $column . ") FROM " . $wpdb->prefix . $table;
3629
 
3637
  *
3638
  * @return bool
3639
  */
3640
+ public function delete_formmaker_query( $id = 0 ) {
3641
  global $wpdb;
3642
  $query = 'DELETE FROM ' . $wpdb->prefix . 'formmaker_query WHERE id =' . $id;
3643
  return $wpdb->query($query);
3660
  *
3661
  * @return bool
3662
  */
3663
+ public function update_data( $table = '', $data_params = array(), $where_data_params = array() ) {
3664
  global $wpdb;
3665
  return $wpdb->update($wpdb->prefix . $table, $data_params, $where_data_params);
3666
  }
3669
  * Get request value.
3670
  *
3671
  * @param string $table
3672
+ * @param array $data
3673
  *
3674
+ * @return false|int
3675
  */
3676
+ public function insert_data_to_db( $table = '', $data = array() ) {
3677
  global $wpdb;
3678
  $query = $wpdb->insert($wpdb->prefix . $table, $data);
3679
  $wpdb->show_errors();
3699
  *
3700
  * @return bool
3701
  */
3702
+ public function replace_display_options( $data = array() ) {
3703
  global $wpdb;
3704
 
3705
  return $wpdb->replace($wpdb->prefix . 'formmaker_display_options', $data);
3713
  *
3714
  * @return int
3715
  */
3716
+ public function get_prev_backup_id( $backup_id = 0, $id = 0 ) {
3717
  global $wpdb;
3718
  $query = "SELECT backup_id FROM " . $wpdb->prefix . "formmaker_backup WHERE backup_id < " . $backup_id . " AND id = " . $id . " ORDER BY backup_id DESC LIMIT 0 , 1 ";
3719
 
3728
  *
3729
  * @return int
3730
  */
3731
+ public function get_backup_id( $backup_id = 0, $id = 0 ) {
3732
  global $wpdb;
3733
  $query = "SELECT backup_id FROM " . $wpdb->prefix . "formmaker_backup WHERE backup_id > " . $backup_id . " AND id = " . $id . " ORDER BY backup_id ASC LIMIT 0 , 1 ";
3734
 
3735
  return $wpdb->get_var($query);
3736
  }
3737
 
3738
+ public function get_autogen_layout( $id = 0 ) {
3739
  global $wpdb;
3740
  $autogen_layout = $wpdb->get_var($wpdb->prepare('SELECT autogen_layout FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
3741
  return $autogen_layout == '1';
3749
  *
3750
  * @return int
3751
  */
3752
+ public function get_count( $params = array() ) {
3753
  global $wpdb;
3754
  $query = "SELECT count(" . $params['selection'] . ") FROM " . $wpdb->prefix . $params['table'];
3755
  if ( isset($params['where']) ) {
3767
  *
3768
  * @return array
3769
  */
3770
+ public function delete_rows( $params = array() ) {
3771
  global $wpdb;
3772
  $query = "DELETE FROM " . $wpdb->prefix . $params['table'];
3773
  if ( isset($params['where']) ) {
3787
  * Get row(s) from db.
3788
  *
3789
  * @param string $get_type
3790
+ * @param array $params
3791
  * params = [selection, table, where, order_by, limit]
3792
  *
3793
  * @return array
3794
  */
3795
+ public function select_rows( $get_type = '', $params = array() ) {
3796
  global $wpdb;
3797
  $query = "SELECT " . $params['selection'] . " FROM " . $wpdb->prefix . $params['table'];
3798
  if ( isset($params['where']) ) {
3814
  return $wpdb->get_row($query);
3815
  }
3816
 
3817
+ /**
3818
+ * @param int $form_id
3819
+ */
3820
+ public function create_js( $form_id = 0) {
3821
  WDW_FM_Library(self::PLUGIN)->create_js($form_id, true);
3822
  $jsversion = rand();
3823
  global $wpdb;
3834
  *
3835
  * @return bool
3836
  */
3837
+ public function insert_formmaker_backup( $backup_id = 0, $id = 0 ) {
3838
  global $wpdb;
3839
+ $query = "INSERT INTO " . $wpdb->prefix . "formmaker_backup (backup_id, cur, id, title, `type`, mail, form_front, theme, javascript, submit_text, url, submit_text_type, script_mail, script_mail_user, counter, published, label_order, label_order_current, article_id, pagination, show_title, show_numbers, public_key, private_key, recaptcha_theme, paypal_mode, checkout_mode, paypal_email, payment_currency, tax, form_fields, savedb, sendemail, requiredmark, from_mail, from_name, reply_to, send_to, autogen_layout, custom_front, mail_from_user, mail_from_name_user, reply_to_user, `condition`, mail_cc, mail_cc_user, mail_bcc, mail_bcc_user, mail_subject, mail_subject_user, mail_mode, mail_mode_user, mail_attachment, mail_attachment_user, user_id_wd, sortable, frontend_submit_fields, frontend_submit_stat_fields, mail_emptyfields, mail_verify, mail_verify_expiretime, mail_verification_post_id, save_uploads, header_title, header_description, header_image_url, header_image_animation, header_hide_image, privacy) SELECT " . $backup_id . ", 1, formmakerbkup.id, formmakerbkup.title, formmakerbkup.type, formmakerbkup.mail, formmakerbkup.form_front, formmakerbkup.theme, formmakerbkup.javascript, formmakerbkup.submit_text, formmakerbkup.url, formmakerbkup.submit_text_type, formmakerbkup.script_mail, formmakerbkup.script_mail_user, formmakerbkup.counter, formmakerbkup.published, formmakerbkup.label_order, formmakerbkup.label_order_current, formmakerbkup.article_id, formmakerbkup.pagination, formmakerbkup.show_title, formmakerbkup.show_numbers, formmakerbkup.public_key, formmakerbkup.private_key, formmakerbkup.recaptcha_theme, formmakerbkup.paypal_mode, formmakerbkup.checkout_mode, formmakerbkup.paypal_email, formmakerbkup.payment_currency, formmakerbkup.tax, formmakerbkup.form_fields, formmakerbkup.savedb, formmakerbkup.sendemail, formmakerbkup.requiredmark, formmakerbkup.from_mail, formmakerbkup.from_name, formmakerbkup.reply_to, formmakerbkup.send_to, formmakerbkup.autogen_layout, formmakerbkup.custom_front, formmakerbkup.mail_from_user, formmakerbkup.mail_from_name_user, formmakerbkup.reply_to_user, formmakerbkup.condition, formmakerbkup.mail_cc, formmakerbkup.mail_cc_user, formmakerbkup.mail_bcc, formmakerbkup.mail_bcc_user, formmakerbkup.mail_subject, formmakerbkup.mail_subject_user, formmakerbkup.mail_mode, formmakerbkup.mail_mode_user, formmakerbkup.mail_attachment, formmakerbkup.mail_attachment_user, formmakerbkup.user_id_wd, formmakerbkup.sortable, formmakerbkup.frontend_submit_fields, formmakerbkup.frontend_submit_stat_fields, formmakerbkup.mail_emptyfields, formmakerbkup.mail_verify, formmakerbkup.mail_verify_expiretime, formmakerbkup.mail_verification_post_id, formmakerbkup.save_uploads, formmakerbkup.header_title, formmakerbkup.header_description, formmakerbkup.header_image_url, formmakerbkup.header_image_animation, formmakerbkup.header_hide_image, formmakerbkup.privacy FROM " . $wpdb->prefix . "formmaker as formmakerbkup WHERE id=" . $id;
3840
 
3841
  return $wpdb->query($query);
3842
  }
3848
  *
3849
  * @return bool
3850
  */
3851
+ public function update_emailverification_id( $id = 0 ) {
3852
  global $wpdb;
3853
  $sql = "UPDATE " . $wpdb->prefix . "formmaker SET mail_verification_post_id = " . $id . " WHERE mail_verification_post_id != 0";
3854
 
3862
  *
3863
  * @return bool
3864
  */
3865
+ public function check_mailverification_id_posts_vs_fm( $id = 0 ) {
3866
  global $wpdb;
3867
  $rows = $wpdb->get_results('SELECT mail_verification_post_id FROM ' . $wpdb->prefix . 'formmaker WHERE mail_verification_post_id = ' . $id);
3868
  if ( $rows ) {
admin/models/Options_fm.php CHANGED
@@ -8,19 +8,22 @@ class FMModelOptions_fm extends FMAdminModel {
8
  * Save data to DB.
9
  */
10
  public function save_db() {
 
 
11
  $public_key = WDW_FM_Library(self::PLUGIN)->get('public_key', '');
12
  $private_key = WDW_FM_Library(self::PLUGIN)->get('private_key', '');
13
  $csv_delimiter = (isset($_POST['csv_delimiter']) && $_POST['csv_delimiter'] != '' ? esc_html(stripslashes($_POST['csv_delimiter'])) : ',');
14
  $fm_shortcode = (isset($_POST['fm_shortcode']) ? "old" : '');
15
  $fm_advanced_layout = WDW_FM_Library(self::PLUGIN)->get('fm_advanced_layout', '0');
16
  $map_key = WDW_FM_Library(self::PLUGIN)->get('map_key', '');
17
- update_option((WDFMInstance(self::PLUGIN)->is_free == 2 ? 'fmc_settings' : 'fm_settings'), array(
18
  'public_key' => $public_key,
19
  'private_key' => $private_key,
20
  'csv_delimiter' => $csv_delimiter,
21
  'map_key' => $map_key,
22
  'fm_shortcode' => $fm_shortcode,
23
  'fm_advanced_layout' => $fm_advanced_layout,
 
24
  ));
25
  return 8;
26
  }
8
  * Save data to DB.
9
  */
10
  public function save_db() {
11
+ $option_key = (WDFMInstance(self::PLUGIN)->is_free == 2 ? 'fmc_settings' : 'fm_settings');
12
+ $fm_settings = get_option($option_key);
13
  $public_key = WDW_FM_Library(self::PLUGIN)->get('public_key', '');
14
  $private_key = WDW_FM_Library(self::PLUGIN)->get('private_key', '');
15
  $csv_delimiter = (isset($_POST['csv_delimiter']) && $_POST['csv_delimiter'] != '' ? esc_html(stripslashes($_POST['csv_delimiter'])) : ',');
16
  $fm_shortcode = (isset($_POST['fm_shortcode']) ? "old" : '');
17
  $fm_advanced_layout = WDW_FM_Library(self::PLUGIN)->get('fm_advanced_layout', '0');
18
  $map_key = WDW_FM_Library(self::PLUGIN)->get('map_key', '');
19
+ update_option( $option_key, array(
20
  'public_key' => $public_key,
21
  'private_key' => $private_key,
22
  'csv_delimiter' => $csv_delimiter,
23
  'map_key' => $map_key,
24
  'fm_shortcode' => $fm_shortcode,
25
  'fm_advanced_layout' => $fm_advanced_layout,
26
+ 'ajax_export_per_page' => !empty($fm_settings['ajax_export_per_page']) ? $fm_settings['export_per_page'] : 1000
27
  ));
28
  return 8;
29
  }
admin/models/Submissions_fm.php CHANGED
@@ -4,6 +4,7 @@
4
  * Class FMModelSubmissions_fm
5
  */
6
  class FMModelSubmissions_fm extends FMAdminModel {
 
7
  public function blocked_ips() {
8
  global $wpdb;
9
  $ips = $wpdb->get_col('SELECT ip FROM ' . $wpdb->prefix . 'formmaker_blocked');
@@ -36,7 +37,7 @@ class FMModelSubmissions_fm extends FMAdminModel {
36
  *
37
  * @return object $form
38
  */
39
- public function get_form( $id ) {
40
  global $wpdb;
41
  $query = 'SELECT `id`, `title` FROM ' . $wpdb->prefix .'formmaker WHERE id = ' . $id ;
42
  $form = $wpdb->get_row( $query );
@@ -47,10 +48,9 @@ class FMModelSubmissions_fm extends FMAdminModel {
47
  * Get subs count.
48
  *
49
  * @param int $id
50
- *
51
  * @return int $count
52
  */
53
- public function get_subs_count( $id ) {
54
  global $wpdb;
55
  $query = $wpdb->prepare("SELECT distinct group_id FROM " . $wpdb->prefix . "formmaker_submits where form_id=%d", $id);
56
  $group_id_s = $wpdb->get_col($query);
@@ -62,10 +62,9 @@ class FMModelSubmissions_fm extends FMAdminModel {
62
  * Get statistics.
63
  *
64
  * @param int $id
65
- *
66
  * @return object $statistics
67
  */
68
- public function get_statistics( $id ) {
69
  global $wpdb;
70
  $statistics = array();
71
  $query = $wpdb->prepare('SELECT count(distinct group_id) FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id ="%d"', $id);
@@ -81,16 +80,17 @@ class FMModelSubmissions_fm extends FMAdminModel {
81
  }
82
  return $statistics;
83
  }
 
84
  /*
85
  * Get labels parameters.
86
  *
87
  * @param int $form_id
88
  * @param int $page_num
89
  * @param int $per_num
90
- *
91
  * @return array $labels_parameters
92
  */
93
- public function get_labels_parameters( $form_id, $page_num=0, $per_num=0) {
 
94
  global $wpdb;
95
  $labels = array();
96
  $labels_id = array();
@@ -129,9 +129,9 @@ class FMModelSubmissions_fm extends FMAdminModel {
129
  $where_labels = array();
130
  $where2 = array();
131
  $order_by = ((isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) != '') ? esc_html(stripslashes($_POST['order_by'])) : 'group_id');
132
- $asc_or_desc = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'asc') ? 'asc' : 'desc');
133
-
134
- $lists['hide_label_list'] = ((isset($_POST['hide_label_list'])) ? esc_html(stripslashes($_POST['hide_label_list'])) : '');
135
  $lists['startdate'] = ((isset($_POST['startdate'])) ? esc_html(stripslashes($_POST['startdate'])) : '');
136
  $lists['enddate'] = ((isset($_POST['enddate'])) ? esc_html(stripslashes($_POST['enddate'])) : '');
137
  $lists['ip_search'] = ((isset($_POST['ip_search'])) ? esc_html(stripslashes($_POST['ip_search'])) : '');
@@ -306,8 +306,8 @@ class FMModelSubmissions_fm extends FMAdminModel {
306
  }
307
  $total = $wpdb->get_var($query);
308
  $query_sub_count = "SELECT count(distinct group_id) from " . $wpdb->prefix . "formmaker_submits";
309
- $sub_count = (int) $wpdb->get_var($query_sub_count);
310
- $query = $join . ' ' . $orderby . ' LIMIT ' . $page_num . ', '.$per_num;
311
  $results = $wpdb->get_results($query);
312
  for ( $i = 0; $i < count($results); $i++ ) {
313
  array_push($rows_ord, $results[$i]->group_id);
@@ -344,7 +344,14 @@ class FMModelSubmissions_fm extends FMAdminModel {
344
  return $labels_parameters;
345
  }
346
 
347
- public function get_type_address( $sorted_label_type, $sorted_label_name_original ) {
 
 
 
 
 
 
 
348
  if ( $sorted_label_type == 'type_address' ) {
349
  switch ( $sorted_label_name_original ) {
350
  case 'Street Line':
@@ -377,7 +384,14 @@ class FMModelSubmissions_fm extends FMAdminModel {
377
  return $field_title;
378
  }
379
 
380
- public function hide_or_not( $hide_strings, $hide_string ) {
 
 
 
 
 
 
 
381
  if ( strpos($hide_string, '@') === FALSE ) {
382
  if ( strpos($hide_strings, '@' . $hide_string . '@') === FALSE ) {
383
  $style = '';
@@ -398,7 +412,14 @@ class FMModelSubmissions_fm extends FMAdminModel {
398
  return $style;
399
  }
400
 
401
- public function sort_group_ids( $sorted_label_names_count, $group_ids ) {
 
 
 
 
 
 
 
402
  $count_labe = $sorted_label_names_count;
403
  $group_id_s = array();
404
  $l = 0;
@@ -409,11 +430,17 @@ class FMModelSubmissions_fm extends FMAdminModel {
409
  }
410
  }
411
  }
412
-
413
  return $group_id_s;
414
  }
415
 
416
- public function array_for_group_id( $group, $rows ) {
 
 
 
 
 
 
 
417
  $i = $group;
418
  $count_rows = count($rows);
419
  $temp = array();
@@ -427,7 +454,13 @@ class FMModelSubmissions_fm extends FMAdminModel {
427
  return $temp;
428
  }
429
 
430
- public function check_radio_type( $sorted_label_type ) {
 
 
 
 
 
 
431
  if ( $sorted_label_type == "type_checkbox" || $sorted_label_type == "type_radio" || $sorted_label_type == "type_own_select" || $sorted_label_type == "type_country" || $sorted_label_type == "type_paypal_select" || $sorted_label_type == "type_paypal_radio" || $sorted_label_type == "type_paypal_checkbox" || $sorted_label_type == "type_paypal_shipping" ) {
432
  return TRUE;
433
  }
@@ -436,7 +469,14 @@ class FMModelSubmissions_fm extends FMAdminModel {
436
  }
437
  }
438
 
439
- public function statistic_for_radio( $where_choices, $sorted_label_id ) {
 
 
 
 
 
 
 
440
  global $wpdb;
441
  $choices_params = array();
442
  $query = "SELECT element_value FROM " . $wpdb->prefix . "formmaker_submits WHERE " . $where_choices . " AND element_label='" . $sorted_label_id . "'";
@@ -469,7 +509,13 @@ class FMModelSubmissions_fm extends FMAdminModel {
469
  return $choices_params;
470
  }
471
 
472
- public function get_data_of_group_id( $id ) {
 
 
 
 
 
 
473
  global $wpdb;
474
  $query = "SELECT * FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id=" . $id;
475
  $rows = $wpdb->get_results($query);
@@ -506,7 +552,13 @@ class FMModelSubmissions_fm extends FMAdminModel {
506
  return $params;
507
  }
508
 
509
- public function check_type_for_edit_function( $label_type ) {
 
 
 
 
 
 
510
  if ( $label_type != 'type_editor' and $label_type != 'type_submit_reset' and $label_type != 'type_map' and $label_type != 'type_mark_map' and $label_type != 'type_captcha' and $label_type != 'type_recaptcha' and $label_type != 'type_button' ) {
511
  return TRUE;
512
  }
@@ -515,7 +567,14 @@ class FMModelSubmissions_fm extends FMAdminModel {
515
  }
516
  }
517
 
518
- public function check_for_submited_label( $rows, $label_id ) {
 
 
 
 
 
 
 
519
  foreach ( $rows as $row ) {
520
  if ( $row->element_label == $label_id ) {
521
  $element_value = $row->element_value;
@@ -533,11 +592,11 @@ class FMModelSubmissions_fm extends FMAdminModel {
533
  * Create array of group by key.
534
  *
535
  * @param array $array
536
- * @param string $key
537
  *
538
  * @return array $data
539
  */
540
- public function _group_by($array, $key) {
541
  $data = array();
542
  foreach($array as $val) {
543
  $by_key = '';
@@ -555,7 +614,14 @@ class FMModelSubmissions_fm extends FMAdminModel {
555
  return $data;
556
  }
557
 
558
- public function view_for_star_rating( $element_value, $element_label ) {
 
 
 
 
 
 
 
559
  $view_star_rating_array = array();
560
  $new_filename = str_replace("***star_rating***", '', $element_value);
561
  $stars = "";
@@ -571,7 +637,13 @@ class FMModelSubmissions_fm extends FMAdminModel {
571
  return $view_star_rating_array;
572
  }
573
 
574
- public function view_for_grading( $element_value ) {
 
 
 
 
 
 
575
  $view_grading_array = array();
576
  $new_filename = str_replace("***grading***", '', $element_value);
577
  $grading = explode(":", $new_filename);
@@ -588,7 +660,14 @@ class FMModelSubmissions_fm extends FMAdminModel {
588
  return $view_grading_array;
589
  }
590
 
591
- public function images_for_star_rating( $element_value, $label_id ) {
 
 
 
 
 
 
 
592
  $edit_stars = "";
593
  $star_rating_array = array();
594
  $element_value1 = str_replace("***star_rating***", '', $element_value);
@@ -605,7 +684,14 @@ class FMModelSubmissions_fm extends FMAdminModel {
605
  return $star_rating_array;
606
  }
607
 
608
- public function params_for_scale_rating( $element_value, $label_id ) {
 
 
 
 
 
 
 
609
  $scale_rating_array = array();
610
  $scale_radio = explode('/', $element_value);
611
  $scale_value = $scale_radio[0];
@@ -631,14 +717,28 @@ class FMModelSubmissions_fm extends FMAdminModel {
631
  return $scale_rating_array;
632
  }
633
 
634
- public function params_for_type_range( $element_value, $label_id ) {
 
 
 
 
 
 
 
635
  $range_value = explode('-', $element_value);
636
  $range = '<input name="' . $label_id . '_element0" id="' . $label_id . '_element0" type="text" value="' . $range_value[0] . '" onChange="edit_range(this.value,' . $label_id . ',0)" size="8"/> - <input name="' . $label_id . '_element1" id="' . $label_id . '_element1" type="text" value="' . $range_value[1] . '" onChange="edit_range(this.value,' . $label_id . ',1)" size="8"/>';
637
 
638
  return $range;
639
  }
640
 
641
- public function params_for_type_grading( $element_value, $label_id ) {
 
 
 
 
 
 
 
642
  $type_grading_array = array();
643
  $element_value1 = str_replace("***grading***", '', $element_value);
644
  $garding_value = explode(':', $element_value1);
@@ -659,7 +759,14 @@ class FMModelSubmissions_fm extends FMAdminModel {
659
  return $type_grading_array;
660
  }
661
 
662
- public function params_for_type_matrix( $element_value, $label_id ) {
 
 
 
 
 
 
 
663
  $type_matrix_array = array();
664
  $new_filename = str_replace("***matrix***", '', $element_value);
665
  $matrix_value = explode('***', $new_filename);
@@ -757,7 +864,17 @@ class FMModelSubmissions_fm extends FMAdminModel {
757
  return $type_matrix_array;
758
  }
759
 
760
- public function select_data_from_db_for_labels( $db_info, $label_column, $table, $where, $order_by ) {
 
 
 
 
 
 
 
 
 
 
761
  global $wpdb;
762
  $query = "SELECT `" . $label_column . "` FROM " . $table . $where . " ORDER BY " . $order_by;
763
  $db_info = trim($db_info, '[]');
@@ -782,7 +899,17 @@ class FMModelSubmissions_fm extends FMAdminModel {
782
  return $choices_labels;
783
  }
784
 
785
- public function select_data_from_db_for_values( $db_info, $value_column, $table, $where, $order_by ) {
 
 
 
 
 
 
 
 
 
 
786
  global $wpdb;
787
  $query = "SELECT `" . $value_column . "` FROM " . $table . $where . " ORDER BY " . $order_by;
788
  $db_info = trim($db_info, '[]');
@@ -807,28 +934,51 @@ class FMModelSubmissions_fm extends FMAdminModel {
807
  return $choices_values;
808
  }
809
 
810
- public function delete_row( $id ) {
 
 
 
 
 
811
  global $wpdb;
812
  $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id="%d"', $id);
813
  return $wpdb->query($query);
814
  }
815
 
816
- public function delete_from_session( $form_id, $id ) {
 
 
 
 
 
 
 
817
  global $wpdb;
818
  $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_sessions WHERE form_id="%d" AND group_id="%d"', $form_id, $id);
819
 
820
  return $wpdb->query($query);
821
  }
822
 
823
- // params array
824
- public function delete_rows( $params ) {
 
 
 
 
825
  global $wpdb;
826
  $query = 'DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( ' . $params . ' )';
827
 
828
  return $wpdb->query($query);
829
  }
830
 
831
- public function delete_rows_from_session( $form_id, $cids ) {
 
 
 
 
 
 
 
832
  global $wpdb;
833
  $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_sessions WHERE form_id="%d" AND group_id IN ( "%s" )', $form_id, $cids);
834
 
@@ -842,7 +992,7 @@ class FMModelSubmissions_fm extends FMAdminModel {
842
  *
843
  * @return array
844
  */
845
- public function get_rows( $cids ) {
846
  global $wpdb;
847
  $query = 'SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( ' . $cids . ' )';
848
 
@@ -856,7 +1006,7 @@ class FMModelSubmissions_fm extends FMAdminModel {
856
  *
857
  * @return string
858
  */
859
- public function get_ips( $ip ) {
860
  global $wpdb;
861
  $q = $wpdb->prepare('SELECT ip FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $ip);
862
  return $wpdb->get_var($q);
@@ -868,7 +1018,7 @@ class FMModelSubmissions_fm extends FMAdminModel {
868
  * @params array $params_set
869
  * @params array $params_type
870
  */
871
- public function set_ips( $params_set, $params_type ) {
872
  global $wpdb;
873
  return $wpdb->insert($wpdb->prefix . 'formmaker_blocked', $params_set, $params_type);
874
  }
@@ -880,18 +1030,30 @@ class FMModelSubmissions_fm extends FMAdminModel {
880
  *
881
  * @return bool
882
  */
883
- public function delete_by_ip( $ip ) {
884
  global $wpdb;
885
  return $wpdb->query( $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $ip) );
886
  }
887
 
888
- public function get_col( $id ) {
 
 
 
 
 
 
889
  global $wpdb;
890
-
891
  return $wpdb->get_var("SELECT form_id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "'");
892
  }
893
 
894
- public function get_id( $id, $label_id ) {
 
 
 
 
 
 
 
895
  global $wpdb;
896
  $query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "' AND element_label='" . $label_id . "'";
897
 
@@ -899,7 +1061,7 @@ class FMModelSubmissions_fm extends FMAdminModel {
899
  }
900
 
901
  /**
902
- * update formmaker_submits
903
  *
904
  * @params array $params_set
905
  * @params array $params_where
@@ -908,7 +1070,7 @@ class FMModelSubmissions_fm extends FMAdminModel {
908
  *
909
  * @return bool
910
  */
911
- public function update_fm_submits( $params_set, $params_where, $params_set_type, $params_where_type ) {
912
  global $wpdb;
913
 
914
  return $wpdb->update($wpdb->prefix . "formmaker_submits", $params_set, $params_where, $params_set_type, $params_where_type);
@@ -922,13 +1084,19 @@ class FMModelSubmissions_fm extends FMAdminModel {
922
  *
923
  * @return bool
924
  */
925
- public function insert_fm_submits( $params_set, $params_set_type ) {
926
  global $wpdb;
927
 
928
  return $wpdb->insert($wpdb->prefix . "formmaker_submits", $params_set, $params_set_type);
929
  }
930
 
931
- public function get_all( $id ) {
 
 
 
 
 
 
932
  global $wpdb;
933
 
934
  return $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id='" . $id . "'");
4
  * Class FMModelSubmissions_fm
5
  */
6
  class FMModelSubmissions_fm extends FMAdminModel {
7
+
8
  public function blocked_ips() {
9
  global $wpdb;
10
  $ips = $wpdb->get_col('SELECT ip FROM ' . $wpdb->prefix . 'formmaker_blocked');
37
  *
38
  * @return object $form
39
  */
40
+ public function get_form( $id = 0 ) {
41
  global $wpdb;
42
  $query = 'SELECT `id`, `title` FROM ' . $wpdb->prefix .'formmaker WHERE id = ' . $id ;
43
  $form = $wpdb->get_row( $query );
48
  * Get subs count.
49
  *
50
  * @param int $id
 
51
  * @return int $count
52
  */
53
+ public function get_subs_count( $id = 0 ) {
54
  global $wpdb;
55
  $query = $wpdb->prepare("SELECT distinct group_id FROM " . $wpdb->prefix . "formmaker_submits where form_id=%d", $id);
56
  $group_id_s = $wpdb->get_col($query);
62
  * Get statistics.
63
  *
64
  * @param int $id
 
65
  * @return object $statistics
66
  */
67
+ public function get_statistics( $id = 0 ) {
68
  global $wpdb;
69
  $statistics = array();
70
  $query = $wpdb->prepare('SELECT count(distinct group_id) FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id ="%d"', $id);
80
  }
81
  return $statistics;
82
  }
83
+
84
  /*
85
  * Get labels parameters.
86
  *
87
  * @param int $form_id
88
  * @param int $page_num
89
  * @param int $per_num
 
90
  * @return array $labels_parameters
91
  */
92
+
93
+ public function get_labels_parameters( $form_id = 0, $page_num = 0, $per_num = 0 ) {
94
  global $wpdb;
95
  $labels = array();
96
  $labels_id = array();
129
  $where_labels = array();
130
  $where2 = array();
131
  $order_by = ((isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) != '') ? esc_html(stripslashes($_POST['order_by'])) : 'group_id');
132
+ $asc_or_desc = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'asc') ? 'asc' : 'desc');
133
+
134
+ $lists['hide_label_list'] = ((isset($_POST['hide_label_list'])) ? esc_html(stripslashes($_POST['hide_label_list'])) : '');
135
  $lists['startdate'] = ((isset($_POST['startdate'])) ? esc_html(stripslashes($_POST['startdate'])) : '');
136
  $lists['enddate'] = ((isset($_POST['enddate'])) ? esc_html(stripslashes($_POST['enddate'])) : '');
137
  $lists['ip_search'] = ((isset($_POST['ip_search'])) ? esc_html(stripslashes($_POST['ip_search'])) : '');
306
  }
307
  $total = $wpdb->get_var($query);
308
  $query_sub_count = "SELECT count(distinct group_id) from " . $wpdb->prefix . "formmaker_submits";
309
+ $sub_count = (int) $wpdb->get_var($query_sub_count);
310
+ $query = $join . ' ' . $orderby . ' LIMIT ' . $page_num . ', '. $per_num;
311
  $results = $wpdb->get_results($query);
312
  for ( $i = 0; $i < count($results); $i++ ) {
313
  array_push($rows_ord, $results[$i]->group_id);
344
  return $labels_parameters;
345
  }
346
 
347
+ /**
348
+ * Get type address.
349
+ *
350
+ * @param string $sorted_label_type
351
+ * @param string $sorted_label_name_original
352
+ * @return mixed|string
353
+ */
354
+ public function get_type_address( $sorted_label_type = '', $sorted_label_name_original = '' ) {
355
  if ( $sorted_label_type == 'type_address' ) {
356
  switch ( $sorted_label_name_original ) {
357
  case 'Street Line':
384
  return $field_title;
385
  }
386
 
387
+ /**
388
+ * Hide or not.
389
+ *
390
+ * @param string $hide_strings
391
+ * @param string $hide_string
392
+ * @return string
393
+ */
394
+ public function hide_or_not( $hide_strings = '', $hide_string = '' ) {
395
  if ( strpos($hide_string, '@') === FALSE ) {
396
  if ( strpos($hide_strings, '@' . $hide_string . '@') === FALSE ) {
397
  $style = '';
412
  return $style;
413
  }
414
 
415
+ /**
416
+ * Sort group ids.
417
+ *
418
+ * @param int $sorted_label_names_count
419
+ * @param array $group_ids
420
+ * @return array
421
+ */
422
+ public function sort_group_ids( $sorted_label_names_count = 0, $group_ids = array() ) {
423
  $count_labe = $sorted_label_names_count;
424
  $group_id_s = array();
425
  $l = 0;
430
  }
431
  }
432
  }
 
433
  return $group_id_s;
434
  }
435
 
436
+ /**
437
+ * Array for group id.
438
+ *
439
+ * @param int $group
440
+ * @param array $rows
441
+ * @return array
442
+ */
443
+ public function array_for_group_id( $group = 0, $rows = array() ) {
444
  $i = $group;
445
  $count_rows = count($rows);
446
  $temp = array();
454
  return $temp;
455
  }
456
 
457
+ /**
458
+ * Sorted label type.
459
+ *
460
+ * @param string $sorted_label_type
461
+ * @return bool
462
+ */
463
+ public function check_radio_type( $sorted_label_type = '' ) {
464
  if ( $sorted_label_type == "type_checkbox" || $sorted_label_type == "type_radio" || $sorted_label_type == "type_own_select" || $sorted_label_type == "type_country" || $sorted_label_type == "type_paypal_select" || $sorted_label_type == "type_paypal_radio" || $sorted_label_type == "type_paypal_checkbox" || $sorted_label_type == "type_paypal_shipping" ) {
465
  return TRUE;
466
  }
469
  }
470
  }
471
 
472
+ /**
473
+ * Statistic for radio.
474
+ *
475
+ * @param string $where_choices
476
+ * @param string $sorted_label_id
477
+ * @return array
478
+ */
479
+ public function statistic_for_radio( $where_choices = '', $sorted_label_id = '' ) {
480
  global $wpdb;
481
  $choices_params = array();
482
  $query = "SELECT element_value FROM " . $wpdb->prefix . "formmaker_submits WHERE " . $where_choices . " AND element_label='" . $sorted_label_id . "'";
509
  return $choices_params;
510
  }
511
 
512
+ /**
513
+ * Get data of group id.
514
+ *
515
+ * @param int $id
516
+ * @return array
517
+ */
518
+ public function get_data_of_group_id( $id = 0 ) {
519
  global $wpdb;
520
  $query = "SELECT * FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id=" . $id;
521
  $rows = $wpdb->get_results($query);
552
  return $params;
553
  }
554
 
555
+ /**
556
+ * Check type for edit function.
557
+ *
558
+ * @param string $label_type
559
+ * @return bool
560
+ */
561
+ public function check_type_for_edit_function( $label_type = '' ) {
562
  if ( $label_type != 'type_editor' and $label_type != 'type_submit_reset' and $label_type != 'type_map' and $label_type != 'type_mark_map' and $label_type != 'type_captcha' and $label_type != 'type_recaptcha' and $label_type != 'type_button' ) {
563
  return TRUE;
564
  }
567
  }
568
  }
569
 
570
+ /**
571
+ * Check for submited label.
572
+ *
573
+ * @param array $rows
574
+ * @param string $label_id
575
+ * @return string
576
+ */
577
+ public function check_for_submited_label( $rows = array(), $label_id = '' ) {
578
  foreach ( $rows as $row ) {
579
  if ( $row->element_label == $label_id ) {
580
  $element_value = $row->element_value;
592
  * Create array of group by key.
593
  *
594
  * @param array $array
595
+ * @param string $key
596
  *
597
  * @return array $data
598
  */
599
+ public function _group_by( $array = array(), $key = '' ) {
600
  $data = array();
601
  foreach($array as $val) {
602
  $by_key = '';
614
  return $data;
615
  }
616
 
617
+ /**
618
+ * View for star rating.
619
+ *
620
+ * @param string $element_value
621
+ * @param string $element_label
622
+ * @return array
623
+ */
624
+ public function view_for_star_rating( $element_value = '', $element_label = '' ) {
625
  $view_star_rating_array = array();
626
  $new_filename = str_replace("***star_rating***", '', $element_value);
627
  $stars = "";
637
  return $view_star_rating_array;
638
  }
639
 
640
+ /**
641
+ * View for grading.
642
+ *
643
+ * @param string $element_value
644
+ * @return array
645
+ */
646
+ public function view_for_grading( $element_value = '' ) {
647
  $view_grading_array = array();
648
  $new_filename = str_replace("***grading***", '', $element_value);
649
  $grading = explode(":", $new_filename);
660
  return $view_grading_array;
661
  }
662
 
663
+ /**
664
+ * Images for star rating.
665
+ *
666
+ * @param string $element_value
667
+ * @param string $label_id
668
+ * @return array
669
+ */
670
+ public function images_for_star_rating( $element_value = '', $label_id = '' ) {
671
  $edit_stars = "";
672
  $star_rating_array = array();
673
  $element_value1 = str_replace("***star_rating***", '', $element_value);
684
  return $star_rating_array;
685
  }
686
 
687
+ /**
688
+ * Params for scale rating.
689
+ *
690
+ * @param string $element_value
691
+ * @param string $label_id
692
+ * @return array
693
+ */
694
+ public function params_for_scale_rating( $element_value = '', $label_id = '' ) {
695
  $scale_rating_array = array();
696
  $scale_radio = explode('/', $element_value);
697
  $scale_value = $scale_radio[0];
717
  return $scale_rating_array;
718
  }
719
 
720
+ /**
721
+ * Params for type range.
722
+ *
723
+ * @param string $element_value
724
+ * @param string $label_id
725
+ * @return string
726
+ */
727
+ public function params_for_type_range( $element_value = '', $label_id = '' ) {
728
  $range_value = explode('-', $element_value);
729
  $range = '<input name="' . $label_id . '_element0" id="' . $label_id . '_element0" type="text" value="' . $range_value[0] . '" onChange="edit_range(this.value,' . $label_id . ',0)" size="8"/> - <input name="' . $label_id . '_element1" id="' . $label_id . '_element1" type="text" value="' . $range_value[1] . '" onChange="edit_range(this.value,' . $label_id . ',1)" size="8"/>';
730
 
731
  return $range;
732
  }
733
 
734
+ /**
735
+ * Params for type grading.
736
+ *
737
+ * @param string $element_value
738
+ * @param string $label_id
739
+ * @return array
740
+ */
741
+ public function params_for_type_grading( $element_value = '', $label_id = '' ) {
742
  $type_grading_array = array();
743
  $element_value1 = str_replace("***grading***", '', $element_value);
744
  $garding_value = explode(':', $element_value1);
759
  return $type_grading_array;
760
  }
761
 
762
+ /**
763
+ * Params for type matrix.
764
+ *
765
+ * @param string $element_value
766
+ * @param string $label_id
767
+ * @return array
768
+ */
769
+ public function params_for_type_matrix( $element_value = '', $label_id = '' ) {
770
  $type_matrix_array = array();
771
  $new_filename = str_replace("***matrix***", '', $element_value);
772
  $matrix_value = explode('***', $new_filename);
864
  return $type_matrix_array;
865
  }
866
 
867
+ /**
868
+ * select data from db for labels.
869
+ *
870
+ * @param string $db_info
871
+ * @param string $label_column
872
+ * @param string $table
873
+ * @param string $where
874
+ * @param string $order_by
875
+ * @return mixed
876
+ */
877
+ public function select_data_from_db_for_labels( $db_info = '', $label_column = '', $table = '', $where = '', $order_by = '' ) {
878
  global $wpdb;
879
  $query = "SELECT `" . $label_column . "` FROM " . $table . $where . " ORDER BY " . $order_by;
880
  $db_info = trim($db_info, '[]');
899
  return $choices_labels;
900
  }
901
 
902
+ /**
903
+ * Select data from db for values.
904
+ *
905
+ * @param string $db_info
906
+ * @param string $value_column
907
+ * @param string $table
908
+ * @param string $where
909
+ * @param string $order_by
910
+ * @return mixed
911
+ */
912
+ public function select_data_from_db_for_values( $db_info = '', $value_column = '', $table = '', $where = '', $order_by = '' ) {
913
  global $wpdb;
914
  $query = "SELECT `" . $value_column . "` FROM " . $table . $where . " ORDER BY " . $order_by;
915
  $db_info = trim($db_info, '[]');
934
  return $choices_values;
935
  }
936
 
937
+ /**
938
+ * Delete row.
939
+ * @param int $id
940
+ * @return mixed
941
+ */
942
+ public function delete_row( $id = 0 ) {
943
  global $wpdb;
944
  $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id="%d"', $id);
945
  return $wpdb->query($query);
946
  }
947
 
948
+ /**
949
+ * Delete from session.
950
+ *
951
+ * @param int $form_id
952
+ * @param int $id
953
+ * @return mixed
954
+ */
955
+ public function delete_from_session( $form_id = 0, $id = 0 ) {
956
  global $wpdb;
957
  $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_sessions WHERE form_id="%d" AND group_id="%d"', $form_id, $id);
958
 
959
  return $wpdb->query($query);
960
  }
961
 
962
+ /**
963
+ * Delete rows.
964
+ * @param array $params
965
+ * @return mixed
966
+ */
967
+ public function delete_rows( $params = array() ) {
968
  global $wpdb;
969
  $query = 'DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( ' . $params . ' )';
970
 
971
  return $wpdb->query($query);
972
  }
973
 
974
+ /**
975
+ * Delete rows from session.
976
+ *
977
+ * @param int $form_id
978
+ * @param string $cids
979
+ * @return mixed
980
+ */
981
+ public function delete_rows_from_session( $form_id = 0, $cids = '' ) {
982
  global $wpdb;
983
  $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_sessions WHERE form_id="%d" AND group_id IN ( "%s" )', $form_id, $cids);
984
 
992
  *
993
  * @return array
994
  */
995
+ public function get_rows( $cids = array() ) {
996
  global $wpdb;
997
  $query = 'SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( ' . $cids . ' )';
998
 
1006
  *
1007
  * @return string
1008
  */
1009
+ public function get_ips( $ip = '' ) {
1010
  global $wpdb;
1011
  $q = $wpdb->prepare('SELECT ip FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $ip);
1012
  return $wpdb->get_var($q);
1018
  * @params array $params_set
1019
  * @params array $params_type
1020
  */
1021
+ public function set_ips( $params_set = array(), $params_type = array() ) {
1022
  global $wpdb;
1023
  return $wpdb->insert($wpdb->prefix . 'formmaker_blocked', $params_set, $params_type);
1024
  }
1030
  *
1031
  * @return bool
1032
  */
1033
+ public function delete_by_ip( $ip = '' ) {
1034
  global $wpdb;
1035
  return $wpdb->query( $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $ip) );
1036
  }
1037
 
1038
+ /**
1039
+ * Get col.
1040
+ *
1041
+ * @param int $id
1042
+ * @return mixed
1043
+ */
1044
+ public function get_col( $id = 0 ) {
1045
  global $wpdb;
 
1046
  return $wpdb->get_var("SELECT form_id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "'");
1047
  }
1048
 
1049
+ /**
1050
+ * Get id.
1051
+ *
1052
+ * @param $id
1053
+ * @param $label_id
1054
+ * @return mixed
1055
+ */
1056
+ public function get_id( $id = 0, $label_id = '' ) {
1057
  global $wpdb;
1058
  $query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "' AND element_label='" . $label_id . "'";
1059
 
1061
  }
1062
 
1063
  /**
1064
+ * Update formmaker_submits
1065
  *
1066
  * @params array $params_set
1067
  * @params array $params_where
1070
  *
1071
  * @return bool
1072
  */
1073
+ public function update_fm_submits( $params_set = array(), $params_where = array(), $params_set_type = array(), $params_where_type = array() ) {
1074
  global $wpdb;
1075
 
1076
  return $wpdb->update($wpdb->prefix . "formmaker_submits", $params_set, $params_where, $params_set_type, $params_where_type);
1084
  *
1085
  * @return bool
1086
  */
1087
+ public function insert_fm_submits( $params_set = array(), $params_set_type = array() ) {
1088
  global $wpdb;
1089
 
1090
  return $wpdb->insert($wpdb->prefix . "formmaker_submits", $params_set, $params_set_type);
1091
  }
1092
 
1093
+ /**
1094
+ * Get all.
1095
+ *
1096
+ * @param int $id
1097
+ * @return mixed
1098
+ */
1099
+ public function get_all( $id = 0 ) {
1100
  global $wpdb;
1101
 
1102
  return $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id='" . $id . "'");
admin/models/Themes_fm.php CHANGED
@@ -8,7 +8,7 @@ class FMModelThemes_fm extends FMAdminModel {
8
  *
9
  * @return array $rows
10
  */
11
- public function get_rows_data( $params ) {
12
  global $wpdb;
13
  $order = $params['order'];
14
  $orderby = $params['orderby'];
@@ -26,7 +26,14 @@ class FMModelThemes_fm extends FMAdminModel {
26
  return $rows;
27
  }
28
 
29
- public function get_row_data( $id, $reset ) {
 
 
 
 
 
 
 
30
  global $wpdb;
31
  if ( $id != 0 ) {
32
  $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id));
@@ -62,7 +69,6 @@ class FMModelThemes_fm extends FMAdminModel {
62
  $row->css = array( "CUPCSS" => $row->css );
63
  }
64
  }
65
-
66
  return $row;
67
  }
68
 
@@ -73,7 +79,7 @@ class FMModelThemes_fm extends FMAdminModel {
73
  *
74
  * @return null|string
75
  */
76
- public function total($search = '') {
77
  global $wpdb;
78
  $query = 'SELECT COUNT(*) FROM `' . $wpdb->prefix . 'formmaker_themes`';
79
  if ( $search ) {
@@ -92,7 +98,7 @@ class FMModelThemes_fm extends FMAdminModel {
92
  *
93
  * @return array
94
  */
95
- public function delete_rows( $params ) {
96
  global $wpdb;
97
  $query = 'DELETE FROM ' . $wpdb->prefix . $params['table'];
98
  if ( isset($params['where']) ) {
@@ -118,7 +124,7 @@ class FMModelThemes_fm extends FMAdminModel {
118
  *
119
  * @return array
120
  */
121
- public function select_rows( $get_type, $params ) {
122
  global $wpdb;
123
  $query = "SELECT " . $params['selection'] . " FROM " . $wpdb->prefix . $params['table'];
124
  if ( isset($params['where']) ) {
@@ -148,7 +154,7 @@ class FMModelThemes_fm extends FMAdminModel {
148
  *
149
  * @return array
150
  */
151
- public function insert_data_to_db( $table, $data ) {
152
  global $wpdb;
153
  $query = $wpdb->insert($wpdb->prefix . $table, $data);
154
  $wpdb->show_errors();
@@ -159,9 +165,10 @@ class FMModelThemes_fm extends FMAdminModel {
159
  /**
160
  * @params array $params
161
  *
 
162
  * @return bool
163
  */
164
- public function insert_theme( $params ) {
165
  global $wpdb;
166
 
167
  $wpdb->insert($wpdb->prefix . 'formmaker_themes', $params);
@@ -176,9 +183,8 @@ class FMModelThemes_fm extends FMAdminModel {
176
  *
177
  * @return bool
178
  */
179
- public function update_formmaker_themes( $params, $where ) {
180
  global $wpdb;
181
-
182
  return $wpdb->update($wpdb->prefix . 'formmaker_themes', $params, $where);
183
  }
184
 
@@ -189,9 +195,8 @@ class FMModelThemes_fm extends FMAdminModel {
189
  *
190
  * @return string
191
  */
192
- public function get_theme_version( $id ) {
193
  global $wpdb;
194
-
195
  return $wpdb->get_var($wpdb->prepare("SELECT version FROM " . $wpdb->prefix . "formmaker_themes WHERE id=%d", $id));
196
  }
197
 
@@ -202,9 +207,8 @@ class FMModelThemes_fm extends FMAdminModel {
202
  *
203
  * @return string
204
  */
205
- public function get_default( $id ) {
206
  global $wpdb;
207
-
208
  return $wpdb->get_var($wpdb->prepare('SELECT `default` FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id));
209
  }
210
  }
8
  *
9
  * @return array $rows
10
  */
11
+ public function get_rows_data( $params = array() ) {
12
  global $wpdb;
13
  $order = $params['order'];
14
  $orderby = $params['orderby'];
26
  return $rows;
27
  }
28
 
29
+ /**
30
+ * Get row data.
31
+ *
32
+ * @param int $id
33
+ * @param $reset
34
+ * @return stdClass
35
+ */
36
+ public function get_row_data( $id = 0 , $reset = false ) {
37
  global $wpdb;
38
  if ( $id != 0 ) {
39
  $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id));
69
  $row->css = array( "CUPCSS" => $row->css );
70
  }
71
  }
 
72
  return $row;
73
  }
74
 
79
  *
80
  * @return null|string
81
  */
82
+ public function total( $search = '' ) {
83
  global $wpdb;
84
  $query = 'SELECT COUNT(*) FROM `' . $wpdb->prefix . 'formmaker_themes`';
85
  if ( $search ) {
98
  *
99
  * @return array
100
  */
101
+ public function delete_rows( $params = array() ) {
102
  global $wpdb;
103
  $query = 'DELETE FROM ' . $wpdb->prefix . $params['table'];
104
  if ( isset($params['where']) ) {
124
  *
125
  * @return array
126
  */
127
+ public function select_rows( $get_type = '', $params = array() ) {
128
  global $wpdb;
129
  $query = "SELECT " . $params['selection'] . " FROM " . $wpdb->prefix . $params['table'];
130
  if ( isset($params['where']) ) {
154
  *
155
  * @return array
156
  */
157
+ public function insert_data_to_db( $table = '', $data = array() ) {
158
  global $wpdb;
159
  $query = $wpdb->insert($wpdb->prefix . $table, $data);
160
  $wpdb->show_errors();
165
  /**
166
  * @params array $params
167
  *
168
+ * @param array $params
169
  * @return bool
170
  */
171
+ public function insert_theme( $params = array() ) {
172
  global $wpdb;
173
 
174
  $wpdb->insert($wpdb->prefix . 'formmaker_themes', $params);
183
  *
184
  * @return bool
185
  */
186
+ public function update_formmaker_themes( $params = array(), $where = array() ) {
187
  global $wpdb;
 
188
  return $wpdb->update($wpdb->prefix . 'formmaker_themes', $params, $where);
189
  }
190
 
195
  *
196
  * @return string
197
  */
198
+ public function get_theme_version( $id = 0 ) {
199
  global $wpdb;
 
200
  return $wpdb->get_var($wpdb->prepare("SELECT version FROM " . $wpdb->prefix . "formmaker_themes WHERE id=%d", $id));
201
  }
202
 
207
  *
208
  * @return string
209
  */
210
+ public function get_default( $id = 0 ) {
211
  global $wpdb;
 
212
  return $wpdb->get_var($wpdb->prepare('SELECT `default` FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id));
213
  }
214
  }
admin/models/Uninstall_fm.php CHANGED
@@ -1,10 +1,11 @@
1
  <?php
2
 
3
  class FMModelUninstall_fm extends FMAdminModel {
 
4
  public function delete_db_tables() {
5
  global $wpdb;
6
  $true_or_false_forms = !WDFMInstance(self::PLUGIN)->is_free ? false : $wpdb->get_var('SELECT COUNT(*) FROM ' . $wpdb->prefix . 'formmaker WHERE `id`' . (WDFMInstance(self::PLUGIN)->is_free == 1 ? ' NOT ' : ' ') . 'IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ')');
7
- if ($true_or_false_forms) {
8
  $wpdb->query('DELETE FROM ' . $wpdb->prefix . 'formmaker WHERE `id`' . (WDFMInstance(self::PLUGIN)->is_free == 1 ? ' NOT ' : ' ') . 'IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ')');
9
  $wpdb->query('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE `form_id`' . (WDFMInstance(self::PLUGIN)->is_free == 1 ? ' NOT ' : ' ') . 'IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ')');
10
  $wpdb->query('DELETE FROM ' . $wpdb->prefix . 'formmaker_views WHERE `form_id`' . (WDFMInstance(self::PLUGIN)->is_free == 1 ? ' NOT ' : ' ') . 'IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ')');
1
  <?php
2
 
3
  class FMModelUninstall_fm extends FMAdminModel {
4
+
5
  public function delete_db_tables() {
6
  global $wpdb;
7
  $true_or_false_forms = !WDFMInstance(self::PLUGIN)->is_free ? false : $wpdb->get_var('SELECT COUNT(*) FROM ' . $wpdb->prefix . 'formmaker WHERE `id`' . (WDFMInstance(self::PLUGIN)->is_free == 1 ? ' NOT ' : ' ') . 'IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ')');
8
+ if ( $true_or_false_forms ) {
9
  $wpdb->query('DELETE FROM ' . $wpdb->prefix . 'formmaker WHERE `id`' . (WDFMInstance(self::PLUGIN)->is_free == 1 ? ' NOT ' : ' ') . 'IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ')');
10
  $wpdb->query('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE `form_id`' . (WDFMInstance(self::PLUGIN)->is_free == 1 ? ' NOT ' : ' ') . 'IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ')');
11
  $wpdb->query('DELETE FROM ' . $wpdb->prefix . 'formmaker_views WHERE `form_id`' . (WDFMInstance(self::PLUGIN)->is_free == 1 ? ' NOT ' : ' ') . 'IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ')');
admin/views/Addons_fm.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  /**
4
  * Class FMViewAddons_fm
5
  */
@@ -13,6 +12,11 @@ class FMViewAddons_fm extends FMAdminView {
13
  wp_enqueue_script(WDFMInstance(self::PLUGIN)->handle_prefix . '-admin');
14
  }
15
 
 
 
 
 
 
16
  public function display( $params = array() ) {
17
  $page = $params['page'];
18
  $page_url = $params['page_url'];
@@ -31,6 +35,7 @@ class FMViewAddons_fm extends FMAdminView {
31
  /**
32
  * Generate page body.
33
  *
 
34
  * @return string Body html.
35
  */
36
  public function body( $params = array() ) {
1
  <?php
 
2
  /**
3
  * Class FMViewAddons_fm
4
  */
12
  wp_enqueue_script(WDFMInstance(self::PLUGIN)->handle_prefix . '-admin');
13
  }
14
 
15
+ /**
16
+ * Display.
17
+ *
18
+ * @param array $params
19
+ */
20
  public function display( $params = array() ) {
21
  $page = $params['page'];
22
  $page_url = $params['page_url'];
35
  /**
36
  * Generate page body.
37
  *
38
+ * @param array $params
39
  * @return string Body html.
40
  */
41
  public function body( $params = array() ) {
admin/views/Blocked_ips_fm.php CHANGED
@@ -17,9 +17,11 @@ class FMViewBlocked_ips_fm extends FMAdminView {
17
  }
18
 
19
  /**
 
 
20
  * @param $params
21
  */
22
- public function display( $params ) {
23
  ob_start();
24
  echo $this->body($params);
25
  // Pass the content to form.
@@ -31,13 +33,13 @@ class FMViewBlocked_ips_fm extends FMAdminView {
31
  echo $this->form(ob_get_clean(), $form_attr);
32
  }
33
 
34
-
35
  /**
36
  * Generate page body.
37
  *
 
38
  * @return string Body html.
39
  */
40
- public function body( $params ) {
41
  $rows_data = $params['rows_data'];
42
  $total = $params['total'];
43
  $order = $params['order'];
17
  }
18
 
19
  /**
20
+ * Display.
21
+ *
22
  * @param $params
23
  */
24
+ public function display( $params = array() ) {
25
  ob_start();
26
  echo $this->body($params);
27
  // Pass the content to form.
33
  echo $this->form(ob_get_clean(), $form_attr);
34
  }
35
 
 
36
  /**
37
  * Generate page body.
38
  *
39
+ * @param array $params
40
  * @return string Body html.
41
  */
42
+ public function body( $params = array() ) {
43
  $rows_data = $params['rows_data'];
44
  $total = $params['total'];
45
  $order = $params['order'];
admin/views/Checkpaypal.php CHANGED
@@ -8,10 +8,9 @@ class FMViewCheckpaypal extends FMAdminView {
8
  * Payment information template.
9
  *
10
  * @param array $template_params
11
- *
12
  * @return string
13
  */
14
- public function payment_information_template( $template_params ) {
15
  $form_session = $template_params['form_session'];
16
  $data = $template_params['data'];
17
  $tax = $data['tax'];
8
  * Payment information template.
9
  *
10
  * @param array $template_params
 
11
  * @return string
12
  */
13
+ public function payment_information_template( $template_params = array() ) {
14
  $form_session = $template_params['form_session'];
15
  $data = $template_params['data'];
16
  $tax = $data['tax'];
admin/views/FMCaptcha.php CHANGED
@@ -7,7 +7,7 @@ class FMViewFormmakerwdcaptcha extends FMAdminView {
7
  *
8
  * @param array $params
9
  */
10
- public function display( $params ) {
11
  if (isset($_GET['action']) && esc_html($_GET['action']) == 'formmakerwdcaptcha' . WDFMInstance(self::PLUGIN)->plugin_postfix) {
12
  $i = (isset($_GET["i"]) ? esc_html($_GET["i"]) : '');
13
  $r2 = (isset($_GET["r2"]) ? (int) $_GET["r2"] : 0);
@@ -38,7 +38,7 @@ class FMViewFormmakerwdcaptcha extends FMAdminView {
38
 
39
  $l = rand($cap_length_min, $cap_length_max);
40
  $code = code_generic($l, $cap_digital, $cap_latin_char);
41
- WDW_FM_Library(self::PLUGIN)->start_session();
42
  $_SESSION[$i . '_wd_captcha_code'] = md5($code);
43
  $canvas = imagecreatetruecolor($cap_width, $cap_height);
44
  $c = imagecolorallocate($canvas, rand(150, 255), rand(150, 255), rand(150, 255));
7
  *
8
  * @param array $params
9
  */
10
+ public function display( $params = array() ) {
11
  if (isset($_GET['action']) && esc_html($_GET['action']) == 'formmakerwdcaptcha' . WDFMInstance(self::PLUGIN)->plugin_postfix) {
12
  $i = (isset($_GET["i"]) ? esc_html($_GET["i"]) : '');
13
  $r2 = (isset($_GET["r2"]) ? (int) $_GET["r2"] : 0);
38
 
39
  $l = rand($cap_length_min, $cap_length_max);
40
  $code = code_generic($l, $cap_digital, $cap_latin_char);
41
+ WDW_FM_Library(self::PLUGIN)->start_session();
42
  $_SESSION[$i . '_wd_captcha_code'] = md5($code);
43
  $canvas = imagecreatetruecolor($cap_width, $cap_height);
44
  $c = imagecolorallocate($canvas, rand(150, 255), rand(150, 255), rand(150, 255));
admin/views/FMEditCountryinPopup.php CHANGED
@@ -4,12 +4,13 @@
4
  * Class FMViewFromeditcountryinpopup
5
  */
6
  class FMViewFromeditcountryinpopup extends FMAdminView {
 
7
  /**
8
  * Display.
9
  *
10
  * @param array $params
11
  */
12
- public function display( $params ) {
13
  $field_id = $params['field_id'];
14
  wp_print_scripts('jquery');
15
  wp_print_scripts('jquery-ui-core');
4
  * Class FMViewFromeditcountryinpopup
5
  */
6
  class FMViewFromeditcountryinpopup extends FMAdminView {
7
+
8
  /**
9
  * Display.
10
  *
11
  * @param array $params
12
  */
13
+ public function display( $params = array() ) {
14
  $field_id = $params['field_id'];
15
  wp_print_scripts('jquery');
16
  wp_print_scripts('jquery-ui-core');
admin/views/FMIpinfoinPopup.php CHANGED
@@ -9,7 +9,7 @@ class FMViewFromipinfoinpopup extends FMAdminView {
9
  *
10
  * @param array $params
11
  */
12
- public function display( $params ) {
13
  $ip = $params['ip'];
14
  $city = $params['city'];
15
  $country = $params['country'];
9
  *
10
  * @param array $params
11
  */
12
+ public function display( $params = array() ) {
13
  $ip = $params['ip'];
14
  $city = $params['city'];
15
  $country = $params['country'];
admin/views/FMMapEditinPopup.php CHANGED
@@ -9,7 +9,7 @@ class FMViewFrommapeditinpopup extends FMAdminView {
9
  *
10
  * @param array $params
11
  */
12
- public function display( $params ) {
13
  wp_print_scripts('google-maps');
14
  wp_print_scripts(WDFMInstance(self::PLUGIN)->handle_prefix . '-gmap_form');
15
  $long = $params['long'];
9
  *
10
  * @param array $params
11
  */
12
+ public function display( $params = array() ) {
13
  wp_print_scripts('google-maps');
14
  wp_print_scripts(WDFMInstance(self::PLUGIN)->handle_prefix . '-gmap_form');
15
  $long = $params['long'];
admin/views/FMMathCaptcha.php CHANGED
@@ -48,7 +48,14 @@ class FMViewFormmakerwdmathcaptcha extends FMAdminView {
48
  die('');
49
  }
50
 
51
- private function code_generic( $_length, $_operations ) {
 
 
 
 
 
 
 
52
  $cap = '';
53
  $dig = array( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 );
54
  $valid_oprations = array( '+', '-', '*', '/' );
@@ -81,7 +88,13 @@ class FMViewFormmakerwdmathcaptcha extends FMAdminView {
81
  return array( $cap, $pass );
82
  }
83
 
84
- public function arrayOfNumberDivisors( $x ) {
 
 
 
 
 
 
85
  $divisors = array();
86
  if ( $x == 0 ) {
87
  $divisors[] = rand(1, 9);
@@ -91,7 +104,6 @@ class FMViewFormmakerwdmathcaptcha extends FMAdminView {
91
  $divisors [] = $i;
92
  }
93
  }
94
-
95
  return $divisors;
96
  }
97
  }
48
  die('');
49
  }
50
 
51
+ /**
52
+ * Code generic.
53
+ *
54
+ * @param array $_length
55
+ * @param array $_operations
56
+ * @return array
57
+ */
58
+ private function code_generic( $_length = array(), $_operations = array() ) {
59
  $cap = '';
60
  $dig = array( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 );
61
  $valid_oprations = array( '+', '-', '*', '/' );
88
  return array( $cap, $pass );
89
  }
90
 
91
+ /**
92
+ * array Of Number Divisors.
93
+ *
94
+ * @param int $x
95
+ * @return array
96
+ */
97
+ public function arrayOfNumberDivisors( $x = 0 ) {
98
  $divisors = array();
99
  if ( $x == 0 ) {
100
  $divisors[] = rand(1, 9);
104
  $divisors [] = $i;
105
  }
106
  }
 
107
  return $divisors;
108
  }
109
  }
admin/views/FMPaypalInfo.php CHANGED
@@ -9,12 +9,12 @@ class FMViewPaypal_info extends FMAdminView {
9
  *
10
  * @param array $params
11
  */
12
- public function display( $params ) {
13
  $row = $params['row'];
14
  if ( !isset($row->ipn) ) {
15
  ?>
16
  <div style="width:100%; text-align: center; height: 70%; vertical-align: middle;">
17
- <h1 style="vertical-align: middle; margin: auto; color: #000"><p>No information yet</p></h1>
18
  </div>
19
  <?php
20
  }
@@ -32,7 +32,7 @@ class FMViewPaypal_info extends FMAdminView {
32
  width: 140px;
33
  }
34
  </style>
35
- <h2>Payment Info</h2>
36
  <table class="admintable">
37
  <?php
38
  if ( $row->currency ) {
@@ -48,7 +48,7 @@ class FMViewPaypal_info extends FMAdminView {
48
  if ( $row->ord_last_modified ) {
49
  ?>
50
  <tr>
51
- <td class="key">Last modified</td>
52
  <td><?php echo $row->ord_last_modified; ?></td>
53
  </tr>
54
  <?php
@@ -58,7 +58,7 @@ class FMViewPaypal_info extends FMAdminView {
58
  if ( $row->status ) {
59
  ?>
60
  <tr>
61
- <td class="key">Status</td>
62
  <td><?php echo $row->status; ?></td>
63
  </tr>
64
  <?php
@@ -68,7 +68,7 @@ class FMViewPaypal_info extends FMAdminView {
68
  if ( $row->full_name ) {
69
  ?>
70
  <tr>
71
- <td class="key">Full name</td>
72
  <td><?php echo $row->full_name; ?></td>
73
  </tr>
74
  <?php
@@ -78,7 +78,7 @@ class FMViewPaypal_info extends FMAdminView {
78
  if ( $row->email ) {
79
  ?>
80
  <tr>
81
- <td class="key">Email</td>
82
  <td><?php echo $row->email; ?></td>
83
  </tr>
84
  <?php
@@ -88,7 +88,7 @@ class FMViewPaypal_info extends FMAdminView {
88
  if ( $row->phone ) {
89
  ?>
90
  <tr>
91
- <td class="key">Phone</td>
92
  <td><?php echo $row->phone; ?></td>
93
  </tr>
94
  <?php
@@ -98,7 +98,7 @@ class FMViewPaypal_info extends FMAdminView {
98
  if ( $row->mobile_phone ) {
99
  ?>
100
  <tr>
101
- <td class="key">Mobile phone</td>
102
  <td><?php echo $row->mobile_phone; ?></td>
103
  </tr>
104
  <?php
@@ -108,7 +108,7 @@ class FMViewPaypal_info extends FMAdminView {
108
  if ( $row->fax ) {
109
  ?>
110
  <tr>
111
- <td class="key">Fax</td>
112
  <td><?php echo $row->fax; ?></td>
113
  </tr>
114
  <?php
@@ -118,7 +118,7 @@ class FMViewPaypal_info extends FMAdminView {
118
  if ( $row->address ) {
119
  ?>
120
  <tr>
121
- <td class="key">Address</td>
122
  <td><?php echo $row->address; ?></td>
123
  </tr>
124
  <?php
@@ -128,7 +128,7 @@ class FMViewPaypal_info extends FMAdminView {
128
  if ( $row->paypal_info ) {
129
  ?>
130
  <tr>
131
- <td class="key">Info</td>
132
  <td><?php echo $row->paypal_info; ?></td>
133
  </tr>
134
  <?php
@@ -138,7 +138,7 @@ class FMViewPaypal_info extends FMAdminView {
138
  if ( $row->ipn ) {
139
  ?>
140
  <tr>
141
- <td class="key">IPN</td>
142
  <td><?php echo $row->ipn; ?></td>
143
  </tr>
144
  <?php
@@ -148,7 +148,7 @@ class FMViewPaypal_info extends FMAdminView {
148
  if ( $row->tax ) {
149
  ?>
150
  <tr>
151
- <td class="key">Tax</td>
152
  <td><?php echo $row->tax; ?></td>
153
  </tr>
154
  <?php
@@ -158,7 +158,7 @@ class FMViewPaypal_info extends FMAdminView {
158
  if ( $row->shipping ) {
159
  ?>
160
  <tr>
161
- <td class="key">Shipping</td>
162
  <td><?php echo $row->shipping; ?></td>
163
  </tr>
164
  <?php
@@ -168,7 +168,7 @@ class FMViewPaypal_info extends FMAdminView {
168
  if ( $row->read ) {
169
  ?>
170
  <tr>
171
- <td class="key">Read</td>
172
  <td><?php echo $row->read; ?></td>
173
  </tr>
174
  <?php
@@ -178,7 +178,7 @@ class FMViewPaypal_info extends FMAdminView {
178
  if ( $row->total ) {
179
  ?>
180
  <tr>
181
- <td class="key">Total</td>
182
  <td><b><?php echo $row->total; ?></b></td>
183
  </tr>
184
  <?php
9
  *
10
  * @param array $params
11
  */
12
+ public function display( $params = array() ) {
13
  $row = $params['row'];
14
  if ( !isset($row->ipn) ) {
15
  ?>
16
  <div style="width:100%; text-align: center; height: 70%; vertical-align: middle;">
17
+ <h1 style="vertical-align: middle; margin: auto; color: #000"><p><?php _e('No information yet', WDFMInstance(self::PLUGIN)->prefix); ?></p></h1>
18
  </div>
19
  <?php
20
  }
32
  width: 140px;
33
  }
34
  </style>
35
+ <h2><?php _e('Payment Info', WDFMInstance(self::PLUGIN)->prefix); ?></h2>
36
  <table class="admintable">
37
  <?php
38
  if ( $row->currency ) {
48
  if ( $row->ord_last_modified ) {
49
  ?>
50
  <tr>
51
+ <td class="key"><?php _e('Last modified', WDFMInstance(self::PLUGIN)->prefix); ?></td>
52
  <td><?php echo $row->ord_last_modified; ?></td>
53
  </tr>
54
  <?php
58
  if ( $row->status ) {
59
  ?>
60
  <tr>
61
+ <td class="key"><?php _e('Status', WDFMInstance(self::PLUGIN)->prefix); ?></td>
62
  <td><?php echo $row->status; ?></td>
63
  </tr>
64
  <?php
68
  if ( $row->full_name ) {
69
  ?>
70
  <tr>
71
+ <td class="key"><?php _e('Full name', WDFMInstance(self::PLUGIN)->prefix); ?></td>
72
  <td><?php echo $row->full_name; ?></td>
73
  </tr>
74
  <?php
78
  if ( $row->email ) {
79
  ?>
80
  <tr>
81
+ <td class="key"><?php _e('Email', WDFMInstance(self::PLUGIN)->prefix); ?></td>
82
  <td><?php echo $row->email; ?></td>
83
  </tr>
84
  <?php
88
  if ( $row->phone ) {
89
  ?>
90
  <tr>
91
+ <td class="key"><?php _e('Phone', WDFMInstance(self::PLUGIN)->prefix); ?></td>
92
  <td><?php echo $row->phone; ?></td>
93
  </tr>
94
  <?php
98
  if ( $row->mobile_phone ) {
99
  ?>
100
  <tr>
101
+ <td class="key"><?php _e('Mobile phone', WDFMInstance(self::PLUGIN)->prefix); ?></td>
102
  <td><?php echo $row->mobile_phone; ?></td>
103
  </tr>
104
  <?php
108
  if ( $row->fax ) {
109
  ?>
110
  <tr>
111
+ <td class="key"><?php _e('Fax', WDFMInstance(self::PLUGIN)->prefix); ?></td>
112
  <td><?php echo $row->fax; ?></td>
113
  </tr>
114
  <?php
118
  if ( $row->address ) {
119
  ?>
120
  <tr>
121
+ <td class="key"><?php _e('Address', WDFMInstance(self::PLUGIN)->prefix); ?></td>
122
  <td><?php echo $row->address; ?></td>
123
  </tr>
124
  <?php
128
  if ( $row->paypal_info ) {
129
  ?>
130
  <tr>
131
+ <td class="key"><?php _e('Info', WDFMInstance(self::PLUGIN)->prefix); ?></td>
132
  <td><?php echo $row->paypal_info; ?></td>
133
  </tr>
134
  <?php
138
  if ( $row->ipn ) {
139
  ?>
140
  <tr>
141
+ <td class="key"><?php _e('IPN', WDFMInstance(self::PLUGIN)->prefix); ?></td>
142
  <td><?php echo $row->ipn; ?></td>
143
  </tr>
144
  <?php
148
  if ( $row->tax ) {
149
  ?>
150
  <tr>
151
+ <td class="key"><?php _e('Tax', WDFMInstance(self::PLUGIN)->prefix); ?></td>
152
  <td><?php echo $row->tax; ?></td>
153
  </tr>
154
  <?php
158
  if ( $row->shipping ) {
159
  ?>
160
  <tr>
161
+ <td class="key"><?php _e('Shipping', WDFMInstance(self::PLUGIN)->prefix); ?></td>
162
  <td><?php echo $row->shipping; ?></td>
163
  </tr>
164
  <?php
168
  if ( $row->read ) {
169
  ?>
170
  <tr>
171
+ <td class="key"><?php _e('Read', WDFMInstance(self::PLUGIN)->prefix); ?></td>
172
  <td><?php echo $row->read; ?></td>
173
  </tr>
174
  <?php
178
  if ( $row->total ) {
179
  ?>
180
  <tr>
181
+ <td class="key"><?php _e('Total', WDFMInstance(self::PLUGIN)->prefix); ?></td>
182
  <td><b><?php echo $row->total; ?></b></td>
183
  </tr>
184
  <?php
admin/views/FMProductOption.php CHANGED
@@ -9,7 +9,7 @@ class FMViewProduct_option extends FMAdminView {
9
  *
10
  * @param array $params
11
  */
12
- public function display( $params ) {
13
  $field_id = $params['field_id'];
14
  $property_id = $params['property_id'];
15
  $url_for_ajax = $params['url_for_ajax'];
9
  *
10
  * @param array $params
11
  */
12
+ public function display( $params = array() ) {
13
  $field_id = $params['field_id'];
14
  $property_id = $params['property_id'];
15
  $url_for_ajax = $params['url_for_ajax'];
admin/views/FMSelectDataFromDb.php CHANGED
@@ -9,7 +9,7 @@ class FMViewSelect_data_from_db extends FMAdminView {
9
  *
10
  * @param array $params
11
  */
12
- public function display( $params ) {
13
  wp_print_scripts('jquery');
14
  wp_print_styles(WDFMInstance(self::PLUGIN)->handle_prefix . '-style');
15
  wp_print_styles(WDFMInstance(self::PLUGIN)->handle_prefix . '-jquery-ui');
@@ -223,7 +223,7 @@ class FMViewSelect_data_from_db extends FMAdminView {
223
  *
224
  * @param array $params
225
  */
226
- public function db_table_struct_select( $params ) {
227
  $form_id = $params['form_id'];
228
  $field_type = $params['field_type'];
229
  $table_struct = $params['table_struct'];
@@ -553,7 +553,7 @@ class FMViewSelect_data_from_db extends FMAdminView {
553
  *
554
  * @param array $params
555
  */
556
- public function db_tables( $params ) {
557
  $form_id = $params['form_id'];
558
  $field_type = $params['field_type'];
559
  $tables = $params['tables'];
9
  *
10
  * @param array $params
11
  */
12
+ public function display( $params = array() ) {
13
  wp_print_scripts('jquery');
14
  wp_print_styles(WDFMInstance(self::PLUGIN)->handle_prefix . '-style');
15
  wp_print_styles(WDFMInstance(self::PLUGIN)->handle_prefix . '-jquery-ui');
223
  *
224
  * @param array $params
225
  */
226
+ public function db_table_struct_select( $params = array() ) {
227
  $form_id = $params['form_id'];
228
  $field_type = $params['field_type'];
229
  $table_struct = $params['table_struct'];
553
  *
554
  * @param array $params
555
  */
556
+ public function db_tables( $params = array() ) {
557
  $form_id = $params['form_id'];
558
  $field_type = $params['field_type'];
559
  $tables = $params['tables'];
admin/views/FMShortocde.php CHANGED
@@ -31,7 +31,7 @@ class FMViewFMShortocde extends FMAdminView {
31
  *
32
  * @param array $forms
33
  */
34
- public function form( $forms ) {
35
  ?>
36
  <body class="wp-core-ui" data-width="400" data-height="140">
37
  <div class="wd-table">
@@ -67,7 +67,7 @@ class FMViewFMShortocde extends FMAdminView {
67
  *
68
  * @param array $forms
69
  */
70
- public function submissions( $forms ) {
71
  ?>
72
  <body class="wp-core-ui" data-width="520" data-height="570" <?php echo (WDFMInstance(self::PLUGIN)->is_free ? 'style="overflow: hidden;"' : ''); ?>>
73
  <?php
31
  *
32
  * @param array $forms
33
  */
34
+ public function forms( $forms = array() ) {
35
  ?>
36
  <body class="wp-core-ui" data-width="400" data-height="140">
37
  <div class="wd-table">
67
  *
68
  * @param array $forms
69
  */
70
+ public function submissions( $forms = array() ) {
71
  ?>
72
  <body class="wp-core-ui" data-width="520" data-height="570" <?php echo (WDFMInstance(self::PLUGIN)->is_free ? 'style="overflow: hidden;"' : ''); ?>>
73
  <?php
admin/views/FMShowMatrix.php CHANGED
@@ -9,7 +9,7 @@ class FMViewShow_matrix extends FMAdminView {
9
  *
10
  * @param array $params
11
  */
12
- public function display( $params ) {
13
  $matrix_params = ((isset($_GET['matrix_params'])) ? esc_html(stripslashes($_GET['matrix_params'])) : 0);
14
  $new_filename = str_replace("***matrix***", '', $matrix_params);
15
  $new_filename = explode('***', $matrix_params);
9
  *
10
  * @param array $params
11
  */
12
+ public function display( $params = array() ) {
13
  $matrix_params = ((isset($_GET['matrix_params'])) ? esc_html(stripslashes($_GET['matrix_params'])) : 0);
14
  $new_filename = str_replace("***matrix***", '', $matrix_params);
15
  $new_filename = explode('***', $matrix_params);
admin/views/FMSqlMapping.php CHANGED
@@ -1,6 +1,7 @@
1
  <?php
2
 
3
  class FMViewFormMakerSQLMapping extends FMAdminView {
 
4
  public function __construct() {
5
  wp_print_scripts('jquery');
6
  wp_print_scripts('jquery-ui-tooltip');
@@ -9,7 +10,12 @@ class FMViewFormMakerSQLMapping extends FMAdminView {
9
  wp_print_styles('dashicons');
10
  }
11
 
12
- public function edit_query( $params ) {
 
 
 
 
 
13
  $id = $params['id'];
14
  $form_id = $params['form_id'];
15
  $label = $params['label'];
@@ -911,7 +917,12 @@ class FMViewFormMakerSQLMapping extends FMAdminView {
911
  die();
912
  }
913
 
914
- public function add_query( $params ) {
 
 
 
 
 
915
  $label = $params['label'];
916
  $form_id = $params['form_id'];
917
  $filter_types = array(
@@ -1154,7 +1165,12 @@ class FMViewFormMakerSQLMapping extends FMAdminView {
1154
  die();
1155
  }
1156
 
1157
- public function db_tables( $params ) {
 
 
 
 
 
1158
  $tables = $params['tables'];
1159
  $form_id = $params['form_id'];
1160
  ?>
@@ -1196,7 +1212,12 @@ class FMViewFormMakerSQLMapping extends FMAdminView {
1196
  die();
1197
  }
1198
 
1199
- public function db_table_struct( $params ) {
 
 
 
 
 
1200
  $label = $params['label'];
1201
  $form_id = $params['form_id'];
1202
  $con_method = $params['con_method'];
1
  <?php
2
 
3
  class FMViewFormMakerSQLMapping extends FMAdminView {
4
+
5
  public function __construct() {
6
  wp_print_scripts('jquery');
7
  wp_print_scripts('jquery-ui-tooltip');
10
  wp_print_styles('dashicons');
11
  }
12
 
13
+ /**
14
+ * Edit query.
15
+ *
16
+ * @param array $params
17
+ */
18
+ public function edit_query( $params = array() ) {
19
  $id = $params['id'];
20
  $form_id = $params['form_id'];
21
  $label = $params['label'];
917
  die();
918
  }
919
 
920
+ /**
921
+ * Add query.
922
+ *
923
+ * @param array $params
924
+ */
925
+ public function add_query( $params = array() ) {
926
  $label = $params['label'];
927
  $form_id = $params['form_id'];
928
  $filter_types = array(
1165
  die();
1166
  }
1167
 
1168
+ /**
1169
+ * db tables.
1170
+ *
1171
+ * @param array $params
1172
+ */
1173
+ public function db_tables( $params = array() ) {
1174
  $tables = $params['tables'];
1175
  $form_id = $params['form_id'];
1176
  ?>
1212
  die();
1213
  }
1214
 
1215
+ /**
1216
+ * db table struct.
1217
+ *
1218
+ * @param array $params
1219
+ */
1220
+ public function db_table_struct( $params = array() ) {
1221
  $label = $params['label'];
1222
  $form_id = $params['form_id'];
1223
  $con_method = $params['con_method'];
admin/views/FormMakerSubmits.php CHANGED
@@ -4,7 +4,13 @@
4
  * Class FMViewFormMakerSubmits
5
  */
6
  class FMViewFormMakerSubmits extends FMAdminView {
7
- public function display( $params ) {
 
 
 
 
 
 
8
  if ( isset($_GET['form_id']) && isset($_GET['group_id']) ) {
9
  $rows = $params['rows'];
10
  $labels_id = $params['labels_id'];
4
  * Class FMViewFormMakerSubmits
5
  */
6
  class FMViewFormMakerSubmits extends FMAdminView {
7
+
8
+ /**
9
+ * Display.
10
+ *
11
+ * @param array $params
12
+ */
13
+ public function display( $params = array() ) {
14
  if ( isset($_GET['form_id']) && isset($_GET['group_id']) ) {
15
  $rows = $params['rows'];
16
  $labels_id = $params['labels_id'];
admin/views/Manage_fm.php CHANGED
@@ -22,8 +22,10 @@ class FMViewManage_fm extends FMAdminView {
22
 
23
  /**
24
  * Display page.
 
 
25
  */
26
- public function display($params) {
27
  $this->import_popup_div();
28
  ob_start();
29
  echo $this->body($params);
@@ -39,9 +41,10 @@ class FMViewManage_fm extends FMAdminView {
39
  /**
40
  * Generate page body.
41
  *
 
42
  * @return string Body html.
43
  */
44
- public function body( $params ) {
45
  $page = $params['page'];
46
  $actions = $params['actions'];
47
  $form_preview_link = $params['form_preview_link'];
@@ -73,7 +76,6 @@ class FMViewManage_fm extends FMAdminView {
73
  echo $this->pagination($page_url, $total, $items_per_page);
74
  ?>
75
  </div>
76
-
77
  <table class="adminlist table table-striped wp-list-table widefat fixed pages">
78
  <thead>
79
  <tr>
@@ -187,10 +189,10 @@ class FMViewManage_fm extends FMAdminView {
187
  ?>
188
  </td>
189
  <td data-colname="<?php _e('Shortcode', WDFMInstance(self::PLUGIN)->prefix); ?>">
190
- <input type="text" value='<?php echo (WDFMInstance(self::PLUGIN)->is_free == 2 ? '[wd_contact_form id="' . $row_data->id . '"]' : '[Form id="' . $row_data->id . '"]'); ?>' onclick="fm_select_value(this)" size="12" readonly="readonly" />
191
  </td>
192
  <td data-colname="<?php _e('PHP function', WDFMInstance(self::PLUGIN)->prefix); ?>">
193
- <input type="text" value='<?php echo (WDFMInstance(self::PLUGIN)->is_free == 2 ? '&#60;?php wd_contact_form_maker(' . $row_data->id . ', "' . $row_data->type . '"); ?&#62;' : '&#60;?php wd_form_maker(' . $row_data->id . ', "' . $row_data->type . '"); ?&#62;'); ?>' onclick="fm_select_value(this)" readonly="readonly" />
194
  </td>
195
  </tr>
196
  <?php
@@ -216,7 +218,12 @@ class FMViewManage_fm extends FMAdminView {
216
  return $list;
217
  }
218
 
219
- public function edit($params) {
 
 
 
 
 
220
  // TODO: Change this function to standard.
221
  echo $this->topbar();
222
 
@@ -512,7 +519,13 @@ class FMViewManage_fm extends FMAdminView {
512
  <?php
513
  }
514
 
515
- public function add_fields($params) {
 
 
 
 
 
 
516
  $pro_fields1 = array('file_upload', 'map', 'paypal');
517
  $pro_fields2 = array('file_upload', 'paypal', 'checkbox', 'radio', 'survey', 'time_and_date', 'select');
518
  $fields = array(
@@ -683,8 +696,13 @@ class FMViewManage_fm extends FMAdminView {
683
  <?php
684
  return ob_get_clean();
685
  }
686
-
687
- public function form_options( $params ) {
 
 
 
 
 
688
  wp_enqueue_style('thickbox');
689
  wp_enqueue_style(WDFMInstance(self::PLUGIN)->handle_prefix . '-phone_field_css');
690
  wp_enqueue_style(WDFMInstance(self::PLUGIN)->handle_prefix . '-jquery-ui');
@@ -739,10 +757,9 @@ class FMViewManage_fm extends FMAdminView {
739
  * Generate page body form options.
740
  *
741
  * @param array $params
742
- *
743
  * @return string Body html.
744
  */
745
- private function body_form_options( $params ) {
746
  $id = $params['id'];
747
  $page = $params['page'];
748
  $page_title = $params['page_title'];
@@ -818,6 +835,9 @@ class FMViewManage_fm extends FMAdminView {
818
  <li>
819
  <a id="mapping" class="fm_fieldset_tab" onclick="form_maker_options_tabs('mapping')" href="#"><?php _e('MySQL Mapping', WDFMInstance(self::PLUGIN)->prefix); ?></a>
820
  </li>
 
 
 
821
  <?php
822
  if ( !empty($addons['tabs']) ) {
823
  foreach ( $addons['tabs'] as $addon => $name ) {
@@ -877,7 +897,7 @@ class FMViewManage_fm extends FMAdminView {
877
  WDFMInstance(self::PLUGIN)->nonce => wp_create_nonce(WDFMInstance(self::PLUGIN)->nonce)
878
  ), admin_url('admin.php?page=themes' . WDFMInstance(self::PLUGIN)->menu_postfix . '&task=edit')); ?>'); return false;"><?php _e('Edit', WDFMInstance(self::PLUGIN)->prefix); ?></a>
879
  <div id="old_theme_notice" class="error inline" style="display: none;"><p><?php _e('The theme you have selected is outdated. Please choose one from New Themes section.', WDFMInstance(self::PLUGIN)->prefix); ?></p></div>
880
- <p class="description"><?php _e('The appearance of your forms is controlled by the theme you select with this option. Press Edit button to open and modify your form theme.', WDFMInstance(self::PLUGIN)->prefix); ?></p>
881
 
882
  </span>
883
  <span class="wd-group">
@@ -996,24 +1016,9 @@ class FMViewManage_fm extends FMAdminView {
996
  </div>
997
  <div class="wd-box-content">
998
  <div class="wd-group wd-has-placeholder">
999
- <label class="wd-label" for="mailToAdd"><?php _e('Email to send submissions to', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1000
- <input type="text" id="mailToAdd" name="mailToAdd" />
1001
- <input type="hidden" id="mail" name="mail" value="<?php echo $row->mail . ($row->mail && (substr($row->mail, -1) != ',') ? ',' : ''); ?>" />
1002
- <span class="dashicons dashicons-list-view" data-id="mailToAdd"></span>
1003
- <div id="cfm_mail_div">
1004
- <?php
1005
- $mail_array = explode(',', $row->mail);
1006
- foreach ( $mail_array as $mail ) {
1007
- if ( $mail && $mail != ',' ) {
1008
- ?>
1009
- <p class="fm_mail_input">
1010
- <span class="mail_name"><?php echo $mail; ?></span><span class="dashicons dashicons-trash" onclick="fm_delete_mail(this, '<?php echo $mail; ?>')" title="<?php _e('Delete Email', WDFMInstance(self::PLUGIN)->prefix); ?>"></span>
1011
- </p>
1012
- <?php
1013
- }
1014
- }
1015
- ?>
1016
- </div>
1017
  <p class="description"><?php _e('Specify the email address(es), to which submitted form information will be sent. For multiple email addresses separate with commas.', WDFMInstance(self::PLUGIN)->prefix); ?></p>
1018
  </div>
1019
  <div class="wd-group wd-has-placeholder">
@@ -1863,10 +1868,36 @@ class FMViewManage_fm extends FMAdminView {
1863
  </div>
1864
  </div>
1865
  </div>
1866
- <?php
1867
  }
1868
- ?>
1869
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1870
  <?php
1871
  if ( !empty ($addons['html']) ){
1872
  foreach($addons['html'] as $addon => $html) {
@@ -1889,7 +1920,13 @@ class FMViewManage_fm extends FMAdminView {
1889
  <?php
1890
  }
1891
 
1892
- public function placeholders_popup($placeholders) {
 
 
 
 
 
 
1893
  ob_start();
1894
  ?>
1895
  <div id="placeholders_overlay"></div>
@@ -1947,7 +1984,7 @@ class FMViewManage_fm extends FMAdminView {
1947
  * @param array $params
1948
  *
1949
  */
1950
- public function form_layout( $params ) {
1951
  wp_enqueue_style(WDFMInstance(self::PLUGIN)->handle_prefix . '-codemirror');
1952
  wp_enqueue_style(WDFMInstance(self::PLUGIN)->handle_prefix . '-colorpicker');
1953
 
@@ -2013,7 +2050,7 @@ class FMViewManage_fm extends FMAdminView {
2013
  * @param array $params
2014
  * @return string Body html.
2015
  */
2016
- private function body_form_layout( $params ) {
2017
  $id = $params['id'];
2018
  $row = $params['row'];
2019
  $ids = $params['ids'];
@@ -2063,12 +2100,17 @@ class FMViewManage_fm extends FMAdminView {
2063
  <?php
2064
  }
2065
 
2066
- public function display_options($params) {
2067
- $row = $params['row'];
 
 
 
 
2068
  $id = $params['id'];
2069
- $fieldset_id = $params['fieldset_id'];
2070
  $page = $params['page'];
2071
  $page_url = $params['page_url'];
 
2072
 
2073
  if($fieldset_id != "embedded") $row->type = $fieldset_id;
2074
 
@@ -2084,13 +2126,18 @@ class FMViewManage_fm extends FMAdminView {
2084
  'action' => add_query_arg( array('page' => $page, 'current_id' => $id ), $page_url),
2085
  );
2086
  echo $this->form(ob_get_clean(), $form_attr);
2087
-
2088
-
2089
  }
2090
 
2091
- public function body_display_options($params) {
 
 
 
 
 
2092
  $row = $params['row'];
2093
  $page_title = $params['page_title'];
 
 
2094
  $animation_effects = $params['animation_effects'];
2095
  $back_url = $params['back_url'];
2096
 
@@ -2121,39 +2168,38 @@ class FMViewManage_fm extends FMAdminView {
2121
  <div class="fm-clear"></div>
2122
  <div class="display-options-container">
2123
  <div id="type_settings_fieldset" class="adminform">
2124
-
2125
  <div class="wd-table">
2126
  <div class="wd-table-col-70 wd-table-col-left">
2127
  <div class="wd-box-section">
2128
  <div class="wd-box-content">
2129
- <span>
2130
- <div class="fm-row fm-form-types">
2131
- <label class="wd-label"><?php _e('Form Type', WDFMInstance(self::PLUGIN)->prefix); ?></label>
2132
- <label>
2133
- <input type="radio" name="form_type" value="embedded" onclick="change_form_type('embedded'); change_hide_show('fm-embedded');"
2134
- <?php echo $row->type == 'embedded' ? 'checked="checked"' : '' ?>>
2135
- <span class="fm-embedded <?php echo $row->type == 'embedded' ? ' active' : '' ?>"></span>
2136
- <p>Embedded</p>
2137
- </label>
2138
- <label>
2139
- <input type="radio" name="form_type" value="popover" onclick="change_form_type('popover'); change_hide_show('fm-popover');"
2140
- <?php echo $row->type == 'popover' ? 'checked="checked"' : '' ?>>
2141
- <span class="fm-popover <?php echo $row->type == 'popover' ? ' active' : '' ?>"></span>
2142
- <p>Popup</p>
2143
- </label>
2144
- <label>
2145
- <input type="radio" name="form_type" value="topbar" onclick="change_form_type('topbar'); change_hide_show('fm-topbar');"
2146
- <?php echo $row->type == 'topbar' ? 'checked="checked"' : '' ?>>
2147
- <span class="fm-topbar <?php echo $row->type == 'topbar' ? ' active' : '' ?>"></span>
2148
- <p>Topbar</p>
2149
- </label>
2150
- <label>
2151
- <input type="radio" name="form_type" value="scrollbox" onclick="change_form_type('scrollbox'); change_hide_show('fm-scrollbox');"<?php echo $row->type == 'scrollbox' ? 'checked="checked"' : '' ?>>
2152
- <span class="fm-scrollbox <?php echo $row->type == 'scrollbox' ? ' active' : '' ?>"></span>
2153
- <p>Scrollbox</p>
2154
- </label>
2155
- </div>
2156
- </span>
2157
  </div>
2158
  </div>
2159
  </div>
@@ -2167,7 +2213,7 @@ class FMViewManage_fm extends FMAdminView {
2167
  <label class="wd-label"><?php _e('Form Placement', WDFMInstance(self::PLUGIN)->prefix); ?></label>
2168
  <div id="fm-embedded-element">
2169
  <p><?php _e('Use', WDFMInstance(self::PLUGIN)->prefix); ?></p>
2170
- <input type="text" value='<?php echo (WDFMInstance(self::PLUGIN)->is_free == 2 ? '[wd_contact_form id="' . $row->form_id . '"]' : '[Form id="' . $row->form_id . '"]'); ?>' onclick="fm_select_value(this)" readonly="readonly" style="width:155px !important;"/>
2171
  <p><?php _e('shortcode to display the form.', WDFMInstance(self::PLUGIN)->prefix); ?></p>
2172
  </div>
2173
  </span>
@@ -2296,25 +2342,16 @@ class FMViewManage_fm extends FMAdminView {
2296
  </span>
2297
  <span class="wd-group fm-popover fm-topbar fm-scrollbox <?php echo $row->type != 'embedded' ? 'fm-show' : 'fm-hide' ?>">
2298
  <label class="wd-label"><?php _e('Display on', WDFMInstance(self::PLUGIN)->prefix); ?></label>
2299
- <ul class="pp_display pp_display_on"><?php
2300
- $posts_and_pages = $params['posts_and_pages'];
2301
- $stat_types = array('everything' => 'All', 'home' => 'Homepage', 'archive' => 'Archives');
2302
-
2303
  $def_post_types = array('post' => 'Post', 'page' => 'Page');
2304
- $custom_post_types = get_post_types( array(
2305
- 'public' => true,
2306
- '_builtin' => false,
2307
- ) );
2308
-
2309
- $post_types = array_merge($def_post_types, $custom_post_types);
2310
- $all_types = $stat_types + $post_types;
2311
  $selected_types = explode(',', $row->display_on);
2312
  $show_cats = in_array('post', $selected_types);
2313
  $m = 0;
2314
- foreach($all_types as $post_key => $post_type){
2315
  $checked = in_array('everything', $selected_types) || in_array($post_key, $selected_types) ? 'checked="checked"' : '';
2316
  $postclass = $post_key != 'page' && in_array($post_key, array_keys($def_post_types)) ? 'class="catpost"' : '';
2317
- echo '<li><input id="pt'.$m.'" type="checkbox" name="display_on[]" value="'.$post_key.'" '.$checked.' '.$postclass.'/><label for="pt'.$m.'">'.$post_type.'</label></li>';
2318
  $m++;
2319
  }
2320
  ?>
@@ -2329,7 +2366,6 @@ class FMViewManage_fm extends FMAdminView {
2329
  $m = 0;
2330
  foreach($categories as $cat_key => $category){
2331
  $checked = ((!$row->current_categories && !$row->display_on_categories) || in_array($cat_key, $selected_categories) || (in_array('auto_check_new', $selected_categories) && !in_array($cat_key, $current_categories_array))) ? 'checked="checked"' : '';
2332
-
2333
  echo '<li><input id="cat'.$m.'" type="checkbox" name="display_on_categories[]" value="'.$cat_key.'" '.$checked.'/><label for="cat'.$m.'">'.$category.'</label></li>';
2334
  $m++;
2335
  }
@@ -2348,7 +2384,9 @@ class FMViewManage_fm extends FMAdminView {
2348
  </div>
2349
  <p><?php _e('Posts defined below will override all settings above.', WDFMInstance(self::PLUGIN)->prefix); ?></p>
2350
  <ul class="fm-pp">
2351
- <li class="pp_selected"><?php if($row->posts_include){
 
 
2352
  $posts_include = explode(',', $row->posts_include);
2353
  foreach($posts_include as $post_exclude){
2354
  if(isset($posts_and_pages[$post_exclude])){
22
 
23
  /**
24
  * Display page.
25
+ *
26
+ * @param array $params
27
  */
28
+ public function display( $params = array() ) {
29
  $this->import_popup_div();
30
  ob_start();
31
  echo $this->body($params);
41
  /**
42
  * Generate page body.
43
  *
44
+ * @param array $params
45
  * @return string Body html.
46
  */
47
+ public function body( $params = array() ) {
48
  $page = $params['page'];
49
  $actions = $params['actions'];
50
  $form_preview_link = $params['form_preview_link'];
76
  echo $this->pagination($page_url, $total, $items_per_page);
77
  ?>
78
  </div>
 
79
  <table class="adminlist table table-striped wp-list-table widefat fixed pages">
80
  <thead>
81
  <tr>
189
  ?>
190
  </td>
191
  <td data-colname="<?php _e('Shortcode', WDFMInstance(self::PLUGIN)->prefix); ?>">
192
+ <input type="text" value='<?php echo (WDFMInstance(self::PLUGIN)->is_free == 2 ? '[wd_contact_form id="' . $row_data->id . '"]' : '[Form id="' . $row_data->id . '"]'); ?>' onclick="fm_select_value(this)" size="12" readonly="readonly" class="fm_shortcode" />
193
  </td>
194
  <td data-colname="<?php _e('PHP function', WDFMInstance(self::PLUGIN)->prefix); ?>">
195
+ <input type="text" value='<?php echo (WDFMInstance(self::PLUGIN)->is_free == 2 ? '&#60;?php wd_contact_form_maker(' . $row_data->id . ', "' . $row_data->type . '"); ?&#62;' : '&#60;?php wd_form_maker(' . $row_data->id . ', "' . $row_data->type . '"); ?&#62;'); ?>' onclick="fm_select_value(this)" readonly="readonly" class="fm_php_function" />
196
  </td>
197
  </tr>
198
  <?php
218
  return $list;
219
  }
220
 
221
+ /**
222
+ * Edit.
223
+ *
224
+ * @param array $params
225
+ */
226
+ public function edit( $params = array() ) {
227
  // TODO: Change this function to standard.
228
  echo $this->topbar();
229
 
519
  <?php
520
  }
521
 
522
+ /**
523
+ * add fields.
524
+ *
525
+ * @param array $params
526
+ * @return string
527
+ */
528
+ public function add_fields( $params = array() ) {
529
  $pro_fields1 = array('file_upload', 'map', 'paypal');
530
  $pro_fields2 = array('file_upload', 'paypal', 'checkbox', 'radio', 'survey', 'time_and_date', 'select');
531
  $fields = array(
696
  <?php
697
  return ob_get_clean();
698
  }
699
+
700
+ /**
701
+ * Form options.
702
+ *
703
+ * @param array $params
704
+ */
705
+ public function form_options( $params = array() ) {
706
  wp_enqueue_style('thickbox');
707
  wp_enqueue_style(WDFMInstance(self::PLUGIN)->handle_prefix . '-phone_field_css');
708
  wp_enqueue_style(WDFMInstance(self::PLUGIN)->handle_prefix . '-jquery-ui');
757
  * Generate page body form options.
758
  *
759
  * @param array $params
 
760
  * @return string Body html.
761
  */
762
+ private function body_form_options( $params = array() ) {
763
  $id = $params['id'];
764
  $page = $params['page'];
765
  $page_title = $params['page_title'];
835
  <li>
836
  <a id="mapping" class="fm_fieldset_tab" onclick="form_maker_options_tabs('mapping')" href="#"><?php _e('MySQL Mapping', WDFMInstance(self::PLUGIN)->prefix); ?></a>
837
  </li>
838
+ <li>
839
+ <a id="privacy" class="fm_fieldset_tab" onclick="form_maker_options_tabs('privacy')" href="#"><?php _e('Privacy', WDFMInstance(self::PLUGIN)->prefix); ?></a>
840
+ </li>
841
  <?php
842
  if ( !empty($addons['tabs']) ) {
843
  foreach ( $addons['tabs'] as $addon => $name ) {
897
  WDFMInstance(self::PLUGIN)->nonce => wp_create_nonce(WDFMInstance(self::PLUGIN)->nonce)
898
  ), admin_url('admin.php?page=themes' . WDFMInstance(self::PLUGIN)->menu_postfix . '&task=edit')); ?>'); return false;"><?php _e('Edit', WDFMInstance(self::PLUGIN)->prefix); ?></a>
899
  <div id="old_theme_notice" class="error inline" style="display: none;"><p><?php _e('The theme you have selected is outdated. Please choose one from New Themes section.', WDFMInstance(self::PLUGIN)->prefix); ?></p></div>
900
+ <p class="description"><?php _e('The appearance of your forms is controlled by the theme you select with this option. Press Edit button to open and modify your form theme.', WDFMInstance(self::PLUGIN)->prefix); ?></p>
901
 
902
  </span>
903
  <span class="wd-group">
1016
  </div>
1017
  <div class="wd-box-content">
1018
  <div class="wd-group wd-has-placeholder">
1019
+ <label class="wd-label" for="mail"><?php _e('Email to send submissions to', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1020
+ <input type="text" id="mail" name="mail" value="<?php echo $row->mail; ?>" />
1021
+ <span class="dashicons dashicons-list-view" data-id="mail"></span>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1022
  <p class="description"><?php _e('Specify the email address(es), to which submitted form information will be sent. For multiple email addresses separate with commas.', WDFMInstance(self::PLUGIN)->prefix); ?></p>
1023
  </div>
1024
  <div class="wd-group wd-has-placeholder">
1868
  </div>
1869
  </div>
1870
  </div>
1871
+ <?php
1872
  }
1873
+ ?>
1874
+ </div>
1875
+ <div id="privacy_fieldset" class="adminform fm_fieldset_deactive">
1876
+ <div class="wd-table">
1877
+ <div class="wd-table-col-70">
1878
+ <div class="wd-box-section">
1879
+ <div class="wd-box-content">
1880
+ <div class="wd-group">
1881
+ <label class="wd-label"><?php _e('Save User IP Address to Database', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1882
+ <input type="radio" name="save_ip" <?php echo $row->save_ip == 1 ? 'checked="checked"' : '' ?> id="fm_go-save_ip-1" class="wd-radio" value="1">
1883
+ <label class="wd-label-radio" for="fm_go-save_ip-1"><?php _e('Yes', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1884
+ <input type="radio" name="save_ip" <?php echo $row->save_ip == 0 ? 'checked="checked"' : '' ?> id="fm_go-save_ip-0" class="wd-radio" value="0">
1885
+ <label class="wd-label-radio" for="fm_go-save_ip-0"><?php _e('No', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1886
+ <p class="description"><?php _e('Use this setting to disable storing submitter IP address to the database of your website.', WDFMInstance(self::PLUGIN)->prefix); ?></p>
1887
+ </div>
1888
+ <div class="wd-group">
1889
+ <label class="wd-label"><?php _e('Save User Data to Database', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1890
+ <input type="radio" name="save_user_id" <?php echo $row->save_user_id == 1 ? 'checked="checked"' : '' ?> id="fm_go-save_user_id-1" class="wd-radio" value="1">
1891
+ <label class="wd-label-radio" for="fm_go-save_user_id-1"><?php _e('Yes', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1892
+ <input type="radio" name="save_user_id" <?php echo $row->save_user_id == 0 ? 'checked="checked"' : '' ?> id="fm_go-save_user_id-0" class="wd-radio" value="0">
1893
+ <label class="wd-label-radio" for="fm_go-save_user_id-0"><?php _e('No', WDFMInstance(self::PLUGIN)->prefix); ?></label>
1894
+ <p class="description"><?php _e('Disable this option to stop saving logged in username and email address to the database of your website.', WDFMInstance(self::PLUGIN)->prefix); ?></p>
1895
+ </div>
1896
+ </div>
1897
+ </div>
1898
+ </div>
1899
+ </div>
1900
+ </div>
1901
  <?php
1902
  if ( !empty ($addons['html']) ){
1903
  foreach($addons['html'] as $addon => $html) {
1920
  <?php
1921
  }
1922
 
1923
+ /**
1924
+ * Placeholders popup.
1925
+ *
1926
+ * @param array $placeholders
1927
+ * @return string
1928
+ */
1929
+ public function placeholders_popup( $placeholders = array() ) {
1930
  ob_start();
1931
  ?>
1932
  <div id="placeholders_overlay"></div>
1984
  * @param array $params
1985
  *
1986
  */
1987
+ public function form_layout( $params = array() ) {
1988
  wp_enqueue_style(WDFMInstance(self::PLUGIN)->handle_prefix . '-codemirror');
1989
  wp_enqueue_style(WDFMInstance(self::PLUGIN)->handle_prefix . '-colorpicker');
1990
 
2050
  * @param array $params
2051
  * @return string Body html.
2052
  */
2053
+ private function body_form_layout( $params = array() ) {
2054
  $id = $params['id'];
2055
  $row = $params['row'];
2056
  $ids = $params['ids'];
2100
  <?php
2101
  }
2102
 
2103
+ /**
2104
+ * Display options.
2105
+ *
2106
+ * @param array $params
2107
+ */
2108
+ public function display_options( $params = array() ) {
2109
  $id = $params['id'];
2110
+ $row = $params['row'];
2111
  $page = $params['page'];
2112
  $page_url = $params['page_url'];
2113
+ $fieldset_id = $params['fieldset_id'];
2114
 
2115
  if($fieldset_id != "embedded") $row->type = $fieldset_id;
2116
 
2126
  'action' => add_query_arg( array('page' => $page, 'current_id' => $id ), $page_url),
2127
  );
2128
  echo $this->form(ob_get_clean(), $form_attr);
 
 
2129
  }
2130
 
2131
+ /**
2132
+ * Body display options.
2133
+ *
2134
+ * @param array $params
2135
+ */
2136
+ public function body_display_options( $params = array() ) {
2137
  $row = $params['row'];
2138
  $page_title = $params['page_title'];
2139
+ $posts_and_pages = $params['posts_and_pages'];
2140
+ $all_display_posts = $params['all_display_posts'];
2141
  $animation_effects = $params['animation_effects'];
2142
  $back_url = $params['back_url'];
2143
 
2168
  <div class="fm-clear"></div>
2169
  <div class="display-options-container">
2170
  <div id="type_settings_fieldset" class="adminform">
 
2171
  <div class="wd-table">
2172
  <div class="wd-table-col-70 wd-table-col-left">
2173
  <div class="wd-box-section">
2174
  <div class="wd-box-content">
2175
+ <span>
2176
+ <div class="fm-row fm-form-types">
2177
+ <label class="wd-label"><?php _e('Form Type', WDFMInstance(self::PLUGIN)->prefix); ?></label>
2178
+ <label>
2179
+ <input type="radio" name="form_type" value="embedded" onclick="change_form_type('embedded'); change_hide_show('fm-embedded');"
2180
+ <?php echo $row->type == 'embedded' ? 'checked="checked"' : '' ?>>
2181
+ <span class="fm-embedded <?php echo $row->type == 'embedded' ? ' active' : '' ?>"></span>
2182
+ <p><?php _e('Embedded', WDFMInstance(self::PLUGIN)->prefix); ?></p>
2183
+ </label>
2184
+ <label>
2185
+ <input type="radio" name="form_type" value="popover" onclick="change_form_type('popover'); change_hide_show('fm-popover');"
2186
+ <?php echo $row->type == 'popover' ? 'checked="checked"' : '' ?>>
2187
+ <span class="fm-popover <?php echo $row->type == 'popover' ? ' active' : '' ?>"></span>
2188
+ <p><?php _e('Popup', WDFMInstance(self::PLUGIN)->prefix); ?></p>
2189
+ </label>
2190
+ <label>
2191
+ <input type="radio" name="form_type" value="topbar" onclick="change_form_type('topbar'); change_hide_show('fm-topbar');"
2192
+ <?php echo $row->type == 'topbar' ? 'checked="checked"' : '' ?>>
2193
+ <span class="fm-topbar <?php echo $row->type == 'topbar' ? ' active' : '' ?>"></span>
2194
+ <p><?php _e('Topbar', WDFMInstance(self::PLUGIN)->prefix); ?></p>
2195
+ </label>
2196
+ <label>
2197
+ <input type="radio" name="form_type" value="scrollbox" onclick="change_form_type('scrollbox'); change_hide_show('fm-scrollbox');"<?php echo $row->type == 'scrollbox' ? 'checked="checked"' : '' ?>>
2198
+ <span class="fm-scrollbox <?php echo $row->type == 'scrollbox' ? ' active' : '' ?>"></span>
2199
+ <p><?php _e('Scrollbox', WDFMInstance(self::PLUGIN)->prefix); ?></p>
2200
+ </label>
2201
+ </div>
2202
+ </span>
2203
  </div>
2204
  </div>
2205
  </div>
2213
  <label class="wd-label"><?php _e('Form Placement', WDFMInstance(self::PLUGIN)->prefix); ?></label>
2214
  <div id="fm-embedded-element">
2215
  <p><?php _e('Use', WDFMInstance(self::PLUGIN)->prefix); ?></p>
2216
+ <input type="text" value='<?php echo (WDFMInstance(self::PLUGIN)->is_free == 2 ? '[wd_contact_form id="' . $row->form_id . '"]' : '[Form id="' . $row->form_id . '"]'); ?>' onclick="fm_select_value(this)" readonly="readonly" style="width:190px !important;"/>
2217
  <p><?php _e('shortcode to display the form.', WDFMInstance(self::PLUGIN)->prefix); ?></p>
2218
  </div>
2219
  </span>
2342
  </span>
2343
  <span class="wd-group fm-popover fm-topbar fm-scrollbox <?php echo $row->type != 'embedded' ? 'fm-show' : 'fm-hide' ?>">
2344
  <label class="wd-label"><?php _e('Display on', WDFMInstance(self::PLUGIN)->prefix); ?></label>
2345
+ <ul class="pp_display pp_display_on">
2346
+ <?php
 
 
2347
  $def_post_types = array('post' => 'Post', 'page' => 'Page');
 
 
 
 
 
 
 
2348
  $selected_types = explode(',', $row->display_on);
2349
  $show_cats = in_array('post', $selected_types);
2350
  $m = 0;
2351
+ foreach($all_display_posts as $post_key => $post_type){
2352
  $checked = in_array('everything', $selected_types) || in_array($post_key, $selected_types) ? 'checked="checked"' : '';
2353
  $postclass = $post_key != 'page' && in_array($post_key, array_keys($def_post_types)) ? 'class="catpost"' : '';
2354
+ echo '<li><input id="pt' . $m . '" type="checkbox" name="display_on[]" value="' . $post_key . '" ' . $checked . ' ' . $postclass . '/><label for="pt'.$m.'">'.$post_type.'</label></li>';
2355
  $m++;
2356
  }
2357
  ?>
2366
  $m = 0;
2367
  foreach($categories as $cat_key => $category){
2368
  $checked = ((!$row->current_categories && !$row->display_on_categories) || in_array($cat_key, $selected_categories) || (in_array('auto_check_new', $selected_categories) && !in_array($cat_key, $current_categories_array))) ? 'checked="checked"' : '';
 
2369
  echo '<li><input id="cat'.$m.'" type="checkbox" name="display_on_categories[]" value="'.$cat_key.'" '.$checked.'/><label for="cat'.$m.'">'.$category.'</label></li>';
2370
  $m++;
2371
  }
2384
  </div>
2385
  <p><?php _e('Posts defined below will override all settings above.', WDFMInstance(self::PLUGIN)->prefix); ?></p>
2386
  <ul class="fm-pp">
2387
+ <li class="pp_selected">
2388
+ <?php
2389
+ if($row->posts_include){
2390
  $posts_include = explode(',', $row->posts_include);
2391
  foreach($posts_include as $post_exclude){
2392
  if(isset($posts_and_pages[$post_exclude])){
admin/views/Options_fm.php CHANGED
@@ -16,8 +16,10 @@ class FMViewOptions_fm extends FMAdminView {
16
 
17
  /**
18
  * Display page.
 
 
19
  */
20
- public function display($params) {
21
  ob_start();
22
  echo $this->title(array(
23
  'title' => __('Options', WDFMInstance(self::PLUGIN)->prefix),
@@ -42,7 +44,13 @@ class FMViewOptions_fm extends FMAdminView {
42
  echo $this->form(ob_get_clean(), $form_attr);
43
  }
44
 
45
- public function body($fm_settings) {
 
 
 
 
 
 
46
  $public_key = isset($fm_settings['public_key']) ? $fm_settings['public_key'] : '';
47
  $private_key = isset($fm_settings['private_key']) ? $fm_settings['private_key'] : '';
48
  $csv_delimiter = isset($fm_settings['csv_delimiter']) ? $fm_settings['csv_delimiter'] : ',';
16
 
17
  /**
18
  * Display page.
19
+ *
20
+ * @param array $params
21
  */
22
+ public function display( $params = array() ) {
23
  ob_start();
24
  echo $this->title(array(
25
  'title' => __('Options', WDFMInstance(self::PLUGIN)->prefix),
44
  echo $this->form(ob_get_clean(), $form_attr);
45
  }
46
 
47
+ /**
48
+ * Generate page body.
49
+ *
50
+ * @param array $fm_settings
51
+ * @return string Body html.
52
+ */
53
+ public function body( $fm_settings = array() ) {
54
  $public_key = isset($fm_settings['public_key']) ? $fm_settings['public_key'] : '';
55
  $private_key = isset($fm_settings['private_key']) ? $fm_settings['private_key'] : '';
56
  $csv_delimiter = isset($fm_settings['csv_delimiter']) ? $fm_settings['csv_delimiter'] : ',';
admin/views/Pricing_fm.php CHANGED
@@ -4,6 +4,7 @@
4
  * Class FMViewPricing_fm
5
  */
6
  class FMViewPricing_fm extends FMAdminView {
 
7
  /**
8
  * FMViewpricing_fm constructor.
9
  */
@@ -13,7 +14,12 @@ class FMViewPricing_fm extends FMAdminView {
13
  wp_enqueue_script(WDFMInstance(self::PLUGIN)->handle_prefix . '-admin');
14
  }
15
 
16
- public function display( $params = array() ) {
 
 
 
 
 
17
  $page = $params['page'];
18
  $page_url = $params['page_url'];
19
  ob_start();
4
  * Class FMViewPricing_fm
5
  */
6
  class FMViewPricing_fm extends FMAdminView {
7
+
8
  /**
9
  * FMViewpricing_fm constructor.
10
  */
14
  wp_enqueue_script(WDFMInstance(self::PLUGIN)->handle_prefix . '-admin');
15
  }
16
 
17
+ /**
18
+ * Display page.
19
+ *
20
+ * @param array $params
21
+ */
22
+ public function display ( $params = array() ) {
23
  $page = $params['page'];
24
  $page_url = $params['page_url'];
25
  ob_start();
admin/views/Submissions_fm.php CHANGED
@@ -3,9 +3,10 @@
3
  * Class FMViewSubmissions_fm
4
  */
5
  class FMViewSubmissions_fm extends FMAdminView {
 
6
  private $model;
7
 
8
- public function __construct( $model ) {
9
  $this->model = $model;
10
  wp_enqueue_style('thickbox');
11
  wp_enqueue_style(WDFMInstance(self::PLUGIN)->handle_prefix . '-tables');
@@ -37,14 +38,15 @@ class FMViewSubmissions_fm extends FMAdminView {
37
 
38
  /**
39
  * Forms page.
 
40
  * @param $params
41
  */
42
- public function forms( $params ) {
43
  // TODO: Change this function to standard.
44
  echo $this->topbar();
45
 
46
- $id = $params['id'];
47
- $page = $params['page'];
48
  $page_title = $params['page_title'];
49
  $page_url = $params['page_url'];
50
  $forms = $params['forms'];
@@ -68,7 +70,7 @@ class FMViewSubmissions_fm extends FMAdminView {
68
  <table class="wp-list-table widefat fixed striped posts">
69
  <body id="the-list">
70
  <tr class="no-items">
71
- <td class="colspanchange" colspan="0"><?php _e('Please select a form to view submissions', WDFMInstance(self::PLUGIN)->prefix); ?></td>
72
  </tr>
73
  </body>
74
  </table>
@@ -76,14 +78,18 @@ class FMViewSubmissions_fm extends FMAdminView {
76
  echo '</div>';
77
  }
78
 
79
- /**
80
- * Display page.
81
- */
82
- public function display( $params ) {
 
 
83
  $id = $params['id'];
84
  $page = $params['page'];
85
  $page_url = $params['page_url'];
86
  ob_start();
 
 
87
  echo $this->body($params);
88
 
89
  // Pass the content to form.
@@ -91,7 +97,7 @@ class FMViewSubmissions_fm extends FMAdminView {
91
  // 'id' => WDFMInstance(self::PLUGIN)->prefix . '_submissions',
92
  'id' => 'admin_form',
93
  'name' => WDFMInstance(self::PLUGIN)->prefix . '_submissions',
94
- 'class' => WDFMInstance(self::PLUGIN)->prefix . '_submissions wd-form',
95
  'action' => add_query_arg( array('page' => $page, 'task' => 'display', 'current_id' => $id ), $page_url),
96
  );
97
  echo $this->form(ob_get_clean(), $form_attr);
@@ -100,9 +106,10 @@ class FMViewSubmissions_fm extends FMAdminView {
100
  /**
101
  * Generate page body.
102
  *
 
103
  * @return string Body html.
104
  */
105
- public function body( $params ) {
106
  global $wpdb;
107
  $form_id = $params['id'];
108
  $page = $params['page'];
@@ -141,7 +148,9 @@ class FMViewSubmissions_fm extends FMAdminView {
141
  $oder_class = $params['oder_class'];
142
  $m = $params['m'];
143
 
 
144
  $group_id_s = $params['group_id_s'];
 
145
  $is_search = $params['is_search'];
146
  $is_stats = $params['is_stats'];
147
 
@@ -159,7 +168,6 @@ class FMViewSubmissions_fm extends FMAdminView {
159
  'title' => $page_title,
160
  'title_class' => 'wd-header',
161
  ));
162
-
163
  ?>
164
  <br>
165
  <div>
@@ -198,21 +206,18 @@ class FMViewSubmissions_fm extends FMAdminView {
198
  <input type="button" class="button action <?php echo ($is_search) ? '' : 'hide'; ?>" onclick="remove_all(); fm_set_input_value('order_by', 'group_id'); fm_set_input_value('asc_or_desc', 'desc'); fm_form_submit(event, 'admin_form'); return false;" value="<?php echo _e('Reset', WDFMInstance(self::PLUGIN)->prefix);?>">
199
  </span>
200
  </div>
201
- <?php
202
- echo $this->pagination($pagination_url, $subs_count, $page_per_num);
203
- ?>
204
  </div>
205
  <div style="width: 100%;">
206
-
207
  <div class="table-wrapper-1 <?php echo ($m == 0) ? 'no-scroll' : ''; ?>">
208
  <div class="table-scroll-1"></div>
209
  </div>
210
  <div class="table-wrapper-2 <?php echo ($m == 0) ? 'no-scroll' : ''; ?>">
211
  <div class="table-scroll-2 submit_content" id="fm-scroll">
212
- <table class="adminlist table table-striped wp-list-table widefat fixed pages">
213
  <thead>
214
  <tr class="fm_table_head">
215
- <td id="cb" class="column-cb check-column">
216
  <label class="screen-reader-text" for="cb-select-all-1"><?php _e('Select all', WDFMInstance(self::PLUGIN)->prefix);?></label>
217
  <input type="checkbox" id="check_all">
218
  </td>
@@ -221,7 +226,7 @@ class FMViewSubmissions_fm extends FMAdminView {
221
  }
222
  else {
223
  echo $oder_class_default;
224
- } ?> col_id" <?php echo $style_id; ?> data-colname="<?php _e('ID', WDFMInstance(self::PLUGIN)->prefix);?>">
225
  <a href="" class="sub_id" onclick="fm_set_input_value('order_by', 'group_id');
226
  fm_set_input_value('asc_or_desc', '<?php echo(($order_by == 'group_id' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>');
227
  fm_form_submit(event, 'admin_form')">
@@ -229,7 +234,7 @@ class FMViewSubmissions_fm extends FMAdminView {
229
  <span class="sorting-indicator"></span>
230
  </a>
231
  </th>
232
- <th id="submitsubmitdate_fc" class="column-primary col-submit-date <?php if ( $order_by == "date" ) {
233
  echo $oder_class;
234
  }
235
  else {
@@ -281,7 +286,7 @@ class FMViewSubmissions_fm extends FMAdminView {
281
  <span class="sorting-indicator"></span>
282
  </a>
283
  </th>
284
- <?php
285
  $stripe_paypal = false;
286
  for ( $i = 0; $i < count($sorted_label_names); $i++ ) {
287
  $styleStr = $this->model->hide_or_not($lists['hide_label_list'], $sorted_labels_id[$i]);
@@ -292,13 +297,13 @@ class FMViewSubmissions_fm extends FMAdminView {
292
  $stripe_paypal = true;
293
  if ( $sorted_label_types[$i] != 'type_stripe' ) {
294
  ?>
295
- <th <?php echo $styleStr; ?> id="<?php echo $sorted_labels_id[$i] . '_fc'; ?>" class="table_large_col <?php echo $sorted_labels_id[$i] . '_fc ';
296
  if ( $order_by == $sorted_labels_id[$i] . "_field" ) {
297
  echo $oder_class . '"';
298
  }
299
  else {
300
  echo $oder_class_default . '"';
301
- } ?>" data-colname="<?php echo $field_title; ?>">
302
  <a href="" onclick="fm_set_input_value('order_by', '<?php echo $sorted_labels_id[$i] . '_field'; ?>'); fm_set_input_value('asc_or_desc', '<?php echo(($order_by == $sorted_labels_id[$i] . '_field' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>'); fm_form_submit(event, 'admin_form')">
303
  <span><?php echo $textdata['text']; ?></span>
304
  <span class="sorting-indicator"></span>
@@ -310,7 +315,7 @@ class FMViewSubmissions_fm extends FMAdminView {
310
  else {
311
  ?>
312
  <th <?php echo $styleStr; ?> id="<?php echo $sorted_labels_id[$i] . '_fc'; ?>" class="<?php echo ($sorted_label_types[$i] == 'type_mark_map' || $sorted_label_types[$i] == 'type_matrix') ? 'table_large_col ' : '';
313
- echo $sorted_labels_id[$i] . '_fc';
314
  if ( $order_by == $sorted_labels_id[$i] . "_field" ) {
315
  echo $oder_class . '"';
316
  }
@@ -330,25 +335,25 @@ class FMViewSubmissions_fm extends FMAdminView {
330
  <?php } ?>
331
  </tr>
332
  <tr id="fm-fields-filter" style="display: none;">
333
- <th></th>
334
  <th class="submitid_fc" <?php echo $style_id; ?> >
335
  <input type="text" name="id_search" id="id_search" value="<?php echo $lists['id_search'] ?>" style="width:30px" />
336
  </th>
337
- <th class="submitdate_fc" <?php echo $style_date; ?>>
338
  <table align="center" style="margin:auto" class="simple_table">
339
- <tr class="simple_table">
340
- <td class="simple_table" style="text-align: left;">From:</td>
341
- <td style="text-align: center;" class="simple_table">
342
- <input class="inputbox" type="text" name="startdate" id="startdate" size="10" maxlength="10" value="<?php echo $lists['startdate']; ?>" />
343
- </td>
344
- </tr>
345
- <tr class="simple_table">
346
- <td style="text-align: left;" class="simple_table">To:</td>
347
- <td style="text-align: center;" class="simple_table">
348
- <input class="inputbox" type="text" name="enddate" id="enddate" size="10" maxlength="10" value="<?php echo $lists['enddate']; ?>" />
349
- </td>
350
- </tr>
351
- </table>
352
  </th>
353
  <th class="submitterip_fc" <?php echo $style_ip; ?>>
354
  <input type="text" name="ip_search" id="ip_search" value="<?php echo $lists['ip_search']; ?>" />
@@ -453,13 +458,13 @@ class FMViewSubmissions_fm extends FMAdminView {
453
  $username = $userinfo ? $userinfo->display_name : "";
454
  ?>
455
  <tr id="tr_<?php echo $data->group_id; ?>" class="<?php echo $alternate; ?>">
456
- <th class="check-column">
457
  <input type="checkbox" id="check_<?php echo $data->group_id; ?>" name="check[<?php echo $data->group_id; ?>]">
458
  </th>
459
- <td id="submitid_fc" class="col-id" data-colname="<?php _e('ID', WDFMInstance(self::PLUGIN)->prefix);?>" <?php echo $style_id; ?>>
460
  <a href="" onclick="fm_set_input_value('task', 'edit'); fm_set_input_value('current_id',<?php echo $data->group_id; ?>); fm_form_submit(event, 'admin_form');"><?php echo $data->group_id; ?></a>
461
  </td>
462
- <td class="column-primary col-submit-date" data-colname="<?php _e('Submit date', WDFMInstance(self::PLUGIN)->prefix);?>" <?php echo $style_date; ?>>
463
  <?php
464
  $view_url = add_query_arg( array(
465
  'action' => 'FormMakerSubmits' . WDFMInstance(self::PLUGIN)->plugin_postfix,
@@ -496,21 +501,23 @@ class FMViewSubmissions_fm extends FMAdminView {
496
  <button class="toggle-row" type="button"><span class="screen-reader-text"><?php _e("Show more details", WDFMInstance(self::PLUGIN)->prefix); ?></span></button>
497
  </div>
498
  </td>
499
- <td class="submitterip_fc sub-align" id="submitterip_fc" <?php echo $style_ip; ?> data-colname="<?php _e('Show submitter information', WDFMInstance(self::PLUGIN)->prefix);?>">
 
500
  <p><a class="thickbox-preview" href="<?php echo $ip_infoin_popup_url; ?>" title="<?php _e("Show submitter information", WDFMInstance(self::PLUGIN)->prefix); ?>" <?php echo (!in_array($data->ip, $blocked_ips)) ? '' : 'style="color: #FF0000;"'; ?>><?php echo $data->ip; ?></a></p>
501
- <div class="row-actions">
502
- <?php if( !in_array($data->ip, $blocked_ips) ){ ?>
503
- <span><a href="<?php echo $block_url; ?>" title="<?php _e("Block IP", WDFMInstance(self::PLUGIN)->prefix); ?>"><?php _e('Block IP', WDFMInstance(self::PLUGIN)->prefix); ?></a></span>
504
- <?php } else { ?>
505
- <span><a href="<?php echo $unblock_url; ?>" title="<?php _e("Unblock IP ", WDFMInstance(self::PLUGIN)->prefix); ?>"><?php _e('Unblock IP', WDFMInstance(self::PLUGIN)->prefix); ?></a></span>
 
 
506
  <?php } ?>
507
- </div>
508
  </td>
509
- <td class="table_large_col submitterusername_fc sub-align" id="submitterusername_fc" <?php echo $style_username; ?> data-colname="<?php _e('Submitter\'s Username', WDFMInstance(self::PLUGIN)->prefix);?>">
510
  <p><?php echo $username; ?></p>
511
  </td>
512
- <td class="table_large_col submitteremail_fc sub-align" id="submitteremail_fc" <?php echo $style_useremail; ?> data-colname="<?php _e('Submitter\'s Email Address', WDFMInstance(self::PLUGIN)->prefix);?>">
513
- <p><?php echo $useremail; ?></p>
514
  </td>
515
  <?php
516
  for ( $h = 0; $h < $m; $h++ ) {
@@ -529,7 +536,7 @@ class FMViewSubmissions_fm extends FMAdminView {
529
  if ( strpos($temp[$g]->element_value, "***map***") ) {
530
  $map_params = explode('***map***', $temp[$g]->element_value);
531
  ?>
532
- <td class="table_large_col <?php echo $sorted_labels_id[$h]; ?>_fc sub-align" id="<?php echo $sorted_labels_id[$h]; ?>_fc" <?php echo $styleStr; ?> data-colname="<?php _e('Show on Map', WDFMInstance(self::PLUGIN)->prefix);?>">
533
  <a class="thickbox-preview" href="<?php echo add_query_arg(array(
534
  'action' => 'FormMakerMapEditinPopup' . WDFMInstance(self::PLUGIN)->plugin_postfix,
535
  'long' => $map_params[0],
@@ -543,7 +550,7 @@ class FMViewSubmissions_fm extends FMAdminView {
543
  }
544
  elseif ( strpos($temp[$g]->element_value, "*@@url@@*") ) {
545
  ?>
546
- <td class="<?php echo $sorted_labels_id[$h]; ?>_fc sub-align" id="<?php echo $sorted_labels_id[$h]; ?>_fc" <?php echo $styleStr; ?> data-colname="<?php _e('URL', WDFMInstance(self::PLUGIN)->prefix);?>">
547
  <?php
548
  $new_files = explode("*@@url@@*", $temp[$g]->element_value);
549
  foreach ( $new_files as $new_file ) {
@@ -564,12 +571,12 @@ class FMViewSubmissions_fm extends FMAdminView {
564
  $view_star_rating_array = $this->model->view_for_star_rating($temp[$g]->element_value, $temp[$g]->element_label);
565
  $stars = $view_star_rating_array[0];
566
  ?>
567
- <td align="center" class="<?php echo $sorted_labels_id[$h]; ?>_fc sub-align" id="<?php echo $sorted_labels_id[$h]; ?>_fc" <?php echo $styleStr; ?> data-colname="<?php _e('Star rating', WDFMInstance(self::PLUGIN)->prefix);?>"><?php echo $stars; ?></td>
568
  <?php
569
  }
570
  elseif ( strpos($temp[$g]->element_value, "***matrix***") ) {
571
  ?>
572
- <td class="table_large_col <?php echo $sorted_labels_id[$h]; ?>_fc sub-align" id="<?php echo $sorted_labels_id[$h]; ?>_fc" <?php echo $styleStr; ?> data-colname="<?php _e('Matrix', WDFMInstance(self::PLUGIN)->prefix);?>">
573
  <a class="thickbox-preview" href="<?php echo add_query_arg(array(
574
  'action' => 'show_matrix' . WDFMInstance(self::PLUGIN)->plugin_postfix,
575
  'matrix_params' => str_replace('#', '%23', urlencode($temp[$g]->element_value)),
@@ -582,7 +589,7 @@ class FMViewSubmissions_fm extends FMAdminView {
582
  }
583
  elseif ( strpos($temp[$g]->element_value, "@@@") !== FALSE || $temp[$g]->element_value == "@@@" || $temp[$g]->element_value == "@@@@@@@@@" ) {
584
  ?>
585
- <td class="<?php echo $sorted_labels_id[$h]; ?>_fc sub-align" <?php echo $styleStr; ?> data-colname="<?php echo !empty($label_name_ids[$sorted_labels_id[$h]]) ? $label_name_ids[$sorted_labels_id[$h]] : ''; ?>">
586
  <p><?php echo str_replace("@@@", " ", $temp[$g]->element_value); ?></p>
587
  </td>
588
  <?php
@@ -591,7 +598,7 @@ class FMViewSubmissions_fm extends FMAdminView {
591
  $view_grading_array = $this->model->view_for_grading($temp[$g]->element_value);
592
  $items = $view_grading_array[0];
593
  ?>
594
- <td class="<?php echo $sorted_labels_id[$h]; ?>_fc sub-align" id="<?php echo $sorted_labels_id[$h]; ?>_fc" <?php echo $styleStr; ?> data-colname="<?php _e('Grading', WDFMInstance(self::PLUGIN)->prefix);?>">
595
  <p><?php echo $items; ?></p>
596
  </td>
597
  <?php
@@ -624,16 +631,16 @@ class FMViewSubmissions_fm extends FMAdminView {
624
  </td>
625
  <?php }
626
  else { ?>
627
- <td class="<?php echo $sorted_labels_id[$h]; ?>_fc sub-align" id="<?php echo $sorted_labels_id[$h]; ?>_fc" <?php echo $styleStr; ?> data-colname="<?php echo !empty($label_name_ids[$sorted_labels_id[$h]]) ? $label_name_ids[$sorted_labels_id[$h]] : ''; ?>">
628
  <p><?php echo $temp[$g]->element_value; ?></p>
629
  </td>
630
  <?php }
631
  }
632
  else {
633
  $element_value = str_replace("***br***", '<br>', stripslashes($temp[$g]->element_value));
634
- $textdata = $this->gen_shorter_text($element_value, 100);
635
  ?>
636
- <td class="<?php echo $sorted_labels_id[$h]; ?>_fc sub-align" id="<?php echo $sorted_labels_id[$h]; ?>_fc" <?php echo $styleStr; ?> data-colname="<?php echo !empty($label_name_ids[$sorted_labels_id[$h]]) ? $label_name_ids[$sorted_labels_id[$h]] : ''; ?>">
637
  <p><?php echo $textdata['text']; ?></p>
638
  </td>
639
  <?php
@@ -645,7 +652,7 @@ class FMViewSubmissions_fm extends FMAdminView {
645
 
646
  if ( $not_label ) {
647
  ?>
648
- <td class="<?php echo $sorted_labels_id[$h]; ?>_fc sub-align" id="<?php echo $sorted_labels_id[$h]; ?>_fc" <?php echo $styleStr; ?>>
649
  <p>&nbsp;</p>
650
  </td>
651
  <?php
@@ -653,7 +660,7 @@ class FMViewSubmissions_fm extends FMAdminView {
653
  }
654
  if ( $ispaypal ) {
655
  ?>
656
- <td class="payment_info_fc sub-align" id="payment_info_fc" <?php echo $style_payment_info; ?> data-colname="<?php _e('Paypal information', WDFMInstance(self::PLUGIN)->prefix); ?>">
657
  <a class="thickbox-preview" href="<?php echo add_query_arg(array(
658
  'action' => 'paypal_info' . WDFMInstance(self::PLUGIN)->plugin_postfix,
659
  'id' => $i,
@@ -681,6 +688,9 @@ class FMViewSubmissions_fm extends FMAdminView {
681
  </div>
682
  </div>
683
  </div>
 
 
 
684
  <?php
685
  if ( $sorted_label_types ) {
686
  foreach ( $sorted_label_types as $key => $sorted_label_type ) {
@@ -709,7 +719,7 @@ class FMViewSubmissions_fm extends FMAdminView {
709
  }
710
  ?>
711
  </select>
712
- <p class="fm_error_sorted_label_key"><?php echo _e('Please select the field!', WDFMInstance(self::PLUGIN)->prefix);?></p>
713
  </td>
714
  </tr>
715
  <tr>
@@ -722,7 +732,7 @@ class FMViewSubmissions_fm extends FMAdminView {
722
  <input class="inputbox" type="text" name="endstats" id="endstats" size="9" maxlength="9" />
723
  </td>
724
  <td>
725
- <span class="fm-div_stats-loading spinner"></span>
726
  <button class="button" onclick="show_stats(); return false;"><?php _e('Show', WDFMInstance(self::PLUGIN)->prefix); ?></button>
727
  </td>
728
  </tr>
@@ -730,7 +740,7 @@ class FMViewSubmissions_fm extends FMAdminView {
730
  <div id="div_stats"></div>
731
  </div>
732
  <script>
733
- show_stats_url = "<?php echo add_query_arg( array('action' => 'get_stats' . WDFMInstance(self::PLUGIN)->plugin_postfix, 'task' => 'show_stats', 'current_id' => $form_id ), $page_url); ?>";
734
  </script>
735
  <?php
736
  }
@@ -776,18 +786,18 @@ class FMViewSubmissions_fm extends FMAdminView {
776
  );
777
  }
778
  ?>
779
-
780
- function clickLabChBAll(ChBAll) {
781
- if (ChBAll.checked) {
782
  document.forms.admin_form.hide_label_list.value = '';
783
  var ChBDivInputs = document.getElementById('ChBDiv').getElementsByTagName('input');
784
  for (var i = 1, input; input = ChBDivInputs[i++]; ) {
785
- if(input.id != 'ChBAll'){
786
  input.checked = ChBAll.checked;
787
  }
788
  }
789
  }
790
- else {
791
  document.forms.admin_form.hide_label_list.value = '@<?php echo implode($templabels, '@@') ?>@' + '@payment_info@';
792
  for (i = 0; i <= ChBAll.form.length; i++) {
793
  if (typeof(ChBAll.form[i]) != "undefined") {
@@ -801,27 +811,25 @@ class FMViewSubmissions_fm extends FMAdminView {
801
  }
802
  </script>
803
  <div id="ChBDiv">
804
- <p class="add-col-header"><?php _e('Select columns', WDFMInstance(self::PLUGIN)->prefix); ?></p>
805
- <div class="fm_check_labels">
806
  <input type="checkbox" <?php echo ( !$lists['hide_label_list'] ) ? 'checked="checked"' : ''; ?> onclick="clickLabChBAll(this)" id="ChBAll" />
807
  <label for="ChBAll"><?php _e('All', WDFMInstance(self::PLUGIN)->prefix); ?></label>
808
  </div>
809
- <?php
810
- foreach ( $templabels as $key => $curlabel ) {
811
- if ( strpos($lists['hide_label_list'], '@' . $curlabel . '@') === FALSE ) {
812
- ?>
813
- <div class="fm_check_labels">
814
- <input type="checkbox" checked="checked" onclick="clickLabChB('<?php echo $curlabel; ?>', this)" id="fm_check_id_<?php echo $curlabel; ?>" />
815
- <label for="fm_check_id_<?php echo $curlabel; ?>"> <?php echo stripslashes($sorted_label_names_for_check[$key]); ?></label>
816
- </div>
817
- <?php
818
- }
819
- else {
820
- ?>
821
- <div class="fm_check_labels">
822
- <input type="checkbox" onclick="clickLabChB('<?php echo $curlabel; ?>', this)" id="fm_check_id_<?php echo $curlabel; ?>" />
823
- <label for="fm_check_id_<?php echo $curlabel; ?>"> <?php echo stripslashes($sorted_label_names_for_check[$key]); ?></label>
824
- </div>
825
  <?php
826
  }
827
  }
@@ -845,60 +853,139 @@ class FMViewSubmissions_fm extends FMAdminView {
845
  </div>
846
  </div>
847
  <script type="text/javascript">
848
- function export_submissions(type, limit) {
849
- var progressbar = jQuery("#fm-progressbar");
850
- var progressLabel = jQuery(".fm-progress-label");
851
- progressbar.progressbar({
852
- max: <?php echo $subs_count; ?>
853
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
854
  jQuery.ajax({
855
  type: "POST",
 
856
  url: "<?php echo add_query_arg(array(
857
  'form_id' => $form_id,
858
  'send_header' => 0,
859
- ), admin_url('admin-ajax.php')); ?>&action=generete_" + type + "<?php echo WDFMInstance(self::PLUGIN)->plugin_postfix; ?>&limitstart=" + limit,
860
- data: {search_labels: '<?php echo $searched_ids; ?>', verified_emails: jQuery('#verified_emails').val()},
861
- beforeSend: function () {
862
- if (<?php echo $subs_count; ?> >=
863
- 1000
864
- )
865
- jQuery('.fm_modal').show();
866
  },
867
- success: function (data) {
868
- if (limit < <?php echo $subs_count; ?>) {
869
- limit += 1000;
870
- export_submissions(type, limit);
871
- progressbar.progressbar("value", limit);
872
- loaded_percent = Math.round((progressbar.progressbar("value") * 100) / parseInt(<?php echo $subs_count; ?>));
873
- progressLabel.text(loaded_percent + ' %');
874
- progressbarValue = progressbar.find(".fm-progress-label");
875
- if (loaded_percent >= 46) {
876
- progressbarValue.css({
877
- "color": '#fff',
878
- });
879
- }
880
- else {
881
- progressbarValue.css({
882
- "color": '#444',
883
- });
884
- }
885
- }
886
- else {
887
- jQuery('.fm_modal').hide();
888
- progressbar.progressbar("value", 0);
889
- progressLabel.text('Loading ...');
890
- progressbarValue = progressbar.find(".fm-progress-label");
891
- progressbarValue.css({
892
- "color": '#444',
893
- });
894
- window.location = "<?php echo add_query_arg(array(
895
- 'form_id' => $form_id,
896
- 'send_header' => 1,
897
- ), admin_url('admin-ajax.php')); ?>&action=generete_" + type + "<?php echo WDFMInstance(self::PLUGIN)->plugin_postfix; ?>&limitstart=" + limit;
898
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
899
  }
900
  });
901
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
902
  function remove_all() {
903
  if (document.getElementById('startdate')) {
904
  document.getElementById('startdate').value = '';
@@ -919,7 +1006,7 @@ class FMViewSubmissions_fm extends FMAdminView {
919
  document.getElementById('useremail_search').value = '';
920
  }
921
  <?php
922
- foreach($sorted_label_types as $slt_index => $slt_val){
923
  if ($slt_val != "type_mark_map" && $slt_val != "type_stripe") {
924
  ?>
925
  document.getElementById('<?php echo $form_id . '_' . $sorted_labels_id[$slt_index] . '_search'; ?>').value = '';
@@ -934,67 +1021,25 @@ class FMViewSubmissions_fm extends FMAdminView {
934
  }
935
  }
936
  ?>
937
- }
938
-
939
- function show_hide_filter() {
940
- jQuery(".show-filter").toggle();
941
- jQuery(".hide-filter").toggle();
942
- if (document.getElementById('fm-fields-filter').style.display == "none") {
943
- document.getElementById('fm-fields-filter').style.display = '';
944
- jQuery('.fm-bulk-actions .search_reset_button').show();
945
- }
946
- else {
947
- document.getElementById('fm-fields-filter').style.display = "none";
948
- jQuery('.fm-bulk-actions .search_reset_button').hide();
949
- }
950
- add_scroll_width();
951
- return false;
952
- }
953
 
954
- jQuery(document).ready(function () {
955
- jQuery('.theme-detail').click(function () {
956
- jQuery(this).siblings('.themedetaildiv').toggle();
957
- return false;
958
- });
959
- jQuery("#startdate, #startstats, #enddate, #endstats").datepicker({
960
- dateFormat: "yy-mm-dd",
961
- changeMonth: true,
962
- changeYear: true
963
- });
964
- });
965
- jQuery(window).on("resize", function () {
966
- var width = jQuery(window).width();
967
- if (width <= 765) {
968
- document.getElementById('fm-fields-filter').style.display = 'none';
969
- remove_scroll_width();
970
- }
971
- else {
972
- if ( jQuery('.hide-filter.hide').is(":visible") ) {
973
  document.getElementById('fm-fields-filter').style.display = '';
974
- }
975
- add_scroll_width();
976
- }
977
- });
978
- jQuery(window).on('load', function (e) {
979
- fm_popup();
980
- if (typeof jQuery().fancybox !== 'undefined' && jQuery.isFunction(jQuery().fancybox)) {
981
- jQuery(".fm_fancybox").fancybox({
982
- 'maxWidth ': 600,
983
- 'maxHeight': 500
984
- });
985
- }
986
- });
987
- <?php if ($is_search) { ?>
988
- document.getElementById('fm-fields-filter').style.display = '';
989
  <?php } ?>
990
- </script>
991
  <input id="form_id" name="form_id" type="hidden" value="<?php echo $form_id; ?>">
992
  <input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php echo $asc_or_desc; ?>"/>
993
  <input type="hidden" name="order_by" id="order_by" value="<?php echo $order_by; ?>"/>
994
  <?php
995
  }
996
 
997
- public function show_stats( $params ) {
 
 
 
 
 
 
998
  ob_start();
999
  $sorted_label_name_original = $params['sorted_label_name_original'];
1000
  $choices_labels = $params['choices_labels'];
@@ -1067,7 +1112,12 @@ class FMViewSubmissions_fm extends FMAdminView {
1067
  die();
1068
  }
1069
 
1070
- public function edit( $params ) {
 
 
 
 
 
1071
  // TODO: Change this function to standard.
1072
  echo $this->topbar();
1073
 
@@ -1299,9 +1349,10 @@ class FMViewSubmissions_fm extends FMAdminView {
1299
 
1300
  /**
1301
  * Print saelect form.
1302
- * @param $params
 
1303
  */
1304
- private function saelect_form( $params ) {
1305
  if ( !empty($params['forms']) ) {
1306
  $page = $params['page'];
1307
  $page_url = $params['page_url'];
@@ -1333,11 +1384,12 @@ class FMViewSubmissions_fm extends FMAdminView {
1333
  /**
1334
  * Generate short text.
1335
  *
1336
- * @param $text , $chars_limit
 
1337
  *
1338
  * @return array.
1339
  */
1340
- public function gen_shorter_text( $text, $chars_limit ) {
1341
  $data = array();
1342
  // Check if length is larger than the character limit.
1343
  if ( strlen($text) > $chars_limit && $text == strip_tags($text) ) {
@@ -1356,4 +1408,4 @@ class FMViewSubmissions_fm extends FMAdminView {
1356
  }
1357
  return $data;
1358
  }
1359
- }
3
  * Class FMViewSubmissions_fm
4
  */
5
  class FMViewSubmissions_fm extends FMAdminView {
6
+
7
  private $model;
8
 
9
+ public function __construct( $model = array() ) {
10
  $this->model = $model;
11
  wp_enqueue_style('thickbox');
12
  wp_enqueue_style(WDFMInstance(self::PLUGIN)->handle_prefix . '-tables');
38
 
39
  /**
40
  * Forms page.
41
+ *
42
  * @param $params
43
  */
44
+ public function forms( $params = array() ) {
45
  // TODO: Change this function to standard.
46
  echo $this->topbar();
47
 
48
+ $id = $params['id'];
49
+ $page = $params['page'];
50
  $page_title = $params['page_title'];
51
  $page_url = $params['page_url'];
52
  $forms = $params['forms'];
70
  <table class="wp-list-table widefat fixed striped posts">
71
  <body id="the-list">
72
  <tr class="no-items">
73
+ <td class="colspanchange fm-column-not-hide" colspan="0"><?php _e('Please select a form to view submissions', WDFMInstance(self::PLUGIN)->prefix); ?></td>
74
  </tr>
75
  </body>
76
  </table>
78
  echo '</div>';
79
  }
80
 
81
+ /**
82
+ * Display page.
83
+ *
84
+ * @param array $params
85
+ */
86
+ public function display( $params = array() ) {
87
  $id = $params['id'];
88
  $page = $params['page'];
89
  $page_url = $params['page_url'];
90
  ob_start();
91
+ $unexpected_error_message = sprintf( __('An unexpected error occurred while exporting data. %s Please contact Web-Dorado (10Web) Customer Care. %s', WDFMInstance(self::PLUGIN)->prefix), '<a href="https://web-dorado.com/support/contact-us.html" target="_blank">','</a>');
92
+ echo '<div class="fm-unexpected_error_message fm-hide">' . WDW_FM_Library(self::PLUGIN)->message_id('', $unexpected_error_message, 'error') . '</div>';
93
  echo $this->body($params);
94
 
95
  // Pass the content to form.
97
  // 'id' => WDFMInstance(self::PLUGIN)->prefix . '_submissions',
98
  'id' => 'admin_form',
99
  'name' => WDFMInstance(self::PLUGIN)->prefix . '_submissions',
100
+ 'class' => WDFMInstance(self::PLUGIN)->prefix . '_submissions fm-table-submissions wd-form',
101
  'action' => add_query_arg( array('page' => $page, 'task' => 'display', 'current_id' => $id ), $page_url),
102
  );
103
  echo $this->form(ob_get_clean(), $form_attr);
106
  /**
107
  * Generate page body.
108
  *
109
+ * @param array $params
110
  * @return string Body html.
111
  */
112
+ public function body( $params = array() ) {
113
  global $wpdb;
114
  $form_id = $params['id'];
115
  $page = $params['page'];
148
  $oder_class = $params['oder_class'];
149
  $m = $params['m'];
150
 
151
+ $fm_settings = $params['fm_settings'];
152
  $group_id_s = $params['group_id_s'];
153
+ $groupids = $params['groupids'];
154
  $is_search = $params['is_search'];
155
  $is_stats = $params['is_stats'];
156
 
168
  'title' => $page_title,
169
  'title_class' => 'wd-header',
170
  ));
 
171
  ?>
172
  <br>
173
  <div>
206
  <input type="button" class="button action <?php echo ($is_search) ? '' : 'hide'; ?>" onclick="remove_all(); fm_set_input_value('order_by', 'group_id'); fm_set_input_value('asc_or_desc', 'desc'); fm_form_submit(event, 'admin_form'); return false;" value="<?php echo _e('Reset', WDFMInstance(self::PLUGIN)->prefix);?>">
207
  </span>
208
  </div>
209
+ <?php echo $this->pagination($pagination_url, $subs_count, $page_per_num); ?>
 
 
210
  </div>
211
  <div style="width: 100%;">
 
212
  <div class="table-wrapper-1 <?php echo ($m == 0) ? 'no-scroll' : ''; ?>">
213
  <div class="table-scroll-1"></div>
214
  </div>
215
  <div class="table-wrapper-2 <?php echo ($m == 0) ? 'no-scroll' : ''; ?>">
216
  <div class="table-scroll-2 submit_content" id="fm-scroll">
217
+ <table id="fm-submission-lists" class="adminlist table table-striped wp-list-table widefat fixed pages">
218
  <thead>
219
  <tr class="fm_table_head">
220
+ <td id="cb" class="column-cb check-column fm-column-not-hide">
221
  <label class="screen-reader-text" for="cb-select-all-1"><?php _e('Select all', WDFMInstance(self::PLUGIN)->prefix);?></label>
222
  <input type="checkbox" id="check_all">
223
  </td>
226
  }
227
  else {
228
  echo $oder_class_default;
229
+ } ?> submitid_fc col_id" <?php echo $style_id; ?> data-colname="<?php _e('ID', WDFMInstance(self::PLUGIN)->prefix);?>">
230
  <a href="" class="sub_id" onclick="fm_set_input_value('order_by', 'group_id');
231
  fm_set_input_value('asc_or_desc', '<?php echo(($order_by == 'group_id' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>');
232
  fm_form_submit(event, 'admin_form')">
234
  <span class="sorting-indicator"></span>
235
  </a>
236
  </th>
237
+ <th id="submitsubmitdate_fc" class="column-primary col-submit-date fm-column-not-hide <?php if ( $order_by == "date" ) {
238
  echo $oder_class;
239
  }
240
  else {
286
  <span class="sorting-indicator"></span>
287
  </a>
288
  </th>
289
+ <?php
290
  $stripe_paypal = false;
291
  for ( $i = 0; $i < count($sorted_label_names); $i++ ) {
292
  $styleStr = $this->model->hide_or_not($lists['hide_label_list'], $sorted_labels_id[$i]);
297
  $stripe_paypal = true;
298
  if ( $sorted_label_types[$i] != 'type_stripe' ) {
299
  ?>
300
+ <th id="<?php echo $sorted_labels_id[$i] . '_fc'; ?>" class="table_large_col <?php echo $sorted_labels_id[$i] . '_fc ';
301
  if ( $order_by == $sorted_labels_id[$i] . "_field" ) {
302
  echo $oder_class . '"';
303
  }
304
  else {
305
  echo $oder_class_default . '"';
306
+ } ?>" <?php echo $styleStr; ?> data-colname="<?php echo $field_title; ?>">
307
  <a href="" onclick="fm_set_input_value('order_by', '<?php echo $sorted_labels_id[$i] . '_field'; ?>'); fm_set_input_value('asc_or_desc', '<?php echo(($order_by == $sorted_labels_id[$i] . '_field' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>'); fm_form_submit(event, 'admin_form')">
308
  <span><?php echo $textdata['text']; ?></span>
309
  <span class="sorting-indicator"></span>
315
  else {
316
  ?>
317
  <th <?php echo $styleStr; ?> id="<?php echo $sorted_labels_id[$i] . '_fc'; ?>" class="<?php echo ($sorted_label_types[$i] == 'type_mark_map' || $sorted_label_types[$i] == 'type_matrix') ? 'table_large_col ' : '';
318
+ echo $sorted_labels_id[$i] . '_fc ';
319
  if ( $order_by == $sorted_labels_id[$i] . "_field" ) {
320
  echo $oder_class . '"';
321
  }
335
  <?php } ?>
336
  </tr>
337
  <tr id="fm-fields-filter" style="display: none;">
338
+ <th class="fm-column-not-hide"></th>
339
  <th class="submitid_fc" <?php echo $style_id; ?> >
340
  <input type="text" name="id_search" id="id_search" value="<?php echo $lists['id_search'] ?>" style="width:30px" />
341
  </th>
342
+ <th class="submitdate_fc fm-column-not-hide" <?php echo $style_date; ?>>
343
  <table align="center" style="margin:auto" class="simple_table">
344
+ <tr class="simple_table">
345
+ <td class="simple_table fm-column-not-hide" style="text-align: left;">From:</td>
346
+ <td class="simple_table fm-column-not-hide" style="text-align: center;">
347
+ <input class="inputbox" type="text" name="startdate" id="startdate" size="10" maxlength="10" value="<?php echo $lists['startdate']; ?>" />
348
+ </td>
349
+ </tr>
350
+ <tr class="simple_table">
351
+ <td class="simple_table fm-column-not-hide" style="text-align: left;">To:</td>
352
+ <td class="simple_table fm-column-not-hide" style="text-align: center;">
353
+ <input class="inputbox" type="text" name="enddate" id="enddate" size="10" maxlength="10" value="<?php echo $lists['enddate']; ?>" />
354
+ </td>
355
+ </tr>
356
+ </table>
357
  </th>
358
  <th class="submitterip_fc" <?php echo $style_ip; ?>>
359
  <input type="text" name="ip_search" id="ip_search" value="<?php echo $lists['ip_search']; ?>" />
458
  $username = $userinfo ? $userinfo->display_name : "";
459
  ?>
460
  <tr id="tr_<?php echo $data->group_id; ?>" class="<?php echo $alternate; ?>">
461
+ <th class="check-column fm-column-not-hide">
462
  <input type="checkbox" id="check_<?php echo $data->group_id; ?>" name="check[<?php echo $data->group_id; ?>]">
463
  </th>
464
+ <td id="submitid_fc" class="submitid_fc col-id" data-colname="<?php _e('ID', WDFMInstance(self::PLUGIN)->prefix);?>" <?php echo $style_id; ?>>
465
  <a href="" onclick="fm_set_input_value('task', 'edit'); fm_set_input_value('current_id',<?php echo $data->group_id; ?>); fm_form_submit(event, 'admin_form');"><?php echo $data->group_id; ?></a>
466
  </td>
467
+ <td class="column-primary col-submit-date fm-column-not-hide" data-colname="<?php _e('Submit date', WDFMInstance(self::PLUGIN)->prefix);?>" <?php echo $style_date; ?>>
468
  <?php
469
  $view_url = add_query_arg( array(
470
  'action' => 'FormMakerSubmits' . WDFMInstance(self::PLUGIN)->plugin_postfix,
501
  <button class="toggle-row" type="button"><span class="screen-reader-text"><?php _e("Show more details", WDFMInstance(self::PLUGIN)->prefix); ?></span></button>
502
  </div>
503
  </td>
504
+ <td id="submitterip_fc" class="submitterip_fc sub-align" <?php echo $style_ip; ?> data-colname="<?php _e('Show submitter information', WDFMInstance(self::PLUGIN)->prefix);?>">
505
+ <?php if ( $data->ip ) { ?>
506
  <p><a class="thickbox-preview" href="<?php echo $ip_infoin_popup_url; ?>" title="<?php _e("Show submitter information", WDFMInstance(self::PLUGIN)->prefix); ?>" <?php echo (!in_array($data->ip, $blocked_ips)) ? '' : 'style="color: #FF0000;"'; ?>><?php echo $data->ip; ?></a></p>
507
+ <div class="row-actions">
508
+ <?php if( !in_array($data->ip, $blocked_ips) ){ ?>
509
+ <span><a href="<?php echo $block_url; ?>" title="<?php _e("Block IP", WDFMInstance(self::PLUGIN)->prefix); ?>"><?php _e('Block IP', WDFMInstance(self::PLUGIN)->prefix); ?></a></span>
510
+ <?php } else { ?>
511
+ <span><a href="<?php echo $unblock_url; ?>" title="<?php _e("Unblock IP ", WDFMInstance(self::PLUGIN)->prefix); ?>"><?php _e('Unblock IP', WDFMInstance(self::PLUGIN)->prefix); ?></a></span>
512
+ <?php } ?>
513
+ </div>
514
  <?php } ?>
 
515
  </td>
516
+ <td id="submitterusername_fc" class="table_large_col submitterusername_fc sub-align" <?php echo $style_username; ?> data-colname="<?php _e('Submitter\'s Username', WDFMInstance(self::PLUGIN)->prefix);?>">
517
  <p><?php echo $username; ?></p>
518
  </td>
519
+ <td id="submitteremail_fc" class="table_large_col submitteremail_fc sub-align" <?php echo $style_useremail; ?> data-colname="<?php _e('Submitter\'s Email Address', WDFMInstance(self::PLUGIN)->prefix);?>">
520
+ <p><?php echo $useremail; ?></p>
521
  </td>
522
  <?php
523
  for ( $h = 0; $h < $m; $h++ ) {
536
  if ( strpos($temp[$g]->element_value, "***map***") ) {
537
  $map_params = explode('***map***', $temp[$g]->element_value);
538
  ?>
539
+ <td id="<?php echo $sorted_labels_id[$h]; ?>_fc" class="table_large_col <?php echo $sorted_labels_id[$h]; ?>_fc sub-align" <?php echo $styleStr; ?> data-colname="<?php _e('Show on Map', WDFMInstance(self::PLUGIN)->prefix);?>">
540
  <a class="thickbox-preview" href="<?php echo add_query_arg(array(
541
  'action' => 'FormMakerMapEditinPopup' . WDFMInstance(self::PLUGIN)->plugin_postfix,
542
  'long' => $map_params[0],
550
  }
551
  elseif ( strpos($temp[$g]->element_value, "*@@url@@*") ) {
552
  ?>
553
+ <td id="<?php echo $sorted_labels_id[$h]; ?>_fc" class="<?php echo $sorted_labels_id[$h]; ?>_fc sub-align" <?php echo $styleStr; ?> data-colname="<?php _e('URL', WDFMInstance(self::PLUGIN)->prefix);?>">
554
  <?php
555
  $new_files = explode("*@@url@@*", $temp[$g]->element_value);
556
  foreach ( $new_files as $new_file ) {
571
  $view_star_rating_array = $this->model->view_for_star_rating($temp[$g]->element_value, $temp[$g]->element_label);
572
  $stars = $view_star_rating_array[0];
573
  ?>
574
+ <td id="<?php echo $sorted_labels_id[$h]; ?>_fc" align="center" class="<?php echo $sorted_labels_id[$h]; ?>_fc sub-align" <?php echo $styleStr; ?> data-colname="<?php _e('Star rating', WDFMInstance(self::PLUGIN)->prefix);?>"><?php echo $stars; ?></td>
575
  <?php
576
  }
577
  elseif ( strpos($temp[$g]->element_value, "***matrix***") ) {
578
  ?>
579
+ <td id="<?php echo $sorted_labels_id[$h]; ?>_fc" class="table_large_col <?php echo $sorted_labels_id[$h]; ?>_fc sub-align" <?php echo $styleStr; ?> data-colname="<?php _e('Matrix', WDFMInstance(self::PLUGIN)->prefix);?>">
580
  <a class="thickbox-preview" href="<?php echo add_query_arg(array(
581
  'action' => 'show_matrix' . WDFMInstance(self::PLUGIN)->plugin_postfix,
582
  'matrix_params' => str_replace('#', '%23', urlencode($temp[$g]->element_value)),
589
  }
590
  elseif ( strpos($temp[$g]->element_value, "@@@") !== FALSE || $temp[$g]->element_value == "@@@" || $temp[$g]->element_value == "@@@@@@@@@" ) {
591
  ?>
592
+ <td id="<?php echo $sorted_labels_id[$h]; ?>_fc" class="<?php echo $sorted_labels_id[$h]; ?>_fc sub-align" <?php echo $styleStr; ?> data-colname="<?php echo !empty($label_name_ids[$sorted_labels_id[$h]]) ? $label_name_ids[$sorted_labels_id[$h]] : ''; ?>">
593
  <p><?php echo str_replace("@@@", " ", $temp[$g]->element_value); ?></p>
594
  </td>
595
  <?php
598
  $view_grading_array = $this->model->view_for_grading($temp[$g]->element_value);
599
  $items = $view_grading_array[0];
600
  ?>
601
+ <td id="<?php echo $sorted_labels_id[$h]; ?>_fc" class="<?php echo $sorted_labels_id[$h]; ?>_fc sub-align" <?php echo $styleStr; ?> data-colname="<?php _e('Grading', WDFMInstance(self::PLUGIN)->prefix);?>">
602
  <p><?php echo $items; ?></p>
603
  </td>
604
  <?php
631
  </td>
632
  <?php }
633
  else { ?>
634
+ <td id="<?php echo $sorted_labels_id[$h]; ?>_fc" class="<?php echo $sorted_labels_id[$h]; ?>_fc sub-align" <?php echo $styleStr; ?> data-colname="<?php echo !empty($label_name_ids[$sorted_labels_id[$h]]) ? $label_name_ids[$sorted_labels_id[$h]] : ''; ?>">
635
  <p><?php echo $temp[$g]->element_value; ?></p>
636
  </td>
637
  <?php }
638
  }
639
  else {
640
  $element_value = str_replace("***br***", '<br>', stripslashes($temp[$g]->element_value));
641
+ $textdata = $this->gen_shorter_text($element_value, 100);
642
  ?>
643
+ <td id="<?php echo $sorted_labels_id[$h]; ?>_fc" class="<?php echo $sorted_labels_id[$h]; ?>_fc sub-align" <?php echo $styleStr; ?> data-colname="<?php echo !empty($label_name_ids[$sorted_labels_id[$h]]) ? $label_name_ids[$sorted_labels_id[$h]] : ''; ?>">
644
  <p><?php echo $textdata['text']; ?></p>
645
  </td>
646
  <?php
652
 
653
  if ( $not_label ) {
654
  ?>
655
+ <td id="<?php echo $sorted_labels_id[$h]; ?>_fc" class="<?php echo $sorted_labels_id[$h]; ?>_fc sub-align" <?php echo $styleStr; ?>>
656
  <p>&nbsp;</p>
657
  </td>
658
  <?php
660
  }
661
  if ( $ispaypal ) {
662
  ?>
663
+ <td id="payment_info_fc" class="payment_info_fc sub-align" <?php echo $style_payment_info; ?> data-colname="<?php _e('Paypal information', WDFMInstance(self::PLUGIN)->prefix); ?>">
664
  <a class="thickbox-preview" href="<?php echo add_query_arg(array(
665
  'action' => 'paypal_info' . WDFMInstance(self::PLUGIN)->plugin_postfix,
666
  'id' => $i,
688
  </div>
689
  </div>
690
  </div>
691
+ <div class="tablenav bottom">
692
+ <?php echo $this->pagination($pagination_url, $subs_count, $page_per_num); ?>
693
+ </div>
694
  <?php
695
  if ( $sorted_label_types ) {
696
  foreach ( $sorted_label_types as $key => $sorted_label_type ) {
719
  }
720
  ?>
721
  </select>
722
+ <p class="fm_error_sorted_label_key"><?php echo _e('Please select the field!', WDFMInstance(self::PLUGIN)->prefix);?></p>
723
  </td>
724
  </tr>
725
  <tr>
732
  <input class="inputbox" type="text" name="endstats" id="endstats" size="9" maxlength="9" />
733
  </td>
734
  <td>
735
+ <span class="fm-div_stats-loading spinner"></span>
736
  <button class="button" onclick="show_stats(); return false;"><?php _e('Show', WDFMInstance(self::PLUGIN)->prefix); ?></button>
737
  </td>
738
  </tr>
740
  <div id="div_stats"></div>
741
  </div>
742
  <script>
743
+ show_stats_url = "<?php echo add_query_arg( array('action' => 'get_stats' . WDFMInstance(self::PLUGIN)->plugin_postfix, 'task' => 'show_stats', 'current_id' => $form_id ), $page_url); ?>";
744
  </script>
745
  <?php
746
  }
786
  );
787
  }
788
  ?>
789
+ function clickLabChBAll( ChBAll ) {
790
+ ChBAll.classList.remove("fm-remove_before");
791
+ if ( ChBAll.checked ) {
792
  document.forms.admin_form.hide_label_list.value = '';
793
  var ChBDivInputs = document.getElementById('ChBDiv').getElementsByTagName('input');
794
  for (var i = 1, input; input = ChBDivInputs[i++]; ) {
795
+ if ( input.id != 'ChBAll') {
796
  input.checked = ChBAll.checked;
797
  }
798
  }
799
  }
800
+ else {
801
  document.forms.admin_form.hide_label_list.value = '@<?php echo implode($templabels, '@@') ?>@' + '@payment_info@';
802
  for (i = 0; i <= ChBAll.form.length; i++) {
803
  if (typeof(ChBAll.form[i]) != "undefined") {
811
  }
812
  </script>
813
  <div id="ChBDiv">
814
+ <p class="add-col-header"><?php _e('Select columns', WDFMInstance(self::PLUGIN)->prefix); ?></p>
815
+ <div class="fm_check_labels">
816
  <input type="checkbox" <?php echo ( !$lists['hide_label_list'] ) ? 'checked="checked"' : ''; ?> onclick="clickLabChBAll(this)" id="ChBAll" />
817
  <label for="ChBAll"><?php _e('All', WDFMInstance(self::PLUGIN)->prefix); ?></label>
818
  </div>
819
+ <?php foreach ( $templabels as $key => $curlabel ) {
820
+ if ( strpos($lists['hide_label_list'], '@' . $curlabel . '@') === FALSE ) {
821
+ ?>
822
+ <div class="fm_check_labels">
823
+ <input type="checkbox" checked="checked" onclick="clickLabChB('<?php echo $curlabel; ?>', this)" id="fm_check_id_<?php echo $curlabel; ?>" />
824
+ <label for="fm_check_id_<?php echo $curlabel; ?>"> <?php echo stripslashes($sorted_label_names_for_check[$key]); ?></label>
825
+ </div>
826
+ <?php }
827
+ else {
828
+ ?>
829
+ <div class="fm_check_labels">
830
+ <input type="checkbox" onclick="clickLabChB('<?php echo $curlabel; ?>', this)" id="fm_check_id_<?php echo $curlabel; ?>" />
831
+ <label for="fm_check_id_<?php echo $curlabel; ?>"> <?php echo stripslashes($sorted_label_names_for_check[$key]); ?></label>
832
+ </div>
 
 
833
  <?php
834
  }
835
  }
853
  </div>
854
  </div>
855
  <script type="text/javascript">
856
+ var index = 1;
857
+ var minLimit = 60;
858
+ var total_count = <?php echo $subs_count; ?>;
859
+ var page_num_update = false;
860
+ var page_num = <?php echo !empty($fm_settings['ajax_export_per_page']) ? $fm_settings['ajax_export_per_page'] : 1000; ?>;
861
+ var groupids = <?php echo json_encode($groupids);?>;
862
+ var groupids_string = '';
863
+
864
+ /**
865
+ * Export submissions.
866
+ *
867
+ * @param string type
868
+ * @param int limitstart
869
+ * @param null ids
870
+ */
871
+ function export_submissions(type, limitstart, ids) {
872
+ var verified_emails = jQuery('#verified_emails').val();
873
+ if ( limitstart == 0) {
874
+ jQuery('.fm_modal').show();
875
+ loading_progress(total_count, limitstart);
876
+ if( typeof ids == "undefined" || ids === null ) {
877
+ var ids = groupids.slice(limitstart, page_num);
878
+ groupids_string = ids.toString();
879
+ }
880
+ }
881
  jQuery.ajax({
882
  type: "POST",
883
+ dataType: "json",
884
  url: "<?php echo add_query_arg(array(
885
  'form_id' => $form_id,
886
  'send_header' => 0,
887
+ ), admin_url('admin-ajax.php')); ?>&action=generete_" + type + "<?php echo WDFMInstance(self::PLUGIN)->plugin_postfix; ?>&limitstart=" + limitstart,
888
+ data: {
889
+ page_num: page_num,
890
+ page_num_update: page_num_update,
891
+ groupids: groupids_string,
892
+ verified_emails: verified_emails
 
893
  },
894
+ beforeSend: function () {
895
+ if ( page_num <= total_count ) {
896
+ jQuery('.fm_modal').show();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
897
  }
898
+ },
899
+ success: function (response, textStatus, xhr) {
900
+ if ( limitstart < total_count ) {
901
+ limitstart += page_num;
902
+ ++index;
903
+ if ( index <= total_count ) {
904
+ end = index*page_num;
905
+ start = end - page_num;
906
+ ids = groupids.slice(start, end);
907
+ groupids_string = ids.toString();
908
+ }
909
+ if ( limitstart >= total_count ) {
910
+ ids = '';
911
+ index = 1;
912
+ start = page_num;
913
+ }
914
+ if ( ids ) {
915
+ export_submissions(type, limitstart, ids);
916
+ }
917
+ else {
918
+ ajax_export_end(total_count, type, limitstart);
919
+ }
920
+ loading_progress(total_count, limitstart);
921
+ }
922
+ else {
923
+ ajax_export_end(total_count, type, limitstart);
924
+ }
925
+ },
926
+ error: function (xhr, ajaxOptions, thrownError) {
927
+ limitstart = 0;
928
+ index = 1;
929
+ page_num = parseInt(page_num / 2);
930
+ if ( page_num > minLimit ) {
931
+ page_num_update = true;
932
+ export_submissions(type, 0, null);
933
+ }
934
+ if ( page_num < minLimit ) {
935
+ page_num = parseInt(page_num * 2);
936
+ page_num_update = false;
937
+ jQuery('.fm_modal').hide();
938
+ jQuery('.fm-unexpected_error_message').show();
939
+ return false;
940
+ }
941
  }
942
  });
943
  }
944
+
945
+ /**
946
+ * Ajax export end.
947
+ *
948
+ * @param int total_count
949
+ * @param string type
950
+ * @param int limitstart
951
+ */
952
+ function ajax_export_end(total_count, type, limitstart) {
953
+ jQuery('.fm_modal').hide();
954
+ jQuery('.fm-unexpected_error_message').hide();
955
+ loading_progress(total_count, 0);
956
+
957
+ window.location = "<?php echo add_query_arg(array(
958
+ 'form_id' => $form_id,
959
+ 'send_header' => 1,
960
+ ), admin_url('admin-ajax.php')); ?>&action=generete_" + type + "<?php echo WDFMInstance(self::PLUGIN)->plugin_postfix; ?>&limitstart=" + limitstart;
961
+
962
+ }
963
+
964
+ /**
965
+ * Loading progress.
966
+ *
967
+ * @param int count
968
+ * @param int start
969
+ */
970
+ function loading_progress(count, start) {
971
+ var text = 'Loading ...';
972
+ var progressbar = jQuery("#fm-progressbar");
973
+ var progressLabel = jQuery(".fm-progress-label");
974
+ progressbar.progressbar({
975
+ max: count
976
+ });
977
+ if ( start != 0 ) {
978
+ var interval = Math.round( (progressbar.progressbar("value") * 100) / parseInt(count) );
979
+ text = interval + ' %';
980
+ }
981
+ progressbar.progressbar("value", start);
982
+ progressLabel.text(text);
983
+ progressbarValue = progressbar.find(".fm-progress-label");
984
+ progressbarValue.css({
985
+ "color": '#444',
986
+ });
987
+ }
988
+
989
  function remove_all() {
990
  if (document.getElementById('startdate')) {
991
  document.getElementById('startdate').value = '';
1006
  document.getElementById('useremail_search').value = '';
1007
  }
1008
  <?php
1009
+ foreach( $sorted_label_types as $slt_index => $slt_val ) {
1010
  if ($slt_val != "type_mark_map" && $slt_val != "type_stripe") {
1011
  ?>
1012
  document.getElementById('<?php echo $form_id . '_' . $sorted_labels_id[$slt_index] . '_search'; ?>').value = '';
1021
  }
1022
  }
1023
  ?>
1024
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1025
 
1026
+ <?php if ( $is_search ) { ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1027
  document.getElementById('fm-fields-filter').style.display = '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1028
  <?php } ?>
1029
+ </script>
1030
  <input id="form_id" name="form_id" type="hidden" value="<?php echo $form_id; ?>">
1031
  <input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php echo $asc_or_desc; ?>"/>
1032
  <input type="hidden" name="order_by" id="order_by" value="<?php echo $order_by; ?>"/>
1033
  <?php
1034
  }
1035
 
1036
+ /**
1037
+ * Show stats.
1038
+ *
1039
+ * @param array $params
1040
+ * @return string
1041
+ */
1042
+ public function show_stats( $params = array() ) {
1043
  ob_start();
1044
  $sorted_label_name_original = $params['sorted_label_name_original'];
1045
  $choices_labels = $params['choices_labels'];
1112
  die();
1113
  }
1114
 
1115
+ /**
1116
+ * Edit page.
1117
+ *
1118
+ * @param array $params
1119
+ */
1120
+ public function edit( $params = array() ) {
1121
  // TODO: Change this function to standard.
1122
  echo $this->topbar();
1123
 
1349
 
1350
  /**
1351
  * Print saelect form.
1352
+ *
1353
+ * @param array $params
1354
  */
1355
+ private function saelect_form( $params = array() ) {
1356
  if ( !empty($params['forms']) ) {
1357
  $page = $params['page'];
1358
  $page_url = $params['page_url'];
1384
  /**
1385
  * Generate short text.
1386
  *
1387
+ * @param string $text
1388
+ * @param int $chars_limit
1389
  *
1390
  * @return array.
1391
  */
1392
+ public function gen_shorter_text( $text = '', $chars_limit = 0 ) {
1393
  $data = array();
1394
  // Check if length is larger than the character limit.
1395
  if ( strlen($text) > $chars_limit && $text == strip_tags($text) ) {
1408
  }
1409
  return $data;
1410
  }
1411
+ }
admin/views/Themes_fm.php CHANGED
@@ -15,7 +15,7 @@ class FMViewThemes_fm extends FMAdminView {
15
  *
16
  * @param $params
17
  */
18
- public function display( $params ) {
19
  ob_start();
20
  echo $this->body($params);
21
  // Pass the content to form.
@@ -32,8 +32,9 @@ class FMViewThemes_fm extends FMAdminView {
32
  * Generate page body.
33
  *
34
  * @param $params
 
35
  */
36
- public function body( $params ) {
37
  $order = $params['order'];
38
  $orderby = $params['orderby'];
39
  $actions = $params['actions'];
@@ -136,7 +137,7 @@ class FMViewThemes_fm extends FMAdminView {
136
  *
137
  * @param $params
138
  */
139
- public function edit( $params ) {
140
  ob_start();
141
  $buttons = array(
142
  'save' => array(
@@ -171,8 +172,9 @@ class FMViewThemes_fm extends FMAdminView {
171
  * Generate edit page body.
172
  *
173
  * @param $params
 
174
  */
175
- public function edit_body( $params ) {
176
  wp_enqueue_style(WDFMInstance(self::PLUGIN)->handle_prefix . '-bootstrap');
177
  wp_enqueue_style(WDFMInstance(self::PLUGIN)->handle_prefix . '-style');
178
  wp_enqueue_style(WDFMInstance(self::PLUGIN)->handle_prefix . '-colorpicker');
15
  *
16
  * @param $params
17
  */
18
+ public function display( $params = array() ) {
19
  ob_start();
20
  echo $this->body($params);
21
  // Pass the content to form.
32
  * Generate page body.
33
  *
34
  * @param $params
35
+ * @return string Body html.
36
  */
37
+ public function body( $params = array() ) {
38
  $order = $params['order'];
39
  $orderby = $params['orderby'];
40
  $actions = $params['actions'];
137
  *
138
  * @param $params
139
  */
140
+ public function edit( $params = array() ) {
141
  ob_start();
142
  $buttons = array(
143
  'save' => array(
172
  * Generate edit page body.
173
  *
174
  * @param $params
175
+ * @return string edit body html.
176
  */
177
+ public function edit_body( $params = array() ) {
178
  wp_enqueue_style(WDFMInstance(self::PLUGIN)->handle_prefix . '-bootstrap');
179
  wp_enqueue_style(WDFMInstance(self::PLUGIN)->handle_prefix . '-style');
180
  wp_enqueue_style(WDFMInstance(self::PLUGIN)->handle_prefix . '-colorpicker');
admin/views/Uninstall_fm.php CHANGED
@@ -13,7 +13,12 @@ class FMViewUninstall_fm extends FMAdminView {
13
  }
14
  }
15
 
16
- public function display( $params ) {
 
 
 
 
 
17
  global $wpdb;
18
  $prefix = $wpdb->prefix;
19
  $addons = $params['addons'];
@@ -98,7 +103,12 @@ class FMViewUninstall_fm extends FMAdminView {
98
  <?php
99
  }
100
 
101
- public function uninstall( $params ) {
 
 
 
 
 
102
  $prefix = $params['prefix'];
103
  $addons = $params['addons']; //array
104
  $deactivate_url = add_query_arg(array(
@@ -135,10 +145,13 @@ class FMViewUninstall_fm extends FMAdminView {
135
  ?>
136
  </div>
137
  <div class="wrap">
138
- <h2>Uninstall <?php echo WDFMInstance(self::PLUGIN)->nicename; ?></h2>
139
  <p>
140
- <strong><a href="<?php echo $deactivate_url; ?>" class="fm_deactivate_link" data-uninstall="1">Click Here</a> To Finish the Uninstallation and Form Maker
141
- will be Deactivated Automatically.</strong></p>
 
 
 
142
  <input id="task" name="task" type="hidden" value="" />
143
  </div>
144
  <?php
13
  }
14
  }
15
 
16
+ /**
17
+ * Display page.
18
+ *
19
+ * @param array $params
20
+ */
21
+ public function display( $params = array() ) {
22
  global $wpdb;
23
  $prefix = $wpdb->prefix;
24
  $addons = $params['addons'];
103
  <?php
104
  }
105
 
106
+ /**
107
+ * Uninstall.
108
+ *
109
+ * @param array $params
110
+ */
111
+ public function uninstall( $params = array() ) {
112
  $prefix = $params['prefix'];
113
  $addons = $params['addons']; //array
114
  $deactivate_url = add_query_arg(array(
145
  ?>
146
  </div>
147
  <div class="wrap">
148
+ <h2><?php _e('Uninstall', WDFMInstance(self::PLUGIN)->prefix); ?> <?php echo WDFMInstance(self::PLUGIN)->nicename; ?></h2>
149
  <p>
150
+ <strong>
151
+ <a href="<?php echo $deactivate_url; ?>" class="fm_deactivate_link" data-uninstall="1"><?php _e('Click Here', WDFMInstance(self::PLUGIN)->prefix); ?></a>
152
+ <?php _e('To Finish the Uninstallation and Form Maker will be Deactivated Automatically.', WDFMInstance(self::PLUGIN)->prefix); ?></a>
153
+ </strong>
154
+ </p>
155
  <input id="task" name="task" type="hidden" value="" />
156
  </div>
157
  <?php
admin/views/Widget.php CHANGED
@@ -4,7 +4,15 @@
4
  * Class FMViewWidget
5
  */
6
  class FMViewWidget {
7
- function widget( $args, $instance, $execute ) {
 
 
 
 
 
 
 
 
8
  extract($args);
9
  $title = $instance['title'];
10
  $form_id = (isset($instance['form_id']) ? $instance['form_id'] : 0);
@@ -20,8 +28,16 @@ class FMViewWidget {
20
  echo $after_widget;
21
  }
22
 
23
- // Widget Control Panel.
24
- function form( $instance, $ids_FM, $id_title, $name_title, $id_form_id, $name_form_id ) {
 
 
 
 
 
 
 
 
25
  $defaults = array(
26
  'title' => '',
27
  'form_id' => 0,
4
  * Class FMViewWidget
5
  */
6
  class FMViewWidget {
7
+
8
+ /**
9
+ * Widget.
10
+ *
11
+ * @param array $args
12
+ * @param array $instance
13
+ * @param string $execute
14
+ */
15
+ function widget( $args = array(), $instance = array(), $execute = '' ) {
16
  extract($args);
17
  $title = $instance['title'];
18
  $form_id = (isset($instance['form_id']) ? $instance['form_id'] : 0);
28
  echo $after_widget;
29
  }
30
 
31
+ /**
32
+ * Form.
33
+ * @param $instance
34
+ * @param $ids_FM
35
+ * @param $id_title
36
+ * @param $name_title
37
+ * @param $id_form_id
38
+ * @param $name_form_id
39
+ */
40
+ function form( $instance = array(), $ids_FM = array(), $id_title = 0, $name_title = '', $id_form_id = 0, $name_form_id = 0 ) {
41
  $defaults = array(
42
  'title' => '',
43
  'form_id' => 0,
admin/views/view.php CHANGED
@@ -178,7 +178,7 @@ class FMAdminView {
178
  *
179
  * @return string
180
  */
181
- protected function pagination($page_url, $total, $items_per_page = 20) {
182
  $page_number = WDW_FM_Library(self::PLUGIN)->get('paged', 1);
183
  $search = WDW_FM_Library(self::PLUGIN)->get('s', '');
184
  $orderby = WDW_FM_Library(self::PLUGIN)->get('orderby', '');
@@ -262,7 +262,13 @@ class FMAdminView {
262
  return ob_get_clean();
263
  }
264
 
265
- protected function bulk_actions($actions) {
 
 
 
 
 
 
266
  ob_start();
267
  ?>
268
  <div class="alignleft actions bulkactions">
@@ -463,7 +469,7 @@ class FMAdminView {
463
  * @param string $premium_link_text
464
  * @return string
465
  */
466
- protected function free_message($message, $premium_link = '', $premium_link_text = '', $id = '') {
467
  $upgrade = false;
468
  if ('' == $premium_link) {
469
  $premium_link = $this->premium_link;
@@ -495,7 +501,7 @@ class FMAdminView {
495
  *
496
  * @return string Stripe promo box html.
497
  */
498
- protected function promo_box($message, $addon_message, $addon_link, $id = '') {
499
  $premium_link = $this->premium_link;
500
  ob_start();
501
  ?>
178
  *
179
  * @return string
180
  */
181
+ protected function pagination($page_url = '', $total = 0, $items_per_page = 20) {
182
  $page_number = WDW_FM_Library(self::PLUGIN)->get('paged', 1);
183
  $search = WDW_FM_Library(self::PLUGIN)->get('s', '');
184
  $orderby = WDW_FM_Library(self::PLUGIN)->get('orderby', '');
262
  return ob_get_clean();
263
  }
264
 
265
+ /**
266
+ * Bulk actions.
267
+ *
268
+ * @param array $actions
269
+ * @return string
270
+ */
271
+ protected function bulk_actions( $actions = array() ) {
272
  ob_start();
273
  ?>
274
  <div class="alignleft actions bulkactions">
469
  * @param string $premium_link_text
470
  * @return string
471
  */
472
+ protected function free_message($message = '', $premium_link = '', $premium_link_text = '', $id = '') {
473
  $upgrade = false;
474
  if ('' == $premium_link) {
475
  $premium_link = $this->premium_link;
501
  *
502
  * @return string Stripe promo box html.
503
  */
504
+ protected function promo_box( $message = '', $addon_message = '', $addon_link = '', $id = 0 ) {
505
  $premium_link = $this->premium_link;
506
  ob_start();
507
  ?>
css/form_maker_tables.css CHANGED
@@ -1,3 +1,6 @@
 
 
 
1
  #fm_admin_container {
2
  display: inline-block;
3
  width: 100%;
@@ -642,6 +645,20 @@ p.description {
642
  width: 100px;
643
  }
644
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
645
  .col_id {
646
  width: 130px;
647
  }
@@ -1442,8 +1459,8 @@ table.admintable {
1442
  max-width: 200px;
1443
  }
1444
 
1445
- .form_maker_submissions #submitid_fc {
1446
- min-width: 55px;
1447
  }
1448
  .submit_content #submitsubmitdate_fc,
1449
  .submit_content #submitterusername_fc,
@@ -1456,7 +1473,11 @@ table.admintable {
1456
  max-width: 30px !important;
1457
  text-align: left !important;
1458
  }
1459
-
 
 
 
 
1460
  .submitid_fc a {
1461
  padding-left: 2px;
1462
  }
@@ -2494,8 +2515,8 @@ button:focus {
2494
  word-break: break-all;
2495
  }
2496
 
2497
- .form_maker_submissions td,
2498
- .form_maker_submissions th {
2499
  max-width: 200px;
2500
  word-break: break-all;
2501
  }
@@ -2564,14 +2585,14 @@ button:focus {
2564
 
2565
  #field_container {
2566
  display: inline-block;
2567
- width: calc(60% + 16px);
2568
  height: 100%;
2569
  }
2570
  #field_container.field_container_full {
2571
  width: 100%;
2572
  }
2573
  #field_container .popup-body-col {
2574
- width: calc(50% - 7px);
2575
  }
2576
  #field_container .popup-body-col:last-child {
2577
  margin-right: 0;
1
+ .fm-remove_before:before {
2
+ content: "" !important;
3
+ }
4
  #fm_admin_container {
5
  display: inline-block;
6
  width: 100%;
645
  width: 100px;
646
  }
647
 
648
+ @media screen and ( min-width: 1100px ), screen and ( max-width: 782px ) {
649
+ .wp-list-table .col_id {
650
+ width: 190px;
651
+ }
652
+
653
+ .wp-list-table .col_function {
654
+ width: 340px;
655
+ }
656
+
657
+ .wp-list-table .fm_php_function, .fm_shortcode {
658
+ width: 100%;
659
+ }
660
+ }
661
+
662
  .col_id {
663
  width: 130px;
664
  }
1459
  max-width: 200px;
1460
  }
1461
 
1462
+ .fm-table-submissions #submitid_fc.submitid_fc {
1463
+ min-width: 55px !important;
1464
  }
1465
  .submit_content #submitsubmitdate_fc,
1466
  .submit_content #submitterusername_fc,
1473
  max-width: 30px !important;
1474
  text-align: left !important;
1475
  }
1476
+ #fm-submission-lists .fm-show-column {
1477
+ }
1478
+ #fm-submission-lists .fm-hide-column {
1479
+ display:none;
1480
+ }
1481
  .submitid_fc a {
1482
  padding-left: 2px;
1483
  }
2515
  word-break: break-all;
2516
  }
2517
 
2518
+ .fm-table-submissions td,
2519
+ .fm-table-submissions th {
2520
  max-width: 200px;
2521
  word-break: break-all;
2522
  }
2585
 
2586
  #field_container {
2587
  display: inline-block;
2588
+ width: calc(60% + 15px);
2589
  height: 100%;
2590
  }
2591
  #field_container.field_container_full {
2592
  width: 100%;
2593
  }
2594
  #field_container .popup-body-col {
2595
+ width: calc(50% - 8px);
2596
  }
2597
  #field_container .popup-body-col:last-child {
2598
  margin-right: 0;
css/style.css CHANGED
@@ -1368,21 +1368,25 @@ li.pp_selected > span {
1368
  .fm-bulk-actions span.show-filter.hide {
1369
  display: none;
1370
  }
1371
- .form_maker_submissions .payment_info_fc {
1372
  color: #0073aa;
1373
  }
1374
- .form_maker_submissions .table-wrapper-1,
1375
- .form_maker_submissions .table-wrapper-2 {
1376
  width: 100%;
1377
  overflow-x: scroll;
1378
  overflow-y:hidden;
1379
- }
1380
- .form_maker_submissions .table-scroll-1 { height: 20px; }
1381
- .form_maker_submissions .submit_content {
 
 
 
 
1382
  overflow:hidden;
1383
  }
1384
- .form_maker_submissions th.col_id a { min-width: 40px; }
1385
- .form_maker_submissions .col-submit-date {
1386
  width:150px;
1387
  }
1388
  .table-wrapper-1.no-scroll,
@@ -1395,8 +1399,8 @@ li.pp_selected > span {
1395
  display: none !important;
1396
  }
1397
 
1398
- .form_maker_submissions .table-wrapper-1,
1399
- .form_maker_submissions .table-wrapper-2 {
1400
  overflow-x: hidden !important;
1401
  }
1402
  }
@@ -1412,28 +1416,28 @@ li.pp_selected > span {
1412
  margin: 0 0 5px 0;
1413
  }
1414
 
1415
- .form_maker_submissions_edit .wd-table .type_range input {
1416
  display: inline-block;
1417
  width: 70px;
1418
  }
1419
- .form_maker_submissions_edit .wd-table .type_grading .grading-inputs label {
1420
  display: inline-block;
1421
  width: 70px;
1422
  }
1423
- .form_maker_submissions_edit .wd-table .type_grading .grading-inputs input {
1424
  display: inline-block;
1425
  width: 70px;
1426
  }
1427
- .form_maker_submissions_edit .non-editable label {
1428
  display:inline-block;
1429
  min-width:200px;
1430
  }
1431
- .form_maker_submissions_edit .non-editable span {
1432
  display: inline-block;
1433
  line-height: 20px;
1434
  vertical-align: top;
1435
  }
1436
- .form_maker_submissions_edit .form-title {
1437
  font-size: 16px;
1438
  font-weight: 400;
1439
  margin: 0;
1368
  .fm-bulk-actions span.show-filter.hide {
1369
  display: none;
1370
  }
1371
+ .fm-table-submissions .payment_info_fc {
1372
  color: #0073aa;
1373
  }
1374
+ .fm-table-submissions .table-wrapper-1,
1375
+ .fm-table-submissions .table-wrapper-2 {
1376
  width: 100%;
1377
  overflow-x: scroll;
1378
  overflow-y:hidden;
1379
+ }
1380
+ .fm-table-submissions .table-wrapper-1.fixed {
1381
+ position: fixed;
1382
+ top:15px;
1383
+ }
1384
+ .fm-table-submissions .table-scroll-1 { height: 20px; }
1385
+ .fm-table-submissions .submit_content {
1386
  overflow:hidden;
1387
  }
1388
+ .fm-table-submissions th.col_id a { min-width: 40px; }
1389
+ .fm-table-submissions .col-submit-date {
1390
  width:150px;
1391
  }
1392
  .table-wrapper-1.no-scroll,
1399
  display: none !important;
1400
  }
1401
 
1402
+ .fm-table-submissions .table-wrapper-1,
1403
+ .fm-table-submissions .table-wrapper-2 {
1404
  overflow-x: hidden !important;
1405
  }
1406
  }
1416
  margin: 0 0 5px 0;
1417
  }
1418
 
1419
+ .fm-table-submissions_edit .wd-table .type_range input {
1420
  display: inline-block;
1421
  width: 70px;
1422
  }
1423
+ .fm-table-submissions_edit .wd-table .type_grading .grading-inputs label {
1424
  display: inline-block;
1425
  width: 70px;
1426
  }
1427
+ .fm-table-submissions_edit .wd-table .type_grading .grading-inputs input {
1428
  display: inline-block;
1429
  width: 70px;
1430
  }
1431
+ .fm-table-submissions_edit .non-editable label {
1432
  display:inline-block;
1433
  min-width:200px;
1434
  }
1435
+ .fm-table-submissions_edit .non-editable span {
1436
  display: inline-block;
1437
  line-height: 20px;
1438
  vertical-align: top;
1439
  }
1440
+ .fm-table-submissions_edit .form-title {
1441
  font-size: 16px;
1442
  font-weight: 400;
1443
  margin: 0;
css/style_submissions.css CHANGED
@@ -105,6 +105,10 @@
105
  font-size: 12px;
106
  font-style: italic;
107
  }
 
 
 
 
108
  .tablenav .tablenav-pages a.disabled,
109
  .tablenav .tablenav-pages a.disabled:active,
110
  .tablenav .tablenav-pages a.disabled:focus,
105
  font-size: 12px;
106
  font-style: italic;
107
  }
108
+ .tablenav .tablenav-pages .current_page {
109
+ width:15%;
110
+ text-align: center;
111
+ }
112
  .tablenav .tablenav-pages a.disabled,
113
  .tablenav .tablenav-pages a.disabled:active,
114
  .tablenav .tablenav-pages a.disabled:focus,
form-maker.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Form Maker
4
  * Plugin URI: https://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.12.29
7
  * Author: WebDorado Form Builder Team
8
  * Author URI: https://web-dorado.com/wordpress-plugins-bundle.html
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
@@ -95,8 +95,8 @@ final class WDFM {
95
  $this->plugin_url = plugins_url(plugin_basename(dirname(__FILE__)));
96
  $this->front_urls = $this->get_front_urls();
97
  $this->main_file = plugin_basename(__FILE__);
98
- $this->plugin_version = '1.12.29';
99
- $this->db_version = '2.12.29';
100
  $this->menu_postfix = ($this->is_free == 2 ? '_fmc' : '_fm');
101
  $this->plugin_postfix = ($this->is_free == 2 ? '_fmc' : '');
102
  $this->menu_slug = 'manage' . $this->menu_postfix;
@@ -105,6 +105,7 @@ final class WDFM {
105
  $this->js_prefix = 'fm_';
106
  $this->handle_prefix = ($this->is_free == 2 ? 'fmc' : 'fm');
107
  $this->nicename = ($this->is_free == 2 ? __('Contact Form', $this->prefix) : __('Form Maker', $this->prefix));
 
108
  }
109
 
110
  /**
@@ -208,16 +209,24 @@ final class WDFM {
208
  // Enqueue block editor assets for Gutenberg.
209
  add_filter('tw_get_block_editor_assets', array($this, 'register_block_editor_assets'));
210
  add_action( 'enqueue_block_editor_assets', array($this, 'enqueue_block_editor_assets') );
 
211
  // Privacy policy.
212
  add_action( 'admin_init', array($this, 'add_privacy_policy_content') );
 
 
 
 
 
213
  }
214
-
215
  function add_privacy_policy_content() {
216
  if ( ! function_exists( 'wp_add_privacy_policy_content' ) ) {
217
  return;
218
  }
219
 
220
- $content = __( 'All data submitted by website visitors is stored in website database. With every form submission Form Maker plugin collects users’ IP address and WordPress user ID for logged in users.<br />In the following forms <b>[List of Forms that collect personal data]</b> we collect personal data, such as <b>[Types of personal data collected]</b>. We need this information to <b>[purpose of collecting personal data]</b>. Please see sections <b>[Links to sections]</b> on how your personal data is handled.', WDFMInstance(self::PLUGIN)->prefix );
 
 
221
 
222
  wp_add_privacy_policy_content(
223
  WDFMInstance(self::PLUGIN)->nicename,
@@ -225,6 +234,22 @@ final class WDFM {
225
  );
226
  }
227
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
228
  public function register_block_editor_assets($assets) {
229
  $version = '2.0.0';
230
  $js_path = $this->plugin_url . '/js/tw-gb/block.js';
@@ -923,13 +948,14 @@ final class WDFM {
923
  * Activate plugin.
924
  */
925
  public function form_maker_activate() {
 
926
  if (!$this->is_free) {
927
  deactivate_plugins("contact-form-maker/contact-form-maker.php");
928
  delete_transient('fm_update_check');
929
  }
930
  $version = get_option("wd_form_maker_version");
931
  $new_version = $this->db_version;
932
- global $wpdb;
933
  require_once $this->plugin_dir . "/form_maker_insert.php";
934
  if (!$version) {
935
  if ($wpdb->get_var("SHOW TABLES LIKE '" . $wpdb->prefix . "formmaker'") == $wpdb->prefix . "formmaker") {
@@ -952,8 +978,7 @@ final class WDFM {
952
  'post_type' => ($this->is_free == 2 ? 'cfmemailverification' : 'fmemailverification'),
953
  );
954
  $mail_verification_post_id = wp_insert_post($email_verification_post);
955
-
956
- add_option(($this->is_free == 2 ? 'fmc_settings' : 'fm_settings'), array('public_key' => '', 'private_key' => '', 'csv_delimiter' => ',', 'map_key' => ''));
957
  $wpdb->update($wpdb->prefix . "formmaker", array(
958
  'mail_verification_post_id' => $mail_verification_post_id,
959
  ), array('id' => 1), array(
@@ -982,11 +1007,11 @@ final class WDFM {
982
  }
983
  update_option("wd_form_maker_version", $new_version);
984
 
985
- if (FALSE === $fm_settings = get_option($this->is_free == 2 ? 'fmc_settings' : 'fm_settings')) {
986
  $recaptcha_keys = $wpdb->get_row('SELECT `public_key`, `private_key` FROM ' . $wpdb->prefix . 'formmaker WHERE public_key!="" and private_key!=""', ARRAY_A);
987
  $public_key = isset($recaptcha_keys['public_key']) ? $recaptcha_keys['public_key'] : '';
988
  $private_key = isset($recaptcha_keys['private_key']) ? $recaptcha_keys['private_key'] : '';
989
- add_option(($this->is_free == 2 ? 'fmc_settings' : 'fm_settings'), array('public_key' => $public_key, 'private_key' => $private_key, 'csv_delimiter' => ',', 'map_key' => ''));
990
  }
991
  }
992
  }
@@ -1106,7 +1131,7 @@ final class WDFM {
1106
  */
1107
  function media_button($context) {
1108
  ob_start();
1109
- $url = add_query_arg(array('action' => 'FMShortocde' . $this->plugin_postfix, 'task' => 'form', 'TB_iframe' => '1'), admin_url('admin-ajax.php'));
1110
  ?>
1111
  <a onclick="tb_click.call(this); fm_set_shortcode_popup_dimensions(400, 140); return false;" href="<?php echo $url; ?>" class="button" title="<?php _e('Insert Form', $this->prefix); ?>">
1112
  <span class="wp-media-buttons-icon" style="background: url('<?php echo $this->plugin_url; ?>/images/fm-media-form-button.png') no-repeat scroll left top rgba(0, 0, 0, 0);"></span>
@@ -1233,7 +1258,7 @@ function fm_bp_install_notice() {
1233
  }
1234
 
1235
  // Show notice only on plugin pages.
1236
- if ( !isset($_GET['page']) || strpos(esc_html($_GET['page']), '_fm') === FALSE ) {
1237
  return '';
1238
  }
1239
 
3
  * Plugin Name: Form Maker
4
  * Plugin URI: https://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.12.31
7
  * Author: WebDorado Form Builder Team
8
  * Author URI: https://web-dorado.com/wordpress-plugins-bundle.html
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
95
  $this->plugin_url = plugins_url(plugin_basename(dirname(__FILE__)));
96
  $this->front_urls = $this->get_front_urls();
97
  $this->main_file = plugin_basename(__FILE__);
98
+ $this->plugin_version = '1.12.31';
99
+ $this->db_version = '2.12.31';
100
  $this->menu_postfix = ($this->is_free == 2 ? '_fmc' : '_fm');
101
  $this->plugin_postfix = ($this->is_free == 2 ? '_fmc' : '');
102
  $this->menu_slug = 'manage' . $this->menu_postfix;
105
  $this->js_prefix = 'fm_';
106
  $this->handle_prefix = ($this->is_free == 2 ? 'fmc' : 'fm');
107
  $this->nicename = ($this->is_free == 2 ? __('Contact Form', $this->prefix) : __('Form Maker', $this->prefix));
108
+ $this->slug = ($this->is_free == 2 ? 'contact-form-maker' : 'form-maker');
109
  }
110
 
111
  /**
209
  // Enqueue block editor assets for Gutenberg.
210
  add_filter('tw_get_block_editor_assets', array($this, 'register_block_editor_assets'));
211
  add_action( 'enqueue_block_editor_assets', array($this, 'enqueue_block_editor_assets') );
212
+
213
  // Privacy policy.
214
  add_action( 'admin_init', array($this, 'add_privacy_policy_content') );
215
+
216
+ // Personal data export.
217
+ add_filter( 'wp_privacy_personal_data_exporters', array($this, 'register_privacy_personal_data_exporter') );
218
+ // Personal data erase.
219
+ add_filter( 'wp_privacy_personal_data_erasers', array($this, 'register_privacy_personal_data_eraser') );
220
  }
221
+
222
  function add_privacy_policy_content() {
223
  if ( ! function_exists( 'wp_add_privacy_policy_content' ) ) {
224
  return;
225
  }
226
 
227
+ $content = __( 'When you leave a comment on this site, we send your name, email
228
+ address, IP address and comment text to example.com. Example.com does
229
+ not retain your personal data.', WDFMInstance(self::PLUGIN)->prefix );
230
 
231
  wp_add_privacy_policy_content(
232
  WDFMInstance(self::PLUGIN)->nicename,
234
  );
235
  }
236
 
237
+ public function register_privacy_personal_data_exporter( $exporters ) {
238
+ $exporters[ $this->slug ] = array(
239
+ 'exporter_friendly_name' => $this->nicename,
240
+ 'callback' => array( WDW_FM_Library(self::PLUGIN), 'privacy_personal_data_export' ),
241
+ );
242
+ return $exporters;
243
+ }
244
+
245
+ public function register_privacy_personal_data_eraser( $erasers ) {
246
+ $erasers[ $this->slug ] = array(
247
+ 'eraser_friendly_name' => $this->nicename,
248
+ 'callback' => array( WDW_FM_Library(self::PLUGIN), 'privacy_personal_data_erase' ),
249
+ );
250
+ return $erasers;
251
+ }
252
+
253
  public function register_block_editor_assets($assets) {
254
  $version = '2.0.0';
255
  $js_path = $this->plugin_url . '/js/tw-gb/block.js';
948
  * Activate plugin.
949
  */
950
  public function form_maker_activate() {
951
+ global $wpdb;
952
  if (!$this->is_free) {
953
  deactivate_plugins("contact-form-maker/contact-form-maker.php");
954
  delete_transient('fm_update_check');
955
  }
956
  $version = get_option("wd_form_maker_version");
957
  $new_version = $this->db_version;
958
+ $option_key = ($this->is_free == 2 ? 'fmc_settings' : 'fm_settings');
959
  require_once $this->plugin_dir . "/form_maker_insert.php";
960
  if (!$version) {
961
  if ($wpdb->get_var("SHOW TABLES LIKE '" . $wpdb->prefix . "formmaker'") == $wpdb->prefix . "formmaker") {
978
  'post_type' => ($this->is_free == 2 ? 'cfmemailverification' : 'fmemailverification'),
979
  );
980
  $mail_verification_post_id = wp_insert_post($email_verification_post);
981
+ add_option($option_key, array('public_key' => '', 'private_key' => '', 'csv_delimiter' => ',', 'map_key' => '', 'ajax_export_per_page' => 1000));
 
982
  $wpdb->update($wpdb->prefix . "formmaker", array(
983
  'mail_verification_post_id' => $mail_verification_post_id,
984
  ), array('id' => 1), array(
1007
  }
1008
  update_option("wd_form_maker_version", $new_version);
1009
 
1010
+ if ( FALSE === $fm_settings = get_option($option_key) ) {
1011
  $recaptcha_keys = $wpdb->get_row('SELECT `public_key`, `private_key` FROM ' . $wpdb->prefix . 'formmaker WHERE public_key!="" and private_key!=""', ARRAY_A);
1012
  $public_key = isset($recaptcha_keys['public_key']) ? $recaptcha_keys['public_key'] : '';
1013
  $private_key = isset($recaptcha_keys['private_key']) ? $recaptcha_keys['private_key'] : '';
1014
+ add_option($option_key, array('public_key' => $public_key, 'private_key' => $private_key, 'csv_delimiter' => ',', 'map_key' => '', 'ajax_export_per_page' => 1000));
1015
  }
1016
  }
1017
  }
1131
  */
1132
  function media_button($context) {
1133
  ob_start();
1134
+ $url = add_query_arg(array('action' => 'FMShortocde' . $this->plugin_postfix, 'task' => 'forms', 'TB_iframe' => '1'), admin_url('admin-ajax.php'));
1135
  ?>
1136
  <a onclick="tb_click.call(this); fm_set_shortcode_popup_dimensions(400, 140); return false;" href="<?php echo $url; ?>" class="button" title="<?php _e('Insert Form', $this->prefix); ?>">
1137
  <span class="wp-media-buttons-icon" style="background: url('<?php echo $this->plugin_url; ?>/images/fm-media-form-button.png') no-repeat scroll left top rgba(0, 0, 0, 0);"></span>
1258
  }
1259
 
1260
  // Show notice only on plugin pages.
1261
+ if ( !isset($_GET['page']) || (strpos(esc_html($_GET['page']), '_fm') === FALSE || strpos(esc_html($_GET['page']), '_fmc') !== FALSE) ) {
1262
  return '';
1263
  }
1264
 
form_maker_insert.php CHANGED
@@ -80,6 +80,7 @@ class WDFMInsert {
80
  `header_image_animation` varchar(200) NOT NULL,
81
  `header_hide_image` tinyint(4) NOT NULL DEFAULT '1',
82
  `jsversion` int(11) NOT NULL,
 
83
  PRIMARY KEY (`id`)
84
  ) " . $charset_collate . ";";
85
  $wpdb->query($formmaker);
@@ -277,12 +278,13 @@ class WDFMInsert {
277
  `mail_verify` tinyint(4) NOT NULL DEFAULT '0',
278
  `mail_verify_expiretime` float NOT NULL,
279
  `mail_verification_post_id` int(11) NOT NULL,
280
- `save_uploads` tinyint(4) NOT NULL DEFAULT '1',
281
  `header_title` varchar(255) NOT NULL,
282
  `header_description` text NOT NULL,
283
  `header_image_url` varchar(255) NOT NULL,
284
  `header_image_animation` varchar(200) NOT NULL,
285
  `header_hide_image` tinyint(4) NOT NULL DEFAULT '1',
 
286
  PRIMARY KEY (`backup_id`)
287
  ) " . $charset_collate . ";";
288
  $wpdb->query($formmaker_backup);
@@ -294,17 +296,17 @@ class WDFMInsert {
294
  $form_maker_row = $wpdb->get_var('SELECT * FROM ' . $wpdb->prefix . 'formmaker' . (!WDFMInstance(self::PLUGIN)->is_free ? '' : ' WHERE id' . (WDFMInstance(self::PLUGIN)->is_free == 1 ? ' NOT ' : ' ') . 'IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ')'));
295
  if ( !$form_maker_row ) {
296
  $insert_form_id = array();
297
- $wpdb->query("INSERT INTO `" . $wpdb->prefix . "formmaker` (`id`, `title`, `type`, `mail`, `form_front`, `theme`, `javascript`, `submit_text`, `url`, `submit_text_type`, `script_mail`, `script_mail_user`, `counter`, `published`, `label_order`, `label_order_current`, `article_id`, `pagination`, `show_title`, `show_numbers`, `public_key`, `private_key`, `recaptcha_theme`, `paypal_mode`, `checkout_mode`, `paypal_email`, `payment_currency`, `tax`, `form_fields`, `savedb`, `sendemail`, `requiredmark`, `from_mail`, `from_name`, `reply_to`, `send_to`, `autogen_layout`, `custom_front`, `mail_from_user`, `mail_from_name_user`, `reply_to_user`, `condition`, `mail_cc`, `mail_cc_user`, `mail_bcc`, `mail_bcc_user`, `mail_subject`, `mail_subject_user`, `mail_mode`, `mail_mode_user`, `mail_attachment`, `mail_attachment_user`, `user_id_wd`, `sortable`, `frontend_submit_fields`, `frontend_submit_stat_fields`, `mail_emptyfields`, `mail_verify`, `mail_verify_expiretime`, `mail_verification_post_id`, `save_uploads`, `header_title`, `header_description`, `header_image_url`, `header_image_animation`, `header_hide_image`, `jsversion`) VALUES (NULL, 'Contact Us', 'embedded', '{adminemail}', '<div class=\"wdform-page-and-images\"><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=\"true\" previous_title=\"Previous\" previous_type=\"text\" previous_class=\"wdform-page-button\" previous_checkable=\"false\"><div class=\"wdform_section\"><div class=\"wdform_column\"><div wdid=\"2\" class=\"wdform_row\">%2 - Name%</div><div wdid=\"3\" class=\"wdform_row\">%3 - Email%</div><div wdid=\"4\" class=\"wdform_row\">%4 - Subject%</div><div wdid=\"5\" class=\"wdform_row\">%5 - Message%</div><div wdid=\"1\" class=\"wdform_row\">%1 - type_submit_reset_1%</div></div></div><div valign=\"top\" class=\"wdform_footer wd-width-100\"><div class=\"wd-width-100\"><div class=\"wd-width-100 wd-table\" style=\"padding-top:10px;\"><div class=\"wd-table-group\"><div id=\"form_id_temppage_nav1\" class=\"wd-table-row\"></div></div></div></div></div></div></div>', '1', '// Occurs before the form is loaded\r\nfunction before_load() { \r\n} \r\n// Occurs just before submitting the form\r\nfunction before_submit() {\r\n // IMPORTANT! If you want to interrupt (stop) the submitting of the form, this function should return true. You don\'t need to return any value if you don\'t want to stop the submission.\r\n} \r\n// Occurs just before resetting the form\r\nfunction before_reset() { \r\n}\r\n// Occurs after form is submitted and reloaded\r\nfunction after_submit() {\r\n \r\n}', '', '', '1', '{all}', '{all}', '6', '1', '2#**id**#Name#**label**#type_text#****#3#**id**#Email#**label**#type_submitter_mail#****#4#**id**#Subject#**label**#type_text#****#5#**id**#Message#**label**#type_textarea#****#1#**id**#type_submit_reset_1#**label**#type_submit_reset#****#2_elementform_id_temp#**id**#type_submit_reset_1#**label**#type_submit_reset#****#', '2#**id**#Name#**label**#type_text#****#3#**id**#Email#**label**#type_submitter_mail#****#4#**id**#Subject#**label**#type_text#****#5#**id**#Message#**label**#type_textarea#****#1#**id**#type_submit_reset_1#**label**#type_submit_reset#****#', '0', 'none', '', '1', '', '', '', '0', 'testmode', '', '', '0', '2*:*id*:*type_text*:*type*:*Name*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:**:*w_size*:**:*w_first_val*:**:*w_title*:*yes*:*w_required*:*no*:*w_regExp_status*:**:*w_regExp_value*:**:*w_regExp_common*:**:*w_regExp_arg*:*Incorrect Value*:*w_regExp_alert*:*no*:*w_unique*:*no*:*w_readonly*:**:*new_field*:*3*:*id*:*type_submitter_mail*:*type*:*Email*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:**:*w_size*:**:*w_first_val*:**:*w_title*:*yes*:*w_required*:*no*:*w_unique*:**:*w_class*:*no*:*w_verification*:*Email confirmation*:*w_verification_label*:**:*w_verification_placeholder*:*no*:*w_autofill*:**:*new_field*:*4*:*id*:*type_text*:*type*:*Subject*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:**:*w_size*:**:*w_first_val*:**:*w_title*:*yes*:*w_required*:*no*:*w_regExp_status*:**:*w_regExp_value*:**:*w_regExp_common*:**:*w_regExp_arg*:*Incorrect Value*:*w_regExp_alert*:*no*:*w_unique*:*no*:*w_readonly*:**:*new_field*:*5*:*id*:*type_textarea*:*type*:*Message*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:**:*w_size_w*:*100*:*w_size_h*:**:*w_first_val*:**:*w_title*:*yes*:*w_required*:*no*:*w_unique*:**:*w_class*:**:*new_field*:*1*:*id*:*type_submit_reset*:*type*:*type_submit_reset_1*:*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', '0', '0', '0', '1', 'Contact Us', 'You may contact us by filling in this form any time you need professional support or have any questions. You can also fill in the form to leave your comments or feedback.', '', 'none', '0', '0');");
298
  $insert_form_id[] = $wpdb->insert_id;
299
- $wpdb->query("INSERT INTO `" . $wpdb->prefix . "formmaker` (`id`, `title`, `type`, `mail`, `form_front`, `theme`, `javascript`, `submit_text`, `url`, `submit_text_type`, `script_mail`, `script_mail_user`, `counter`, `published`, `label_order`, `label_order_current`, `article_id`, `pagination`, `show_title`, `show_numbers`, `public_key`, `private_key`, `recaptcha_theme`, `paypal_mode`, `checkout_mode`, `paypal_email`, `payment_currency`, `tax`, `form_fields`, `savedb`, `sendemail`, `requiredmark`, `from_mail`, `from_name`, `reply_to`, `send_to`, `autogen_layout`, `custom_front`, `mail_from_user`, `mail_from_name_user`, `reply_to_user`, `condition`, `mail_cc`, `mail_cc_user`, `mail_bcc`, `mail_bcc_user`, `mail_subject`, `mail_subject_user`, `mail_mode`, `mail_mode_user`, `mail_attachment`, `mail_attachment_user`, `user_id_wd`, `sortable`, `frontend_submit_fields`, `frontend_submit_stat_fields`, `mail_emptyfields`, `mail_verify`, `mail_verify_expiretime`, `mail_verification_post_id`, `save_uploads`, `header_title`, `header_description`, `header_image_url`, `header_image_animation`, `header_hide_image`, `jsversion`) VALUES (NULL, 'Client List Form', 'embedded', '{adminemail}', '<div class=\"wdform-page-and-images\"><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=\"true\" previous_title=\"Previous\" previous_type=\"text\" previous_class=\"wdform-page-button\" previous_checkable=\"false\"><div class=\"wdform_section\"><div class=\"wdform_column\"><div wdid=\"2\" class=\"wdform_row\">%2 - First Name%</div><div wdid=\"3\" class=\"wdform_row\">%3 - Last Name%</div><div wdid=\"4\" class=\"wdform_row\">%4 - Email%</div><div wdid=\"5\" class=\"wdform_row\">%5 - Phone%</div><div wdid=\"6\" class=\"wdform_row\">%6 - Website%</div><div wdid=\"7\" class=\"wdform_row\">%7 - Address%</div><div wdid=\"1\" class=\"wdform_row\">%1 - type_submit_reset_1%</div></div></div><div valign=\"top\" class=\"wdform_footer wd-width-100\"><div class=\"wd-width-100\"><div class=\"wd-width-100 wd-table\" style=\"padding-top:10px;\"><div class=\"wd-table-group\"><div id=\"form_id_temppage_nav1\" class=\"wd-table-row\"></div></div></div></div></div></div></div>', '1', '// Occurs before the form is loaded\r\nfunction before_load() { \r\n} \r\n// Occurs just before submitting the form\r\nfunction before_submit() {\r\n // IMPORTANT! If you want to interrupt (stop) the submitting of the form, this function should return true. You don\'t need to return any value if you don\'t want to stop the submission.\r\n} \r\n// Occurs just before resetting the form\r\nfunction before_reset() { \r\n}// Occurs after form is submitted and reloaded\r\nfunction after_submit() {\r\n \r\n}', '', '', '1', '{all}', '{all}', '13', '1', '2#**id**#First Name#**label**#type_text#****#3#**id**#Last Name#**label**#type_text#****#4#**id**#Email#**label**#type_submitter_mail#****#5#**id**#Phone#**label**#type_text#****#6#**id**#Website#**label**#type_text#****#7#**id**#Street Address#**label**#type_address#****#8#**id**#Street Address Line 2#**label**#type_address#****#9#**id**#City#**label**#type_address#****#10#**id**#State / Province / Region#**label**#type_address#****#11#**id**#Postal / Zip Code#**label**#type_address#****#12#**id**#Country#**label**#type_address#****#1#**id**#type_submit_reset_1#**label**#type_submit_reset#****#7_street1form_id_temp#**id**#type_submit_reset_1#**label**#type_submit_reset#****#7_street2form_id_temp#**id**##**label**##****#7_cityform_id_temp#**id**#undefined#**label**#undefined#****#7_stateform_id_temp#**id**#undefined#**label**#undefined#****#7_postalform_id_temp#**id**#undefined#**label**#undefined#****#7_countryform_id_temp#**id**#undefined#**label**#undefined#****#', '2#**id**#First Name#**label**#type_text#****#3#**id**#Last Name#**label**#type_text#****#4#**id**#Email#**label**#type_submitter_mail#****#5#**id**#Phone#**label**#type_text#****#6#**id**#Website#**label**#type_text#****#7#**id**#Street Address#**label**#type_address#****#8#**id**#Street Address Line 2#**label**#type_address#****#9#**id**#City#**label**#type_address#****#10#**id**#State / Province / Region#**label**#type_address#****#11#**id**#Postal / Zip Code#**label**#type_address#****#12#**id**#Country#**label**#type_address#****#1#**id**#type_submit_reset_1#**label**#type_submit_reset#****#', '0', 'none', '', '1', '', '', '', '0', 'testmode', '', '', '0', '2*:*id*:*type_text*:*type*:*First Name*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:**:*w_size*:**:*w_first_val*:**:*w_title*:*no*:*w_required*:*no*:*w_regExp_status*:**:*w_regExp_value*:**:*w_regExp_common*:**:*w_regExp_arg*:*Incorrect Value*:*w_regExp_alert*:*no*:*w_unique*:*no*:*w_readonly*:**:*new_field*:*3*:*id*:*type_text*:*type*:*Last Name*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:**:*w_size*:**:*w_first_val*:**:*w_title*:*no*:*w_required*:*no*:*w_regExp_status*:**:*w_regExp_value*:**:*w_regExp_common*:**:*w_regExp_arg*:*Incorrect Value*:*w_regExp_alert*:*no*:*w_unique*:*no*:*w_readonly*:**:*new_field*:*4*:*id*:*type_submitter_mail*:*type*:*Email*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:**:*w_size*:**:*w_first_val*:**:*w_title*:*yes*:*w_required*:*no*:*w_unique*:**:*w_class*:*no*:*w_verification*:*Email confirmation*:*w_verification_label*:**:*w_verification_placeholder*:*no*:*w_autofill*:**:*new_field*:*5*:*id*:*type_text*:*type*:*Phone*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:**:*w_size*:**:*w_first_val*:**:*w_title*:*no*:*w_required*:*no*:*w_regExp_status*:**:*w_regExp_value*:**:*w_regExp_common*:**:*w_regExp_arg*:*Incorrect Value*:*w_regExp_alert*:*no*:*w_unique*:*no*:*w_readonly*:**:*new_field*:*6*:*id*:*type_text*:*type*:*Website*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:**:*w_size*:**:*w_first_val*:*http://example.com*:*w_title*:*no*:*w_required*:*no*:*w_regExp_status*:**:*w_regExp_value*:**:*w_regExp_common*:**:*w_regExp_arg*:*Incorrect Value*:*w_regExp_alert*:*no*:*w_unique*:*no*:*w_readonly*:**:*new_field*:*7*:*id*:*type_address*:*type*:*Address*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:**:*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***no*:*w_disabled_fields*:*no*:*w_required*:*wdform_address*:*w_class*:**:*new_field*:*1*:*id*:*type_submit_reset*:*type*:*type_submit_reset_1*:*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', '0', '0', '0', '1', '', '', '', 'none', '0', '0');");
300
  $insert_form_id[] = $wpdb->insert_id;
301
 
302
  if ( WDFMInstance(self::PLUGIN)->is_free != 2 ) {
303
- $wpdb->query("INSERT INTO `" . $wpdb->prefix . "formmaker` (`id`, `title`, `type`, `mail`, `form_front`, `theme`, `javascript`, `submit_text`, `url`, `submit_text_type`, `script_mail`, `script_mail_user`, `counter`, `published`, `label_order`, `label_order_current`, `article_id`, `pagination`, `show_title`, `show_numbers`, `public_key`, `private_key`, `recaptcha_theme`, `paypal_mode`, `checkout_mode`, `paypal_email`, `payment_currency`, `tax`, `form_fields`, `savedb`, `sendemail`, `requiredmark`, `from_mail`, `from_name`, `reply_to`, `send_to`, `autogen_layout`, `custom_front`, `mail_from_user`, `mail_from_name_user`, `reply_to_user`, `condition`, `mail_cc`, `mail_cc_user`, `mail_bcc`, `mail_bcc_user`, `mail_subject`, `mail_subject_user`, `mail_mode`, `mail_mode_user`, `mail_attachment`, `mail_attachment_user`, `user_id_wd`, `sortable`, `frontend_submit_fields`, `frontend_submit_stat_fields`, `mail_emptyfields`, `mail_verify`, `mail_verify_expiretime`, `mail_verification_post_id`, `save_uploads`, `header_title`, `header_description`, `header_image_url`, `header_image_animation`, `header_hide_image`, `jsversion`) VALUES (NULL, 'Feedback Form', 'embedded', '{adminemail}', '<div class=\"wdform-page-and-images\"><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=\"true\" previous_title=\"Previous\" previous_type=\"text\" previous_class=\"wdform-page-button\" previous_checkable=\"false\"><div class=\"wdform_section\"><div class=\"wdform_column\"><div wdid=\"3\" class=\"wdform_row\">%3 - Name%</div><div wdid=\"4\" class=\"wdform_row\">%4 - Email%</div><div wdid=\"5\" class=\"wdform_row\" style=\"position: relative; left: 0px; top: 0px;\">%5 - CMS%</div><div wdid=\"6\" class=\"wdform_row\">%6 - Extension%</div><div wdid=\"7\" class=\"wdform_row\">%7 - Plugin%</div><div wdid=\"2\" class=\"wdform_row\" style=\"position: relative; left: 0px; top: 0px;\">%2 - Subject%</div><div wdid=\"8\" class=\"wdform_row\">%8 - Message%</div><div wdid=\"1\" class=\"wdform_row\">%1 - type_submit_reset_1%</div></div></div><div valign=\"top\" class=\"wdform_footer wd-width-100\"><div class=\"wd-width-100\"><div class=\"wd-width-100 wd-table\" style=\"padding-top:10px;\"><div class=\"wd-table-group\"><div id=\"form_id_temppage_nav1\" class=\"wd-table-row\"></div></div></div></div></div></div></div>', '3', '// Occurs before the form is loaded\r\nfunction before_load() { \r\n} \r\n// Occurs just before submitting the form\r\nfunction before_submit() {\r\n // IMPORTANT! If you want to interrupt (stop) the submitting of the form, this function should return true. You don\'t need to return any value if you don\'t want to stop the submission.\r\n} \r\n// Occurs just before resetting the form\r\nfunction before_reset() { \r\n}// Occurs after form is submitted and reloaded\r\nfunction after_submit() {\r\n \r\n}', '', '', '1', '{all}', '{all}', '9', '1', '3#**id**#Name#**label**#type_name#****#4#**id**#Email#**label**#type_submitter_mail#****#5#**id**#CMS#**label**#type_radio#****#6#**id**#Extension#**label**#type_own_select#****#7#**id**#Plugin#**label**#type_own_select#****#2#**id**#Subject#**label**#type_text#****#8#**id**#Message#**label**#type_textarea#****#1#**id**#type_submit_reset_1#**label**#type_submit_reset#****#2_elementform_id_temp#**id**#Text#**label**#type_text#****#', '3#**id**#Name#**label**#type_name#****#4#**id**#Email#**label**#type_submitter_mail#****#5#**id**#CMS#**label**#type_radio#****#6#**id**#Extension#**label**#type_own_select#****#7#**id**#Plugin#**label**#type_own_select#****#2#**id**#Subject#**label**#type_text#****#8#**id**#Message#**label**#type_textarea#****#1#**id**#type_submit_reset_1#**label**#type_submit_reset#****#', '0', 'none', '', '1', '', '', '', '0', '0', '', 'USD', '0', '3*:*id*:*type_name*:*type*:*Name*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:***********:*w_first_val*:*First***Last*******:*w_title*:*Title*********Middle*:*w_mini_labels*:**:*w_size*:*normal*:*w_name_format*:*yes*:*w_required*:*no*:*w_unique*:**:*w_class*:*no***no*:*w_name_fields*:*no*:*w_autofill*:**:*new_field*:*4*:*id*:*type_submitter_mail*:*type*:*Email*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:**:*w_size*:**:*w_first_val*:**:*w_title*:*yes*:*w_required*:*no*:*w_unique*:**:*w_class*:*no*:*w_verification*:*Email confirmation*:*w_verification_label*:**:*w_verification_placeholder*:*no*:*w_autofill*:**:*new_field*:*5*:*id*:*type_radio*:*type*:*CMS*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*right*:*w_field_option_pos*:*no*:*w_hide_label*:*hor*:*w_flow*:*Joomla!***Wordpress*:*w_choices*:*false***false*:*w_choices_checked*:*1*:*w_rowcol*:*yes*:*w_required*:*no*:*w_randomize*:*no*:*w_allow_other*:*0*:*w_allow_other_num*:*no*:*w_value_disabled*:*Joomla!***Wordpress*:*w_choices_value*:*****:*w_choices_params*:**:*w_class*:**:*new_field*:*6*:*id*:*type_own_select*:*type*:*Extension*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:**:*w_size*:*Select extension***Form Maker***Gallery WD***Spider Calendar*:*w_choices*:*true***false***false***false*:*w_choices_checked*:*true***false***false***false*:*w_choices_disabled*:*yes*:*w_required*:*no*:*w_value_disabled*:****Form Maker***Gallery WD***Spider Calendar*:*w_choices_value*:***********:*w_choices_params*:*wdform_select*:*w_class*:**:*new_field*:*7*:*id*:*type_own_select*:*type*:*Plugin*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:**:*w_size*:*Select plugin***Form Maker***Photo Gallery***Ecommerce WD*:*w_choices*:*true***false***false***false*:*w_choices_checked*:*true***false***false***false*:*w_choices_disabled*:*yes*:*w_required*:*no*:*w_value_disabled*:****Form Maker***Photo Gallery***Ecommerce WD*:*w_choices_value*:***********:*w_choices_params*:*wdform_select*:*w_class*:**:*new_field*:*2*:*id*:*type_text*:*type*:*Subject*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:**:*w_size*:**:*w_first_val*:**:*w_title*:*yes*:*w_required*:*no*:*w_regExp_status*:**:*w_regExp_value*:**:*w_regExp_common*:**:*w_regExp_arg*:*Incorrect Value*:*w_regExp_alert*:*no*:*w_unique*:*no*:*w_readonly*:**:*new_field*:*8*:*id*:*type_textarea*:*type*:*Message*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:**:*w_size_w*:*100*:*w_size_h*:**:*w_first_val*:**:*w_title*:*yes*:*w_required*:*no*:*w_unique*:**:*w_class*:**:*new_field*:*1*:*id*:*type_submit_reset*:*type*:*type_submit_reset_1*:*w_field_label*:*Submit*:*w_submit_title*:*Reset*:*w_reset_title*:**:*w_class*:*true*:*w_act*:**:*new_field*:*', '1', '1', '*', '', '', '', '', '1', '', '', '', '', '1*:*show_hide*:*6*:*field_label*:*and*:*all_any*:*5***==***Joomla!*:*next_condition*:**:*new_condition*:*1*:*show_hide*:*7*:*field_label*:*and*:*all_any*:*5***==***Wordpress*:*next_condition*:**:*new_condition*:*', '', '', '', '', '', '', '1', '1', '1', '1', 'administrator,', '1', '', '', '0', '0', '0', '110', '1', 'Feedback Form', 'You may contact us by filling in this form any time you need professional support or have any questions. You can also fill in the form to leave your comments or feedback.', '" . WDFMInstance(self::PLUGIN)->plugin_url . "/images/demo/2.png', 'flash', '0', '0');");
304
  $insert_form_id[] = $wpdb->insert_id;
305
- $wpdb->query("INSERT INTO `" . $wpdb->prefix . "formmaker` (`id`, `title`, `type`, `mail`, `form_front`, `theme`, `javascript`, `submit_text`, `url`, `submit_text_type`, `script_mail`, `script_mail_user`, `counter`, `published`, `label_order`, `label_order_current`, `article_id`, `pagination`, `show_title`, `show_numbers`, `public_key`, `private_key`, `recaptcha_theme`, `paypal_mode`, `checkout_mode`, `paypal_email`, `payment_currency`, `tax`, `form_fields`, `savedb`, `sendemail`, `requiredmark`, `from_mail`, `from_name`, `reply_to`, `send_to`, `autogen_layout`, `custom_front`, `mail_from_user`, `mail_from_name_user`, `reply_to_user`, `condition`, `mail_cc`, `mail_cc_user`, `mail_bcc`, `mail_bcc_user`, `mail_subject`, `mail_subject_user`, `mail_mode`, `mail_mode_user`, `mail_attachment`, `mail_attachment_user`, `user_id_wd`, `sortable`, `frontend_submit_fields`, `frontend_submit_stat_fields`, `mail_emptyfields`, `mail_verify`, `mail_verify_expiretime`, `mail_verification_post_id`, `save_uploads`, `header_title`, `header_description`, `header_image_url`, `header_image_animation`, `header_hide_image`, `jsversion`) VALUES (NULL, 'Business Demographic Survey', 'embedded', '{adminemail}', '<div class=\"wdform-page-and-images\"><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=\"true\" previous_title=\"Previous\" previous_type=\"text\" previous_class=\"wdform-page-button\" previous_checkable=\"false\"><div class=\"wdform_section\"><div class=\"wdform_column\"><div wdid=\"2\" class=\"wdform_row\">%2 - What is your employment status?%</div><div wdid=\"3\" class=\"wdform_row\">%3 - What is your level of education?%</div><div wdid=\"4\" class=\"wdform_row\">%4 - In which industry do you work?%</div><div wdid=\"6\" class=\"wdform_row\">%6 - What is the annual revenue of your company?%</div><div wdid=\"5\" class=\"wdform_row\">%5 - Enter characters for verification.%</div><div wdid=\"1\" class=\"wdform_row\">%1 - type_submit_reset_1%</div></div></div><div valign=\"top\" class=\"wdform_footer wd-width-100\"><div class=\"wd-width-100\"><div class=\"wd-width-100 wd-table\" style=\"padding-top:10px;\"><div class=\"wd-table-group\"><div id=\"form_id_temppage_nav1\" class=\"wd-table-row\"></div></div></div></div></div></div></div>', '4', '// Occurs before the form is loaded\r\nfunction before_load() { \r\n} \r\n// Occurs just before submitting the form\r\nfunction before_submit() {\r\n // IMPORTANT! If you want to interrupt (stop) the submitting of the form, this function should return true. You don\'t need to return any value if you don\'t want to stop the submission.\r\n} \r\n// Occurs just before resetting the form\r\nfunction before_reset() { \r\n}// Occurs after form is submitted and reloaded\r\nfunction after_submit() {\r\n \r\n}', '', '', '1', '{all}', '{all}', '7', '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#****#6#**id**#What is the annual revenue of your company?#**label**#type_radio#****#5#**id**#Enter characters for verification.#**label**#type_captcha#****#1#**id**#type_submit_reset_1#**label**#type_submit_reset#****#6_elementform_id_temp0#**id**#What is your employment status?#**label**#type_radio#****#6_elementform_id_temp1#**id**#What is your level of education?#**label**#type_radio#****#6_elementform_id_temp2#**id**#In which industry do you work?#**label**#type_own_select#****#6_elementform_id_temp3#**id**#Enter characters for verification.#**label**#type_captcha#****#6_elementform_id_temp4#**id**#type_submit_reset_1#**label**#type_submit_reset#****#6_elementform_id_temp5#**id**#type_submit_reset_1#**label**#type_submit_reset#****#6_elementform_id_temp6#**id**##**label**##****#6_elementform_id_temp7#**id**#undefined#**label**#undefined#****#6_elementform_id_temp8#**id**#undefined#**label**#undefined#****#6_elementform_id_temp9#**id**#undefined#**label**#undefined#****#6_elementform_id_temp10#**id**#undefined#**label**#undefined#****#6_elementform_id_temp11#**id**#undefined#**label**#undefined#****#6_elementform_id_temp12#**id**#undefined#**label**#undefined#****#6_elementform_id_temp13#**id**#undefined#**label**#undefined#****#6_elementform_id_temp14#**id**#undefined#**label**#undefined#****#6_elementform_id_temp15#**id**#undefined#**label**#undefined#****#6_elementform_id_temp16#**id**#undefined#**label**#undefined#****#6_elementform_id_temp17#**id**#undefined#**label**#undefined#****#6_elementform_id_temp18#**id**#undefined#**label**#undefined#****#6_elementform_id_temp19#**id**#undefined#**label**#undefined#****#6_elementform_id_temp20#**id**#undefined#**label**#undefined#****#6_elementform_id_temp21#**id**#undefined#**label**#undefined#****#6_elementform_id_temp22#**id**#undefined#**label**#undefined#****#6_elementform_id_temp23#**id**#undefined#**label**#undefined#****#6_elementform_id_temp24#**id**#undefined#**label**#undefined#****#6_elementform_id_temp25#**id**#undefined#**label**#undefined#****#6_elementform_id_temp26#**id**#undefined#**label**#undefined#****#6_elementform_id_temp27#**id**#undefined#**label**#undefined#****#6_elementform_id_temp28#**id**#undefined#**label**#undefined#****#6_elementform_id_temp29#**id**#undefined#**label**#undefined#****#6_elementform_id_temp30#**id**#undefined#**label**#undefined#****#6_elementform_id_temp31#**id**#undefined#**label**#undefined#****#6_elementform_id_temp32#**id**#undefined#**label**#undefined#****#6_elementform_id_temp33#**id**#undefined#**label**#undefined#****#6_elementform_id_temp34#**id**#undefined#**label**#undefined#****#6_elementform_id_temp35#**id**#undefined#**label**#undefined#****#6_elementform_id_temp36#**id**#undefined#**label**#undefined#****#6_elementform_id_temp37#**id**#undefined#**label**#undefined#****#6_elementform_id_temp38#**id**#undefined#**label**#undefined#****#6_elementform_id_temp39#**id**#undefined#**label**#undefined#****#6_elementform_id_temp40#**id**#undefined#**label**#undefined#****#6_elementform_id_temp41#**id**#undefined#**label**#undefined#****#6_elementform_id_temp42#**id**#undefined#**label**#undefined#****#6_elementform_id_temp43#**id**#undefined#**label**#undefined#****#6_elementform_id_temp44#**id**#undefined#**label**#undefined#****#6_elementform_id_temp45#**id**#undefined#**label**#undefined#****#6_elementform_id_temp46#**id**#undefined#**label**#undefined#****#6_elementform_id_temp47#**id**#undefined#**label**#undefined#****#6_elementform_id_temp48#**id**#undefined#**label**#undefined#****#6_elementform_id_temp49#**id**#undefined#**label**#undefined#****#', '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#****#6#**id**#What is the annual revenue of your company?#**label**#type_radio#****#5#**id**#Enter characters for verification.#**label**#type_captcha#****#1#**id**#type_submit_reset_1#**label**#type_submit_reset#****#', '0', 'none', '', '1', '', '', '', '0', 'testmode', '', '', '0', '2*:*id*:*type_radio*:*type*:*What is your employment status?*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*right*:*w_field_option_pos*:*no*:*w_hide_label*:*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*:*no*:*w_value_disabled*:*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_value*:***********************:*w_choices_params*:**:*w_class*:**:*new_field*:*3*:*id*:*type_radio*:*type*:*What is your level of education?*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*right*:*w_field_option_pos*:*no*:*w_hide_label*:*ver*:*w_flow*:*Some high school***High school graduate or equivalent***Trade or Vocational Degree***Some college***Associate degree***Bachelor\'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*:*no*:*w_value_disabled*:*Some high school***High school graduate or equivalent***Trade or Vocational Degree***Some college***Associate degree***Bachelor\'s degree***Graduate or Professional degree***Prefer not to answer*:*w_choices_value*:***********************:*w_choices_params*:**:*w_class*:**:*new_field*:*4*:*id*:*type_own_select*:*type*:*In which industry do you work?*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:**:*w_size*:*Select industry***Agriculture***Engineering***Information Technologies***Media***Local Business*:*w_choices*:*true***false***false***false***false***false*:*w_choices_checked*:*true***false***false***false***false***false*:*w_choices_disabled*:*no*:*w_required*:*no*:*w_value_disabled*:****Agriculture***Engineering***Information Technologies***Media***Local Business*:*w_choices_value*:*****************:*w_choices_params*:*wdform_select*:*w_class*:**:*new_field*:*6*:*id*:*type_radio*:*type*:*What is the annual revenue of your company?*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*right*:*w_field_option_pos*:*no*:*w_hide_label*:*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*:*no*:*w_value_disabled*:*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_value*:**************************:*w_choices_params*:**:*w_class*:**:*new_field*:*5*:*id*:*type_captcha*:*type*:*Enter characters for verification.*:*w_field_label*:**:*w_field_label_size*:*left*:*w_field_label_pos*:*yes*:*w_hide_label*:*6*:*w_digit*:**:*w_class*:**:*new_field*:*1*:*id*:*type_submit_reset*:*type*:*type_submit_reset_1*:*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', '0', '0', '0', '1', 'Business Demographic Survey', 'Thank you for joining our business demographic survey. Please give us your feedback by filling in the information bellow.', '', 'none', '1', '0');");
306
  $insert_form_id[] = $wpdb->insert_id;
307
- $wpdb->query("INSERT INTO `" . $wpdb->prefix . "formmaker` (`id`, `title`, `type`, `mail`, `form_front`, `theme`, `javascript`, `submit_text`, `url`, `submit_text_type`, `script_mail`, `script_mail_user`, `counter`, `published`, `label_order`, `label_order_current`, `article_id`, `pagination`, `show_title`, `show_numbers`, `public_key`, `private_key`, `recaptcha_theme`, `paypal_mode`, `checkout_mode`, `paypal_email`, `payment_currency`, `tax`, `form_fields`, `savedb`, `sendemail`, `requiredmark`, `from_mail`, `from_name`, `reply_to`, `send_to`, `autogen_layout`, `custom_front`, `mail_from_user`, `mail_from_name_user`, `reply_to_user`, `condition`, `mail_cc`, `mail_cc_user`, `mail_bcc`, `mail_bcc_user`, `mail_subject`, `mail_subject_user`, `mail_mode`, `mail_mode_user`, `mail_attachment`, `mail_attachment_user`, `user_id_wd`, `sortable`, `frontend_submit_fields`, `frontend_submit_stat_fields`, `mail_emptyfields`, `mail_verify`, `mail_verify_expiretime`, `mail_verification_post_id`, `save_uploads`, `header_title`, `header_description`, `header_image_url`, `header_image_animation`, `header_hide_image`, `jsversion`) VALUES (NULL, 'Cupcake Order Form', 'embedded', '{adminemail}', '<div class=\"wdform-page-and-images\"><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=\"true\" previous_title=\"Previous\" previous_type=\"text\" previous_class=\"wdform-page-button\" previous_checkable=\"false\"><div class=\"wdform_section\"><div class=\"wdform_column\"><div wdid=\"2\" class=\"wdform_row\">%2 - Name%</div><div wdid=\"3\" class=\"wdform_row\">%3 - Email%</div><div wdid=\"4\" class=\"wdform_row\">%4 - Date%</div><div wdid=\"5\" class=\"wdform_row\">%5 - Cupcakes Flavors (1 doz. minimum)%</div><div wdid=\"6\" class=\"wdform_row\">%6 - Quantity%</div><div wdid=\"7\" class=\"wdform_row\">%7 - Details (if any)%</div><div wdid=\"1\" class=\"wdform_row\">%1 - type_submit_reset_1%</div></div></div><div valign=\"top\" class=\"wdform_footer wd-width-100\"><div class=\"wd-width-100\"><div class=\"wd-width-100 wd-table\" style=\"padding-top:10px;\"><div class=\"wd-table-group\"><div id=\"form_id_temppage_nav1\" class=\"wd-table-row\"></div></div></div></div></div></div></div>', '6', '// Occurs before the form is loaded\r\nfunction before_load() { \r\n} \r\n// Occurs just before submitting the form\r\nfunction before_submit() {\r\n // IMPORTANT! If you want to interrupt (stop) the submitting of the form, this function should return true. You don\'t need to return any value if you don\'t want to stop the submission.\r\n} \r\n// Occurs just before resetting the form\r\nfunction before_reset() { \r\n}// Occurs after form is submitted and reloaded\r\nfunction after_submit() {\r\n \r\n}', '', '', '1', '{all}', '{all}', '8', '1', '2#**id**#Name#**label**#type_name#****#3#**id**#Email#**label**#type_submitter_mail#****#4#**id**#Date#**label**#type_date_new#****#5#**id**#Cupcakes Flavors (1 doz. minimum)#**label**#type_radio#****#6#**id**#Quantity#**label**#type_spinner#****#7#**id**#Details (if any)#**label**#type_textarea#****#1#**id**#type_submit_reset_1#**label**#type_submit_reset#****#5_elementform_id_temp0#**id**#Name#**label**#type_name#****#5_elementform_id_temp1#**id**#Email#**label**#type_submitter_mail#****#5_elementform_id_temp2#**id**#Date#**label**#type_date_new#****#5_elementform_id_temp3#**id**#Name:* Email:* Date* Cupcakes Flavors (1 doz. minimum)#**label**#type_radio#****#5_elementform_id_temp4#**id**#Quantity#**label**#type_spinner#****#5_elementform_id_temp5#**id**#Details (if any)#**label**#type_textarea#****#5_elementform_id_temp6#**id**#type_submit_reset_1#**label**#type_submit_reset#****#5_elementform_id_temp7#**id**#Name#**label**#type_name#****#5_elementform_id_temp8#**id**#Email#**label**#type_submitter_mail#****#5_elementform_id_temp9#**id**#Date#**label**#type_date_new#****#5_elementform_id_temp10#**id**#type_submit_reset_1#**label**#type_submit_reset#****#5_elementform_id_temp11#**id**#type_submit_reset_1#**label**#type_submit_reset#****#5_elementform_id_temp12#**id**#undefined#**label**#undefined#****#5_elementform_id_temp13#**id**#undefined#**label**#undefined#****#5_elementform_id_temp14#**id**#undefined#**label**#undefined#****#5_elementform_id_temp15#**id**#undefined#**label**#undefined#****#5_elementform_id_temp16#**id**#undefined#**label**#undefined#****#5_elementform_id_temp17#**id**#undefined#**label**#undefined#****#5_elementform_id_temp18#**id**#undefined#**label**#undefined#****#5_elementform_id_temp19#**id**#undefined#**label**#undefined#****#5_elementform_id_temp20#**id**#undefined#**label**#undefined#****#5_elementform_id_temp21#**id**#undefined#**label**#undefined#****#5_elementform_id_temp22#**id**#undefined#**label**#undefined#****#5_elementform_id_temp23#**id**#undefined#**label**#undefined#****#5_elementform_id_temp24#**id**#undefined#**label**#undefined#****#5_elementform_id_temp25#**id**#undefined#**label**#undefined#****#5_elementform_id_temp26#**id**#undefined#**label**#undefined#****#5_elementform_id_temp27#**id**#undefined#**label**#undefined#****#5_elementform_id_temp28#**id**#undefined#**label**#undefined#****#5_elementform_id_temp29#**id**#undefined#**label**#undefined#****#5_elementform_id_temp30#**id**#undefined#**label**#undefined#****#5_elementform_id_temp31#**id**#undefined#**label**#undefined#****#5_elementform_id_temp32#**id**#undefined#**label**#undefined#****#5_elementform_id_temp33#**id**#undefined#**label**#undefined#****#5_elementform_id_temp34#**id**#undefined#**label**#undefined#****#5_elementform_id_temp35#**id**#undefined#**label**#undefined#****#5_elementform_id_temp36#**id**#undefined#**label**#undefined#****#5_elementform_id_temp37#**id**#undefined#**label**#undefined#****#5_elementform_id_temp38#**id**#undefined#**label**#undefined#****#5_elementform_id_temp39#**id**#undefined#**label**#undefined#****#5_elementform_id_temp40#**id**#undefined#**label**#undefined#****#5_elementform_id_temp41#**id**#undefined#**label**#undefined#****#5_elementform_id_temp42#**id**#undefined#**label**#undefined#****#5_elementform_id_temp43#**id**#undefined#**label**#undefined#****#5_elementform_id_temp44#**id**#undefined#**label**#undefined#****#5_elementform_id_temp45#**id**#undefined#**label**#undefined#****#5_elementform_id_temp46#**id**#undefined#**label**#undefined#****#5_elementform_id_temp47#**id**#undefined#**label**#undefined#****#5_elementform_id_temp48#**id**#undefined#**label**#undefined#****#5_elementform_id_temp49#**id**#undefined#**label**#undefined#****#', '2#**id**#Name#**label**#type_name#****#3#**id**#Email#**label**#type_submitter_mail#****#4#**id**#Date#**label**#type_date_new#****#5#**id**#Cupcakes Flavors (1 doz. minimum)#**label**#type_radio#****#6#**id**#Quantity#**label**#type_spinner#****#7#**id**#Details (if any)#**label**#type_textarea#****#1#**id**#type_submit_reset_1#**label**#type_submit_reset#****#', '0', 'none', '', '1', '', '', '', '0', 'testmode', '', '', '0', '2*:*id*:*type_name*:*type*:*Name*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:***********:*w_first_val*:***********:*w_title*:*Title*********Middle*:*w_mini_labels*:**:*w_size*:*normal*:*w_name_format*:*yes*:*w_required*:*no*:*w_unique*:**:*w_class*:*no***no*:*w_name_fields*:*no*:*w_autofill*:**:*new_field*:*3*:*id*:*type_submitter_mail*:*type*:*Email*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:**:*w_size*:**:*w_first_val*:**:*w_title*:*yes*:*w_required*:*no*:*w_unique*:**:*w_class*:*no*:*w_verification*:*Email confirmation*:*w_verification_label*:**:*w_verification_placeholder*:*no*:*w_autofill*:**:*new_field*:*4*:*id*:*type_date_new*:*type*:*Date*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:**:*w_size*:**:*w_date*:*yes*:*w_required*:*yes*:*w_show_image*:**:*w_class*:*mm/dd/yy*:*w_format*:*0*:*w_start_day*:**:*w_default_date*:**:*w_min_date*:**:*w_max_date*:**:*w_invalid_dates*:*yes***yes***yes***yes***yes***yes***yes*:*w_show_days*:*yes*:*w_hide_time*:*...*:*w_but_val*:*no*:*w_disable_past_days*:**:*new_field*:*5*:*id*:*type_radio*:*type*:*Cupcakes Flavors (1 doz. minimum)*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*right*:*w_field_option_pos*:*no*:*w_hide_label*:*ver*:*w_flow*:*Red Velvet***Vanilla***Chocolate***Guinness***Coconut***Lemon***Chocolate Mint*:*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*:*no*:*w_value_disabled*:*Red Velvet***Vanilla***Chocolate***Guinness***Coconut***Lemon***Chocolate Mint*:*w_choices_value*:********************:*w_choices_params*:**:*w_class*:**:*new_field*:*6*:*id*:*type_spinner*:*type*:*Quantity*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:*60*:*w_field_width*:**:*w_field_min_value*:**:*w_field_max_value*:*1*:*w_field_step*:*null*:*w_field_value*:*no*:*w_required*:**:*w_class*:**:*new_field*:*7*:*id*:*type_textarea*:*type*:*Details (if any)*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:**:*w_size_w*:*100*:*w_size_h*:**:*w_first_val*:**:*w_title*:*no*:*w_required*:*no*:*w_unique*:**:*w_class*:**:*new_field*:*1*:*id*:*type_submit_reset*:*type*:*type_submit_reset_1*:*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', '0', '0', '0', '1', 'Cupcake Order Form', '', '', 'none', '1', '0');");
308
  $insert_form_id[] = $wpdb->insert_id;
309
  }
310
  else {
80
  `header_image_animation` varchar(200) NOT NULL,
81
  `header_hide_image` tinyint(4) NOT NULL DEFAULT '1',
82
  `jsversion` int(11) NOT NULL,
83
+ `privacy` longtext NOT NULL,
84
  PRIMARY KEY (`id`)
85
  ) " . $charset_collate . ";";
86
  $wpdb->query($formmaker);
278
  `mail_verify` tinyint(4) NOT NULL DEFAULT '0',
279
  `mail_verify_expiretime` float NOT NULL,
280
  `mail_verification_post_id` int(11) NOT NULL,
281
+ `save_uploads` tinyint(4) NOT NULL DEFAULT '1',
282
  `header_title` varchar(255) NOT NULL,
283
  `header_description` text NOT NULL,
284
  `header_image_url` varchar(255) NOT NULL,
285
  `header_image_animation` varchar(200) NOT NULL,
286
  `header_hide_image` tinyint(4) NOT NULL DEFAULT '1',
287
+ `privacy` longtext NOT NULL,
288
  PRIMARY KEY (`backup_id`)
289
  ) " . $charset_collate . ";";
290
  $wpdb->query($formmaker_backup);
296
  $form_maker_row = $wpdb->get_var('SELECT * FROM ' . $wpdb->prefix . 'formmaker' . (!WDFMInstance(self::PLUGIN)->is_free ? '' : ' WHERE id' . (WDFMInstance(self::PLUGIN)->is_free == 1 ? ' NOT ' : ' ') . 'IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ')'));
297
  if ( !$form_maker_row ) {
298
  $insert_form_id = array();
299
+ $wpdb->query("INSERT INTO `" . $wpdb->prefix . "formmaker` (`id`, `title`, `type`, `mail`, `form_front`, `theme`, `javascript`, `submit_text`, `url`, `submit_text_type`, `script_mail`, `script_mail_user`, `counter`, `published`, `label_order`, `label_order_current`, `article_id`, `pagination`, `show_title`, `show_numbers`, `public_key`, `private_key`, `recaptcha_theme`, `paypal_mode`, `checkout_mode`, `paypal_email`, `payment_currency`, `tax`, `form_fields`, `savedb`, `sendemail`, `requiredmark`, `from_mail`, `from_name`, `reply_to`, `send_to`, `autogen_layout`, `custom_front`, `mail_from_user`, `mail_from_name_user`, `reply_to_user`, `condition`, `mail_cc`, `mail_cc_user`, `mail_bcc`, `mail_bcc_user`, `mail_subject`, `mail_subject_user`, `mail_mode`, `mail_mode_user`, `mail_attachment`, `mail_attachment_user`, `user_id_wd`, `sortable`, `frontend_submit_fields`, `frontend_submit_stat_fields`, `mail_emptyfields`, `mail_verify`, `mail_verify_expiretime`, `mail_verification_post_id`, `save_uploads`, `header_title`, `header_description`, `header_image_url`, `header_image_animation`, `header_hide_image`, `jsversion`, `privacy`) VALUES (NULL, 'Contact Us', 'embedded', '{adminemail}', '<div class=\"wdform-page-and-images\"><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=\"true\" previous_title=\"Previous\" previous_type=\"text\" previous_class=\"wdform-page-button\" previous_checkable=\"false\"><div class=\"wdform_section\"><div class=\"wdform_column\"><div wdid=\"2\" class=\"wdform_row\">%2 - Name%</div><div wdid=\"3\" class=\"wdform_row\">%3 - Email%</div><div wdid=\"4\" class=\"wdform_row\">%4 - Subject%</div><div wdid=\"5\" class=\"wdform_row\">%5 - Message%</div><div wdid=\"1\" class=\"wdform_row\">%1 - type_submit_reset_1%</div></div></div><div valign=\"top\" class=\"wdform_footer wd-width-100\"><div class=\"wd-width-100\"><div class=\"wd-width-100 wd-table\" style=\"padding-top:10px;\"><div class=\"wd-table-group\"><div id=\"form_id_temppage_nav1\" class=\"wd-table-row\"></div></div></div></div></div></div></div>', '1', '// Occurs before the form is loaded\r\nfunction before_load() { \r\n} \r\n// Occurs just before submitting the form\r\nfunction before_submit() {\r\n // IMPORTANT! If you want to interrupt (stop) the submitting of the form, this function should return true. You don\'t need to return any value if you don\'t want to stop the submission.\r\n} \r\n// Occurs just before resetting the form\r\nfunction before_reset() { \r\n}\r\n// Occurs after form is submitted and reloaded\r\nfunction after_submit() {\r\n \r\n}', '', '', '1', '{all}', '{all}', '6', '1', '2#**id**#Name#**label**#type_text#****#3#**id**#Email#**label**#type_submitter_mail#****#4#**id**#Subject#**label**#type_text#****#5#**id**#Message#**label**#type_textarea#****#1#**id**#type_submit_reset_1#**label**#type_submit_reset#****#2_elementform_id_temp#**id**#type_submit_reset_1#**label**#type_submit_reset#****#', '2#**id**#Name#**label**#type_text#****#3#**id**#Email#**label**#type_submitter_mail#****#4#**id**#Subject#**label**#type_text#****#5#**id**#Message#**label**#type_textarea#****#1#**id**#type_submit_reset_1#**label**#type_submit_reset#****#', '0', 'none', '', '1', '', '', '', '0', 'testmode', '', '', '0', '2*:*id*:*type_text*:*type*:*Name*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:**:*w_size*:**:*w_first_val*:**:*w_title*:*yes*:*w_required*:*no*:*w_regExp_status*:**:*w_regExp_value*:**:*w_regExp_common*:**:*w_regExp_arg*:*Incorrect Value*:*w_regExp_alert*:*no*:*w_unique*:*no*:*w_readonly*:**:*new_field*:*3*:*id*:*type_submitter_mail*:*type*:*Email*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:**:*w_size*:**:*w_first_val*:**:*w_title*:*yes*:*w_required*:*no*:*w_unique*:**:*w_class*:*no*:*w_verification*:*Email confirmation*:*w_verification_label*:**:*w_verification_placeholder*:*no*:*w_autofill*:**:*new_field*:*4*:*id*:*type_text*:*type*:*Subject*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:**:*w_size*:**:*w_first_val*:**:*w_title*:*yes*:*w_required*:*no*:*w_regExp_status*:**:*w_regExp_value*:**:*w_regExp_common*:**:*w_regExp_arg*:*Incorrect Value*:*w_regExp_alert*:*no*:*w_unique*:*no*:*w_readonly*:**:*new_field*:*5*:*id*:*type_textarea*:*type*:*Message*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:**:*w_size_w*:*100*:*w_size_h*:**:*w_first_val*:**:*w_title*:*yes*:*w_required*:*no*:*w_unique*:**:*w_class*:**:*new_field*:*1*:*id*:*type_submit_reset*:*type*:*type_submit_reset_1*:*w_field_label*:*Submit*:*w_submit_title*:*Reset*:*w_reset_title*:**:*w_class*:*false*:*w_act*:**:*new_field*:*', '1', '1', '*', '{adminemail}', '', '', '', '1', '', '{adminemail}', '', '', '', '', '', '', '', '', '', '1', '1', '1', '1', 'administrator,', '1', '', '', '0', '0', '0', '0', '1', 'Contact Us', 'You may contact us by filling in this form any time you need professional support or have any questions. You can also fill in the form to leave your comments or feedback.', '', 'none', '0', '0', '');");
300
  $insert_form_id[] = $wpdb->insert_id;
301
+ $wpdb->query("INSERT INTO `" . $wpdb->prefix . "formmaker` (`id`, `title`, `type`, `mail`, `form_front`, `theme`, `javascript`, `submit_text`, `url`, `submit_text_type`, `script_mail`, `script_mail_user`, `counter`, `published`, `label_order`, `label_order_current`, `article_id`, `pagination`, `show_title`, `show_numbers`, `public_key`, `private_key`, `recaptcha_theme`, `paypal_mode`, `checkout_mode`, `paypal_email`, `payment_currency`, `tax`, `form_fields`, `savedb`, `sendemail`, `requiredmark`, `from_mail`, `from_name`, `reply_to`, `send_to`, `autogen_layout`, `custom_front`, `mail_from_user`, `mail_from_name_user`, `reply_to_user`, `condition`, `mail_cc`, `mail_cc_user`, `mail_bcc`, `mail_bcc_user`, `mail_subject`, `mail_subject_user`, `mail_mode`, `mail_mode_user`, `mail_attachment`, `mail_attachment_user`, `user_id_wd`, `sortable`, `frontend_submit_fields`, `frontend_submit_stat_fields`, `mail_emptyfields`, `mail_verify`, `mail_verify_expiretime`, `mail_verification_post_id`, `save_uploads`, `header_title`, `header_description`, `header_image_url`, `header_image_animation`, `header_hide_image`, `jsversion`, `privacy`) VALUES (NULL, 'Client List Form', 'embedded', '{adminemail}', '<div class=\"wdform-page-and-images\"><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=\"true\" previous_title=\"Previous\" previous_type=\"text\" previous_class=\"wdform-page-button\" previous_checkable=\"false\"><div class=\"wdform_section\"><div class=\"wdform_column\"><div wdid=\"2\" class=\"wdform_row\">%2 - First Name%</div><div wdid=\"3\" class=\"wdform_row\">%3 - Last Name%</div><div wdid=\"4\" class=\"wdform_row\">%4 - Email%</div><div wdid=\"5\" class=\"wdform_row\">%5 - Phone%</div><div wdid=\"6\" class=\"wdform_row\">%6 - Website%</div><div wdid=\"7\" class=\"wdform_row\">%7 - Address%</div><div wdid=\"1\" class=\"wdform_row\">%1 - type_submit_reset_1%</div></div></div><div valign=\"top\" class=\"wdform_footer wd-width-100\"><div class=\"wd-width-100\"><div class=\"wd-width-100 wd-table\" style=\"padding-top:10px;\"><div class=\"wd-table-group\"><div id=\"form_id_temppage_nav1\" class=\"wd-table-row\"></div></div></div></div></div></div></div>', '1', '// Occurs before the form is loaded\r\nfunction before_load() { \r\n} \r\n// Occurs just before submitting the form\r\nfunction before_submit() {\r\n // IMPORTANT! If you want to interrupt (stop) the submitting of the form, this function should return true. You don\'t need to return any value if you don\'t want to stop the submission.\r\n} \r\n// Occurs just before resetting the form\r\nfunction before_reset() { \r\n}// Occurs after form is submitted and reloaded\r\nfunction after_submit() {\r\n \r\n}', '', '', '1', '{all}', '{all}', '13', '1', '2#**id**#First Name#**label**#type_text#****#3#**id**#Last Name#**label**#type_text#****#4#**id**#Email#**label**#type_submitter_mail#****#5#**id**#Phone#**label**#type_text#****#6#**id**#Website#**label**#type_text#****#7#**id**#Street Address#**label**#type_address#****#8#**id**#Street Address Line 2#**label**#type_address#****#9#**id**#City#**label**#type_address#****#10#**id**#State / Province / Region#**label**#type_address#****#11#**id**#Postal / Zip Code#**label**#type_address#****#12#**id**#Country#**label**#type_address#****#1#**id**#type_submit_reset_1#**label**#type_submit_reset#****#7_street1form_id_temp#**id**#type_submit_reset_1#**label**#type_submit_reset#****#7_street2form_id_temp#**id**##**label**##****#7_cityform_id_temp#**id**#undefined#**label**#undefined#****#7_stateform_id_temp#**id**#undefined#**label**#undefined#****#7_postalform_id_temp#**id**#undefined#**label**#undefined#****#7_countryform_id_temp#**id**#undefined#**label**#undefined#****#', '2#**id**#First Name#**label**#type_text#****#3#**id**#Last Name#**label**#type_text#****#4#**id**#Email#**label**#type_submitter_mail#****#5#**id**#Phone#**label**#type_text#****#6#**id**#Website#**label**#type_text#****#7#**id**#Street Address#**label**#type_address#****#8#**id**#Street Address Line 2#**label**#type_address#****#9#**id**#City#**label**#type_address#****#10#**id**#State / Province / Region#**label**#type_address#****#11#**id**#Postal / Zip Code#**label**#type_address#****#12#**id**#Country#**label**#type_address#****#1#**id**#type_submit_reset_1#**label**#type_submit_reset#****#', '0', 'none', '', '1', '', '', '', '0', 'testmode', '', '', '0', '2*:*id*:*type_text*:*type*:*First Name*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:**:*w_size*:**:*w_first_val*:**:*w_title*:*no*:*w_required*:*no*:*w_regExp_status*:**:*w_regExp_value*:**:*w_regExp_common*:**:*w_regExp_arg*:*Incorrect Value*:*w_regExp_alert*:*no*:*w_unique*:*no*:*w_readonly*:**:*new_field*:*3*:*id*:*type_text*:*type*:*Last Name*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:**:*w_size*:**:*w_first_val*:**:*w_title*:*no*:*w_required*:*no*:*w_regExp_status*:**:*w_regExp_value*:**:*w_regExp_common*:**:*w_regExp_arg*:*Incorrect Value*:*w_regExp_alert*:*no*:*w_unique*:*no*:*w_readonly*:**:*new_field*:*4*:*id*:*type_submitter_mail*:*type*:*Email*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:**:*w_size*:**:*w_first_val*:**:*w_title*:*yes*:*w_required*:*no*:*w_unique*:**:*w_class*:*no*:*w_verification*:*Email confirmation*:*w_verification_label*:**:*w_verification_placeholder*:*no*:*w_autofill*:**:*new_field*:*5*:*id*:*type_text*:*type*:*Phone*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:**:*w_size*:**:*w_first_val*:**:*w_title*:*no*:*w_required*:*no*:*w_regExp_status*:**:*w_regExp_value*:**:*w_regExp_common*:**:*w_regExp_arg*:*Incorrect Value*:*w_regExp_alert*:*no*:*w_unique*:*no*:*w_readonly*:**:*new_field*:*6*:*id*:*type_text*:*type*:*Website*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:**:*w_size*:**:*w_first_val*:*http://example.com*:*w_title*:*no*:*w_required*:*no*:*w_regExp_status*:**:*w_regExp_value*:**:*w_regExp_common*:**:*w_regExp_arg*:*Incorrect Value*:*w_regExp_alert*:*no*:*w_unique*:*no*:*w_readonly*:**:*new_field*:*7*:*id*:*type_address*:*type*:*Address*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:**:*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***no*:*w_disabled_fields*:*no*:*w_required*:*wdform_address*:*w_class*:**:*new_field*:*1*:*id*:*type_submit_reset*:*type*:*type_submit_reset_1*:*w_field_label*:*Submit*:*w_submit_title*:*Reset*:*w_reset_title*:**:*w_class*:*false*:*w_act*:**:*new_field*:*', '1', '1', '*', '{adminemail}', '', '', '', '1', '', '{adminemail}', '', '', '', '', '', '', '', '', '', '1', '1', '1', '1', 'administrator,', '1', '', '', '0', '0', '0', '0', '1', '', '', '', 'none', '0', '0', '');");
302
  $insert_form_id[] = $wpdb->insert_id;
303
 
304
  if ( WDFMInstance(self::PLUGIN)->is_free != 2 ) {
305
+ $wpdb->query("INSERT INTO `" . $wpdb->prefix . "formmaker` (`id`, `title`, `type`, `mail`, `form_front`, `theme`, `javascript`, `submit_text`, `url`, `submit_text_type`, `script_mail`, `script_mail_user`, `counter`, `published`, `label_order`, `label_order_current`, `article_id`, `pagination`, `show_title`, `show_numbers`, `public_key`, `private_key`, `recaptcha_theme`, `paypal_mode`, `checkout_mode`, `paypal_email`, `payment_currency`, `tax`, `form_fields`, `savedb`, `sendemail`, `requiredmark`, `from_mail`, `from_name`, `reply_to`, `send_to`, `autogen_layout`, `custom_front`, `mail_from_user`, `mail_from_name_user`, `reply_to_user`, `condition`, `mail_cc`, `mail_cc_user`, `mail_bcc`, `mail_bcc_user`, `mail_subject`, `mail_subject_user`, `mail_mode`, `mail_mode_user`, `mail_attachment`, `mail_attachment_user`, `user_id_wd`, `sortable`, `frontend_submit_fields`, `frontend_submit_stat_fields`, `mail_emptyfields`, `mail_verify`, `mail_verify_expiretime`, `mail_verification_post_id`, `save_uploads`, `header_title`, `header_description`, `header_image_url`, `header_image_animation`, `header_hide_image`, `jsversion`, `privacy`) VALUES (NULL, 'Feedback Form', 'embedded', '{adminemail}', '<div class=\"wdform-page-and-images\"><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=\"true\" previous_title=\"Previous\" previous_type=\"text\" previous_class=\"wdform-page-button\" previous_checkable=\"false\"><div class=\"wdform_section\"><div class=\"wdform_column\"><div wdid=\"3\" class=\"wdform_row\">%3 - Name%</div><div wdid=\"4\" class=\"wdform_row\">%4 - Email%</div><div wdid=\"5\" class=\"wdform_row\" style=\"position: relative; left: 0px; top: 0px;\">%5 - CMS%</div><div wdid=\"6\" class=\"wdform_row\">%6 - Extension%</div><div wdid=\"7\" class=\"wdform_row\">%7 - Plugin%</div><div wdid=\"2\" class=\"wdform_row\" style=\"position: relative; left: 0px; top: 0px;\">%2 - Subject%</div><div wdid=\"8\" class=\"wdform_row\">%8 - Message%</div><div wdid=\"1\" class=\"wdform_row\">%1 - type_submit_reset_1%</div></div></div><div valign=\"top\" class=\"wdform_footer wd-width-100\"><div class=\"wd-width-100\"><div class=\"wd-width-100 wd-table\" style=\"padding-top:10px;\"><div class=\"wd-table-group\"><div id=\"form_id_temppage_nav1\" class=\"wd-table-row\"></div></div></div></div></div></div></div>', '3', '// Occurs before the form is loaded\r\nfunction before_load() { \r\n} \r\n// Occurs just before submitting the form\r\nfunction before_submit() {\r\n // IMPORTANT! If you want to interrupt (stop) the submitting of the form, this function should return true. You don\'t need to return any value if you don\'t want to stop the submission.\r\n} \r\n// Occurs just before resetting the form\r\nfunction before_reset() { \r\n}// Occurs after form is submitted and reloaded\r\nfunction after_submit() {\r\n \r\n}', '', '', '1', '{all}', '{all}', '9', '1', '3#**id**#Name#**label**#type_name#****#4#**id**#Email#**label**#type_submitter_mail#****#5#**id**#CMS#**label**#type_radio#****#6#**id**#Extension#**label**#type_own_select#****#7#**id**#Plugin#**label**#type_own_select#****#2#**id**#Subject#**label**#type_text#****#8#**id**#Message#**label**#type_textarea#****#1#**id**#type_submit_reset_1#**label**#type_submit_reset#****#2_elementform_id_temp#**id**#Text#**label**#type_text#****#', '3#**id**#Name#**label**#type_name#****#4#**id**#Email#**label**#type_submitter_mail#****#5#**id**#CMS#**label**#type_radio#****#6#**id**#Extension#**label**#type_own_select#****#7#**id**#Plugin#**label**#type_own_select#****#2#**id**#Subject#**label**#type_text#****#8#**id**#Message#**label**#type_textarea#****#1#**id**#type_submit_reset_1#**label**#type_submit_reset#****#', '0', 'none', '', '1', '', '', '', '0', '0', '', 'USD', '0', '3*:*id*:*type_name*:*type*:*Name*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:***********:*w_first_val*:*First***Last*******:*w_title*:*Title*********Middle*:*w_mini_labels*:**:*w_size*:*normal*:*w_name_format*:*yes*:*w_required*:*no*:*w_unique*:**:*w_class*:*no***no*:*w_name_fields*:*no*:*w_autofill*:**:*new_field*:*4*:*id*:*type_submitter_mail*:*type*:*Email*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:**:*w_size*:**:*w_first_val*:**:*w_title*:*yes*:*w_required*:*no*:*w_unique*:**:*w_class*:*no*:*w_verification*:*Email confirmation*:*w_verification_label*:**:*w_verification_placeholder*:*no*:*w_autofill*:**:*new_field*:*5*:*id*:*type_radio*:*type*:*CMS*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*right*:*w_field_option_pos*:*no*:*w_hide_label*:*hor*:*w_flow*:*Joomla!***Wordpress*:*w_choices*:*false***false*:*w_choices_checked*:*1*:*w_rowcol*:*yes*:*w_required*:*no*:*w_randomize*:*no*:*w_allow_other*:*0*:*w_allow_other_num*:*no*:*w_value_disabled*:*Joomla!***Wordpress*:*w_choices_value*:*****:*w_choices_params*:**:*w_class*:**:*new_field*:*6*:*id*:*type_own_select*:*type*:*Extension*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:**:*w_size*:*Select extension***Form Maker***Gallery WD***Spider Calendar*:*w_choices*:*true***false***false***false*:*w_choices_checked*:*true***false***false***false*:*w_choices_disabled*:*yes*:*w_required*:*no*:*w_value_disabled*:****Form Maker***Gallery WD***Spider Calendar*:*w_choices_value*:***********:*w_choices_params*:*wdform_select*:*w_class*:**:*new_field*:*7*:*id*:*type_own_select*:*type*:*Plugin*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:**:*w_size*:*Select plugin***Form Maker***Photo Gallery***Ecommerce WD*:*w_choices*:*true***false***false***false*:*w_choices_checked*:*true***false***false***false*:*w_choices_disabled*:*yes*:*w_required*:*no*:*w_value_disabled*:****Form Maker***Photo Gallery***Ecommerce WD*:*w_choices_value*:***********:*w_choices_params*:*wdform_select*:*w_class*:**:*new_field*:*2*:*id*:*type_text*:*type*:*Subject*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:**:*w_size*:**:*w_first_val*:**:*w_title*:*yes*:*w_required*:*no*:*w_regExp_status*:**:*w_regExp_value*:**:*w_regExp_common*:**:*w_regExp_arg*:*Incorrect Value*:*w_regExp_alert*:*no*:*w_unique*:*no*:*w_readonly*:**:*new_field*:*8*:*id*:*type_textarea*:*type*:*Message*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:**:*w_size_w*:*100*:*w_size_h*:**:*w_first_val*:**:*w_title*:*yes*:*w_required*:*no*:*w_unique*:**:*w_class*:**:*new_field*:*1*:*id*:*type_submit_reset*:*type*:*type_submit_reset_1*:*w_field_label*:*Submit*:*w_submit_title*:*Reset*:*w_reset_title*:**:*w_class*:*true*:*w_act*:**:*new_field*:*', '1', '1', '*', '{adminemail}', '', '', '', '1', '', '{adminemail}', '', '', '1*:*show_hide*:*6*:*field_label*:*and*:*all_any*:*5***==***Joomla!*:*next_condition*:**:*new_condition*:*1*:*show_hide*:*7*:*field_label*:*and*:*all_any*:*5***==***Wordpress*:*next_condition*:**:*new_condition*:*', '', '', '', '', '', '', '1', '1', '1', '1', 'administrator,', '1', '', '', '0', '0', '0', '110', '1', 'Feedback Form', 'You may contact us by filling in this form any time you need professional support or have any questions. You can also fill in the form to leave your comments or feedback.', '" . WDFMInstance(self::PLUGIN)->plugin_url . "/images/demo/2.png', 'flash', '0', '0', '');");
306
  $insert_form_id[] = $wpdb->insert_id;
307
+ $wpdb->query("INSERT INTO `" . $wpdb->prefix . "formmaker` (`id`, `title`, `type`, `mail`, `form_front`, `theme`, `javascript`, `submit_text`, `url`, `submit_text_type`, `script_mail`, `script_mail_user`, `counter`, `published`, `label_order`, `label_order_current`, `article_id`, `pagination`, `show_title`, `show_numbers`, `public_key`, `private_key`, `recaptcha_theme`, `paypal_mode`, `checkout_mode`, `paypal_email`, `payment_currency`, `tax`, `form_fields`, `savedb`, `sendemail`, `requiredmark`, `from_mail`, `from_name`, `reply_to`, `send_to`, `autogen_layout`, `custom_front`, `mail_from_user`, `mail_from_name_user`, `reply_to_user`, `condition`, `mail_cc`, `mail_cc_user`, `mail_bcc`, `mail_bcc_user`, `mail_subject`, `mail_subject_user`, `mail_mode`, `mail_mode_user`, `mail_attachment`, `mail_attachment_user`, `user_id_wd`, `sortable`, `frontend_submit_fields`, `frontend_submit_stat_fields`, `mail_emptyfields`, `mail_verify`, `mail_verify_expiretime`, `mail_verification_post_id`, `save_uploads`, `header_title`, `header_description`, `header_image_url`, `header_image_animation`, `header_hide_image`, `jsversion`, `privacy`) VALUES (NULL, 'Business Demographic Survey', 'embedded', '{adminemail}', '<div class=\"wdform-page-and-images\"><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=\"true\" previous_title=\"Previous\" previous_type=\"text\" previous_class=\"wdform-page-button\" previous_checkable=\"false\"><div class=\"wdform_section\"><div class=\"wdform_column\"><div wdid=\"2\" class=\"wdform_row\">%2 - What is your employment status?%</div><div wdid=\"3\" class=\"wdform_row\">%3 - What is your level of education?%</div><div wdid=\"4\" class=\"wdform_row\">%4 - In which industry do you work?%</div><div wdid=\"6\" class=\"wdform_row\">%6 - What is the annual revenue of your company?%</div><div wdid=\"5\" class=\"wdform_row\">%5 - Enter characters for verification.%</div><div wdid=\"1\" class=\"wdform_row\">%1 - type_submit_reset_1%</div></div></div><div valign=\"top\" class=\"wdform_footer wd-width-100\"><div class=\"wd-width-100\"><div class=\"wd-width-100 wd-table\" style=\"padding-top:10px;\"><div class=\"wd-table-group\"><div id=\"form_id_temppage_nav1\" class=\"wd-table-row\"></div></div></div></div></div></div></div>', '4', '// Occurs before the form is loaded\r\nfunction before_load() { \r\n} \r\n// Occurs just before submitting the form\r\nfunction before_submit() {\r\n // IMPORTANT! If you want to interrupt (stop) the submitting of the form, this function should return true. You don\'t need to return any value if you don\'t want to stop the submission.\r\n} \r\n// Occurs just before resetting the form\r\nfunction before_reset() { \r\n}// Occurs after form is submitted and reloaded\r\nfunction after_submit() {\r\n \r\n}', '', '', '1', '{all}', '{all}', '7', '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#****#6#**id**#What is the annual revenue of your company?#**label**#type_radio#****#5#**id**#Enter characters for verification.#**label**#type_captcha#****#1#**id**#type_submit_reset_1#**label**#type_submit_reset#****#6_elementform_id_temp0#**id**#What is your employment status?#**label**#type_radio#****#6_elementform_id_temp1#**id**#What is your level of education?#**label**#type_radio#****#6_elementform_id_temp2#**id**#In which industry do you work?#**label**#type_own_select#****#6_elementform_id_temp3#**id**#Enter characters for verification.#**label**#type_captcha#****#6_elementform_id_temp4#**id**#type_submit_reset_1#**label**#type_submit_reset#****#6_elementform_id_temp5#**id**#type_submit_reset_1#**label**#type_submit_reset#****#6_elementform_id_temp6#**id**##**label**##****#6_elementform_id_temp7#**id**#undefined#**label**#undefined#****#6_elementform_id_temp8#**id**#undefined#**label**#undefined#****#6_elementform_id_temp9#**id**#undefined#**label**#undefined#****#6_elementform_id_temp10#**id**#undefined#**label**#undefined#****#6_elementform_id_temp11#**id**#undefined#**label**#undefined#****#6_elementform_id_temp12#**id**#undefined#**label**#undefined#****#6_elementform_id_temp13#**id**#undefined#**label**#undefined#****#6_elementform_id_temp14#**id**#undefined#**label**#undefined#****#6_elementform_id_temp15#**id**#undefined#**label**#undefined#****#6_elementform_id_temp16#**id**#undefined#**label**#undefined#****#6_elementform_id_temp17#**id**#undefined#**label**#undefined#****#6_elementform_id_temp18#**id**#undefined#**label**#undefined#****#6_elementform_id_temp19#**id**#undefined#**label**#undefined#****#6_elementform_id_temp20#**id**#undefined#**label**#undefined#****#6_elementform_id_temp21#**id**#undefined#**label**#undefined#****#6_elementform_id_temp22#**id**#undefined#**label**#undefined#****#6_elementform_id_temp23#**id**#undefined#**label**#undefined#****#6_elementform_id_temp24#**id**#undefined#**label**#undefined#****#6_elementform_id_temp25#**id**#undefined#**label**#undefined#****#6_elementform_id_temp26#**id**#undefined#**label**#undefined#****#6_elementform_id_temp27#**id**#undefined#**label**#undefined#****#6_elementform_id_temp28#**id**#undefined#**label**#undefined#****#6_elementform_id_temp29#**id**#undefined#**label**#undefined#****#6_elementform_id_temp30#**id**#undefined#**label**#undefined#****#6_elementform_id_temp31#**id**#undefined#**label**#undefined#****#6_elementform_id_temp32#**id**#undefined#**label**#undefined#****#6_elementform_id_temp33#**id**#undefined#**label**#undefined#****#6_elementform_id_temp34#**id**#undefined#**label**#undefined#****#6_elementform_id_temp35#**id**#undefined#**label**#undefined#****#6_elementform_id_temp36#**id**#undefined#**label**#undefined#****#6_elementform_id_temp37#**id**#undefined#**label**#undefined#****#6_elementform_id_temp38#**id**#undefined#**label**#undefined#****#6_elementform_id_temp39#**id**#undefined#**label**#undefined#****#6_elementform_id_temp40#**id**#undefined#**label**#undefined#****#6_elementform_id_temp41#**id**#undefined#**label**#undefined#****#6_elementform_id_temp42#**id**#undefined#**label**#undefined#****#6_elementform_id_temp43#**id**#undefined#**label**#undefined#****#6_elementform_id_temp44#**id**#undefined#**label**#undefined#****#6_elementform_id_temp45#**id**#undefined#**label**#undefined#****#6_elementform_id_temp46#**id**#undefined#**label**#undefined#****#6_elementform_id_temp47#**id**#undefined#**label**#undefined#****#6_elementform_id_temp48#**id**#undefined#**label**#undefined#****#6_elementform_id_temp49#**id**#undefined#**label**#undefined#****#', '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#****#6#**id**#What is the annual revenue of your company?#**label**#type_radio#****#5#**id**#Enter characters for verification.#**label**#type_captcha#****#1#**id**#type_submit_reset_1#**label**#type_submit_reset#****#', '0', 'none', '', '1', '', '', '', '0', 'testmode', '', '', '0', '2*:*id*:*type_radio*:*type*:*What is your employment status?*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*right*:*w_field_option_pos*:*no*:*w_hide_label*:*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*:*no*:*w_value_disabled*:*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_value*:***********************:*w_choices_params*:**:*w_class*:**:*new_field*:*3*:*id*:*type_radio*:*type*:*What is your level of education?*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*right*:*w_field_option_pos*:*no*:*w_hide_label*:*ver*:*w_flow*:*Some high school***High school graduate or equivalent***Trade or Vocational Degree***Some college***Associate degree***Bachelor\'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*:*no*:*w_value_disabled*:*Some high school***High school graduate or equivalent***Trade or Vocational Degree***Some college***Associate degree***Bachelor\'s degree***Graduate or Professional degree***Prefer not to answer*:*w_choices_value*:***********************:*w_choices_params*:**:*w_class*:**:*new_field*:*4*:*id*:*type_own_select*:*type*:*In which industry do you work?*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:**:*w_size*:*Select industry***Agriculture***Engineering***Information Technologies***Media***Local Business*:*w_choices*:*true***false***false***false***false***false*:*w_choices_checked*:*true***false***false***false***false***false*:*w_choices_disabled*:*no*:*w_required*:*no*:*w_value_disabled*:****Agriculture***Engineering***Information Technologies***Media***Local Business*:*w_choices_value*:*****************:*w_choices_params*:*wdform_select*:*w_class*:**:*new_field*:*6*:*id*:*type_radio*:*type*:*What is the annual revenue of your company?*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*right*:*w_field_option_pos*:*no*:*w_hide_label*:*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*:*no*:*w_value_disabled*:*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_value*:**************************:*w_choices_params*:**:*w_class*:**:*new_field*:*5*:*id*:*type_captcha*:*type*:*Enter characters for verification.*:*w_field_label*:**:*w_field_label_size*:*left*:*w_field_label_pos*:*yes*:*w_hide_label*:*6*:*w_digit*:**:*w_class*:**:*new_field*:*1*:*id*:*type_submit_reset*:*type*:*type_submit_reset_1*:*w_field_label*:*Submit*:*w_submit_title*:*Reset*:*w_reset_title*:**:*w_class*:*false*:*w_act*:**:*new_field*:*', '1', '1', '*', '{adminemail}', '', '', '', '1', '', '{adminemail}', '', '', '', '', '', '', '', '', '', '1', '1', '1', '1', 'administrator,', '1', '', '', '0', '0', '0', '0', '1', 'Business Demographic Survey', 'Thank you for joining our business demographic survey. Please give us your feedback by filling in the information bellow.', '', 'none', '1', '0', '');");
308
  $insert_form_id[] = $wpdb->insert_id;
309
+ $wpdb->query("INSERT INTO `" . $wpdb->prefix . "formmaker` (`id`, `title`, `type`, `mail`, `form_front`, `theme`, `javascript`, `submit_text`, `url`, `submit_text_type`, `script_mail`, `script_mail_user`, `counter`, `published`, `label_order`, `label_order_current`, `article_id`, `pagination`, `show_title`, `show_numbers`, `public_key`, `private_key`, `recaptcha_theme`, `paypal_mode`, `checkout_mode`, `paypal_email`, `payment_currency`, `tax`, `form_fields`, `savedb`, `sendemail`, `requiredmark`, `from_mail`, `from_name`, `reply_to`, `send_to`, `autogen_layout`, `custom_front`, `mail_from_user`, `mail_from_name_user`, `reply_to_user`, `condition`, `mail_cc`, `mail_cc_user`, `mail_bcc`, `mail_bcc_user`, `mail_subject`, `mail_subject_user`, `mail_mode`, `mail_mode_user`, `mail_attachment`, `mail_attachment_user`, `user_id_wd`, `sortable`, `frontend_submit_fields`, `frontend_submit_stat_fields`, `mail_emptyfields`, `mail_verify`, `mail_verify_expiretime`, `mail_verification_post_id`, `save_uploads`, `header_title`, `header_description`, `header_image_url`, `header_image_animation`, `header_hide_image`, `jsversion`, `privacy`) VALUES (NULL, 'Cupcake Order Form', 'embedded', '{adminemail}', '<div class=\"wdform-page-and-images\"><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=\"true\" previous_title=\"Previous\" previous_type=\"text\" previous_class=\"wdform-page-button\" previous_checkable=\"false\"><div class=\"wdform_section\"><div class=\"wdform_column\"><div wdid=\"2\" class=\"wdform_row\">%2 - Name%</div><div wdid=\"3\" class=\"wdform_row\">%3 - Email%</div><div wdid=\"4\" class=\"wdform_row\">%4 - Date%</div><div wdid=\"5\" class=\"wdform_row\">%5 - Cupcakes Flavors (1 doz. minimum)%</div><div wdid=\"6\" class=\"wdform_row\">%6 - Quantity%</div><div wdid=\"7\" class=\"wdform_row\">%7 - Details (if any)%</div><div wdid=\"1\" class=\"wdform_row\">%1 - type_submit_reset_1%</div></div></div><div valign=\"top\" class=\"wdform_footer wd-width-100\"><div class=\"wd-width-100\"><div class=\"wd-width-100 wd-table\" style=\"padding-top:10px;\"><div class=\"wd-table-group\"><div id=\"form_id_temppage_nav1\" class=\"wd-table-row\"></div></div></div></div></div></div></div>', '6', '// Occurs before the form is loaded\r\nfunction before_load() { \r\n} \r\n// Occurs just before submitting the form\r\nfunction before_submit() {\r\n // IMPORTANT! If you want to interrupt (stop) the submitting of the form, this function should return true. You don\'t need to return any value if you don\'t want to stop the submission.\r\n} \r\n// Occurs just before resetting the form\r\nfunction before_reset() { \r\n}// Occurs after form is submitted and reloaded\r\nfunction after_submit() {\r\n \r\n}', '', '', '1', '{all}', '{all}', '8', '1', '2#**id**#Name#**label**#type_name#****#3#**id**#Email#**label**#type_submitter_mail#****#4#**id**#Date#**label**#type_date_new#****#5#**id**#Cupcakes Flavors (1 doz. minimum)#**label**#type_radio#****#6#**id**#Quantity#**label**#type_spinner#****#7#**id**#Details (if any)#**label**#type_textarea#****#1#**id**#type_submit_reset_1#**label**#type_submit_reset#****#5_elementform_id_temp0#**id**#Name#**label**#type_name#****#5_elementform_id_temp1#**id**#Email#**label**#type_submitter_mail#****#5_elementform_id_temp2#**id**#Date#**label**#type_date_new#****#5_elementform_id_temp3#**id**#Name:* Email:* Date* Cupcakes Flavors (1 doz. minimum)#**label**#type_radio#****#5_elementform_id_temp4#**id**#Quantity#**label**#type_spinner#****#5_elementform_id_temp5#**id**#Details (if any)#**label**#type_textarea#****#5_elementform_id_temp6#**id**#type_submit_reset_1#**label**#type_submit_reset#****#5_elementform_id_temp7#**id**#Name#**label**#type_name#****#5_elementform_id_temp8#**id**#Email#**label**#type_submitter_mail#****#5_elementform_id_temp9#**id**#Date#**label**#type_date_new#****#5_elementform_id_temp10#**id**#type_submit_reset_1#**label**#type_submit_reset#****#5_elementform_id_temp11#**id**#type_submit_reset_1#**label**#type_submit_reset#****#5_elementform_id_temp12#**id**#undefined#**label**#undefined#****#5_elementform_id_temp13#**id**#undefined#**label**#undefined#****#5_elementform_id_temp14#**id**#undefined#**label**#undefined#****#5_elementform_id_temp15#**id**#undefined#**label**#undefined#****#5_elementform_id_temp16#**id**#undefined#**label**#undefined#****#5_elementform_id_temp17#**id**#undefined#**label**#undefined#****#5_elementform_id_temp18#**id**#undefined#**label**#undefined#****#5_elementform_id_temp19#**id**#undefined#**label**#undefined#****#5_elementform_id_temp20#**id**#undefined#**label**#undefined#****#5_elementform_id_temp21#**id**#undefined#**label**#undefined#****#5_elementform_id_temp22#**id**#undefined#**label**#undefined#****#5_elementform_id_temp23#**id**#undefined#**label**#undefined#****#5_elementform_id_temp24#**id**#undefined#**label**#undefined#****#5_elementform_id_temp25#**id**#undefined#**label**#undefined#****#5_elementform_id_temp26#**id**#undefined#**label**#undefined#****#5_elementform_id_temp27#**id**#undefined#**label**#undefined#****#5_elementform_id_temp28#**id**#undefined#**label**#undefined#****#5_elementform_id_temp29#**id**#undefined#**label**#undefined#****#5_elementform_id_temp30#**id**#undefined#**label**#undefined#****#5_elementform_id_temp31#**id**#undefined#**label**#undefined#****#5_elementform_id_temp32#**id**#undefined#**label**#undefined#****#5_elementform_id_temp33#**id**#undefined#**label**#undefined#****#5_elementform_id_temp34#**id**#undefined#**label**#undefined#****#5_elementform_id_temp35#**id**#undefined#**label**#undefined#****#5_elementform_id_temp36#**id**#undefined#**label**#undefined#****#5_elementform_id_temp37#**id**#undefined#**label**#undefined#****#5_elementform_id_temp38#**id**#undefined#**label**#undefined#****#5_elementform_id_temp39#**id**#undefined#**label**#undefined#****#5_elementform_id_temp40#**id**#undefined#**label**#undefined#****#5_elementform_id_temp41#**id**#undefined#**label**#undefined#****#5_elementform_id_temp42#**id**#undefined#**label**#undefined#****#5_elementform_id_temp43#**id**#undefined#**label**#undefined#****#5_elementform_id_temp44#**id**#undefined#**label**#undefined#****#5_elementform_id_temp45#**id**#undefined#**label**#undefined#****#5_elementform_id_temp46#**id**#undefined#**label**#undefined#****#5_elementform_id_temp47#**id**#undefined#**label**#undefined#****#5_elementform_id_temp48#**id**#undefined#**label**#undefined#****#5_elementform_id_temp49#**id**#undefined#**label**#undefined#****#', '2#**id**#Name#**label**#type_name#****#3#**id**#Email#**label**#type_submitter_mail#****#4#**id**#Date#**label**#type_date_new#****#5#**id**#Cupcakes Flavors (1 doz. minimum)#**label**#type_radio#****#6#**id**#Quantity#**label**#type_spinner#****#7#**id**#Details (if any)#**label**#type_textarea#****#1#**id**#type_submit_reset_1#**label**#type_submit_reset#****#', '0', 'none', '', '1', '', '', '', '0', 'testmode', '', '', '0', '2*:*id*:*type_name*:*type*:*Name*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:***********:*w_first_val*:***********:*w_title*:*Title*********Middle*:*w_mini_labels*:**:*w_size*:*normal*:*w_name_format*:*yes*:*w_required*:*no*:*w_unique*:**:*w_class*:*no***no*:*w_name_fields*:*no*:*w_autofill*:**:*new_field*:*3*:*id*:*type_submitter_mail*:*type*:*Email*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:**:*w_size*:**:*w_first_val*:**:*w_title*:*yes*:*w_required*:*no*:*w_unique*:**:*w_class*:*no*:*w_verification*:*Email confirmation*:*w_verification_label*:**:*w_verification_placeholder*:*no*:*w_autofill*:**:*new_field*:*4*:*id*:*type_date_new*:*type*:*Date*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:**:*w_size*:**:*w_date*:*yes*:*w_required*:*yes*:*w_show_image*:**:*w_class*:*mm/dd/yy*:*w_format*:*0*:*w_start_day*:**:*w_default_date*:**:*w_min_date*:**:*w_max_date*:**:*w_invalid_dates*:*yes***yes***yes***yes***yes***yes***yes*:*w_show_days*:*yes*:*w_hide_time*:*...*:*w_but_val*:*no*:*w_disable_past_days*:**:*new_field*:*5*:*id*:*type_radio*:*type*:*Cupcakes Flavors (1 doz. minimum)*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*right*:*w_field_option_pos*:*no*:*w_hide_label*:*ver*:*w_flow*:*Red Velvet***Vanilla***Chocolate***Guinness***Coconut***Lemon***Chocolate Mint*:*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*:*no*:*w_value_disabled*:*Red Velvet***Vanilla***Chocolate***Guinness***Coconut***Lemon***Chocolate Mint*:*w_choices_value*:********************:*w_choices_params*:**:*w_class*:**:*new_field*:*6*:*id*:*type_spinner*:*type*:*Quantity*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:*60*:*w_field_width*:**:*w_field_min_value*:**:*w_field_max_value*:*1*:*w_field_step*:*null*:*w_field_value*:*no*:*w_required*:**:*w_class*:**:*new_field*:*7*:*id*:*type_textarea*:*type*:*Details (if any)*:*w_field_label*:**:*w_field_label_size*:*top*:*w_field_label_pos*:*no*:*w_hide_label*:**:*w_size_w*:*100*:*w_size_h*:**:*w_first_val*:**:*w_title*:*no*:*w_required*:*no*:*w_unique*:**:*w_class*:**:*new_field*:*1*:*id*:*type_submit_reset*:*type*:*type_submit_reset_1*:*w_field_label*:*Submit*:*w_submit_title*:*Reset*:*w_reset_title*:**:*w_class*:*false*:*w_act*:**:*new_field*:*', '1', '1', '*', '{adminemail}', '', '', '', '1', '', '{adminemail}', '', '', '', '', '', '', '', '', '', '1', '1', '1', '1', 'administrator,', '1', '', '', '0', '0', '0', '0', '1', 'Cupcake Order Form', '', '', 'none', '1', '0', '');");
310
  $insert_form_id[] = $wpdb->insert_id;
311
  }
312
  else {
form_maker_update.php CHANGED
@@ -9,6 +9,7 @@ class WDFMUpdate {
9
  *
10
  * @param $version
11
  */
 
12
  public static function form_maker_update($version) {
13
  global $wpdb;
14
  if (version_compare($version, '1.7.0') == -1) {
@@ -254,6 +255,10 @@ class WDFMUpdate {
254
  ) DEFAULT CHARSET=utf8 AUTO_INCREMENT=" . $group_id;
255
  $wpdb->query($formmaker_groups);
256
  }
 
 
 
 
257
  return;
258
  }
259
  }
9
  *
10
  * @param $version
11
  */
12
+ //TODO. $version is undefine need set default value.
13
  public static function form_maker_update($version) {
14
  global $wpdb;
15
  if (version_compare($version, '1.7.0') == -1) {
255
  ) DEFAULT CHARSET=utf8 AUTO_INCREMENT=" . $group_id;
256
  $wpdb->query($formmaker_groups);
257
  }
258
+ if (version_compare($version, '1.12.31') == -1) {
259
+ $wpdb->query("ALTER TABLE `" . $wpdb->prefix . "formmaker` ADD `privacy` longtext NOT NULL DEFAULT ''");
260
+ $wpdb->query("ALTER TABLE `" . $wpdb->prefix . "formmaker_backup` ADD `privacy` longtext NOT NULL DEFAULT ''");
261
+ }
262
  return;
263
  }
264
  }
framework/WDW_FM_Library.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  class WDW_FM_Library {
4
  /**
5
  * PLUGIN = 2 points to Contact Form Maker
@@ -916,7 +915,7 @@ class WDW_FM_Library {
916
  $row->scrollbox_closing = 1;
917
  $row->scrollbox_minimize = 1;
918
  $row->scrollbox_minimize_text = '';
919
- $row->display_on = 'everything';
920
  $row->posts_include = '';
921
  $row->pages_include = '';
922
  $row->display_on_categories = '';
@@ -3896,12 +3895,16 @@ class WDW_FM_Library {
3896
  function onsubmit_js<?php echo $form_id ?>() {
3897
  <?php echo $onsubmit_js; ?>
3898
  }
3899
- jQuery(window).load(function () {
3900
- formOnload(<?php echo $form_id ?>);
 
 
3901
  });
3902
  form_view_count<?php echo $form_id ?> = 0;
3903
  jQuery(document).ready(function () {
3904
- fm_document_ready(<?php echo $form_id ?>);
 
 
3905
  });
3906
  <?php
3907
  $js_content = ob_get_clean();
@@ -3917,48 +3920,29 @@ class WDW_FM_Library {
3917
  * @return array
3918
  */
3919
  public static function get_submissions_to_export() {
3920
- global $wpdb;
3921
- $is_paypal_info = FALSE;
3922
- $params = array();
3923
- $group_id_s = array();
3924
- $form_id = (int) $_REQUEST['form_id'];
3925
- $limitstart = (int) $_REQUEST['limitstart'];
3926
- $search_labels = WDW_FM_Library(self::PLUGIN)->get('search_labels', '');
3927
- $verified_emails = isset($_REQUEST['verified_emails']) ? json_decode(stripslashes($_REQUEST['verified_emails']), TRUE) : array();
3928
- $paypal_info_fields = array(
3929
- 'currency',
3930
- 'ord_last_modified',
3931
- 'status',
3932
- 'full_name',
3933
- 'fax',
3934
- 'mobile_phone',
3935
- 'email',
3936
- 'phone',
3937
- 'address',
3938
- 'paypal_info',
3939
- 'ipn',
3940
- 'tax',
3941
- 'shipping',
3942
- );
3943
- $paypal_info_labels = array(
3944
- 'Currency',
3945
- 'Last modified',
3946
- 'Status',
3947
- 'Full Name',
3948
- 'Fax',
3949
- 'Mobile phone',
3950
- 'Email',
3951
- 'Phone',
3952
- 'Address',
3953
- 'Paypal info',
3954
- 'IPN',
3955
- 'Tax',
3956
- 'Shipping',
3957
- );
3958
- if ( $search_labels ) {
3959
- $query = $wpdb->prepare("SELECT distinct group_id FROM " . $wpdb->prefix . "formmaker_submits where form_id=%d and group_id IN(" . $search_labels . ")", $form_id);
3960
- $group_id_s = $wpdb->get_col($query);
3961
- }
3962
  $query = $wpdb->prepare("SELECT distinct element_label FROM " . $wpdb->prefix . "formmaker_submits where form_id=%d", $form_id);
3963
  $labels = $wpdb->get_col($query);
3964
  $query_lable = $wpdb->prepare("SELECT label_order,title FROM " . $wpdb->prefix . "formmaker where id=%d", $form_id);
@@ -3999,15 +3983,14 @@ class WDW_FM_Library {
3999
  $m = count($sorted_labels);
4000
  $wpdb->query("SET SESSION group_concat_max_len = 1000000");
4001
  $rows = array();
4002
- if ( $search_labels ) {
4003
- $query = $wpdb->prepare("SELECT group_id, ip, date, user_id_wd, GROUP_CONCAT( element_label SEPARATOR ',') as element_label, GROUP_CONCAT( element_value SEPARATOR '*:*el_value*:*') as element_value FROM " . $wpdb->prefix . "formmaker_submits where form_id= %d and group_id IN(" . $search_labels . ") GROUP BY group_id ORDER BY date ASC limit %d, %d", $form_id, $limitstart, 1000);
4004
- $rows = $wpdb->get_results($query, OBJECT_K);
4005
  }
4006
  $data = array();
4007
- $group_id_s_count = $limitstart + 1000 < count($group_id_s) ? $limitstart + 1000 : count($group_id_s);
4008
- sort($group_id_s, SORT_NUMERIC);
4009
- for ( $www = $limitstart; $www < $group_id_s_count; $www++ ) {
4010
- $i = $group_id_s[$www];
4011
  $field_key = array_search($i, $label_id);
4012
  if ( $label_type[$field_key] != 'type_arithmetic_captcha'
4013
  && $label_type[$field_key] != 'type_stripe' ) {
@@ -4177,19 +4160,19 @@ class WDW_FM_Library {
4177
  if ( $is_paypal_info ) {
4178
  foreach ( $paypal_info_fields as $key => $paypal_info_field ) {
4179
  if ( $paypal_info ) {
4180
- $data_temp['PAYPAL_' . $paypal_info_labels[$key]] = $paypal_info[0]->$paypal_info_field;
4181
  }
4182
  else {
4183
- $data_temp['PAYPAL_' . $paypal_info_labels[$key]] = '';
4184
  }
4185
  }
4186
  }
4187
  $data[$i] = $data_temp;
4188
  }
4189
  }
4190
- array_push($params, $data);
4191
- array_push($params, $title);
4192
- array_push($params, $is_paypal_info);
4193
 
4194
  return $params;
4195
  }
@@ -4205,7 +4188,7 @@ class WDW_FM_Library {
4205
  $title = ($title != '') ? strtolower($title) : 'items';
4206
  ob_start();
4207
  ?><tr class="no-items">
4208
- <td class="colspanchange" colspan="0"><?php echo sprintf(__('No %s found.', WDFMInstance(self::PLUGIN)->prefix), $title); ?></td>
4209
  </tr><?php
4210
  return ob_get_clean();
4211
  }
@@ -5101,6 +5084,122 @@ class WDW_FM_Library {
5101
  @session_start();
5102
  }
5103
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5104
  }
5105
 
5106
  /*
1
  <?php
 
2
  class WDW_FM_Library {
3
  /**
4
  * PLUGIN = 2 points to Contact Form Maker
915
  $row->scrollbox_closing = 1;
916
  $row->scrollbox_minimize = 1;
917
  $row->scrollbox_minimize_text = '';
918
+ $row->display_on = 'home,post,page';
919
  $row->posts_include = '';
920
  $row->pages_include = '';
921
  $row->display_on_categories = '';
3895
  function onsubmit_js<?php echo $form_id ?>() {
3896
  <?php echo $onsubmit_js; ?>
3897
  }
3898
+ jQuery(window).on('load', function () {
3899
+ if (jQuery('form#form<?php echo $form_id ?> .wdform_section').length > 0) {
3900
+ formOnload(<?php echo $form_id ?>);
3901
+ }
3902
  });
3903
  form_view_count<?php echo $form_id ?> = 0;
3904
  jQuery(document).ready(function () {
3905
+ if (jQuery('form#form<?php echo $form_id ?> .wdform_section').length > 0) {
3906
+ fm_document_ready(<?php echo $form_id ?>);
3907
+ }
3908
  });
3909
  <?php
3910
  $js_content = ob_get_clean();
3920
  * @return array
3921
  */
3922
  public static function get_submissions_to_export() {
3923
+ global $wpdb;
3924
+ $params = array();
3925
+ $form_id = (int) $_REQUEST['form_id'];
3926
+ $limitstart = (int) $_REQUEST['limitstart'];
3927
+ $page_num = (int) $_REQUEST['page_num'];
3928
+ $search_labels = isset($_REQUEST['search_labels']) ? $_REQUEST['search_labels'] : '';
3929
+ $groupids = !empty($_REQUEST['groupids']) ? explode(',', $_REQUEST['groupids']) : '';
3930
+ $verified_emails = isset($_REQUEST['verified_emails']) ? json_decode(stripslashes($_REQUEST['verified_emails']), TRUE) : array();
3931
+ $paypal_info_fields = array(
3932
+ 'currency' => 'Currency',
3933
+ 'ord_last_modified' => 'Last modified',
3934
+ 'status' => 'Status',
3935
+ 'full_name' => 'Full Name',
3936
+ 'fax' => 'Fax',
3937
+ 'mobile_phone' => 'Mobile phone',
3938
+ 'email' => 'Email',
3939
+ 'phone' => 'Phone',
3940
+ 'address' => 'Address',
3941
+ 'paypal_info' => 'Paypal info',
3942
+ 'ipn' => 'IPN',
3943
+ 'tax' => 'Tax',
3944
+ 'shipping' => 'Shipping'
3945
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3946
  $query = $wpdb->prepare("SELECT distinct element_label FROM " . $wpdb->prefix . "formmaker_submits where form_id=%d", $form_id);
3947
  $labels = $wpdb->get_col($query);
3948
  $query_lable = $wpdb->prepare("SELECT label_order,title FROM " . $wpdb->prefix . "formmaker where id=%d", $form_id);
3983
  $m = count($sorted_labels);
3984
  $wpdb->query("SET SESSION group_concat_max_len = 1000000");
3985
  $rows = array();
3986
+ if ( !empty($groupids) ) {
3987
+ $query = $wpdb->prepare("SELECT `group_id`, `ip`, `date`, `user_id_wd`, GROUP_CONCAT( element_label SEPARATOR ',') AS `element_label`, GROUP_CONCAT( element_value SEPARATOR '*:*el_value*:*') AS `element_value` FROM " . $wpdb->prefix . "formmaker_submits WHERE `form_id` = %d and `group_id` IN(" . implode($groupids,',') . ") GROUP BY `group_id` ORDER BY `date` ASC", $form_id);
3988
+ $rows = $wpdb->get_results($query, OBJECT_K);
3989
  }
3990
  $data = array();
3991
+ $is_paypal_info = FALSE;
3992
+ for ( $www = 0; $www < count($groupids); $www++ ) {
3993
+ $i = $groupids[$www];
 
3994
  $field_key = array_search($i, $label_id);
3995
  if ( $label_type[$field_key] != 'type_arithmetic_captcha'
3996
  && $label_type[$field_key] != 'type_stripe' ) {
4160
  if ( $is_paypal_info ) {
4161
  foreach ( $paypal_info_fields as $key => $paypal_info_field ) {
4162
  if ( $paypal_info ) {
4163
+ $data_temp['PAYPAL_' . $paypal_info_field ] = $paypal_info[0]->$key;
4164
  }
4165
  else {
4166
+ $data_temp['PAYPAL_' . $paypal_info_field ] = '';
4167
  }
4168
  }
4169
  }
4170
  $data[$i] = $data_temp;
4171
  }
4172
  }
4173
+ array_push($params, $data);
4174
+ array_push($params, $title);
4175
+ array_push($params, $is_paypal_info);
4176
 
4177
  return $params;
4178
  }
4188
  $title = ($title != '') ? strtolower($title) : 'items';
4189
  ob_start();
4190
  ?><tr class="no-items">
4191
+ <td class="colspanchange fm-column-not-hide" colspan="0"><?php echo sprintf(__('No %s found.', WDFMInstance(self::PLUGIN)->prefix), $title); ?></td>
4192
  </tr><?php
4193
  return ob_get_clean();
4194
  }
5084
  @session_start();
5085
  }
5086
  }
5087
+
5088
+ public static function not_display_posts() {
5089
+ return array('fmemailverification','cfmemailverification','form-maker','form-maker_fmc');
5090
+ }
5091
+
5092
+ public static function get_user_submission_ids( $email_address ) {
5093
+ global $wpdb;
5094
+ $user = get_user_by( 'email', $email_address );
5095
+ $query = 'SELECT DISTINCT submits.`form_id`, form.`title`, submits.`group_id` FROM ' . $wpdb->prefix . 'formmaker_submits as submits INNER JOIN ' . $wpdb->prefix . 'formmaker as form ON submits.form_id=form.id WHERE submits.`element_value`=\'' . $email_address . '\'' . ($user ? ' OR submits.`user_id_wd`=' . $user->ID : '') . (!WDFMInstance(self::PLUGIN)->is_free ? '' : ' AND submits.form_id' . (WDFMInstance(self::PLUGIN)->is_free == 1 ? ' NOT ' : ' ') . 'IN (' . (get_option( 'contact_form_forms', '' ) != '' ? get_option( 'contact_form_forms' ) : 0) . ')') . ' ORDER BY submits.`form_id`';
5096
+ $results = $wpdb->get_results($query);
5097
+ return $results;
5098
+ }
5099
+
5100
+ public static function get_submission_by_id( $group_id ) {
5101
+ global $wpdb;
5102
+ $query = 'SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits WHERE `group_id`=' . (int) $group_id;
5103
+ $results = $wpdb->get_results($query);
5104
+ return $results;
5105
+ }
5106
+
5107
+ public static function delete_user_submissions( $email_address ) {
5108
+ global $wpdb;
5109
+ $submission_ids = self::get_user_submission_ids( $email_address );
5110
+ $ids = array();
5111
+ foreach ($submission_ids as $id) {
5112
+ $ids[] = $id->group_id;
5113
+ }
5114
+ $ids = implode(',', $ids);
5115
+ $query = 'DELETE FROM ' . $wpdb->prefix . 'formmaker_sessions WHERE group_id IN (' . $ids . ')';
5116
+ $deleted = $wpdb->query($query);
5117
+ $query = 'DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN (' . $ids . ')';
5118
+ $deleted = $deleted || $wpdb->query($query);
5119
+ return $deleted;
5120
+ }
5121
+
5122
+ public static function privacy_personal_data_export ( $email_address, $page = 1 ) {
5123
+ $export_items = array();
5124
+
5125
+ $submission_ids = self::get_user_submission_ids( $email_address );
5126
+ if ($submission_ids) {
5127
+ require_once WDFMInstance(self::PLUGIN)->plugin_dir . '/admin/models/model.php';
5128
+ require_once WDFMInstance(self::PLUGIN)->plugin_dir . '/admin/models/Submissions_fm.php';
5129
+ $model_class = self::PLUGIN == 2 ? 'FMModelSubmissions_fmc' : 'FMModelSubmissions_fm';
5130
+ $model = new $model_class();
5131
+ $form_id = 0;
5132
+ $label_parameters = array();
5133
+ foreach ($submission_ids as $submission_id) {
5134
+ if ($submission_id->form_id != $form_id) {
5135
+ $form_id = $submission_id->form_id;
5136
+ $label_parameters = $model->get_labels_parameters($form_id);
5137
+ }
5138
+ $data = array();
5139
+ $submission = self::get_submission_by_id($submission_id->group_id);
5140
+ if ( $submission ) {
5141
+ $data[] = array(
5142
+ 'name' => __( 'Form Title', WDFMInstance(self::PLUGIN)->prefix ),
5143
+ 'value' => $submission_id->title
5144
+ );
5145
+ // Selecting this each time as any user could submit a data containing $email_address.
5146
+ $user = get_user_by( 'id', $submission[0]->user_id_wd );
5147
+ if ($user) {
5148
+ $data[] = array(
5149
+ 'name' => __( 'Submitter Name', WDFMInstance( self::PLUGIN )->prefix ),
5150
+ 'value' => $user->display_name
5151
+ );
5152
+ $data[] = array(
5153
+ 'name' => __( 'Submitter Email', WDFMInstance( self::PLUGIN )->prefix ),
5154
+ 'value' => $user->user_email
5155
+ );
5156
+ }
5157
+ $data[] = array(
5158
+ 'name' => __( 'Submitter IP', WDFMInstance(self::PLUGIN)->prefix ),
5159
+ 'value' => $submission[0]->ip
5160
+ );
5161
+ $data[] = array(
5162
+ 'name' => __( 'Submission Date', WDFMInstance(self::PLUGIN)->prefix ),
5163
+ 'value' => $submission[0]->date
5164
+ );
5165
+ foreach ( $submission as $row ) {
5166
+ $element_label = $label_parameters[3][array_search($row->element_label, $label_parameters[0])];
5167
+ $data[] = array(
5168
+ 'name' => $element_label,
5169
+ 'value' => $row->element_value
5170
+ );
5171
+ }
5172
+ }
5173
+
5174
+ $item_id = WDFMInstance(self::PLUGIN)->slug . '-submission-' . $submission_id->group_id;
5175
+ // This is nor submission group_id.
5176
+ $group_id = WDFMInstance(self::PLUGIN)->slug;
5177
+ $group_label = WDFMInstance(self::PLUGIN)->nicename . __( ' Submissions', WDFMInstance(self::PLUGIN)->prefix );
5178
+ $export_items[] = array(
5179
+ 'group_id' => $group_id,
5180
+ 'group_label' => $group_label,
5181
+ 'item_id' => $item_id,
5182
+ 'data' => $data,
5183
+ );
5184
+ }
5185
+ }
5186
+
5187
+ return array(
5188
+ 'data' => $export_items,
5189
+ 'done' => true,
5190
+ );
5191
+ }
5192
+
5193
+ public static function privacy_personal_data_erase( $email_address, $page = 1 ) {
5194
+ $items_removed = self::delete_user_submissions( $email_address );
5195
+
5196
+ return array(
5197
+ 'items_removed' => $items_removed,
5198
+ 'items_retained' => false,
5199
+ 'messages' => array(sprintf(__('All personal data and submissions of this user found in %s plugin were removed.', WDFMInstance(self::PLUGIN)->prefix), WDFMInstance(self::PLUGIN)->nicename)),
5200
+ 'done' => true,
5201
+ );
5202
+ }
5203
  }
5204
 
5205
  /*
frontend/controllers/form_maker.php CHANGED
@@ -33,24 +33,24 @@ class FMControllerForm_maker {
33
  /**
34
  * Execute.
35
  *
36
- * @param $id
37
  * @param string $type
38
  *
39
  * @return string|void
40
  */
41
- public function execute( $id, $type = 'embedded' ) {
42
  return $this->display($id, $type);
43
  }
44
 
45
  /**
46
  * Display.
47
  *
48
- * @param $id
49
- * @param $type
50
  *
51
  * @return string|void
52
  */
53
- public function display( $id, $type ) {
54
  $fm_settings = get_option(WDFMInstance(self::PLUGIN)->is_free == 2 ? 'fmc_settings' : 'fm_settings');
55
  if ( $type == 'embedded' ) {
56
  $result = $this->model->showform($id, $type);
@@ -67,12 +67,18 @@ class FMControllerForm_maker {
67
  else {
68
  // Get all forms.
69
  $forms = $this->model->all_forms();
70
-
71
  return $this->autoload_form($forms, $fm_settings);
72
  }
73
  }
74
 
75
- public function autoload_form($forms, $fm_settings) {
 
 
 
 
 
 
 
76
  $fm_forms = array();
77
 
78
  foreach ($forms as $key => $form) {
@@ -191,9 +197,17 @@ class FMControllerForm_maker {
191
  $this->model->remove($ok);
192
  }
193
  $this->model->increment_views_count($id);
194
-
195
- $form_html = $this->view->display($form_result, $fm_settings, $id, $type);
196
- $fm_forms[$id] = $this->view->autoload_form($id, $form, $type, $form_html, $display_on_this, $message, $error, $show_for_admin);
 
 
 
 
 
 
 
 
197
  }
198
 
199
  return implode($fm_forms);
33
  /**
34
  * Execute.
35
  *
36
+ * @param int $id
37
  * @param string $type
38
  *
39
  * @return string|void
40
  */
41
+ public function execute( $id = 0, $type = 'embedded' ) {
42
  return $this->display($id, $type);
43
  }
44
 
45
  /**
46
  * Display.
47
  *
48
+ * @param int $id
49
+ * @param string $type
50
  *
51
  * @return string|void
52
  */
53
+ public function display( $id = 0, $type = '' ) {
54
  $fm_settings = get_option(WDFMInstance(self::PLUGIN)->is_free == 2 ? 'fmc_settings' : 'fm_settings');
55
  if ( $type == 'embedded' ) {
56
  $result = $this->model->showform($id, $type);
67
  else {
68
  // Get all forms.
69
  $forms = $this->model->all_forms();
 
70
  return $this->autoload_form($forms, $fm_settings);
71
  }
72
  }
73
 
74
+ /**
75
+ * Autoload form.
76
+ *
77
+ * @param array $forms
78
+ * @param array $fm_settings
79
+ * @return string
80
+ */
81
+ public function autoload_form( $forms = array(), $fm_settings = array() ) {
82
  $fm_forms = array();
83
 
84
  foreach ($forms as $key => $form) {
197
  $this->model->remove($ok);
198
  }
199
  $this->model->increment_views_count($id);
200
+ $params = array();
201
+ $params['id'] = $id;
202
+ $params['type'] = $type;
203
+ $params['form'] = $form;
204
+ $params['display_on_this'] = $display_on_this;
205
+ $params['show_for_admin'] = $show_for_admin;
206
+ $params['form_result'] = $form_result;
207
+ $params['fm_settings'] = $fm_settings;
208
+ $params['error'] = $error;
209
+ $params['message'] = $message;
210
+ $fm_forms[$id] = $this->view->autoload_form( $params );
211
  }
212
 
213
  return implode($fm_forms);
frontend/models/form_maker.php CHANGED
@@ -19,7 +19,7 @@ class FMModelForm_maker {
19
  *
20
  * @return array
21
  */
22
- public function showform( $id, $type = 'embedded' ) {
23
  global $wpdb;
24
  $row = $wpdb->get_row( $wpdb->prepare( 'SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"' . (!WDFMInstance(self::PLUGIN)->is_free ? '' : ' AND id' . (WDFMInstance(self::PLUGIN)->is_free == 1 ? ' NOT ' : ' ') . 'IN (' . (get_option( 'contact_form_forms', '' ) != '' ? get_option( 'contact_form_forms' ) : 0) . ')'), $id ) );
25
 
@@ -101,7 +101,7 @@ class FMModelForm_maker {
101
  * @param $value
102
  * @param $key
103
  */
104
- public static function set_empty_values_transparent( &$value, $key ) {
105
  if ( strpos( $key, 'Color' ) > -1 ) {
106
  /*
107
  * New themes colorpicker conflict with others.
@@ -117,12 +117,12 @@ class FMModelForm_maker {
117
  }
118
 
119
  /**
120
- * @param $theme_id
121
- * @param $form_theme
122
  * @param bool $old
123
  * @param bool $force_rewrite
124
  */
125
- public function create_css( $theme_id, $form_theme, $old = TRUE, $force_rewrite = FALSE ) {
126
  $wp_upload_dir = wp_upload_dir();
127
  $frontend_dir = '/form-maker-frontend/';
128
  if ( !is_dir( $wp_upload_dir[ 'basedir' ] . $frontend_dir ) ) {
@@ -137,6 +137,10 @@ class FMModelForm_maker {
137
  if ( $theme_id && !$force_rewrite && file_exists( $frontend_css ) ) {
138
  return;
139
  }
 
 
 
 
140
  $prefixes = array(
141
  'HP',
142
  'AGP',
@@ -575,7 +579,7 @@ class FMModelForm_maker {
575
  '}';
576
 
577
  $css_content .= '.fm-form-container.fm-theme' . $theme_id . ' .fm-form .file-picker {' .
578
- (!empty( $form_theme[ 'OPFBgUrl' ] ) ? 'display: inline-block; width: 22px; height: 22px; background: url("' . WDFMInstance(self::PLUGIN)->plugin_url . '/' . $form_theme[ 'OPFBgUrl' ] . '");' : '') .
579
  (!empty( $form_theme[ 'OPFBGRepeat' ] ) ? 'background-repeat:' . $form_theme[ 'OPFBGRepeat' ] . ';' : '') .
580
  (!empty( $form_theme[ 'OPFPos1' ] ) ? 'background-position-x:' . $form_theme[ 'OPFPos1' ] . ';' : '') .
581
  (!empty( $form_theme[ 'OPFPos2' ] ) ? 'background-position-y:' . $form_theme[ 'OPFPos2' ] . ';' : '') .
@@ -689,7 +693,7 @@ class FMModelForm_maker {
689
  }
690
  $css_content .= '.fm-form-container.fm-theme' . $theme_id . ' .fm-form select {' .
691
  (!empty( $form_theme[ 'IPBGColor' ] ) ? 'background-color:' . $form_theme[ 'IPBGColor' ] . ';' : '') .
692
- (!empty( $form_theme[ 'SBPBackground' ] ) ? 'background-image: url("' . WDFMInstance(self::PLUGIN)->plugin_url . '/' . $form_theme[ 'SBPBackground' ] . '");' : '') .
693
  (!empty( $form_theme[ 'SBPBGRepeat' ] ) ? 'background-repeat:' . $form_theme[ 'SBPBGRepeat' ] . ';' : '') .
694
  (!empty( $form_theme[ 'SBPBackground' ] ) ? 'background-position-x: calc(100% - 8px);' : '') .
695
  (!empty( $form_theme[ 'SBPBackground' ] ) ? 'background-position-y: 50%;' : '') .
@@ -749,7 +753,7 @@ class FMModelForm_maker {
749
  (!empty( $form_theme[ 'MCCPHeight' ] ) ? 'height:' . $form_theme[ 'MCCPHeight' ] . 'px;' : '') .
750
  (!empty( $form_theme[ 'MCPMargin' ] ) ? 'margin:' . $form_theme[ 'MCCPMargin' ] . 'px;' : '') .
751
  (!empty( $form_theme[ 'MCCPBGColor' ] ) ? 'background-color:' . $form_theme[ 'MCCPBGColor' ] . ';' : '') .
752
- (!empty( $form_theme[ 'MCCPBackground' ] ) ? 'background-image: url("' . WDFMInstance(self::PLUGIN)->plugin_url . '/' . $form_theme[ 'MCCPBackground' ] . '");' : '') .
753
  (!empty( $form_theme[ 'MCCPBGRepeat' ] ) ? 'background-repeat:' . $form_theme[ 'MCCPBGRepeat' ] . ';' : '') .
754
  (!empty( $form_theme[ 'MCCPBGPos1' ] ) ? 'background-position-x:' . $form_theme[ 'MCCPBGPos1' ] . ';' : '') .
755
  (!empty( $form_theme[ 'MCCPBGPos2' ] ) ? 'background-position-y:' . $form_theme[ 'MCCPBGPos2' ] . ';' : '') .
@@ -1008,7 +1012,7 @@ class FMModelForm_maker {
1008
  content: \'\';
1009
  width: 16px;
1010
  height: 16px;
1011
- background:transparent url([SITE_ROOT]/images/themes/checkboxes/1.png) no-repeat;
1012
  background-size: 100%;
1013
  border-radius: 0px;
1014
  margin: 0px;
@@ -1054,19 +1058,19 @@ class FMModelForm_maker {
1054
  }
1055
  $theme = implode( '{', $body_or_classes_implode );
1056
  $theme = preg_replace( $pattern, ' ', $theme );
1057
- $css_content .= str_replace( '[SITE_ROOT]', WDFMInstance(self::PLUGIN)->plugin_url, $theme );
1058
  }
1059
  $this->fm_css_content = $css_content;
1060
  file_put_contents( $frontend_css, $css_content );
1061
  }
1062
 
1063
  /**
1064
- * @param $form
1065
- * @param $id
1066
  *
1067
  * @return array|mixed
1068
  */
1069
- public function savedata( $form, $id ) {
1070
  $fm_settings = get_option(WDFMInstance(self::PLUGIN)->is_free == 2 ? 'fmc_settings' : 'fm_settings');
1071
  $all_files = array();
1072
  $correct = FALSE;
@@ -1212,15 +1216,16 @@ class FMModelForm_maker {
1212
  }
1213
 
1214
  /**
1215
- * @param $db_info
1216
- * @param $label_column
1217
- * @param $table
1218
- * @param $where
1219
- * @param $order_by
1220
  *
1221
- * @return array|null|object
 
 
 
 
 
1222
  */
1223
- public function select_data_from_db_for_labels( $db_info, $label_column, $table, $where, $order_by ) {
1224
  global $wpdb;
1225
  $query = "SELECT `" . $label_column . "` FROM " . $table . $where . " ORDER BY " . $order_by;
1226
  $db_info = trim($db_info, '[]');
@@ -1244,15 +1249,17 @@ class FMModelForm_maker {
1244
  }
1245
 
1246
  /**
1247
- * @param $db_info
1248
- * @param $value_column
1249
- * @param $table
1250
- * @param $where
1251
- * @param $order_by
 
 
1252
  *
1253
  * @return array|null|object
1254
  */
1255
- public function select_data_from_db_for_values( $db_info, $value_column, $table, $where, $order_by ) {
1256
  global $wpdb;
1257
  $query = "SELECT `" . $value_column . "` FROM " . $table . $where . " ORDER BY " . $order_by;
1258
  $db_info = trim($db_info, '[]');
@@ -1276,11 +1283,12 @@ class FMModelForm_maker {
1276
  }
1277
 
1278
  /**
1279
- * @param $id
1280
  *
 
1281
  * @return array( 'error' => true, 'group_id' => $max, 'message' => '' ); in case of error | array('group_id' => $max, 'all_files' => '', 'redirect_url' => '')
1282
  */
1283
- public function save_db( $id ) {
1284
  global $wpdb;
1285
  $wp_userid = '';
1286
  $wp_username = '';
@@ -1306,6 +1314,17 @@ class FMModelForm_maker {
1306
  $adminemail = get_option('admin_email');
1307
  $current_page_url = WDW_FM_Library(self::PLUGIN)->get_current_page_url();
1308
  $form = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id= %d", $id ) );
 
 
 
 
 
 
 
 
 
 
 
1309
  $formtitle = $form->title;
1310
  if ( !$form->form_front ) {
1311
  $id = '';
@@ -1357,13 +1376,13 @@ class FMModelForm_maker {
1357
  $i = $label_id[ $key ];
1358
 
1359
  $missing_required_field = FALSE;
 
1360
  $required = (isset($params[$i]) && strpos($params[$i], '*:*yes*:*w_required*:*') !== FALSE ? 1 : 0);
1361
 
1362
  if ( !in_array( $i, $disabled_fields ) ) {
1363
  switch ( $type ) {
1364
  case 'type_text':
1365
  case 'type_password':
1366
- case "type_submitter_mail":
1367
  case "type_own_select":
1368
  case "type_country":
1369
  case "type_number":
@@ -1378,6 +1397,16 @@ class FMModelForm_maker {
1378
  }
1379
  break;
1380
  }
 
 
 
 
 
 
 
 
 
 
1381
  case "type_date": {
1382
  $value = isset( $_POST[ 'wdform_' . $i . "_element" . $id ] ) ? esc_html( $_POST[ 'wdform_' . $i . "_element" . $id ] ) : "";
1383
  $date_format = isset( $_POST[ 'wdform_' . $i . "_date_format" . $id ] ) ? esc_html( $_POST[ 'wdform_' . $i . "_date_format" . $id ] ) : "";
@@ -2025,6 +2054,9 @@ class FMModelForm_maker {
2025
  if ( $missing_required_field ) {
2026
  return array( 'error' => true, 'group_id' => $group_id, 'message' => addslashes( addslashes( sprintf( __( '%s field is required.', WDFMInstance(self::PLUGIN)->prefix ), $label_label[ $key ] ) ) ) );
2027
  }
 
 
 
2028
 
2029
  if ( $type == "type_address" ) {
2030
  if ( $value == '*#*#*#' ) {
@@ -2072,23 +2104,21 @@ class FMModelForm_maker {
2072
  }
2073
 
2074
  if ( $form->savedb ) {
2075
- $save_or_no = $wpdb->insert( $wpdb->prefix . "formmaker_submits", array(
2076
  'form_id' => $id,
2077
  'element_label' => $i,
2078
  'element_value' => stripslashes( $value ),
2079
  'group_id' => $group_id,
2080
  'date' => date( 'Y-m-d H:i:s' ),
2081
- 'ip' => $_SERVER[ 'REMOTE_ADDR' ],
2082
- 'user_id_wd' => $current_user->ID,
2083
- ), array(
2084
- '%d',
2085
- '%s',
2086
- '%s',
2087
- '%d',
2088
- '%s',
2089
- '%s',
2090
- '%d',
2091
- ) );
2092
  }
2093
  if ( !$save_or_no ) {
2094
  return array( 'error' => true, 'group_id' => $group_id, 'message' => addslashes( __( 'Database error occurred. Please try again.', WDFMInstance(self::PLUGIN)->prefix ) ) );
@@ -2164,23 +2194,23 @@ class FMModelForm_maker {
2164
  $business = $form->paypal_email;
2165
  $ip = $_SERVER[ 'REMOTE_ADDR' ];
2166
  $total2 = round( $total, 2 );
2167
- $save_or_no = $wpdb->insert( $wpdb->prefix . "formmaker_submits", array(
2168
- 'form_id' => $id,
2169
- 'element_label' => 'item_total',
2170
- 'element_value' => $form_currency . $total2,
2171
- 'group_id' => $group_id,
2172
- 'date' => date( 'Y-m-d H:i:s' ),
2173
- 'ip' => $ip,
2174
- 'user_id_wd' => $current_user->ID,
2175
- ), array(
2176
- '%d',
2177
- '%s',
2178
- '%s',
2179
- '%d',
2180
- '%s',
2181
- '%s',
2182
- '%d',
2183
- ) );
2184
  if ( !$save_or_no ) {
2185
  return array( 'error' => true, 'group_id' => $group_id, 'message' => addslashes( __( 'Database error occurred. Please try again.', WDFMInstance(self::PLUGIN)->prefix ) ) );
2186
  }
@@ -2189,43 +2219,21 @@ class FMModelForm_maker {
2189
  $total = $total + $paypal[ 'shipping' ];
2190
  }
2191
  $total = round( $total, 2 );
2192
- $save_or_no = $wpdb->insert( $wpdb->prefix . "formmaker_submits", array(
2193
- 'form_id' => $id,
2194
- 'element_label' => 'total',
2195
- 'element_value' => $form_currency . $total,
2196
- 'group_id' => $group_id,
2197
- 'date' => date( 'Y-m-d H:i:s' ),
2198
- 'ip' => $ip,
2199
- 'user_id_wd' => $current_user->ID,
2200
- ), array(
2201
- '%d',
2202
- '%s',
2203
- '%s',
2204
- '%d',
2205
- '%s',
2206
- '%s',
2207
- '%d',
2208
- ) );
2209
  if ( !$save_or_no ) {
2210
  return array( 'error' => true, 'group_id' => $group_id, 'message' => addslashes( __( 'Database error occurred. Please try again.', WDFMInstance(self::PLUGIN)->prefix ) ) );
2211
  }
2212
- $save_or_no = $wpdb->insert( $wpdb->prefix . "formmaker_submits", array(
2213
- 'form_id' => $id,
2214
- 'element_label' => '0',
2215
- 'element_value' => 'In progress',
2216
- 'group_id' => $group_id,
2217
- 'date' => date( 'Y-m-d H:i:s' ),
2218
- 'ip' => $ip,
2219
- 'user_id_wd' => $current_user->ID,
2220
- ), array(
2221
- '%d',
2222
- '%s',
2223
- '%s',
2224
- '%d',
2225
- '%s',
2226
- '%s',
2227
- '%d',
2228
- ) );
2229
  if ( !$save_or_no ) {
2230
  return array( 'error' => true, 'group_id' => $group_id, 'message' => addslashes( __( 'Database error occurred. Please try again.', WDFMInstance(self::PLUGIN)->prefix ) ) );
2231
  }
@@ -2279,23 +2287,23 @@ class FMModelForm_maker {
2279
  foreach ( $send_tos as $send_index => $send_to ) {
2280
  $_SESSION[ 'hash' ][] = md5( $ip . time() . rand() );
2281
  $send_to = str_replace( '*', '', $send_to );
2282
- $save_or_no = $wpdb->insert( $wpdb->prefix . "formmaker_submits", array(
 
2283
  'form_id' => $id,
2284
  'element_label' => 'verifyInfo@' . $send_to,
2285
  'element_value' => $_SESSION[ 'hash' ][ $send_index ] . "**" . $form->mail_verify_expiretime . "**" . $send_to,
2286
  'group_id' => $group_id,
2287
  'date' => date( 'Y-m-d H:i:s' ),
2288
- 'ip' => $ip,
2289
- 'user_id_wd' => $current_user->ID,
2290
- ), array(
2291
- '%d',
2292
- '%s',
2293
- '%s',
2294
- '%d',
2295
- '%s',
2296
- '%s',
2297
- '%d',
2298
- ) );
2299
  if ( !$save_or_no ) {
2300
  return array( 'error' => true, 'group_id' => $group_id, 'message' => addslashes( __( 'Database error occurred. Please try again.', WDFMInstance(self::PLUGIN)->prefix ) ) );
2301
  }
@@ -2331,7 +2339,9 @@ class FMModelForm_maker {
2331
 
2332
  do_action( 'fm_addon_frontend_init', $frontend_parmas );
2333
  }
2334
- return array( 'group_id' => $group_id, 'all_files' => $all_files, 'redirect_url' => $str );
 
 
2335
  }
2336
 
2337
  /**
@@ -2357,20 +2367,24 @@ class FMModelForm_maker {
2357
  }
2358
 
2359
  /**
2360
- * @param $group_id
 
 
2361
  */
2362
- public function remove( $group_id ) {
2363
  global $wpdb;
2364
  $wpdb->query( $wpdb->prepare( 'DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id= %d', $group_id ) );
2365
  }
2366
 
2367
  /**
2368
- * @param $form_id
2369
- * @param $group_id
 
 
2370
  *
2371
  * @return mixed|null|string
2372
  */
2373
- public function get_after_submission_text( $form_id, $group_id ) {
2374
  global $wpdb;
2375
  $submit_text = $wpdb->get_var( "SELECT submit_text FROM " . $wpdb->prefix . "formmaker WHERE id='" . $form_id . "'" );
2376
  $current_user = wp_get_current_user();
@@ -2437,9 +2451,11 @@ class FMModelForm_maker {
2437
  }
2438
 
2439
  /**
 
 
2440
  * @param $id
2441
  */
2442
- public function increment_views_count( $id ) {
2443
  global $wpdb;
2444
  $vives_form = $wpdb->get_var( $wpdb->prepare( "SELECT views FROM " . $wpdb->prefix . "formmaker_views WHERE form_id=%d", $id ) );
2445
  if ( isset( $vives_form ) ) {
@@ -2461,14 +2477,15 @@ class FMModelForm_maker {
2461
  }
2462
 
2463
  /**
2464
- * @param $group_id
2465
- * @param $all_files
2466
- * @param $id
2467
- * @param $str
2468
  *
 
 
 
 
2469
  * @return array
2470
  */
2471
- public function gen_mail( $group_id, $all_files, $id, $str ) {
2472
  global $wpdb;
2473
  WDW_FM_Library(self::PLUGIN)->start_session();
2474
  // checking save uploads option
@@ -2534,8 +2551,9 @@ class FMModelForm_maker {
2534
  }
2535
  $disabled_fields = explode( ',', WDW_FM_Library(self::PLUGIN)->get('disabled_fields', '') );
2536
  $disabled_fields = array_slice( $disabled_fields, 0, count( $disabled_fields ) - 1 );
2537
- $list = '<table border="1" cellpadding="3" cellspacing="0" style="width:600px;">';
2538
  $list_text_mode = '';
 
2539
  foreach ( $label_order_ids as $key => $label_order_id ) {
2540
  $i = $label_order_id;
2541
  $type = $label_type[ $i ];
@@ -2553,7 +2571,7 @@ class FMModelForm_maker {
2553
  case "type_phone_new": {
2554
  $element = isset( $_POST[ 'wdform_' . $i . "_element" . $id ] ) ? $_POST[ 'wdform_' . $i . "_element" . $id ] : NULL;
2555
  if ( isset( $element ) && $this->empty_field( $element, $row->mail_emptyfields ) ) {
2556
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td>' . $element . '</td></tr>';
2557
  $list_text_mode = $list_text_mode . $element_label . ' - ' . $element . "\r\n";
2558
  }
2559
  break;
@@ -2563,7 +2581,7 @@ class FMModelForm_maker {
2563
  $element1 = isset( $_POST[ 'wdform_' . $i . "_element" . $id . "1" ] ) ? $_POST[ 'wdform_' . $i . "_element" . $id . "1" ] : NULL;
2564
  if ( isset( $element0 ) && $this->empty_field( $element0, $row->mail_emptyfields ) && $this->empty_field( $element1, $row->mail_emptyfields ) ) {
2565
  $element = $element0 . ' - ' . $element1;
2566
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td>' . $element . '</td></tr>';
2567
  $list_text_mode = $list_text_mode . $element_label . ' - ' . $element . "\r\n";
2568
  }
2569
  break;
@@ -2571,7 +2589,7 @@ class FMModelForm_maker {
2571
  case 'type_textarea': {
2572
  $element = isset( $_POST[ 'wdform_' . $i . "_element" . $id ] ) ? wpautop( $_POST[ 'wdform_' . $i . "_element" . $id ] ) : NULL;
2573
  if ( isset( $element ) && $this->empty_field( $element, $row->mail_emptyfields ) ) {
2574
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td>' . $element . '</td></tr>';
2575
  $list_text_mode = $list_text_mode . $element_label . ' - ' . $element . "\r\n";
2576
  }
2577
  break;
@@ -2579,7 +2597,7 @@ class FMModelForm_maker {
2579
  case "type_hidden": {
2580
  $element = isset( $_POST[ $element_label ] ) ? $_POST[ $element_label ] : NULL;
2581
  if ( isset( $element ) && $this->empty_field( $element, $row->mail_emptyfields ) ) {
2582
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td>' . $element . '</td></tr>';
2583
  $list_text_mode = $list_text_mode . $element_label . ' - ' . $element . "\r\n";
2584
  }
2585
  break;
@@ -2587,7 +2605,7 @@ class FMModelForm_maker {
2587
  case "type_mark_map": {
2588
  $element = isset( $_POST[ 'wdform_' . $i . "_long" . $id ] ) ? $_POST[ 'wdform_' . $i . "_long" . $id ] : NULL;
2589
  if ( isset( $element ) && $this->empty_field( $element, $row->mail_emptyfields ) ) {
2590
- $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>';
2591
  $list_text_mode = $list_text_mode . $element_label . ' - Longitude:' . $element . ' Latitude:' . (isset( $_POST[ 'wdform_' . $i . "_lat" . $id ] ) ? $_POST[ 'wdform_' . $i . "_lat" . $id ] : "") . "\r\n";
2592
  }
2593
  break;
@@ -2595,7 +2613,7 @@ class FMModelForm_maker {
2595
  case "type_submitter_mail": {
2596
  $element = isset( $_POST[ 'wdform_' . $i . "_element" . $id ] ) ? $_POST[ 'wdform_' . $i . "_element" . $id ] : NULL;
2597
  if ( isset( $element ) && $this->empty_field( $element, $row->mail_emptyfields ) ) {
2598
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $element . '</td></tr>';
2599
  $list_text_mode = $list_text_mode . $element_label . ' - ' . $element . "\r\n";
2600
  }
2601
  break;
@@ -2605,10 +2623,10 @@ class FMModelForm_maker {
2605
  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 )) ) {
2606
  $ss = isset( $_POST[ 'wdform_' . $i . "_ss" . $id ] ) ? $_POST[ 'wdform_' . $i . "_ss" . $id ] : NULL;
2607
  if ( isset( $ss ) ) {
2608
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $hh . ':' . (isset( $_POST[ 'wdform_' . $i . "_mm" . $id ] ) ? $_POST[ 'wdform_' . $i . "_mm" . $id ] : "") . ':' . $ss;
2609
  $list_text_mode = $list_text_mode . $element_label . ' - ' . $hh . ':' . (isset( $_POST[ 'wdform_' . $i . "_mm" . $id ] ) ? $_POST[ 'wdform_' . $i . "_mm" . $id ] : "") . ':' . $ss;
2610
  } else {
2611
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $hh . ':' . (isset( $_POST[ 'wdform_' . $i . "_mm" . $id ] ) ? $_POST[ 'wdform_' . $i . "_mm" . $id ] : "");
2612
  $list_text_mode = $list_text_mode . $element_label . ' - ' . $hh . ':' . (isset( $_POST[ 'wdform_' . $i . "_mm" . $id ] ) ? $_POST[ 'wdform_' . $i . "_mm" . $id ] : "");
2613
  }
2614
  $am_pm = isset( $_POST[ 'wdform_' . $i . "_am_pm" . $id ] ) ? $_POST[ 'wdform_' . $i . "_am_pm" . $id ] : NULL;
@@ -2625,7 +2643,7 @@ class FMModelForm_maker {
2625
  case "type_phone": {
2626
  $element_first = isset( $_POST[ 'wdform_' . $i . "_element_first" . $id ] ) ? $_POST[ 'wdform_' . $i . "_element_first" . $id ] : NULL;
2627
  if ( isset( $element_first ) && $this->empty_field( $element_first, $row->mail_emptyfields ) ) {
2628
- $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>';
2629
  $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";
2630
  }
2631
  break;
@@ -2636,11 +2654,11 @@ class FMModelForm_maker {
2636
  $element_title = isset( $_POST[ 'wdform_' . $i . "_element_title" . $id ] ) ? $_POST[ 'wdform_' . $i . "_element_title" . $id ] : NULL;
2637
  $element_middle = isset( $_POST[ 'wdform_' . $i . "_element_middle" . $id ] ) ? esc_html( $_POST[ 'wdform_' . $i . "_element_middle" . $id ] ) : NULL;
2638
  if ( (isset( $element_title ) || isset( $element_middle )) && ($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 )) ) {
2639
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . (isset( $_POST[ 'wdform_' . $i . "_element_title" . $id ] ) ? $_POST[ 'wdform_' . $i . "_element_title" . $id ] : '') . ' ' . $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>';
2640
  $list_text_mode = $list_text_mode . $element_label . ' - ' . (isset( $_POST[ 'wdform_' . $i . "_element_title" . $id ] ) ? $_POST[ 'wdform_' . $i . "_element_title" . $id ] : '') . ' ' . $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";
2641
  } else {
2642
  if ( $this->empty_field( $element_first, $row->mail_emptyfields ) || $this->empty_field( $_POST[ 'wdform_' . $i . "_element_last" . $id ], $row->mail_emptyfields ) ) {
2643
- $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>';
2644
  $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";
2645
  }
2646
  }
@@ -2650,37 +2668,37 @@ class FMModelForm_maker {
2650
  case "type_address": {
2651
  $element = isset( $_POST[ 'wdform_' . $i . "_street1" . $id ] ) ? $_POST[ 'wdform_' . $i . "_street1" . $id ] : NULL;
2652
  if ( isset( $element ) && $this->empty_field( $element, $row->mail_emptyfields ) ) {
2653
- $list = $list . '<tr valign="top"><td >' . $label_order_original[ $i ] . '</td><td >' . $element . '</td></tr>';
2654
  $list_text_mode = $list_text_mode . $label_order_original[ $i ] . ' - ' . $element . "\r\n";
2655
  break;
2656
  }
2657
  $element = isset( $_POST[ 'wdform_' . $i . "_street2" . $id ] ) ? $_POST[ 'wdform_' . $i . "_street2" . $id ] : NULL;
2658
  if ( isset( $element ) && $this->empty_field( $element, $row->mail_emptyfields ) ) {
2659
- $list = $list . '<tr valign="top"><td >' . $label_order_original[ $i ] . '</td><td >' . $element . '</td></tr>';
2660
  $list_text_mode = $list_text_mode . $label_order_original[ $i ] . ' - ' . $element . "\r\n";
2661
  break;
2662
  }
2663
  $element = isset( $_POST[ 'wdform_' . $i . "_city" . $id ] ) ? $_POST[ 'wdform_' . $i . "_city" . $id ] : NULL;
2664
  if ( isset( $element ) && $this->empty_field( $element, $row->mail_emptyfields ) ) {
2665
- $list = $list . '<tr valign="top"><td >' . $label_order_original[ $i ] . '</td><td >' . $element . '</td></tr>';
2666
  $list_text_mode = $list_text_mode . $label_order_original[ $i ] . ' - ' . $element . "\r\n";
2667
  break;
2668
  }
2669
  $element = isset( $_POST[ 'wdform_' . $i . "_state" . $id ] ) ? $_POST[ 'wdform_' . $i . "_state" . $id ] : NULL;
2670
  if ( isset( $element ) && $this->empty_field( $element, $row->mail_emptyfields ) ) {
2671
- $list = $list . '<tr valign="top"><td >' . $label_order_original[ $i ] . '</td><td >' . $element . '</td></tr>';
2672
  $list_text_mode = $list_text_mode . $label_order_original[ $i ] . ' - ' . $element . "\r\n";
2673
  break;
2674
  }
2675
  $element = isset( $_POST[ 'wdform_' . $i . "_postal" . $id ] ) ? $_POST[ 'wdform_' . $i . "_postal" . $id ] : NULL;
2676
  if ( isset( $element ) && $this->empty_field( $element, $row->mail_emptyfields ) ) {
2677
- $list = $list . '<tr valign="top"><td >' . $label_order_original[ $i ] . '</td><td >' . $element . '</td></tr>';
2678
  $list_text_mode = $list_text_mode . $label_order_original[ $i ] . ' - ' . $element . "\r\n";
2679
  break;
2680
  }
2681
  $element = isset( $_POST[ 'wdform_' . $i . "_country" . $id ] ) ? $_POST[ 'wdform_' . $i . "_country" . $id ] : NULL;
2682
  if ( isset( $element ) && $this->empty_field( $element, $row->mail_emptyfields ) ) {
2683
- $list = $list . '<tr valign="top"><td >' . $label_order_original[ $i ] . '</td><td >' . $element . '</td></tr>';
2684
  $list_text_mode = $list_text_mode . $label_order_original[ $i ] . ' - ' . $element . "\r\n";
2685
  break;
2686
  }
@@ -2691,7 +2709,7 @@ class FMModelForm_maker {
2691
  $month = isset( $_POST[ 'wdform_' . $i . "_month" . $id ] ) ? $_POST[ 'wdform_' . $i . "_month" . $id ] : "";
2692
  $year = isset( $_POST[ 'wdform_' . $i . "_year" . $id ] ) ? $_POST[ 'wdform_' . $i . "_year" . $id ] : "";
2693
  if ( isset( $day ) && $this->empty_field( $day, $row->mail_emptyfields ) ) {
2694
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . (($day || $month || $year) ? $day . '-' . $month . '-' . $year : '') . '</td></tr>';
2695
  $list_text_mode = $list_text_mode . $element_label . (($day || $month || $year) ? $day . '-' . $month . '-' . $year : '') . "\r\n";
2696
  }
2697
  break;
@@ -2699,13 +2717,13 @@ class FMModelForm_maker {
2699
  case "type_radio": {
2700
  $element = isset( $_POST[ 'wdform_' . $i . "_other_input" . $id ] ) ? $_POST[ 'wdform_' . $i . "_other_input" . $id ] : NULL;
2701
  if ( isset( $element ) && $this->empty_field( $element, $row->mail_emptyfields ) ) {
2702
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $element . '</td></tr>';
2703
  $list_text_mode = $list_text_mode . $element_label . ' - ' . $element . "\r\n";
2704
  break;
2705
  }
2706
  $element = isset( $_POST[ 'wdform_' . $i . "_element" . $id ] ) ? $_POST[ 'wdform_' . $i . "_element" . $id ] : NULL;
2707
  if ( isset( $element ) && $this->empty_field( $element, $row->mail_emptyfields ) ) {
2708
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $element . '</td></tr>';
2709
  $list_text_mode = $list_text_mode . $element_label . ' - ' . $element . "\r\n";
2710
  }
2711
  break;
@@ -2725,7 +2743,7 @@ class FMModelForm_maker {
2725
  $other_element_id = isset( $_POST[ 'wdform_' . $i . "_allow_other_num" . $id ] ) ? $_POST[ 'wdform_' . $i . "_allow_other_num" . $id ] : "";
2726
  }
2727
  if ( $start != -1 || ($start == -1 && $row->mail_emptyfields) ) {
2728
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >';
2729
  $list_text_mode = $list_text_mode . $element_label . ' - ';
2730
  }
2731
  if ( $start != -1 ) {
@@ -2757,7 +2775,7 @@ class FMModelForm_maker {
2757
  $value = $value . '.' . $_POST[ 'wdform_' . $i . "_element_cents" . $id ];
2758
  }
2759
  if ( $this->empty_field( $value, $row->mail_emptyfields ) && $value != '.' ) {
2760
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $value . $form_currency . '</td></tr>';
2761
  $list_text_mode = $list_text_mode . $element_label . ' - ' . $value . $form_currency . "\r\n";
2762
  }
2763
  break;
@@ -2768,7 +2786,7 @@ class FMModelForm_maker {
2768
  $value = $_POST[ 'wdform_' . $i . "_element" . $id ];
2769
  }
2770
  if ( $this->empty_field( $value, $row->mail_emptyfields ) && $value != '.' ) {
2771
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . ($value == '' ? '' : $form_currency) . $value . '</td></tr>';
2772
  $list_text_mode = $list_text_mode . $element_label . ' - ' . $value . $form_currency . "\r\n";
2773
  }
2774
  break;
@@ -2782,10 +2800,10 @@ class FMModelForm_maker {
2782
  $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;
2783
  $element_quantity = (isset( $_POST[ 'wdform_' . $i . "_element_quantity" . $id ] ) && $_POST[ 'wdform_' . $i . "_element_quantity" . $id ]) ? $_POST[ 'wdform_' . $i . "_element_quantity" . $id ] : NULL;
2784
  if ( $value != '' ) {
2785
- if( $is_element_quantity ) {
2786
- $value .= '<br/>' . $element_quantity_label . ': ' . (($element_quantity == NULL) ? 0 : $element_quantity);
2787
- }
2788
- for ( $k = 0; $k < 50; $k++ ) {
2789
  $temp_val = isset( $_POST[ 'wdform_' . $i . "_property" . $id . $k ] ) ? $_POST[ 'wdform_' . $i . "_property" . $id . $k ] : NULL;
2790
  if ( isset( $temp_val ) ) {
2791
  $value .= '<br/>' . (isset( $_POST[ 'wdform_' . $i . "_element_property_label" . $id . $k ] ) ? $_POST[ 'wdform_' . $i . "_element_property_label" . $id . $k ] : "") . ': ' . $temp_val;
@@ -2793,7 +2811,7 @@ class FMModelForm_maker {
2793
  }
2794
  }
2795
  if ( $this->empty_field( $value, $row->mail_emptyfields ) ) {
2796
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $value . '</td></tr>';
2797
  $list_text_mode = $list_text_mode . $element_label . ' - ' . str_replace( '<br/>', ', ', $value ) . "\r\n";
2798
  }
2799
  break;
@@ -2805,9 +2823,9 @@ class FMModelForm_maker {
2805
  $is_element_quantity = isset( $_POST[ 'wdform_' . $i . "_element_quantity" . $id ] ) ? TRUE : FALSE;
2806
  $element_quantity_label = isset( $_POST[ 'wdform_' . $i . "_element_quantity_label" . $id ] ) ? $_POST[ 'wdform_' . $i . "_element_quantity_label" . $id ] : NULL;
2807
  $element_quantity = (isset( $_POST[ 'wdform_' . $i . "_element_quantity" . $id ] ) && $_POST[ 'wdform_' . $i . "_element_quantity" . $id ]) ? $_POST[ 'wdform_' . $i . "_element_quantity" . $id ] : NULL;
2808
- if ( !empty($is_element_quantity) ) {
2809
- $value .= '<br/>' . $element_quantity_label . ': ' . (($element_quantity == NULL) ? 0 : $element_quantity);
2810
- }
2811
  for ( $k = 0; $k < 50; $k++ ) {
2812
  $temp_val = isset( $_POST[ 'wdform_' . $i . "_property" . $id . $k ] ) ? $_POST[ 'wdform_' . $i . "_property" . $id . $k ] : NULL;
2813
  if ( isset( $temp_val ) ) {
@@ -2816,7 +2834,7 @@ class FMModelForm_maker {
2816
  }
2817
  }
2818
  if ( $this->empty_field( $value, $row->mail_emptyfields ) ) {
2819
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $value . '</td></tr>';
2820
  $list_text_mode = $list_text_mode . $element_label . ' - ' . str_replace( '<br/>', ', ', $value ) . "\r\n";
2821
  }
2822
  break;
@@ -2825,7 +2843,7 @@ class FMModelForm_maker {
2825
  if ( isset( $_POST[ 'wdform_' . $i . "_element" . $id ] ) ) {
2826
  $value = $_POST[ 'wdform_' . $i . "_element_label" . $id ] . ' : ' . $form_currency . (isset( $_POST[ 'wdform_' . $i . "_element" . $id ] ) ? $_POST[ 'wdform_' . $i . "_element" . $id ] : "");
2827
  if ( $this->empty_field( $value, $row->mail_emptyfields ) ) {
2828
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $value . '</td></tr>';
2829
  $list_text_mode = $list_text_mode . $element_label . ' - ' . $value . "\r\n";
2830
  }
2831
  } else {
@@ -2843,7 +2861,7 @@ class FMModelForm_maker {
2843
  }
2844
  }
2845
  if ( $start != -1 || ($start == -1 && $row->mail_emptyfields) ) {
2846
- $list = $list . '<tr valign="top"><td>' . $element_label . '</td><td>';
2847
  $list_text_mode = $list_text_mode . $element_label . ' - ';
2848
  }
2849
  if ( $start != -1 ) {
@@ -2860,9 +2878,9 @@ class FMModelForm_maker {
2860
  $element_quantity_label = isset( $_POST[ 'wdform_' . $i . "_element_quantity_label" . $id ] ) ? $_POST[ 'wdform_' . $i . "_element_quantity_label" . $id ] : NULL;
2861
  $element_quantity = (isset( $_POST[ 'wdform_' . $i . "_element_quantity" . $id ] ) && $_POST[ 'wdform_' . $i . "_element_quantity" . $id ]) ? $_POST[ 'wdform_' . $i . "_element_quantity" . $id ] : NULL;
2862
  if ( $is_element_quantity ) {
2863
- $list = $list . $element_quantity_label . ': ' . (($element_quantity == NULL) ? 0 : $element_quantity);
2864
- $list_text_mode = $list_text_mode . $element_quantity_label . ': ' . (($element_quantity == NULL) ? 0 : $element_quantity) . ', ';
2865
- }
2866
  }
2867
  if ( $start != -1 ) {
2868
  for ( $k = 0; $k < 50; $k++ ) {
@@ -2882,7 +2900,7 @@ class FMModelForm_maker {
2882
  case "type_paypal_total": {
2883
  $element = isset( $_POST[ 'wdform_' . $i . "_paypal_total" . $id ] ) ? $_POST[ 'wdform_' . $i . "_paypal_total" . $id ] : "";
2884
  if ( $this->empty_field( $element, $row->mail_emptyfields ) ) {
2885
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $element . '</td></tr>';
2886
  $list_text_mode = $list_text_mode . $element_label . ' - ' . $element . "\r\n";
2887
  }
2888
  break;
@@ -2891,7 +2909,7 @@ class FMModelForm_maker {
2891
  $element = isset( $_POST[ 'wdform_' . $i . "_star_amount" . $id ] ) ? $_POST[ 'wdform_' . $i . "_star_amount" . $id ] : NULL;
2892
  $selected = isset( $_POST[ 'wdform_' . $i . "_selected_star_amount" . $id ] ) ? $_POST[ 'wdform_' . $i . "_selected_star_amount" . $id ] : 0;
2893
  if ( isset( $element ) && $this->empty_field( $selected, $row->mail_emptyfields ) ) {
2894
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $selected . '/' . $element . '</td></tr>';
2895
  $list_text_mode = $list_text_mode . $element_label . ' - ' . $selected . '/' . $element . "\r\n";
2896
  }
2897
  break;
@@ -2900,7 +2918,7 @@ class FMModelForm_maker {
2900
  $element = isset( $_POST[ 'wdform_' . $i . "_scale_amount" . $id ] ) ? $_POST[ 'wdform_' . $i . "_scale_amount" . $id ] : NULL;
2901
  $selected = isset( $_POST[ 'wdform_' . $i . "_scale_radio" . $id ] ) ? $_POST[ 'wdform_' . $i . "_scale_radio" . $id ] : 0;
2902
  if ( isset( $element ) && $this->empty_field( $selected, $row->mail_emptyfields ) ) {
2903
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $selected . '/' . $element . '</td></tr>';
2904
  $list_text_mode = $list_text_mode . $element_label . ' - ' . $selected . '/' . $element . "\r\n";
2905
  }
2906
  break;
@@ -2908,7 +2926,7 @@ class FMModelForm_maker {
2908
  case "type_spinner": {
2909
  $element = isset( $_POST[ 'wdform_' . $i . "_element" . $id ] ) ? $_POST[ 'wdform_' . $i . "_element" . $id ] : NULL;
2910
  if ( isset( $element ) && $this->empty_field( $element, $row->mail_emptyfields ) ) {
2911
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $element . '</td></tr>';
2912
  $list_text_mode = $list_text_mode . $element_label . ' - ' . $element . "\r\n";
2913
  }
2914
  break;
@@ -2916,7 +2934,7 @@ class FMModelForm_maker {
2916
  case "type_slider": {
2917
  $element = isset( $_POST[ 'wdform_' . $i . "_slider_value" . $id ] ) ? $_POST[ 'wdform_' . $i . "_slider_value" . $id ] : NULL;
2918
  if ( isset( $element ) && $this->empty_field( $element, $row->mail_emptyfields ) ) {
2919
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $element . '</td></tr>';
2920
  $list_text_mode = $list_text_mode . $element_label . ' - ' . $element . "\r\n";
2921
  }
2922
  break;
@@ -2925,7 +2943,7 @@ class FMModelForm_maker {
2925
  $element0 = isset( $_POST[ 'wdform_' . $i . "_element" . $id . '0' ] ) ? $_POST[ 'wdform_' . $i . "_element" . $id . '0' ] : NULL;
2926
  $element1 = isset( $_POST[ 'wdform_' . $i . "_element" . $id . '1' ] ) ? $_POST[ 'wdform_' . $i . "_element" . $id . '1' ] : NULL;
2927
  if ( (isset( $element0 ) && $this->empty_field( $element0, $row->mail_emptyfields )) || (isset( $element1 ) && $this->empty_field( $element1, $row->mail_emptyfields )) ) {
2928
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >From: ' . $element0 . '<span style="margin-left:6px"> To </span>:' . $element1 . '</td></tr>';
2929
  $list_text_mode = $list_text_mode . $element_label . ' - From: ' . $element0 . ' To: ' . $element1 . "\r\n";
2930
  }
2931
  break;
@@ -2946,7 +2964,7 @@ class FMModelForm_maker {
2946
  }
2947
  $element .= "Total: " . $total;
2948
  if ( isset( $element ) && $this->empty_field( $form_empty_field, $row->mail_emptyfields ) ) {
2949
- $list = $list . '<tr valign="top"><td>' . $element_label . '</td><td >' . $element . '</td></tr>';
2950
  $list_text_mode = $list_text_mode . $element_label . ' - ' . $element . "\r\n";
2951
  }
2952
  break;
@@ -2958,15 +2976,15 @@ class FMModelForm_maker {
2958
  $rows_count = sizeof( $mat_rows ) - 1;
2959
  $mat_columns = explode( "***", isset( $_POST[ 'wdform_' . $i . "_hidden_column" . $id ] ) ? $_POST[ 'wdform_' . $i . "_hidden_column" . $id ] : "" );
2960
  $columns_count = sizeof( $mat_columns ) - 1;
2961
- $matrix = "<table>";
2962
- $matrix .= '<tr><td></td>';
2963
  for ( $k = 1; $k < count( $mat_columns ); $k++ ) {
2964
- $matrix .= '<td style="background-color:#BBBBBB; padding:5px; ">' . $mat_columns[ $k ] . '</td>';
2965
  }
2966
  $matrix .= '</tr>';
2967
  $aaa = Array();
2968
  for ( $k = 1; $k <= $rows_count; $k++ ) {
2969
- $matrix .= '<tr><td style="background-color:#BBBBBB; padding:5px;">' . $mat_rows[ $k ] . '</td>';
2970
  if ( $input_type == "radio" ) {
2971
  $mat_radio = isset( $_POST[ 'wdform_' . $i . "_input_element" . $id . $k ] ) ? $_POST[ 'wdform_' . $i . "_input_element" . $id . $k ] : 0;
2972
  if ( $mat_radio == 0 ) {
@@ -2983,7 +3001,7 @@ class FMModelForm_maker {
2983
  $checked = "";
2984
  }
2985
  $sign = $checked == 'checked' ? '&#10004;' : '';
2986
- $matrix .= '<td style="text-align:center">' . $sign . '</td>';
2987
  }
2988
  } else {
2989
  if ( $input_type == "checkbox" ) {
@@ -2996,7 +3014,7 @@ class FMModelForm_maker {
2996
  $checked = "";
2997
  }
2998
  $sign = $checked == 'checked' ? '&#10004;' : '';
2999
- $matrix .= '<td style="text-align:center">' . $sign . '</td>';
3000
  }
3001
  } else {
3002
  if ( $input_type == "text" ) {
@@ -3005,7 +3023,7 @@ class FMModelForm_maker {
3005
  if ( $checked ) {
3006
  $form_empty_field = 1;
3007
  }
3008
- $matrix .= '<td style="text-align:center">' . $checked . '</td>';
3009
  }
3010
  } else {
3011
  for ( $j = 1; $j <= $columns_count; $j++ ) {
@@ -3013,7 +3031,7 @@ class FMModelForm_maker {
3013
  if ( $checked ) {
3014
  $form_empty_field = 1;
3015
  }
3016
- $matrix .= '<td style="text-align:center">' . $checked . '</td>';
3017
  }
3018
  }
3019
  }
@@ -3022,7 +3040,7 @@ class FMModelForm_maker {
3022
  }
3023
  $matrix .= '</table>';
3024
  if ( isset( $matrix ) && $this->empty_field( $form_empty_field, $row->mail_emptyfields ) ) {
3025
- $list = $list . '<tr valign="top"><td >' . $element_label . '</td><td >' . $matrix . '</td></tr>';
3026
  }
3027
  break;
3028
  }
@@ -3033,9 +3051,11 @@ class FMModelForm_maker {
3033
  }
3034
  }
3035
  $list = $list . '</table>';
3036
- // User part.
 
3037
  if ( $row->sendemail ) {
3038
  $fromname = $row->mail_from_name_user;
 
3039
  $subject = !empty( $row->mail_subject_user ) ? $row->mail_subject_user : $row->title;
3040
  $attachment_user = array();
3041
  if ( !WDFMInstance(self::PLUGIN)->is_demo ) {
@@ -3101,12 +3121,16 @@ class FMModelForm_maker {
3101
  foreach ( $this->custom_fields as $key => $custom_field ) {
3102
  $new_script = str_replace( array( '%' . $key . '%', '{' . $key . '}' ), $custom_field, $new_script );
3103
  $fromname = str_replace( array( '%' . $key . '%', '{' . $key . '}' ), $custom_field, $fromname );
 
3104
  $subject = str_replace( array( '%' . $key . '%', '{' . $key . '}' ), $custom_field, $subject );
3105
  }
 
 
 
3106
 
3107
  $header_arr = array();
3108
  if ( $row->mail_from_user != '' ) {
3109
- $header_arr[ 'from' ] = $row->mail_from_user;
3110
  }
3111
  $header_arr['from_name'] = $fromname;
3112
  $header_arr['content_type'] = $content_type;
@@ -3129,7 +3153,8 @@ class FMModelForm_maker {
3129
  $send_copy = isset( $_POST[ "wdform_send_copy_" . $id ] ) ? $_POST[ "wdform_send_copy_" . $id ] : NULL;
3130
  if ( isset( $send_copy ) ) {
3131
  $send = TRUE;
3132
- } else {
 
3133
  $mail_verification_post_id = (int)$wpdb->get_var( $wpdb->prepare( 'SELECT mail_verification_post_id FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id ) );
3134
  $verification_link = get_post( $mail_verification_post_id );
3135
 
@@ -3166,12 +3191,14 @@ class FMModelForm_maker {
3166
  }
3167
  }
3168
  }
3169
- // Admin part.
 
3170
  if ( $row->sendemail ) {
3171
  $recipient = $row->mail ? $row->mail : '';
3172
  $subject = !empty( $row->mail_subject ) ? $row->mail_subject : $row->title;
3173
 
3174
  $fromname = $row->from_name;
 
3175
  $attachment = array();
3176
  if ( !WDFMInstance(self::PLUGIN)->is_demo ) {
3177
  for ( $k = 0; $k < count( $all_files ); $k++ ) {
@@ -3238,14 +3265,18 @@ class FMModelForm_maker {
3238
  }
3239
  $this->custom_fields['all'] = $list;
3240
 
3241
- foreach ( $this->custom_fields as $key => $custom_field ) {
3242
  $new_script = str_replace( array( '%' . $key . '%', '{' . $key . '}' ), $custom_field, $new_script );
3243
  $recipient = str_replace( array( '%' . $key . '%', '{' . $key . '}' ), $custom_field, $recipient);
3244
  $fromname = str_replace( array( '%' . $key . '%', '{' . $key . '}' ), $custom_field, $fromname );
 
3245
  $subject = str_replace( array( '%' . $key . '%', '{' . $key . '}' ), $custom_field, $subject );
3246
  }
 
 
 
3247
  if ( $row->from_mail ) {
3248
- $header_arr[ 'from' ] = isset( $_POST['wdform_' . $row->from_mail . "_element" . $id] ) ? $_POST['wdform_' . $row->from_mail . "_element" . $id] : $row->from_mail;
3249
  }
3250
  $header_arr['from_name'] = $fromname;
3251
  $header_arr['content_type'] = $content_type;
@@ -3348,16 +3379,17 @@ class FMModelForm_maker {
3348
  }
3349
 
3350
  /**
3351
- * @param $type
3352
- * @param $key
3353
- * @param $id
3354
- * @param $attachment
3355
- * @param $form_currency
3356
- * @param int $file_upload_link
3357
  *
3358
- * @return null|string
 
 
 
 
 
 
3359
  */
3360
- public static function custom_fields_mail( $type, $key, $id, $attachment, $form_currency, $file_upload_link = 0 ) {
3361
  $new_value = "";
3362
  if ( $type != "type_submit_reset" or $type != "type_map" or $type != "type_editor" or $type != "type_captcha" or $type != "type_arithmetic_captcha" or $type != "type_recaptcha" or $type != "type_button" ) {
3363
  switch ( $type ) {
@@ -3586,10 +3618,10 @@ class FMModelForm_maker {
3586
  $is_element_quantity = isset( $_POST[ 'wdform_' . $key . "_element_quantity" . $id ] ) ? TRUE : FALSE;
3587
  $element_quantity_label = isset( $_POST[ 'wdform_' . $key . "_element_quantity_label" . $id ] ) ? $_POST[ 'wdform_' . $key . "_element_quantity_label" . $id ] : NULL;
3588
  $element_quantity = (isset( $_POST[ 'wdform_' . $key . "_element_quantity" . $id ] ) && $_POST[ 'wdform_' . $key . "_element_quantity" . $id ]) ? $_POST[ 'wdform_' . $key . "_element_quantity" . $id ] : NULL;
3589
- if ( $is_element_quantity ) {
3590
- $new_value .= '<br/>' . $element_quantity_label . ': ' . ( !(empty($element_quantity)) ? $element_quantity : 0);
3591
  }
3592
- for ( $k = 0; $k < 50; $k++ ) {
3593
  $temp_val = isset( $_POST[ 'wdform_' . $key . "_property" . $id . $k ] ) ? $_POST[ 'wdform_' . $key . "_property" . $id . $k ] : NULL;
3594
  if ( isset( $temp_val ) ) {
3595
  $new_value .= '<br/>' . (isset( $_POST[ 'wdform_' . $key . "_element_property_label" . $id . $k ] ) ? $_POST[ 'wdform_' . $key . "_element_property_label" . $id . $k ] : "") . ': ' . $temp_val;
@@ -3603,9 +3635,9 @@ class FMModelForm_maker {
3603
  $is_element_quantity = isset( $_POST[ 'wdform_' . $key . "_element_quantity" . $id ] ) ? TRUE : FALSE;
3604
  $element_quantity_label = isset( $_POST[ 'wdform_' . $key . "_element_quantity_label" . $id ] ) ? $_POST[ 'wdform_' . $key . "_element_quantity_label" . $id ] : NULL;
3605
  $element_quantity = ( isset( $_POST[ 'wdform_' . $key . "_element_quantity" . $id ] ) && $_POST[ 'wdform_' . $key . "_element_quantity" . $id ]) ? $_POST[ 'wdform_' . $key . "_element_quantity" . $id ] : NULL;
3606
- if ( $is_element_quantity ) {
3607
- $new_value .= '<br/>'. $element_quantity_label . ': ' . ( (!empty($element_quantity)) ? $element_quantity : 0 );
3608
- }
3609
  for ( $k = 0; $k < 50; $k++ ) {
3610
  $temp_val = isset( $_POST[ 'wdform_' . $key . "_property" . $id . $k ] ) ? $_POST[ 'wdform_' . $key . "_property" . $id . $k ] : NULL;
3611
  if ( isset( $temp_val ) ) {
@@ -3639,8 +3671,8 @@ class FMModelForm_maker {
3639
  $element_quantity_label = isset( $_POST[ 'wdform_' . $key . "_element_quantity_label" . $id ] ) ? $_POST[ 'wdform_' . $key . "_element_quantity_label" . $id ] : NULL;
3640
  $element_quantity = (isset( $_POST[ 'wdform_' . $key . "_element_quantity" . $id ] ) && $_POST[ 'wdform_' . $key . "_element_quantity" . $id ]) ? $_POST[ 'wdform_' . $key . "_element_quantity" . $id ] : NULL;
3641
  if ( $is_element_quantity ) {
3642
- $new_value .= $element_quantity_label . ': ' . ( (!empty($element_quantity)) ? $element_quantity : 0 );
3643
- }
3644
  for ( $k = 0; $k < 50; $k++ ) {
3645
  $temp_val = isset( $_POST[ 'wdform_' . $key . "_property" . $id . $k ] ) ? $_POST[ 'wdform_' . $key . "_property" . $id . $k ] : NULL;
3646
  if ( isset( $temp_val ) ) {
@@ -3781,12 +3813,12 @@ class FMModelForm_maker {
3781
  }
3782
 
3783
  /**
3784
- * @param $element
3785
- * @param $mail_emptyfields
3786
  *
3787
  * @return int
3788
  */
3789
- public function empty_field( $element, $mail_emptyfields ) {
3790
  if ( !$mail_emptyfields ) {
3791
  if ( empty( $element ) ) {
3792
  return 0;
@@ -3797,12 +3829,12 @@ class FMModelForm_maker {
3797
  }
3798
 
3799
  /**
3800
- * @param $date
3801
  * @param string $format
3802
  *
3803
  * @return bool
3804
  */
3805
- public function fm_validateDate( $date, $format = 'Y-m-d H:i:s' ) {
3806
  $d = DateTime::createFromFormat( $format, $date );
3807
 
3808
  return $d && $d->format( $format ) == $date;
19
  *
20
  * @return array
21
  */
22
+ public function showform( $id = 0, $type = 'embedded' ) {
23
  global $wpdb;
24
  $row = $wpdb->get_row( $wpdb->prepare( 'SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"' . (!WDFMInstance(self::PLUGIN)->is_free ? '' : ' AND id' . (WDFMInstance(self::PLUGIN)->is_free == 1 ? ' NOT ' : ' ') . 'IN (' . (get_option( 'contact_form_forms', '' ) != '' ? get_option( 'contact_form_forms' ) : 0) . ')'), $id ) );
25
 
101
  * @param $value
102
  * @param $key
103
  */
104
+ public static function set_empty_values_transparent( &$value = '', $key = '' ) {
105
  if ( strpos( $key, 'Color' ) > -1 ) {
106
  /*
107
  * New themes colorpicker conflict with others.
117
  }
118
 
119
  /**
120
+ * @param int $theme_id
121
+ * @param array $form_theme
122
  * @param bool $old
123
  * @param bool $force_rewrite
124
  */
125
+ public function create_css( $theme_id = 0, $form_theme = array(), $old = TRUE, $force_rewrite = FALSE ) {
126
  $wp_upload_dir = wp_upload_dir();
127
  $frontend_dir = '/form-maker-frontend/';
128
  if ( !is_dir( $wp_upload_dir[ 'basedir' ] . $frontend_dir ) ) {
137
  if ( $theme_id && !$force_rewrite && file_exists( $frontend_css ) ) {
138
  return;
139
  }
140
+
141
+ $plugin_relative_url = trim(str_replace(site_url(), '', WDFMInstance(self::PLUGIN)->plugin_url), '/');
142
+ $plugin_relative_url = '../../../../' . $plugin_relative_url . '/';
143
+
144
  $prefixes = array(
145
  'HP',
146
  'AGP',
579
  '}';
580
 
581
  $css_content .= '.fm-form-container.fm-theme' . $theme_id . ' .fm-form .file-picker {' .
582
+ (!empty( $form_theme[ 'OPFBgUrl' ] ) ? 'display: inline-block; width: 22px; height: 22px; background: url("' . $plugin_relative_url . $form_theme[ 'OPFBgUrl' ] . '");' : '') .
583
  (!empty( $form_theme[ 'OPFBGRepeat' ] ) ? 'background-repeat:' . $form_theme[ 'OPFBGRepeat' ] . ';' : '') .
584
  (!empty( $form_theme[ 'OPFPos1' ] ) ? 'background-position-x:' . $form_theme[ 'OPFPos1' ] . ';' : '') .
585
  (!empty( $form_theme[ 'OPFPos2' ] ) ? 'background-position-y:' . $form_theme[ 'OPFPos2' ] . ';' : '') .
693
  }
694
  $css_content .= '.fm-form-container.fm-theme' . $theme_id . ' .fm-form select {' .
695
  (!empty( $form_theme[ 'IPBGColor' ] ) ? 'background-color:' . $form_theme[ 'IPBGColor' ] . ';' : '') .
696
+ (!empty( $form_theme[ 'SBPBackground' ] ) ? 'background-image: url("' . $plugin_relative_url . $form_theme[ 'SBPBackground' ] . '");' : '') .
697
  (!empty( $form_theme[ 'SBPBGRepeat' ] ) ? 'background-repeat:' . $form_theme[ 'SBPBGRepeat' ] . ';' : '') .
698
  (!empty( $form_theme[ 'SBPBackground' ] ) ? 'background-position-x: calc(100% - 8px);' : '') .
699
  (!empty( $form_theme[ 'SBPBackground' ] ) ? 'background-position-y: 50%;' : '') .
753
  (!empty( $form_theme[ 'MCCPHeight' ] ) ? 'height:' . $form_theme[ 'MCCPHeight' ] . 'px;' : '') .
754
  (!empty( $form_theme[ 'MCPMargin' ] ) ? 'margin:' . $form_theme[ 'MCCPMargin' ] . 'px;' : '') .
755
  (!empty( $form_theme[ 'MCCPBGColor' ] ) ? 'background-color:' . $form_theme[ 'MCCPBGColor' ] . ';' : '') .
756
+ (!empty( $form_theme[ 'MCCPBackground' ] ) ? 'background-image: url("' . $plugin_relative_url . $form_theme[ 'MCCPBackground' ] . '");' : '') .
757
  (!empty( $form_theme[ 'MCCPBGRepeat' ] ) ? 'background-repeat:' . $form_theme[ 'MCCPBGRepeat' ] . ';' : '') .
758
  (!empty( $form_theme[ 'MCCPBGPos1' ] ) ? 'background-position-x:' . $form_theme[ 'MCCPBGPos1' ] . ';' : '') .
759
  (!empty( $form_theme[ 'MCCPBGPos2' ] ) ? 'background-position-y:' . $form_theme[ 'MCCPBGPos2' ] . ';' : '') .
1012
  content: \'\';
1013
  width: 16px;
1014
  height: 16px;
1015
+ background:transparent url("' . $plugin_relative_url . 'images/themes/checkboxes/1.png") no-repeat;
1016
  background-size: 100%;
1017
  border-radius: 0px;
1018
  margin: 0px;
1058
  }
1059
  $theme = implode( '{', $body_or_classes_implode );
1060
  $theme = preg_replace( $pattern, ' ', $theme );
1061
+ $css_content .= $theme;
1062
  }
1063
  $this->fm_css_content = $css_content;
1064
  file_put_contents( $frontend_css, $css_content );
1065
  }
1066
 
1067
  /**
1068
+ * @param int $form
1069
+ * @param int $id
1070
  *
1071
  * @return array|mixed
1072
  */
1073
+ public function savedata( $form = 0, $id = 0 ) {
1074
  $fm_settings = get_option(WDFMInstance(self::PLUGIN)->is_free == 2 ? 'fmc_settings' : 'fm_settings');
1075
  $all_files = array();
1076
  $correct = FALSE;
1216
  }
1217
 
1218
  /**
1219
+ * Select data from db for labels.
 
 
 
 
1220
  *
1221
+ * @param string $db_info
1222
+ * @param string $label_column
1223
+ * @param string $table
1224
+ * @param string $where
1225
+ * @param string $order_by
1226
+ * @return mixed
1227
  */
1228
+ public function select_data_from_db_for_labels( $db_info = '', $label_column = '', $table = '', $where = '', $order_by = '' ) {
1229
  global $wpdb;
1230
  $query = "SELECT `" . $label_column . "` FROM " . $table . $where . " ORDER BY " . $order_by;
1231
  $db_info = trim($db_info, '[]');
1249
  }
1250
 
1251
  /**
1252
+ * Select data from db for values.
1253
+ *
1254
+ * @param string $db_info
1255
+ * @param string $value_column
1256
+ * @param string $table
1257
+ * @param string $where
1258
+ * @param string $order_by
1259
  *
1260
  * @return array|null|object
1261
  */
1262
+ public function select_data_from_db_for_values( $db_info = '', $value_column = '', $table = '', $where = '', $order_by = '' ) {
1263
  global $wpdb;
1264
  $query = "SELECT `" . $value_column . "` FROM " . $table . $where . " ORDER BY " . $order_by;
1265
  $db_info = trim($db_info, '[]');
1283
  }
1284
 
1285
  /**
1286
+ * Save DB.
1287
  *
1288
+ * @param int $id
1289
  * @return array( 'error' => true, 'group_id' => $max, 'message' => '' ); in case of error | array('group_id' => $max, 'all_files' => '', 'redirect_url' => '')
1290
  */
1291
+ public function save_db( $id = 0 ) {
1292
  global $wpdb;
1293
  $wp_userid = '';
1294
  $wp_username = '';
1314
  $adminemail = get_option('admin_email');
1315
  $current_page_url = WDW_FM_Library(self::PLUGIN)->get_current_page_url();
1316
  $form = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id= %d", $id ) );
1317
+
1318
+ $form->save_ip = 1;
1319
+ $form->save_user_id = 1;
1320
+ if ( $form && isset($form->privacy) ) {
1321
+ if ( $form->privacy ) {
1322
+ $privacy = json_decode($form->privacy);
1323
+ $form->save_ip = isset($privacy->save_ip) ? $privacy->save_ip : 1;
1324
+ $form->save_user_id = isset($privacy->save_user_id) ? $privacy->save_user_id : 1;
1325
+ }
1326
+ }
1327
+
1328
  $formtitle = $form->title;
1329
  if ( !$form->form_front ) {
1330
  $id = '';
1376
  $i = $label_id[ $key ];
1377
 
1378
  $missing_required_field = FALSE;
1379
+ $invalid_email_address = FALSE;
1380
  $required = (isset($params[$i]) && strpos($params[$i], '*:*yes*:*w_required*:*') !== FALSE ? 1 : 0);
1381
 
1382
  if ( !in_array( $i, $disabled_fields ) ) {
1383
  switch ( $type ) {
1384
  case 'type_text':
1385
  case 'type_password':
 
1386
  case "type_own_select":
1387
  case "type_country":
1388
  case "type_number":
1397
  }
1398
  break;
1399
  }
1400
+ case "type_submitter_mail": {
1401
+ $value = isset( $_POST[ 'wdform_' . $i . "_element" . $id ] ) ? esc_html( $_POST[ 'wdform_' . $i . "_element" . $id ] ) : "";
1402
+ if ( $required && !isset( $_POST[ 'wdform_' . $i . "_element" . $id ] ) ) {
1403
+ $missing_required_field = TRUE;
1404
+ }
1405
+ if ( $value !== '' && is_email($value) === FALSE ) {
1406
+ $invalid_email_address = TRUE;
1407
+ }
1408
+ break;
1409
+ }
1410
  case "type_date": {
1411
  $value = isset( $_POST[ 'wdform_' . $i . "_element" . $id ] ) ? esc_html( $_POST[ 'wdform_' . $i . "_element" . $id ] ) : "";
1412
  $date_format = isset( $_POST[ 'wdform_' . $i . "_date_format" . $id ] ) ? esc_html( $_POST[ 'wdform_' . $i . "_date_format" . $id ] ) : "";
2054
  if ( $missing_required_field ) {
2055
  return array( 'error' => true, 'group_id' => $group_id, 'message' => addslashes( addslashes( sprintf( __( '%s field is required.', WDFMInstance(self::PLUGIN)->prefix ), $label_label[ $key ] ) ) ) );
2056
  }
2057
+ if ( $invalid_email_address ) {
2058
+ return array( 'error' => true, 'group_id' => $group_id, 'message' => addslashes( addslashes( __( 'Enter a valid email address.', WDFMInstance(self::PLUGIN)->prefix ) ) ) );
2059
+ }
2060
 
2061
  if ( $type == "type_address" ) {
2062
  if ( $value == '*#*#*#' ) {
2104
  }
2105
 
2106
  if ( $form->savedb ) {
2107
+ $submition_data = array(
2108
  'form_id' => $id,
2109
  'element_label' => $i,
2110
  'element_value' => stripslashes( $value ),
2111
  'group_id' => $group_id,
2112
  'date' => date( 'Y-m-d H:i:s' ),
2113
+ );
2114
+ if ( $form->save_ip ) {
2115
+ $submition_data['ip'] = $_SERVER['REMOTE_ADDR'];
2116
+ }
2117
+ if ( $form->save_user_id ) {
2118
+ $submition_data['user_id_wd'] = $current_user->ID;
2119
+ }
2120
+
2121
+ $save_or_no = $wpdb->insert( $wpdb->prefix . "formmaker_submits", $submition_data );
 
 
2122
  }
2123
  if ( !$save_or_no ) {
2124
  return array( 'error' => true, 'group_id' => $group_id, 'message' => addslashes( __( 'Database error occurred. Please try again.', WDFMInstance(self::PLUGIN)->prefix ) ) );
2194
  $business = $form->paypal_email;
2195
  $ip = $_SERVER[ 'REMOTE_ADDR' ];
2196
  $total2 = round( $total, 2 );
2197
+
2198
+ $submition_data = array();
2199
+
2200
+ $submition_data['form_id'] = $id;
2201
+ $submition_data['element_label'] = 'item_total';
2202
+ $submition_data['element_value'] = $form_currency . $total2;
2203
+ $submition_data['group_id'] = $group_id;
2204
+ $submition_data['date'] = date( 'Y-m-d H:i:s' );
2205
+ if ( $form->save_ip ) {
2206
+ $submition_data['ip'] = $ip;
2207
+ }
2208
+ if ( $form->save_user_id ) {
2209
+ $submition_data['user_id_wd'] = $current_user->ID;
2210
+ }
2211
+
2212
+ $save_or_no = $wpdb->insert( $wpdb->prefix . "formmaker_submits", $submition_data );
2213
+
2214
  if ( !$save_or_no ) {
2215
  return array( 'error' => true, 'group_id' => $group_id, 'message' => addslashes( __( 'Database error occurred. Please try again.', WDFMInstance(self::PLUGIN)->prefix ) ) );
2216
  }
2219
  $total = $total + $paypal[ 'shipping' ];
2220
  }
2221
  $total = round( $total, 2 );
2222
+
2223
+ $submition_data['element_label'] = 'total';
2224
+ $submition_data['element_value'] = $form_currency . $total;
2225
+
2226
+ $save_or_no = $wpdb->insert( $wpdb->prefix . "formmaker_submits", $submition_data );
2227
+
 
 
 
 
 
 
 
 
 
 
 
2228
  if ( !$save_or_no ) {
2229
  return array( 'error' => true, 'group_id' => $group_id, 'message' => addslashes( __( 'Database error occurred. Please try again.', WDFMInstance(self::PLUGIN)->prefix ) ) );
2230
  }
2231
+
2232
+ $submition_data['element_label'] = '0';
2233
+ $submition_data['element_value'] = 'In progress';
2234
+
2235
+ $save_or_no = $wpdb->insert( $wpdb->prefix . "formmaker_submits", $submition_data );
2236
+
 
 
 
 
 
 
 
 
 
 
 
2237
  if ( !$save_or_no ) {
2238
  return array( 'error' => true, 'group_id' => $group_id, 'message' => addslashes( __( 'Database error occurred. Please try again.', WDFMInstance(self::PLUGIN)->prefix ) ) );
2239
  }
2287
  foreach ( $send_tos as $send_index => $send_to ) {
2288
  $_SESSION[ 'hash' ][] = md5( $ip . time() . rand() );
2289
  $send_to = str_replace( '*', '', $send_to );
2290
+
2291
+ $submition_data = array(
2292
  'form_id' => $id,
2293
  'element_label' => 'verifyInfo@' . $send_to,
2294
  'element_value' => $_SESSION[ 'hash' ][ $send_index ] . "**" . $form->mail_verify_expiretime . "**" . $send_to,
2295
  'group_id' => $group_id,
2296
  'date' => date( 'Y-m-d H:i:s' ),
2297
+ );
2298
+ if ( $form->save_ip ) {
2299
+ $submition_data['ip'] = $ip;
2300
+ }
2301
+ if ( $form->save_user_id ) {
2302
+ $submition_data['user_id_wd'] = $current_user->ID;
2303
+ }
2304
+
2305
+ $save_or_no = $wpdb->insert( $wpdb->prefix . "formmaker_submits", $submition_data );
2306
+
 
2307
  if ( !$save_or_no ) {
2308
  return array( 'error' => true, 'group_id' => $group_id, 'message' => addslashes( __( 'Database error occurred. Please try again.', WDFMInstance(self::PLUGIN)->prefix ) ) );
2309
  }
2339
 
2340
  do_action( 'fm_addon_frontend_init', $frontend_parmas );
2341
  }
2342
+ $return_value = array( 'group_id' => $group_id, 'all_files' => $all_files, 'redirect_url' => $str );
2343
+ $return_value = apply_filters('fm_save_submission_return_value', $return_value);
2344
+ return $return_value;
2345
  }
2346
 
2347
  /**
2367
  }
2368
 
2369
  /**
2370
+ * Remove.
2371
+ *
2372
+ * @param int $group_id
2373
  */
2374
+ public function remove( $group_id = 0 ) {
2375
  global $wpdb;
2376
  $wpdb->query( $wpdb->prepare( 'DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id= %d', $group_id ) );
2377
  }
2378
 
2379
  /**
2380
+ * Get after submission text.
2381
+ *
2382
+ * @param int $form_id
2383
+ * @param int $group_id
2384
  *
2385
  * @return mixed|null|string
2386
  */
2387
+ public function get_after_submission_text( $form_id = 0, $group_id = 0 ) {
2388
  global $wpdb;
2389
  $submit_text = $wpdb->get_var( "SELECT submit_text FROM " . $wpdb->prefix . "formmaker WHERE id='" . $form_id . "'" );
2390
  $current_user = wp_get_current_user();
2451
  }
2452
 
2453
  /**
2454
+ * Increment views count.
2455
+ *
2456
  * @param $id
2457
  */
2458
+ public function increment_views_count( $id = 0 ) {
2459
  global $wpdb;
2460
  $vives_form = $wpdb->get_var( $wpdb->prepare( "SELECT views FROM " . $wpdb->prefix . "formmaker_views WHERE form_id=%d", $id ) );
2461
  if ( isset( $vives_form ) ) {
2477
  }
2478
 
2479
  /**
2480
+ * Gen mail.
 
 
 
2481
  *
2482
+ * @param int $group_id
2483
+ * @param array $all_files
2484
+ * @param int $id
2485
+ * @param string $str
2486
  * @return array
2487
  */
2488
+ public function gen_mail( $group_id = 0, $all_files = array(), $id = 0, $str = '' ) {
2489
  global $wpdb;
2490
  WDW_FM_Library(self::PLUGIN)->start_session();
2491
  // checking save uploads option
2551
  }
2552
  $disabled_fields = explode( ',', WDW_FM_Library(self::PLUGIN)->get('disabled_fields', '') );
2553
  $disabled_fields = array_slice( $disabled_fields, 0, count( $disabled_fields ) - 1 );
2554
+ $list = '<table cellpadding="3" cellspacing="0" style="width: 600px; border-bottom: 1px solid #CCC; border-right: 1px solid #CCC;">';
2555
  $list_text_mode = '';
2556
+ $td_style = ' style="border-top: 1px solid #CCC; border-left: 1px solid #CCC; padding: 10px; color: #3D3D3D;"';
2557
  foreach ( $label_order_ids as $key => $label_order_id ) {
2558
  $i = $label_order_id;
2559
  $type = $label_type[ $i ];
2571
  case "type_phone_new": {
2572
  $element = isset( $_POST[ 'wdform_' . $i . "_element" . $id ] ) ? $_POST[ 'wdform_' . $i . "_element" . $id ] : NULL;
2573
  if ( isset( $element ) && $this->empty_field( $element, $row->mail_emptyfields ) ) {
2574
+ $list = $list . '<tr valign="top"><td ' . $td_style . '>' . $element_label . '</td><td ' . $td_style . '>' . $element . '</td></tr>';
2575
  $list_text_mode = $list_text_mode . $element_label . ' - ' . $element . "\r\n";
2576
  }
2577
  break;
2581
  $element1 = isset( $_POST[ 'wdform_' . $i . "_element" . $id . "1" ] ) ? $_POST[ 'wdform_' . $i . "_element" . $id . "1" ] : NULL;
2582
  if ( isset( $element0 ) && $this->empty_field( $element0, $row->mail_emptyfields ) && $this->empty_field( $element1, $row->mail_emptyfields ) ) {
2583
  $element = $element0 . ' - ' . $element1;
2584
+ $list = $list . '<tr valign="top"><td ' . $td_style . '>' . $element_label . '</td><td ' . $td_style . '>' . $element . '</td></tr>';
2585
  $list_text_mode = $list_text_mode . $element_label . ' - ' . $element . "\r\n";
2586
  }
2587
  break;
2589
  case 'type_textarea': {
2590
  $element = isset( $_POST[ 'wdform_' . $i . "_element" . $id ] ) ? wpautop( $_POST[ 'wdform_' . $i . "_element" . $id ] ) : NULL;
2591
  if ( isset( $element ) && $this->empty_field( $element, $row->mail_emptyfields ) ) {
2592
+ $list = $list . '<tr valign="top"><td ' . $td_style . '>' . $element_label . '</td><td ' . $td_style . '>' . $element . '</td></tr>';
2593
  $list_text_mode = $list_text_mode . $element_label . ' - ' . $element . "\r\n";
2594
  }
2595
  break;
2597
  case "type_hidden": {
2598
  $element = isset( $_POST[ $element_label ] ) ? $_POST[ $element_label ] : NULL;
2599
  if ( isset( $element ) && $this->empty_field( $element, $row->mail_emptyfields ) ) {
2600
+ $list = $list . '<tr valign="top"><td ' . $td_style . '>' . $element_label . '</td><td ' . $td_style . '>' . $element . '</td></tr>';
2601
  $list_text_mode = $list_text_mode . $element_label . ' - ' . $element . "\r\n";
2602
  }
2603
  break;
2605
  case "type_mark_map": {
2606
  $element = isset( $_POST[ 'wdform_' . $i . "_long" . $id ] ) ? $_POST[ 'wdform_' . $i . "_long" . $id ] : NULL;
2607
  if ( isset( $element ) && $this->empty_field( $element, $row->mail_emptyfields ) ) {
2608
+ $list = $list . '<tr valign="top"><td ' . $td_style . '>' . $element_label . '</td><td ' . $td_style . '>Longitude:' . $element . '<br/>Latitude:' . (isset( $_POST[ 'wdform_' . $i . "_lat" . $id ] ) ? $_POST[ 'wdform_' . $i . "_lat" . $id ] : "") . '</td></tr>';
2609
  $list_text_mode = $list_text_mode . $element_label . ' - Longitude:' . $element . ' Latitude:' . (isset( $_POST[ 'wdform_' . $i . "_lat" . $id ] ) ? $_POST[ 'wdform_' . $i . "_lat" . $id ] : "") . "\r\n";
2610
  }
2611
  break;
2613
  case "type_submitter_mail": {
2614
  $element = isset( $_POST[ 'wdform_' . $i . "_element" . $id ] ) ? $_POST[ 'wdform_' . $i . "_element" . $id ] : NULL;
2615
  if ( isset( $element ) && $this->empty_field( $element, $row->mail_emptyfields ) ) {
2616
+ $list = $list . '<tr valign="top"><td ' . $td_style . ' >' . $element_label . '</td><td ' . $td_style . ' >' . $element . '</td></tr>';
2617
  $list_text_mode = $list_text_mode . $element_label . ' - ' . $element . "\r\n";
2618
  }
2619
  break;
2623
  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 )) ) {
2624
  $ss = isset( $_POST[ 'wdform_' . $i . "_ss" . $id ] ) ? $_POST[ 'wdform_' . $i . "_ss" . $id ] : NULL;
2625
  if ( isset( $ss ) ) {
2626
+ $list = $list . '<tr valign="top"><td ' . $td_style . ' >' . $element_label . '</td><td ' . $td_style . ' >' . $hh . ':' . (isset( $_POST[ 'wdform_' . $i . "_mm" . $id ] ) ? $_POST[ 'wdform_' . $i . "_mm" . $id ] : "") . ':' . $ss;
2627
  $list_text_mode = $list_text_mode . $element_label . ' - ' . $hh . ':' . (isset( $_POST[ 'wdform_' . $i . "_mm" . $id ] ) ? $_POST[ 'wdform_' . $i . "_mm" . $id ] : "") . ':' . $ss;
2628
  } else {
2629
+ $list = $list . '<tr valign="top"><td ' . $td_style . ' >' . $element_label . '</td><td ' . $td_style . ' >' . $hh . ':' . (isset( $_POST[ 'wdform_' . $i . "_mm" . $id ] ) ? $_POST[ 'wdform_' . $i . "_mm" . $id ] : "");
2630
  $list_text_mode = $list_text_mode . $element_label . ' - ' . $hh . ':' . (isset( $_POST[ 'wdform_' . $i . "_mm" . $id ] ) ? $_POST[ 'wdform_' . $i . "_mm" . $id ] : "");
2631
  }
2632
  $am_pm = isset( $_POST[ 'wdform_' . $i . "_am_pm" . $id ] ) ? $_POST[ 'wdform_' . $i . "_am_pm" . $id ] : NULL;
2643
  case "type_phone": {
2644
  $element_first = isset( $_POST[ 'wdform_' . $i . "_element_first" . $id ] ) ? $_POST[ 'wdform_' . $i . "_element_first" . $id ] : NULL;
2645
  if ( isset( $element_first ) && $this->empty_field( $element_first, $row->mail_emptyfields ) ) {
2646
+ $list = $list . '<tr valign="top"><td ' . $td_style . ' >' . $element_label . '</td><td ' . $td_style . ' >' . $element_first . ' ' . (isset( $_POST[ 'wdform_' . $i . "_element_last" . $id ] ) ? $_POST[ 'wdform_' . $i . "_element_last" . $id ] : "") . '</td></tr>';
2647
  $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";
2648
  }
2649
  break;
2654
  $element_title = isset( $_POST[ 'wdform_' . $i . "_element_title" . $id ] ) ? $_POST[ 'wdform_' . $i . "_element_title" . $id ] : NULL;
2655
  $element_middle = isset( $_POST[ 'wdform_' . $i . "_element_middle" . $id ] ) ? esc_html( $_POST[ 'wdform_' . $i . "_element_middle" . $id ] ) : NULL;
2656
  if ( (isset( $element_title ) || isset( $element_middle )) && ($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 )) ) {
2657
+ $list = $list . '<tr valign="top"><td ' . $td_style . ' >' . $element_label . '</td><td ' . $td_style . ' >' . (isset( $_POST[ 'wdform_' . $i . "_element_title" . $id ] ) ? $_POST[ 'wdform_' . $i . "_element_title" . $id ] : '') . ' ' . $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>';
2658
  $list_text_mode = $list_text_mode . $element_label . ' - ' . (isset( $_POST[ 'wdform_' . $i . "_element_title" . $id ] ) ? $_POST[ 'wdform_' . $i . "_element_title" . $id ] : '') . ' ' . $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";
2659
  } else {
2660
  if ( $this->empty_field( $element_first, $row->mail_emptyfields ) || $this->empty_field( $_POST[ 'wdform_' . $i . "_element_last" . $id ], $row->mail_emptyfields ) ) {
2661
+ $list = $list . '<tr valign="top"><td ' . $td_style . ' >' . $element_label . '</td><td ' . $td_style . ' >' . $element_first . ' ' . (isset( $_POST[ 'wdform_' . $i . "_element_last" . $id ] ) ? $_POST[ 'wdform_' . $i . "_element_last" . $id ] : "") . '</td></tr>';
2662
  $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";
2663
  }
2664
  }
2668
  case "type_address": {
2669
  $element = isset( $_POST[ 'wdform_' . $i . "_street1" . $id ] ) ? $_POST[ 'wdform_' . $i . "_street1" . $id ] : NULL;
2670
  if ( isset( $element ) && $this->empty_field( $element, $row->mail_emptyfields ) ) {
2671
+ $list = $list . '<tr valign="top"><td ' . $td_style . ' >' . $label_order_original[ $i ] . '</td><td ' . $td_style . ' >' . $element . '</td></tr>';
2672
  $list_text_mode = $list_text_mode . $label_order_original[ $i ] . ' - ' . $element . "\r\n";
2673
  break;
2674
  }
2675
  $element = isset( $_POST[ 'wdform_' . $i . "_street2" . $id ] ) ? $_POST[ 'wdform_' . $i . "_street2" . $id ] : NULL;
2676
  if ( isset( $element ) && $this->empty_field( $element, $row->mail_emptyfields ) ) {
2677
+ $list = $list . '<tr valign="top"><td ' . $td_style . ' >' . $label_order_original[ $i ] . '</td><td ' . $td_style . ' >' . $element . '</td></tr>';
2678
  $list_text_mode = $list_text_mode . $label_order_original[ $i ] . ' - ' . $element . "\r\n";
2679
  break;
2680
  }
2681
  $element = isset( $_POST[ 'wdform_' . $i . "_city" . $id ] ) ? $_POST[ 'wdform_' . $i . "_city" . $id ] : NULL;
2682
  if ( isset( $element ) && $this->empty_field( $element, $row->mail_emptyfields ) ) {
2683
+ $list = $list . '<tr valign="top"><td ' . $td_style . ' >' . $label_order_original[ $i ] . '</td><td ' . $td_style . ' >' . $element . '</td></tr>';
2684
  $list_text_mode = $list_text_mode . $label_order_original[ $i ] . ' - ' . $element . "\r\n";
2685
  break;
2686
  }
2687
  $element = isset( $_POST[ 'wdform_' . $i . "_state" . $id ] ) ? $_POST[ 'wdform_' . $i . "_state" . $id ] : NULL;
2688
  if ( isset( $element ) && $this->empty_field( $element, $row->mail_emptyfields ) ) {
2689
+ $list = $list . '<tr valign="top"><td ' . $td_style . ' >' . $label_order_original[ $i ] . '</td><td ' . $td_style . ' >' . $element . '</td></tr>';
2690
  $list_text_mode = $list_text_mode . $label_order_original[ $i ] . ' - ' . $element . "\r\n";
2691
  break;
2692
  }
2693
  $element = isset( $_POST[ 'wdform_' . $i . "_postal" . $id ] ) ? $_POST[ 'wdform_' . $i . "_postal" . $id ] : NULL;
2694
  if ( isset( $element ) && $this->empty_field( $element, $row->mail_emptyfields ) ) {
2695
+ $list = $list . '<tr valign="top"><td ' . $td_style . ' >' . $label_order_original[ $i ] . '</td><td ' . $td_style . ' >' . $element . '</td></tr>';
2696
  $list_text_mode = $list_text_mode . $label_order_original[ $i ] . ' - ' . $element . "\r\n";
2697
  break;
2698
  }
2699
  $element = isset( $_POST[ 'wdform_' . $i . "_country" . $id ] ) ? $_POST[ 'wdform_' . $i . "_country" . $id ] : NULL;
2700
  if ( isset( $element ) && $this->empty_field( $element, $row->mail_emptyfields ) ) {
2701
+ $list = $list . '<tr valign="top"><td ' . $td_style . ' >' . $label_order_original[ $i ] . '</td><td ' . $td_style . ' >' . $element . '</td></tr>';
2702
  $list_text_mode = $list_text_mode . $label_order_original[ $i ] . ' - ' . $element . "\r\n";
2703
  break;
2704
  }
2709
  $month = isset( $_POST[ 'wdform_' . $i . "_month" . $id ] ) ? $_POST[ 'wdform_' . $i . "_month" . $id ] : "";
2710
  $year = isset( $_POST[ 'wdform_' . $i . "_year" . $id ] ) ? $_POST[ 'wdform_' . $i . "_year" . $id ] : "";
2711
  if ( isset( $day ) && $this->empty_field( $day, $row->mail_emptyfields ) ) {
2712
+ $list = $list . '<tr valign="top"><td ' . $td_style . ' >' . $element_label . '</td><td ' . $td_style . ' >' . (($day || $month || $year) ? $day . '-' . $month . '-' . $year : '') . '</td></tr>';
2713
  $list_text_mode = $list_text_mode . $element_label . (($day || $month || $year) ? $day . '-' . $month . '-' . $year : '') . "\r\n";
2714
  }
2715
  break;
2717
  case "type_radio": {
2718
  $element = isset( $_POST[ 'wdform_' . $i . "_other_input" . $id ] ) ? $_POST[ 'wdform_' . $i . "_other_input" . $id ] : NULL;
2719
  if ( isset( $element ) && $this->empty_field( $element, $row->mail_emptyfields ) ) {
2720
+ $list = $list . '<tr valign="top"><td ' . $td_style . ' >' . $element_label . '</td><td ' . $td_style . ' >' . $element . '</td></tr>';
2721
  $list_text_mode = $list_text_mode . $element_label . ' - ' . $element . "\r\n";
2722
  break;
2723
  }
2724
  $element = isset( $_POST[ 'wdform_' . $i . "_element" . $id ] ) ? $_POST[ 'wdform_' . $i . "_element" . $id ] : NULL;
2725
  if ( isset( $element ) && $this->empty_field( $element, $row->mail_emptyfields ) ) {
2726
+ $list = $list . '<tr valign="top"><td ' . $td_style . ' >' . $element_label . '</td><td ' . $td_style . ' >' . $element . '</td></tr>';
2727
  $list_text_mode = $list_text_mode . $element_label . ' - ' . $element . "\r\n";
2728
  }
2729
  break;
2743
  $other_element_id = isset( $_POST[ 'wdform_' . $i . "_allow_other_num" . $id ] ) ? $_POST[ 'wdform_' . $i . "_allow_other_num" . $id ] : "";
2744
  }
2745
  if ( $start != -1 || ($start == -1 && $row->mail_emptyfields) ) {
2746
+ $list = $list . '<tr valign="top"><td ' . $td_style . ' >' . $element_label . '</td><td ' . $td_style . ' >';
2747
  $list_text_mode = $list_text_mode . $element_label . ' - ';
2748
  }
2749
  if ( $start != -1 ) {
2775
  $value = $value . '.' . $_POST[ 'wdform_' . $i . "_element_cents" . $id ];
2776
  }
2777
  if ( $this->empty_field( $value, $row->mail_emptyfields ) && $value != '.' ) {
2778
+ $list = $list . '<tr valign="top"><td ' . $td_style . ' >' . $element_label . '</td><td ' . $td_style . ' >' . $value . $form_currency . '</td></tr>';
2779
  $list_text_mode = $list_text_mode . $element_label . ' - ' . $value . $form_currency . "\r\n";
2780
  }
2781
  break;
2786
  $value = $_POST[ 'wdform_' . $i . "_element" . $id ];
2787
  }
2788
  if ( $this->empty_field( $value, $row->mail_emptyfields ) && $value != '.' ) {
2789
+ $list = $list . '<tr valign="top"><td ' . $td_style . ' >' . $element_label . '</td><td ' . $td_style . ' >' . ($value == '' ? '' : $form_currency) . $value . '</td></tr>';
2790
  $list_text_mode = $list_text_mode . $element_label . ' - ' . $value . $form_currency . "\r\n";
2791
  }
2792
  break;
2800
  $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;
2801
  $element_quantity = (isset( $_POST[ 'wdform_' . $i . "_element_quantity" . $id ] ) && $_POST[ 'wdform_' . $i . "_element_quantity" . $id ]) ? $_POST[ 'wdform_' . $i . "_element_quantity" . $id ] : NULL;
2802
  if ( $value != '' ) {
2803
+ if ( $is_element_quantity ) {
2804
+ $value .= '<br/>' . $element_quantity_label . ': ' . (($element_quantity == NULL) ? 0 : $element_quantity);
2805
+ }
2806
+ for ( $k = 0; $k < 50; $k++ ) {
2807
  $temp_val = isset( $_POST[ 'wdform_' . $i . "_property" . $id . $k ] ) ? $_POST[ 'wdform_' . $i . "_property" . $id . $k ] : NULL;
2808
  if ( isset( $temp_val ) ) {
2809
  $value .= '<br/>' . (isset( $_POST[ 'wdform_' . $i . "_element_property_label" . $id . $k ] ) ? $_POST[ 'wdform_' . $i . "_element_property_label" . $id . $k ] : "") . ': ' . $temp_val;
2811
  }
2812
  }
2813
  if ( $this->empty_field( $value, $row->mail_emptyfields ) ) {
2814
+ $list = $list . '<tr valign="top"><td ' . $td_style . ' >' . $element_label . '</td><td ' . $td_style . ' >' . $value . '</td></tr>';
2815
  $list_text_mode = $list_text_mode . $element_label . ' - ' . str_replace( '<br/>', ', ', $value ) . "\r\n";
2816
  }
2817
  break;
2823
  $is_element_quantity = isset( $_POST[ 'wdform_' . $i . "_element_quantity" . $id ] ) ? TRUE : FALSE;
2824
  $element_quantity_label = isset( $_POST[ 'wdform_' . $i . "_element_quantity_label" . $id ] ) ? $_POST[ 'wdform_' . $i . "_element_quantity_label" . $id ] : NULL;
2825
  $element_quantity = (isset( $_POST[ 'wdform_' . $i . "_element_quantity" . $id ] ) && $_POST[ 'wdform_' . $i . "_element_quantity" . $id ]) ? $_POST[ 'wdform_' . $i . "_element_quantity" . $id ] : NULL;
2826
+ if ( !empty($is_element_quantity) ) {
2827
+ $value .= '<br/>' . $element_quantity_label . ': ' . (($element_quantity == NULL) ? 0 : $element_quantity);
2828
+ }
2829
  for ( $k = 0; $k < 50; $k++ ) {
2830
  $temp_val = isset( $_POST[ 'wdform_' . $i . "_property" . $id . $k ] ) ? $_POST[ 'wdform_' . $i . "_property" . $id . $k ] : NULL;
2831
  if ( isset( $temp_val ) ) {
2834
  }
2835
  }
2836
  if ( $this->empty_field( $value, $row->mail_emptyfields ) ) {
2837
+ $list = $list . '<tr valign="top"><td ' . $td_style . ' >' . $element_label . '</td><td ' . $td_style . ' >' . $value . '</td></tr>';
2838
  $list_text_mode = $list_text_mode . $element_label . ' - ' . str_replace( '<br/>', ', ', $value ) . "\r\n";
2839
  }
2840
  break;
2843
  if ( isset( $_POST[ 'wdform_' . $i . "_element" . $id ] ) ) {
2844
  $value = $_POST[ 'wdform_' . $i . "_element_label" . $id ] . ' : ' . $form_currency . (isset( $_POST[ 'wdform_' . $i . "_element" . $id ] ) ? $_POST[ 'wdform_' . $i . "_element" . $id ] : "");
2845
  if ( $this->empty_field( $value, $row->mail_emptyfields ) ) {
2846
+ $list = $list . '<tr valign="top"><td ' . $td_style . ' >' . $element_label . '</td><td ' . $td_style . ' >' . $value . '</td></tr>';
2847
  $list_text_mode = $list_text_mode . $element_label . ' - ' . $value . "\r\n";
2848
  }
2849
  } else {
2861
  }
2862
  }
2863
  if ( $start != -1 || ($start == -1 && $row->mail_emptyfields) ) {
2864
+ $list = $list . '<tr valign="top"><td ' . $td_style . '>' . $element_label . '</td><td ' . $td_style . '>';
2865
  $list_text_mode = $list_text_mode . $element_label . ' - ';
2866
  }
2867
  if ( $start != -1 ) {
2878
  $element_quantity_label = isset( $_POST[ 'wdform_' . $i . "_element_quantity_label" . $id ] ) ? $_POST[ 'wdform_' . $i . "_element_quantity_label" . $id ] : NULL;
2879
  $element_quantity = (isset( $_POST[ 'wdform_' . $i . "_element_quantity" . $id ] ) && $_POST[ 'wdform_' . $i . "_element_quantity" . $id ]) ? $_POST[ 'wdform_' . $i . "_element_quantity" . $id ] : NULL;
2880
  if ( $is_element_quantity ) {
2881
+ $list = $list . $element_quantity_label . ': ' . (($element_quantity == NULL) ? 0 : $element_quantity);
2882
+ $list_text_mode = $list_text_mode . $element_quantity_label . ': ' . (($element_quantity == NULL) ? 0 : $element_quantity) . ', ';
2883
+ }
2884
  }
2885
  if ( $start != -1 ) {
2886
  for ( $k = 0; $k < 50; $k++ ) {
2900
  case "type_paypal_total": {
2901
  $element = isset( $_POST[ 'wdform_' . $i . "_paypal_total" . $id ] ) ? $_POST[ 'wdform_' . $i . "_paypal_total" . $id ] : "";
2902
  if ( $this->empty_field( $element, $row->mail_emptyfields ) ) {
2903
+ $list = $list . '<tr valign="top"><td ' . $td_style . ' >' . $element_label . '</td><td ' . $td_style . ' >' . $element . '</td></tr>';
2904
  $list_text_mode = $list_text_mode . $element_label . ' - ' . $element . "\r\n";
2905
  }
2906
  break;
2909
  $element = isset( $_POST[ 'wdform_' . $i . "_star_amount" . $id ] ) ? $_POST[ 'wdform_' . $i . "_star_amount" . $id ] : NULL;
2910
  $selected = isset( $_POST[ 'wdform_' . $i . "_selected_star_amount" . $id ] ) ? $_POST[ 'wdform_' . $i . "_selected_star_amount" . $id ] : 0;
2911
  if ( isset( $element ) && $this->empty_field( $selected, $row->mail_emptyfields ) ) {
2912
+ $list = $list . '<tr valign="top"><td ' . $td_style . ' >' . $element_label . '</td><td ' . $td_style . ' >' . $selected . '/' . $element . '</td></tr>';
2913
  $list_text_mode = $list_text_mode . $element_label . ' - ' . $selected . '/' . $element . "\r\n";
2914
  }
2915
  break;
2918
  $element = isset( $_POST[ 'wdform_' . $i . "_scale_amount" . $id ] ) ? $_POST[ 'wdform_' . $i . "_scale_amount" . $id ] : NULL;
2919
  $selected = isset( $_POST[ 'wdform_' . $i . "_scale_radio" . $id ] ) ? $_POST[ 'wdform_' . $i . "_scale_radio" . $id ] : 0;
2920
  if ( isset( $element ) && $this->empty_field( $selected, $row->mail_emptyfields ) ) {
2921
+ $list = $list . '<tr valign="top"><td ' . $td_style . ' >' . $element_label . '</td><td ' . $td_style . ' >' . $selected . '/' . $element . '</td></tr>';
2922
  $list_text_mode = $list_text_mode . $element_label . ' - ' . $selected . '/' . $element . "\r\n";
2923
  }
2924
  break;
2926
  case "type_spinner": {
2927
  $element = isset( $_POST[ 'wdform_' . $i . "_element" . $id ] ) ? $_POST[ 'wdform_' . $i . "_element" . $id ] : NULL;
2928
  if ( isset( $element ) && $this->empty_field( $element, $row->mail_emptyfields ) ) {
2929
+ $list = $list . '<tr valign="top"><td ' . $td_style . ' >' . $element_label . '</td><td ' . $td_style . ' >' . $element . '</td></tr>';
2930
  $list_text_mode = $list_text_mode . $element_label . ' - ' . $element . "\r\n";
2931
  }
2932
  break;
2934
  case "type_slider": {
2935
  $element = isset( $_POST[ 'wdform_' . $i . "_slider_value" . $id ] ) ? $_POST[ 'wdform_' . $i . "_slider_value" . $id ] : NULL;
2936
  if ( isset( $element ) && $this->empty_field( $element, $row->mail_emptyfields ) ) {
2937
+ $list = $list . '<tr valign="top"><td ' . $td_style . ' >' . $element_label . '</td><td ' . $td_style . ' >' . $element . '</td></tr>';
2938
  $list_text_mode = $list_text_mode . $element_label . ' - ' . $element . "\r\n";
2939
  }
2940
  break;
2943
  $element0 = isset( $_POST[ 'wdform_' . $i . "_element" . $id . '0' ] ) ? $_POST[ 'wdform_' . $i . "_element" . $id . '0' ] : NULL;
2944
  $element1 = isset( $_POST[ 'wdform_' . $i . "_element" . $id . '1' ] ) ? $_POST[ 'wdform_' . $i . "_element" . $id . '1' ] : NULL;
2945
  if ( (isset( $element0 ) && $this->empty_field( $element0, $row->mail_emptyfields )) || (isset( $element1 ) && $this->empty_field( $element1, $row->mail_emptyfields )) ) {
2946
+ $list = $list . '<tr valign="top"><td ' . $td_style . ' >' . $element_label . '</td><td ' . $td_style . ' >From: ' . $element0 . '<span style="margin-left:6px"> To </span>:' . $element1 . '</td></tr>';
2947
  $list_text_mode = $list_text_mode . $element_label . ' - From: ' . $element0 . ' To: ' . $element1 . "\r\n";
2948
  }
2949
  break;
2964
  }
2965
  $element .= "Total: " . $total;
2966
  if ( isset( $element ) && $this->empty_field( $form_empty_field, $row->mail_emptyfields ) ) {
2967
+ $list = $list . '<tr valign="top"><td ' . $td_style . '>' . $element_label . '</td><td ' . $td_style . ' >' . $element . '</td></tr>';
2968
  $list_text_mode = $list_text_mode . $element_label . ' - ' . $element . "\r\n";
2969
  }
2970
  break;
2976
  $rows_count = sizeof( $mat_rows ) - 1;
2977
  $mat_columns = explode( "***", isset( $_POST[ 'wdform_' . $i . "_hidden_column" . $id ] ) ? $_POST[ 'wdform_' . $i . "_hidden_column" . $id ] : "" );
2978
  $columns_count = sizeof( $mat_columns ) - 1;
2979
+ $matrix = '<table cellpadding="3" cellspacing="0" style="width: 600px; border-bottom: 1px solid #CCC; border-right: 1px solid #CCC;">';
2980
+ $matrix .= '<tr><td ' . $td_style . '></td>';
2981
  for ( $k = 1; $k < count( $mat_columns ); $k++ ) {
2982
+ $matrix .= '<td style="border-top: 1px solid #CCC; border-left: 1px solid #CCC; padding: 10px; color: #3D3D3D; background-color: #EEEEEE; padding: 5px; ">' . $mat_columns[ $k ] . '</td>';
2983
  }
2984
  $matrix .= '</tr>';
2985
  $aaa = Array();
2986
  for ( $k = 1; $k <= $rows_count; $k++ ) {
2987
+ $matrix .= '<tr><td style="border-top: 1px solid #CCC; border-left: 1px solid #CCC; padding: 10px; color: #3D3D3D; background-color: #EEEEEE; padding: 5px;">' . $mat_rows[ $k ] . '</td>';
2988
  if ( $input_type == "radio" ) {
2989
  $mat_radio = isset( $_POST[ 'wdform_' . $i . "_input_element" . $id . $k ] ) ? $_POST[ 'wdform_' . $i . "_input_element" . $id . $k ] : 0;
2990
  if ( $mat_radio == 0 ) {
3001
  $checked = "";
3002
  }
3003
  $sign = $checked == 'checked' ? '&#10004;' : '';
3004
+ $matrix .= '<td style="border-top: 1px solid #CCC; border-left: 1px solid #CCC; padding: 10px; color: #3D3D3D; text-align: center;">' . $sign . '</td>';
3005
  }
3006
  } else {
3007
  if ( $input_type == "checkbox" ) {
3014
  $checked = "";
3015
  }
3016
  $sign = $checked == 'checked' ? '&#10004;' : '';
3017
+ $matrix .= '<td style="border-top: 1px solid #CCC; border-left: 1px solid #CCC; padding: 10px; color: #3D3D3D; text-align: center;">' . $sign . '</td>';
3018
  }
3019
  } else {
3020
  if ( $input_type == "text" ) {
3023
  if ( $checked ) {
3024
  $form_empty_field = 1;
3025
  }
3026
+ $matrix .= '<td style="border-top: 1px solid #CCC; border-left: 1px solid #CCC; padding: 10px; color: #3D3D3D; text-align: center;">' . $checked . '</td>';
3027
  }
3028
  } else {
3029
  for ( $j = 1; $j <= $columns_count; $j++ ) {
3031
  if ( $checked ) {
3032
  $form_empty_field = 1;
3033
  }
3034
+ $matrix .= '<td style="border-top: 1px solid #CCC; border-left: 1px solid #CCC; padding: 10px; color: #3D3D3D; text-align: center;">' . $checked . '</td>';
3035
  }
3036
  }
3037
  }
3040
  }
3041
  $matrix .= '</table>';
3042
  if ( isset( $matrix ) && $this->empty_field( $form_empty_field, $row->mail_emptyfields ) ) {
3043
+ $list = $list . '<tr valign="top"><td ' . $td_style . ' >' . $element_label . '</td><td ' . $td_style . ' >' . $matrix . '</td></tr>';
3044
  }
3045
  break;
3046
  }
3051
  }
3052
  }
3053
  $list = $list . '</table>';
3054
+
3055
+ // User part.
3056
  if ( $row->sendemail ) {
3057
  $fromname = $row->mail_from_name_user;
3058
+ $from_email = $row->mail_from_user;
3059
  $subject = !empty( $row->mail_subject_user ) ? $row->mail_subject_user : $row->title;
3060
  $attachment_user = array();
3061
  if ( !WDFMInstance(self::PLUGIN)->is_demo ) {
3121
  foreach ( $this->custom_fields as $key => $custom_field ) {
3122
  $new_script = str_replace( array( '%' . $key . '%', '{' . $key . '}' ), $custom_field, $new_script );
3123
  $fromname = str_replace( array( '%' . $key . '%', '{' . $key . '}' ), $custom_field, $fromname );
3124
+ $from_email = str_replace( array( '%' . $key . '%', '{' . $key . '}' ), $custom_field, $from_email );
3125
  $subject = str_replace( array( '%' . $key . '%', '{' . $key . '}' ), $custom_field, $subject );
3126
  }
3127
+ if ( $fromname === '' ) {
3128
+ $fromname = get_bloginfo('name');
3129
+ }
3130
 
3131
  $header_arr = array();
3132
  if ( $row->mail_from_user != '' ) {
3133
+ $header_arr[ 'from' ] = $from_email;
3134
  }
3135
  $header_arr['from_name'] = $fromname;
3136
  $header_arr['content_type'] = $content_type;
3153
  $send_copy = isset( $_POST[ "wdform_send_copy_" . $id ] ) ? $_POST[ "wdform_send_copy_" . $id ] : NULL;
3154
  if ( isset( $send_copy ) ) {
3155
  $send = TRUE;
3156
+ }
3157
+ else {
3158
  $mail_verification_post_id = (int)$wpdb->get_var( $wpdb->prepare( 'SELECT mail_verification_post_id FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id ) );
3159
  $verification_link = get_post( $mail_verification_post_id );
3160
 
3191
  }
3192
  }
3193
  }
3194
+
3195
+ // Admin part.
3196
  if ( $row->sendemail ) {
3197
  $recipient = $row->mail ? $row->mail : '';
3198
  $subject = !empty( $row->mail_subject ) ? $row->mail_subject : $row->title;
3199
 
3200
  $fromname = $row->from_name;
3201
+ $from_mail = $row->from_mail;
3202
  $attachment = array();
3203
  if ( !WDFMInstance(self::PLUGIN)->is_demo ) {
3204
  for ( $k = 0; $k < count( $all_files ); $k++ ) {
3265
  }
3266
  $this->custom_fields['all'] = $list;
3267
 
3268
+ foreach ( $this->custom_fields as $key => $custom_field ) {
3269
  $new_script = str_replace( array( '%' . $key . '%', '{' . $key . '}' ), $custom_field, $new_script );
3270
  $recipient = str_replace( array( '%' . $key . '%', '{' . $key . '}' ), $custom_field, $recipient);
3271
  $fromname = str_replace( array( '%' . $key . '%', '{' . $key . '}' ), $custom_field, $fromname );
3272
+ $from_mail = str_replace( array( '%' . $key . '%', '{' . $key . '}' ), $custom_field, $from_mail );
3273
  $subject = str_replace( array( '%' . $key . '%', '{' . $key . '}' ), $custom_field, $subject );
3274
  }
3275
+ if ( $fromname === '' ) {
3276
+ $fromname = get_bloginfo('name');
3277
+ }
3278
  if ( $row->from_mail ) {
3279
+ $header_arr[ 'from' ] = isset( $_POST['wdform_' . $row->from_mail . "_element" . $id] ) ? $_POST['wdform_' . $row->from_mail . "_element" . $id] : $from_mail;
3280
  }
3281
  $header_arr['from_name'] = $fromname;
3282
  $header_arr['content_type'] = $content_type;
3379
  }
3380
 
3381
  /**
3382
+ * Custom fields mail.
 
 
 
 
 
3383
  *
3384
+ * @param string $type
3385
+ * @param string $key
3386
+ * @param int $id
3387
+ * @param array $attachment
3388
+ * @param string $form_currency
3389
+ * @param int $file_upload_link
3390
+ * @return null|string $new_value
3391
  */
3392
+ public static function custom_fields_mail( $type = '', $key = '', $id = 0, $attachment = array(), $form_currency = '', $file_upload_link = 0 ) {
3393
  $new_value = "";
3394
  if ( $type != "type_submit_reset" or $type != "type_map" or $type != "type_editor" or $type != "type_captcha" or $type != "type_arithmetic_captcha" or $type != "type_recaptcha" or $type != "type_button" ) {
3395
  switch ( $type ) {
3618
  $is_element_quantity = isset( $_POST[ 'wdform_' . $key . "_element_quantity" . $id ] ) ? TRUE : FALSE;
3619
  $element_quantity_label = isset( $_POST[ 'wdform_' . $key . "_element_quantity_label" . $id ] ) ? $_POST[ 'wdform_' . $key . "_element_quantity_label" . $id ] : NULL;
3620
  $element_quantity = (isset( $_POST[ 'wdform_' . $key . "_element_quantity" . $id ] ) && $_POST[ 'wdform_' . $key . "_element_quantity" . $id ]) ? $_POST[ 'wdform_' . $key . "_element_quantity" . $id ] : NULL;
3621
+ if ( $is_element_quantity ) {
3622
+ $new_value .= '<br/>' . $element_quantity_label . ': ' . ( !(empty($element_quantity)) ? $element_quantity : 0);
3623
  }
3624
+ for ( $k = 0; $k < 50; $k++ ) {
3625
  $temp_val = isset( $_POST[ 'wdform_' . $key . "_property" . $id . $k ] ) ? $_POST[ 'wdform_' . $key . "_property" . $id . $k ] : NULL;
3626
  if ( isset( $temp_val ) ) {
3627
  $new_value .= '<br/>' . (isset( $_POST[ 'wdform_' . $key . "_element_property_label" . $id . $k ] ) ? $_POST[ 'wdform_' . $key . "_element_property_label" . $id . $k ] : "") . ': ' . $temp_val;
3635
  $is_element_quantity = isset( $_POST[ 'wdform_' . $key . "_element_quantity" . $id ] ) ? TRUE : FALSE;
3636
  $element_quantity_label = isset( $_POST[ 'wdform_' . $key . "_element_quantity_label" . $id ] ) ? $_POST[ 'wdform_' . $key . "_element_quantity_label" . $id ] : NULL;
3637
  $element_quantity = ( isset( $_POST[ 'wdform_' . $key . "_element_quantity" . $id ] ) && $_POST[ 'wdform_' . $key . "_element_quantity" . $id ]) ? $_POST[ 'wdform_' . $key . "_element_quantity" . $id ] : NULL;
3638
+ if ( $is_element_quantity ) {
3639
+ $new_value .= '<br/>'. $element_quantity_label . ': ' . ( (!empty($element_quantity)) ? $element_quantity : 0 );
3640
+ }
3641
  for ( $k = 0; $k < 50; $k++ ) {
3642
  $temp_val = isset( $_POST[ 'wdform_' . $key . "_property" . $id . $k ] ) ? $_POST[ 'wdform_' . $key . "_property" . $id . $k ] : NULL;
3643
  if ( isset( $temp_val ) ) {
3671
  $element_quantity_label = isset( $_POST[ 'wdform_' . $key . "_element_quantity_label" . $id ] ) ? $_POST[ 'wdform_' . $key . "_element_quantity_label" . $id ] : NULL;
3672
  $element_quantity = (isset( $_POST[ 'wdform_' . $key . "_element_quantity" . $id ] ) && $_POST[ 'wdform_' . $key . "_element_quantity" . $id ]) ? $_POST[ 'wdform_' . $key . "_element_quantity" . $id ] : NULL;
3673
  if ( $is_element_quantity ) {
3674
+ $new_value .= $element_quantity_label . ': ' . ( (!empty($element_quantity)) ? $element_quantity : 0 );
3675
+ }
3676
  for ( $k = 0; $k < 50; $k++ ) {
3677
  $temp_val = isset( $_POST[ 'wdform_' . $key . "_property" . $id . $k ] ) ? $_POST[ 'wdform_' . $key . "_property" . $id . $k ] : NULL;
3678
  if ( isset( $temp_val ) ) {
3813
  }
3814
 
3815
  /**
3816
+ * @param string $element
3817
+ * @param string $mail_emptyfields
3818
  *
3819
  * @return int
3820
  */
3821
+ public function empty_field( $element = '', $mail_emptyfields = '' ) {
3822
  if ( !$mail_emptyfields ) {
3823
  if ( empty( $element ) ) {
3824
  return 0;
3829
  }
3830
 
3831
  /**
3832
+ * @param string $date
3833
  * @param string $format
3834
  *
3835
  * @return bool
3836
  */
3837
+ public function fm_validateDate( $date = '', $format = 'Y-m-d H:i:s' ) {
3838
  $d = DateTime::createFromFormat( $format, $date );
3839
 
3840
  return $d && $d->format( $format ) == $date;
frontend/models/verify_email.php CHANGED
@@ -12,13 +12,13 @@ class FMModelVerify_email {
12
  /**
13
  * Set given email as validated and return message.
14
  *
15
- * @param $gid
16
- * @param $md5
17
- * @param $email
18
  *
19
  * @return bool|mixed|string|void
20
  */
21
- function set_validation( $gid, $md5, $email ) {
22
  global $wpdb;
23
  $query = $wpdb->prepare("SELECT * FROM `" . $wpdb->prefix . "formmaker_submits` WHERE group_id='%d' AND element_label REGEXP 'verifyInfo'", $gid);
24
  $submissions = $wpdb->get_results($query);
12
  /**
13
  * Set given email as validated and return message.
14
  *
15
+ * @param int $gid
16
+ * @param string $md5
17
+ * @param string $email
18
  *
19
  * @return bool|mixed|string|void
20
  */
21
+ function set_validation( $gid = 0, $md5 = '', $email = '' ) {
22
  global $wpdb;
23
  $query = $wpdb->prepare("SELECT * FROM `" . $wpdb->prefix . "formmaker_submits` WHERE group_id='%d' AND element_label REGEXP 'verifyInfo'", $gid);
24
  $submissions = $wpdb->get_results($query);
frontend/views/form_maker.php CHANGED
@@ -15,7 +15,7 @@ class FMViewForm_maker {
15
  *
16
  * @param $model
17
  */
18
- public function __construct( $model ) {
19
  $this->model = $model;
20
 
21
  wp_enqueue_script('jquery');
@@ -33,14 +33,14 @@ class FMViewForm_maker {
33
  /**
34
  * Display.
35
  *
36
- * @param $result
37
- * @param $fm_settings
38
- * @param $form_id
39
  * @param string $formType
40
  *
41
  * @return string
42
  */
43
- public function display( $result, $fm_settings, $form_id, $formType = 'embedded' ) {
44
  $current_user = wp_get_current_user();
45
  if ( $current_user->ID != 0 ) {
46
  $wp_username = $current_user->display_name;
@@ -381,9 +381,9 @@ class FMViewForm_maker {
381
  class="wd-width-100"
382
  id="wdform_' . $id1 . '_element' . $form_id . '"
383
  name="wdform_' . $id1 . '_element' . $form_id . '"
384
- value="' . $param['w_first_val'] . '"
385
- title="' . $param['w_title'] . '"
386
- placeholder="' . $param['w_title'] . '"
387
  ' . $readonly . '
388
  ' . $param['attributes'] . ' />';
389
  if ( isset($symbol_end[$id1]) ) {
@@ -440,8 +440,8 @@ class FMViewForm_maker {
440
  class="wd-width-100"
441
  id="wdform_' . $id1 . '_element' . $form_id . '"
442
  name="wdform_' . $id1 . '_element' . $form_id . '"
443
- value="' . $param['w_first_val'] . '"
444
- title="' . $param['w_title'] . '"
445
  ' . $param['attributes'] . '>
446
  </div>';
447
  $rep .= '</div>';
@@ -570,7 +570,7 @@ class FMViewForm_maker {
570
  $html = '<textarea class="wd-width-100"
571
  id="wdform_' . $id1 . '_element' . $form_id . '"
572
  name="wdform_' . $id1 . '_element' . $form_id . '"
573
- placeholder="' . $param['w_title'] . '"
574
  style="height: ' . $param['w_size_h'] . 'px;"
575
  ' . $param['attributes'] . '>' . $textarea_value . '</textarea>';
576
 
@@ -628,14 +628,14 @@ class FMViewForm_maker {
628
  $param['w_class'] .= ' wd-flex-row';
629
 
630
  $html = '<div class="wd-flex wd-flex-column wd-width-20">
631
- <input type="text" class="wd-phone-first" id="wdform_' . $id1 . '_element_first' . $form_id . '" name="wdform_' . $id1 . '_element_first' . $form_id . '" value="' . $w_first_val[0] . '" title="' . $w_title[0] . '" placeholder="' . $w_title[0] . '" ' . $param['attributes'] . '>
632
  <label for="wdform_' . $id1 . '_element_first' . $form_id . '" class="mini_label wd-flex-column">' . $w_mini_labels[0] . '</label>
633
  </div>
634
  <div>
635
  <div class="wd-flex wd-flex-column ">&nbsp;-&nbsp;</div>
636
  </div>
637
  <div class="wd-flex wd-flex-column wd-width-80">
638
- <input type="text" class="wd-flex-column wd-width-100" id="wdform_' . $id1 . '_element_last' . $form_id . '" name="wdform_' . $id1 . '_element_last' . $form_id . '" value="' . $w_first_val[1] . '" title="' . $w_title[1] . '" placeholder="' . $w_title[1] . '" ' . $param['attributes'] . ' />
639
  <label for="wdform_' . $id1 . '_element_last' . $form_id . '" class="wd-flex-column mini_label">' . $w_mini_labels[1] . '</label>
640
  </div>';
641
 
@@ -679,8 +679,8 @@ class FMViewForm_maker {
679
  class="wd-width-100"
680
  id="wdform_' . $id1 . '_element' . $form_id . '"
681
  name="wdform_' . $id1 . '_element' . $form_id . '"
682
- value="' . $param['w_first_val'] . '"
683
- placeholder="" ' . $param['attributes'] . ' />';
684
 
685
  // Generate field.
686
  $rep = $this->wdform_field($type, $param, $row, $html);
@@ -790,25 +790,25 @@ class FMViewForm_maker {
790
  if ( $w_name_fields[0] == 'yes' ) {
791
  $first_field_id = 'wdform_' . $id1 . '_element_title' . $form_id;
792
  $html .= '<div class="wd-flex wd-flex-column wd-width-10">';
793
- $html .= '<input type="text" id="wdform_' . $id1 . '_element_title' . $form_id . '" name="wdform_' . $id1 . '_element_title' . $form_id . '" value="' . $w_first_val[2] . '" title="' . $w_title[2] . '" placeholder="' . $w_title[2] . '" />';
794
  $html .= '<label class="mini_label" for="wdform_' . $id1 . '_element_title' . $form_id . '">' . $w_mini_labels[0] . '</label>';
795
  $html .= '</div>';
796
  $html .= '<div class="wd-flex wd-flex-column wd-name-separator"></div>';
797
  }
798
  $html .= '<div class="wd-flex wd-flex-column wd-width-50">';
799
- $html .= '<input type="text" class="wd-width-100" id="wdform_' . $id1 . '_element_first' . $form_id . '" name="wdform_' . $id1 . '_element_first' . $form_id . '" value="' . $w_first_val[0] . '" title="' . $w_title[0] . '" placeholder="' . $w_title[0] . '" ' . $param['attributes'] . ' />';
800
  $html .= '<label class="mini_label" for="wdform_' . $id1 . '_element_first' . $form_id . '">' . $w_mini_labels[1] . '</label>';
801
  $html .= '</div>';
802
  $html .= '<div class="wd-flex wd-flex-column wd-name-separator"></div>';
803
  $html .= '<div class="wd-flex wd-flex-column wd-width-50">';
804
- $html .= '<input type="text" class="wd-width-100" id="wdform_' . $id1 . '_element_last' . $form_id . '" name="wdform_' . $id1 . '_element_last' . $form_id . '" value="' . $w_first_val[1] . '" title="' . $w_title[1] . '" placeholder="' . $w_title[1] . '" ' . $param['attributes'] . ' />';
805
  $html .= '<label class="mini_label" for="wdform_' . $id1 . '_element_last' . $form_id . '">' . $w_mini_labels[2] . '</label>';
806
  $html .= '</div>';
807
 
808
  if ( $w_name_fields[1] == 'yes' ) {
809
  $html .= '<div class="wd-flex wd-flex-column wd-name-separator"></div>';
810
  $html .= '<div class="wd-flex wd-flex-column wd-width-50">';
811
- $html .= '<input type="text" class="wd-width-100" id="wdform_' . $id1 . '_element_middle' . $form_id . '" name="wdform_' . $id1 . '_element_middle' . $form_id . '" value="' . $w_first_val[3] . '" title="' . $w_title[3] . '" placeholder="' . $w_title[3] . '" />';
812
  $html .= '<label class="mini_label" for="wdform_' . $id1 . '_element_middle' . $form_id . '">' . $w_mini_labels[3] . '</label>';
813
  $html .= '</div>';
814
  }
@@ -1018,7 +1018,7 @@ class FMViewForm_maker {
1018
  $message_check_email = addslashes(__('This is not a valid email address.', WDFMInstance(self::PLUGIN)->prefix));
1019
  $onchange = (isset($param['w_verification']) && $param['w_verification'] == "yes") ? '; wd_check_confirmation_email(\'' . $id1 . '\', \'' . $form_id . '\', \'' . $message_confirm . '\')' : '';
1020
 
1021
- $html = '<input type="text" class="wd-width-100" id="wdform_' . $id1 . '_element' . $form_id . '" name="wdform_' . $id1 . '_element' . $form_id . '" value="' . $param['w_first_val'] . '" title="' . $param['w_title'] . '" placeholder="' . $param['w_title'] . '" ' . $param['attributes'] . ' onchange="wd_check_email(\'' . $id1 . '\', \'' . $form_id . '\', \'' . $message_check_email . '\')' . $onchange . '" />';
1022
 
1023
  // Generate field.
1024
  $rep = $this->wdform_field($type, $param, $row, $html);
@@ -1028,7 +1028,7 @@ class FMViewForm_maker {
1028
  $param['label'] = $param['w_verification_label'];
1029
  $param['id'] = 'wdform_' . $id1 . '_1_element' . $form_id;
1030
 
1031
- $html = '<input type="text" class="wd-width-100" id="wdform_' . $id1 . '_1_element' . $form_id . '" name="wdform_' . $id1 . '_1_element' . $form_id . '" placeholder="' . $param['w_verification_placeholder'] . '" title="' . $param['w_verification_placeholder'] . '" ' . $param['attributes'] . 'onchange="wd_check_confirmation_email(\'' . $id1 . '\', \'' . $form_id . '\', \'' . $message_confirm . '\')" />';
1032
 
1033
  // Generate field.
1034
  $rep .= $this->wdform_field($type, $param, $row, $html);
@@ -1451,13 +1451,13 @@ class FMViewForm_maker {
1451
  $rep .= '<span class="wdform_colon wd-vertical-middle">&nbsp;' . $form_currency . '&nbsp;</span>';
1452
  $rep .= '</div>';
1453
  $rep .= '<div id="wdform_' . $id1 . '_td_name_dollars" class="wd-table-cell">';
1454
- $rep .= '<input type="text" id="wdform_' . $id1 . '_element_dollars' . $form_id . '" name="wdform_' . $id1 . '_element_dollars' . $form_id . '" value="' . $w_first_val[0] . '" title="' . $w_title[0] . '" onkeypress="return check_isnum(event)" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' />';
1455
  $rep .= '</div>';
1456
  $rep .= '<div id="wdform_' . $id1 . '_td_name_divider" class="' . $hide_cents . '">';
1457
  $rep .= '<span class="wdform_colon wd-vertical-middle">&nbsp;.&nbsp;</span>';
1458
  $rep .= '</div>';
1459
  $rep .= '<div id="wdform_' . $id1 . '_td_name_cents" class="' . $hide_cents . '">';
1460
- $rep .= '<input type="text" class="wd-paypal-cent" id="wdform_' . $id1 . '_element_cents' . $form_id . '" name="wdform_' . $id1 . '_element_cents' . $form_id . '" value="' . $w_first_val[1] . '" title="' . $w_title[1] . '" ' . $param['attributes'] . ' />';
1461
  $rep .= '</div></div>';
1462
  $rep .= '<div id="wdform_' . $id1 . '_tr_price2" class="wd-table-row">';
1463
  $rep .= '<div class="wd-table-cell"><label class="mini_label"></label></div>';
@@ -1669,10 +1669,20 @@ class FMViewForm_maker {
1669
  /**
1670
  * Autoload form.
1671
  *
 
1672
  * @return string
1673
  */
1674
- public function autoload_form($id, $form, $type, $form_html, $display_on_this, $message, $error, $show_for_admin) {
1675
- $onload_js = '';
 
 
 
 
 
 
 
 
 
1676
  $fm_form = '';
1677
  switch ($type) {
1678
  case 'topbar': {
@@ -1711,7 +1721,7 @@ class FMViewForm_maker {
1711
  }
1712
 
1713
  $fm_form .= '<div id="fm-topbar' . $id . '" class="fm-topbar" style="position: ' . $fixed_relative . '; ' . $top_bottom . ': 0px; visibility:hidden;">';
1714
- $fm_form .= $form_html;
1715
  $fm_form .= '<div id="fm-action-buttons' . $id . '" class="fm-action-buttons">';
1716
  if ($closing) {
1717
  $fm_form .= '<span id="closing-form' . $id . '" class="closing-form dashicons dashicons-no" onclick="fm_hide_form(' . $id . ', ' . $hide_duration . ', function(){
@@ -1737,26 +1747,23 @@ class FMViewForm_maker {
1737
  $left_right_class = $form->scrollbox_position ? 'float-right' : 'float-left';
1738
  if ($display_on_this && $hide_mobile) {
1739
  WDW_FM_Library(self::PLUGIN)->start_session();
1740
- if (isset($_SESSION['fm_hide_form_after_submit' . $id]) && $_SESSION['fm_hide_form_after_submit' . $id] == 1) {
1741
- if ($error == 'success') {
1742
- if ($message) {
1743
  $onload_js .= '
1744
  jQuery("#fm-form' . $id . ', #fm-pages' . $id . '").addClass("fm-hide");
1745
- fm_hide_form(' . $id . ', ' . $hide_duration . ');
1746
  jQuery("#fm-scrollbox' . $id . '").removeClass("fm-animated fadeOutDown").addClass("fm-animated fadeInUp");
1747
  jQuery("#fm-scrollbox' . $id . '").css("visibility", "");
1748
  jQuery("#minimize-form' . $id . '").css("visibility", "hidden");
1749
  ';
1750
  }
1751
- else {
1752
- $onload_js .= 'fm_hide_form(' . $id . ', ' . $hide_duration . ');';
1753
- }
1754
  }
1755
  }
1756
  else {
1757
- if (isset($_SESSION['error_occurred' . $id]) && $_SESSION['error_occurred' . $id] == 1) {
1758
  $_SESSION['error_occurred' . $id] = 0;
1759
- if ($message) {
1760
  $onload_js .= '
1761
  jQuery("#fm-scrollbox' . $id . '").removeClass("fm-animated fadeOutDown").addClass("fm-animated fadeInUp");
1762
  jQuery("#fm-scrollbox' . $id . '").removeClass("fm-animated fadeOutDown").addClass("fm-animated fadeInUp");
@@ -1766,7 +1773,7 @@ class FMViewForm_maker {
1766
  }
1767
  else {
1768
  $onload_js .= '
1769
- if(' . $hide_duration . ' == 0){
1770
  localStorage.removeItem("hide-"+' . $id . ');
1771
  }
1772
  var hide_scrollbox = localStorage.getItem("hide-"+' . $id . ');';
@@ -1794,7 +1801,7 @@ class FMViewForm_maker {
1794
 
1795
  $fm_form .= '<div id="fm-scrollbox' . $id . '" class="fm-scrollbox ' . $hide_mobile_class . '" style="' . $left_right . ': 0px; visibility:hidden;">';
1796
  $fm_form .= '<div class="fm-scrollbox-form ' . $left_right_class . '">';
1797
- $fm_form .= $form_html;
1798
  $fm_form .= '<div id="fm-action-buttons' . $id . '" class="fm-action-buttons">';
1799
  if ($minimize) {
1800
  $fm_form .= '<span id="minimize-form' . $id . '" class="minimize-form dashicons dashicons-minus" onclick="minimize_form(' . $id . ')"></span>';
@@ -1883,8 +1890,8 @@ class FMViewForm_maker {
1883
  <div class="fm-popover-container" id="fm-popover-container' . $id . '">
1884
  <div class="fm-popover-inner-background" id="fm-popover-inner-background' . $id . '"></div>
1885
  <div class="fm-popover-content">';
1886
- $fm_form .= $form_html;
1887
- $fm_form .= '<div id="fm-action-buttons' . $id . '" class="fm-action-buttons">';
1888
  $fm_form .= '<span id="closing-form' . $id . '" class="closing-form dashicons dashicons-no" onclick="fm_hide_form(' . $id . ', ' . $frequency . ', function(){
1889
  jQuery(\'#fm-popover-background' . $id . '\').css(\'display\', \'none\');
1890
  jQuery(\'#fm-popover' . $id . '\').css(\'display\', \'none\');
@@ -1902,7 +1909,7 @@ class FMViewForm_maker {
1902
  $onload_js = 'jQuery(document).ready(function () {' . $onload_js . '})';
1903
  }
1904
  if ( function_exists('wp_add_inline_script') ) { // Since Wordpress 4.5.0
1905
- wp_add_inline_script('fm-script-' . $id, $onload_js);
1906
  }
1907
  else {
1908
  echo '<script>' . $onload_js . '</script>';
@@ -1912,65 +1919,131 @@ class FMViewForm_maker {
1912
  }
1913
 
1914
  /**
1915
- * Free 1, 2
 
 
 
 
 
 
 
1916
  */
1917
- private function type_file_upload($params, $row, $id1, $form_id, $param) {
1918
  return '';
1919
  }
1920
 
1921
  /**
1922
- * Free 1, 2
 
 
 
 
 
 
 
 
 
 
1923
  */
1924
- private function type_paypal_price_new($params, $row, $id1, $form_id, $param, $form_currency, $symbol_begin, $symbol_end) {
1925
  return '';
1926
  }
1927
 
1928
  /**
1929
- * Free 1, 2
 
 
 
 
 
 
 
1930
  */
1931
- private function type_paypal_select($params, $row, $id1, $form_id, $param) {
1932
  return '';
1933
  }
1934
 
1935
  /**
1936
- * Free 1, 2
 
 
 
 
 
 
 
1937
  */
1938
- private function type_paypal_radio($params, $row, $id1, $form_id, $param) {
1939
  return '';
1940
  }
1941
 
1942
  /**
1943
- * Free 1, 2
 
 
 
 
 
 
 
1944
  */
1945
- private function type_paypal_checkbox($params, $row, $id1, $form_id, $param) {
1946
  return '';
1947
  }
1948
 
1949
  /**
1950
- * Free 1, 2
 
 
 
 
 
 
 
1951
  */
1952
- private function type_paypal_shipping($params, $row, $id1, $form_id, $param) {
1953
  return '';
1954
  }
1955
 
1956
  /**
1957
- * Free 1, 2
 
 
 
 
 
 
 
1958
  */
1959
- private function type_paypal_total($params, $row, $id1, $form_id, $param) {
1960
  return '';
1961
  }
1962
 
1963
  /**
1964
- * Free 1
 
 
 
 
 
 
1965
  */
1966
- private function type_map($params, $id1, $row, $param) {
1967
  return '';
1968
  }
1969
 
1970
  /**
1971
- * Free 2
 
 
 
 
 
 
 
 
1972
  */
1973
- private function type_checkbox($params, $row, $form_id, $id1, $type, $param) {
1974
  $params_names = array(
1975
  'w_field_label_size',
1976
  'w_field_label_pos',
@@ -2124,9 +2197,17 @@ class FMViewForm_maker {
2124
  }
2125
 
2126
  /**
2127
- * Free 2
 
 
 
 
 
 
 
 
2128
  */
2129
- private function type_radio($params, $row, $form_id, $id1, $type, $param) {
2130
  $params_names = array(
2131
  'w_field_label_size',
2132
  'w_field_label_pos',
@@ -2281,9 +2362,17 @@ class FMViewForm_maker {
2281
  }
2282
 
2283
  /**
2284
- * Free 2
 
 
 
 
 
 
 
 
2285
  */
2286
- private function type_own_select($params, $row, $form_id, $id1, $type, $param) {
2287
  $params_names = array(
2288
  'w_field_label_size',
2289
  'w_field_label_pos',
@@ -2406,9 +2495,17 @@ class FMViewForm_maker {
2406
  }
2407
 
2408
  /**
2409
- * Free 2
 
 
 
 
 
 
 
 
2410
  */
2411
- private function type_date_new($params, $row, $form_id, $id1, $type, $param) {
2412
  wp_enqueue_script('jquery-ui-datepicker');
2413
  if ( function_exists('wp_add_inline_script') ) { // Since Wordpress 4.5.0
2414
  wp_add_inline_script('jquery-ui-datepicker', WDW_FM_Library(self::PLUGIN)->localize_ui_datepicker());
@@ -2486,9 +2583,17 @@ class FMViewForm_maker {
2486
  }
2487
 
2488
  /**
2489
- * Free 2
 
 
 
 
 
 
 
 
2490
  */
2491
- private function type_date_fields($params, $row, $form_id, $id1, $type, $param) {
2492
  $params_names = array(
2493
  'w_field_label_size',
2494
  'w_field_label_pos',
@@ -2666,9 +2771,17 @@ class FMViewForm_maker {
2666
  }
2667
 
2668
  /**
2669
- * Free 2
 
 
 
 
 
 
 
 
2670
  */
2671
- private function type_date_range($params, $row, $form_id, $id1, $type, $param) {
2672
  wp_enqueue_script('jquery-ui-datepicker');
2673
  if ( function_exists('wp_add_inline_script') ) { // Since Wordpress 4.5.0
2674
  wp_add_inline_script('jquery-ui-datepicker', WDW_FM_Library(self::PLUGIN)->localize_ui_datepicker());
@@ -2753,9 +2866,17 @@ class FMViewForm_maker {
2753
  }
2754
 
2755
  /**
2756
- * Free 2
 
 
 
 
 
 
 
 
2757
  */
2758
- private function type_time($params, $row, $form_id, $id1, $type, $param) {
2759
  $params_names = array(
2760
  'w_field_label_size',
2761
  'w_field_label_pos',
@@ -2874,9 +2995,17 @@ class FMViewForm_maker {
2874
  }
2875
 
2876
  /**
2877
- * Free 2
 
 
 
 
 
 
 
 
2878
  */
2879
- private function type_country($params, $row, $form_id, $id1, $type, $param) {
2880
  $params_names = array(
2881
  'w_field_label_size',
2882
  'w_field_label_pos',
@@ -2933,9 +3062,17 @@ class FMViewForm_maker {
2933
  }
2934
 
2935
  /**
2936
- * Free 2
 
 
 
 
 
 
 
 
2937
  */
2938
- private function type_spinner($params, $row, $form_id, $id1, $type, $param) {
2939
  wp_enqueue_script('jquery-ui-spinner');
2940
 
2941
  $params_names = array(
@@ -2999,9 +3136,17 @@ class FMViewForm_maker {
2999
  }
3000
 
3001
  /**
3002
- * Free 2
 
 
 
 
 
 
 
 
3003
  */
3004
- private function type_star_rating($params, $row, $form_id, $id1, $type, $param) {
3005
  $params_names = array(
3006
  'w_field_label_size',
3007
  'w_field_label_pos',
@@ -3055,9 +3200,17 @@ class FMViewForm_maker {
3055
  }
3056
 
3057
  /**
3058
- * Free 2
 
 
 
 
 
 
 
 
3059
  */
3060
- private function type_scale_rating($params, $row, $form_id, $id1, $type, $param) {
3061
  $params_names = array(
3062
  'w_field_label_size',
3063
  'w_field_label_pos',
@@ -3126,9 +3279,17 @@ class FMViewForm_maker {
3126
  }
3127
 
3128
  /**
3129
- * Free 2
 
 
 
 
 
 
 
 
3130
  */
3131
- private function type_slider($params, $row, $form_id, $id1, $type, $param) {
3132
  wp_enqueue_script('jquery-ui-slider');
3133
 
3134
  $params_names = array(
@@ -3192,9 +3353,17 @@ class FMViewForm_maker {
3192
  }
3193
 
3194
  /**
3195
- * Free 2
 
 
 
 
 
 
 
 
3196
  */
3197
- private function type_range($params, $row, $form_id, $id1, $type, $param) {
3198
  wp_enqueue_script('jquery-ui-spinner');
3199
 
3200
  $params_names = array(
@@ -3260,9 +3429,17 @@ class FMViewForm_maker {
3260
  }
3261
 
3262
  /**
3263
- * Free 2
 
 
 
 
 
 
 
 
3264
  */
3265
- private function type_grading($params, $row, $form_id, $id1, $type, $param) {
3266
  $params_names = array(
3267
  'w_field_label_size',
3268
  'w_field_label_pos',
@@ -3325,9 +3502,17 @@ class FMViewForm_maker {
3325
  }
3326
 
3327
  /**
3328
- * Free 2
 
 
 
 
 
 
 
 
3329
  */
3330
- private function type_matrix($params, $row, $form_id, $id1, $type, $param) {
3331
  $params_names = array(
3332
  'w_field_label_size',
3333
  'w_field_label_pos',
@@ -3429,17 +3614,16 @@ class FMViewForm_maker {
3429
  }
3430
 
3431
  /**
3432
- * Return form field HTML.
3433
- *
3434
- * @param $type
3435
- * @param $param
3436
- * @param $row
3437
- * @param $html
3438
- * @param $label
3439
  *
 
 
 
 
 
3440
  * @return string
3441
  */
3442
- public function wdform_field($type, $param, $row, $html, $label = TRUE) {
3443
  ob_start();
3444
  $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
3445
  $param['w_size'] = (isset($param['w_size']) ? $param['w_size'] : "");
@@ -3462,12 +3646,12 @@ class FMViewForm_maker {
3462
  /**
3463
  * Return form field label HTML.
3464
  *
3465
- * @param $param
3466
- * @param $form
3467
  *
3468
  * @return string
3469
  */
3470
- private function field_label($param, $form) {
3471
  ob_start();
3472
  $label = isset($param['label']) ? $param['label'] : '';
3473
  $field_id = $param['id'];
@@ -3487,7 +3671,7 @@ class FMViewForm_maker {
3487
  }
3488
  $label_width = (isset($param['w_field_label_size']) && $param['w_field_label_size'] != '') ? ' style="max-width: ' . $param['w_field_label_size'] . 'px;"' : '';
3489
  ?><div class="<?php echo implode(' ', $classes); ?>"<?php echo $label_width; ?>>
3490
- <label<?php echo ($field_id ? ' for="' . $field_id . '"' : ''); ?> class="wdform-label"><?php echo $label; ?></label><?php
3491
  if ( isset($param['w_required']) && $param['w_required'] == "yes" ) {
3492
  $requiredmark = isset($form->requiredmark) ? $form->requiredmark : '';
3493
  ?><span class="wdform-required"><?php echo $requiredmark; ?></span><?php
@@ -3500,12 +3684,12 @@ class FMViewForm_maker {
3500
  /**
3501
  * Return form field section HTML.
3502
  *
3503
- * @param $html
3504
- * @param $param
3505
  *
3506
  * @return string
3507
  */
3508
- private function field_section($html, $param) {
3509
  ob_start();
3510
  $classes = array( 'wdform-element-section', 'wd-flex' );
3511
  if ( isset($param['w_class']) ) {
15
  *
16
  * @param $model
17
  */
18
+ public function __construct( $model = array() ) {
19
  $this->model = $model;
20
 
21
  wp_enqueue_script('jquery');
33
  /**
34
  * Display.
35
  *
36
+ * @param array $result
37
+ * @param array $fm_settings
38
+ * @param int $form_id
39
  * @param string $formType
40
  *
41
  * @return string
42
  */
43
+ public function display( $result = array(), $fm_settings = array(), $form_id = 0, $formType = 'embedded' ) {
44
  $current_user = wp_get_current_user();
45
  if ( $current_user->ID != 0 ) {
46
  $wp_username = $current_user->display_name;
381
  class="wd-width-100"
382
  id="wdform_' . $id1 . '_element' . $form_id . '"
383
  name="wdform_' . $id1 . '_element' . $form_id . '"
384
+ value="' . htmlentities($param['w_first_val'], ENT_COMPAT) . '"
385
+ title="' . htmlentities($param['w_title'], ENT_COMPAT) . '"
386
+ placeholder="' . htmlentities($param['w_title'], ENT_COMPAT) . '"
387
  ' . $readonly . '
388
  ' . $param['attributes'] . ' />';
389
  if ( isset($symbol_end[$id1]) ) {
440
  class="wd-width-100"
441
  id="wdform_' . $id1 . '_element' . $form_id . '"
442
  name="wdform_' . $id1 . '_element' . $form_id . '"
443
+ value="' . htmlentities($param['w_first_val'], ENT_COMPAT) . '"
444
+ title="' . htmlentities($param['w_title'], ENT_COMPAT) . '"
445
  ' . $param['attributes'] . '>
446
  </div>';
447
  $rep .= '</div>';
570
  $html = '<textarea class="wd-width-100"
571
  id="wdform_' . $id1 . '_element' . $form_id . '"
572
  name="wdform_' . $id1 . '_element' . $form_id . '"
573
+ placeholder="' . htmlentities($param['w_title'], ENT_COMPAT) . '"
574
  style="height: ' . $param['w_size_h'] . 'px;"
575
  ' . $param['attributes'] . '>' . $textarea_value . '</textarea>';
576
 
628
  $param['w_class'] .= ' wd-flex-row';
629
 
630
  $html = '<div class="wd-flex wd-flex-column wd-width-20">
631
+ <input type="text" class="wd-phone-first" id="wdform_' . $id1 . '_element_first' . $form_id . '" name="wdform_' . $id1 . '_element_first' . $form_id . '" value="' . htmlentities($w_first_val[0], ENT_COMPAT) . '" title="' . htmlentities($w_title[0], ENT_COMPAT) . '" placeholder="' . htmlentities($w_title[0], ENT_COMPAT) . '" ' . $param['attributes'] . '>
632
  <label for="wdform_' . $id1 . '_element_first' . $form_id . '" class="mini_label wd-flex-column">' . $w_mini_labels[0] . '</label>
633
  </div>
634
  <div>
635
  <div class="wd-flex wd-flex-column ">&nbsp;-&nbsp;</div>
636
  </div>
637
  <div class="wd-flex wd-flex-column wd-width-80">
638
+ <input type="text" class="wd-flex-column wd-width-100" id="wdform_' . $id1 . '_element_last' . $form_id . '" name="wdform_' . $id1 . '_element_last' . $form_id . '" value="' . htmlentities($w_first_val[1], ENT_COMPAT) . '" title="' . htmlentities($w_title[1], ENT_COMPAT) . '" placeholder="' . htmlentities($w_title[1], ENT_COMPAT) . '" ' . $param['attributes'] . ' />
639
  <label for="wdform_' . $id1 . '_element_last' . $form_id . '" class="wd-flex-column mini_label">' . $w_mini_labels[1] . '</label>
640
  </div>';
641
 
679
  class="wd-width-100"
680
  id="wdform_' . $id1 . '_element' . $form_id . '"
681
  name="wdform_' . $id1 . '_element' . $form_id . '"
682
+ value="' . htmlentities($param['w_first_val'], ENT_COMPAT) . '"
683
+ placeholder="" ' . htmlentities($param['attributes'], ENT_COMPAT) . ' />';
684
 
685
  // Generate field.
686
  $rep = $this->wdform_field($type, $param, $row, $html);
790
  if ( $w_name_fields[0] == 'yes' ) {
791
  $first_field_id = 'wdform_' . $id1 . '_element_title' . $form_id;
792
  $html .= '<div class="wd-flex wd-flex-column wd-width-10">';
793
+ $html .= '<input type="text" id="wdform_' . $id1 . '_element_title' . $form_id . '" name="wdform_' . $id1 . '_element_title' . $form_id . '" value="' . htmlentities($w_first_val[2], ENT_COMPAT) . '" title="' . htmlentities($w_title[2], ENT_COMPAT) . '" placeholder="' . htmlentities($w_title[2], ENT_COMPAT) . '" />';
794
  $html .= '<label class="mini_label" for="wdform_' . $id1 . '_element_title' . $form_id . '">' . $w_mini_labels[0] . '</label>';
795
  $html .= '</div>';
796
  $html .= '<div class="wd-flex wd-flex-column wd-name-separator"></div>';
797
  }
798
  $html .= '<div class="wd-flex wd-flex-column wd-width-50">';
799
+ $html .= '<input type="text" class="wd-width-100" id="wdform_' . $id1 . '_element_first' . $form_id . '" name="wdform_' . $id1 . '_element_first' . $form_id . '" value="' . htmlentities($w_first_val[0], ENT_COMPAT) . '" title="' . htmlentities($w_title[0], ENT_COMPAT) . '" placeholder="' . htmlentities($w_title[0], ENT_COMPAT) . '" ' . $param['attributes'] . ' />';
800
  $html .= '<label class="mini_label" for="wdform_' . $id1 . '_element_first' . $form_id . '">' . $w_mini_labels[1] . '</label>';
801
  $html .= '</div>';
802
  $html .= '<div class="wd-flex wd-flex-column wd-name-separator"></div>';
803
  $html .= '<div class="wd-flex wd-flex-column wd-width-50">';
804
+ $html .= '<input type="text" class="wd-width-100" id="wdform_' . $id1 . '_element_last' . $form_id . '" name="wdform_' . $id1 . '_element_last' . $form_id . '" value="' . htmlentities($w_first_val[1], ENT_COMPAT) . '" title="' . htmlentities($w_title[1], ENT_COMPAT) . '" placeholder="' . htmlentities($w_title[1], ENT_COMPAT) . '" ' . $param['attributes'] . ' />';
805
  $html .= '<label class="mini_label" for="wdform_' . $id1 . '_element_last' . $form_id . '">' . $w_mini_labels[2] . '</label>';
806
  $html .= '</div>';
807
 
808
  if ( $w_name_fields[1] == 'yes' ) {
809
  $html .= '<div class="wd-flex wd-flex-column wd-name-separator"></div>';
810
  $html .= '<div class="wd-flex wd-flex-column wd-width-50">';
811
+ $html .= '<input type="text" class="wd-width-100" id="wdform_' . $id1 . '_element_middle' . $form_id . '" name="wdform_' . $id1 . '_element_middle' . $form_id . '" value="' . htmlentities($w_first_val[3], ENT_COMPAT) . '" title="' . htmlentities($w_title[3], ENT_COMPAT) . '" placeholder="' . htmlentities($w_title[3], ENT_COMPAT) . '" />';
812
  $html .= '<label class="mini_label" for="wdform_' . $id1 . '_element_middle' . $form_id . '">' . $w_mini_labels[3] . '</label>';
813
  $html .= '</div>';
814
  }
1018
  $message_check_email = addslashes(__('This is not a valid email address.', WDFMInstance(self::PLUGIN)->prefix));
1019
  $onchange = (isset($param['w_verification']) && $param['w_verification'] == "yes") ? '; wd_check_confirmation_email(\'' . $id1 . '\', \'' . $form_id . '\', \'' . $message_confirm . '\')' : '';
1020
 
1021
+ $html = '<input type="text" class="wd-width-100" id="wdform_' . $id1 . '_element' . $form_id . '" name="wdform_' . $id1 . '_element' . $form_id . '" value="' . htmlentities($param['w_first_val'], ENT_COMPAT) . '" title="' . htmlentities($param['w_title'], ENT_COMPAT) . '" placeholder="' . htmlentities($param['w_title'], ENT_COMPAT) . '" ' . $param['attributes'] . ' onchange="wd_check_email(\'' . $id1 . '\', \'' . $form_id . '\', \'' . $message_check_email . '\')' . $onchange . '" />';
1022
 
1023
  // Generate field.
1024
  $rep = $this->wdform_field($type, $param, $row, $html);
1028
  $param['label'] = $param['w_verification_label'];
1029
  $param['id'] = 'wdform_' . $id1 . '_1_element' . $form_id;
1030
 
1031
+ $html = '<input type="text" class="wd-width-100" id="wdform_' . $id1 . '_1_element' . $form_id . '" name="wdform_' . $id1 . '_1_element' . $form_id . '" placeholder="' . htmlentities($param['w_verification_placeholder'], ENT_COMPAT) . '" title="' . htmlentities($param['w_verification_placeholder'], ENT_COMPAT) . '" ' . $param['attributes'] . 'onchange="wd_check_confirmation_email(\'' . $id1 . '\', \'' . $form_id . '\', \'' . $message_confirm . '\')" />';
1032
 
1033
  // Generate field.
1034
  $rep .= $this->wdform_field($type, $param, $row, $html);
1451
  $rep .= '<span class="wdform_colon wd-vertical-middle">&nbsp;' . $form_currency . '&nbsp;</span>';
1452
  $rep .= '</div>';
1453
  $rep .= '<div id="wdform_' . $id1 . '_td_name_dollars" class="wd-table-cell">';
1454
+ $rep .= '<input type="text" id="wdform_' . $id1 . '_element_dollars' . $form_id . '" name="wdform_' . $id1 . '_element_dollars' . $form_id . '" value="' . htmlentities($w_first_val[0], ENT_COMPAT) . '" title="' . $w_title[0] . '" onkeypress="return check_isnum(event)" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' />';
1455
  $rep .= '</div>';
1456
  $rep .= '<div id="wdform_' . $id1 . '_td_name_divider" class="' . $hide_cents . '">';
1457
  $rep .= '<span class="wdform_colon wd-vertical-middle">&nbsp;.&nbsp;</span>';
1458
  $rep .= '</div>';
1459
  $rep .= '<div id="wdform_' . $id1 . '_td_name_cents" class="' . $hide_cents . '">';
1460
+ $rep .= '<input type="text" class="wd-paypal-cent" id="wdform_' . $id1 . '_element_cents' . $form_id . '" name="wdform_' . $id1 . '_element_cents' . $form_id . '" value="' . htmlentities($w_first_val[1], ENT_COMPAT) . '" title="' . $w_title[1] . '" ' . $param['attributes'] . ' />';
1461
  $rep .= '</div></div>';
1462
  $rep .= '<div id="wdform_' . $id1 . '_tr_price2" class="wd-table-row">';
1463
  $rep .= '<div class="wd-table-cell"><label class="mini_label"></label></div>';
1669
  /**
1670
  * Autoload form.
1671
  *
1672
+ * @param array $params
1673
  * @return string
1674
  */
1675
+ public function autoload_form( $params = array() ) {
1676
+ $id = $params['id'];
1677
+ $type = $params['type'];
1678
+ $form = $params['form'];
1679
+ $display_on_this = $params['display_on_this'];
1680
+ $show_for_admin = $params['show_for_admin'];
1681
+ $form_result = $params['form_result'];
1682
+ $fm_settings = $params['fm_settings'];
1683
+ $error = $params['error'];
1684
+ $message = $params['message'];
1685
+ $onload_js = '';
1686
  $fm_form = '';
1687
  switch ($type) {
1688
  case 'topbar': {
1721
  }
1722
 
1723
  $fm_form .= '<div id="fm-topbar' . $id . '" class="fm-topbar" style="position: ' . $fixed_relative . '; ' . $top_bottom . ': 0px; visibility:hidden;">';
1724
+ $fm_form .= $this->display($form_result, $fm_settings, $id, $type);
1725
  $fm_form .= '<div id="fm-action-buttons' . $id . '" class="fm-action-buttons">';
1726
  if ($closing) {
1727
  $fm_form .= '<span id="closing-form' . $id . '" class="closing-form dashicons dashicons-no" onclick="fm_hide_form(' . $id . ', ' . $hide_duration . ', function(){
1747
  $left_right_class = $form->scrollbox_position ? 'float-right' : 'float-left';
1748
  if ($display_on_this && $hide_mobile) {
1749
  WDW_FM_Library(self::PLUGIN)->start_session();
1750
+ if ( isset($_SESSION['fm_hide_form_after_submit' . $id]) && $_SESSION['fm_hide_form_after_submit' . $id] == 1 ) {
1751
+ if ( $error == 'success' ) {
1752
+ if ( $message ) {
1753
  $onload_js .= '
1754
  jQuery("#fm-form' . $id . ', #fm-pages' . $id . '").addClass("fm-hide");
 
1755
  jQuery("#fm-scrollbox' . $id . '").removeClass("fm-animated fadeOutDown").addClass("fm-animated fadeInUp");
1756
  jQuery("#fm-scrollbox' . $id . '").css("visibility", "");
1757
  jQuery("#minimize-form' . $id . '").css("visibility", "hidden");
1758
  ';
1759
  }
1760
+ $onload_js .= 'fm_hide_form(' . $id . ', ' . $hide_duration . ');';
 
 
1761
  }
1762
  }
1763
  else {
1764
+ if ( isset($_SESSION['error_occurred' . $id]) && $_SESSION['error_occurred' . $id] == 1 ) {
1765
  $_SESSION['error_occurred' . $id] = 0;
1766
+ if ( $message ) {
1767
  $onload_js .= '
1768
  jQuery("#fm-scrollbox' . $id . '").removeClass("fm-animated fadeOutDown").addClass("fm-animated fadeInUp");
1769
  jQuery("#fm-scrollbox' . $id . '").removeClass("fm-animated fadeOutDown").addClass("fm-animated fadeInUp");
1773
  }
1774
  else {
1775
  $onload_js .= '
1776
+ if (' . $hide_duration . ' == 0) {
1777
  localStorage.removeItem("hide-"+' . $id . ');
1778
  }
1779
  var hide_scrollbox = localStorage.getItem("hide-"+' . $id . ');';
1801
 
1802
  $fm_form .= '<div id="fm-scrollbox' . $id . '" class="fm-scrollbox ' . $hide_mobile_class . '" style="' . $left_right . ': 0px; visibility:hidden;">';
1803
  $fm_form .= '<div class="fm-scrollbox-form ' . $left_right_class . '">';
1804
+ $fm_form .= $this->display($form_result, $fm_settings, $id, $type);
1805
  $fm_form .= '<div id="fm-action-buttons' . $id . '" class="fm-action-buttons">';
1806
  if ($minimize) {
1807
  $fm_form .= '<span id="minimize-form' . $id . '" class="minimize-form dashicons dashicons-minus" onclick="minimize_form(' . $id . ')"></span>';
1890
  <div class="fm-popover-container" id="fm-popover-container' . $id . '">
1891
  <div class="fm-popover-inner-background" id="fm-popover-inner-background' . $id . '"></div>
1892
  <div class="fm-popover-content">';
1893
+ $fm_form .= $this->display($form_result, $fm_settings, $id, $type);
1894
+ $fm_form .= '<div id="fm-action-buttons' . $id . '" class="fm-action-buttons">';
1895
  $fm_form .= '<span id="closing-form' . $id . '" class="closing-form dashicons dashicons-no" onclick="fm_hide_form(' . $id . ', ' . $frequency . ', function(){
1896
  jQuery(\'#fm-popover-background' . $id . '\').css(\'display\', \'none\');
1897
  jQuery(\'#fm-popover' . $id . '\').css(\'display\', \'none\');
1909
  $onload_js = 'jQuery(document).ready(function () {' . $onload_js . '})';
1910
  }
1911
  if ( function_exists('wp_add_inline_script') ) { // Since Wordpress 4.5.0
1912
+ wp_add_inline_script( WDFMInstance(self::PLUGIN)->handle_prefix . '-script-' . $id, $onload_js);
1913
  }
1914
  else {
1915
  echo '<script>' . $onload_js . '</script>';
1919
  }
1920
 
1921
  /**
1922
+ * Type file upload.
1923
+ *
1924
+ * @param array $params
1925
+ * @param array $row
1926
+ * @param int $id1
1927
+ * @param int $form_id
1928
+ * @param array $param
1929
+ * @return string
1930
  */
1931
+ private function type_file_upload( $params = array(), $row = array(), $id1 = 0, $form_id = 0, $param = array() ) {
1932
  return '';
1933
  }
1934
 
1935
  /**
1936
+ * Type paypal price new.
1937
+ *
1938
+ * @param array $params
1939
+ * @param array $row
1940
+ * @param int $id1
1941
+ * @param int $form_id
1942
+ * @param array $param
1943
+ * @param string $form_currency
1944
+ * @param string $symbol_begin
1945
+ * @param string $symbol_end
1946
+ * @return string
1947
  */
1948
+ private function type_paypal_price_new( $params = array(), $row = array(), $id1 = 0, $form_id = 0, $param = array(), $form_currency = '', $symbol_begin = '', $symbol_end = '' ) {
1949
  return '';
1950
  }
1951
 
1952
  /**
1953
+ * Type paypal select.
1954
+ *
1955
+ * @param array $params
1956
+ * @param array $row
1957
+ * @param int $id1
1958
+ * @param int $form_id
1959
+ * @param array $param
1960
+ * @return string
1961
  */
1962
+ private function type_paypal_select( $params = array(), $row = array(), $id1 = 0, $form_id = 0, $param = array() ) {
1963
  return '';
1964
  }
1965
 
1966
  /**
1967
+ * Type paypal radio.
1968
+ *
1969
+ * @param array $params
1970
+ * @param array $row
1971
+ * @param int $id1
1972
+ * @param int $form_id
1973
+ * @param array $param
1974
+ * @return string
1975
  */
1976
+ private function type_paypal_radio( $params = array(), $row = array(), $id1 = 0, $form_id = 0, $param = array() ) {
1977
  return '';
1978
  }
1979
 
1980
  /**
1981
+ * Type paypal checkbox.
1982
+ *
1983
+ * @param array $params
1984
+ * @param array $row
1985
+ * @param int $id1
1986
+ * @param int $form_id
1987
+ * @param array $param
1988
+ * @return string
1989
  */
1990
+ private function type_paypal_checkbox( $params = array(), $row = array(), $id1 = 0, $form_id = 0, $param = array() ) {
1991
  return '';
1992
  }
1993
 
1994
  /**
1995
+ * Type paypal shipping.
1996
+ *
1997
+ * @param array $params
1998
+ * @param array $row
1999
+ * @param int $id1
2000
+ * @param int $form_id
2001
+ * @param array $param
2002
+ * @return string
2003
  */
2004
+ private function type_paypal_shipping( $params = array(), $row = array(), $id1 = 0, $form_id = 0, $param = array() ) {
2005
  return '';
2006
  }
2007
 
2008
  /**
2009
+ * Type paypal total.
2010
+ *
2011
+ * @param array $params
2012
+ * @param array $row
2013
+ * @param int $id1
2014
+ * @param int $form_id
2015
+ * @param array $param
2016
+ * @return string
2017
  */
2018
+ private function type_paypal_total( $params = array(), $row = array(), $id1 = 0, $form_id = 0, $param = array() ) {
2019
  return '';
2020
  }
2021
 
2022
  /**
2023
+ * Type map.
2024
+ *
2025
+ * @param array $params
2026
+ * @param int $id1
2027
+ * @param array $row
2028
+ * @param array $param
2029
+ * @return string
2030
  */
2031
+ private function type_map( $params = array(), $id1 = 0, $row = array(), $param = array() ) {
2032
  return '';
2033
  }
2034
 
2035
  /**
2036
+ * Type checkbox.
2037
+ *
2038
+ * @param array $params
2039
+ * @param array $row
2040
+ * @param int $form_id
2041
+ * @param int $id1
2042
+ * @param string $type
2043
+ * @param array $param
2044
+ * @return string
2045
  */
2046
+ private function type_checkbox( $params = array(), $row = array(), $form_id = 0, $id1 = 0, $type = '', $param = array() ) {
2047
  $params_names = array(
2048
  'w_field_label_size',
2049
  'w_field_label_pos',
2197
  }
2198
 
2199
  /**
2200
+ * Type radio.
2201
+ *
2202
+ * @param array $params
2203
+ * @param array $row
2204
+ * @param int $form_id
2205
+ * @param int $id1
2206
+ * @param string $type
2207
+ * @param array $param
2208
+ * @return string
2209
  */
2210
+ private function type_radio( $params = array(), $row = array(), $form_id = 0, $id1 = 0, $type = '', $param = array() ) {
2211
  $params_names = array(
2212
  'w_field_label_size',
2213
  'w_field_label_pos',
2362
  }
2363
 
2364
  /**
2365
+ * Type own select.
2366
+ *
2367
+ * @param array $params
2368
+ * @param array $row
2369
+ * @param int $form_id
2370
+ * @param int $id1
2371
+ * @param string $type
2372
+ * @param array $param
2373
+ * @return string
2374
  */
2375
+ private function type_own_select( $params = array(), $row = array(), $form_id = 0, $id1 = 0, $type = '', $param = array() ) {
2376
  $params_names = array(
2377
  'w_field_label_size',
2378
  'w_field_label_pos',
2495
  }
2496
 
2497
  /**
2498
+ * Type date new.
2499
+ *
2500
+ * @param array $params
2501
+ * @param array $row
2502
+ * @param int $form_id
2503
+ * @param int $id1
2504
+ * @param string $type
2505
+ * @param array $param
2506
+ * @return string
2507
  */
2508
+ private function type_date_new( $params = array(), $row = array(), $form_id = 0, $id1 = 0, $type = '', $param = array() ) {
2509
  wp_enqueue_script('jquery-ui-datepicker');
2510
  if ( function_exists('wp_add_inline_script') ) { // Since Wordpress 4.5.0
2511
  wp_add_inline_script('jquery-ui-datepicker', WDW_FM_Library(self::PLUGIN)->localize_ui_datepicker());
2583
  }
2584
 
2585
  /**
2586
+ * Type date fields.
2587
+ *
2588
+ * @param array $params
2589
+ * @param array $row
2590
+ * @param int $form_id
2591
+ * @param int $id1
2592
+ * @param string $type
2593
+ * @param array $param
2594
+ * @return string
2595
  */
2596
+ private function type_date_fields( $params = array(), $row = array(), $form_id = 0, $id1 = 0, $type = '', $param = array() ) {
2597
  $params_names = array(
2598
  'w_field_label_size',
2599
  'w_field_label_pos',
2771
  }
2772
 
2773
  /**
2774
+ * Type date range
2775
+ *
2776
+ * @param array $params
2777
+ * @param array $row
2778
+ * @param int $form_id
2779
+ * @param int $id1
2780
+ * @param string $type
2781
+ * @param array $param
2782
+ * @return string
2783
  */
2784
+ private function type_date_range( $params = array(), $row = array(), $form_id = 0, $id1 = 0, $type = '', $param = array() ) {
2785
  wp_enqueue_script('jquery-ui-datepicker');
2786
  if ( function_exists('wp_add_inline_script') ) { // Since Wordpress 4.5.0
2787
  wp_add_inline_script('jquery-ui-datepicker', WDW_FM_Library(self::PLUGIN)->localize_ui_datepicker());
2866
  }
2867
 
2868
  /**
2869
+ * Type time.
2870
+ *
2871
+ * @param array $params
2872
+ * @param array $row
2873
+ * @param int $form_id
2874
+ * @param int $id1
2875
+ * @param string $type
2876
+ * @param array $param
2877
+ * @return string
2878
  */
2879
+ private function type_time( $params = array(), $row = array(), $form_id = 0, $id1 = 0, $type = '', $param = array() ) {
2880
  $params_names = array(
2881
  'w_field_label_size',
2882
  'w_field_label_pos',
2995
  }
2996
 
2997
  /**
2998
+ * Type country.
2999
+ *
3000
+ * @param array $params
3001
+ * @param array $row
3002
+ * @param int $form_id
3003
+ * @param int $id1
3004
+ * @param string $type
3005
+ * @param array $param
3006
+ * @return string
3007
  */
3008
+ private function type_country( $params = array(), $row = array(), $form_id = 0, $id1 = 0, $type = '', $param = array() ) {
3009
  $params_names = array(
3010
  'w_field_label_size',
3011
  'w_field_label_pos',
3062
  }
3063
 
3064
  /**
3065
+ * Type spinner.
3066
+ *
3067
+ * @param array $params
3068
+ * @param array $row
3069
+ * @param int $form_id
3070
+ * @param int $id1
3071
+ * @param string $type
3072
+ * @param array $param
3073
+ * @return string
3074
  */
3075
+ private function type_spinner( $params = array(), $row = array(), $form_id = 0, $id1 = 0, $type = '', $param = array() ) {
3076
  wp_enqueue_script('jquery-ui-spinner');
3077
 
3078
  $params_names = array(
3136
  }
3137
 
3138
  /**
3139
+ * Type star rating.
3140
+ *
3141
+ * @param array $params
3142
+ * @param array $row
3143
+ * @param int $form_id
3144
+ * @param int $id1
3145
+ * @param string $type
3146
+ * @param array $param
3147
+ * @return string
3148
  */
3149
+ private function type_star_rating( $params = array(), $row = array(), $form_id = 0, $id1 = 0, $type = '', $param = array() ) {
3150
  $params_names = array(
3151
  'w_field_label_size',
3152
  'w_field_label_pos',
3200
  }
3201
 
3202
  /**
3203
+ * Type scale rating.
3204
+ *
3205
+ * @param array $params
3206
+ * @param array $row
3207
+ * @param int $form_id
3208
+ * @param int $id1
3209
+ * @param string $type
3210
+ * @param array $param
3211
+ * @return string
3212
  */
3213
+ private function type_scale_rating( $params = array(), $row = array(), $form_id = 0, $id1 = 0, $type = '', $param = array() ) {
3214
  $params_names = array(
3215
  'w_field_label_size',
3216
  'w_field_label_pos',
3279
  }
3280
 
3281
  /**
3282
+ * Type slider.
3283
+ *
3284
+ * @param array $params
3285
+ * @param array $row
3286
+ * @param int $form_id
3287
+ * @param int $id1
3288
+ * @param string $type
3289
+ * @param array $param
3290
+ * @return string
3291
  */
3292
+ private function type_slider( $params = array(), $row = array(), $form_id = 0, $id1 = 0, $type = '', $param = array() ) {
3293
  wp_enqueue_script('jquery-ui-slider');
3294
 
3295
  $params_names = array(
3353
  }
3354
 
3355
  /**
3356
+ * Type range.
3357
+ *
3358
+ * @param array $params
3359
+ * @param array $row
3360
+ * @param int $form_id
3361
+ * @param int $id1
3362
+ * @param string $type
3363
+ * @param array $param
3364
+ * @return string
3365
  */
3366
+ private function type_range( $params = array(), $row = array(), $form_id = 0, $id1 = 0, $type = '', $param = array() ) {
3367
  wp_enqueue_script('jquery-ui-spinner');
3368
 
3369
  $params_names = array(
3429
  }
3430
 
3431
  /**
3432
+ * Type grading.
3433
+ *
3434
+ * @param array $params
3435
+ * @param array $row
3436
+ * @param int $form_id
3437
+ * @param int $id1
3438
+ * @param string $type
3439
+ * @param array $param
3440
+ * @return string
3441
  */
3442
+ private function type_grading( $params = array(), $row = array(), $form_id = 0, $id1 = 0, $type = '', $param = array() ) {
3443
  $params_names = array(
3444
  'w_field_label_size',
3445
  'w_field_label_pos',
3502
  }
3503
 
3504
  /**
3505
+ * Type matrix.
3506
+ *
3507
+ * @param array $params
3508
+ * @param array $row
3509
+ * @param int $form_id
3510
+ * @param int $id1
3511
+ * @param string $type
3512
+ * @param array $param
3513
+ * @return string
3514
  */
3515
+ private function type_matrix( $params = array(), $row = array(), $form_id = 0, $id1 = 0, $type = '', $param = array() ) {
3516
  $params_names = array(
3517
  'w_field_label_size',
3518
  'w_field_label_pos',
3614
  }
3615
 
3616
  /**
3617
+ * WD form field.
 
 
 
 
 
 
3618
  *
3619
+ * @param string $type
3620
+ * @param array $param
3621
+ * @param array $row
3622
+ * @param string $html
3623
+ * @param bool $label
3624
  * @return string
3625
  */
3626
+ public function wdform_field( $type = '', $param = array(), $row = array(), $html = '', $label = TRUE) {
3627
  ob_start();
3628
  $param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
3629
  $param['w_size'] = (isset($param['w_size']) ? $param['w_size'] : "");
3646
  /**
3647
  * Return form field label HTML.
3648
  *
3649
+ * @param array $param
3650
+ * @param array $form
3651
  *
3652
  * @return string
3653
  */
3654
+ private function field_label( $param = array(), $form = array() ) {
3655
  ob_start();
3656
  $label = isset($param['label']) ? $param['label'] : '';
3657
  $field_id = $param['id'];
3671
  }
3672
  $label_width = (isset($param['w_field_label_size']) && $param['w_field_label_size'] != '') ? ' style="max-width: ' . $param['w_field_label_size'] . 'px;"' : '';
3673
  ?><div class="<?php echo implode(' ', $classes); ?>"<?php echo $label_width; ?>>
3674
+ <label <?php echo ($field_id ? ' for="' . $field_id . '"' : ''); ?> class="wdform-label"><?php echo $label; ?></label><?php
3675
  if ( isset($param['w_required']) && $param['w_required'] == "yes" ) {
3676
  $requiredmark = isset($form->requiredmark) ? $form->requiredmark : '';
3677
  ?><span class="wdform-required"><?php echo $requiredmark; ?></span><?php
3684
  /**
3685
  * Return form field section HTML.
3686
  *
3687
+ * @param string $html
3688
+ * @param array $param
3689
  *
3690
  * @return string
3691
  */
3692
+ private function field_section( $html = '', $param = array() ) {
3693
  ob_start();
3694
  $classes = array( 'wdform-element-section', 'wd-flex' );
3695
  if ( isset($param['w_class']) ) {
frontend/views/verify_email.php CHANGED
@@ -12,9 +12,9 @@ class FMViewVerify_email {
12
  /**
13
  * Display message.
14
  *
15
- * @param $message
16
  */
17
- public function display($message) {
18
  echo WDW_FM_Library(self::PLUGIN)->message($message, 'fm-notice-success');
19
  }
20
  }
12
  /**
13
  * Display message.
14
  *
15
+ * @param string $message
16
  */
17
+ public function display( $message = '' ) {
18
  echo WDW_FM_Library(self::PLUGIN)->message($message, 'fm-notice-success');
19
  }
20
  }
js/add_field.js CHANGED
@@ -1,6 +1,6 @@
1
  var nextID; // next field id
2
 
3
- jQuery(window).load(function () {
4
  if (!storageAvailable("localStorage")
5
  || !localStorage.getItem("wd-form-first-time-use")) {
6
  jQuery(".first-time-use").show();
@@ -2401,13 +2401,13 @@ function create_label(i, w_field_label) {
2401
  }
2402
 
2403
  function change_label(id, label, type) {
 
 
2404
  if (!type) {
2405
- label = label.replace(/(<([^>]+)>)/ig, "");
2406
  document.getElementById(id).innerHTML = label;
2407
  document.getElementById(id).value = label;
2408
  }
2409
  else {
2410
- label = label.replace(/(<([^>]+)>)/ig, "");
2411
  document.getElementById(type).innerHTML = label;
2412
  }
2413
  }
@@ -2510,7 +2510,7 @@ function hide_label(id) {
2510
  if (document.getElementById(id + "_hide_labelform_id_temp").value == "no") {
2511
  document.getElementById(id + "_hide_labelform_id_temp").value = "yes";
2512
  document.getElementById(id + "_label_sectionform_id_temp").style.display = "none";
2513
- if (document.getElementById(id + "_1_label_sectionform_id_temp")) {
2514
  document.getElementById(id + "_1_label_sectionform_id_temp").style.display = "none";
2515
  }
2516
  }
@@ -2518,7 +2518,7 @@ function hide_label(id) {
2518
  if (document.getElementById("edit_for_label_position_left").checked) {
2519
  document.getElementById(id + "_label_sectionform_id_temp").style.display = "table-cell";
2520
  document.getElementById(id + "_element_sectionform_id_temp").style.display = "table-cell";
2521
- if (document.getElementById(id + "_1_label_sectionform_id_temp")) {
2522
  document.getElementById(id + "_1_label_sectionform_id_temp").style.display = "table-cell";
2523
  document.getElementById(id + "_1_element_sectionform_id_temp").style.display = "table-cell";
2524
  }
@@ -2526,7 +2526,7 @@ function hide_label(id) {
2526
  else {
2527
  document.getElementById(id + "_label_sectionform_id_temp").style.display = "block";
2528
  document.getElementById(id + "_element_sectionform_id_temp").style.display = "block";
2529
- if (document.getElementById(id + "_1_label_sectionform_id_temp")) {
2530
  document.getElementById(id + "_1_label_sectionform_id_temp").style.display = "block";
2531
  document.getElementById(id + "_1_element_sectionform_id_temp").style.display = "block";
2532
  }
@@ -2537,7 +2537,7 @@ function hide_label(id) {
2537
 
2538
  function create_placeholder(i, w_title) {
2539
  var label = jQuery('<label class="fm-field-label" for="el_first_value_input">Placeholder</label>');
2540
- var input = jQuery('<input type="text" class="fm-width-100" id="el_first_value_input" onKeyUp="change_input_value(this.value,\'' + i + '_elementform_id_temp\')" value="' + w_title + '" />');
2541
  return create_option_container(label, input);
2542
  }
2543
 
@@ -3555,7 +3555,7 @@ function type_textarea(i, w_field_label, w_field_label_size, w_field_label_pos,
3555
 
3556
  function create_spinner_width(i, w_field_width) {
3557
  var label = jQuery('<label class="fm-field-label" for="edit_for_spinner_width">Width(px)</label>');
3558
- var input = jQuery('<input class="fm-width-100" type="text" id="edit_for_spinner_width" onKeyPress="return check_isnum(event)" onKeyUp="change_spinner_width(this.value,' + i + ',\'form_id_temp\')" value="' + w_field_width + '" />');
3559
  return create_option_container(label, input);
3560
  }
3561
 
@@ -4463,10 +4463,10 @@ function create_select_options(i, w_value_disabled, w_choices, w_choices_params,
4463
  for (j = 0; j < n; j++) {
4464
  var attr = jQuery('<div id="' + j + '" class="change_pos fm-width-100">' +
4465
  '<div class="fm-table-col fm-width-30">' +
4466
- '<input type="text" class="fm-field-choice" id="el_option' + j + '" value="' + w_choices[j] + '" onKeyUp="change_label_name(' + j + ', \'' + i + '_option' + j + '\', this.value, \'select\')" onpaste="elem=this; change_label_name_on_paste(' + j + ', \'' + i + '_option' + j + '\', \'select\')"' + (w_choices_params[j] ? ' disabled="disabled"' : '') + ' />' +
4467
  '</div>' +
4468
  '<div class="fm-table-col fm-width-30">' +
4469
- '<input type="text" class="fm-field-choice' + (!w_choices_params[j] ? ' el_option_value' : '') + '" id="el_option_value' + j + '" value="' + w_choices_value[j] + '" onKeyUp="change_label_value(\'' + i + '_option' + j + '\', this.value)" onpaste="change_label_value_on_paste(\'' + i + '_option' + j + '\', this)"' + (w_value_disabled == 'no' || w_choices_params[j] ? ' disabled="disabled"' : '') + ' />' +
4470
  '</div>' +
4471
  '<div class="fm-table-col fm-width-20">' +
4472
  '<input type="checkbox" title="Empty value" class="el_option_dis" id="el_option' + j + '_dis" onClick="dis_option(\'' + i + '_option' + j + '\', this.checked, ' + j + ')"' + (w_value_disabled == 'yes' ? ' disabled="disabled"' : '') + (w_choices_disabled[j] ? ' checked="checked"' : '') + ' />' +
@@ -4733,12 +4733,12 @@ function type_own_select(i, w_field_label, w_field_label_size, w_field_label_pos
4733
  var option = document.createElement('option');
4734
  option.setAttribute("id", i + "_option" + j);
4735
  if (w_value_disabled == 'yes')
4736
- option.setAttribute("value", w_choices_value[j]);
4737
  else {
4738
  if (w_choices_disabled[j])
4739
  option.value = "";
4740
  else
4741
- option.setAttribute("value", w_choices[j]);
4742
  }
4743
 
4744
  if (w_choices_params[j]) {
@@ -4749,7 +4749,7 @@ function type_own_select(i, w_field_label, w_field_label_size, w_field_label_pos
4749
  option.setAttribute("db_info", w_params[1]);
4750
  }
4751
  option.setAttribute("onselect", "set_select('" + i + "_option" + j + "')");
4752
- option.innerHTML = w_choices[j];
4753
  if (w_choices_checked[j] == 1)
4754
  option.setAttribute("selected", "selected");
4755
  select_.appendChild(option);
@@ -5119,10 +5119,10 @@ function create_radio_options(i, w_value_disabled, w_choices, w_choices_params,
5119
  for (j = 0; j < n; j++) {
5120
  var attr = jQuery('<div id="' + j + '" class="change_pos fm-width-100">' +
5121
  '<div class="fm-table-col fm-width-40">' +
5122
- '<input type="text" class="fm-field-choice" id="el_choices' + j + '"' + (w_allow_other == "yes" && j == w_allow_other_num ? ' other="1"' : '') + ' value="' + w_choices[j] + '" onKeyUp="change_label(\'' + i + '_label_element' + j + '\', this.value)" onpaste="elem=this; change_label_name_on_paste(' + j + ', \'' + i + '_label_element' + j + '\', \'' + type + '\'); change_label_value_on_paste(\'' + i + '_elementform_id_temp' + j + '\', this)"' + (w_choices_params[j] ? ' disabled="disabled"' : '') + ' />' +
5123
  '</div>' +
5124
  '<div class="fm-table-col fm-width-40">' +
5125
- '<input type="text" class="fm-field-choice' + (!w_choices_params[j] && (w_allow_other != "yes" || j != w_allow_other_num) ? ' el_option_value' : '') + '" id="el_option_value' + j + '" value="' + w_choices_value[j] + '" onKeyUp="change_label_value(\'' + i + '_elementform_id_temp' + j + '\', this.value)" onpaste="change_label_value_on_paste(\'' + i + '_elementform_id_temp' + j + '\', this)"' + (w_value_disabled == 'no' || w_choices_params[j] || (w_allow_other == "yes" && j == w_allow_other_num) ? ' disabled="disabled"' : '') + ' />' +
5126
  '<input type="hidden" id="el_option_params' + j + '" class="el_option_params" value="' + w_choices_params[j] + '" />' +
5127
  '</div>' +
5128
  '<div class="fm-table-col fm-width-10">' +
@@ -6182,7 +6182,7 @@ function make_pagebreak_button(next_or_previous, title, type, class_, id) {
6182
 
6183
  function create_placeholder_name(i, w_title) {
6184
  var label = jQuery('<label class="fm-field-label" for="el_first_value_input">Placeholder</label>');
6185
- var input = jQuery('<input type="text" class="fm-width-40" id="el_first_value_first" onKeyUp="change_input_value(this.value,\'' + i + '_element_firstform_id_temp\')" value="' + w_title[0] + '" />-<input type="text" class="fm-width-40" id="el_first_value_last" onKeyUp="change_input_value(this.value,\'' + i + '_element_lastform_id_temp\')" value="' + w_title[1] + '" />');
6186
  return create_option_container(label, input);
6187
  }
6188
 
@@ -6633,7 +6633,7 @@ function create_confirmation_email_label(i, w_verification, w_verification_label
6633
 
6634
  function create_confirmation_email_placeholder(i, w_verification, w_verification_placeholder) {
6635
  var label = jQuery('<label class="fm-field-label" for="el_first_value_verification_input">Confirmation placeholder</label>');
6636
- var input = jQuery('<input type="text" class="fm-width-100" id="el_first_value_verification_input" onKeyUp="change_input_value(this.value,\'' + i + '_1_elementform_id_temp\')" value="' + w_verification_placeholder + '" />');
6637
  return create_option_container(label, input, 'confirm_validation_empty', w_verification == 'yes');
6638
  }
6639
 
@@ -8680,7 +8680,7 @@ function create_paypal_select_options(i, w_choices, w_choices_params, w_choices_
8680
  for (j = 0; j < n; j++) {
8681
  var attr = jQuery('<div id="' + j + '" class="change_pos fm-width-100">' +
8682
  '<div class="fm-table-col fm-width-40">' +
8683
- '<input type="text" class="fm-field-choice" id="el_option' + j + '" value="' + w_choices[j] + '" onKeyUp="change_label_price(\'' + i + '_option' + j + '\', this.value)"' + (w_choices_params[j] ? ' disabled="disabled"' : '') + ' />' +
8684
  '</div>' +
8685
  '<div class="fm-table-col fm-width-20">' +
8686
  '<input type="text" class="fm-field-choice" id="el_option_price' + j + '" value="' + w_choices_price[j] + '" onKeyPress="return check_isnum_point(event)" onKeyUp="change_value_price(\'' + i + '_option' + j + '\', this.value)"' + (w_choices_params[j] ? ' disabled="disabled"' : '') + ' />' +
@@ -9139,7 +9139,7 @@ function type_paypal_select(i, w_field_label, w_field_label_size, w_field_label_
9139
  }
9140
 
9141
  option.setAttribute("onselect", "set_select('" + i + "_option" + j + "')");
9142
- option.innerHTML = w_choices[j];
9143
  if (w_choices_checked[j] == 1)
9144
  option.setAttribute("selected", "selected");
9145
  select_.appendChild(option);
@@ -9305,7 +9305,7 @@ function create_paypal_radio_options(i, w_choices, w_choices_params, w_choices_p
9305
  for (j = 0; j < n; j++) {
9306
  var attr = jQuery('<div id="' + j + '" class="change_pos fm-width-100">' +
9307
  '<div class="fm-table-col fm-width-60">' +
9308
- '<input type="text" class="fm-field-choice" id="el_choices' + j + '" value="' + w_choices[j] + '" onKeyUp="change_label(\'' + i + '_label_element' + j + '\', this.value); change_label_1(\'' + i + '_elementlabel_form_id_temp' + j + '\', this.value);"' + (w_choices_params[j] ? ' disabled="disabled"' : '') + ' />' +
9309
  '</div>' +
9310
  '<div class="fm-table-col fm-width-20">' +
9311
  '<input type="text" class="fm-field-choice" id="el_option_price' + j + '" value="' + w_choices_price[j] + '" onKeyPress="return check_isnum_point(event)" onKeyUp="change_value_price(\'' + i + '_elementform_id_temp' + j + '\', this.value)"' + (w_choices_params[j] ? ' disabled="disabled"' : '') + ' />' +
@@ -9510,7 +9510,7 @@ function type_paypal_radio(i, w_field_label, w_field_label_size, w_field_label_p
9510
  label_adding.setAttribute("id", i + "_label_element" + j);
9511
  label_adding.setAttribute("class", "ch-rad-label");
9512
  label_adding.setAttribute("for", i + "_elementform_id_temp" + j);
9513
- label_adding.innerHTML = w_choices[j];
9514
  if (w_field_option_pos == "right")
9515
  label_adding.style.cssText = "float: none !important";
9516
  if (w_choices_params[j]) {
@@ -9525,7 +9525,7 @@ function type_paypal_radio(i, w_field_label, w_field_label_size, w_field_label_p
9525
  adding_ch_label.setAttribute("type", "hidden");
9526
  adding_ch_label.setAttribute("id", i + "_elementlabel_form_id_temp" + j);
9527
  adding_ch_label.setAttribute("name", i + "_elementform_id_temp" + j + "_label");
9528
- adding_ch_label.setAttribute("value", w_choices[j]);
9529
 
9530
  td_little.appendChild(adding);
9531
  td_little.appendChild(label_adding);
@@ -9736,7 +9736,7 @@ function type_paypal_checkbox(i, w_field_label, w_field_label_size, w_field_labe
9736
  label_adding.setAttribute("id", i + "_label_element" + j);
9737
  label_adding.setAttribute("class", "ch-rad-label");
9738
  label_adding.setAttribute("for", i + "_elementform_id_temp" + j);
9739
- label_adding.innerHTML = w_choices[j];
9740
  if (w_field_option_pos == "right")
9741
  label_adding.style.cssText = "float: none !important";
9742
  if (w_choices_params[j]) {
@@ -9751,7 +9751,7 @@ function type_paypal_checkbox(i, w_field_label, w_field_label_size, w_field_labe
9751
  adding_ch_label.setAttribute("type", "hidden");
9752
  adding_ch_label.setAttribute("id", i + "_elementlabel_form_id_temp" + j);
9753
  adding_ch_label.setAttribute("name", i + "_elementform_id_temp" + j + "_label");
9754
- adding_ch_label.setAttribute("value", w_choices[j]);
9755
 
9756
  td_little.appendChild(adding);
9757
  td_little.appendChild(label_adding);
@@ -9973,7 +9973,7 @@ function type_paypal_shipping(i, w_field_label, w_field_label_size, w_field_labe
9973
  label_adding.setAttribute("id", i + "_label_element" + j);
9974
  label_adding.setAttribute("class", "ch-rad-label");
9975
  label_adding.setAttribute("for", i + "_elementform_id_temp" + j);
9976
- label_adding.innerHTML = w_choices[j];
9977
  if (w_field_option_pos == "right")
9978
  label_adding.style.cssText = "float: none !important";
9979
  if (w_choices_params[j]) {
@@ -9987,7 +9987,7 @@ function type_paypal_shipping(i, w_field_label, w_field_label_size, w_field_labe
9987
  adding_ch_label.setAttribute("type", "hidden");
9988
  adding_ch_label.setAttribute("id", i + "_elementlabel_form_id_temp" + j);
9989
  adding_ch_label.setAttribute("name", i + "_elementform_id_temp" + j + "_label");
9990
- adding_ch_label.setAttribute("value", w_choices[j]);
9991
 
9992
  td_little.appendChild(adding);
9993
  td_little.appendChild(label_adding);
@@ -13068,7 +13068,7 @@ function create_field_size_phone(i, w_size, fields_count) {
13068
 
13069
  function create_placeholder_phone(i, w_title) {
13070
  var label = jQuery('<label class="fm-field-label" for="el_first_value_area">Placeholder</label>');
13071
- var input = jQuery('<input type="text" class="fm-width-20" id="el_first_value_area" onKeyUp="change_input_value(this.value,\'' + i + '_element_firstform_id_temp\')" value="' + w_title[0] + '" />-<input type="text" class="fm-width-60" id="el_first_value_phone" onKeyUp="change_input_value(this.value,\'' + i + '_element_lastform_id_temp\')" value="' + w_title[1] + '" />');
13072
  return create_option_container(label, input);
13073
  }
13074
 
1
  var nextID; // next field id
2
 
3
+ jQuery(window).on('load', function () {
4
  if (!storageAvailable("localStorage")
5
  || !localStorage.getItem("wd-form-first-time-use")) {
6
  jQuery(".first-time-use").show();
2401
  }
2402
 
2403
  function change_label(id, label, type) {
2404
+ label = label.replace(/(<([^>]+)>)/ig, "");
2405
+ label = label.replace(/"/g, "&quot;");
2406
  if (!type) {
 
2407
  document.getElementById(id).innerHTML = label;
2408
  document.getElementById(id).value = label;
2409
  }
2410
  else {
 
2411
  document.getElementById(type).innerHTML = label;
2412
  }
2413
  }
2510
  if (document.getElementById(id + "_hide_labelform_id_temp").value == "no") {
2511
  document.getElementById(id + "_hide_labelform_id_temp").value = "yes";
2512
  document.getElementById(id + "_label_sectionform_id_temp").style.display = "none";
2513
+ if (document.getElementById(id + "_1_elementform_id_temp") && document.getElementById(id + "_1_elementform_id_temp").offsetParent) {
2514
  document.getElementById(id + "_1_label_sectionform_id_temp").style.display = "none";
2515
  }
2516
  }
2518
  if (document.getElementById("edit_for_label_position_left").checked) {
2519
  document.getElementById(id + "_label_sectionform_id_temp").style.display = "table-cell";
2520
  document.getElementById(id + "_element_sectionform_id_temp").style.display = "table-cell";
2521
+ if (document.getElementById(id + "_1_elementform_id_temp") && document.getElementById(id + "_1_elementform_id_temp").offsetParent) {
2522
  document.getElementById(id + "_1_label_sectionform_id_temp").style.display = "table-cell";
2523
  document.getElementById(id + "_1_element_sectionform_id_temp").style.display = "table-cell";
2524
  }
2526
  else {
2527
  document.getElementById(id + "_label_sectionform_id_temp").style.display = "block";
2528
  document.getElementById(id + "_element_sectionform_id_temp").style.display = "block";
2529
+ if (document.getElementById(id + "_1_elementform_id_temp") && document.getElementById(id + "_1_elementform_id_temp").offsetParent) {
2530
  document.getElementById(id + "_1_label_sectionform_id_temp").style.display = "block";
2531
  document.getElementById(id + "_1_element_sectionform_id_temp").style.display = "block";
2532
  }
2537
 
2538
  function create_placeholder(i, w_title) {
2539
  var label = jQuery('<label class="fm-field-label" for="el_first_value_input">Placeholder</label>');
2540
+ var input = jQuery('<input type="text" class="fm-width-100" id="el_first_value_input" onKeyUp="change_input_value(this.value,\'' + i + '_elementform_id_temp\')" value="' + w_title.replace(/"/g, "&quot;") + '" />');
2541
  return create_option_container(label, input);
2542
  }
2543
 
3555
 
3556
  function create_spinner_width(i, w_field_width) {
3557
  var label = jQuery('<label class="fm-field-label" for="edit_for_spinner_width">Width(px)</label>');
3558
+ var input = jQuery('<input class="fm-width-100" type="text" id="edit_for_spinner_width" onKeyPress="return check_isnum(event)" onKeyUp="change_spinner_width(this.value,' + i + ',\'form_id_temp\')" value="' + w_field_width + '" /><p class="description">' + form_maker.leave_empty + '</p>');
3559
  return create_option_container(label, input);
3560
  }
3561
 
4463
  for (j = 0; j < n; j++) {
4464
  var attr = jQuery('<div id="' + j + '" class="change_pos fm-width-100">' +
4465
  '<div class="fm-table-col fm-width-30">' +
4466
+ '<input type="text" class="fm-field-choice" id="el_option' + j + '" value="' + w_choices[j].replace(/"/g, "&quot;") + '" onKeyUp="change_label_name(' + j + ', \'' + i + '_option' + j + '\', this.value, \'select\')" onpaste="elem=this; change_label_name_on_paste(' + j + ', \'' + i + '_option' + j + '\', \'select\')"' + (w_choices_params[j] ? ' disabled="disabled"' : '') + ' />' +
4467
  '</div>' +
4468
  '<div class="fm-table-col fm-width-30">' +
4469
+ '<input type="text" class="fm-field-choice' + (!w_choices_params[j] ? ' el_option_value' : '') + '" id="el_option_value' + j + '" value="' + w_choices_value[j].replace(/"/g, "&quot;") + '" onKeyUp="change_label_value(\'' + i + '_option' + j + '\', this.value)" onpaste="change_label_value_on_paste(\'' + i + '_option' + j + '\', this)"' + (w_value_disabled == 'no' || w_choices_params[j] ? ' disabled="disabled"' : '') + ' />' +
4470
  '</div>' +
4471
  '<div class="fm-table-col fm-width-20">' +
4472
  '<input type="checkbox" title="Empty value" class="el_option_dis" id="el_option' + j + '_dis" onClick="dis_option(\'' + i + '_option' + j + '\', this.checked, ' + j + ')"' + (w_value_disabled == 'yes' ? ' disabled="disabled"' : '') + (w_choices_disabled[j] ? ' checked="checked"' : '') + ' />' +
4733
  var option = document.createElement('option');
4734
  option.setAttribute("id", i + "_option" + j);
4735
  if (w_value_disabled == 'yes')
4736
+ option.setAttribute("value", w_choices_value[j].replace(/"/g, "&quot;"));
4737
  else {
4738
  if (w_choices_disabled[j])
4739
  option.value = "";
4740
  else
4741
+ option.setAttribute("value", w_choices[j].replace(/"/g, "&quot;"));
4742
  }
4743
 
4744
  if (w_choices_params[j]) {
4749
  option.setAttribute("db_info", w_params[1]);
4750
  }
4751
  option.setAttribute("onselect", "set_select('" + i + "_option" + j + "')");
4752
+ option.innerHTML = w_choices[j].replace(/"/g, "&quot;");
4753
  if (w_choices_checked[j] == 1)
4754
  option.setAttribute("selected", "selected");
4755
  select_.appendChild(option);
5119
  for (j = 0; j < n; j++) {
5120
  var attr = jQuery('<div id="' + j + '" class="change_pos fm-width-100">' +
5121
  '<div class="fm-table-col fm-width-40">' +
5122
+ '<input type="text" class="fm-field-choice" id="el_choices' + j + '"' + (w_allow_other == "yes" && j == w_allow_other_num ? ' other="1"' : '') + ' value="' + w_choices[j].replace(/"/g, "&quot;") + '" onKeyUp="change_label(\'' + i + '_label_element' + j + '\', this.value)" onpaste="elem=this; change_label_name_on_paste(' + j + ', \'' + i + '_label_element' + j + '\', \'' + type + '\'); change_label_value_on_paste(\'' + i + '_elementform_id_temp' + j + '\', this)"' + (w_choices_params[j] ? ' disabled="disabled"' : '') + ' />' +
5123
  '</div>' +
5124
  '<div class="fm-table-col fm-width-40">' +
5125
+ '<input type="text" class="fm-field-choice' + (!w_choices_params[j] && (w_allow_other != "yes" || j != w_allow_other_num) ? ' el_option_value' : '') + '" id="el_option_value' + j + '" value="' + w_choices_value[j].replace(/"/g, "&quot;") + '" onKeyUp="change_label_value(\'' + i + '_elementform_id_temp' + j + '\', this.value)" onpaste="change_label_value_on_paste(\'' + i + '_elementform_id_temp' + j + '\', this)"' + (w_value_disabled == 'no' || w_choices_params[j] || (w_allow_other == "yes" && j == w_allow_other_num) ? ' disabled="disabled"' : '') + ' />' +
5126
  '<input type="hidden" id="el_option_params' + j + '" class="el_option_params" value="' + w_choices_params[j] + '" />' +
5127
  '</div>' +
5128
  '<div class="fm-table-col fm-width-10">' +
6182
 
6183
  function create_placeholder_name(i, w_title) {
6184
  var label = jQuery('<label class="fm-field-label" for="el_first_value_input">Placeholder</label>');
6185
+ var input = jQuery('<input type="text" class="fm-width-40" id="el_first_value_first" onKeyUp="change_input_value(this.value,\'' + i + '_element_firstform_id_temp\')" value="' + w_title[0].replace(/"/g, "&quot;") + '" />-<input type="text" class="fm-width-40" id="el_first_value_last" onKeyUp="change_input_value(this.value,\'' + i + '_element_lastform_id_temp\')" value="' + w_title[1].replace(/"/g, "&quot;") + '" />');
6186
  return create_option_container(label, input);
6187
  }
6188
 
6633
 
6634
  function create_confirmation_email_placeholder(i, w_verification, w_verification_placeholder) {
6635
  var label = jQuery('<label class="fm-field-label" for="el_first_value_verification_input">Confirmation placeholder</label>');
6636
+ var input = jQuery('<input type="text" class="fm-width-100" id="el_first_value_verification_input" onKeyUp="change_input_value(this.value,\'' + i + '_1_elementform_id_temp\')" value="' + w_verification_placeholder.replace(/"/g, "&quot;") + '" />');
6637
  return create_option_container(label, input, 'confirm_validation_empty', w_verification == 'yes');
6638
  }
6639
 
8680
  for (j = 0; j < n; j++) {
8681
  var attr = jQuery('<div id="' + j + '" class="change_pos fm-width-100">' +
8682
  '<div class="fm-table-col fm-width-40">' +
8683
+ '<input type="text" class="fm-field-choice" id="el_option' + j + '" value="' + w_choices[j].replace(/"/g, "&quot;") + '" onKeyUp="change_label_price(\'' + i + '_option' + j + '\', this.value)"' + (w_choices_params[j] ? ' disabled="disabled"' : '') + ' />' +
8684
  '</div>' +
8685
  '<div class="fm-table-col fm-width-20">' +
8686
  '<input type="text" class="fm-field-choice" id="el_option_price' + j + '" value="' + w_choices_price[j] + '" onKeyPress="return check_isnum_point(event)" onKeyUp="change_value_price(\'' + i + '_option' + j + '\', this.value)"' + (w_choices_params[j] ? ' disabled="disabled"' : '') + ' />' +
9139
  }
9140
 
9141
  option.setAttribute("onselect", "set_select('" + i + "_option" + j + "')");
9142
+ option.innerHTML = w_choices[j].replace(/"/g, "&quot;");
9143
  if (w_choices_checked[j] == 1)
9144
  option.setAttribute("selected", "selected");
9145
  select_.appendChild(option);
9305
  for (j = 0; j < n; j++) {
9306
  var attr = jQuery('<div id="' + j + '" class="change_pos fm-width-100">' +
9307
  '<div class="fm-table-col fm-width-60">' +
9308
+ '<input type="text" class="fm-field-choice" id="el_choices' + j + '" value="' + w_choices[j].replace(/"/g, "&quot;") + '" onKeyUp="change_label(\'' + i + '_label_element' + j + '\', this.value); change_label_1(\'' + i + '_elementlabel_form_id_temp' + j + '\', this.value);"' + (w_choices_params[j] ? ' disabled="disabled"' : '') + ' />' +
9309
  '</div>' +
9310
  '<div class="fm-table-col fm-width-20">' +
9311
  '<input type="text" class="fm-field-choice" id="el_option_price' + j + '" value="' + w_choices_price[j] + '" onKeyPress="return check_isnum_point(event)" onKeyUp="change_value_price(\'' + i + '_elementform_id_temp' + j + '\', this.value)"' + (w_choices_params[j] ? ' disabled="disabled"' : '') + ' />' +
9510
  label_adding.setAttribute("id", i + "_label_element" + j);
9511
  label_adding.setAttribute("class", "ch-rad-label");
9512
  label_adding.setAttribute("for", i + "_elementform_id_temp" + j);
9513
+ label_adding.innerHTML = w_choices[j].replace(/"/g, "&quot;");
9514
  if (w_field_option_pos == "right")
9515
  label_adding.style.cssText = "float: none !important";
9516
  if (w_choices_params[j]) {
9525
  adding_ch_label.setAttribute("type", "hidden");
9526
  adding_ch_label.setAttribute("id", i + "_elementlabel_form_id_temp" + j);
9527
  adding_ch_label.setAttribute("name", i + "_elementform_id_temp" + j + "_label");
9528
+ adding_ch_label.setAttribute("value", w_choices[j].replace(/"/g, "&quot;"));
9529
 
9530
  td_little.appendChild(adding);
9531
  td_little.appendChild(label_adding);
9736
  label_adding.setAttribute("id", i + "_label_element" + j);
9737
  label_adding.setAttribute("class", "ch-rad-label");
9738
  label_adding.setAttribute("for", i + "_elementform_id_temp" + j);
9739
+ label_adding.innerHTML = w_choices[j].replace(/"/g, "&quot;");
9740
  if (w_field_option_pos == "right")
9741
  label_adding.style.cssText = "float: none !important";
9742
  if (w_choices_params[j]) {
9751
  adding_ch_label.setAttribute("type", "hidden");
9752
  adding_ch_label.setAttribute("id", i + "_elementlabel_form_id_temp" + j);
9753
  adding_ch_label.setAttribute("name", i + "_elementform_id_temp" + j + "_label");
9754
+ adding_ch_label.setAttribute("value", w_choices[j].replace(/"/g, "&quot;"));
9755
 
9756
  td_little.appendChild(adding);
9757
  td_little.appendChild(label_adding);
9973
  label_adding.setAttribute("id", i + "_label_element" + j);
9974
  label_adding.setAttribute("class", "ch-rad-label");
9975
  label_adding.setAttribute("for", i + "_elementform_id_temp" + j);
9976
+ label_adding.innerHTML = w_choices[j].replace(/"/g, "&quot;");
9977
  if (w_field_option_pos == "right")
9978
  label_adding.style.cssText = "float: none !important";
9979
  if (w_choices_params[j]) {
9987
  adding_ch_label.setAttribute("type", "hidden");
9988
  adding_ch_label.setAttribute("id", i + "_elementlabel_form_id_temp" + j);
9989
  adding_ch_label.setAttribute("name", i + "_elementform_id_temp" + j + "_label");
9990
+ adding_ch_label.setAttribute("value", w_choices[j].replace(/"/g, "&quot;"));
9991
 
9992
  td_little.appendChild(adding);
9993
  td_little.appendChild(label_adding);
13068
 
13069
  function create_placeholder_phone(i, w_title) {
13070
  var label = jQuery('<label class="fm-field-label" for="el_first_value_area">Placeholder</label>');
13071
+ var input = jQuery('<input type="text" class="fm-width-20" id="el_first_value_area" onKeyUp="change_input_value(this.value,\'' + i + '_element_firstform_id_temp\')" value="' + w_title[0].replace(/"/g, "&quot;") + '" />-<input type="text" class="fm-width-60" id="el_first_value_phone" onKeyUp="change_input_value(this.value,\'' + i + '_element_lastform_id_temp\')" value="' + w_title[1].replace(/"/g, "&quot;") + '" />');
13072
  return create_option_container(label, input);
13073
  }
13074
 
js/form_maker_admin.js CHANGED
@@ -61,7 +61,7 @@ function fm_toggle_postbox(that) {
61
  }
62
 
63
  function fm_option_tabs_mail_validation() {
64
- if (fm_check_email('email') || fm_check_email('fm_email_to') || fm_check_email('mail_bcc_user') || fm_check_email('mail_cc_user') || fm_check_email('reply_to_other') || fm_check_email('mail_cc') || fm_check_email('mail_bcc') || fm_check_email('mailToAdd') || fm_check_email('from_mail') || fm_check_email('reply_to') || fm_check_email('mail_from_user') || fm_check_email('reply_to_user') || fm_check_email('mail_from_other') || fm_check_email('reply_to_other') || fm_check_email('paypal_email')) {
65
  return false;
66
  }
67
  return true;
@@ -734,7 +734,7 @@ function fm_delete_ip( id ) {
734
  if(!isNaN(paged)) {
735
  url = url.replace(/(paged=)[^\&]+/, '$1' + paged);
736
  }
737
- jQuery('.wrap').load(url + ' #blocked_ips',function(){
738
  window.history.pushState(null, null, url);
739
  if (jQuery(".updated").length != 0) {
740
  jQuery(" .updated p strong").html("Items Successfully Deleted");
@@ -785,7 +785,7 @@ function fm_insert_blocked_ip() {
785
  "last_id" : 1
786
  },
787
  success: function (response) {
788
- jQuery('#fm-form-admin').load(url + ' #blocked_ips',function() {
789
  window.history.pushState(null, null, url);
790
  if (jQuery(".updated").length != 0) {
791
  jQuery(".updated p strong").html("Items Successfully Saved");
@@ -946,4 +946,78 @@ function fm_loading_show() {
946
  }
947
  function fm_loading_hide() {
948
  jQuery('#fm_loading').hide();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
949
  }
61
  }
62
 
63
  function fm_option_tabs_mail_validation() {
64
+ if (fm_check_email('email') || fm_check_email('fm_email_to') || fm_check_email('mail_bcc_user') || fm_check_email('mail_cc_user') || fm_check_email('reply_to_other') || fm_check_email('mail_cc') || fm_check_email('mail_bcc') || fm_check_email('mail') || fm_check_email('from_mail') || fm_check_email('reply_to') || fm_check_email('mail_from_user') || fm_check_email('reply_to_user') || fm_check_email('mail_from_other') || fm_check_email('reply_to_other') || fm_check_email('paypal_email')) {
65
  return false;
66
  }
67
  return true;
734
  if(!isNaN(paged)) {
735
  url = url.replace(/(paged=)[^\&]+/, '$1' + paged);
736
  }
737
+ jQuery('#blocked_ips').parent('.wrap').load(url + ' #blocked_ips',function(){
738
  window.history.pushState(null, null, url);
739
  if (jQuery(".updated").length != 0) {
740
  jQuery(" .updated p strong").html("Items Successfully Deleted");
785
  "last_id" : 1
786
  },
787
  success: function (response) {
788
+ jQuery('#blocked_ips').parent('.wrap').load(url + ' #blocked_ips',function() {
789
  window.history.pushState(null, null, url);
790
  if (jQuery(".updated").length != 0) {
791
  jQuery(".updated p strong").html("Items Successfully Saved");
946
  }
947
  function fm_loading_hide() {
948
  jQuery('#fm_loading').hide();
949
+ }
950
+
951
+ /**
952
+ * Get form local storage.
953
+ *
954
+ * @returns object
955
+ */
956
+ function getFormLocalStorage(){
957
+ var formStoragObj = {};
958
+ formId = getAllUrlParams().current_id;
959
+ var formStorag = localStorage.getItem('fm_form' + formId);
960
+ if ( formStorag != null ) {
961
+ formStoragObj = jQuery.parseJSON(formStorag);
962
+ }
963
+ return formStoragObj;
964
+ }
965
+
966
+ /**
967
+ * Get all Url params.
968
+ *
969
+ * @param url
970
+ * @returns object
971
+ */
972
+ function getAllUrlParams(url) {
973
+ // get query string from url (optional) or window
974
+ var queryString = url ? url.split('?')[1] : window.location.search.slice(1);
975
+ // we'll store the parameters here
976
+ var obj = {};
977
+ // if query string exists
978
+ if (queryString) {
979
+ // stuff after # is not part of query string, so get rid of it
980
+ queryString = queryString.split('#')[0];
981
+ // split our query string into its component parts
982
+ var arr = queryString.split('&');
983
+ for (var i=0; i<arr.length; i++) {
984
+ // separate the keys and the values
985
+ var a = arr[i].split('=');
986
+ // in case params look like: list[]=thing1&list[]=thing2
987
+ var paramNum = undefined;
988
+ var paramName = a[0].replace(/\[\d*\]/, function(v) {
989
+ paramNum = v.slice(1,-1);
990
+ return '';
991
+ });
992
+
993
+ // set parameter value (use 'true' if empty)
994
+ var paramValue = typeof(a[1]) === 'undefined' ? true : a[1];
995
+ // (optional) keep case consistent
996
+ paramName = paramName.toLowerCase();
997
+ paramValue = paramValue.toLowerCase();
998
+
999
+ // if parameter name already exists
1000
+ if (obj[paramName]) {
1001
+ // convert value to array (if still string)
1002
+ if (typeof obj[paramName] === 'string') {
1003
+ obj[paramName] = [obj[paramName]];
1004
+ }
1005
+ // if no array index number specified...
1006
+ if (typeof paramNum === 'undefined') {
1007
+ // put the value on the end of the array
1008
+ obj[paramName].push(paramValue);
1009
+ }
1010
+ // if array index number specified...
1011
+ else {
1012
+ // put the value at that index number
1013
+ obj[paramName][paramNum] = paramValue;
1014
+ }
1015
+ }
1016
+ // if param name doesn't exist yet, set it
1017
+ else {
1018
+ obj[paramName] = paramValue;
1019
+ }
1020
+ }
1021
+ }
1022
+ return obj;
1023
  }
js/form_maker_form_options.js CHANGED
@@ -37,11 +37,11 @@ jQuery(document).ready(function () {
37
  }
38
  });
39
  });
40
-
41
- jQuery(window).load(function () {
42
  var fieldset_id = jQuery("#fieldset_id").val();
43
  form_maker_options_tabs(fieldset_id);
44
-
45
  if ( fieldset_id == 'javascript' ) {
46
  codemirror_for_javascript();
47
  }
@@ -116,7 +116,7 @@ function filter_placeholders(that) {
116
  }
117
 
118
  function wd_fm_apply_options(task) {
119
- var submit = fm_option_tabs_mail_validation();
120
  if(submit === true){
121
  set_condition();
122
  fm_set_input_value('task', task);
37
  }
38
  });
39
  });
40
+
41
+ jQuery(window).on('load', function () {
42
  var fieldset_id = jQuery("#fieldset_id").val();
43
  form_maker_options_tabs(fieldset_id);
44
+
45
  if ( fieldset_id == 'javascript' ) {
46
  codemirror_for_javascript();
47
  }
116
  }
117
 
118
  function wd_fm_apply_options(task) {
119
+ var submit = fm_option_tabs_mail_validation();
120
  if(submit === true){
121
  set_condition();
122
  fm_set_input_value('task', task);
js/form_maker_manage.js CHANGED
@@ -160,14 +160,15 @@ function fm_delete_mail(img, value) {
160
  }
161
 
162
  function form_maker_options_tabs(id) {
163
- var tab = fm_option_tabs_mail_validation();
164
- if(tab === true) {
165
- jQuery("#fieldset_id").val(id);
166
- jQuery(".fm_fieldset_active").removeClass("fm_fieldset_active").addClass("fm_fieldset_deactive");
167
- jQuery("#" + id + "_fieldset").removeClass("fm_fieldset_deactive").addClass("fm_fieldset_active");
168
- jQuery(".fm_fieldset_tab").removeClass("active");
169
- jQuery("#" + id).addClass("active");
170
- }
 
171
  return false;
172
  }
173
 
@@ -225,8 +226,40 @@ function fm_check_email(id) {
225
  var re = /^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,61}$/;
226
  for (var email_id = 0; email_id < email_array.length; email_id++) {
227
  var email = email_array[email_id].replace(/^\s+|\s+$/g, '');
228
- if ( ! re.test( email ) && jQuery('#' + id).val().indexOf('{') === -1 ) {
229
  alert('This is not a valid email address.');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
230
  jQuery('#' + id).css('border', '1px solid #FF0000');
231
  jQuery('#' + id).focus();
232
  jQuery('html, body').animate({
160
  }
161
 
162
  function form_maker_options_tabs(id) {
163
+ var tab = fm_option_tabs_mail_validation();
164
+ if ( tab === true ) {
165
+ jQuery("#fieldset_id").val(id);
166
+ jQuery(".fm_fieldset_active").removeClass("fm_fieldset_active").addClass("fm_fieldset_deactive");
167
+ jQuery("#" + id + "_fieldset").removeClass("fm_fieldset_deactive").addClass("fm_fieldset_active");
168
+ jQuery(".fm_fieldset_tab").removeClass("active");
169
+ jQuery("#" + id).addClass("active");
170
+ }
171
+
172
  return false;
173
  }
174
 
226
  var re = /^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,61}$/;
227
  for (var email_id = 0; email_id < email_array.length; email_id++) {
228
  var email = email_array[email_id].replace(/^\s+|\s+$/g, '');
229
+ if ( email && ! re.test( email ) && email.indexOf('{') === -1 ) {
230
  alert('This is not a valid email address.');
231
+
232
+ /* Do only if there is active class */
233
+ if( jQuery('#submenu li a').hasClass('active') ) {
234
+ var activeTabId = jQuery("#submenu .active").attr("id");
235
+ var error_cont_id = jQuery('#' + id).closest(".fm_fieldset_deactive").attr("id");
236
+
237
+ if(typeof error_cont_id != 'undefined') {
238
+ var error_tab_id = error_cont_id.split("_fieldset");
239
+ tab_id = error_tab_id[0];
240
+
241
+ /* If current active and error active tabs are the same */
242
+ if ( activeTabId != tab_id ) {
243
+ var activeContentId = activeTabId +"_fieldset";
244
+ jQuery("#"+activeContentId).removeClass("fm_fieldset_active");
245
+ jQuery("#"+activeContentId).removeClass("fm_fieldset_deactive");
246
+ jQuery("#" + error_cont_id).addClass("fm_fieldset_active");
247
+ jQuery("#submenu .active").removeClass('active');
248
+ jQuery("#" + tab_id).addClass("active");
249
+ }
250
+ }
251
+ } else {
252
+ var error_cont_id = jQuery('#' + id).closest(".fm_fieldset_deactive").attr("id");
253
+ if(typeof error_cont_id != 'undefined') {
254
+ var tab_id = error_cont_id.split("_fieldset");
255
+ tab_id = tab_id[0];
256
+
257
+ jQuery("#" + error_cont_id).removeClass("fm_fieldset_deactive");
258
+ jQuery("#" + error_cont_id).addClass("fm_fieldset_active");
259
+ jQuery("#" + tab_id).addClass("active");
260
+ }
261
+ }
262
+
263
  jQuery('#' + id).css('border', '1px solid #FF0000');
264
  jQuery('#' + id).focus();
265
  jQuery('html, body').animate({
js/form_maker_submissions.js CHANGED
@@ -1,11 +1,80 @@
1
- jQuery( document ).ready(function() {
2
- add_scroll_width();
3
- add_scroll_left();
4
- fm_Tooltip();
 
 
 
 
 
 
 
 
 
 
 
 
5
  });
6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  function add_scroll_width() {
8
- var wrapFullWidth = jQuery('.form_maker_submissions').width();
9
  var scrollWidth = 0;
10
  jQuery.each(jQuery("#fm-scroll table tr.fm_table_head td:visible, #fm-scroll table tr.fm_table_head th:visible"), function( index, value ) {
11
  scrollWidth += jQuery(this).width();
@@ -75,17 +144,18 @@ function renderColumns() {
75
 
76
  function clickLabChB(label, ChB) {
77
  document.forms.admin_form.hide_label_list.value = document.forms.admin_form.hide_label_list.value.replace('@' + label + '@', '');
78
- if (document.forms.admin_form.hide_label_list.value == '') {
79
  document.getElementById('ChBAll').checked = true;
80
  }
81
- if (!(ChB.checked)) {
82
  document.forms.admin_form.hide_label_list.value += '@' + label + '@';
83
  document.getElementById('ChBAll').checked = false;
84
  }
85
  renderColumns();
 
86
  }
87
 
88
- function toggleChBDiv(flag) {
89
  if (flag) {
90
  /* sizes = window.getSize().size;*/
91
  var width = jQuery(window).width();
@@ -96,15 +166,71 @@ function toggleChBDiv(flag) {
96
 
97
  document.getElementById("ChBDiv").style.display = "block";
98
  document.getElementById("sbox-overlay").style.display = "block";
99
- }
 
100
  else {
101
  document.getElementById("ChBDiv").style.display = "none";
102
  document.getElementById("sbox-overlay").style.display = "none";
 
 
103
  }
104
  add_scroll_width();
105
  add_scroll_left();
106
  }
107
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
  function submit_del(href_in) {
109
  document.getElementById('admin_form').action = href_in;
110
  document.getElementById('admin_form').submit();
1
+ jQuery(document).ready(function() {
2
+ jQuery('.theme-detail').click(function () {
3
+ jQuery(this).siblings('.themedetaildiv').toggle();
4
+ return false;
5
+ });
6
+ jQuery("#startdate, #startstats, #enddate, #endstats").datepicker({
7
+ dateFormat: "yy-mm-dd",
8
+ changeMonth: true,
9
+ changeYear: true
10
+ });
11
+
12
+ show_hide_columns_history();
13
+ add_scroll_width();
14
+ add_scroll_left();
15
+ fm_Tooltip();
16
+ filter_fields_submit();
17
  });
18
 
19
+ jQuery(window).scroll(function () {
20
+ var scrollTop = jQuery(this).scrollTop();
21
+ var wrapperTop = jQuery('.tablenav').offset().top;
22
+ if ( scrollTop > wrapperTop ) {
23
+ jQuery('.table-wrapper-1').addClass('fixed').css({'width': jQuery('#admin_form').width() + 'px' });
24
+ } else {
25
+ jQuery('.table-wrapper-1').removeClass('fixed')
26
+ }
27
+ });
28
+
29
+ jQuery(window).on('load', function (e) {
30
+ fm_popup();
31
+ if (typeof jQuery().fancybox !== 'undefined' && jQuery.isFunction(jQuery().fancybox)) {
32
+ jQuery(".fm_fancybox").fancybox({
33
+ 'maxWidth ': 600,
34
+ 'maxHeight': 500
35
+ });
36
+ }
37
+ });
38
+
39
+ jQuery(window).on("resize", function () {
40
+ var width = jQuery(window).width();
41
+ if ( width <= 765 ) {
42
+ document.getElementById('fm-fields-filter').style.display = 'none';
43
+ remove_scroll_width();
44
+ }
45
+ else {
46
+ if ( jQuery('.hide-filter.hide').is(":visible") ) {
47
+ document.getElementById('fm-fields-filter').style.display = '';
48
+ }
49
+ add_scroll_width();
50
+ }
51
+ });
52
+
53
+ function filter_fields_submit() {
54
+ jQuery('#fm-fields-filter').find('input').keypress( function(e) {
55
+ if ( e.which == 13 ) {
56
+ fm_form_submit(false, 'admin_form');
57
+ }
58
+ });
59
+ }
60
+
61
+ function show_hide_filter() {
62
+ jQuery(".show-filter").toggle();
63
+ jQuery(".hide-filter").toggle();
64
+ if (document.getElementById('fm-fields-filter').style.display == "none") {
65
+ document.getElementById('fm-fields-filter').style.display = '';
66
+ jQuery('.fm-bulk-actions .search_reset_button').show();
67
+ }
68
+ else {
69
+ document.getElementById('fm-fields-filter').style.display = "none";
70
+ jQuery('.fm-bulk-actions .search_reset_button').hide();
71
+ }
72
+ add_scroll_width();
73
+ return false;
74
+ }
75
+
76
  function add_scroll_width() {
77
+ var wrapFullWidth = jQuery('.fm-table-submissions').width();
78
  var scrollWidth = 0;
79
  jQuery.each(jQuery("#fm-scroll table tr.fm_table_head td:visible, #fm-scroll table tr.fm_table_head th:visible"), function( index, value ) {
80
  scrollWidth += jQuery(this).width();
144
 
145
  function clickLabChB(label, ChB) {
146
  document.forms.admin_form.hide_label_list.value = document.forms.admin_form.hide_label_list.value.replace('@' + label + '@', '');
147
+ if ( document.forms.admin_form.hide_label_list.value == '' ) {
148
  document.getElementById('ChBAll').checked = true;
149
  }
150
+ if ( ! (ChB.checked) ) {
151
  document.forms.admin_form.hide_label_list.value += '@' + label + '@';
152
  document.getElementById('ChBAll').checked = false;
153
  }
154
  renderColumns();
155
+ set_all_column_checkbox_checked();
156
  }
157
 
158
+ function toggleChBDiv(flag) {
159
  if (flag) {
160
  /* sizes = window.getSize().size;*/
161
  var width = jQuery(window).width();
166
 
167
  document.getElementById("ChBDiv").style.display = "block";
168
  document.getElementById("sbox-overlay").style.display = "block";
169
+ set_columns_history_checked();
170
+ }
171
  else {
172
  document.getElementById("ChBDiv").style.display = "none";
173
  document.getElementById("sbox-overlay").style.display = "none";
174
+ set_show_hide_column_ids();
175
+ show_hide_columns_history();
176
  }
177
  add_scroll_width();
178
  add_scroll_left();
179
  }
180
 
181
+ function set_columns_history_checked() {
182
+ if ( getFormLocalStorage().show_hide_column_ids ) {
183
+ var show_hide_column_ids = getFormLocalStorage().show_hide_column_ids;
184
+ var checkboxs = jQuery('#ChBDiv input[type=checkbox]');
185
+ checkboxs.filter(':checkbox').removeAttr('checked');
186
+ var ChBAll = document.getElementById('ChBAll');
187
+ if ( checkboxs.length != show_hide_column_ids.length ) {
188
+ jQuery('#ChBAll').addClass('fm-remove_before');
189
+ }
190
+ if ( checkboxs.length == show_hide_column_ids.length) {
191
+ jQuery('#ChBAll').removeClass('fm-remove_before');
192
+ }
193
+ jQuery.each( show_hide_column_ids, function ( i, val) {
194
+ jQuery('#ChBDiv #'+ val).prop('checked',true).attr('checked');
195
+ });
196
+ }
197
+ }
198
+
199
+ function set_all_column_checkbox_checked() {
200
+ var ChBAll = jQuery('#ChBAll');
201
+ var checkboxs = jQuery('#ChBDiv input[type=checkbox]');
202
+ if ( checkboxs.length == checkboxs.filter(":checked").length ) {
203
+ ChBAll.removeClass('fm-remove_before').prop('checked', true);
204
+ }
205
+ else {
206
+ ChBAll.addClass('fm-remove_before').prop('checked', false);
207
+ }
208
+ }
209
+
210
+ function set_show_hide_column_ids() {
211
+ var ids = [];
212
+ var obj = {};
213
+ jQuery('#ChBDiv input[type=checkbox]').each(function ( i, val ) {
214
+ if ( this.checked ) {
215
+ var id = jQuery(this).attr('id');
216
+ ids.push( id );
217
+ }
218
+ });
219
+ obj.show_hide_column_ids = ids;
220
+ localStorage.setItem('fm_form' + formId, JSON.stringify(obj));
221
+ }
222
+ function show_hide_columns_history() {
223
+ if ( getFormLocalStorage().show_hide_column_ids ) {
224
+ jQuery('#fm-submission-lists th, #fm-submission-lists td').addClass('fm-hide-column');
225
+ jQuery.each( getFormLocalStorage().show_hide_column_ids , function( key, val ) {
226
+ var columnClassName = val.replace("fm_check_id_", "");
227
+ columnClassName = columnClassName.replace("fm_check_", "");
228
+ jQuery('#fm-submission-lists .' + columnClassName + '_fc' ).removeClass('fm-hide-column').addClass('fm-show-column');
229
+ });
230
+ jQuery('#fm-submission-lists .fm-column-not-hide').removeClass('fm-hide-column');
231
+ }
232
+ }
233
+
234
  function submit_del(href_in) {
235
  document.getElementById('admin_form').action = href_in;
236
  document.getElementById('admin_form').submit();
js/frontend/.gitignore DELETED
File without changes
js/main_div_front_end.js CHANGED
@@ -796,7 +796,7 @@ function page_next(id, form_id, form_view_count, form_view_max) {
796
  }
797
 
798
  function getfileextension(filename, exten) {
799
- if(filename.length == 0) {
800
  return true;
801
  }
802
  var dot = filename.lastIndexOf(".");
796
  }
797
 
798
  function getfileextension(filename, exten) {
799
+ if( typeof filename == 'undefined' || filename.length == 0) {
800
  return true;
801
  }
802
  var dot = filename.lastIndexOf(".");
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: webdorado,10web,wdsupport,formmakersupport
3
  Tags: form, form builder, contact form, custom form, feedback, contact, web contact form, captcha, email, form manager, forms, survey
4
  Requires at least: 3.4
5
  Tested up to: 4.9
6
- Stable tag: 1.12.29
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -13,7 +13,7 @@ Form Maker is a user-friendly form builder plugin that allows to create forms f
13
 
14
  https://www.youtube.com/watch?v=tN3_c6MhqFk
15
 
16
- = Useful Links =
17
  [Special Offer for all Premium Plugins](https://web-dorado.com/wordpress-plugins-bundle.html)
18
 
19
 
@@ -450,13 +450,23 @@ jQuery("#{{field_id}}").attr("class", "input_active");`
450
  Where **{{field_id}}** is the ID of the field you wish to prefill. Also, **{{param_name}}** is the name of the parameter in the URL.
451
 
452
 
453
-
454
  == Changelog ==
455
 
456
- = 2.12.29 =
 
 
 
 
 
 
 
 
 
 
 
457
  * Fixed: Bug on empty values for some field types.
458
 
459
- = 2.12.28 =
460
  * Added: Custom javascript event, occurs after form is submitted.
461
  * Changed: Code structure refactoring.
462
  * Fixed: Bug on required fields PHP validation.
3
  Tags: form, form builder, contact form, custom form, feedback, contact, web contact form, captcha, email, form manager, forms, survey
4
  Requires at least: 3.4
5
  Tested up to: 4.9
6
+ Stable tag: 1.12.31
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
13
 
14
  https://www.youtube.com/watch?v=tN3_c6MhqFk
15
 
16
+ = Useful Links: =
17
  [Special Offer for all Premium Plugins](https://web-dorado.com/wordpress-plugins-bundle.html)
18
 
19
 
450
  Where **{{field_id}}** is the ID of the field you wish to prefill. Also, **{{param_name}}** is the name of the parameter in the URL.
451
 
452
 
 
453
  == Changelog ==
454
 
455
+ = 1.12.31 =
456
+ * Improved: CSV, XML export.
457
+ * Improved: default email design
458
+ * Improved: Minor improvements in email options
459
+ * Fixed: PHP validation for email.
460
+ * Fixed: Preserve the list of columns displayed when changing the page.
461
+ * Fixed: Do not display ScrollBox form after Successful submission.
462
+
463
+ = 1.12.30 =
464
+ * Changed: Separate buttons for deactivation.
465
+
466
+ = 1.12.29 =
467
  * Fixed: Bug on empty values for some field types.
468
 
469
+ = 1.12.28 =
470
  * Added: Custom javascript event, occurs after form is submitted.
471
  * Changed: Code structure refactoring.
472
  * Fixed: Bug on required fields PHP validation.
wd/assets/css/img/close.svg ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="6917.521 490.293 11.414 11.414">
2
+ <defs>
3
+ <style>
4
+ .cls-1 {
5
+ fill: none;
6
+ stroke: #cbcbcb;
7
+ stroke-linecap: round;
8
+ stroke-linejoin: round;
9
+ }
10
+ </style>
11
+ </defs>
12
+ <g id="if_misc-_close__1276877_3_" data-name="if_misc-_close__1276877 (3)" transform="translate(6917.229 490)">
13
+ <line id="Line_262" data-name="Line 262" class="cls-1" y1="10" x2="10" transform="translate(1 1)"/>
14
+ <line id="Line_263" data-name="Line 263" class="cls-1" x2="10" y2="10" transform="translate(1 1)"/>
15
+ </g>
16
+ </svg>
wd/assets/js/deactivate_popup.js CHANGED
@@ -19,132 +19,120 @@ var btnVal = 3;
19
  ////////////////////////////////////////////////////////////////////////////////////////
20
  // Public Methods //
21
  ////////////////////////////////////////////////////////////////////////////////////////
22
- function wdReady(prefix){
23
-
24
- var agree_with_pp = false;
25
-
26
- jQuery(document).on("click", "." + window[prefix + "WDDeactivateVars"].deactivate_class, function(){
27
- agree_with_pp = false;
28
- if (!jQuery('#wd-' + prefix + '-submit-and-deactivate').hasClass('button-primary-disabled')) {
29
- jQuery('#wd-' + prefix + '-submit-and-deactivate').addClass('button-primary-disabled')
30
- }
31
- jQuery(".wd-" + prefix + "-opacity").show();
32
- jQuery(".wd-" + prefix + "-deactivate-popup").show();
33
- if(jQuery(this).attr("data-uninstall") == "1"){
34
- btnVal = 2 ;
35
- }
36
-
37
- return false;
38
- });
39
-
40
- jQuery(document).on("change", "[name=" + prefix + "_reasons]", function(){
41
-
42
- var disabled_class = (agree_with_pp === false) ? "button-primary-disabled" : "";
43
-
44
- jQuery("." + prefix + "_additional_details_wrap").html("");
45
- jQuery(".wd-" + prefix + "-deactivate-popup").removeClass("wd-popup-active1 wd-popup-active2 wd-popup-active3 wd-popup-active4");
46
- if(jQuery(this).val() == "reason_plugin_is_hard_to_use_technical_problems"){
47
-
48
- additionalInfo = '<div class="wd-additional-active"><div><strong>Please describe your issue.</strong></div><br>' +
49
- '<textarea name="' + prefix + '_additional_details" rows = "4"></textarea><br>' +
50
- '<div>Our support will contact <input type="text" name="' + prefix + '_email" value="' + window[prefix + "WDDeactivateVars"].email + '"> shortly.</div>'+
51
- '<br><div><button class="button button-primary ' + disabled_class + ' wd-' + prefix + '-deactivate" data-val="' + btnVal + '">Submit support ticket</button></div></div>';
52
- jQuery("." + prefix + "_additional_details_wrap").append(additionalInfo);
53
- jQuery(".wd-" + prefix + "-deactivate-popup").addClass("wd-popup-active1");
54
-
55
- }
56
- else if(jQuery(this).val() == "reason_free_version_limited"){
57
- additionalInfo = '<div class="wd-additional-active">' +
58
- '<div><strong>We believe our premium version will fit your needs.</strong></div>' +
59
- '<div><a href="' + window[prefix + "WDDeactivateVars"].plugin_wd_url+ '" target="_blank">Try with 30 day money back guarantee.</a></div>';
60
-
61
- jQuery("." + prefix + "_additional_details_wrap").append(additionalInfo);
62
- jQuery(".wd-" + prefix + "-deactivate-popup").addClass("wd-popup-active2");
63
- }
64
- else if(jQuery(this).val() == "reason_premium_expensive"){
65
- additionalInfo = '<div class="wd-additional-active">' +
66
- '<div><strong>We have a special offer for you.</strong></div>' +
67
- '<div>Submit this form to get the offer to <input type="text" name="' + prefix + '_email" value="' + window[prefix + "WDDeactivateVars"].email + '"></div>' +
68
- '<br><div><button class="button button-primary ' + disabled_class + ' wd-' + prefix + '-deactivate" data-val="' + btnVal + '">Submit</button></div></div>';
69
-
70
- jQuery("." + prefix + "_additional_details_wrap").append(additionalInfo);
71
- jQuery(".wd-" + prefix + "-deactivate-popup").addClass("wd-popup-active3");
72
- }else{
73
- jQuery(".wd-" + prefix + "-deactivate-popup").addClass("wd-popup-active4");
74
- }
75
-
76
- var checked = (agree_with_pp === true) ? "checked" : "";
77
- var agree_checkbox =
78
- "<div style='margin-top: 5px;'>" +
79
- "<input type='checkbox' " + checked + " name='" + prefix + "_agree_with_pp" + "' id='" + prefix + "_agree_with_pp" + "'/>" +
80
- "By submitting this form your email and website URL will be sent to Web-Dorado. Click the checkbox if you consent to usage of mentioned data by Web-Dorado in accordance with our <a target='_blank' href='https://web-dorado.com/web-dorado-privacy-statement.html'>Privacy Policy</a>."+
81
- "</div>";
82
-
83
- jQuery("." + prefix + "_additional_details_wrap").prepend(agree_checkbox);
84
-
85
- jQuery("#wd-" + prefix + "-deactivate").hide();
86
- jQuery("#wd-" + prefix + "-submit-and-deactivate").show();
87
-
88
- });
89
- jQuery(document).on("keyup", "[name=" + prefix + "_additional_details]", function(){
90
- if(jQuery(this).val().trim() || jQuery("[name=" + prefix + "_reasons]:checked").length > 0){
91
- jQuery("#wd-" + prefix + "-deactivate").hide();
92
- jQuery("#wd-" + prefix + "-submit-and-deactivate").show();
93
- }
94
- else{
95
- jQuery("#wd-" + prefix + "-deactivate").show();
96
- jQuery("#wd-" + prefix + "-submit-and-deactivate").hide();
97
- }
98
-
99
- });
100
-
101
- jQuery(document).on("change", "[name=" + prefix + "_agree_with_pp]", function () {
102
- if(jQuery(this).prop('checked')){
103
- jQuery(".wd-" + prefix + "-deactivate").removeClass('button-primary-disabled');
104
- agree_with_pp = true;
105
- }else{
106
- jQuery(".wd-" + prefix + "-deactivate").addClass('button-primary-disabled');
107
- agree_with_pp = false;
108
- }
109
- });
110
-
111
- jQuery(document).on("click", ".wd-" + prefix + "-deactivate", function(e){
112
-
113
- var data_val = jQuery(this).data('val');
114
- var checkbox = jQuery("#" + prefix + "_agree_with_pp");
115
-
116
-
117
- if (data_val !== 1 && (checkbox.length === 0 || checkbox.prop('checked') === false)) {
118
- return false;
119
- }
120
-
121
- jQuery(".wd-deactivate-popup-opacity-" + prefix).show();
122
- if(jQuery(this).hasClass("wd-clicked") == false){
123
- jQuery(this).addClass("wd-clicked");
124
- jQuery("[name=" + prefix + "_submit_and_deactivate]").val(jQuery(this).attr("data-val"));
125
- jQuery("#" + prefix + "_deactivate_form").submit();
126
- }
127
- return false;
128
- });
129
-
130
- jQuery(document).on("click", ".wd-" + prefix + "-cancel, .wd-opacity, .wd-deactivate-popup-close-btn", function(){
131
- jQuery(".wd-" + prefix + "-opacity").hide();
132
- jQuery(".wd-" + prefix + "-deactivate-popup").hide();
133
- reset_popup();
134
-
135
- return false;
136
- });
137
-
138
- function reset_popup() {
139
- jQuery("." + prefix + "_additional_details_wrap").html("");
140
- jQuery(".wd-" + prefix + "-deactivate-popup").removeClass("wd-popup-active1 wd-popup-active2 wd-popup-active3 wd-popup-active4");
141
-
142
- jQuery("#wd-" + prefix + "-deactivate").removeClass("button-primary-disabled");
143
- jQuery("#wd-" + prefix + "-deactivate").show();
144
- jQuery("#wd-" + prefix + "-submit-and-deactivate").hide();
145
- jQuery('#' + prefix + '_deactivate_form input[name="' + prefix + '_reasons' + '"]').prop('checked', false);
146
 
 
 
 
 
 
 
 
 
 
 
 
 
 
147
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
 
149
  }
150
 
19
  ////////////////////////////////////////////////////////////////////////////////////////
20
  // Public Methods //
21
  ////////////////////////////////////////////////////////////////////////////////////////
22
+ function wdReady( prefix ) {
23
+
24
+ var agree_with_pp = false;
25
+ reset_popup();
26
+ jQuery( document ).on( "click", "." + window[prefix + "WDDeactivateVars"].deactivate_class, function () {
27
+ agree_with_pp = false;
28
+ if ( !jQuery( '#wd-' + prefix + '-submit-and-deactivate' ).hasClass( 'button-primary-disabled' ) ) {
29
+ jQuery( '#wd-' + prefix + '-submit-and-deactivate' ).addClass( 'button-primary-disabled' )
30
+ }
31
+ jQuery( ".wd-" + prefix + "-opacity" ).show();
32
+ jQuery( ".wd-" + prefix + "-deactivate-popup" ).show();
33
+ if ( jQuery( this ).attr( "data-uninstall" ) == "1" ) {
34
+ btnVal = 2;
35
+ }
36
+
37
+ return false;
38
+ } );
39
+
40
+ jQuery( document ).on( "change", "[name=" + prefix + "_reasons]", function () {
41
+ var disabled_class = ( agree_with_pp === false ) ? "button-primary-disabled" : "";
42
+
43
+ jQuery( "." + prefix + "_additional_details_wrap" ).html( "" );
44
+ jQuery( ".wd-" + prefix + "-deactivate-popup" ).removeClass( "wd-popup-active1 wd-popup-active2 wd-popup-active3 wd-popup-active4" );
45
+ if ( jQuery( this ).val() == "reason_plugin_is_hard_to_use_technical_problems" ) {
46
+
47
+ additionalInfo = '<div class="wd-additional-active"><div><strong>Please describe your issue.</strong></div><br>' +
48
+ '<textarea name="' + prefix + '_additional_details" rows = "4"></textarea><br>' +
49
+ '<div>Our support will contact <input type="text" name="' + prefix + '_email" value="' + window[prefix + "WDDeactivateVars"].email + '"> shortly.</div>' +
50
+ '<br><div><button class="button button-primary ' + disabled_class + ' wd-' + prefix + '-deactivate" data-val="' + btnVal + '">Submit support ticket</button></div></div>';
51
+ jQuery( "." + prefix + "_additional_details_wrap" ).append( additionalInfo );
52
+ jQuery( ".wd-" + prefix + "-deactivate-popup" ).addClass( "wd-popup-active1" );
53
+
54
+ }
55
+ else if ( jQuery( this ).val() == "reason_free_version_limited" ) {
56
+ additionalInfo = '<div class="wd-additional-active">' +
57
+ '<div><strong>We believe our premium version will fit your needs.</strong></div>' +
58
+ '<div><a href="' + window[prefix + "WDDeactivateVars"].plugin_wd_url + '" target="_blank">Try with 30 day money back guarantee.</a></div>';
59
+
60
+ jQuery( "." + prefix + "_additional_details_wrap" ).append( additionalInfo );
61
+ jQuery( ".wd-" + prefix + "-deactivate-popup" ).addClass( "wd-popup-active2" );
62
+ }
63
+ else if ( jQuery( this ).val() == "reason_premium_expensive" ) {
64
+ additionalInfo = '<div class="wd-additional-active">' +
65
+ '<div><strong>We have a special offer for you.</strong></div>' +
66
+ '<div>Submit this form to get the offer to <input type="text" name="' + prefix + '_email" value="' + window[prefix + "WDDeactivateVars"].email + '"></div>' +
67
+ '<br><div><button class="button button-primary ' + disabled_class + ' wd-' + prefix + '-deactivate" data-val="' + btnVal + '">Submit</button></div></div>';
68
+
69
+ jQuery( "." + prefix + "_additional_details_wrap" ).append( additionalInfo );
70
+ jQuery( ".wd-" + prefix + "-deactivate-popup" ).addClass( "wd-popup-active3" );
71
+ } else {
72
+ jQuery( ".wd-" + prefix + "-deactivate-popup" ).addClass( "wd-popup-active4" );
73
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
 
75
+ var checked = ( agree_with_pp === true ) ? "checked" : "";
76
+ var agree_checkbox =
77
+ "<div style='margin-top: 5px;'>" +
78
+ "<input type='checkbox' " + checked + " name='" + prefix + "_agree_with_pp" + "' id='" + prefix + "_agree_with_pp" + "'/>" +
79
+ "By submitting this form your email and website URL will be sent to Web-Dorado. Click the checkbox if you consent to usage of mentioned data by Web-Dorado in accordance with our <a target='_blank' href='https://web-dorado.com/web-dorado-privacy-statement.html'>Privacy Policy</a>."+
80
+ "</div>";
81
+ jQuery( "." + prefix + "_additional_details_wrap" ).prepend( agree_checkbox );
82
+
83
+ jQuery( "#wd-" + prefix + "-submit-and-deactivate" ).show();
84
+ } );
85
+ jQuery( document ).on( "keyup", "[name=" + prefix + "_additional_details]", function () {
86
+ if ( jQuery( this ).val().trim() || jQuery( "[name=" + prefix + "_reasons]:checked" ).length > 0 ) {
87
+ jQuery( "#wd-" + prefix + "-submit-and-deactivate" ).show();
88
  }
89
+ else {
90
+ jQuery( "#wd-" + prefix + "-submit-and-deactivate" ).hide();
91
+ }
92
+ } );
93
+
94
+ jQuery( document ).on( "change", "[name=" + prefix + "_agree_with_pp]", function () {
95
+ if ( jQuery( this ).prop( 'checked' ) ) {
96
+ jQuery( ".wd-" + prefix + "-deactivate" ).removeClass( 'button-primary-disabled' );
97
+ agree_with_pp = true;
98
+ } else {
99
+ jQuery( ".wd-" + prefix + "-deactivate" ).addClass( 'button-primary-disabled' );
100
+ agree_with_pp = false;
101
+ }
102
+ } );
103
+
104
+ jQuery( document ).on( "click", ".wd-" + prefix + "-deactivate", function ( e ) {
105
+ var data_val = jQuery( this ).data( 'val' );
106
+ var checkbox = jQuery( "#" + prefix + "_agree_with_pp" );
107
+
108
+ if ( data_val !== 1 && ( checkbox.length === 0 || checkbox.prop( 'checked' ) === false ) ) {
109
+ return false;
110
+ }
111
+
112
+ jQuery( ".wd-deactivate-popup-opacity-" + prefix ).show();
113
+ if ( jQuery( this ).hasClass( "wd-clicked" ) == false ) {
114
+ jQuery( this ).addClass( "wd-clicked" );
115
+ jQuery( "[name=" + prefix + "_submit_and_deactivate]" ).val( jQuery( this ).attr( "data-val" ) );
116
+ jQuery( "#" + prefix + "_deactivate_form" ).submit();
117
+ }
118
+ return false;
119
+ } );
120
+
121
+ jQuery( document ).on( "click", ".wd-" + prefix + "-cancel, .wd-opacity, .wd-deactivate-popup-close-btn", function () {
122
+ jQuery( ".wd-" + prefix + "-opacity" ).hide();
123
+ jQuery( ".wd-" + prefix + "-deactivate-popup" ).hide();
124
+ reset_popup();
125
+
126
+ return false;
127
+ } );
128
+
129
+ function reset_popup() {
130
+ jQuery( "." + prefix + "_additional_details_wrap" ).html( "" );
131
+ jQuery( ".wd-" + prefix + "-deactivate-popup" ).removeClass( "wd-popup-active1 wd-popup-active2 wd-popup-active3 wd-popup-active4" );
132
+
133
+ jQuery( "#wd-" + prefix + "-submit-and-deactivate" ).hide();
134
+ jQuery( '#' + prefix + '_deactivate_form input[name="' + prefix + '_reasons' + '"]' ).prop( 'checked', false );
135
+ }
136
 
137
  }
138
 
wd/templates/display_deactivation_popup.php CHANGED
@@ -19,8 +19,8 @@
19
  <div class="<?php echo $wd_options->prefix; ?>_additional_details_wrap"></div>
20
  </div>
21
  <div class="wd-btns">
22
- <a href="<?php echo $deactivate_url; ?>" data-val="1" class="button button-primary button-close wd-<?php echo $wd_options->prefix; ?>-deactivate" id="wd-<?php echo $wd_options->prefix; ?>-deactivate"><?php _e( "Skip and Deactivate" , $wd_options->prefix ); ?></a>
23
- <a href="<?php echo $deactivate_url; ?>" data-val="2" class="button button-primary button-primary-disabled button-close wd-<?php echo $wd_options->prefix; ?>-deactivate" id="wd-<?php echo $wd_options->prefix; ?>-submit-and-deactivate" style="display:none;"><?php _e( "Submit and Deactivate" , $wd_options->prefix ); ?></a>
24
  </div>
25
  <input type="hidden" name="<?php echo $wd_options->prefix . "_submit_and_deactivate"; ?>" value="" >
26
  <?php wp_nonce_field( $wd_options->prefix . '_save_form', $wd_options->prefix . '_save_form_fild'); ?>
19
  <div class="<?php echo $wd_options->prefix; ?>_additional_details_wrap"></div>
20
  </div>
21
  <div class="wd-btns">
22
+ <a href="<?php echo $deactivate_url; ?>" data-val="1" class="button button-secondary button-close" id="wd-<?php echo $wd_options->prefix; ?>-deactivate"><?php _e( "Skip and Deactivate" , $wd_options->prefix ); ?></a>
23
+ <a href="<?php echo $deactivate_url; ?>" data-val="2" class="button button-primary button-primary-disabled button-close wd-<?php echo $wd_options->prefix; ?>-deactivate" id="wd-<?php echo $wd_options->prefix; ?>-submit-and-deactivate"><?php _e( "Submit and Deactivate" , $wd_options->prefix ); ?></a>
24
  </div>
25
  <input type="hidden" name="<?php echo $wd_options->prefix . "_submit_and_deactivate"; ?>" value="" >
26
  <?php wp_nonce_field( $wd_options->prefix . '_save_form', $wd_options->prefix . '_save_form_fild'); ?>