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

Version Description

Fixed: Bug with Date field in custom text in Email
Fixed: Bug on editing submissions with checkbox and radio fields with customized values

Download this release

Release Info

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

Code changes from version 1.9.2 to 1.9.3

Files changed (47) hide show
  1. admin/controllers/FMControllerBlocked_ips_fm.php +147 -147
  2. admin/controllers/FMControllerFormMakerEditCSS.php +97 -97
  3. admin/controllers/FMControllerFormMakerPreview.php +42 -42
  4. admin/controllers/FMControllerFormMakerSQLMapping.php +111 -111
  5. admin/controllers/FMControllerFormMakerSubmits.php +42 -42
  6. admin/controllers/FMControllerFormmakerwdcaptcha.php +42 -42
  7. admin/controllers/FMControllerFormmakerwdmathcaptcha.php +42 -42
  8. admin/controllers/FMControllerFormmakerwindow.php +42 -42
  9. admin/controllers/FMControllerFromeditcountryinpopup.php +42 -42
  10. admin/controllers/FMControllerFromipinfoinpopup.php +42 -42
  11. admin/controllers/FMControllerFrommapeditinpopup.php +42 -42
  12. admin/controllers/FMControllerGenerete_csv.php +42 -42
  13. admin/controllers/FMControllerGenerete_xml.php +42 -42
  14. admin/controllers/FMControllerGoptions_fm.php +68 -68
  15. admin/controllers/FMControllerLicensing_fm.php +48 -48
  16. admin/controllers/FMControllerManage_fm.php +1266 -1266
  17. admin/controllers/FMControllerSelect_data_from_db.php +69 -69
  18. admin/controllers/FMControllerShow_matrix.php +42 -42
  19. admin/controllers/FMControllerSubmissions_fm.php +803 -803
  20. admin/controllers/FMControllerThemes_fm.php +188 -188
  21. admin/controllers/FMControllerUninstall_fm.php +57 -57
  22. admin/controllers/FMControllerWidget.php +60 -60
  23. admin/models/FMModelBlocked_ips_fm.php +74 -74
  24. admin/models/FMModelFormMakerEditCSS.php +41 -41
  25. admin/models/FMModelFormMakerPreview.php +41 -41
  26. admin/models/FMModelFormMakerSQLMapping.php +120 -120
  27. admin/models/FMModelFormMakerSubmits.php +42 -42
  28. admin/models/FMModelFormmakerwdcaptcha.php +30 -30
  29. admin/models/FMModelFormmakerwdmathcaptcha.php +30 -30
  30. admin/models/FMModelFormmakerwindow.php +35 -35
  31. admin/models/FMModelFromeditcountryinpopup.php +30 -30
  32. admin/models/FMModelFromipinfoinpopup.php +30 -30
  33. admin/models/FMModelFrommapeditinpopup.php +30 -30
  34. admin/models/FMModelGenerete_csv.php +269 -269
  35. admin/models/FMModelGenerete_xml.php +275 -275
  36. admin/models/FMModelGoptions_fm.php +29 -29
  37. admin/models/FMModelLicensing_fm.php +29 -29
  38. admin/models/FMModelManage_fm.php +2368 -2368
  39. admin/models/FMModelSelect_data_from_db.php +110 -110
  40. admin/models/FMModelShow_matrix.php +30 -30
  41. admin/models/FMModelSubmissions_fm.php +676 -676
  42. admin/models/FMModelThemes_fm.php +90 -90
  43. admin/models/FMModelUninstall_fm.php +54 -54
  44. admin/models/FMModelWidget.php +37 -37
  45. admin/views/FMViewBlocked_ips_fm.php +162 -162
  46. admin/views/FMViewFormMakerEditCSS.php +134 -134
  47. admin/views/FMViewFormMakerPreview.php +11 -476
admin/controllers/FMControllerBlocked_ips_fm.php CHANGED
@@ -1,148 +1,148 @@
1
- <?php
2
-
3
- class FMControllerBlocked_ips_fm {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $task = WDW_FM_Library::get('task');
23
- $id = (int)WDW_FM_Library::get('current_id', 0);
24
- $message = WDW_FM_Library::get('message');
25
- echo WDW_FM_Library::message_id($message);
26
- if (method_exists($this, $task)) {
27
- check_admin_referer('nonce_fm', 'nonce_fm');
28
- $this->$task($id);
29
- }
30
- else {
31
- $this->display();
32
- }
33
- }
34
-
35
- public function display() {
36
- require_once WD_FM_DIR . "/admin/models/FMModelBlocked_ips_fm.php";
37
- $model = new FMModelBlocked_ips_fm();
38
-
39
- require_once WD_FM_DIR . "/admin/views/FMViewBlocked_ips_fm.php";
40
- $view = new FMViewBlocked_ips_fm($model);
41
- $view->display();
42
- }
43
-
44
- public function save() {
45
- $message = $this->save_db();
46
- // $this->display();
47
- $page = WDW_FM_Library::get('page');
48
- WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
49
- }
50
-
51
- public function save_db() {
52
- global $wpdb;
53
- $id = (isset($_POST['current_id']) ? (int) $_POST['current_id'] : 0);
54
- $ip = (isset($_POST['ip']) ? esc_html(stripslashes($_POST['ip'])) : '');
55
- if ($id != 0) {
56
- $save = $wpdb->update($wpdb->prefix . 'formmaker_blocked', array(
57
- 'ip' => $ip,
58
- ), array('id' => $id));
59
- }
60
- else {
61
- $save = $wpdb->insert($wpdb->prefix . 'formmaker_blocked', array(
62
- 'ip' => $ip,
63
- ), array(
64
- '%s',
65
- ));
66
- }
67
- if ($save !== FALSE) {
68
- $message = 1;
69
- }
70
- else {
71
- $message = 2;
72
- }
73
- }
74
-
75
- public function save_all() {
76
- global $wpdb;
77
- $flag = FALSE;
78
- $ips_id_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker_blocked');
79
- foreach ($ips_id_col as $ip_id) {
80
- if (isset($_POST['ip' . $ip_id])) {
81
- $ip = esc_html(stripslashes($_POST['ip' . $ip_id]));
82
- if ($ip == '') {
83
- $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $ip_id));
84
- }
85
- else {
86
- $flag = TRUE;
87
- $wpdb->update($wpdb->prefix . 'formmaker_blocked', array(
88
- 'ip' => $ip,
89
- ), array('id' => $ip_id));
90
- }
91
- }
92
- }
93
- if ($flag) {
94
- $message = 1;
95
- }
96
- else {
97
- $message = 0;
98
- }
99
- // $this->display();
100
- $page = WDW_FM_Library::get('page');
101
- WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
102
- }
103
-
104
- public function delete($id) {
105
- global $wpdb;
106
- $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $id);
107
- if ($wpdb->query($query)) {
108
- $message = 3;
109
- }
110
- else {
111
- $message = 2;
112
- }
113
- // $this->display();
114
- $page = WDW_FM_Library::get('page');
115
- WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
116
- }
117
-
118
- public function delete_all() {
119
- global $wpdb;
120
- $flag = FALSE;
121
- $ips_id_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker_blocked');
122
- foreach ($ips_id_col as $ip_id) {
123
- if (isset($_POST['check_' . $ip_id])) {
124
- $flag = TRUE;
125
- $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $ip_id));
126
- }
127
- }
128
- if ($flag) {
129
- $message = 5;
130
- }
131
- else {
132
- $message = 2;
133
- }
134
- // $this->display();
135
- $page = WDW_FM_Library::get('page');
136
- WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
137
- }
138
-
139
- ////////////////////////////////////////////////////////////////////////////////////////
140
- // Getters & Setters //
141
- ////////////////////////////////////////////////////////////////////////////////////////
142
- ////////////////////////////////////////////////////////////////////////////////////////
143
- // Private Methods //
144
- ////////////////////////////////////////////////////////////////////////////////////////
145
- ////////////////////////////////////////////////////////////////////////////////////////
146
- // Listeners //
147
- ////////////////////////////////////////////////////////////////////////////////////////
148
  }
1
+ <?php
2
+
3
+ class FMControllerBlocked_ips_fm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $task = WDW_FM_Library::get('task');
23
+ $id = (int)WDW_FM_Library::get('current_id', 0);
24
+ $message = WDW_FM_Library::get('message');
25
+ echo WDW_FM_Library::message_id($message);
26
+ if (method_exists($this, $task)) {
27
+ check_admin_referer('nonce_fm', 'nonce_fm');
28
+ $this->$task($id);
29
+ }
30
+ else {
31
+ $this->display();
32
+ }
33
+ }
34
+
35
+ public function display() {
36
+ require_once WD_FM_DIR . "/admin/models/FMModelBlocked_ips_fm.php";
37
+ $model = new FMModelBlocked_ips_fm();
38
+
39
+ require_once WD_FM_DIR . "/admin/views/FMViewBlocked_ips_fm.php";
40
+ $view = new FMViewBlocked_ips_fm($model);
41
+ $view->display();
42
+ }
43
+
44
+ public function save() {
45
+ $message = $this->save_db();
46
+ // $this->display();
47
+ $page = WDW_FM_Library::get('page');
48
+ WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
49
+ }
50
+
51
+ public function save_db() {
52
+ global $wpdb;
53
+ $id = (isset($_POST['current_id']) ? (int) $_POST['current_id'] : 0);
54
+ $ip = (isset($_POST['ip']) ? esc_html(stripslashes($_POST['ip'])) : '');
55
+ if ($id != 0) {
56
+ $save = $wpdb->update($wpdb->prefix . 'formmaker_blocked', array(
57
+ 'ip' => $ip,
58
+ ), array('id' => $id));
59
+ }
60
+ else {
61
+ $save = $wpdb->insert($wpdb->prefix . 'formmaker_blocked', array(
62
+ 'ip' => $ip,
63
+ ), array(
64
+ '%s',
65
+ ));
66
+ }
67
+ if ($save !== FALSE) {
68
+ $message = 1;
69
+ }
70
+ else {
71
+ $message = 2;
72
+ }
73
+ }
74
+
75
+ public function save_all() {
76
+ global $wpdb;
77
+ $flag = FALSE;
78
+ $ips_id_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker_blocked');
79
+ foreach ($ips_id_col as $ip_id) {
80
+ if (isset($_POST['ip' . $ip_id])) {
81
+ $ip = esc_html(stripslashes($_POST['ip' . $ip_id]));
82
+ if ($ip == '') {
83
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $ip_id));
84
+ }
85
+ else {
86
+ $flag = TRUE;
87
+ $wpdb->update($wpdb->prefix . 'formmaker_blocked', array(
88
+ 'ip' => $ip,
89
+ ), array('id' => $ip_id));
90
+ }
91
+ }
92
+ }
93
+ if ($flag) {
94
+ $message = 1;
95
+ }
96
+ else {
97
+ $message = 0;
98
+ }
99
+ // $this->display();
100
+ $page = WDW_FM_Library::get('page');
101
+ WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
102
+ }
103
+
104
+ public function delete($id) {
105
+ global $wpdb;
106
+ $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $id);
107
+ if ($wpdb->query($query)) {
108
+ $message = 3;
109
+ }
110
+ else {
111
+ $message = 2;
112
+ }
113
+ // $this->display();
114
+ $page = WDW_FM_Library::get('page');
115
+ WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
116
+ }
117
+
118
+ public function delete_all() {
119
+ global $wpdb;
120
+ $flag = FALSE;
121
+ $ips_id_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker_blocked');
122
+ foreach ($ips_id_col as $ip_id) {
123
+ if (isset($_POST['check_' . $ip_id])) {
124
+ $flag = TRUE;
125
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $ip_id));
126
+ }
127
+ }
128
+ if ($flag) {
129
+ $message = 5;
130
+ }
131
+ else {
132
+ $message = 2;
133
+ }
134
+ // $this->display();
135
+ $page = WDW_FM_Library::get('page');
136
+ WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
137
+ }
138
+
139
+ ////////////////////////////////////////////////////////////////////////////////////////
140
+ // Getters & Setters //
141
+ ////////////////////////////////////////////////////////////////////////////////////////
142
+ ////////////////////////////////////////////////////////////////////////////////////////
143
+ // Private Methods //
144
+ ////////////////////////////////////////////////////////////////////////////////////////
145
+ ////////////////////////////////////////////////////////////////////////////////////////
146
+ // Listeners //
147
+ ////////////////////////////////////////////////////////////////////////////////////////
148
  }
admin/controllers/FMControllerFormMakerEditCSS.php CHANGED
@@ -1,98 +1,98 @@
1
- <?php
2
-
3
- class FMControllerFormMakerEditCSS {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $task = ((isset($_POST['task'])) ? esc_html($_POST['task']) : '');
23
- $id = ((isset($_POST['current_id'])) ? (int)esc_html($_POST['current_id']) : 0);
24
- if (method_exists($this, $task)) {
25
- $this->$task($id);
26
- }
27
- else {
28
- $this->display();
29
- }
30
- }
31
-
32
- public function display() {
33
- require_once WD_FM_DIR . "/admin/models/FMModelFormMakerEditCSS.php";
34
- $model = new FMModelFormMakerEditCSS();
35
-
36
- require_once WD_FM_DIR . "/admin/views/FMViewFormMakerEditCSS.php";
37
- $view = new FMViewFormMakerEditCSS($model);
38
- $view->display();
39
- }
40
-
41
- public function save() {
42
- $this->update_db();
43
- }
44
-
45
- public function apply() {
46
- $this->update_db();
47
- $this->display();
48
- }
49
-
50
- public function save_as_new() {
51
- $this->insert_db();
52
- }
53
-
54
- public function insert_db() {
55
- global $wpdb;
56
- $title = (isset($_POST['title']) ? esc_html(stripslashes( $_POST['title'])) : '');
57
- $css = (isset($_POST['css']) ? stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST['css'])) : '');
58
- $default = (isset($_POST['default']) ? esc_html(stripslashes( $_POST['default'])) : 0);
59
- $save = $wpdb->insert($wpdb->prefix . 'formmaker_themes', array(
60
- 'title' => $title,
61
- 'css' => $css,
62
- 'default' => $default,
63
- ), array(
64
- '%s',
65
- '%s',
66
- '%d',
67
- ));
68
- }
69
-
70
- public function update_db() {
71
- global $wpdb;
72
- $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes( $_POST['current_id'])) : 0);
73
- $title = (isset($_POST['title']) ? esc_html(stripslashes( $_POST['title'])) : '');
74
- $css = (isset($_POST['css']) ? stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST['css'])) : '');
75
- $default = (isset($_POST['default']) ? esc_html(stripslashes( $_POST['default'])) : 0);
76
- $save = $wpdb->update($wpdb->prefix . 'formmaker_themes', array(
77
- 'title' => $title,
78
- 'css' => $css,
79
- 'default' => $default,
80
- ), array('id' => $id));
81
- if ($save !== FALSE) {
82
- echo WDW_FM_Library::message('Item Succesfully Saved.', 'updated');
83
- }
84
- else {
85
- echo WDW_FM_Library::message('Error. Please install plugin again.', 'error');
86
- }
87
- }
88
-
89
- ////////////////////////////////////////////////////////////////////////////////////////
90
- // Getters & Setters //
91
- ////////////////////////////////////////////////////////////////////////////////////////
92
- ////////////////////////////////////////////////////////////////////////////////////////
93
- // Private Methods //
94
- ////////////////////////////////////////////////////////////////////////////////////////
95
- ////////////////////////////////////////////////////////////////////////////////////////
96
- // Listeners //
97
- ////////////////////////////////////////////////////////////////////////////////////////
98
  }
1
+ <?php
2
+
3
+ class FMControllerFormMakerEditCSS {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $task = ((isset($_POST['task'])) ? esc_html($_POST['task']) : '');
23
+ $id = ((isset($_POST['current_id'])) ? (int)esc_html($_POST['current_id']) : 0);
24
+ if (method_exists($this, $task)) {
25
+ $this->$task($id);
26
+ }
27
+ else {
28
+ $this->display();
29
+ }
30
+ }
31
+
32
+ public function display() {
33
+ require_once WD_FM_DIR . "/admin/models/FMModelFormMakerEditCSS.php";
34
+ $model = new FMModelFormMakerEditCSS();
35
+
36
+ require_once WD_FM_DIR . "/admin/views/FMViewFormMakerEditCSS.php";
37
+ $view = new FMViewFormMakerEditCSS($model);
38
+ $view->display();
39
+ }
40
+
41
+ public function save() {
42
+ $this->update_db();
43
+ }
44
+
45
+ public function apply() {
46
+ $this->update_db();
47
+ $this->display();
48
+ }
49
+
50
+ public function save_as_new() {
51
+ $this->insert_db();
52
+ }
53
+
54
+ public function insert_db() {
55
+ global $wpdb;
56
+ $title = (isset($_POST['title']) ? esc_html(stripslashes( $_POST['title'])) : '');
57
+ $css = (isset($_POST['css']) ? stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST['css'])) : '');
58
+ $default = (isset($_POST['default']) ? esc_html(stripslashes( $_POST['default'])) : 0);
59
+ $save = $wpdb->insert($wpdb->prefix . 'formmaker_themes', array(
60
+ 'title' => $title,
61
+ 'css' => $css,
62
+ 'default' => $default,
63
+ ), array(
64
+ '%s',
65
+ '%s',
66
+ '%d',
67
+ ));
68
+ }
69
+
70
+ public function update_db() {
71
+ global $wpdb;
72
+ $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes( $_POST['current_id'])) : 0);
73
+ $title = (isset($_POST['title']) ? esc_html(stripslashes( $_POST['title'])) : '');
74
+ $css = (isset($_POST['css']) ? stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST['css'])) : '');
75
+ $default = (isset($_POST['default']) ? esc_html(stripslashes( $_POST['default'])) : 0);
76
+ $save = $wpdb->update($wpdb->prefix . 'formmaker_themes', array(
77
+ 'title' => $title,
78
+ 'css' => $css,
79
+ 'default' => $default,
80
+ ), array('id' => $id));
81
+ if ($save !== FALSE) {
82
+ echo WDW_FM_Library::message('Item Succesfully Saved.', 'updated');
83
+ }
84
+ else {
85
+ echo WDW_FM_Library::message('Error. Please install plugin again.', 'error');
86
+ }
87
+ }
88
+
89
+ ////////////////////////////////////////////////////////////////////////////////////////
90
+ // Getters & Setters //
91
+ ////////////////////////////////////////////////////////////////////////////////////////
92
+ ////////////////////////////////////////////////////////////////////////////////////////
93
+ // Private Methods //
94
+ ////////////////////////////////////////////////////////////////////////////////////////
95
+ ////////////////////////////////////////////////////////////////////////////////////////
96
+ // Listeners //
97
+ ////////////////////////////////////////////////////////////////////////////////////////
98
  }
admin/controllers/FMControllerFormMakerPreview.php CHANGED
@@ -1,43 +1,43 @@
1
- <?php
2
-
3
- class FMControllerFormMakerPreview {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $this->display();
23
- }
24
-
25
- public function display() {
26
- require_once WD_FM_DIR . "/admin/models/FMModelFormMakerPreview.php";
27
- $model = new FMModelFormMakerPreview();
28
-
29
- require_once WD_FM_DIR . "/admin/views/FMViewFormMakerPreview.php";
30
- $view = new FMViewFormMakerPreview($model);
31
- $view->display();
32
- }
33
-
34
- ////////////////////////////////////////////////////////////////////////////////////////
35
- // Getters & Setters //
36
- ////////////////////////////////////////////////////////////////////////////////////////
37
- ////////////////////////////////////////////////////////////////////////////////////////
38
- // Private Methods //
39
- ////////////////////////////////////////////////////////////////////////////////////////
40
- ////////////////////////////////////////////////////////////////////////////////////////
41
- // Listeners //
42
- ////////////////////////////////////////////////////////////////////////////////////////
43
  }
1
+ <?php
2
+
3
+ class FMControllerFormMakerPreview {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $this->display();
23
+ }
24
+
25
+ public function display() {
26
+ require_once WD_FM_DIR . "/admin/models/FMModelFormMakerPreview.php";
27
+ $model = new FMModelFormMakerPreview();
28
+
29
+ require_once WD_FM_DIR . "/admin/views/FMViewFormMakerPreview.php";
30
+ $view = new FMViewFormMakerPreview($model);
31
+ $view->display();
32
+ }
33
+
34
+ ////////////////////////////////////////////////////////////////////////////////////////
35
+ // Getters & Setters //
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
+ ////////////////////////////////////////////////////////////////////////////////////////
38
+ // Private Methods //
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Listeners //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
  }
admin/controllers/FMControllerFormMakerSQLMapping.php CHANGED
@@ -1,112 +1,112 @@
1
- <?php
2
-
3
- class FMControllerFormMakerSQLMapping {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $task = ((isset($_GET['task'])) ? esc_html($_GET['task']) : 0);
23
- $id = ((isset($_GET['id'])) ? (int) $_GET['id'] : 0);
24
- $form_id = ((isset($_GET['form_id'])) ? (int) $_GET['form_id'] : 0);
25
- if ($task && method_exists($this, $task)) {
26
- $this->$task($form_id);
27
- }
28
- else {
29
- if ($id) {
30
- $this->edit_query($id, $form_id);
31
- }
32
- else {
33
- $this->add_query($form_id);
34
- }
35
- }
36
- }
37
-
38
- public function add_query($form_id) {
39
- require_once WD_FM_DIR . "/admin/models/FMModelFormMakerSQLMapping.php";
40
- $model = new FMModelFormMakerSQLMapping();
41
-
42
- require_once WD_FM_DIR . "/admin/views/FMViewFormMakerSQLMapping.php";
43
- $view = new FMViewFormMakerSQLMapping($model);
44
- $view->add_query($form_id);
45
- }
46
-
47
- public function edit_query($id, $form_id) {
48
- require_once WD_FM_DIR . "/admin/models/FMModelFormMakerSQLMapping.php";
49
- $model = new FMModelFormMakerSQLMapping();
50
-
51
- require_once WD_FM_DIR . "/admin/views/FMViewFormMakerSQLMapping.php";
52
- $view = new FMViewFormMakerSQLMapping($model);
53
- $view->edit_query($id, $form_id);
54
- }
55
-
56
- public function db_tables($form_id) {
57
- require_once WD_FM_DIR . "/admin/models/FMModelFormMakerSQLMapping.php";
58
- $model = new FMModelFormMakerSQLMapping();
59
-
60
- require_once WD_FM_DIR . "/admin/views/FMViewFormMakerSQLMapping.php";
61
- $view = new FMViewFormMakerSQLMapping($model);
62
- $view->db_tables($form_id);
63
- }
64
-
65
- public function db_table_struct($form_id) {
66
- require_once WD_FM_DIR . "/admin/models/FMModelFormMakerSQLMapping.php";
67
- $model = new FMModelFormMakerSQLMapping();
68
-
69
- require_once WD_FM_DIR . "/admin/views/FMViewFormMakerSQLMapping.php";
70
- $view = new FMViewFormMakerSQLMapping($model);
71
- $view->db_table_struct($form_id);
72
- }
73
-
74
- public function save_query() {
75
- global $wpdb;
76
- $form_id = ((isset($_GET['form_id'])) ? (int) $_GET['form_id'] : 0);
77
- $query = ((isset($_POST['query'])) ? stripslashes(wp_specialchars_decode($_POST['query'])) : "");
78
- $details = ((isset($_POST['details'])) ? esc_html($_POST['details']) : "");
79
- $save = $wpdb->insert($wpdb->prefix . 'formmaker_query', array(
80
- 'form_id' => $form_id,
81
- 'query' => $query,
82
- 'details' => $details,
83
- ), array(
84
- '%d',
85
- '%s',
86
- '%s',
87
- ));
88
- }
89
-
90
- public function update_query() {
91
- global $wpdb;
92
- $id = ((isset($_GET['id'])) ? (int) $_GET['id'] : 0);
93
- $form_id = ((isset($_GET['form_id'])) ? (int) $_GET['form_id'] : 0);
94
- $query = ((isset($_POST['query'])) ? stripslashes(wp_specialchars_decode($_POST['query'])) : "");
95
- $details = ((isset($_POST['details'])) ? esc_html($_POST['details']) : "");
96
- $save = $wpdb->update($wpdb->prefix . 'formmaker_query', array(
97
- 'form_id' => $form_id,
98
- 'query' => $query,
99
- 'details' => $details,
100
- ), array('id' => $id));
101
- }
102
-
103
- ////////////////////////////////////////////////////////////////////////////////////////
104
- // Getters & Setters //
105
- ////////////////////////////////////////////////////////////////////////////////////////
106
- ////////////////////////////////////////////////////////////////////////////////////////
107
- // Private Methods //
108
- ////////////////////////////////////////////////////////////////////////////////////////
109
- ////////////////////////////////////////////////////////////////////////////////////////
110
- // Listeners //
111
- ////////////////////////////////////////////////////////////////////////////////////////
112
  }
1
+ <?php
2
+
3
+ class FMControllerFormMakerSQLMapping {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $task = ((isset($_GET['task'])) ? esc_html($_GET['task']) : 0);
23
+ $id = ((isset($_GET['id'])) ? (int) $_GET['id'] : 0);
24
+ $form_id = ((isset($_GET['form_id'])) ? (int) $_GET['form_id'] : 0);
25
+ if ($task && method_exists($this, $task)) {
26
+ $this->$task($form_id);
27
+ }
28
+ else {
29
+ if ($id) {
30
+ $this->edit_query($id, $form_id);
31
+ }
32
+ else {
33
+ $this->add_query($form_id);
34
+ }
35
+ }
36
+ }
37
+
38
+ public function add_query($form_id) {
39
+ require_once WD_FM_DIR . "/admin/models/FMModelFormMakerSQLMapping.php";
40
+ $model = new FMModelFormMakerSQLMapping();
41
+
42
+ require_once WD_FM_DIR . "/admin/views/FMViewFormMakerSQLMapping.php";
43
+ $view = new FMViewFormMakerSQLMapping($model);
44
+ $view->add_query($form_id);
45
+ }
46
+
47
+ public function edit_query($id, $form_id) {
48
+ require_once WD_FM_DIR . "/admin/models/FMModelFormMakerSQLMapping.php";
49
+ $model = new FMModelFormMakerSQLMapping();
50
+
51
+ require_once WD_FM_DIR . "/admin/views/FMViewFormMakerSQLMapping.php";
52
+ $view = new FMViewFormMakerSQLMapping($model);
53
+ $view->edit_query($id, $form_id);
54
+ }
55
+
56
+ public function db_tables($form_id) {
57
+ require_once WD_FM_DIR . "/admin/models/FMModelFormMakerSQLMapping.php";
58
+ $model = new FMModelFormMakerSQLMapping();
59
+
60
+ require_once WD_FM_DIR . "/admin/views/FMViewFormMakerSQLMapping.php";
61
+ $view = new FMViewFormMakerSQLMapping($model);
62
+ $view->db_tables($form_id);
63
+ }
64
+
65
+ public function db_table_struct($form_id) {
66
+ require_once WD_FM_DIR . "/admin/models/FMModelFormMakerSQLMapping.php";
67
+ $model = new FMModelFormMakerSQLMapping();
68
+
69
+ require_once WD_FM_DIR . "/admin/views/FMViewFormMakerSQLMapping.php";
70
+ $view = new FMViewFormMakerSQLMapping($model);
71
+ $view->db_table_struct($form_id);
72
+ }
73
+
74
+ public function save_query() {
75
+ global $wpdb;
76
+ $form_id = ((isset($_GET['form_id'])) ? (int) $_GET['form_id'] : 0);
77
+ $query = ((isset($_POST['query'])) ? stripslashes(wp_specialchars_decode($_POST['query'])) : "");
78
+ $details = ((isset($_POST['details'])) ? esc_html($_POST['details']) : "");
79
+ $save = $wpdb->insert($wpdb->prefix . 'formmaker_query', array(
80
+ 'form_id' => $form_id,
81
+ 'query' => $query,
82
+ 'details' => $details,
83
+ ), array(
84
+ '%d',
85
+ '%s',
86
+ '%s',
87
+ ));
88
+ }
89
+
90
+ public function update_query() {
91
+ global $wpdb;
92
+ $id = ((isset($_GET['id'])) ? (int) $_GET['id'] : 0);
93
+ $form_id = ((isset($_GET['form_id'])) ? (int) $_GET['form_id'] : 0);
94
+ $query = ((isset($_POST['query'])) ? stripslashes(wp_specialchars_decode($_POST['query'])) : "");
95
+ $details = ((isset($_POST['details'])) ? esc_html($_POST['details']) : "");
96
+ $save = $wpdb->update($wpdb->prefix . 'formmaker_query', array(
97
+ 'form_id' => $form_id,
98
+ 'query' => $query,
99
+ 'details' => $details,
100
+ ), array('id' => $id));
101
+ }
102
+
103
+ ////////////////////////////////////////////////////////////////////////////////////////
104
+ // Getters & Setters //
105
+ ////////////////////////////////////////////////////////////////////////////////////////
106
+ ////////////////////////////////////////////////////////////////////////////////////////
107
+ // Private Methods //
108
+ ////////////////////////////////////////////////////////////////////////////////////////
109
+ ////////////////////////////////////////////////////////////////////////////////////////
110
+ // Listeners //
111
+ ////////////////////////////////////////////////////////////////////////////////////////
112
  }
admin/controllers/FMControllerFormMakerSubmits.php CHANGED
@@ -1,43 +1,43 @@
1
- <?php
2
-
3
- class FMControllerFormMakerSubmits {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $this->display();
23
- }
24
-
25
- public function display() {
26
- require_once WD_FM_DIR . "/admin/models/FMModelFormMakerSubmits.php";
27
- $model = new FMModelFormMakerSubmits();
28
-
29
- require_once WD_FM_DIR . "/admin/views/FMViewFormMakerSubmits.php";
30
- $view = new FMViewFormMakerSubmits($model);
31
- $view->display();
32
- }
33
-
34
- ////////////////////////////////////////////////////////////////////////////////////////
35
- // Getters & Setters //
36
- ////////////////////////////////////////////////////////////////////////////////////////
37
- ////////////////////////////////////////////////////////////////////////////////////////
38
- // Private Methods //
39
- ////////////////////////////////////////////////////////////////////////////////////////
40
- ////////////////////////////////////////////////////////////////////////////////////////
41
- // Listeners //
42
- ////////////////////////////////////////////////////////////////////////////////////////
43
  }
1
+ <?php
2
+
3
+ class FMControllerFormMakerSubmits {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $this->display();
23
+ }
24
+
25
+ public function display() {
26
+ require_once WD_FM_DIR . "/admin/models/FMModelFormMakerSubmits.php";
27
+ $model = new FMModelFormMakerSubmits();
28
+
29
+ require_once WD_FM_DIR . "/admin/views/FMViewFormMakerSubmits.php";
30
+ $view = new FMViewFormMakerSubmits($model);
31
+ $view->display();
32
+ }
33
+
34
+ ////////////////////////////////////////////////////////////////////////////////////////
35
+ // Getters & Setters //
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
+ ////////////////////////////////////////////////////////////////////////////////////////
38
+ // Private Methods //
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Listeners //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
  }
admin/controllers/FMControllerFormmakerwdcaptcha.php CHANGED
@@ -1,43 +1,43 @@
1
- <?php
2
-
3
- class FMControllerFormmakerwdcaptcha {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $this->display();
23
- }
24
-
25
- public function display() {
26
- require_once WD_FM_DIR . "/admin/models/FMModelFormmakerwdcaptcha.php";
27
- $model = new FMModelFormmakerwdcaptcha();
28
-
29
- require_once WD_FM_DIR . "/admin/views/FMViewFormmakerwdcaptcha.php";
30
- $view = new FMViewFormmakerwdcaptcha($model);
31
- $view->display();
32
- }
33
-
34
- ////////////////////////////////////////////////////////////////////////////////////////
35
- // Getters & Setters //
36
- ////////////////////////////////////////////////////////////////////////////////////////
37
- ////////////////////////////////////////////////////////////////////////////////////////
38
- // Private Methods //
39
- ////////////////////////////////////////////////////////////////////////////////////////
40
- ////////////////////////////////////////////////////////////////////////////////////////
41
- // Listeners //
42
- ////////////////////////////////////////////////////////////////////////////////////////
43
  }
1
+ <?php
2
+
3
+ class FMControllerFormmakerwdcaptcha {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $this->display();
23
+ }
24
+
25
+ public function display() {
26
+ require_once WD_FM_DIR . "/admin/models/FMModelFormmakerwdcaptcha.php";
27
+ $model = new FMModelFormmakerwdcaptcha();
28
+
29
+ require_once WD_FM_DIR . "/admin/views/FMViewFormmakerwdcaptcha.php";
30
+ $view = new FMViewFormmakerwdcaptcha($model);
31
+ $view->display();
32
+ }
33
+
34
+ ////////////////////////////////////////////////////////////////////////////////////////
35
+ // Getters & Setters //
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
+ ////////////////////////////////////////////////////////////////////////////////////////
38
+ // Private Methods //
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Listeners //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
  }
admin/controllers/FMControllerFormmakerwdmathcaptcha.php CHANGED
@@ -1,43 +1,43 @@
1
- <?php
2
-
3
- class FMControllerFormmakerwdmathcaptcha {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $this->display();
23
- }
24
-
25
- public function display() {
26
- require_once WD_FM_DIR . "/admin/models/FMModelFormmakerwdmathcaptcha.php";
27
- $model = new FMModelFormmakerwdmathcaptcha();
28
-
29
- require_once WD_FM_DIR . "/admin/views/FMViewFormmakerwdmathcaptcha.php";
30
- $view = new FMViewFormmakerwdmathcaptcha($model);
31
- $view->display();
32
- }
33
-
34
- ////////////////////////////////////////////////////////////////////////////////////////
35
- // Getters & Setters //
36
- ////////////////////////////////////////////////////////////////////////////////////////
37
- ////////////////////////////////////////////////////////////////////////////////////////
38
- // Private Methods //
39
- ////////////////////////////////////////////////////////////////////////////////////////
40
- ////////////////////////////////////////////////////////////////////////////////////////
41
- // Listeners //
42
- ////////////////////////////////////////////////////////////////////////////////////////
43
  }
1
+ <?php
2
+
3
+ class FMControllerFormmakerwdmathcaptcha {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $this->display();
23
+ }
24
+
25
+ public function display() {
26
+ require_once WD_FM_DIR . "/admin/models/FMModelFormmakerwdmathcaptcha.php";
27
+ $model = new FMModelFormmakerwdmathcaptcha();
28
+
29
+ require_once WD_FM_DIR . "/admin/views/FMViewFormmakerwdmathcaptcha.php";
30
+ $view = new FMViewFormmakerwdmathcaptcha($model);
31
+ $view->display();
32
+ }
33
+
34
+ ////////////////////////////////////////////////////////////////////////////////////////
35
+ // Getters & Setters //
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
+ ////////////////////////////////////////////////////////////////////////////////////////
38
+ // Private Methods //
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Listeners //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
  }
admin/controllers/FMControllerFormmakerwindow.php CHANGED
@@ -1,43 +1,43 @@
1
- <?php
2
-
3
- class FMControllerFormmakerwindow {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $this->display();
23
- }
24
-
25
- public function display() {
26
- require_once WD_FM_DIR . "/admin/models/FMModelFormmakerwindow.php";
27
- $model = new FMModelFormmakerwindow();
28
-
29
- require_once WD_FM_DIR . "/admin/views/FMViewFormmakerwindow.php";
30
- $view = new FMViewFormmakerwindow($model);
31
- $view->display();
32
- }
33
-
34
- ////////////////////////////////////////////////////////////////////////////////////////
35
- // Getters & Setters //
36
- ////////////////////////////////////////////////////////////////////////////////////////
37
- ////////////////////////////////////////////////////////////////////////////////////////
38
- // Private Methods //
39
- ////////////////////////////////////////////////////////////////////////////////////////
40
- ////////////////////////////////////////////////////////////////////////////////////////
41
- // Listeners //
42
- ////////////////////////////////////////////////////////////////////////////////////////
43
  }
1
+ <?php
2
+
3
+ class FMControllerFormmakerwindow {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $this->display();
23
+ }
24
+
25
+ public function display() {
26
+ require_once WD_FM_DIR . "/admin/models/FMModelFormmakerwindow.php";
27
+ $model = new FMModelFormmakerwindow();
28
+
29
+ require_once WD_FM_DIR . "/admin/views/FMViewFormmakerwindow.php";
30
+ $view = new FMViewFormmakerwindow($model);
31
+ $view->display();
32
+ }
33
+
34
+ ////////////////////////////////////////////////////////////////////////////////////////
35
+ // Getters & Setters //
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
+ ////////////////////////////////////////////////////////////////////////////////////////
38
+ // Private Methods //
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Listeners //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
  }
admin/controllers/FMControllerFromeditcountryinpopup.php CHANGED
@@ -1,43 +1,43 @@
1
- <?php
2
-
3
- class FMControllerFromeditcountryinpopup {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $this->display();
23
- }
24
-
25
- public function display() {
26
- require_once WD_FM_DIR . "/admin/models/FMModelFromeditcountryinpopup.php";
27
- $model = new FMModelFromeditcountryinpopup();
28
-
29
- require_once WD_FM_DIR . "/admin/views/FMViewFromeditcountryinpopup.php";
30
- $view = new FMViewFromeditcountryinpopup($model);
31
- $view->display();
32
- }
33
-
34
- ////////////////////////////////////////////////////////////////////////////////////////
35
- // Getters & Setters //
36
- ////////////////////////////////////////////////////////////////////////////////////////
37
- ////////////////////////////////////////////////////////////////////////////////////////
38
- // Private Methods //
39
- ////////////////////////////////////////////////////////////////////////////////////////
40
- ////////////////////////////////////////////////////////////////////////////////////////
41
- // Listeners //
42
- ////////////////////////////////////////////////////////////////////////////////////////
43
  }
1
+ <?php
2
+
3
+ class FMControllerFromeditcountryinpopup {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $this->display();
23
+ }
24
+
25
+ public function display() {
26
+ require_once WD_FM_DIR . "/admin/models/FMModelFromeditcountryinpopup.php";
27
+ $model = new FMModelFromeditcountryinpopup();
28
+
29
+ require_once WD_FM_DIR . "/admin/views/FMViewFromeditcountryinpopup.php";
30
+ $view = new FMViewFromeditcountryinpopup($model);
31
+ $view->display();
32
+ }
33
+
34
+ ////////////////////////////////////////////////////////////////////////////////////////
35
+ // Getters & Setters //
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
+ ////////////////////////////////////////////////////////////////////////////////////////
38
+ // Private Methods //
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Listeners //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
  }
admin/controllers/FMControllerFromipinfoinpopup.php CHANGED
@@ -1,43 +1,43 @@
1
- <?php
2
-
3
- class FMControllerFromipinfoinpopup {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $this->display();
23
- }
24
-
25
- public function display() {
26
- require_once WD_FM_DIR . "/admin/models/FMModelFromipinfoinpopup.php";
27
- $model = new FMModelFromipinfoinpopup();
28
-
29
- require_once WD_FM_DIR . "/admin/views/FMViewFromipinfoinpopup.php";
30
- $view = new FMViewFromipinfoinpopup($model);
31
- $view->display();
32
- }
33
-
34
- ////////////////////////////////////////////////////////////////////////////////////////
35
- // Getters & Setters //
36
- ////////////////////////////////////////////////////////////////////////////////////////
37
- ////////////////////////////////////////////////////////////////////////////////////////
38
- // Private Methods //
39
- ////////////////////////////////////////////////////////////////////////////////////////
40
- ////////////////////////////////////////////////////////////////////////////////////////
41
- // Listeners //
42
- ////////////////////////////////////////////////////////////////////////////////////////
43
  }
1
+ <?php
2
+
3
+ class FMControllerFromipinfoinpopup {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $this->display();
23
+ }
24
+
25
+ public function display() {
26
+ require_once WD_FM_DIR . "/admin/models/FMModelFromipinfoinpopup.php";
27
+ $model = new FMModelFromipinfoinpopup();
28
+
29
+ require_once WD_FM_DIR . "/admin/views/FMViewFromipinfoinpopup.php";
30
+ $view = new FMViewFromipinfoinpopup($model);
31
+ $view->display();
32
+ }
33
+
34
+ ////////////////////////////////////////////////////////////////////////////////////////
35
+ // Getters & Setters //
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
+ ////////////////////////////////////////////////////////////////////////////////////////
38
+ // Private Methods //
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Listeners //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
  }
admin/controllers/FMControllerFrommapeditinpopup.php CHANGED
@@ -1,43 +1,43 @@
1
- <?php
2
-
3
- class FMControllerFrommapeditinpopup {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $this->display();
23
- }
24
-
25
- public function display() {
26
- require_once WD_FM_DIR . "/admin/models/FMModelFrommapeditinpopup.php";
27
- $model = new FMModelFrommapeditinpopup();
28
-
29
- require_once WD_FM_DIR . "/admin/views/FMViewFrommapeditinpopup.php";
30
- $view = new FMViewFrommapeditinpopup($model);
31
- $view->display();
32
- }
33
-
34
- ////////////////////////////////////////////////////////////////////////////////////////
35
- // Getters & Setters //
36
- ////////////////////////////////////////////////////////////////////////////////////////
37
- ////////////////////////////////////////////////////////////////////////////////////////
38
- // Private Methods //
39
- ////////////////////////////////////////////////////////////////////////////////////////
40
- ////////////////////////////////////////////////////////////////////////////////////////
41
- // Listeners //
42
- ////////////////////////////////////////////////////////////////////////////////////////
43
  }
1
+ <?php
2
+
3
+ class FMControllerFrommapeditinpopup {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $this->display();
23
+ }
24
+
25
+ public function display() {
26
+ require_once WD_FM_DIR . "/admin/models/FMModelFrommapeditinpopup.php";
27
+ $model = new FMModelFrommapeditinpopup();
28
+
29
+ require_once WD_FM_DIR . "/admin/views/FMViewFrommapeditinpopup.php";
30
+ $view = new FMViewFrommapeditinpopup($model);
31
+ $view->display();
32
+ }
33
+
34
+ ////////////////////////////////////////////////////////////////////////////////////////
35
+ // Getters & Setters //
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
+ ////////////////////////////////////////////////////////////////////////////////////////
38
+ // Private Methods //
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Listeners //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
  }
admin/controllers/FMControllerGenerete_csv.php CHANGED
@@ -1,43 +1,43 @@
1
- <?php
2
-
3
- class FMControllerGenerete_csv {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $this->display();
23
- }
24
-
25
- public function display() {
26
- require_once WD_FM_DIR . "/admin/models/FMModelGenerete_csv.php";
27
- $model = new FMModelGenerete_csv();
28
-
29
- require_once WD_FM_DIR . "/admin/views/FMViewGenerete_csv.php";
30
- $view = new FMViewGenerete_csv($model);
31
- $view->display();
32
- }
33
-
34
- ////////////////////////////////////////////////////////////////////////////////////////
35
- // Getters & Setters //
36
- ////////////////////////////////////////////////////////////////////////////////////////
37
- ////////////////////////////////////////////////////////////////////////////////////////
38
- // Private Methods //
39
- ////////////////////////////////////////////////////////////////////////////////////////
40
- ////////////////////////////////////////////////////////////////////////////////////////
41
- // Listeners //
42
- ////////////////////////////////////////////////////////////////////////////////////////
43
  }
1
+ <?php
2
+
3
+ class FMControllerGenerete_csv {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $this->display();
23
+ }
24
+
25
+ public function display() {
26
+ require_once WD_FM_DIR . "/admin/models/FMModelGenerete_csv.php";
27
+ $model = new FMModelGenerete_csv();
28
+
29
+ require_once WD_FM_DIR . "/admin/views/FMViewGenerete_csv.php";
30
+ $view = new FMViewGenerete_csv($model);
31
+ $view->display();
32
+ }
33
+
34
+ ////////////////////////////////////////////////////////////////////////////////////////
35
+ // Getters & Setters //
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
+ ////////////////////////////////////////////////////////////////////////////////////////
38
+ // Private Methods //
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Listeners //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
  }
admin/controllers/FMControllerGenerete_xml.php CHANGED
@@ -1,43 +1,43 @@
1
- <?php
2
-
3
- class FMControllerGenerete_xml {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $this->display();
23
- }
24
-
25
- public function display() {
26
- require_once WD_FM_DIR . "/admin/models/FMModelGenerete_xml.php";
27
- $model = new FMModelGenerete_xml();
28
-
29
- require_once WD_FM_DIR . "/admin/views/FMViewGenerete_xml.php";
30
- $view = new FMViewGenerete_xml($model);
31
- $view->display();
32
- }
33
-
34
- ////////////////////////////////////////////////////////////////////////////////////////
35
- // Getters & Setters //
36
- ////////////////////////////////////////////////////////////////////////////////////////
37
- ////////////////////////////////////////////////////////////////////////////////////////
38
- // Private Methods //
39
- ////////////////////////////////////////////////////////////////////////////////////////
40
- ////////////////////////////////////////////////////////////////////////////////////////
41
- // Listeners //
42
- ////////////////////////////////////////////////////////////////////////////////////////
43
  }
1
+ <?php
2
+
3
+ class FMControllerGenerete_xml {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $this->display();
23
+ }
24
+
25
+ public function display() {
26
+ require_once WD_FM_DIR . "/admin/models/FMModelGenerete_xml.php";
27
+ $model = new FMModelGenerete_xml();
28
+
29
+ require_once WD_FM_DIR . "/admin/views/FMViewGenerete_xml.php";
30
+ $view = new FMViewGenerete_xml($model);
31
+ $view->display();
32
+ }
33
+
34
+ ////////////////////////////////////////////////////////////////////////////////////////
35
+ // Getters & Setters //
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
+ ////////////////////////////////////////////////////////////////////////////////////////
38
+ // Private Methods //
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Listeners //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
  }
admin/controllers/FMControllerGoptions_fm.php CHANGED
@@ -1,69 +1,69 @@
1
- <?php
2
-
3
- class FMControllerGoptions_fm {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $task = WDW_FM_Library::get('task');
23
- $id = (int)WDW_FM_Library::get('current_id', 0);
24
- $message = WDW_FM_Library::get('message');
25
- echo WDW_FM_Library::message_id($message);
26
- if (method_exists($this, $task)) {
27
- check_admin_referer('nonce_fm', 'nonce_fm');
28
- $this->$task($id);
29
- }
30
- else {
31
- $this->display();
32
- }
33
- }
34
-
35
- public function display() {
36
- require_once WD_FM_DIR . "/admin/models/FMModelGoptions_fm.php";
37
- $model = new FMModelGoptions_fm();
38
-
39
- require_once WD_FM_DIR . "/admin/views/FMViewGoptions_fm.php";
40
- $view = new FMViewGoptions_fm($model);
41
- $view->display();
42
- }
43
-
44
- public function save() {
45
- $message = $this->save_db();
46
- $page = WDW_FM_Library::get('page');
47
- WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
48
- }
49
-
50
- public function save_db() {
51
- global $wpdb;
52
- $public_key = (isset($_POST['public_key']) ? esc_html(stripslashes( $_POST['public_key'])) : '');
53
- $private_key = (isset($_POST['private_key']) ? esc_html(stripslashes( $_POST['private_key'])) : '');
54
- $csv_delimiter = (isset($_POST['csv_delimiter']) && $_POST['csv_delimiter']!='' ? esc_html(stripslashes( $_POST['csv_delimiter'])) : ',');
55
- update_option('fm_settings', array('public_key' => $public_key, 'private_key' => $private_key, 'csv_delimiter' => $csv_delimiter));
56
- }
57
-
58
-
59
-
60
- ////////////////////////////////////////////////////////////////////////////////////////
61
- // Getters & Setters //
62
- ////////////////////////////////////////////////////////////////////////////////////////
63
- ////////////////////////////////////////////////////////////////////////////////////////
64
- // Private Methods //
65
- ////////////////////////////////////////////////////////////////////////////////////////
66
- ////////////////////////////////////////////////////////////////////////////////////////
67
- // Listeners //
68
- ////////////////////////////////////////////////////////////////////////////////////////
69
  }
1
+ <?php
2
+
3
+ class FMControllerGoptions_fm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $task = WDW_FM_Library::get('task');
23
+ $id = (int)WDW_FM_Library::get('current_id', 0);
24
+ $message = WDW_FM_Library::get('message');
25
+ echo WDW_FM_Library::message_id($message);
26
+ if (method_exists($this, $task)) {
27
+ check_admin_referer('nonce_fm', 'nonce_fm');
28
+ $this->$task($id);
29
+ }
30
+ else {
31
+ $this->display();
32
+ }
33
+ }
34
+
35
+ public function display() {
36
+ require_once WD_FM_DIR . "/admin/models/FMModelGoptions_fm.php";
37
+ $model = new FMModelGoptions_fm();
38
+
39
+ require_once WD_FM_DIR . "/admin/views/FMViewGoptions_fm.php";
40
+ $view = new FMViewGoptions_fm($model);
41
+ $view->display();
42
+ }
43
+
44
+ public function save() {
45
+ $message = $this->save_db();
46
+ $page = WDW_FM_Library::get('page');
47
+ WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
48
+ }
49
+
50
+ public function save_db() {
51
+ global $wpdb;
52
+ $public_key = (isset($_POST['public_key']) ? esc_html(stripslashes( $_POST['public_key'])) : '');
53
+ $private_key = (isset($_POST['private_key']) ? esc_html(stripslashes( $_POST['private_key'])) : '');
54
+ $csv_delimiter = (isset($_POST['csv_delimiter']) && $_POST['csv_delimiter']!='' ? esc_html(stripslashes( $_POST['csv_delimiter'])) : ',');
55
+ update_option('fm_settings', array('public_key' => $public_key, 'private_key' => $private_key, 'csv_delimiter' => $csv_delimiter));
56
+ }
57
+
58
+
59
+
60
+ ////////////////////////////////////////////////////////////////////////////////////////
61
+ // Getters & Setters //
62
+ ////////////////////////////////////////////////////////////////////////////////////////
63
+ ////////////////////////////////////////////////////////////////////////////////////////
64
+ // Private Methods //
65
+ ////////////////////////////////////////////////////////////////////////////////////////
66
+ ////////////////////////////////////////////////////////////////////////////////////////
67
+ // Listeners //
68
+ ////////////////////////////////////////////////////////////////////////////////////////
69
  }
admin/controllers/FMControllerLicensing_fm.php CHANGED
@@ -1,49 +1,49 @@
1
- <?php
2
-
3
- class FMControllerLicensing_fm {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $task = ((isset($_POST['task'])) ? esc_html(stripslashes($_POST['task'])) : '');
23
- if (method_exists($this, $task)) {
24
- $this->$task($id);
25
- }
26
- else {
27
- $this->display();
28
- }
29
- }
30
-
31
- public function display() {
32
- require_once WD_FM_DIR . "/admin/models/FMModelLicensing_fm.php";
33
- $model = new FMModelLicensing_fm();
34
-
35
- require_once WD_FM_DIR . "/admin/views/FMViewLicensing_fm.php";
36
- $view = new FMViewLicensing_fm($model);
37
- $view->display();
38
- }
39
-
40
- ////////////////////////////////////////////////////////////////////////////////////////
41
- // Getters & Setters //
42
- ////////////////////////////////////////////////////////////////////////////////////////
43
- ////////////////////////////////////////////////////////////////////////////////////////
44
- // Private Methods //
45
- ////////////////////////////////////////////////////////////////////////////////////////
46
- ////////////////////////////////////////////////////////////////////////////////////////
47
- // Listeners //
48
- ////////////////////////////////////////////////////////////////////////////////////////
49
  }
1
+ <?php
2
+
3
+ class FMControllerLicensing_fm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $task = ((isset($_POST['task'])) ? esc_html(stripslashes($_POST['task'])) : '');
23
+ if (method_exists($this, $task)) {
24
+ $this->$task($id);
25
+ }
26
+ else {
27
+ $this->display();
28
+ }
29
+ }
30
+
31
+ public function display() {
32
+ require_once WD_FM_DIR . "/admin/models/FMModelLicensing_fm.php";
33
+ $model = new FMModelLicensing_fm();
34
+
35
+ require_once WD_FM_DIR . "/admin/views/FMViewLicensing_fm.php";
36
+ $view = new FMViewLicensing_fm($model);
37
+ $view->display();
38
+ }
39
+
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Getters & Setters //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
+ ////////////////////////////////////////////////////////////////////////////////////////
44
+ // Private Methods //
45
+ ////////////////////////////////////////////////////////////////////////////////////////
46
+ ////////////////////////////////////////////////////////////////////////////////////////
47
+ // Listeners //
48
+ ////////////////////////////////////////////////////////////////////////////////////////
49
  }
admin/controllers/FMControllerManage_fm.php CHANGED
@@ -1,1267 +1,1267 @@
1
- <?php
2
-
3
- class FMControllerManage_fm {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $task = WDW_FM_Library::get('task');
23
- $id = (int)WDW_FM_Library::get('current_id', 0);
24
- $message = WDW_FM_Library::get('message');
25
- echo WDW_FM_Library::message_id($message);
26
- if (method_exists($this, $task)) {
27
- check_admin_referer('nonce_fm', 'nonce_fm');
28
- $this->$task($id);
29
- }
30
- else {
31
- $this->display();
32
- }
33
- }
34
- public function undo()
35
- {
36
- require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
37
- $model = new FMModelManage_fm();
38
-
39
- require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
40
-
41
- global $wpdb;
42
- $backup_id = (int)WDW_FM_Library::get('backup_id');
43
- $id = (int)WDW_FM_Library::get('id');
44
-
45
- $query = "SELECT backup_id FROM ".$wpdb->prefix."formmaker_backup WHERE backup_id < $backup_id AND id = $id ORDER BY backup_id DESC LIMIT 0 , 1 ";
46
- $backup_id = $wpdb->get_var($query);
47
-
48
- $view = new FMViewManage_fm($model);
49
- $view->edit($backup_id);
50
-
51
- }
52
- public function redo()
53
- {
54
- require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
55
- $model = new FMModelManage_fm();
56
-
57
- require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
58
- global $wpdb;
59
- $backup_id = (int)WDW_FM_Library::get('backup_id');
60
- $id = (int)WDW_FM_Library::get('id');
61
-
62
- $query = "SELECT backup_id FROM ".$wpdb->prefix."formmaker_backup WHERE backup_id > $backup_id AND id = $id ORDER BY backup_id ASC LIMIT 0 , 1 ";
63
- $backup_id = $wpdb->get_var($query);
64
-
65
- $view = new FMViewManage_fm($model);
66
- $view->edit($backup_id);
67
-
68
- }
69
-
70
-
71
- public function display() {
72
- require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
73
- $model = new FMModelManage_fm();
74
-
75
- require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
76
- $view = new FMViewManage_fm($model);
77
- $view->display();
78
- }
79
-
80
- public function add() {
81
- require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
82
- $model = new FMModelManage_fm();
83
-
84
- require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
85
- $view = new FMViewManage_fm($model);
86
- $view->edit(0);
87
- }
88
-
89
- public function edit() {
90
- require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
91
- $model = new FMModelManage_fm();
92
-
93
- require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
94
- $view = new FMViewManage_fm($model);
95
- $id = (int)WDW_FM_Library::get('current_id', 0);
96
-
97
- global $wpdb;
98
- $query = "SELECT backup_id FROM ".$wpdb->prefix."formmaker_backup WHERE cur=1 and id=".$id;
99
- $backup_id = $wpdb->get_var($query);
100
-
101
- if(!$backup_id)
102
- {
103
- $query = "SELECT max(backup_id) FROM ".$wpdb->prefix."formmaker_backup";
104
- $backup_id = $wpdb->get_var($query);
105
- if($backup_id)
106
- $backup_id++;
107
- else
108
- $backup_id=1;
109
- $query = "INSERT INTO ".$wpdb->prefix."formmaker_backup SELECT ".$backup_id." AS backup_id, 1 AS cur, formmakerbkup.id, formmakerbkup.title, formmakerbkup.mail, formmakerbkup.form_front, formmakerbkup.theme, formmakerbkup.javascript, formmakerbkup.submit_text, formmakerbkup.url, formmakerbkup.submit_text_type, formmakerbkup.script_mail, formmakerbkup.script_mail_user, formmakerbkup.counter, formmakerbkup.published, formmakerbkup.label_order, formmakerbkup.label_order_current, formmakerbkup.article_id, formmakerbkup.pagination, formmakerbkup.show_title, formmakerbkup.show_numbers, formmakerbkup.public_key, formmakerbkup.private_key, formmakerbkup.recaptcha_theme, formmakerbkup.paypal_mode, formmakerbkup.checkout_mode, formmakerbkup.paypal_email, formmakerbkup.payment_currency, formmakerbkup.tax, formmakerbkup.form_fields, formmakerbkup.savedb, formmakerbkup.sendemail, formmakerbkup.requiredmark, formmakerbkup.from_mail, formmakerbkup.from_name, formmakerbkup.reply_to, formmakerbkup.send_to, formmakerbkup.autogen_layout, formmakerbkup.custom_front, formmakerbkup.mail_from_user, formmakerbkup.mail_from_name_user, formmakerbkup.reply_to_user, formmakerbkup.condition, formmakerbkup.mail_cc, formmakerbkup.mail_cc_user, formmakerbkup.mail_bcc, formmakerbkup.mail_bcc_user, formmakerbkup.mail_subject, formmakerbkup.mail_subject_user, formmakerbkup.mail_mode, formmakerbkup.mail_mode_user, formmakerbkup.mail_attachment, formmakerbkup.mail_attachment_user, formmakerbkup.user_id_wd, formmakerbkup.sortable, formmakerbkup.frontend_submit_fields, formmakerbkup.frontend_submit_stat_fields, formmakerbkup.mail_emptyfields, formmakerbkup.mail_verify, formmakerbkup.mail_verify_expiretime, formmakerbkup.mail_verification_post_id, formmakerbkup.save_uploads FROM ".$wpdb->prefix."formmaker as formmakerbkup WHERE id=".$id;
110
- $wpdb->query($query);
111
- }
112
-
113
- $view->edit($backup_id);
114
- }
115
-
116
- public function edit_old() {
117
- require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
118
- $model = new FMModelManage_fm();
119
-
120
- require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
121
- $view = new FMViewManage_fm($model);
122
- $id = (int)WDW_FM_Library::get('current_id', 0);
123
- $view->edit_old($id);
124
- }
125
-
126
- public function form_options_old() {
127
- if (!isset($_GET['task'])) {
128
- $this->save_db();
129
- }
130
- require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
131
- $model = new FMModelManage_fm();
132
-
133
- require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
134
- $view = new FMViewManage_fm($model);
135
- global $wpdb;
136
- $id = (int)WDW_FM_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
137
- $view->form_options_old($id);
138
- }
139
-
140
- public function save_options_old() {
141
- $message = $this->save_db_options_old();
142
- // $this->edit_old();
143
- $page = WDW_FM_Library::get('page');
144
- $current_id = (int)WDW_FM_Library::get('current_id', 0);
145
- WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit_old', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
146
- }
147
-
148
- public function apply_options_old() {
149
- $message = $this->save_db_options_old();
150
- require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
151
- $model = new FMModelManage_fm();
152
-
153
- require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
154
- $view = new FMViewManage_fm($model);
155
- $page = WDW_FM_Library::get('page');
156
- $current_id = (int)WDW_FM_Library::get('current_id', 0);
157
- $fieldset_id = WDW_FM_Library::get('fieldset_id', 'general');
158
- WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'form_options_old', 'current_id' => $current_id, 'message' => $message, 'fieldset_id' => $fieldset_id), admin_url('admin.php')));
159
- }
160
-
161
- public function save_db_options_old() {
162
- $javascript = "// Occurs before the form is loaded
163
- function before_load() {
164
-
165
- }
166
- // Occurs just before submitting the form
167
- function before_submit() {
168
- // 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.
169
- }
170
- // Occurs just before resetting the form
171
- function before_reset() {
172
-
173
- }";
174
- global $wpdb;
175
- $id = (int)WDW_FM_Library::get('current_id', 0);
176
- $mail = (isset($_POST['mail']) ? esc_html(stripslashes($_POST['mail'])) : '');
177
- $theme = (isset($_POST['theme']) ? (int)esc_html(stripslashes($_POST['theme'])) : 1);
178
- $javascript = (isset($_POST['javascript']) ? stripslashes($_POST['javascript']) : $javascript);
179
- $script1 = (isset($_POST['script1']) ? esc_html(stripslashes($_POST['script1'])) : '');
180
- $script2 = (isset($_POST['script2']) ? esc_html(stripslashes($_POST['script2'])) : '');
181
- $script_user1 = (isset($_POST['script_user1']) ? esc_html(stripslashes($_POST['script_user1'])) : '');
182
- $script_user2 = (isset($_POST['script_user2']) ? esc_html(stripslashes($_POST['script_user2'])) : '');
183
- $submit_text = (isset($_POST['submit_text']) ? stripslashes($_POST['submit_text']) : '');
184
- $url = (isset($_POST['url']) ? esc_html(stripslashes($_POST['url'])) : '');
185
- $script_mail = (isset($_POST['script_mail']) ? stripslashes($_POST['script_mail']) : '%all%');
186
- $script_mail_user = (isset($_POST['script_mail_user']) ? stripslashes($_POST['script_mail_user']) : '%all%');
187
- $label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
188
- $tax = (isset($_POST['tax']) ? esc_html(stripslashes($_POST['tax'])) : 0);
189
- $payment_currency = (isset($_POST['payment_currency']) ? stripslashes($_POST['payment_currency']) : '');
190
- $paypal_email = (isset($_POST['paypal_email']) ? esc_html(stripslashes($_POST['paypal_email'])) : '');
191
- $checkout_mode = (isset($_POST['checkout_mode']) ? esc_html(stripslashes($_POST['checkout_mode'])) : 'testmode');
192
- $paypal_mode = (isset($_POST['paypal_mode']) ? esc_html(stripslashes($_POST['paypal_mode'])) : 0);
193
- $from_mail = (isset($_POST['from_mail']) ? esc_html(stripslashes($_POST['from_mail'])) : '');
194
- $from_name = (isset($_POST['from_name']) ? esc_html(stripslashes($_POST['from_name'])) : '');
195
- if (isset($_POST['submit_text_type'])) {
196
- $submit_text_type = esc_html(stripslashes($_POST['submit_text_type']));
197
- if ($submit_text_type == 5) {
198
- $article_id = (isset($_POST['page_name']) ? esc_html(stripslashes($_POST['page_name'])) : 0);
199
- }
200
- else {
201
- $article_id = (isset($_POST['post_name']) ? esc_html(stripslashes($_POST['post_name'])) : 0);
202
- }
203
- }
204
- else {
205
- $submit_text_type = 0;
206
- $article_id = 0;
207
- }
208
- $save = $wpdb->update($wpdb->prefix . 'formmaker', array(
209
- 'mail' => $mail,
210
- 'theme' => $theme,
211
- 'javascript' => $javascript,
212
- 'submit_text' => $submit_text,
213
- 'url' => $url,
214
- 'submit_text_type' => $submit_text_type,
215
- 'script_mail' => $script_mail,
216
- 'script_mail_user' => $script_mail_user,
217
- 'article_id' => $article_id,
218
- 'paypal_mode' => $paypal_mode,
219
- 'checkout_mode' => $checkout_mode,
220
- 'paypal_email' => $paypal_email,
221
- 'payment_currency' => $payment_currency,
222
- 'tax' => $tax,
223
- 'from_mail' => $from_mail,
224
- 'from_name' => $from_name,
225
- ), array('id' => $id));
226
- if ($save !== FALSE) {
227
- return 8;
228
- }
229
- else {
230
- return 2;
231
- }
232
- }
233
-
234
- public function cancel_options_old() {
235
- $this->edit_old();
236
- }
237
-
238
- public function form_layout() {
239
- if (!isset($_GET['task'])) {
240
- $this->save_db();
241
- }
242
- require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
243
- $model = new FMModelManage_fm();
244
-
245
- require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
246
- $view = new FMViewManage_fm($model);
247
- global $wpdb;
248
- $id = (int)WDW_FM_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
249
- $view->form_layout($id);
250
- }
251
-
252
- public function save_layout() {
253
- $message = $this->save_db_layout();
254
- // $this->edit();
255
- $page = WDW_FM_Library::get('page');
256
- $current_id = (int)WDW_FM_Library::get('current_id', 0);
257
- WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
258
- }
259
-
260
- public function apply_layout() {
261
- $message = $this->save_db_layout();
262
- require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
263
- $model = new FMModelManage_fm();
264
-
265
- require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
266
- $view = new FMViewManage_fm($model);
267
- $page = WDW_FM_Library::get('page');
268
- $current_id = (int)WDW_FM_Library::get('current_id', 0);
269
- WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'form_layout', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
270
- // $view->form_layout($id);
271
- }
272
-
273
- public function save_db_layout() {
274
- global $wpdb;
275
- $id = (int)WDW_FM_Library::get('current_id', 0);
276
- $custom_front = (isset($_POST['custom_front']) ? stripslashes($_POST['custom_front']) : '');
277
- $autogen_layout = (isset($_POST['autogen_layout']) ? 1 : 0);
278
- $save = $wpdb->update($wpdb->prefix . 'formmaker', array(
279
- 'custom_front' => $custom_front,
280
- 'autogen_layout' => $autogen_layout
281
- ), array('id' => $id));
282
- if ($save !== FALSE) {
283
- return 1;
284
- }
285
- else {
286
- return 2;
287
- }
288
- }
289
-
290
- public function form_options() {
291
- if (!isset($_GET['task'])) {
292
- $this->save_db();
293
- }
294
- require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
295
- $model = new FMModelManage_fm();
296
-
297
- require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
298
- $view = new FMViewManage_fm($model);
299
- // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
300
- global $wpdb;
301
- $id = (int)WDW_FM_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
302
- $view->form_options($id);
303
- }
304
-
305
- public function save_options() {
306
- $message = $this->save_db_options();
307
- // $this->edit();
308
- $page = WDW_FM_Library::get('page');
309
- $current_id = (int)WDW_FM_Library::get('current_id', 0);
310
- WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
311
- }
312
-
313
- public function apply_options() {
314
- $message = $this->save_db_options();
315
- require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
316
- $model = new FMModelManage_fm();
317
-
318
- require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
319
- $view = new FMViewManage_fm($model);
320
- // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
321
- // $view->form_options($id);
322
- $page = WDW_FM_Library::get('page');
323
- $current_id = (int)WDW_FM_Library::get('current_id', 0);
324
- $fieldset_id = WDW_FM_Library::get('fieldset_id', 'general');
325
- WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'form_options', 'current_id' => $current_id, 'message' => $message, 'fieldset_id' => $fieldset_id), admin_url('admin.php')));
326
- }
327
-
328
- public function remove_query() {
329
- global $wpdb;
330
- $cid = ((isset($_POST['cid']) && $_POST['cid'] != '') ? $_POST['cid'] : NULL);
331
- if (count($cid)) {
332
- array_walk($cid, create_function('&$value', '$value = (int)$value;'));
333
- $cids = implode(',', $cid);
334
- $query = 'DELETE FROM ' . $wpdb->prefix . 'formmaker_query WHERE id IN ( ' . $cids . ' )';
335
- if ($wpdb->query($query)) {
336
- echo WDW_FM_Library::message('Items Succesfully Deleted.', 'updated');
337
- }
338
- else {
339
- echo WDW_FM_Library::message('Error. Please install plugin again.', 'error');
340
- }
341
- }
342
- else {
343
- echo WDW_FM_Library::message('You must select at least one item.', 'error');
344
- }
345
- $this->apply_options();
346
- }
347
-
348
- public function cancel_options() {
349
- $this->edit();
350
- }
351
-
352
- public function save_db_options() {
353
- $javascript = "// Occurs before the form is loaded
354
- function before_load() {
355
-
356
- }
357
- // Occurs just before submitting the form
358
- function before_submit() {
359
- // 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.
360
- }
361
- // Occurs just before resetting the form
362
- function before_reset() {
363
-
364
- }";
365
- global $wpdb;
366
- // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
367
- $id = (int)WDW_FM_Library::get('current_id', 0);
368
- $published = (isset($_POST['published']) ? esc_html(stripslashes($_POST['published'])) : 1);
369
- $savedb = (isset($_POST['savedb']) ? esc_html(stripslashes($_POST['savedb'])) : 1);
370
- $theme = (int)((isset($_POST['theme']) && (esc_html($_POST['theme']) != 0)) ? esc_html(stripslashes($_POST['theme'])) : $wpdb->get_var("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE `default`='1'"));
371
- $requiredmark = (isset($_POST['requiredmark']) ? esc_html(stripslashes($_POST['requiredmark'])) : '*');
372
- $sendemail = (isset($_POST['sendemail']) ? esc_html(stripslashes($_POST['sendemail'])) : 1);
373
- $save_uploads = (isset($_POST['save_uploads']) ? esc_html(stripslashes($_POST['save_uploads'])) : 1);
374
- $mail = (isset($_POST['mail']) ? esc_html(stripslashes($_POST['mail'])) : '');
375
- if (isset($_POST['mailToAdd']) && esc_html(stripslashes($_POST['mailToAdd'])) != '') {
376
- $mail .= esc_html(stripslashes($_POST['mailToAdd'])) . ',';
377
- }
378
- $from_mail = (isset($_POST['from_mail']) ? esc_html(stripslashes($_POST['from_mail'])) : '');
379
- $from_name = (isset($_POST['from_name']) ? esc_html(stripslashes($_POST['from_name'])) : '');
380
- $reply_to = (isset($_POST['reply_to']) ? esc_html(stripslashes($_POST['reply_to'])) : '');
381
- if ($from_mail == "other") {
382
- $from_mail = (isset($_POST['mail_from_other']) ? esc_html(stripslashes($_POST['mail_from_other'])) : '');
383
- }
384
- if ($reply_to == "other") {
385
- $reply_to = (isset($_POST['reply_to_other']) ? esc_html(stripslashes($_POST['reply_to_other'])) : '');
386
- }
387
- $script_mail = (isset($_POST['script_mail']) ? stripslashes($_POST['script_mail']) : '%all%');
388
- $mail_from_user = (isset($_POST['mail_from_user']) ? esc_html(stripslashes($_POST['mail_from_user'])) : '');
389
- $mail_from_name_user = (isset($_POST['mail_from_name_user']) ? esc_html(stripslashes($_POST['mail_from_name_user'])) : '');
390
- $reply_to_user = (isset($_POST['reply_to_user']) ? esc_html(stripslashes($_POST['reply_to_user'])) : '');
391
- $condition = (isset($_POST['condition']) ? esc_html(stripslashes($_POST['condition'])) : '');
392
- $mail_cc = (isset($_POST['mail_cc']) ? esc_html(stripslashes($_POST['mail_cc'])) : '');
393
- $mail_cc_user = (isset($_POST['mail_cc_user']) ? esc_html(stripslashes($_POST['mail_cc_user'])) : '');
394
- $mail_bcc = (isset($_POST['mail_bcc']) ? esc_html(stripslashes($_POST['mail_bcc'])) : '');
395
- $mail_bcc_user = (isset($_POST['mail_bcc_user']) ? esc_html(stripslashes($_POST['mail_bcc_user'])) : '');
396
- $mail_subject = (isset($_POST['mail_subject']) ? esc_html(stripslashes($_POST['mail_subject'])) : '');
397
- $mail_subject_user = (isset($_POST['mail_subject_user']) ? esc_html(stripslashes($_POST['mail_subject_user'])) : '');
398
- $mail_mode = (isset($_POST['mail_mode']) ? esc_html(stripslashes($_POST['mail_mode'])) : 1);
399
- $mail_mode_user = (isset($_POST['mail_mode_user']) ? esc_html(stripslashes($_POST['mail_mode_user'])) : 1);
400
- $mail_attachment = (isset($_POST['mail_attachment']) ? esc_html(stripslashes($_POST['mail_attachment'])) : 1);
401
- $mail_attachment_user = (isset($_POST['mail_attachment_user']) ? esc_html(stripslashes($_POST['mail_attachment_user'])) : 1);
402
- $script_mail_user = (isset($_POST['script_mail_user']) ? stripslashes($_POST['script_mail_user']) : '%all%');
403
- $submit_text = (isset($_POST['submit_text']) ? stripslashes($_POST['submit_text']) : '');
404
- $url = (isset($_POST['url']) ? esc_html(stripslashes($_POST['url'])) : '');
405
- $tax = (isset($_POST['tax']) ? esc_html(stripslashes($_POST['tax'])) : 0);
406
- $payment_currency = (isset($_POST['payment_currency']) ? stripslashes($_POST['payment_currency']) : '');
407
- $paypal_email = (isset($_POST['paypal_email']) ? esc_html(stripslashes($_POST['paypal_email'])) : '');
408
- $checkout_mode = (isset($_POST['checkout_mode']) ? esc_html(stripslashes($_POST['checkout_mode'])) : 'testmode');
409
- $paypal_mode = (isset($_POST['paypal_mode']) ? esc_html(stripslashes($_POST['paypal_mode'])) : 0);
410
- $javascript = (isset($_POST['javascript']) ? stripslashes($_POST['javascript']) : $javascript);
411
- $user_id_wd = (isset($_POST['user_id_wd']) ? stripslashes($_POST['user_id_wd']) : 'administrator,');
412
- $frontend_submit_fields = (isset($_POST['frontend_submit_fields']) ? stripslashes($_POST['frontend_submit_fields']) : '');
413
- $frontend_submit_stat_fields = (isset($_POST['frontend_submit_stat_fields']) ? stripslashes($_POST['frontend_submit_stat_fields']) : '');
414
- $mail_emptyfields = (isset($_POST['mail_emptyfields']) ? esc_html(stripslashes($_POST['mail_emptyfields'])) : 0);
415
- $mail_verify = (isset($_POST['mail_verify']) ? esc_html(stripslashes($_POST['mail_verify'])) : 0);
416
- $mail_verify_expiretime = (isset($_POST['mail_verify_expiretime']) ? esc_html(stripslashes($_POST['mail_verify_expiretime'])) : '');
417
- $send_to = '';
418
- for ($i = 0; $i < 20; $i++) {
419
- if (isset($_POST['send_to' . $i])) {
420
- $send_to .= '*' . esc_html(stripslashes($_POST['send_to' . $i])) . '*';
421
- }
422
- }
423
- if (isset($_POST['submit_text_type'])) {
424
- $submit_text_type = esc_html(stripslashes($_POST['submit_text_type']));
425
- if ($submit_text_type == 5) {
426
- $article_id = (isset($_POST['page_name']) ? esc_html(stripslashes($_POST['page_name'])) : 0);
427
- }
428
- else {
429
- $article_id = (isset($_POST['post_name']) ? esc_html(stripslashes($_POST['post_name'])) : 0);
430
- }
431
- }
432
- else {
433
- $submit_text_type = 0;
434
- $article_id = 0;
435
- }
436
-
437
- $mail_verification_post_id = (int)$wpdb->get_var('SELECT mail_verification_post_id FROM ' . $wpdb->prefix . 'formmaker WHERE mail_verification_post_id!=0');
438
- if($mail_verify) {
439
- $email_verification_post = array(
440
- 'post_title' => 'Email Verification',
441
- 'post_content' => '[email_verification]',
442
- 'post_status' => 'publish',
443
- 'post_author' => 1,
444
- 'post_type' => 'fmemailverification',
445
- );
446
-
447
- if(!$mail_verification_post_id || get_post( $mail_verification_post_id )===NULL)
448
- $mail_verification_post_id = wp_insert_post( $email_verification_post );
449
- }
450
-
451
- $save = $wpdb->update($wpdb->prefix . 'formmaker', array(
452
- 'published' => $published,
453
- 'savedb' => $savedb,
454
- 'theme' => $theme,
455
- 'requiredmark' => $requiredmark,
456
- 'sendemail' => $sendemail,
457
- 'save_uploads' => $save_uploads,
458
- 'mail' => $mail,
459
- 'from_mail' => $from_mail,
460
- 'from_name' => $from_name,
461
- 'reply_to' => $reply_to,
462
- 'script_mail' => $script_mail,
463
- 'mail_from_user' => $mail_from_user,
464
- 'mail_from_name_user' => $mail_from_name_user,
465
- 'reply_to_user' => $reply_to_user,
466
- 'condition' => $condition,
467
- 'mail_cc' => $mail_cc,
468
- 'mail_cc_user' => $mail_cc_user,
469
- 'mail_bcc' => $mail_bcc,
470
- 'mail_bcc_user' => $mail_bcc_user,
471
- 'mail_subject' => $mail_subject,
472
- 'mail_subject_user' => $mail_subject_user,
473
- 'mail_mode' => $mail_mode,
474
- 'mail_mode_user' => $mail_mode_user,
475
- 'mail_attachment' => $mail_attachment,
476
- 'mail_attachment_user' => $mail_attachment_user,
477
- 'script_mail_user' => $script_mail_user,
478
- 'submit_text' => $submit_text,
479
- 'url' => $url,
480
- 'submit_text_type' => $submit_text_type,
481
- 'article_id' => $article_id,
482
- 'tax' => $tax,
483
- 'payment_currency' => $payment_currency,
484
- 'paypal_email' => $paypal_email,
485
- 'checkout_mode' => $checkout_mode,
486
- 'paypal_mode' => $paypal_mode,
487
- 'javascript' => $javascript,
488
- 'user_id_wd' => $user_id_wd,
489
- 'send_to' => $send_to,
490
- 'frontend_submit_fields' => $frontend_submit_fields,
491
- 'frontend_submit_stat_fields' => $frontend_submit_stat_fields,
492
- 'mail_emptyfields' => $mail_emptyfields,
493
- 'mail_verify' => $mail_verify,
494
- 'mail_verify_expiretime' => $mail_verify_expiretime,
495
- 'mail_verification_post_id' => $mail_verification_post_id,
496
- ), array('id' => $id));
497
- if ($save !== FALSE) {
498
- $save_theme_in_backup = $wpdb->update($wpdb->prefix . 'formmaker_backup', array(
499
- 'theme' => $theme
500
- ), array('id' => $id));
501
- return 8;
502
- }
503
- else {
504
- return 2;
505
- }
506
- }
507
-
508
- public function save_as_copy_old() {
509
- $message = $this->save_db_as_copy_old();
510
- // $this->display();
511
- $page = WDW_FM_Library::get('page');
512
- WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
513
- }
514
-
515
- public function save_old() {
516
- $message = $this->save_db_old();
517
- // $this->display();
518
- $page = WDW_FM_Library::get('page');
519
- WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
520
- }
521
-
522
- public function apply_old() {
523
- global $wpdb;
524
- $message = $this->save_db_old();
525
- // $this->edit_old();
526
- $id = (int) $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
527
- $current_id = (int)WDW_FM_Library::get('current_id', $id);
528
- $page = WDW_FM_Library::get('page');
529
- WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit_old', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
530
- }
531
-
532
- public function save_db_old() {
533
- global $wpdb;
534
- // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
535
- $id = (int)WDW_FM_Library::get('current_id', 0);
536
- $title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
537
- $form = (isset($_POST['form']) ? stripslashes($_POST['form']) : '');
538
- $form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
539
- $counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
540
- $label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
541
- $label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
542
- $pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
543
- $show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
544
- $show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
545
- $public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
546
- $private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
547
- $recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
548
-
549
- $save = $wpdb->update($wpdb->prefix . 'formmaker', array(
550
- 'title' => $title,
551
- 'form' => $form,
552
- 'form_front' => $form_front,
553
- 'counter' => $counter,
554
- 'label_order' => $label_order,
555
- 'label_order_current' => $label_order_current,
556
- 'pagination' => $pagination,
557
- 'show_title' => $show_title,
558
- 'show_numbers' => $show_numbers,
559
- 'public_key' => $public_key,
560
- 'private_key' => $private_key,
561
- 'recaptcha_theme' => $recaptcha_theme,
562
- ), array('id' => $id));
563
- if ($save !== FALSE) {
564
- return 1;
565
- }
566
- else {
567
- return 2;
568
- }
569
- }
570
-
571
- public function save_db_as_copy_old() {
572
- global $wpdb;
573
- // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
574
- $id = (int)WDW_FM_Library::get('current_id', 0);
575
- $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
576
- $title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
577
- $form = (isset($_POST['form']) ? stripslashes($_POST['form']) : '');
578
- $form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
579
- $counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
580
- $label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
581
- $pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
582
- $show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
583
- $show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
584
- $public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
585
- $private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
586
- $recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
587
-
588
- $save = $wpdb->insert($wpdb->prefix . 'formmaker', array(
589
- 'title' => $title,
590
- 'mail' => $row->mail,
591
- 'form' => $form,
592
- 'form_front' => $form_front,
593
- 'theme' => $row->theme,
594
- 'counter' => $counter,
595
- 'label_order' => $label_order,
596
- 'pagination' => $pagination,
597
- 'show_title' => $show_title,
598
- 'show_numbers' => $show_numbers,
599
- 'public_key' => $public_key,
600
- 'private_key' => $private_key,
601
- 'recaptcha_theme' => $recaptcha_theme,
602
- 'javascript' => $row->javascript,
603
- 'script1' => $row->script1,
604
- 'script2' => $row->script2,
605
- 'script_user1' => $row->script_user1,
606
- 'script_user2' => $row->script_user2,
607
- 'submit_text' => $row->submit_text,
608
- 'url' => $row->url,
609
- 'article_id' => $row->article_id,
610
- 'submit_text_type' => $row->submit_text_type,
611
- 'script_mail' => $row->script_mail,
612
- 'script_mail_user' => $row->script_mail_user,
613
- 'paypal_mode' => $row->paypal_mode,
614
- 'checkout_mode' => $row->checkout_mode,
615
- 'paypal_email' => $row->paypal_email,
616
- 'payment_currency' => $row->payment_currency,
617
- 'tax' => $row->tax,
618
- 'label_order_current' => $row->label_order_current,
619
- 'from_mail' => $row->from_mail,
620
- 'from_name' => $row->from_name,
621
- 'reply_to_user' => $row->reply_to_user,
622
- 'mail_from_name_user' => $row->mail_from_name_user,
623
- 'mail_from_user' => $row->mail_from_user,
624
- 'custom_front' => $row->custom_front,
625
- 'autogen_layout' => $row->autogen_layout,
626
- 'send_to' => $row->send_to,
627
- 'reply_to' => $row->reply_to,
628
- 'requiredmark' => $row->requiredmark,
629
- 'sendemail' => $row->sendemail,
630
- 'savedb' => $row->savedb,
631
- 'form_fields' => $row->form_fields,
632
- 'published' => $row->published,
633
- 'save_uploads' => $row->save_uploads
634
- ), array(
635
- '%s',
636
- '%s',
637
- '%s',
638
- '%s',
639
- '%d',
640
- '%d',
641
- '%s',
642
- '%s',
643
- '%s',
644
- '%s',
645
- '%s',
646
- '%s',
647
- '%s',
648
- '%s',
649
- '%s',
650
- '%s',
651
- '%s',
652
- '%s',
653
- '%s',
654
- '%s',
655
- '%s',
656
- '%d',
657
- '%s',
658
- '%s',
659
- '%d',
660
- '%s',
661
- '%s',
662
- '%s',
663
- '%s',
664
- '%s',
665
- '%s',
666
- '%s',
667
- '%s',
668
- '%s',
669
- '%s',
670
- '%s',
671
- '%d',
672
- '%s',
673
- '%s',
674
- '%s',
675
- '%d',
676
- '%d',
677
- '%s',
678
- '%d'
679
- ));
680
- $id = (int)$wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
681
- $wpdb->insert($wpdb->prefix . 'formmaker_views', array(
682
- 'form_id' => $id,
683
- 'views' => 0
684
- ), array(
685
- '%d',
686
- '%d'
687
- ));
688
- if ($save !== FALSE) {
689
- return 1;
690
- }
691
- else {
692
- return 2;
693
- }
694
- }
695
-
696
- public function save_as_copy() {
697
- $message = $this->save_db_as_copy();
698
- // $this->display();
699
- $page = WDW_FM_Library::get('page');
700
- WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
701
- }
702
-
703
- public function save() {
704
- $message = $this->save_db();
705
- // $this->display();
706
- $page = WDW_FM_Library::get('page');
707
- WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
708
- }
709
-
710
- public function apply() {
711
- $message = $this->save_db();
712
- // $this->edit();
713
- global $wpdb;
714
- $id = (int) $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
715
- $current_id = (int)WDW_FM_Library::get('current_id', $id);
716
- $page = WDW_FM_Library::get('page');
717
- WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
718
- }
719
-
720
- public function save_db() {
721
- global $wpdb;
722
- $javascript = "// Occurs before the form is loaded
723
- function before_load() {
724
- }
725
- // Occurs just before submitting the form
726
- function before_submit() {
727
- // 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.
728
- }
729
- // before form reset
730
- function before_reset() {
731
- }";
732
- $id = (int)WDW_FM_Library::get('current_id', 0);
733
- $title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
734
- $theme = (isset($_POST['theme']) ? esc_html(stripslashes($_POST['theme'])) : $wpdb->get_var("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE `default`='1'"));
735
- $form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
736
- $sortable = (isset($_POST['sortable']) ? stripslashes($_POST['sortable']) : 1);
737
- $counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
738
- $label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
739
- $pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
740
- $show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
741
- $show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
742
- $public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
743
- $private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
744
- $recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
745
- $label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
746
- $form_fields = (isset($_POST['form_fields']) ? stripslashes($_POST['form_fields']) : '');
747
- if ($id != 0) {
748
- $save = $wpdb->update($wpdb->prefix . 'formmaker', array(
749
- 'title' => $title,
750
- 'theme' => $theme,
751
- 'form_front' => $form_front,
752
- 'sortable' => $sortable,
753
- 'counter' => $counter,
754
- 'label_order' => $label_order,
755
- 'label_order_current' => $label_order_current,
756
- 'pagination' => $pagination,
757
- 'show_title' => $show_title,
758
- 'show_numbers' => $show_numbers,
759
- 'public_key' => $public_key,
760
- 'private_key' => $private_key,
761
- 'recaptcha_theme' => $recaptcha_theme,
762
- 'form_fields' => $form_fields,
763
- ), array('id' => $id));
764
- }
765
- else {
766
- $save = $wpdb->insert($wpdb->prefix . 'formmaker', array(
767
- 'title' => $title,
768
- 'mail' => '',
769
- 'form_front' => $form_front,
770
- 'theme' => $theme,
771
- 'counter' => $counter,
772
- 'label_order' => $label_order,
773
- 'pagination' => $pagination,
774
- 'show_title' => $show_title,
775
- 'show_numbers' => $show_numbers,
776
- 'public_key' => $public_key,
777
- 'private_key' => $private_key,
778
- 'recaptcha_theme' => $recaptcha_theme,
779
- 'javascript' => $javascript,
780
- 'submit_text' => '',
781
- 'url' => '',
782
- 'article_id' => 0,
783
- 'submit_text_type' => 0,
784
- 'script_mail' => '%all%',
785
- 'script_mail_user' => '%all%',
786
- 'label_order_current' => $label_order_current,
787
- 'tax' => 0,
788
- 'payment_currency' => '',
789
- 'paypal_email' => '',
790
- 'checkout_mode' => 'testmode',
791
- 'paypal_mode' => 0,
792
- 'published' => 1,
793
- 'form_fields' => $form_fields,
794
- 'savedb' => 1,
795
- 'sendemail' => 1,
796
- 'requiredmark' => '*',
797
- 'from_mail' => '',
798
- 'from_name' => '',
799
- 'reply_to' => '',
800
- 'send_to' => '',
801
- 'autogen_layout' => 1,
802
- 'custom_front' => '',
803
- 'mail_from_user' => '',
804
- 'mail_from_name_user' => '',
805
- 'reply_to_user' => '',
806
- 'condition' => '',
807
- 'mail_cc' => '',
808
- 'mail_cc_user' => '',
809
- 'mail_bcc' => '',
810
- 'mail_bcc_user' => '',
811
- 'mail_subject' => '',
812
- 'mail_subject_user' => '',
813
- 'mail_mode' => 1,
814
- 'mail_mode_user' => 1,
815
- 'mail_attachment' => 1,
816
- 'mail_attachment_user' => 1,
817
- 'sortable' => $sortable,
818
- 'user_id_wd' => 'administrator,',
819
- 'frontend_submit_fields' => '',
820
- 'frontend_submit_stat_fields' => '',
821
- 'save_uploads' => 1,
822
- ), array(
823
- '%s',
824
- '%s',
825
- '%s',
826
- '%d',
827
- '%d',
828
- '%s',
829
- '%s',
830
- '%s',
831
- '%s',
832
- '%s',
833
- '%s',
834
- '%s',
835
- '%s',
836
- '%s',
837
- '%s',
838
- '%d',
839
- '%d',
840
- '%s',
841
- '%s',
842
- '%s',
843
- '%s',
844
- '%s',
845
- '%s',
846
- '%s',
847
- '%d',
848
- '%d',
849
- '%s',
850
- '%d',
851
- '%d',
852
- '%s',
853
- '%s',
854
- '%s',
855
- '%s',
856
- '%s',
857
- '%d',
858
- '%s',
859
- '%s',
860
- '%s',
861
- '%s',
862
- '%s',
863
- '%s',
864
- '%s',
865
- '%s',
866
- '%s',
867
- '%s',
868
- '%s',
869
- '%d',
870
- '%d',
871
- '%d',
872
- '%d',
873
- '%d',
874
- '%s',
875
- '%s',
876
- '%s',
877
- '%d',
878
- ));
879
- $id = (int)$wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
880
- // $_POST['current_id'] = $id;
881
- $wpdb->insert($wpdb->prefix . 'formmaker_views', array(
882
- 'form_id' => $id,
883
- 'views' => 0
884
- ), array(
885
- '%d',
886
- '%d'
887
- ));
888
- }
889
-
890
- $backup_id = (isset($_POST['backup_id']) ? (int)esc_html(stripslashes($_POST['backup_id'])) : '');
891
-
892
- if($backup_id)
893
- {
894
- $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 ";
895
-
896
- if($wpdb->get_var($query))
897
- {
898
- $query = "DELETE FROM ".$wpdb->prefix."formmaker_backup WHERE backup_id > ".$backup_id." AND id = ".$id;
899
- $wpdb->query($query);
900
- }
901
-
902
- $row = $wpdb->get_row($wpdb->prepare("SELECT form_fields, form_front FROM ".$wpdb->prefix."formmaker_backup WHERE backup_id = '%d'", $backup_id));
903
-
904
- if($row->form_fields==$form_fields and $row->form_front==$form_front)
905
- {
906
- $save = $wpdb->update($wpdb->prefix . 'formmaker_backup', array(
907
- 'cur' => 1,
908
- 'title' => $title,
909
- 'theme' => $theme,
910
- 'form_front' => $form_front,
911
- 'sortable' => $sortable,
912
- 'counter' => $counter,
913
- 'label_order' => $label_order,
914
- 'label_order_current' => $label_order_current,
915
- 'pagination' => $pagination,
916
- 'show_title' => $show_title,
917
- 'show_numbers' => $show_numbers,
918
- 'public_key' => $public_key,
919
- 'private_key' => $private_key,
920
- 'recaptcha_theme' => $recaptcha_theme,
921
- 'form_fields' => $form_fields,
922
- ), array('backup_id' => $backup_id));
923
-
924
-
925
- if ($save !== FALSE) {
926
- return 1;
927
- }
928
- else {
929
- return 2;
930
- }
931
- }
932
- }
933
-
934
- $wpdb->query("UPDATE ".$wpdb->prefix."formmaker_backup SET cur=0 WHERE id=".$id );
935
-
936
- $save = $wpdb->insert($wpdb->prefix . 'formmaker_backup', array(
937
- 'cur' => 1,
938
- 'id' => $id,
939
- 'title' => $title,
940
- 'mail' => '',
941
- 'form_front' => $form_front,
942
- 'theme' => $theme,
943
- 'counter' => $counter,
944
- 'label_order' => $label_order,
945
- 'pagination' => $pagination,
946
- 'show_title' => $show_title,
947
- 'show_numbers' => $show_numbers,
948
- 'public_key' => $public_key,
949
- 'private_key' => $private_key,
950
- 'recaptcha_theme' => $recaptcha_theme,
951
- 'javascript' => $javascript,
952
- 'submit_text' => '',
953
- 'url' => '',
954
- 'article_id' => 0,
955
- 'submit_text_type' => 0,
956
- 'script_mail' => '%all%',
957
- 'script_mail_user' => '%all%',
958
- 'label_order_current' => $label_order_current,
959
- 'tax' => 0,
960
- 'payment_currency' => '',
961
- 'paypal_email' => '',
962
- 'checkout_mode' => 'testmode',
963
- 'paypal_mode' => 0,
964
- 'published' => 1,
965
- 'form_fields' => $form_fields,
966
- 'savedb' => 1,
967
- 'sendemail' => 1,
968
- 'requiredmark' => '*',
969
- 'from_mail' => '',
970
- 'from_name' => '',
971
- 'reply_to' => '',
972
- 'send_to' => '',
973
- 'autogen_layout' => 1,
974
- 'custom_front' => '',
975
- 'mail_from_user' => '',
976
- 'mail_from_name_user' => '',
977
- 'reply_to_user' => '',
978
- 'condition' => '',
979
- 'mail_cc' => '',
980
- 'mail_cc_user' => '',
981
- 'mail_bcc' => '',
982
- 'mail_bcc_user' => '',
983
- 'mail_subject' => '',
984
- 'mail_subject_user' => '',
985
- 'mail_mode' => 1,
986
- 'mail_mode_user' => 1,
987
- 'mail_attachment' => 1,
988
- 'mail_attachment_user' => 1,
989
- 'sortable' => $sortable,
990
- 'user_id_wd' => 'administrator,',
991
- 'frontend_submit_fields' => '',
992
- 'frontend_submit_stat_fields' => '',
993
- ), array(
994
- '%d',
995
- '%d',
996
- '%s',
997
- '%s',
998
- '%s',
999
- '%d',
1000
- '%d',
1001
- '%s',
1002
- '%s',
1003
- '%s',
1004
- '%s',
1005
- '%s',
1006
- '%s',
1007
- '%s',
1008
- '%s',
1009
- '%s',
1010
- '%s',
1011
- '%d',
1012
- '%d',
1013
- '%s',
1014
- '%s',
1015
- '%s',
1016
- '%s',
1017
- '%s',
1018
- '%s',
1019
- '%s',
1020
- '%d',
1021
- '%d',
1022
- '%s',
1023
- '%d',
1024
- '%d',
1025
- '%s',
1026
- '%s',
1027
- '%s',
1028
- '%s',
1029
- '%s',
1030
- '%d',
1031
- '%s',
1032
- '%s',
1033
- '%s',
1034
- '%s',
1035
- '%s',
1036
- '%s',
1037
- '%s',
1038
- '%s',
1039
- '%s',
1040
- '%s',
1041
- '%s',
1042
- '%d',
1043
- '%d',
1044
- '%d',
1045
- '%d',
1046
- '%d',
1047
- '%s',
1048
- '%s',
1049
- '%s',
1050
- )) ;
1051
-
1052
- $query = "SELECT count(backup_id) FROM ".$wpdb->prefix."formmaker_backup WHERE id = ".$id;
1053
- $wpdb->get_var($query);
1054
- if($wpdb->get_var($query)>10)
1055
- {
1056
- $query = "DELETE FROM ".$wpdb->prefix."formmaker_backup WHERE id = ".$id." ORDER BY backup_id ASC LIMIT 1 ";
1057
- $wpdb->query($query);
1058
- }
1059
-
1060
- if ($save !== FALSE) {
1061
- return 1;
1062
- }
1063
- else {
1064
- return 2;
1065
- }
1066
- }
1067
-
1068
- public function save_db_as_copy() {
1069
- global $wpdb;
1070
- // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
1071
- $id = (int)WDW_FM_Library::get('current_id', 0);
1072
- $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
1073
- $title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
1074
- $form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
1075
- $sortable = (isset($_POST['sortable']) ? stripslashes($_POST['sortable']) : 1);
1076
- $counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
1077
- $label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
1078
- $label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
1079
- $pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
1080
- $show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
1081
- $show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
1082
- $public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
1083
- $private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
1084
- $recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
1085
- $form_fields = (isset($_POST['form_fields']) ? stripslashes($_POST['form_fields']) : '');
1086
-
1087
- $save = $wpdb->insert($wpdb->prefix . 'formmaker', array(
1088
- 'title' => $title,
1089
- 'mail' => $row->mail,
1090
- 'form_front' => $form_front,
1091
- 'theme' => $row->theme,
1092
- 'counter' => $counter,
1093
- 'label_order' => $label_order,
1094
- 'pagination' => $pagination,
1095
- 'show_title' => $show_title,
1096
- 'show_numbers' => $show_numbers,
1097
- 'public_key' => $public_key,
1098
- 'private_key' => $private_key,
1099
- 'recaptcha_theme' => $recaptcha_theme,
1100
- 'javascript' => $row->javascript,
1101
- 'submit_text' => $row->submit_text,
1102
- 'url' => $row->url,
1103
- 'article_id' => $row->article_id,
1104
- 'submit_text_type' => $row->submit_text_type,
1105
- 'script_mail' => $row->script_mail,
1106
- 'script_mail_user' => $row->script_mail_user,
1107
- 'label_order_current' => $label_order_current,
1108
- 'tax' => $row->tax,
1109
- 'payment_currency' => $row->payment_currency,
1110
- 'paypal_email' => $row->paypal_email,
1111
- 'checkout_mode' => $row->checkout_mode,
1112
- 'paypal_mode' => $row->paypal_mode,
1113
- 'published' => $row->published,
1114
- 'form_fields' => $form_fields,
1115
- 'savedb' => $row->savedb,
1116
- 'sendemail' => $row->sendemail,
1117
- 'requiredmark' => $row->requiredmark,
1118
- 'from_mail' => $row->from_mail,
1119
- 'from_name' => $row->from_name,
1120
- 'reply_to' => $row->reply_to,
1121
- 'send_to' => $row->send_to,
1122
- 'autogen_layout' => $row->autogen_layout,
1123
- 'custom_front' => $row->custom_front,
1124
- 'mail_from_user' => $row->mail_from_user,
1125
- 'mail_from_name_user' => $row->mail_from_name_user,
1126
- 'reply_to_user' => $row->reply_to_user,
1127
- 'condition' => $row->condition,
1128
- 'mail_cc' => $row->mail_cc,
1129
- 'mail_cc_user' => $row->mail_cc_user,
1130
- 'mail_bcc' => $row->mail_bcc,
1131
- 'mail_bcc_user' => $row->mail_bcc_user,
1132
- 'mail_subject' => $row->mail_subject,
1133
- 'mail_subject_user' => $row->mail_subject_user,
1134
- 'mail_mode' => $row->mail_mode,
1135
- 'mail_mode_user' => $row->mail_mode_user,
1136
- 'mail_attachment' => $row->mail_attachment,
1137
- 'mail_attachment_user' => $row->mail_attachment_user,
1138
- 'sortable' => $sortable,
1139
- 'user_id_wd' => $row->user_id_wd,
1140
- 'frontend_submit_fields' => $row->frontend_submit_fields,
1141
- 'frontend_submit_stat_fields' => $row->frontend_submit_stat_fields,
1142
- 'save_uploads' => $row->save_uploads,
1143
- ), array(
1144
- '%s',
1145
- '%s',
1146
- '%s',
1147
- '%d',
1148
- '%d',
1149
- '%s',
1150
- '%s',
1151
- '%s',
1152
- '%s',
1153
- '%s',
1154
- '%s',
1155
- '%s',
1156
- '%s',
1157
- '%s',
1158
- '%s',
1159
- '%d',
1160
- '%d',
1161
- '%s',
1162
- '%s',
1163
- '%s',
1164
- '%s',
1165
- '%s',
1166
- '%s',
1167
- '%s',
1168
- '%d',
1169
- '%d',
1170
- '%s',
1171
- '%d',
1172
- '%d',
1173
- '%s',
1174
- '%s',
1175
- '%s',
1176
- '%s',
1177
- '%s',
1178
- '%d',
1179
- '%s',
1180
- '%s',
1181
- '%s',
1182
- '%s',
1183
- '%s',
1184
- '%s',
1185
- '%s',
1186
- '%s',
1187
- '%s',
1188
- '%s',
1189
- '%s',
1190
- '%d',
1191
- '%d',
1192
- '%d',
1193
- '%d',
1194
- '%d',
1195
- '%s',
1196
- '%s',
1197
- '%s',
1198
- '%d',
1199
- ));
1200
- $new_id = (int)$wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
1201
- $wpdb->insert($wpdb->prefix . 'formmaker_views', array(
1202
- 'form_id' => $new_id,
1203
- 'views' => 0
1204
- ), array(
1205
- '%d',
1206
- '%d'
1207
- ));
1208
- if ($save !== FALSE) {
1209
-
1210
- return 1;
1211
- }
1212
- else {
1213
- return 2;
1214
- }
1215
- }
1216
-
1217
- public function delete($id) {
1218
- global $wpdb;
1219
- $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id);
1220
- if ($wpdb->query($query)) {
1221
- $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="%d"', $id));
1222
- $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id="%d"', $id));
1223
-
1224
- $message = 3;
1225
- }
1226
- else {
1227
- $message = 2;
1228
- }
1229
- // $this->display();
1230
- $page = WDW_FM_Library::get('page');
1231
- WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
1232
- }
1233
-
1234
- public function delete_all() {
1235
- global $wpdb;
1236
- $flag = FALSE;
1237
- $isDefault = FALSE;
1238
- $form_ids_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker');
1239
- foreach ($form_ids_col as $form_id) {
1240
- if (isset($_POST['check_' . $form_id])) {
1241
- $flag = TRUE;
1242
- $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $form_id));
1243
- $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="%d"', $form_id));
1244
- $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id="%d"', $form_id));
1245
- }
1246
- }
1247
- if ($flag) {
1248
- $message = 5;
1249
- }
1250
- else {
1251
- $message = 6;
1252
- }
1253
- // $this->display();
1254
- $page = WDW_FM_Library::get('page');
1255
- WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
1256
- }
1257
-
1258
- ////////////////////////////////////////////////////////////////////////////////////////
1259
- // Getters & Setters //
1260
- ////////////////////////////////////////////////////////////////////////////////////////
1261
- ////////////////////////////////////////////////////////////////////////////////////////
1262
- // Private Methods //
1263
- ////////////////////////////////////////////////////////////////////////////////////////
1264
- ////////////////////////////////////////////////////////////////////////////////////////
1265
- // Listeners //
1266
- ////////////////////////////////////////////////////////////////////////////////////////
1267
  }
1
+ <?php
2
+
3
+ class FMControllerManage_fm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $task = WDW_FM_Library::get('task');
23
+ $id = (int)WDW_FM_Library::get('current_id', 0);
24
+ $message = WDW_FM_Library::get('message');
25
+ echo WDW_FM_Library::message_id($message);
26
+ if (method_exists($this, $task)) {
27
+ check_admin_referer('nonce_fm', 'nonce_fm');
28
+ $this->$task($id);
29
+ }
30
+ else {
31
+ $this->display();
32
+ }
33
+ }
34
+ public function undo()
35
+ {
36
+ require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
37
+ $model = new FMModelManage_fm();
38
+
39
+ require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
40
+
41
+ global $wpdb;
42
+ $backup_id = (int)WDW_FM_Library::get('backup_id');
43
+ $id = (int)WDW_FM_Library::get('id');
44
+
45
+ $query = "SELECT backup_id FROM ".$wpdb->prefix."formmaker_backup WHERE backup_id < $backup_id AND id = $id ORDER BY backup_id DESC LIMIT 0 , 1 ";
46
+ $backup_id = $wpdb->get_var($query);
47
+
48
+ $view = new FMViewManage_fm($model);
49
+ $view->edit($backup_id);
50
+
51
+ }
52
+ public function redo()
53
+ {
54
+ require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
55
+ $model = new FMModelManage_fm();
56
+
57
+ require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
58
+ global $wpdb;
59
+ $backup_id = (int)WDW_FM_Library::get('backup_id');
60
+ $id = (int)WDW_FM_Library::get('id');
61
+
62
+ $query = "SELECT backup_id FROM ".$wpdb->prefix."formmaker_backup WHERE backup_id > $backup_id AND id = $id ORDER BY backup_id ASC LIMIT 0 , 1 ";
63
+ $backup_id = $wpdb->get_var($query);
64
+
65
+ $view = new FMViewManage_fm($model);
66
+ $view->edit($backup_id);
67
+
68
+ }
69
+
70
+
71
+ public function display() {
72
+ require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
73
+ $model = new FMModelManage_fm();
74
+
75
+ require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
76
+ $view = new FMViewManage_fm($model);
77
+ $view->display();
78
+ }
79
+
80
+ public function add() {
81
+ require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
82
+ $model = new FMModelManage_fm();
83
+
84
+ require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
85
+ $view = new FMViewManage_fm($model);
86
+ $view->edit(0);
87
+ }
88
+
89
+ public function edit() {
90
+ require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
91
+ $model = new FMModelManage_fm();
92
+
93
+ require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
94
+ $view = new FMViewManage_fm($model);
95
+ $id = (int)WDW_FM_Library::get('current_id', 0);
96
+
97
+ global $wpdb;
98
+ $query = "SELECT backup_id FROM ".$wpdb->prefix."formmaker_backup WHERE cur=1 and id=".$id;
99
+ $backup_id = $wpdb->get_var($query);
100
+
101
+ if(!$backup_id)
102
+ {
103
+ $query = "SELECT max(backup_id) FROM ".$wpdb->prefix."formmaker_backup";
104
+ $backup_id = $wpdb->get_var($query);
105
+ if($backup_id)
106
+ $backup_id++;
107
+ else
108
+ $backup_id=1;
109
+ $query = "INSERT INTO ".$wpdb->prefix."formmaker_backup SELECT ".$backup_id." AS backup_id, 1 AS cur, formmakerbkup.id, formmakerbkup.title, formmakerbkup.mail, formmakerbkup.form_front, formmakerbkup.theme, formmakerbkup.javascript, formmakerbkup.submit_text, formmakerbkup.url, formmakerbkup.submit_text_type, formmakerbkup.script_mail, formmakerbkup.script_mail_user, formmakerbkup.counter, formmakerbkup.published, formmakerbkup.label_order, formmakerbkup.label_order_current, formmakerbkup.article_id, formmakerbkup.pagination, formmakerbkup.show_title, formmakerbkup.show_numbers, formmakerbkup.public_key, formmakerbkup.private_key, formmakerbkup.recaptcha_theme, formmakerbkup.paypal_mode, formmakerbkup.checkout_mode, formmakerbkup.paypal_email, formmakerbkup.payment_currency, formmakerbkup.tax, formmakerbkup.form_fields, formmakerbkup.savedb, formmakerbkup.sendemail, formmakerbkup.requiredmark, formmakerbkup.from_mail, formmakerbkup.from_name, formmakerbkup.reply_to, formmakerbkup.send_to, formmakerbkup.autogen_layout, formmakerbkup.custom_front, formmakerbkup.mail_from_user, formmakerbkup.mail_from_name_user, formmakerbkup.reply_to_user, formmakerbkup.condition, formmakerbkup.mail_cc, formmakerbkup.mail_cc_user, formmakerbkup.mail_bcc, formmakerbkup.mail_bcc_user, formmakerbkup.mail_subject, formmakerbkup.mail_subject_user, formmakerbkup.mail_mode, formmakerbkup.mail_mode_user, formmakerbkup.mail_attachment, formmakerbkup.mail_attachment_user, formmakerbkup.user_id_wd, formmakerbkup.sortable, formmakerbkup.frontend_submit_fields, formmakerbkup.frontend_submit_stat_fields, formmakerbkup.mail_emptyfields, formmakerbkup.mail_verify, formmakerbkup.mail_verify_expiretime, formmakerbkup.mail_verification_post_id, formmakerbkup.save_uploads FROM ".$wpdb->prefix."formmaker as formmakerbkup WHERE id=".$id;
110
+ $wpdb->query($query);
111
+ }
112
+
113
+ $view->edit($backup_id);
114
+ }
115
+
116
+ public function edit_old() {
117
+ require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
118
+ $model = new FMModelManage_fm();
119
+
120
+ require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
121
+ $view = new FMViewManage_fm($model);
122
+ $id = (int)WDW_FM_Library::get('current_id', 0);
123
+ $view->edit_old($id);
124
+ }
125
+
126
+ public function form_options_old() {
127
+ if (!isset($_GET['task'])) {
128
+ $this->save_db();
129
+ }
130
+ require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
131
+ $model = new FMModelManage_fm();
132
+
133
+ require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
134
+ $view = new FMViewManage_fm($model);
135
+ global $wpdb;
136
+ $id = (int)WDW_FM_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
137
+ $view->form_options_old($id);
138
+ }
139
+
140
+ public function save_options_old() {
141
+ $message = $this->save_db_options_old();
142
+ // $this->edit_old();
143
+ $page = WDW_FM_Library::get('page');
144
+ $current_id = (int)WDW_FM_Library::get('current_id', 0);
145
+ WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit_old', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
146
+ }
147
+
148
+ public function apply_options_old() {
149
+ $message = $this->save_db_options_old();
150
+ require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
151
+ $model = new FMModelManage_fm();
152
+
153
+ require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
154
+ $view = new FMViewManage_fm($model);
155
+ $page = WDW_FM_Library::get('page');
156
+ $current_id = (int)WDW_FM_Library::get('current_id', 0);
157
+ $fieldset_id = WDW_FM_Library::get('fieldset_id', 'general');
158
+ WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'form_options_old', 'current_id' => $current_id, 'message' => $message, 'fieldset_id' => $fieldset_id), admin_url('admin.php')));
159
+ }
160
+
161
+ public function save_db_options_old() {
162
+ $javascript = "// Occurs before the form is loaded
163
+ function before_load() {
164
+
165
+ }
166
+ // Occurs just before submitting the form
167
+ function before_submit() {
168
+ // 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.
169
+ }
170
+ // Occurs just before resetting the form
171
+ function before_reset() {
172
+
173
+ }";
174
+ global $wpdb;
175
+ $id = (int)WDW_FM_Library::get('current_id', 0);
176
+ $mail = (isset($_POST['mail']) ? esc_html(stripslashes($_POST['mail'])) : '');
177
+ $theme = (isset($_POST['theme']) ? (int)esc_html(stripslashes($_POST['theme'])) : 1);
178
+ $javascript = (isset($_POST['javascript']) ? stripslashes($_POST['javascript']) : $javascript);
179
+ $script1 = (isset($_POST['script1']) ? esc_html(stripslashes($_POST['script1'])) : '');
180
+ $script2 = (isset($_POST['script2']) ? esc_html(stripslashes($_POST['script2'])) : '');
181
+ $script_user1 = (isset($_POST['script_user1']) ? esc_html(stripslashes($_POST['script_user1'])) : '');
182
+ $script_user2 = (isset($_POST['script_user2']) ? esc_html(stripslashes($_POST['script_user2'])) : '');
183
+ $submit_text = (isset($_POST['submit_text']) ? stripslashes($_POST['submit_text']) : '');
184
+ $url = (isset($_POST['url']) ? esc_html(stripslashes($_POST['url'])) : '');
185
+ $script_mail = (isset($_POST['script_mail']) ? stripslashes($_POST['script_mail']) : '%all%');
186
+ $script_mail_user = (isset($_POST['script_mail_user']) ? stripslashes($_POST['script_mail_user']) : '%all%');
187
+ $label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
188
+ $tax = (isset($_POST['tax']) ? esc_html(stripslashes($_POST['tax'])) : 0);
189
+ $payment_currency = (isset($_POST['payment_currency']) ? stripslashes($_POST['payment_currency']) : '');
190
+ $paypal_email = (isset($_POST['paypal_email']) ? esc_html(stripslashes($_POST['paypal_email'])) : '');
191
+ $checkout_mode = (isset($_POST['checkout_mode']) ? esc_html(stripslashes($_POST['checkout_mode'])) : 'testmode');
192
+ $paypal_mode = (isset($_POST['paypal_mode']) ? esc_html(stripslashes($_POST['paypal_mode'])) : 0);
193
+ $from_mail = (isset($_POST['from_mail']) ? esc_html(stripslashes($_POST['from_mail'])) : '');
194
+ $from_name = (isset($_POST['from_name']) ? esc_html(stripslashes($_POST['from_name'])) : '');
195
+ if (isset($_POST['submit_text_type'])) {
196
+ $submit_text_type = esc_html(stripslashes($_POST['submit_text_type']));
197
+ if ($submit_text_type == 5) {
198
+ $article_id = (isset($_POST['page_name']) ? esc_html(stripslashes($_POST['page_name'])) : 0);
199
+ }
200
+ else {
201
+ $article_id = (isset($_POST['post_name']) ? esc_html(stripslashes($_POST['post_name'])) : 0);
202
+ }
203
+ }
204
+ else {
205
+ $submit_text_type = 0;
206
+ $article_id = 0;
207
+ }
208
+ $save = $wpdb->update($wpdb->prefix . 'formmaker', array(
209
+ 'mail' => $mail,
210
+ 'theme' => $theme,
211
+ 'javascript' => $javascript,
212
+ 'submit_text' => $submit_text,
213
+ 'url' => $url,
214
+ 'submit_text_type' => $submit_text_type,
215
+ 'script_mail' => $script_mail,
216
+ 'script_mail_user' => $script_mail_user,
217
+ 'article_id' => $article_id,
218
+ 'paypal_mode' => $paypal_mode,
219
+ 'checkout_mode' => $checkout_mode,
220
+ 'paypal_email' => $paypal_email,
221
+ 'payment_currency' => $payment_currency,
222
+ 'tax' => $tax,
223
+ 'from_mail' => $from_mail,
224
+ 'from_name' => $from_name,
225
+ ), array('id' => $id));
226
+ if ($save !== FALSE) {
227
+ return 8;
228
+ }
229
+ else {
230
+ return 2;
231
+ }
232
+ }
233
+
234
+ public function cancel_options_old() {
235
+ $this->edit_old();
236
+ }
237
+
238
+ public function form_layout() {
239
+ if (!isset($_GET['task'])) {
240
+ $this->save_db();
241
+ }
242
+ require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
243
+ $model = new FMModelManage_fm();
244
+
245
+ require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
246
+ $view = new FMViewManage_fm($model);
247
+ global $wpdb;
248
+ $id = (int)WDW_FM_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
249
+ $view->form_layout($id);
250
+ }
251
+
252
+ public function save_layout() {
253
+ $message = $this->save_db_layout();
254
+ // $this->edit();
255
+ $page = WDW_FM_Library::get('page');
256
+ $current_id = (int)WDW_FM_Library::get('current_id', 0);
257
+ WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
258
+ }
259
+
260
+ public function apply_layout() {
261
+ $message = $this->save_db_layout();
262
+ require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
263
+ $model = new FMModelManage_fm();
264
+
265
+ require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
266
+ $view = new FMViewManage_fm($model);
267
+ $page = WDW_FM_Library::get('page');
268
+ $current_id = (int)WDW_FM_Library::get('current_id', 0);
269
+ WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'form_layout', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
270
+ // $view->form_layout($id);
271
+ }
272
+
273
+ public function save_db_layout() {
274
+ global $wpdb;
275
+ $id = (int)WDW_FM_Library::get('current_id', 0);
276
+ $custom_front = (isset($_POST['custom_front']) ? stripslashes($_POST['custom_front']) : '');
277
+ $autogen_layout = (isset($_POST['autogen_layout']) ? 1 : 0);
278
+ $save = $wpdb->update($wpdb->prefix . 'formmaker', array(
279
+ 'custom_front' => $custom_front,
280
+ 'autogen_layout' => $autogen_layout
281
+ ), array('id' => $id));
282
+ if ($save !== FALSE) {
283
+ return 1;
284
+ }
285
+ else {
286
+ return 2;
287
+ }
288
+ }
289
+
290
+ public function form_options() {
291
+ if (!isset($_GET['task'])) {
292
+ $this->save_db();
293
+ }
294
+ require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
295
+ $model = new FMModelManage_fm();
296
+
297
+ require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
298
+ $view = new FMViewManage_fm($model);
299
+ // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
300
+ global $wpdb;
301
+ $id = (int)WDW_FM_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
302
+ $view->form_options($id);
303
+ }
304
+
305
+ public function save_options() {
306
+ $message = $this->save_db_options();
307
+ // $this->edit();
308
+ $page = WDW_FM_Library::get('page');
309
+ $current_id = (int)WDW_FM_Library::get('current_id', 0);
310
+ WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
311
+ }
312
+
313
+ public function apply_options() {
314
+ $message = $this->save_db_options();
315
+ require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
316
+ $model = new FMModelManage_fm();
317
+
318
+ require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
319
+ $view = new FMViewManage_fm($model);
320
+ // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
321
+ // $view->form_options($id);
322
+ $page = WDW_FM_Library::get('page');
323
+ $current_id = (int)WDW_FM_Library::get('current_id', 0);
324
+ $fieldset_id = WDW_FM_Library::get('fieldset_id', 'general');
325
+ WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'form_options', 'current_id' => $current_id, 'message' => $message, 'fieldset_id' => $fieldset_id), admin_url('admin.php')));
326
+ }
327
+
328
+ public function remove_query() {
329
+ global $wpdb;
330
+ $cid = ((isset($_POST['cid']) && $_POST['cid'] != '') ? $_POST['cid'] : NULL);
331
+ if (count($cid)) {
332
+ array_walk($cid, create_function('&$value', '$value = (int)$value;'));
333
+ $cids = implode(',', $cid);
334
+ $query = 'DELETE FROM ' . $wpdb->prefix . 'formmaker_query WHERE id IN ( ' . $cids . ' )';
335
+ if ($wpdb->query($query)) {
336
+ echo WDW_FM_Library::message('Items Succesfully Deleted.', 'updated');
337
+ }
338
+ else {
339
+ echo WDW_FM_Library::message('Error. Please install plugin again.', 'error');
340
+ }
341
+ }
342
+ else {
343
+ echo WDW_FM_Library::message('You must select at least one item.', 'error');
344
+ }
345
+ $this->apply_options();
346
+ }
347
+
348
+ public function cancel_options() {
349
+ $this->edit();
350
+ }
351
+
352
+ public function save_db_options() {
353
+ $javascript = "// Occurs before the form is loaded
354
+ function before_load() {
355
+
356
+ }
357
+ // Occurs just before submitting the form
358
+ function before_submit() {
359
+ // 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.
360
+ }
361
+ // Occurs just before resetting the form
362
+ function before_reset() {
363
+
364
+ }";
365
+ global $wpdb;
366
+ // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
367
+ $id = (int)WDW_FM_Library::get('current_id', 0);
368
+ $published = (isset($_POST['published']) ? esc_html(stripslashes($_POST['published'])) : 1);
369
+ $savedb = (isset($_POST['savedb']) ? esc_html(stripslashes($_POST['savedb'])) : 1);
370
+ $theme = (int)((isset($_POST['theme']) && (esc_html($_POST['theme']) != 0)) ? esc_html(stripslashes($_POST['theme'])) : $wpdb->get_var("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE `default`='1'"));
371
+ $requiredmark = (isset($_POST['requiredmark']) ? esc_html(stripslashes($_POST['requiredmark'])) : '*');
372
+ $sendemail = (isset($_POST['sendemail']) ? esc_html(stripslashes($_POST['sendemail'])) : 1);
373
+ $save_uploads = (isset($_POST['save_uploads']) ? esc_html(stripslashes($_POST['save_uploads'])) : 1);
374
+ $mail = (isset($_POST['mail']) ? esc_html(stripslashes($_POST['mail'])) : '');
375
+ if (isset($_POST['mailToAdd']) && esc_html(stripslashes($_POST['mailToAdd'])) != '') {
376
+ $mail .= esc_html(stripslashes($_POST['mailToAdd'])) . ',';
377
+ }
378
+ $from_mail = (isset($_POST['from_mail']) ? esc_html(stripslashes($_POST['from_mail'])) : '');
379
+ $from_name = (isset($_POST['from_name']) ? esc_html(stripslashes($_POST['from_name'])) : '');
380
+ $reply_to = (isset($_POST['reply_to']) ? esc_html(stripslashes($_POST['reply_to'])) : '');
381
+ if ($from_mail == "other") {
382
+ $from_mail = (isset($_POST['mail_from_other']) ? esc_html(stripslashes($_POST['mail_from_other'])) : '');
383
+ }
384
+ if ($reply_to == "other") {
385
+ $reply_to = (isset($_POST['reply_to_other']) ? esc_html(stripslashes($_POST['reply_to_other'])) : '');
386
+ }
387
+ $script_mail = (isset($_POST['script_mail']) ? stripslashes($_POST['script_mail']) : '%all%');
388
+ $mail_from_user = (isset($_POST['mail_from_user']) ? esc_html(stripslashes($_POST['mail_from_user'])) : '');
389
+ $mail_from_name_user = (isset($_POST['mail_from_name_user']) ? esc_html(stripslashes($_POST['mail_from_name_user'])) : '');
390
+ $reply_to_user = (isset($_POST['reply_to_user']) ? esc_html(stripslashes($_POST['reply_to_user'])) : '');
391
+ $condition = (isset($_POST['condition']) ? esc_html(stripslashes($_POST['condition'])) : '');
392
+ $mail_cc = (isset($_POST['mail_cc']) ? esc_html(stripslashes($_POST['mail_cc'])) : '');
393
+ $mail_cc_user = (isset($_POST['mail_cc_user']) ? esc_html(stripslashes($_POST['mail_cc_user'])) : '');
394
+ $mail_bcc = (isset($_POST['mail_bcc']) ? esc_html(stripslashes($_POST['mail_bcc'])) : '');
395
+ $mail_bcc_user = (isset($_POST['mail_bcc_user']) ? esc_html(stripslashes($_POST['mail_bcc_user'])) : '');
396
+ $mail_subject = (isset($_POST['mail_subject']) ? esc_html(stripslashes($_POST['mail_subject'])) : '');
397
+ $mail_subject_user = (isset($_POST['mail_subject_user']) ? esc_html(stripslashes($_POST['mail_subject_user'])) : '');
398
+ $mail_mode = (isset($_POST['mail_mode']) ? esc_html(stripslashes($_POST['mail_mode'])) : 1);
399
+ $mail_mode_user = (isset($_POST['mail_mode_user']) ? esc_html(stripslashes($_POST['mail_mode_user'])) : 1);
400
+ $mail_attachment = (isset($_POST['mail_attachment']) ? esc_html(stripslashes($_POST['mail_attachment'])) : 1);
401
+ $mail_attachment_user = (isset($_POST['mail_attachment_user']) ? esc_html(stripslashes($_POST['mail_attachment_user'])) : 1);
402
+ $script_mail_user = (isset($_POST['script_mail_user']) ? stripslashes($_POST['script_mail_user']) : '%all%');
403
+ $submit_text = (isset($_POST['submit_text']) ? stripslashes($_POST['submit_text']) : '');
404
+ $url = (isset($_POST['url']) ? esc_html(stripslashes($_POST['url'])) : '');
405
+ $tax = (isset($_POST['tax']) ? esc_html(stripslashes($_POST['tax'])) : 0);
406
+ $payment_currency = (isset($_POST['payment_currency']) ? stripslashes($_POST['payment_currency']) : '');
407
+ $paypal_email = (isset($_POST['paypal_email']) ? esc_html(stripslashes($_POST['paypal_email'])) : '');
408
+ $checkout_mode = (isset($_POST['checkout_mode']) ? esc_html(stripslashes($_POST['checkout_mode'])) : 'testmode');
409
+ $paypal_mode = (isset($_POST['paypal_mode']) ? esc_html(stripslashes($_POST['paypal_mode'])) : 0);
410
+ $javascript = (isset($_POST['javascript']) ? stripslashes($_POST['javascript']) : $javascript);
411
+ $user_id_wd = (isset($_POST['user_id_wd']) ? stripslashes($_POST['user_id_wd']) : 'administrator,');
412
+ $frontend_submit_fields = (isset($_POST['frontend_submit_fields']) ? stripslashes($_POST['frontend_submit_fields']) : '');
413
+ $frontend_submit_stat_fields = (isset($_POST['frontend_submit_stat_fields']) ? stripslashes($_POST['frontend_submit_stat_fields']) : '');
414
+ $mail_emptyfields = (isset($_POST['mail_emptyfields']) ? esc_html(stripslashes($_POST['mail_emptyfields'])) : 0);
415
+ $mail_verify = (isset($_POST['mail_verify']) ? esc_html(stripslashes($_POST['mail_verify'])) : 0);
416
+ $mail_verify_expiretime = (isset($_POST['mail_verify_expiretime']) ? esc_html(stripslashes($_POST['mail_verify_expiretime'])) : '');
417
+ $send_to = '';
418
+ for ($i = 0; $i < 20; $i++) {
419
+ if (isset($_POST['send_to' . $i])) {
420
+ $send_to .= '*' . esc_html(stripslashes($_POST['send_to' . $i])) . '*';
421
+ }
422
+ }
423
+ if (isset($_POST['submit_text_type'])) {
424
+ $submit_text_type = esc_html(stripslashes($_POST['submit_text_type']));
425
+ if ($submit_text_type == 5) {
426
+ $article_id = (isset($_POST['page_name']) ? esc_html(stripslashes($_POST['page_name'])) : 0);
427
+ }
428
+ else {
429
+ $article_id = (isset($_POST['post_name']) ? esc_html(stripslashes($_POST['post_name'])) : 0);
430
+ }
431
+ }
432
+ else {
433
+ $submit_text_type = 0;
434
+ $article_id = 0;
435
+ }
436
+
437
+ $mail_verification_post_id = (int)$wpdb->get_var('SELECT mail_verification_post_id FROM ' . $wpdb->prefix . 'formmaker WHERE mail_verification_post_id!=0');
438
+ if($mail_verify) {
439
+ $email_verification_post = array(
440
+ 'post_title' => 'Email Verification',
441
+ 'post_content' => '[email_verification]',
442
+ 'post_status' => 'publish',
443
+ 'post_author' => 1,
444
+ 'post_type' => 'fmemailverification',
445
+ );
446
+
447
+ if(!$mail_verification_post_id || get_post( $mail_verification_post_id )===NULL)
448
+ $mail_verification_post_id = wp_insert_post( $email_verification_post );
449
+ }
450
+
451
+ $save = $wpdb->update($wpdb->prefix . 'formmaker', array(
452
+ 'published' => $published,
453
+ 'savedb' => $savedb,
454
+ 'theme' => $theme,
455
+ 'requiredmark' => $requiredmark,
456
+ 'sendemail' => $sendemail,
457
+ 'save_uploads' => $save_uploads,
458
+ 'mail' => $mail,
459
+ 'from_mail' => $from_mail,
460
+ 'from_name' => $from_name,
461
+ 'reply_to' => $reply_to,
462
+ 'script_mail' => $script_mail,
463
+ 'mail_from_user' => $mail_from_user,
464
+ 'mail_from_name_user' => $mail_from_name_user,
465
+ 'reply_to_user' => $reply_to_user,
466
+ 'condition' => $condition,
467
+ 'mail_cc' => $mail_cc,
468
+ 'mail_cc_user' => $mail_cc_user,
469
+ 'mail_bcc' => $mail_bcc,
470
+ 'mail_bcc_user' => $mail_bcc_user,
471
+ 'mail_subject' => $mail_subject,
472
+ 'mail_subject_user' => $mail_subject_user,
473
+ 'mail_mode' => $mail_mode,
474
+ 'mail_mode_user' => $mail_mode_user,
475
+ 'mail_attachment' => $mail_attachment,
476
+ 'mail_attachment_user' => $mail_attachment_user,
477
+ 'script_mail_user' => $script_mail_user,
478
+ 'submit_text' => $submit_text,
479
+ 'url' => $url,
480
+ 'submit_text_type' => $submit_text_type,
481
+ 'article_id' => $article_id,
482
+ 'tax' => $tax,
483
+ 'payment_currency' => $payment_currency,
484
+ 'paypal_email' => $paypal_email,
485
+ 'checkout_mode' => $checkout_mode,
486
+ 'paypal_mode' => $paypal_mode,
487
+ 'javascript' => $javascript,
488
+ 'user_id_wd' => $user_id_wd,
489
+ 'send_to' => $send_to,
490
+ 'frontend_submit_fields' => $frontend_submit_fields,
491
+ 'frontend_submit_stat_fields' => $frontend_submit_stat_fields,
492
+ 'mail_emptyfields' => $mail_emptyfields,
493
+ 'mail_verify' => $mail_verify,
494
+ 'mail_verify_expiretime' => $mail_verify_expiretime,
495
+ 'mail_verification_post_id' => $mail_verification_post_id,
496
+ ), array('id' => $id));
497
+ if ($save !== FALSE) {
498
+ $save_theme_in_backup = $wpdb->update($wpdb->prefix . 'formmaker_backup', array(
499
+ 'theme' => $theme
500
+ ), array('id' => $id));
501
+ return 8;
502
+ }
503
+ else {
504
+ return 2;
505
+ }
506
+ }
507
+
508
+ public function save_as_copy_old() {
509
+ $message = $this->save_db_as_copy_old();
510
+ // $this->display();
511
+ $page = WDW_FM_Library::get('page');
512
+ WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
513
+ }
514
+
515
+ public function save_old() {
516
+ $message = $this->save_db_old();
517
+ // $this->display();
518
+ $page = WDW_FM_Library::get('page');
519
+ WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
520
+ }
521
+
522
+ public function apply_old() {
523
+ global $wpdb;
524
+ $message = $this->save_db_old();
525
+ // $this->edit_old();
526
+ $id = (int) $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
527
+ $current_id = (int)WDW_FM_Library::get('current_id', $id);
528
+ $page = WDW_FM_Library::get('page');
529
+ WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit_old', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
530
+ }
531
+
532
+ public function save_db_old() {
533
+ global $wpdb;
534
+ // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
535
+ $id = (int)WDW_FM_Library::get('current_id', 0);
536
+ $title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
537
+ $form = (isset($_POST['form']) ? stripslashes($_POST['form']) : '');
538
+ $form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
539
+ $counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
540
+ $label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
541
+ $label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
542
+ $pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
543
+ $show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
544
+ $show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
545
+ $public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
546
+ $private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
547
+ $recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
548
+
549
+ $save = $wpdb->update($wpdb->prefix . 'formmaker', array(
550
+ 'title' => $title,
551
+ 'form' => $form,
552
+ 'form_front' => $form_front,
553
+ 'counter' => $counter,
554
+ 'label_order' => $label_order,
555
+ 'label_order_current' => $label_order_current,
556
+ 'pagination' => $pagination,
557
+ 'show_title' => $show_title,
558
+ 'show_numbers' => $show_numbers,
559
+ 'public_key' => $public_key,
560
+ 'private_key' => $private_key,
561
+ 'recaptcha_theme' => $recaptcha_theme,
562
+ ), array('id' => $id));
563
+ if ($save !== FALSE) {
564
+ return 1;
565
+ }
566
+ else {
567
+ return 2;
568
+ }
569
+ }
570
+
571
+ public function save_db_as_copy_old() {
572
+ global $wpdb;
573
+ // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
574
+ $id = (int)WDW_FM_Library::get('current_id', 0);
575
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
576
+ $title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
577
+ $form = (isset($_POST['form']) ? stripslashes($_POST['form']) : '');
578
+ $form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
579
+ $counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
580
+ $label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
581
+ $pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
582
+ $show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
583
+ $show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
584
+ $public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
585
+ $private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
586
+ $recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
587
+
588
+ $save = $wpdb->insert($wpdb->prefix . 'formmaker', array(
589
+ 'title' => $title,
590
+ 'mail' => $row->mail,
591
+ 'form' => $form,
592
+ 'form_front' => $form_front,
593
+ 'theme' => $row->theme,
594
+ 'counter' => $counter,
595
+ 'label_order' => $label_order,
596
+ 'pagination' => $pagination,
597
+ 'show_title' => $show_title,
598
+ 'show_numbers' => $show_numbers,
599
+ 'public_key' => $public_key,
600
+ 'private_key' => $private_key,
601
+ 'recaptcha_theme' => $recaptcha_theme,
602
+ 'javascript' => $row->javascript,
603
+ 'script1' => $row->script1,
604
+ 'script2' => $row->script2,
605
+ 'script_user1' => $row->script_user1,
606
+ 'script_user2' => $row->script_user2,
607
+ 'submit_text' => $row->submit_text,
608
+ 'url' => $row->url,
609
+ 'article_id' => $row->article_id,
610
+ 'submit_text_type' => $row->submit_text_type,
611
+ 'script_mail' => $row->script_mail,
612
+ 'script_mail_user' => $row->script_mail_user,
613
+ 'paypal_mode' => $row->paypal_mode,
614
+ 'checkout_mode' => $row->checkout_mode,
615
+ 'paypal_email' => $row->paypal_email,
616
+ 'payment_currency' => $row->payment_currency,
617
+ 'tax' => $row->tax,
618
+ 'label_order_current' => $row->label_order_current,
619
+ 'from_mail' => $row->from_mail,
620
+ 'from_name' => $row->from_name,
621
+ 'reply_to_user' => $row->reply_to_user,
622
+ 'mail_from_name_user' => $row->mail_from_name_user,
623
+ 'mail_from_user' => $row->mail_from_user,
624
+ 'custom_front' => $row->custom_front,
625
+ 'autogen_layout' => $row->autogen_layout,
626
+ 'send_to' => $row->send_to,
627
+ 'reply_to' => $row->reply_to,
628
+ 'requiredmark' => $row->requiredmark,
629
+ 'sendemail' => $row->sendemail,
630
+ 'savedb' => $row->savedb,
631
+ 'form_fields' => $row->form_fields,
632
+ 'published' => $row->published,
633
+ 'save_uploads' => $row->save_uploads
634
+ ), array(
635
+ '%s',
636
+ '%s',
637
+ '%s',
638
+ '%s',
639
+ '%d',
640
+ '%d',
641
+ '%s',
642
+ '%s',
643
+ '%s',
644
+ '%s',
645
+ '%s',
646
+ '%s',
647
+ '%s',
648
+ '%s',
649
+ '%s',
650
+ '%s',
651
+ '%s',
652
+ '%s',
653
+ '%s',
654
+ '%s',
655
+ '%s',
656
+ '%d',
657
+ '%s',
658
+ '%s',
659
+ '%d',
660
+ '%s',
661
+ '%s',
662
+ '%s',
663
+ '%s',
664
+ '%s',
665
+ '%s',
666
+ '%s',
667
+ '%s',
668
+ '%s',
669
+ '%s',
670
+ '%s',
671
+ '%d',
672
+ '%s',
673
+ '%s',
674
+ '%s',
675
+ '%d',
676
+ '%d',
677
+ '%s',
678
+ '%d'
679
+ ));
680
+ $id = (int)$wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
681
+ $wpdb->insert($wpdb->prefix . 'formmaker_views', array(
682
+ 'form_id' => $id,
683
+ 'views' => 0
684
+ ), array(
685
+ '%d',
686
+ '%d'
687
+ ));
688
+ if ($save !== FALSE) {
689
+ return 1;
690
+ }
691
+ else {
692
+ return 2;
693
+ }
694
+ }
695
+
696
+ public function save_as_copy() {
697
+ $message = $this->save_db_as_copy();
698
+ // $this->display();
699
+ $page = WDW_FM_Library::get('page');
700
+ WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
701
+ }
702
+
703
+ public function save() {
704
+ $message = $this->save_db();
705
+ // $this->display();
706
+ $page = WDW_FM_Library::get('page');
707
+ WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
708
+ }
709
+
710
+ public function apply() {
711
+ $message = $this->save_db();
712
+ // $this->edit();
713
+ global $wpdb;
714
+ $id = (int) $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
715
+ $current_id = (int)WDW_FM_Library::get('current_id', $id);
716
+ $page = WDW_FM_Library::get('page');
717
+ WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
718
+ }
719
+
720
+ public function save_db() {
721
+ global $wpdb;
722
+ $javascript = "// Occurs before the form is loaded
723
+ function before_load() {
724
+ }
725
+ // Occurs just before submitting the form
726
+ function before_submit() {
727
+ // 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.
728
+ }
729
+ // before form reset
730
+ function before_reset() {
731
+ }";
732
+ $id = (int)WDW_FM_Library::get('current_id', 0);
733
+ $title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
734
+ $theme = (isset($_POST['theme']) ? esc_html(stripslashes($_POST['theme'])) : $wpdb->get_var("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE `default`='1'"));
735
+ $form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
736
+ $sortable = (isset($_POST['sortable']) ? stripslashes($_POST['sortable']) : 1);
737
+ $counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
738
+ $label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
739
+ $pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
740
+ $show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
741
+ $show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
742
+ $public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
743
+ $private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
744
+ $recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
745
+ $label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
746
+ $form_fields = (isset($_POST['form_fields']) ? stripslashes($_POST['form_fields']) : '');
747
+ if ($id != 0) {
748
+ $save = $wpdb->update($wpdb->prefix . 'formmaker', array(
749
+ 'title' => $title,
750
+ 'theme' => $theme,
751
+ 'form_front' => $form_front,
752
+ 'sortable' => $sortable,
753
+ 'counter' => $counter,
754
+ 'label_order' => $label_order,
755
+ 'label_order_current' => $label_order_current,
756
+ 'pagination' => $pagination,
757
+ 'show_title' => $show_title,
758
+ 'show_numbers' => $show_numbers,
759
+ 'public_key' => $public_key,
760
+ 'private_key' => $private_key,
761
+ 'recaptcha_theme' => $recaptcha_theme,
762
+ 'form_fields' => $form_fields,
763
+ ), array('id' => $id));
764
+ }
765
+ else {
766
+ $save = $wpdb->insert($wpdb->prefix . 'formmaker', array(
767
+ 'title' => $title,
768
+ 'mail' => '',
769
+ 'form_front' => $form_front,
770
+ 'theme' => $theme,
771
+ 'counter' => $counter,
772
+ 'label_order' => $label_order,
773
+ 'pagination' => $pagination,
774
+ 'show_title' => $show_title,
775
+ 'show_numbers' => $show_numbers,
776
+ 'public_key' => $public_key,
777
+ 'private_key' => $private_key,
778
+ 'recaptcha_theme' => $recaptcha_theme,
779
+ 'javascript' => $javascript,
780
+ 'submit_text' => '',
781
+ 'url' => '',
782
+ 'article_id' => 0,
783
+ 'submit_text_type' => 0,
784
+ 'script_mail' => '%all%',
785
+ 'script_mail_user' => '%all%',
786
+ 'label_order_current' => $label_order_current,
787
+ 'tax' => 0,
788
+ 'payment_currency' => '',
789
+ 'paypal_email' => '',
790
+ 'checkout_mode' => 'testmode',
791
+ 'paypal_mode' => 0,
792
+ 'published' => 1,
793
+ 'form_fields' => $form_fields,
794
+ 'savedb' => 1,
795
+ 'sendemail' => 1,
796
+ 'requiredmark' => '*',
797
+ 'from_mail' => '',
798
+ 'from_name' => '',
799
+ 'reply_to' => '',
800
+ 'send_to' => '',
801
+ 'autogen_layout' => 1,
802
+ 'custom_front' => '',
803
+ 'mail_from_user' => '',
804
+ 'mail_from_name_user' => '',
805
+ 'reply_to_user' => '',
806
+ 'condition' => '',
807
+ 'mail_cc' => '',
808
+ 'mail_cc_user' => '',
809
+ 'mail_bcc' => '',
810
+ 'mail_bcc_user' => '',
811
+ 'mail_subject' => '',
812
+ 'mail_subject_user' => '',
813
+ 'mail_mode' => 1,
814
+ 'mail_mode_user' => 1,
815
+ 'mail_attachment' => 1,
816
+ 'mail_attachment_user' => 1,
817
+ 'sortable' => $sortable,
818
+ 'user_id_wd' => 'administrator,',
819
+ 'frontend_submit_fields' => '',
820
+ 'frontend_submit_stat_fields' => '',
821
+ 'save_uploads' => 1,
822
+ ), array(
823
+ '%s',
824
+ '%s',
825
+ '%s',
826
+ '%d',
827
+ '%d',
828
+ '%s',
829
+ '%s',
830
+ '%s',
831
+ '%s',
832
+ '%s',
833
+ '%s',
834
+ '%s',
835
+ '%s',
836
+ '%s',
837
+ '%s',
838
+ '%d',
839
+ '%d',
840
+ '%s',
841
+ '%s',
842
+ '%s',
843
+ '%s',
844
+ '%s',
845
+ '%s',
846
+ '%s',
847
+ '%d',
848
+ '%d',
849
+ '%s',
850
+ '%d',
851
+ '%d',
852
+ '%s',
853
+ '%s',
854
+ '%s',
855
+ '%s',
856
+ '%s',
857
+ '%d',
858
+ '%s',
859
+ '%s',
860
+ '%s',
861
+ '%s',
862
+ '%s',
863
+ '%s',
864
+ '%s',
865
+ '%s',
866
+ '%s',
867
+ '%s',
868
+ '%s',
869
+ '%d',
870
+ '%d',
871
+ '%d',
872
+ '%d',
873
+ '%d',
874
+ '%s',
875
+ '%s',
876
+ '%s',
877
+ '%d',
878
+ ));
879
+ $id = (int)$wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
880
+ // $_POST['current_id'] = $id;
881
+ $wpdb->insert($wpdb->prefix . 'formmaker_views', array(
882
+ 'form_id' => $id,
883
+ 'views' => 0
884
+ ), array(
885
+ '%d',
886
+ '%d'
887
+ ));
888
+ }
889
+
890
+ $backup_id = (isset($_POST['backup_id']) ? (int)esc_html(stripslashes($_POST['backup_id'])) : '');
891
+
892
+ if($backup_id)
893
+ {
894
+ $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 ";
895
+
896
+ if($wpdb->get_var($query))
897
+ {
898
+ $query = "DELETE FROM ".$wpdb->prefix."formmaker_backup WHERE backup_id > ".$backup_id." AND id = ".$id;
899
+ $wpdb->query($query);
900
+ }
901
+
902
+ $row = $wpdb->get_row($wpdb->prepare("SELECT form_fields, form_front FROM ".$wpdb->prefix."formmaker_backup WHERE backup_id = '%d'", $backup_id));
903
+
904
+ if($row->form_fields==$form_fields and $row->form_front==$form_front)
905
+ {
906
+ $save = $wpdb->update($wpdb->prefix . 'formmaker_backup', array(
907
+ 'cur' => 1,
908
+ 'title' => $title,
909
+ 'theme' => $theme,
910
+ 'form_front' => $form_front,
911
+ 'sortable' => $sortable,
912
+ 'counter' => $counter,
913
+ 'label_order' => $label_order,
914
+ 'label_order_current' => $label_order_current,
915
+ 'pagination' => $pagination,
916
+ 'show_title' => $show_title,
917
+ 'show_numbers' => $show_numbers,
918
+ 'public_key' => $public_key,
919
+ 'private_key' => $private_key,
920
+ 'recaptcha_theme' => $recaptcha_theme,
921
+ 'form_fields' => $form_fields,
922
+ ), array('backup_id' => $backup_id));
923
+
924
+
925
+ if ($save !== FALSE) {
926
+ return 1;
927
+ }
928
+ else {
929
+ return 2;
930
+ }
931
+ }
932
+ }
933
+
934
+ $wpdb->query("UPDATE ".$wpdb->prefix."formmaker_backup SET cur=0 WHERE id=".$id );
935
+
936
+ $save = $wpdb->insert($wpdb->prefix . 'formmaker_backup', array(
937
+ 'cur' => 1,
938
+ 'id' => $id,
939
+ 'title' => $title,
940
+ 'mail' => '',
941
+ 'form_front' => $form_front,
942
+ 'theme' => $theme,
943
+ 'counter' => $counter,
944
+ 'label_order' => $label_order,
945
+ 'pagination' => $pagination,
946
+ 'show_title' => $show_title,
947
+ 'show_numbers' => $show_numbers,
948
+ 'public_key' => $public_key,
949
+ 'private_key' => $private_key,
950
+ 'recaptcha_theme' => $recaptcha_theme,
951
+ 'javascript' => $javascript,
952
+ 'submit_text' => '',
953
+ 'url' => '',
954
+ 'article_id' => 0,
955
+ 'submit_text_type' => 0,
956
+ 'script_mail' => '%all%',
957
+ 'script_mail_user' => '%all%',
958
+ 'label_order_current' => $label_order_current,
959
+ 'tax' => 0,
960
+ 'payment_currency' => '',
961
+ 'paypal_email' => '',
962
+ 'checkout_mode' => 'testmode',
963
+ 'paypal_mode' => 0,
964
+ 'published' => 1,
965
+ 'form_fields' => $form_fields,
966
+ 'savedb' => 1,
967
+ 'sendemail' => 1,
968
+ 'requiredmark' => '*',
969
+ 'from_mail' => '',
970
+ 'from_name' => '',
971
+ 'reply_to' => '',
972
+ 'send_to' => '',
973
+ 'autogen_layout' => 1,
974
+ 'custom_front' => '',
975
+ 'mail_from_user' => '',
976
+ 'mail_from_name_user' => '',
977
+ 'reply_to_user' => '',
978
+ 'condition' => '',
979
+ 'mail_cc' => '',
980
+ 'mail_cc_user' => '',
981
+ 'mail_bcc' => '',
982
+ 'mail_bcc_user' => '',
983
+ 'mail_subject' => '',
984
+ 'mail_subject_user' => '',
985
+ 'mail_mode' => 1,
986
+ 'mail_mode_user' => 1,
987
+ 'mail_attachment' => 1,
988
+ 'mail_attachment_user' => 1,
989
+ 'sortable' => $sortable,
990
+ 'user_id_wd' => 'administrator,',
991
+ 'frontend_submit_fields' => '',
992
+ 'frontend_submit_stat_fields' => '',
993
+ ), array(
994
+ '%d',
995
+ '%d',
996
+ '%s',
997
+ '%s',
998
+ '%s',
999
+ '%d',
1000
+ '%d',
1001
+ '%s',
1002
+ '%s',
1003
+ '%s',
1004
+ '%s',
1005
+ '%s',
1006
+ '%s',
1007
+ '%s',
1008
+ '%s',
1009
+ '%s',
1010
+ '%s',
1011
+ '%d',
1012
+ '%d',
1013
+ '%s',
1014
+ '%s',
1015
+ '%s',
1016
+ '%s',
1017
+ '%s',
1018
+ '%s',
1019
+ '%s',
1020
+ '%d',
1021
+ '%d',
1022
+ '%s',
1023
+ '%d',
1024
+ '%d',
1025
+ '%s',
1026
+ '%s',
1027
+ '%s',
1028
+ '%s',
1029
+ '%s',
1030
+ '%d',
1031
+ '%s',
1032
+ '%s',
1033
+ '%s',
1034
+ '%s',
1035
+ '%s',
1036
+ '%s',
1037
+ '%s',
1038
+ '%s',
1039
+ '%s',
1040
+ '%s',
1041
+ '%s',
1042
+ '%d',
1043
+ '%d',
1044
+ '%d',
1045
+ '%d',
1046
+ '%d',
1047
+ '%s',
1048
+ '%s',
1049
+ '%s',
1050
+ )) ;
1051
+
1052
+ $query = "SELECT count(backup_id) FROM ".$wpdb->prefix."formmaker_backup WHERE id = ".$id;
1053
+ $wpdb->get_var($query);
1054
+ if($wpdb->get_var($query)>10)
1055
+ {
1056
+ $query = "DELETE FROM ".$wpdb->prefix."formmaker_backup WHERE id = ".$id." ORDER BY backup_id ASC LIMIT 1 ";
1057
+ $wpdb->query($query);
1058
+ }
1059
+
1060
+ if ($save !== FALSE) {
1061
+ return 1;
1062
+ }
1063
+ else {
1064
+ return 2;
1065
+ }
1066
+ }
1067
+
1068
+ public function save_db_as_copy() {
1069
+ global $wpdb;
1070
+ // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
1071
+ $id = (int)WDW_FM_Library::get('current_id', 0);
1072
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
1073
+ $title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
1074
+ $form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
1075
+ $sortable = (isset($_POST['sortable']) ? stripslashes($_POST['sortable']) : 1);
1076
+ $counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
1077
+ $label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
1078
+ $label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
1079
+ $pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
1080
+ $show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
1081
+ $show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
1082
+ $public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
1083
+ $private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
1084
+ $recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
1085
+ $form_fields = (isset($_POST['form_fields']) ? stripslashes($_POST['form_fields']) : '');
1086
+
1087
+ $save = $wpdb->insert($wpdb->prefix . 'formmaker', array(
1088
+ 'title' => $title,
1089
+ 'mail' => $row->mail,
1090
+ 'form_front' => $form_front,
1091
+ 'theme' => $row->theme,
1092
+ 'counter' => $counter,
1093
+ 'label_order' => $label_order,
1094
+ 'pagination' => $pagination,
1095
+ 'show_title' => $show_title,
1096
+ 'show_numbers' => $show_numbers,
1097
+ 'public_key' => $public_key,
1098
+ 'private_key' => $private_key,
1099
+ 'recaptcha_theme' => $recaptcha_theme,
1100
+ 'javascript' => $row->javascript,
1101
+ 'submit_text' => $row->submit_text,
1102
+ 'url' => $row->url,
1103
+ 'article_id' => $row->article_id,
1104
+ 'submit_text_type' => $row->submit_text_type,
1105
+ 'script_mail' => $row->script_mail,
1106
+ 'script_mail_user' => $row->script_mail_user,
1107
+ 'label_order_current' => $label_order_current,
1108
+ 'tax' => $row->tax,
1109
+ 'payment_currency' => $row->payment_currency,
1110
+ 'paypal_email' => $row->paypal_email,
1111
+ 'checkout_mode' => $row->checkout_mode,
1112
+ 'paypal_mode' => $row->paypal_mode,
1113
+ 'published' => $row->published,
1114
+ 'form_fields' => $form_fields,
1115
+ 'savedb' => $row->savedb,
1116
+ 'sendemail' => $row->sendemail,
1117
+ 'requiredmark' => $row->requiredmark,
1118
+ 'from_mail' => $row->from_mail,
1119
+ 'from_name' => $row->from_name,
1120
+ 'reply_to' => $row->reply_to,
1121
+ 'send_to' => $row->send_to,
1122
+ 'autogen_layout' => $row->autogen_layout,
1123
+ 'custom_front' => $row->custom_front,
1124
+ 'mail_from_user' => $row->mail_from_user,
1125
+ 'mail_from_name_user' => $row->mail_from_name_user,
1126
+ 'reply_to_user' => $row->reply_to_user,
1127
+ 'condition' => $row->condition,
1128
+ 'mail_cc' => $row->mail_cc,
1129
+ 'mail_cc_user' => $row->mail_cc_user,
1130
+ 'mail_bcc' => $row->mail_bcc,
1131
+ 'mail_bcc_user' => $row->mail_bcc_user,
1132
+ 'mail_subject' => $row->mail_subject,
1133
+ 'mail_subject_user' => $row->mail_subject_user,
1134
+ 'mail_mode' => $row->mail_mode,
1135
+ 'mail_mode_user' => $row->mail_mode_user,
1136
+ 'mail_attachment' => $row->mail_attachment,
1137
+ 'mail_attachment_user' => $row->mail_attachment_user,
1138
+ 'sortable' => $sortable,
1139
+ 'user_id_wd' => $row->user_id_wd,
1140
+ 'frontend_submit_fields' => $row->frontend_submit_fields,
1141
+ 'frontend_submit_stat_fields' => $row->frontend_submit_stat_fields,
1142
+ 'save_uploads' => $row->save_uploads,
1143
+ ), array(
1144
+ '%s',
1145
+ '%s',
1146
+ '%s',
1147
+ '%d',
1148
+ '%d',
1149
+ '%s',
1150
+ '%s',
1151
+ '%s',
1152
+ '%s',
1153
+ '%s',
1154
+ '%s',
1155
+ '%s',
1156
+ '%s',
1157
+ '%s',
1158
+ '%s',
1159
+ '%d',
1160
+ '%d',
1161
+ '%s',
1162
+ '%s',
1163
+ '%s',
1164
+ '%s',
1165
+ '%s',
1166
+ '%s',
1167
+ '%s',
1168
+ '%d',
1169
+ '%d',
1170
+ '%s',
1171
+ '%d',
1172
+ '%d',
1173
+ '%s',
1174
+ '%s',
1175
+ '%s',
1176
+ '%s',
1177
+ '%s',
1178
+ '%d',
1179
+ '%s',
1180
+ '%s',
1181
+ '%s',
1182
+ '%s',
1183
+ '%s',
1184
+ '%s',
1185
+ '%s',
1186
+ '%s',
1187
+ '%s',
1188
+ '%s',
1189
+ '%s',
1190
+ '%d',
1191
+ '%d',
1192
+ '%d',
1193
+ '%d',
1194
+ '%d',
1195
+ '%s',
1196
+ '%s',
1197
+ '%s',
1198
+ '%d',
1199
+ ));
1200
+ $new_id = (int)$wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
1201
+ $wpdb->insert($wpdb->prefix . 'formmaker_views', array(
1202
+ 'form_id' => $new_id,
1203
+ 'views' => 0
1204
+ ), array(
1205
+ '%d',
1206
+ '%d'
1207
+ ));
1208
+ if ($save !== FALSE) {
1209
+
1210
+ return 1;
1211
+ }
1212
+ else {
1213
+ return 2;
1214
+ }
1215
+ }
1216
+
1217
+ public function delete($id) {
1218
+ global $wpdb;
1219
+ $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id);
1220
+ if ($wpdb->query($query)) {
1221
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="%d"', $id));
1222
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id="%d"', $id));
1223
+
1224
+ $message = 3;
1225
+ }
1226
+ else {
1227
+ $message = 2;
1228
+ }
1229
+ // $this->display();
1230
+ $page = WDW_FM_Library::get('page');
1231
+ WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
1232
+ }
1233
+
1234
+ public function delete_all() {
1235
+ global $wpdb;
1236
+ $flag = FALSE;
1237
+ $isDefault = FALSE;
1238
+ $form_ids_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker');
1239
+ foreach ($form_ids_col as $form_id) {
1240
+ if (isset($_POST['check_' . $form_id])) {
1241
+ $flag = TRUE;
1242
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $form_id));
1243
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="%d"', $form_id));
1244
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id="%d"', $form_id));
1245
+ }
1246
+ }
1247
+ if ($flag) {
1248
+ $message = 5;
1249
+ }
1250
+ else {
1251
+ $message = 6;
1252
+ }
1253
+ // $this->display();
1254
+ $page = WDW_FM_Library::get('page');
1255
+ WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
1256
+ }
1257
+
1258
+ ////////////////////////////////////////////////////////////////////////////////////////
1259
+ // Getters & Setters //
1260
+ ////////////////////////////////////////////////////////////////////////////////////////
1261
+ ////////////////////////////////////////////////////////////////////////////////////////
1262
+ // Private Methods //
1263
+ ////////////////////////////////////////////////////////////////////////////////////////
1264
+ ////////////////////////////////////////////////////////////////////////////////////////
1265
+ // Listeners //
1266
+ ////////////////////////////////////////////////////////////////////////////////////////
1267
  }
admin/controllers/FMControllerSelect_data_from_db.php CHANGED
@@ -1,70 +1,70 @@
1
- <?php
2
-
3
- class FMControllerSelect_data_from_db {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $task = ((isset($_GET['task'])) ? esc_html($_GET['task']) : 0);
23
- $id = ((isset($_GET['id'])) ? (int)esc_html($_GET['id']) : 0);
24
- $form_id = ((isset($_GET['form_id'])) ? (int)esc_html($_GET['form_id']) : 0);
25
- $field_id = ((isset($_GET['field_id'])) ? esc_html($_GET['field_id']) : 0);
26
- $field_type = ((isset($_GET['field_type'])) ? esc_html($_GET['field_type']) : 0);
27
- $value_disabled = ((isset($_GET['value_disabled'])) ? esc_html($_GET['value_disabled']) : 0);
28
- if ($task && method_exists($this, $task)) {
29
- $this->$task($form_id,$field_type="");
30
- }
31
- else
32
- $this->display($id, $field_id, $field_type, $value_disabled,$form_id);
33
- }
34
-
35
- public function display($id, $field_id, $field_type, $value_disabled,$form_id) {
36
- require_once WD_FM_DIR . "/admin/models/FMModelSelect_data_from_db.php";
37
- $model = new FMModelSelect_data_from_db();
38
-
39
- require_once WD_FM_DIR . "/admin/views/FMViewSelect_data_from_db.php";
40
- $view = new FMViewSelect_data_from_db($model);
41
- $view->display($id, $field_id, $field_type, $value_disabled,$form_id);
42
- }
43
-
44
- public function db_tables($form_id,$field_type) {
45
- require_once WD_FM_DIR . "/admin/models/FMModelSelect_data_from_db.php";
46
- $model = new FMModelSelect_data_from_db();
47
-
48
- require_once WD_FM_DIR . "/admin/views/FMViewSelect_data_from_db.php";
49
- $view = new FMViewSelect_data_from_db($model);
50
- $view->db_tables((int)$form_id, $field_type);
51
- }
52
- public function db_table_struct_select($form_id,$field_type) {
53
- require_once WD_FM_DIR . "/admin/models/FMModelSelect_data_from_db.php";
54
- $model = new FMModelSelect_data_from_db();
55
-
56
- require_once WD_FM_DIR . "/admin/views/FMViewSelect_data_from_db.php";
57
- $view = new FMViewSelect_data_from_db($model);
58
- $view->db_table_struct_select((int)$form_id,$field_type);
59
- }
60
-
61
- ////////////////////////////////////////////////////////////////////////////////////////
62
- // Getters & Setters //
63
- ////////////////////////////////////////////////////////////////////////////////////////
64
- ////////////////////////////////////////////////////////////////////////////////////////
65
- // Private Methods //
66
- ////////////////////////////////////////////////////////////////////////////////////////
67
- ////////////////////////////////////////////////////////////////////////////////////////
68
- // Listeners //
69
- ////////////////////////////////////////////////////////////////////////////////////////
70
  }
1
+ <?php
2
+
3
+ class FMControllerSelect_data_from_db {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $task = ((isset($_GET['task'])) ? esc_html($_GET['task']) : 0);
23
+ $id = ((isset($_GET['id'])) ? (int)esc_html($_GET['id']) : 0);
24
+ $form_id = ((isset($_GET['form_id'])) ? (int)esc_html($_GET['form_id']) : 0);
25
+ $field_id = ((isset($_GET['field_id'])) ? esc_html($_GET['field_id']) : 0);
26
+ $field_type = ((isset($_GET['field_type'])) ? esc_html($_GET['field_type']) : 0);
27
+ $value_disabled = ((isset($_GET['value_disabled'])) ? esc_html($_GET['value_disabled']) : 0);
28
+ if ($task && method_exists($this, $task)) {
29
+ $this->$task($form_id,$field_type="");
30
+ }
31
+ else
32
+ $this->display($id, $field_id, $field_type, $value_disabled,$form_id);
33
+ }
34
+
35
+ public function display($id, $field_id, $field_type, $value_disabled,$form_id) {
36
+ require_once WD_FM_DIR . "/admin/models/FMModelSelect_data_from_db.php";
37
+ $model = new FMModelSelect_data_from_db();
38
+
39
+ require_once WD_FM_DIR . "/admin/views/FMViewSelect_data_from_db.php";
40
+ $view = new FMViewSelect_data_from_db($model);
41
+ $view->display($id, $field_id, $field_type, $value_disabled,$form_id);
42
+ }
43
+
44
+ public function db_tables($form_id,$field_type) {
45
+ require_once WD_FM_DIR . "/admin/models/FMModelSelect_data_from_db.php";
46
+ $model = new FMModelSelect_data_from_db();
47
+
48
+ require_once WD_FM_DIR . "/admin/views/FMViewSelect_data_from_db.php";
49
+ $view = new FMViewSelect_data_from_db($model);
50
+ $view->db_tables((int)$form_id, $field_type);
51
+ }
52
+ public function db_table_struct_select($form_id,$field_type) {
53
+ require_once WD_FM_DIR . "/admin/models/FMModelSelect_data_from_db.php";
54
+ $model = new FMModelSelect_data_from_db();
55
+
56
+ require_once WD_FM_DIR . "/admin/views/FMViewSelect_data_from_db.php";
57
+ $view = new FMViewSelect_data_from_db($model);
58
+ $view->db_table_struct_select((int)$form_id,$field_type);
59
+ }
60
+
61
+ ////////////////////////////////////////////////////////////////////////////////////////
62
+ // Getters & Setters //
63
+ ////////////////////////////////////////////////////////////////////////////////////////
64
+ ////////////////////////////////////////////////////////////////////////////////////////
65
+ // Private Methods //
66
+ ////////////////////////////////////////////////////////////////////////////////////////
67
+ ////////////////////////////////////////////////////////////////////////////////////////
68
+ // Listeners //
69
+ ////////////////////////////////////////////////////////////////////////////////////////
70
  }
admin/controllers/FMControllerShow_matrix.php CHANGED
@@ -1,43 +1,43 @@
1
- <?php
2
-
3
- class FMControllerShow_matrix {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $this->display();
23
- }
24
-
25
- public function display() {
26
- require_once WD_FM_DIR . "/admin/models/FMModelShow_matrix.php";
27
- $model = new FMModelShow_matrix();
28
-
29
- require_once WD_FM_DIR . "/admin/views/FMViewShow_matrix.php";
30
- $view = new FMViewShow_matrix($model);
31
- $view->display();
32
- }
33
-
34
- ////////////////////////////////////////////////////////////////////////////////////////
35
- // Getters & Setters //
36
- ////////////////////////////////////////////////////////////////////////////////////////
37
- ////////////////////////////////////////////////////////////////////////////////////////
38
- // Private Methods //
39
- ////////////////////////////////////////////////////////////////////////////////////////
40
- ////////////////////////////////////////////////////////////////////////////////////////
41
- // Listeners //
42
- ////////////////////////////////////////////////////////////////////////////////////////
43
  }
1
+ <?php
2
+
3
+ class FMControllerShow_matrix {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $this->display();
23
+ }
24
+
25
+ public function display() {
26
+ require_once WD_FM_DIR . "/admin/models/FMModelShow_matrix.php";
27
+ $model = new FMModelShow_matrix();
28
+
29
+ require_once WD_FM_DIR . "/admin/views/FMViewShow_matrix.php";
30
+ $view = new FMViewShow_matrix($model);
31
+ $view->display();
32
+ }
33
+
34
+ ////////////////////////////////////////////////////////////////////////////////////////
35
+ // Getters & Setters //
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
+ ////////////////////////////////////////////////////////////////////////////////////////
38
+ // Private Methods //
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Listeners //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
  }
admin/controllers/FMControllerSubmissions_fm.php CHANGED
@@ -1,804 +1,804 @@
1
- <?php
2
-
3
- class FMControllerSubmissions_fm {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $task = ((isset($_POST['task'])) ? esc_html($_POST['task']) : '');
23
- $id = ((isset($_POST['current_id'])) ? (int)esc_html($_POST['current_id']) : 0);
24
- $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
25
-
26
- if (method_exists($this, $task)) {
27
- if($task != 'show_stats')
28
- check_admin_referer('nonce_fm', 'nonce_fm');
29
- else
30
- check_ajax_referer('nonce_fm_ajax', 'nonce_fm_ajax');
31
- $this->$task($id);
32
- }
33
- else {
34
- $this->display($form_id);
35
- }
36
- }
37
-
38
- public function display($form_id) {
39
- $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
40
- require_once WD_FM_DIR . "/admin/models/FMModelSubmissions_fm.php";
41
- $model = new FMModelSubmissions_fm();
42
-
43
- require_once WD_FM_DIR . "/admin/views/FMViewSubmissions_fm.php";
44
- $view = new FMViewSubmissions_fm($model);
45
- $view->display($form_id);
46
- }
47
-
48
- public function show_stats() {
49
-
50
- $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
51
- require_once WD_FM_DIR . "/admin/models/FMModelSubmissions_fm.php";
52
- $model = new FMModelSubmissions_fm();
53
-
54
- require_once WD_FM_DIR . "/admin/views/FMViewSubmissions_fm.php";
55
- $view = new FMViewSubmissions_fm($model);
56
- $view->show_stats($form_id);
57
- }
58
-
59
- public function edit() {
60
- global $wpdb;
61
- require_once WD_FM_DIR . "/admin/models/FMModelSubmissions_fm.php";
62
- $model = new FMModelSubmissions_fm();
63
-
64
- require_once WD_FM_DIR . "/admin/views/FMViewSubmissions_fm.php";
65
- $view = new FMViewSubmissions_fm($model);
66
- $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? (int) $_POST['current_id'] : 0);
67
-
68
- $form_id = (int)$wpdb->get_var("SELECT form_id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "'");
69
- $form = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id='" . $form_id . "'");
70
-
71
- if (isset($form->form)) {
72
- $old = TRUE;
73
- }
74
- else {
75
- $old = FALSE;
76
- }
77
-
78
- if ($old == FALSE || ($old == TRUE && $form->form == '')) {
79
- $view->new_edit($id, $form_id);
80
- }
81
- else {
82
- $view->edit($id);
83
- }
84
- }
85
-
86
- public function save() {
87
- $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
88
- $this->save_db();
89
- $this->display($form_id);
90
- }
91
-
92
- public function apply() {
93
- $this->save_db();
94
- $this->edit();
95
- }
96
-
97
- public function save_db() {
98
- global $wpdb;
99
- $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes( $_POST['current_id'])) : 0);
100
- $group_id = $id;
101
- $date = esc_html($_POST['date']);
102
- $ip = esc_html($_POST['ip']);
103
- $form_id = (int)$wpdb->get_var("SELECT form_id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "'");
104
- $form = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id='" . $form_id . "'");
105
- $label_id = array();
106
- $label_order_original = array();
107
- $label_type = array();
108
- $old = false;
109
- $form_currency = '$';
110
-
111
- if (strpos($form->label_order, 'type_paypal_')) {
112
- $form->label_order = $form->label_order."0#**id**#Payment Status#**label**#type_paypal_payment_status#****#";
113
- }
114
- $label_all = explode('#****#', $form->label_order);
115
- $label_all = array_slice($label_all, 0, count($label_all) - 1);
116
- foreach ($label_all as $key => $label_each) {
117
- $label_id_each = explode('#**id**#', $label_each);
118
- array_push($label_id, $label_id_each[0]);
119
- $label_oder_each = explode('#**label**#', $label_id_each[1]);
120
- array_push($label_order_original, $label_oder_each[0]);
121
- array_push($label_type, $label_oder_each[1]);
122
- }
123
-
124
- if(isset($form->form))
125
- $old = true;
126
-
127
- if($old == false || ($old == true && $form->form=='')) {
128
-
129
- foreach($label_type as $key => $type) {
130
-
131
- $value='';
132
- if($type=="type_submit_reset" or $type=="type_map" or $type=="type_editor" or $type=="type_captcha" or $type=="type_recaptcha" or $type=="type_button" or $type=="type_paypal_total")
133
- continue;
134
-
135
- $i=$label_id[$key];
136
- $id = 'form_id_temp';
137
- switch ($type) {
138
-
139
- case 'type_text':
140
- case 'type_password':
141
- case 'type_textarea':
142
- case "type_submitter_mail":
143
- case "type_date":
144
- case "type_own_select":
145
- case "type_country":
146
- case "type_number": {
147
- $value = (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL);
148
- break;
149
- }
150
- case "type_wdeditor": {
151
- $value = (isset($_POST['wdform_'.$i.'_wd_editor'.$id]) ? $_POST['wdform_'.$i.'_wd_editor'.$id] : NULL);
152
- break;
153
- }
154
- case "type_mark_map": {
155
- $long = (isset($_POST['wdform_'.$i."_long".$id]) ? $_POST['wdform_'.$i."_long".$id] : NULL);
156
- $lat = (isset($_POST['wdform_'.$i."_lat".$id]) ? $_POST['wdform_'.$i."_lat".$id] : NULL);
157
- if($long and $lat)
158
- $value = $long . '***map***' . $lat;
159
-
160
- break;
161
- }
162
-
163
- case "type_date_new":{
164
- $value = isset($_POST['wdform_'.$i."_element".$id]) ? esc_html($_POST['wdform_'.$i."_element".$id]) : "";
165
-
166
- break;
167
- }
168
-
169
- case "type_date_range":{
170
- $value = (isset($_POST['wdform_'.$i."_element".$id."0"]) ? esc_html($_POST['wdform_'.$i."_element".$id."0"]) : "").' - '.(isset($_POST['wdform_'.$i."_element".$id."1"]) ? esc_html($_POST['wdform_'.$i."_element".$id."1"]) : "");
171
-
172
- break;
173
- }
174
-
175
- case "type_date_fields": {
176
- $day = (isset($_POST['wdform_'.$i."_day".$id]) ? $_POST['wdform_'.$i."_day".$id] : NULL);
177
- $month = (isset($_POST['wdform_'.$i."_month".$id]) ? $_POST['wdform_'.$i."_month".$id] : NULL);
178
- $year = (isset($_POST['wdform_'.$i."_year".$id]) ? $_POST['wdform_'.$i."_year".$id] : NULL);
179
- if($day or $month or $year)
180
- $value = $day . '-' . $month . '-' . $year;
181
- break;
182
- }
183
-
184
- case "type_time": {
185
- $ss = (isset($_POST['wdform_'.$i."_ss".$id]) ? $_POST['wdform_'.$i."_ss".$id] : NULL);
186
- $hh = (isset($_POST['wdform_'.$i."_hh".$id]) ? $_POST['wdform_'.$i."_hh".$id] : NULL);
187
- $mm = (isset($_POST['wdform_'.$i."_mm".$id]) ? $_POST['wdform_'.$i."_mm".$id] : NULL);
188
-
189
- if(isset($ss))
190
- $value = $hh .':'. $mm .':' . $ss;
191
- else
192
- $value = $hh .':' . $mm;
193
-
194
- $am_pm = (isset($_POST['wdform_'.$i."_am_pm".$id]) ? $_POST['wdform_'.$i."_am_pm".$id] : NULL);
195
- if(isset($am_pm))
196
- $value = $value . ' ' . $am_pm;
197
-
198
- break;
199
- }
200
-
201
- case "type_phone": {
202
- $first = (isset($_POST['wdform_'.$i."_element_first".$id]) ? $_POST['wdform_'.$i."_element_first".$id] : NULL);
203
- $last = (isset($_POST['wdform_'.$i."_element_last".$id]) ? $_POST['wdform_'.$i."_element_last".$id] : NULL);
204
- if($first or $last)
205
- $value = $first . ' ' . $last;
206
-
207
- break;
208
- }
209
-
210
- case "type_name": {
211
-
212
- $element_title = (isset($_POST['wdform_'.$i."_element_title".$id]) ? $_POST['wdform_'.$i."_element_title".$id] : NULL);
213
- $element_first = (isset($_POST['wdform_'.$i."_element_first".$id]) ? $_POST['wdform_'.$i."_element_first".$id] : NULL);
214
- $element_last = (isset($_POST['wdform_'.$i."_element_last".$id]) ? $_POST['wdform_'.$i."_element_last".$id] : NULL);
215
- $element_middle = (isset($_POST['wdform_'.$i."_element_middle".$id]) ? $_POST['wdform_'.$i."_element_middle".$id] : NULL);
216
-
217
- if(isset($element_title))
218
- $value = $element_title . '@@@' . $element_first . '@@@' . $element_last . '@@@' . $element_middle;
219
- else
220
- $value = $element_first . '@@@' . $element_last;
221
-
222
- break;
223
- }
224
-
225
- case "type_file_upload": {
226
- break;
227
- }
228
-
229
- case 'type_address': {
230
- $value='*#*#*#';
231
- $element = (isset($_POST['wdform_'.$i."_street1".$id]) ? $_POST['wdform_'.$i."_street1".$id] : NULL);
232
- if($element) {
233
- $value = $element;
234
- break;
235
- }
236
-
237
- $element = (isset($_POST['wdform_'.$i."_street2".$id]) ? $_POST['wdform_'.$i."_street2".$id] : NULL);
238
- if($element) {
239
- $value = $element;
240
- break;
241
- }
242
-
243
- $element = (isset($_POST['wdform_'.$i."_city".$id]) ? $_POST['wdform_'.$i."_city".$id] : NULL);
244
- if(isset($element)) {
245
- $value = $element;
246
- break;
247
- }
248
-
249
- $element = (isset($_POST['wdform_'.$i."_state".$id]) ? $_POST['wdform_'.$i."_state".$id] : NULL);
250
- if(isset($element)) {
251
- $value = $element;
252
- break;
253
- }
254
-
255
- $element = (isset($_POST['wdform_'.$i."_postal".$id]) ? $_POST['wdform_'.$i."_postal".$id] : NULL);
256
- if(isset($element)) {
257
- $value = $element;
258
- break;
259
- }
260
-
261
- $element = (isset($_POST['wdform_'.$i."_country".$id]) ? $_POST['wdform_'.$i."_country".$id] : NULL);
262
- if(isset($element)) {
263
- $value = $element;
264
- break;
265
- }
266
-
267
- break;
268
- }
269
-
270
- case "type_hidden": {
271
- $value = (isset($_POST[$label_order_original[$key]]) ? $_POST[$label_order_original[$key]] : NULL);
272
- break;
273
- }
274
-
275
- case "type_radio": {
276
- $element = (isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : NULL);
277
- if(isset($element)) {
278
- $value = $element;
279
- break;
280
- }
281
-
282
- $value = (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL);
283
- break;
284
- }
285
-
286
- case "type_checkbox": {
287
- $start=-1;
288
- $value='';
289
- for($j=0; $j<100; $j++) {
290
-
291
- $element = (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL);
292
-
293
- if(isset($element)) {
294
- $start = $j;
295
- break;
296
- }
297
- }
298
-
299
- $other_element_id=-1;
300
- $is_other = (isset($_POST['wdform_'.$i."_allow_other".$id]) ? $_POST['wdform_'.$i."_allow_other".$id] : NULL);
301
- if($is_other == "yes") {
302
- $other_element_id = (isset($_POST['wdform_'.$i."_allow_other_num".$id]) ? $_POST['wdform_'.$i."_allow_other_num".$id] : NULL);
303
- }
304
-
305
- if($start!=-1) {
306
- for($j=$start; $j<100; $j++) {
307
- $element = (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL);
308
- if(isset($element))
309
- if($j == $other_element_id) {
310
- $value = $value . (isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : NULL) . '***br***';
311
- }
312
- else
313
- $value = $value . (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL) . '***br***';
314
- }
315
- }
316
-
317
- break;
318
- }
319
-
320
- case "type_paypal_price": {
321
- $value=0;
322
- if((isset($_POST['wdform_'.$i."_element_dollars".$id]) ? $_POST['wdform_'.$i."_element_dollars".$id] : NULL))
323
- $value = (isset($_POST['wdform_'.$i."_element_dollars".$id]) ? $_POST['wdform_'.$i."_element_dollars".$id] : NULL);
324
-
325
- $value = (int) preg_replace('/\D/', '', $value);
326
-
327
- if((isset($_POST['wdform_'.$i."_element_cents".$id]) ? $_POST['wdform_'.$i."_element_cents".$id] : NULL))
328
- $value = $value . '.' . ( preg_replace('/\D/', '', (isset($_POST['wdform_'.$i."_element_cents".$id]) ? $_POST['wdform_'.$i."_element_cents".$id] : NULL)));
329
-
330
-
331
- $value = $value;
332
- break;
333
- }
334
-
335
- case "type_paypal_select": {
336
-
337
- if((isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL))
338
- $value = (isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL) . ' : ' . (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL) . $form_currency;
339
- else
340
- $value = '';
341
-
342
- $element_quantity = (isset($_POST['wdform_'.$i."element_quantity".$id]) ? $_POST['wdform_'.$i."element_quantity".$id] : NULL);
343
- if(isset($element_quantity) && $value!='')
344
- $value .= '***br***' . (isset($_POST['wdform_'.$i."_element_quantity_label".$id]) ? $_POST['wdform_'.$i."_element_quantity_label".$id] : NULL) . ': ' . (isset($_POST['wdform_'.$i."_element_quantity".$id]) ? $_POST['wdform_'.$i."_element_quantity".$id] : NULL);
345
-
346
-
347
- for($k=0; $k<50; $k++) {
348
- $temp_val = (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL);
349
- if(isset($temp_val) && $value!='') {
350
- $value .= '***br***' . (isset($_POST['wdform_'.$i."_element_property_label".$id]) ? $_POST['wdform_'.$i."_element_property_label".$id] : NULL) . ': ' . (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL) . '***property***';
351
- }
352
- }
353
-
354
- break;
355
- }
356
-
357
- case "type_paypal_radio": {
358
-
359
- if((isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL))
360
- $value = (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL) . ' : ' . (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL) . $form_currency;
361
- else
362
- $value='';
363
-
364
-
365
- $element_quantity = (isset($_POST['wdform_'.$i."element_quantity".$id]) ? $_POST['wdform_'.$i."element_quantity".$id] : NULL);
366
- if(isset($element_quantity) && $value!='')
367
- $value .= '***br***' . (isset($_POST['wdform_'.$i."_element_quantity_label".$id]) ? $_POST['wdform_'.$i."_element_quantity_label".$id] : NULL) . ': ' . (isset($_POST['wdform_'.$i."_element_quantity".$id]) ? $_POST['wdform_'.$i."_element_quantity".$id] : NULL) . '***quantity***';
368
-
369
-
370
- for($k=0; $k<50; $k++) {
371
- $temp_val = (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL);
372
- if(isset($temp_val) && $value!='') {
373
-
374
- $value .= '***br***' . (isset($_POST['wdform_'.$i."_element_property_label".$id]) ? $_POST['wdform_'.$i."_element_property_label".$id] : NULL) . ': ' . (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL) . '***property***';
375
- }
376
- }
377
-
378
- break;
379
- }
380
-
381
- case "type_paypal_shipping": {
382
-
383
- if((isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL))
384
- $value = (isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL) . ' : ' . (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL) . $form_currency;
385
- else
386
- $value='';
387
- $value = (isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL) . ' - ' . (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL);
388
-
389
- $paypal['shipping'] = (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL);
390
-
391
- break;
392
- }
393
-
394
- case "type_paypal_checkbox": {
395
- $start=-1;
396
- $value='';
397
- for($j=0; $j<100; $j++) {
398
-
399
- $element = (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL);
400
-
401
- if(isset($element)) {
402
- $start=$j;
403
- break;
404
- }
405
- }
406
-
407
- $other_element_id = -1;
408
- $is_other = (isset($_POST['wdform_'.$i."_allow_other".$id]) ? $_POST['wdform_'.$i."_allow_other".$id] : NULL);
409
- if($is_other=="yes") {
410
- $other_element_id = (isset($_POST['wdform_'.$i."_allow_other_num".$id]) ? $_POST['wdform_'.$i."_allow_other_num".$id] : NULL);
411
- }
412
-
413
- if($start!=-1) {
414
- for($j=$start; $j<100; $j++) {
415
- $element = (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL);
416
- if(isset($element))
417
- if($j==$other_element_id) {
418
- $value = $value . (isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : NULL) . '***br***';
419
-
420
- }
421
- else {
422
-
423
- $value = $value . (isset($_POST['wdform_'.$i."_element".$id.$j."_label"]) ? $_POST['wdform_'.$i."_element".$id.$j."_label"] : NULL) . ' - ' . ((isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL) == '' ? '0' : (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL)) . $form_currency . '***br***';
424
-
425
- }
426
- }
427
-
428
- $element_quantity = (isset($_POST['wdform_'.$i."element_quantity".$id]) ? $_POST['wdform_'.$i."element_quantity".$id] : NULL);
429
- if(isset($element_quantity))
430
- $value .= (isset($_POST['wdform_'.$i."_element_quantity_label".$id]) ? $_POST['wdform_'.$i."_element_quantity_label".$id] : NULL) . ': '. (isset($_POST['wdform_'.$i."_element_quantity".$id]) ? $_POST['wdform_'.$i."_element_quantity".$id] : NULL) . '***quantity***';
431
-
432
- for($k=0; $k<50; $k++) {
433
- $temp_val = (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL);
434
- if(isset($temp_val)) {
435
-
436
- $value .= '***br***' . (isset($_POST['wdform_'.$i."_element_property_label".$id]) ? $_POST['wdform_'.$i."_element_property_label".$id] : NULL) . ': ' . (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL) . '***property***';
437
- }
438
- }
439
-
440
- }
441
-
442
-
443
- break;
444
- }
445
-
446
- case "type_star_rating": {
447
-
448
- if((isset($_POST['wdform_'.$i."_selected_star_amount".$id]) ? $_POST['wdform_'.$i."_selected_star_amount".$id] : NULL) == "")
449
- $selected_star_amount = 0;
450
- else {
451
- $selected_star_amount = (isset($_POST['wdform_'.$i."_selected_star_amount".$id]) ? $_POST['wdform_'.$i."_selected_star_amount".$id] : NULL);
452
- }
453
- $value = $selected_star_amount . '/' . (isset($_POST['wdform_'.$i."_star_amount".$id]) ? $_POST['wdform_'.$i."_star_amount".$id] : NULL);
454
- break;
455
- }
456
-
457
- case "type_scale_rating": {
458
-
459
- $value = (isset($_POST['wdform_'.$i."_scale_radio".$id]) ? $_POST['wdform_'.$i."_scale_radio".$id] : 0) . '/' . (isset($_POST['wdform_'.$i."_scale_amount".$id]) ? $_POST['wdform_'.$i."_scale_amount".$id] : NULL);
460
- break;
461
- }
462
-
463
- case "type_spinner": {
464
- $value = (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL);
465
-
466
- break;
467
- }
468
-
469
- case "type_slider": {
470
- $value = (isset($_POST['wdform_'.$i."_slider_value".$id]) ? $_POST['wdform_'.$i."_slider_value".$id] : NULL);
471
-
472
- break;
473
- }
474
- case "type_range": {
475
- $value = (isset($_POST['wdform_'.$i."_element".$id.'0']) ? $_POST['wdform_'.$i."_element".$id.'0'] : NULL) . '-' . (isset($_POST['wdform_'.$i."_element".$id.'1']) ? $_POST['wdform_'.$i."_element".$id.'1'] : NULL);
476
-
477
- break;
478
- }
479
- case "type_grading": {
480
- $value ="";
481
- $items = explode(":",(isset($_POST['wdform_'.$i."_hidden_item".$id]) ? $_POST['wdform_'.$i."_hidden_item".$id] : NULL));
482
- for($k=0; $k<sizeof($items)-1; $k++)
483
- $value .= (isset($_POST['wdform_'.$i."_element".$id.'_'.$k]) ? $_POST['wdform_'.$i."_element".$id.'_'.$k] : NULL) . ':';
484
-
485
- $value .= (isset($_POST['wdform_'.$i."_hidden_item".$id]) ? $_POST['wdform_'.$i."_hidden_item".$id] : NULL) . '***grading***';
486
-
487
- break;
488
- }
489
-
490
- case "type_matrix": {
491
-
492
- $rows_of_matrix = explode("***",(isset($_POST['wdform_'.$i."_hidden_row".$id]) ? $_POST['wdform_'.$i."_hidden_row".$id] : NULL));
493
- $rows_count = sizeof($rows_of_matrix)-1;
494
- $column_of_matrix = explode("***",(isset($_POST['wdform_'.$i."_hidden_column".$id]) ? $_POST['wdform_'.$i."_hidden_column".$id] : NULL));
495
- $columns_count = sizeof($column_of_matrix)-1;
496
-
497
-
498
- if((isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) == "radio") {
499
- $input_value="";
500
-
501
- for($k=1; $k<=$rows_count; $k++)
502
- $input_value .= (isset($_POST['wdform_'.$i."_input_element".$id.$k]) ? $_POST['wdform_'.$i."_input_element".$id.$k] : 0) ."***";
503
-
504
- }
505
- if((isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) == "checkbox") {
506
- $input_value="";
507
-
508
- for($k=1; $k<=$rows_count; $k++)
509
- for($j=1; $j<=$columns_count; $j++)
510
- $input_value .= (isset($_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j]) ? $_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j] : 0) . "***";
511
- }
512
-
513
- if((isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) == "text") {
514
- $input_value="";
515
- for($k=1; $k<=$rows_count; $k++)
516
- for($j=1; $j<=$columns_count; $j++)
517
- $input_value .= (isset($_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j]) ? $_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j] : NULL) . "***";
518
- }
519
-
520
- if((isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) == "select") {
521
- $input_value="";
522
- for($k=1; $k<=$rows_count; $k++)
523
- for($j=1; $j<=$columns_count; $j++)
524
- $input_value .= (isset($_POST['wdform_'.$i."_select_yes_no".$id.$k.'_'.$j]) ? $_POST['wdform_'.$i."_select_yes_no".$id.$k.'_'.$j] : NULL) . "***";
525
- }
526
-
527
- $value = $rows_count . (isset($_POST['wdform_'.$i."_hidden_row".$id]) ? $_POST['wdform_'.$i."_hidden_row".$id] : NULL) . '***' . $columns_count . (isset($_POST['wdform_'.$i."_hidden_column".$id]) ? $_POST['wdform_'.$i."_hidden_column".$id] : NULL) . '***' . (isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) . '***' . $input_value . '***matrix***';
528
-
529
- break;
530
- }
531
-
532
- }
533
-
534
- if($type == "type_address")
535
- if($value == '*#*#*#')
536
- continue;
537
-
538
-
539
- if($value) {
540
- $query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $group_id . "' AND element_label='" . $i . "'";
541
- $result = $wpdb->get_var($query);
542
-
543
- if($result) {
544
- $save = $wpdb->update($wpdb->prefix . "formmaker_submits", array(
545
- 'element_value' => stripslashes($value),
546
- ), array(
547
- 'group_id' => $group_id,
548
- 'element_label' => $i
549
- ), array(
550
- '%s',
551
- ), array(
552
- '%d',
553
- '%s'
554
- ));
555
- }
556
- else {
557
-
558
- $save = $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
559
- 'form_id' => $form_id,
560
- 'element_label' => $i,
561
- 'element_value' => stripslashes($value),
562
- 'group_id' => $group_id,
563
- 'date' => $date,
564
- 'ip' => $ip
565
- ), array(
566
- '%d',
567
- '%s',
568
- '%s',
569
- '%d',
570
- '%s',
571
- '%s'
572
- )
573
- );
574
-
575
-
576
- }
577
- }
578
-
579
-
580
-
581
- }
582
- }
583
-
584
- else {
585
-
586
- foreach ($label_id as $key => $label_id_1) {
587
- $element_value = (isset($_POST["submission_" . $label_id_1]) ? esc_html(stripslashes($_POST["submission_" . $label_id_1])) : " ");
588
- if (isset($_POST["submission_" . $label_id_1])) {
589
- $query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
590
- $result = $wpdb->get_var($query);
591
- if ($label_type[$key] == 'type_file_upload')
592
- if ($element_value)
593
- $element_value = $element_value . "*@@url@@*";
594
- if ($result) {
595
- $save = $wpdb->update($wpdb->prefix . "formmaker_submits", array(
596
- 'element_value' => stripslashes($element_value),
597
- ), array(
598
- 'group_id' => $id,
599
- 'element_label' => $label_id_1
600
- ), array(
601
- '%s',
602
- ), array(
603
- '%d',
604
- '%s'
605
- ));
606
- }
607
- else {
608
- $save = $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
609
- 'form_id' => $form_id,
610
- 'element_label' => $label_id_1,
611
- 'element_value' => stripslashes($element_value),
612
- 'group_id' => $id,
613
- 'date' => $date,
614
- 'ip' => $ip
615
- ), array(
616
- '%d',
617
- '%s',
618
- '%s',
619
- '%d',
620
- '%s',
621
- '%s'
622
- )
623
- );
624
- }
625
- }
626
- else {
627
- $element_value_ch = (isset($_POST["submission_" . $label_id_1 . '_0']) ? esc_html(stripslashes($_POST["submission_" . $label_id_1 . '_0'])) : " ");
628
- if (isset($_POST["submission_" . $label_id_1 . '_0'])) {
629
- for ($z = 0; $z < 21; $z++) {
630
- $element_value_ch = $_POST["submission_" . $label_id_1 . '_' . $z];
631
- if (isset($element_value_ch))
632
- $element_value = $element_value . $element_value_ch . '***br***';
633
- else
634
- break;
635
- }
636
- $query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
637
- $result = $wpdb->get_var($query);
638
- if ($result) {
639
- $query = "UPDATE " . $wpdb->prefix . "formmaker_submits SET `element_value`='" . stripslashes($element_value) . "' WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
640
- $save = $wpdb->update($wpdb->prefix . "formmaker_submits", array(
641
- 'element_value' => stripslashes($element_value),
642
- ), array(
643
- 'group_id' => $id,
644
- 'element_label' => $label_id_1
645
- ), array(
646
- '%s',
647
- ), array(
648
- '%d',
649
- '%s'
650
- ));
651
- }
652
- else {
653
- $query = "INSERT INTO " . $wpdb->prefix . "formmaker_submits (form_id, element_label, element_value, group_id, date, ip) VALUES('" . $form_id . "', '" . $label_id_1 . "', '" . stripslashes($element_value) . "','" . $id . "', '" . $date . "', '" . $ip . "')";
654
- $save = $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
655
- 'form_id' => $form_id,
656
- 'element_label' => $label_id_1,
657
- 'element_value' => stripslashes($element_value),
658
- 'group_id' => $id,
659
- 'date' => $date,
660
- 'ip' => $ip
661
- ), array(
662
- '%d',
663
- '%s',
664
- '%s',
665
- '%d',
666
- '%s',
667
- '%s'
668
- )
669
- );
670
- }
671
- }
672
- }
673
- }
674
- }
675
- if ($save !== FALSE) {
676
- echo WDW_FM_Library::message('Submission Succesfully Saved.', 'updated');
677
- }
678
- else {
679
- echo WDW_FM_Library::message('Error. Please install plugin again.', 'error');
680
- }
681
- }
682
-
683
- public function delete($id) {
684
- global $wpdb;
685
- $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
686
- $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id="%d"', $id);
687
- // $elements_col = $wpdb->get_col($wpdb->prepare('SELECT element_value FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id="%d"', $id));
688
- if ($wpdb->query($query)) {
689
- // foreach ($elements_col as $element_value) {
690
- // $destination = str_replace(site_url() . '/', '', $element_value);
691
- // $destination = str_replace('*@@url@@*', '', $destination);
692
- // if ($destination) {
693
- // $destination = ABSPATH . $destination;
694
- // if (file_exists($destination)) {
695
- // unlink($destination);
696
- // }
697
- // }
698
- // }
699
- echo WDW_FM_Library::message('Item Succesfully Deleted.', 'updated');
700
- }
701
- else {
702
- echo WDW_FM_Library::message('Error. Please install plugin again.', 'error');
703
- }
704
-
705
- $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_sessions WHERE form_id="%d" AND group_id="%d"', $form_id, $id);
706
- $wpdb->query($query);
707
-
708
- $this->display($form_id);
709
- }
710
-
711
- public function delete_all() {
712
- global $wpdb;
713
- $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
714
- $cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
715
- if (count($cid)) {
716
- array_walk($cid, create_function('&$value', '$value = (int)$value;'));
717
- $cids = implode(',', $cid);
718
- $query = 'DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( ' . $cids . ' )';
719
- // $elements_col = $wpdb->get_col('SELECT element_value FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( ' . $cids . ' )');
720
- if ($wpdb->query($query)) {
721
-
722
- echo WDW_FM_Library::message('Items Succesfully Deleted.', 'updated');
723
- }
724
- else {
725
- echo WDW_FM_Library::message('Error. Please install plugin again.', 'error');
726
- }
727
-
728
- $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_sessions WHERE form_id="%d" AND group_id IN ( "%s" )', $form_id, $cids );
729
- $wpdb->query($query);
730
- }
731
- else {
732
- echo WDW_FM_Library::message('You must select at least one item.', 'error');
733
- }
734
- $this->display($form_id);
735
- }
736
-
737
- public function block_ip() {
738
- global $wpdb;
739
- $flag = FALSE;
740
- $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
741
- $cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
742
- if (count($cid)) {
743
- array_walk($cid, create_function('&$value', '$value = (int)$value;'));
744
- $cids = implode(',', $cid);
745
- $query = 'SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( '. $cids .' )';
746
- $rows = $wpdb->get_results($query);
747
- foreach ($rows as $row) {
748
- $ips = $wpdb->get_var($wpdb->prepare('SELECT ip FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $row->ip));
749
- $flag = TRUE;
750
- if (!$ips) {
751
- $save = $wpdb->insert($wpdb->prefix . 'formmaker_blocked', array(
752
- 'ip' => $row->ip,
753
- ), array(
754
- '%s',
755
- ));
756
- }
757
- }
758
- }
759
- if ($flag) {
760
- echo WDW_FM_Library::message('IPs Succesfully Blocked.', 'updated');
761
- }
762
- else {
763
- echo WDW_FM_Library::message('You must select at least one item.', 'error');
764
- }
765
- $this->display($form_id);
766
- }
767
-
768
- public function unblock_ip() {
769
- global $wpdb;
770
- $flag = FALSE;
771
- $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
772
- $cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
773
- if (count($cid)) {
774
- array_walk($cid, create_function('&$value', '$value = (int)$value;'));
775
- $cids = implode(',', $cid);
776
- $query = 'SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( '. $cids .' )';
777
- $rows = $wpdb->get_results($query);
778
- foreach ($rows as $row) {
779
- $flag = TRUE;
780
- $ips = $wpdb->get_var($wpdb->prepare('SELECT ip FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $row->ip));
781
- if ($ips) {
782
- $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $ips));
783
- }
784
- }
785
- }
786
- if ($flag) {
787
- echo WDW_FM_Library::message('IPs Succesfully Unblocked.', 'updated');
788
- }
789
- else {
790
- echo WDW_FM_Library::message('You must select at least one item.', 'error');
791
- }
792
- $this->display($form_id);
793
- }
794
-
795
- ////////////////////////////////////////////////////////////////////////////////////////
796
- // Getters & Setters //
797
- ////////////////////////////////////////////////////////////////////////////////////////
798
- ////////////////////////////////////////////////////////////////////////////////////////
799
- // Private Methods //
800
- ////////////////////////////////////////////////////////////////////////////////////////
801
- ////////////////////////////////////////////////////////////////////////////////////////
802
- // Listeners //
803
- ////////////////////////////////////////////////////////////////////////////////////////
804
  }
1
+ <?php
2
+
3
+ class FMControllerSubmissions_fm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $task = ((isset($_POST['task'])) ? esc_html($_POST['task']) : '');
23
+ $id = ((isset($_POST['current_id'])) ? (int)esc_html($_POST['current_id']) : 0);
24
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
25
+
26
+ if (method_exists($this, $task)) {
27
+ if($task != 'show_stats')
28
+ check_admin_referer('nonce_fm', 'nonce_fm');
29
+ else
30
+ check_ajax_referer('nonce_fm_ajax', 'nonce_fm_ajax');
31
+ $this->$task($id);
32
+ }
33
+ else {
34
+ $this->display($form_id);
35
+ }
36
+ }
37
+
38
+ public function display($form_id) {
39
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
40
+ require_once WD_FM_DIR . "/admin/models/FMModelSubmissions_fm.php";
41
+ $model = new FMModelSubmissions_fm();
42
+
43
+ require_once WD_FM_DIR . "/admin/views/FMViewSubmissions_fm.php";
44
+ $view = new FMViewSubmissions_fm($model);
45
+ $view->display($form_id);
46
+ }
47
+
48
+ public function show_stats() {
49
+
50
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
51
+ require_once WD_FM_DIR . "/admin/models/FMModelSubmissions_fm.php";
52
+ $model = new FMModelSubmissions_fm();
53
+
54
+ require_once WD_FM_DIR . "/admin/views/FMViewSubmissions_fm.php";
55
+ $view = new FMViewSubmissions_fm($model);
56
+ $view->show_stats($form_id);
57
+ }
58
+
59
+ public function edit() {
60
+ global $wpdb;
61
+ require_once WD_FM_DIR . "/admin/models/FMModelSubmissions_fm.php";
62
+ $model = new FMModelSubmissions_fm();
63
+
64
+ require_once WD_FM_DIR . "/admin/views/FMViewSubmissions_fm.php";
65
+ $view = new FMViewSubmissions_fm($model);
66
+ $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? (int) $_POST['current_id'] : 0);
67
+
68
+ $form_id = (int)$wpdb->get_var("SELECT form_id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "'");
69
+ $form = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id='" . $form_id . "'");
70
+
71
+ if (isset($form->form)) {
72
+ $old = TRUE;
73
+ }
74
+ else {
75
+ $old = FALSE;
76
+ }
77
+
78
+ if ($old == FALSE || ($old == TRUE && $form->form == '')) {
79
+ $view->new_edit($id, $form_id);
80
+ }
81
+ else {
82
+ $view->edit($id);
83
+ }
84
+ }
85
+
86
+ public function save() {
87
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
88
+ $this->save_db();
89
+ $this->display($form_id);
90
+ }
91
+
92
+ public function apply() {
93
+ $this->save_db();
94
+ $this->edit();
95
+ }
96
+
97
+ public function save_db() {
98
+ global $wpdb;
99
+ $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes( $_POST['current_id'])) : 0);
100
+ $group_id = $id;
101
+ $date = esc_html($_POST['date']);
102
+ $ip = esc_html($_POST['ip']);
103
+ $form_id = (int)$wpdb->get_var("SELECT form_id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "'");
104
+ $form = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id='" . $form_id . "'");
105
+ $label_id = array();
106
+ $label_order_original = array();
107
+ $label_type = array();
108
+ $old = false;
109
+ $form_currency = '$';
110
+
111
+ if (strpos($form->label_order, 'type_paypal_')) {
112
+ $form->label_order = $form->label_order."0#**id**#Payment Status#**label**#type_paypal_payment_status#****#";
113
+ }
114
+ $label_all = explode('#****#', $form->label_order);
115
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
116
+ foreach ($label_all as $key => $label_each) {
117
+ $label_id_each = explode('#**id**#', $label_each);
118
+ array_push($label_id, $label_id_each[0]);
119
+ $label_oder_each = explode('#**label**#', $label_id_each[1]);
120
+ array_push($label_order_original, $label_oder_each[0]);
121
+ array_push($label_type, $label_oder_each[1]);
122
+ }
123
+
124
+ if(isset($form->form))
125
+ $old = true;
126
+
127
+ if($old == false || ($old == true && $form->form=='')) {
128
+
129
+ foreach($label_type as $key => $type) {
130
+
131
+ $value='';
132
+ if($type=="type_submit_reset" or $type=="type_map" or $type=="type_editor" or $type=="type_captcha" or $type=="type_recaptcha" or $type=="type_button" or $type=="type_paypal_total")
133
+ continue;
134
+
135
+ $i=$label_id[$key];
136
+ $id = 'form_id_temp';
137
+ switch ($type) {
138
+
139
+ case 'type_text':
140
+ case 'type_password':
141
+ case 'type_textarea':
142
+ case "type_submitter_mail":
143
+ case "type_date":
144
+ case "type_own_select":
145
+ case "type_country":
146
+ case "type_number": {
147
+ $value = (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL);
148
+ break;
149
+ }
150
+ case "type_wdeditor": {
151
+ $value = (isset($_POST['wdform_'.$i.'_wd_editor'.$id]) ? $_POST['wdform_'.$i.'_wd_editor'.$id] : NULL);
152
+ break;
153
+ }
154
+ case "type_mark_map": {
155
+ $long = (isset($_POST['wdform_'.$i."_long".$id]) ? $_POST['wdform_'.$i."_long".$id] : NULL);
156
+ $lat = (isset($_POST['wdform_'.$i."_lat".$id]) ? $_POST['wdform_'.$i."_lat".$id] : NULL);
157
+ if($long and $lat)
158
+ $value = $long . '***map***' . $lat;
159
+
160
+ break;
161
+ }
162
+
163
+ case "type_date_new":{
164
+ $value = isset($_POST['wdform_'.$i."_element".$id]) ? esc_html($_POST['wdform_'.$i."_element".$id]) : "";
165
+
166
+ break;
167
+ }
168
+
169
+ case "type_date_range":{
170
+ $value = (isset($_POST['wdform_'.$i."_element".$id."0"]) ? esc_html($_POST['wdform_'.$i."_element".$id."0"]) : "").' - '.(isset($_POST['wdform_'.$i."_element".$id."1"]) ? esc_html($_POST['wdform_'.$i."_element".$id."1"]) : "");
171
+
172
+ break;
173
+ }
174
+
175
+ case "type_date_fields": {
176
+ $day = (isset($_POST['wdform_'.$i."_day".$id]) ? $_POST['wdform_'.$i."_day".$id] : NULL);
177
+ $month = (isset($_POST['wdform_'.$i."_month".$id]) ? $_POST['wdform_'.$i."_month".$id] : NULL);
178
+ $year = (isset($_POST['wdform_'.$i."_year".$id]) ? $_POST['wdform_'.$i."_year".$id] : NULL);
179
+ if($day or $month or $year)
180
+ $value = $day . '-' . $month . '-' . $year;
181
+ break;
182
+ }
183
+
184
+ case "type_time": {
185
+ $ss = (isset($_POST['wdform_'.$i."_ss".$id]) ? $_POST['wdform_'.$i."_ss".$id] : NULL);
186
+ $hh = (isset($_POST['wdform_'.$i."_hh".$id]) ? $_POST['wdform_'.$i."_hh".$id] : NULL);
187
+ $mm = (isset($_POST['wdform_'.$i."_mm".$id]) ? $_POST['wdform_'.$i."_mm".$id] : NULL);
188
+
189
+ if(isset($ss))
190
+ $value = $hh .':'. $mm .':' . $ss;
191
+ else
192
+ $value = $hh .':' . $mm;
193
+
194
+ $am_pm = (isset($_POST['wdform_'.$i."_am_pm".$id]) ? $_POST['wdform_'.$i."_am_pm".$id] : NULL);
195
+ if(isset($am_pm))
196
+ $value = $value . ' ' . $am_pm;
197
+
198
+ break;
199
+ }
200
+
201
+ case "type_phone": {
202
+ $first = (isset($_POST['wdform_'.$i."_element_first".$id]) ? $_POST['wdform_'.$i."_element_first".$id] : NULL);
203
+ $last = (isset($_POST['wdform_'.$i."_element_last".$id]) ? $_POST['wdform_'.$i."_element_last".$id] : NULL);
204
+ if($first or $last)
205
+ $value = $first . ' ' . $last;
206
+
207
+ break;
208
+ }
209
+
210
+ case "type_name": {
211
+
212
+ $element_title = (isset($_POST['wdform_'.$i."_element_title".$id]) ? $_POST['wdform_'.$i."_element_title".$id] : NULL);
213
+ $element_first = (isset($_POST['wdform_'.$i."_element_first".$id]) ? $_POST['wdform_'.$i."_element_first".$id] : NULL);
214
+ $element_last = (isset($_POST['wdform_'.$i."_element_last".$id]) ? $_POST['wdform_'.$i."_element_last".$id] : NULL);
215
+ $element_middle = (isset($_POST['wdform_'.$i."_element_middle".$id]) ? $_POST['wdform_'.$i."_element_middle".$id] : NULL);
216
+
217
+ if(isset($element_title))
218
+ $value = $element_title . '@@@' . $element_first . '@@@' . $element_last . '@@@' . $element_middle;
219
+ else
220
+ $value = $element_first . '@@@' . $element_last;
221
+
222
+ break;
223
+ }
224
+
225
+ case "type_file_upload": {
226
+ break;
227
+ }
228
+
229
+ case 'type_address': {
230
+ $value='*#*#*#';
231
+ $element = (isset($_POST['wdform_'.$i."_street1".$id]) ? $_POST['wdform_'.$i."_street1".$id] : NULL);
232
+ if($element) {
233
+ $value = $element;
234
+ break;
235
+ }
236
+
237
+ $element = (isset($_POST['wdform_'.$i."_street2".$id]) ? $_POST['wdform_'.$i."_street2".$id] : NULL);
238
+ if($element) {
239
+ $value = $element;
240
+ break;
241
+ }
242
+
243
+ $element = (isset($_POST['wdform_'.$i."_city".$id]) ? $_POST['wdform_'.$i."_city".$id] : NULL);
244
+ if(isset($element)) {
245
+ $value = $element;
246
+ break;
247
+ }
248
+
249
+ $element = (isset($_POST['wdform_'.$i."_state".$id]) ? $_POST['wdform_'.$i."_state".$id] : NULL);
250
+ if(isset($element)) {
251
+ $value = $element;
252
+ break;
253
+ }
254
+
255
+ $element = (isset($_POST['wdform_'.$i."_postal".$id]) ? $_POST['wdform_'.$i."_postal".$id] : NULL);
256
+ if(isset($element)) {
257
+ $value = $element;
258
+ break;
259
+ }
260
+
261
+ $element = (isset($_POST['wdform_'.$i."_country".$id]) ? $_POST['wdform_'.$i."_country".$id] : NULL);
262
+ if(isset($element)) {
263
+ $value = $element;
264
+ break;
265
+ }
266
+
267
+ break;
268
+ }
269
+
270
+ case "type_hidden": {
271
+ $value = (isset($_POST[$label_order_original[$key]]) ? $_POST[$label_order_original[$key]] : NULL);
272
+ break;
273
+ }
274
+
275
+ case "type_radio": {
276
+ $element = (isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : NULL);
277
+ if(isset($element)) {
278
+ $value = $element;
279
+ break;
280
+ }
281
+
282
+ $value = (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL);
283
+ break;
284
+ }
285
+
286
+ case "type_checkbox": {
287
+ $start=-1;
288
+ $value='';
289
+ for($j=0; $j<100; $j++) {
290
+
291
+ $element = (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL);
292
+
293
+ if(isset($element)) {
294
+ $start = $j;
295
+ break;
296
+ }
297
+ }
298
+
299
+ $other_element_id=-1;
300
+ $is_other = (isset($_POST['wdform_'.$i."_allow_other".$id]) ? $_POST['wdform_'.$i."_allow_other".$id] : NULL);
301
+ if($is_other == "yes") {
302
+ $other_element_id = (isset($_POST['wdform_'.$i."_allow_other_num".$id]) ? $_POST['wdform_'.$i."_allow_other_num".$id] : NULL);
303
+ }
304
+
305
+ if($start!=-1) {
306
+ for($j=$start; $j<100; $j++) {
307
+ $element = (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL);
308
+ if(isset($element))
309
+ if($j == $other_element_id) {
310
+ $value = $value . (isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : NULL) . '***br***';
311
+ }
312
+ else
313
+ $value = $value . (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL) . '***br***';
314
+ }
315
+ }
316
+
317
+ break;
318
+ }
319
+
320
+ case "type_paypal_price": {
321
+ $value=0;
322
+ if((isset($_POST['wdform_'.$i."_element_dollars".$id]) ? $_POST['wdform_'.$i."_element_dollars".$id] : NULL))
323
+ $value = (isset($_POST['wdform_'.$i."_element_dollars".$id]) ? $_POST['wdform_'.$i."_element_dollars".$id] : NULL);
324
+
325
+ $value = (int) preg_replace('/\D/', '', $value);
326
+
327
+ if((isset($_POST['wdform_'.$i."_element_cents".$id]) ? $_POST['wdform_'.$i."_element_cents".$id] : NULL))
328
+ $value = $value . '.' . ( preg_replace('/\D/', '', (isset($_POST['wdform_'.$i."_element_cents".$id]) ? $_POST['wdform_'.$i."_element_cents".$id] : NULL)));
329
+
330
+
331
+ $value = $value;
332
+ break;
333
+ }
334
+
335
+ case "type_paypal_select": {
336
+
337
+ if((isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL))
338
+ $value = (isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL) . ' : ' . (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL) . $form_currency;
339
+ else
340
+ $value = '';
341
+
342
+ $element_quantity = (isset($_POST['wdform_'.$i."element_quantity".$id]) ? $_POST['wdform_'.$i."element_quantity".$id] : NULL);
343
+ if(isset($element_quantity) && $value!='')
344
+ $value .= '***br***' . (isset($_POST['wdform_'.$i."_element_quantity_label".$id]) ? $_POST['wdform_'.$i."_element_quantity_label".$id] : NULL) . ': ' . (isset($_POST['wdform_'.$i."_element_quantity".$id]) ? $_POST['wdform_'.$i."_element_quantity".$id] : NULL);
345
+
346
+
347
+ for($k=0; $k<50; $k++) {
348
+ $temp_val = (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL);
349
+ if(isset($temp_val) && $value!='') {
350
+ $value .= '***br***' . (isset($_POST['wdform_'.$i."_element_property_label".$id]) ? $_POST['wdform_'.$i."_element_property_label".$id] : NULL) . ': ' . (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL) . '***property***';
351
+ }
352
+ }
353
+
354
+ break;
355
+ }
356
+
357
+ case "type_paypal_radio": {
358
+
359
+ if((isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL))
360
+ $value = (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL) . ' : ' . (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL) . $form_currency;
361
+ else
362
+ $value='';
363
+
364
+
365
+ $element_quantity = (isset($_POST['wdform_'.$i."element_quantity".$id]) ? $_POST['wdform_'.$i."element_quantity".$id] : NULL);
366
+ if(isset($element_quantity) && $value!='')
367
+ $value .= '***br***' . (isset($_POST['wdform_'.$i."_element_quantity_label".$id]) ? $_POST['wdform_'.$i."_element_quantity_label".$id] : NULL) . ': ' . (isset($_POST['wdform_'.$i."_element_quantity".$id]) ? $_POST['wdform_'.$i."_element_quantity".$id] : NULL) . '***quantity***';
368
+
369
+
370
+ for($k=0; $k<50; $k++) {
371
+ $temp_val = (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL);
372
+ if(isset($temp_val) && $value!='') {
373
+
374
+ $value .= '***br***' . (isset($_POST['wdform_'.$i."_element_property_label".$id]) ? $_POST['wdform_'.$i."_element_property_label".$id] : NULL) . ': ' . (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL) . '***property***';
375
+ }
376
+ }
377
+
378
+ break;
379
+ }
380
+
381
+ case "type_paypal_shipping": {
382
+
383
+ if((isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL))
384
+ $value = (isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL) . ' : ' . (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL) . $form_currency;
385
+ else
386
+ $value='';
387
+ $value = (isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL) . ' - ' . (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL);
388
+
389
+ $paypal['shipping'] = (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL);
390
+
391
+ break;
392
+ }
393
+
394
+ case "type_paypal_checkbox": {
395
+ $start=-1;
396
+ $value='';
397
+ for($j=0; $j<100; $j++) {
398
+
399
+ $element = (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL);
400
+
401
+ if(isset($element)) {
402
+ $start=$j;
403
+ break;
404
+ }
405
+ }
406
+
407
+ $other_element_id = -1;
408
+ $is_other = (isset($_POST['wdform_'.$i."_allow_other".$id]) ? $_POST['wdform_'.$i."_allow_other".$id] : NULL);
409
+ if($is_other=="yes") {
410
+ $other_element_id = (isset($_POST['wdform_'.$i."_allow_other_num".$id]) ? $_POST['wdform_'.$i."_allow_other_num".$id] : NULL);
411
+ }
412
+
413
+ if($start!=-1) {
414
+ for($j=$start; $j<100; $j++) {
415
+ $element = (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL);
416
+ if(isset($element))
417
+ if($j==$other_element_id) {
418
+ $value = $value . (isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : NULL) . '***br***';
419
+
420
+ }
421
+ else {
422
+
423
+ $value = $value . (isset($_POST['wdform_'.$i."_element".$id.$j."_label"]) ? $_POST['wdform_'.$i."_element".$id.$j."_label"] : NULL) . ' - ' . ((isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL) == '' ? '0' : (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL)) . $form_currency . '***br***';
424
+
425
+ }
426
+ }
427
+
428
+ $element_quantity = (isset($_POST['wdform_'.$i."element_quantity".$id]) ? $_POST['wdform_'.$i."element_quantity".$id] : NULL);
429
+ if(isset($element_quantity))
430
+ $value .= (isset($_POST['wdform_'.$i."_element_quantity_label".$id]) ? $_POST['wdform_'.$i."_element_quantity_label".$id] : NULL) . ': '. (isset($_POST['wdform_'.$i."_element_quantity".$id]) ? $_POST['wdform_'.$i."_element_quantity".$id] : NULL) . '***quantity***';
431
+
432
+ for($k=0; $k<50; $k++) {
433
+ $temp_val = (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL);
434
+ if(isset($temp_val)) {
435
+
436
+ $value .= '***br***' . (isset($_POST['wdform_'.$i."_element_property_label".$id]) ? $_POST['wdform_'.$i."_element_property_label".$id] : NULL) . ': ' . (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL) . '***property***';
437
+ }
438
+ }
439
+
440
+ }
441
+
442
+
443
+ break;
444
+ }
445
+
446
+ case "type_star_rating": {
447
+
448
+ if((isset($_POST['wdform_'.$i."_selected_star_amount".$id]) ? $_POST['wdform_'.$i."_selected_star_amount".$id] : NULL) == "")
449
+ $selected_star_amount = 0;
450
+ else {
451
+ $selected_star_amount = (isset($_POST['wdform_'.$i."_selected_star_amount".$id]) ? $_POST['wdform_'.$i."_selected_star_amount".$id] : NULL);
452
+ }
453
+ $value = $selected_star_amount . '/' . (isset($_POST['wdform_'.$i."_star_amount".$id]) ? $_POST['wdform_'.$i."_star_amount".$id] : NULL);
454
+ break;
455
+ }
456
+
457
+ case "type_scale_rating": {
458
+
459
+ $value = (isset($_POST['wdform_'.$i."_scale_radio".$id]) ? $_POST['wdform_'.$i."_scale_radio".$id] : 0) . '/' . (isset($_POST['wdform_'.$i."_scale_amount".$id]) ? $_POST['wdform_'.$i."_scale_amount".$id] : NULL);
460
+ break;
461
+ }
462
+
463
+ case "type_spinner": {
464
+ $value = (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL);
465
+
466
+ break;
467
+ }
468
+
469
+ case "type_slider": {
470
+ $value = (isset($_POST['wdform_'.$i."_slider_value".$id]) ? $_POST['wdform_'.$i."_slider_value".$id] : NULL);
471
+
472
+ break;
473
+ }
474
+ case "type_range": {
475
+ $value = (isset($_POST['wdform_'.$i."_element".$id.'0']) ? $_POST['wdform_'.$i."_element".$id.'0'] : NULL) . '-' . (isset($_POST['wdform_'.$i."_element".$id.'1']) ? $_POST['wdform_'.$i."_element".$id.'1'] : NULL);
476
+
477
+ break;
478
+ }
479
+ case "type_grading": {
480
+ $value ="";
481
+ $items = explode(":",(isset($_POST['wdform_'.$i."_hidden_item".$id]) ? $_POST['wdform_'.$i."_hidden_item".$id] : NULL));
482
+ for($k=0; $k<sizeof($items)-1; $k++)
483
+ $value .= (isset($_POST['wdform_'.$i."_element".$id.'_'.$k]) ? $_POST['wdform_'.$i."_element".$id.'_'.$k] : NULL) . ':';
484
+
485
+ $value .= (isset($_POST['wdform_'.$i."_hidden_item".$id]) ? $_POST['wdform_'.$i."_hidden_item".$id] : NULL) . '***grading***';
486
+
487
+ break;
488
+ }
489
+
490
+ case "type_matrix": {
491
+
492
+ $rows_of_matrix = explode("***",(isset($_POST['wdform_'.$i."_hidden_row".$id]) ? $_POST['wdform_'.$i."_hidden_row".$id] : NULL));
493
+ $rows_count = sizeof($rows_of_matrix)-1;
494
+ $column_of_matrix = explode("***",(isset($_POST['wdform_'.$i."_hidden_column".$id]) ? $_POST['wdform_'.$i."_hidden_column".$id] : NULL));
495
+ $columns_count = sizeof($column_of_matrix)-1;
496
+
497
+
498
+ if((isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) == "radio") {
499
+ $input_value="";
500
+
501
+ for($k=1; $k<=$rows_count; $k++)
502
+ $input_value .= (isset($_POST['wdform_'.$i."_input_element".$id.$k]) ? $_POST['wdform_'.$i."_input_element".$id.$k] : 0) ."***";
503
+
504
+ }
505
+ if((isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) == "checkbox") {
506
+ $input_value="";
507
+
508
+ for($k=1; $k<=$rows_count; $k++)
509
+ for($j=1; $j<=$columns_count; $j++)
510
+ $input_value .= (isset($_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j]) ? $_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j] : 0) . "***";
511
+ }
512
+
513
+ if((isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) == "text") {
514
+ $input_value="";
515
+ for($k=1; $k<=$rows_count; $k++)
516
+ for($j=1; $j<=$columns_count; $j++)
517
+ $input_value .= (isset($_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j]) ? $_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j] : NULL) . "***";
518
+ }
519
+
520
+ if((isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) == "select") {
521
+ $input_value="";
522
+ for($k=1; $k<=$rows_count; $k++)
523
+ for($j=1; $j<=$columns_count; $j++)
524
+ $input_value .= (isset($_POST['wdform_'.$i."_select_yes_no".$id.$k.'_'.$j]) ? $_POST['wdform_'.$i."_select_yes_no".$id.$k.'_'.$j] : NULL) . "***";
525
+ }
526
+
527
+ $value = $rows_count . (isset($_POST['wdform_'.$i."_hidden_row".$id]) ? $_POST['wdform_'.$i."_hidden_row".$id] : NULL) . '***' . $columns_count . (isset($_POST['wdform_'.$i."_hidden_column".$id]) ? $_POST['wdform_'.$i."_hidden_column".$id] : NULL) . '***' . (isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) . '***' . $input_value . '***matrix***';
528
+
529
+ break;
530
+ }
531
+
532
+ }
533
+
534
+ if($type == "type_address")
535
+ if($value == '*#*#*#')
536
+ continue;
537
+
538
+
539
+ if($value) {
540
+ $query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $group_id . "' AND element_label='" . $i . "'";
541
+ $result = $wpdb->get_var($query);
542
+
543
+ if($result) {
544
+ $save = $wpdb->update($wpdb->prefix . "formmaker_submits", array(
545
+ 'element_value' => stripslashes($value),
546
+ ), array(
547
+ 'group_id' => $group_id,
548
+ 'element_label' => $i
549
+ ), array(
550
+ '%s',
551
+ ), array(
552
+ '%d',
553
+ '%s'
554
+ ));
555
+ }
556
+ else {
557
+
558
+ $save = $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
559
+ 'form_id' => $form_id,
560
+ 'element_label' => $i,
561
+ 'element_value' => stripslashes($value),
562
+ 'group_id' => $group_id,
563
+ 'date' => $date,
564
+ 'ip' => $ip
565
+ ), array(
566
+ '%d',
567
+ '%s',
568
+ '%s',
569
+ '%d',
570
+ '%s',
571
+ '%s'
572
+ )
573
+ );
574
+
575
+
576
+ }
577
+ }
578
+
579
+
580
+
581
+ }
582
+ }
583
+
584
+ else {
585
+
586
+ foreach ($label_id as $key => $label_id_1) {
587
+ $element_value = (isset($_POST["submission_" . $label_id_1]) ? esc_html(stripslashes($_POST["submission_" . $label_id_1])) : " ");
588
+ if (isset($_POST["submission_" . $label_id_1])) {
589
+ $query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
590
+ $result = $wpdb->get_var($query);
591
+ if ($label_type[$key] == 'type_file_upload')
592
+ if ($element_value)
593
+ $element_value = $element_value . "*@@url@@*";
594
+ if ($result) {
595
+ $save = $wpdb->update($wpdb->prefix . "formmaker_submits", array(
596
+ 'element_value' => stripslashes($element_value),
597
+ ), array(
598
+ 'group_id' => $id,
599
+ 'element_label' => $label_id_1
600
+ ), array(
601
+ '%s',
602
+ ), array(
603
+ '%d',
604
+ '%s'
605
+ ));
606
+ }
607
+ else {
608
+ $save = $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
609
+ 'form_id' => $form_id,
610
+ 'element_label' => $label_id_1,
611
+ 'element_value' => stripslashes($element_value),
612
+ 'group_id' => $id,
613
+ 'date' => $date,
614
+ 'ip' => $ip
615
+ ), array(
616
+ '%d',
617
+ '%s',
618
+ '%s',
619
+ '%d',
620
+ '%s',
621
+ '%s'
622
+ )
623
+ );
624
+ }
625
+ }
626
+ else {
627
+ $element_value_ch = (isset($_POST["submission_" . $label_id_1 . '_0']) ? esc_html(stripslashes($_POST["submission_" . $label_id_1 . '_0'])) : " ");
628
+ if (isset($_POST["submission_" . $label_id_1 . '_0'])) {
629
+ for ($z = 0; $z < 21; $z++) {
630
+ $element_value_ch = $_POST["submission_" . $label_id_1 . '_' . $z];
631
+ if (isset($element_value_ch))
632
+ $element_value = $element_value . $element_value_ch . '***br***';
633
+ else
634
+ break;
635
+ }
636
+ $query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
637
+ $result = $wpdb->get_var($query);
638
+ if ($result) {
639
+ $query = "UPDATE " . $wpdb->prefix . "formmaker_submits SET `element_value`='" . stripslashes($element_value) . "' WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
640
+ $save = $wpdb->update($wpdb->prefix . "formmaker_submits", array(
641
+ 'element_value' => stripslashes($element_value),
642
+ ), array(
643
+ 'group_id' => $id,
644
+ 'element_label' => $label_id_1
645
+ ), array(
646
+ '%s',
647
+ ), array(
648
+ '%d',
649
+ '%s'
650
+ ));
651
+ }
652
+ else {
653
+ $query = "INSERT INTO " . $wpdb->prefix . "formmaker_submits (form_id, element_label, element_value, group_id, date, ip) VALUES('" . $form_id . "', '" . $label_id_1 . "', '" . stripslashes($element_value) . "','" . $id . "', '" . $date . "', '" . $ip . "')";
654
+ $save = $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
655
+ 'form_id' => $form_id,
656
+ 'element_label' => $label_id_1,
657
+ 'element_value' => stripslashes($element_value),
658
+ 'group_id' => $id,
659
+ 'date' => $date,
660
+ 'ip' => $ip
661
+ ), array(
662
+ '%d',
663
+ '%s',
664
+ '%s',
665
+ '%d',
666
+ '%s',
667
+ '%s'
668
+ )
669
+ );
670
+ }
671
+ }
672
+ }
673
+ }
674
+ }
675
+ if ($save !== FALSE) {
676
+ echo WDW_FM_Library::message('Submission Succesfully Saved.', 'updated');
677
+ }
678
+ else {
679
+ echo WDW_FM_Library::message('Error. Please install plugin again.', 'error');
680
+ }
681
+ }
682
+
683
+ public function delete($id) {
684
+ global $wpdb;
685
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
686
+ $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id="%d"', $id);
687
+ // $elements_col = $wpdb->get_col($wpdb->prepare('SELECT element_value FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id="%d"', $id));
688
+ if ($wpdb->query($query)) {
689
+ // foreach ($elements_col as $element_value) {
690
+ // $destination = str_replace(site_url() . '/', '', $element_value);
691
+ // $destination = str_replace('*@@url@@*', '', $destination);
692
+ // if ($destination) {
693
+ // $destination = ABSPATH . $destination;
694
+ // if (file_exists($destination)) {
695
+ // unlink($destination);
696
+ // }
697
+ // }
698
+ // }
699
+ echo WDW_FM_Library::message('Item Succesfully Deleted.', 'updated');
700
+ }
701
+ else {
702
+ echo WDW_FM_Library::message('Error. Please install plugin again.', 'error');
703
+ }
704
+
705
+ $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_sessions WHERE form_id="%d" AND group_id="%d"', $form_id, $id);
706
+ $wpdb->query($query);
707
+
708
+ $this->display($form_id);
709
+ }
710
+
711
+ public function delete_all() {
712
+ global $wpdb;
713
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
714
+ $cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
715
+ if (count($cid)) {
716
+ array_walk($cid, create_function('&$value', '$value = (int)$value;'));
717
+ $cids = implode(',', $cid);
718
+ $query = 'DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( ' . $cids . ' )';
719
+ // $elements_col = $wpdb->get_col('SELECT element_value FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( ' . $cids . ' )');
720
+ if ($wpdb->query($query)) {
721
+
722
+ echo WDW_FM_Library::message('Items Succesfully Deleted.', 'updated');
723
+ }
724
+ else {
725
+ echo WDW_FM_Library::message('Error. Please install plugin again.', 'error');
726
+ }
727
+
728
+ $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_sessions WHERE form_id="%d" AND group_id IN ( "%s" )', $form_id, $cids );
729
+ $wpdb->query($query);
730
+ }
731
+ else {
732
+ echo WDW_FM_Library::message('You must select at least one item.', 'error');
733
+ }
734
+ $this->display($form_id);
735
+ }
736
+
737
+ public function block_ip() {
738
+ global $wpdb;
739
+ $flag = FALSE;
740
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
741
+ $cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
742
+ if (count($cid)) {
743
+ array_walk($cid, create_function('&$value', '$value = (int)$value;'));
744
+ $cids = implode(',', $cid);
745
+ $query = 'SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( '. $cids .' )';
746
+ $rows = $wpdb->get_results($query);
747
+ foreach ($rows as $row) {
748
+ $ips = $wpdb->get_var($wpdb->prepare('SELECT ip FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $row->ip));
749
+ $flag = TRUE;
750
+ if (!$ips) {
751
+ $save = $wpdb->insert($wpdb->prefix . 'formmaker_blocked', array(
752
+ 'ip' => $row->ip,
753
+ ), array(
754
+ '%s',
755
+ ));
756
+ }
757
+ }
758
+ }
759
+ if ($flag) {
760
+ echo WDW_FM_Library::message('IPs Succesfully Blocked.', 'updated');
761
+ }
762
+ else {
763
+ echo WDW_FM_Library::message('You must select at least one item.', 'error');
764
+ }
765
+ $this->display($form_id);
766
+ }
767
+
768
+ public function unblock_ip() {
769
+ global $wpdb;
770
+ $flag = FALSE;
771
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
772
+ $cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
773
+ if (count($cid)) {
774
+ array_walk($cid, create_function('&$value', '$value = (int)$value;'));
775
+ $cids = implode(',', $cid);
776
+ $query = 'SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( '. $cids .' )';
777
+ $rows = $wpdb->get_results($query);
778
+ foreach ($rows as $row) {
779
+ $flag = TRUE;
780
+ $ips = $wpdb->get_var($wpdb->prepare('SELECT ip FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $row->ip));
781
+ if ($ips) {
782
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $ips));
783
+ }
784
+ }
785
+ }
786
+ if ($flag) {
787
+ echo WDW_FM_Library::message('IPs Succesfully Unblocked.', 'updated');
788
+ }
789
+ else {
790
+ echo WDW_FM_Library::message('You must select at least one item.', 'error');
791
+ }
792
+ $this->display($form_id);
793
+ }
794
+
795
+ ////////////////////////////////////////////////////////////////////////////////////////
796
+ // Getters & Setters //
797
+ ////////////////////////////////////////////////////////////////////////////////////////
798
+ ////////////////////////////////////////////////////////////////////////////////////////
799
+ // Private Methods //
800
+ ////////////////////////////////////////////////////////////////////////////////////////
801
+ ////////////////////////////////////////////////////////////////////////////////////////
802
+ // Listeners //
803
+ ////////////////////////////////////////////////////////////////////////////////////////
804
  }
admin/controllers/FMControllerThemes_fm.php CHANGED
@@ -1,189 +1,189 @@
1
- <?php
2
-
3
- class FMControllerThemes_fm {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $task = WDW_FM_Library::get('task');
23
- $id = (int)WDW_FM_Library::get('current_id', 0);
24
- $message = WDW_FM_Library::get('message');
25
- echo WDW_FM_Library::message_id($message);
26
- if (method_exists($this, $task)) {
27
- check_admin_referer('nonce_fm', 'nonce_fm');
28
- $this->$task($id);
29
- }
30
- else {
31
- $this->display();
32
- }
33
- }
34
-
35
- public function display() {
36
- require_once WD_FM_DIR . "/admin/models/FMModelThemes_fm.php";
37
- $model = new FMModelThemes_fm();
38
-
39
- require_once WD_FM_DIR . "/admin/views/FMViewThemes_fm.php";
40
- $view = new FMViewThemes_fm($model);
41
- $view->display();
42
- }
43
-
44
- public function add() {
45
- require_once WD_FM_DIR . "/admin/models/FMModelThemes_fm.php";
46
- $model = new FMModelThemes_fm();
47
-
48
- require_once WD_FM_DIR . "/admin/views/FMViewThemes_fm.php";
49
- $view = new FMViewThemes_fm($model);
50
- $view->edit(0, FALSE);
51
- }
52
-
53
- public function edit() {
54
- require_once WD_FM_DIR . "/admin/models/FMModelThemes_fm.php";
55
- $model = new FMModelThemes_fm();
56
-
57
- require_once WD_FM_DIR . "/admin/views/FMViewThemes_fm.php";
58
- $view = new FMViewThemes_fm($model);
59
- // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
60
- $id = (int)WDW_FM_Library::get('current_id', 0);
61
- $view->edit($id, FALSE);
62
- }
63
-
64
- public function save() {
65
- $message = $this->save_db();
66
- // $this->display();
67
- $page = WDW_FM_Library::get('page');
68
- WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
69
- }
70
-
71
- public function apply() {
72
- $message = $this->save_db();
73
- global $wpdb;
74
- // if (!isset($_POST['current_id']) || (esc_html($_POST['current_id']) == 0) || (esc_html($_POST['current_id']) == '')) {
75
-
76
- // }
77
- $id = (int) $wpdb->get_var('SELECT MAX(`id`) FROM ' . $wpdb->prefix . 'formmaker_themes');
78
- $current_id = (int)WDW_FM_Library::get('current_id', $id);
79
- $page = WDW_FM_Library::get('page');
80
- WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
81
- // $this->edit();
82
- }
83
-
84
- public function save_db() {
85
- global $wpdb;
86
- // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes( $_POST['current_id'])) : 0);
87
- $id = (int) WDW_FM_Library::get('current_id', 0);
88
- $title = (isset($_POST['title']) ? esc_html(stripslashes( $_POST['title'])) : '');
89
- $css = (isset($_POST['css']) ? stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST['css'])) : '');
90
- $default = (isset($_POST['default']) ? esc_html(stripslashes( $_POST['default'])) : 0);
91
- if ($id != 0) {
92
- $save = $wpdb->update($wpdb->prefix . 'formmaker_themes', array(
93
- 'title' => $title,
94
- 'css' => $css,
95
- 'default' => $default,
96
- ), array('id' => $id));
97
- }
98
- else {
99
- $save = $wpdb->insert($wpdb->prefix . 'formmaker_themes', array(
100
- 'title' => $title,
101
- 'css' => $css,
102
- 'default' => $default,
103
- ), array(
104
- '%s',
105
- '%s',
106
- '%d',
107
- ));
108
- }
109
- if ($save !== FALSE) {
110
- return 1;
111
- }
112
- else {
113
- return 2;
114
- }
115
- }
116
-
117
- public function delete($id) {
118
- global $wpdb;
119
- $isDefault = $wpdb->get_var($wpdb->prepare('SELECT `default` FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id));
120
- if ($isDefault) {
121
- $message = 4;
122
- }
123
- else {
124
- $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id);
125
- if ($wpdb->query($query)) {
126
- $message = 3;
127
- }
128
- else {
129
- $message = 2;
130
- }
131
- }
132
- // $this->display();
133
- $page = WDW_FM_Library::get('page');
134
- WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
135
- }
136
-
137
- public function delete_all() {
138
- global $wpdb;
139
- $flag = FALSE;
140
- $isDefault = FALSE;
141
- $theme_ids_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker_themes');
142
- foreach ($theme_ids_col as $theme_id) {
143
- if (isset($_POST['check_' . $theme_id])) {
144
- $isDefault = $wpdb->get_var($wpdb->prepare('SELECT `default` FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $theme_id));
145
- if ($isDefault) {
146
- $message = 4;
147
- }
148
- else {
149
- $flag = TRUE;
150
- $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $theme_id));
151
- }
152
- }
153
- }
154
- if ($flag) {
155
- $message = 5;
156
- }
157
- else {
158
- $message = 6;
159
- }
160
- // $this->display();
161
- $page = WDW_FM_Library::get('page');
162
- WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
163
- }
164
-
165
- public function setdefault($id) {
166
- global $wpdb;
167
- $wpdb->update($wpdb->prefix . 'formmaker_themes', array('default' => 0), array('default' => 1));
168
- $save = $wpdb->update($wpdb->prefix . 'formmaker_themes', array('default' => 1), array('id' => $id));
169
- if ($save !== FALSE) {
170
- $message = 7;
171
- }
172
- else {
173
- $message = 2;
174
- }
175
- // $this->display();
176
- $page = WDW_FM_Library::get('page');
177
- WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
178
- }
179
-
180
- ////////////////////////////////////////////////////////////////////////////////////////
181
- // Getters & Setters //
182
- ////////////////////////////////////////////////////////////////////////////////////////
183
- ////////////////////////////////////////////////////////////////////////////////////////
184
- // Private Methods //
185
- ////////////////////////////////////////////////////////////////////////////////////////
186
- ////////////////////////////////////////////////////////////////////////////////////////
187
- // Listeners //
188
- ////////////////////////////////////////////////////////////////////////////////////////
189
  }
1
+ <?php
2
+
3
+ class FMControllerThemes_fm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $task = WDW_FM_Library::get('task');
23
+ $id = (int)WDW_FM_Library::get('current_id', 0);
24
+ $message = WDW_FM_Library::get('message');
25
+ echo WDW_FM_Library::message_id($message);
26
+ if (method_exists($this, $task)) {
27
+ check_admin_referer('nonce_fm', 'nonce_fm');
28
+ $this->$task($id);
29
+ }
30
+ else {
31
+ $this->display();
32
+ }
33
+ }
34
+
35
+ public function display() {
36
+ require_once WD_FM_DIR . "/admin/models/FMModelThemes_fm.php";
37
+ $model = new FMModelThemes_fm();
38
+
39
+ require_once WD_FM_DIR . "/admin/views/FMViewThemes_fm.php";
40
+ $view = new FMViewThemes_fm($model);
41
+ $view->display();
42
+ }
43
+
44
+ public function add() {
45
+ require_once WD_FM_DIR . "/admin/models/FMModelThemes_fm.php";
46
+ $model = new FMModelThemes_fm();
47
+
48
+ require_once WD_FM_DIR . "/admin/views/FMViewThemes_fm.php";
49
+ $view = new FMViewThemes_fm($model);
50
+ $view->edit(0, FALSE);
51
+ }
52
+
53
+ public function edit() {
54
+ require_once WD_FM_DIR . "/admin/models/FMModelThemes_fm.php";
55
+ $model = new FMModelThemes_fm();
56
+
57
+ require_once WD_FM_DIR . "/admin/views/FMViewThemes_fm.php";
58
+ $view = new FMViewThemes_fm($model);
59
+ // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
60
+ $id = (int)WDW_FM_Library::get('current_id', 0);
61
+ $view->edit($id, FALSE);
62
+ }
63
+
64
+ public function save() {
65
+ $message = $this->save_db();
66
+ // $this->display();
67
+ $page = WDW_FM_Library::get('page');
68
+ WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
69
+ }
70
+
71
+ public function apply() {
72
+ $message = $this->save_db();
73
+ global $wpdb;
74
+ // if (!isset($_POST['current_id']) || (esc_html($_POST['current_id']) == 0) || (esc_html($_POST['current_id']) == '')) {
75
+
76
+ // }
77
+ $id = (int) $wpdb->get_var('SELECT MAX(`id`) FROM ' . $wpdb->prefix . 'formmaker_themes');
78
+ $current_id = (int)WDW_FM_Library::get('current_id', $id);
79
+ $page = WDW_FM_Library::get('page');
80
+ WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
81
+ // $this->edit();
82
+ }
83
+
84
+ public function save_db() {
85
+ global $wpdb;
86
+ // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes( $_POST['current_id'])) : 0);
87
+ $id = (int) WDW_FM_Library::get('current_id', 0);
88
+ $title = (isset($_POST['title']) ? esc_html(stripslashes( $_POST['title'])) : '');
89
+ $css = (isset($_POST['css']) ? stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST['css'])) : '');
90
+ $default = (isset($_POST['default']) ? esc_html(stripslashes( $_POST['default'])) : 0);
91
+ if ($id != 0) {
92
+ $save = $wpdb->update($wpdb->prefix . 'formmaker_themes', array(
93
+ 'title' => $title,
94
+ 'css' => $css,
95
+ 'default' => $default,
96
+ ), array('id' => $id));
97
+ }
98
+ else {
99
+ $save = $wpdb->insert($wpdb->prefix . 'formmaker_themes', array(
100
+ 'title' => $title,
101
+ 'css' => $css,
102
+ 'default' => $default,
103
+ ), array(
104
+ '%s',
105
+ '%s',
106
+ '%d',
107
+ ));
108
+ }
109
+ if ($save !== FALSE) {
110
+ return 1;
111
+ }
112
+ else {
113
+ return 2;
114
+ }
115
+ }
116
+
117
+ public function delete($id) {
118
+ global $wpdb;
119
+ $isDefault = $wpdb->get_var($wpdb->prepare('SELECT `default` FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id));
120
+ if ($isDefault) {
121
+ $message = 4;
122
+ }
123
+ else {
124
+ $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id);
125
+ if ($wpdb->query($query)) {
126
+ $message = 3;
127
+ }
128
+ else {
129
+ $message = 2;
130
+ }
131
+ }
132
+ // $this->display();
133
+ $page = WDW_FM_Library::get('page');
134
+ WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
135
+ }
136
+
137
+ public function delete_all() {
138
+ global $wpdb;
139
+ $flag = FALSE;
140
+ $isDefault = FALSE;
141
+ $theme_ids_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker_themes');
142
+ foreach ($theme_ids_col as $theme_id) {
143
+ if (isset($_POST['check_' . $theme_id])) {
144
+ $isDefault = $wpdb->get_var($wpdb->prepare('SELECT `default` FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $theme_id));
145
+ if ($isDefault) {
146
+ $message = 4;
147
+ }
148
+ else {
149
+ $flag = TRUE;
150
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $theme_id));
151
+ }
152
+ }
153
+ }
154
+ if ($flag) {
155
+ $message = 5;
156
+ }
157
+ else {
158
+ $message = 6;
159
+ }
160
+ // $this->display();
161
+ $page = WDW_FM_Library::get('page');
162
+ WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
163
+ }
164
+
165
+ public function setdefault($id) {
166
+ global $wpdb;
167
+ $wpdb->update($wpdb->prefix . 'formmaker_themes', array('default' => 0), array('default' => 1));
168
+ $save = $wpdb->update($wpdb->prefix . 'formmaker_themes', array('default' => 1), array('id' => $id));
169
+ if ($save !== FALSE) {
170
+ $message = 7;
171
+ }
172
+ else {
173
+ $message = 2;
174
+ }
175
+ // $this->display();
176
+ $page = WDW_FM_Library::get('page');
177
+ WDW_FM_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
178
+ }
179
+
180
+ ////////////////////////////////////////////////////////////////////////////////////////
181
+ // Getters & Setters //
182
+ ////////////////////////////////////////////////////////////////////////////////////////
183
+ ////////////////////////////////////////////////////////////////////////////////////////
184
+ // Private Methods //
185
+ ////////////////////////////////////////////////////////////////////////////////////////
186
+ ////////////////////////////////////////////////////////////////////////////////////////
187
+ // Listeners //
188
+ ////////////////////////////////////////////////////////////////////////////////////////
189
  }
admin/controllers/FMControllerUninstall_fm.php CHANGED
@@ -1,58 +1,58 @@
1
- <?php
2
-
3
- class FMControllerUninstall_fm {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $task = ((isset($_POST['task'])) ? esc_html(stripslashes($_POST['task'])) : '');
23
- if (method_exists($this, $task)) {
24
- check_admin_referer('nonce_fm', 'nonce_fm');
25
- $this->$task();
26
- }
27
- else {
28
- $this->display();
29
- }
30
- }
31
-
32
- public function display() {
33
- require_once WD_FM_DIR . "/admin/models/FMModelUninstall_fm.php";
34
- $model = new FMModelUninstall_fm();
35
-
36
- require_once WD_FM_DIR . "/admin/views/FMViewUninstall_fm.php";
37
- $view = new FMViewUninstall_fm($model);
38
- $view->display();
39
- }
40
-
41
- public function uninstall() {
42
- require_once WD_FM_DIR . "/admin/models/FMModelUninstall_fm.php";
43
- $model = new FMModelUninstall_fm();
44
-
45
- require_once WD_FM_DIR . "/admin/views/FMViewUninstall_fm.php";
46
- $view = new FMViewUninstall_fm($model);
47
- $view->uninstall();
48
- }
49
- ////////////////////////////////////////////////////////////////////////////////////////
50
- // Getters & Setters //
51
- ////////////////////////////////////////////////////////////////////////////////////////
52
- ////////////////////////////////////////////////////////////////////////////////////////
53
- // Private Methods //
54
- ////////////////////////////////////////////////////////////////////////////////////////
55
- ////////////////////////////////////////////////////////////////////////////////////////
56
- // Listeners //
57
- ////////////////////////////////////////////////////////////////////////////////////////
58
  }
1
+ <?php
2
+
3
+ class FMControllerUninstall_fm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $task = ((isset($_POST['task'])) ? esc_html(stripslashes($_POST['task'])) : '');
23
+ if (method_exists($this, $task)) {
24
+ check_admin_referer('nonce_fm', 'nonce_fm');
25
+ $this->$task();
26
+ }
27
+ else {
28
+ $this->display();
29
+ }
30
+ }
31
+
32
+ public function display() {
33
+ require_once WD_FM_DIR . "/admin/models/FMModelUninstall_fm.php";
34
+ $model = new FMModelUninstall_fm();
35
+
36
+ require_once WD_FM_DIR . "/admin/views/FMViewUninstall_fm.php";
37
+ $view = new FMViewUninstall_fm($model);
38
+ $view->display();
39
+ }
40
+
41
+ public function uninstall() {
42
+ require_once WD_FM_DIR . "/admin/models/FMModelUninstall_fm.php";
43
+ $model = new FMModelUninstall_fm();
44
+
45
+ require_once WD_FM_DIR . "/admin/views/FMViewUninstall_fm.php";
46
+ $view = new FMViewUninstall_fm($model);
47
+ $view->uninstall();
48
+ }
49
+ ////////////////////////////////////////////////////////////////////////////////////////
50
+ // Getters & Setters //
51
+ ////////////////////////////////////////////////////////////////////////////////////////
52
+ ////////////////////////////////////////////////////////////////////////////////////////
53
+ // Private Methods //
54
+ ////////////////////////////////////////////////////////////////////////////////////////
55
+ ////////////////////////////////////////////////////////////////////////////////////////
56
+ // Listeners //
57
+ ////////////////////////////////////////////////////////////////////////////////////////
58
  }
admin/controllers/FMControllerWidget.php CHANGED
@@ -1,61 +1,61 @@
1
- <?php
2
-
3
- class FMControllerWidget extends WP_Widget {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- private $view;
14
- private $model;
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- // Constructor & Destructor //
17
- ////////////////////////////////////////////////////////////////////////////////////////
18
- public function __construct() {
19
- $widget_ops = array(
20
- 'classname' => 'form_maker_widget',
21
- 'description' => 'Add Form Maker widget.'
22
- );
23
- // Widget Control Settings.
24
- $control_ops = array('id_base' => 'form_maker_widget');
25
- // Create the widget.
26
- parent::__construct('form_maker_widget', 'Form Maker', $widget_ops, $control_ops);
27
- require_once WD_FM_DIR . "/admin/models/FMModelWidget.php";
28
- $this->model = new FMModelWidget();
29
-
30
- require_once WD_FM_DIR . "/admin/views/FMViewWidget.php";
31
- $this->view = new FMViewWidget($this->model);
32
- }
33
- ////////////////////////////////////////////////////////////////////////////////////////
34
- // Public Methods //
35
- ////////////////////////////////////////////////////////////////////////////////////////
36
-
37
- public function widget($args, $instance) {
38
- $this->view->widget($args, $instance);
39
- }
40
-
41
- public function form( $instance ) {
42
- $this->view->form($instance, parent::get_field_id('title'), parent::get_field_name('title'), parent::get_field_id('form_id'), parent::get_field_name('form_id'));
43
- }
44
-
45
- // Update Settings.
46
- public function update($new_instance, $old_instance) {
47
- $instance['title'] = $new_instance['title'];
48
- $instance['form_id'] = $new_instance['form_id'];
49
- return $instance;
50
- }
51
-
52
- ////////////////////////////////////////////////////////////////////////////////////////
53
- // Getters & Setters //
54
- ////////////////////////////////////////////////////////////////////////////////////////
55
- ////////////////////////////////////////////////////////////////////////////////////////
56
- // Private Methods //
57
- ////////////////////////////////////////////////////////////////////////////////////////
58
- ////////////////////////////////////////////////////////////////////////////////////////
59
- // Listeners //
60
- ////////////////////////////////////////////////////////////////////////////////////////
61
  }
1
+ <?php
2
+
3
+ class FMControllerWidget extends WP_Widget {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $view;
14
+ private $model;
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ // Constructor & Destructor //
17
+ ////////////////////////////////////////////////////////////////////////////////////////
18
+ public function __construct() {
19
+ $widget_ops = array(
20
+ 'classname' => 'form_maker_widget',
21
+ 'description' => 'Add Form Maker widget.'
22
+ );
23
+ // Widget Control Settings.
24
+ $control_ops = array('id_base' => 'form_maker_widget');
25
+ // Create the widget.
26
+ parent::__construct('form_maker_widget', 'Form Maker', $widget_ops, $control_ops);
27
+ require_once WD_FM_DIR . "/admin/models/FMModelWidget.php";
28
+ $this->model = new FMModelWidget();
29
+
30
+ require_once WD_FM_DIR . "/admin/views/FMViewWidget.php";
31
+ $this->view = new FMViewWidget($this->model);
32
+ }
33
+ ////////////////////////////////////////////////////////////////////////////////////////
34
+ // Public Methods //
35
+ ////////////////////////////////////////////////////////////////////////////////////////
36
+
37
+ public function widget($args, $instance) {
38
+ $this->view->widget($args, $instance);
39
+ }
40
+
41
+ public function form( $instance ) {
42
+ $this->view->form($instance, parent::get_field_id('title'), parent::get_field_name('title'), parent::get_field_id('form_id'), parent::get_field_name('form_id'));
43
+ }
44
+
45
+ // Update Settings.
46
+ public function update($new_instance, $old_instance) {
47
+ $instance['title'] = $new_instance['title'];
48
+ $instance['form_id'] = $new_instance['form_id'];
49
+ return $instance;
50
+ }
51
+
52
+ ////////////////////////////////////////////////////////////////////////////////////////
53
+ // Getters & Setters //
54
+ ////////////////////////////////////////////////////////////////////////////////////////
55
+ ////////////////////////////////////////////////////////////////////////////////////////
56
+ // Private Methods //
57
+ ////////////////////////////////////////////////////////////////////////////////////////
58
+ ////////////////////////////////////////////////////////////////////////////////////////
59
+ // Listeners //
60
+ ////////////////////////////////////////////////////////////////////////////////////////
61
  }
admin/models/FMModelBlocked_ips_fm.php CHANGED
@@ -1,75 +1,75 @@
1
- <?php
2
-
3
- class FMModelBlocked_ips_fm {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function get_rows_data() {
22
- global $wpdb;
23
- $where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE `ip` LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
24
- $asc_or_desc = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'desc') ? 'desc' : 'asc');
25
- $order_by_array = array('id', 'ip');
26
- $order_by = isset($_POST['order_by']) && in_array(esc_html(stripslashes($_POST['order_by'])), $order_by_array) ? esc_html(stripslashes($_POST['order_by'])) : 'id';
27
- $order_by = ' ORDER BY `' . $order_by . '` ' . $asc_or_desc;
28
- if (isset($_POST['page_number']) && $_POST['page_number']) {
29
- $limit = ((int) $_POST['page_number'] - 1) * 20;
30
- }
31
- else {
32
- $limit = 0;
33
- }
34
- $query = "SELECT * FROM " . $wpdb->prefix . "formmaker_blocked " . $where . $order_by . " LIMIT " . $limit . ",20";
35
- $rows = $wpdb->get_results($query);
36
- return $rows;
37
- }
38
-
39
- public function get_row_data($id) {
40
- global $wpdb;
41
- if ($id != 0) {
42
- $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $id));
43
- }
44
- else {
45
- $row->id = 0;
46
- $row->ip = '';
47
- }
48
- return $row;
49
- }
50
-
51
- public function page_nav() {
52
- global $wpdb;
53
- $where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE `ip` LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
54
- $query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker_blocked " . $where;
55
- $total = $wpdb->get_var($query);
56
- $page_nav['total'] = $total;
57
- if (isset($_POST['page_number']) && $_POST['page_number']) {
58
- $limit = ((int) $_POST['page_number'] - 1) * 20;
59
- }
60
- else {
61
- $limit = 0;
62
- }
63
- $page_nav['limit'] = (int) ($limit / 20 + 1);
64
- return $page_nav;
65
- }
66
- ////////////////////////////////////////////////////////////////////////////////////////
67
- // Getters & Setters //
68
- ////////////////////////////////////////////////////////////////////////////////////////
69
- ////////////////////////////////////////////////////////////////////////////////////////
70
- // Private Methods //
71
- ////////////////////////////////////////////////////////////////////////////////////////
72
- ////////////////////////////////////////////////////////////////////////////////////////
73
- // Listeners //
74
- ////////////////////////////////////////////////////////////////////////////////////////
75
  }
1
+ <?php
2
+
3
+ class FMModelBlocked_ips_fm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function get_rows_data() {
22
+ global $wpdb;
23
+ $where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE `ip` LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
24
+ $asc_or_desc = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'desc') ? 'desc' : 'asc');
25
+ $order_by_array = array('id', 'ip');
26
+ $order_by = isset($_POST['order_by']) && in_array(esc_html(stripslashes($_POST['order_by'])), $order_by_array) ? esc_html(stripslashes($_POST['order_by'])) : 'id';
27
+ $order_by = ' ORDER BY `' . $order_by . '` ' . $asc_or_desc;
28
+ if (isset($_POST['page_number']) && $_POST['page_number']) {
29
+ $limit = ((int) $_POST['page_number'] - 1) * 20;
30
+ }
31
+ else {
32
+ $limit = 0;
33
+ }
34
+ $query = "SELECT * FROM " . $wpdb->prefix . "formmaker_blocked " . $where . $order_by . " LIMIT " . $limit . ",20";
35
+ $rows = $wpdb->get_results($query);
36
+ return $rows;
37
+ }
38
+
39
+ public function get_row_data($id) {
40
+ global $wpdb;
41
+ if ($id != 0) {
42
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $id));
43
+ }
44
+ else {
45
+ $row->id = 0;
46
+ $row->ip = '';
47
+ }
48
+ return $row;
49
+ }
50
+
51
+ public function page_nav() {
52
+ global $wpdb;
53
+ $where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE `ip` LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
54
+ $query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker_blocked " . $where;
55
+ $total = $wpdb->get_var($query);
56
+ $page_nav['total'] = $total;
57
+ if (isset($_POST['page_number']) && $_POST['page_number']) {
58
+ $limit = ((int) $_POST['page_number'] - 1) * 20;
59
+ }
60
+ else {
61
+ $limit = 0;
62
+ }
63
+ $page_nav['limit'] = (int) ($limit / 20 + 1);
64
+ return $page_nav;
65
+ }
66
+ ////////////////////////////////////////////////////////////////////////////////////////
67
+ // Getters & Setters //
68
+ ////////////////////////////////////////////////////////////////////////////////////////
69
+ ////////////////////////////////////////////////////////////////////////////////////////
70
+ // Private Methods //
71
+ ////////////////////////////////////////////////////////////////////////////////////////
72
+ ////////////////////////////////////////////////////////////////////////////////////////
73
+ // Listeners //
74
+ ////////////////////////////////////////////////////////////////////////////////////////
75
  }
admin/models/FMModelFormMakerEditCSS.php CHANGED
@@ -1,42 +1,42 @@
1
- <?php
2
-
3
- class FMModelFormMakerEditCSS {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
-
22
- public function get_theme_row($id) {
23
- global $wpdb;
24
- $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id));
25
- return $row;
26
- }
27
-
28
- /*public function get_form($form_id) {
29
- global $wpdb;
30
- $form = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $form_id));
31
- return $form;
32
- }*/
33
- ////////////////////////////////////////////////////////////////////////////////////////
34
- // Getters & Setters //
35
- ////////////////////////////////////////////////////////////////////////////////////////
36
- ////////////////////////////////////////////////////////////////////////////////////////
37
- // Private Methods //
38
- ////////////////////////////////////////////////////////////////////////////////////////
39
- ////////////////////////////////////////////////////////////////////////////////////////
40
- // Listeners //
41
- ////////////////////////////////////////////////////////////////////////////////////////
42
  }
1
+ <?php
2
+
3
+ class FMModelFormMakerEditCSS {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
22
+ public function get_theme_row($id) {
23
+ global $wpdb;
24
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id));
25
+ return $row;
26
+ }
27
+
28
+ /*public function get_form($form_id) {
29
+ global $wpdb;
30
+ $form = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $form_id));
31
+ return $form;
32
+ }*/
33
+ ////////////////////////////////////////////////////////////////////////////////////////
34
+ // Getters & Setters //
35
+ ////////////////////////////////////////////////////////////////////////////////////////
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
+ // Private Methods //
38
+ ////////////////////////////////////////////////////////////////////////////////////////
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ // Listeners //
41
+ ////////////////////////////////////////////////////////////////////////////////////////
42
  }
admin/models/FMModelFormMakerPreview.php CHANGED
@@ -1,42 +1,42 @@
1
- <?php
2
-
3
- class FMModelFormMakerPreview {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
-
22
- public function get_theme_css($id) {
23
- global $wpdb;
24
- $css = $wpdb->get_var($wpdb->prepare('SELECT css FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id));
25
- return $css;
26
- }
27
-
28
- public function get_form($form_id) {
29
- global $wpdb;
30
- $form = $wpdb->get_var($wpdb->prepare('SELECT form_front FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $form_id));
31
- return $form;
32
- }
33
- ////////////////////////////////////////////////////////////////////////////////////////
34
- // Getters & Setters //
35
- ////////////////////////////////////////////////////////////////////////////////////////
36
- ////////////////////////////////////////////////////////////////////////////////////////
37
- // Private Methods //
38
- ////////////////////////////////////////////////////////////////////////////////////////
39
- ////////////////////////////////////////////////////////////////////////////////////////
40
- // Listeners //
41
- ////////////////////////////////////////////////////////////////////////////////////////
42
  }
1
+ <?php
2
+
3
+ class FMModelFormMakerPreview {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
22
+ public function get_theme_css($id) {
23
+ global $wpdb;
24
+ $css = $wpdb->get_var($wpdb->prepare('SELECT css FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id));
25
+ return $css;
26
+ }
27
+
28
+ public function get_form($form_id) {
29
+ global $wpdb;
30
+ $form = $wpdb->get_var($wpdb->prepare('SELECT form_front FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $form_id));
31
+ return $form;
32
+ }
33
+ ////////////////////////////////////////////////////////////////////////////////////////
34
+ // Getters & Setters //
35
+ ////////////////////////////////////////////////////////////////////////////////////////
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
+ // Private Methods //
38
+ ////////////////////////////////////////////////////////////////////////////////////////
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ // Listeners //
41
+ ////////////////////////////////////////////////////////////////////////////////////////
42
  }
admin/models/FMModelFormMakerSQLMapping.php CHANGED
@@ -1,121 +1,121 @@
1
- <?php
2
-
3
- class FMModelFormMakerSQLMapping {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
-
22
- function get_query($id) {
23
- global $wpdb;
24
- $rows = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker_query where id=" . $id);
25
- return $rows;
26
- }
27
-
28
- function get_labels($form_id) {
29
- global $wpdb;
30
- // $wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
31
- // wp_set_wpdb_vars();
32
- $rows = $wpdb->get_var("SELECT label_order_current FROM " . $wpdb->prefix . "formmaker where id=" . $form_id);
33
- return $rows;
34
- }
35
-
36
- function get_tables() {
37
- global $wpdb;
38
- $con_type = $_POST['con_type'];
39
-
40
- if($con_type == 'local') {
41
- $query = "SHOW TABLES";
42
- $tables = $wpdb->get_col($query);
43
- }
44
- else if($con_type == 'remote') {
45
- $username = isset($_POST['username']) ? $_POST['username'] : '';
46
- $password = isset($_POST['password']) ? $_POST['password'] : '';
47
- $database = isset($_POST['database']) ? $_POST['database'] : '';
48
- $host = isset($_POST['host']) ? $_POST['host'] : '';
49
- $wpdb_temp = new wpdb($username, $password, $database, $host);
50
- $query = "SHOW TABLES";
51
- $tables = $wpdb_temp->get_col($query);
52
- }
53
- //$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
54
- return $tables;
55
- }
56
-
57
- function get_tables_saved($con_type, $username, $password, $database, $host) {
58
- global $wpdb;
59
-
60
- if($con_type == 'local') {
61
- $query = "SHOW TABLES";
62
- $tables = $wpdb->get_col($query);
63
- }
64
- else if($con_type == 'remote') {
65
- $wpdb_temp = new wpdb($username, $password, $database, $host);
66
- $query = "SHOW TABLES";
67
- $tables = $wpdb_temp->get_col($query);
68
- }
69
- //$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
70
- return $tables;
71
- }
72
-
73
- function get_table_struct() {
74
- global $wpdb;
75
- $name = isset($_POST['name']) ? $_POST['name'] : NULL;
76
- if(!$name)
77
- return array();
78
- $con_method = $_POST['con_method'];
79
- $con_type = $_POST['con_type'];
80
- $query = "SHOW COLUMNS FROM " . $name;
81
- if($con_type == 'remote') {
82
- $username = isset($_POST['username']) ? $_POST['username'] : '';
83
- $password = isset($_POST['password']) ? $_POST['password'] : '';
84
- $database = isset($_POST['database']) ? $_POST['database'] : '';
85
- $host = isset($_POST['host']) ? $_POST['host'] : '';
86
- $wpdb_temp = new wpdb($username, $password, $database, $host);
87
- $table_struct = $wpdb_temp->get_results($query);
88
- }
89
- else {
90
- $table_struct = $wpdb->get_results($query);
91
- }
92
- //$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
93
- return $table_struct;
94
- }
95
-
96
- function get_table_struct_saved($con_type, $username, $password, $database, $host, $name, $con_method) {
97
- global $wpdb;
98
- if(!$name)
99
- return array();
100
- $query = "SHOW COLUMNS FROM " . $name;
101
- if($con_type == 'remote') {
102
- $wpdb_temp = new wpdb($username, $password, $database, $host);
103
- $table_struct = $wpdb_temp->get_results($query);
104
- }
105
- else {
106
- $table_struct = $wpdb->get_results($query);
107
- }
108
- //$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
109
- return $table_struct;
110
- }
111
-
112
- ////////////////////////////////////////////////////////////////////////////////////////
113
- // Getters & Setters //
114
- ////////////////////////////////////////////////////////////////////////////////////////
115
- ////////////////////////////////////////////////////////////////////////////////////////
116
- // Private Methods //
117
- ////////////////////////////////////////////////////////////////////////////////////////
118
- ////////////////////////////////////////////////////////////////////////////////////////
119
- // Listeners //
120
- ////////////////////////////////////////////////////////////////////////////////////////
121
  }
1
+ <?php
2
+
3
+ class FMModelFormMakerSQLMapping {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
22
+ function get_query($id) {
23
+ global $wpdb;
24
+ $rows = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker_query where id=" . $id);
25
+ return $rows;
26
+ }
27
+
28
+ function get_labels($form_id) {
29
+ global $wpdb;
30
+ // $wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
31
+ // wp_set_wpdb_vars();
32
+ $rows = $wpdb->get_var("SELECT label_order_current FROM " . $wpdb->prefix . "formmaker where id=" . $form_id);
33
+ return $rows;
34
+ }
35
+
36
+ function get_tables() {
37
+ global $wpdb;
38
+ $con_type = $_POST['con_type'];
39
+
40
+ if($con_type == 'local') {
41
+ $query = "SHOW TABLES";
42
+ $tables = $wpdb->get_col($query);
43
+ }
44
+ else if($con_type == 'remote') {
45
+ $username = isset($_POST['username']) ? $_POST['username'] : '';
46
+ $password = isset($_POST['password']) ? $_POST['password'] : '';
47
+ $database = isset($_POST['database']) ? $_POST['database'] : '';
48
+ $host = isset($_POST['host']) ? $_POST['host'] : '';
49
+ $wpdb_temp = new wpdb($username, $password, $database, $host);
50
+ $query = "SHOW TABLES";
51
+ $tables = $wpdb_temp->get_col($query);
52
+ }
53
+ //$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
54
+ return $tables;
55
+ }
56
+
57
+ function get_tables_saved($con_type, $username, $password, $database, $host) {
58
+ global $wpdb;
59
+
60
+ if($con_type == 'local') {
61
+ $query = "SHOW TABLES";
62
+ $tables = $wpdb->get_col($query);
63
+ }
64
+ else if($con_type == 'remote') {
65
+ $wpdb_temp = new wpdb($username, $password, $database, $host);
66
+ $query = "SHOW TABLES";
67
+ $tables = $wpdb_temp->get_col($query);
68
+ }
69
+ //$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
70
+ return $tables;
71
+ }
72
+
73
+ function get_table_struct() {
74
+ global $wpdb;
75
+ $name = isset($_POST['name']) ? $_POST['name'] : NULL;
76
+ if(!$name)
77
+ return array();
78
+ $con_method = $_POST['con_method'];
79
+ $con_type = $_POST['con_type'];
80
+ $query = "SHOW COLUMNS FROM " . $name;
81
+ if($con_type == 'remote') {
82
+ $username = isset($_POST['username']) ? $_POST['username'] : '';
83
+ $password = isset($_POST['password']) ? $_POST['password'] : '';
84
+ $database = isset($_POST['database']) ? $_POST['database'] : '';
85
+ $host = isset($_POST['host']) ? $_POST['host'] : '';
86
+ $wpdb_temp = new wpdb($username, $password, $database, $host);
87
+ $table_struct = $wpdb_temp->get_results($query);
88
+ }
89
+ else {
90
+ $table_struct = $wpdb->get_results($query);
91
+ }
92
+ //$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
93
+ return $table_struct;
94
+ }
95
+
96
+ function get_table_struct_saved($con_type, $username, $password, $database, $host, $name, $con_method) {
97
+ global $wpdb;
98
+ if(!$name)
99
+ return array();
100
+ $query = "SHOW COLUMNS FROM " . $name;
101
+ if($con_type == 'remote') {
102
+ $wpdb_temp = new wpdb($username, $password, $database, $host);
103
+ $table_struct = $wpdb_temp->get_results($query);
104
+ }
105
+ else {
106
+ $table_struct = $wpdb->get_results($query);
107
+ }
108
+ //$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
109
+ return $table_struct;
110
+ }
111
+
112
+ ////////////////////////////////////////////////////////////////////////////////////////
113
+ // Getters & Setters //
114
+ ////////////////////////////////////////////////////////////////////////////////////////
115
+ ////////////////////////////////////////////////////////////////////////////////////////
116
+ // Private Methods //
117
+ ////////////////////////////////////////////////////////////////////////////////////////
118
+ ////////////////////////////////////////////////////////////////////////////////////////
119
+ // Listeners //
120
+ ////////////////////////////////////////////////////////////////////////////////////////
121
  }
admin/models/FMModelFormMakerSubmits.php CHANGED
@@ -1,43 +1,43 @@
1
- <?php
2
-
3
- class FMModelFormMakerSubmits {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
-
22
- public function get_from_label_order($form_id) {
23
- global $wpdb;
24
- $label_order = $wpdb->get_var($wpdb->prepare('SELECT `label_order` FROM `' . $wpdb->prefix . 'formmaker` WHERE id="%d"', $form_id));
25
- return $label_order;
26
- }
27
-
28
- public function get_submissions($group_id) {
29
- global $wpdb;
30
- $row = $wpdb->get_results($wpdb->prepare('SELECT * FROM `' . $wpdb->prefix . 'formmaker_submits` WHERE group_id="%d"', $group_id));
31
- return $row;
32
- }
33
-
34
- ////////////////////////////////////////////////////////////////////////////////////////
35
- // Getters & Setters //
36
- ////////////////////////////////////////////////////////////////////////////////////////
37
- ////////////////////////////////////////////////////////////////////////////////////////
38
- // Private Methods //
39
- ////////////////////////////////////////////////////////////////////////////////////////
40
- ////////////////////////////////////////////////////////////////////////////////////////
41
- // Listeners //
42
- ////////////////////////////////////////////////////////////////////////////////////////
43
  }
1
+ <?php
2
+
3
+ class FMModelFormMakerSubmits {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
22
+ public function get_from_label_order($form_id) {
23
+ global $wpdb;
24
+ $label_order = $wpdb->get_var($wpdb->prepare('SELECT `label_order` FROM `' . $wpdb->prefix . 'formmaker` WHERE id="%d"', $form_id));
25
+ return $label_order;
26
+ }
27
+
28
+ public function get_submissions($group_id) {
29
+ global $wpdb;
30
+ $row = $wpdb->get_results($wpdb->prepare('SELECT * FROM `' . $wpdb->prefix . 'formmaker_submits` WHERE group_id="%d"', $group_id));
31
+ return $row;
32
+ }
33
+
34
+ ////////////////////////////////////////////////////////////////////////////////////////
35
+ // Getters & Setters //
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
+ ////////////////////////////////////////////////////////////////////////////////////////
38
+ // Private Methods //
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Listeners //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
  }
admin/models/FMModelFormmakerwdcaptcha.php CHANGED
@@ -1,31 +1,31 @@
1
- <?php
2
-
3
- class FMModelFormmakerwdcaptcha {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
-
22
- ////////////////////////////////////////////////////////////////////////////////////////
23
- // Getters & Setters //
24
- ////////////////////////////////////////////////////////////////////////////////////////
25
- ////////////////////////////////////////////////////////////////////////////////////////
26
- // Private Methods //
27
- ////////////////////////////////////////////////////////////////////////////////////////
28
- ////////////////////////////////////////////////////////////////////////////////////////
29
- // Listeners //
30
- ////////////////////////////////////////////////////////////////////////////////////////
31
  }
1
+ <?php
2
+
3
+ class FMModelFormmakerwdcaptcha {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Getters & Setters //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ ////////////////////////////////////////////////////////////////////////////////////////
26
+ // Private Methods //
27
+ ////////////////////////////////////////////////////////////////////////////////////////
28
+ ////////////////////////////////////////////////////////////////////////////////////////
29
+ // Listeners //
30
+ ////////////////////////////////////////////////////////////////////////////////////////
31
  }
admin/models/FMModelFormmakerwdmathcaptcha.php CHANGED
@@ -1,31 +1,31 @@
1
- <?php
2
-
3
- class FMModelFormmakerwdmathcaptcha {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
-
22
- ////////////////////////////////////////////////////////////////////////////////////////
23
- // Getters & Setters //
24
- ////////////////////////////////////////////////////////////////////////////////////////
25
- ////////////////////////////////////////////////////////////////////////////////////////
26
- // Private Methods //
27
- ////////////////////////////////////////////////////////////////////////////////////////
28
- ////////////////////////////////////////////////////////////////////////////////////////
29
- // Listeners //
30
- ////////////////////////////////////////////////////////////////////////////////////////
31
  }
1
+ <?php
2
+
3
+ class FMModelFormmakerwdmathcaptcha {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Getters & Setters //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ ////////////////////////////////////////////////////////////////////////////////////////
26
+ // Private Methods //
27
+ ////////////////////////////////////////////////////////////////////////////////////////
28
+ ////////////////////////////////////////////////////////////////////////////////////////
29
+ // Listeners //
30
+ ////////////////////////////////////////////////////////////////////////////////////////
31
  }
admin/models/FMModelFormmakerwindow.php CHANGED
@@ -1,36 +1,36 @@
1
- <?php
2
-
3
- class FMModelFormmakerwindow {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
-
22
- public function get_form_data() {
23
- global $wpdb;
24
- $row = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE `id` NOT IN(" . get_option('contact_form_forms', 0) . ") order by `title`");
25
- return $row;
26
- }
27
- ////////////////////////////////////////////////////////////////////////////////////////
28
- // Getters & Setters //
29
- ////////////////////////////////////////////////////////////////////////////////////////
30
- ////////////////////////////////////////////////////////////////////////////////////////
31
- // Private Methods //
32
- ////////////////////////////////////////////////////////////////////////////////////////
33
- ////////////////////////////////////////////////////////////////////////////////////////
34
- // Listeners //
35
- ////////////////////////////////////////////////////////////////////////////////////////
36
  }
1
+ <?php
2
+
3
+ class FMModelFormmakerwindow {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
22
+ public function get_form_data() {
23
+ global $wpdb;
24
+ $row = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE `id` NOT IN(" . get_option('contact_form_forms', 0) . ") order by `title`");
25
+ return $row;
26
+ }
27
+ ////////////////////////////////////////////////////////////////////////////////////////
28
+ // Getters & Setters //
29
+ ////////////////////////////////////////////////////////////////////////////////////////
30
+ ////////////////////////////////////////////////////////////////////////////////////////
31
+ // Private Methods //
32
+ ////////////////////////////////////////////////////////////////////////////////////////
33
+ ////////////////////////////////////////////////////////////////////////////////////////
34
+ // Listeners //
35
+ ////////////////////////////////////////////////////////////////////////////////////////
36
  }
admin/models/FMModelFromeditcountryinpopup.php CHANGED
@@ -1,31 +1,31 @@
1
- <?php
2
-
3
- class FMModelFromeditcountryinpopup {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
-
22
- ////////////////////////////////////////////////////////////////////////////////////////
23
- // Getters & Setters //
24
- ////////////////////////////////////////////////////////////////////////////////////////
25
- ////////////////////////////////////////////////////////////////////////////////////////
26
- // Private Methods //
27
- ////////////////////////////////////////////////////////////////////////////////////////
28
- ////////////////////////////////////////////////////////////////////////////////////////
29
- // Listeners //
30
- ////////////////////////////////////////////////////////////////////////////////////////
31
  }
1
+ <?php
2
+
3
+ class FMModelFromeditcountryinpopup {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Getters & Setters //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ ////////////////////////////////////////////////////////////////////////////////////////
26
+ // Private Methods //
27
+ ////////////////////////////////////////////////////////////////////////////////////////
28
+ ////////////////////////////////////////////////////////////////////////////////////////
29
+ // Listeners //
30
+ ////////////////////////////////////////////////////////////////////////////////////////
31
  }
admin/models/FMModelFromipinfoinpopup.php CHANGED
@@ -1,31 +1,31 @@
1
- <?php
2
-
3
- class FMModelFromipinfoinpopup {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
-
22
- ////////////////////////////////////////////////////////////////////////////////////////
23
- // Getters & Setters //
24
- ////////////////////////////////////////////////////////////////////////////////////////
25
- ////////////////////////////////////////////////////////////////////////////////////////
26
- // Private Methods //
27
- ////////////////////////////////////////////////////////////////////////////////////////
28
- ////////////////////////////////////////////////////////////////////////////////////////
29
- // Listeners //
30
- ////////////////////////////////////////////////////////////////////////////////////////
31
  }
1
+ <?php
2
+
3
+ class FMModelFromipinfoinpopup {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Getters & Setters //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ ////////////////////////////////////////////////////////////////////////////////////////
26
+ // Private Methods //
27
+ ////////////////////////////////////////////////////////////////////////////////////////
28
+ ////////////////////////////////////////////////////////////////////////////////////////
29
+ // Listeners //
30
+ ////////////////////////////////////////////////////////////////////////////////////////
31
  }
admin/models/FMModelFrommapeditinpopup.php CHANGED
@@ -1,31 +1,31 @@
1
- <?php
2
-
3
- class FMModelFrommapeditinpopup {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
-
22
- ////////////////////////////////////////////////////////////////////////////////////////
23
- // Getters & Setters //
24
- ////////////////////////////////////////////////////////////////////////////////////////
25
- ////////////////////////////////////////////////////////////////////////////////////////
26
- // Private Methods //
27
- ////////////////////////////////////////////////////////////////////////////////////////
28
- ////////////////////////////////////////////////////////////////////////////////////////
29
- // Listeners //
30
- ////////////////////////////////////////////////////////////////////////////////////////
31
  }
1
+ <?php
2
+
3
+ class FMModelFrommapeditinpopup {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Getters & Setters //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ ////////////////////////////////////////////////////////////////////////////////////////
26
+ // Private Methods //
27
+ ////////////////////////////////////////////////////////////////////////////////////////
28
+ ////////////////////////////////////////////////////////////////////////////////////////
29
+ // Listeners //
30
+ ////////////////////////////////////////////////////////////////////////////////////////
31
  }
admin/models/FMModelGenerete_csv.php CHANGED
@@ -1,270 +1,270 @@
1
- <?php
2
-
3
- class FMModelGenerete_csv {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function get_data() {
22
- global $wpdb;
23
- $is_paypal_info = FALSE;
24
- $params = array();
25
- $group_id_s = array();
26
- $form_id = (int)$_REQUEST['form_id'];
27
- $limitstart = (int)$_REQUEST['limitstart'];
28
-
29
- $paypal_info_fields = array('currency', 'ord_last_modified', 'status', 'full_name', 'fax', 'mobile_phone', 'email', 'phone', 'address', 'paypal_info', 'ipn', 'tax', 'shipping');
30
- $paypal_info_labels = array( 'Currency', 'Last modified', 'Status', 'Full Name', 'Fax', 'Mobile phone', 'Email', 'Phone', 'Address', 'Paypal info', 'IPN', 'Tax', 'Shipping');
31
-
32
- $query = $wpdb->prepare("SELECT distinct group_id FROM " . $wpdb->prefix . "formmaker_submits where form_id=%d", $form_id);
33
- $group_id_s = $wpdb->get_col($query);
34
-
35
- $query = $wpdb->prepare("SELECT distinct element_label FROM " . $wpdb->prefix . "formmaker_submits where form_id=%d",$form_id);
36
- $labels = $wpdb->get_col($query);
37
-
38
- $query_lable = $wpdb->prepare("SELECT label_order,title FROM " . $wpdb->prefix . "formmaker where id=%d", $form_id);
39
- $rows_lable = $wpdb->get_results($query_lable);
40
- $ptn = "/[^a-zA-Z0-9_]/";
41
- $rpltxt = "";
42
- $title = isset($rows_lable[0]) ? preg_replace($ptn, $rpltxt, $rows_lable[0]->title) : '';
43
-
44
- $sorted_labels_id = array();
45
- $sorted_labels = array();
46
- $label_titles = array();
47
- $label_id = array();
48
- $label_order = array();
49
- $label_order_original = array();
50
- $label_type = array();
51
- if ($labels) {
52
- $label_all = explode('#****#', $rows_lable[0]->label_order);
53
- $label_all = array_slice($label_all, 0, count($label_all) - 1);
54
- foreach ($label_all as $key => $label_each) {
55
- $label_id_each = explode('#**id**#', $label_each);
56
- array_push($label_id, $label_id_each[0]);
57
- $label_oder_each = explode('#**label**#', $label_id_each[1]);
58
- array_push($label_order_original, $label_oder_each[0]);
59
- $label_temp = preg_replace($ptn, $rpltxt, $label_oder_each[0]);
60
- array_push($label_order, $label_temp);
61
- array_push($label_type, $label_oder_each[1]);
62
- }
63
- foreach ($label_id as $key => $label) {
64
- if (in_array($label, $labels) && $label_type[$key] !='type_arithmetic_captcha') {
65
- array_push($sorted_labels, $label_order[$key]);
66
- array_push($sorted_labels_id, $label);
67
- array_push($label_titles, stripslashes($label_order_original[$key]));
68
- }
69
- }
70
- }
71
-
72
- $m = count($sorted_labels);
73
- $wpdb->query("SET SESSION group_concat_max_len = 1000000");
74
-
75
- $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 GROUP BY group_id ORDER BY date ASC limit %d, %d", $form_id, $limitstart, 1000);
76
- $rows = $wpdb->get_results($query, OBJECT_K);
77
-
78
- $data = array();
79
- $group_id_s_count = $limitstart + 1000 < count($group_id_s) ? $limitstart + 1000 : count($group_id_s);
80
-
81
- for ($www = $limitstart; $www < $group_id_s_count; $www++) {
82
- $i = $group_id_s[$www];
83
- $field_key = array_search($i, $label_id);
84
- if($label_type[$field_key] != 'type_arithmetic_captcha') {
85
- $data_temp = array();
86
- $tt = $rows[$i];
87
-
88
- $date = $tt->date;
89
- $ip = $tt->ip;
90
- $user_id = get_userdata($tt->user_id_wd);
91
- $username = $user_id ? $user_id->display_name : "";
92
- $useremail = $user_id ? $user_id->user_email : "";
93
- $data_temp['Submission ID'] = $i;
94
- $data_temp['Submit date'] = $date;
95
- $data_temp['Ip']=$ip;
96
- $data_temp['Submitter\'s Username']=$username;
97
- $data_temp['Submitter\'s Email Address']=$useremail;
98
-
99
- $element_labels = explode(',', $tt->element_label);
100
- $element_values = explode('*:*el_value*:*', $tt->element_value);
101
- for ($h = 0; $h < $m; $h++) {
102
- if(isset($data_temp[$label_titles[$h]]))
103
- $label_titles[$h] .= '(1)';
104
-
105
- if(in_array($sorted_labels_id[$h], $element_labels)) {
106
- $element_value = $element_values[array_search($sorted_labels_id[$h], $element_labels)];
107
-
108
- if (strpos($element_value, "*@@url@@*")) {
109
- $file_names = '';
110
- $new_files = explode("*@@url@@*", $element_value);
111
- foreach ($new_files as $new_file) {
112
- if ($new_file) {
113
- $file_names .= $new_file . ", ";
114
- }
115
- }
116
- $data_temp[stripslashes($label_titles[$h])] = $file_names;
117
- }
118
- elseif (strpos($element_value, "***br***")) {
119
- $element_value = str_replace("***br***", ', ', $element_value);
120
- if (strpos($element_value, "***quantity***")) {
121
- $element_value = str_replace("***quantity***", '', $element_value);
122
- }
123
- if (strpos($element_value, "***property***")) {
124
- $element_value = str_replace("***property***", '', $element_value);
125
- }
126
- if(substr($element_value, -2) == ', ') {
127
- $data_temp[stripslashes($label_titles[$h])]= substr($element_value, 0, -2);
128
- }
129
- else {
130
- $data_temp[stripslashes($label_titles[$h])]= $element_value;
131
- }
132
- }
133
- elseif (strpos($element_value, "***map***")) {
134
- $data_temp[stripslashes($label_titles[$h])] = 'Longitude:' . str_replace("***map***", ', Latitude:', $element_value);
135
- }
136
- elseif (strpos($element_value, "***star_rating***")) {
137
- $element = str_replace("***star_rating***", '', $element_value);
138
- $element = explode("***", $element);
139
- $data_temp[stripslashes($label_titles[$h])] = ' ' . $element[1] . '/' . $element[0];
140
- }
141
- elseif (strpos($element_value, "@@@") || $element_value == "@@@" || $element_value == "@@@@@@@@@") {
142
- $data_temp[stripslashes($label_titles[$h])] = str_replace("@@@", ' ', $element_value);
143
- }
144
- elseif (strpos($element_value, "***grading***")) {
145
- $element = str_replace("***grading***", '', $element_value);
146
- $grading = explode(":", $element);
147
- $items_count = sizeof($grading) - 1;
148
- $items = "";
149
- $total = "";
150
- for ($k = 0; $k < $items_count / 2; $k++) {
151
- $items .= $grading[$items_count / 2 + $k] . ": " . $grading[$k] . ", ";
152
- $total += $grading[$k];
153
- }
154
- $items .= "Total: " . $total;
155
- $data_temp[stripslashes($label_titles[$h])] = $items;
156
- }
157
- elseif (strpos($element_value, "***matrix***")) {
158
- $element = str_replace("***matrix***", '', $element_value);
159
- $matrix_value = explode('***', $element);
160
- $matrix_value = array_slice($matrix_value, 0, count($matrix_value) - 1);
161
- $mat_rows = $matrix_value[0];
162
- $mat_columns = $matrix_value[$mat_rows + 1];
163
- $matrix = "";
164
- $aaa = array();
165
- $var_checkbox = 1;
166
- $selected_value = "";
167
- $selected_value_yes = "";
168
- $selected_value_no = "";
169
- for ($k = 1; $k <= $mat_rows; $k++) {
170
- if ($matrix_value[$mat_rows + $mat_columns + 2] == "radio") {
171
- if ($matrix_value[$mat_rows + $mat_columns + 2 + $k] == 0) {
172
- $checked = "0";
173
- $aaa[1] = "";
174
- }
175
- else {
176
- $aaa = explode("_", $matrix_value[$mat_rows + $mat_columns + 2 + $k]);
177
- }
178
- for ($l = 1; $l <= $mat_columns; $l++) {
179
- $checked = $aaa[1] == $l ? '1' : '0';
180
- $matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$checked."; ";
181
- }
182
- }
183
- else {
184
- if ($matrix_value[$mat_rows+$mat_columns + 2] == "checkbox") {
185
- for ($l = 1; $l <= $mat_columns; $l++) {
186
- $checked = $matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox] == 1 ? '1' : '0';
187
- $matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$checked."; ";
188
- $var_checkbox++;
189
- }
190
- }
191
- else {
192
- if ($matrix_value[$mat_rows+$mat_columns + 2] == "text") {
193
- for ($l = 1; $l <= $mat_columns; $l++) {
194
- $text_value = $matrix_value[$mat_rows+$mat_columns+2+$var_checkbox];
195
- $matrix .='['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$text_value."; ";
196
- $var_checkbox++;
197
- }
198
- }
199
- else {
200
- for ($l = 1; $l <= $mat_columns; $l++) {
201
- $selected_text = $matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox];
202
- $matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows + 1 + $l].']='.$selected_text."; ";
203
- $var_checkbox++;
204
- }
205
- }
206
- }
207
- }
208
- }
209
- $data_temp[stripslashes($label_titles[$h])] = $matrix;
210
- }
211
- else {
212
- $val = htmlspecialchars_decode($element_value);
213
- $val = stripslashes(str_replace('&#039;', "'", $val));
214
- $data_temp[stripslashes($label_titles[$h])] = ($element_value ? $val : '');
215
- }
216
- }
217
- else
218
- $data_temp[stripslashes($label_titles[$h])] = '';
219
- }
220
-
221
- $query = $wpdb->prepare("SELECT id FROM " . $wpdb->prefix . "formmaker_submits where element_label=%s AND form_id = %d AND group_id=%d",'item_total', $form_id, $i);
222
- $is_paypal = $wpdb->get_results($query);
223
-
224
- if($is_paypal) {
225
- $item_total = $wpdb->get_var($wpdb->prepare("SELECT `element_value` FROM " . $wpdb->prefix . "formmaker_submits where group_id=%d AND element_label=%s", $i, 'item_total'));
226
- $total = $wpdb->get_var($wpdb->prepare("SELECT `element_value` FROM " . $wpdb->prefix . "formmaker_submits where group_id=%d AND element_label=%s", $i, 'total'));
227
- $payment_status = $wpdb->get_var($wpdb->prepare("SELECT `element_value` FROM " . $wpdb->prefix . "formmaker_submits where group_id=%d AND element_label=%s", $i, '0'));
228
- $data_temp['Item Total'] = $item_total;
229
- $data_temp['Total'] = $total;
230
- $data_temp['Payment Status'] = $payment_status;
231
- }
232
- $query = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker_sessions where group_id=%d",$i);
233
- $paypal_info = $wpdb->get_results($query);
234
- if ($paypal_info) {
235
- $is_paypal_info = TRUE;
236
- }
237
- if ($is_paypal) {
238
- foreach ($paypal_info_fields as $key=>$paypal_info_field) {
239
- if ($paypal_info) {
240
- $data_temp['PAYPAL_'.$paypal_info_labels[$key]]=$paypal_info[0]->$paypal_info_field;
241
- }
242
- else {
243
- $data_temp['PAYPAL_'.$paypal_info_labels[$key]]='';
244
- }
245
- }
246
- }
247
-
248
- $data[$i] = $data_temp;
249
- }
250
- }
251
-
252
- array_push($params, $data);
253
- array_push($params, $title);
254
- array_push($params, $is_paypal_info);
255
-
256
- return $params;
257
-
258
- }
259
-
260
-
261
- ////////////////////////////////////////////////////////////////////////////////////////
262
- // Getters & Setters //
263
- ////////////////////////////////////////////////////////////////////////////////////////
264
- ////////////////////////////////////////////////////////////////////////////////////////
265
- // Private Methods //
266
- ////////////////////////////////////////////////////////////////////////////////////////
267
- ////////////////////////////////////////////////////////////////////////////////////////
268
- // Listeners //
269
- ////////////////////////////////////////////////////////////////////////////////////////
270
  }
1
+ <?php
2
+
3
+ class FMModelGenerete_csv {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function get_data() {
22
+ global $wpdb;
23
+ $is_paypal_info = FALSE;
24
+ $params = array();
25
+ $group_id_s = array();
26
+ $form_id = (int)$_REQUEST['form_id'];
27
+ $limitstart = (int)$_REQUEST['limitstart'];
28
+
29
+ $paypal_info_fields = array('currency', 'ord_last_modified', 'status', 'full_name', 'fax', 'mobile_phone', 'email', 'phone', 'address', 'paypal_info', 'ipn', 'tax', 'shipping');
30
+ $paypal_info_labels = array( 'Currency', 'Last modified', 'Status', 'Full Name', 'Fax', 'Mobile phone', 'Email', 'Phone', 'Address', 'Paypal info', 'IPN', 'Tax', 'Shipping');
31
+
32
+ $query = $wpdb->prepare("SELECT distinct group_id FROM " . $wpdb->prefix . "formmaker_submits where form_id=%d", $form_id);
33
+ $group_id_s = $wpdb->get_col($query);
34
+
35
+ $query = $wpdb->prepare("SELECT distinct element_label FROM " . $wpdb->prefix . "formmaker_submits where form_id=%d",$form_id);
36
+ $labels = $wpdb->get_col($query);
37
+
38
+ $query_lable = $wpdb->prepare("SELECT label_order,title FROM " . $wpdb->prefix . "formmaker where id=%d", $form_id);
39
+ $rows_lable = $wpdb->get_results($query_lable);
40
+ $ptn = "/[^a-zA-Z0-9_]/";
41
+ $rpltxt = "";
42
+ $title = isset($rows_lable[0]) ? preg_replace($ptn, $rpltxt, $rows_lable[0]->title) : '';
43
+
44
+ $sorted_labels_id = array();
45
+ $sorted_labels = array();
46
+ $label_titles = array();
47
+ $label_id = array();
48
+ $label_order = array();
49
+ $label_order_original = array();
50
+ $label_type = array();
51
+ if ($labels) {
52
+ $label_all = explode('#****#', $rows_lable[0]->label_order);
53
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
54
+ foreach ($label_all as $key => $label_each) {
55
+ $label_id_each = explode('#**id**#', $label_each);
56
+ array_push($label_id, $label_id_each[0]);
57
+ $label_oder_each = explode('#**label**#', $label_id_each[1]);
58
+ array_push($label_order_original, $label_oder_each[0]);
59
+ $label_temp = preg_replace($ptn, $rpltxt, $label_oder_each[0]);
60
+ array_push($label_order, $label_temp);
61
+ array_push($label_type, $label_oder_each[1]);
62
+ }
63
+ foreach ($label_id as $key => $label) {
64
+ if (in_array($label, $labels) && $label_type[$key] !='type_arithmetic_captcha') {
65
+ array_push($sorted_labels, $label_order[$key]);
66
+ array_push($sorted_labels_id, $label);
67
+ array_push($label_titles, stripslashes($label_order_original[$key]));
68
+ }
69
+ }
70
+ }
71
+
72
+ $m = count($sorted_labels);
73
+ $wpdb->query("SET SESSION group_concat_max_len = 1000000");
74
+
75
+ $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 GROUP BY group_id ORDER BY date ASC limit %d, %d", $form_id, $limitstart, 1000);
76
+ $rows = $wpdb->get_results($query, OBJECT_K);
77
+
78
+ $data = array();
79
+ $group_id_s_count = $limitstart + 1000 < count($group_id_s) ? $limitstart + 1000 : count($group_id_s);
80
+
81
+ for ($www = $limitstart; $www < $group_id_s_count; $www++) {
82
+ $i = $group_id_s[$www];
83
+ $field_key = array_search($i, $label_id);
84
+ if($label_type[$field_key] != 'type_arithmetic_captcha') {
85
+ $data_temp = array();
86
+ $tt = $rows[$i];
87
+
88
+ $date = $tt->date;
89
+ $ip = $tt->ip;
90
+ $user_id = get_userdata($tt->user_id_wd);
91
+ $username = $user_id ? $user_id->display_name : "";
92
+ $useremail = $user_id ? $user_id->user_email : "";
93
+ $data_temp['Submission ID'] = $i;
94
+ $data_temp['Submit date'] = $date;
95
+ $data_temp['Ip']=$ip;
96
+ $data_temp['Submitter\'s Username']=$username;
97
+ $data_temp['Submitter\'s Email Address']=$useremail;
98
+
99
+ $element_labels = explode(',', $tt->element_label);
100
+ $element_values = explode('*:*el_value*:*', $tt->element_value);
101
+ for ($h = 0; $h < $m; $h++) {
102
+ if(isset($data_temp[$label_titles[$h]]))
103
+ $label_titles[$h] .= '(1)';
104
+
105
+ if(in_array($sorted_labels_id[$h], $element_labels)) {
106
+ $element_value = $element_values[array_search($sorted_labels_id[$h], $element_labels)];
107
+
108
+ if (strpos($element_value, "*@@url@@*")) {
109
+ $file_names = '';
110
+ $new_files = explode("*@@url@@*", $element_value);
111
+ foreach ($new_files as $new_file) {
112
+ if ($new_file) {
113
+ $file_names .= $new_file . ", ";
114
+ }
115
+ }
116
+ $data_temp[stripslashes($label_titles[$h])] = $file_names;
117
+ }
118
+ elseif (strpos($element_value, "***br***")) {
119
+ $element_value = str_replace("***br***", ', ', $element_value);
120
+ if (strpos($element_value, "***quantity***")) {
121
+ $element_value = str_replace("***quantity***", '', $element_value);
122
+ }
123
+ if (strpos($element_value, "***property***")) {
124
+ $element_value = str_replace("***property***", '', $element_value);
125
+ }
126
+ if(substr($element_value, -2) == ', ') {
127
+ $data_temp[stripslashes($label_titles[$h])]= substr($element_value, 0, -2);
128
+ }
129
+ else {
130
+ $data_temp[stripslashes($label_titles[$h])]= $element_value;
131
+ }
132
+ }
133
+ elseif (strpos($element_value, "***map***")) {
134
+ $data_temp[stripslashes($label_titles[$h])] = 'Longitude:' . str_replace("***map***", ', Latitude:', $element_value);
135
+ }
136
+ elseif (strpos($element_value, "***star_rating***")) {
137
+ $element = str_replace("***star_rating***", '', $element_value);
138
+ $element = explode("***", $element);
139
+ $data_temp[stripslashes($label_titles[$h])] = ' ' . $element[1] . '/' . $element[0];
140
+ }
141
+ elseif (strpos($element_value, "@@@") || $element_value == "@@@" || $element_value == "@@@@@@@@@") {
142
+ $data_temp[stripslashes($label_titles[$h])] = str_replace("@@@", ' ', $element_value);
143
+ }
144
+ elseif (strpos($element_value, "***grading***")) {
145
+ $element = str_replace("***grading***", '', $element_value);
146
+ $grading = explode(":", $element);
147
+ $items_count = sizeof($grading) - 1;
148
+ $items = "";
149
+ $total = "";
150
+ for ($k = 0; $k < $items_count / 2; $k++) {
151
+ $items .= $grading[$items_count / 2 + $k] . ": " . $grading[$k] . ", ";
152
+ $total += $grading[$k];
153
+ }
154
+ $items .= "Total: " . $total;
155
+ $data_temp[stripslashes($label_titles[$h])] = $items;
156
+ }
157
+ elseif (strpos($element_value, "***matrix***")) {
158
+ $element = str_replace("***matrix***", '', $element_value);
159
+ $matrix_value = explode('***', $element);
160
+ $matrix_value = array_slice($matrix_value, 0, count($matrix_value) - 1);
161
+ $mat_rows = $matrix_value[0];
162
+ $mat_columns = $matrix_value[$mat_rows + 1];
163
+ $matrix = "";
164
+ $aaa = array();
165
+ $var_checkbox = 1;
166
+ $selected_value = "";
167
+ $selected_value_yes = "";
168
+ $selected_value_no = "";
169
+ for ($k = 1; $k <= $mat_rows; $k++) {
170
+ if ($matrix_value[$mat_rows + $mat_columns + 2] == "radio") {
171
+ if ($matrix_value[$mat_rows + $mat_columns + 2 + $k] == 0) {
172
+ $checked = "0";
173
+ $aaa[1] = "";
174
+ }
175
+ else {
176
+ $aaa = explode("_", $matrix_value[$mat_rows + $mat_columns + 2 + $k]);
177
+ }
178
+ for ($l = 1; $l <= $mat_columns; $l++) {
179
+ $checked = $aaa[1] == $l ? '1' : '0';
180
+ $matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$checked."; ";
181
+ }
182
+ }
183
+ else {
184
+ if ($matrix_value[$mat_rows+$mat_columns + 2] == "checkbox") {
185
+ for ($l = 1; $l <= $mat_columns; $l++) {
186
+ $checked = $matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox] == 1 ? '1' : '0';
187
+ $matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$checked."; ";
188
+ $var_checkbox++;
189
+ }
190
+ }
191
+ else {
192
+ if ($matrix_value[$mat_rows+$mat_columns + 2] == "text") {
193
+ for ($l = 1; $l <= $mat_columns; $l++) {
194
+ $text_value = $matrix_value[$mat_rows+$mat_columns+2+$var_checkbox];
195
+ $matrix .='['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$text_value."; ";
196
+ $var_checkbox++;
197
+ }
198
+ }
199
+ else {
200
+ for ($l = 1; $l <= $mat_columns; $l++) {
201
+ $selected_text = $matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox];
202
+ $matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows + 1 + $l].']='.$selected_text."; ";
203
+ $var_checkbox++;
204
+ }
205
+ }
206
+ }
207
+ }
208
+ }
209
+ $data_temp[stripslashes($label_titles[$h])] = $matrix;
210
+ }
211
+ else {
212
+ $val = htmlspecialchars_decode($element_value);
213
+ $val = stripslashes(str_replace('&#039;', "'", $val));
214
+ $data_temp[stripslashes($label_titles[$h])] = ($element_value ? $val : '');
215
+ }
216
+ }
217
+ else
218
+ $data_temp[stripslashes($label_titles[$h])] = '';
219
+ }
220
+
221
+ $query = $wpdb->prepare("SELECT id FROM " . $wpdb->prefix . "formmaker_submits where element_label=%s AND form_id = %d AND group_id=%d",'item_total', $form_id, $i);
222
+ $is_paypal = $wpdb->get_results($query);
223
+
224
+ if($is_paypal) {
225
+ $item_total = $wpdb->get_var($wpdb->prepare("SELECT `element_value` FROM " . $wpdb->prefix . "formmaker_submits where group_id=%d AND element_label=%s", $i, 'item_total'));
226
+ $total = $wpdb->get_var($wpdb->prepare("SELECT `element_value` FROM " . $wpdb->prefix . "formmaker_submits where group_id=%d AND element_label=%s", $i, 'total'));
227
+ $payment_status = $wpdb->get_var($wpdb->prepare("SELECT `element_value` FROM " . $wpdb->prefix . "formmaker_submits where group_id=%d AND element_label=%s", $i, '0'));
228
+ $data_temp['Item Total'] = $item_total;
229
+ $data_temp['Total'] = $total;
230
+ $data_temp['Payment Status'] = $payment_status;
231
+ }
232
+ $query = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker_sessions where group_id=%d",$i);
233
+ $paypal_info = $wpdb->get_results($query);
234
+ if ($paypal_info) {
235
+ $is_paypal_info = TRUE;
236
+ }
237
+ if ($is_paypal) {
238
+ foreach ($paypal_info_fields as $key=>$paypal_info_field) {
239
+ if ($paypal_info) {
240
+ $data_temp['PAYPAL_'.$paypal_info_labels[$key]]=$paypal_info[0]->$paypal_info_field;
241
+ }
242
+ else {
243
+ $data_temp['PAYPAL_'.$paypal_info_labels[$key]]='';
244
+ }
245
+ }
246
+ }
247
+
248
+ $data[$i] = $data_temp;
249
+ }
250
+ }
251
+
252
+ array_push($params, $data);
253
+ array_push($params, $title);
254
+ array_push($params, $is_paypal_info);
255
+
256
+ return $params;
257
+
258
+ }
259
+
260
+
261
+ ////////////////////////////////////////////////////////////////////////////////////////
262
+ // Getters & Setters //
263
+ ////////////////////////////////////////////////////////////////////////////////////////
264
+ ////////////////////////////////////////////////////////////////////////////////////////
265
+ // Private Methods //
266
+ ////////////////////////////////////////////////////////////////////////////////////////
267
+ ////////////////////////////////////////////////////////////////////////////////////////
268
+ // Listeners //
269
+ ////////////////////////////////////////////////////////////////////////////////////////
270
  }
admin/models/FMModelGenerete_xml.php CHANGED
@@ -1,276 +1,276 @@
1
- <?php
2
-
3
- class FMModelGenerete_xml {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
-
22
- public function get_data() {
23
- global $wpdb;
24
- $is_paypal_info = FALSE;
25
- $params = array();
26
- $group_id_s = array();
27
- $form_id = (int)$_REQUEST['form_id'];
28
- $limitstart = (int)$_REQUEST['limitstart'];
29
-
30
- $paypal_info_fields = array('currency', 'ord_last_modified', 'status', 'full_name', 'fax', 'mobile_phone', 'email', 'phone', 'address', 'paypal_info', 'ipn', 'tax', 'shipping');
31
- $paypal_info_labels = array( 'Currency', 'Last modified', 'Status', 'Full Name', 'Fax', 'Mobile phone', 'Email', 'Phone', 'Address', 'Paypal info', 'IPN', 'Tax', 'Shipping');
32
-
33
- $query = $wpdb->prepare("SELECT distinct group_id FROM " . $wpdb->prefix . "formmaker_submits where form_id=%d", $form_id);
34
- $group_id_s = $wpdb->get_col($query);
35
-
36
- $query = $wpdb->prepare("SELECT distinct element_label FROM " . $wpdb->prefix . "formmaker_submits where form_id=%d",$form_id);
37
- $labels = $wpdb->get_col($query);
38
-
39
- $query_lable = $wpdb->prepare("SELECT label_order,title FROM " . $wpdb->prefix . "formmaker where id=%d", $form_id);
40
- $rows_lable = $wpdb->get_results($query_lable);
41
- $ptn = "/[^a-zA-Z0-9_]/";
42
- $rpltxt = "";
43
- $title = isset($rows_lable[0]) ? preg_replace($ptn, $rpltxt, $rows_lable[0]->title) : '';
44
-
45
- $sorted_labels_id = array();
46
- $sorted_labels = array();
47
- $label_titles = array();
48
- $label_id = array();
49
- $label_order = array();
50
- $label_order_original = array();
51
- $label_type = array();
52
- if ($labels) {
53
- $label_all = explode('#****#', $rows_lable[0]->label_order);
54
- $label_all = array_slice($label_all, 0, count($label_all) - 1);
55
- foreach ($label_all as $key => $label_each) {
56
- $label_id_each = explode('#**id**#', $label_each);
57
- array_push($label_id, $label_id_each[0]);
58
- $label_oder_each = explode('#**label**#', $label_id_each[1]);
59
- array_push($label_order_original, $label_oder_each[0]);
60
- $label_temp = preg_replace($ptn, $rpltxt, $label_oder_each[0]);
61
- array_push($label_order, $label_temp);
62
- array_push($label_type, $label_oder_each[1]);
63
- }
64
- foreach ($label_id as $key => $label) {
65
- if (in_array($label, $labels) && $label_type[$key] !='type_arithmetic_captcha') {
66
- array_push($sorted_labels, $label_order[$key]);
67
- array_push($sorted_labels_id, $label);
68
- array_push($label_titles, stripslashes($label_order_original[$key]));
69
- }
70
- }
71
- }
72
-
73
- $m = count($sorted_labels);
74
-
75
- $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 GROUP BY group_id ORDER BY date ASC limit %d, %d", $form_id, $limitstart, 1000);
76
- $rows = $wpdb->get_results($query, OBJECT_K);
77
-
78
- $data = array();
79
- $group_id_s_count = $limitstart + 1000 < count($group_id_s) ? $limitstart + 1000 : count($group_id_s);
80
-
81
- for ($www = $limitstart; $www < $group_id_s_count; $www++) {
82
- $i = $group_id_s[$www];
83
- $field_key = array_search($i, $label_id);
84
- if($label_type[$field_key] != 'type_arithmetic_captcha') {
85
- $data_temp = array();
86
- $tt = $rows[$i];
87
-
88
- $date = $tt->date;
89
- $ip = $tt->ip;
90
- $user_id = get_userdata($tt->user_id_wd);
91
- $username = $user_id ? $user_id->display_name : "";
92
- $useremail = $user_id ? $user_id->user_email : "";
93
- $data_temp['Submit date'] = $date;
94
- $data_temp['Ip']=$ip;
95
- $data_temp['Submitter\'s Username']=$username;
96
- $data_temp['Submitter\'s Email Address']=$useremail;
97
-
98
- $element_labels = explode(',', $tt->element_label);
99
- $element_values = explode('*:*el_value*:*', $tt->element_value);
100
- for ($h = 0; $h < $m; $h++) {
101
- if(isset($data_temp[$label_titles[$h]]))
102
- $label_titles[$h] .= '(1)';
103
-
104
- if(in_array($sorted_labels_id[$h], $element_labels)) {
105
- $element_value = $element_values[array_search($sorted_labels_id[$h], $element_labels)];
106
-
107
- if (strpos($element_value, "*@@url@@*")) {
108
- $file_names = '';
109
- $new_files = explode("*@@url@@*", $element_value);
110
- foreach ($new_files as $new_file) {
111
- if ($new_file) {
112
- $file_names .= $new_file . ", ";
113
- }
114
- }
115
- $data_temp[stripslashes($label_titles[$h])] = $file_names;
116
- }
117
- elseif (strpos($element_value, "***br***")) {
118
- $element_value = str_replace("***br***", ', ', $element_value);
119
- if (strpos($element_value, "***quantity***")) {
120
- $element_value = str_replace("***quantity***", '', $element_value);
121
- }
122
- if (strpos($element_value, "***property***")) {
123
- $element_value = str_replace("***property***", '', $element_value);
124
- }
125
- if(substr($element_value, -2) == ', ') {
126
- $data_temp[stripslashes($label_titles[$h])]= substr($element_value, 0, -2);
127
- }
128
- else {
129
- $data_temp[stripslashes($label_titles[$h])]= $element_value;
130
- }
131
- }
132
- elseif (strpos($element_value, "***map***")) {
133
- $data_temp[stripslashes($label_titles[$h])] = 'Longitude:' . str_replace("***map***", ', Latitude:', $element_value);
134
- }
135
- elseif (strpos($element_value, "***star_rating***")) {
136
- $element = str_replace("***star_rating***", '', $element_value);
137
- $element = explode("***", $element);
138
- $data_temp[stripslashes($label_titles[$h])] = ' ' . $element[1] . '/' . $element[0];
139
- }
140
- elseif (strpos($element_value, "@@@") || $element_value == "@@@" || $element_value == "@@@@@@@@@") {
141
- $data_temp[stripslashes($label_titles[$h])] = str_replace("@@@", ' ', $element_value);
142
- }
143
- elseif (strpos($element_value, "***grading***")) {
144
- $element = str_replace("***grading***", '', $element_value);
145
- $grading = explode(":", $element);
146
- $items_count = sizeof($grading) - 1;
147
- $items = "";
148
- $total = "";
149
- for ($k = 0; $k < $items_count / 2; $k++) {
150
- $items .= $grading[$items_count / 2 + $k] . ": " . $grading[$k] . ", ";
151
- $total += $grading[$k];
152
- }
153
- $items .= "Total: " . $total;
154
- $data_temp[stripslashes($label_titles[$h])] = $items;
155
- }
156
- elseif (strpos($element_value, "***matrix***")) {
157
- $element = str_replace("***matrix***", '', $element_value);
158
- $matrix_value = explode('***', $element);
159
- $matrix_value = array_slice($matrix_value, 0, count($matrix_value) - 1);
160
- $mat_rows = $matrix_value[0];
161
- $mat_columns = $matrix_value[$mat_rows + 1];
162
- $matrix = "";
163
- $aaa = array();
164
- $var_checkbox = 1;
165
- $selected_value = "";
166
- $selected_value_yes = "";
167
- $selected_value_no = "";
168
- for ($k = 1; $k <= $mat_rows; $k++) {
169
- if ($matrix_value[$mat_rows + $mat_columns + 2] == "radio") {
170
- if ($matrix_value[$mat_rows + $mat_columns + 2 + $k] == 0) {
171
- $checked = "0";
172
- $aaa[1] = "";
173
- }
174
- else {
175
- $aaa = explode("_", $matrix_value[$mat_rows + $mat_columns + 2 + $k]);
176
- }
177
- for ($l = 1; $l <= $mat_columns; $l++) {
178
- $checked = $aaa[1] == $l ? '1' : '0';
179
- $matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$checked."; ";
180
- }
181
- }
182
- else {
183
- if ($matrix_value[$mat_rows+$mat_columns + 2] == "checkbox") {
184
- for ($l = 1; $l <= $mat_columns; $l++) {
185
- $checked = $matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox] == 1 ? '1' : '0';
186
- $matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$checked."; ";
187
- $var_checkbox++;
188
- }
189
- }
190
- else {
191
- if ($matrix_value[$mat_rows+$mat_columns + 2] == "text") {
192
- for ($l = 1; $l <= $mat_columns; $l++) {
193
- $text_value = $matrix_value[$mat_rows+$mat_columns+2+$var_checkbox];
194
- $matrix .='['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$text_value."; ";
195
- $var_checkbox++;
196
- }
197
- }
198
- else {
199
- for ($l = 1; $l <= $mat_columns; $l++) {
200
- $selected_text = $matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox];
201
- $matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows + 1 + $l].']='.$selected_text."; ";
202
- $var_checkbox++;
203
- }
204
- }
205
- }
206
- }
207
- }
208
- $data_temp[stripslashes($label_titles[$h])] = $matrix;
209
- }
210
- else {
211
- $val = htmlspecialchars_decode($element_value);
212
- $val = stripslashes(str_replace('&#039;', "'", $val));
213
- $data_temp[stripslashes($label_titles[$h])] = ($element_value ? $val : '');
214
- }
215
- }
216
- else
217
- $data_temp[stripslashes($label_titles[$h])] = '';
218
- }
219
-
220
- $item_total = $wpdb->get_var($wpdb->prepare("SELECT `element_value` FROM " . $wpdb->prefix . "formmaker_submits where group_id=%d AND element_label=%s",$i,'item_total'));
221
-
222
- $total = $wpdb->get_var($wpdb->prepare("SELECT `element_value` FROM " . $wpdb->prefix . "formmaker_submits where group_id=%d AND element_label=%s",$i,'total'));
223
-
224
- $payment_status = $wpdb->get_var($wpdb->prepare("SELECT `element_value` FROM " . $wpdb->prefix . "formmaker_submits where group_id=%d AND element_label=%s",$i,'0'));
225
-
226
-
227
- if($item_total)
228
- $data_temp['Item Total'] = $item_total;
229
-
230
- if($total)
231
- $data_temp['Total'] = $total;
232
-
233
- if($payment_status)
234
- $data_temp['Payment Status'] = $payment_status;
235
-
236
- $query = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker_sessions where group_id= %d", $i);
237
-
238
-
239
-
240
- $paypal_info = $wpdb->get_results($query);
241
- if ($paypal_info) {
242
- $is_paypal_info = TRUE;
243
- }
244
- if ($is_paypal_info) {
245
- foreach ($paypal_info_fields as $key=>$paypal_info_field) {
246
- if ($paypal_info) {
247
- $data_temp['PAYPAL_' . $paypal_info_labels[$key]] = $paypal_info[0]->$paypal_info_field;
248
- }
249
- else {
250
- $data_temp['PAYPAL_' . $paypal_info_labels[$key]] = '';
251
- }
252
- }
253
- }
254
-
255
- $data[$i] = $data_temp;
256
- }
257
- }
258
-
259
- array_push($params, $data);
260
- array_push($params, $title);
261
- array_push($params, $is_paypal_info);
262
-
263
- return $params;
264
-
265
- }
266
-
267
- ////////////////////////////////////////////////////////////////////////////////////////
268
- // Getters & Setters //
269
- ////////////////////////////////////////////////////////////////////////////////////////
270
- ////////////////////////////////////////////////////////////////////////////////////////
271
- // Private Methods //
272
- ////////////////////////////////////////////////////////////////////////////////////////
273
- ////////////////////////////////////////////////////////////////////////////////////////
274
- // Listeners //
275
- ////////////////////////////////////////////////////////////////////////////////////////
276
  }
1
+ <?php
2
+
3
+ class FMModelGenerete_xml {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
22
+ public function get_data() {
23
+ global $wpdb;
24
+ $is_paypal_info = FALSE;
25
+ $params = array();
26
+ $group_id_s = array();
27
+ $form_id = (int)$_REQUEST['form_id'];
28
+ $limitstart = (int)$_REQUEST['limitstart'];
29
+
30
+ $paypal_info_fields = array('currency', 'ord_last_modified', 'status', 'full_name', 'fax', 'mobile_phone', 'email', 'phone', 'address', 'paypal_info', 'ipn', 'tax', 'shipping');
31
+ $paypal_info_labels = array( 'Currency', 'Last modified', 'Status', 'Full Name', 'Fax', 'Mobile phone', 'Email', 'Phone', 'Address', 'Paypal info', 'IPN', 'Tax', 'Shipping');
32
+
33
+ $query = $wpdb->prepare("SELECT distinct group_id FROM " . $wpdb->prefix . "formmaker_submits where form_id=%d", $form_id);
34
+ $group_id_s = $wpdb->get_col($query);
35
+
36
+ $query = $wpdb->prepare("SELECT distinct element_label FROM " . $wpdb->prefix . "formmaker_submits where form_id=%d",$form_id);
37
+ $labels = $wpdb->get_col($query);
38
+
39
+ $query_lable = $wpdb->prepare("SELECT label_order,title FROM " . $wpdb->prefix . "formmaker where id=%d", $form_id);
40
+ $rows_lable = $wpdb->get_results($query_lable);
41
+ $ptn = "/[^a-zA-Z0-9_]/";
42
+ $rpltxt = "";
43
+ $title = isset($rows_lable[0]) ? preg_replace($ptn, $rpltxt, $rows_lable[0]->title) : '';
44
+
45
+ $sorted_labels_id = array();
46
+ $sorted_labels = array();
47
+ $label_titles = array();
48
+ $label_id = array();
49
+ $label_order = array();
50
+ $label_order_original = array();
51
+ $label_type = array();
52
+ if ($labels) {
53
+ $label_all = explode('#****#', $rows_lable[0]->label_order);
54
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
55
+ foreach ($label_all as $key => $label_each) {
56
+ $label_id_each = explode('#**id**#', $label_each);
57
+ array_push($label_id, $label_id_each[0]);
58
+ $label_oder_each = explode('#**label**#', $label_id_each[1]);
59
+ array_push($label_order_original, $label_oder_each[0]);
60
+ $label_temp = preg_replace($ptn, $rpltxt, $label_oder_each[0]);
61
+ array_push($label_order, $label_temp);
62
+ array_push($label_type, $label_oder_each[1]);
63
+ }
64
+ foreach ($label_id as $key => $label) {
65
+ if (in_array($label, $labels) && $label_type[$key] !='type_arithmetic_captcha') {
66
+ array_push($sorted_labels, $label_order[$key]);
67
+ array_push($sorted_labels_id, $label);
68
+ array_push($label_titles, stripslashes($label_order_original[$key]));
69
+ }
70
+ }
71
+ }
72
+
73
+ $m = count($sorted_labels);
74
+
75
+ $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 GROUP BY group_id ORDER BY date ASC limit %d, %d", $form_id, $limitstart, 1000);
76
+ $rows = $wpdb->get_results($query, OBJECT_K);
77
+
78
+ $data = array();
79
+ $group_id_s_count = $limitstart + 1000 < count($group_id_s) ? $limitstart + 1000 : count($group_id_s);
80
+
81
+ for ($www = $limitstart; $www < $group_id_s_count; $www++) {
82
+ $i = $group_id_s[$www];
83
+ $field_key = array_search($i, $label_id);
84
+ if($label_type[$field_key] != 'type_arithmetic_captcha') {
85
+ $data_temp = array();
86
+ $tt = $rows[$i];
87
+
88
+ $date = $tt->date;
89
+ $ip = $tt->ip;
90
+ $user_id = get_userdata($tt->user_id_wd);
91
+ $username = $user_id ? $user_id->display_name : "";
92
+ $useremail = $user_id ? $user_id->user_email : "";
93
+ $data_temp['Submit date'] = $date;
94
+ $data_temp['Ip']=$ip;
95
+ $data_temp['Submitter\'s Username']=$username;
96
+ $data_temp['Submitter\'s Email Address']=$useremail;
97
+
98
+ $element_labels = explode(',', $tt->element_label);
99
+ $element_values = explode('*:*el_value*:*', $tt->element_value);
100
+ for ($h = 0; $h < $m; $h++) {
101
+ if(isset($data_temp[$label_titles[$h]]))
102
+ $label_titles[$h] .= '(1)';
103
+
104
+ if(in_array($sorted_labels_id[$h], $element_labels)) {
105
+ $element_value = $element_values[array_search($sorted_labels_id[$h], $element_labels)];
106
+
107
+ if (strpos($element_value, "*@@url@@*")) {
108
+ $file_names = '';
109
+ $new_files = explode("*@@url@@*", $element_value);
110
+ foreach ($new_files as $new_file) {
111
+ if ($new_file) {
112
+ $file_names .= $new_file . ", ";
113
+ }
114
+ }
115
+ $data_temp[stripslashes($label_titles[$h])] = $file_names;
116
+ }
117
+ elseif (strpos($element_value, "***br***")) {
118
+ $element_value = str_replace("***br***", ', ', $element_value);
119
+ if (strpos($element_value, "***quantity***")) {
120
+ $element_value = str_replace("***quantity***", '', $element_value);
121
+ }
122
+ if (strpos($element_value, "***property***")) {
123
+ $element_value = str_replace("***property***", '', $element_value);
124
+ }
125
+ if(substr($element_value, -2) == ', ') {
126
+ $data_temp[stripslashes($label_titles[$h])]= substr($element_value, 0, -2);
127
+ }
128
+ else {
129
+ $data_temp[stripslashes($label_titles[$h])]= $element_value;
130
+ }
131
+ }
132
+ elseif (strpos($element_value, "***map***")) {
133
+ $data_temp[stripslashes($label_titles[$h])] = 'Longitude:' . str_replace("***map***", ', Latitude:', $element_value);
134
+ }
135
+ elseif (strpos($element_value, "***star_rating***")) {
136
+ $element = str_replace("***star_rating***", '', $element_value);
137
+ $element = explode("***", $element);
138
+ $data_temp[stripslashes($label_titles[$h])] = ' ' . $element[1] . '/' . $element[0];
139
+ }
140
+ elseif (strpos($element_value, "@@@") || $element_value == "@@@" || $element_value == "@@@@@@@@@") {
141
+ $data_temp[stripslashes($label_titles[$h])] = str_replace("@@@", ' ', $element_value);
142
+ }
143
+ elseif (strpos($element_value, "***grading***")) {
144
+ $element = str_replace("***grading***", '', $element_value);
145
+ $grading = explode(":", $element);
146
+ $items_count = sizeof($grading) - 1;
147
+ $items = "";
148
+ $total = "";
149
+ for ($k = 0; $k < $items_count / 2; $k++) {
150
+ $items .= $grading[$items_count / 2 + $k] . ": " . $grading[$k] . ", ";
151
+ $total += $grading[$k];
152
+ }
153
+ $items .= "Total: " . $total;
154
+ $data_temp[stripslashes($label_titles[$h])] = $items;
155
+ }
156
+ elseif (strpos($element_value, "***matrix***")) {
157
+ $element = str_replace("***matrix***", '', $element_value);
158
+ $matrix_value = explode('***', $element);
159
+ $matrix_value = array_slice($matrix_value, 0, count($matrix_value) - 1);
160
+ $mat_rows = $matrix_value[0];
161
+ $mat_columns = $matrix_value[$mat_rows + 1];
162
+ $matrix = "";
163
+ $aaa = array();
164
+ $var_checkbox = 1;
165
+ $selected_value = "";
166
+ $selected_value_yes = "";
167
+ $selected_value_no = "";
168
+ for ($k = 1; $k <= $mat_rows; $k++) {
169
+ if ($matrix_value[$mat_rows + $mat_columns + 2] == "radio") {
170
+ if ($matrix_value[$mat_rows + $mat_columns + 2 + $k] == 0) {
171
+ $checked = "0";
172
+ $aaa[1] = "";
173
+ }
174
+ else {
175
+ $aaa = explode("_", $matrix_value[$mat_rows + $mat_columns + 2 + $k]);
176
+ }
177
+ for ($l = 1; $l <= $mat_columns; $l++) {
178
+ $checked = $aaa[1] == $l ? '1' : '0';
179
+ $matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$checked."; ";
180
+ }
181
+ }
182
+ else {
183
+ if ($matrix_value[$mat_rows+$mat_columns + 2] == "checkbox") {
184
+ for ($l = 1; $l <= $mat_columns; $l++) {
185
+ $checked = $matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox] == 1 ? '1' : '0';
186
+ $matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$checked."; ";
187
+ $var_checkbox++;
188
+ }
189
+ }
190
+ else {
191
+ if ($matrix_value[$mat_rows+$mat_columns + 2] == "text") {
192
+ for ($l = 1; $l <= $mat_columns; $l++) {
193
+ $text_value = $matrix_value[$mat_rows+$mat_columns+2+$var_checkbox];
194
+ $matrix .='['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$text_value."; ";
195
+ $var_checkbox++;
196
+ }
197
+ }
198
+ else {
199
+ for ($l = 1; $l <= $mat_columns; $l++) {
200
+ $selected_text = $matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox];
201
+ $matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows + 1 + $l].']='.$selected_text."; ";
202
+ $var_checkbox++;
203
+ }
204
+ }
205
+ }
206
+ }
207
+ }
208
+ $data_temp[stripslashes($label_titles[$h])] = $matrix;
209
+ }
210
+ else {
211
+ $val = htmlspecialchars_decode($element_value);
212
+ $val = stripslashes(str_replace('&#039;', "'", $val));
213
+ $data_temp[stripslashes($label_titles[$h])] = ($element_value ? $val : '');
214
+ }
215
+ }
216
+ else
217
+ $data_temp[stripslashes($label_titles[$h])] = '';
218
+ }
219
+
220
+ $item_total = $wpdb->get_var($wpdb->prepare("SELECT `element_value` FROM " . $wpdb->prefix . "formmaker_submits where group_id=%d AND element_label=%s",$i,'item_total'));
221
+
222
+ $total = $wpdb->get_var($wpdb->prepare("SELECT `element_value` FROM " . $wpdb->prefix . "formmaker_submits where group_id=%d AND element_label=%s",$i,'total'));
223
+
224
+ $payment_status = $wpdb->get_var($wpdb->prepare("SELECT `element_value` FROM " . $wpdb->prefix . "formmaker_submits where group_id=%d AND element_label=%s",$i,'0'));
225
+
226
+
227
+ if($item_total)
228
+ $data_temp['Item Total'] = $item_total;
229
+
230
+ if($total)
231
+ $data_temp['Total'] = $total;
232
+
233
+ if($payment_status)
234
+ $data_temp['Payment Status'] = $payment_status;
235
+
236
+ $query = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker_sessions where group_id= %d", $i);
237
+
238
+
239
+
240
+ $paypal_info = $wpdb->get_results($query);
241
+ if ($paypal_info) {
242
+ $is_paypal_info = TRUE;
243
+ }
244
+ if ($is_paypal_info) {
245
+ foreach ($paypal_info_fields as $key=>$paypal_info_field) {
246
+ if ($paypal_info) {
247
+ $data_temp['PAYPAL_' . $paypal_info_labels[$key]] = $paypal_info[0]->$paypal_info_field;
248
+ }
249
+ else {
250
+ $data_temp['PAYPAL_' . $paypal_info_labels[$key]] = '';
251
+ }
252
+ }
253
+ }
254
+
255
+ $data[$i] = $data_temp;
256
+ }
257
+ }
258
+
259
+ array_push($params, $data);
260
+ array_push($params, $title);
261
+ array_push($params, $is_paypal_info);
262
+
263
+ return $params;
264
+
265
+ }
266
+
267
+ ////////////////////////////////////////////////////////////////////////////////////////
268
+ // Getters & Setters //
269
+ ////////////////////////////////////////////////////////////////////////////////////////
270
+ ////////////////////////////////////////////////////////////////////////////////////////
271
+ // Private Methods //
272
+ ////////////////////////////////////////////////////////////////////////////////////////
273
+ ////////////////////////////////////////////////////////////////////////////////////////
274
+ // Listeners //
275
+ ////////////////////////////////////////////////////////////////////////////////////////
276
  }
admin/models/FMModelGoptions_fm.php CHANGED
@@ -1,30 +1,30 @@
1
- <?php
2
-
3
- class FMModelGoptions_fm {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- ////////////////////////////////////////////////////////////////////////////////////////
22
- // Getters & Setters //
23
- ////////////////////////////////////////////////////////////////////////////////////////
24
- ////////////////////////////////////////////////////////////////////////////////////////
25
- // Private Methods //
26
- ////////////////////////////////////////////////////////////////////////////////////////
27
- ////////////////////////////////////////////////////////////////////////////////////////
28
- // Listeners //
29
- ////////////////////////////////////////////////////////////////////////////////////////
30
  }
1
+ <?php
2
+
3
+ class FMModelGoptions_fm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ ////////////////////////////////////////////////////////////////////////////////////////
22
+ // Getters & Setters //
23
+ ////////////////////////////////////////////////////////////////////////////////////////
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ // Private Methods //
26
+ ////////////////////////////////////////////////////////////////////////////////////////
27
+ ////////////////////////////////////////////////////////////////////////////////////////
28
+ // Listeners //
29
+ ////////////////////////////////////////////////////////////////////////////////////////
30
  }
admin/models/FMModelLicensing_fm.php CHANGED
@@ -1,30 +1,30 @@
1
- <?php
2
-
3
- class FMModelLicensing_fm {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- ////////////////////////////////////////////////////////////////////////////////////////
22
- // Getters & Setters //
23
- ////////////////////////////////////////////////////////////////////////////////////////
24
- ////////////////////////////////////////////////////////////////////////////////////////
25
- // Private Methods //
26
- ////////////////////////////////////////////////////////////////////////////////////////
27
- ////////////////////////////////////////////////////////////////////////////////////////
28
- // Listeners //
29
- ////////////////////////////////////////////////////////////////////////////////////////
30
  }
1
+ <?php
2
+
3
+ class FMModelLicensing_fm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ ////////////////////////////////////////////////////////////////////////////////////////
22
+ // Getters & Setters //
23
+ ////////////////////////////////////////////////////////////////////////////////////////
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ // Private Methods //
26
+ ////////////////////////////////////////////////////////////////////////////////////////
27
+ ////////////////////////////////////////////////////////////////////////////////////////
28
+ // Listeners //
29
+ ////////////////////////////////////////////////////////////////////////////////////////
30
  }
admin/models/FMModelManage_fm.php CHANGED
@@ -1,2369 +1,2369 @@
1
- <?php
2
-
3
- class FMModelManage_fm {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function get_rows_data() {
22
- global $wpdb;
23
- $where = 'WHERE `id` NOT IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ')';
24
- $where .= ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? ' AND title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
25
- $asc_or_desc = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'desc') ? 'desc' : 'asc');
26
- $order_by_array = array('id', 'title', 'mail');
27
- $order_by = isset($_POST['order_by']) && in_array(esc_html(stripslashes($_POST['order_by'])), $order_by_array) ? esc_html(stripslashes($_POST['order_by'])) : 'id';
28
- $order_by = ' ORDER BY `' . $order_by . '` ' . $asc_or_desc;
29
- if (isset($_POST['page_number']) && $_POST['page_number']) {
30
- $limit = ((int) $_POST['page_number'] - 1) * 20;
31
- }
32
- else {
33
- $limit = 0;
34
- }
35
- $query = "SELECT * FROM " . $wpdb->prefix . "formmaker " . $where . $order_by . " LIMIT " . $limit . ",20";
36
- $rows = $wpdb->get_results($query);
37
- return $rows;
38
- }
39
-
40
- public function get_row_data($id) {
41
- global $wpdb;
42
- if ($id != 0) {
43
- $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
44
- }
45
- else {
46
- $row = new stdClass();
47
- $row->id = 0;
48
- $row->title = '';
49
- $row->mail = '';
50
- $row->form = '';
51
- $row->form_front = '';
52
- $row->theme = 0;
53
- $row->javascript = '';
54
- $row->submit_text = '';
55
- $row->url = '';
56
- $row->submit_text_type = 0;
57
- $row->script1 = '';
58
- $row->script2 = '';
59
- $row->script_user1 = '';
60
- $row->script_user2 = '';
61
- $row->counter = 0;
62
- $row->label_order = '';
63
- $row->article_id = '';
64
- $row->pagination = '';
65
- $row->show_title = '';
66
- $row->show_numbers = '';
67
- $row->public_key = '';
68
- $row->private_key = '';
69
- $row->recaptcha_theme = '';
70
- $row->from_name = '';
71
- $row->from_mail = '';
72
- $row->label_order_current = '';
73
- $row->script_mail_user = '';
74
- $row->script_mail = '';
75
- $row->tax = 0;
76
- $row->payment_currency = '$';
77
- $row->paypal_email = '';
78
- $row->checkout_mode = 'testmode';
79
- $row->paypal_mode = 0;
80
-
81
- $row->published = 1;
82
- $row->form_fields = '';
83
- $row->savedb = 1;
84
- $row->sendemail = 1;
85
- $row->requiredmark = '*';
86
- $row->reply_to = 0;
87
- $row->send_to = 0;
88
- $row->autogen_layout = 1;
89
- $row->custom_front = '';
90
- $row->mail_from_user = '';
91
- $row->mail_from_name_user = '';
92
- $row->reply_to_user = '';
93
- $row->save_uploads = 1;
94
- }
95
- return $row;
96
- }
97
-
98
- public function get_row_data_new($id) {
99
- global $wpdb;
100
- if ($id != 0) {
101
- $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_backup WHERE backup_id="%d"', $id));
102
- $labels2 = array();
103
- $label_id = array();
104
- $label_order_original = array();
105
- $label_type = array();
106
- $label_all = explode('#****#', $row->label_order);
107
- $label_all = array_slice($label_all, 0, count($label_all) - 1);
108
- foreach($label_all as $key => $label_each) {
109
- $label_id_each=explode('#**id**#',$label_each);
110
- array_push($label_id, $label_id_each[0]);
111
- $label_oder_each=explode('#**label**#', $label_id_each[1]);
112
- array_push($label_order_original, addslashes($label_oder_each[0]));
113
- array_push($label_type, $label_oder_each[1]);
114
- }
115
- $labels2['id'] = '"' . implode('","', $label_id) . '"';
116
- $labels2['label'] = '"' . implode('","', $label_order_original) . '"';
117
- $labels2['type'] = '"' . implode('","', $label_type) . '"';
118
- $ids = array();
119
- $types = array();
120
- $labels = array();
121
- $paramss = array();
122
- $fields = explode('*:*new_field*:*', $row->form_fields);
123
- $fields = array_slice($fields, 0, count($fields) - 1);
124
- foreach ($fields as $field) {
125
- $temp=explode('*:*id*:*',$field);
126
- array_push($ids, $temp[0]);
127
- $temp=explode('*:*type*:*',$temp[1]);
128
- array_push($types, $temp[0]);
129
- $temp=explode('*:*w_field_label*:*',$temp[1]);
130
- array_push($labels, $temp[0]);
131
- array_push($paramss, $temp[1]);
132
- }
133
- $form = $row->form_front;
134
- foreach ($ids as $ids_key => $id) {
135
- $label = $labels[$ids_key];
136
- $type = $types[$ids_key];
137
- $params = $paramss[$ids_key];
138
- if (strpos($form, '%'.$id.' - '.$label.'%') || strpos($form, '%'.$id.' -'.$label.'%')) {
139
- $rep = '';
140
- $arrows='';
141
- $param = array();
142
- $param['attributes'] = '';
143
- switch($type)
144
- {
145
- case 'type_section_break':
146
- {
147
- $arrows =$arrows.'<div id="wdform_arrows'.$id.'" class="wdform_arrows" ><div id="X_'.$id.'" class="element_toolbar"><img src="' . WD_FM_URL . '/images/delete_el.png?ver='. get_option("wd_form_maker_version").'" title="Remove the field" onclick="remove_section_break(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;delete_el&quot;)" onmouseout="chnage_icons_src(this,&quot;delete_el&quot;)"></div><div id="edit_'.$id.'" class="element_toolbar"><img src="' . WD_FM_URL . '/images/edit.png?ver='. get_option("wd_form_maker_version").'" title="Edit the field" onclick="edit(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;edit&quot;)" onmouseout="chnage_icons_src(this,&quot;edit&quot;)"><span id="'.$id.'_element_labelform_id_temp" style="display: none;">custom_'.$id.'</span></div><div id="duplicate_'.$id.'" class="element_toolbar"><img src="' . WD_FM_URL . '/images/duplicate.png?ver='. get_option("wd_form_maker_version").'" title="Duplicate the field" onclick="duplicate(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;duplicate&quot;)" onmouseout="chnage_icons_src(this,&quot;duplicate&quot;)"></div></div>';
148
- break;
149
- }
150
- case 'type_editor':
151
- {
152
- $arrows =$arrows.'<div id="wdform_arrows'.$id.'" class="wdform_arrows" type="type_editor" style="margin-top:0px;"><div id="X_'.$id.'" valign="middle" align="right" class="element_toolbar"><img src="' . WD_FM_URL . '/images/delete_el.png?ver='. get_option("wd_form_maker_version").'" title="Remove the field" onclick="remove_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;delete_el&quot;)" onmouseout="chnage_icons_src(this,&quot;delete_el&quot;)"></div><div id="left_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/left.png?ver='. get_option("wd_form_maker_version").'" title="Move the field to the left" onclick="left_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;left&quot;)" onmouseout="chnage_icons_src(this,&quot;left&quot;)"></div><div id="up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/up.png?ver='. get_option("wd_form_maker_version").'" title="Move the field up" onclick="up_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;up&quot;)" onmouseout="chnage_icons_src(this,&quot;up&quot;)"></div><div id="down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/down.png?ver='. get_option("wd_form_maker_version").'" title="Move the field down" onclick="down_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;down&quot;)" onmouseout="chnage_icons_src(this,&quot;down&quot;)"></div><div id="right_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/right.png?ver='. get_option("wd_form_maker_version").'" title="Move the field to the right" onclick="right_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;right&quot;)" onmouseout="chnage_icons_src(this,&quot;right&quot;)"></div><div id="edit_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/edit.png?ver='. get_option("wd_form_maker_version").'" title="Edit the field" onclick="edit(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;edit&quot;)" onmouseout="chnage_icons_src(this,&quot;edit&quot;)"></div><div id="duplicate_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/duplicate.png?ver='. get_option("wd_form_maker_version").'" title="Duplicate the field" onclick="duplicate(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;duplicate&quot;)" onmouseout="chnage_icons_src(this,&quot;duplicate&quot;)"></div><div id="page_up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_up.png?ver='. get_option("wd_form_maker_version").'" title="Move the field to the upper page" onclick="page_up(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;page_up&quot;)" onmouseout="chnage_icons_src(this,&quot;page_up&quot;)"></div><div id="page_down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_down.png?ver='. get_option("wd_form_maker_version").'" title="Move the field to the lower page" onclick="page_down(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;page_down&quot;)" onmouseout="chnage_icons_src(this,&quot;page_down&quot;)"></div></div>';
153
- break;
154
- }
155
-
156
- case 'type_send_copy':
157
- case 'type_captcha':
158
- case 'type_arithmetic_captcha':
159
- case 'type_recaptcha':
160
- {
161
- $arrows =$arrows.'<div id="wdform_arrows'.$id.'" class="wdform_arrows"><div id="X_'.$id.'" valign="middle" align="right" class="element_toolbar"><img src="' . WD_FM_URL . '/images/delete_el.png?ver='. get_option("wd_form_maker_version").'" title="Remove the field" onclick="remove_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;delete_el&quot;)" onmouseout="chnage_icons_src(this,&quot;delete_el&quot;)"></div><div id="left_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/left.png?ver='. get_option("wd_form_maker_version").'" title="Move the field to the left" onclick="left_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;left&quot;)" onmouseout="chnage_icons_src(this,&quot;left&quot;)"></div><div id="up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/up.png?ver='. get_option("wd_form_maker_version").'" title="Move the field up" onclick="up_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;up&quot;)" onmouseout="chnage_icons_src(this,&quot;up&quot;)"></div><div id="down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/down.png?ver='. get_option("wd_form_maker_version").'" title="Move the field down" onclick="down_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;down&quot;)" onmouseout="chnage_icons_src(this,&quot;down&quot;)"></div><div id="right_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/right.png?ver='. get_option("wd_form_maker_version").'" title="Move the field to the right" onclick="right_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;right&quot;)" onmouseout="chnage_icons_src(this,&quot;right&quot;)"></div><div id="edit_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/edit.png?ver='. get_option("wd_form_maker_version").'" title="Edit the field" onclick="edit(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;edit&quot;)" onmouseout="chnage_icons_src(this,&quot;edit&quot;)"></div><div id="duplicate_'.$id.'" valign="middle" class="element_toolbar"></div><div id="page_up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_up.png?ver='. get_option("wd_form_maker_version").'" title="Move the field to the upper page" onclick="page_up(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;page_up&quot;)" onmouseout="chnage_icons_src(this,&quot;page_up&quot;)"></div><div id="page_down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_down.png?ver='. get_option("wd_form_maker_version").'" title="Move the field to the lower page" onclick="page_down(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;page_down&quot;)" onmouseout="chnage_icons_src(this,&quot;page_down&quot;)"></div></div>';
162
- break;
163
- }
164
-
165
- default :
166
- {
167
- $arrows =$arrows.'<div id="wdform_arrows'.$id.'" class="wdform_arrows" ><div id="X_'.$id.'" valign="middle" align="right" class="element_toolbar"><img src="' . WD_FM_URL . '/images/delete_el.png?ver='. get_option("wd_form_maker_version").'" title="Remove the field" onclick="remove_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;delete_el&quot;)" onmouseout="chnage_icons_src(this,&quot;delete_el&quot;)"></div><div id="left_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/left.png?ver='. get_option("wd_form_maker_version").'" title="Move the field to the left" onclick="left_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;left&quot;)" onmouseout="chnage_icons_src(this,&quot;left&quot;)"></div><div id="up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/up.png?ver='. get_option("wd_form_maker_version").'" title="Move the field up" onclick="up_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;up&quot;)" onmouseout="chnage_icons_src(this,&quot;up&quot;)"></div><div id="down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/down.png?ver='. get_option("wd_form_maker_version").'" title="Move the field down" onclick="down_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;down&quot;)" onmouseout="chnage_icons_src(this,&quot;down&quot;)"></div><div id="right_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/right.png?ver='. get_option("wd_form_maker_version").'" title="Move the field to the right" onclick="right_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;right&quot;)" onmouseout="chnage_icons_src(this,&quot;right&quot;)"></div><div id="edit_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/edit.png?ver='. get_option("wd_form_maker_version").'" title="Edit the field" onclick="edit(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;edit&quot;)" onmouseout="chnage_icons_src(this,&quot;edit&quot;)"></div><div id="duplicate_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/duplicate.png?ver='. get_option("wd_form_maker_version").'" title="Duplicate the field" onclick="duplicate(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;duplicate&quot;)" onmouseout="chnage_icons_src(this,&quot;duplicate&quot;)"></div><div id="page_up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_up.png?ver='. get_option("wd_form_maker_version").'" title="Move the field to the upper page" onclick="page_up(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;page_up&quot;)" onmouseout="chnage_icons_src(this,&quot;page_up&quot;)"></div><div id="page_down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_down.png?ver='. get_option("wd_form_maker_version").'" title="Move the field to the lower page" onclick="page_down(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;page_down&quot;)" onmouseout="chnage_icons_src(this,&quot;page_down&quot;)"></div></div>';
168
- break;
169
- }
170
-
171
- }
172
- switch ($type) {
173
- case 'type_section_break': {
174
- $params_names = array('w_editor');
175
- $temp = $params;
176
- foreach ($params_names as $params_name) {
177
- $temp = explode('*:*' . $params_name . '*:*', $temp);
178
- $param[$params_name] = $temp[0];
179
- $temp = $temp[1];
180
- }
181
- $rep ='<div id="wdform_field'.$id.'" type="type_section_break" class="wdform_field_section_break">'.$arrows.'<span id="'.$id.'_element_labelform_id_temp" style="display: none;">custom_'.$id.'</span><div id="'.$id.'_element_sectionform_id_temp" align="left" class="wdform_section_break">'.$param['w_editor'].'</div></div><div id="'.$id.'_element_labelform_id_temp" style="color:red;">custom_'.$id.'</div>';
182
- break;
183
- }
184
- case 'type_editor': {
185
- $params_names = array('w_editor');
186
- $temp = $params;
187
- foreach ($params_names as $params_name ) {
188
- $temp = explode('*:*' . $params_name . '*:*', $temp);
189
- $param[$params_name] = $temp[0];
190
- $temp = $temp[1];
191
- }
192
- $rep =$arrows.'<div id="wdform_field'.$id.'" type="type_editor" class="wdform_field" >'.$param['w_editor'].'</div><div id="'.$id.'_element_labelform_id_temp" style="color: red;">custom_'.$id.'</div>';
193
- break;
194
- }
195
- case 'type_send_copy': {
196
- $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_required');
197
- $temp = $params;
198
- foreach ($params_names as $params_name ) {
199
- $temp = explode('*:*' . $params_name . '*:*', $temp);
200
- $param[$params_name] = $temp[0];
201
- $temp = $temp[1];
202
- }
203
- if ($temp) {
204
- $temp = explode('*:*w_attr_name*:*', $temp);
205
- $attrs = array_slice($temp, 0, count($temp) - 1);
206
- foreach ($attrs as $attr) {
207
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
208
- }
209
- }
210
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
211
- $input_active = ($param['w_first_val'] == 'true' ? "checked='checked'" : "");
212
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
213
- $rep ='<div id="wdform_field'.$id.'" type="type_send_copy" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" 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" style="display: '.$param['w_field_label_pos'].'"><input type="hidden" value="type_send_copy" 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="checkbox" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" onclick="set_checked(&quot;'.$id.'&quot;,&quot;&quot;,&quot;form_id_temp&quot;)" '.$input_active.' '.$param['attributes'].' disabled /></div></div>';
214
- break;
215
- }
216
- case 'type_text': {
217
- $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_first_val', 'w_title', 'w_required', 'w_unique');
218
- $temp = $params;
219
- if(strpos($temp, 'w_regExp_status') > -1)
220
- $params_names = array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_required', 'w_regExp_status', 'w_regExp_value', 'w_regExp_common', 'w_regExp_arg', 'w_regExp_alert', 'w_unique');
221
- foreach ($params_names as $params_name) {
222
- $temp = explode('*:*' . $params_name . '*:*', $temp);
223
- $param[$params_name] = $temp[0];
224
- $temp = $temp[1];
225
- }
226
- if ($temp) {
227
- $temp = explode('*:*w_attr_name*:*', $temp);
228
- $attrs = array_slice($temp, 0, count($temp) - 1);
229
- foreach ($attrs as $attr) {
230
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
231
- }
232
- }
233
-
234
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
235
- $input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
236
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
237
-
238
- $param['w_regExp_status'] = (isset($param['w_regExp_status']) ? $param['w_regExp_status'] : "no");
239
- $param['w_regExp_value'] = (isset($param['w_regExp_value']) ? $param['w_regExp_value'] : "");
240
- $param['w_regExp_common'] = (isset($param['w_regExp_common']) ? $param['w_regExp_common'] : "");
241
- $param['w_regExp_arg'] = (isset($param['w_regExp_arg']) ? $param['w_regExp_arg'] : "");
242
- $param['w_regExp_alert'] = (isset($param['w_regExp_alert']) ? $param['w_regExp_alert'] : "Incorrect Value");
243
-
244
- $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: '.$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" 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_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" class="'.$input_active.'" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" value="'.$param['w_first_val'].'" title="'.$param['w_title'].'" onfocus="delete_value(&quot;'.$id.'_elementform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_elementform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_elementform_id_temp&quot;)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled /></div></div>';
245
-
246
- break;
247
- }
248
- case 'type_number': {
249
- $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_first_val', 'w_title', 'w_required', 'w_unique', 'w_class');
250
- $temp = $params;
251
- foreach ($params_names as $params_name) {
252
- $temp = explode('*:*' . $params_name . '*:*', $temp);
253
- $param[$params_name] = $temp[0];
254
- $temp = $temp[1];
255
- }
256
- if ($temp) {
257
- $temp = explode('*:*w_attr_name*:*', $temp);
258
- $attrs = array_slice($temp, 0, count($temp) - 1);
259
- foreach ($attrs as $attr) {
260
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
261
- }
262
- }
263
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
264
- $input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
265
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
266
- $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" class="'.$input_active.'" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" value="'.$param['w_first_val'].'" title="'.$param['w_title'].'" onkeypress="return check_isnum(event)" onfocus="delete_value(&quot;'.$id.'_elementform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_elementform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_elementform_id_temp&quot;)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled /></div></div>';
267
- break;
268
- }
269
- case 'type_password': {
270
- $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_required', 'w_unique', 'w_class');
271
- $temp = $params;
272
- foreach ($params_names as $params_name) {
273
- $temp = explode('*:*' . $params_name . '*:*', $temp);
274
- $param[$params_name] = $temp[0];
275
- $temp = $temp[1];
276
- }
277
- if ($temp) {
278
- $temp = explode('*:*w_attr_name*:*', $temp);
279
- $attrs = array_slice($temp, 0, count($temp) - 1);
280
- foreach ($attrs as $attr) {
281
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
282
- }
283
- }
284
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
285
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
286
- $rep ='<div id="wdform_field'.$id.'" type="type_password" 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_password" 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="password" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled /></div></div>';
287
- break;
288
- }
289
- case 'type_textarea': {
290
- $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size_w', 'w_size_h', 'w_first_val', 'w_title', 'w_required', 'w_unique', 'w_class');
291
- $temp = $params;
292
- foreach ($params_names as $params_name) {
293
- $temp = explode('*:*' . $params_name . '*:*', $temp);
294
- $param[$params_name] = $temp[0];
295
- $temp = $temp[1];
296
- }
297
- if ($temp) {
298
- $temp = explode('*:*w_attr_name*:*', $temp);
299
- $attrs = array_slice($temp, 0, count($temp) - 1);
300
- foreach ($attrs as $attr) {
301
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
302
- }
303
- }
304
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
305
- $input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
306
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
307
- $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:'.$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: table-cell;"><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_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><textarea class="'.$input_active.'" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" title="'.$param['w_title'].'" onfocus="delete_value(&quot;'.$id.'_elementform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_elementform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_elementform_id_temp&quot;)" style="width: '.$param['w_size_w'].'px; height: '.$param['w_size_h'].'px;" '.$param['attributes'].' disabled>'.$param['w_first_val'].'</textarea></div></div>';
308
- break;
309
- }
310
- case 'type_phone': {
311
- $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_first_val', 'w_title', 'w_mini_labels', 'w_required', 'w_unique', 'w_class');
312
- $temp = $params;
313
- foreach ($params_names as $params_name) {
314
- $temp = explode('*:*' . $params_name . '*:*', $temp);
315
- $param[$params_name] = $temp[0];
316
- $temp = $temp[1];
317
- }
318
- if ($temp) {
319
- $temp = explode('*:*w_attr_name*:*', $temp);
320
- $attrs = array_slice($temp, 0, count($temp) - 1);
321
- foreach ($attrs as $attr) {
322
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
323
- }
324
- }
325
- $w_first_val = explode('***', $param['w_first_val']);
326
- $w_title = explode('***', $param['w_title']);
327
- $w_mini_labels = explode('***', $param['w_mini_labels']);
328
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
329
- $input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
330
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
331
- $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: '.$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">'.$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_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" class="'.$input_active.'" id="'.$id.'_element_firstform_id_temp" name="'.$id.'_element_firstform_id_temp" value="'.$w_first_val[0].'" title="'.$w_title[0].'" onfocus="delete_value(&quot;'.$id.'_element_firstform_id_temp&quot;)"onblur="return_value(&quot;'.$id.'_element_firstform_id_temp&quot;)"onchange="change_value(&quot;'.$id.'_element_firstform_id_temp&quot;)" 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" class="'.$input_active.'" id="'.$id.'_element_lastform_id_temp" name="'.$id.'_element_lastform_id_temp" value="'.$w_first_val[1].'" title="'.$w_title[1].'" onfocus="delete_value(&quot;'.$id.'_element_lastform_id_temp&quot;)"onblur="return_value(&quot;'.$id.'_element_lastform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_element_lastform_id_temp&quot;)" 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>';
332
- break;
333
- }
334
- case 'type_name': {
335
- $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_title', 'w_mini_labels', 'w_size', 'w_name_format', 'w_required', 'w_unique', 'w_class');
336
- $temp = $params;
337
- if(strpos($temp, 'w_name_fields') > -1)
338
- $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_title', 'w_mini_labels', 'w_size', 'w_name_format', 'w_required', 'w_unique', 'w_class', 'w_name_fields');
339
-
340
- if(strpos($temp, 'w_autofill') > -1)
341
- $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_title', 'w_mini_labels', 'w_size', 'w_name_format', 'w_required', 'w_unique', 'w_class', 'w_name_fields', 'w_autofill');
342
- foreach ($params_names as $params_name) {
343
- $temp = explode('*:*' . $params_name . '*:*', $temp);
344
- $param[$params_name] = $temp[0];
345
- $temp = $temp[1];
346
- }
347
- if ($temp) {
348
- $temp = explode('*:*w_attr_name*:*', $temp);
349
- $attrs = array_slice($temp, 0, count($temp) - 1);
350
- foreach ($attrs as $attr) {
351
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
352
- }
353
- }
354
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
355
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
356
- $w_first_val = explode('***', $param['w_first_val']);
357
- $w_title = explode('***', $param['w_title']);
358
- $w_mini_labels = explode('***', $param['w_mini_labels']);
359
-
360
- $param['w_name_fields'] = isset($param['w_name_fields']) ? $param['w_name_fields'] : ($param['w_name_format'] == 'normal' ? 'no***no' : 'yes***yes');
361
- $w_name_fields = explode('***', $param['w_name_fields']);
362
- $param['w_autofill'] = isset($param['w_autofill']) ? $param['w_autofill'] : 'no';
363
-
364
- $w_name_format = '<div id="'.$id.'_td_name_input_first" style="display: table-cell;"><input type="text" class="'.($w_first_val[0]==$w_title[0] ? "input_deactive" : "input_active").'" id="'.$id.'_element_firstform_id_temp" name="'.$id.'_element_firstform_id_temp" value="'.$w_first_val[0].'" title="'.$w_title[0].'" onfocus="delete_value(&quot;'.$id.'_element_firstform_id_temp&quot;)"onblur="return_value(&quot;'.$id.'_element_firstform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_element_firstform_id_temp&quot;)" 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" class="'.($w_first_val[1]==$w_title[1] ? "input_deactive" : "input_active").'" id="'.$id.'_element_lastform_id_temp" name="'.$id.'_element_lastform_id_temp" value="'.$w_first_val[1].'" title="'.$w_title[1].'" onfocus="delete_value(&quot;'.$id.'_element_lastform_id_temp&quot;)"onblur="return_value(&quot;'.$id.'_element_lastform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_element_lastform_id_temp&quot;)" style="margin-right: 10px; width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled /></div>';
365
- $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>';
366
-
367
- if($w_name_fields[0] == 'yes') {
368
- $w_name_format = '<div id="'.$id.'_td_name_input_title" style="display: table-cell;"><input type="text" class="'.($w_first_val[2]==$w_title[2] ? "input_deactive" : "input_active").'" id="'.$id.'_element_titleform_id_temp" name="'.$id.'_element_titleform_id_temp" value="'.$w_first_val[2].'" title="'.$w_title[2].'" onfocus="delete_value(&quot;'.$id.'_element_titleform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_element_titleform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_element_titleform_id_temp&quot;)" style="margin: 0px 10px 0px 0px; width: 40px;" disabled /></div>'.$w_name_format;
369
- $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;
370
- }
371
-
372
- if($w_name_fields[1] == 'yes') {
373
- $w_name_format = $w_name_format.'<div id="'.$id.'_td_name_input_middle" style="display: table-cell;"><input type="text" class="'.($w_first_val[3]==$w_title[3] ? "input_deactive" : "input_active").'" id="'.$id.'_element_middleform_id_temp" name="'.$id.'_element_middleform_id_temp" value="'.$w_first_val[3].'" title="'.$w_title[3].'" onfocus="delete_value(&quot;'.$id.'_element_middleform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_element_middleform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_element_middleform_id_temp&quot;)" style="width: '.$param['w_size'].'px;" disabled /></div>';
374
- $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>';
375
- }
376
-
377
- $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: '.$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_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_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>';
378
- break;
379
- }
380
- case 'type_address': {
381
- $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_mini_labels', 'w_disabled_fields', 'w_required', 'w_class');
382
- $temp = $params;
383
- foreach ($params_names as $params_name) {
384
- $temp = explode('*:*' . $params_name . '*:*', $temp);
385
- $param[$params_name] = $temp[0];
386
- $temp = $temp[1];
387
- }
388
- if ($temp) {
389
- $temp = explode('*:*w_attr_name*:*', $temp);
390
- $attrs = array_slice($temp, 0, count($temp) - 1);
391
- foreach ($attrs as $attr) {
392
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
393
- }
394
- }
395
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
396
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
397
- $w_mini_labels = explode('***', $param['w_mini_labels']);
398
- $w_disabled_fields = explode('***', $param['w_disabled_fields']);
399
- $hidden_inputs = '';
400
- $labels_for_id = array('street1', 'street2', 'city', 'state', 'postal', 'country');
401
- foreach ($w_disabled_fields as $key => $w_disabled_field) {
402
- if ($key != 6) {
403
- if ($w_disabled_field == 'yes') {
404
- $hidden_inputs .= '<input type="hidden" id="'.$id.'_'.$labels_for_id[$key].'form_id_temp" value="'.$w_mini_labels[$key].'" id_for_label="'.($id+$key).'">';
405
- }
406
- }
407
- }
408
- $address_fields ='';
409
- $g=0;
410
- if($w_disabled_fields[0]=='no')
411
- {
412
- $g+=2;
413
- $address_fields .= '<span style="float: left; width: 100%; padding-bottom: 8px; display: block;"><input type="text" id="'.$id.'_street1form_id_temp" name="'.$id.'_street1form_id_temp" onchange="change_value(&quot;'.$id.'_street1form_id_temp&quot;)" style="width: 100%;" '.$param['attributes'].' disabled /><label class="mini_label" id="'.$id.'_mini_label_street1" style="display: block;">'.$w_mini_labels[0].'</label></span>';
414
- }
415
-
416
- if($w_disabled_fields[1]=='no')
417
- {
418
- $g+=2;
419
- $address_fields .= '<span style="float: left; width: 100%; padding-bottom: 8px; display: block;"><input type="text" id="'.$id.'_street2form_id_temp" name="'.($id+1).'_street2form_id_temp" onchange="change_value(&quot;'.$id.'_street2form_id_temp&quot;)" style="width: 100%;" '.$param['attributes'].' disabled /><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_street2">'.$w_mini_labels[1].'</label></span>';
420
- }
421
-
422
- if($w_disabled_fields[2]=='no')
423
- {
424
- $g++;
425
- $address_fields .= '<span style="float: left; width: 48%; padding-bottom: 8px;"><input type="text" id="'.$id.'_cityform_id_temp" name="'.($id+2).'_cityform_id_temp" onchange="change_value(&quot;'.$id.'_cityform_id_temp&quot;)" style="width: 100%;" '.$param['attributes'].' disabled /><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_city">'.$w_mini_labels[2].'</label></span>';
426
- }
427
-
428
- if($w_disabled_fields[3]=='no')
429
- {
430
- $g++;
431
- if($w_disabled_fields[5]=='yes' && $w_disabled_fields[6]=='yes')
432
- $address_fields .= '<span style="float: '.(($g%2==0) ? 'right' : 'left').'; width: 48%; padding-bottom: 8px;"><select type="text" id="'.$id.'_stateform_id_temp" name="'.($id+3).'_stateform_id_temp" onchange="change_value(&quot;'.$id.'_stateform_id_temp&quot;)" style="width: 100%;" '.$param['attributes'].' disabled ><option value=""></option><option value="Alabama">Alabama</option><option value="Alaska">Alaska</option><option value="Arizona">Arizona</option><option value="Arkansas">Arkansas</option><option value="California">California</option><option value="Colorado">Colorado</option><option value="Connecticut">Connecticut</option><option value="Delaware">Delaware</option><option value="Florida">Florida</option><option value="Georgia">Georgia</option><option value="Hawaii">Hawaii</option><option value="Idaho">Idaho</option><option value="Illinois">Illinois</option><option value="Indiana">Indiana</option><option value="Iowa">Iowa</option><option value="Kansas">Kansas</option><option value="Kentucky">Kentucky</option><option value="Louisiana">Louisiana</option><option value="Maine">Maine</option><option value="Maryland">Maryland</option><option value="Massachusetts">Massachusetts</option><option value="Michigan">Michigan</option><option value="Minnesota">Minnesota</option><option value="Mississippi">Mississippi</option><option value="Missouri">Missouri</option><option value="Montana">Montana</option><option value="Nebraska">Nebraska</option><option value="Nevada">Nevada</option><option value="New Hampshire">New Hampshire</option><option value="New Jersey">New Jersey</option><option value="New Mexico">New Mexico</option><option value="New York">New York</option><option value="North Carolina">North Carolina</option><option value="North Dakota">North Dakota</option><option value="Ohio">Ohio</option><option value="Oklahoma">Oklahoma</option><option value="Oregon">Oregon</option><option value="Pennsylvania">Pennsylvania</option><option value="Rhode Island">Rhode Island</option><option value="South Carolina">South Carolina</option><option value="South Dakota">South Dakota</option><option value="Tennessee">Tennessee</option><option value="Texas">Texas</option><option value="Utah">Utah</option><option value="Vermont">Vermont</option><option value="Virginia">Virginia</option><option value="Washington">Washington</option><option value="West Virginia">West Virginia</option><option value="Wisconsin">Wisconsin</option><option value="Wyoming">Wyoming</option></select><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_state">'.$w_mini_labels[3].'</label></span>';
433
- else
434
- $address_fields .= '<span style="float: '.(($g%2==0) ? 'right' : 'left').'; width: 48%; padding-bottom: 8px;"><input type="text" id="'.$id.'_stateform_id_temp" name="'.($id+3).'_stateform_id_temp" onchange="change_value(&quot;'.$id.'_stateform_id_temp&quot;)" style="width: 100%;" '.$param['attributes'].' disabled><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_state">'.$w_mini_labels[3].'</label></span>';
435
- }
436
-
437
- if($w_disabled_fields[4]=='no')
438
- {
439
- $g++;
440
- $address_fields .= '<span style="float: '.(($g%2==0) ? 'right' : 'left').'; width: 48%; padding-bottom: 8px;"><input type="text" id="'.$id.'_postalform_id_temp" name="'.($id+4).'_postalform_id_temp" onchange="change_value(&quot;'.$id.'_postalform_id_temp&quot;)" style="width: 100%;" '.$param['attributes'].' disabled><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_postal">'.$w_mini_labels[4].'</label></span>';
441
- }
442
-
443
- if($w_disabled_fields[5]=='no')
444
- {
445
- $g++;
446
- $address_fields .= '<span style="float: '.(($g%2==0) ? 'right' : 'left').'; width: 48%; padding-bottom: 8px;"><select type="text" id="'.$id.'_countryform_id_temp" name="'.($id+5).'_countryform_id_temp" onchange="change_value(&quot;'.$id.'_countryform_id_temp&quot;)" style="width: 100%;" '.$param['attributes'].' disabled><option value=""></option><option value="Afghanistan">Afghanistan</option><option value="Albania">Albania</option><option value="Algeria">Algeria</option><option value="Andorra">Andorra</option><option value="Angola">Angola</option><option value="Antigua and Barbuda">Antigua and Barbuda</option><option value="Argentina">Argentina</option><option value="Armenia">Armenia</option><option value="Australia">Australia</option><option value="Austria">Austria</option><option value="Azerbaijan">Azerbaijan</option><option value="Bahamas">Bahamas</option><option value="Bahrain">Bahrain</option><option value="Bangladesh">Bangladesh</option><option value="Barbados">Barbados</option><option value="Belarus">Belarus</option><option value="Belgium">Belgium</option><option value="Belize">Belize</option><option value="Benin">Benin</option><option value="Bhutan">Bhutan</option><option value="Bolivia">Bolivia</option><option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option><option value="Botswana">Botswana</option><option value="Brazil">Brazil</option><option value="Brunei">Brunei</option><option value="Bulgaria">Bulgaria</option><option value="Burkina Faso">Burkina Faso</option><option value="Burundi">Burundi</option><option value="Cambodia">Cambodia</option><option value="Cameroon">Cameroon</option><option value="Canada">Canada</option><option value="Cape Verde">Cape Verde</option><option value="Central African Republic">Central African Republic</option><option value="Chad">Chad</option><option value="Chile">Chile</option><option value="China">China</option><option value="Colombia">Colombia</option><option value="Comoros">Comoros</option><option value="Congo (Brazzaville)">Congo (Brazzaville)</option><option value="Congo">Congo</option><option value="Costa Rica">Costa Rica</option><option value="Cote d\'Ivoire">Cote d\'Ivoire</option><option value="Croatia">Croatia</option><option value="Cuba">Cuba</option><option value="Cyprus">Cyprus</option><option value="Czech Republic">Czech Republic</option><option value="Denmark">Denmark</option><option value="Djibouti">Djibouti</option><option value="Dominica">Dominica</option><option value="Dominican Republic">Dominican Republic</option><option value="East Timor (Timor Timur)">East Timor (Timor Timur)</option><option value="Ecuador">Ecuador</option><option value="Egypt">Egypt</option><option value="El Salvador">El Salvador</option><option value="Equatorial Guinea">Equatorial Guinea</option><option value="Eritrea">Eritrea</option><option value="Estonia">Estonia</option><option value="Ethiopia">Ethiopia</option><option value="Fiji">Fiji</option><option value="Finland">Finland</option><option value="France">France</option><option value="Gabon">Gabon</option><option value="Gambia, The">Gambia, The</option><option value="Georgia">Georgia</option><option value="Germany">Germany</option><option value="Ghana">Ghana</option><option value="Greece">Greece</option><option value="Grenada">Grenada</option><option value="Guatemala">Guatemala</option><option value="Guinea">Guinea</option><option value="Guinea-Bissau">Guinea-Bissau</option><option value="Guyana">Guyana</option><option value="Haiti">Haiti</option><option value="Honduras">Honduras</option><option value="Hungary">Hungary</option><option value="Iceland">Iceland</option><option value="India">India</option><option value="Indonesia">Indonesia</option><option value="Iran">Iran</option><option value="Iraq">Iraq</option><option value="Ireland">Ireland</option><option value="Israel">Israel</option><option value="Italy">Italy</option><option value="Jamaica">Jamaica</option><option value="Japan">Japan</option><option value="Jordan">Jordan</option><option value="Kazakhstan">Kazakhstan</option><option value="Kenya">Kenya</option><option value="Kiribati">Kiribati</option><option value="Korea, North">Korea, North</option><option value="Korea, South">Korea, South</option><option value="Kuwait">Kuwait</option><option value="Kyrgyzstan">Kyrgyzstan</option><option value="Laos">Laos</option><option value="Latvia">Latvia</option><option value="Lebanon">Lebanon</option><option value="Lesotho">Lesotho</option><option value="Liberia">Liberia</option><option value="Libya">Libya</option><option value="Liechtenstein">Liechtenstein</option><option value="Lithuania">Lithuania</option><option value="Luxembourg">Luxembourg</option><option value="Macedonia">Macedonia</option><option value="Madagascar">Madagascar</option><option value="Malawi">Malawi</option><option value="Malaysia">Malaysia</option><option value="Maldives">Maldives</option><option value="Mali">Mali</option><option value="Malta">Malta</option><option value="Marshall Islands">Marshall Islands</option><option value="Mauritania">Mauritania</option><option value="Mauritius">Mauritius</option><option value="Mexico">Mexico</option><option value="Micronesia">Micronesia</option><option value="Moldova">Moldova</option><option value="Monaco">Monaco</option><option value="Mongolia">Mongolia</option><option value="Morocco">Morocco</option><option value="Mozambique">Mozambique</option><option value="Myanmar">Myanmar</option><option value="Namibia">Namibia</option><option value="Nauru">Nauru</option><option value="Nepal">Nepal</option><option value="Netherlands">Netherlands</option><option value="New Zealand">New Zealand</option><option value="Nicaragua">Nicaragua</option><option value="Niger">Niger</option><option value="Nigeria">Nigeria</option><option value="Norway">Norway</option><option value="Oman">Oman</option><option value="Pakistan">Pakistan</option><option value="Palau">Palau</option><option value="Panama">Panama</option><option value="Papua New Guinea">Papua New Guinea</option><option value="Paraguay">Paraguay</option><option value="Peru">Peru</option><option value="Philippines">Philippines</option><option value="Poland">Poland</option><option value="Portugal">Portugal</option><option value="Qatar">Qatar</option><option value="Romania">Romania</option><option value="Russia">Russia</option><option value="Rwanda">Rwanda</option><option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option><option value="Saint Lucia">Saint Lucia</option><option value="Saint Vincent">Saint Vincent</option><option value="Samoa">Samoa</option><option value="San Marino">San Marino</option><option value="Sao Tome and Principe">Sao Tome and Principe</option><option value="Saudi Arabia">Saudi Arabia</option><option value="Senegal">Senegal</option><option value="Serbia and Montenegro">Serbia and Montenegro</option><option value="Seychelles">Seychelles</option><option value="Sierra Leone">Sierra Leone</option><option value="Singapore">Singapore</option><option value="Slovakia">Slovakia</option><option value="Slovenia">Slovenia</option><option value="Solomon Islands">Solomon Islands</option><option value="Somalia">Somalia</option><option value="South Africa">South Africa</option><option value="Spain">Spain</option><option value="Sri Lanka">Sri Lanka</option><option value="Sudan">Sudan</option><option value="Suriname">Suriname</option><option value="Swaziland">Swaziland</option><option value="Sweden">Sweden</option><option value="Switzerland">Switzerland</option><option value="Syria">Syria</option><option value="Taiwan">Taiwan</option><option value="Tajikistan">Tajikistan</option><option value="Tanzania">Tanzania</option><option value="Thailand">Thailand</option><option value="Togo">Togo</option><option value="Tonga">Tonga</option><option value="Trinidad and Tobago">Trinidad and Tobago</option><option value="Tunisia">Tunisia</option><option value="Turkey">Turkey</option><option value="Turkmenistan">Turkmenistan</option><option value="Tuvalu">Tuvalu</option><option value="Uganda">Uganda</option><option value="Ukraine">Ukraine</option><option value="United Arab Emirates">United Arab Emirates</option><option value="United Kingdom">United Kingdom</option><option value="United States">United States</option><option value="Uruguay">Uruguay</option><option value="Uzbekistan">Uzbekistan</option><option value="Vanuatu">Vanuatu</option><option value="Vatican City">Vatican City</option><option value="Venezuela">Venezuela</option><option value="Vietnam">Vietnam</option><option value="Yemen">Yemen</option><option value="Zambia">Zambia</option><option value="Zimbabwe">Zimbabwe</option></select><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_country">'.$w_mini_labels[5].'</span>';
447
- }
448
-
449
- $rep ='<div id="wdform_field'.$id.'" type="type_address" 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; vertical-align:top;"><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_address" 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" name="'.$id.'_disable_fieldsform_id_temp" id="'.$id.'_disable_fieldsform_id_temp" street1="'.$w_disabled_fields[0].'" street2="'.$w_disabled_fields[1].'" city="'.$w_disabled_fields[2].'" state="'.$w_disabled_fields[3].'" postal="'.$w_disabled_fields[4].'" country="'.$w_disabled_fields[5].'" us_states="'.$w_disabled_fields[6].'"><div id="'.$id.'_div_address" style="width: '.$param['w_size'].'px;">'.$address_fields.$hidden_inputs.'</div></div></div>';
450
- break;
451
- }
452
- case 'type_submitter_mail': {
453
- $params_names=array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_required','w_unique', 'w_class');
454
- $temp=$params;
455
- if(strpos($temp, 'w_autofill') > -1)
456
- $params_names=array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_required','w_unique', 'w_class', 'w_autofill');
457
- foreach($params_names as $params_name )
458
- {
459
- $temp=explode('*:*'.$params_name.'*:*',$temp);
460
- $param[$params_name] = $temp[0];
461
- $temp=$temp[1];
462
- }
463
-
464
- if($temp)
465
- {
466
- $temp =explode('*:*w_attr_name*:*',$temp);
467
- $attrs = array_slice($temp,0, count($temp)-1);
468
- foreach($attrs as $attr)
469
- $param['attributes'] = $param['attributes'].' add_'.$attr;
470
- }
471
-
472
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
473
- $input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active");
474
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
475
- $param['w_autofill'] = isset($param['w_autofill']) ? $param['w_autofill'] : 'no';
476
-
477
- $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: '.$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_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_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="text" class="'.$input_active.'" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" value="'.$param['w_first_val'].'" title="'.$param['w_title'].'" onfocus="delete_value(&quot;'.$id.'_elementform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_elementform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_elementform_id_temp&quot;)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled /></div></div>';
478
- break;
479
- }
480
- case 'type_checkbox':
481
- {
482
- $params_names=array('w_field_label_size','w_field_label_pos','w_flow','w_choices','w_choices_checked','w_rowcol', 'w_required','w_randomize','w_allow_other','w_allow_other_num','w_class');
483
- $temp=$params;
484
- if(strpos($temp, 'w_field_option_pos') > -1)
485
- $params_names=array('w_field_label_size','w_field_label_pos','w_field_option_pos','w_flow','w_choices','w_choices_checked','w_rowcol', 'w_required','w_randomize','w_allow_other','w_allow_other_num', 'w_value_disabled','w_choices_value', 'w_choices_params', 'w_class');
486
- foreach($params_names as $params_name )
487
- {
488
- $temp=explode('*:*'.$params_name.'*:*',$temp);
489
- $param[$params_name] = $temp[0];
490
- $temp=$temp[1];
491
- }
492
-
493
- if($temp)
494
- {
495
- $temp =explode('*:*w_attr_name*:*',$temp);
496
- $attrs = array_slice($temp,0, count($temp)-1);
497
- foreach($attrs as $attr)
498
- $param['attributes'] = $param['attributes'].' add_'.$attr;
499
- }
500
- if(!isset($param['w_value_disabled']))
501
- $param['w_value_disabled'] = 'no';
502
-
503
- if(!isset($param['w_field_option_pos']))
504
- $param['w_field_option_pos'] = 'left';
505
-
506
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
507
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
508
- $param['w_choices'] = explode('***',$param['w_choices']);
509
- $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
510
-
511
- if(isset($param['w_choices_value']))
512
- {
513
- $param['w_choices_value'] = explode('***',$param['w_choices_value']);
514
- $param['w_choices_params'] = explode('***',$param['w_choices_params']);
515
- }
516
-
517
- foreach($param['w_choices_checked'] as $key => $choices_checked )
518
- {
519
- if($choices_checked=='true')
520
- $param['w_choices_checked'][$key]='checked="checked"';
521
- else
522
- $param['w_choices_checked'][$key]='';
523
- }
524
-
525
- $rep='<div id="wdform_field'.$id.'" type="type_checkbox" 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_checkbox" 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_randomize'].'" name="'.$id.'_randomizeform_id_temp" id="'.$id.'_randomizeform_id_temp"><input type="hidden" value="'.$param['w_allow_other'].'" name="'.$id.'_allow_otherform_id_temp" id="'.$id.'_allow_otherform_id_temp"><input type="hidden" value="'.$param['w_allow_other_num'].'" name="'.$id.'_allow_other_numform_id_temp" id="'.$id.'_allow_other_numform_id_temp"><input type="hidden" value="'.$param['w_rowcol'].'" name="'.$id.'_rowcol_numform_id_temp" id="'.$id.'_rowcol_numform_id_temp"><input type="hidden" value="'.$param['w_field_option_pos'].'" id="'.$id.'_option_left_right"><input type="hidden" value="'.$param['w_value_disabled'].'" name="'.$id.'_value_disabledform_id_temp" id="'.$id.'_value_disabledform_id_temp"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;" '.($param['w_flow']=='hor' ? 'for_hor="'.$id.'_hor"' : '').'>';
526
-
527
- if($param['w_flow']=='hor')
528
- {
529
- $j = 0;
530
- for($i=0; $i<(int)$param['w_rowcol']; $i++)
531
- {
532
- $rep.='<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;">';
533
-
534
- for($l=0; $l<=(int)(count($param['w_choices'])/$param['w_rowcol']); $l++)
535
- {
536
- if($j >= count($param['w_choices'])%$param['w_rowcol'] && $l==(int)(count($param['w_choices'])/$param['w_rowcol']))
537
- continue;
538
-
539
- if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
540
- $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$l+$i).'" idi="'.((int)$param['w_rowcol']*$l+$i).'" style="display: table-cell;"><input type="checkbox" value="" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" other="1" onclick="if(set_checked(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$l+$i).'&quot;,&quot;form_id_temp&quot;)) show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$l+$i].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled /><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$l+$i).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'">'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'</label></div>';
541
- else
542
- {
543
- $where = '';
544
- $order_by = '';
545
- $db_info = '';
546
- if(isset($param['w_choices_value']))
547
- $choise_value = $param['w_choices_value'][(int)$param['w_rowcol']*$l+$i];
548
- else
549
- $choise_value = $param['w_choices'][(int)$param['w_rowcol']*$l+$i];
550
-
551
- if(isset($param['w_choices_params']) && $param['w_choices_params'][(int)$param['w_rowcol']*$l+$i])
552
- {
553
- $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][(int)$param['w_rowcol']*$l+$i]);
554
- $where = "where='".$w_choices_params[0]."'";
555
- $w_choices_params = explode('[db_info]',$w_choices_params[1]);
556
- $order_by = "order_by='".$w_choices_params[0]."'";
557
- $db_info = "db_info='".$w_choices_params[1]."'";
558
- }
559
-
560
- $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$l+$i).'" idi="'.((int)$param['w_rowcol']*$l+$i).'" style="display: table-cell;"><input type="checkbox" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" onclick="set_checked(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$l+$i).'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$l+$i].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$l+$i).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" '.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'</label></div>';
561
- }
562
- }
563
-
564
- $j++;
565
- $rep.='</div>';
566
-
567
- }
568
-
569
- }
570
- else
571
- {
572
- for($i=0; $i<(int)(count($param['w_choices'])/$param['w_rowcol']); $i++)
573
- {
574
- $rep.='<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;">';
575
-
576
- if(count($param['w_choices']) > (int)$param['w_rowcol'])
577
- for($l=0; $l<$param['w_rowcol']; $l++)
578
- {
579
- if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
580
- $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="checkbox" value="" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" other="1" onclick="if(set_checked(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$i+$l).'&quot;,&quot;form_id_temp&quot;)) show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled /><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'">'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
581
- else
582
- {
583
- $where = '' ;
584
- $order_by = '' ;
585
- $db_info = '' ;
586
- if(isset($param['w_choices_value']))
587
- $choise_value = $param['w_choices_value'][(int)$param['w_rowcol']*$i+$l];
588
- else
589
- $choise_value = $param['w_choices'][(int)$param['w_rowcol']*$i+$l];
590
-
591
- if(isset($param['w_choices_params']) && $param['w_choices_params'][(int)$param['w_rowcol']*$i+$l])
592
- {
593
- $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][(int)$param['w_rowcol']*$i+$l]);
594
- $where = "where='".$w_choices_params[0]."'";
595
- $w_choices_params = explode('[db_info]',$w_choices_params[1]);
596
- $order_by = "order_by='".$w_choices_params[0]."'";
597
- $db_info = "db_info='".$w_choices_params[1]."'";
598
- }
599
-
600
- $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="checkbox" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" onclick="set_checked(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$i+$l).'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'"
601
- '.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
602
- }
603
- }
604
- else
605
- for($l=0; $l<count($param['w_choices']); $l++)
606
- {
607
- if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
608
- $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="checkbox" value="" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" other="1" onclick="if(set_checked(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$i+$l).'&quot;,&quot;form_id_temp&quot;)) show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'">'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
609
- else
610
- {
611
- $where = '' ;
612
- $order_by = '' ;
613
- $db_info = '' ;
614
- if(isset($param['w_choices_value']))
615
- $choise_value = $param['w_choices_value'][(int)$param['w_rowcol']*$i+$l];
616
- else
617
- $choise_value = $param['w_choices'][(int)$param['w_rowcol']*$i+$l];
618
-
619
- if(isset($param['w_choices_params']) && $param['w_choices_params'][(int)$param['w_rowcol']*$i+$l])
620
- {
621
- $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][(int)$param['w_rowcol']*$i+$l]);
622
- $where = "where='".$w_choices_params[0]."'";
623
- $w_choices_params = explode('[db_info]',$w_choices_params[1]);
624
- $order_by = "order_by='".$w_choices_params[0]."'";
625
- $db_info = "db_info='".$w_choices_params[1]."'";
626
- }
627
-
628
- $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="checkbox" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" onclick="set_checked(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$i+$l).'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" '.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
629
- }
630
- }
631
-
632
- $rep.='</div>';
633
- }
634
-
635
- if(count($param['w_choices'])%$param['w_rowcol']!=0)
636
- {
637
- $rep.='<div id="'.$id.'_element_tr'.((int)(count($param['w_choices'])/(int)$param['w_rowcol'])).'" style="display: table-row;">';
638
-
639
- for($k=0; $k<count($param['w_choices'])%$param['w_rowcol']; $k++)
640
- {
641
- $l = count($param['w_choices']) - count($param['w_choices'])%$param['w_rowcol'] + $k;
642
- if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$l)
643
- $rep.='<div valign="top" id="'.$id.'_td_little'.$l.'" idi="'.$l.'" style="display: table-cell;"><input type="checkbox" value="" id="'.$id.'_elementform_id_temp'.$l.'" name="'.$id.'_elementform_id_temp'.$l.'" other="1" onclick="if(set_checked(&quot;'.$id.'&quot;,&quot;'.$l.'&quot;,&quot;form_id_temp&quot;)) show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$l.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$l.'">'.$param['w_choices'][$l].'</label></div>';
644
- else
645
- {
646
- $where = '' ;
647
- $order_by = '' ;
648
- $db_info = '' ;
649
- if(isset($param['w_choices_value']))
650
- $choise_value = $param['w_choices_value'][$l];
651
- else
652
- $choise_value = $param['w_choices'][$l];
653
-
654
- if(isset($param['w_choices_params']) && $param['w_choices_params'][$l])
655
- {
656
- $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$l]);
657
- $where = "where='".$w_choices_params[0]."'";
658
- $w_choices_params = explode('[db_info]',$w_choices_params[1]);
659
- $order_by = "order_by='".$w_choices_params[0]."'";
660
- $db_info = "db_info='".$w_choices_params[1]."'";
661
- }
662
- $rep.='<div valign="top" id="'.$id.'_td_little'.$l.'" idi="'.$l.'" style="display: table-cell;"><input type="checkbox" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.$l.'" name="'.$id.'_elementform_id_temp'.$l.'" onclick="set_checked(&quot;'.$id.'&quot;,&quot;'.$l.'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$l.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$l.'" '.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][$l].'</label></div>';
663
- }
664
- }
665
-
666
- $rep.='</div>';
667
- }
668
-
669
-
670
-
671
- }
672
- $rep.='</div></div></div></div>';
673
- break;
674
- }
675
- case 'type_radio':
676
- {
677
-
678
- $params_names=array('w_field_label_size','w_field_label_pos','w_flow','w_choices','w_choices_checked','w_rowcol', 'w_required','w_randomize','w_allow_other','w_allow_other_num','w_class');
679
- $temp=$params;
680
- if(strpos($temp, 'w_field_option_pos') > -1)
681
- $params_names=array('w_field_label_size','w_field_label_pos','w_field_option_pos','w_flow','w_choices','w_choices_checked','w_rowcol', 'w_required','w_randomize','w_allow_other','w_allow_other_num', 'w_value_disabled', 'w_choices_value', 'w_choices_params','w_class');
682
- foreach($params_names as $params_name )
683
- {
684
- $temp=explode('*:*'.$params_name.'*:*',$temp);
685
- $param[$params_name] = $temp[0];
686
- $temp=$temp[1];
687
- }
688
-
689
- if($temp)
690
- {
691
- $temp =explode('*:*w_attr_name*:*',$temp);
692
- $attrs = array_slice($temp,0, count($temp)-1);
693
- foreach($attrs as $attr)
694
- $param['attributes'] = $param['attributes'].' add_'.$attr;
695
- }
696
- if(!isset($param['w_value_disabled']))
697
- $param['w_value_disabled'] = 'no';
698
-
699
- if(!isset($param['w_field_option_pos']))
700
- $param['w_field_option_pos'] = 'left';
701
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
702
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
703
- $param['w_choices'] = explode('***',$param['w_choices']);
704
- $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
705
-
706
- if(isset($param['w_choices_value']))
707
- {
708
- $param['w_choices_value'] = explode('***',$param['w_choices_value']);
709
- $param['w_choices_params'] = explode('***',$param['w_choices_params']);
710
- }
711
-
712
- foreach($param['w_choices_checked'] as $key => $choices_checked )
713
- {
714
- if($choices_checked=='true')
715
- $param['w_choices_checked'][$key]='checked="checked"';
716
- else
717
- $param['w_choices_checked'][$key]='';
718
- }
719
-
720
- $rep='<div id="wdform_field'.$id.'" type="type_radio" 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_radio" 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_randomize'].'" name="'.$id.'_randomizeform_id_temp" id="'.$id.'_randomizeform_id_temp"><input type="hidden" value="'.$param['w_allow_other'].'" name="'.$id.'_allow_otherform_id_temp" id="'.$id.'_allow_otherform_id_temp"><input type="hidden" value="'.$param['w_allow_other_num'].'" name="'.$id.'_allow_other_numform_id_temp" id="'.$id.'_allow_other_numform_id_temp"><input type="hidden" value="'.$param['w_rowcol'].'" name="'.$id.'_rowcol_numform_id_temp" id="'.$id.'_rowcol_numform_id_temp"><input type="hidden" value="'.$param['w_field_option_pos'].'" id="'.$id.'_option_left_right"><input type="hidden" value="'.$param['w_value_disabled'].'" name="'.$id.'_value_disabledform_id_temp" id="'.$id.'_value_disabledform_id_temp"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;" '.($param['w_flow']=='hor' ? 'for_hor="'.$id.'_hor"' : '').'>';
721
-
722
-
723
- if($param['w_flow']=='hor')
724
- {
725
- $j = 0;
726
- for($i=0; $i<(int)$param['w_rowcol']; $i++)
727
- {
728
- $rep.='<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;">';
729
-
730
- for($l=0; $l<=(int)(count($param['w_choices'])/$param['w_rowcol']); $l++)
731
- {
732
- if($j >= count($param['w_choices'])%$param['w_rowcol'] && $l==(int)(count($param['w_choices'])/$param['w_rowcol']))
733
- continue;
734
-
735
- if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$l+$i)
736
- $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$l+$i).'" idi="'.((int)$param['w_rowcol']*$l+$i).'" style="display: table-cell;"><input type="radio" value="'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" name="'.$id.'_elementform_id_temp" other="1" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$l+$i).'&quot;,&quot;form_id_temp&quot;); show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$l+$i].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$l+$i).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'">'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'</label></div>';
737
- else
738
- {
739
- $where = '' ;
740
- $order_by = '' ;
741
- $db_info = '' ;
742
- if(isset($param['w_choices_value']))
743
- $choise_value = $param['w_choices_value'][(int)$param['w_rowcol']*$l+$i];
744
- else
745
- $choise_value = $param['w_choices'][(int)$param['w_rowcol']*$l+$i];
746
-
747
- if(isset($param['w_choices_params']) && $param['w_choices_params'][(int)$param['w_rowcol']*$l+$i])
748
- {
749
- $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][(int)$param['w_rowcol']*$l+$i]);
750
- $where = "where='".$w_choices_params[0]."'";
751
- $w_choices_params = explode('[db_info]',$w_choices_params[1]);
752
- $order_by = "order_by='".$w_choices_params[0]."'";
753
- $db_info = "db_info='".$w_choices_params[1]."'";
754
- }
755
-
756
- $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$l+$i).'" idi="'.((int)$param['w_rowcol']*$l+$i).'" style="display: table-cell;"><input type="radio" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" name="'.$id.'_elementform_id_temp" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$l+$i).'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$l+$i].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$l+$i).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" '.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'</label></div>';
757
- }
758
- }
759
-
760
- $j++;
761
- $rep.='</div>';
762
-
763
- }
764
-
765
- }
766
- else
767
- {
768
- for($i=0; $i<(int)(count($param['w_choices'])/$param['w_rowcol']); $i++)
769
- {
770
- $rep.='<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;">';
771
-
772
- if(count($param['w_choices']) > (int)$param['w_rowcol'])
773
- for($l=0; $l<$param['w_rowcol']; $l++)
774
- {
775
- if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
776
- $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="radio" value="'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp" other="1" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$i+$l).'&quot;,&quot;form_id_temp&quot;); show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'">'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
777
- else
778
- {
779
- $where = '' ;
780
- $order_by = '' ;
781
- $db_info = '' ;
782
- if(isset($param['w_choices_value']))
783
- $choise_value = $param['w_choices_value'][(int)$param['w_rowcol']*$i+$l];
784
- else
785
- $choise_value = $param['w_choices'][(int)$param['w_rowcol']*$i+$l];
786
-
787
- if(isset($param['w_choices_params']) && $param['w_choices_params'][(int)$param['w_rowcol']*$i+$l])
788
- {
789
- $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][(int)$param['w_rowcol']*$i+$l]);
790
- $where = "where='".$w_choices_params[0]."'";
791
- $w_choices_params = explode('[db_info]',$w_choices_params[1]);
792
- $order_by = "order_by='".$w_choices_params[0]."'";
793
- $db_info = "db_info='".$w_choices_params[1]."'";
794
- }
795
-
796
- $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="radio" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$i+$l).'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" '.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
797
- }
798
- }
799
- else
800
- for($l=0; $l<count($param['w_choices']); $l++)
801
- {
802
- if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
803
- $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="radio" value="'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp" other="1" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$i+$l).'&quot;,&quot;form_id_temp&quot;); show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'">'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
804
- else
805
- {
806
- $where = '' ;
807
- $order_by = '' ;
808
- $db_info = '' ;
809
- if(isset($param['w_choices_value']))
810
- $choise_value = $param['w_choices_value'][(int)$param['w_rowcol']*$i+$l];
811
- else
812
- $choise_value = $param['w_choices'][(int)$param['w_rowcol']*$i+$l];
813
-
814
- if(isset($param['w_choices_params']) && $param['w_choices_params'][(int)$param['w_rowcol']*$i+$l])
815
- {
816
- $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][(int)$param['w_rowcol']*$i+$l]);
817
- $where = "where='".$w_choices_params[0]."'";
818
- $w_choices_params = explode('[db_info]',$w_choices_params[1]);
819
- $order_by = "order_by='".$w_choices_params[0]."'";
820
- $db_info = "db_info='".$w_choices_params[1]."'";
821
- }
822
-
823
- $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="radio" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$i+$l).'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" '.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
824
- }
825
- }
826
-
827
- $rep.='</div>';
828
- }
829
-
830
- if(count($param['w_choices'])%$param['w_rowcol']!=0)
831
- {
832
- $rep.='<div id="'.$id.'_element_tr'.((int)(count($param['w_choices'])/(int)$param['w_rowcol'])).'" style="display: table-row;">';
833
-
834
- for($k=0; $k<count($param['w_choices'])%$param['w_rowcol']; $k++)
835
- {
836
- $l = count($param['w_choices']) - count($param['w_choices'])%$param['w_rowcol'] + $k;
837
- if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$l)
838
- $rep.='<div valign="top" id="'.$id.'_td_little'.$l.'" idi="'.$l.'" style="display: table-cell;"><input type="radio" value="'.$param['w_choices'][$l].'" id="'.$id.'_elementform_id_temp'.$l.'" name="'.$id.'_elementform_id_temp" other="1" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.$l.'&quot;,&quot;form_id_temp&quot;); show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$l.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$l.'">'.$param['w_choices'][$l].'</label></div>';
839
- else
840
- {
841
- $where = '' ;
842
- $order_by = '' ;
843
- $db_info = '' ;
844
- if(isset($param['w_choices_value']))
845
- $choise_value = $param['w_choices_value'][$l];
846
- else
847
- $choise_value = $param['w_choices'][$l];
848
-
849
- if(isset($param['w_choices_params']) && $param['w_choices_params'][$l])
850
- {
851
- $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$l]);
852
- $where = "where='".$w_choices_params[0]."'";
853
- $w_choices_params = explode('[db_info]',$w_choices_params[1]);
854
- $order_by = "order_by='".$w_choices_params[0]."'";
855
- $db_info = "db_info='".$w_choices_params[1]."'";
856
- }
857
-
858
- $rep.='<div valign="top" id="'.$id.'_td_little'.$l.'" idi="'.$l.'" style="display: table-cell;"><input type="radio" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.$l.'" name="'.$id.'_elementform_id_temp" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.$l.'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$l.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$l.'"
859
- '.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][$l].'</label></div>';
860
- }
861
- }
862
-
863
- $rep.='</div>';
864
- }
865
-
866
- }
867
-
868
-
869
-
870
- $rep.='</div></div></div></div>';
871
-
872
- break;
873
- }
874
- case 'type_own_select':
875
- {
876
- $params_names=array('w_field_label_size','w_field_label_pos','w_size','w_choices','w_choices_checked', 'w_choices_disabled','w_required','w_class');
877
- $temp=$params;
878
- if(strpos($temp, 'w_choices_value') > -1)
879
- $params_names=array('w_field_label_size','w_field_label_pos','w_size','w_choices','w_choices_checked', 'w_choices_disabled', 'w_required', 'w_value_disabled', 'w_choices_value', 'w_choices_params', 'w_class');
880
- foreach($params_names as $params_name )
881
- {
882
- $temp=explode('*:*'.$params_name.'*:*',$temp);
883
- $param[$params_name] = $temp[0];
884
- $temp=$temp[1];
885
- }
886
-
887
- if($temp)
888
- {
889
- $temp =explode('*:*w_attr_name*:*',$temp);
890
- $attrs = array_slice($temp,0, count($temp)-1);
891
- foreach($attrs as $attr)
892
- $param['attributes'] = $param['attributes'].' add_'.$attr;
893
- }
894
-
895
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
896
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
897
- $param['w_choices'] = explode('***',$param['w_choices']);
898
- $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
899
- $param['w_choices_disabled'] = explode('***',$param['w_choices_disabled']);
900
-
901
- if(isset($param['w_choices_value']))
902
- {
903
- $param['w_choices_value'] = explode('***',$param['w_choices_value']);
904
- $param['w_choices_params'] = explode('***',$param['w_choices_params']);
905
- }
906
-
907
- if(!isset($param['w_value_disabled']))
908
- $param['w_value_disabled'] = 'no';
909
-
910
- foreach($param['w_choices_checked'] as $key => $choices_checked )
911
- {
912
- if($choices_checked=='true')
913
- $param['w_choices_checked'][$key]='selected="selected"';
914
- else
915
- $param['w_choices_checked'][$key]='';
916
- }
917
-
918
- $rep='<div id="wdform_field'.$id.'" type="type_own_select" 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_own_select" 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_value_disabled'].'" name="'.$id.'_value_disabledform_id_temp" id="'.$id.'_value_disabledform_id_temp"><select id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" onchange="set_select(this)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled>';
919
- foreach($param['w_choices'] as $key => $choice)
920
- {
921
- $where = '';
922
- $order_by = '';
923
- $db_info = '';
924
- $choice_value = $param['w_choices_disabled'][$key]=='true' ? '' : (isset($param['w_choices_value']) ? $param['w_choices_value'][$key] : $choice);
925
- if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
926
- {
927
- $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
928
- $where = "where='".$w_choices_params[0]."'";
929
- $w_choices_params = explode('[db_info]',$w_choices_params[1]);
930
- $order_by = "order_by='".$w_choices_params[0]."'";
931
- $db_info = "db_info='".$w_choices_params[1]."'";
932
- }
933
-
934
- $rep.='<option id="'.$id.'_option'.$key.'" value="'.$choice_value.'" onselect="set_select(&quot;'.$id.'_option'.$key.'&quot;)" '.$param['w_choices_checked'][$key].' '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</option>';
935
- }
936
- $rep.='</select></div></div>';
937
- break;
938
- }
939
-
940
- case 'type_country':
941
- {
942
- $params_names=array('w_field_label_size','w_field_label_pos','w_size','w_countries','w_required','w_class');
943
- $temp=$params;
944
- foreach($params_names as $params_name )
945
- {
946
- $temp=explode('*:*'.$params_name.'*:*',$temp);
947
- $param[$params_name] = $temp[0];
948
- $temp=$temp[1];
949
- }
950
-
951
- if($temp)
952
- {
953
- $temp =explode('*:*w_attr_name*:*',$temp);
954
- $attrs = array_slice($temp,0, count($temp)-1);
955
- foreach($attrs as $attr)
956
- $param['attributes'] = $param['attributes'].' add_'.$attr;
957
- }
958
-
959
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
960
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
961
- $param['w_countries'] = explode('***',$param['w_countries']);
962
-
963
- $rep='<div id="wdform_field'.$id.'" type="type_country" 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_country" 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"><select id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled>';
964
- foreach($param['w_countries'] as $key => $choice)
965
- {
966
- $choice_value=$choice;
967
- $rep.='<option value="'.$choice_value.'">'.$choice.'</option>';
968
- }
969
- $rep.='</select></div></div>';
970
- break;
971
- }
972
-
973
- case 'type_time':
974
- {
975
- $params_names=array('w_field_label_size','w_field_label_pos','w_time_type','w_am_pm','w_sec','w_hh','w_mm','w_ss','w_mini_labels','w_required','w_class');
976
- $temp=$params;
977
- foreach($params_names as $params_name )
978
- {
979
- $temp=explode('*:*'.$params_name.'*:*',$temp);
980
- $param[$params_name] = $temp[0];
981
- $temp=$temp[1];
982
- }
983
-
984
- if($temp)
985
- {
986
- $temp =explode('*:*w_attr_name*:*',$temp);
987
- $attrs = array_slice($temp,0, count($temp)-1);
988
- foreach($attrs as $attr)
989
- $param['attributes'] = $param['attributes'].' add_'.$attr;
990
- }
991
-
992
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
993
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
994
-
995
- $w_mini_labels = explode('***',$param['w_mini_labels']);
996
-
997
-
998
- if($param['w_sec']=='1')
999
- {
1000
- $w_sec = '<div align="center" style="display: table-cell;"><span class="wdform_colon" style="vertical-align: middle;">&nbsp;:&nbsp;</span></div><div id="'.$id.'_td_time_input3" style="width: 32px; display: table-cell;"><input type="text" value="'.$param['w_ss'].'" class="time_box" id="'.$id.'_ssform_id_temp" name="'.$id.'_ssform_id_temp" onkeypress="return check_second(event, &quot;'.$id.'_ssform_id_temp&quot;)" onkeyup="change_second(&quot;'.$id.'_ssform_id_temp&quot;)" onblur="add_0(&quot;'.$id.'_ssform_id_temp&quot;)" '.$param['attributes'].' disabled /></div>';
1001
- $w_sec_label='<div style="display: table-cell;"></div><div id="'.$id.'_td_time_label3" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_ss">'.$w_mini_labels[2].'</label></div>';
1002
- }
1003
- else
1004
- {
1005
- $w_sec = '';
1006
- $w_sec_label='';
1007
- }
1008
-
1009
- if($param['w_time_type']=='12')
1010
- {
1011
- if($param['w_am_pm']=='am')
1012
- {
1013
- $am_ = "selected=\"selected\"";
1014
- $pm_ = "";
1015
- }
1016
- else
1017
- {
1018
- $am_ = "";
1019
- $pm_ = "selected=\"selected\"";
1020
-
1021
- }
1022
-
1023
- $w_time_type = '<div id="'.$id.'_am_pm_select" class="td_am_pm_select" style="display: table-cell;"><select class="am_pm_select" name="'.$id.'_am_pmform_id_temp" id="'.$id.'_am_pmform_id_temp" onchange="set_sel_am_pm(this)" '.$param['attributes'].'><option value="am" '.$am_.'>AM</option><option value="pm" '.$pm_.'>PM</option></select></div>';
1024
-
1025
- $w_time_type_label = '<div id="'.$id.'_am_pm_label" class="td_am_pm_select" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_am_pm">'.$w_mini_labels[3].'</label></div>';
1026
-
1027
- }
1028
- else
1029
- {
1030
- $w_time_type='';
1031
- $w_time_type_label = '';
1032
- }
1033
-
1034
-
1035
- $rep ='<div id="wdform_field'.$id.'" type="type_time" 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_time" 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"><div id="'.$id.'_table_time" style="display: table;"><div id="'.$id.'_tr_time1" style="display: table-row;"><div id="'.$id.'_td_time_input1" style="width: 32px; display: table-cell;"><input type="text" value="'.$param['w_hh'].'" class="time_box" id="'.$id.'_hhform_id_temp" name="'.$id.'_hhform_id_temp" onkeypress="return check_hour(event, &quot;'.$id.'_hhform_id_temp&quot;, &quot;23&quot;)" onkeyup="change_hour(event, &quot;'.$id.'_hhform_id_temp&quot;,&quot;23&quot;)" onblur="add_0(&quot;'.$id.'_hhform_id_temp&quot;)" '.$param['attributes'].' disabled/></div><div align="center" style="display: table-cell;"><span class="wdform_colon" style="vertical-align: middle;">&nbsp;:&nbsp;</span></div><div id="'.$id.'_td_time_input2" style="width: 32px; display: table-cell;"><input type="text" value="'.$param['w_mm'].'" class="time_box" id="'.$id.'_mmform_id_temp" name="'.$id.'_mmform_id_temp" onkeypress="return check_minute(event, &quot;'.$id.'_mmform_id_temp&quot;)" onkeyup="change_minute(event, &quot;'.$id.'_mmform_id_temp&quot;)" onblur="add_0(&quot;'.$id.'_mmform_id_temp&quot;)" '.$param['attributes'].' disabled/></div>'.$w_sec.$w_time_type.'</div><div id="'.$id.'_tr_time2" style="display: table-row;"><div id="'.$id.'_td_time_label1" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_hh">'.$w_mini_labels[0].'</label></div><div style="display: table-cell;"></div><div id="'.$id.'_td_time_label2" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_mm">'.$w_mini_labels[1].'</label></div>'.$w_sec_label.$w_time_type_label.'</div></div></div></div>';
1036
-
1037
- break;
1038
- }
1039
- case 'type_date':
1040
- {
1041
- $params_names=array('w_field_label_size','w_field_label_pos','w_date','w_required','w_class','w_format','w_but_val');
1042
- $temp = $params;
1043
- if(strpos($temp, 'w_disable_past_days') > -1)
1044
- $params_names = array('w_field_label_size','w_field_label_pos','w_date','w_required','w_class','w_format','w_but_val', 'w_disable_past_days');
1045
- foreach($params_names as $params_name )
1046
- {
1047
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1048
- $param[$params_name] = $temp[0];
1049
- $temp=$temp[1];
1050
- }
1051
-
1052
- if($temp)
1053
- {
1054
- $temp =explode('*:*w_attr_name*:*',$temp);
1055
- $attrs = array_slice($temp,0, count($temp)-1);
1056
- foreach($attrs as $attr)
1057
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1058
- }
1059
-
1060
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1061
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
1062
- $param['w_disable_past_days'] = isset($param['w_disable_past_days']) ? $param['w_disable_past_days'] : 'no';
1063
- $disable_past_days = $param['w_disable_past_days'] == 'yes' ? 'true' : 'false';
1064
-
1065
- $rep ='<div id="wdform_field'.$id.'" type="type_date" 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_date" 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_disable_past_days'].'" name="'.$id.'_dis_past_daysform_id_temp" id="'.$id.'_dis_past_daysform_id_temp"><input type="text" value="'.$param['w_date'].'" class="wdform-date" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" maxlength="10" size="10" onchange="change_value(&quot;'.$id.'_elementform_id_temp&quot;)" '.$param['attributes'].' disabled/><input id="'.$id.'_buttonform_id_temp" class="button" type="reset" value="'.$param['w_but_val'].'" format="'.$param['w_format'].'" src="templates/bluestork/images/system/calendar.png?ver='. get_option("wd_form_maker_version").'" alt="calendario" '.$param['attributes'].' onclick="return showCalendar(&quot;'.$id.'_elementform_id_temp&quot; , &quot;'.$param['w_format'].'&quot;, '.$disable_past_days.')"></div></div>';
1066
-
1067
- break;
1068
- }
1069
-
1070
- case 'type_date_new':
1071
- {
1072
-
1073
- $params_names=array('w_field_label_size','w_field_label_pos', 'w_size', 'w_date','w_required', 'w_show_image', 'w_class','w_format', 'w_start_day', 'w_default_date', 'w_min_date', 'w_max_date', 'w_invalid_dates', 'w_show_days', 'w_hide_time', 'w_but_val', 'w_disable_past_days');
1074
- $temp = $params;
1075
-
1076
- foreach($params_names as $params_name )
1077
- {
1078
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1079
- $param[$params_name] = $temp[0];
1080
- $temp=$temp[1];
1081
- }
1082
-
1083
- if($temp)
1084
- {
1085
- $temp =explode('*:*w_attr_name*:*',$temp);
1086
- $attrs = array_slice($temp,0, count($temp)-1);
1087
- foreach($attrs as $attr)
1088
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1089
- }
1090
-
1091
-
1092
- $w_show_week_days = explode('***', $param['w_show_days']);
1093
-
1094
-
1095
-
1096
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1097
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
1098
- $param['w_disable_past_days'] = isset($param['w_disable_past_days']) ? $param['w_disable_past_days'] : 'no';
1099
- $disable_past_days = $param['w_disable_past_days'] == 'yes' ? 'true' : 'false';
1100
- $display_image_date = $param['w_show_image'] == 'yes' ? 'inline' : 'none';
1101
-
1102
-
1103
- $rep ='<div id="wdform_field'.$id.'" type="type_date_new" 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_date_new" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp">
1104
- <input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp">
1105
-
1106
- <input type="hidden" value="'.$param['w_show_image'].'" name="'.$id.'_show_imageform_id_temp" id="'.$id.'_show_imageform_id_temp">
1107
-
1108
- <input type="hidden" value="'.$param['w_disable_past_days'].'" name="'.$id.'_dis_past_daysform_id_temp" id="'.$id.'_dis_past_daysform_id_temp">
1109
-
1110
- <input type="hidden" value="'.$param['w_default_date'].'" name="'.$id.'_default_date_id_temp" id="'.$id.'_default_date_id_temp">
1111
- <input type="hidden" value="'.$param['w_min_date'].'" name="'.$id.'_min_date_id_temp" id="'.$id.'_min_date_id_temp">
1112
- <input type="hidden" value="'.$param['w_max_date'].'" name="'.$id.'_max_date_id_temp" id="'.$id.'_max_date_id_temp">
1113
- <input type="hidden" value="'.$param['w_invalid_dates'].'" name="'.$id.'_invalid_dates_id_temp" id="'.$id.'_invalid_dates_id_temp">
1114
-
1115
- <input type="hidden" value="'.$param['w_start_day'].'" name="'.$id.'_start_dayform_id_temp" id="'.$id.'_start_dayform_id_temp">
1116
-
1117
- <input type="hidden" value="'.$param['w_hide_time'].'" name="'.$id.'_hide_timeform_id_temp" id="'.$id.'_hide_timeform_id_temp">
1118
-
1119
- <input type="hidden" name="'.$id.'_show_week_days" id="'.$id.'_show_week_days" sunday="'.$w_show_week_days[0].'" monday="'.$w_show_week_days[1].'" tuesday="'.$w_show_week_days[2].'" wednesday="'.$w_show_week_days[3].'" thursday="'.$w_show_week_days[4].'" friday="'.$w_show_week_days[5].'" saturday="'.$w_show_week_days[6].'">
1120
-
1121
-
1122
-
1123
- <input type="text" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled/>
1124
- <img src="' . WD_FM_URL . '/images/date.png" id="'.$id.'_show_imagedateform_id_temp" name="'.$id.'_show_imagedateform_id_temp" style="vertical-align : text-top; margin-left : 1px; display:'.$display_image_date.'">
1125
-
1126
- <input id="'.$id.'_buttonform_id_temp" type="hidden" value="'.$param['w_but_val'].'" format="'.$param['w_format'].'" ></div></div>';
1127
-
1128
- break;
1129
- }
1130
-
1131
-
1132
-
1133
- case 'type_date_range':
1134
- {
1135
-
1136
- $params_names=array('w_field_label_size','w_field_label_pos', 'w_size', 'w_date','w_required', 'w_show_image', 'w_class','w_format', 'w_start_day', 'w_default_date_start', 'w_default_date_end', 'w_min_date', 'w_max_date', 'w_invalid_dates', 'w_show_days', 'w_hide_time', 'w_but_val', 'w_disable_past_days');
1137
- $temp = $params;
1138
-
1139
-
1140
- foreach($params_names as $params_name )
1141
- {
1142
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1143
- $param[$params_name] = $temp[0];
1144
- $temp=$temp[1];
1145
- }
1146
-
1147
- if($temp)
1148
- {
1149
- $temp =explode('*:*w_attr_name*:*',$temp);
1150
- $attrs = array_slice($temp,0, count($temp)-1);
1151
- foreach($attrs as $attr)
1152
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1153
- }
1154
-
1155
-
1156
- $w_show_week_days = explode('***', $param['w_show_days']);
1157
- $defaul_day_array = explode(',', $param['w_date']);
1158
- $defaul_day_start = $defaul_day_array[0];
1159
- $defaul_day_end = $defaul_day_array[1];
1160
-
1161
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1162
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
1163
- $param['w_disable_past_days'] = isset($param['w_disable_past_days']) ? $param['w_disable_past_days'] : 'no';
1164
- $disable_past_days = $param['w_disable_past_days'] == 'yes' ? 'true' : 'false';
1165
- $display_image_date = $param['w_show_image'] == 'yes' ? 'inline' : 'none';
1166
-
1167
- $rep ='<div id="wdform_field'.$id.'" type="type_date_range" 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'].';">
1168
-
1169
- <input type="hidden" value="type_date_range" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp">
1170
-
1171
- <input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp">
1172
-
1173
- <input type="hidden" value="'.$param['w_show_image'].'" name="'.$id.'_show_imageform_id_temp" id="'.$id.'_show_imageform_id_temp">
1174
-
1175
- <input type="hidden" value="'.$param['w_disable_past_days'].'" name="'.$id.'_dis_past_daysform_id_temp" id="'.$id.'_dis_past_daysform_id_temp">
1176
-
1177
- <input type="hidden" value="'.$param['w_default_date_start'].'" name="'.$id.'_default_date_id_temp_start" id="'.$id.'_default_date_id_temp_start">
1178
-
1179
- <input type="hidden" value="'.$param['w_default_date_end'].'" name="'.$id.'_default_date_id_temp_end" id="'.$id.'_default_date_id_temp_end">
1180
-
1181
- <input type="hidden" value="'.$param['w_min_date'].'" name="'.$id.'_min_date_id_temp" id="'.$id.'_min_date_id_temp">
1182
-
1183
- <input type="hidden" value="'.$param['w_max_date'].'" name="'.$id.'_max_date_id_temp" id="'.$id.'_max_date_id_temp">
1184
-
1185
- <input type="hidden" value="'.$param['w_invalid_dates'].'" name="'.$id.'_invalid_dates_id_temp" id="'.$id.'_invalid_dates_id_temp">
1186
-
1187
- <input type="hidden" value="'.$param['w_start_day'].'" name="'.$id.'_start_dayform_id_temp" id="'.$id.'_start_dayform_id_temp">
1188
-
1189
- <input type="hidden" value="'.$param['w_hide_time'].'" name="'.$id.'_hide_timeform_id_temp" id="'.$id.'_hide_timeform_id_temp">
1190
-
1191
- <input type="hidden" name="'.$id.'_show_week_days" id="'.$id.'_show_week_days" sunday="'.$w_show_week_days[0].'" monday="'.$w_show_week_days[1].'" tuesday="'.$w_show_week_days[2].'" wednesday="'.$w_show_week_days[3].'" thursday="'.$w_show_week_days[4].'" friday="'.$w_show_week_days[5].'" saturday="'.$w_show_week_days[6].'">
1192
-
1193
-
1194
-
1195
-
1196
-
1197
- <input type="text" id="'.$id.'_elementform_id_temp0" name="'.$id.'_elementform_id_temp0" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled/>
1198
- <img src="' . WD_FM_URL . '/images/date.png" id="'.$id.'_show_imagedateform_id_temp0" name="'.$id.'_show_imagedateform_id_temp0" style="vertical-align : text-top; margin-left : 1px; display:'.$display_image_date.'">
1199
-
1200
- <span>-</span>
1201
-
1202
- <input type="text" id="'.$id.'_elementform_id_temp1" name="'.$id.'_elementform_id_temp1" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled/>
1203
- <img src="' . WD_FM_URL . '/images/date.png" id="'.$id.'_show_imagedateform_id_temp1" name="'.$id.'_show_imagedateform_id_temp1" style="vertical-align : text-top; margin-left : 1px; display:'.$display_image_date.'">
1204
-
1205
- <input id="'.$id.'_buttonform_id_temp" type="hidden" value="'.$param['w_but_val'].'" format="'.$param['w_format'].'" >
1206
-
1207
- </div></div>';
1208
-
1209
-
1210
-
1211
- break;
1212
- }
1213
-
1214
-
1215
- case 'type_date_fields':
1216
- {
1217
- $params_names=array('w_field_label_size','w_field_label_pos','w_day','w_month','w_year','w_day_type','w_month_type','w_year_type','w_day_label','w_month_label','w_year_label','w_day_size','w_month_size','w_year_size','w_required','w_class','w_from','w_to','w_divider');
1218
-
1219
- $temp=$params;
1220
- foreach($params_names as $params_name )
1221
- {
1222
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1223
- $param[$params_name] = $temp[0];
1224
- $temp=$temp[1];
1225
- }
1226
-
1227
- if($temp)
1228
- {
1229
- $temp =explode('*:*w_attr_name*:*',$temp);
1230
- $attrs = array_slice($temp,0, count($temp)-1);
1231
- foreach($attrs as $attr)
1232
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1233
- }
1234
-
1235
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1236
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
1237
-
1238
-
1239
- if($param['w_day_type']=="SELECT")
1240
- {
1241
-
1242
-
1243
- $w_day_type = '<select id="'.$id.'_dayform_id_temp" name="'.$id.'_dayform_id_temp" onchange="set_select(this)" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].' disabled><option value=""></option>';
1244
- for($k=0; $k<=31; $k++)
1245
- {
1246
- if($k<10)
1247
- {
1248
- if($param['w_day']=='0'.$k)
1249
- $selected = "selected=\"selected\"";
1250
- else
1251
- $selected = "";
1252
-
1253
- $w_day_type .= '<option value="0'.$k.'" '.$selected.'>0'.$k.'</option>';
1254
- }
1255
- else
1256
- {
1257
- if($param['w_day']==''.$k)
1258
- $selected = "selected=\"selected\"";
1259
- else
1260
- $selected = "";
1261
-
1262
- $w_day_type .= '<option value="'.$k.'" '.$selected.'>'.$k.'</option>';
1263
- }
1264
-
1265
-
1266
-
1267
- }
1268
- $w_day_type .= '</select>';
1269
- }
1270
- else
1271
- {
1272
- $w_day_type = '<input type="text" value="'.$param['w_day'].'" id="'.$id.'_dayform_id_temp" name="'.$id.'_dayform_id_temp" onchange="change_value(&quot;'.$id.'_dayform_id_temp&quot;)" onkeypress="return check_day(event, &quot;'.$id.'_dayform_id_temp&quot;)" onblur="if (this.value==&quot;0&quot;) this.value=&quot;&quot;; else add_0(&quot;'.$id.'_dayform_id_temp&quot;)" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].' disabled/>';
1273
- }
1274
-
1275
- if($param['w_month_type']=="SELECT")
1276
- {
1277
-
1278
- $w_month_type = '<select id="'.$id.'_monthform_id_temp" name="'.$id.'_monthform_id_temp" onchange="set_select(this)" style="width: '.$param['w_month_size'].'px;" '.$param['attributes'].' disabled><option value=""></option><option value="01" '.($param['w_month']=="01" ? "selected=\"selected\"": "").' ><!--repstart-->January<!--repend--></option><option value="02" '.($param['w_month']=="02" ? "selected=\"selected\"": "").'><!--repstart-->February<!--repend--></option><option value="03" '.($param['w_month']=="03"? "selected=\"selected\"": "").'><!--repstart-->March<!--repend--></option><option value="04" '.($param['w_month']=="04" ? "selected=\"selected\"": "").' ><!--repstart-->April<!--repend--></option><option value="05" '.($param['w_month']=="05" ? "selected=\"selected\"": "").' ><!--repstart-->May<!--repend--></option><option value="06" '.($param['w_month']=="06" ? "selected=\"selected\"": "").' ><!--repstart-->June<!--repend--></option><option value="07" '.($param['w_month']=="07" ? "selected=\"selected\"": "").' ><!--repstart-->July<!--repend--></option><option value="08" '.($param['w_month']=="08" ? "selected=\"selected\"": "").' ><!--repstart-->August<!--repend--></option><option value="09" '.($param['w_month']=="09" ? "selected=\"selected\"": "").' ><!--repstart-->September<!--repend--></option><option value="10" '.($param['w_month']=="10" ? "selected=\"selected\"": "").' ><!--repstart-->October<!--repend--></option><option value="11" '.($param['w_month']=="11" ? "selected=\"selected\"": "").'><!--repstart-->November<!--repend--></option><option value="12" '.($param['w_month']=="12" ? "selected=\"selected\"": "").' ><!--repstart-->December<!--repend--></option></select>';
1279
-
1280
- }
1281
- else
1282
- {
1283
- $w_month_type = '<input type="text" value="'.$param['w_month'].'" id="'.$id.'_monthform_id_temp" name="'.$id.'_monthform_id_temp" onkeypress="return check_month(event, &quot;'.$id.'_monthform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_monthform_id_temp&quot;)" onblur="if (this.value==&quot;0&quot;) this.value=&quot;&quot;; else add_0(&quot;'.$id.'_monthform_id_temp&quot;)" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].' disabled/>';
1284
-
1285
- }
1286
- $param['w_to'] = isset($param['w_to']) && $param['w_to']!="NaN" ? $param['w_to'] : date("Y");
1287
- if($param['w_year_type']=="SELECT")
1288
- {
1289
- $w_year_type = '<select id="'.$id.'_yearform_id_temp" name="'.$id.'_yearform_id_temp" onchange="set_select(this)" from="'.$param['w_from'].'" to="'.$param['w_to'].'" style="width: '.$param['w_year_size'].'px;" '.$param['attributes'].' disabled><option value=""></option>';
1290
- for($k=$param['w_to']; $k>=$param['w_from']; $k--)
1291
- {
1292
- if($param['w_year']==$k)
1293
- $selected = "selected=\"selected\"";
1294
- else
1295
- $selected = "";
1296
-
1297
- $w_year_type .= '<option value="'.$k.'" '.$selected.'>'.$k.'</option>';
1298
- }
1299
- $w_year_type .= '</select>';
1300
-
1301
- }
1302
- else
1303
- {
1304
- $w_year_type = '<input type="text" value="'.$param['w_year'].'" id="'.$id.'_yearform_id_temp" name="'.$id.'_yearform_id_temp" onchange="change_year(&quot;'.$id.'_yearform_id_temp&quot;)" onkeypress="return check_year1(event, &quot;'.$id.'_yearform_id_temp&quot;)" onblur="check_year2(&quot;'.$id.'_yearform_id_temp&quot;)" from="'.$param['w_from'].'" to="'.$param['w_to'].'" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].' disabled/>';
1305
- }
1306
-
1307
-
1308
- $rep ='<div id="wdform_field'.$id.'" type="type_date_fields" 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_date_fields" 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"><div id="'.$id.'_table_date" style="display: table;"><div id="'.$id.'_tr_date1" style="display: table-row;"><div id="'.$id.'_td_date_input1" style="display: table-cell;">
1309
- '.$w_day_type.'
1310
-
1311
- </div><div id="'.$id.'_td_date_separator1" style="display: table-cell;"><span id="'.$id.'_separator1" class="wdform_separator">'.$param['w_divider'].'</span></div><div id="'.$id.'_td_date_input2" style="display: table-cell;">'.$w_month_type.'</div><div id="'.$id.'_td_date_separator2" style="display: table-cell;"><span id="'.$id.'_separator2" class="wdform_separator">'.$param['w_divider'].'</span></div><div id="'.$id.'_td_date_input3" style="display: table-cell;">'.$w_year_type.'</div></div><div id="'.$id.'_tr_date2" style="display: table-row;"><div id="'.$id.'_td_date_label1" style="display: table-cell;"><label class="mini_label" id="'.$id.'_day_label">'.$param['w_day_label'].'</label></div><div style="display: table-cell;"></div><div id="'.$id.'_td_date_label2" style="display: table-cell;"><label class="mini_label" id="'.$id.'_month_label">'.$param['w_month_label'].'</label></div><div style="display: table-cell;"></div><div id="'.$id.'_td_date_label3" style="display: table-cell;"><label class="mini_label" id="'.$id.'_year_label">'.$param['w_year_label'].'</label></div></div></div></div></div>';
1312
-
1313
- break;
1314
- }
1315
- case 'type_file_upload':
1316
- {
1317
- $params_names=array('w_field_label_size','w_field_label_pos','w_destination','w_extension','w_max_size','w_required','w_multiple','w_class');
1318
- $temp=$params;
1319
- foreach($params_names as $params_name )
1320
- {
1321
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1322
- $param[$params_name] = $temp[0];
1323
- if (isset($temp[1])) {
1324
- $temp = $temp[1];
1325
- }
1326
- else {
1327
- $temp = '';
1328
- }
1329
- }
1330
-
1331
- if($temp)
1332
- {
1333
- $temp =explode('*:*w_attr_name*:*',$temp);
1334
- $attrs = array_slice($temp,0, count($temp)-1);
1335
- foreach($attrs as $attr)
1336
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1337
- }
1338
-
1339
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1340
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
1341
- $multiple = ($param['w_multiple']=="yes" ? "multiple='multiple'" : "");
1342
-
1343
- $rep ='<div id="wdform_field'.$id.'" type="type_file_upload" 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_file_upload" 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="***max_sizeskizb'.$id.'***'.$param['w_max_size'].'***max_sizeverj'.$id.'***" id="'.$id.'_max_size" name="'.$id.'_max_size"><input type="hidden" value="***destinationskizb'.$id.'***'.$param['w_destination'].'***destinationverj'.$id.'***" id="'.$id.'_destination" name="'.$id.'_destination"><input type="hidden" value="***extensionskizb'.$id.'***'.$param['w_extension'].'***extensionverj'.$id.'***" id="'.$id.'_extension" name="'.$id.'_extension"><input type="file" class="file_upload" id="'.$id.'_elementform_id_temp" name="'.$id.'_fileform_id_temp" '.$multiple.' '.$param['attributes'].' disabled/></div></div>';
1344
-
1345
- break;
1346
- }
1347
- case 'type_captcha':
1348
- {
1349
- $params_names=array('w_field_label_size','w_field_label_pos','w_digit','w_class');
1350
- $temp=$params;
1351
- foreach($params_names as $params_name )
1352
- {
1353
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1354
- $param[$params_name] = $temp[0];
1355
- $temp=$temp[1];
1356
- }
1357
-
1358
- if($temp)
1359
- {
1360
- $temp =explode('*:*w_attr_name*:*',$temp);
1361
- $attrs = array_slice($temp,0, count($temp)-1);
1362
- foreach($attrs as $attr)
1363
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1364
- }
1365
-
1366
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1367
-
1368
- $rep ='<div id="wdform_field'.$id.'" type="type_captcha" 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></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_captcha" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><div style="display: table;"><div style="display: table-row;"><div valign="middle" style="display: table-cell;"><img type="captcha" digit="'.$param['w_digit'].'" src="' . add_query_arg(array('action' => 'formmakerwdcaptcha', 'digit' => $param['w_digit'], 'i' => 'form_id_temp'), admin_url('admin-ajax.php')) . '" id="_wd_captchaform_id_temp" class="captcha_img" onclick="captcha_refresh(&quot;_wd_captcha&quot;,&quot;form_id_temp&quot;)" '.$param['attributes'].'></div><div valign="middle" style="display: table-cell;"><div class="captcha_refresh" id="_element_refreshform_id_temp" onclick="captcha_refresh(&quot;_wd_captcha&quot;,&quot;form_id_temp&quot;)" '.$param['attributes'].'></div></div></div><div style="display: table-row;"><div style="display: table-cell;"><input type="text" class="captcha_input" id="_wd_captcha_inputform_id_temp" name="captcha_input" style="width: '.($param['w_digit']*10+15).'px;" '.$param['attributes'].' disabled/></div></div></div></div></div>';
1369
-
1370
- break;
1371
- }
1372
- case 'type_arithmetic_captcha':
1373
- {
1374
- $params_names=array('w_field_label_size','w_field_label_pos', 'w_count', 'w_operations','w_class', 'w_input_size');
1375
- $temp=$params;
1376
- foreach($params_names as $params_name )
1377
- {
1378
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1379
- $param[$params_name] = $temp[0];
1380
- $temp=$temp[1];
1381
- }
1382
-
1383
- if($temp)
1384
- {
1385
- $temp =explode('*:*w_attr_name*:*',$temp);
1386
- $attrs = array_slice($temp,0, count($temp)-1);
1387
- foreach($attrs as $attr)
1388
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1389
- }
1390
-
1391
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1392
- $param['w_count'] = $param['w_count'] ? $param['w_count'] : 1;
1393
- $param['w_operations'] = $param['w_operations'] ? $param['w_operations'] : '+, -, *, /';
1394
- $param['w_input_size'] = $param['w_input_size'] ? $param['w_input_size'] : 60;
1395
-
1396
- $rep ='<div id="wdform_field'.$id.'" type="type_arithmetic_captcha" 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></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_captcha" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><div style="display: table;"><div style="display: table-row;"><div style="display: table-cell;"><img type="captcha" operations_count="'.$param['w_count'].'" operations="'.$param['w_operations'].'" input_size="'.$param['w_input_size'].'" src="' . add_query_arg(array('action' => 'formmakerwdmathcaptcha', 'operations_count' => $param['w_count'], 'operations' => $param['w_operations'], 'i' => 'form_id_temp'), admin_url('admin-ajax.php')) . '" id="_wd_arithmetic_captchaform_id_temp" class="arithmetic_captcha_img" onclick="captcha_refresh(&quot;_wd_arithmetic_captcha&quot;,&quot;form_id_temp&quot;)" '.$param['attributes'].'></div><div style="display: table-cell;"><input type="text" class="arithmetic_captcha_input" id="_wd_arithmetic_captcha_inputform_id_temp" name="arithmetic_captcha_input" onkeypress="return check_isnum(event)" style="width: '.$param['w_input_size'].'px;" '.$param['attributes'].' disabled/></div><div style="display: table-cell; vertical-align: middle;"><div class="captcha_refresh" id="_element_refreshform_id_temp" onclick="captcha_refresh(&quot;_wd_arithmetic_captcha&quot;,&quot;form_id_temp&quot;)" '.$param['attributes'].'></div></div></div></div></div></div>';
1397
-
1398
- break;
1399
- }
1400
-
1401
-
1402
- case 'type_recaptcha':
1403
- {
1404
- $params_names=array('w_field_label_size','w_field_label_pos','w_public','w_private','w_theme','w_class');
1405
- $temp=$params;
1406
- foreach($params_names as $params_name )
1407
- {
1408
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1409
- $param[$params_name] = $temp[0];
1410
- $temp=$temp[1];
1411
- }
1412
-
1413
- if($temp)
1414
- {
1415
- $temp =explode('*:*w_attr_name*:*',$temp);
1416
- $attrs = array_slice($temp,0, count($temp)-1);
1417
- foreach($attrs as $attr)
1418
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1419
- }
1420
-
1421
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1422
-
1423
- $rep ='<div id="wdform_field'.$id.'" type="type_recaptcha" 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></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_recaptcha" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><div id="wd_recaptchaform_id_temp" public_key="'.$param['w_public'].'" private_key="'.$param['w_private'].'" theme="'.$param['w_theme'].'" '.$param['attributes'].'><span style="color: red; font-style: italic;">Recaptcha doesn\'t display in back end</span></div></div></div>';
1424
-
1425
- break;
1426
- }
1427
-
1428
- case 'type_hidden':
1429
- {
1430
- $params_names=array('w_name','w_value');
1431
- $temp=$params;
1432
- foreach($params_names as $params_name )
1433
- {
1434
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1435
- $param[$params_name] = $temp[0];
1436
- $temp=$temp[1];
1437
- }
1438
-
1439
- if($temp)
1440
- {
1441
- $temp =explode('*:*w_attr_name*:*',$temp);
1442
- $attrs = array_slice($temp,0, count($temp)-1);
1443
- foreach($attrs as $attr)
1444
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1445
- }
1446
- $param['w_name'] = str_replace('&nbsp;','',$param['w_name']);
1447
- $rep ='<div id="wdform_field'.$id.'" type="type_hidden" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" style="display: table-cell;"><span id="'.$id.'_element_labelform_id_temp" style="display: none;">'.$param['w_name'].'</span><span style="color: red; font-size: 13px;">Hidden field</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" style="display: table-cell; padding-left:7px;"><input type="hidden" value="'.$param['w_value'].'" id="'.$id.'_elementform_id_temp" name="'.$param['w_name'].'" '.$param['attributes'].'><input type="hidden" value="type_hidden" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><div><span align="left">Name: </span><span align="left" id="'.$id.'_hidden_nameform_id_temp">'.$param['w_name'].'</span></div><div><span align="left">Value: </span><span align="left" id="'.$id.'_hidden_valueform_id_temp">'.$param['w_value'].'</span></div></div></div>';
1448
-
1449
- break;
1450
- }
1451
- case 'type_mark_map':
1452
- {
1453
- $params_names=array('w_field_label_size','w_field_label_pos','w_center_x','w_center_y','w_long','w_lat','w_zoom','w_width','w_height','w_info','w_class');
1454
- $temp=$params;
1455
- foreach($params_names as $params_name )
1456
- {
1457
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1458
- $param[$params_name] = $temp[0];
1459
- $temp=$temp[1];
1460
- }
1461
-
1462
- if($temp)
1463
- {
1464
- $temp =explode('*:*w_attr_name*:*',$temp);
1465
- $attrs = array_slice($temp,0, count($temp)-1);
1466
- foreach($attrs as $attr)
1467
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1468
- }
1469
-
1470
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1471
-
1472
- $rep ='<div id="wdform_field'.$id.'" type="type_mark_map" 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></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_mark_map" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><div id="'.$id.'_elementform_id_temp" long0="'.$param['w_long'].'" lat0="'.$param['w_lat'].'" zoom="'.$param['w_zoom'].'" info0="'.$param['w_info'].'" center_x="'.$param['w_center_x'].'" center_y="'.$param['w_center_y'].'" style="width: '.$param['w_width'].'px; height: '.$param['w_height'].'px;" '.$param['attributes'].'></div></div></div> ';
1473
-
1474
- break;
1475
- }
1476
-
1477
- case 'type_map':
1478
- {
1479
- $params_names=array('w_center_x','w_center_y','w_long','w_lat','w_zoom','w_width','w_height','w_info','w_class');
1480
- $temp=$params;
1481
- foreach($params_names as $params_name )
1482
- {
1483
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1484
- $param[$params_name] = $temp[0];
1485
- $temp=$temp[1];
1486
- }
1487
-
1488
- if($temp)
1489
- {
1490
- $temp =explode('*:*w_attr_name*:*',$temp);
1491
- $attrs = array_slice($temp,0, count($temp)-1);
1492
- foreach($attrs as $attr)
1493
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1494
- }
1495
-
1496
- $marker='';
1497
-
1498
- $param['w_long'] = explode('***',$param['w_long']);
1499
- $param['w_lat'] = explode('***',$param['w_lat']);
1500
- $param['w_info'] = explode('***',$param['w_info']);
1501
- foreach($param['w_long'] as $key => $w_long )
1502
- {
1503
- $marker.='long'.$key.'="'.$w_long.'" lat'.$key.'="'.$param['w_lat'][$key].'" info'.$key.'="'.$param['w_info'][$key].'"';
1504
- }
1505
-
1506
- $rep ='<div id="wdform_field'.$id.'" type="type_map" 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;">'.$label.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: table-cell;"><input type="hidden" value="type_map" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><div id="'.$id.'_elementform_id_temp" zoom="'.$param['w_zoom'].'" center_x="'.$param['w_center_x'].'" center_y="'.$param['w_center_y'].'" style="width: '.$param['w_width'].'px; height: '.$param['w_height'].'px;" '.$marker.' '.$param['attributes'].'></div></div></div>';
1507
-
1508
- break;
1509
- }
1510
- case 'type_paypal_price':
1511
- {
1512
-
1513
- $params_names=array('w_field_label_size','w_field_label_pos','w_first_val','w_title', 'w_mini_labels','w_size','w_required','w_hide_cents','w_class','w_range_min','w_range_max');
1514
- $temp=$params;
1515
- foreach($params_names as $params_name )
1516
- {
1517
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1518
- $param[$params_name] = $temp[0];
1519
- $temp=$temp[1];
1520
- }
1521
-
1522
- if($temp)
1523
- {
1524
- $temp =explode('*:*w_attr_name*:*',$temp);
1525
- $attrs = array_slice($temp,0, count($temp)-1);
1526
- foreach($attrs as $attr)
1527
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1528
- }
1529
-
1530
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1531
- $input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active");
1532
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
1533
- $hide_cents = ($param['w_hide_cents']=="yes" ? "none;" : "table-cell;");
1534
-
1535
-
1536
- $w_first_val = explode('***',$param['w_first_val']);
1537
- $w_title = explode('***',$param['w_title']);
1538
- $w_mini_labels = explode('***',$param['w_mini_labels']);
1539
-
1540
- $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" class="'.$input_active.'" id="'.$id.'_element_dollarsform_id_temp" name="'.$id.'_element_dollarsform_id_temp" value="'.$w_first_val[0].'" title="'.$w_title[0].'"onfocus="delete_value(&quot;'.$id.'_element_dollarsform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_element_dollarsform_id_temp&quot;)"onchange="change_value(&quot;'.$id.'_element_dollarsform_id_temp&quot;)" 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" class="'.$input_active.'" id="'.$id.'_element_centsform_id_temp" name="'.$id.'_element_centsform_id_temp" value="'.$w_first_val[1].'" title="'.$w_title[1].'"onfocus="delete_value(&quot;'.$id.'_element_centsform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_element_centsform_id_temp&quot;); add_0(&quot;'.$id.'_element_centsform_id_temp&quot;)"onchange="change_value(&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>';
1541
- break;
1542
- }
1543
-
1544
- case 'type_paypal_select':
1545
- {
1546
- $params_names=array('w_field_label_size','w_field_label_pos','w_size','w_choices','w_choices_price','w_choices_checked', 'w_choices_disabled','w_required','w_quantity', 'w_quantity_value','w_class','w_property','w_property_values');
1547
- $temp=$params;
1548
- if(strpos($temp, 'w_choices_params') > -1)
1549
- $params_names=array('w_field_label_size','w_field_label_pos','w_size','w_choices','w_choices_price','w_choices_checked', 'w_choices_disabled','w_required','w_quantity', 'w_quantity_value', 'w_choices_params', 'w_class', 'w_property', 'w_property_values');
1550
- foreach($params_names as $params_name )
1551
- {
1552
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1553
- $param[$params_name] = $temp[0];
1554
- $temp=$temp[1];
1555
- }
1556
-
1557
- if($temp)
1558
- {
1559
- $temp =explode('*:*w_attr_name*:*',$temp);
1560
- $attrs = array_slice($temp,0, count($temp)-1);
1561
- foreach($attrs as $attr)
1562
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1563
- }
1564
-
1565
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1566
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
1567
- $param['w_choices'] = explode('***',$param['w_choices']);
1568
-
1569
- $param['w_choices_price'] = explode('***',$param['w_choices_price']);
1570
-
1571
- $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
1572
-
1573
- $param['w_choices_disabled'] = explode('***',$param['w_choices_disabled']);
1574
- $param['w_property'] = explode('***',$param['w_property']);
1575
- $param['w_property_values'] = explode('***',$param['w_property_values']);
1576
- if(isset($param['w_choices_params']))
1577
- $param['w_choices_params'] = explode('***',$param['w_choices_params']);
1578
- foreach($param['w_choices_checked'] as $key => $choices_checked )
1579
- {
1580
- if($choices_checked=='true')
1581
- $param['w_choices_checked'][$key]='selected="selected"';
1582
- else
1583
- $param['w_choices_checked'][$key]='';
1584
- }
1585
-
1586
-
1587
- $rep='<div id="wdform_field'.$id.'" type="type_paypal_select" 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_select" 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"><select id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" onchange="set_select(this)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled>';
1588
- foreach($param['w_choices'] as $key => $choice)
1589
- {
1590
- $where = '';
1591
- $order_by = '';
1592
- $db_info = '';
1593
- $choice_value = $param['w_choices_disabled'][$key]=="true" ? '' : $param['w_choices_price'][$key];
1594
-
1595
- if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
1596
- {
1597
- $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
1598
- $where = "where='".$w_choices_params[0]."'";
1599
- $w_choices_params = explode('[db_info]',$w_choices_params[1]);
1600
- $order_by = "order_by='".$w_choices_params[0]."'";
1601
- $db_info = "db_info='".$w_choices_params[1]."'";
1602
- }
1603
- $rep.='<option id="'.$id.'_option'.$key.'" value="'.$choice_value.'" onselect="set_select(&quot;'.$id.'_option'.$key.'&quot;)" '.$param['w_choices_checked'][$key].' '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</option>';
1604
- }
1605
- $rep.='</select><div id="'.$id.'_divform_id_temp">';
1606
- if($param['w_quantity']=="yes")
1607
- $rep.='<span id="'.$id.'_element_quantity_spanform_id_temp" style="margin-right: 15px;"><label class="mini_label" id="'.$id.'_element_quantity_label_form_id_temp" style="margin-right: 5px;"><!--repstart-->Quantity<!--repend--></label><input type="text" value="'.$param['w_quantity_value'].'" id="'.$id.'_element_quantityform_id_temp" name="'.$id.'_element_quantityform_id_temp" onkeypress="return check_isnum(event)" onchange="change_value(&quot;'.$id.'_element_quantityform_id_temp&quot;, this.value)" style="width: 30px; margin: 2px 0px;" disabled /></span>';
1608
- if($param['w_property'][0])
1609
- foreach($param['w_property'] as $key => $property)
1610
- {
1611
-
1612
- $rep.='
1613
- <span id="'.$id.'_property_'.$key.'" style="margin-right: 15px;">
1614
-
1615
- <label class="mini_label" id="'.$id.'_property_label_form_id_temp'.$key.'" style="margin-right: 5px;">'.$property.'</label>
1616
- <select id="'.$id.'_propertyform_id_temp'.$key.'" name="'.$id.'_propertyform_id_temp'.$key.'" style="width: auto; margin: 2px 0px;" disabled>';
1617
- $param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
1618
- $param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
1619
- foreach($param['w_property_values'][$key] as $subkey => $property_value)
1620
- {
1621
- $rep.='<option id="'.$id.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'">'.$property_value.'</option>';
1622
- }
1623
- $rep.='</select></span>';
1624
- }
1625
-
1626
- $rep.='</div></div></div>';
1627
- break;
1628
- }
1629
-
1630
- case 'type_paypal_checkbox':
1631
- {
1632
-
1633
- $params_names=array('w_field_label_size','w_field_label_pos','w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num','w_class','w_property','w_property_values','w_quantity','w_quantity_value');
1634
- $temp=$params;
1635
- if(strpos($temp, 'w_field_option_pos') > -1)
1636
- $params_names=array('w_field_label_size','w_field_label_pos', 'w_field_option_pos', 'w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num', 'w_choices_params', 'w_class','w_property','w_property_values','w_quantity','w_quantity_value');
1637
- foreach($params_names as $params_name )
1638
- {
1639
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1640
- $param[$params_name] = $temp[0];
1641
- $temp=$temp[1];
1642
- }
1643
-
1644
- if($temp)
1645
- {
1646
- $temp =explode('*:*w_attr_name*:*',$temp);
1647
- $attrs = array_slice($temp,0, count($temp)-1);
1648
- foreach($attrs as $attr)
1649
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1650
- }
1651
- if(!isset($param['w_field_option_pos']))
1652
- $param['w_field_option_pos'] = 'left';
1653
-
1654
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1655
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
1656
- $param['w_choices'] = explode('***',$param['w_choices']);
1657
- $param['w_choices_price'] = explode('***',$param['w_choices_price']);
1658
- $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
1659
- $param['w_property'] = explode('***',$param['w_property']);
1660
- $param['w_property_values'] = explode('***',$param['w_property_values']);
1661
-
1662
- if(isset($param['w_choices_params']))
1663
- $param['w_choices_params'] = explode('***',$param['w_choices_params']);
1664
-
1665
- foreach($param['w_choices_checked'] as $key => $choices_checked )
1666
- {
1667
- if($choices_checked=='true')
1668
- $param['w_choices_checked'][$key]='checked="checked"';
1669
- else
1670
- $param['w_choices_checked'][$key]='';
1671
- }
1672
-
1673
- $rep='<div id="wdform_field'.$id.'" type="type_paypal_checkbox" 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="wd_form_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_checkbox" 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_randomize'].'" name="'.$id.'_randomizeform_id_temp" id="'.$id.'_randomizeform_id_temp"><input type="hidden" value="'.$param['w_allow_other'].'" name="'.$id.'_allow_otherform_id_temp" id="'.$id.'_allow_otherform_id_temp"><input type="hidden" value="'.$param['w_allow_other_num'].'" name="'.$id.'_allow_other_numform_id_temp" id="'.$id.'_allow_other_numform_id_temp"><input type="hidden" value="'.$param['w_field_option_pos'].'" id="'.$id.'_option_left_right"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;">';
1674
-
1675
- if($param['w_flow']=='hor')
1676
- {
1677
- $rep.= '<div id="'.$id.'_hor" style="display: table-row;">';
1678
- foreach($param['w_choices'] as $key => $choice)
1679
- {
1680
- $where ='';
1681
- $order_by ='';
1682
- $db_info = '';
1683
- if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
1684
- {
1685
- $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
1686
- $where = "where='".$w_choices_params[0]."'";
1687
- $w_choices_params = explode('[db_info]',$w_choices_params[1]);
1688
- $order_by = "order_by='".$w_choices_params[0]."'";
1689
- $db_info = "db_info='".$w_choices_params[1]."'";
1690
- }
1691
-
1692
- $rep.='<div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="checkbox" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp'.$key.'" value="'.$param['w_choices_price'][$key].'" onclick="set_checked(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][$key].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'" '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</label></div>';
1693
- }
1694
- $rep.= '</div>';
1695
- }
1696
- else
1697
- {
1698
-
1699
- foreach($param['w_choices'] as $key => $choice)
1700
- {
1701
- $where ='';
1702
- $order_by ='';
1703
- $db_info ='';
1704
- if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
1705
- {
1706
- $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
1707
- $where = "where='".$w_choices_params[0]."'";
1708
- $w_choices_params = explode('[db_info]',$w_choices_params[1]);
1709
- $order_by = "order_by='".$w_choices_params[0]."'";
1710
- $db_info = "db_info='".$w_choices_params[1]."'";
1711
- }
1712
-
1713
- $rep.='<div id="'.$id.'_element_tr'.$key.'" style="display: table-row;"><div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="checkbox" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp'.$key.'" value="'.$param['w_choices_price'][$key].'" onclick="set_checked(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][$key].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'" '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</label></div></div>';
1714
- }
1715
-
1716
- }
1717
- $rep.='</div></div>';
1718
-
1719
- $rep.='<div id="'.$id.'_divform_id_temp">';
1720
- if($param['w_quantity']=="yes")
1721
- $rep.='<span id="'.$id.'_element_quantity_spanform_id_temp" style="margin-right: 15px;"><label class="mini_label" id="'.$id.'_element_quantity_label_form_id_temp" style="margin-right: 5px;"><!--repstart-->Quantity<!--repend--></label><input type="text" value="'.$param['w_quantity_value'].'" id="'.$id.'_element_quantityform_id_temp" name="'.$id.'_element_quantityform_id_temp" onkeypress="return check_isnum(event)" onchange="change_value(&quot;'.$id.'_element_quantityform_id_temp&quot;, this.value)" style="width: 30px; margin: 2px 0px;" disabled/></span>';
1722
- if($param['w_property'][0])
1723
- foreach($param['w_property'] as $key => $property)
1724
- {
1725
- $rep.='
1726
- <span id="'.$id.'_property_'.$key.'" style="margin-right: 15px;">
1727
-
1728
- <label class="mini_label" id="'.$id.'_property_label_form_id_temp'.$key.'" style="margin-right: 5px;">'.$property.'</label>
1729
- <select id="'.$id.'_propertyform_id_temp'.$key.'" name="'.$id.'_propertyform_id_temp'.$key.'" style="width: auto; margin: 2px 0px;" disabled>';
1730
- $param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
1731
- $param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
1732
- foreach($param['w_property_values'][$key] as $subkey => $property_value)
1733
- {
1734
- $rep.='<option id="'.$id.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'">'.$property_value.'</option>';
1735
- }
1736
- $rep.='</select></span>';
1737
- }
1738
-
1739
- $rep.='</div></div></div>';
1740
- break;
1741
- }
1742
- case 'type_paypal_radio':
1743
- {
1744
-
1745
- $params_names=array('w_field_label_size','w_field_label_pos','w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num','w_class','w_property','w_property_values','w_quantity','w_quantity_value');
1746
- $temp=$params;
1747
- if(strpos($temp, 'w_field_option_pos') > -1)
1748
- $params_names=array('w_field_label_size','w_field_label_pos', 'w_field_option_pos', 'w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num', 'w_choices_params', 'w_class','w_property','w_property_values','w_quantity','w_quantity_value');
1749
- foreach($params_names as $params_name )
1750
- {
1751
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1752
- $param[$params_name] = $temp[0];
1753
- $temp=$temp[1];
1754
- }
1755
-
1756
- if($temp)
1757
- {
1758
- $temp =explode('*:*w_attr_name*:*',$temp);
1759
- $attrs = array_slice($temp,0, count($temp)-1);
1760
- foreach($attrs as $attr)
1761
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1762
- }
1763
- if(!isset($param['w_field_option_pos']))
1764
- $param['w_field_option_pos'] = 'left';
1765
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1766
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
1767
- $param['w_choices'] = explode('***',$param['w_choices']);
1768
-
1769
- $param['w_choices_price'] = explode('***',$param['w_choices_price']);
1770
-
1771
- $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
1772
-
1773
- $param['w_property'] = explode('***',$param['w_property']);
1774
- $param['w_property_values'] = explode('***',$param['w_property_values']);
1775
-
1776
- if(isset($param['w_choices_params']))
1777
- $param['w_choices_params'] = explode('***',$param['w_choices_params']);
1778
-
1779
- foreach($param['w_choices_checked'] as $key => $choices_checked )
1780
- {
1781
- if($choices_checked=='true')
1782
- $param['w_choices_checked'][$key]='checked="checked"';
1783
- else
1784
- $param['w_choices_checked'][$key]='';
1785
- }
1786
-
1787
- $rep='<div id="wdform_field'.$id.'" type="type_paypal_radio" 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="wd_form_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_radio" 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_randomize'].'" name="'.$id.'_randomizeform_id_temp" id="'.$id.'_randomizeform_id_temp"><input type="hidden" value="'.$param['w_allow_other'].'" name="'.$id.'_allow_otherform_id_temp" id="'.$id.'_allow_otherform_id_temp"><input type="hidden" value="'.$param['w_allow_other_num'].'" name="'.$id.'_allow_other_numform_id_temp" id="'.$id.'_allow_other_numform_id_temp"><input type="hidden" value="'.$param['w_field_option_pos'].'" id="'.$id.'_option_left_right"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;">';
1788
-
1789
- if($param['w_flow']=='hor')
1790
- {
1791
- $rep.= '<div id="'.$id.'_hor" style="display: table-row;">';
1792
- foreach($param['w_choices'] as $key => $choice)
1793
- {
1794
- $where ='';
1795
- $order_by ='';
1796
- $db_info ='';
1797
- if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
1798
- {
1799
- $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
1800
- $where = "where='".$w_choices_params[0]."'";
1801
- $w_choices_params = explode('[db_info]',$w_choices_params[1]);
1802
- $order_by = "order_by='".$w_choices_params[0]."'";
1803
- $db_info = "db_info='".$w_choices_params[1]."'";
1804
- }
1805
-
1806
- $rep.='<div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="radio" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp" value="'.$param['w_choices_price'][$key].'" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][$key].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'" '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</label></div>';
1807
- }
1808
- $rep.= '</div>';
1809
- }
1810
- else
1811
- {
1812
-
1813
- foreach($param['w_choices'] as $key => $choice)
1814
- {
1815
-
1816
- $where ='';
1817
- $order_by ='';
1818
- $db_info ='';
1819
- if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
1820
- {
1821
- $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
1822
- $where = "where='".$w_choices_params[0]."'";
1823
- $w_choices_params = explode('[db_info]',$w_choices_params[1]);
1824
- $order_by = "order_by='".$w_choices_params[0]."'";
1825
- $db_info = "db_info='".$w_choices_params[1]."'";
1826
- }
1827
-
1828
- $rep.='<div id="'.$id.'_element_tr'.$key.'" style="display: table-row;"><div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="radio" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp" value="'.$param['w_choices_price'][$key].'" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][$key].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'" '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</label></div></div>';
1829
- }
1830
-
1831
- }
1832
- $rep.='</div></div>';
1833
-
1834
- $rep.='<div id="'.$id.'_divform_id_temp">';
1835
- if($param['w_quantity']=="yes")
1836
- $rep.='<span id="'.$id.'_element_quantity_spanform_id_temp" style="margin-right: 15px;"><label class="mini_label" id="'.$id.'_element_quantity_label_form_id_temp" style="margin-right: 5px;"><!--repstart-->Quantity<!--repend--></label><input type="text" value="'.$param['w_quantity_value'].'" id="'.$id.'_element_quantityform_id_temp" name="'.$id.'_element_quantityform_id_temp" onkeypress="return check_isnum(event)" onchange="change_value(&quot;'.$id.'_element_quantityform_id_temp&quot;, this.value)" style="width: 30px; margin: 2px 0px;" disabled/></span>';
1837
- if($param['w_property'][0])
1838
- foreach($param['w_property'] as $key => $property)
1839
- {
1840
- $rep.='
1841
- <span id="'.$id.'_property_'.$key.'" style="margin-right: 15px;">
1842
-
1843
- <label class="mini_label" id="'.$id.'_property_label_form_id_temp'.$key.'" style="margin-right: 5px;">'.$property.'</label>
1844
- <select id="'.$id.'_propertyform_id_temp'.$key.'" name="'.$id.'_propertyform_id_temp'.$key.'" style="width: auto; margin: 2px 0px;" disabled>';
1845
- $param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
1846
- $param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
1847
- foreach($param['w_property_values'][$key] as $subkey => $property_value)
1848
- {
1849
- $rep.='<option id="'.$id.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'">'.$property_value.'</option>';
1850
- }
1851
- $rep.='</select></span>';
1852
- }
1853
-
1854
- $rep.='</div></div></div>';
1855
-
1856
- break;
1857
- }
1858
- case 'type_paypal_shipping':
1859
- {
1860
-
1861
- $params_names=array('w_field_label_size','w_field_label_pos', 'w_field_option_pos', 'w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num','w_class');
1862
- $temp=$params;
1863
- if(strpos($temp, 'w_field_option_pos') > -1)
1864
- $params_names=array('w_field_label_size','w_field_label_pos', 'w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num','w_choices_params','w_class');
1865
- foreach($params_names as $params_name )
1866
- {
1867
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1868
- $param[$params_name] = $temp[0];
1869
- $temp=$temp[1];
1870
- }
1871
-
1872
- if($temp)
1873
- {
1874
- $temp =explode('*:*w_attr_name*:*',$temp);
1875
- $attrs = array_slice($temp,0, count($temp)-1);
1876
- foreach($attrs as $attr)
1877
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1878
- }
1879
- if(!isset($param['w_field_option_pos']))
1880
- $param['w_field_option_pos'] = 'left';
1881
-
1882
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1883
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
1884
- $param['w_choices'] = explode('***',$param['w_choices']);
1885
-
1886
- $param['w_choices_price'] = explode('***',$param['w_choices_price']);
1887
-
1888
- $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
1889
-
1890
- if(isset($param['w_choices_params']))
1891
- $param['w_choices_params'] = explode('***',$param['w_choices_params']);
1892
-
1893
- foreach($param['w_choices_checked'] as $key => $choices_checked )
1894
- {
1895
- if($choices_checked=='true')
1896
- $param['w_choices_checked'][$key]='checked="checked"';
1897
- else
1898
- $param['w_choices_checked'][$key]='';
1899
- }
1900
-
1901
- $rep='<div id="wdform_field'.$id.'" type="type_paypal_shipping" 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="wd_form_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'].'; vertical-align:top;"><input type="hidden" value="type_paypal_shipping" 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_randomize'].'" name="'.$id.'_randomizeform_id_temp" id="'.$id.'_randomizeform_id_temp"><input type="hidden" value="'.$param['w_allow_other'].'" name="'.$id.'_allow_otherform_id_temp" id="'.$id.'_allow_otherform_id_temp"><input type="hidden" value="'.$param['w_allow_other_num'].'" name="'.$id.'_allow_other_numform_id_temp" id="'.$id.'_allow_other_numform_id_temp"><input type="hidden" value="'.$param['w_field_option_pos'].'" id="'.$id.'_option_left_right"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;">';
1902
-
1903
- if($param['w_flow']=='hor')
1904
- {
1905
- $rep.= '<div id="'.$id.'_hor" style="display: table-row;">';
1906
- foreach($param['w_choices'] as $key => $choice)
1907
- {
1908
- $where ='';
1909
- $order_by ='';
1910
- $db_info ='';
1911
- if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
1912
- {
1913
- $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
1914
- $where = "where='".$w_choices_params[0]."'";
1915
- $w_choices_params = explode('[db_info]',$w_choices_params[1]);
1916
- $order_by = "order_by='".$w_choices_params[0]."'";
1917
- $db_info = "db_info='".$w_choices_params[1]."'";
1918
- }
1919
-
1920
- $rep.='<div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="radio" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp" value="'.$param['w_choices_price'][$key].'" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][$key].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'" '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</label></div>';
1921
- }
1922
- $rep.= '</div>';
1923
- }
1924
- else
1925
- {
1926
-
1927
- foreach($param['w_choices'] as $key => $choice)
1928
- {
1929
- $where ='';
1930
- $order_by ='';
1931
- $db_info ='';
1932
- if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
1933
- {
1934
- $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
1935
- $where = "where='".$w_choices_params[0]."'";
1936
- $w_choices_params = explode('[db_info]',$w_choices_params[1]);
1937
- $order_by = "order_by='".$w_choices_params[0]."'";
1938
- $db_info = "db_info='".$w_choices_params[1]."'";
1939
- }
1940
-
1941
- $rep.='<div id="'.$id.'_element_tr'.$key.'" style="display: table-row;"><div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="radio" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp" value="'.$param['w_choices_price'][$key].'" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][$key].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'" '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</label></div></div>';
1942
- }
1943
-
1944
- }
1945
- $rep.='</div></div>';
1946
-
1947
- $rep.='</div></div>';
1948
-
1949
- break;
1950
- }
1951
- case 'type_paypal_total':
1952
- {
1953
- $params_names=array('w_field_label_size','w_field_label_pos','w_class');
1954
- $temp=$params;
1955
- foreach($params_names as $params_name )
1956
- {
1957
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1958
- $param[$params_name] = $temp[0];
1959
- $temp=$temp[1];
1960
- }
1961
-
1962
- if($temp)
1963
- {
1964
- $temp =explode('*:*w_attr_name*:*',$temp);
1965
- $attrs = array_slice($temp,0, count($temp)-1);
1966
- foreach($attrs as $attr)
1967
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1968
- }
1969
-
1970
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1971
-
1972
-
1973
-
1974
- $rep='<div id="wdform_field'.$id.'" type="type_paypal_total" 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">'.$label.'</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_total" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><div id="'.$id.'paypal_totalform_id_temp" class="wdform_paypal_total paypal_totalform_id_temp"><input type="hidden" value="" name="'.$id.'_paypal_totalform_id_temp" class="input_paypal_totalform_id_temp"><div id="'.$id.'div_totalform_id_temp" class="div_totalform_id_temp" style="margin-bottom: 10px;"><!--repstart-->$300<!--repend--></div><div id="'.$id.'paypal_productsform_id_temp" class="paypal_productsform_id_temp" style="border-spacing: 2px;"><div style="border-spacing: 2px;"><!--repstart-->product 1 $100<!--repend--></div><div style="border-spacing: 2px;"><!--repstart-->product 2 $200<!--repend--></div></div><div id="'.$id.'paypal_taxform_id_temp" class="paypal_taxform_id_temp" style="border-spacing: 2px; margin-top: 7px;"></div></div></div></div>';
1975
-
1976
-
1977
- break;
1978
- }
1979
-
1980
- case 'type_star_rating':
1981
- {
1982
- $params_names=array('w_field_label_size','w_field_label_pos','w_field_label_col','w_star_amount','w_required','w_class');
1983
- $temp=$params;
1984
- foreach($params_names as $params_name )
1985
- {
1986
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1987
- $param[$params_name] = $temp[0];
1988
- $temp=$temp[1];
1989
- }
1990
-
1991
- if($temp)
1992
- {
1993
- $temp =explode('*:*w_attr_name*:*',$temp);
1994
- $attrs = array_slice($temp,0, count($temp)-1);
1995
- foreach($attrs as $attr)
1996
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1997
- }
1998
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1999
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
2000
-
2001
-
2002
- $images = '';
2003
- for($i=0; $i<$param['w_star_amount']; $i++)
2004
- {
2005
- $images .= '<img id="'.$id.'_star_'.$i.'" src="' . WD_FM_URL . '/images/star.png?ver='. get_option("wd_form_maker_version").'" onmouseover="change_src('.$i.','.$id.',&quot;form_id_temp&quot;)" onmouseout="reset_src('.$i.','.$id.')" onclick="select_star_rating('.$i.','.$id.', &quot;form_id_temp&quot;)">';
2006
- }
2007
-
2008
- $rep ='<div id="wdform_field'.$id.'" type="type_star_rating" 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">'.$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_star_rating" 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_star_amount'].'" id="'.$id.'_star_amountform_id_temp" name="'.$id.'_star_amountform_id_temp"><input type="hidden" value="'.$param['w_field_label_col'].'" name="'.$id.'_star_colorform_id_temp" id="'.$id.'_star_colorform_id_temp"><div id="'.$id.'_elementform_id_temp" class="wdform_stars" '.$param['attributes'].'>'.$images.'</div></div></div>';
2009
-
2010
-
2011
- break;
2012
- }
2013
- case 'type_scale_rating':
2014
- {
2015
- $params_names=array('w_field_label_size','w_field_label_pos','w_mini_labels','w_scale_amount','w_required','w_class');
2016
- $temp=$params;
2017
- foreach($params_names as $params_name )
2018
- {
2019
- $temp=explode('*:*'.$params_name.'*:*',$temp);
2020
- $param[$params_name] = $temp[0];
2021
- $temp=$temp[1];
2022
- }
2023
-
2024
- if($temp)
2025
- {
2026
- $temp =explode('*:*w_attr_name*:*',$temp);
2027
- $attrs = array_slice($temp,0, count($temp)-1);
2028
- foreach($attrs as $attr)
2029
- $param['attributes'] = $param['attributes'].' add_'.$attr;
2030
- }
2031
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
2032
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
2033
-
2034
- $w_mini_labels = explode('***',$param['w_mini_labels']);
2035
-
2036
- $numbers = '';
2037
- for($i=1; $i<=$param['w_scale_amount']; $i++)
2038
- {
2039
- $numbers .= '<div id="'.$id.'_scale_td1_'.$i.'form_id_temp" style="text-align: center; display: table-cell;"><span>'.$i.'</span></div>';
2040
- }
2041
-
2042
-
2043
- $radio_buttons = '';
2044
- for($k=1; $k<=$param['w_scale_amount']; $k++)
2045
- {
2046
- $radio_buttons .= '<div id="'.$id.'_scale_td2_'.$k.'form_id_temp" style="display: table-cell;"><input id="'.$id.'_scale_radioform_id_temp_'.$k.'" name="'.$id.'_scale_radioform_id_temp" value="'.$k.'" type="radio"></div>';
2047
- }
2048
-
2049
- $rep ='<div id="wdform_field'.$id.'" type="type_scale_rating" 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'].'; vertical-align: top; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label">'.$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_scale_rating" 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_scale_amount'].'" id="'.$id.'_scale_amountform_id_temp" name="'.$id.'_scale_amountform_id_temp"><div id="'.$id.'_elementform_id_temp" style="float: left;" '.$param['attributes'].'><label class="mini_label" id="'.$id.'_mini_label_worst" style="position: relative; top: 6px; font-size: 11px; display: inline-table;">'.$w_mini_labels[0].'</label><div id="'.$id.'_scale_tableform_id_temp" style="display: inline-table;"><div id="'.$id.'_scale_tr1form_id_temp" style="display: table-row;">'.$numbers.'</div><div id="'.$id.'_scale_tr2form_id_temp" style="display: table-row;">'.$radio_buttons.'</div></div><label class="mini_label" id="'.$id.'_mini_label_best" style="position: relative; top: 6px; font-size: 11px; display: inline-table;">'.$w_mini_labels[1].'</label></div></div></div>';
2050
-
2051
- break;
2052
- }
2053
- case 'type_spinner':
2054
- {
2055
- $params_names=array('w_field_label_size','w_field_label_pos','w_field_width','w_field_min_value','w_field_max_value', 'w_field_step', 'w_field_value', 'w_required','w_class');
2056
- $temp=$params;
2057
- foreach($params_names as $params_name ) {
2058
- $temp=explode('*:*'.$params_name.'*:*',$temp);
2059
- $param[$params_name] = $temp[0];
2060
- $temp=$temp[1];
2061
- }
2062
- if($temp) {
2063
- $temp =explode('*:*w_attr_name*:*',$temp);
2064
- $attrs = array_slice($temp,0, count($temp)-1);
2065
- foreach($attrs as $attr)
2066
- $param['attributes'] = $param['attributes'].' add_'.$attr;
2067
- }
2068
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
2069
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
2070
- $rep ='<div id="wdform_field'.$id.'" type="type_spinner" 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">'.$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_spinner" 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_field_width'].'" name="'.$id.'_spinner_widthform_id_temp" id="'.$id.'_spinner_widthform_id_temp"><input type="hidden" value="'.$param['w_field_min_value'].'" id="'.$id.'_min_valueform_id_temp" name="'.$id.'_min_valueform_id_temp"><input type="hidden" value="'.$param['w_field_max_value'].'" name="'.$id.'_max_valueform_id_temp" id="'.$id.'_max_valueform_id_temp"><input type="hidden" value="'.$param['w_field_step'].'" name="'.$id.'_stepform_id_temp" id="'.$id.'_stepform_id_temp"><input type="" value="'.($param['w_field_value']!= 'null' ? $param['w_field_value'] : '').'" name="'.$id.'_elementform_id_temp" id="'.$id.'_elementform_id_temp" onkeypress="return check_isnum_or_minus(event)" style="width: '.$param['w_field_width'].'px;" '.$param['attributes'].' disabled/></div></div>';
2071
- break;
2072
- }
2073
- case 'type_slider': {
2074
- $params_names=array('w_field_label_size','w_field_label_pos','w_field_width','w_field_min_value','w_field_max_value', 'w_field_value', 'w_required','w_class');
2075
- $temp=$params;
2076
- foreach($params_names as $params_name ) {
2077
- $temp = explode('*:*'.$params_name.'*:*',$temp);
2078
- $param[$params_name] = $temp[0];
2079
- $temp=$temp[1];
2080
- }
2081
- if ($temp) {
2082
- $temp = explode('*:*w_attr_name*:*', $temp);
2083
- $attrs = array_slice($temp,0, count($temp)-1);
2084
- foreach($attrs as $attr) {
2085
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
2086
- }
2087
- }
2088
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
2089
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
2090
- $rep ='<div id="wdform_field'.$id.'" type="type_slider" 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'].'; vertical-align: top; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label">'.$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_slider" 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_field_width'].'" name="'.$id.'_slider_widthform_id_temp" id="'.$id.'_slider_widthform_id_temp"><input type="hidden" value="'.$param['w_field_min_value'].'" id="'.$id.'_slider_min_valueform_id_temp" name="'.$id.'_slider_min_valueform_id_temp"><input type="hidden" value="'.$param['w_field_max_value'].'" id="'.$id.'_slider_max_valueform_id_temp" name="'.$id.'_slider_max_valueform_id_temp"><input type="hidden" value="'.$param['w_field_value'].'" id="'.$id.'_slider_valueform_id_temp" name="'.$id.'_slider_valueform_id_temp"><div id="'.$id.'_slider_tableform_id_temp"><div><div id="'.$id.'_slider_td1form_id_temp"><div name="'.$id.'_elementform_id_temp" id="'.$id.'_elementform_id_temp" style="width: '.$param['w_field_width'].'px;" '.$param['attributes'].'"></div></div></div><div><div align="left" id="'.$id.'_slider_td2form_id_temp" style="display: inline-table; width: 33.3%; text-align: left;"><span id="'.$id.'_element_minform_id_temp" class="label">'.$param['w_field_min_value'].'</span></div><div align="right" id="'.$id.'_slider_td3form_id_temp" style="display: inline-table; width: 33.3%; text-align: center;"><span id="'.$id.'_element_valueform_id_temp" class="label">'.$param['w_field_value'].'</span></div><div align="right" id="'.$id.'_slider_td4form_id_temp" style="display: inline-table; width: 33.3%; text-align: right;"><span id="'.$id.'_element_maxform_id_temp" class="label">'.$param['w_field_max_value'].'</span></div></div></div></div></div>';
2091
- break;
2092
- }
2093
- case 'type_range': {
2094
- $params_names = array('w_field_label_size','w_field_label_pos','w_field_range_width','w_field_range_step','w_field_value1', 'w_field_value2', 'w_mini_labels', 'w_required','w_class');
2095
- $temp = $params;
2096
- foreach ($params_names as $params_name ) {
2097
- $temp = explode('*:*' . $params_name . '*:*', $temp);
2098
- $param[$params_name] = $temp[0];
2099
- $temp = $temp[1];
2100
- }
2101
- if ($temp) {
2102
- $temp = explode('*:*w_attr_name*:*', $temp);
2103
- $attrs = array_slice($temp, 0, count($temp) - 1);
2104
- foreach($attrs as $attr) {
2105
- $param['attributes'] = $param['attributes'].' add_'.$attr;
2106
- }
2107
- }
2108
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
2109
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
2110
- $w_mini_labels = explode('***',$param['w_mini_labels']);
2111
- $rep ='<div id="wdform_field'.$id.'" type="type_range" 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">'.$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_range" 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_field_range_width'].'" name="'.$id.'_range_widthform_id_temp" id="'.$id.'_range_widthform_id_temp"><input type="hidden" value="'.$param['w_field_range_step'].'" name="'.$id.'_range_stepform_id_temp" id="'.$id.'_range_stepform_id_temp"><div id="'.$id.'_elemet_table_littleform_id_temp" style="display: table;"><div style="display: table-row;"><div valign="middle" align="left" style="display: table-cell;"><input type="" value="'.($param['w_field_value1']!= 'null' ? $param['w_field_value1'] : '').'" name="'.$id.'_elementform_id_temp0" id="'.$id.'_elementform_id_temp0" onkeypress="return check_isnum_or_minus(event)" style="width: '.$param['w_field_range_width'].'px;" '.$param['attributes'].' disabled/></div><div valign="middle" align="left" style="display: table-cell; padding-left: 4px;"><input type="" value="'.($param['w_field_value2']!= 'null' ? $param['w_field_value2'] : '').'" name="'.$id.'_elementform_id_temp1" id="'.$id.'_elementform_id_temp1" onkeypress="return check_isnum_or_minus(event)" style="width: '.$param['w_field_range_width'].'px;" '.$param['attributes'].' disabled/></div></div><div style="display: table-row;"><div valign="top" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_from">'.$w_mini_labels[0].'</label></div><div valign="top" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_to">'.$w_mini_labels[1].'</label></div></div></div></div></div>';
2112
- break;
2113
- }
2114
- case 'type_grading': {
2115
- $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_items', 'w_total', 'w_required', 'w_class');
2116
- $temp = $params;
2117
- foreach($params_names as $params_name) {
2118
- $temp = explode('*:*' . $params_name . '*:*', $temp);
2119
- $param[$params_name] = $temp[0];
2120
- $temp = $temp[1];
2121
- }
2122
- if ($temp) {
2123
- $temp = explode('*:*w_attr_name*:*', $temp);
2124
- $attrs = array_slice($temp, 0, count($temp) - 1);
2125
- foreach ($attrs as $attr) {
2126
- $param['attributes'] = $param['attributes'].' add_'.$attr;
2127
- }
2128
- }
2129
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
2130
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
2131
- $w_items = explode('***', $param['w_items']);
2132
- $grading_items = '';
2133
- for($i=0; $i<count($w_items); $i++)
2134
- {
2135
- $grading_items .= '<div id="'.$id.'_element_div'.$i.'" class="grading"><input id="'.$id.'_elementform_id_temp_'.$i.'" name="'.$id.'_elementform_id_temp_'.$i.'" onkeypress="return check_isnum_or_minus(event)" value="" size="5" onkeyup="sum_grading_values('.$id.',&quot;form_id_temp&quot;)" onchange="sum_grading_values('.$id.',&quot;form_id_temp&quot;)" '.$param['attributes'].' disabled/><label id="'.$id.'_label_elementform_id_temp'.$i.'" class="ch-rad-label">'.$w_items[$i].'</label></div>';
2136
- }
2137
-
2138
- $rep ='<div id="wdform_field'.$id.'" type="type_grading" 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'].'; vertical-align: top; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label">'.$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_grading" 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_total'].'" name="'.$id.'_grading_totalform_id_temp" id="'.$id.'_grading_totalform_id_temp"><div id="'.$id.'_elementform_id_temp">'.$grading_items.'<div id="'.$id.'_element_total_divform_id_temp" class="grading_div">Total:<span id="'.$id.'_sum_elementform_id_temp" name="'.$id.'_sum_elementform_id_temp">0</span>/<span id="'.$id.'_total_elementform_id_temp" name="'.$id.'_total_elementform_id_temp">'.$param['w_total'].'</span><span id="'.$id.'_text_elementform_id_temp" name="'.$id.'_text_elementform_id_temp"></span></div></div></div></div>';
2139
-
2140
- break;
2141
- }
2142
- case 'type_matrix': {
2143
- $params_names=array('w_field_label_size','w_field_label_pos', 'w_field_input_type', 'w_rows', 'w_columns', 'w_required','w_class','w_textbox_size');
2144
- $temp = $params;
2145
- foreach ($params_names as $params_name) {
2146
- $temp = explode('*:*'.$params_name.'*:*',$temp);
2147
- $param[$params_name] = $temp[0];
2148
- $temp = $temp[1];
2149
- }
2150
- if ($temp) {
2151
- $temp = explode('*:*w_attr_name*:*', $temp);
2152
- $attrs = array_slice($temp, 0, count($temp) - 1);
2153
- foreach ($attrs as $attr) {
2154
- $param['attributes'] = $param['attributes'].' add_'.$attr;
2155
- }
2156
- }
2157
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
2158
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
2159
- $param['w_textbox_size'] = isset($param['w_textbox_size']) ? $param['w_textbox_size'] : '100';
2160
- $w_rows = explode('***',$param['w_rows']);
2161
- $w_columns = explode('***',$param['w_columns']);
2162
- $column_labels = '';
2163
- for ($i = 1; $i < count($w_columns); $i++) {
2164
- $column_labels .= '<div id="'.$id.'_element_td0_'.$i.'" class="matrix_" style="display: table-cell;"><label id="'.$id.'_label_elementform_id_temp0_'.$i.'" name="'.$id.'_label_elementform_id_temp0_'.$i.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$i.'" value="'.$w_columns[$i].'">'.$w_columns[$i].'</label></div>';
2165
- }
2166
- $rows_columns = '';
2167
- for($i=1; $i<count($w_rows); $i++)
2168
- {
2169
-
2170
- $rows_columns .= '<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;"><div id="'.$id.'_element_td'.$i.'_0" class="matrix_" style="display: table-cell;"><label id="'.$id.'_label_elementform_id_temp'.$i.'_0" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$i.'" value="'.$w_rows[$i].'">'.$w_rows[$i].'</label></div>';
2171
-
2172
-
2173
- for($k=1; $k<count($w_columns); $k++)
2174
- {
2175
- if($param['w_field_input_type']=='radio')
2176
- $rows_columns .= '<div id="'.$id.'_element_td'.$i.'_'.$k.'" style="text-align: center; display: table-cell; padding: 5px 0 0 5px;"><input id="'.$id.'_input_elementform_id_temp'.$i.'_'.$k.'" align="center" size="14" type="radio" name="'.$id.'_input_elementform_id_temp'.$i.'" value="'.$i.'_'.$k.'" disabled/></div>';
2177
- else
2178
- if($param['w_field_input_type']=='checkbox')
2179
- $rows_columns .= '<div id="'.$id.'_element_td'.$i.'_'.$k.'" style="text-align: center; display: table-cell; padding: 5px 0 0 5px;"><input id="'.$id.'_input_elementform_id_temp'.$i.'_'.$k.'" align="center" size="14" type="checkbox" name="'.$id.'_input_elementform_id_temp'.$i.'_'.$k.'" value="1" disabled/></div>';
2180
- else
2181
- if($param['w_field_input_type']=='text')
2182
- $rows_columns .= '<div id="'.$id.'_element_td'.$i.'_'.$k.'" style="text-align: center; display: table-cell; padding: 5px 0 0 5px;"><input id="'.$id.'_input_elementform_id_temp'.$i.'_'.$k.'" align="center" type="text" name="'.$id.'_input_elementform_id_temp'.$i.'_'.$k.'" value="" style="width:'.$param['w_textbox_size'].'px" disabled/></div>';
2183
- else
2184
- if($param['w_field_input_type']=='select')
2185
- $rows_columns .= '<div id="'.$id.'_element_td'.$i.'_'.$k.'" style="text-align: center; display: table-cell; padding: 5px 0 0 5px;"><select id="'.$id.'_select_yes_noform_id_temp'.$i.'_'.$k.'" name="'.$id.'_select_yes_noform_id_temp'.$i.'_'.$k.'" disabled><option value=""> </option><option value="yes">Yes</option><option value="no">No</option></select></div>';
2186
-
2187
- }
2188
-
2189
- $rows_columns .= '</div>';
2190
- }
2191
-
2192
-
2193
-
2194
- $rep ='<div id="wdform_field'.$id.'" type="type_matrix" 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">'.$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_matrix" 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_field_input_type'].'" name="'.$id.'_input_typeform_id_temp" id="'.$id.'_input_typeform_id_temp"><input type="hidden" value="'.$param['w_textbox_size'].'" name="'.$id.'_textbox_sizeform_id_temp" id="'.$id.'_textbox_sizeform_id_temp"><div id="'.$id.'_elementform_id_temp" style="display: table;" '.$param['attributes'].'><div id="'.$id.'_table_little" style="display: table-row-group;"><div id="'.$id.'_element_tr0" style="display: table-row;"><div id="'.$id.'_element_td0_0" style="display: table-cell;"></div>'.$column_labels.'</div>'.$rows_columns.'</div></div></div></div>';
2195
-
2196
- break;
2197
- }
2198
- case 'type_submit_reset': {
2199
- $params_names=array('w_submit_title','w_reset_title','w_class','w_act');
2200
- $temp=$params;
2201
- foreach ($params_names as $params_name) {
2202
- $temp=explode('*:*'.$params_name.'*:*',$temp);
2203
- $param[$params_name] = $temp[0];
2204
- $temp=$temp[1];
2205
- }
2206
- if ($temp) {
2207
- $temp = explode('*:*w_attr_name*:*',$temp);
2208
- $attrs = array_slice($temp,0, count($temp)-1);
2209
- foreach ($attrs as $attr) {
2210
- $param['attributes'] = $param['attributes'].' add_'.$attr;
2211
- }
2212
- }
2213
- $param['w_act'] = ($param['w_act']=="false" ? 'style="display: none;"' : "");
2214
- $rep='<div id="wdform_field'.$id.'" type="type_submit_reset" 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;">type_submit_reset_'.$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_submit_reset" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><button type="button" class="button-submit" id="'.$id.'_element_submitform_id_temp" value="'.$param['w_submit_title'].'" onclick="check_required(&quot;submit&quot;, &quot;form_id_temp&quot;);" '.$param['attributes'].'>'.$param['w_submit_title'].'</button><button type="button" class="button-reset" id="'.$id.'_element_resetform_id_temp" value="'.$param['w_reset_title'].'" onclick="check_required(&quot;reset&quot;);" '.$param['w_act'].' '.$param['attributes'].'>'.$param['w_reset_title'].'</button></div></div>';
2215
- break;
2216
- }
2217
- case 'type_button': {
2218
- $params_names=array('w_title','w_func','w_class');
2219
- $temp=$params;
2220
- foreach($params_names as $params_name) {
2221
- $temp=explode('*:*'.$params_name.'*:*',$temp);
2222
- $param[$params_name] = $temp[0];
2223
- $temp=$temp[1];
2224
- }
2225
- if ($temp) {
2226
- $temp = explode('*:*w_attr_name*:*',$temp);
2227
- $attrs = array_slice($temp,0, count($temp)-1);
2228
- foreach($attrs as $attr) {
2229
- $param['attributes'] = $param['attributes'].' add_'.$attr;
2230
- }
2231
- }
2232
- $param['w_title'] = explode('***',$param['w_title']);
2233
- $param['w_func'] = explode('***',$param['w_func']);
2234
- $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">';
2235
- foreach ($param['w_title'] as $key => $title) {
2236
- $rep.='<button type="button" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp'.$key.'" value="'.$title.'" onclick="'.$param['w_func'][$key].'" '.$param['attributes'].'>'.$title.'</button>';
2237
- }
2238
- $rep .= '</div></div>';
2239
- break;
2240
- }
2241
- }
2242
-
2243
- $form = str_replace('%' . $id . ' - ' . $labels[$ids_key] . '%', $rep, $form);
2244
- $form = str_replace('%' . $id . ' -' . $labels[$ids_key] . '%', $rep, $form);
2245
- $row->form_front = $form;
2246
- }
2247
- }
2248
- }
2249
- else {
2250
- $row = new stdClass();
2251
- $row->id = 0;
2252
- $row->backup_id ='';
2253
- $row->title = '';
2254
- $row->mail = '';
2255
- $row->form = '';
2256
- $row->form_front = '';
2257
- $row->theme = $wpdb->get_var("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE `default`='1'");
2258
- $row->javascript = '';
2259
- $row->submit_text = '';
2260
- $row->url = '';
2261
- $row->submit_text_type = 0;
2262
- $row->script1 = '';
2263
- $row->script2 = '';
2264
- $row->script_user1 = '';
2265
- $row->script_user2 = '';
2266
- $row->counter = 0;
2267
- $row->label_order = '';
2268
- $row->article_id = '';
2269
- $row->pagination = '';
2270
- $row->show_title = '';
2271
- $row->show_numbers = '';
2272
- $row->public_key = '';
2273
- $row->private_key = '';
2274
- $row->recaptcha_theme = '';
2275
- $row->from_name = '';
2276
- $row->from_mail = '';
2277
- $row->label_order_current = '';
2278
- $row->script_mail_user = '';
2279
- $row->script_mail = '';
2280
- $row->tax = 0;
2281
- $row->payment_currency = '$';
2282
- $row->paypal_email = '';
2283
- $row->checkout_mode = 'testmode';
2284
- $row->paypal_mode = 0;
2285
-
2286
- $row->published = 1;
2287
- $row->form_fields = '';
2288
- $row->savedb = 1;
2289
- $row->sendemail = 1;
2290
- $row->requiredmark = '*';
2291
- $row->reply_to = 0;
2292
- $row->send_to = 0;
2293
- $row->autogen_layout = 1;
2294
- $row->custom_front = '';
2295
- $row->mail_from_user = '';
2296
- $row->mail_from_name_user = '';
2297
- $row->reply_to_user = '';
2298
- $row->save_uploads = 1;
2299
-
2300
- $row->condition = '';
2301
- $row->mail_cc = '';
2302
- $row->mail_cc_user = '';
2303
- $row->mail_bcc = '';
2304
- $row->mail_bcc_user = '';
2305
- $row->mail_subject = '';
2306
- $row->mail_subject_user = '';
2307
- $row->mail_mode = 1;
2308
- $row->mail_mode_user = 1;
2309
- $row->mail_attachment = 1;
2310
- $row->mail_attachment_user = 1;
2311
-
2312
- $row->user_id_wd = '';
2313
- $row->sortable = 1;
2314
- $row->frontend_submit_fields = '';
2315
- $row->frontend_submit_stat_fields = '';
2316
- }
2317
- return $row;
2318
- }
2319
-
2320
- public function get_theme_rows_data($old = '') {
2321
- global $wpdb;
2322
- $rows = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker_themes WHERE css " . ($old ? 'NOT' : '') . " LIKE '%.wdform_section%' ORDER BY title");
2323
- return $rows;
2324
- }
2325
-
2326
- public function get_queries_rows_data($id) {
2327
- global $wpdb;
2328
- $rows = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker_query WHERE form_id=" . $id . " ORDER BY id ASC");
2329
- return $rows;
2330
- }
2331
-
2332
- public function get_labels($id) {
2333
- global $wpdb;
2334
- $rows = $wpdb->get_col("SELECT DISTINCT `element_label` FROM " . $wpdb->prefix . "formmaker_submits WHERE form_id=" . $id);
2335
- return $rows;
2336
- }
2337
-
2338
- public function is_paypal($id) {
2339
- global $wpdb;
2340
- $rows = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker_sessions WHERE form_id=" . $id);
2341
- return $rows;
2342
- }
2343
-
2344
- public function page_nav() {
2345
- global $wpdb;
2346
- $where = 'WHERE `id` NOT IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ')';
2347
- $where .= ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? ' AND title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
2348
- $query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker " . $where;
2349
- $total = $wpdb->get_var($query);
2350
- $page_nav['total'] = $total;
2351
- if (isset($_POST['page_number']) && $_POST['page_number']) {
2352
- $limit = ((int) $_POST['page_number'] - 1) * 20;
2353
- }
2354
- else {
2355
- $limit = 0;
2356
- }
2357
- $page_nav['limit'] = (int) ($limit / 20 + 1);
2358
- return $page_nav;
2359
- }
2360
- ////////////////////////////////////////////////////////////////////////////////////////
2361
- // Getters & Setters //
2362
- ////////////////////////////////////////////////////////////////////////////////////////
2363
- ////////////////////////////////////////////////////////////////////////////////////////
2364
- // Private Methods //
2365
- ////////////////////////////////////////////////////////////////////////////////////////
2366
- ////////////////////////////////////////////////////////////////////////////////////////
2367
- // Listeners //
2368
- ////////////////////////////////////////////////////////////////////////////////////////
2369
  }
1
+ <?php
2
+
3
+ class FMModelManage_fm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function get_rows_data() {
22
+ global $wpdb;
23
+ $where = 'WHERE `id` NOT IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ')';
24
+ $where .= ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? ' AND title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
25
+ $asc_or_desc = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'desc') ? 'desc' : 'asc');
26
+ $order_by_array = array('id', 'title', 'mail');
27
+ $order_by = isset($_POST['order_by']) && in_array(esc_html(stripslashes($_POST['order_by'])), $order_by_array) ? esc_html(stripslashes($_POST['order_by'])) : 'id';
28
+ $order_by = ' ORDER BY `' . $order_by . '` ' . $asc_or_desc;
29
+ if (isset($_POST['page_number']) && $_POST['page_number']) {
30
+ $limit = ((int) $_POST['page_number'] - 1) * 20;
31
+ }
32
+ else {
33
+ $limit = 0;
34
+ }
35
+ $query = "SELECT * FROM " . $wpdb->prefix . "formmaker " . $where . $order_by . " LIMIT " . $limit . ",20";
36
+ $rows = $wpdb->get_results($query);
37
+ return $rows;
38
+ }
39
+
40
+ public function get_row_data($id) {
41
+ global $wpdb;
42
+ if ($id != 0) {
43
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
44
+ }
45
+ else {
46
+ $row = new stdClass();
47
+ $row->id = 0;
48
+ $row->title = '';
49
+ $row->mail = '';
50
+ $row->form = '';
51
+ $row->form_front = '';
52
+ $row->theme = 0;
53
+ $row->javascript = '';
54
+ $row->submit_text = '';
55
+ $row->url = '';
56
+ $row->submit_text_type = 0;
57
+ $row->script1 = '';
58
+ $row->script2 = '';
59
+ $row->script_user1 = '';
60
+ $row->script_user2 = '';
61
+ $row->counter = 0;
62
+ $row->label_order = '';
63
+ $row->article_id = '';
64
+ $row->pagination = '';
65
+ $row->show_title = '';
66
+ $row->show_numbers = '';
67
+ $row->public_key = '';
68
+ $row->private_key = '';
69
+ $row->recaptcha_theme = '';
70
+ $row->from_name = '';
71
+ $row->from_mail = '';
72
+ $row->label_order_current = '';
73
+ $row->script_mail_user = '';
74
+ $row->script_mail = '';
75
+ $row->tax = 0;
76
+ $row->payment_currency = '$';
77
+ $row->paypal_email = '';
78
+ $row->checkout_mode = 'testmode';
79
+ $row->paypal_mode = 0;
80
+
81
+ $row->published = 1;
82
+ $row->form_fields = '';
83
+ $row->savedb = 1;
84
+ $row->sendemail = 1;
85
+ $row->requiredmark = '*';
86
+ $row->reply_to = 0;
87
+ $row->send_to = 0;
88
+ $row->autogen_layout = 1;
89
+ $row->custom_front = '';
90
+ $row->mail_from_user = '';
91
+ $row->mail_from_name_user = '';
92
+ $row->reply_to_user = '';
93
+ $row->save_uploads = 1;
94
+ }
95
+ return $row;
96
+ }
97
+
98
+ public function get_row_data_new($id) {
99
+ global $wpdb;
100
+ if ($id != 0) {
101
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_backup WHERE backup_id="%d"', $id));
102
+ $labels2 = array();
103
+ $label_id = array();
104
+ $label_order_original = array();
105
+ $label_type = array();
106
+ $label_all = explode('#****#', $row->label_order);
107
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
108
+ foreach($label_all as $key => $label_each) {
109
+ $label_id_each=explode('#**id**#',$label_each);
110
+ array_push($label_id, $label_id_each[0]);
111
+ $label_oder_each=explode('#**label**#', $label_id_each[1]);
112
+ array_push($label_order_original, addslashes($label_oder_each[0]));
113
+ array_push($label_type, $label_oder_each[1]);
114
+ }
115
+ $labels2['id'] = '"' . implode('","', $label_id) . '"';
116
+ $labels2['label'] = '"' . implode('","', $label_order_original) . '"';
117
+ $labels2['type'] = '"' . implode('","', $label_type) . '"';
118
+ $ids = array();
119
+ $types = array();
120
+ $labels = array();
121
+ $paramss = array();
122
+ $fields = explode('*:*new_field*:*', $row->form_fields);
123
+ $fields = array_slice($fields, 0, count($fields) - 1);
124
+ foreach ($fields as $field) {
125
+ $temp=explode('*:*id*:*',$field);
126
+ array_push($ids, $temp[0]);
127
+ $temp=explode('*:*type*:*',$temp[1]);
128
+ array_push($types, $temp[0]);
129
+ $temp=explode('*:*w_field_label*:*',$temp[1]);
130
+ array_push($labels, $temp[0]);
131
+ array_push($paramss, $temp[1]);
132
+ }
133
+ $form = $row->form_front;
134
+ foreach ($ids as $ids_key => $id) {
135
+ $label = $labels[$ids_key];
136
+ $type = $types[$ids_key];
137
+ $params = $paramss[$ids_key];
138
+ if (strpos($form, '%'.$id.' - '.$label.'%') || strpos($form, '%'.$id.' -'.$label.'%')) {
139
+ $rep = '';
140
+ $arrows='';
141
+ $param = array();
142
+ $param['attributes'] = '';
143
+ switch($type)
144
+ {
145
+ case 'type_section_break':
146
+ {
147
+ $arrows =$arrows.'<div id="wdform_arrows'.$id.'" class="wdform_arrows" ><div id="X_'.$id.'" class="element_toolbar"><img src="' . WD_FM_URL . '/images/delete_el.png?ver='. get_option("wd_form_maker_version").'" title="Remove the field" onclick="remove_section_break(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;delete_el&quot;)" onmouseout="chnage_icons_src(this,&quot;delete_el&quot;)"></div><div id="edit_'.$id.'" class="element_toolbar"><img src="' . WD_FM_URL . '/images/edit.png?ver='. get_option("wd_form_maker_version").'" title="Edit the field" onclick="edit(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;edit&quot;)" onmouseout="chnage_icons_src(this,&quot;edit&quot;)"><span id="'.$id.'_element_labelform_id_temp" style="display: none;">custom_'.$id.'</span></div><div id="duplicate_'.$id.'" class="element_toolbar"><img src="' . WD_FM_URL . '/images/duplicate.png?ver='. get_option("wd_form_maker_version").'" title="Duplicate the field" onclick="duplicate(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;duplicate&quot;)" onmouseout="chnage_icons_src(this,&quot;duplicate&quot;)"></div></div>';
148
+ break;
149
+ }
150
+ case 'type_editor':
151
+ {
152
+ $arrows =$arrows.'<div id="wdform_arrows'.$id.'" class="wdform_arrows" type="type_editor" style="margin-top:0px;"><div id="X_'.$id.'" valign="middle" align="right" class="element_toolbar"><img src="' . WD_FM_URL . '/images/delete_el.png?ver='. get_option("wd_form_maker_version").'" title="Remove the field" onclick="remove_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;delete_el&quot;)" onmouseout="chnage_icons_src(this,&quot;delete_el&quot;)"></div><div id="left_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/left.png?ver='. get_option("wd_form_maker_version").'" title="Move the field to the left" onclick="left_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;left&quot;)" onmouseout="chnage_icons_src(this,&quot;left&quot;)"></div><div id="up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/up.png?ver='. get_option("wd_form_maker_version").'" title="Move the field up" onclick="up_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;up&quot;)" onmouseout="chnage_icons_src(this,&quot;up&quot;)"></div><div id="down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/down.png?ver='. get_option("wd_form_maker_version").'" title="Move the field down" onclick="down_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;down&quot;)" onmouseout="chnage_icons_src(this,&quot;down&quot;)"></div><div id="right_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/right.png?ver='. get_option("wd_form_maker_version").'" title="Move the field to the right" onclick="right_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;right&quot;)" onmouseout="chnage_icons_src(this,&quot;right&quot;)"></div><div id="edit_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/edit.png?ver='. get_option("wd_form_maker_version").'" title="Edit the field" onclick="edit(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;edit&quot;)" onmouseout="chnage_icons_src(this,&quot;edit&quot;)"></div><div id="duplicate_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/duplicate.png?ver='. get_option("wd_form_maker_version").'" title="Duplicate the field" onclick="duplicate(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;duplicate&quot;)" onmouseout="chnage_icons_src(this,&quot;duplicate&quot;)"></div><div id="page_up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_up.png?ver='. get_option("wd_form_maker_version").'" title="Move the field to the upper page" onclick="page_up(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;page_up&quot;)" onmouseout="chnage_icons_src(this,&quot;page_up&quot;)"></div><div id="page_down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_down.png?ver='. get_option("wd_form_maker_version").'" title="Move the field to the lower page" onclick="page_down(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;page_down&quot;)" onmouseout="chnage_icons_src(this,&quot;page_down&quot;)"></div></div>';
153
+ break;
154
+ }
155
+
156
+ case 'type_send_copy':
157
+ case 'type_captcha':
158
+ case 'type_arithmetic_captcha':
159
+ case 'type_recaptcha':
160
+ {
161
+ $arrows =$arrows.'<div id="wdform_arrows'.$id.'" class="wdform_arrows"><div id="X_'.$id.'" valign="middle" align="right" class="element_toolbar"><img src="' . WD_FM_URL . '/images/delete_el.png?ver='. get_option("wd_form_maker_version").'" title="Remove the field" onclick="remove_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;delete_el&quot;)" onmouseout="chnage_icons_src(this,&quot;delete_el&quot;)"></div><div id="left_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/left.png?ver='. get_option("wd_form_maker_version").'" title="Move the field to the left" onclick="left_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;left&quot;)" onmouseout="chnage_icons_src(this,&quot;left&quot;)"></div><div id="up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/up.png?ver='. get_option("wd_form_maker_version").'" title="Move the field up" onclick="up_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;up&quot;)" onmouseout="chnage_icons_src(this,&quot;up&quot;)"></div><div id="down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/down.png?ver='. get_option("wd_form_maker_version").'" title="Move the field down" onclick="down_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;down&quot;)" onmouseout="chnage_icons_src(this,&quot;down&quot;)"></div><div id="right_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/right.png?ver='. get_option("wd_form_maker_version").'" title="Move the field to the right" onclick="right_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;right&quot;)" onmouseout="chnage_icons_src(this,&quot;right&quot;)"></div><div id="edit_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/edit.png?ver='. get_option("wd_form_maker_version").'" title="Edit the field" onclick="edit(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;edit&quot;)" onmouseout="chnage_icons_src(this,&quot;edit&quot;)"></div><div id="duplicate_'.$id.'" valign="middle" class="element_toolbar"></div><div id="page_up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_up.png?ver='. get_option("wd_form_maker_version").'" title="Move the field to the upper page" onclick="page_up(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;page_up&quot;)" onmouseout="chnage_icons_src(this,&quot;page_up&quot;)"></div><div id="page_down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_down.png?ver='. get_option("wd_form_maker_version").'" title="Move the field to the lower page" onclick="page_down(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;page_down&quot;)" onmouseout="chnage_icons_src(this,&quot;page_down&quot;)"></div></div>';
162
+ break;
163
+ }
164
+
165
+ default :
166
+ {
167
+ $arrows =$arrows.'<div id="wdform_arrows'.$id.'" class="wdform_arrows" ><div id="X_'.$id.'" valign="middle" align="right" class="element_toolbar"><img src="' . WD_FM_URL . '/images/delete_el.png?ver='. get_option("wd_form_maker_version").'" title="Remove the field" onclick="remove_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;delete_el&quot;)" onmouseout="chnage_icons_src(this,&quot;delete_el&quot;)"></div><div id="left_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/left.png?ver='. get_option("wd_form_maker_version").'" title="Move the field to the left" onclick="left_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;left&quot;)" onmouseout="chnage_icons_src(this,&quot;left&quot;)"></div><div id="up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/up.png?ver='. get_option("wd_form_maker_version").'" title="Move the field up" onclick="up_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;up&quot;)" onmouseout="chnage_icons_src(this,&quot;up&quot;)"></div><div id="down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/down.png?ver='. get_option("wd_form_maker_version").'" title="Move the field down" onclick="down_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;down&quot;)" onmouseout="chnage_icons_src(this,&quot;down&quot;)"></div><div id="right_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/right.png?ver='. get_option("wd_form_maker_version").'" title="Move the field to the right" onclick="right_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;right&quot;)" onmouseout="chnage_icons_src(this,&quot;right&quot;)"></div><div id="edit_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/edit.png?ver='. get_option("wd_form_maker_version").'" title="Edit the field" onclick="edit(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;edit&quot;)" onmouseout="chnage_icons_src(this,&quot;edit&quot;)"></div><div id="duplicate_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/duplicate.png?ver='. get_option("wd_form_maker_version").'" title="Duplicate the field" onclick="duplicate(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;duplicate&quot;)" onmouseout="chnage_icons_src(this,&quot;duplicate&quot;)"></div><div id="page_up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_up.png?ver='. get_option("wd_form_maker_version").'" title="Move the field to the upper page" onclick="page_up(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;page_up&quot;)" onmouseout="chnage_icons_src(this,&quot;page_up&quot;)"></div><div id="page_down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_down.png?ver='. get_option("wd_form_maker_version").'" title="Move the field to the lower page" onclick="page_down(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;page_down&quot;)" onmouseout="chnage_icons_src(this,&quot;page_down&quot;)"></div></div>';
168
+ break;
169
+ }
170
+
171
+ }
172
+ switch ($type) {
173
+ case 'type_section_break': {
174
+ $params_names = array('w_editor');
175
+ $temp = $params;
176
+ foreach ($params_names as $params_name) {
177
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
178
+ $param[$params_name] = $temp[0];
179
+ $temp = $temp[1];
180
+ }
181
+ $rep ='<div id="wdform_field'.$id.'" type="type_section_break" class="wdform_field_section_break">'.$arrows.'<span id="'.$id.'_element_labelform_id_temp" style="display: none;">custom_'.$id.'</span><div id="'.$id.'_element_sectionform_id_temp" align="left" class="wdform_section_break">'.$param['w_editor'].'</div></div><div id="'.$id.'_element_labelform_id_temp" style="color:red;">custom_'.$id.'</div>';
182
+ break;
183
+ }
184
+ case 'type_editor': {
185
+ $params_names = array('w_editor');
186
+ $temp = $params;
187
+ foreach ($params_names as $params_name ) {
188
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
189
+ $param[$params_name] = $temp[0];
190
+ $temp = $temp[1];
191
+ }
192
+ $rep =$arrows.'<div id="wdform_field'.$id.'" type="type_editor" class="wdform_field" >'.$param['w_editor'].'</div><div id="'.$id.'_element_labelform_id_temp" style="color: red;">custom_'.$id.'</div>';
193
+ break;
194
+ }
195
+ case 'type_send_copy': {
196
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_required');
197
+ $temp = $params;
198
+ foreach ($params_names as $params_name ) {
199
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
200
+ $param[$params_name] = $temp[0];
201
+ $temp = $temp[1];
202
+ }
203
+ if ($temp) {
204
+ $temp = explode('*:*w_attr_name*:*', $temp);
205
+ $attrs = array_slice($temp, 0, count($temp) - 1);
206
+ foreach ($attrs as $attr) {
207
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
208
+ }
209
+ }
210
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
211
+ $input_active = ($param['w_first_val'] == 'true' ? "checked='checked'" : "");
212
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
213
+ $rep ='<div id="wdform_field'.$id.'" type="type_send_copy" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" 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" style="display: '.$param['w_field_label_pos'].'"><input type="hidden" value="type_send_copy" 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="checkbox" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" onclick="set_checked(&quot;'.$id.'&quot;,&quot;&quot;,&quot;form_id_temp&quot;)" '.$input_active.' '.$param['attributes'].' disabled /></div></div>';
214
+ break;
215
+ }
216
+ case 'type_text': {
217
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_first_val', 'w_title', 'w_required', 'w_unique');
218
+ $temp = $params;
219
+ if(strpos($temp, 'w_regExp_status') > -1)
220
+ $params_names = array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_required', 'w_regExp_status', 'w_regExp_value', 'w_regExp_common', 'w_regExp_arg', 'w_regExp_alert', 'w_unique');
221
+ foreach ($params_names as $params_name) {
222
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
223
+ $param[$params_name] = $temp[0];
224
+ $temp = $temp[1];
225
+ }
226
+ if ($temp) {
227
+ $temp = explode('*:*w_attr_name*:*', $temp);
228
+ $attrs = array_slice($temp, 0, count($temp) - 1);
229
+ foreach ($attrs as $attr) {
230
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
231
+ }
232
+ }
233
+
234
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
235
+ $input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
236
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
237
+
238
+ $param['w_regExp_status'] = (isset($param['w_regExp_status']) ? $param['w_regExp_status'] : "no");
239
+ $param['w_regExp_value'] = (isset($param['w_regExp_value']) ? $param['w_regExp_value'] : "");
240
+ $param['w_regExp_common'] = (isset($param['w_regExp_common']) ? $param['w_regExp_common'] : "");
241
+ $param['w_regExp_arg'] = (isset($param['w_regExp_arg']) ? $param['w_regExp_arg'] : "");
242
+ $param['w_regExp_alert'] = (isset($param['w_regExp_alert']) ? $param['w_regExp_alert'] : "Incorrect Value");
243
+
244
+ $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: '.$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" 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_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" class="'.$input_active.'" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" value="'.$param['w_first_val'].'" title="'.$param['w_title'].'" onfocus="delete_value(&quot;'.$id.'_elementform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_elementform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_elementform_id_temp&quot;)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled /></div></div>';
245
+
246
+ break;
247
+ }
248
+ case 'type_number': {
249
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_first_val', 'w_title', 'w_required', 'w_unique', 'w_class');
250
+ $temp = $params;
251
+ foreach ($params_names as $params_name) {
252
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
253
+ $param[$params_name] = $temp[0];
254
+ $temp = $temp[1];
255
+ }
256
+ if ($temp) {
257
+ $temp = explode('*:*w_attr_name*:*', $temp);
258
+ $attrs = array_slice($temp, 0, count($temp) - 1);
259
+ foreach ($attrs as $attr) {
260
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
261
+ }
262
+ }
263
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
264
+ $input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
265
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
266
+ $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" class="'.$input_active.'" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" value="'.$param['w_first_val'].'" title="'.$param['w_title'].'" onkeypress="return check_isnum(event)" onfocus="delete_value(&quot;'.$id.'_elementform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_elementform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_elementform_id_temp&quot;)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled /></div></div>';
267
+ break;
268
+ }
269
+ case 'type_password': {
270
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_required', 'w_unique', 'w_class');
271
+ $temp = $params;
272
+ foreach ($params_names as $params_name) {
273
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
274
+ $param[$params_name] = $temp[0];
275
+ $temp = $temp[1];
276
+ }
277
+ if ($temp) {
278
+ $temp = explode('*:*w_attr_name*:*', $temp);
279
+ $attrs = array_slice($temp, 0, count($temp) - 1);
280
+ foreach ($attrs as $attr) {
281
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
282
+ }
283
+ }
284
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
285
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
286
+ $rep ='<div id="wdform_field'.$id.'" type="type_password" 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_password" 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="password" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled /></div></div>';
287
+ break;
288
+ }
289
+ case 'type_textarea': {
290
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size_w', 'w_size_h', 'w_first_val', 'w_title', 'w_required', 'w_unique', 'w_class');
291
+ $temp = $params;
292
+ foreach ($params_names as $params_name) {
293
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
294
+ $param[$params_name] = $temp[0];
295
+ $temp = $temp[1];
296
+ }
297
+ if ($temp) {
298
+ $temp = explode('*:*w_attr_name*:*', $temp);
299
+ $attrs = array_slice($temp, 0, count($temp) - 1);
300
+ foreach ($attrs as $attr) {
301
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
302
+ }
303
+ }
304
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
305
+ $input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
306
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
307
+ $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:'.$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: table-cell;"><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_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><textarea class="'.$input_active.'" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" title="'.$param['w_title'].'" onfocus="delete_value(&quot;'.$id.'_elementform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_elementform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_elementform_id_temp&quot;)" style="width: '.$param['w_size_w'].'px; height: '.$param['w_size_h'].'px;" '.$param['attributes'].' disabled>'.$param['w_first_val'].'</textarea></div></div>';
308
+ break;
309
+ }
310
+ case 'type_phone': {
311
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_first_val', 'w_title', 'w_mini_labels', 'w_required', 'w_unique', 'w_class');
312
+ $temp = $params;
313
+ foreach ($params_names as $params_name) {
314
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
315
+ $param[$params_name] = $temp[0];
316
+ $temp = $temp[1];
317
+ }
318
+ if ($temp) {
319
+ $temp = explode('*:*w_attr_name*:*', $temp);
320
+ $attrs = array_slice($temp, 0, count($temp) - 1);
321
+ foreach ($attrs as $attr) {
322
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
323
+ }
324
+ }
325
+ $w_first_val = explode('***', $param['w_first_val']);
326
+ $w_title = explode('***', $param['w_title']);
327
+ $w_mini_labels = explode('***', $param['w_mini_labels']);
328
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
329
+ $input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
330
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
331
+ $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: '.$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">'.$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_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" class="'.$input_active.'" id="'.$id.'_element_firstform_id_temp" name="'.$id.'_element_firstform_id_temp" value="'.$w_first_val[0].'" title="'.$w_title[0].'" onfocus="delete_value(&quot;'.$id.'_element_firstform_id_temp&quot;)"onblur="return_value(&quot;'.$id.'_element_firstform_id_temp&quot;)"onchange="change_value(&quot;'.$id.'_element_firstform_id_temp&quot;)" 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" class="'.$input_active.'" id="'.$id.'_element_lastform_id_temp" name="'.$id.'_element_lastform_id_temp" value="'.$w_first_val[1].'" title="'.$w_title[1].'" onfocus="delete_value(&quot;'.$id.'_element_lastform_id_temp&quot;)"onblur="return_value(&quot;'.$id.'_element_lastform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_element_lastform_id_temp&quot;)" 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>';
332
+ break;
333
+ }
334
+ case 'type_name': {
335
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_title', 'w_mini_labels', 'w_size', 'w_name_format', 'w_required', 'w_unique', 'w_class');
336
+ $temp = $params;
337
+ if(strpos($temp, 'w_name_fields') > -1)
338
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_title', 'w_mini_labels', 'w_size', 'w_name_format', 'w_required', 'w_unique', 'w_class', 'w_name_fields');
339
+
340
+ if(strpos($temp, 'w_autofill') > -1)
341
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_title', 'w_mini_labels', 'w_size', 'w_name_format', 'w_required', 'w_unique', 'w_class', 'w_name_fields', 'w_autofill');
342
+ foreach ($params_names as $params_name) {
343
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
344
+ $param[$params_name] = $temp[0];
345
+ $temp = $temp[1];
346
+ }
347
+ if ($temp) {
348
+ $temp = explode('*:*w_attr_name*:*', $temp);
349
+ $attrs = array_slice($temp, 0, count($temp) - 1);
350
+ foreach ($attrs as $attr) {
351
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
352
+ }
353
+ }
354
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
355
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
356
+ $w_first_val = explode('***', $param['w_first_val']);
357
+ $w_title = explode('***', $param['w_title']);
358
+ $w_mini_labels = explode('***', $param['w_mini_labels']);
359
+
360
+ $param['w_name_fields'] = isset($param['w_name_fields']) ? $param['w_name_fields'] : ($param['w_name_format'] == 'normal' ? 'no***no' : 'yes***yes');
361
+ $w_name_fields = explode('***', $param['w_name_fields']);
362
+ $param['w_autofill'] = isset($param['w_autofill']) ? $param['w_autofill'] : 'no';
363
+
364
+ $w_name_format = '<div id="'.$id.'_td_name_input_first" style="display: table-cell;"><input type="text" class="'.($w_first_val[0]==$w_title[0] ? "input_deactive" : "input_active").'" id="'.$id.'_element_firstform_id_temp" name="'.$id.'_element_firstform_id_temp" value="'.$w_first_val[0].'" title="'.$w_title[0].'" onfocus="delete_value(&quot;'.$id.'_element_firstform_id_temp&quot;)"onblur="return_value(&quot;'.$id.'_element_firstform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_element_firstform_id_temp&quot;)" 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" class="'.($w_first_val[1]==$w_title[1] ? "input_deactive" : "input_active").'" id="'.$id.'_element_lastform_id_temp" name="'.$id.'_element_lastform_id_temp" value="'.$w_first_val[1].'" title="'.$w_title[1].'" onfocus="delete_value(&quot;'.$id.'_element_lastform_id_temp&quot;)"onblur="return_value(&quot;'.$id.'_element_lastform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_element_lastform_id_temp&quot;)" style="margin-right: 10px; width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled /></div>';
365
+ $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>';
366
+
367
+ if($w_name_fields[0] == 'yes') {
368
+ $w_name_format = '<div id="'.$id.'_td_name_input_title" style="display: table-cell;"><input type="text" class="'.($w_first_val[2]==$w_title[2] ? "input_deactive" : "input_active").'" id="'.$id.'_element_titleform_id_temp" name="'.$id.'_element_titleform_id_temp" value="'.$w_first_val[2].'" title="'.$w_title[2].'" onfocus="delete_value(&quot;'.$id.'_element_titleform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_element_titleform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_element_titleform_id_temp&quot;)" style="margin: 0px 10px 0px 0px; width: 40px;" disabled /></div>'.$w_name_format;
369
+ $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;
370
+ }
371
+
372
+ if($w_name_fields[1] == 'yes') {
373
+ $w_name_format = $w_name_format.'<div id="'.$id.'_td_name_input_middle" style="display: table-cell;"><input type="text" class="'.($w_first_val[3]==$w_title[3] ? "input_deactive" : "input_active").'" id="'.$id.'_element_middleform_id_temp" name="'.$id.'_element_middleform_id_temp" value="'.$w_first_val[3].'" title="'.$w_title[3].'" onfocus="delete_value(&quot;'.$id.'_element_middleform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_element_middleform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_element_middleform_id_temp&quot;)" style="width: '.$param['w_size'].'px;" disabled /></div>';
374
+ $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>';
375
+ }
376
+
377
+ $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: '.$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_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_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>';
378
+ break;
379
+ }
380
+ case 'type_address': {
381
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_mini_labels', 'w_disabled_fields', 'w_required', 'w_class');
382
+ $temp = $params;
383
+ foreach ($params_names as $params_name) {
384
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
385
+ $param[$params_name] = $temp[0];
386
+ $temp = $temp[1];
387
+ }
388
+ if ($temp) {
389
+ $temp = explode('*:*w_attr_name*:*', $temp);
390
+ $attrs = array_slice($temp, 0, count($temp) - 1);
391
+ foreach ($attrs as $attr) {
392
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
393
+ }
394
+ }
395
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
396
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
397
+ $w_mini_labels = explode('***', $param['w_mini_labels']);
398
+ $w_disabled_fields = explode('***', $param['w_disabled_fields']);
399
+ $hidden_inputs = '';
400
+ $labels_for_id = array('street1', 'street2', 'city', 'state', 'postal', 'country');
401
+ foreach ($w_disabled_fields as $key => $w_disabled_field) {
402
+ if ($key != 6) {
403
+ if ($w_disabled_field == 'yes') {
404
+ $hidden_inputs .= '<input type="hidden" id="'.$id.'_'.$labels_for_id[$key].'form_id_temp" value="'.$w_mini_labels[$key].'" id_for_label="'.($id+$key).'">';
405
+ }
406
+ }
407
+ }
408
+ $address_fields ='';
409
+ $g=0;
410
+ if($w_disabled_fields[0]=='no')
411
+ {
412
+ $g+=2;
413
+ $address_fields .= '<span style="float: left; width: 100%; padding-bottom: 8px; display: block;"><input type="text" id="'.$id.'_street1form_id_temp" name="'.$id.'_street1form_id_temp" onchange="change_value(&quot;'.$id.'_street1form_id_temp&quot;)" style="width: 100%;" '.$param['attributes'].' disabled /><label class="mini_label" id="'.$id.'_mini_label_street1" style="display: block;">'.$w_mini_labels[0].'</label></span>';
414
+ }
415
+
416
+ if($w_disabled_fields[1]=='no')
417
+ {
418
+ $g+=2;
419
+ $address_fields .= '<span style="float: left; width: 100%; padding-bottom: 8px; display: block;"><input type="text" id="'.$id.'_street2form_id_temp" name="'.($id+1).'_street2form_id_temp" onchange="change_value(&quot;'.$id.'_street2form_id_temp&quot;)" style="width: 100%;" '.$param['attributes'].' disabled /><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_street2">'.$w_mini_labels[1].'</label></span>';
420
+ }
421
+
422
+ if($w_disabled_fields[2]=='no')
423
+ {
424
+ $g++;
425
+ $address_fields .= '<span style="float: left; width: 48%; padding-bottom: 8px;"><input type="text" id="'.$id.'_cityform_id_temp" name="'.($id+2).'_cityform_id_temp" onchange="change_value(&quot;'.$id.'_cityform_id_temp&quot;)" style="width: 100%;" '.$param['attributes'].' disabled /><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_city">'.$w_mini_labels[2].'</label></span>';
426
+ }
427
+
428
+ if($w_disabled_fields[3]=='no')
429
+ {
430
+ $g++;
431
+ if($w_disabled_fields[5]=='yes' && $w_disabled_fields[6]=='yes')
432
+ $address_fields .= '<span style="float: '.(($g%2==0) ? 'right' : 'left').'; width: 48%; padding-bottom: 8px;"><select type="text" id="'.$id.'_stateform_id_temp" name="'.($id+3).'_stateform_id_temp" onchange="change_value(&quot;'.$id.'_stateform_id_temp&quot;)" style="width: 100%;" '.$param['attributes'].' disabled ><option value=""></option><option value="Alabama">Alabama</option><option value="Alaska">Alaska</option><option value="Arizona">Arizona</option><option value="Arkansas">Arkansas</option><option value="California">California</option><option value="Colorado">Colorado</option><option value="Connecticut">Connecticut</option><option value="Delaware">Delaware</option><option value="Florida">Florida</option><option value="Georgia">Georgia</option><option value="Hawaii">Hawaii</option><option value="Idaho">Idaho</option><option value="Illinois">Illinois</option><option value="Indiana">Indiana</option><option value="Iowa">Iowa</option><option value="Kansas">Kansas</option><option value="Kentucky">Kentucky</option><option value="Louisiana">Louisiana</option><option value="Maine">Maine</option><option value="Maryland">Maryland</option><option value="Massachusetts">Massachusetts</option><option value="Michigan">Michigan</option><option value="Minnesota">Minnesota</option><option value="Mississippi">Mississippi</option><option value="Missouri">Missouri</option><option value="Montana">Montana</option><option value="Nebraska">Nebraska</option><option value="Nevada">Nevada</option><option value="New Hampshire">New Hampshire</option><option value="New Jersey">New Jersey</option><option value="New Mexico">New Mexico</option><option value="New York">New York</option><option value="North Carolina">North Carolina</option><option value="North Dakota">North Dakota</option><option value="Ohio">Ohio</option><option value="Oklahoma">Oklahoma</option><option value="Oregon">Oregon</option><option value="Pennsylvania">Pennsylvania</option><option value="Rhode Island">Rhode Island</option><option value="South Carolina">South Carolina</option><option value="South Dakota">South Dakota</option><option value="Tennessee">Tennessee</option><option value="Texas">Texas</option><option value="Utah">Utah</option><option value="Vermont">Vermont</option><option value="Virginia">Virginia</option><option value="Washington">Washington</option><option value="West Virginia">West Virginia</option><option value="Wisconsin">Wisconsin</option><option value="Wyoming">Wyoming</option></select><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_state">'.$w_mini_labels[3].'</label></span>';
433
+ else
434
+ $address_fields .= '<span style="float: '.(($g%2==0) ? 'right' : 'left').'; width: 48%; padding-bottom: 8px;"><input type="text" id="'.$id.'_stateform_id_temp" name="'.($id+3).'_stateform_id_temp" onchange="change_value(&quot;'.$id.'_stateform_id_temp&quot;)" style="width: 100%;" '.$param['attributes'].' disabled><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_state">'.$w_mini_labels[3].'</label></span>';
435
+ }
436
+
437
+ if($w_disabled_fields[4]=='no')
438
+ {
439
+ $g++;
440
+ $address_fields .= '<span style="float: '.(($g%2==0) ? 'right' : 'left').'; width: 48%; padding-bottom: 8px;"><input type="text" id="'.$id.'_postalform_id_temp" name="'.($id+4).'_postalform_id_temp" onchange="change_value(&quot;'.$id.'_postalform_id_temp&quot;)" style="width: 100%;" '.$param['attributes'].' disabled><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_postal">'.$w_mini_labels[4].'</label></span>';
441
+ }
442
+
443
+ if($w_disabled_fields[5]=='no')
444
+ {
445
+ $g++;
446
+ $address_fields .= '<span style="float: '.(($g%2==0) ? 'right' : 'left').'; width: 48%; padding-bottom: 8px;"><select type="text" id="'.$id.'_countryform_id_temp" name="'.($id+5).'_countryform_id_temp" onchange="change_value(&quot;'.$id.'_countryform_id_temp&quot;)" style="width: 100%;" '.$param['attributes'].' disabled><option value=""></option><option value="Afghanistan">Afghanistan</option><option value="Albania">Albania</option><option value="Algeria">Algeria</option><option value="Andorra">Andorra</option><option value="Angola">Angola</option><option value="Antigua and Barbuda">Antigua and Barbuda</option><option value="Argentina">Argentina</option><option value="Armenia">Armenia</option><option value="Australia">Australia</option><option value="Austria">Austria</option><option value="Azerbaijan">Azerbaijan</option><option value="Bahamas">Bahamas</option><option value="Bahrain">Bahrain</option><option value="Bangladesh">Bangladesh</option><option value="Barbados">Barbados</option><option value="Belarus">Belarus</option><option value="Belgium">Belgium</option><option value="Belize">Belize</option><option value="Benin">Benin</option><option value="Bhutan">Bhutan</option><option value="Bolivia">Bolivia</option><option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option><option value="Botswana">Botswana</option><option value="Brazil">Brazil</option><option value="Brunei">Brunei</option><option value="Bulgaria">Bulgaria</option><option value="Burkina Faso">Burkina Faso</option><option value="Burundi">Burundi</option><option value="Cambodia">Cambodia</option><option value="Cameroon">Cameroon</option><option value="Canada">Canada</option><option value="Cape Verde">Cape Verde</option><option value="Central African Republic">Central African Republic</option><option value="Chad">Chad</option><option value="Chile">Chile</option><option value="China">China</option><option value="Colombia">Colombia</option><option value="Comoros">Comoros</option><option value="Congo (Brazzaville)">Congo (Brazzaville)</option><option value="Congo">Congo</option><option value="Costa Rica">Costa Rica</option><option value="Cote d\'Ivoire">Cote d\'Ivoire</option><option value="Croatia">Croatia</option><option value="Cuba">Cuba</option><option value="Cyprus">Cyprus</option><option value="Czech Republic">Czech Republic</option><option value="Denmark">Denmark</option><option value="Djibouti">Djibouti</option><option value="Dominica">Dominica</option><option value="Dominican Republic">Dominican Republic</option><option value="East Timor (Timor Timur)">East Timor (Timor Timur)</option><option value="Ecuador">Ecuador</option><option value="Egypt">Egypt</option><option value="El Salvador">El Salvador</option><option value="Equatorial Guinea">Equatorial Guinea</option><option value="Eritrea">Eritrea</option><option value="Estonia">Estonia</option><option value="Ethiopia">Ethiopia</option><option value="Fiji">Fiji</option><option value="Finland">Finland</option><option value="France">France</option><option value="Gabon">Gabon</option><option value="Gambia, The">Gambia, The</option><option value="Georgia">Georgia</option><option value="Germany">Germany</option><option value="Ghana">Ghana</option><option value="Greece">Greece</option><option value="Grenada">Grenada</option><option value="Guatemala">Guatemala</option><option value="Guinea">Guinea</option><option value="Guinea-Bissau">Guinea-Bissau</option><option value="Guyana">Guyana</option><option value="Haiti">Haiti</option><option value="Honduras">Honduras</option><option value="Hungary">Hungary</option><option value="Iceland">Iceland</option><option value="India">India</option><option value="Indonesia">Indonesia</option><option value="Iran">Iran</option><option value="Iraq">Iraq</option><option value="Ireland">Ireland</option><option value="Israel">Israel</option><option value="Italy">Italy</option><option value="Jamaica">Jamaica</option><option value="Japan">Japan</option><option value="Jordan">Jordan</option><option value="Kazakhstan">Kazakhstan</option><option value="Kenya">Kenya</option><option value="Kiribati">Kiribati</option><option value="Korea, North">Korea, North</option><option value="Korea, South">Korea, South</option><option value="Kuwait">Kuwait</option><option value="Kyrgyzstan">Kyrgyzstan</option><option value="Laos">Laos</option><option value="Latvia">Latvia</option><option value="Lebanon">Lebanon</option><option value="Lesotho">Lesotho</option><option value="Liberia">Liberia</option><option value="Libya">Libya</option><option value="Liechtenstein">Liechtenstein</option><option value="Lithuania">Lithuania</option><option value="Luxembourg">Luxembourg</option><option value="Macedonia">Macedonia</option><option value="Madagascar">Madagascar</option><option value="Malawi">Malawi</option><option value="Malaysia">Malaysia</option><option value="Maldives">Maldives</option><option value="Mali">Mali</option><option value="Malta">Malta</option><option value="Marshall Islands">Marshall Islands</option><option value="Mauritania">Mauritania</option><option value="Mauritius">Mauritius</option><option value="Mexico">Mexico</option><option value="Micronesia">Micronesia</option><option value="Moldova">Moldova</option><option value="Monaco">Monaco</option><option value="Mongolia">Mongolia</option><option value="Morocco">Morocco</option><option value="Mozambique">Mozambique</option><option value="Myanmar">Myanmar</option><option value="Namibia">Namibia</option><option value="Nauru">Nauru</option><option value="Nepal">Nepal</option><option value="Netherlands">Netherlands</option><option value="New Zealand">New Zealand</option><option value="Nicaragua">Nicaragua</option><option value="Niger">Niger</option><option value="Nigeria">Nigeria</option><option value="Norway">Norway</option><option value="Oman">Oman</option><option value="Pakistan">Pakistan</option><option value="Palau">Palau</option><option value="Panama">Panama</option><option value="Papua New Guinea">Papua New Guinea</option><option value="Paraguay">Paraguay</option><option value="Peru">Peru</option><option value="Philippines">Philippines</option><option value="Poland">Poland</option><option value="Portugal">Portugal</option><option value="Qatar">Qatar</option><option value="Romania">Romania</option><option value="Russia">Russia</option><option value="Rwanda">Rwanda</option><option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option><option value="Saint Lucia">Saint Lucia</option><option value="Saint Vincent">Saint Vincent</option><option value="Samoa">Samoa</option><option value="San Marino">San Marino</option><option value="Sao Tome and Principe">Sao Tome and Principe</option><option value="Saudi Arabia">Saudi Arabia</option><option value="Senegal">Senegal</option><option value="Serbia and Montenegro">Serbia and Montenegro</option><option value="Seychelles">Seychelles</option><option value="Sierra Leone">Sierra Leone</option><option value="Singapore">Singapore</option><option value="Slovakia">Slovakia</option><option value="Slovenia">Slovenia</option><option value="Solomon Islands">Solomon Islands</option><option value="Somalia">Somalia</option><option value="South Africa">South Africa</option><option value="Spain">Spain</option><option value="Sri Lanka">Sri Lanka</option><option value="Sudan">Sudan</option><option value="Suriname">Suriname</option><option value="Swaziland">Swaziland</option><option value="Sweden">Sweden</option><option value="Switzerland">Switzerland</option><option value="Syria">Syria</option><option value="Taiwan">Taiwan</option><option value="Tajikistan">Tajikistan</option><option value="Tanzania">Tanzania</option><option value="Thailand">Thailand</option><option value="Togo">Togo</option><option value="Tonga">Tonga</option><option value="Trinidad and Tobago">Trinidad and Tobago</option><option value="Tunisia">Tunisia</option><option value="Turkey">Turkey</option><option value="Turkmenistan">Turkmenistan</option><option value="Tuvalu">Tuvalu</option><option value="Uganda">Uganda</option><option value="Ukraine">Ukraine</option><option value="United Arab Emirates">United Arab Emirates</option><option value="United Kingdom">United Kingdom</option><option value="United States">United States</option><option value="Uruguay">Uruguay</option><option value="Uzbekistan">Uzbekistan</option><option value="Vanuatu">Vanuatu</option><option value="Vatican City">Vatican City</option><option value="Venezuela">Venezuela</option><option value="Vietnam">Vietnam</option><option value="Yemen">Yemen</option><option value="Zambia">Zambia</option><option value="Zimbabwe">Zimbabwe</option></select><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_country">'.$w_mini_labels[5].'</span>';
447
+ }
448
+
449
+ $rep ='<div id="wdform_field'.$id.'" type="type_address" 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; vertical-align:top;"><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_address" 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" name="'.$id.'_disable_fieldsform_id_temp" id="'.$id.'_disable_fieldsform_id_temp" street1="'.$w_disabled_fields[0].'" street2="'.$w_disabled_fields[1].'" city="'.$w_disabled_fields[2].'" state="'.$w_disabled_fields[3].'" postal="'.$w_disabled_fields[4].'" country="'.$w_disabled_fields[5].'" us_states="'.$w_disabled_fields[6].'"><div id="'.$id.'_div_address" style="width: '.$param['w_size'].'px;">'.$address_fields.$hidden_inputs.'</div></div></div>';
450
+ break;
451
+ }
452
+ case 'type_submitter_mail': {
453
+ $params_names=array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_required','w_unique', 'w_class');
454
+ $temp=$params;
455
+ if(strpos($temp, 'w_autofill') > -1)
456
+ $params_names=array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_required','w_unique', 'w_class', 'w_autofill');
457
+ foreach($params_names as $params_name )
458
+ {
459
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
460
+ $param[$params_name] = $temp[0];
461
+ $temp=$temp[1];
462
+ }
463
+
464
+ if($temp)
465
+ {
466
+ $temp =explode('*:*w_attr_name*:*',$temp);
467
+ $attrs = array_slice($temp,0, count($temp)-1);
468
+ foreach($attrs as $attr)
469
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
470
+ }
471
+
472
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
473
+ $input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active");
474
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
475
+ $param['w_autofill'] = isset($param['w_autofill']) ? $param['w_autofill'] : 'no';
476
+
477
+ $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: '.$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_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_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="text" class="'.$input_active.'" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" value="'.$param['w_first_val'].'" title="'.$param['w_title'].'" onfocus="delete_value(&quot;'.$id.'_elementform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_elementform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_elementform_id_temp&quot;)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled /></div></div>';
478
+ break;
479
+ }
480
+ case 'type_checkbox':
481
+ {
482
+ $params_names=array('w_field_label_size','w_field_label_pos','w_flow','w_choices','w_choices_checked','w_rowcol', 'w_required','w_randomize','w_allow_other','w_allow_other_num','w_class');
483
+ $temp=$params;
484
+ if(strpos($temp, 'w_field_option_pos') > -1)
485
+ $params_names=array('w_field_label_size','w_field_label_pos','w_field_option_pos','w_flow','w_choices','w_choices_checked','w_rowcol', 'w_required','w_randomize','w_allow_other','w_allow_other_num', 'w_value_disabled','w_choices_value', 'w_choices_params', 'w_class');
486
+ foreach($params_names as $params_name )
487
+ {
488
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
489
+ $param[$params_name] = $temp[0];
490
+ $temp=$temp[1];
491
+ }
492
+
493
+ if($temp)
494
+ {
495
+ $temp =explode('*:*w_attr_name*:*',$temp);
496
+ $attrs = array_slice($temp,0, count($temp)-1);
497
+ foreach($attrs as $attr)
498
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
499
+ }
500
+ if(!isset($param['w_value_disabled']))
501
+ $param['w_value_disabled'] = 'no';
502
+
503
+ if(!isset($param['w_field_option_pos']))
504
+ $param['w_field_option_pos'] = 'left';
505
+
506
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
507
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
508
+ $param['w_choices'] = explode('***',$param['w_choices']);
509
+ $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
510
+
511
+ if(isset($param['w_choices_value']))
512
+ {
513
+ $param['w_choices_value'] = explode('***',$param['w_choices_value']);
514
+ $param['w_choices_params'] = explode('***',$param['w_choices_params']);
515
+ }
516
+
517
+ foreach($param['w_choices_checked'] as $key => $choices_checked )
518
+ {
519
+ if($choices_checked=='true')
520
+ $param['w_choices_checked'][$key]='checked="checked"';
521
+ else
522
+ $param['w_choices_checked'][$key]='';
523
+ }
524
+
525
+ $rep='<div id="wdform_field'.$id.'" type="type_checkbox" 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_checkbox" 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_randomize'].'" name="'.$id.'_randomizeform_id_temp" id="'.$id.'_randomizeform_id_temp"><input type="hidden" value="'.$param['w_allow_other'].'" name="'.$id.'_allow_otherform_id_temp" id="'.$id.'_allow_otherform_id_temp"><input type="hidden" value="'.$param['w_allow_other_num'].'" name="'.$id.'_allow_other_numform_id_temp" id="'.$id.'_allow_other_numform_id_temp"><input type="hidden" value="'.$param['w_rowcol'].'" name="'.$id.'_rowcol_numform_id_temp" id="'.$id.'_rowcol_numform_id_temp"><input type="hidden" value="'.$param['w_field_option_pos'].'" id="'.$id.'_option_left_right"><input type="hidden" value="'.$param['w_value_disabled'].'" name="'.$id.'_value_disabledform_id_temp" id="'.$id.'_value_disabledform_id_temp"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;" '.($param['w_flow']=='hor' ? 'for_hor="'.$id.'_hor"' : '').'>';
526
+
527
+ if($param['w_flow']=='hor')
528
+ {
529
+ $j = 0;
530
+ for($i=0; $i<(int)$param['w_rowcol']; $i++)
531
+ {
532
+ $rep.='<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;">';
533
+
534
+ for($l=0; $l<=(int)(count($param['w_choices'])/$param['w_rowcol']); $l++)
535
+ {
536
+ if($j >= count($param['w_choices'])%$param['w_rowcol'] && $l==(int)(count($param['w_choices'])/$param['w_rowcol']))
537
+ continue;
538
+
539
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
540
+ $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$l+$i).'" idi="'.((int)$param['w_rowcol']*$l+$i).'" style="display: table-cell;"><input type="checkbox" value="" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" other="1" onclick="if(set_checked(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$l+$i).'&quot;,&quot;form_id_temp&quot;)) show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$l+$i].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled /><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$l+$i).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'">'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'</label></div>';
541
+ else
542
+ {
543
+ $where = '';
544
+ $order_by = '';
545
+ $db_info = '';
546
+ if(isset($param['w_choices_value']))
547
+ $choise_value = $param['w_choices_value'][(int)$param['w_rowcol']*$l+$i];
548
+ else
549
+ $choise_value = $param['w_choices'][(int)$param['w_rowcol']*$l+$i];
550
+
551
+ if(isset($param['w_choices_params']) && $param['w_choices_params'][(int)$param['w_rowcol']*$l+$i])
552
+ {
553
+ $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][(int)$param['w_rowcol']*$l+$i]);
554
+ $where = "where='".$w_choices_params[0]."'";
555
+ $w_choices_params = explode('[db_info]',$w_choices_params[1]);
556
+ $order_by = "order_by='".$w_choices_params[0]."'";
557
+ $db_info = "db_info='".$w_choices_params[1]."'";
558
+ }
559
+
560
+ $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$l+$i).'" idi="'.((int)$param['w_rowcol']*$l+$i).'" style="display: table-cell;"><input type="checkbox" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" onclick="set_checked(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$l+$i).'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$l+$i].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$l+$i).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" '.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'</label></div>';
561
+ }
562
+ }
563
+
564
+ $j++;
565
+ $rep.='</div>';
566
+
567
+ }
568
+
569
+ }
570
+ else
571
+ {
572
+ for($i=0; $i<(int)(count($param['w_choices'])/$param['w_rowcol']); $i++)
573
+ {
574
+ $rep.='<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;">';
575
+
576
+ if(count($param['w_choices']) > (int)$param['w_rowcol'])
577
+ for($l=0; $l<$param['w_rowcol']; $l++)
578
+ {
579
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
580
+ $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="checkbox" value="" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" other="1" onclick="if(set_checked(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$i+$l).'&quot;,&quot;form_id_temp&quot;)) show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled /><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'">'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
581
+ else
582
+ {
583
+ $where = '' ;
584
+ $order_by = '' ;
585
+ $db_info = '' ;
586
+ if(isset($param['w_choices_value']))
587
+ $choise_value = $param['w_choices_value'][(int)$param['w_rowcol']*$i+$l];
588
+ else
589
+ $choise_value = $param['w_choices'][(int)$param['w_rowcol']*$i+$l];
590
+
591
+ if(isset($param['w_choices_params']) && $param['w_choices_params'][(int)$param['w_rowcol']*$i+$l])
592
+ {
593
+ $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][(int)$param['w_rowcol']*$i+$l]);
594
+ $where = "where='".$w_choices_params[0]."'";
595
+ $w_choices_params = explode('[db_info]',$w_choices_params[1]);
596
+ $order_by = "order_by='".$w_choices_params[0]."'";
597
+ $db_info = "db_info='".$w_choices_params[1]."'";
598
+ }
599
+
600
+ $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="checkbox" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" onclick="set_checked(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$i+$l).'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'"
601
+ '.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
602
+ }
603
+ }
604
+ else
605
+ for($l=0; $l<count($param['w_choices']); $l++)
606
+ {
607
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
608
+ $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="checkbox" value="" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" other="1" onclick="if(set_checked(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$i+$l).'&quot;,&quot;form_id_temp&quot;)) show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'">'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
609
+ else
610
+ {
611
+ $where = '' ;
612
+ $order_by = '' ;
613
+ $db_info = '' ;
614
+ if(isset($param['w_choices_value']))
615
+ $choise_value = $param['w_choices_value'][(int)$param['w_rowcol']*$i+$l];
616
+ else
617
+ $choise_value = $param['w_choices'][(int)$param['w_rowcol']*$i+$l];
618
+
619
+ if(isset($param['w_choices_params']) && $param['w_choices_params'][(int)$param['w_rowcol']*$i+$l])
620
+ {
621
+ $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][(int)$param['w_rowcol']*$i+$l]);
622
+ $where = "where='".$w_choices_params[0]."'";
623
+ $w_choices_params = explode('[db_info]',$w_choices_params[1]);
624
+ $order_by = "order_by='".$w_choices_params[0]."'";
625
+ $db_info = "db_info='".$w_choices_params[1]."'";
626
+ }
627
+
628
+ $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="checkbox" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" onclick="set_checked(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$i+$l).'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" '.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
629
+ }
630
+ }
631
+
632
+ $rep.='</div>';
633
+ }
634
+
635
+ if(count($param['w_choices'])%$param['w_rowcol']!=0)
636
+ {
637
+ $rep.='<div id="'.$id.'_element_tr'.((int)(count($param['w_choices'])/(int)$param['w_rowcol'])).'" style="display: table-row;">';
638
+
639
+ for($k=0; $k<count($param['w_choices'])%$param['w_rowcol']; $k++)
640
+ {
641
+ $l = count($param['w_choices']) - count($param['w_choices'])%$param['w_rowcol'] + $k;
642
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$l)
643
+ $rep.='<div valign="top" id="'.$id.'_td_little'.$l.'" idi="'.$l.'" style="display: table-cell;"><input type="checkbox" value="" id="'.$id.'_elementform_id_temp'.$l.'" name="'.$id.'_elementform_id_temp'.$l.'" other="1" onclick="if(set_checked(&quot;'.$id.'&quot;,&quot;'.$l.'&quot;,&quot;form_id_temp&quot;)) show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$l.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$l.'">'.$param['w_choices'][$l].'</label></div>';
644
+ else
645
+ {
646
+ $where = '' ;
647
+ $order_by = '' ;
648
+ $db_info = '' ;
649
+ if(isset($param['w_choices_value']))
650
+ $choise_value = $param['w_choices_value'][$l];
651
+ else
652
+ $choise_value = $param['w_choices'][$l];
653
+
654
+ if(isset($param['w_choices_params']) && $param['w_choices_params'][$l])
655
+ {
656
+ $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$l]);
657
+ $where = "where='".$w_choices_params[0]."'";
658
+ $w_choices_params = explode('[db_info]',$w_choices_params[1]);
659
+ $order_by = "order_by='".$w_choices_params[0]."'";
660
+ $db_info = "db_info='".$w_choices_params[1]."'";
661
+ }
662
+ $rep.='<div valign="top" id="'.$id.'_td_little'.$l.'" idi="'.$l.'" style="display: table-cell;"><input type="checkbox" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.$l.'" name="'.$id.'_elementform_id_temp'.$l.'" onclick="set_checked(&quot;'.$id.'&quot;,&quot;'.$l.'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$l.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$l.'" '.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][$l].'</label></div>';
663
+ }
664
+ }
665
+
666
+ $rep.='</div>';
667
+ }
668
+
669
+
670
+
671
+ }
672
+ $rep.='</div></div></div></div>';
673
+ break;
674
+ }
675
+ case 'type_radio':
676
+ {
677
+
678
+ $params_names=array('w_field_label_size','w_field_label_pos','w_flow','w_choices','w_choices_checked','w_rowcol', 'w_required','w_randomize','w_allow_other','w_allow_other_num','w_class');
679
+ $temp=$params;
680
+ if(strpos($temp, 'w_field_option_pos') > -1)
681
+ $params_names=array('w_field_label_size','w_field_label_pos','w_field_option_pos','w_flow','w_choices','w_choices_checked','w_rowcol', 'w_required','w_randomize','w_allow_other','w_allow_other_num', 'w_value_disabled', 'w_choices_value', 'w_choices_params','w_class');
682
+ foreach($params_names as $params_name )
683
+ {
684
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
685
+ $param[$params_name] = $temp[0];
686
+ $temp=$temp[1];
687
+ }
688
+
689
+ if($temp)
690
+ {
691
+ $temp =explode('*:*w_attr_name*:*',$temp);
692
+ $attrs = array_slice($temp,0, count($temp)-1);
693
+ foreach($attrs as $attr)
694
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
695
+ }
696
+ if(!isset($param['w_value_disabled']))
697
+ $param['w_value_disabled'] = 'no';
698
+
699
+ if(!isset($param['w_field_option_pos']))
700
+ $param['w_field_option_pos'] = 'left';
701
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
702
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
703
+ $param['w_choices'] = explode('***',$param['w_choices']);
704
+ $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
705
+
706
+ if(isset($param['w_choices_value']))
707
+ {
708
+ $param['w_choices_value'] = explode('***',$param['w_choices_value']);
709
+ $param['w_choices_params'] = explode('***',$param['w_choices_params']);
710
+ }
711
+
712
+ foreach($param['w_choices_checked'] as $key => $choices_checked )
713
+ {
714
+ if($choices_checked=='true')
715
+ $param['w_choices_checked'][$key]='checked="checked"';
716
+ else
717
+ $param['w_choices_checked'][$key]='';
718
+ }
719
+
720
+ $rep='<div id="wdform_field'.$id.'" type="type_radio" 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_radio" 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_randomize'].'" name="'.$id.'_randomizeform_id_temp" id="'.$id.'_randomizeform_id_temp"><input type="hidden" value="'.$param['w_allow_other'].'" name="'.$id.'_allow_otherform_id_temp" id="'.$id.'_allow_otherform_id_temp"><input type="hidden" value="'.$param['w_allow_other_num'].'" name="'.$id.'_allow_other_numform_id_temp" id="'.$id.'_allow_other_numform_id_temp"><input type="hidden" value="'.$param['w_rowcol'].'" name="'.$id.'_rowcol_numform_id_temp" id="'.$id.'_rowcol_numform_id_temp"><input type="hidden" value="'.$param['w_field_option_pos'].'" id="'.$id.'_option_left_right"><input type="hidden" value="'.$param['w_value_disabled'].'" name="'.$id.'_value_disabledform_id_temp" id="'.$id.'_value_disabledform_id_temp"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;" '.($param['w_flow']=='hor' ? 'for_hor="'.$id.'_hor"' : '').'>';
721
+
722
+
723
+ if($param['w_flow']=='hor')
724
+ {
725
+ $j = 0;
726
+ for($i=0; $i<(int)$param['w_rowcol']; $i++)
727
+ {
728
+ $rep.='<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;">';
729
+
730
+ for($l=0; $l<=(int)(count($param['w_choices'])/$param['w_rowcol']); $l++)
731
+ {
732
+ if($j >= count($param['w_choices'])%$param['w_rowcol'] && $l==(int)(count($param['w_choices'])/$param['w_rowcol']))
733
+ continue;
734
+
735
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$l+$i)
736
+ $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$l+$i).'" idi="'.((int)$param['w_rowcol']*$l+$i).'" style="display: table-cell;"><input type="radio" value="'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" name="'.$id.'_elementform_id_temp" other="1" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$l+$i).'&quot;,&quot;form_id_temp&quot;); show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$l+$i].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$l+$i).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'">'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'</label></div>';
737
+ else
738
+ {
739
+ $where = '' ;
740
+ $order_by = '' ;
741
+ $db_info = '' ;
742
+ if(isset($param['w_choices_value']))
743
+ $choise_value = $param['w_choices_value'][(int)$param['w_rowcol']*$l+$i];
744
+ else
745
+ $choise_value = $param['w_choices'][(int)$param['w_rowcol']*$l+$i];
746
+
747
+ if(isset($param['w_choices_params']) && $param['w_choices_params'][(int)$param['w_rowcol']*$l+$i])
748
+ {
749
+ $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][(int)$param['w_rowcol']*$l+$i]);
750
+ $where = "where='".$w_choices_params[0]."'";
751
+ $w_choices_params = explode('[db_info]',$w_choices_params[1]);
752
+ $order_by = "order_by='".$w_choices_params[0]."'";
753
+ $db_info = "db_info='".$w_choices_params[1]."'";
754
+ }
755
+
756
+ $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$l+$i).'" idi="'.((int)$param['w_rowcol']*$l+$i).'" style="display: table-cell;"><input type="radio" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" name="'.$id.'_elementform_id_temp" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$l+$i).'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$l+$i].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$l+$i).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" '.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'</label></div>';
757
+ }
758
+ }
759
+
760
+ $j++;
761
+ $rep.='</div>';
762
+
763
+ }
764
+
765
+ }
766
+ else
767
+ {
768
+ for($i=0; $i<(int)(count($param['w_choices'])/$param['w_rowcol']); $i++)
769
+ {
770
+ $rep.='<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;">';
771
+
772
+ if(count($param['w_choices']) > (int)$param['w_rowcol'])
773
+ for($l=0; $l<$param['w_rowcol']; $l++)
774
+ {
775
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
776
+ $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="radio" value="'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp" other="1" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$i+$l).'&quot;,&quot;form_id_temp&quot;); show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'">'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
777
+ else
778
+ {
779
+ $where = '' ;
780
+ $order_by = '' ;
781
+ $db_info = '' ;
782
+ if(isset($param['w_choices_value']))
783
+ $choise_value = $param['w_choices_value'][(int)$param['w_rowcol']*$i+$l];
784
+ else
785
+ $choise_value = $param['w_choices'][(int)$param['w_rowcol']*$i+$l];
786
+
787
+ if(isset($param['w_choices_params']) && $param['w_choices_params'][(int)$param['w_rowcol']*$i+$l])
788
+ {
789
+ $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][(int)$param['w_rowcol']*$i+$l]);
790
+ $where = "where='".$w_choices_params[0]."'";
791
+ $w_choices_params = explode('[db_info]',$w_choices_params[1]);
792
+ $order_by = "order_by='".$w_choices_params[0]."'";
793
+ $db_info = "db_info='".$w_choices_params[1]."'";
794
+ }
795
+
796
+ $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="radio" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$i+$l).'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" '.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
797
+ }
798
+ }
799
+ else
800
+ for($l=0; $l<count($param['w_choices']); $l++)
801
+ {
802
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
803
+ $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="radio" value="'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp" other="1" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$i+$l).'&quot;,&quot;form_id_temp&quot;); show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'">'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
804
+ else
805
+ {
806
+ $where = '' ;
807
+ $order_by = '' ;
808
+ $db_info = '' ;
809
+ if(isset($param['w_choices_value']))
810
+ $choise_value = $param['w_choices_value'][(int)$param['w_rowcol']*$i+$l];
811
+ else
812
+ $choise_value = $param['w_choices'][(int)$param['w_rowcol']*$i+$l];
813
+
814
+ if(isset($param['w_choices_params']) && $param['w_choices_params'][(int)$param['w_rowcol']*$i+$l])
815
+ {
816
+ $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][(int)$param['w_rowcol']*$i+$l]);
817
+ $where = "where='".$w_choices_params[0]."'";
818
+ $w_choices_params = explode('[db_info]',$w_choices_params[1]);
819
+ $order_by = "order_by='".$w_choices_params[0]."'";
820
+ $db_info = "db_info='".$w_choices_params[1]."'";
821
+ }
822
+
823
+ $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="radio" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$i+$l).'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" '.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
824
+ }
825
+ }
826
+
827
+ $rep.='</div>';
828
+ }
829
+
830
+ if(count($param['w_choices'])%$param['w_rowcol']!=0)
831
+ {
832
+ $rep.='<div id="'.$id.'_element_tr'.((int)(count($param['w_choices'])/(int)$param['w_rowcol'])).'" style="display: table-row;">';
833
+
834
+ for($k=0; $k<count($param['w_choices'])%$param['w_rowcol']; $k++)
835
+ {
836
+ $l = count($param['w_choices']) - count($param['w_choices'])%$param['w_rowcol'] + $k;
837
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$l)
838
+ $rep.='<div valign="top" id="'.$id.'_td_little'.$l.'" idi="'.$l.'" style="display: table-cell;"><input type="radio" value="'.$param['w_choices'][$l].'" id="'.$id.'_elementform_id_temp'.$l.'" name="'.$id.'_elementform_id_temp" other="1" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.$l.'&quot;,&quot;form_id_temp&quot;); show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$l.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$l.'">'.$param['w_choices'][$l].'</label></div>';
839
+ else
840
+ {
841
+ $where = '' ;
842
+ $order_by = '' ;
843
+ $db_info = '' ;
844
+ if(isset($param['w_choices_value']))
845
+ $choise_value = $param['w_choices_value'][$l];
846
+ else
847
+ $choise_value = $param['w_choices'][$l];
848
+
849
+ if(isset($param['w_choices_params']) && $param['w_choices_params'][$l])
850
+ {
851
+ $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$l]);
852
+ $where = "where='".$w_choices_params[0]."'";
853
+ $w_choices_params = explode('[db_info]',$w_choices_params[1]);
854
+ $order_by = "order_by='".$w_choices_params[0]."'";
855
+ $db_info = "db_info='".$w_choices_params[1]."'";
856
+ }
857
+
858
+ $rep.='<div valign="top" id="'.$id.'_td_little'.$l.'" idi="'.$l.'" style="display: table-cell;"><input type="radio" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.$l.'" name="'.$id.'_elementform_id_temp" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.$l.'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$l.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$l.'"
859
+ '.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][$l].'</label></div>';
860
+ }
861
+ }
862
+
863
+ $rep.='</div>';
864
+ }
865
+
866
+ }
867
+
868
+
869
+
870
+ $rep.='</div></div></div></div>';
871
+
872
+ break;
873
+ }
874
+ case 'type_own_select':
875
+ {
876
+ $params_names=array('w_field_label_size','w_field_label_pos','w_size','w_choices','w_choices_checked', 'w_choices_disabled','w_required','w_class');
877
+ $temp=$params;
878
+ if(strpos($temp, 'w_choices_value') > -1)
879
+ $params_names=array('w_field_label_size','w_field_label_pos','w_size','w_choices','w_choices_checked', 'w_choices_disabled', 'w_required', 'w_value_disabled', 'w_choices_value', 'w_choices_params', 'w_class');
880
+ foreach($params_names as $params_name )
881
+ {
882
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
883
+ $param[$params_name] = $temp[0];
884
+ $temp=$temp[1];
885
+ }
886
+
887
+ if($temp)
888
+ {
889
+ $temp =explode('*:*w_attr_name*:*',$temp);
890
+ $attrs = array_slice($temp,0, count($temp)-1);
891
+ foreach($attrs as $attr)
892
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
893
+ }
894
+
895
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
896
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
897
+ $param['w_choices'] = explode('***',$param['w_choices']);
898
+ $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
899
+ $param['w_choices_disabled'] = explode('***',$param['w_choices_disabled']);
900
+
901
+ if(isset($param['w_choices_value']))
902
+ {
903
+ $param['w_choices_value'] = explode('***',$param['w_choices_value']);
904
+ $param['w_choices_params'] = explode('***',$param['w_choices_params']);
905
+ }
906
+
907
+ if(!isset($param['w_value_disabled']))
908
+ $param['w_value_disabled'] = 'no';
909
+
910
+ foreach($param['w_choices_checked'] as $key => $choices_checked )
911
+ {
912
+ if($choices_checked=='true')
913
+ $param['w_choices_checked'][$key]='selected="selected"';
914
+ else
915
+ $param['w_choices_checked'][$key]='';
916
+ }
917
+
918
+ $rep='<div id="wdform_field'.$id.'" type="type_own_select" 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_own_select" 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_value_disabled'].'" name="'.$id.'_value_disabledform_id_temp" id="'.$id.'_value_disabledform_id_temp"><select id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" onchange="set_select(this)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled>';
919
+ foreach($param['w_choices'] as $key => $choice)
920
+ {
921
+ $where = '';
922
+ $order_by = '';
923
+ $db_info = '';
924
+ $choice_value = $param['w_choices_disabled'][$key]=='true' ? '' : (isset($param['w_choices_value']) ? $param['w_choices_value'][$key] : $choice);
925
+ if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
926
+ {
927
+ $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
928
+ $where = "where='".$w_choices_params[0]."'";
929
+ $w_choices_params = explode('[db_info]',$w_choices_params[1]);
930
+ $order_by = "order_by='".$w_choices_params[0]."'";
931
+ $db_info = "db_info='".$w_choices_params[1]."'";
932
+ }
933
+
934
+ $rep.='<option id="'.$id.'_option'.$key.'" value="'.$choice_value.'" onselect="set_select(&quot;'.$id.'_option'.$key.'&quot;)" '.$param['w_choices_checked'][$key].' '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</option>';
935
+ }
936
+ $rep.='</select></div></div>';
937
+ break;
938
+ }
939
+
940
+ case 'type_country':
941
+ {
942
+ $params_names=array('w_field_label_size','w_field_label_pos','w_size','w_countries','w_required','w_class');
943
+ $temp=$params;
944
+ foreach($params_names as $params_name )
945
+ {
946
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
947
+ $param[$params_name] = $temp[0];
948
+ $temp=$temp[1];
949
+ }
950
+
951
+ if($temp)
952
+ {
953
+ $temp =explode('*:*w_attr_name*:*',$temp);
954
+ $attrs = array_slice($temp,0, count($temp)-1);
955
+ foreach($attrs as $attr)
956
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
957
+ }
958
+
959
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
960
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
961
+ $param['w_countries'] = explode('***',$param['w_countries']);
962
+
963
+ $rep='<div id="wdform_field'.$id.'" type="type_country" 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_country" 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"><select id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled>';
964
+ foreach($param['w_countries'] as $key => $choice)
965
+ {
966
+ $choice_value=$choice;
967
+ $rep.='<option value="'.$choice_value.'">'.$choice.'</option>';
968
+ }
969
+ $rep.='</select></div></div>';
970
+ break;
971
+ }
972
+
973
+ case 'type_time':
974
+ {
975
+ $params_names=array('w_field_label_size','w_field_label_pos','w_time_type','w_am_pm','w_sec','w_hh','w_mm','w_ss','w_mini_labels','w_required','w_class');
976
+ $temp=$params;
977
+ foreach($params_names as $params_name )
978
+ {
979
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
980
+ $param[$params_name] = $temp[0];
981
+ $temp=$temp[1];
982
+ }
983
+
984
+ if($temp)
985
+ {
986
+ $temp =explode('*:*w_attr_name*:*',$temp);
987
+ $attrs = array_slice($temp,0, count($temp)-1);
988
+ foreach($attrs as $attr)
989
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
990
+ }
991
+
992
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
993
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
994
+
995
+ $w_mini_labels = explode('***',$param['w_mini_labels']);
996
+
997
+
998
+ if($param['w_sec']=='1')
999
+ {
1000
+ $w_sec = '<div align="center" style="display: table-cell;"><span class="wdform_colon" style="vertical-align: middle;">&nbsp;:&nbsp;</span></div><div id="'.$id.'_td_time_input3" style="width: 32px; display: table-cell;"><input type="text" value="'.$param['w_ss'].'" class="time_box" id="'.$id.'_ssform_id_temp" name="'.$id.'_ssform_id_temp" onkeypress="return check_second(event, &quot;'.$id.'_ssform_id_temp&quot;)" onkeyup="change_second(&quot;'.$id.'_ssform_id_temp&quot;)" onblur="add_0(&quot;'.$id.'_ssform_id_temp&quot;)" '.$param['attributes'].' disabled /></div>';
1001
+ $w_sec_label='<div style="display: table-cell;"></div><div id="'.$id.'_td_time_label3" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_ss">'.$w_mini_labels[2].'</label></div>';
1002
+ }
1003
+ else
1004
+ {
1005
+ $w_sec = '';
1006
+ $w_sec_label='';
1007
+ }
1008
+
1009
+ if($param['w_time_type']=='12')
1010
+ {
1011
+ if($param['w_am_pm']=='am')
1012
+ {
1013
+ $am_ = "selected=\"selected\"";
1014
+ $pm_ = "";
1015
+ }
1016
+ else
1017
+ {
1018
+ $am_ = "";
1019
+ $pm_ = "selected=\"selected\"";
1020
+
1021
+ }
1022
+
1023
+ $w_time_type = '<div id="'.$id.'_am_pm_select" class="td_am_pm_select" style="display: table-cell;"><select class="am_pm_select" name="'.$id.'_am_pmform_id_temp" id="'.$id.'_am_pmform_id_temp" onchange="set_sel_am_pm(this)" '.$param['attributes'].'><option value="am" '.$am_.'>AM</option><option value="pm" '.$pm_.'>PM</option></select></div>';
1024
+
1025
+ $w_time_type_label = '<div id="'.$id.'_am_pm_label" class="td_am_pm_select" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_am_pm">'.$w_mini_labels[3].'</label></div>';
1026
+
1027
+ }
1028
+ else
1029
+ {
1030
+ $w_time_type='';
1031
+ $w_time_type_label = '';
1032
+ }
1033
+
1034
+
1035
+ $rep ='<div id="wdform_field'.$id.'" type="type_time" 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_time" 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"><div id="'.$id.'_table_time" style="display: table;"><div id="'.$id.'_tr_time1" style="display: table-row;"><div id="'.$id.'_td_time_input1" style="width: 32px; display: table-cell;"><input type="text" value="'.$param['w_hh'].'" class="time_box" id="'.$id.'_hhform_id_temp" name="'.$id.'_hhform_id_temp" onkeypress="return check_hour(event, &quot;'.$id.'_hhform_id_temp&quot;, &quot;23&quot;)" onkeyup="change_hour(event, &quot;'.$id.'_hhform_id_temp&quot;,&quot;23&quot;)" onblur="add_0(&quot;'.$id.'_hhform_id_temp&quot;)" '.$param['attributes'].' disabled/></div><div align="center" style="display: table-cell;"><span class="wdform_colon" style="vertical-align: middle;">&nbsp;:&nbsp;</span></div><div id="'.$id.'_td_time_input2" style="width: 32px; display: table-cell;"><input type="text" value="'.$param['w_mm'].'" class="time_box" id="'.$id.'_mmform_id_temp" name="'.$id.'_mmform_id_temp" onkeypress="return check_minute(event, &quot;'.$id.'_mmform_id_temp&quot;)" onkeyup="change_minute(event, &quot;'.$id.'_mmform_id_temp&quot;)" onblur="add_0(&quot;'.$id.'_mmform_id_temp&quot;)" '.$param['attributes'].' disabled/></div>'.$w_sec.$w_time_type.'</div><div id="'.$id.'_tr_time2" style="display: table-row;"><div id="'.$id.'_td_time_label1" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_hh">'.$w_mini_labels[0].'</label></div><div style="display: table-cell;"></div><div id="'.$id.'_td_time_label2" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_mm">'.$w_mini_labels[1].'</label></div>'.$w_sec_label.$w_time_type_label.'</div></div></div></div>';
1036
+
1037
+ break;
1038
+ }
1039
+ case 'type_date':
1040
+ {
1041
+ $params_names=array('w_field_label_size','w_field_label_pos','w_date','w_required','w_class','w_format','w_but_val');
1042
+ $temp = $params;
1043
+ if(strpos($temp, 'w_disable_past_days') > -1)
1044
+ $params_names = array('w_field_label_size','w_field_label_pos','w_date','w_required','w_class','w_format','w_but_val', 'w_disable_past_days');
1045
+ foreach($params_names as $params_name )
1046
+ {
1047
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1048
+ $param[$params_name] = $temp[0];
1049
+ $temp=$temp[1];
1050
+ }
1051
+
1052
+ if($temp)
1053
+ {
1054
+ $temp =explode('*:*w_attr_name*:*',$temp);
1055
+ $attrs = array_slice($temp,0, count($temp)-1);
1056
+ foreach($attrs as $attr)
1057
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1058
+ }
1059
+
1060
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1061
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1062
+ $param['w_disable_past_days'] = isset($param['w_disable_past_days']) ? $param['w_disable_past_days'] : 'no';
1063
+ $disable_past_days = $param['w_disable_past_days'] == 'yes' ? 'true' : 'false';
1064
+
1065
+ $rep ='<div id="wdform_field'.$id.'" type="type_date" 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_date" 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_disable_past_days'].'" name="'.$id.'_dis_past_daysform_id_temp" id="'.$id.'_dis_past_daysform_id_temp"><input type="text" value="'.$param['w_date'].'" class="wdform-date" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" maxlength="10" size="10" onchange="change_value(&quot;'.$id.'_elementform_id_temp&quot;)" '.$param['attributes'].' disabled/><input id="'.$id.'_buttonform_id_temp" class="button" type="reset" value="'.$param['w_but_val'].'" format="'.$param['w_format'].'" src="templates/bluestork/images/system/calendar.png?ver='. get_option("wd_form_maker_version").'" alt="calendario" '.$param['attributes'].' onclick="return showCalendar(&quot;'.$id.'_elementform_id_temp&quot; , &quot;'.$param['w_format'].'&quot;, '.$disable_past_days.')"></div></div>';
1066
+
1067
+ break;
1068
+ }
1069
+
1070
+ case 'type_date_new':
1071
+ {
1072
+
1073
+ $params_names=array('w_field_label_size','w_field_label_pos', 'w_size', 'w_date','w_required', 'w_show_image', 'w_class','w_format', 'w_start_day', 'w_default_date', 'w_min_date', 'w_max_date', 'w_invalid_dates', 'w_show_days', 'w_hide_time', 'w_but_val', 'w_disable_past_days');
1074
+ $temp = $params;
1075
+
1076
+ foreach($params_names as $params_name )
1077
+ {
1078
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1079
+ $param[$params_name] = $temp[0];
1080
+ $temp=$temp[1];
1081
+ }
1082
+
1083
+ if($temp)
1084
+ {
1085
+ $temp =explode('*:*w_attr_name*:*',$temp);
1086
+ $attrs = array_slice($temp,0, count($temp)-1);
1087
+ foreach($attrs as $attr)
1088
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1089
+ }
1090
+
1091
+
1092
+ $w_show_week_days = explode('***', $param['w_show_days']);
1093
+
1094
+
1095
+
1096
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1097
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1098
+ $param['w_disable_past_days'] = isset($param['w_disable_past_days']) ? $param['w_disable_past_days'] : 'no';
1099
+ $disable_past_days = $param['w_disable_past_days'] == 'yes' ? 'true' : 'false';
1100
+ $display_image_date = $param['w_show_image'] == 'yes' ? 'inline' : 'none';
1101
+
1102
+
1103
+ $rep ='<div id="wdform_field'.$id.'" type="type_date_new" 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_date_new" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp">
1104
+ <input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp">
1105
+
1106
+ <input type="hidden" value="'.$param['w_show_image'].'" name="'.$id.'_show_imageform_id_temp" id="'.$id.'_show_imageform_id_temp">
1107
+
1108
+ <input type="hidden" value="'.$param['w_disable_past_days'].'" name="'.$id.'_dis_past_daysform_id_temp" id="'.$id.'_dis_past_daysform_id_temp">
1109
+
1110
+ <input type="hidden" value="'.$param['w_default_date'].'" name="'.$id.'_default_date_id_temp" id="'.$id.'_default_date_id_temp">
1111
+ <input type="hidden" value="'.$param['w_min_date'].'" name="'.$id.'_min_date_id_temp" id="'.$id.'_min_date_id_temp">
1112
+ <input type="hidden" value="'.$param['w_max_date'].'" name="'.$id.'_max_date_id_temp" id="'.$id.'_max_date_id_temp">
1113
+ <input type="hidden" value="'.$param['w_invalid_dates'].'" name="'.$id.'_invalid_dates_id_temp" id="'.$id.'_invalid_dates_id_temp">
1114
+
1115
+ <input type="hidden" value="'.$param['w_start_day'].'" name="'.$id.'_start_dayform_id_temp" id="'.$id.'_start_dayform_id_temp">
1116
+
1117
+ <input type="hidden" value="'.$param['w_hide_time'].'" name="'.$id.'_hide_timeform_id_temp" id="'.$id.'_hide_timeform_id_temp">
1118
+
1119
+ <input type="hidden" name="'.$id.'_show_week_days" id="'.$id.'_show_week_days" sunday="'.$w_show_week_days[0].'" monday="'.$w_show_week_days[1].'" tuesday="'.$w_show_week_days[2].'" wednesday="'.$w_show_week_days[3].'" thursday="'.$w_show_week_days[4].'" friday="'.$w_show_week_days[5].'" saturday="'.$w_show_week_days[6].'">
1120
+
1121
+
1122
+
1123
+ <input type="text" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled/>
1124
+ <img src="' . WD_FM_URL . '/images/date.png" id="'.$id.'_show_imagedateform_id_temp" name="'.$id.'_show_imagedateform_id_temp" style="vertical-align : text-top; margin-left : 1px; display:'.$display_image_date.'">
1125
+
1126
+ <input id="'.$id.'_buttonform_id_temp" type="hidden" value="'.$param['w_but_val'].'" format="'.$param['w_format'].'" ></div></div>';
1127
+
1128
+ break;
1129
+ }
1130
+
1131
+
1132
+
1133
+ case 'type_date_range':
1134
+ {
1135
+
1136
+ $params_names=array('w_field_label_size','w_field_label_pos', 'w_size', 'w_date','w_required', 'w_show_image', 'w_class','w_format', 'w_start_day', 'w_default_date_start', 'w_default_date_end', 'w_min_date', 'w_max_date', 'w_invalid_dates', 'w_show_days', 'w_hide_time', 'w_but_val', 'w_disable_past_days');
1137
+ $temp = $params;
1138
+
1139
+
1140
+ foreach($params_names as $params_name )
1141
+ {
1142
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1143
+ $param[$params_name] = $temp[0];
1144
+ $temp=$temp[1];
1145
+ }
1146
+
1147
+ if($temp)
1148
+ {
1149
+ $temp =explode('*:*w_attr_name*:*',$temp);
1150
+ $attrs = array_slice($temp,0, count($temp)-1);
1151
+ foreach($attrs as $attr)
1152
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1153
+ }
1154
+
1155
+
1156
+ $w_show_week_days = explode('***', $param['w_show_days']);
1157
+ $defaul_day_array = explode(',', $param['w_date']);
1158
+ $defaul_day_start = $defaul_day_array[0];
1159
+ $defaul_day_end = $defaul_day_array[1];
1160
+
1161
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1162
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1163
+ $param['w_disable_past_days'] = isset($param['w_disable_past_days']) ? $param['w_disable_past_days'] : 'no';
1164
+ $disable_past_days = $param['w_disable_past_days'] == 'yes' ? 'true' : 'false';
1165
+ $display_image_date = $param['w_show_image'] == 'yes' ? 'inline' : 'none';
1166
+
1167
+ $rep ='<div id="wdform_field'.$id.'" type="type_date_range" 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'].';">
1168
+
1169
+ <input type="hidden" value="type_date_range" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp">
1170
+
1171
+ <input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp">
1172
+
1173
+ <input type="hidden" value="'.$param['w_show_image'].'" name="'.$id.'_show_imageform_id_temp" id="'.$id.'_show_imageform_id_temp">
1174
+
1175
+ <input type="hidden" value="'.$param['w_disable_past_days'].'" name="'.$id.'_dis_past_daysform_id_temp" id="'.$id.'_dis_past_daysform_id_temp">
1176
+
1177
+ <input type="hidden" value="'.$param['w_default_date_start'].'" name="'.$id.'_default_date_id_temp_start" id="'.$id.'_default_date_id_temp_start">
1178
+
1179
+ <input type="hidden" value="'.$param['w_default_date_end'].'" name="'.$id.'_default_date_id_temp_end" id="'.$id.'_default_date_id_temp_end">
1180
+
1181
+ <input type="hidden" value="'.$param['w_min_date'].'" name="'.$id.'_min_date_id_temp" id="'.$id.'_min_date_id_temp">
1182
+
1183
+ <input type="hidden" value="'.$param['w_max_date'].'" name="'.$id.'_max_date_id_temp" id="'.$id.'_max_date_id_temp">
1184
+
1185
+ <input type="hidden" value="'.$param['w_invalid_dates'].'" name="'.$id.'_invalid_dates_id_temp" id="'.$id.'_invalid_dates_id_temp">
1186
+
1187
+ <input type="hidden" value="'.$param['w_start_day'].'" name="'.$id.'_start_dayform_id_temp" id="'.$id.'_start_dayform_id_temp">
1188
+
1189
+ <input type="hidden" value="'.$param['w_hide_time'].'" name="'.$id.'_hide_timeform_id_temp" id="'.$id.'_hide_timeform_id_temp">
1190
+
1191
+ <input type="hidden" name="'.$id.'_show_week_days" id="'.$id.'_show_week_days" sunday="'.$w_show_week_days[0].'" monday="'.$w_show_week_days[1].'" tuesday="'.$w_show_week_days[2].'" wednesday="'.$w_show_week_days[3].'" thursday="'.$w_show_week_days[4].'" friday="'.$w_show_week_days[5].'" saturday="'.$w_show_week_days[6].'">
1192
+
1193
+
1194
+
1195
+
1196
+
1197
+ <input type="text" id="'.$id.'_elementform_id_temp0" name="'.$id.'_elementform_id_temp0" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled/>
1198
+ <img src="' . WD_FM_URL . '/images/date.png" id="'.$id.'_show_imagedateform_id_temp0" name="'.$id.'_show_imagedateform_id_temp0" style="vertical-align : text-top; margin-left : 1px; display:'.$display_image_date.'">
1199
+
1200
+ <span>-</span>
1201
+
1202
+ <input type="text" id="'.$id.'_elementform_id_temp1" name="'.$id.'_elementform_id_temp1" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled/>
1203
+ <img src="' . WD_FM_URL . '/images/date.png" id="'.$id.'_show_imagedateform_id_temp1" name="'.$id.'_show_imagedateform_id_temp1" style="vertical-align : text-top; margin-left : 1px; display:'.$display_image_date.'">
1204
+
1205
+ <input id="'.$id.'_buttonform_id_temp" type="hidden" value="'.$param['w_but_val'].'" format="'.$param['w_format'].'" >
1206
+
1207
+ </div></div>';
1208
+
1209
+
1210
+
1211
+ break;
1212
+ }
1213
+
1214
+
1215
+ case 'type_date_fields':
1216
+ {
1217
+ $params_names=array('w_field_label_size','w_field_label_pos','w_day','w_month','w_year','w_day_type','w_month_type','w_year_type','w_day_label','w_month_label','w_year_label','w_day_size','w_month_size','w_year_size','w_required','w_class','w_from','w_to','w_divider');
1218
+
1219
+ $temp=$params;
1220
+ foreach($params_names as $params_name )
1221
+ {
1222
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1223
+ $param[$params_name] = $temp[0];
1224
+ $temp=$temp[1];
1225
+ }
1226
+
1227
+ if($temp)
1228
+ {
1229
+ $temp =explode('*:*w_attr_name*:*',$temp);
1230
+ $attrs = array_slice($temp,0, count($temp)-1);
1231
+ foreach($attrs as $attr)
1232
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1233
+ }
1234
+
1235
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1236
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1237
+
1238
+
1239
+ if($param['w_day_type']=="SELECT")
1240
+ {
1241
+
1242
+
1243
+ $w_day_type = '<select id="'.$id.'_dayform_id_temp" name="'.$id.'_dayform_id_temp" onchange="set_select(this)" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].' disabled><option value=""></option>';
1244
+ for($k=0; $k<=31; $k++)
1245
+ {
1246
+ if($k<10)
1247
+ {
1248
+ if($param['w_day']=='0'.$k)
1249
+ $selected = "selected=\"selected\"";
1250
+ else
1251
+ $selected = "";
1252
+
1253
+ $w_day_type .= '<option value="0'.$k.'" '.$selected.'>0'.$k.'</option>';
1254
+ }
1255
+ else
1256
+ {
1257
+ if($param['w_day']==''.$k)
1258
+ $selected = "selected=\"selected\"";
1259
+ else
1260
+ $selected = "";
1261
+
1262
+ $w_day_type .= '<option value="'.$k.'" '.$selected.'>'.$k.'</option>';
1263
+ }
1264
+
1265
+
1266
+
1267
+ }
1268
+ $w_day_type .= '</select>';
1269
+ }
1270
+ else
1271
+ {
1272
+ $w_day_type = '<input type="text" value="'.$param['w_day'].'" id="'.$id.'_dayform_id_temp" name="'.$id.'_dayform_id_temp" onchange="change_value(&quot;'.$id.'_dayform_id_temp&quot;)" onkeypress="return check_day(event, &quot;'.$id.'_dayform_id_temp&quot;)" onblur="if (this.value==&quot;0&quot;) this.value=&quot;&quot;; else add_0(&quot;'.$id.'_dayform_id_temp&quot;)" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].' disabled/>';
1273
+ }
1274
+
1275
+ if($param['w_month_type']=="SELECT")
1276
+ {
1277
+
1278
+ $w_month_type = '<select id="'.$id.'_monthform_id_temp" name="'.$id.'_monthform_id_temp" onchange="set_select(this)" style="width: '.$param['w_month_size'].'px;" '.$param['attributes'].' disabled><option value=""></option><option value="01" '.($param['w_month']=="01" ? "selected=\"selected\"": "").' ><!--repstart-->January<!--repend--></option><option value="02" '.($param['w_month']=="02" ? "selected=\"selected\"": "").'><!--repstart-->February<!--repend--></option><option value="03" '.($param['w_month']=="03"? "selected=\"selected\"": "").'><!--repstart-->March<!--repend--></option><option value="04" '.($param['w_month']=="04" ? "selected=\"selected\"": "").' ><!--repstart-->April<!--repend--></option><option value="05" '.($param['w_month']=="05" ? "selected=\"selected\"": "").' ><!--repstart-->May<!--repend--></option><option value="06" '.($param['w_month']=="06" ? "selected=\"selected\"": "").' ><!--repstart-->June<!--repend--></option><option value="07" '.($param['w_month']=="07" ? "selected=\"selected\"": "").' ><!--repstart-->July<!--repend--></option><option value="08" '.($param['w_month']=="08" ? "selected=\"selected\"": "").' ><!--repstart-->August<!--repend--></option><option value="09" '.($param['w_month']=="09" ? "selected=\"selected\"": "").' ><!--repstart-->September<!--repend--></option><option value="10" '.($param['w_month']=="10" ? "selected=\"selected\"": "").' ><!--repstart-->October<!--repend--></option><option value="11" '.($param['w_month']=="11" ? "selected=\"selected\"": "").'><!--repstart-->November<!--repend--></option><option value="12" '.($param['w_month']=="12" ? "selected=\"selected\"": "").' ><!--repstart-->December<!--repend--></option></select>';
1279
+
1280
+ }
1281
+ else
1282
+ {
1283
+ $w_month_type = '<input type="text" value="'.$param['w_month'].'" id="'.$id.'_monthform_id_temp" name="'.$id.'_monthform_id_temp" onkeypress="return check_month(event, &quot;'.$id.'_monthform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_monthform_id_temp&quot;)" onblur="if (this.value==&quot;0&quot;) this.value=&quot;&quot;; else add_0(&quot;'.$id.'_monthform_id_temp&quot;)" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].' disabled/>';
1284
+
1285
+ }
1286
+ $param['w_to'] = isset($param['w_to']) && $param['w_to']!="NaN" ? $param['w_to'] : date("Y");
1287
+ if($param['w_year_type']=="SELECT")
1288
+ {
1289
+ $w_year_type = '<select id="'.$id.'_yearform_id_temp" name="'.$id.'_yearform_id_temp" onchange="set_select(this)" from="'.$param['w_from'].'" to="'.$param['w_to'].'" style="width: '.$param['w_year_size'].'px;" '.$param['attributes'].' disabled><option value=""></option>';
1290
+ for($k=$param['w_to']; $k>=$param['w_from']; $k--)
1291
+ {
1292
+ if($param['w_year']==$k)
1293
+ $selected = "selected=\"selected\"";
1294
+ else
1295
+ $selected = "";
1296
+
1297
+ $w_year_type .= '<option value="'.$k.'" '.$selected.'>'.$k.'</option>';
1298
+ }
1299
+ $w_year_type .= '</select>';
1300
+
1301
+ }
1302
+ else
1303
+ {
1304
+ $w_year_type = '<input type="text" value="'.$param['w_year'].'" id="'.$id.'_yearform_id_temp" name="'.$id.'_yearform_id_temp" onchange="change_year(&quot;'.$id.'_yearform_id_temp&quot;)" onkeypress="return check_year1(event, &quot;'.$id.'_yearform_id_temp&quot;)" onblur="check_year2(&quot;'.$id.'_yearform_id_temp&quot;)" from="'.$param['w_from'].'" to="'.$param['w_to'].'" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].' disabled/>';
1305
+ }
1306
+
1307
+
1308
+ $rep ='<div id="wdform_field'.$id.'" type="type_date_fields" 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_date_fields" 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"><div id="'.$id.'_table_date" style="display: table;"><div id="'.$id.'_tr_date1" style="display: table-row;"><div id="'.$id.'_td_date_input1" style="display: table-cell;">
1309
+ '.$w_day_type.'
1310
+
1311
+ </div><div id="'.$id.'_td_date_separator1" style="display: table-cell;"><span id="'.$id.'_separator1" class="wdform_separator">'.$param['w_divider'].'</span></div><div id="'.$id.'_td_date_input2" style="display: table-cell;">'.$w_month_type.'</div><div id="'.$id.'_td_date_separator2" style="display: table-cell;"><span id="'.$id.'_separator2" class="wdform_separator">'.$param['w_divider'].'</span></div><div id="'.$id.'_td_date_input3" style="display: table-cell;">'.$w_year_type.'</div></div><div id="'.$id.'_tr_date2" style="display: table-row;"><div id="'.$id.'_td_date_label1" style="display: table-cell;"><label class="mini_label" id="'.$id.'_day_label">'.$param['w_day_label'].'</label></div><div style="display: table-cell;"></div><div id="'.$id.'_td_date_label2" style="display: table-cell;"><label class="mini_label" id="'.$id.'_month_label">'.$param['w_month_label'].'</label></div><div style="display: table-cell;"></div><div id="'.$id.'_td_date_label3" style="display: table-cell;"><label class="mini_label" id="'.$id.'_year_label">'.$param['w_year_label'].'</label></div></div></div></div></div>';
1312
+
1313
+ break;
1314
+ }
1315
+ case 'type_file_upload':
1316
+ {
1317
+ $params_names=array('w_field_label_size','w_field_label_pos','w_destination','w_extension','w_max_size','w_required','w_multiple','w_class');
1318
+ $temp=$params;
1319
+ foreach($params_names as $params_name )
1320
+ {
1321
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1322
+ $param[$params_name] = $temp[0];
1323
+ if (isset($temp[1])) {
1324
+ $temp = $temp[1];
1325
+ }
1326
+ else {
1327
+ $temp = '';
1328
+ }
1329
+ }
1330
+
1331
+ if($temp)
1332
+ {
1333
+ $temp =explode('*:*w_attr_name*:*',$temp);
1334
+ $attrs = array_slice($temp,0, count($temp)-1);
1335
+ foreach($attrs as $attr)
1336
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1337
+ }
1338
+
1339
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1340
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1341
+ $multiple = ($param['w_multiple']=="yes" ? "multiple='multiple'" : "");
1342
+
1343
+ $rep ='<div id="wdform_field'.$id.'" type="type_file_upload" 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_file_upload" 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="***max_sizeskizb'.$id.'***'.$param['w_max_size'].'***max_sizeverj'.$id.'***" id="'.$id.'_max_size" name="'.$id.'_max_size"><input type="hidden" value="***destinationskizb'.$id.'***'.$param['w_destination'].'***destinationverj'.$id.'***" id="'.$id.'_destination" name="'.$id.'_destination"><input type="hidden" value="***extensionskizb'.$id.'***'.$param['w_extension'].'***extensionverj'.$id.'***" id="'.$id.'_extension" name="'.$id.'_extension"><input type="file" class="file_upload" id="'.$id.'_elementform_id_temp" name="'.$id.'_fileform_id_temp" '.$multiple.' '.$param['attributes'].' disabled/></div></div>';
1344
+
1345
+ break;
1346
+ }
1347
+ case 'type_captcha':
1348
+ {
1349
+ $params_names=array('w_field_label_size','w_field_label_pos','w_digit','w_class');
1350
+ $temp=$params;
1351
+ foreach($params_names as $params_name )
1352
+ {
1353
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1354
+ $param[$params_name] = $temp[0];
1355
+ $temp=$temp[1];
1356
+ }
1357
+
1358
+ if($temp)
1359
+ {
1360
+ $temp =explode('*:*w_attr_name*:*',$temp);
1361
+ $attrs = array_slice($temp,0, count($temp)-1);
1362
+ foreach($attrs as $attr)
1363
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1364
+ }
1365
+
1366
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1367
+
1368
+ $rep ='<div id="wdform_field'.$id.'" type="type_captcha" 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></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_captcha" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><div style="display: table;"><div style="display: table-row;"><div valign="middle" style="display: table-cell;"><img type="captcha" digit="'.$param['w_digit'].'" src="' . add_query_arg(array('action' => 'formmakerwdcaptcha', 'digit' => $param['w_digit'], 'i' => 'form_id_temp'), admin_url('admin-ajax.php')) . '" id="_wd_captchaform_id_temp" class="captcha_img" onclick="captcha_refresh(&quot;_wd_captcha&quot;,&quot;form_id_temp&quot;)" '.$param['attributes'].'></div><div valign="middle" style="display: table-cell;"><div class="captcha_refresh" id="_element_refreshform_id_temp" onclick="captcha_refresh(&quot;_wd_captcha&quot;,&quot;form_id_temp&quot;)" '.$param['attributes'].'></div></div></div><div style="display: table-row;"><div style="display: table-cell;"><input type="text" class="captcha_input" id="_wd_captcha_inputform_id_temp" name="captcha_input" style="width: '.($param['w_digit']*10+15).'px;" '.$param['attributes'].' disabled/></div></div></div></div></div>';
1369
+
1370
+ break;
1371
+ }
1372
+ case 'type_arithmetic_captcha':
1373
+ {
1374
+ $params_names=array('w_field_label_size','w_field_label_pos', 'w_count', 'w_operations','w_class', 'w_input_size');
1375
+ $temp=$params;
1376
+ foreach($params_names as $params_name )
1377
+ {
1378
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1379
+ $param[$params_name] = $temp[0];
1380
+ $temp=$temp[1];
1381
+ }
1382
+
1383
+ if($temp)
1384
+ {
1385
+ $temp =explode('*:*w_attr_name*:*',$temp);
1386
+ $attrs = array_slice($temp,0, count($temp)-1);
1387
+ foreach($attrs as $attr)
1388
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1389
+ }
1390
+
1391
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1392
+ $param['w_count'] = $param['w_count'] ? $param['w_count'] : 1;
1393
+ $param['w_operations'] = $param['w_operations'] ? $param['w_operations'] : '+, -, *, /';
1394
+ $param['w_input_size'] = $param['w_input_size'] ? $param['w_input_size'] : 60;
1395
+
1396
+ $rep ='<div id="wdform_field'.$id.'" type="type_arithmetic_captcha" 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></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_captcha" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><div style="display: table;"><div style="display: table-row;"><div style="display: table-cell;"><img type="captcha" operations_count="'.$param['w_count'].'" operations="'.$param['w_operations'].'" input_size="'.$param['w_input_size'].'" src="' . add_query_arg(array('action' => 'formmakerwdmathcaptcha', 'operations_count' => $param['w_count'], 'operations' => $param['w_operations'], 'i' => 'form_id_temp'), admin_url('admin-ajax.php')) . '" id="_wd_arithmetic_captchaform_id_temp" class="arithmetic_captcha_img" onclick="captcha_refresh(&quot;_wd_arithmetic_captcha&quot;,&quot;form_id_temp&quot;)" '.$param['attributes'].'></div><div style="display: table-cell;"><input type="text" class="arithmetic_captcha_input" id="_wd_arithmetic_captcha_inputform_id_temp" name="arithmetic_captcha_input" onkeypress="return check_isnum(event)" style="width: '.$param['w_input_size'].'px;" '.$param['attributes'].' disabled/></div><div style="display: table-cell; vertical-align: middle;"><div class="captcha_refresh" id="_element_refreshform_id_temp" onclick="captcha_refresh(&quot;_wd_arithmetic_captcha&quot;,&quot;form_id_temp&quot;)" '.$param['attributes'].'></div></div></div></div></div></div>';
1397
+
1398
+ break;
1399
+ }
1400
+
1401
+
1402
+ case 'type_recaptcha':
1403
+ {
1404
+ $params_names=array('w_field_label_size','w_field_label_pos','w_public','w_private','w_theme','w_class');
1405
+ $temp=$params;
1406
+ foreach($params_names as $params_name )
1407
+ {
1408
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1409
+ $param[$params_name] = $temp[0];
1410
+ $temp=$temp[1];
1411
+ }
1412
+
1413
+ if($temp)
1414
+ {
1415
+ $temp =explode('*:*w_attr_name*:*',$temp);
1416
+ $attrs = array_slice($temp,0, count($temp)-1);
1417
+ foreach($attrs as $attr)
1418
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1419
+ }
1420
+
1421
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1422
+
1423
+ $rep ='<div id="wdform_field'.$id.'" type="type_recaptcha" 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></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_recaptcha" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><div id="wd_recaptchaform_id_temp" public_key="'.$param['w_public'].'" private_key="'.$param['w_private'].'" theme="'.$param['w_theme'].'" '.$param['attributes'].'><span style="color: red; font-style: italic;">Recaptcha doesn\'t display in back end</span></div></div></div>';
1424
+
1425
+ break;
1426
+ }
1427
+
1428
+ case 'type_hidden':
1429
+ {
1430
+ $params_names=array('w_name','w_value');
1431
+ $temp=$params;
1432
+ foreach($params_names as $params_name )
1433
+ {
1434
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1435
+ $param[$params_name] = $temp[0];
1436
+ $temp=$temp[1];
1437
+ }
1438
+
1439
+ if($temp)
1440
+ {
1441
+ $temp =explode('*:*w_attr_name*:*',$temp);
1442
+ $attrs = array_slice($temp,0, count($temp)-1);
1443
+ foreach($attrs as $attr)
1444
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1445
+ }
1446
+ $param['w_name'] = str_replace('&nbsp;','',$param['w_name']);
1447
+ $rep ='<div id="wdform_field'.$id.'" type="type_hidden" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" style="display: table-cell;"><span id="'.$id.'_element_labelform_id_temp" style="display: none;">'.$param['w_name'].'</span><span style="color: red; font-size: 13px;">Hidden field</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" style="display: table-cell; padding-left:7px;"><input type="hidden" value="'.$param['w_value'].'" id="'.$id.'_elementform_id_temp" name="'.$param['w_name'].'" '.$param['attributes'].'><input type="hidden" value="type_hidden" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><div><span align="left">Name: </span><span align="left" id="'.$id.'_hidden_nameform_id_temp">'.$param['w_name'].'</span></div><div><span align="left">Value: </span><span align="left" id="'.$id.'_hidden_valueform_id_temp">'.$param['w_value'].'</span></div></div></div>';
1448
+
1449
+ break;
1450
+ }
1451
+ case 'type_mark_map':
1452
+ {
1453
+ $params_names=array('w_field_label_size','w_field_label_pos','w_center_x','w_center_y','w_long','w_lat','w_zoom','w_width','w_height','w_info','w_class');
1454
+ $temp=$params;
1455
+ foreach($params_names as $params_name )
1456
+ {
1457
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1458
+ $param[$params_name] = $temp[0];
1459
+ $temp=$temp[1];
1460
+ }
1461
+
1462
+ if($temp)
1463
+ {
1464
+ $temp =explode('*:*w_attr_name*:*',$temp);
1465
+ $attrs = array_slice($temp,0, count($temp)-1);
1466
+ foreach($attrs as $attr)
1467
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1468
+ }
1469
+
1470
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1471
+
1472
+ $rep ='<div id="wdform_field'.$id.'" type="type_mark_map" 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></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_mark_map" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><div id="'.$id.'_elementform_id_temp" long0="'.$param['w_long'].'" lat0="'.$param['w_lat'].'" zoom="'.$param['w_zoom'].'" info0="'.$param['w_info'].'" center_x="'.$param['w_center_x'].'" center_y="'.$param['w_center_y'].'" style="width: '.$param['w_width'].'px; height: '.$param['w_height'].'px;" '.$param['attributes'].'></div></div></div> ';
1473
+
1474
+ break;
1475
+ }
1476
+
1477
+ case 'type_map':
1478
+ {
1479
+ $params_names=array('w_center_x','w_center_y','w_long','w_lat','w_zoom','w_width','w_height','w_info','w_class');
1480
+ $temp=$params;
1481
+ foreach($params_names as $params_name )
1482
+ {
1483
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1484
+ $param[$params_name] = $temp[0];
1485
+ $temp=$temp[1];
1486
+ }
1487
+
1488
+ if($temp)
1489
+ {
1490
+ $temp =explode('*:*w_attr_name*:*',$temp);
1491
+ $attrs = array_slice($temp,0, count($temp)-1);
1492
+ foreach($attrs as $attr)
1493
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1494
+ }
1495
+
1496
+ $marker='';
1497
+
1498
+ $param['w_long'] = explode('***',$param['w_long']);
1499
+ $param['w_lat'] = explode('***',$param['w_lat']);
1500
+ $param['w_info'] = explode('***',$param['w_info']);
1501
+ foreach($param['w_long'] as $key => $w_long )
1502
+ {
1503
+ $marker.='long'.$key.'="'.$w_long.'" lat'.$key.'="'.$param['w_lat'][$key].'" info'.$key.'="'.$param['w_info'][$key].'"';
1504
+ }
1505
+
1506
+ $rep ='<div id="wdform_field'.$id.'" type="type_map" 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;">'.$label.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: table-cell;"><input type="hidden" value="type_map" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><div id="'.$id.'_elementform_id_temp" zoom="'.$param['w_zoom'].'" center_x="'.$param['w_center_x'].'" center_y="'.$param['w_center_y'].'" style="width: '.$param['w_width'].'px; height: '.$param['w_height'].'px;" '.$marker.' '.$param['attributes'].'></div></div></div>';
1507
+
1508
+ break;
1509
+ }
1510
+ case 'type_paypal_price':
1511
+ {
1512
+
1513
+ $params_names=array('w_field_label_size','w_field_label_pos','w_first_val','w_title', 'w_mini_labels','w_size','w_required','w_hide_cents','w_class','w_range_min','w_range_max');
1514
+ $temp=$params;
1515
+ foreach($params_names as $params_name )
1516
+ {
1517
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1518
+ $param[$params_name] = $temp[0];
1519
+ $temp=$temp[1];
1520
+ }
1521
+
1522
+ if($temp)
1523
+ {
1524
+ $temp =explode('*:*w_attr_name*:*',$temp);
1525
+ $attrs = array_slice($temp,0, count($temp)-1);
1526
+ foreach($attrs as $attr)
1527
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1528
+ }
1529
+
1530
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1531
+ $input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active");
1532
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1533
+ $hide_cents = ($param['w_hide_cents']=="yes" ? "none;" : "table-cell;");
1534
+
1535
+
1536
+ $w_first_val = explode('***',$param['w_first_val']);
1537
+ $w_title = explode('***',$param['w_title']);
1538
+ $w_mini_labels = explode('***',$param['w_mini_labels']);
1539
+
1540
+ $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" class="'.$input_active.'" id="'.$id.'_element_dollarsform_id_temp" name="'.$id.'_element_dollarsform_id_temp" value="'.$w_first_val[0].'" title="'.$w_title[0].'"onfocus="delete_value(&quot;'.$id.'_element_dollarsform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_element_dollarsform_id_temp&quot;)"onchange="change_value(&quot;'.$id.'_element_dollarsform_id_temp&quot;)" 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" class="'.$input_active.'" id="'.$id.'_element_centsform_id_temp" name="'.$id.'_element_centsform_id_temp" value="'.$w_first_val[1].'" title="'.$w_title[1].'"onfocus="delete_value(&quot;'.$id.'_element_centsform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_element_centsform_id_temp&quot;); add_0(&quot;'.$id.'_element_centsform_id_temp&quot;)"onchange="change_value(&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>';
1541
+ break;
1542
+ }
1543
+
1544
+ case 'type_paypal_select':
1545
+ {
1546
+ $params_names=array('w_field_label_size','w_field_label_pos','w_size','w_choices','w_choices_price','w_choices_checked', 'w_choices_disabled','w_required','w_quantity', 'w_quantity_value','w_class','w_property','w_property_values');
1547
+ $temp=$params;
1548
+ if(strpos($temp, 'w_choices_params') > -1)
1549
+ $params_names=array('w_field_label_size','w_field_label_pos','w_size','w_choices','w_choices_price','w_choices_checked', 'w_choices_disabled','w_required','w_quantity', 'w_quantity_value', 'w_choices_params', 'w_class', 'w_property', 'w_property_values');
1550
+ foreach($params_names as $params_name )
1551
+ {
1552
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1553
+ $param[$params_name] = $temp[0];
1554
+ $temp=$temp[1];
1555
+ }
1556
+
1557
+ if($temp)
1558
+ {
1559
+ $temp =explode('*:*w_attr_name*:*',$temp);
1560
+ $attrs = array_slice($temp,0, count($temp)-1);
1561
+ foreach($attrs as $attr)
1562
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1563
+ }
1564
+
1565
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1566
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1567
+ $param['w_choices'] = explode('***',$param['w_choices']);
1568
+
1569
+ $param['w_choices_price'] = explode('***',$param['w_choices_price']);
1570
+
1571
+ $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
1572
+
1573
+ $param['w_choices_disabled'] = explode('***',$param['w_choices_disabled']);
1574
+ $param['w_property'] = explode('***',$param['w_property']);
1575
+ $param['w_property_values'] = explode('***',$param['w_property_values']);
1576
+ if(isset($param['w_choices_params']))
1577
+ $param['w_choices_params'] = explode('***',$param['w_choices_params']);
1578
+ foreach($param['w_choices_checked'] as $key => $choices_checked )
1579
+ {
1580
+ if($choices_checked=='true')
1581
+ $param['w_choices_checked'][$key]='selected="selected"';
1582
+ else
1583
+ $param['w_choices_checked'][$key]='';
1584
+ }
1585
+
1586
+
1587
+ $rep='<div id="wdform_field'.$id.'" type="type_paypal_select" 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_select" 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"><select id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" onchange="set_select(this)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled>';
1588
+ foreach($param['w_choices'] as $key => $choice)
1589
+ {
1590
+ $where = '';
1591
+ $order_by = '';
1592
+ $db_info = '';
1593
+ $choice_value = $param['w_choices_disabled'][$key]=="true" ? '' : $param['w_choices_price'][$key];
1594
+
1595
+ if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
1596
+ {
1597
+ $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
1598
+ $where = "where='".$w_choices_params[0]."'";
1599
+ $w_choices_params = explode('[db_info]',$w_choices_params[1]);
1600
+ $order_by = "order_by='".$w_choices_params[0]."'";
1601
+ $db_info = "db_info='".$w_choices_params[1]."'";
1602
+ }
1603
+ $rep.='<option id="'.$id.'_option'.$key.'" value="'.$choice_value.'" onselect="set_select(&quot;'.$id.'_option'.$key.'&quot;)" '.$param['w_choices_checked'][$key].' '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</option>';
1604
+ }
1605
+ $rep.='</select><div id="'.$id.'_divform_id_temp">';
1606
+ if($param['w_quantity']=="yes")
1607
+ $rep.='<span id="'.$id.'_element_quantity_spanform_id_temp" style="margin-right: 15px;"><label class="mini_label" id="'.$id.'_element_quantity_label_form_id_temp" style="margin-right: 5px;"><!--repstart-->Quantity<!--repend--></label><input type="text" value="'.$param['w_quantity_value'].'" id="'.$id.'_element_quantityform_id_temp" name="'.$id.'_element_quantityform_id_temp" onkeypress="return check_isnum(event)" onchange="change_value(&quot;'.$id.'_element_quantityform_id_temp&quot;, this.value)" style="width: 30px; margin: 2px 0px;" disabled /></span>';
1608
+ if($param['w_property'][0])
1609
+ foreach($param['w_property'] as $key => $property)
1610
+ {
1611
+
1612
+ $rep.='
1613
+ <span id="'.$id.'_property_'.$key.'" style="margin-right: 15px;">
1614
+
1615
+ <label class="mini_label" id="'.$id.'_property_label_form_id_temp'.$key.'" style="margin-right: 5px;">'.$property.'</label>
1616
+ <select id="'.$id.'_propertyform_id_temp'.$key.'" name="'.$id.'_propertyform_id_temp'.$key.'" style="width: auto; margin: 2px 0px;" disabled>';
1617
+ $param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
1618
+ $param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
1619
+ foreach($param['w_property_values'][$key] as $subkey => $property_value)
1620
+ {
1621
+ $rep.='<option id="'.$id.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'">'.$property_value.'</option>';
1622
+ }
1623
+ $rep.='</select></span>';
1624
+ }
1625
+
1626
+ $rep.='</div></div></div>';
1627
+ break;
1628
+ }
1629
+
1630
+ case 'type_paypal_checkbox':
1631
+ {
1632
+
1633
+ $params_names=array('w_field_label_size','w_field_label_pos','w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num','w_class','w_property','w_property_values','w_quantity','w_quantity_value');
1634
+ $temp=$params;
1635
+ if(strpos($temp, 'w_field_option_pos') > -1)
1636
+ $params_names=array('w_field_label_size','w_field_label_pos', 'w_field_option_pos', 'w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num', 'w_choices_params', 'w_class','w_property','w_property_values','w_quantity','w_quantity_value');
1637
+ foreach($params_names as $params_name )
1638
+ {
1639
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1640
+ $param[$params_name] = $temp[0];
1641
+ $temp=$temp[1];
1642
+ }
1643
+
1644
+ if($temp)
1645
+ {
1646
+ $temp =explode('*:*w_attr_name*:*',$temp);
1647
+ $attrs = array_slice($temp,0, count($temp)-1);
1648
+ foreach($attrs as $attr)
1649
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1650
+ }
1651
+ if(!isset($param['w_field_option_pos']))
1652
+ $param['w_field_option_pos'] = 'left';
1653
+
1654
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1655
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1656
+ $param['w_choices'] = explode('***',$param['w_choices']);
1657
+ $param['w_choices_price'] = explode('***',$param['w_choices_price']);
1658
+ $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
1659
+ $param['w_property'] = explode('***',$param['w_property']);
1660
+ $param['w_property_values'] = explode('***',$param['w_property_values']);
1661
+
1662
+ if(isset($param['w_choices_params']))
1663
+ $param['w_choices_params'] = explode('***',$param['w_choices_params']);
1664
+
1665
+ foreach($param['w_choices_checked'] as $key => $choices_checked )
1666
+ {
1667
+ if($choices_checked=='true')
1668
+ $param['w_choices_checked'][$key]='checked="checked"';
1669
+ else
1670
+ $param['w_choices_checked'][$key]='';
1671
+ }
1672
+
1673
+ $rep='<div id="wdform_field'.$id.'" type="type_paypal_checkbox" 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="wd_form_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_checkbox" 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_randomize'].'" name="'.$id.'_randomizeform_id_temp" id="'.$id.'_randomizeform_id_temp"><input type="hidden" value="'.$param['w_allow_other'].'" name="'.$id.'_allow_otherform_id_temp" id="'.$id.'_allow_otherform_id_temp"><input type="hidden" value="'.$param['w_allow_other_num'].'" name="'.$id.'_allow_other_numform_id_temp" id="'.$id.'_allow_other_numform_id_temp"><input type="hidden" value="'.$param['w_field_option_pos'].'" id="'.$id.'_option_left_right"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;">';
1674
+
1675
+ if($param['w_flow']=='hor')
1676
+ {
1677
+ $rep.= '<div id="'.$id.'_hor" style="display: table-row;">';
1678
+ foreach($param['w_choices'] as $key => $choice)
1679
+ {
1680
+ $where ='';
1681
+ $order_by ='';
1682
+ $db_info = '';
1683
+ if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
1684
+ {
1685
+ $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
1686
+ $where = "where='".$w_choices_params[0]."'";
1687
+ $w_choices_params = explode('[db_info]',$w_choices_params[1]);
1688
+ $order_by = "order_by='".$w_choices_params[0]."'";
1689
+ $db_info = "db_info='".$w_choices_params[1]."'";
1690
+ }
1691
+
1692
+ $rep.='<div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="checkbox" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp'.$key.'" value="'.$param['w_choices_price'][$key].'" onclick="set_checked(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][$key].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'" '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</label></div>';
1693
+ }
1694
+ $rep.= '</div>';
1695
+ }
1696
+ else
1697
+ {
1698
+
1699
+ foreach($param['w_choices'] as $key => $choice)
1700
+ {
1701
+ $where ='';
1702
+ $order_by ='';
1703
+ $db_info ='';
1704
+ if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
1705
+ {
1706
+ $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
1707
+ $where = "where='".$w_choices_params[0]."'";
1708
+ $w_choices_params = explode('[db_info]',$w_choices_params[1]);
1709
+ $order_by = "order_by='".$w_choices_params[0]."'";
1710
+ $db_info = "db_info='".$w_choices_params[1]."'";
1711
+ }
1712
+
1713
+ $rep.='<div id="'.$id.'_element_tr'.$key.'" style="display: table-row;"><div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="checkbox" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp'.$key.'" value="'.$param['w_choices_price'][$key].'" onclick="set_checked(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][$key].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'" '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</label></div></div>';
1714
+ }
1715
+
1716
+ }
1717
+ $rep.='</div></div>';
1718
+
1719
+ $rep.='<div id="'.$id.'_divform_id_temp">';
1720
+ if($param['w_quantity']=="yes")
1721
+ $rep.='<span id="'.$id.'_element_quantity_spanform_id_temp" style="margin-right: 15px;"><label class="mini_label" id="'.$id.'_element_quantity_label_form_id_temp" style="margin-right: 5px;"><!--repstart-->Quantity<!--repend--></label><input type="text" value="'.$param['w_quantity_value'].'" id="'.$id.'_element_quantityform_id_temp" name="'.$id.'_element_quantityform_id_temp" onkeypress="return check_isnum(event)" onchange="change_value(&quot;'.$id.'_element_quantityform_id_temp&quot;, this.value)" style="width: 30px; margin: 2px 0px;" disabled/></span>';
1722
+ if($param['w_property'][0])
1723
+ foreach($param['w_property'] as $key => $property)
1724
+ {
1725
+ $rep.='
1726
+ <span id="'.$id.'_property_'.$key.'" style="margin-right: 15px;">
1727
+
1728
+ <label class="mini_label" id="'.$id.'_property_label_form_id_temp'.$key.'" style="margin-right: 5px;">'.$property.'</label>
1729
+ <select id="'.$id.'_propertyform_id_temp'.$key.'" name="'.$id.'_propertyform_id_temp'.$key.'" style="width: auto; margin: 2px 0px;" disabled>';
1730
+ $param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
1731
+ $param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
1732
+ foreach($param['w_property_values'][$key] as $subkey => $property_value)
1733
+ {
1734
+ $rep.='<option id="'.$id.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'">'.$property_value.'</option>';
1735
+ }
1736
+ $rep.='</select></span>';
1737
+ }
1738
+
1739
+ $rep.='</div></div></div>';
1740
+ break;
1741
+ }
1742
+ case 'type_paypal_radio':
1743
+ {
1744
+
1745
+ $params_names=array('w_field_label_size','w_field_label_pos','w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num','w_class','w_property','w_property_values','w_quantity','w_quantity_value');
1746
+ $temp=$params;
1747
+ if(strpos($temp, 'w_field_option_pos') > -1)
1748
+ $params_names=array('w_field_label_size','w_field_label_pos', 'w_field_option_pos', 'w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num', 'w_choices_params', 'w_class','w_property','w_property_values','w_quantity','w_quantity_value');
1749
+ foreach($params_names as $params_name )
1750
+ {
1751
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1752
+ $param[$params_name] = $temp[0];
1753
+ $temp=$temp[1];
1754
+ }
1755
+
1756
+ if($temp)
1757
+ {
1758
+ $temp =explode('*:*w_attr_name*:*',$temp);
1759
+ $attrs = array_slice($temp,0, count($temp)-1);
1760
+ foreach($attrs as $attr)
1761
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1762
+ }
1763
+ if(!isset($param['w_field_option_pos']))
1764
+ $param['w_field_option_pos'] = 'left';
1765
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1766
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1767
+ $param['w_choices'] = explode('***',$param['w_choices']);
1768
+
1769
+ $param['w_choices_price'] = explode('***',$param['w_choices_price']);
1770
+
1771
+ $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
1772
+
1773
+ $param['w_property'] = explode('***',$param['w_property']);
1774
+ $param['w_property_values'] = explode('***',$param['w_property_values']);
1775
+
1776
+ if(isset($param['w_choices_params']))
1777
+ $param['w_choices_params'] = explode('***',$param['w_choices_params']);
1778
+
1779
+ foreach($param['w_choices_checked'] as $key => $choices_checked )
1780
+ {
1781
+ if($choices_checked=='true')
1782
+ $param['w_choices_checked'][$key]='checked="checked"';
1783
+ else
1784
+ $param['w_choices_checked'][$key]='';
1785
+ }
1786
+
1787
+ $rep='<div id="wdform_field'.$id.'" type="type_paypal_radio" 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="wd_form_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_radio" 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_randomize'].'" name="'.$id.'_randomizeform_id_temp" id="'.$id.'_randomizeform_id_temp"><input type="hidden" value="'.$param['w_allow_other'].'" name="'.$id.'_allow_otherform_id_temp" id="'.$id.'_allow_otherform_id_temp"><input type="hidden" value="'.$param['w_allow_other_num'].'" name="'.$id.'_allow_other_numform_id_temp" id="'.$id.'_allow_other_numform_id_temp"><input type="hidden" value="'.$param['w_field_option_pos'].'" id="'.$id.'_option_left_right"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;">';
1788
+
1789
+ if($param['w_flow']=='hor')
1790
+ {
1791
+ $rep.= '<div id="'.$id.'_hor" style="display: table-row;">';
1792
+ foreach($param['w_choices'] as $key => $choice)
1793
+ {
1794
+ $where ='';
1795
+ $order_by ='';
1796
+ $db_info ='';
1797
+ if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
1798
+ {
1799
+ $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
1800
+ $where = "where='".$w_choices_params[0]."'";
1801
+ $w_choices_params = explode('[db_info]',$w_choices_params[1]);
1802
+ $order_by = "order_by='".$w_choices_params[0]."'";
1803
+ $db_info = "db_info='".$w_choices_params[1]."'";
1804
+ }
1805
+
1806
+ $rep.='<div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="radio" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp" value="'.$param['w_choices_price'][$key].'" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][$key].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'" '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</label></div>';
1807
+ }
1808
+ $rep.= '</div>';
1809
+ }
1810
+ else
1811
+ {
1812
+
1813
+ foreach($param['w_choices'] as $key => $choice)
1814
+ {
1815
+
1816
+ $where ='';
1817
+ $order_by ='';
1818
+ $db_info ='';
1819
+ if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
1820
+ {
1821
+ $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
1822
+ $where = "where='".$w_choices_params[0]."'";
1823
+ $w_choices_params = explode('[db_info]',$w_choices_params[1]);
1824
+ $order_by = "order_by='".$w_choices_params[0]."'";
1825
+ $db_info = "db_info='".$w_choices_params[1]."'";
1826
+ }
1827
+
1828
+ $rep.='<div id="'.$id.'_element_tr'.$key.'" style="display: table-row;"><div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="radio" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp" value="'.$param['w_choices_price'][$key].'" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][$key].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'" '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</label></div></div>';
1829
+ }
1830
+
1831
+ }
1832
+ $rep.='</div></div>';
1833
+
1834
+ $rep.='<div id="'.$id.'_divform_id_temp">';
1835
+ if($param['w_quantity']=="yes")
1836
+ $rep.='<span id="'.$id.'_element_quantity_spanform_id_temp" style="margin-right: 15px;"><label class="mini_label" id="'.$id.'_element_quantity_label_form_id_temp" style="margin-right: 5px;"><!--repstart-->Quantity<!--repend--></label><input type="text" value="'.$param['w_quantity_value'].'" id="'.$id.'_element_quantityform_id_temp" name="'.$id.'_element_quantityform_id_temp" onkeypress="return check_isnum(event)" onchange="change_value(&quot;'.$id.'_element_quantityform_id_temp&quot;, this.value)" style="width: 30px; margin: 2px 0px;" disabled/></span>';
1837
+ if($param['w_property'][0])
1838
+ foreach($param['w_property'] as $key => $property)
1839
+ {
1840
+ $rep.='
1841
+ <span id="'.$id.'_property_'.$key.'" style="margin-right: 15px;">
1842
+
1843
+ <label class="mini_label" id="'.$id.'_property_label_form_id_temp'.$key.'" style="margin-right: 5px;">'.$property.'</label>
1844
+ <select id="'.$id.'_propertyform_id_temp'.$key.'" name="'.$id.'_propertyform_id_temp'.$key.'" style="width: auto; margin: 2px 0px;" disabled>';
1845
+ $param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
1846
+ $param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
1847
+ foreach($param['w_property_values'][$key] as $subkey => $property_value)
1848
+ {
1849
+ $rep.='<option id="'.$id.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'">'.$property_value.'</option>';
1850
+ }
1851
+ $rep.='</select></span>';
1852
+ }
1853
+
1854
+ $rep.='</div></div></div>';
1855
+
1856
+ break;
1857
+ }
1858
+ case 'type_paypal_shipping':
1859
+ {
1860
+
1861
+ $params_names=array('w_field_label_size','w_field_label_pos', 'w_field_option_pos', 'w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num','w_class');
1862
+ $temp=$params;
1863
+ if(strpos($temp, 'w_field_option_pos') > -1)
1864
+ $params_names=array('w_field_label_size','w_field_label_pos', 'w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num','w_choices_params','w_class');
1865
+ foreach($params_names as $params_name )
1866
+ {
1867
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1868
+ $param[$params_name] = $temp[0];
1869
+ $temp=$temp[1];
1870
+ }
1871
+
1872
+ if($temp)
1873
+ {
1874
+ $temp =explode('*:*w_attr_name*:*',$temp);
1875
+ $attrs = array_slice($temp,0, count($temp)-1);
1876
+ foreach($attrs as $attr)
1877
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1878
+ }
1879
+ if(!isset($param['w_field_option_pos']))
1880
+ $param['w_field_option_pos'] = 'left';
1881
+
1882
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1883
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1884
+ $param['w_choices'] = explode('***',$param['w_choices']);
1885
+
1886
+ $param['w_choices_price'] = explode('***',$param['w_choices_price']);
1887
+
1888
+ $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
1889
+
1890
+ if(isset($param['w_choices_params']))
1891
+ $param['w_choices_params'] = explode('***',$param['w_choices_params']);
1892
+
1893
+ foreach($param['w_choices_checked'] as $key => $choices_checked )
1894
+ {
1895
+ if($choices_checked=='true')
1896
+ $param['w_choices_checked'][$key]='checked="checked"';
1897
+ else
1898
+ $param['w_choices_checked'][$key]='';
1899
+ }
1900
+
1901
+ $rep='<div id="wdform_field'.$id.'" type="type_paypal_shipping" 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="wd_form_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'].'; vertical-align:top;"><input type="hidden" value="type_paypal_shipping" 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_randomize'].'" name="'.$id.'_randomizeform_id_temp" id="'.$id.'_randomizeform_id_temp"><input type="hidden" value="'.$param['w_allow_other'].'" name="'.$id.'_allow_otherform_id_temp" id="'.$id.'_allow_otherform_id_temp"><input type="hidden" value="'.$param['w_allow_other_num'].'" name="'.$id.'_allow_other_numform_id_temp" id="'.$id.'_allow_other_numform_id_temp"><input type="hidden" value="'.$param['w_field_option_pos'].'" id="'.$id.'_option_left_right"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;">';
1902
+
1903
+ if($param['w_flow']=='hor')
1904
+ {
1905
+ $rep.= '<div id="'.$id.'_hor" style="display: table-row;">';
1906
+ foreach($param['w_choices'] as $key => $choice)
1907
+ {
1908
+ $where ='';
1909
+ $order_by ='';
1910
+ $db_info ='';
1911
+ if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
1912
+ {
1913
+ $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
1914
+ $where = "where='".$w_choices_params[0]."'";
1915
+ $w_choices_params = explode('[db_info]',$w_choices_params[1]);
1916
+ $order_by = "order_by='".$w_choices_params[0]."'";
1917
+ $db_info = "db_info='".$w_choices_params[1]."'";
1918
+ }
1919
+
1920
+ $rep.='<div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="radio" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp" value="'.$param['w_choices_price'][$key].'" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][$key].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'" '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</label></div>';
1921
+ }
1922
+ $rep.= '</div>';
1923
+ }
1924
+ else
1925
+ {
1926
+
1927
+ foreach($param['w_choices'] as $key => $choice)
1928
+ {
1929
+ $where ='';
1930
+ $order_by ='';
1931
+ $db_info ='';
1932
+ if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
1933
+ {
1934
+ $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
1935
+ $where = "where='".$w_choices_params[0]."'";
1936
+ $w_choices_params = explode('[db_info]',$w_choices_params[1]);
1937
+ $order_by = "order_by='".$w_choices_params[0]."'";
1938
+ $db_info = "db_info='".$w_choices_params[1]."'";
1939
+ }
1940
+
1941
+ $rep.='<div id="'.$id.'_element_tr'.$key.'" style="display: table-row;"><div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="radio" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp" value="'.$param['w_choices_price'][$key].'" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][$key].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'" '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</label></div></div>';
1942
+ }
1943
+
1944
+ }
1945
+ $rep.='</div></div>';
1946
+
1947
+ $rep.='</div></div>';
1948
+
1949
+ break;
1950
+ }
1951
+ case 'type_paypal_total':
1952
+ {
1953
+ $params_names=array('w_field_label_size','w_field_label_pos','w_class');
1954
+ $temp=$params;
1955
+ foreach($params_names as $params_name )
1956
+ {
1957
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1958
+ $param[$params_name] = $temp[0];
1959
+ $temp=$temp[1];
1960
+ }
1961
+
1962
+ if($temp)
1963
+ {
1964
+ $temp =explode('*:*w_attr_name*:*',$temp);
1965
+ $attrs = array_slice($temp,0, count($temp)-1);
1966
+ foreach($attrs as $attr)
1967
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1968
+ }
1969
+
1970
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1971
+
1972
+
1973
+
1974
+ $rep='<div id="wdform_field'.$id.'" type="type_paypal_total" 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">'.$label.'</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_total" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><div id="'.$id.'paypal_totalform_id_temp" class="wdform_paypal_total paypal_totalform_id_temp"><input type="hidden" value="" name="'.$id.'_paypal_totalform_id_temp" class="input_paypal_totalform_id_temp"><div id="'.$id.'div_totalform_id_temp" class="div_totalform_id_temp" style="margin-bottom: 10px;"><!--repstart-->$300<!--repend--></div><div id="'.$id.'paypal_productsform_id_temp" class="paypal_productsform_id_temp" style="border-spacing: 2px;"><div style="border-spacing: 2px;"><!--repstart-->product 1 $100<!--repend--></div><div style="border-spacing: 2px;"><!--repstart-->product 2 $200<!--repend--></div></div><div id="'.$id.'paypal_taxform_id_temp" class="paypal_taxform_id_temp" style="border-spacing: 2px; margin-top: 7px;"></div></div></div></div>';
1975
+
1976
+
1977
+ break;
1978
+ }
1979
+
1980
+ case 'type_star_rating':
1981
+ {
1982
+ $params_names=array('w_field_label_size','w_field_label_pos','w_field_label_col','w_star_amount','w_required','w_class');
1983
+ $temp=$params;
1984
+ foreach($params_names as $params_name )
1985
+ {
1986
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1987
+ $param[$params_name] = $temp[0];
1988
+ $temp=$temp[1];
1989
+ }
1990
+
1991
+ if($temp)
1992
+ {
1993
+ $temp =explode('*:*w_attr_name*:*',$temp);
1994
+ $attrs = array_slice($temp,0, count($temp)-1);
1995
+ foreach($attrs as $attr)
1996
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1997
+ }
1998
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1999
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
2000
+
2001
+
2002
+ $images = '';
2003
+ for($i=0; $i<$param['w_star_amount']; $i++)
2004
+ {
2005
+ $images .= '<img id="'.$id.'_star_'.$i.'" src="' . WD_FM_URL . '/images/star.png?ver='. get_option("wd_form_maker_version").'" onmouseover="change_src('.$i.','.$id.',&quot;form_id_temp&quot;)" onmouseout="reset_src('.$i.','.$id.')" onclick="select_star_rating('.$i.','.$id.', &quot;form_id_temp&quot;)">';
2006
+ }
2007
+
2008
+ $rep ='<div id="wdform_field'.$id.'" type="type_star_rating" 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">'.$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_star_rating" 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_star_amount'].'" id="'.$id.'_star_amountform_id_temp" name="'.$id.'_star_amountform_id_temp"><input type="hidden" value="'.$param['w_field_label_col'].'" name="'.$id.'_star_colorform_id_temp" id="'.$id.'_star_colorform_id_temp"><div id="'.$id.'_elementform_id_temp" class="wdform_stars" '.$param['attributes'].'>'.$images.'</div></div></div>';
2009
+
2010
+
2011
+ break;
2012
+ }
2013
+ case 'type_scale_rating':
2014
+ {
2015
+ $params_names=array('w_field_label_size','w_field_label_pos','w_mini_labels','w_scale_amount','w_required','w_class');
2016
+ $temp=$params;
2017
+ foreach($params_names as $params_name )
2018
+ {
2019
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
2020
+ $param[$params_name] = $temp[0];
2021
+ $temp=$temp[1];
2022
+ }
2023
+
2024
+ if($temp)
2025
+ {
2026
+ $temp =explode('*:*w_attr_name*:*',$temp);
2027
+ $attrs = array_slice($temp,0, count($temp)-1);
2028
+ foreach($attrs as $attr)
2029
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
2030
+ }
2031
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
2032
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
2033
+
2034
+ $w_mini_labels = explode('***',$param['w_mini_labels']);
2035
+
2036
+ $numbers = '';
2037
+ for($i=1; $i<=$param['w_scale_amount']; $i++)
2038
+ {
2039
+ $numbers .= '<div id="'.$id.'_scale_td1_'.$i.'form_id_temp" style="text-align: center; display: table-cell;"><span>'.$i.'</span></div>';
2040
+ }
2041
+
2042
+
2043
+ $radio_buttons = '';
2044
+ for($k=1; $k<=$param['w_scale_amount']; $k++)
2045
+ {
2046
+ $radio_buttons .= '<div id="'.$id.'_scale_td2_'.$k.'form_id_temp" style="display: table-cell;"><input id="'.$id.'_scale_radioform_id_temp_'.$k.'" name="'.$id.'_scale_radioform_id_temp" value="'.$k.'" type="radio"></div>';
2047
+ }
2048
+
2049
+ $rep ='<div id="wdform_field'.$id.'" type="type_scale_rating" 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'].'; vertical-align: top; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label">'.$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_scale_rating" 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_scale_amount'].'" id="'.$id.'_scale_amountform_id_temp" name="'.$id.'_scale_amountform_id_temp"><div id="'.$id.'_elementform_id_temp" style="float: left;" '.$param['attributes'].'><label class="mini_label" id="'.$id.'_mini_label_worst" style="position: relative; top: 6px; font-size: 11px; display: inline-table;">'.$w_mini_labels[0].'</label><div id="'.$id.'_scale_tableform_id_temp" style="display: inline-table;"><div id="'.$id.'_scale_tr1form_id_temp" style="display: table-row;">'.$numbers.'</div><div id="'.$id.'_scale_tr2form_id_temp" style="display: table-row;">'.$radio_buttons.'</div></div><label class="mini_label" id="'.$id.'_mini_label_best" style="position: relative; top: 6px; font-size: 11px; display: inline-table;">'.$w_mini_labels[1].'</label></div></div></div>';
2050
+
2051
+ break;
2052
+ }
2053
+ case 'type_spinner':
2054
+ {
2055
+ $params_names=array('w_field_label_size','w_field_label_pos','w_field_width','w_field_min_value','w_field_max_value', 'w_field_step', 'w_field_value', 'w_required','w_class');
2056
+ $temp=$params;
2057
+ foreach($params_names as $params_name ) {
2058
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
2059
+ $param[$params_name] = $temp[0];
2060
+ $temp=$temp[1];
2061
+ }
2062
+ if($temp) {
2063
+ $temp =explode('*:*w_attr_name*:*',$temp);
2064
+ $attrs = array_slice($temp,0, count($temp)-1);
2065
+ foreach($attrs as $attr)
2066
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
2067
+ }
2068
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
2069
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
2070
+ $rep ='<div id="wdform_field'.$id.'" type="type_spinner" 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">'.$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_spinner" 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_field_width'].'" name="'.$id.'_spinner_widthform_id_temp" id="'.$id.'_spinner_widthform_id_temp"><input type="hidden" value="'.$param['w_field_min_value'].'" id="'.$id.'_min_valueform_id_temp" name="'.$id.'_min_valueform_id_temp"><input type="hidden" value="'.$param['w_field_max_value'].'" name="'.$id.'_max_valueform_id_temp" id="'.$id.'_max_valueform_id_temp"><input type="hidden" value="'.$param['w_field_step'].'" name="'.$id.'_stepform_id_temp" id="'.$id.'_stepform_id_temp"><input type="" value="'.($param['w_field_value']!= 'null' ? $param['w_field_value'] : '').'" name="'.$id.'_elementform_id_temp" id="'.$id.'_elementform_id_temp" onkeypress="return check_isnum_or_minus(event)" style="width: '.$param['w_field_width'].'px;" '.$param['attributes'].' disabled/></div></div>';
2071
+ break;
2072
+ }
2073
+ case 'type_slider': {
2074
+ $params_names=array('w_field_label_size','w_field_label_pos','w_field_width','w_field_min_value','w_field_max_value', 'w_field_value', 'w_required','w_class');
2075
+ $temp=$params;
2076
+ foreach($params_names as $params_name ) {
2077
+ $temp = explode('*:*'.$params_name.'*:*',$temp);
2078
+ $param[$params_name] = $temp[0];
2079
+ $temp=$temp[1];
2080
+ }
2081
+ if ($temp) {
2082
+ $temp = explode('*:*w_attr_name*:*', $temp);
2083
+ $attrs = array_slice($temp,0, count($temp)-1);
2084
+ foreach($attrs as $attr) {
2085
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
2086
+ }
2087
+ }
2088
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
2089
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
2090
+ $rep ='<div id="wdform_field'.$id.'" type="type_slider" 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'].'; vertical-align: top; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label">'.$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_slider" 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_field_width'].'" name="'.$id.'_slider_widthform_id_temp" id="'.$id.'_slider_widthform_id_temp"><input type="hidden" value="'.$param['w_field_min_value'].'" id="'.$id.'_slider_min_valueform_id_temp" name="'.$id.'_slider_min_valueform_id_temp"><input type="hidden" value="'.$param['w_field_max_value'].'" id="'.$id.'_slider_max_valueform_id_temp" name="'.$id.'_slider_max_valueform_id_temp"><input type="hidden" value="'.$param['w_field_value'].'" id="'.$id.'_slider_valueform_id_temp" name="'.$id.'_slider_valueform_id_temp"><div id="'.$id.'_slider_tableform_id_temp"><div><div id="'.$id.'_slider_td1form_id_temp"><div name="'.$id.'_elementform_id_temp" id="'.$id.'_elementform_id_temp" style="width: '.$param['w_field_width'].'px;" '.$param['attributes'].'"></div></div></div><div><div align="left" id="'.$id.'_slider_td2form_id_temp" style="display: inline-table; width: 33.3%; text-align: left;"><span id="'.$id.'_element_minform_id_temp" class="label">'.$param['w_field_min_value'].'</span></div><div align="right" id="'.$id.'_slider_td3form_id_temp" style="display: inline-table; width: 33.3%; text-align: center;"><span id="'.$id.'_element_valueform_id_temp" class="label">'.$param['w_field_value'].'</span></div><div align="right" id="'.$id.'_slider_td4form_id_temp" style="display: inline-table; width: 33.3%; text-align: right;"><span id="'.$id.'_element_maxform_id_temp" class="label">'.$param['w_field_max_value'].'</span></div></div></div></div></div>';
2091
+ break;
2092
+ }
2093
+ case 'type_range': {
2094
+ $params_names = array('w_field_label_size','w_field_label_pos','w_field_range_width','w_field_range_step','w_field_value1', 'w_field_value2', 'w_mini_labels', 'w_required','w_class');
2095
+ $temp = $params;
2096
+ foreach ($params_names as $params_name ) {
2097
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
2098
+ $param[$params_name] = $temp[0];
2099
+ $temp = $temp[1];
2100
+ }
2101
+ if ($temp) {
2102
+ $temp = explode('*:*w_attr_name*:*', $temp);
2103
+ $attrs = array_slice($temp, 0, count($temp) - 1);
2104
+ foreach($attrs as $attr) {
2105
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
2106
+ }
2107
+ }
2108
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
2109
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
2110
+ $w_mini_labels = explode('***',$param['w_mini_labels']);
2111
+ $rep ='<div id="wdform_field'.$id.'" type="type_range" 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">'.$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_range" 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_field_range_width'].'" name="'.$id.'_range_widthform_id_temp" id="'.$id.'_range_widthform_id_temp"><input type="hidden" value="'.$param['w_field_range_step'].'" name="'.$id.'_range_stepform_id_temp" id="'.$id.'_range_stepform_id_temp"><div id="'.$id.'_elemet_table_littleform_id_temp" style="display: table;"><div style="display: table-row;"><div valign="middle" align="left" style="display: table-cell;"><input type="" value="'.($param['w_field_value1']!= 'null' ? $param['w_field_value1'] : '').'" name="'.$id.'_elementform_id_temp0" id="'.$id.'_elementform_id_temp0" onkeypress="return check_isnum_or_minus(event)" style="width: '.$param['w_field_range_width'].'px;" '.$param['attributes'].' disabled/></div><div valign="middle" align="left" style="display: table-cell; padding-left: 4px;"><input type="" value="'.($param['w_field_value2']!= 'null' ? $param['w_field_value2'] : '').'" name="'.$id.'_elementform_id_temp1" id="'.$id.'_elementform_id_temp1" onkeypress="return check_isnum_or_minus(event)" style="width: '.$param['w_field_range_width'].'px;" '.$param['attributes'].' disabled/></div></div><div style="display: table-row;"><div valign="top" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_from">'.$w_mini_labels[0].'</label></div><div valign="top" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_to">'.$w_mini_labels[1].'</label></div></div></div></div></div>';
2112
+ break;
2113
+ }
2114
+ case 'type_grading': {
2115
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_items', 'w_total', 'w_required', 'w_class');
2116
+ $temp = $params;
2117
+ foreach($params_names as $params_name) {
2118
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
2119
+ $param[$params_name] = $temp[0];
2120
+ $temp = $temp[1];
2121
+ }
2122
+ if ($temp) {
2123
+ $temp = explode('*:*w_attr_name*:*', $temp);
2124
+ $attrs = array_slice($temp, 0, count($temp) - 1);
2125
+ foreach ($attrs as $attr) {
2126
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
2127
+ }
2128
+ }
2129
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
2130
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
2131
+ $w_items = explode('***', $param['w_items']);
2132
+ $grading_items = '';
2133
+ for($i=0; $i<count($w_items); $i++)
2134
+ {
2135
+ $grading_items .= '<div id="'.$id.'_element_div'.$i.'" class="grading"><input id="'.$id.'_elementform_id_temp_'.$i.'" name="'.$id.'_elementform_id_temp_'.$i.'" onkeypress="return check_isnum_or_minus(event)" value="" size="5" onkeyup="sum_grading_values('.$id.',&quot;form_id_temp&quot;)" onchange="sum_grading_values('.$id.',&quot;form_id_temp&quot;)" '.$param['attributes'].' disabled/><label id="'.$id.'_label_elementform_id_temp'.$i.'" class="ch-rad-label">'.$w_items[$i].'</label></div>';
2136
+ }
2137
+
2138
+ $rep ='<div id="wdform_field'.$id.'" type="type_grading" 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'].'; vertical-align: top; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label">'.$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_grading" 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_total'].'" name="'.$id.'_grading_totalform_id_temp" id="'.$id.'_grading_totalform_id_temp"><div id="'.$id.'_elementform_id_temp">'.$grading_items.'<div id="'.$id.'_element_total_divform_id_temp" class="grading_div">Total:<span id="'.$id.'_sum_elementform_id_temp" name="'.$id.'_sum_elementform_id_temp">0</span>/<span id="'.$id.'_total_elementform_id_temp" name="'.$id.'_total_elementform_id_temp">'.$param['w_total'].'</span><span id="'.$id.'_text_elementform_id_temp" name="'.$id.'_text_elementform_id_temp"></span></div></div></div></div>';
2139
+
2140
+ break;
2141
+ }
2142
+ case 'type_matrix': {
2143
+ $params_names=array('w_field_label_size','w_field_label_pos', 'w_field_input_type', 'w_rows', 'w_columns', 'w_required','w_class','w_textbox_size');
2144
+ $temp = $params;
2145
+ foreach ($params_names as $params_name) {
2146
+ $temp = explode('*:*'.$params_name.'*:*',$temp);
2147
+ $param[$params_name] = $temp[0];
2148
+ $temp = $temp[1];
2149
+ }
2150
+ if ($temp) {
2151
+ $temp = explode('*:*w_attr_name*:*', $temp);
2152
+ $attrs = array_slice($temp, 0, count($temp) - 1);
2153
+ foreach ($attrs as $attr) {
2154
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
2155
+ }
2156
+ }
2157
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
2158
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
2159
+ $param['w_textbox_size'] = isset($param['w_textbox_size']) ? $param['w_textbox_size'] : '100';
2160
+ $w_rows = explode('***',$param['w_rows']);
2161
+ $w_columns = explode('***',$param['w_columns']);
2162
+ $column_labels = '';
2163
+ for ($i = 1; $i < count($w_columns); $i++) {
2164
+ $column_labels .= '<div id="'.$id.'_element_td0_'.$i.'" class="matrix_" style="display: table-cell;"><label id="'.$id.'_label_elementform_id_temp0_'.$i.'" name="'.$id.'_label_elementform_id_temp0_'.$i.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$i.'" value="'.$w_columns[$i].'">'.$w_columns[$i].'</label></div>';
2165
+ }
2166
+ $rows_columns = '';
2167
+ for($i=1; $i<count($w_rows); $i++)
2168
+ {
2169
+
2170
+ $rows_columns .= '<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;"><div id="'.$id.'_element_td'.$i.'_0" class="matrix_" style="display: table-cell;"><label id="'.$id.'_label_elementform_id_temp'.$i.'_0" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$i.'" value="'.$w_rows[$i].'">'.$w_rows[$i].'</label></div>';
2171
+
2172
+
2173
+ for($k=1; $k<count($w_columns); $k++)
2174
+ {
2175
+ if($param['w_field_input_type']=='radio')
2176
+ $rows_columns .= '<div id="'.$id.'_element_td'.$i.'_'.$k.'" style="text-align: center; display: table-cell; padding: 5px 0 0 5px;"><input id="'.$id.'_input_elementform_id_temp'.$i.'_'.$k.'" align="center" size="14" type="radio" name="'.$id.'_input_elementform_id_temp'.$i.'" value="'.$i.'_'.$k.'" disabled/></div>';
2177
+ else
2178
+ if($param['w_field_input_type']=='checkbox')
2179
+ $rows_columns .= '<div id="'.$id.'_element_td'.$i.'_'.$k.'" style="text-align: center; display: table-cell; padding: 5px 0 0 5px;"><input id="'.$id.'_input_elementform_id_temp'.$i.'_'.$k.'" align="center" size="14" type="checkbox" name="'.$id.'_input_elementform_id_temp'.$i.'_'.$k.'" value="1" disabled/></div>';
2180
+ else
2181
+ if($param['w_field_input_type']=='text')
2182
+ $rows_columns .= '<div id="'.$id.'_element_td'.$i.'_'.$k.'" style="text-align: center; display: table-cell; padding: 5px 0 0 5px;"><input id="'.$id.'_input_elementform_id_temp'.$i.'_'.$k.'" align="center" type="text" name="'.$id.'_input_elementform_id_temp'.$i.'_'.$k.'" value="" style="width:'.$param['w_textbox_size'].'px" disabled/></div>';
2183
+ else
2184
+ if($param['w_field_input_type']=='select')
2185
+ $rows_columns .= '<div id="'.$id.'_element_td'.$i.'_'.$k.'" style="text-align: center; display: table-cell; padding: 5px 0 0 5px;"><select id="'.$id.'_select_yes_noform_id_temp'.$i.'_'.$k.'" name="'.$id.'_select_yes_noform_id_temp'.$i.'_'.$k.'" disabled><option value=""> </option><option value="yes">Yes</option><option value="no">No</option></select></div>';
2186
+
2187
+ }
2188
+
2189
+ $rows_columns .= '</div>';
2190
+ }
2191
+
2192
+
2193
+
2194
+ $rep ='<div id="wdform_field'.$id.'" type="type_matrix" 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">'.$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_matrix" 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_field_input_type'].'" name="'.$id.'_input_typeform_id_temp" id="'.$id.'_input_typeform_id_temp"><input type="hidden" value="'.$param['w_textbox_size'].'" name="'.$id.'_textbox_sizeform_id_temp" id="'.$id.'_textbox_sizeform_id_temp"><div id="'.$id.'_elementform_id_temp" style="display: table;" '.$param['attributes'].'><div id="'.$id.'_table_little" style="display: table-row-group;"><div id="'.$id.'_element_tr0" style="display: table-row;"><div id="'.$id.'_element_td0_0" style="display: table-cell;"></div>'.$column_labels.'</div>'.$rows_columns.'</div></div></div></div>';
2195
+
2196
+ break;
2197
+ }
2198
+ case 'type_submit_reset': {
2199
+ $params_names=array('w_submit_title','w_reset_title','w_class','w_act');
2200
+ $temp=$params;
2201
+ foreach ($params_names as $params_name) {
2202
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
2203
+ $param[$params_name] = $temp[0];
2204
+ $temp=$temp[1];
2205
+ }
2206
+ if ($temp) {
2207
+ $temp = explode('*:*w_attr_name*:*',$temp);
2208
+ $attrs = array_slice($temp,0, count($temp)-1);
2209
+ foreach ($attrs as $attr) {
2210
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
2211
+ }
2212
+ }
2213
+ $param['w_act'] = ($param['w_act']=="false" ? 'style="display: none;"' : "");
2214
+ $rep='<div id="wdform_field'.$id.'" type="type_submit_reset" 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;">type_submit_reset_'.$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_submit_reset" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><button type="button" class="button-submit" id="'.$id.'_element_submitform_id_temp" value="'.$param['w_submit_title'].'" onclick="check_required(&quot;submit&quot;, &quot;form_id_temp&quot;);" '.$param['attributes'].'>'.$param['w_submit_title'].'</button><button type="button" class="button-reset" id="'.$id.'_element_resetform_id_temp" value="'.$param['w_reset_title'].'" onclick="check_required(&quot;reset&quot;);" '.$param['w_act'].' '.$param['attributes'].'>'.$param['w_reset_title'].'</button></div></div>';
2215
+ break;
2216
+ }
2217
+ case 'type_button': {
2218
+ $params_names=array('w_title','w_func','w_class');
2219
+ $temp=$params;
2220
+ foreach($params_names as $params_name) {
2221
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
2222
+ $param[$params_name] = $temp[0];
2223
+ $temp=$temp[1];
2224
+ }
2225
+ if ($temp) {
2226
+ $temp = explode('*:*w_attr_name*:*',$temp);
2227
+ $attrs = array_slice($temp,0, count($temp)-1);
2228
+ foreach($attrs as $attr) {
2229
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
2230
+ }
2231
+ }
2232
+ $param['w_title'] = explode('***',$param['w_title']);
2233
+ $param['w_func'] = explode('***',$param['w_func']);
2234
+ $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">';
2235
+ foreach ($param['w_title'] as $key => $title) {
2236
+ $rep.='<button type="button" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp'.$key.'" value="'.$title.'" onclick="'.$param['w_func'][$key].'" '.$param['attributes'].'>'.$title.'</button>';
2237
+ }
2238
+ $rep .= '</div></div>';
2239
+ break;
2240
+ }
2241
+ }
2242
+
2243
+ $form = str_replace('%' . $id . ' - ' . $labels[$ids_key] . '%', $rep, $form);
2244
+ $form = str_replace('%' . $id . ' -' . $labels[$ids_key] . '%', $rep, $form);
2245
+ $row->form_front = $form;
2246
+ }
2247
+ }
2248
+ }
2249
+ else {
2250
+ $row = new stdClass();
2251
+ $row->id = 0;
2252
+ $row->backup_id ='';
2253
+ $row->title = '';
2254
+ $row->mail = '';
2255
+ $row->form = '';
2256
+ $row->form_front = '';
2257
+ $row->theme = $wpdb->get_var("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE `default`='1'");
2258
+ $row->javascript = '';
2259
+ $row->submit_text = '';
2260
+ $row->url = '';
2261
+ $row->submit_text_type = 0;
2262
+ $row->script1 = '';
2263
+ $row->script2 = '';
2264
+ $row->script_user1 = '';
2265
+ $row->script_user2 = '';
2266
+ $row->counter = 0;
2267
+ $row->label_order = '';
2268
+ $row->article_id = '';
2269
+ $row->pagination = '';
2270
+ $row->show_title = '';
2271
+ $row->show_numbers = '';
2272
+ $row->public_key = '';
2273
+ $row->private_key = '';
2274
+ $row->recaptcha_theme = '';
2275
+ $row->from_name = '';
2276
+ $row->from_mail = '';
2277
+ $row->label_order_current = '';
2278
+ $row->script_mail_user = '';
2279
+ $row->script_mail = '';
2280
+ $row->tax = 0;
2281
+ $row->payment_currency = '$';
2282
+ $row->paypal_email = '';
2283
+ $row->checkout_mode = 'testmode';
2284
+ $row->paypal_mode = 0;
2285
+
2286
+ $row->published = 1;
2287
+ $row->form_fields = '';
2288
+ $row->savedb = 1;
2289
+ $row->sendemail = 1;
2290
+ $row->requiredmark = '*';
2291
+ $row->reply_to = 0;
2292
+ $row->send_to = 0;
2293
+ $row->autogen_layout = 1;
2294
+ $row->custom_front = '';
2295
+ $row->mail_from_user = '';
2296
+ $row->mail_from_name_user = '';
2297
+ $row->reply_to_user = '';
2298
+ $row->save_uploads = 1;
2299
+
2300
+ $row->condition = '';
2301
+ $row->mail_cc = '';
2302
+ $row->mail_cc_user = '';
2303
+ $row->mail_bcc = '';
2304
+ $row->mail_bcc_user = '';
2305
+ $row->mail_subject = '';
2306
+ $row->mail_subject_user = '';
2307
+ $row->mail_mode = 1;
2308
+ $row->mail_mode_user = 1;
2309
+ $row->mail_attachment = 1;
2310
+ $row->mail_attachment_user = 1;
2311
+
2312
+ $row->user_id_wd = '';
2313
+ $row->sortable = 1;
2314
+ $row->frontend_submit_fields = '';
2315
+ $row->frontend_submit_stat_fields = '';
2316
+ }
2317
+ return $row;
2318
+ }
2319
+
2320
+ public function get_theme_rows_data($old = '') {
2321
+ global $wpdb;
2322
+ $rows = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker_themes WHERE css " . ($old ? 'NOT' : '') . " LIKE '%.wdform_section%' ORDER BY title");
2323
+ return $rows;
2324
+ }
2325
+
2326
+ public function get_queries_rows_data($id) {
2327
+ global $wpdb;
2328
+ $rows = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker_query WHERE form_id=" . $id . " ORDER BY id ASC");
2329
+ return $rows;
2330
+ }
2331
+
2332
+ public function get_labels($id) {
2333
+ global $wpdb;
2334
+ $rows = $wpdb->get_col("SELECT DISTINCT `element_label` FROM " . $wpdb->prefix . "formmaker_submits WHERE form_id=" . $id);
2335
+ return $rows;
2336
+ }
2337
+
2338
+ public function is_paypal($id) {
2339
+ global $wpdb;
2340
+ $rows = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker_sessions WHERE form_id=" . $id);
2341
+ return $rows;
2342
+ }
2343
+
2344
+ public function page_nav() {
2345
+ global $wpdb;
2346
+ $where = 'WHERE `id` NOT IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ')';
2347
+ $where .= ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? ' AND title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
2348
+ $query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker " . $where;
2349
+ $total = $wpdb->get_var($query);
2350
+ $page_nav['total'] = $total;
2351
+ if (isset($_POST['page_number']) && $_POST['page_number']) {
2352
+ $limit = ((int) $_POST['page_number'] - 1) * 20;
2353
+ }
2354
+ else {
2355
+ $limit = 0;
2356
+ }
2357
+ $page_nav['limit'] = (int) ($limit / 20 + 1);
2358
+ return $page_nav;
2359
+ }
2360
+ ////////////////////////////////////////////////////////////////////////////////////////
2361
+ // Getters & Setters //
2362
+ ////////////////////////////////////////////////////////////////////////////////////////
2363
+ ////////////////////////////////////////////////////////////////////////////////////////
2364
+ // Private Methods //
2365
+ ////////////////////////////////////////////////////////////////////////////////////////
2366
+ ////////////////////////////////////////////////////////////////////////////////////////
2367
+ // Listeners //
2368
+ ////////////////////////////////////////////////////////////////////////////////////////
2369
  }
admin/models/FMModelSelect_data_from_db.php CHANGED
@@ -1,111 +1,111 @@
1
- <?php
2
-
3
- class FMModelSelect_data_from_db {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
-
22
- function get_labels($form_id) {
23
- global $wpdb;
24
- $rows = $wpdb->get_var("SELECT label_order_current FROM " . $wpdb->prefix . "formmaker where id=" . $form_id);
25
- return $rows;
26
- }
27
- function get_tables() {
28
- global $wpdb;
29
- $con_type = $_POST['con_type'];
30
-
31
- if($con_type == 'local') {
32
- $query = "SHOW TABLES";
33
- $tables = $wpdb->get_col($query);
34
- }
35
- else if($con_type == 'remote') {
36
- $username = isset($_POST['username']) ? $_POST['username'] : '';
37
- $password = isset($_POST['password']) ? $_POST['password'] : '';
38
- $database = isset($_POST['database']) ? $_POST['database'] : '';
39
- $host = isset($_POST['host']) ? $_POST['host'] : '';
40
- $wpdb_temp = new wpdb($username, $password, $database, $host);
41
- $query = "SHOW TABLES";
42
- $tables = $wpdb_temp->get_col($query);
43
- }
44
- //$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
45
- return $tables;
46
- }
47
-
48
- function get_tables_saved($con_type, $username, $password, $database, $host) {
49
- global $wpdb;
50
-
51
- if($con_type == 'local') {
52
- $query = "SHOW TABLES";
53
- $tables = $wpdb->get_col($query);
54
- }
55
- else if($con_type == 'remote') {
56
- $wpdb_temp = new wpdb($username, $password, $database, $host);
57
- $query = "SHOW TABLES";
58
- $tables = $wpdb_temp->get_col($query);
59
- }
60
- //$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
61
- return $tables;
62
- }
63
-
64
- function get_table_struct() {
65
- global $wpdb;
66
- $name = isset($_POST['name']) ? $_POST['name'] : NULL;
67
- if(!$name)
68
- return array();
69
- $con_method = $_POST['con_method'];
70
- $con_type = $_POST['con_type'];
71
- $query = "SHOW COLUMNS FROM " . $name;
72
- if($con_type == 'remote') {
73
- $username = isset($_POST['username']) ? $_POST['username'] : '';
74
- $password = isset($_POST['password']) ? $_POST['password'] : '';
75
- $database = isset($_POST['database']) ? $_POST['database'] : '';
76
- $host = isset($_POST['host']) ? $_POST['host'] : '';
77
- $wpdb_temp = new wpdb($username, $password, $database, $host);
78
- $table_struct = $wpdb_temp->get_results($query);
79
- }
80
- else {
81
- $table_struct = $wpdb->get_results($query);
82
- }
83
- //$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
84
- return $table_struct;
85
- }
86
-
87
- function get_table_struct_saved($con_type, $username, $password, $database, $host, $name, $con_method) {
88
- global $wpdb;
89
- if(!$name)
90
- return array();
91
- $query = "SHOW COLUMNS FROM " . $name;
92
- if($con_type == 'remote') {
93
- $wpdb_temp = new wpdb($username, $password, $database, $host);
94
- $table_struct = $wpdb_temp->get_results($query);
95
- }
96
- else {
97
- $table_struct = $wpdb->get_results($query);
98
- }
99
- //$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
100
- return $table_struct;
101
- }
102
- ////////////////////////////////////////////////////////////////////////////////////////
103
- // Getters & Setters //
104
- ////////////////////////////////////////////////////////////////////////////////////////
105
- ////////////////////////////////////////////////////////////////////////////////////////
106
- // Private Methods //
107
- ////////////////////////////////////////////////////////////////////////////////////////
108
- ////////////////////////////////////////////////////////////////////////////////////////
109
- // Listeners //
110
- ////////////////////////////////////////////////////////////////////////////////////////
111
  }
1
+ <?php
2
+
3
+ class FMModelSelect_data_from_db {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
22
+ function get_labels($form_id) {
23
+ global $wpdb;
24
+ $rows = $wpdb->get_var("SELECT label_order_current FROM " . $wpdb->prefix . "formmaker where id=" . $form_id);
25
+ return $rows;
26
+ }
27
+ function get_tables() {
28
+ global $wpdb;
29
+ $con_type = $_POST['con_type'];
30
+
31
+ if($con_type == 'local') {
32
+ $query = "SHOW TABLES";
33
+ $tables = $wpdb->get_col($query);
34
+ }
35
+ else if($con_type == 'remote') {
36
+ $username = isset($_POST['username']) ? $_POST['username'] : '';
37
+ $password = isset($_POST['password']) ? $_POST['password'] : '';
38
+ $database = isset($_POST['database']) ? $_POST['database'] : '';
39
+ $host = isset($_POST['host']) ? $_POST['host'] : '';
40
+ $wpdb_temp = new wpdb($username, $password, $database, $host);
41
+ $query = "SHOW TABLES";
42
+ $tables = $wpdb_temp->get_col($query);
43
+ }
44
+ //$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
45
+ return $tables;
46
+ }
47
+
48
+ function get_tables_saved($con_type, $username, $password, $database, $host) {
49
+ global $wpdb;
50
+
51
+ if($con_type == 'local') {
52
+ $query = "SHOW TABLES";
53
+ $tables = $wpdb->get_col($query);
54
+ }
55
+ else if($con_type == 'remote') {
56
+ $wpdb_temp = new wpdb($username, $password, $database, $host);
57
+ $query = "SHOW TABLES";
58
+ $tables = $wpdb_temp->get_col($query);
59
+ }
60
+ //$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
61
+ return $tables;
62
+ }
63
+
64
+ function get_table_struct() {
65
+ global $wpdb;
66
+ $name = isset($_POST['name']) ? $_POST['name'] : NULL;
67
+ if(!$name)
68
+ return array();
69
+ $con_method = $_POST['con_method'];
70
+ $con_type = $_POST['con_type'];
71
+ $query = "SHOW COLUMNS FROM " . $name;
72
+ if($con_type == 'remote') {
73
+ $username = isset($_POST['username']) ? $_POST['username'] : '';
74
+ $password = isset($_POST['password']) ? $_POST['password'] : '';
75
+ $database = isset($_POST['database']) ? $_POST['database'] : '';
76
+ $host = isset($_POST['host']) ? $_POST['host'] : '';
77
+ $wpdb_temp = new wpdb($username, $password, $database, $host);
78
+ $table_struct = $wpdb_temp->get_results($query);
79
+ }
80
+ else {
81
+ $table_struct = $wpdb->get_results($query);
82
+ }
83
+ //$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
84
+ return $table_struct;
85
+ }
86
+
87
+ function get_table_struct_saved($con_type, $username, $password, $database, $host, $name, $con_method) {
88
+ global $wpdb;
89
+ if(!$name)
90
+ return array();
91
+ $query = "SHOW COLUMNS FROM " . $name;
92
+ if($con_type == 'remote') {
93
+ $wpdb_temp = new wpdb($username, $password, $database, $host);
94
+ $table_struct = $wpdb_temp->get_results($query);
95
+ }
96
+ else {
97
+ $table_struct = $wpdb->get_results($query);
98
+ }
99
+ //$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
100
+ return $table_struct;
101
+ }
102
+ ////////////////////////////////////////////////////////////////////////////////////////
103
+ // Getters & Setters //
104
+ ////////////////////////////////////////////////////////////////////////////////////////
105
+ ////////////////////////////////////////////////////////////////////////////////////////
106
+ // Private Methods //
107
+ ////////////////////////////////////////////////////////////////////////////////////////
108
+ ////////////////////////////////////////////////////////////////////////////////////////
109
+ // Listeners //
110
+ ////////////////////////////////////////////////////////////////////////////////////////
111
  }
admin/models/FMModelShow_matrix.php CHANGED
@@ -1,31 +1,31 @@
1
- <?php
2
-
3
- class FMModelShow_matrix {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
-
22
- ////////////////////////////////////////////////////////////////////////////////////////
23
- // Getters & Setters //
24
- ////////////////////////////////////////////////////////////////////////////////////////
25
- ////////////////////////////////////////////////////////////////////////////////////////
26
- // Private Methods //
27
- ////////////////////////////////////////////////////////////////////////////////////////
28
- ////////////////////////////////////////////////////////////////////////////////////////
29
- // Listeners //
30
- ////////////////////////////////////////////////////////////////////////////////////////
31
  }
1
+ <?php
2
+
3
+ class FMModelShow_matrix {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Getters & Setters //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ ////////////////////////////////////////////////////////////////////////////////////////
26
+ // Private Methods //
27
+ ////////////////////////////////////////////////////////////////////////////////////////
28
+ ////////////////////////////////////////////////////////////////////////////////////////
29
+ // Listeners //
30
+ ////////////////////////////////////////////////////////////////////////////////////////
31
  }
admin/models/FMModelSubmissions_fm.php CHANGED
@@ -1,676 +1,676 @@
1
- <?php
2
- class FMModelSubmissions_fm {
3
- ////////////////////////////////////////////////////////////////////////////////////////
4
- // Events //
5
- ////////////////////////////////////////////////////////////////////////////////////////
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- // Constants //
8
- ////////////////////////////////////////////////////////////////////////////////////////
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- // Variables //
11
- ////////////////////////////////////////////////////////////////////////////////////////
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- // Constructor & Destructor //
14
- ////////////////////////////////////////////////////////////////////////////////////////
15
- public function __construct() {
16
- }
17
- ////////////////////////////////////////////////////////////////////////////////////////
18
- // Public Methods //
19
- ////////////////////////////////////////////////////////////////////////////////////////
20
- public function blocked_ips() {
21
- global $wpdb;
22
- $ips = $wpdb->get_col('SELECT ip FROM ' . $wpdb->prefix . 'formmaker_blocked');
23
- return $ips;
24
- }
25
-
26
- public function get_form_titles() {
27
- global $wpdb;
28
- $query = "SELECT id, title FROM " . $wpdb->prefix . "formmaker WHERE `id` NOT IN(" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ") order by title";
29
- $forms = $wpdb->get_results($query);
30
- return $forms;
31
- }
32
-
33
- public function get_statistics($form_id) {
34
- global $wpdb;
35
- $statistics = array();
36
- $query = $wpdb->prepare('SELECT count(distinct group_id) FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id ="%d"', $form_id);
37
- $statistics["total_entries"] = $wpdb->get_var($query);
38
- $query = $wpdb->prepare('SELECT `views` FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="%d"', $form_id);
39
- $statistics["total_views"] = $wpdb->get_var($query);
40
- if ($statistics["total_views"]) {
41
- $statistics["conversion_rate"] = round((($statistics["total_entries"] / $statistics["total_views"]) * 100), 2) . '%';
42
- }
43
- else {
44
- $statistics["conversion_rate"] = '0%';
45
- }
46
- return $statistics;
47
- }
48
-
49
- public function get_labels_parameters($form_id) {
50
- global $wpdb;
51
- $labels = array();
52
- $labels_id = array();
53
- $sorted_labels_id = array();
54
- $label_names = array();
55
- $label_types = array();
56
- $sorted_label_types = array();
57
- $label_names_original = array();
58
- $labels_parameters = array();
59
- $join_query = array();
60
- $join_where = array();
61
- $rows_ord = array();
62
- $join = '';
63
- for ($i = 0; $i < 8; $i++) {
64
- array_push($labels_parameters, NULL);
65
- }
66
- $sorted_label_names = array();
67
- $sorted_label_names_original = array();
68
- $where_labels = array();
69
- $where2 = array();
70
-
71
- $pagination_clicked = (isset($_POST['pagination_clicked']) && $_POST['pagination_clicked'] == '1' ? '1' : '0');
72
-
73
- $order_by = ((isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) != '') ? esc_html(stripslashes($_POST['order_by'])) : 'group_id');
74
- $asc_or_desc = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'asc') ? 'asc' : 'desc');
75
- $limit = ((isset($_POST['page_number'])) ? ((int) $_POST['page_number'] - 1) * 20 : 0);
76
- $lists['hide_label_list'] = ((isset($_POST['hide_label_list'])) ? esc_html(stripslashes($_POST['hide_label_list'])) : '');
77
- $lists['startdate'] = ((isset($_POST['startdate'])) ? esc_html(stripslashes($_POST['startdate'])) : '');
78
- $lists['enddate'] = ((isset($_POST['enddate'])) ? esc_html(stripslashes($_POST['enddate'])) : '');
79
- $lists['ip_search'] = ((isset($_POST['ip_search'])) ? esc_html(stripslashes($_POST['ip_search'])) : '');
80
-
81
- $lists['username_search'] = ((isset($_POST['username_search'])) ? esc_html(stripslashes($_POST['username_search'])) : '');
82
- $lists['useremail_search'] = ((isset($_POST['useremail_search'])) ? esc_html(stripslashes($_POST['useremail_search'])) : '');
83
- $lists['id_search'] = ((isset($_POST['id_search'])) ? esc_html(stripslashes($_POST['id_search'])) : '');
84
-
85
- if ($lists['ip_search']) {
86
- $where[] = 'ip LIKE "%' . $lists['ip_search'] . '%"';
87
- }
88
- if ($lists['startdate'] != '') {
89
- $where[] = " `date`>='" . $lists['startdate'] . " 00:00:00' ";
90
- }
91
- if ($lists['enddate'] != '') {
92
- $where[] = " `date`<='" . $lists['enddate'] . " 23:59:59' ";
93
- }
94
-
95
-
96
- if ($lists['username_search']) {
97
- $where[] = 'user_id_wd IN (SELECT ID FROM ' . $wpdb->prefix . 'users WHERE display_name LIKE "%'.$lists['username_search'].'%")';
98
- }
99
- if ($lists['useremail_search']) {
100
- $where[] = 'user_id_wd IN (SELECT ID FROM ' . $wpdb->prefix . 'users WHERE user_email LIKE "%'.$lists['useremail_search'].'%")';
101
- }
102
-
103
- if ($lists['id_search']) {
104
- $where[] = 'group_id ='.$lists['id_search'];
105
- }
106
-
107
- $where[] = 'form_id=' . $form_id . '';
108
- $where = (count($where) ? ' ' . implode(' AND ', $where) : '');
109
- if ($order_by == 'group_id' or $order_by == 'date' or $order_by == 'ip') {
110
- $orderby = ' ORDER BY ' . $order_by . ' ' . $asc_or_desc . '';
111
- }elseif($order_by == 'display_name' or $order_by == 'user_email'){
112
- $orderby = ' ORDER BY (SELECT '.$order_by.' FROM ' . $wpdb->prefix . 'users WHERE ID=user_id_wd) '. $asc_or_desc .'';
113
- }
114
- else {
115
- $orderby = "";
116
- }
117
- if ($form_id) {
118
- for($i = 0; $i < 8; $i++) {
119
- array_pop($labels_parameters);
120
- }
121
- $query = "SELECT distinct element_label FROM " . $wpdb->prefix . "formmaker_submits WHERE ". $where;
122
- $results = $wpdb->get_results($query);
123
- for ($i = 0; $i < count($results); $i++) {
124
- array_push($labels, $results[$i]->element_label);
125
- }
126
- $form = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id='%d'", $form_id));
127
- if (strpos($form->label_order, 'type_paypal_')) {
128
- $form->label_order = $form->label_order . "item_total#**id**#Item Total#**label**#type_paypal_payment_total#****#total#**id**#Total#**label**#type_paypal_payment_total#****#0#**id**#Payment Status#**label**#type_paypal_payment_status#****#";
129
- }
130
-
131
- $form_labels = explode('#****#', $form->label_order);
132
- $form_labels = array_slice($form_labels, 0, count($form_labels) - 1);
133
-
134
- foreach ($form_labels as $key => $form_label) {
135
- $label_id = explode('#**id**#', $form_label);
136
- array_push($labels_id, $label_id[0]);
137
- $label_name_type = explode('#**label**#', $label_id[1]);
138
- array_push($label_names_original, $label_name_type[0]);
139
- $ptn = "/[^a-zA-Z0-9_]/";
140
- $rpltxt = "";
141
- $label_name = preg_replace($ptn, $rpltxt, $label_name_type[0]);
142
- array_push($label_names, $label_name);
143
- array_push($label_types, $label_name_type[1]);
144
- }
145
-
146
- foreach ($labels_id as $key => $label_id) {
147
- if (in_array($label_id, $labels)) {
148
- if (!in_array($label_id, $sorted_labels_id)) {
149
- array_push($sorted_labels_id, $label_id);
150
- }
151
- array_push($sorted_label_names, $label_names[$key]);
152
- array_push($sorted_label_types, $label_types[$key]);
153
- array_push($sorted_label_names_original, $label_names_original[$key]);
154
- if (isset($_POST[$form_id . '_' . $label_id . '_search'])) {
155
- $search_temp = esc_html($_POST[$form_id . '_' . $label_id . '_search']);
156
- }
157
- else {
158
- $search_temp = '';
159
- }
160
- $search_temp = strtolower($search_temp);
161
- $lists[$form_id . '_' . $label_id . '_search'] = $search_temp;
162
- if ($search_temp) {
163
- $join_query[] = 'search';
164
- $join_where[] = array('label' => $label_id, 'search' => $search_temp);
165
- }
166
- }
167
- }
168
- if (strpos($order_by, "_field")) {
169
- if (in_array(str_replace("_field", "", $order_by), $labels)) {
170
- $join_query[] = 'sort';
171
- $join_where[] = array('label'=>str_replace("_field", "", $order_by));
172
- }
173
- }
174
- $cols = 'group_id';
175
- if ($order_by == 'date' or $order_by == 'ip') {
176
- $cols = 'group_id, date, ip';
177
- }
178
- switch (count($join_query)) {
179
- case 0:
180
- $join = 'SELECT distinct group_id FROM ' . $wpdb->prefix . 'formmaker_submits WHERE '. $where;
181
- break;
182
- case 1:
183
- if ($join_query[0] == 'sort') {
184
- $join = 'SELECT group_id FROM ' . $wpdb->prefix . 'formmaker_submits WHERE ' . $where . ' AND element_label="' . $join_where[0]['label'] . '" ';
185
- $join_count = 'SELECT count(group_id) FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id="' . $form_id . '" AND element_label="' . $join_where[0]['label'] . '" ';
186
- $orderby = ' ORDER BY `element_value` ' . $asc_or_desc;
187
- }
188
- else {
189
- $join = 'SELECT group_id FROM ' . $wpdb->prefix . 'formmaker_submits WHERE element_label="' . $join_where[0]['label'] . '" AND (element_value LIKE "%' . $join_where[0]['search'] . '%" OR element_value LIKE "%' . str_replace(' ', '@@@', $join_where[0]['search']) . '%") AND ' . $where;
190
- }
191
- break;
192
- default:
193
- $join = 'SELECT t.group_id FROM (SELECT ' . $cols . ' FROM ' . $wpdb->prefix . 'formmaker_submits WHERE ' . $where . ' AND element_label="' . $join_where[0]['label'] . '" AND (element_value LIKE "%' . $join_where[0]['search'] . '%" OR element_value LIKE "%' . str_replace(' ', '@@@', $join_where[0]['search']) . '%" ) ) as t ';
194
- for ($key = 1; $key < count($join_query); $key++) {
195
- if ($join_query[$key] == 'sort') {
196
- $join .= 'LEFT JOIN (SELECT group_id as group_id' . $key . ', element_value FROM ' . $wpdb->prefix . 'formmaker_submits WHERE ' . $where . ' AND element_label="' . $join_where[$key]['label'] . '") as t' . $key . ' ON t' . $key . '.group_id' . $key . '=t.group_id ';
197
- $orderby = ' ORDER BY t' . $key . '.`element_value` ' . $asc_or_desc . '';
198
- }
199
- else {
200
- $join .= 'INNER JOIN (SELECT group_id as group_id' . $key . ' FROM ' . $wpdb->prefix . 'formmaker_submits WHERE '.$where.' AND element_label="' . $join_where[$key]['label'] . '" AND (element_value LIKE "%' . $join_where[$key]['search'] . '%" OR element_value LIKE "%' . str_replace(' ', '@@@', $join_where[$key]['search']) . '%") ) as t' . $key . ' ON t' . $key . '.group_id' . $key . '=t.group_id ';
201
- }
202
- }
203
- break;
204
- }
205
- $pos = strpos($join, 'SELECT t.group_id');
206
- if ($pos === FALSE) {
207
- $query = str_replace(array('SELECT group_id','SELECT distinct group_id'), array('SELECT count(distinct group_id)','SELECT count(distinct group_id)'), $join);
208
- }
209
- else {
210
- $query = str_replace('SELECT t.group_id', 'SELECT count(t.group_id)', $join);
211
- }
212
- $total = $wpdb->get_var($query);
213
-
214
- $query_sub_count = "SELECT count(distinct group_id) from ".$wpdb->prefix."formmaker_submits";
215
- $sub_count = (int)$wpdb->get_var($query_sub_count);
216
-
217
- $limit1 = (int)$total < $sub_count && !$pagination_clicked ? 0 : $limit;
218
-
219
- $query = $join . ' ' . $orderby . ' limit ' . $limit1 . ', 20 ';
220
- $results = $wpdb->get_results($query);
221
- for ($i = 0; $i < count($results); $i++) {
222
- array_push($rows_ord, $results[$i]->group_id);
223
- }
224
- $where2 = array();
225
- $where2[] = "group_id='0'";
226
- foreach ($rows_ord as $rows_ordd) {
227
- $where2[] = "group_id='" . $rows_ordd . "'";
228
- }
229
- $where2 = (count($where2) ? ' WHERE ' . implode( ' OR ', $where2 ) . '' : '' );
230
- $query = 'SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits ' . $where2;
231
- $rows = $wpdb->get_results($query);
232
- $group_ids = $rows_ord;
233
- $lists['total'] = $total;
234
- $lists['limit'] = (int) ($limit1 / 20 + 1);
235
- $where_choices = $where;
236
- array_push($labels_parameters, $sorted_labels_id);
237
- array_push($labels_parameters, $sorted_label_types);
238
- array_push($labels_parameters, $lists);
239
- array_push($labels_parameters, $sorted_label_names);
240
- array_push($labels_parameters, $sorted_label_names_original);
241
- array_push($labels_parameters, $rows);
242
- array_push($labels_parameters, $group_ids);
243
- array_push($labels_parameters, $where_choices);
244
- }
245
- return $labels_parameters;
246
- }
247
-
248
- public function get_type_address($sorted_label_type, $sorted_label_name_original) {
249
- if ($sorted_label_type == 'type_address') {
250
- switch ($sorted_label_name_original) {
251
- case 'Street Line':
252
- $field_title = __('Street Address', 'form_maker');
253
- break;
254
- case 'Street Line2':
255
- $field_title = __('Street Address Line 2', 'form_maker');
256
- break;
257
- case 'City':
258
- $field_title = __('City', 'form_maker');
259
- break;
260
- case 'State':
261
- $field_title = __('State / Province / Region', 'form_maker');
262
- break;
263
- case 'Postal':
264
- $field_title = __('Postal / Zip Code', 'form_maker');
265
- break;
266
- case 'Country':
267
- $field_title = __('Country', 'form_maker');
268
- break;
269
- default :
270
- $field_title = stripslashes($sorted_label_name_original);
271
- break;
272
- }
273
- }
274
- else {
275
- $field_title = stripslashes($sorted_label_name_original);
276
- }
277
- return $field_title;
278
- }
279
-
280
- public function hide_or_not($hide_strings,$hide_string) {
281
- if (strpos($hide_string,'@') === FALSE) {
282
- if (strpos($hide_strings, '@' . $hide_string . '@') === FALSE) {
283
- $style = '';
284
- }
285
- else {
286
- $style = 'style="display:none"';
287
- }
288
- }
289
- else {
290
- if (strpos($hide_strings, $hide_string) === FALSE) {
291
- $style = '';
292
- }
293
- else {
294
- $style = 'style="display:none"';
295
- }
296
- }
297
- return $style;
298
- }
299
-
300
- public function sort_group_ids($sorted_label_names_count, $group_ids) {
301
- $count_labe = $sorted_label_names_count;
302
- $group_id_s = array();
303
- $l = 0;
304
- if (count($group_ids) > 0 and $count_labe) {
305
- for ($i = 0; $i < count($group_ids); $i++) {
306
- if (!in_array($group_ids[$i], $group_id_s)) {
307
- array_push($group_id_s, $group_ids[$i]);
308
- }
309
- }
310
- }
311
- return $group_id_s;
312
- }
313
-
314
- public function array_for_group_id($group, $rows) {
315
- $i = $group;
316
- $count_rows = count($rows);
317
- $temp = array();
318
- for ($j = 0; $j < $count_rows; $j++) {
319
- $row = $rows[$j];
320
- if ($row->group_id == $i) {
321
- array_push($temp, $row);
322
- }
323
- }
324
- return $temp;
325
- }
326
-
327
- public function check_radio_type($sorted_label_type) {
328
- 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") {
329
- return TRUE;
330
- }
331
- else {
332
- return FALSE;
333
- }
334
- }
335
-
336
- public function statistic_for_radio($where_choices, $sorted_label_id) {
337
- global $wpdb;
338
- $choices_params = array();
339
- $query = "SELECT element_value FROM " . $wpdb->prefix . "formmaker_submits WHERE " . $where_choices . " AND element_label='" . $sorted_label_id . "'";
340
- $choices = $wpdb->get_results($query);
341
- $colors=array('#5FE2FF','#F9E89C');
342
- $choices_colors=array('#4EC0D9','#DDCC7F');
343
- $choices_labels = array();
344
- $choices_count = array();
345
- $all = count($choices);
346
- $unanswered = 0;
347
- foreach ($choices as $key => $choice) {
348
- if ($choice->element_value == '') {
349
- $unanswered++;
350
- }
351
- else {
352
- if (!in_array($choice->element_value, $choices_labels)) {
353
- array_push($choices_labels, $choice->element_value);
354
- array_push($choices_count, 0);
355
- }
356
- $choices_count[array_search($choice->element_value, $choices_labels)]++;
357
- }
358
- }
359
- array_multisort($choices_count, SORT_DESC, $choices_labels);
360
- array_push($choices_params, $choices_count);
361
- array_push($choices_params, $choices_labels);
362
- array_push($choices_params, $unanswered);
363
- array_push($choices_params, $all);
364
- array_push($choices_params, $colors);
365
- array_push($choices_params, $choices_colors);
366
- return $choices_params;
367
- }
368
-
369
- public function get_data_of_group_id($id) {
370
- global $wpdb;
371
- $query = "SELECT * FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id=" . $id;
372
- $rows = $wpdb->get_results($query);
373
- $form = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id=" . $rows[0]->form_id);
374
- $params = array();
375
- $label_id = array();
376
- $label_order_original = array();
377
- $label_type = array();
378
- $ispaypal = strpos($form->label_order, 'type_paypal_');
379
- if ($form->paypal_mode == 1) {
380
- if ($ispaypal) {
381
- $form->label_order = $form->label_order."0#**id**#Payment Status#**label**#type_paypal_payment_status#****#";
382
- }
383
- }
384
- $label_all = explode('#****#', $form->label_order);
385
- $label_all = array_slice($label_all, 0, count($label_all) - 1);
386
- foreach ($label_all as $key => $label_each) {
387
- $label_id_each = explode('#**id**#', $label_each);
388
- array_push($label_id, $label_id_each[0]);
389
- $label_oder_each = explode('#**label**#', $label_id_each[1]);
390
- array_push($label_order_original, $label_oder_each[0]);
391
- array_push($label_type, $label_oder_each[1]);
392
- }
393
- /*$theme_id = $wpdb->get_var("SELECT theme FROM " . $wpdb->prefix . "formmaker WHERE id='" . $form->id . "'");*/
394
- $css = $wpdb->get_var("SELECT css FROM " . $wpdb->prefix . "formmaker_themes");
395
- array_push($params, $rows);
396
- array_push($params, $label_id);
397
- array_push($params, $label_order_original);
398
- array_push($params, $label_type);
399
- array_push($params, $ispaypal);
400
- array_push($params, $form);
401
- array_push($params, $css);
402
- return $params;
403
- }
404
-
405
- public function check_type_for_edit_function($label_type) {
406
- 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') {
407
- return TRUE;
408
- }
409
- else {
410
- return FALSE;
411
- }
412
- }
413
-
414
- public function check_for_submited_label($rows, $label_id) {
415
- foreach ($rows as $row) {
416
- if ($row->element_label == $label_id) {
417
- $element_value = $row->element_value;
418
- break;
419
- }
420
- else {
421
- $element_value = 'continue';
422
- }
423
- }
424
- return $element_value;
425
- }
426
-
427
- public function view_for_star_rating($element_value, $element_label) {
428
- $view_star_rating_array = array();
429
- $new_filename = str_replace("***star_rating***", '', $element_value);
430
- $stars = "";
431
- $new_filename=explode('***', $new_filename);
432
- for ($j = 0; $j < $new_filename[1]; $j++) {
433
- $stars .= '<img id="' . $element_label . '_star_' . $j . '" src="' . WD_FM_URL . '/images/star_' . $new_filename[2] . '.png?ver='. get_option("wd_form_maker_version").'" /> ';
434
- }
435
- for ($k = $new_filename[1]; $k < $new_filename[0]; $k++) {
436
- $stars .= '<img id="' . $element_label . '_star_' . $k . '" src="' . WD_FM_URL . '/images/star.png?ver='. get_option("wd_form_maker_version").'" /> ';
437
- }
438
- array_push($view_star_rating_array, $stars);
439
- return $view_star_rating_array;
440
- }
441
-
442
- public function view_for_grading($element_value) {
443
- $view_grading_array = array();
444
- $new_filename = str_replace("***grading***", '', $element_value);
445
- $grading = explode(":", $new_filename);
446
- $items_count = sizeof($grading) - 1;
447
- $items = "";
448
- $total = "";
449
- for ($k = 0; $k < $items_count / 2; $k++) {
450
- $items .= $grading[$items_count / 2 + $k] . ": " . $grading[$k] . "</br>";
451
- $total += $grading[$k];
452
- }
453
- $items .= "Total: " . $total;
454
- array_push($view_grading_array, $items);
455
- return $view_grading_array;
456
- }
457
-
458
- public function images_for_star_rating($element_value, $label_id) {
459
- $edit_stars = "";
460
- $star_rating_array = array();
461
- $element_value1 = str_replace("***star_rating***", '', $element_value);
462
- $stars_value = explode('***', $element_value1);
463
- for ($j = 0; $j < $stars_value[1]; $j++) {
464
- $edit_stars .= '<img id="'.$label_id.'_star_'.$j.'" onclick="edit_star_rating('.$j.','.$label_id.')" src="' . WD_FM_URL . '/images/star_'.$stars_value[2].'.png?ver='. get_option("wd_form_maker_version").'" /> ';
465
- }
466
- for( $k=$stars_value[1];$k<$stars_value[0];$k++) {
467
- $edit_stars .= '<img id="'.$label_id.'_star_'.$k.'" onclick="edit_star_rating('.$k.','.$label_id.')" src="' . WD_FM_URL . '/images/star.png?ver='. get_option("wd_form_maker_version").'" /> ';
468
- }
469
- array_push($star_rating_array, $edit_stars);
470
- array_push($star_rating_array, $stars_value);
471
- return $star_rating_array;
472
- }
473
-
474
- public function params_for_scale_rating($element_value, $label_id) {
475
- $scale_rating_array = array();
476
- $scale_radio = explode('/', $element_value);
477
- $scale_value = $scale_radio[0];
478
- $scale = '<table><tr>';
479
- for ($k = 1; $k <= $scale_radio[1]; $k++) {
480
- $scale .= '<td style="text-align:center"><span>' . $k . '</span></td>';
481
- }
482
- $scale .= '<tr></tr>';
483
- for ($l = 1; $l <= $scale_radio[1]; $l++) {
484
- if ($l == $scale_radio[0]) {
485
- $checked = "checked";
486
- }
487
- else {
488
- $checked = "";
489
- }
490
- $scale .= '<td><input type="radio" name = "'.$label_id.'_scale_rating_radio" id = "'.$label_id.'_scale_rating_radio_'.$l.'" value="'.$l.'" '.$checked.' onClick="edit_scale_rating(this.value,'.$label_id.')" /></td>';
491
- }
492
- $scale .= '</tr></table>';
493
- array_push($scale_rating_array, $scale);
494
- array_push($scale_rating_array, $scale_radio);
495
- array_push($scale_rating_array, $checked);
496
- return $scale_rating_array;
497
- }
498
-
499
- public function params_for_type_range($element_value, $label_id) {
500
- $range_value = explode('-', $element_value);
501
- $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"/>';
502
- return $range;
503
- }
504
-
505
- public function params_for_type_grading($element_value, $label_id) {
506
- $type_grading_array = array();
507
- $element_value1 = str_replace("***grading***", '', $element_value);
508
- $garding_value = explode(':', $element_value1);
509
- $items_count = sizeof($garding_value) - 1;
510
- $garding = "";
511
- $sum = "";
512
- for ($k = 0; $k < $items_count/2; $k++) {
513
- $garding .= '<input name="'.$label_id.'_element'.$k.'" id="'.$label_id.'_element'.$k.'" type="text" value="'.$garding_value[$k].'" onKeyUp="edit_grading('.$label_id.','.$items_count.')" size="5"/> '.$garding_value[$items_count/2+$k].'</br>';
514
- $sum += $garding_value[$k];
515
- }
516
- array_push($type_grading_array, $garding);
517
- array_push($type_grading_array, $garding_value);
518
- array_push($type_grading_array, $sum);
519
- array_push($type_grading_array, $items_count);
520
- array_push($type_grading_array, $element_value1);
521
- return $type_grading_array;
522
- }
523
-
524
- public function params_for_type_matrix($element_value, $label_id) {
525
- $type_matrix_array = array();
526
- $new_filename = str_replace("***matrix***", '', $element_value);
527
- $matrix_value = explode('***', $new_filename);
528
- $matrix_value = array_slice($matrix_value, 0, count($matrix_value) - 1);
529
- $mat_rows = $matrix_value[0];
530
- $mat_columns = $matrix_value[$mat_rows + 1];
531
- $matrix = "<table>";
532
- $matrix .= '<tr><td></td>';
533
- for ($k = 1; $k <= $mat_columns; $k++) {
534
- $matrix .= '<td style="background-color:#BBBBBB; padding:5px; border:1px; ">'.$matrix_value[$mat_rows+1+$k].'</td>';
535
- }
536
- $matrix .= '</tr>';
537
- $aaa = Array();
538
- $var_checkbox = 1;
539
- $selected_value = "";
540
- $selected_value_yes = "";
541
- $selected_value_no = "";
542
- for ($k = 1; $k <= $mat_rows; $k++) {
543
- $matrix .= '<tr><td style="background-color:#BBBBBB; padding:5px; border:1px;">'.$matrix_value[$k].'</td>';
544
- if ($matrix_value[$mat_rows + $mat_columns + 2] == "radio") {
545
- if ($matrix_value[$mat_rows + $mat_columns + 2 + $k] == 0) {
546
- $checked = "";
547
- $aaa[1] = "";
548
- }
549
- else {
550
- $aaa = explode("_", $matrix_value[$mat_rows + $mat_columns + 2 + $k]);
551
- }
552
- for ($l = 1; $l <= $mat_columns; $l++) {
553
- if ($aaa[1] == $l) {
554
- $checked = 'checked';
555
- }
556
- else {
557
- $checked = "";
558
- }
559
- $index = "'" . $k . '_' . $l . "'";
560
- $matrix .= '<td style="text-align:center;"><input name="'.$label_id.'_input_elementform_id_temp'.$k.'" id="'.$label_id.'_input_elementform_id_temp'.$k.'_'.$l.'" type="'.$matrix_value[$mat_rows+$mat_columns+2].'" '.$checked.' onClick="change_radio_values('.$index.','.$label_id.','.$mat_rows.','.$mat_columns.')"/></td>';
561
- }
562
- }
563
- else {
564
- if ($matrix_value[$mat_rows+$mat_columns+2] == "checkbox") {
565
- for ($l = 1; $l <= $mat_columns; $l++) {
566
- if ($matrix_value[$mat_rows + $mat_columns + 2 + $var_checkbox] == 1) {
567
- $checked = 'checked';
568
- }
569
- else {
570
- $checked = '';
571
- }
572
- $index = "'".$k.'_'.$l."'";
573
- $matrix .='<td style="text-align:center;"><input name="'.$label_id.'_input_elementform_id_temp'.$k.'_'.$l.'" id="'.$label_id.'_input_elementform_id_temp'.$k.'_'.$l.'" type="'.$matrix_value[$mat_rows+$mat_columns+2].'" '.$checked.' onClick="change_checkbox_values('.$index.','.$label_id.','.$mat_rows.','.$mat_columns.')"/></td>';
574
- $var_checkbox++;
575
- }
576
- }
577
- else {
578
- if ($matrix_value[$mat_rows + $mat_columns + 2] == "text") {
579
- for ($l = 1; $l <= $mat_columns; $l++) {
580
- $text_value = $matrix_value[$mat_rows+$mat_columns+2+$var_checkbox];
581
- $index = "'".$k.'_'.$l."'";
582
- $matrix .= '<td style="text-align:center;"><input name="'.$label_id.'_input_elementform_id_temp'.$k.'_'.$l.'" id="'.$label_id.'_input_elementform_id_temp'.$k.'_'.$l.'" type="'.$matrix_value[$mat_rows+$mat_columns+2].'" value="'.$text_value.'" onKeyUp="change_text_values('.$index.','.$label_id.','.$mat_rows.','.$mat_columns.')"/></td>';
583
- $var_checkbox++;
584
- }
585
- }
586
- else {
587
- for ($l = 1; $l <= $mat_columns; $l++) {
588
- $selected_text = $matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox];
589
- if ($selected_text == 'yes') {
590
- $selected_value_yes = 'selected';
591
- $selected_value_no = '';
592
- $selected_value = '';
593
- }
594
- else {
595
- if ($selected_text=='no') {
596
- $selected_value_yes ='';
597
- $selected_value_no ='selected';
598
- $selected_value ='';
599
- }
600
- else {
601
- $selected_value_yes = '';
602
- $selected_value_no ='';
603
- $selected_value ='selected';
604
- }
605
- }
606
- $index = "'".$k.'_'.$l."'";
607
- $matrix .= '<td style="text-align:center;"><select name="'.$label_id.'_select_yes_noform_id_temp'.$k.'_'.$l.'" id="'.$label_id.'_select_yes_noform_id_temp'.$k.'_'.$l.'" onChange="change_option_values('.$index.','.$label_id.','.$mat_rows.','.$mat_columns.')"><option value="" '.$selected_value.'></option><option value="yes" '.$selected_value_yes.' >Yes</option><option value="no" '.$selected_value_no.'>No</option></select></td>';
608
- $var_checkbox++;
609
- }
610
- }
611
- }
612
- }
613
- $matrix .= '</tr>';
614
- }
615
- $matrix .= '</table>';
616
- array_push($type_matrix_array, $matrix);
617
- array_push($type_matrix_array, $new_filename);
618
- return $type_matrix_array;
619
- }
620
-
621
- public function select_data_from_db_for_labels($db_info,$label_column, $table, $where, $order_by) {
622
- global $wpdb;
623
-
624
- $query = "SELECT `" . $label_column . "` FROM " . $table . $where . " ORDER BY " . $order_by;
625
- if($db_info) {
626
- $temp = explode('@@@wdfhostwdf@@@',$db_info);
627
- $host = $temp[0];
628
- $temp = explode('@@@wdfportwdf@@@',$temp[1]);
629
- $port = $temp[0];
630
- $temp = explode('@@@wdfusernamewdf@@@',$temp[1]);
631
- $username = $temp[0];
632
- $temp = explode('@@@wdfpasswordwdf@@@',$temp[1]);
633
- $password = $temp[0];
634
- $temp = explode('@@@wdfdatabasewdf@@@',$temp[1]);
635
- $database = $temp[0];
636
-
637
- $wpdb_temp = new wpdb($username, $password, $database, $host);
638
- $choices_labels = $wpdb_temp->get_col($query);
639
- }
640
- else {
641
- $choices_labels = $wpdb->get_col($query);
642
- }
643
- return $choices_labels;
644
- }
645
- public function select_data_from_db_for_values($db_info,$value_column, $table, $where, $order_by) {
646
- global $wpdb;
647
- $query = "SELECT `" . $value_column . "` FROM " . $table . $where . " ORDER BY " . $order_by;
648
- if($db_info) {
649
- $temp = explode('@@@wdfhostwdf@@@',$db_info);
650
- $host = $temp[0];
651
- $temp = explode('@@@wdfportwdf@@@',$temp[1]);
652
- $port = $temp[0];
653
- $temp = explode('@@@wdfusernamewdf@@@',$temp[1]);
654
- $username = $temp[0];
655
- $temp = explode('@@@wdfpasswordwdf@@@',$temp[1]);
656
- $password = $temp[0];
657
- $temp = explode('@@@wdfdatabasewdf@@@',$temp[1]);
658
- $database = $temp[0];
659
-
660
- $wpdb_temp = new wpdb($username, $password, $database, $host);
661
- $choices_values = $wpdb_temp->get_col($query);
662
- }
663
- else {
664
- $choices_values = $wpdb->get_col($query);
665
- }
666
- return $choices_values;
667
- }
668
- public function get_subs_count($form_id) {
669
- global $wpdb;
670
- $query = $wpdb->prepare("SELECT distinct group_id FROM " . $wpdb->prefix . "formmaker_submits where form_id=%d", $form_id);
671
- $group_id_s = $wpdb->get_col($query);
672
- return count($group_id_s);
673
- }
674
- }
675
-
676
- ?>
1
+ <?php
2
+ class FMModelSubmissions_fm {
3
+ ////////////////////////////////////////////////////////////////////////////////////////
4
+ // Events //
5
+ ////////////////////////////////////////////////////////////////////////////////////////
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ // Constants //
8
+ ////////////////////////////////////////////////////////////////////////////////////////
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ // Variables //
11
+ ////////////////////////////////////////////////////////////////////////////////////////
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ // Constructor & Destructor //
14
+ ////////////////////////////////////////////////////////////////////////////////////////
15
+ public function __construct() {
16
+ }
17
+ ////////////////////////////////////////////////////////////////////////////////////////
18
+ // Public Methods //
19
+ ////////////////////////////////////////////////////////////////////////////////////////
20
+ public function blocked_ips() {
21
+ global $wpdb;
22
+ $ips = $wpdb->get_col('SELECT ip FROM ' . $wpdb->prefix . 'formmaker_blocked');
23
+ return $ips;
24
+ }
25
+
26
+ public function get_form_titles() {
27
+ global $wpdb;
28
+ $query = "SELECT id, title FROM " . $wpdb->prefix . "formmaker WHERE `id` NOT IN(" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ") order by title";
29
+ $forms = $wpdb->get_results($query);
30
+ return $forms;
31
+ }
32
+
33
+ public function get_statistics($form_id) {
34
+ global $wpdb;
35
+ $statistics = array();
36
+ $query = $wpdb->prepare('SELECT count(distinct group_id) FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id ="%d"', $form_id);
37
+ $statistics["total_entries"] = $wpdb->get_var($query);
38
+ $query = $wpdb->prepare('SELECT `views` FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="%d"', $form_id);
39
+ $statistics["total_views"] = $wpdb->get_var($query);
40
+ if ($statistics["total_views"]) {
41
+ $statistics["conversion_rate"] = round((($statistics["total_entries"] / $statistics["total_views"]) * 100), 2) . '%';
42
+ }
43
+ else {
44
+ $statistics["conversion_rate"] = '0%';
45
+ }
46
+ return $statistics;
47
+ }
48
+
49
+ public function get_labels_parameters($form_id) {
50
+ global $wpdb;
51
+ $labels = array();
52
+ $labels_id = array();
53
+ $sorted_labels_id = array();
54
+ $label_names = array();
55
+ $label_types = array();
56
+ $sorted_label_types = array();
57
+ $label_names_original = array();
58
+ $labels_parameters = array();
59
+ $join_query = array();
60
+ $join_where = array();
61
+ $rows_ord = array();
62
+ $join = '';
63
+ for ($i = 0; $i < 8; $i++) {
64
+ array_push($labels_parameters, NULL);
65
+ }
66
+ $sorted_label_names = array();
67
+ $sorted_label_names_original = array();
68
+ $where_labels = array();
69
+ $where2 = array();
70
+
71
+ $pagination_clicked = (isset($_POST['pagination_clicked']) && $_POST['pagination_clicked'] == '1' ? '1' : '0');
72
+
73
+ $order_by = ((isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) != '') ? esc_html(stripslashes($_POST['order_by'])) : 'group_id');
74
+ $asc_or_desc = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'asc') ? 'asc' : 'desc');
75
+ $limit = ((isset($_POST['page_number'])) ? ((int) $_POST['page_number'] - 1) * 20 : 0);
76
+ $lists['hide_label_list'] = ((isset($_POST['hide_label_list'])) ? esc_html(stripslashes($_POST['hide_label_list'])) : '');
77
+ $lists['startdate'] = ((isset($_POST['startdate'])) ? esc_html(stripslashes($_POST['startdate'])) : '');
78
+ $lists['enddate'] = ((isset($_POST['enddate'])) ? esc_html(stripslashes($_POST['enddate'])) : '');
79
+ $lists['ip_search'] = ((isset($_POST['ip_search'])) ? esc_html(stripslashes($_POST['ip_search'])) : '');
80
+
81
+ $lists['username_search'] = ((isset($_POST['username_search'])) ? esc_html(stripslashes($_POST['username_search'])) : '');
82
+ $lists['useremail_search'] = ((isset($_POST['useremail_search'])) ? esc_html(stripslashes($_POST['useremail_search'])) : '');
83
+ $lists['id_search'] = ((isset($_POST['id_search'])) ? esc_html(stripslashes($_POST['id_search'])) : '');
84
+
85
+ if ($lists['ip_search']) {
86
+ $where[] = 'ip LIKE "%' . $lists['ip_search'] . '%"';
87
+ }
88
+ if ($lists['startdate'] != '') {
89
+ $where[] = " `date`>='" . $lists['startdate'] . " 00:00:00' ";
90
+ }
91
+ if ($lists['enddate'] != '') {
92
+ $where[] = " `date`<='" . $lists['enddate'] . " 23:59:59' ";
93
+ }
94
+
95
+
96
+ if ($lists['username_search']) {
97
+ $where[] = 'user_id_wd IN (SELECT ID FROM ' . $wpdb->prefix . 'users WHERE display_name LIKE "%'.$lists['username_search'].'%")';
98
+ }
99
+ if ($lists['useremail_search']) {
100
+ $where[] = 'user_id_wd IN (SELECT ID FROM ' . $wpdb->prefix . 'users WHERE user_email LIKE "%'.$lists['useremail_search'].'%")';
101
+ }
102
+
103
+ if ($lists['id_search']) {
104
+ $where[] = 'group_id ='.$lists['id_search'];
105
+ }
106
+
107
+ $where[] = 'form_id=' . $form_id . '';
108
+ $where = (count($where) ? ' ' . implode(' AND ', $where) : '');
109
+ if ($order_by == 'group_id' or $order_by == 'date' or $order_by == 'ip') {
110
+ $orderby = ' ORDER BY ' . $order_by . ' ' . $asc_or_desc . '';
111
+ }elseif($order_by == 'display_name' or $order_by == 'user_email'){
112
+ $orderby = ' ORDER BY (SELECT '.$order_by.' FROM ' . $wpdb->prefix . 'users WHERE ID=user_id_wd) '. $asc_or_desc .'';
113
+ }
114
+ else {
115
+ $orderby = "";
116
+ }
117
+ if ($form_id) {
118
+ for($i = 0; $i < 8; $i++) {
119
+ array_pop($labels_parameters);
120
+ }
121
+ $query = "SELECT distinct element_label FROM " . $wpdb->prefix . "formmaker_submits WHERE ". $where;
122
+ $results = $wpdb->get_results($query);
123
+ for ($i = 0; $i < count($results); $i++) {
124
+ array_push($labels, $results[$i]->element_label);
125
+ }
126
+ $form = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id='%d'", $form_id));
127
+ if (strpos($form->label_order, 'type_paypal_')) {
128
+ $form->label_order = $form->label_order . "item_total#**id**#Item Total#**label**#type_paypal_payment_total#****#total#**id**#Total#**label**#type_paypal_payment_total#****#0#**id**#Payment Status#**label**#type_paypal_payment_status#****#";
129
+ }
130
+
131
+ $form_labels = explode('#****#', $form->label_order);
132
+ $form_labels = array_slice($form_labels, 0, count($form_labels) - 1);
133
+
134
+ foreach ($form_labels as $key => $form_label) {
135
+ $label_id = explode('#**id**#', $form_label);
136
+ array_push($labels_id, $label_id[0]);
137
+ $label_name_type = explode('#**label**#', $label_id[1]);
138
+ array_push($label_names_original, $label_name_type[0]);
139
+ $ptn = "/[^a-zA-Z0-9_]/";
140
+ $rpltxt = "";
141
+ $label_name = preg_replace($ptn, $rpltxt, $label_name_type[0]);
142
+ array_push($label_names, $label_name);
143
+ array_push($label_types, $label_name_type[1]);
144
+ }
145
+
146
+ foreach ($labels_id as $key => $label_id) {
147
+ if (in_array($label_id, $labels)) {
148
+ if (!in_array($label_id, $sorted_labels_id)) {
149
+ array_push($sorted_labels_id, $label_id);
150
+ }
151
+ array_push($sorted_label_names, $label_names[$key]);
152
+ array_push($sorted_label_types, $label_types[$key]);
153
+ array_push($sorted_label_names_original, $label_names_original[$key]);
154
+ if (isset($_POST[$form_id . '_' . $label_id . '_search'])) {
155
+ $search_temp = esc_html($_POST[$form_id . '_' . $label_id . '_search']);
156
+ }
157
+ else {
158
+ $search_temp = '';
159
+ }
160
+ $search_temp = strtolower($search_temp);
161
+ $lists[$form_id . '_' . $label_id . '_search'] = $search_temp;
162
+ if ($search_temp) {
163
+ $join_query[] = 'search';
164
+ $join_where[] = array('label' => $label_id, 'search' => $search_temp);
165
+ }
166
+ }
167
+ }
168
+ if (strpos($order_by, "_field")) {
169
+ if (in_array(str_replace("_field", "", $order_by), $labels)) {
170
+ $join_query[] = 'sort';
171
+ $join_where[] = array('label'=>str_replace("_field", "", $order_by));
172
+ }
173
+ }
174
+ $cols = 'group_id';
175
+ if ($order_by == 'date' or $order_by == 'ip') {
176
+ $cols = 'group_id, date, ip';
177
+ }
178
+ switch (count($join_query)) {
179
+ case 0:
180
+ $join = 'SELECT distinct group_id FROM ' . $wpdb->prefix . 'formmaker_submits WHERE '. $where;
181
+ break;
182
+ case 1:
183
+ if ($join_query[0] == 'sort') {
184
+ $join = 'SELECT group_id FROM ' . $wpdb->prefix . 'formmaker_submits WHERE ' . $where . ' AND element_label="' . $join_where[0]['label'] . '" ';
185
+ $join_count = 'SELECT count(group_id) FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id="' . $form_id . '" AND element_label="' . $join_where[0]['label'] . '" ';
186
+ $orderby = ' ORDER BY `element_value` ' . $asc_or_desc;
187
+ }
188
+ else {
189
+ $join = 'SELECT group_id FROM ' . $wpdb->prefix . 'formmaker_submits WHERE element_label="' . $join_where[0]['label'] . '" AND (element_value LIKE "%' . $join_where[0]['search'] . '%" OR element_value LIKE "%' . str_replace(' ', '@@@', $join_where[0]['search']) . '%") AND ' . $where;
190
+ }
191
+ break;
192
+ default:
193
+ $join = 'SELECT t.group_id FROM (SELECT ' . $cols . ' FROM ' . $wpdb->prefix . 'formmaker_submits WHERE ' . $where . ' AND element_label="' . $join_where[0]['label'] . '" AND (element_value LIKE "%' . $join_where[0]['search'] . '%" OR element_value LIKE "%' . str_replace(' ', '@@@', $join_where[0]['search']) . '%" ) ) as t ';
194
+ for ($key = 1; $key < count($join_query); $key++) {
195
+ if ($join_query[$key] == 'sort') {
196
+ $join .= 'LEFT JOIN (SELECT group_id as group_id' . $key . ', element_value FROM ' . $wpdb->prefix . 'formmaker_submits WHERE ' . $where . ' AND element_label="' . $join_where[$key]['label'] . '") as t' . $key . ' ON t' . $key . '.group_id' . $key . '=t.group_id ';
197
+ $orderby = ' ORDER BY t' . $key . '.`element_value` ' . $asc_or_desc . '';
198
+ }
199
+ else {
200
+ $join .= 'INNER JOIN (SELECT group_id as group_id' . $key . ' FROM ' . $wpdb->prefix . 'formmaker_submits WHERE '.$where.' AND element_label="' . $join_where[$key]['label'] . '" AND (element_value LIKE "%' . $join_where[$key]['search'] . '%" OR element_value LIKE "%' . str_replace(' ', '@@@', $join_where[$key]['search']) . '%") ) as t' . $key . ' ON t' . $key . '.group_id' . $key . '=t.group_id ';
201
+ }
202
+ }
203
+ break;
204
+ }
205
+ $pos = strpos($join, 'SELECT t.group_id');
206
+ if ($pos === FALSE) {
207
+ $query = str_replace(array('SELECT group_id','SELECT distinct group_id'), array('SELECT count(distinct group_id)','SELECT count(distinct group_id)'), $join);
208
+ }
209
+ else {
210
+ $query = str_replace('SELECT t.group_id', 'SELECT count(t.group_id)', $join);
211
+ }
212
+ $total = $wpdb->get_var($query);
213
+
214
+ $query_sub_count = "SELECT count(distinct group_id) from ".$wpdb->prefix."formmaker_submits";
215
+ $sub_count = (int)$wpdb->get_var($query_sub_count);
216
+
217
+ $limit1 = (int)$total < $sub_count && !$pagination_clicked ? 0 : $limit;
218
+
219
+ $query = $join . ' ' . $orderby . ' limit ' . $limit1 . ', 20 ';
220
+ $results = $wpdb->get_results($query);
221
+ for ($i = 0; $i < count($results); $i++) {
222
+ array_push($rows_ord, $results[$i]->group_id);
223
+ }
224
+ $where2 = array();
225
+ $where2[] = "group_id='0'";
226
+ foreach ($rows_ord as $rows_ordd) {
227
+ $where2[] = "group_id='" . $rows_ordd . "'";
228
+ }
229
+ $where2 = (count($where2) ? ' WHERE ' . implode( ' OR ', $where2 ) . '' : '' );
230
+ $query = 'SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits ' . $where2;
231
+ $rows = $wpdb->get_results($query);
232
+ $group_ids = $rows_ord;
233
+ $lists['total'] = $total;
234
+ $lists['limit'] = (int) ($limit1 / 20 + 1);
235
+ $where_choices = $where;
236
+ array_push($labels_parameters, $sorted_labels_id);
237
+ array_push($labels_parameters, $sorted_label_types);
238
+ array_push($labels_parameters, $lists);
239
+ array_push($labels_parameters, $sorted_label_names);
240
+ array_push($labels_parameters, $sorted_label_names_original);
241
+ array_push($labels_parameters, $rows);
242
+ array_push($labels_parameters, $group_ids);
243
+ array_push($labels_parameters, $where_choices);
244
+ }
245
+ return $labels_parameters;
246
+ }
247
+
248
+ public function get_type_address($sorted_label_type, $sorted_label_name_original) {
249
+ if ($sorted_label_type == 'type_address') {
250
+ switch ($sorted_label_name_original) {
251
+ case 'Street Line':
252
+ $field_title = __('Street Address', 'form_maker');
253
+ break;
254
+ case 'Street Line2':
255
+ $field_title = __('Street Address Line 2', 'form_maker');
256
+ break;
257
+ case 'City':
258
+ $field_title = __('City', 'form_maker');
259
+ break;
260
+ case 'State':
261
+ $field_title = __('State / Province / Region', 'form_maker');
262
+ break;
263
+ case 'Postal':
264
+ $field_title = __('Postal / Zip Code', 'form_maker');
265
+ break;
266
+ case 'Country':
267
+ $field_title = __('Country', 'form_maker');
268
+ break;
269
+ default :
270
+ $field_title = stripslashes($sorted_label_name_original);
271
+ break;
272
+ }
273
+ }
274
+ else {
275
+ $field_title = stripslashes($sorted_label_name_original);
276
+ }
277
+ return $field_title;
278
+ }
279
+
280
+ public function hide_or_not($hide_strings,$hide_string) {
281
+ if (strpos($hide_string,'@') === FALSE) {
282
+ if (strpos($hide_strings, '@' . $hide_string . '@') === FALSE) {
283
+ $style = '';
284
+ }
285
+ else {
286
+ $style = 'style="display:none"';
287
+ }
288
+ }
289
+ else {
290
+ if (strpos($hide_strings, $hide_string) === FALSE) {
291
+ $style = '';
292
+ }
293
+ else {
294
+ $style = 'style="display:none"';
295
+ }
296
+ }
297
+ return $style;
298
+ }
299
+
300
+ public function sort_group_ids($sorted_label_names_count, $group_ids) {
301
+ $count_labe = $sorted_label_names_count;
302
+ $group_id_s = array();
303
+ $l = 0;
304
+ if (count($group_ids) > 0 and $count_labe) {
305
+ for ($i = 0; $i < count($group_ids); $i++) {
306
+ if (!in_array($group_ids[$i], $group_id_s)) {
307
+ array_push($group_id_s, $group_ids[$i]);
308
+ }
309
+ }
310
+ }
311
+ return $group_id_s;
312
+ }
313
+
314
+ public function array_for_group_id($group, $rows) {
315
+ $i = $group;
316
+ $count_rows = count($rows);
317
+ $temp = array();
318
+ for ($j = 0; $j < $count_rows; $j++) {
319
+ $row = $rows[$j];
320
+ if ($row->group_id == $i) {
321
+ array_push($temp, $row);
322
+ }
323
+ }
324
+ return $temp;
325
+ }
326
+
327
+ public function check_radio_type($sorted_label_type) {
328
+ 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") {
329
+ return TRUE;
330
+ }
331
+ else {
332
+ return FALSE;
333
+ }
334
+ }
335
+
336
+ public function statistic_for_radio($where_choices, $sorted_label_id) {
337
+ global $wpdb;
338
+ $choices_params = array();
339
+ $query = "SELECT element_value FROM " . $wpdb->prefix . "formmaker_submits WHERE " . $where_choices . " AND element_label='" . $sorted_label_id . "'";
340
+ $choices = $wpdb->get_results($query);
341
+ $colors=array('#5FE2FF','#F9E89C');
342
+ $choices_colors=array('#4EC0D9','#DDCC7F');
343
+ $choices_labels = array();
344
+ $choices_count = array();
345
+ $all = count($choices);
346
+ $unanswered = 0;
347
+ foreach ($choices as $key => $choice) {
348
+ if ($choice->element_value == '') {
349
+ $unanswered++;
350
+ }
351
+ else {
352
+ if (!in_array($choice->element_value, $choices_labels)) {
353
+ array_push($choices_labels, $choice->element_value);
354
+ array_push($choices_count, 0);
355
+ }
356
+ $choices_count[array_search($choice->element_value, $choices_labels)]++;
357
+ }
358
+ }
359
+ array_multisort($choices_count, SORT_DESC, $choices_labels);
360
+ array_push($choices_params, $choices_count);
361
+ array_push($choices_params, $choices_labels);
362
+ array_push($choices_params, $unanswered);
363
+ array_push($choices_params, $all);
364
+ array_push($choices_params, $colors);
365
+ array_push($choices_params, $choices_colors);
366
+ return $choices_params;
367
+ }
368
+
369
+ public function get_data_of_group_id($id) {
370
+ global $wpdb;
371
+ $query = "SELECT * FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id=" . $id;
372
+ $rows = $wpdb->get_results($query);
373
+ $form = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id=" . $rows[0]->form_id);
374
+ $params = array();
375
+ $label_id = array();
376
+ $label_order_original = array();
377
+ $label_type = array();
378
+ $ispaypal = strpos($form->label_order, 'type_paypal_');
379
+ if ($form->paypal_mode == 1) {
380
+ if ($ispaypal) {
381
+ $form->label_order = $form->label_order."0#**id**#Payment Status#**label**#type_paypal_payment_status#****#";
382
+ }
383
+ }
384
+ $label_all = explode('#****#', $form->label_order);
385
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
386
+ foreach ($label_all as $key => $label_each) {
387
+ $label_id_each = explode('#**id**#', $label_each);
388
+ array_push($label_id, $label_id_each[0]);
389
+ $label_oder_each = explode('#**label**#', $label_id_each[1]);
390
+ array_push($label_order_original, $label_oder_each[0]);
391
+ array_push($label_type, $label_oder_each[1]);
392
+ }
393
+ /*$theme_id = $wpdb->get_var("SELECT theme FROM " . $wpdb->prefix . "formmaker WHERE id='" . $form->id . "'");*/
394
+ $css = $wpdb->get_var("SELECT css FROM " . $wpdb->prefix . "formmaker_themes");
395
+ array_push($params, $rows);
396
+ array_push($params, $label_id);
397
+ array_push($params, $label_order_original);
398
+ array_push($params, $label_type);
399
+ array_push($params, $ispaypal);
400
+ array_push($params, $form);
401
+ array_push($params, $css);
402
+ return $params;
403
+ }
404
+
405
+ public function check_type_for_edit_function($label_type) {
406
+ 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') {
407
+ return TRUE;
408
+ }
409
+ else {
410
+ return FALSE;
411
+ }
412
+ }
413
+
414
+ public function check_for_submited_label($rows, $label_id) {
415
+ foreach ($rows as $row) {
416
+ if ($row->element_label == $label_id) {
417
+ $element_value = $row->element_value;
418
+ break;
419
+ }
420
+ else {
421
+ $element_value = 'continue';
422
+ }
423
+ }
424
+ return $element_value;
425
+ }
426
+
427
+ public function view_for_star_rating($element_value, $element_label) {
428
+ $view_star_rating_array = array();
429
+ $new_filename = str_replace("***star_rating***", '', $element_value);
430
+ $stars = "";
431
+ $new_filename=explode('***', $new_filename);
432
+ for ($j = 0; $j < $new_filename[1]; $j++) {
433
+ $stars .= '<img id="' . $element_label . '_star_' . $j . '" src="' . WD_FM_URL . '/images/star_' . $new_filename[2] . '.png?ver='. get_option("wd_form_maker_version").'" /> ';
434
+ }
435
+ for ($k = $new_filename[1]; $k < $new_filename[0]; $k++) {
436
+ $stars .= '<img id="' . $element_label . '_star_' . $k . '" src="' . WD_FM_URL . '/images/star.png?ver='. get_option("wd_form_maker_version").'" /> ';
437
+ }
438
+ array_push($view_star_rating_array, $stars);
439
+ return $view_star_rating_array;
440
+ }
441
+
442
+ public function view_for_grading($element_value) {
443
+ $view_grading_array = array();
444
+ $new_filename = str_replace("***grading***", '', $element_value);
445
+ $grading = explode(":", $new_filename);
446
+ $items_count = sizeof($grading) - 1;
447
+ $items = "";
448
+ $total = "";
449
+ for ($k = 0; $k < $items_count / 2; $k++) {
450
+ $items .= $grading[$items_count / 2 + $k] . ": " . $grading[$k] . "</br>";
451
+ $total += $grading[$k];
452
+ }
453
+ $items .= "Total: " . $total;
454
+ array_push($view_grading_array, $items);
455
+ return $view_grading_array;
456
+ }
457
+
458
+ public function images_for_star_rating($element_value, $label_id) {
459
+ $edit_stars = "";
460
+ $star_rating_array = array();
461
+ $element_value1 = str_replace("***star_rating***", '', $element_value);
462
+ $stars_value = explode('***', $element_value1);
463
+ for ($j = 0; $j < $stars_value[1]; $j++) {
464
+ $edit_stars .= '<img id="'.$label_id.'_star_'.$j.'" onclick="edit_star_rating('.$j.','.$label_id.')" src="' . WD_FM_URL . '/images/star_'.$stars_value[2].'.png?ver='. get_option("wd_form_maker_version").'" /> ';
465
+ }
466
+ for( $k=$stars_value[1];$k<$stars_value[0];$k++) {
467
+ $edit_stars .= '<img id="'.$label_id.'_star_'.$k.'" onclick="edit_star_rating('.$k.','.$label_id.')" src="' . WD_FM_URL . '/images/star.png?ver='. get_option("wd_form_maker_version").'" /> ';
468
+ }
469
+ array_push($star_rating_array, $edit_stars);
470
+ array_push($star_rating_array, $stars_value);
471
+ return $star_rating_array;
472
+ }
473
+
474
+ public function params_for_scale_rating($element_value, $label_id) {
475
+ $scale_rating_array = array();
476
+ $scale_radio = explode('/', $element_value);
477
+ $scale_value = $scale_radio[0];
478
+ $scale = '<table><tr>';
479
+ for ($k = 1; $k <= $scale_radio[1]; $k++) {
480
+ $scale .= '<td style="text-align:center"><span>' . $k . '</span></td>';
481
+ }
482
+ $scale .= '<tr></tr>';
483
+ for ($l = 1; $l <= $scale_radio[1]; $l++) {
484
+ if ($l == $scale_radio[0]) {
485
+ $checked = "checked";
486
+ }
487
+ else {
488
+ $checked = "";
489
+ }
490
+ $scale .= '<td><input type="radio" name = "'.$label_id.'_scale_rating_radio" id = "'.$label_id.'_scale_rating_radio_'.$l.'" value="'.$l.'" '.$checked.' onClick="edit_scale_rating(this.value,'.$label_id.')" /></td>';
491
+ }
492
+ $scale .= '</tr></table>';
493
+ array_push($scale_rating_array, $scale);
494
+ array_push($scale_rating_array, $scale_radio);
495
+ array_push($scale_rating_array, $checked);
496
+ return $scale_rating_array;
497
+ }
498
+
499
+ public function params_for_type_range($element_value, $label_id) {
500
+ $range_value = explode('-', $element_value);
501
+ $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"/>';
502
+ return $range;
503
+ }
504
+
505
+ public function params_for_type_grading($element_value, $label_id) {
506
+ $type_grading_array = array();
507
+ $element_value1 = str_replace("***grading***", '', $element_value);
508
+ $garding_value = explode(':', $element_value1);
509
+ $items_count = sizeof($garding_value) - 1;
510
+ $garding = "";
511
+ $sum = "";
512
+ for ($k = 0; $k < $items_count/2; $k++) {
513
+ $garding .= '<input name="'.$label_id.'_element'.$k.'" id="'.$label_id.'_element'.$k.'" type="text" value="'.$garding_value[$k].'" onKeyUp="edit_grading('.$label_id.','.$items_count.')" size="5"/> '.$garding_value[$items_count/2+$k].'</br>';
514
+ $sum += $garding_value[$k];
515
+ }
516
+ array_push($type_grading_array, $garding);
517
+ array_push($type_grading_array, $garding_value);
518
+ array_push($type_grading_array, $sum);
519
+ array_push($type_grading_array, $items_count);
520
+ array_push($type_grading_array, $element_value1);
521
+ return $type_grading_array;
522
+ }
523
+
524
+ public function params_for_type_matrix($element_value, $label_id) {
525
+ $type_matrix_array = array();
526
+ $new_filename = str_replace("***matrix***", '', $element_value);
527
+ $matrix_value = explode('***', $new_filename);
528
+ $matrix_value = array_slice($matrix_value, 0, count($matrix_value) - 1);
529
+ $mat_rows = $matrix_value[0];
530
+ $mat_columns = $matrix_value[$mat_rows + 1];
531
+ $matrix = "<table>";
532
+ $matrix .= '<tr><td></td>';
533
+ for ($k = 1; $k <= $mat_columns; $k++) {
534
+ $matrix .= '<td style="background-color:#BBBBBB; padding:5px; border:1px; ">'.$matrix_value[$mat_rows+1+$k].'</td>';
535
+ }
536
+ $matrix .= '</tr>';
537
+ $aaa = Array();
538
+ $var_checkbox = 1;
539
+ $selected_value = "";
540
+ $selected_value_yes = "";
541
+ $selected_value_no = "";
542
+ for ($k = 1; $k <= $mat_rows; $k++) {
543
+ $matrix .= '<tr><td style="background-color:#BBBBBB; padding:5px; border:1px;">'.$matrix_value[$k].'</td>';
544
+ if ($matrix_value[$mat_rows + $mat_columns + 2] == "radio") {
545
+ if ($matrix_value[$mat_rows + $mat_columns + 2 + $k] == 0) {
546
+ $checked = "";
547
+ $aaa[1] = "";
548
+ }
549
+ else {
550
+ $aaa = explode("_", $matrix_value[$mat_rows + $mat_columns + 2 + $k]);
551
+ }
552
+ for ($l = 1; $l <= $mat_columns; $l++) {
553
+ if ($aaa[1] == $l) {
554
+ $checked = 'checked';
555
+ }
556
+ else {
557
+ $checked = "";
558
+ }
559
+ $index = "'" . $k . '_' . $l . "'";
560
+ $matrix .= '<td style="text-align:center;"><input name="'.$label_id.'_input_elementform_id_temp'.$k.'" id="'.$label_id.'_input_elementform_id_temp'.$k.'_'.$l.'" type="'.$matrix_value[$mat_rows+$mat_columns+2].'" '.$checked.' onClick="change_radio_values('.$index.','.$label_id.','.$mat_rows.','.$mat_columns.')"/></td>';
561
+ }
562
+ }
563
+ else {
564
+ if ($matrix_value[$mat_rows+$mat_columns+2] == "checkbox") {
565
+ for ($l = 1; $l <= $mat_columns; $l++) {
566
+ if ($matrix_value[$mat_rows + $mat_columns + 2 + $var_checkbox] == 1) {
567
+ $checked = 'checked';
568
+ }
569
+ else {
570
+ $checked = '';
571
+ }
572
+ $index = "'".$k.'_'.$l."'";
573
+ $matrix .='<td style="text-align:center;"><input name="'.$label_id.'_input_elementform_id_temp'.$k.'_'.$l.'" id="'.$label_id.'_input_elementform_id_temp'.$k.'_'.$l.'" type="'.$matrix_value[$mat_rows+$mat_columns+2].'" '.$checked.' onClick="change_checkbox_values('.$index.','.$label_id.','.$mat_rows.','.$mat_columns.')"/></td>';
574
+ $var_checkbox++;
575
+ }
576
+ }
577
+ else {
578
+ if ($matrix_value[$mat_rows + $mat_columns + 2] == "text") {
579
+ for ($l = 1; $l <= $mat_columns; $l++) {
580
+ $text_value = $matrix_value[$mat_rows+$mat_columns+2+$var_checkbox];
581
+ $index = "'".$k.'_'.$l."'";
582
+ $matrix .= '<td style="text-align:center;"><input name="'.$label_id.'_input_elementform_id_temp'.$k.'_'.$l.'" id="'.$label_id.'_input_elementform_id_temp'.$k.'_'.$l.'" type="'.$matrix_value[$mat_rows+$mat_columns+2].'" value="'.$text_value.'" onKeyUp="change_text_values('.$index.','.$label_id.','.$mat_rows.','.$mat_columns.')"/></td>';
583
+ $var_checkbox++;
584
+ }
585
+ }
586
+ else {
587
+ for ($l = 1; $l <= $mat_columns; $l++) {
588
+ $selected_text = $matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox];
589
+ if ($selected_text == 'yes') {
590
+ $selected_value_yes = 'selected';
591
+ $selected_value_no = '';
592
+ $selected_value = '';
593
+ }
594
+ else {
595
+ if ($selected_text=='no') {
596
+ $selected_value_yes ='';
597
+ $selected_value_no ='selected';
598
+ $selected_value ='';
599
+ }
600
+ else {
601
+ $selected_value_yes = '';
602
+ $selected_value_no ='';
603
+ $selected_value ='selected';
604
+ }
605
+ }
606
+ $index = "'".$k.'_'.$l."'";
607
+ $matrix .= '<td style="text-align:center;"><select name="'.$label_id.'_select_yes_noform_id_temp'.$k.'_'.$l.'" id="'.$label_id.'_select_yes_noform_id_temp'.$k.'_'.$l.'" onChange="change_option_values('.$index.','.$label_id.','.$mat_rows.','.$mat_columns.')"><option value="" '.$selected_value.'></option><option value="yes" '.$selected_value_yes.' >Yes</option><option value="no" '.$selected_value_no.'>No</option></select></td>';
608
+ $var_checkbox++;
609
+ }
610
+ }
611
+ }
612
+ }
613
+ $matrix .= '</tr>';
614
+ }
615
+ $matrix .= '</table>';
616
+ array_push($type_matrix_array, $matrix);
617
+ array_push($type_matrix_array, $new_filename);
618
+ return $type_matrix_array;
619
+ }
620
+
621
+ public function select_data_from_db_for_labels($db_info,$label_column, $table, $where, $order_by) {
622
+ global $wpdb;
623
+
624
+ $query = "SELECT `" . $label_column . "` FROM " . $table . $where . " ORDER BY " . $order_by;
625
+ if($db_info) {
626
+ $temp = explode('@@@wdfhostwdf@@@',$db_info);
627
+ $host = $temp[0];
628
+ $temp = explode('@@@wdfportwdf@@@',$temp[1]);
629
+ $port = $temp[0];
630
+ $temp = explode('@@@wdfusernamewdf@@@',$temp[1]);
631
+ $username = $temp[0];
632
+ $temp = explode('@@@wdfpasswordwdf@@@',$temp[1]);
633
+ $password = $temp[0];
634
+ $temp = explode('@@@wdfdatabasewdf@@@',$temp[1]);
635
+ $database = $temp[0];
636
+
637
+ $wpdb_temp = new wpdb($username, $password, $database, $host);
638
+ $choices_labels = $wpdb_temp->get_col($query);
639
+ }
640
+ else {
641
+ $choices_labels = $wpdb->get_col($query);
642
+ }
643
+ return $choices_labels;
644
+ }
645
+ public function select_data_from_db_for_values($db_info,$value_column, $table, $where, $order_by) {
646
+ global $wpdb;
647
+ $query = "SELECT `" . $value_column . "` FROM " . $table . $where . " ORDER BY " . $order_by;
648
+ if($db_info) {
649
+ $temp = explode('@@@wdfhostwdf@@@',$db_info);
650
+ $host = $temp[0];
651
+ $temp = explode('@@@wdfportwdf@@@',$temp[1]);
652
+ $port = $temp[0];
653
+ $temp = explode('@@@wdfusernamewdf@@@',$temp[1]);
654
+ $username = $temp[0];
655
+ $temp = explode('@@@wdfpasswordwdf@@@',$temp[1]);
656
+ $password = $temp[0];
657
+ $temp = explode('@@@wdfdatabasewdf@@@',$temp[1]);
658
+ $database = $temp[0];
659
+
660
+ $wpdb_temp = new wpdb($username, $password, $database, $host);
661
+ $choices_values = $wpdb_temp->get_col($query);
662
+ }
663
+ else {
664
+ $choices_values = $wpdb->get_col($query);
665
+ }
666
+ return $choices_values;
667
+ }
668
+ public function get_subs_count($form_id) {
669
+ global $wpdb;
670
+ $query = $wpdb->prepare("SELECT distinct group_id FROM " . $wpdb->prefix . "formmaker_submits where form_id=%d", $form_id);
671
+ $group_id_s = $wpdb->get_col($query);
672
+ return count($group_id_s);
673
+ }
674
+ }
675
+
676
+ ?>
admin/models/FMModelThemes_fm.php CHANGED
@@ -1,91 +1,91 @@
1
- <?php
2
-
3
- class FMModelThemes_fm {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function get_rows_data() {
22
- global $wpdb;
23
- $where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
24
- $asc_or_desc = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'desc') ? 'desc' : 'asc');
25
- $order_by_array = array('id', 'title', 'default');
26
- $order_by = isset($_POST['order_by']) && in_array(esc_html(stripslashes($_POST['order_by'])), $order_by_array) ? esc_html(stripslashes($_POST['order_by'])) : 'id';
27
- $order_by = ' ORDER BY `' . $order_by . '` ' . $asc_or_desc;
28
- if (isset($_POST['page_number']) && $_POST['page_number']) {
29
- $limit = ((int) $_POST['page_number'] - 1) * 20;
30
- }
31
- else {
32
- $limit = 0;
33
- }
34
- $query = "SELECT * FROM " . $wpdb->prefix . "formmaker_themes " . $where . $order_by . " LIMIT " . $limit . ",20";
35
- $rows = $wpdb->get_results($query);
36
- return $rows;
37
- }
38
-
39
- public function get_row_data($id, $reset) {
40
- global $wpdb;
41
- if ($id != 0) {
42
- $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id));
43
- if ($reset) {
44
- if (!$row->default) {
45
- $row_id = $row->id;
46
- $row_title = $row->title;
47
- $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_themes WHERE default="%d"', 1));
48
- $row->id = $row_id;
49
- $row->title = $row_title;
50
- $row->default = FALSE;
51
- }
52
- else {
53
- $row->css = '';
54
- }
55
- }
56
- }
57
- else {
58
- $row = new stdClass();
59
- $row->id = 0;
60
- $row->title = '';
61
- $row->css = '';
62
- $row->default = 0;
63
- }
64
- return $row;
65
- }
66
-
67
- public function page_nav() {
68
- global $wpdb;
69
- $where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
70
- $query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker_themes " . $where;
71
- $total = $wpdb->get_var($query);
72
- $page_nav['total'] = $total;
73
- if (isset($_POST['page_number']) && $_POST['page_number']) {
74
- $limit = ((int) $_POST['page_number'] - 1) * 20;
75
- }
76
- else {
77
- $limit = 0;
78
- }
79
- $page_nav['limit'] = (int) ($limit / 20 + 1);
80
- return $page_nav;
81
- }
82
- ////////////////////////////////////////////////////////////////////////////////////////
83
- // Getters & Setters //
84
- ////////////////////////////////////////////////////////////////////////////////////////
85
- ////////////////////////////////////////////////////////////////////////////////////////
86
- // Private Methods //
87
- ////////////////////////////////////////////////////////////////////////////////////////
88
- ////////////////////////////////////////////////////////////////////////////////////////
89
- // Listeners //
90
- ////////////////////////////////////////////////////////////////////////////////////////
91
  }
1
+ <?php
2
+
3
+ class FMModelThemes_fm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function get_rows_data() {
22
+ global $wpdb;
23
+ $where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
24
+ $asc_or_desc = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'desc') ? 'desc' : 'asc');
25
+ $order_by_array = array('id', 'title', 'default');
26
+ $order_by = isset($_POST['order_by']) && in_array(esc_html(stripslashes($_POST['order_by'])), $order_by_array) ? esc_html(stripslashes($_POST['order_by'])) : 'id';
27
+ $order_by = ' ORDER BY `' . $order_by . '` ' . $asc_or_desc;
28
+ if (isset($_POST['page_number']) && $_POST['page_number']) {
29
+ $limit = ((int) $_POST['page_number'] - 1) * 20;
30
+ }
31
+ else {
32
+ $limit = 0;
33
+ }
34
+ $query = "SELECT * FROM " . $wpdb->prefix . "formmaker_themes " . $where . $order_by . " LIMIT " . $limit . ",20";
35
+ $rows = $wpdb->get_results($query);
36
+ return $rows;
37
+ }
38
+
39
+ public function get_row_data($id, $reset) {
40
+ global $wpdb;
41
+ if ($id != 0) {
42
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id));
43
+ if ($reset) {
44
+ if (!$row->default) {
45
+ $row_id = $row->id;
46
+ $row_title = $row->title;
47
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_themes WHERE default="%d"', 1));
48
+ $row->id = $row_id;
49
+ $row->title = $row_title;
50
+ $row->default = FALSE;
51
+ }
52
+ else {
53
+ $row->css = '';
54
+ }
55
+ }
56
+ }
57
+ else {
58
+ $row = new stdClass();
59
+ $row->id = 0;
60
+ $row->title = '';
61
+ $row->css = '';
62
+ $row->default = 0;
63
+ }
64
+ return $row;
65
+ }
66
+
67
+ public function page_nav() {
68
+ global $wpdb;
69
+ $where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
70
+ $query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker_themes " . $where;
71
+ $total = $wpdb->get_var($query);
72
+ $page_nav['total'] = $total;
73
+ if (isset($_POST['page_number']) && $_POST['page_number']) {
74
+ $limit = ((int) $_POST['page_number'] - 1) * 20;
75
+ }
76
+ else {
77
+ $limit = 0;
78
+ }
79
+ $page_nav['limit'] = (int) ($limit / 20 + 1);
80
+ return $page_nav;
81
+ }
82
+ ////////////////////////////////////////////////////////////////////////////////////////
83
+ // Getters & Setters //
84
+ ////////////////////////////////////////////////////////////////////////////////////////
85
+ ////////////////////////////////////////////////////////////////////////////////////////
86
+ // Private Methods //
87
+ ////////////////////////////////////////////////////////////////////////////////////////
88
+ ////////////////////////////////////////////////////////////////////////////////////////
89
+ // Listeners //
90
+ ////////////////////////////////////////////////////////////////////////////////////////
91
  }
admin/models/FMModelUninstall_fm.php CHANGED
@@ -1,55 +1,55 @@
1
- <?php
2
-
3
- class FMModelUninstall_fm {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function delete_db_tables() {
22
- global $wpdb;
23
- $true_or_false_forms = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker WHERE `id` IN (" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ")");
24
- if ($true_or_false_forms) {
25
- $wpdb->query("DELETE FROM " . $wpdb->prefix . "formmaker WHERE `id` NOT IN (" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ")");
26
- $wpdb->query("DELETE FROM " . $wpdb->prefix . "formmaker_submits WHERE `form_id` NOT IN (" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ")");
27
- $wpdb->query("DELETE FROM " . $wpdb->prefix . "formmaker_views WHERE `form_id` NOT IN (" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ")");
28
- }
29
- else {
30
- $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker");
31
- $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_submits");
32
- $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_views");
33
- $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_themes");
34
- $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_sessions");
35
- $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_blocked");
36
- $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_query");
37
- $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_backup");
38
- delete_option('contact_form_forms');
39
- delete_option("wd_form_maker_version");
40
- delete_option('formmaker_cureent_version');
41
- delete_option('fm_emailverification');
42
- delete_option('form_maker_pro_active');
43
- delete_option('fm_settings');
44
- }
45
- }
46
- ////////////////////////////////////////////////////////////////////////////////////////
47
- // Getters & Setters //
48
- ////////////////////////////////////////////////////////////////////////////////////////
49
- ////////////////////////////////////////////////////////////////////////////////////////
50
- // Private Methods //
51
- ////////////////////////////////////////////////////////////////////////////////////////
52
- ////////////////////////////////////////////////////////////////////////////////////////
53
- // Listeners //
54
- ////////////////////////////////////////////////////////////////////////////////////////
55
  }
1
+ <?php
2
+
3
+ class FMModelUninstall_fm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function delete_db_tables() {
22
+ global $wpdb;
23
+ $true_or_false_forms = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker WHERE `id` IN (" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ")");
24
+ if ($true_or_false_forms) {
25
+ $wpdb->query("DELETE FROM " . $wpdb->prefix . "formmaker WHERE `id` NOT IN (" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ")");
26
+ $wpdb->query("DELETE FROM " . $wpdb->prefix . "formmaker_submits WHERE `form_id` NOT IN (" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ")");
27
+ $wpdb->query("DELETE FROM " . $wpdb->prefix . "formmaker_views WHERE `form_id` NOT IN (" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ")");
28
+ }
29
+ else {
30
+ $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker");
31
+ $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_submits");
32
+ $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_views");
33
+ $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_themes");
34
+ $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_sessions");
35
+ $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_blocked");
36
+ $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_query");
37
+ $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_backup");
38
+ delete_option('contact_form_forms');
39
+ delete_option("wd_form_maker_version");
40
+ delete_option('formmaker_cureent_version');
41
+ delete_option('fm_emailverification');
42
+ delete_option('form_maker_pro_active');
43
+ delete_option('fm_settings');
44
+ }
45
+ }
46
+ ////////////////////////////////////////////////////////////////////////////////////////
47
+ // Getters & Setters //
48
+ ////////////////////////////////////////////////////////////////////////////////////////
49
+ ////////////////////////////////////////////////////////////////////////////////////////
50
+ // Private Methods //
51
+ ////////////////////////////////////////////////////////////////////////////////////////
52
+ ////////////////////////////////////////////////////////////////////////////////////////
53
+ // Listeners //
54
+ ////////////////////////////////////////////////////////////////////////////////////////
55
  }
admin/models/FMModelWidget.php CHANGED
@@ -1,38 +1,38 @@
1
- <?php
2
-
3
- class FMModelWidget {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
-
22
- public function get_gallery_rows_data() {
23
- global $wpdb;
24
- $query = "SELECT * FROM " . $wpdb->prefix . "formmaker order by `title`";
25
- $rows = $wpdb->get_results($query);
26
- return $rows;
27
- }
28
-
29
- ////////////////////////////////////////////////////////////////////////////////////////
30
- // Getters & Setters //
31
- ////////////////////////////////////////////////////////////////////////////////////////
32
- ////////////////////////////////////////////////////////////////////////////////////////
33
- // Private Methods //
34
- ////////////////////////////////////////////////////////////////////////////////////////
35
- ////////////////////////////////////////////////////////////////////////////////////////
36
- // Listeners //
37
- ////////////////////////////////////////////////////////////////////////////////////////
38
  }
1
+ <?php
2
+
3
+ class FMModelWidget {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
22
+ public function get_gallery_rows_data() {
23
+ global $wpdb;
24
+ $query = "SELECT * FROM " . $wpdb->prefix . "formmaker order by `title`";
25
+ $rows = $wpdb->get_results($query);
26
+ return $rows;
27
+ }
28
+
29
+ ////////////////////////////////////////////////////////////////////////////////////////
30
+ // Getters & Setters //
31
+ ////////////////////////////////////////////////////////////////////////////////////////
32
+ ////////////////////////////////////////////////////////////////////////////////////////
33
+ // Private Methods //
34
+ ////////////////////////////////////////////////////////////////////////////////////////
35
+ ////////////////////////////////////////////////////////////////////////////////////////
36
+ // Listeners //
37
+ ////////////////////////////////////////////////////////////////////////////////////////
38
  }
admin/views/FMViewBlocked_ips_fm.php CHANGED
@@ -1,163 +1,163 @@
1
- <?php
2
-
3
- class FMViewBlocked_ips_fm {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- private $model;
14
-
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- // Constructor & Destructor //
17
- ////////////////////////////////////////////////////////////////////////////////////////
18
- public function __construct($model) {
19
- $this->model = $model;
20
- }
21
-
22
- ////////////////////////////////////////////////////////////////////////////////////////
23
- // Public Methods //
24
- ////////////////////////////////////////////////////////////////////////////////////////
25
- public function display() {
26
- $rows_data = $this->model->get_rows_data();
27
- $page_nav = $this->model->page_nav();
28
- $search_value = ((isset($_POST['search_value'])) ? esc_html(stripslashes($_POST['search_value'])) : '');
29
- $asc_or_desc = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'desc') ? 'desc' : 'asc');
30
- $order_by_array = array('id', 'ip');
31
- $order_by = isset($_POST['order_by']) && in_array(esc_html(stripslashes($_POST['order_by'])), $order_by_array) ? esc_html(stripslashes($_POST['order_by'])) : 'id';
32
- $order_class = 'manage-column column-title sorted ' . $asc_or_desc;
33
- $ids_string = '';
34
- ?>
35
- <div id="fm_blocked_ips_message" style="width: 99%; display: none;"></div>
36
- <div class="fm-user-manual">
37
- This section allows you to block IPs.
38
- <a style="color: blue; text-decoration: none;" target="_blank" href="https://web-dorado.com/wordpress-form-maker/blocking-ips.html">Read More in User Manual</a>
39
- </div>
40
- <div class="fm-upgrade-pro">
41
- <a target="_blank" href="https://web-dorado.com/files/fromFormMaker.php">
42
- <div class="fm-upgrade-img">
43
- UPGRADE TO PRO VERSION
44
- <span></span>
45
- </div>
46
- </a>
47
- </div>
48
- <div class="fm-clear"></div>
49
- <form onkeypress="fm_doNothing(event)" class="wrap" id="blocked_ips" method="post" action="admin.php?page=blocked_ips_fm" style="width:99%;">
50
- <?php wp_nonce_field('nonce_fm', 'nonce_fm'); ?>
51
- <div class="fm-page-banner blocked-ips-banner">
52
- <div class="block_icon">
53
- </div>
54
- <div class="fm-logo-title">Blocked IPs</div>
55
- <div class="fm-page-actions">
56
- <button class="fm-button save-button small" onclick="fm_set_input_value('task', 'save_all');">
57
- <span></span>
58
- Save
59
- </button>
60
- <button class="fm-button delete-button small" onclick="if (confirm('Do you want to unblock selected IPs?')) { fm_set_input_value('task', 'delete_all'); } else { return false; }">
61
- <span></span>
62
- Delete
63
- </button>
64
- </div>
65
- </div>
66
- <div class="fm-clear"></div>
67
- <div class="tablenav top">
68
- <?php
69
- WDW_FM_Library::search('IP', $search_value, 'blocked_ips');
70
- WDW_FM_Library::html_page_nav($page_nav['total'], $page_nav['limit'], 'blocked_ips');
71
- ?>
72
- </div>
73
- <table class="wp-list-table widefat fixed pages fm-block-ip">
74
- <thead>
75
- <tr>
76
- <th class="manage-column column-cb check-column table_small_col"><input id="check_all" type="checkbox" style="margin: 0;" /></th>
77
- <th class="table_small_col <?php if ($order_by == 'id') {echo $order_class;} ?>">
78
- <a onclick="fm_set_input_value('task', '');
79
- fm_set_input_value('order_by', 'id');
80
- fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'id' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>');
81
- fm_form_submit(event, 'blocked_ips')" href="">
82
- <span>ID</span><span class="sorting-indicator"></span></th>
83
- </a>
84
- <th class="<?php if ($order_by == 'ip') {echo $order_class;} ?>">
85
- <a onclick="fm_set_input_value('task', '');
86
- fm_set_input_value('order_by', 'ip');
87
- fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'ip' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>');
88
- fm_form_submit(event, 'blocked_ips')" href="">
89
- <span>IP</span><span class="sorting-indicator"></span>
90
- </a>
91
- </th>
92
- <th class="table_small_col">Edit</th>
93
- <th class="table_small_col">Delete</th>
94
- </tr>
95
- <tr id="tr" style="background-color: #f9f9f9;">
96
- <th></th>
97
- <th></th>
98
- <th>
99
- <input type="text" class="input_th" id="ip" name="ip" onkeypress="return fm_check_isnum(event)">
100
- <button class="fm-button add-button small" onclick="if (fm_check_required('ip', 'IP')) {return false;} fm_set_input_value('task', 'save'); fm_set_input_value('current_id', ''); fm_save_ip('blocked_ips');">
101
- Add IP
102
- <span></span>
103
- </button>
104
- </th>
105
- <th>
106
-
107
- </th>
108
- <th></th>
109
- </tr>
110
- </thead>
111
- <tbody id="tbody_arr">
112
- <?php
113
- if ($rows_data) {
114
- foreach ($rows_data as $row_data) {
115
- $alternate = (!isset($alternate) || $alternate == 'class="alternate"') ? '' : 'class="alternate"';
116
- ?>
117
- <tr id="tr_<?php echo $row_data->id; ?>" <?php echo $alternate; ?>>
118
- <td class="table_small_col check-column" id="td_check_<?php echo $row_data->id; ?>" >
119
- <input id="check_<?php echo $row_data->id; ?>" name="check_<?php echo $row_data->id; ?>" type="checkbox" />
120
- </td>
121
- <td class="table_small_col" id="td_id_<?php echo $row_data->id; ?>" ><?php echo $row_data->id; ?></td>
122
- <td id="td_ip_<?php echo $row_data->id; ?>" >
123
- <a class="pointer" id="ip<?php echo $row_data->id; ?>"
124
- onclick="fm_edit_ip(<?php echo $row_data->id; ?>)"
125
- title="Edit"><?php echo $row_data->ip; ?></a>
126
- </td>
127
- <td class="table_small_col" id="td_edit_<?php echo $row_data->id; ?>">
128
- <button class="fm-icon edit-icon" onclick="fm_edit_ip(<?php echo $row_data->id; ?>);">
129
- <span></span>
130
- </button>
131
- </td>
132
- <td class="table_small_col" id="td_delete_<?php echo $row_data->id; ?>">
133
- <button class="fm-icon delete-icon" onclick="if (confirm('Do you want to unblock selected IP?')) { fm_set_input_value('task', 'delete'); fm_set_input_value('current_id', <?php echo $row_data->id; ?>); fm_form_submit(event, 'blocked_ips'); } else {return false;}">
134
- <span></span>
135
- </button>
136
- </td>
137
- </tr>
138
- <?php
139
- $ids_string .= $row_data->id . ',';
140
- }
141
- }
142
- ?>
143
- </tbody>
144
- </table>
145
- <input id="task" name="task" type="hidden" value="" />
146
- <input id="current_id" name="current_id" type="hidden" value="" />
147
- <input id="ids_string" name="ids_string" type="hidden" value="<?php echo $ids_string; ?>" />
148
- <input id="asc_or_desc" name="asc_or_desc" type="hidden" value="<?php echo $asc_or_desc; ?>" />
149
- <input id="order_by" name="order_by" type="hidden" value="<?php echo $order_by; ?>" />
150
- </form>
151
- <?php
152
- }
153
-
154
- ////////////////////////////////////////////////////////////////////////////////////////
155
- // Getters & Setters //
156
- ////////////////////////////////////////////////////////////////////////////////////////
157
- ////////////////////////////////////////////////////////////////////////////////////////
158
- // Private Methods //
159
- ////////////////////////////////////////////////////////////////////////////////////////
160
- ////////////////////////////////////////////////////////////////////////////////////////
161
- // Listeners //
162
- ////////////////////////////////////////////////////////////////////////////////////////
163
  }
1
+ <?php
2
+
3
+ class FMViewBlocked_ips_fm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ // Constructor & Destructor //
17
+ ////////////////////////////////////////////////////////////////////////////////////////
18
+ public function __construct($model) {
19
+ $this->model = $model;
20
+ }
21
+
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
26
+ $rows_data = $this->model->get_rows_data();
27
+ $page_nav = $this->model->page_nav();
28
+ $search_value = ((isset($_POST['search_value'])) ? esc_html(stripslashes($_POST['search_value'])) : '');
29
+ $asc_or_desc = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'desc') ? 'desc' : 'asc');
30
+ $order_by_array = array('id', 'ip');
31
+ $order_by = isset($_POST['order_by']) && in_array(esc_html(stripslashes($_POST['order_by'])), $order_by_array) ? esc_html(stripslashes($_POST['order_by'])) : 'id';
32
+ $order_class = 'manage-column column-title sorted ' . $asc_or_desc;
33
+ $ids_string = '';
34
+ ?>
35
+ <div id="fm_blocked_ips_message" style="width: 99%; display: none;"></div>
36
+ <div class="fm-user-manual">
37
+ This section allows you to block IPs.
38
+ <a style="color: blue; text-decoration: none;" target="_blank" href="https://web-dorado.com/wordpress-form-maker/blocking-ips.html">Read More in User Manual</a>
39
+ </div>
40
+ <div class="fm-upgrade-pro">
41
+ <a target="_blank" href="https://web-dorado.com/files/fromFormMaker.php">
42
+ <div class="fm-upgrade-img">
43
+ UPGRADE TO PRO VERSION
44
+ <span></span>
45
+ </div>
46
+ </a>
47
+ </div>
48
+ <div class="fm-clear"></div>
49
+ <form onkeypress="fm_doNothing(event)" class="wrap" id="blocked_ips" method="post" action="admin.php?page=blocked_ips_fm" style="width:99%;">
50
+ <?php wp_nonce_field('nonce_fm', 'nonce_fm'); ?>
51
+ <div class="fm-page-banner blocked-ips-banner">
52
+ <div class="block_icon">
53
+ </div>
54
+ <div class="fm-logo-title">Blocked IPs</div>
55
+ <div class="fm-page-actions">
56
+ <button class="fm-button save-button small" onclick="fm_set_input_value('task', 'save_all');">
57
+ <span></span>
58
+ Save
59
+ </button>
60
+ <button class="fm-button delete-button small" onclick="if (confirm('Do you want to unblock selected IPs?')) { fm_set_input_value('task', 'delete_all'); } else { return false; }">
61
+ <span></span>
62
+ Delete
63
+ </button>
64
+ </div>
65
+ </div>
66
+ <div class="fm-clear"></div>
67
+ <div class="tablenav top">
68
+ <?php
69
+ WDW_FM_Library::search('IP', $search_value, 'blocked_ips');
70
+ WDW_FM_Library::html_page_nav($page_nav['total'], $page_nav['limit'], 'blocked_ips');
71
+ ?>
72
+ </div>
73
+ <table class="wp-list-table widefat fixed pages fm-block-ip">
74
+ <thead>
75
+ <tr>
76
+ <th class="manage-column column-cb check-column table_small_col"><input id="check_all" type="checkbox" style="margin: 0;" /></th>
77
+ <th class="table_small_col <?php if ($order_by == 'id') {echo $order_class;} ?>">
78
+ <a onclick="fm_set_input_value('task', '');
79
+ fm_set_input_value('order_by', 'id');
80
+ fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'id' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>');
81
+ fm_form_submit(event, 'blocked_ips')" href="">
82
+ <span>ID</span><span class="sorting-indicator"></span></th>
83
+ </a>
84
+ <th class="<?php if ($order_by == 'ip') {echo $order_class;} ?>">
85
+ <a onclick="fm_set_input_value('task', '');
86
+ fm_set_input_value('order_by', 'ip');
87
+ fm_set_input_value('asc_or_desc', '<?php echo (($order_by == 'ip' && $asc_or_desc == 'asc') ? 'desc' : 'asc'); ?>');
88
+ fm_form_submit(event, 'blocked_ips')" href="">
89
+ <span>IP</span><span class="sorting-indicator"></span>
90
+ </a>
91
+ </th>
92
+ <th class="table_small_col">Edit</th>
93
+ <th class="table_small_col">Delete</th>
94
+ </tr>
95
+ <tr id="tr" style="background-color: #f9f9f9;">
96
+ <th></th>
97
+ <th></th>
98
+ <th>
99
+ <input type="text" class="input_th" id="ip" name="ip" onkeypress="return fm_check_isnum(event)">
100
+ <button class="fm-button add-button small" onclick="if (fm_check_required('ip', 'IP')) {return false;} fm_set_input_value('task', 'save'); fm_set_input_value('current_id', ''); fm_save_ip('blocked_ips');">
101
+ Add IP
102
+ <span></span>
103
+ </button>
104
+ </th>
105
+ <th>
106
+
107
+ </th>
108
+ <th></th>
109
+ </tr>
110
+ </thead>
111
+ <tbody id="tbody_arr">
112
+ <?php
113
+ if ($rows_data) {
114
+ foreach ($rows_data as $row_data) {
115
+ $alternate = (!isset($alternate) || $alternate == 'class="alternate"') ? '' : 'class="alternate"';
116
+ ?>
117
+ <tr id="tr_<?php echo $row_data->id; ?>" <?php echo $alternate; ?>>
118
+ <td class="table_small_col check-column" id="td_check_<?php echo $row_data->id; ?>" >
119
+ <input id="check_<?php echo $row_data->id; ?>" name="check_<?php echo $row_data->id; ?>" type="checkbox" />
120
+ </td>
121
+ <td class="table_small_col" id="td_id_<?php echo $row_data->id; ?>" ><?php echo $row_data->id; ?></td>
122
+ <td id="td_ip_<?php echo $row_data->id; ?>" >
123
+ <a class="pointer" id="ip<?php echo $row_data->id; ?>"
124
+ onclick="fm_edit_ip(<?php echo $row_data->id; ?>)"
125
+ title="Edit"><?php echo $row_data->ip; ?></a>
126
+ </td>
127
+ <td class="table_small_col" id="td_edit_<?php echo $row_data->id; ?>">
128
+ <button class="fm-icon edit-icon" onclick="fm_edit_ip(<?php echo $row_data->id; ?>);">
129
+ <span></span>
130
+ </button>
131
+ </td>
132
+ <td class="table_small_col" id="td_delete_<?php echo $row_data->id; ?>">
133
+ <button class="fm-icon delete-icon" onclick="if (confirm('Do you want to unblock selected IP?')) { fm_set_input_value('task', 'delete'); fm_set_input_value('current_id', <?php echo $row_data->id; ?>); fm_form_submit(event, 'blocked_ips'); } else {return false;}">
134
+ <span></span>
135
+ </button>
136
+ </td>
137
+ </tr>
138
+ <?php
139
+ $ids_string .= $row_data->id . ',';
140
+ }
141
+ }
142
+ ?>
143
+ </tbody>
144
+ </table>
145
+ <input id="task" name="task" type="hidden" value="" />
146
+ <input id="current_id" name="current_id" type="hidden" value="" />
147
+ <input id="ids_string" name="ids_string" type="hidden" value="<?php echo $ids_string; ?>" />
148
+ <input id="asc_or_desc" name="asc_or_desc" type="hidden" value="<?php echo $asc_or_desc; ?>" />
149
+ <input id="order_by" name="order_by" type="hidden" value="<?php echo $order_by; ?>" />
150
+ </form>
151
+ <?php
152
+ }
153
+
154
+ ////////////////////////////////////////////////////////////////////////////////////////
155
+ // Getters & Setters //
156
+ ////////////////////////////////////////////////////////////////////////////////////////
157
+ ////////////////////////////////////////////////////////////////////////////////////////
158
+ // Private Methods //
159
+ ////////////////////////////////////////////////////////////////////////////////////////
160
+ ////////////////////////////////////////////////////////////////////////////////////////
161
+ // Listeners //
162
+ ////////////////////////////////////////////////////////////////////////////////////////
163
  }
admin/views/FMViewFormMakerEditCSS.php CHANGED
@@ -1,135 +1,135 @@
1
- <?php
2
-
3
- class FMViewFormMakerEditCSS {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- private $model;
14
-
15
-
16
- ////////////////////////////////////////////////////////////////////////////////////////
17
- // Constructor & Destructor //
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- public function __construct($model) {
20
- $this->model = $model;
21
- }
22
- ////////////////////////////////////////////////////////////////////////////////////////
23
- // Public Methods //
24
- ////////////////////////////////////////////////////////////////////////////////////////
25
- public function display() {
26
- $theme_id = ((isset($_GET['id'])) ? esc_html(stripslashes($_GET['id'])) : '');
27
- $form_id = ((isset($_GET['form_id'])) ? esc_html(stripslashes($_GET['form_id'])) : 0);
28
- $row = $this->model->get_theme_row($theme_id);
29
- wp_print_scripts('jquery');
30
-
31
- ?>
32
- <link media="all" type="text/css" href="<?php echo get_admin_url(); ?>load-styles.php?c=1&amp;dir=ltr&amp;load=admin-bar,dashicons,wp-admin,buttons,wp-auth-check" rel="stylesheet">
33
- <link media="all" type="text/css" href="<?php echo get_admin_url(); ?>css/colors<?php echo ((get_bloginfo('version') < '3.8') ? '-fresh' : ''); ?>.min.css" id="colors-css" rel="stylesheet">
34
- <link media="all" type="text/css" href="<?php echo WD_FM_URL . '/css/form_maker_tables.css'; ?>" rel="stylesheet">
35
- <script src="<?php echo WD_FM_URL . '/js/form_maker_admin.js'; ?>" type="text/javascript"></script>
36
- <script src="<?php echo WD_FM_URL . '/js/layout/codemirror.js'; ?>" type="text/javascript"></script>
37
- <script src="<?php echo WD_FM_URL . '/js/layout/formatting.js'; ?>" type="text/javascript"></script>
38
- <script src="<?php echo WD_FM_URL . '/js/layout/css.js'; ?>" type="text/javascript"></script>
39
- <script src="<?php echo WD_FM_URL . '/js/layout/clike.js'; ?>" type="text/javascript"></script>
40
- <script src="<?php echo WD_FM_URL . '/js/layout/javascript.js'; ?>" type="text/javascript"></script>
41
- <script src="<?php echo WD_FM_URL . '/js/layout/htmlmixed.js'; ?>" type="text/javascript"></script>
42
- <script src="<?php echo WD_FM_URL . '/js/layout/xml.js'; ?>" type="text/javascript"></script>
43
- <script src="<?php echo WD_FM_URL . '/js/layout/php.js'; ?>" type="text/javascript"></script>
44
- <link media="all" type="text/css" href="<?php echo WD_FM_URL . '/css/codemirror.css'; ?>" rel="stylesheet">
45
-
46
- <style>
47
- .CodeMirror {
48
- border: 1px solid #ccc;
49
- font-size: 12px;
50
- margin-bottom: 6px;
51
- background: white;
52
- }
53
- </style>
54
-
55
- <form id="fm_theme" class="wrap wp-core-ui" method="post" action="#" style="width: 99%; padding-left:3px;">
56
- <div class="fm-page-header">
57
- <div class="fm-page-actions">
58
- <button class="fm-button save-button small" onclick="if (fm_check_required('title', 'Theme title')) {return false;}; fm_save_theme('save'); window.parent.jQuery('#theme option[value=<?php echo $theme_id; ?>]').html(jQuery('#title').val()); window.parent.tb_remove();">
59
- <span></span>
60
- Save
61
- </button>
62
- <button class="fm-button apply-button small" onclick="if (fm_check_required('title', 'Theme title')) {return false;}; fm_save_theme('apply'); window.parent.jQuery('#theme option[value=<?php echo $theme_id; ?>]').html(jQuery('#title').val()); return false;">
63
- <span></span>
64
- Apply
65
- </button>
66
- <button class="fm-button save-as-copy-button medium" onclick="if (fm_check_required('title', 'Theme title')) {return false;}; fm_save_theme('save_as_new'); window.parent.jQuery('#theme').append('<option value=0>' + jQuery('#title').val() + '</option>'); window.parent.tb_remove(); return false;">
67
- <span></span>
68
- Save as New
69
- </button>
70
- <button class="fm-button undo-button small" onclick="fm_reset_theme(); return false;">
71
- <span></span>
72
- Reset
73
- </button>
74
- <button class="fm-button cancel-button small" onclick="window.parent.tb_remove();">
75
- <span></span>
76
- Cancel
77
- </button>
78
- </div>
79
- <div class="fm-clear"></div>
80
- </div>
81
- <table style="clear: both;">
82
- <tbody>
83
- <tr>
84
- <td class="fm_label"><label for="title">Theme title: <span style="color:#FF0000;"> * </span> </label></td>
85
- <td><input type="text" id="title" name="title" value="<?php echo $row->title; ?>" class="fm_text_input" /></td>
86
- </tr>
87
- <tr>
88
- <td class="fm_label"><label for="css">Css: </label></td>
89
- <td style="width: 90%;"><textarea id="css" name="css" rows="25" style="width: 100%;"><?php echo htmlspecialchars($row->css); ?></textarea></td>
90
- </tr>
91
- </tbody>
92
- </table>
93
- <div style="display: none;" id="main_theme"><?php echo str_replace('"', '\"', $row->css); ?></div>
94
- <input type="hidden" id="task" name="task" value="" />
95
- <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
96
- <input type="hidden" id="default" name="default" value="<?php echo $row->default; ?>" />
97
- <input type="hidden" name="form_id" id="form_id" value="<?php echo $form_id; ?>" />
98
- </form>
99
- <script>
100
- var editor = CodeMirror.fromTextArea(
101
- document.getElementById("css"), {
102
- lineNumbers: true,
103
- lineWrapping: true,
104
- mode: "css"
105
- });
106
-
107
- CodeMirror.commands["selectAll"](editor);
108
- editor.autoFormatRange(editor.getCursor(true), editor.getCursor(false));
109
- editor.scrollTo(0,0);
110
-
111
- function fm_save_theme(task) {
112
- fm_set_input_value('task', task);
113
- document.getElementById('fm_theme').submit();
114
- }
115
-
116
- function fm_reset_theme() {
117
- editor.setValue(jQuery('#main_theme').html())
118
- jQuery('#css').val(jQuery('#main_theme').html());
119
- }
120
-
121
- </script>
122
- <?php
123
- die();
124
- }
125
-
126
- ////////////////////////////////////////////////////////////////////////////////////////
127
- // Getters & Setters //
128
- ////////////////////////////////////////////////////////////////////////////////////////
129
- ////////////////////////////////////////////////////////////////////////////////////////
130
- // Private Methods //
131
- ////////////////////////////////////////////////////////////////////////////////////////
132
- ////////////////////////////////////////////////////////////////////////////////////////
133
- // Listeners //
134
- ////////////////////////////////////////////////////////////////////////////////////////
135
  }
1
+ <?php
2
+
3
+ class FMViewFormMakerEditCSS {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+
16
+ ////////////////////////////////////////////////////////////////////////////////////////
17
+ // Constructor & Destructor //
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ public function __construct($model) {
20
+ $this->model = $model;
21
+ }
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
26
+ $theme_id = ((isset($_GET['id'])) ? esc_html(stripslashes($_GET['id'])) : '');
27
+ $form_id = ((isset($_GET['form_id'])) ? esc_html(stripslashes($_GET['form_id'])) : 0);
28
+ $row = $this->model->get_theme_row($theme_id);
29
+ wp_print_scripts('jquery');
30
+
31
+ ?>
32
+ <link media="all" type="text/css" href="<?php echo get_admin_url(); ?>load-styles.php?c=1&amp;dir=ltr&amp;load=admin-bar,dashicons,wp-admin,buttons,wp-auth-check" rel="stylesheet">
33
+ <link media="all" type="text/css" href="<?php echo get_admin_url(); ?>css/colors<?php echo ((get_bloginfo('version') < '3.8') ? '-fresh' : ''); ?>.min.css" id="colors-css" rel="stylesheet">
34
+ <link media="all" type="text/css" href="<?php echo WD_FM_URL . '/css/form_maker_tables.css'; ?>" rel="stylesheet">
35
+ <script src="<?php echo WD_FM_URL . '/js/form_maker_admin.js'; ?>" type="text/javascript"></script>
36
+ <script src="<?php echo WD_FM_URL . '/js/layout/codemirror.js'; ?>" type="text/javascript"></script>
37
+ <script src="<?php echo WD_FM_URL . '/js/layout/formatting.js'; ?>" type="text/javascript"></script>
38
+ <script src="<?php echo WD_FM_URL . '/js/layout/css.js'; ?>" type="text/javascript"></script>
39
+ <script src="<?php echo WD_FM_URL . '/js/layout/clike.js'; ?>" type="text/javascript"></script>
40
+ <script src="<?php echo WD_FM_URL . '/js/layout/javascript.js'; ?>" type="text/javascript"></script>
41
+ <script src="<?php echo WD_FM_URL . '/js/layout/htmlmixed.js'; ?>" type="text/javascript"></script>
42
+ <script src="<?php echo WD_FM_URL . '/js/layout/xml.js'; ?>" type="text/javascript"></script>
43
+ <script src="<?php echo WD_FM_URL . '/js/layout/php.js'; ?>" type="text/javascript"></script>
44
+ <link media="all" type="text/css" href="<?php echo WD_FM_URL . '/css/codemirror.css'; ?>" rel="stylesheet">
45
+
46
+ <style>
47
+ .CodeMirror {
48
+ border: 1px solid #ccc;
49
+ font-size: 12px;
50
+ margin-bottom: 6px;
51
+ background: white;
52
+ }
53
+ </style>
54
+
55
+ <form id="fm_theme" class="wrap wp-core-ui" method="post" action="#" style="width: 99%; padding-left:3px;">
56
+ <div class="fm-page-header">
57
+ <div class="fm-page-actions">
58
+ <button class="fm-button save-button small" onclick="if (fm_check_required('title', 'Theme title')) {return false;}; fm_save_theme('save'); window.parent.jQuery('#theme option[value=<?php echo $theme_id; ?>]').html(jQuery('#title').val()); window.parent.tb_remove();">
59
+ <span></span>
60
+ Save
61
+ </button>
62
+ <button class="fm-button apply-button small" onclick="if (fm_check_required('title', 'Theme title')) {return false;}; fm_save_theme('apply'); window.parent.jQuery('#theme option[value=<?php echo $theme_id; ?>]').html(jQuery('#title').val()); return false;">
63
+ <span></span>
64
+ Apply
65
+ </button>
66
+ <button class="fm-button save-as-copy-button medium" onclick="if (fm_check_required('title', 'Theme title')) {return false;}; fm_save_theme('save_as_new'); window.parent.jQuery('#theme').append('<option value=0>' + jQuery('#title').val() + '</option>'); window.parent.tb_remove(); return false;">
67
+ <span></span>
68
+ Save as New
69
+ </button>
70
+ <button class="fm-button undo-button small" onclick="fm_reset_theme(); return false;">
71
+ <span></span>
72
+ Reset
73
+ </button>
74
+ <button class="fm-button cancel-button small" onclick="window.parent.tb_remove();">
75
+ <span></span>
76
+ Cancel
77
+ </button>
78
+ </div>
79
+ <div class="fm-clear"></div>
80
+ </div>
81
+ <table style="clear: both;">
82
+ <tbody>
83
+ <tr>
84
+ <td class="fm_label"><label for="title">Theme title: <span style="color:#FF0000;"> * </span> </label></td>
85
+ <td><input type="text" id="title" name="title" value="<?php echo $row->title; ?>" class="fm_text_input" /></td>
86
+ </tr>
87
+ <tr>
88
+ <td class="fm_label"><label for="css">Css: </label></td>
89
+ <td style="width: 90%;"><textarea id="css" name="css" rows="25" style="width: 100%;"><?php echo htmlspecialchars($row->css); ?></textarea></td>
90
+ </tr>
91
+ </tbody>
92
+ </table>
93
+ <div style="display: none;" id="main_theme"><?php echo str_replace('"', '\"', $row->css); ?></div>
94
+ <input type="hidden" id="task" name="task" value="" />
95
+ <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
96
+ <input type="hidden" id="default" name="default" value="<?php echo $row->default; ?>" />
97
+ <input type="hidden" name="form_id" id="form_id" value="<?php echo $form_id; ?>" />
98
+ </form>
99
+ <script>
100
+ var editor = CodeMirror.fromTextArea(
101
+ document.getElementById("css"), {
102
+ lineNumbers: true,
103
+ lineWrapping: true,
104
+ mode: "css"
105
+ });
106
+
107
+ CodeMirror.commands["selectAll"](editor);
108
+ editor.autoFormatRange(editor.getCursor(true), editor.getCursor(false));
109
+ editor.scrollTo(0,0);
110
+
111
+ function fm_save_theme(task) {
112
+ fm_set_input_value('task', task);
113
+ document.getElementById('fm_theme').submit();
114
+ }
115
+
116
+ function fm_reset_theme() {
117
+ editor.setValue(jQuery('#main_theme').html())
118
+ jQuery('#css').val(jQuery('#main_theme').html());
119
+ }
120
+
121
+ </script>
122
+ <?php
123
+ die();
124
+ }
125
+
126
+ ////////////////////////////////////////////////////////////////////////////////////////
127
+ // Getters & Setters //
128
+ ////////////////////////////////////////////////////////////////////////////////////////
129
+ ////////////////////////////////////////////////////////////////////////////////////////
130
+ // Private Methods //
131
+ ////////////////////////////////////////////////////////////////////////////////////////
132
+ ////////////////////////////////////////////////////////////////////////////////////////
133
+ // Listeners //
134
+ ////////////////////////////////////////////////////////////////////////////////////////
135
  }
admin/views/FMViewFormMakerPreview.php CHANGED
@@ -1,477 +1,477 @@
1
- <?php
2
-
3
- class FMViewFormMakerPreview {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- private $model;
14
-
15
-
16
- ////////////////////////////////////////////////////////////////////////////////////////
17
- // Constructor & Destructor //
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- public function __construct($model) {
20
- $this->model = $model;
21
- }
22
- ////////////////////////////////////////////////////////////////////////////////////////
23
- // Public Methods //
24
- ////////////////////////////////////////////////////////////////////////////////////////
25
- public function display() {
26
- $form_id = ((isset($_GET['form_id'])) ? esc_html(stripslashes($_GET['form_id'])) : 0);
27
- $form = (($form_id) ? $this->model->get_form($form_id) : '');
28
- wp_print_scripts('jquery');
29
- wp_print_scripts('jquery-ui-widget');
30
- wp_print_scripts('jquery-ui-slider');
31
- wp_print_scripts('jquery-ui-spinner');
32
- ?>
33
- <script src="https://maps.google.com/maps/api/js?v=3" type="text/javascript"></script>
34
- <script src="<?php echo WD_FM_URL . '/js/if_gmap_front_end.js'; ?>" type="text/javascript"></script>
35
- <script src="<?php echo WD_FM_URL . '/js/calendar/calendar.js'; ?>" type="text/javascript"></script>
36
- <script src="<?php echo WD_FM_URL . '/js/calendar/calendar_function.js'; ?>" type="text/javascript"></script>
37
- <link media="all" type="text/css" href="<?php echo WD_FM_URL . '/css/calendar-jos.css'; ?>" rel="stylesheet">
38
- <link media="all" type="text/css" href="<?php echo WD_FM_URL . '/css/jquery-ui-1.10.3.custom.css'; ?>" rel="stylesheet">
39
- <link media="all" type="text/css" href="<?php echo WD_FM_URL . '/css/jquery-ui-spinner.css'; ?>" rel="stylesheet">
40
- <?php
41
- if (isset($_GET['test_theme'])) {
42
- wp_print_scripts('jquery-effects-shake');
43
- wp_register_script('main_div_front_end', WD_FM_URL . '/js/main_div_front_end.js', array(), get_option("wd_form_maker_version"));
44
- $theme_id = esc_html(stripslashes($_GET['test_theme']));
45
- require_once (WD_FM_DIR . '/frontend/controllers/FMControllerForm_maker.php');
46
- $controller = new FMControllerForm_maker();
47
- echo $controller->execute($form_id, $theme_id);
48
- die();
49
- }
50
- $theme_id = ((isset($_GET['id'])) ? esc_html(stripslashes($_GET['id'])) : '');
51
- $css = $this->model->get_theme_css($theme_id);
52
- $id = 'form_id_temp';
53
- ?>
54
- <script src="<?php echo WD_FM_URL . '/js/main_front_end.js'; ?>"></script>
55
- <style>
56
- <?php
57
- echo str_replace('[SITE_ROOT]', WD_FM_URL, $css);
58
- ?>
59
- </style>
60
- <div id="form_id_temppages" class="wdform_page_navigation" show_title="" show_numbers="" type=""></div>
61
- <form id="form_preview"><?php echo $form; ?></form>
62
- <?php
63
- if ($form) { // Preview from options page.
64
- die();
65
- }
66
- ?>
67
- <input type="hidden" id="counter<?php echo $id; ?>" value="" name="counter<?php echo $id; ?>" />
68
- <script>
69
- var plugin_url = "<?php echo WD_FM_URL; ?>";
70
- /*JURI_ROOT = '<?php echo WD_FM_URL . '/js' ?>';*/
71
- document.getElementById('form_preview').innerHTML = window.parent.document.getElementById('take').innerHTML;
72
- document.getElementById('form_id_temppages').setAttribute('show_title', window.parent.document.getElementById('pages').getAttribute('show_title'));
73
- document.getElementById('form_id_temppages').setAttribute('show_numbers', window.parent.document.getElementById('pages').getAttribute('show_numbers'));
74
- document.getElementById('form_id_temppages').setAttribute('type', window.parent.document.getElementById('pages').getAttribute('type'));
75
- document.getElementById('counterform_id_temp').value = window.parent.gen;
76
- form_view_count<?php echo $id ?>= 0;
77
- for (i = 1; i <= 30; i++) {
78
- if (document.getElementById('<?php echo $id ?>form_view' + i)) {
79
- form_view_count<?php echo $id ?>++;
80
- form_view_max<?php echo $id ?>= i;
81
- document.getElementById('<?php echo $id ?>form_view' + i).parentNode.removeAttribute('style');
82
- }
83
- }
84
- refresh_first();
85
- if (form_view_count<?php echo $id ?>> 1) {
86
- for (i = 1; i <= form_view_max<?php echo $id ?>; i++) {
87
- if (document.getElementById('<?php echo $id ?>form_view' + i)) {
88
- first_form_view<?php echo $id ?>= i;
89
- break;
90
- }
91
- }
92
- generate_page_nav(first_form_view<?php echo $id ?>, '<?php echo $id ?>', form_view_count<?php echo $id ?>, form_view_max<?php echo $id ?>);
93
- }
94
- function remove_add_(id) {
95
- attr_name = new Array();
96
- attr_value = new Array();
97
- var input = document.getElementById(id);
98
- atr = input.attributes;
99
- for (v = 0; v < 30; v++)
100
- if (atr[v]) {
101
- if (atr[v].name.indexOf("add_") == 0) {
102
- attr_name.push(atr[v].name.replace('add_', ''));
103
- attr_value.push(atr[v].value);
104
- input.removeAttribute(atr[v].name);
105
- v--;
106
- }
107
- }
108
- for (v = 0; v < attr_name.length; v++) {
109
- input.setAttribute(attr_name[v], attr_value[v])
110
- }
111
- }
112
- function refresh_first() {
113
- n = window.parent.gen;
114
- for (i = 0; i < n; i++) {
115
- if (document.getElementById(i)) {
116
- for (z = 0; z < document.getElementById(i).childNodes.length; z++) {
117
- if (document.getElementById(i).childNodes[z].nodeType == 3) {
118
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[z]);
119
- }
120
- }
121
- if (document.getElementById(i).getAttribute('type') == "type_map") {
122
- if_gmap_init(i);
123
- for (q = 0; q < 20; q++) {
124
- if (document.getElementById(i + "_elementform_id_temp").getAttribute("long" + q)) {
125
- w_long = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("long" + q));
126
- w_lat = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("lat" + q));
127
- w_info = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("info" + q));
128
- add_marker_on_map(i, q, w_long, w_lat, w_info, false);
129
- }
130
- }
131
- }
132
- if (document.getElementById(i).getAttribute('type') == "type_mark_map") {
133
- if_gmap_init(i);
134
- w_long = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("long" + 0));
135
- w_lat = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("lat" + 0));
136
- w_info = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("info" + 0));
137
- add_marker_on_map(i, 0, w_long, w_lat, w_info, true);
138
- }
139
- if (document.getElementById(i).getAttribute('type') == "type_captcha" || document.getElementById(i).getAttribute('type') == "type_recaptcha") {
140
- if (document.getElementById(i).childNodes[10]) {
141
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
142
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
143
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
144
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
145
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
146
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
147
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
148
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
149
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
150
- }
151
- else {
152
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
153
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
154
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
155
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
156
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
157
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
158
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
159
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
160
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
161
- }
162
- continue;
163
- }
164
- if (document.getElementById(i).getAttribute('type') == "type_section_break") {
165
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
166
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
167
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
168
- continue;
169
- }
170
- if (document.getElementById(i).childNodes[10]) {
171
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
172
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
173
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
174
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
175
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
176
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
177
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
178
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
179
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
180
- }
181
- else {
182
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
183
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
184
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
185
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
186
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
187
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
188
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
189
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
190
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
191
- }
192
- }
193
- }
194
- for (i = 0; i <= n; i++) {
195
- if (document.getElementById(i)) {
196
- type = document.getElementById(i).getAttribute("type");
197
- switch (type) {
198
- case "type_text":
199
- case "type_number":
200
- case "type_password":
201
- case "type_submitter_mail":
202
- case "type_own_select":
203
- case "type_country":
204
- case "type_hidden":
205
- case "type_map": {
206
- remove_add_(i + "_elementform_id_temp");
207
- break;
208
- }
209
- case "type_submit_reset": {
210
- remove_add_(i + "_element_submitform_id_temp");
211
- if (document.getElementById(i + "_element_resetform_id_temp")) {
212
- remove_add_(i + "_element_resetform_id_temp");
213
- }
214
- break;
215
- }
216
-
217
- case "type_captcha": {
218
- remove_add_("_wd_captchaform_id_temp");
219
- remove_add_("_element_refreshform_id_temp");
220
- remove_add_("_wd_captcha_inputform_id_temp");
221
- break;
222
- }
223
- case "type_recaptcha": {
224
- remove_add_("wd_recaptchaform_id_temp");
225
- break;
226
- }
227
- case "type_file_upload": {
228
- remove_add_(i + "_elementform_id_temp");
229
- break;
230
- }
231
- case "type_textarea": {
232
- remove_add_(i + "_elementform_id_temp");
233
- break;
234
- }
235
- case "type_name": {
236
- if (document.getElementById(i + "_element_titleform_id_temp")) {
237
- remove_add_(i + "_element_titleform_id_temp");
238
- remove_add_(i + "_element_firstform_id_temp");
239
- remove_add_(i + "_element_lastform_id_temp");
240
- remove_add_(i + "_element_middleform_id_temp");
241
- }
242
- else {
243
- remove_add_(i + "_element_firstform_id_temp");
244
- remove_add_(i + "_element_lastform_id_temp");
245
-
246
- }
247
- break;
248
- }
249
- case "type_phone": {
250
- remove_add_(i + "_element_firstform_id_temp");
251
- remove_add_(i + "_element_lastform_id_temp");
252
- break;
253
- }
254
- case "type_address": {
255
- if(document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute('street1')=='no')
256
- remove_add_(i+"_street1form_id_temp");
257
- if(document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute('street2')=='no')
258
- remove_add_(i+"_street2form_id_temp");
259
- if(document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute('city')=='no')
260
- remove_add_(i+"_cityform_id_temp");
261
- if(document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute('state')=='no')
262
- remove_add_(i+"_stateform_id_temp");
263
- if(document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute('postal')=='no')
264
- remove_add_(i+"_postalform_id_temp");
265
- if(document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute('country')=='no')
266
- remove_add_(i+"_countryform_id_temp");
267
- break;
268
- }
269
- case "type_checkbox":
270
- case "type_radio": {
271
- is = true;
272
- for (j = 0; j < 100; j++) {
273
- if (document.getElementById(i + "_elementform_id_temp" + j)) {
274
- remove_add_(i + "_elementform_id_temp" + j);
275
- }
276
- }
277
- break;
278
- }
279
- case "type_button": {
280
- for (j = 0; j < 100; j++) {
281
- if (document.getElementById(i + "_elementform_id_temp" + j)) {
282
- remove_add_(i + "_elementform_id_temp" + j);
283
- }
284
- }
285
- break;
286
- }
287
- case "type_time": {
288
- if (document.getElementById(i + "_ssform_id_temp")) {
289
- remove_add_(i + "_ssform_id_temp");
290
- remove_add_(i + "_mmform_id_temp");
291
- remove_add_(i + "_hhform_id_temp");
292
- }
293
- else {
294
- remove_add_(i + "_mmform_id_temp");
295
- remove_add_(i + "_hhform_id_temp");
296
- }
297
- break;
298
- }
299
- case "type_date": {
300
- remove_add_(i + "_elementform_id_temp");
301
- remove_add_(i + "_buttonform_id_temp");
302
- break;
303
- }
304
- case "type_date_fields": {
305
- remove_add_(i + "_dayform_id_temp");
306
- remove_add_(i + "_monthform_id_temp");
307
- remove_add_(i + "_yearform_id_temp");
308
- break;
309
- }
310
- case "type_star_rating": {
311
- remove_add_(i+"_elementform_id_temp");
312
- break;
313
- }
314
- case "type_scale_rating": {
315
- remove_add_(i+"_elementform_id_temp");
316
- break;
317
- }
318
- case "type_spinner": {
319
- remove_add_(i+"_elementform_id_temp");
320
- var spinner_value = document.getElementById(i+"_elementform_id_temp").getAttribute( "aria-valuenow" );
321
- var spinner_min_value = document.getElementById(i+"_min_valueform_id_temp").value;
322
- var spinner_max_value = document.getElementById(i+"_max_valueform_id_temp").value;
323
- var spinner_step = document.getElementById(i+"_stepform_id_temp").value;
324
- jQuery( "#"+i+"_elementform_id_temp" ).removeClass( "ui-spinner-input" )
325
- .prop( "disabled", false )
326
- .removeAttr( "autocomplete" )
327
- .removeAttr( "role" )
328
- .removeAttr( "aria-valuemin" )
329
- .removeAttr( "aria-valuemax" )
330
- .removeAttr( "aria-valuenow" );
331
- span_ui= document.getElementById(i+"_elementform_id_temp").parentNode;
332
- span_ui.parentNode.appendChild(document.getElementById(i+"_elementform_id_temp"));
333
- span_ui.parentNode.removeChild(span_ui);
334
- jQuery("#"+i+"_elementform_id_temp")[0].spin = null;
335
- spinner = jQuery( "#"+i+"_elementform_id_temp" ).spinner();
336
- spinner.spinner( "value", spinner_value );
337
- jQuery( "#"+i+"_elementform_id_temp" ).spinner({ min: spinner_min_value});
338
- jQuery( "#"+i+"_elementform_id_temp" ).spinner({ max: spinner_max_value});
339
- jQuery( "#"+i+"_elementform_id_temp" ).spinner({ step: spinner_step});
340
- break;
341
- }
342
- case "type_slider": {
343
- remove_add_(i+"_elementform_id_temp");
344
- var slider_value = document.getElementById(i+"_slider_valueform_id_temp").value;
345
- var slider_min_value = document.getElementById(i+"_slider_min_valueform_id_temp").value;
346
- var slider_max_value = document.getElementById(i+"_slider_max_valueform_id_temp").value;
347
- var slider_element_value = document.getElementById( i+"_element_valueform_id_temp" );
348
- var slider_value_save = document.getElementById( i+"_slider_valueform_id_temp" );
349
- document.getElementById(i+"_elementform_id_temp").innerHTML = "";
350
- document.getElementById(i+"_elementform_id_temp").removeAttribute( "class" );
351
- document.getElementById(i+"_elementform_id_temp").removeAttribute( "aria-disabled" );
352
- jQuery("#"+i+"_elementform_id_temp")[0].slide = null;
353
- jQuery( "#"+i+"_elementform_id_temp").slider({
354
- range: "min",
355
- value: eval(slider_value),
356
- min: eval(slider_min_value),
357
- max: eval(slider_max_value),
358
- slide: function( event, ui ) {
359
- slider_element_value.innerHTML = "" + ui.value ;
360
- slider_value_save.value = "" + ui.value;
361
-
362
- }
363
- });
364
- break;
365
- }
366
- case "type_range": {
367
- remove_add_(i+"_elementform_id_temp0");
368
- remove_add_(i+"_elementform_id_temp1");
369
- var spinner_value0 = document.getElementById(i+"_elementform_id_temp0").getAttribute( "aria-valuenow" );
370
- var spinner_step = document.getElementById(i+"_range_stepform_id_temp").value;
371
- jQuery( "#"+i+"_elementform_id_temp0" ).removeClass( "ui-spinner-input" )
372
- .prop( "disabled", false )
373
- .removeAttr( "autocomplete" )
374
- .removeAttr( "role" )
375
- .removeAttr( "aria-valuenow" );
376
- span_ui= document.getElementById(i+"_elementform_id_temp0").parentNode;
377
- span_ui.parentNode.appendChild(document.getElementById(i+"_elementform_id_temp0"));
378
- span_ui.parentNode.removeChild(span_ui);
379
- jQuery("#"+i+"_elementform_id_temp0")[0].spin = null;
380
- jQuery("#"+i+"_elementform_id_temp1")[0].spin = null;
381
- spinner0 = jQuery( "#"+i+"_elementform_id_temp0" ).spinner();
382
- spinner0.spinner( "value", spinner_value0 );
383
- jQuery( "#"+i+"_elementform_id_temp0" ).spinner({ step: spinner_step});
384
- var spinner_value1 = document.getElementById(i+"_elementform_id_temp1").getAttribute( "aria-valuenow" );
385
- jQuery( "#"+i+"_elementform_id_temp1" ).removeClass( "ui-spinner-input" )
386
- .prop( "disabled", false )
387
- .removeAttr( "autocomplete" )
388
- .removeAttr( "role" )
389
- .removeAttr( "aria-valuenow" );
390
- span_ui1= document.getElementById(i+"_elementform_id_temp1").parentNode;
391
- span_ui1.parentNode.appendChild(document.getElementById(i+"_elementform_id_temp1"));
392
- span_ui1.parentNode.removeChild(span_ui1);
393
- spinner1 = jQuery( "#"+i+"_elementform_id_temp1" ).spinner();
394
- spinner1.spinner( "value", spinner_value1 );
395
- jQuery( "#"+i+"_elementform_id_temp1" ).spinner({ step: spinner_step});
396
- break;
397
- }
398
- case "type_grading": {
399
- for (k=0; k<100; k++) {
400
- if (document.getElementById(i+"_elementform_id_temp"+k)) {
401
- remove_add_(i+"_elementform_id_temp"+k);
402
- }
403
- }
404
- break;
405
- }
406
- case "type_matrix": {
407
- remove_add_(i+"_elementform_id_temp");
408
- break;
409
- }
410
- }
411
- }
412
- }
413
- for (t = 1; t <= form_view_max<?php echo $id ?>; t++) {
414
- if (document.getElementById('form_id_tempform_view' + t)) {
415
- form_view_element = document.getElementById('form_id_tempform_view' + t);
416
- remove_whitespace(form_view_element);
417
- xy = form_view_element.childNodes.length - 2;
418
- for (z = 0; z <= xy; z++) {
419
- if (form_view_element.childNodes[z]) {
420
- if (form_view_element.childNodes[z].nodeType != 3) {
421
- if (!form_view_element.childNodes[z].id) {
422
- del = true;
423
- GLOBAL_tr = form_view_element.childNodes[z];
424
- //////////////////////////////////////////////////////////////////////////////////////////
425
- for (x = 0; x < GLOBAL_tr.firstChild.childNodes.length; x++) {
426
- table = GLOBAL_tr.firstChild.childNodes[x];
427
- tbody = table.firstChild;
428
- if (tbody.childNodes.length) {
429
- del = false;
430
- }
431
- }
432
- if (del) {
433
- form_view_element.removeChild(form_view_element.childNodes[z]);
434
- }
435
- }
436
- }
437
- }
438
- }
439
- }
440
- }
441
- for (i = 1; i <= window.parent.form_view_max; i++) {
442
- if (document.getElementById('form_id_tempform_view' + i)) {
443
- document.getElementById('form_id_tempform_view' + i).parentNode.removeChild(document.getElementById('form_id_tempform_view_img' + i));
444
- document.getElementById('form_id_tempform_view' + i).removeAttribute('style');
445
- }
446
- }
447
- }
448
- function remove_whitespace(node) {
449
- var ttt;
450
- for (ttt = 0; ttt < node.childNodes.length; ttt++) {
451
- if (node.childNodes[ttt] && node.childNodes[ttt].nodeType == '3' && !/\S/.test(node.childNodes[ttt].nodeValue)) {
452
- node.removeChild(node.childNodes[ttt]);
453
- ttt--;
454
- }
455
- else {
456
- if (node.childNodes[ttt].childNodes.length) {
457
- remove_whitespace(node.childNodes[ttt]);
458
- }
459
- }
460
- }
461
- return;
462
- }
463
- </script>
464
- <?php
465
- die();
466
- }
467
-
468
- ////////////////////////////////////////////////////////////////////////////////////////
469
- // Getters & Setters //
470
- ////////////////////////////////////////////////////////////////////////////////////////
471
- ////////////////////////////////////////////////////////////////////////////////////////
472
- // Private Methods //
473
- ////////////////////////////////////////////////////////////////////////////////////////
474
- ////////////////////////////////////////////////////////////////////////////////////////
475
- // Listeners //
476
- ////////////////////////////////////////////////////////////////////////////////////////
1
+ <?php
2
+
3
+ class FMViewFormMakerPreview {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables