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

Version Description

Fixed: Bug on Matrix field (additional attributes)

Download this release

Release Info

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

Code changes from version 1.8.38 to 1.8.39

Files changed (46) 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/FMControllerFormmakerwdcaptcha.php +42 -42
  6. admin/controllers/FMControllerFormmakerwdmathcaptcha.php +42 -42
  7. admin/controllers/FMControllerFormmakerwindow.php +42 -42
  8. admin/controllers/FMControllerFromeditcountryinpopup.php +42 -42
  9. admin/controllers/FMControllerFromipinfoinpopup.php +42 -42
  10. admin/controllers/FMControllerFrommapeditinpopup.php +42 -42
  11. admin/controllers/FMControllerGenerete_csv.php +42 -42
  12. admin/controllers/FMControllerGenerete_xml.php +42 -42
  13. admin/controllers/FMControllerGoptions_fm.php +68 -68
  14. admin/controllers/FMControllerLicensing_fm.php +48 -48
  15. admin/controllers/FMControllerManage_fm.php +1266 -1266
  16. admin/controllers/FMControllerSelect_data_from_db.php +70 -70
  17. admin/controllers/FMControllerShow_matrix.php +42 -42
  18. admin/controllers/FMControllerSubmissions_fm.php +791 -791
  19. admin/controllers/FMControllerThemes_fm.php +188 -188
  20. admin/controllers/FMControllerUninstall_fm.php +57 -57
  21. admin/controllers/FMControllerWidget.php +60 -60
  22. admin/models/FMModelBlocked_ips_fm.php +74 -74
  23. admin/models/FMModelFormMakerEditCSS.php +41 -41
  24. admin/models/FMModelFormMakerPreview.php +41 -41
  25. admin/models/FMModelFormMakerSQLMapping.php +120 -120
  26. admin/models/FMModelFormmakerwdcaptcha.php +30 -30
  27. admin/models/FMModelFormmakerwdmathcaptcha.php +30 -30
  28. admin/models/FMModelFormmakerwindow.php +35 -35
  29. admin/models/FMModelFromeditcountryinpopup.php +30 -30
  30. admin/models/FMModelFromipinfoinpopup.php +30 -30
  31. admin/models/FMModelFrommapeditinpopup.php +30 -30
  32. admin/models/FMModelGenerete_csv.php +269 -269
  33. admin/models/FMModelGenerete_xml.php +275 -275
  34. admin/models/FMModelGoptions_fm.php +29 -29
  35. admin/models/FMModelLicensing_fm.php +29 -29
  36. admin/models/FMModelManage_fm.php +2222 -2222
  37. admin/models/FMModelSelect_data_from_db.php +110 -110
  38. admin/models/FMModelShow_matrix.php +30 -30
  39. admin/models/FMModelSubmissions_fm.php +676 -676
  40. admin/models/FMModelThemes_fm.php +90 -90
  41. admin/models/FMModelUninstall_fm.php +54 -54
  42. admin/models/FMModelWidget.php +37 -37
  43. admin/views/FMViewBlocked_ips_fm.php +162 -162
  44. admin/views/FMViewFormMakerEditCSS.php +134 -134
  45. admin/views/FMViewFormMakerPreview.php +476 -476
  46. admin/views/FMViewFormMakerSQLMapping.php +0 -102
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/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,71 +1,71 @@
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
- //var_dump($form_id);
27
- $field_type = ((isset($_GET['field_type'])) ? esc_html($_GET['field_type']) : 0);
28
- $value_disabled = ((isset($_GET['value_disabled'])) ? esc_html($_GET['value_disabled']) : 0);
29
- if ($task && method_exists($this, $task)) {
30
- $this->$task($form_id,$field_type="");
31
- }
32
- else
33
- $this->display($id, $field_id, $field_type, $value_disabled,$form_id);
34
- }
35
-
36
- public function display($id, $field_id, $field_type, $value_disabled,$form_id) {
37
- require_once WD_FM_DIR . "/admin/models/FMModelSelect_data_from_db.php";
38
- $model = new FMModelSelect_data_from_db();
39
-
40
- require_once WD_FM_DIR . "/admin/views/FMViewSelect_data_from_db.php";
41
- $view = new FMViewSelect_data_from_db($model);
42
- $view->display($id, $field_id, $field_type, $value_disabled,$form_id);
43
- }
44
-
45
- public function db_tables($form_id,$field_type) {
46
- require_once WD_FM_DIR . "/admin/models/FMModelSelect_data_from_db.php";
47
- $model = new FMModelSelect_data_from_db();
48
-
49
- require_once WD_FM_DIR . "/admin/views/FMViewSelect_data_from_db.php";
50
- $view = new FMViewSelect_data_from_db($model);
51
- $view->db_tables((int)$form_id, $field_type);
52
- }
53
- public function db_table_struct_select($form_id,$field_type) {
54
- require_once WD_FM_DIR . "/admin/models/FMModelSelect_data_from_db.php";
55
- $model = new FMModelSelect_data_from_db();
56
-
57
- require_once WD_FM_DIR . "/admin/views/FMViewSelect_data_from_db.php";
58
- $view = new FMViewSelect_data_from_db($model);
59
- $view->db_table_struct_select((int)$form_id,$field_type);
60
- }
61
-
62
- ////////////////////////////////////////////////////////////////////////////////////////
63
- // Getters & Setters //
64
- ////////////////////////////////////////////////////////////////////////////////////////
65
- ////////////////////////////////////////////////////////////////////////////////////////
66
- // Private Methods //
67
- ////////////////////////////////////////////////////////////////////////////////////////
68
- ////////////////////////////////////////////////////////////////////////////////////////
69
- // Listeners //
70
- ////////////////////////////////////////////////////////////////////////////////////////
71
  }
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
+ //var_dump($form_id);
27
+ $field_type = ((isset($_GET['field_type'])) ? esc_html($_GET['field_type']) : 0);
28
+ $value_disabled = ((isset($_GET['value_disabled'])) ? esc_html($_GET['value_disabled']) : 0);
29
+ if ($task && method_exists($this, $task)) {
30
+ $this->$task($form_id,$field_type="");
31
+ }
32
+ else
33
+ $this->display($id, $field_id, $field_type, $value_disabled,$form_id);
34
+ }
35
+
36
+ public function display($id, $field_id, $field_type, $value_disabled,$form_id) {
37
+ require_once WD_FM_DIR . "/admin/models/FMModelSelect_data_from_db.php";
38
+ $model = new FMModelSelect_data_from_db();
39
+
40
+ require_once WD_FM_DIR . "/admin/views/FMViewSelect_data_from_db.php";
41
+ $view = new FMViewSelect_data_from_db($model);
42
+ $view->display($id, $field_id, $field_type, $value_disabled,$form_id);
43
+ }
44
+
45
+ public function db_tables($form_id,$field_type) {
46
+ require_once WD_FM_DIR . "/admin/models/FMModelSelect_data_from_db.php";
47
+ $model = new FMModelSelect_data_from_db();
48
+
49
+ require_once WD_FM_DIR . "/admin/views/FMViewSelect_data_from_db.php";
50
+ $view = new FMViewSelect_data_from_db($model);
51
+ $view->db_tables((int)$form_id, $field_type);
52
+ }
53
+ public function db_table_struct_select($form_id,$field_type) {
54
+ require_once WD_FM_DIR . "/admin/models/FMModelSelect_data_from_db.php";
55
+ $model = new FMModelSelect_data_from_db();
56
+
57
+ require_once WD_FM_DIR . "/admin/views/FMViewSelect_data_from_db.php";
58
+ $view = new FMViewSelect_data_from_db($model);
59
+ $view->db_table_struct_select((int)$form_id,$field_type);
60
+ }
61
+
62
+ ////////////////////////////////////////////////////////////////////////////////////////
63
+ // Getters & Setters //
64
+ ////////////////////////////////////////////////////////////////////////////////////////
65
+ ////////////////////////////////////////////////////////////////////////////////////////
66
+ // Private Methods //
67
+ ////////////////////////////////////////////////////////////////////////////////////////
68
+ ////////////////////////////////////////////////////////////////////////////////////////
69
+ // Listeners //
70
+ ////////////////////////////////////////////////////////////////////////////////////////
71
  }
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,792 +1,792 @@
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);
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_fields": {
164
- $day = (isset($_POST['wdform_'.$i."_day".$id]) ? $_POST['wdform_'.$i."_day".$id] : NULL);
165
- $month = (isset($_POST['wdform_'.$i."_month".$id]) ? $_POST['wdform_'.$i."_month".$id] : NULL);
166
- $year = (isset($_POST['wdform_'.$i."_year".$id]) ? $_POST['wdform_'.$i."_year".$id] : NULL);
167
- if($day or $month or $year)
168
- $value = $day . '-' . $month . '-' . $year;
169
- break;
170
- }
171
-
172
- case "type_time": {
173
- $ss = (isset($_POST['wdform_'.$i."_ss".$id]) ? $_POST['wdform_'.$i."_ss".$id] : NULL);
174
- $hh = (isset($_POST['wdform_'.$i."_hh".$id]) ? $_POST['wdform_'.$i."_hh".$id] : NULL);
175
- $mm = (isset($_POST['wdform_'.$i."_mm".$id]) ? $_POST['wdform_'.$i."_mm".$id] : NULL);
176
-
177
- if(isset($ss))
178
- $value = $hh .':'. $mm .':' . $ss;
179
- else
180
- $value = $hh .':' . $mm;
181
-
182
- $am_pm = (isset($_POST['wdform_'.$i."_am_pm".$id]) ? $_POST['wdform_'.$i."_am_pm".$id] : NULL);
183
- if(isset($am_pm))
184
- $value = $value . ' ' . $am_pm;
185
-
186
- break;
187
- }
188
-
189
- case "type_phone": {
190
- $first = (isset($_POST['wdform_'.$i."_element_first".$id]) ? $_POST['wdform_'.$i."_element_first".$id] : NULL);
191
- $last = (isset($_POST['wdform_'.$i."_element_last".$id]) ? $_POST['wdform_'.$i."_element_last".$id] : NULL);
192
- if($first or $last)
193
- $value = $first . ' ' . $last;
194
-
195
- break;
196
- }
197
-
198
- case "type_name": {
199
-
200
- $element_title = (isset($_POST['wdform_'.$i."_element_title".$id]) ? $_POST['wdform_'.$i."_element_title".$id] : NULL);
201
- $element_first = (isset($_POST['wdform_'.$i."_element_first".$id]) ? $_POST['wdform_'.$i."_element_first".$id] : NULL);
202
- $element_last = (isset($_POST['wdform_'.$i."_element_last".$id]) ? $_POST['wdform_'.$i."_element_last".$id] : NULL);
203
- $element_middle = (isset($_POST['wdform_'.$i."_element_middle".$id]) ? $_POST['wdform_'.$i."_element_middle".$id] : NULL);
204
-
205
- if(isset($element_title))
206
- $value = $element_title . '@@@' . $element_first . '@@@' . $element_last . '@@@' . $element_middle;
207
- else
208
- $value = $element_first . '@@@' . $element_last;
209
-
210
- break;
211
- }
212
-
213
- case "type_file_upload": {
214
- break;
215
- }
216
-
217
- case 'type_address': {
218
- $value='*#*#*#';
219
- $element = (isset($_POST['wdform_'.$i."_street1".$id]) ? $_POST['wdform_'.$i."_street1".$id] : NULL);
220
- if($element) {
221
- $value = $element;
222
- break;
223
- }
224
-
225
- $element = (isset($_POST['wdform_'.$i."_street2".$id]) ? $_POST['wdform_'.$i."_street2".$id] : NULL);
226
- if($element) {
227
- $value = $element;
228
- break;
229
- }
230
-
231
- $element = (isset($_POST['wdform_'.$i."_city".$id]) ? $_POST['wdform_'.$i."_city".$id] : NULL);
232
- if(isset($element)) {
233
- $value = $element;
234
- break;
235
- }
236
-
237
- $element = (isset($_POST['wdform_'.$i."_state".$id]) ? $_POST['wdform_'.$i."_state".$id] : NULL);
238
- if(isset($element)) {
239
- $value = $element;
240
- break;
241
- }
242
-
243
- $element = (isset($_POST['wdform_'.$i."_postal".$id]) ? $_POST['wdform_'.$i."_postal".$id] : NULL);
244
- if(isset($element)) {
245
- $value = $element;
246
- break;
247
- }
248
-
249
- $element = (isset($_POST['wdform_'.$i."_country".$id]) ? $_POST['wdform_'.$i."_country".$id] : NULL);
250
- if(isset($element)) {
251
- $value = $element;
252
- break;
253
- }
254
-
255
- break;
256
- }
257
-
258
- case "type_hidden": {
259
- $value = (isset($_POST[$label_order_original[$key]]) ? $_POST[$label_order_original[$key]] : NULL);
260
- break;
261
- }
262
-
263
- case "type_radio": {
264
- $element = (isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : NULL);
265
- if(isset($element)) {
266
- $value = $element;
267
- break;
268
- }
269
-
270
- $value = (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL);
271
- break;
272
- }
273
-
274
- case "type_checkbox": {
275
- $start=-1;
276
- $value='';
277
- for($j=0; $j<100; $j++) {
278
-
279
- $element = (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL);
280
-
281
- if(isset($element)) {
282
- $start = $j;
283
- break;
284
- }
285
- }
286
-
287
- $other_element_id=-1;
288
- $is_other = (isset($_POST['wdform_'.$i."_allow_other".$id]) ? $_POST['wdform_'.$i."_allow_other".$id] : NULL);
289
- if($is_other == "yes") {
290
- $other_element_id = (isset($_POST['wdform_'.$i."_allow_other_num".$id]) ? $_POST['wdform_'.$i."_allow_other_num".$id] : NULL);
291
- }
292
-
293
- if($start!=-1) {
294
- for($j=$start; $j<100; $j++) {
295
- $element = (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL);
296
- if(isset($element))
297
- if($j == $other_element_id) {
298
- $value = $value . (isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : NULL) . '***br***';
299
- }
300
- else
301
- $value = $value . (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL) . '***br***';
302
- }
303
- }
304
-
305
- break;
306
- }
307
-
308
- case "type_paypal_price": {
309
- $value=0;
310
- if((isset($_POST['wdform_'.$i."_element_dollars".$id]) ? $_POST['wdform_'.$i."_element_dollars".$id] : NULL))
311
- $value = (isset($_POST['wdform_'.$i."_element_dollars".$id]) ? $_POST['wdform_'.$i."_element_dollars".$id] : NULL);
312
-
313
- $value = (int) preg_replace('/\D/', '', $value);
314
-
315
- if((isset($_POST['wdform_'.$i."_element_cents".$id]) ? $_POST['wdform_'.$i."_element_cents".$id] : NULL))
316
- $value = $value . '.' . ( preg_replace('/\D/', '', (isset($_POST['wdform_'.$i."_element_cents".$id]) ? $_POST['wdform_'.$i."_element_cents".$id] : NULL)));
317
-
318
-
319
- $value = $value;
320
- break;
321
- }
322
-
323
- case "type_paypal_select": {
324
-
325
- if((isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL))
326
- $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;
327
- else
328
- $value = '';
329
-
330
- $element_quantity = (isset($_POST['wdform_'.$i."element_quantity".$id]) ? $_POST['wdform_'.$i."element_quantity".$id] : NULL);
331
- if(isset($element_quantity) && $value!='')
332
- $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);
333
-
334
-
335
- for($k=0; $k<50; $k++) {
336
- $temp_val = (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL);
337
- if(isset($temp_val) && $value!='') {
338
- $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***';
339
- }
340
- }
341
-
342
- break;
343
- }
344
-
345
- case "type_paypal_radio": {
346
-
347
- if((isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL))
348
- $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;
349
- else
350
- $value='';
351
-
352
-
353
- $element_quantity = (isset($_POST['wdform_'.$i."element_quantity".$id]) ? $_POST['wdform_'.$i."element_quantity".$id] : NULL);
354
- if(isset($element_quantity) && $value!='')
355
- $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***';
356
-
357
-
358
- for($k=0; $k<50; $k++) {
359
- $temp_val = (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL);
360
- if(isset($temp_val) && $value!='') {
361
-
362
- $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***';
363
- }
364
- }
365
-
366
- break;
367
- }
368
-
369
- case "type_paypal_shipping": {
370
-
371
- if((isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL))
372
- $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;
373
- else
374
- $value='';
375
- $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);
376
-
377
- $paypal['shipping'] = (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL);
378
-
379
- break;
380
- }
381
-
382
- case "type_paypal_checkbox": {
383
- $start=-1;
384
- $value='';
385
- for($j=0; $j<100; $j++) {
386
-
387
- $element = (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL);
388
-
389
- if(isset($element)) {
390
- $start=$j;
391
- break;
392
- }
393
- }
394
-
395
- $other_element_id = -1;
396
- $is_other = (isset($_POST['wdform_'.$i."_allow_other".$id]) ? $_POST['wdform_'.$i."_allow_other".$id] : NULL);
397
- if($is_other=="yes") {
398
- $other_element_id = (isset($_POST['wdform_'.$i."_allow_other_num".$id]) ? $_POST['wdform_'.$i."_allow_other_num".$id] : NULL);
399
- }
400
-
401
- if($start!=-1) {
402
- for($j=$start; $j<100; $j++) {
403
- $element = (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL);
404
- if(isset($element))
405
- if($j==$other_element_id) {
406
- $value = $value . (isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : NULL) . '***br***';
407
-
408
- }
409
- else {
410
-
411
- $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***';
412
-
413
- }
414
- }
415
-
416
- $element_quantity = (isset($_POST['wdform_'.$i."element_quantity".$id]) ? $_POST['wdform_'.$i."element_quantity".$id] : NULL);
417
- if(isset($element_quantity))
418
- $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***';
419
-
420
- for($k=0; $k<50; $k++) {
421
- $temp_val = (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL);
422
- if(isset($temp_val)) {
423
-
424
- $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***';
425
- }
426
- }
427
-
428
- }
429
-
430
-
431
- break;
432
- }
433
-
434
- case "type_star_rating": {
435
-
436
- if((isset($_POST['wdform_'.$i."_selected_star_amount".$id]) ? $_POST['wdform_'.$i."_selected_star_amount".$id] : NULL) == "")
437
- $selected_star_amount = 0;
438
- else {
439
- $selected_star_amount = (isset($_POST['wdform_'.$i."_selected_star_amount".$id]) ? $_POST['wdform_'.$i."_selected_star_amount".$id] : NULL);
440
- }
441
- $value = $selected_star_amount . '/' . (isset($_POST['wdform_'.$i."_star_amount".$id]) ? $_POST['wdform_'.$i."_star_amount".$id] : NULL);
442
- break;
443
- }
444
-
445
- case "type_scale_rating": {
446
-
447
- $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);
448
- break;
449
- }
450
-
451
- case "type_spinner": {
452
- $value = (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL);
453
-
454
- break;
455
- }
456
-
457
- case "type_slider": {
458
- $value = (isset($_POST['wdform_'.$i."_slider_value".$id]) ? $_POST['wdform_'.$i."_slider_value".$id] : NULL);
459
-
460
- break;
461
- }
462
- case "type_range": {
463
- $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);
464
-
465
- break;
466
- }
467
- case "type_grading": {
468
- $value ="";
469
- $items = explode(":",(isset($_POST['wdform_'.$i."_hidden_item".$id]) ? $_POST['wdform_'.$i."_hidden_item".$id] : NULL));
470
- for($k=0; $k<sizeof($items)-1; $k++)
471
- $value .= (isset($_POST['wdform_'.$i."_element".$id.'_'.$k]) ? $_POST['wdform_'.$i."_element".$id.'_'.$k] : NULL) . ':';
472
-
473
- $value .= (isset($_POST['wdform_'.$i."_hidden_item".$id]) ? $_POST['wdform_'.$i."_hidden_item".$id] : NULL) . '***grading***';
474
-
475
- break;
476
- }
477
-
478
- case "type_matrix": {
479
-
480
- $rows_of_matrix = explode("***",(isset($_POST['wdform_'.$i."_hidden_row".$id]) ? $_POST['wdform_'.$i."_hidden_row".$id] : NULL));
481
- $rows_count = sizeof($rows_of_matrix)-1;
482
- $column_of_matrix = explode("***",(isset($_POST['wdform_'.$i."_hidden_column".$id]) ? $_POST['wdform_'.$i."_hidden_column".$id] : NULL));
483
- $columns_count = sizeof($column_of_matrix)-1;
484
-
485
-
486
- if((isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) == "radio") {
487
- $input_value="";
488
-
489
- for($k=1; $k<=$rows_count; $k++)
490
- $input_value .= (isset($_POST['wdform_'.$i."_input_element".$id.$k]) ? $_POST['wdform_'.$i."_input_element".$id.$k] : 0) ."***";
491
-
492
- }
493
- if((isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) == "checkbox") {
494
- $input_value="";
495
-
496
- for($k=1; $k<=$rows_count; $k++)
497
- for($j=1; $j<=$columns_count; $j++)
498
- $input_value .= (isset($_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j]) ? $_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j] : 0) . "***";
499
- }
500
-
501
- if((isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) == "text") {
502
- $input_value="";
503
- for($k=1; $k<=$rows_count; $k++)
504
- for($j=1; $j<=$columns_count; $j++)
505
- $input_value .= (isset($_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j]) ? $_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j] : NULL) . "***";
506
- }
507
-
508
- if((isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) == "select") {
509
- $input_value="";
510
- for($k=1; $k<=$rows_count; $k++)
511
- for($j=1; $j<=$columns_count; $j++)
512
- $input_value .= (isset($_POST['wdform_'.$i."_select_yes_no".$id.$k.'_'.$j]) ? $_POST['wdform_'.$i."_select_yes_no".$id.$k.'_'.$j] : NULL) . "***";
513
- }
514
-
515
- $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***';
516
-
517
- break;
518
- }
519
-
520
- }
521
-
522
- if($type == "type_address")
523
- if($value == '*#*#*#')
524
- continue;
525
-
526
-
527
- if($value) {
528
- $query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $group_id . "' AND element_label='" . $i . "'";
529
- $result = $wpdb->get_var($query);
530
-
531
- if($result) {
532
- $save = $wpdb->update($wpdb->prefix . "formmaker_submits", array(
533
- 'element_value' => stripslashes($value),
534
- ), array(
535
- 'group_id' => $group_id,
536
- 'element_label' => $i
537
- ), array(
538
- '%s',
539
- ), array(
540
- '%d',
541
- '%s'
542
- ));
543
- }
544
- else {
545
-
546
- $save = $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
547
- 'form_id' => $form_id,
548
- 'element_label' => $i,
549
- 'element_value' => stripslashes($value),
550
- 'group_id' => $group_id,
551
- 'date' => $date,
552
- 'ip' => $ip
553
- ), array(
554
- '%d',
555
- '%s',
556
- '%s',
557
- '%d',
558
- '%s',
559
- '%s'
560
- )
561
- );
562
-
563
-
564
- }
565
- }
566
-
567
-
568
-
569
- }
570
- }
571
-
572
- else {
573
-
574
- foreach ($label_id as $key => $label_id_1) {
575
- $element_value = (isset($_POST["submission_" . $label_id_1]) ? esc_html(stripslashes($_POST["submission_" . $label_id_1])) : " ");
576
- if (isset($_POST["submission_" . $label_id_1])) {
577
- $query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
578
- $result = $wpdb->get_var($query);
579
- if ($label_type[$key] == 'type_file_upload')
580
- if ($element_value)
581
- $element_value = $element_value . "*@@url@@*";
582
- if ($result) {
583
- $save = $wpdb->update($wpdb->prefix . "formmaker_submits", array(
584
- 'element_value' => stripslashes($element_value),
585
- ), array(
586
- 'group_id' => $id,
587
- 'element_label' => $label_id_1
588
- ), array(
589
- '%s',
590
- ), array(
591
- '%d',
592
- '%s'
593
- ));
594
- }
595
- else {
596
- $save = $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
597
- 'form_id' => $form_id,
598
- 'element_label' => $label_id_1,
599
- 'element_value' => stripslashes($element_value),
600
- 'group_id' => $id,
601
- 'date' => $date,
602
- 'ip' => $ip
603
- ), array(
604
- '%d',
605
- '%s',
606
- '%s',
607
- '%d',
608
- '%s',
609
- '%s'
610
- )
611
- );
612
- }
613
- }
614
- else {
615
- $element_value_ch = (isset($_POST["submission_" . $label_id_1 . '_0']) ? esc_html(stripslashes($_POST["submission_" . $label_id_1 . '_0'])) : " ");
616
- if (isset($_POST["submission_" . $label_id_1 . '_0'])) {
617
- for ($z = 0; $z < 21; $z++) {
618
- $element_value_ch = $_POST["submission_" . $label_id_1 . '_' . $z];
619
- if (isset($element_value_ch))
620
- $element_value = $element_value . $element_value_ch . '***br***';
621
- else
622
- break;
623
- }
624
- $query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
625
- $result = $wpdb->get_var($query);
626
- if ($result) {
627
- $query = "UPDATE " . $wpdb->prefix . "formmaker_submits SET `element_value`='" . stripslashes($element_value) . "' WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
628
- $save = $wpdb->update($wpdb->prefix . "formmaker_submits", array(
629
- 'element_value' => stripslashes($element_value),
630
- ), array(
631
- 'group_id' => $id,
632
- 'element_label' => $label_id_1
633
- ), array(
634
- '%s',
635
- ), array(
636
- '%d',
637
- '%s'
638
- ));
639
- }
640
- else {
641
- $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 . "')";
642
- $save = $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
643
- 'form_id' => $form_id,
644
- 'element_label' => $label_id_1,
645
- 'element_value' => stripslashes($element_value),
646
- 'group_id' => $id,
647
- 'date' => $date,
648
- 'ip' => $ip
649
- ), array(
650
- '%d',
651
- '%s',
652
- '%s',
653
- '%d',
654
- '%s',
655
- '%s'
656
- )
657
- );
658
- }
659
- }
660
- }
661
- }
662
- }
663
- if ($save !== FALSE) {
664
- echo WDW_FM_Library::message('Submission Succesfully Saved.', 'updated');
665
- }
666
- else {
667
- echo WDW_FM_Library::message('Error. Please install plugin again.', 'error');
668
- }
669
- }
670
-
671
- public function delete($id) {
672
- global $wpdb;
673
- $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
674
- $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id="%d"', $id);
675
- // $elements_col = $wpdb->get_col($wpdb->prepare('SELECT element_value FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id="%d"', $id));
676
- if ($wpdb->query($query)) {
677
- // foreach ($elements_col as $element_value) {
678
- // $destination = str_replace(site_url() . '/', '', $element_value);
679
- // $destination = str_replace('*@@url@@*', '', $destination);
680
- // if ($destination) {
681
- // $destination = ABSPATH . $destination;
682
- // if (file_exists($destination)) {
683
- // unlink($destination);
684
- // }
685
- // }
686
- // }
687
- echo WDW_FM_Library::message('Item Succesfully Deleted.', 'updated');
688
- }
689
- else {
690
- echo WDW_FM_Library::message('Error. Please install plugin again.', 'error');
691
- }
692
-
693
- $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_sessions WHERE form_id="%d" AND group_id="%d"', $form_id, $id);
694
- $wpdb->query($query);
695
-
696
- $this->display($form_id);
697
- }
698
-
699
- public function delete_all() {
700
- global $wpdb;
701
- $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
702
- $cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
703
- if (count($cid)) {
704
- array_walk($cid, create_function('&$value', '$value = (int)$value;'));
705
- $cids = implode(',', $cid);
706
- $query = 'DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( ' . $cids . ' )';
707
- // $elements_col = $wpdb->get_col('SELECT element_value FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( ' . $cids . ' )');
708
- if ($wpdb->query($query)) {
709
-
710
- echo WDW_FM_Library::message('Items Succesfully Deleted.', 'updated');
711
- }
712
- else {
713
- echo WDW_FM_Library::message('Error. Please install plugin again.', 'error');
714
- }
715
-
716
- $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_sessions WHERE form_id="%d" AND group_id IN ( "%s" )', $form_id, $cids );
717
- $wpdb->query($query);
718
- }
719
- else {
720
- echo WDW_FM_Library::message('You must select at least one item.', 'error');
721
- }
722
- $this->display($form_id);
723
- }
724
-
725
- public function block_ip() {
726
- global $wpdb;
727
- $flag = FALSE;
728
- $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
729
- $cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
730
- if (count($cid)) {
731
- array_walk($cid, create_function('&$value', '$value = (int)$value;'));
732
- $cids = implode(',', $cid);
733
- $query = 'SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( '. $cids .' )';
734
- $rows = $wpdb->get_results($query);
735
- foreach ($rows as $row) {
736
- $ips = $wpdb->get_var($wpdb->prepare('SELECT ip FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $row->ip));
737
- $flag = TRUE;
738
- if (!$ips) {
739
- $save = $wpdb->insert($wpdb->prefix . 'formmaker_blocked', array(
740
- 'ip' => $row->ip,
741
- ), array(
742
- '%s',
743
- ));
744
- }
745
- }
746
- }
747
- if ($flag) {
748
- echo WDW_FM_Library::message('IPs Succesfully Blocked.', 'updated');
749
- }
750
- else {
751
- echo WDW_FM_Library::message('You must select at least one item.', 'error');
752
- }
753
- $this->display($form_id);
754
- }
755
-
756
- public function unblock_ip() {
757
- global $wpdb;
758
- $flag = FALSE;
759
- $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
760
- $cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
761
- if (count($cid)) {
762
- array_walk($cid, create_function('&$value', '$value = (int)$value;'));
763
- $cids = implode(',', $cid);
764
- $query = 'SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( '. $cids .' )';
765
- $rows = $wpdb->get_results($query);
766
- foreach ($rows as $row) {
767
- $flag = TRUE;
768
- $ips = $wpdb->get_var($wpdb->prepare('SELECT ip FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $row->ip));
769
- if ($ips) {
770
- $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $ips));
771
- }
772
- }
773
- }
774
- if ($flag) {
775
- echo WDW_FM_Library::message('IPs Succesfully Unblocked.', 'updated');
776
- }
777
- else {
778
- echo WDW_FM_Library::message('You must select at least one item.', 'error');
779
- }
780
- $this->display($form_id);
781
- }
782
-
783
- ////////////////////////////////////////////////////////////////////////////////////////
784
- // Getters & Setters //
785
- ////////////////////////////////////////////////////////////////////////////////////////
786
- ////////////////////////////////////////////////////////////////////////////////////////
787
- // Private Methods //
788
- ////////////////////////////////////////////////////////////////////////////////////////
789
- ////////////////////////////////////////////////////////////////////////////////////////
790
- // Listeners //
791
- ////////////////////////////////////////////////////////////////////////////////////////
792
  }
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);
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_fields": {
164
+ $day = (isset($_POST['wdform_'.$i."_day".$id]) ? $_POST['wdform_'.$i."_day".$id] : NULL);
165
+ $month = (isset($_POST['wdform_'.$i."_month".$id]) ? $_POST['wdform_'.$i."_month".$id] : NULL);
166
+ $year = (isset($_POST['wdform_'.$i."_year".$id]) ? $_POST['wdform_'.$i."_year".$id] : NULL);
167
+ if($day or $month or $year)
168
+ $value = $day . '-' . $month . '-' . $year;
169
+ break;
170
+ }
171
+
172
+ case "type_time": {
173
+ $ss = (isset($_POST['wdform_'.$i."_ss".$id]) ? $_POST['wdform_'.$i."_ss".$id] : NULL);
174
+ $hh = (isset($_POST['wdform_'.$i."_hh".$id]) ? $_POST['wdform_'.$i."_hh".$id] : NULL);
175
+ $mm = (isset($_POST['wdform_'.$i."_mm".$id]) ? $_POST['wdform_'.$i."_mm".$id] : NULL);
176
+
177
+ if(isset($ss))
178
+ $value = $hh .':'. $mm .':' . $ss;
179
+ else
180
+ $value = $hh .':' . $mm;
181
+
182
+ $am_pm = (isset($_POST['wdform_'.$i."_am_pm".$id]) ? $_POST['wdform_'.$i."_am_pm".$id] : NULL);
183
+ if(isset($am_pm))
184
+ $value = $value . ' ' . $am_pm;
185
+
186
+ break;
187
+ }
188
+
189
+ case "type_phone": {
190
+ $first = (isset($_POST['wdform_'.$i."_element_first".$id]) ? $_POST['wdform_'.$i."_element_first".$id] : NULL);
191
+ $last = (isset($_POST['wdform_'.$i."_element_last".$id]) ? $_POST['wdform_'.$i."_element_last".$id] : NULL);
192
+ if($first or $last)
193
+ $value = $first . ' ' . $last;
194
+
195
+ break;
196
+ }
197
+
198
+ case "type_name": {
199
+
200
+ $element_title = (isset($_POST['wdform_'.$i."_element_title".$id]) ? $_POST['wdform_'.$i."_element_title".$id] : NULL);
201
+ $element_first = (isset($_POST['wdform_'.$i."_element_first".$id]) ? $_POST['wdform_'.$i."_element_first".$id] : NULL);
202
+ $element_last = (isset($_POST['wdform_'.$i."_element_last".$id]) ? $_POST['wdform_'.$i."_element_last".$id] : NULL);
203
+ $element_middle = (isset($_POST['wdform_'.$i."_element_middle".$id]) ? $_POST['wdform_'.$i."_element_middle".$id] : NULL);
204
+
205
+ if(isset($element_title))
206
+ $value = $element_title . '@@@' . $element_first . '@@@' . $element_last . '@@@' . $element_middle;
207
+ else
208
+ $value = $element_first . '@@@' . $element_last;
209
+
210
+ break;
211
+ }
212
+
213
+ case "type_file_upload": {
214
+ break;
215
+ }
216
+
217
+ case 'type_address': {
218
+ $value='*#*#*#';
219
+ $element = (isset($_POST['wdform_'.$i."_street1".$id]) ? $_POST['wdform_'.$i."_street1".$id] : NULL);
220
+ if($element) {
221
+ $value = $element;
222
+ break;
223
+ }
224
+
225
+ $element = (isset($_POST['wdform_'.$i."_street2".$id]) ? $_POST['wdform_'.$i."_street2".$id] : NULL);
226
+ if($element) {
227
+ $value = $element;
228
+ break;
229
+ }
230
+
231
+ $element = (isset($_POST['wdform_'.$i."_city".$id]) ? $_POST['wdform_'.$i."_city".$id] : NULL);
232
+ if(isset($element)) {
233
+ $value = $element;
234
+ break;
235
+ }
236
+
237
+ $element = (isset($_POST['wdform_'.$i."_state".$id]) ? $_POST['wdform_'.$i."_state".$id] : NULL);
238
+ if(isset($element)) {
239
+ $value = $element;
240
+ break;
241
+ }
242
+
243
+ $element = (isset($_POST['wdform_'.$i."_postal".$id]) ? $_POST['wdform_'.$i."_postal".$id] : NULL);
244
+ if(isset($element)) {
245
+ $value = $element;
246
+ break;
247
+ }
248
+
249
+ $element = (isset($_POST['wdform_'.$i."_country".$id]) ? $_POST['wdform_'.$i."_country".$id] : NULL);
250
+ if(isset($element)) {
251
+ $value = $element;
252
+ break;
253
+ }
254
+
255
+ break;
256
+ }
257
+
258
+ case "type_hidden": {
259
+ $value = (isset($_POST[$label_order_original[$key]]) ? $_POST[$label_order_original[$key]] : NULL);
260
+ break;
261
+ }
262
+
263
+ case "type_radio": {
264
+ $element = (isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : NULL);
265
+ if(isset($element)) {
266
+ $value = $element;
267
+ break;
268
+ }
269
+
270
+ $value = (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL);
271
+ break;
272
+ }
273
+
274
+ case "type_checkbox": {
275
+ $start=-1;
276
+ $value='';
277
+ for($j=0; $j<100; $j++) {
278
+
279
+ $element = (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL);
280
+
281
+ if(isset($element)) {
282
+ $start = $j;
283
+ break;
284
+ }
285
+ }
286
+
287
+ $other_element_id=-1;
288
+ $is_other = (isset($_POST['wdform_'.$i."_allow_other".$id]) ? $_POST['wdform_'.$i."_allow_other".$id] : NULL);
289
+ if($is_other == "yes") {
290
+ $other_element_id = (isset($_POST['wdform_'.$i."_allow_other_num".$id]) ? $_POST['wdform_'.$i."_allow_other_num".$id] : NULL);
291
+ }
292
+
293
+ if($start!=-1) {
294
+ for($j=$start; $j<100; $j++) {
295
+ $element = (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL);
296
+ if(isset($element))
297
+ if($j == $other_element_id) {
298
+ $value = $value . (isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : NULL) . '***br***';
299
+ }
300
+ else
301
+ $value = $value . (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL) . '***br***';
302
+ }
303
+ }
304
+
305
+ break;
306
+ }
307
+
308
+ case "type_paypal_price": {
309
+ $value=0;
310
+ if((isset($_POST['wdform_'.$i."_element_dollars".$id]) ? $_POST['wdform_'.$i."_element_dollars".$id] : NULL))
311
+ $value = (isset($_POST['wdform_'.$i."_element_dollars".$id]) ? $_POST['wdform_'.$i."_element_dollars".$id] : NULL);
312
+
313
+ $value = (int) preg_replace('/\D/', '', $value);
314
+
315
+ if((isset($_POST['wdform_'.$i."_element_cents".$id]) ? $_POST['wdform_'.$i."_element_cents".$id] : NULL))
316
+ $value = $value . '.' . ( preg_replace('/\D/', '', (isset($_POST['wdform_'.$i."_element_cents".$id]) ? $_POST['wdform_'.$i."_element_cents".$id] : NULL)));
317
+
318
+
319
+ $value = $value;
320
+ break;
321
+ }
322
+
323
+ case "type_paypal_select": {
324
+
325
+ if((isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL))
326
+ $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;
327
+ else
328
+ $value = '';
329
+
330
+ $element_quantity = (isset($_POST['wdform_'.$i."element_quantity".$id]) ? $_POST['wdform_'.$i."element_quantity".$id] : NULL);
331
+ if(isset($element_quantity) && $value!='')
332
+ $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);
333
+
334
+
335
+ for($k=0; $k<50; $k++) {
336
+ $temp_val = (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL);
337
+ if(isset($temp_val) && $value!='') {
338
+ $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***';
339
+ }
340
+ }
341
+
342
+ break;
343
+ }
344
+
345
+ case "type_paypal_radio": {
346
+
347
+ if((isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL))
348
+ $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;
349
+ else
350
+ $value='';
351
+
352
+
353
+ $element_quantity = (isset($_POST['wdform_'.$i."element_quantity".$id]) ? $_POST['wdform_'.$i."element_quantity".$id] : NULL);
354
+ if(isset($element_quantity) && $value!='')
355
+ $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***';
356
+
357
+
358
+ for($k=0; $k<50; $k++) {
359
+ $temp_val = (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL);
360
+ if(isset($temp_val) && $value!='') {
361
+
362
+ $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***';
363
+ }
364
+ }
365
+
366
+ break;
367
+ }
368
+
369
+ case "type_paypal_shipping": {
370
+
371
+ if((isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL))
372
+ $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;
373
+ else
374
+ $value='';
375
+ $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);
376
+
377
+ $paypal['shipping'] = (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL);
378
+
379
+ break;
380
+ }
381
+
382
+ case "type_paypal_checkbox": {
383
+ $start=-1;
384
+ $value='';
385
+ for($j=0; $j<100; $j++) {
386
+
387
+ $element = (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL);
388
+
389
+ if(isset($element)) {
390
+ $start=$j;
391
+ break;
392
+ }
393
+ }
394
+
395
+ $other_element_id = -1;
396
+ $is_other = (isset($_POST['wdform_'.$i."_allow_other".$id]) ? $_POST['wdform_'.$i."_allow_other".$id] : NULL);
397
+ if($is_other=="yes") {
398
+ $other_element_id = (isset($_POST['wdform_'.$i."_allow_other_num".$id]) ? $_POST['wdform_'.$i."_allow_other_num".$id] : NULL);
399
+ }
400
+
401
+ if($start!=-1) {
402
+ for($j=$start; $j<100; $j++) {
403
+ $element = (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL);
404
+ if(isset($element))
405
+ if($j==$other_element_id) {
406
+ $value = $value . (isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : NULL) . '***br***';
407
+
408
+ }
409
+ else {
410
+
411
+ $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***';
412
+
413
+ }
414
+ }
415
+
416
+ $element_quantity = (isset($_POST['wdform_'.$i."element_quantity".$id]) ? $_POST['wdform_'.$i."element_quantity".$id] : NULL);
417
+ if(isset($element_quantity))
418
+ $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***';
419
+
420
+ for($k=0; $k<50; $k++) {
421
+ $temp_val = (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL);
422
+ if(isset($temp_val)) {
423
+
424
+ $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***';
425
+ }
426
+ }
427
+
428
+ }
429
+
430
+
431
+ break;
432
+ }
433
+
434
+ case "type_star_rating": {
435
+
436
+ if((isset($_POST['wdform_'.$i."_selected_star_amount".$id]) ? $_POST['wdform_'.$i."_selected_star_amount".$id] : NULL) == "")
437
+ $selected_star_amount = 0;
438
+ else {
439
+ $selected_star_amount = (isset($_POST['wdform_'.$i."_selected_star_amount".$id]) ? $_POST['wdform_'.$i."_selected_star_amount".$id] : NULL);
440
+ }
441
+ $value = $selected_star_amount . '/' . (isset($_POST['wdform_'.$i."_star_amount".$id]) ? $_POST['wdform_'.$i."_star_amount".$id] : NULL);
442
+ break;
443
+ }
444
+
445
+ case "type_scale_rating": {
446
+
447
+ $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);
448
+ break;
449
+ }
450
+
451
+ case "type_spinner": {
452
+ $value = (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL);
453
+
454
+ break;
455
+ }
456
+
457
+ case "type_slider": {
458
+ $value = (isset($_POST['wdform_'.$i."_slider_value".$id]) ? $_POST['wdform_'.$i."_slider_value".$id] : NULL);
459
+
460
+ break;
461
+ }
462
+ case "type_range": {
463
+ $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);
464
+
465
+ break;
466
+ }
467
+ case "type_grading": {
468
+ $value ="";
469
+ $items = explode(":",(isset($_POST['wdform_'.$i."_hidden_item".$id]) ? $_POST['wdform_'.$i."_hidden_item".$id] : NULL));
470
+ for($k=0; $k<sizeof($items)-1; $k++)
471
+ $value .= (isset($_POST['wdform_'.$i."_element".$id.'_'.$k]) ? $_POST['wdform_'.$i."_element".$id.'_'.$k] : NULL) . ':';
472
+
473
+ $value .= (isset($_POST['wdform_'.$i."_hidden_item".$id]) ? $_POST['wdform_'.$i."_hidden_item".$id] : NULL) . '***grading***';
474
+
475
+ break;
476
+ }
477
+
478
+ case "type_matrix": {
479
+
480
+ $rows_of_matrix = explode("***",(isset($_POST['wdform_'.$i."_hidden_row".$id]) ? $_POST['wdform_'.$i."_hidden_row".$id] : NULL));
481
+ $rows_count = sizeof($rows_of_matrix)-1;
482
+ $column_of_matrix = explode("***",(isset($_POST['wdform_'.$i."_hidden_column".$id]) ? $_POST['wdform_'.$i."_hidden_column".$id] : NULL));
483
+ $columns_count = sizeof($column_of_matrix)-1;
484
+
485
+
486
+ if((isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) == "radio") {
487
+ $input_value="";
488
+
489
+ for($k=1; $k<=$rows_count; $k++)
490
+ $input_value .= (isset($_POST['wdform_'.$i."_input_element".$id.$k]) ? $_POST['wdform_'.$i."_input_element".$id.$k] : 0) ."***";
491
+
492
+ }
493
+ if((isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) == "checkbox") {
494
+ $input_value="";
495
+
496
+ for($k=1; $k<=$rows_count; $k++)
497
+ for($j=1; $j<=$columns_count; $j++)
498
+ $input_value .= (isset($_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j]) ? $_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j] : 0) . "***";
499
+ }
500
+
501
+ if((isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) == "text") {
502
+ $input_value="";
503
+ for($k=1; $k<=$rows_count; $k++)
504
+ for($j=1; $j<=$columns_count; $j++)
505
+ $input_value .= (isset($_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j]) ? $_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j] : NULL) . "***";
506
+ }
507
+
508
+ if((isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) == "select") {
509
+ $input_value="";
510
+ for($k=1; $k<=$rows_count; $k++)
511
+ for($j=1; $j<=$columns_count; $j++)
512
+ $input_value .= (isset($_POST['wdform_'.$i."_select_yes_no".$id.$k.'_'.$j]) ? $_POST['wdform_'.$i."_select_yes_no".$id.$k.'_'.$j] : NULL) . "***";
513
+ }
514
+
515
+ $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***';
516
+
517
+ break;
518
+ }
519
+
520
+ }
521
+
522
+ if($type == "type_address")
523
+ if($value == '*#*#*#')
524
+ continue;
525
+
526
+
527
+ if($value) {
528
+ $query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $group_id . "' AND element_label='" . $i . "'";
529
+ $result = $wpdb->get_var($query);
530
+
531
+ if($result) {
532
+ $save = $wpdb->update($wpdb->prefix . "formmaker_submits", array(
533
+ 'element_value' => stripslashes($value),
534
+ ), array(
535
+ 'group_id' => $group_id,
536
+ 'element_label' => $i
537
+ ), array(
538
+ '%s',
539
+ ), array(
540
+ '%d',
541
+ '%s'
542
+ ));
543
+ }
544
+ else {
545
+
546
+ $save = $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
547
+ 'form_id' => $form_id,
548
+ 'element_label' => $i,
549
+ 'element_value' => stripslashes($value),
550
+ 'group_id' => $group_id,
551
+ 'date' => $date,
552
+ 'ip' => $ip
553
+ ), array(
554
+ '%d',
555
+ '%s',
556
+ '%s',
557
+ '%d',
558
+ '%s',
559
+ '%s'
560
+ )
561
+ );
562
+
563
+
564
+ }
565
+ }
566
+
567
+
568
+
569
+ }
570
+ }
571
+
572
+ else {
573
+
574
+ foreach ($label_id as $key => $label_id_1) {
575
+ $element_value = (isset($_POST["submission_" . $label_id_1]) ? esc_html(stripslashes($_POST["submission_" . $label_id_1])) : " ");
576
+ if (isset($_POST["submission_" . $label_id_1])) {
577
+ $query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
578
+ $result = $wpdb->get_var($query);
579
+ if ($label_type[$key] == 'type_file_upload')
580
+ if ($element_value)
581
+ $element_value = $element_value . "*@@url@@*";
582
+ if ($result) {
583
+ $save = $wpdb->update($wpdb->prefix . "formmaker_submits", array(
584
+ 'element_value' => stripslashes($element_value),
585
+ ), array(
586
+ 'group_id' => $id,
587
+ 'element_label' => $label_id_1
588
+ ), array(
589
+ '%s',
590
+ ), array(
591
+ '%d',
592
+ '%s'
593
+ ));
594
+ }
595
+ else {
596
+ $save = $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
597
+ 'form_id' => $form_id,
598
+ 'element_label' => $label_id_1,
599
+ 'element_value' => stripslashes($element_value),
600
+ 'group_id' => $id,
601
+ 'date' => $date,
602
+ 'ip' => $ip
603
+ ), array(
604
+ '%d',
605
+ '%s',
606
+ '%s',
607
+ '%d',
608
+ '%s',
609
+ '%s'
610
+ )
611
+ );
612
+ }
613
+ }
614
+ else {
615
+ $element_value_ch = (isset($_POST["submission_" . $label_id_1 . '_0']) ? esc_html(stripslashes($_POST["submission_" . $label_id_1 . '_0'])) : " ");
616
+ if (isset($_POST["submission_" . $label_id_1 . '_0'])) {
617
+ for ($z = 0; $z < 21; $z++) {
618
+ $element_value_ch = $_POST["submission_" . $label_id_1 . '_' . $z];
619
+ if (isset($element_value_ch))
620
+ $element_value = $element_value . $element_value_ch . '***br***';
621
+ else
622
+ break;
623
+ }
624
+ $query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
625
+ $result = $wpdb->get_var($query);
626
+ if ($result) {
627
+ $query = "UPDATE " . $wpdb->prefix . "formmaker_submits SET `element_value`='" . stripslashes($element_value) . "' WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
628
+ $save = $wpdb->update($wpdb->prefix . "formmaker_submits", array(
629
+ 'element_value' => stripslashes($element_value),
630
+ ), array(
631
+ 'group_id' => $id,
632
+ 'element_label' => $label_id_1
633
+ ), array(
634
+ '%s',
635
+ ), array(
636
+ '%d',
637
+ '%s'
638
+ ));
639
+ }
640
+ else {
641
+ $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 . "')";
642
+ $save = $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
643
+ 'form_id' => $form_id,
644
+ 'element_label' => $label_id_1,
645
+ 'element_value' => stripslashes($element_value),
646
+ 'group_id' => $id,
647
+ 'date' => $date,
648
+ 'ip' => $ip
649
+ ), array(
650
+ '%d',
651
+ '%s',
652
+ '%s',
653
+ '%d',
654
+ '%s',
655
+ '%s'
656
+ )
657
+ );
658
+ }
659
+ }
660
+ }
661
+ }
662
+ }
663
+ if ($save !== FALSE) {
664
+ echo WDW_FM_Library::message('Submission Succesfully Saved.', 'updated');
665
+ }
666
+ else {
667
+ echo WDW_FM_Library::message('Error. Please install plugin again.', 'error');
668
+ }
669
+ }
670
+
671
+ public function delete($id) {
672
+ global $wpdb;
673
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
674
+ $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id="%d"', $id);
675
+ // $elements_col = $wpdb->get_col($wpdb->prepare('SELECT element_value FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id="%d"', $id));
676
+ if ($wpdb->query($query)) {
677
+ // foreach ($elements_col as $element_value) {
678
+ // $destination = str_replace(site_url() . '/', '', $element_value);
679
+ // $destination = str_replace('*@@url@@*', '', $destination);
680
+ // if ($destination) {
681
+ // $destination = ABSPATH . $destination;
682
+ // if (file_exists($destination)) {
683
+ // unlink($destination);
684
+ // }
685
+ // }
686
+ // }
687
+ echo WDW_FM_Library::message('Item Succesfully Deleted.', 'updated');
688
+ }
689
+ else {
690
+ echo WDW_FM_Library::message('Error. Please install plugin again.', 'error');
691
+ }
692
+
693
+ $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_sessions WHERE form_id="%d" AND group_id="%d"', $form_id, $id);
694
+ $wpdb->query($query);
695
+
696
+ $this->display($form_id);
697
+ }
698
+
699
+ public function delete_all() {
700
+ global $wpdb;
701
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
702
+ $cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
703
+ if (count($cid)) {
704
+ array_walk($cid, create_function('&$value', '$value = (int)$value;'));
705
+ $cids = implode(',', $cid);
706
+ $query = 'DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( ' . $cids . ' )';
707
+ // $elements_col = $wpdb->get_col('SELECT element_value FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( ' . $cids . ' )');
708
+ if ($wpdb->query($query)) {
709
+
710
+ echo WDW_FM_Library::message('Items Succesfully Deleted.', 'updated');
711
+ }
712
+ else {
713
+ echo WDW_FM_Library::message('Error. Please install plugin again.', 'error');
714
+ }
715
+
716
+ $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_sessions WHERE form_id="%d" AND group_id IN ( "%s" )', $form_id, $cids );
717
+ $wpdb->query($query);
718
+ }
719
+ else {
720
+ echo WDW_FM_Library::message('You must select at least one item.', 'error');
721
+ }
722
+ $this->display($form_id);
723
+ }
724
+
725
+ public function block_ip() {
726
+ global $wpdb;
727
+ $flag = FALSE;
728
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
729
+ $cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
730
+ if (count($cid)) {
731
+ array_walk($cid, create_function('&$value', '$value = (int)$value;'));
732
+ $cids = implode(',', $cid);
733
+ $query = 'SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( '. $cids .' )';
734
+ $rows = $wpdb->get_results($query);
735
+ foreach ($rows as $row) {
736
+ $ips = $wpdb->get_var($wpdb->prepare('SELECT ip FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $row->ip));
737
+ $flag = TRUE;
738
+ if (!$ips) {
739
+ $save = $wpdb->insert($wpdb->prefix . 'formmaker_blocked', array(
740
+ 'ip' => $row->ip,
741
+ ), array(
742
+ '%s',
743
+ ));
744
+ }
745
+ }
746
+ }
747
+ if ($flag) {
748
+ echo WDW_FM_Library::message('IPs Succesfully Blocked.', 'updated');
749
+ }
750
+ else {
751
+ echo WDW_FM_Library::message('You must select at least one item.', 'error');
752
+ }
753
+ $this->display($form_id);
754
+ }
755
+
756
+ public function unblock_ip() {
757
+ global $wpdb;
758
+ $flag = FALSE;
759
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
760
+ $cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
761
+ if (count($cid)) {
762
+ array_walk($cid, create_function('&$value', '$value = (int)$value;'));
763
+ $cids = implode(',', $cid);
764
+ $query = 'SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( '. $cids .' )';
765
+ $rows = $wpdb->get_results($query);
766
+ foreach ($rows as $row) {
767
+ $flag = TRUE;
768
+ $ips = $wpdb->get_var($wpdb->prepare('SELECT ip FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $row->ip));
769
+ if ($ips) {
770
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $ips));
771
+ }
772
+ }
773
+ }
774
+ if ($flag) {
775
+ echo WDW_FM_Library::message('IPs Succesfully Unblocked.', 'updated');
776
+ }
777
+ else {
778
+ echo WDW_FM_Library::message('You must select at least one item.', 'error');
779
+ }
780
+ $this->display($form_id);
781
+ }
782
+
783
+ ////////////////////////////////////////////////////////////////////////////////////////
784
+ // Getters & Setters //
785
+ ////////////////////////////////////////////////////////////////////////////////////////
786
+ ////////////////////////////////////////////////////////////////////////////////////////
787
+ // Private Methods //
788
+ ////////////////////////////////////////////////////////////////////////////////////////
789
+ ////////////////////////////////////////////////////////////////////////////////////////
790
+ // Listeners //
791
+ ////////////////////////////////////////////////////////////////////////////////////////
792
  }
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/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,2223 +1,2223 @@
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
- case 'type_date_fields':
1070
- {
1071
- $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');
1072
-
1073
- $temp=$params;
1074
- foreach($params_names as $params_name )
1075
- {
1076
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1077
- $param[$params_name] = $temp[0];
1078
- $temp=$temp[1];
1079
- }
1080
-
1081
- if($temp)
1082
- {
1083
- $temp =explode('*:*w_attr_name*:*',$temp);
1084
- $attrs = array_slice($temp,0, count($temp)-1);
1085
- foreach($attrs as $attr)
1086
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1087
- }
1088
-
1089
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1090
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
1091
-
1092
-
1093
- if($param['w_day_type']=="SELECT")
1094
- {
1095
-
1096
-
1097
- $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>';
1098
- for($k=0; $k<=31; $k++)
1099
- {
1100
- if($k<10)
1101
- {
1102
- if($param['w_day']=='0'.$k)
1103
- $selected = "selected=\"selected\"";
1104
- else
1105
- $selected = "";
1106
-
1107
- $w_day_type .= '<option value="0'.$k.'" '.$selected.'>0'.$k.'</option>';
1108
- }
1109
- else
1110
- {
1111
- if($param['w_day']==''.$k)
1112
- $selected = "selected=\"selected\"";
1113
- else
1114
- $selected = "";
1115
-
1116
- $w_day_type .= '<option value="'.$k.'" '.$selected.'>'.$k.'</option>';
1117
- }
1118
-
1119
-
1120
-
1121
- }
1122
- $w_day_type .= '</select>';
1123
- }
1124
- else
1125
- {
1126
- $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/>';
1127
- }
1128
-
1129
- if($param['w_month_type']=="SELECT")
1130
- {
1131
-
1132
- $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>';
1133
-
1134
- }
1135
- else
1136
- {
1137
- $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/>';
1138
-
1139
- }
1140
- $param['w_to'] = isset($param['w_to']) && $param['w_to']!="NaN" ? $param['w_to'] : date("Y");
1141
- if($param['w_year_type']=="SELECT")
1142
- {
1143
- $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>';
1144
- for($k=$param['w_to']; $k>=$param['w_from']; $k--)
1145
- {
1146
- if($param['w_year']==$k)
1147
- $selected = "selected=\"selected\"";
1148
- else
1149
- $selected = "";
1150
-
1151
- $w_year_type .= '<option value="'.$k.'" '.$selected.'>'.$k.'</option>';
1152
- }
1153
- $w_year_type .= '</select>';
1154
-
1155
- }
1156
- else
1157
- {
1158
- $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/>';
1159
- }
1160
-
1161
-
1162
- $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;">
1163
- '.$w_day_type.'
1164
-
1165
- </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>';
1166
-
1167
- break;
1168
- }
1169
- case 'type_file_upload':
1170
- {
1171
- $params_names=array('w_field_label_size','w_field_label_pos','w_destination','w_extension','w_max_size','w_required','w_multiple','w_class');
1172
- $temp=$params;
1173
- foreach($params_names as $params_name )
1174
- {
1175
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1176
- $param[$params_name] = $temp[0];
1177
- if (isset($temp[1])) {
1178
- $temp = $temp[1];
1179
- }
1180
- else {
1181
- $temp = '';
1182
- }
1183
- }
1184
-
1185
- if($temp)
1186
- {
1187
- $temp =explode('*:*w_attr_name*:*',$temp);
1188
- $attrs = array_slice($temp,0, count($temp)-1);
1189
- foreach($attrs as $attr)
1190
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1191
- }
1192
-
1193
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1194
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
1195
- $multiple = ($param['w_multiple']=="yes" ? "multiple='multiple'" : "");
1196
-
1197
- $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>';
1198
-
1199
- break;
1200
- }
1201
- case 'type_captcha':
1202
- {
1203
- $params_names=array('w_field_label_size','w_field_label_pos','w_digit','w_class');
1204
- $temp=$params;
1205
- foreach($params_names as $params_name )
1206
- {
1207
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1208
- $param[$params_name] = $temp[0];
1209
- $temp=$temp[1];
1210
- }
1211
-
1212
- if($temp)
1213
- {
1214
- $temp =explode('*:*w_attr_name*:*',$temp);
1215
- $attrs = array_slice($temp,0, count($temp)-1);
1216
- foreach($attrs as $attr)
1217
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1218
- }
1219
-
1220
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1221
-
1222
- $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>';
1223
-
1224
- break;
1225
- }
1226
- case 'type_arithmetic_captcha':
1227
- {
1228
- $params_names=array('w_field_label_size','w_field_label_pos', 'w_count', 'w_operations','w_class', 'w_input_size');
1229
- $temp=$params;
1230
- foreach($params_names as $params_name )
1231
- {
1232
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1233
- $param[$params_name] = $temp[0];
1234
- $temp=$temp[1];
1235
- }
1236
-
1237
- if($temp)
1238
- {
1239
- $temp =explode('*:*w_attr_name*:*',$temp);
1240
- $attrs = array_slice($temp,0, count($temp)-1);
1241
- foreach($attrs as $attr)
1242
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1243
- }
1244
-
1245
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1246
- $param['w_count'] = $param['w_count'] ? $param['w_count'] : 1;
1247
- $param['w_operations'] = $param['w_operations'] ? $param['w_operations'] : '+, -, *, /';
1248
- $param['w_input_size'] = $param['w_input_size'] ? $param['w_input_size'] : 60;
1249
-
1250
- $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>';
1251
-
1252
- break;
1253
- }
1254
-
1255
-
1256
- case 'type_recaptcha':
1257
- {
1258
- $params_names=array('w_field_label_size','w_field_label_pos','w_public','w_private','w_theme','w_class');
1259
- $temp=$params;
1260
- foreach($params_names as $params_name )
1261
- {
1262
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1263
- $param[$params_name] = $temp[0];
1264
- $temp=$temp[1];
1265
- }
1266
-
1267
- if($temp)
1268
- {
1269
- $temp =explode('*:*w_attr_name*:*',$temp);
1270
- $attrs = array_slice($temp,0, count($temp)-1);
1271
- foreach($attrs as $attr)
1272
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1273
- }
1274
-
1275
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1276
-
1277
- $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>';
1278
-
1279
- break;
1280
- }
1281
-
1282
- case 'type_hidden':
1283
- {
1284
- $params_names=array('w_name','w_value');
1285
- $temp=$params;
1286
- foreach($params_names as $params_name )
1287
- {
1288
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1289
- $param[$params_name] = $temp[0];
1290
- $temp=$temp[1];
1291
- }
1292
-
1293
- if($temp)
1294
- {
1295
- $temp =explode('*:*w_attr_name*:*',$temp);
1296
- $attrs = array_slice($temp,0, count($temp)-1);
1297
- foreach($attrs as $attr)
1298
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1299
- }
1300
- $param['w_name'] = str_replace('&nbsp;','',$param['w_name']);
1301
- $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>';
1302
-
1303
- break;
1304
- }
1305
- case 'type_mark_map':
1306
- {
1307
- $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');
1308
- $temp=$params;
1309
- foreach($params_names as $params_name )
1310
- {
1311
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1312
- $param[$params_name] = $temp[0];
1313
- $temp=$temp[1];
1314
- }
1315
-
1316
- if($temp)
1317
- {
1318
- $temp =explode('*:*w_attr_name*:*',$temp);
1319
- $attrs = array_slice($temp,0, count($temp)-1);
1320
- foreach($attrs as $attr)
1321
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1322
- }
1323
-
1324
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1325
-
1326
- $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> ';
1327
-
1328
- break;
1329
- }
1330
-
1331
- case 'type_map':
1332
- {
1333
- $params_names=array('w_center_x','w_center_y','w_long','w_lat','w_zoom','w_width','w_height','w_info','w_class');
1334
- $temp=$params;
1335
- foreach($params_names as $params_name )
1336
- {
1337
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1338
- $param[$params_name] = $temp[0];
1339
- $temp=$temp[1];
1340
- }
1341
-
1342
- if($temp)
1343
- {
1344
- $temp =explode('*:*w_attr_name*:*',$temp);
1345
- $attrs = array_slice($temp,0, count($temp)-1);
1346
- foreach($attrs as $attr)
1347
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1348
- }
1349
-
1350
- $marker='';
1351
-
1352
- $param['w_long'] = explode('***',$param['w_long']);
1353
- $param['w_lat'] = explode('***',$param['w_lat']);
1354
- $param['w_info'] = explode('***',$param['w_info']);
1355
- foreach($param['w_long'] as $key => $w_long )
1356
- {
1357
- $marker.='long'.$key.'="'.$w_long.'" lat'.$key.'="'.$param['w_lat'][$key].'" info'.$key.'="'.$param['w_info'][$key].'"';
1358
- }
1359
-
1360
- $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>';
1361
-
1362
- break;
1363
- }
1364
- case 'type_paypal_price':
1365
- {
1366
-
1367
- $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');
1368
- $temp=$params;
1369
- foreach($params_names as $params_name )
1370
- {
1371
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1372
- $param[$params_name] = $temp[0];
1373
- $temp=$temp[1];
1374
- }
1375
-
1376
- if($temp)
1377
- {
1378
- $temp =explode('*:*w_attr_name*:*',$temp);
1379
- $attrs = array_slice($temp,0, count($temp)-1);
1380
- foreach($attrs as $attr)
1381
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1382
- }
1383
-
1384
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1385
- $input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active");
1386
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
1387
- $hide_cents = ($param['w_hide_cents']=="yes" ? "none;" : "table-cell;");
1388
-
1389
-
1390
- $w_first_val = explode('***',$param['w_first_val']);
1391
- $w_title = explode('***',$param['w_title']);
1392
- $w_mini_labels = explode('***',$param['w_mini_labels']);
1393
-
1394
- $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>';
1395
- break;
1396
- }
1397
-
1398
- case 'type_paypal_select':
1399
- {
1400
- $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');
1401
- $temp=$params;
1402
- if(strpos($temp, 'w_choices_params') > -1)
1403
- $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');
1404
- foreach($params_names as $params_name )
1405
- {
1406
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1407
- $param[$params_name] = $temp[0];
1408
- $temp=$temp[1];
1409
- }
1410
-
1411
- if($temp)
1412
- {
1413
- $temp =explode('*:*w_attr_name*:*',$temp);
1414
- $attrs = array_slice($temp,0, count($temp)-1);
1415
- foreach($attrs as $attr)
1416
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1417
- }
1418
-
1419
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1420
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
1421
- $param['w_choices'] = explode('***',$param['w_choices']);
1422
-
1423
- $param['w_choices_price'] = explode('***',$param['w_choices_price']);
1424
-
1425
- $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
1426
-
1427
- $param['w_choices_disabled'] = explode('***',$param['w_choices_disabled']);
1428
- $param['w_property'] = explode('***',$param['w_property']);
1429
- $param['w_property_values'] = explode('***',$param['w_property_values']);
1430
- if(isset($param['w_choices_params']))
1431
- $param['w_choices_params'] = explode('***',$param['w_choices_params']);
1432
- foreach($param['w_choices_checked'] as $key => $choices_checked )
1433
- {
1434
- if($choices_checked=='true')
1435
- $param['w_choices_checked'][$key]='selected="selected"';
1436
- else
1437
- $param['w_choices_checked'][$key]='';
1438
- }
1439
-
1440
-
1441
- $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>';
1442
- foreach($param['w_choices'] as $key => $choice)
1443
- {
1444
- $where = '';
1445
- $order_by = '';
1446
- $db_info = '';
1447
- $choice_value = $param['w_choices_disabled'][$key]=="true" ? '' : $param['w_choices_price'][$key];
1448
-
1449
- if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
1450
- {
1451
- $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
1452
- $where = "where='".$w_choices_params[0]."'";
1453
- $w_choices_params = explode('[db_info]',$w_choices_params[1]);
1454
- $order_by = "order_by='".$w_choices_params[0]."'";
1455
- $db_info = "db_info='".$w_choices_params[1]."'";
1456
- }
1457
- $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>';
1458
- }
1459
- $rep.='</select><div id="'.$id.'_divform_id_temp">';
1460
- if($param['w_quantity']=="yes")
1461
- $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>';
1462
- if($param['w_property'][0])
1463
- foreach($param['w_property'] as $key => $property)
1464
- {
1465
-
1466
- $rep.='
1467
- <span id="'.$id.'_property_'.$key.'" style="margin-right: 15px;">
1468
-
1469
- <label class="mini_label" id="'.$id.'_property_label_form_id_temp'.$key.'" style="margin-right: 5px;">'.$property.'</label>
1470
- <select id="'.$id.'_propertyform_id_temp'.$key.'" name="'.$id.'_propertyform_id_temp'.$key.'" style="width: auto; margin: 2px 0px;" disabled>';
1471
- $param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
1472
- $param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
1473
- foreach($param['w_property_values'][$key] as $subkey => $property_value)
1474
- {
1475
- $rep.='<option id="'.$id.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'">'.$property_value.'</option>';
1476
- }
1477
- $rep.='</select></span>';
1478
- }
1479
-
1480
- $rep.='</div></div></div>';
1481
- break;
1482
- }
1483
-
1484
- case 'type_paypal_checkbox':
1485
- {
1486
-
1487
- $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');
1488
- $temp=$params;
1489
- if(strpos($temp, 'w_field_option_pos') > -1)
1490
- $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');
1491
- foreach($params_names as $params_name )
1492
- {
1493
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1494
- $param[$params_name] = $temp[0];
1495
- $temp=$temp[1];
1496
- }
1497
-
1498
- if($temp)
1499
- {
1500
- $temp =explode('*:*w_attr_name*:*',$temp);
1501
- $attrs = array_slice($temp,0, count($temp)-1);
1502
- foreach($attrs as $attr)
1503
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1504
- }
1505
- if(!isset($param['w_field_option_pos']))
1506
- $param['w_field_option_pos'] = 'left';
1507
-
1508
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1509
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
1510
- $param['w_choices'] = explode('***',$param['w_choices']);
1511
- $param['w_choices_price'] = explode('***',$param['w_choices_price']);
1512
- $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
1513
- $param['w_property'] = explode('***',$param['w_property']);
1514
- $param['w_property_values'] = explode('***',$param['w_property_values']);
1515
-
1516
- if(isset($param['w_choices_params']))
1517
- $param['w_choices_params'] = explode('***',$param['w_choices_params']);
1518
-
1519
- foreach($param['w_choices_checked'] as $key => $choices_checked )
1520
- {
1521
- if($choices_checked=='true')
1522
- $param['w_choices_checked'][$key]='checked="checked"';
1523
- else
1524
- $param['w_choices_checked'][$key]='';
1525
- }
1526
-
1527
- $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;">';
1528
-
1529
- if($param['w_flow']=='hor')
1530
- {
1531
- $rep.= '<div id="'.$id.'_hor" style="display: table-row;">';
1532
- foreach($param['w_choices'] as $key => $choice)
1533
- {
1534
- $where ='';
1535
- $order_by ='';
1536
- $db_info = '';
1537
- if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
1538
- {
1539
- $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
1540
- $where = "where='".$w_choices_params[0]."'";
1541
- $w_choices_params = explode('[db_info]',$w_choices_params[1]);
1542
- $order_by = "order_by='".$w_choices_params[0]."'";
1543
- $db_info = "db_info='".$w_choices_params[1]."'";
1544
- }
1545
-
1546
- $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>';
1547
- }
1548
- $rep.= '</div>';
1549
- }
1550
- else
1551
- {
1552
-
1553
- foreach($param['w_choices'] as $key => $choice)
1554
- {
1555
- $where ='';
1556
- $order_by ='';
1557
- $db_info ='';
1558
- if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
1559
- {
1560
- $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
1561
- $where = "where='".$w_choices_params[0]."'";
1562
- $w_choices_params = explode('[db_info]',$w_choices_params[1]);
1563
- $order_by = "order_by='".$w_choices_params[0]."'";
1564
- $db_info = "db_info='".$w_choices_params[1]."'";
1565
- }
1566
-
1567
- $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>';
1568
- }
1569
-
1570
- }
1571
- $rep.='</div></div>';
1572
-
1573
- $rep.='<div id="'.$id.'_divform_id_temp">';
1574
- if($param['w_quantity']=="yes")
1575
- $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>';
1576
- if($param['w_property'][0])
1577
- foreach($param['w_property'] as $key => $property)
1578
- {
1579
- $rep.='
1580
- <span id="'.$id.'_property_'.$key.'" style="margin-right: 15px;">
1581
-
1582
- <label class="mini_label" id="'.$id.'_property_label_form_id_temp'.$key.'" style="margin-right: 5px;">'.$property.'</label>
1583
- <select id="'.$id.'_propertyform_id_temp'.$key.'" name="'.$id.'_propertyform_id_temp'.$key.'" style="width: auto; margin: 2px 0px;" disabled>';
1584
- $param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
1585
- $param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
1586
- foreach($param['w_property_values'][$key] as $subkey => $property_value)
1587
- {
1588
- $rep.='<option id="'.$id.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'">'.$property_value.'</option>';
1589
- }
1590
- $rep.='</select></span>';
1591
- }
1592
-
1593
- $rep.='</div></div></div>';
1594
- break;
1595
- }
1596
- case 'type_paypal_radio':
1597
- {
1598
-
1599
- $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');
1600
- $temp=$params;
1601
- if(strpos($temp, 'w_field_option_pos') > -1)
1602
- $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');
1603
- foreach($params_names as $params_name )
1604
- {
1605
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1606
- $param[$params_name] = $temp[0];
1607
- $temp=$temp[1];
1608
- }
1609
-
1610
- if($temp)
1611
- {
1612
- $temp =explode('*:*w_attr_name*:*',$temp);
1613
- $attrs = array_slice($temp,0, count($temp)-1);
1614
- foreach($attrs as $attr)
1615
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1616
- }
1617
- if(!isset($param['w_field_option_pos']))
1618
- $param['w_field_option_pos'] = 'left';
1619
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1620
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
1621
- $param['w_choices'] = explode('***',$param['w_choices']);
1622
-
1623
- $param['w_choices_price'] = explode('***',$param['w_choices_price']);
1624
-
1625
- $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
1626
-
1627
- $param['w_property'] = explode('***',$param['w_property']);
1628
- $param['w_property_values'] = explode('***',$param['w_property_values']);
1629
-
1630
- if(isset($param['w_choices_params']))
1631
- $param['w_choices_params'] = explode('***',$param['w_choices_params']);
1632
-
1633
- foreach($param['w_choices_checked'] as $key => $choices_checked )
1634
- {
1635
- if($choices_checked=='true')
1636
- $param['w_choices_checked'][$key]='checked="checked"';
1637
- else
1638
- $param['w_choices_checked'][$key]='';
1639
- }
1640
-
1641
- $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;">';
1642
-
1643
- if($param['w_flow']=='hor')
1644
- {
1645
- $rep.= '<div id="'.$id.'_hor" style="display: table-row;">';
1646
- foreach($param['w_choices'] as $key => $choice)
1647
- {
1648
- $where ='';
1649
- $order_by ='';
1650
- $db_info ='';
1651
- if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
1652
- {
1653
- $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
1654
- $where = "where='".$w_choices_params[0]."'";
1655
- $w_choices_params = explode('[db_info]',$w_choices_params[1]);
1656
- $order_by = "order_by='".$w_choices_params[0]."'";
1657
- $db_info = "db_info='".$w_choices_params[1]."'";
1658
- }
1659
-
1660
- $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>';
1661
- }
1662
- $rep.= '</div>';
1663
- }
1664
- else
1665
- {
1666
-
1667
- foreach($param['w_choices'] as $key => $choice)
1668
- {
1669
-
1670
- $where ='';
1671
- $order_by ='';
1672
- $db_info ='';
1673
- if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
1674
- {
1675
- $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
1676
- $where = "where='".$w_choices_params[0]."'";
1677
- $w_choices_params = explode('[db_info]',$w_choices_params[1]);
1678
- $order_by = "order_by='".$w_choices_params[0]."'";
1679
- $db_info = "db_info='".$w_choices_params[1]."'";
1680
- }
1681
-
1682
- $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>';
1683
- }
1684
-
1685
- }
1686
- $rep.='</div></div>';
1687
-
1688
- $rep.='<div id="'.$id.'_divform_id_temp">';
1689
- if($param['w_quantity']=="yes")
1690
- $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>';
1691
- if($param['w_property'][0])
1692
- foreach($param['w_property'] as $key => $property)
1693
- {
1694
- $rep.='
1695
- <span id="'.$id.'_property_'.$key.'" style="margin-right: 15px;">
1696
-
1697
- <label class="mini_label" id="'.$id.'_property_label_form_id_temp'.$key.'" style="margin-right: 5px;">'.$property.'</label>
1698
- <select id="'.$id.'_propertyform_id_temp'.$key.'" name="'.$id.'_propertyform_id_temp'.$key.'" style="width: auto; margin: 2px 0px;" disabled>';
1699
- $param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
1700
- $param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
1701
- foreach($param['w_property_values'][$key] as $subkey => $property_value)
1702
- {
1703
- $rep.='<option id="'.$id.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'">'.$property_value.'</option>';
1704
- }
1705
- $rep.='</select></span>';
1706
- }
1707
-
1708
- $rep.='</div></div></div>';
1709
-
1710
- break;
1711
- }
1712
- case 'type_paypal_shipping':
1713
- {
1714
-
1715
- $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');
1716
- $temp=$params;
1717
- if(strpos($temp, 'w_field_option_pos') > -1)
1718
- $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');
1719
- foreach($params_names as $params_name )
1720
- {
1721
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1722
- $param[$params_name] = $temp[0];
1723
- $temp=$temp[1];
1724
- }
1725
-
1726
- if($temp)
1727
- {
1728
- $temp =explode('*:*w_attr_name*:*',$temp);
1729
- $attrs = array_slice($temp,0, count($temp)-1);
1730
- foreach($attrs as $attr)
1731
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1732
- }
1733
- if(!isset($param['w_field_option_pos']))
1734
- $param['w_field_option_pos'] = 'left';
1735
-
1736
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1737
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
1738
- $param['w_choices'] = explode('***',$param['w_choices']);
1739
-
1740
- $param['w_choices_price'] = explode('***',$param['w_choices_price']);
1741
-
1742
- $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
1743
-
1744
- if(isset($param['w_choices_params']))
1745
- $param['w_choices_params'] = explode('***',$param['w_choices_params']);
1746
-
1747
- foreach($param['w_choices_checked'] as $key => $choices_checked )
1748
- {
1749
- if($choices_checked=='true')
1750
- $param['w_choices_checked'][$key]='checked="checked"';
1751
- else
1752
- $param['w_choices_checked'][$key]='';
1753
- }
1754
-
1755
- $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;">';
1756
-
1757
- if($param['w_flow']=='hor')
1758
- {
1759
- $rep.= '<div id="'.$id.'_hor" style="display: table-row;">';
1760
- foreach($param['w_choices'] as $key => $choice)
1761
- {
1762
- $where ='';
1763
- $order_by ='';
1764
- $db_info ='';
1765
- if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
1766
- {
1767
- $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
1768
- $where = "where='".$w_choices_params[0]."'";
1769
- $w_choices_params = explode('[db_info]',$w_choices_params[1]);
1770
- $order_by = "order_by='".$w_choices_params[0]."'";
1771
- $db_info = "db_info='".$w_choices_params[1]."'";
1772
- }
1773
-
1774
- $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>';
1775
- }
1776
- $rep.= '</div>';
1777
- }
1778
- else
1779
- {
1780
-
1781
- foreach($param['w_choices'] as $key => $choice)
1782
- {
1783
- $where ='';
1784
- $order_by ='';
1785
- $db_info ='';
1786
- if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
1787
- {
1788
- $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
1789
- $where = "where='".$w_choices_params[0]."'";
1790
- $w_choices_params = explode('[db_info]',$w_choices_params[1]);
1791
- $order_by = "order_by='".$w_choices_params[0]."'";
1792
- $db_info = "db_info='".$w_choices_params[1]."'";
1793
- }
1794
-
1795
- $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>';
1796
- }
1797
-
1798
- }
1799
- $rep.='</div></div>';
1800
-
1801
- $rep.='</div></div>';
1802
-
1803
- break;
1804
- }
1805
- case 'type_paypal_total':
1806
- {
1807
- $params_names=array('w_field_label_size','w_field_label_pos','w_class');
1808
- $temp=$params;
1809
- foreach($params_names as $params_name )
1810
- {
1811
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1812
- $param[$params_name] = $temp[0];
1813
- $temp=$temp[1];
1814
- }
1815
-
1816
- if($temp)
1817
- {
1818
- $temp =explode('*:*w_attr_name*:*',$temp);
1819
- $attrs = array_slice($temp,0, count($temp)-1);
1820
- foreach($attrs as $attr)
1821
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1822
- }
1823
-
1824
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1825
-
1826
-
1827
-
1828
- $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>';
1829
-
1830
-
1831
- break;
1832
- }
1833
-
1834
- case 'type_star_rating':
1835
- {
1836
- $params_names=array('w_field_label_size','w_field_label_pos','w_field_label_col','w_star_amount','w_required','w_class');
1837
- $temp=$params;
1838
- foreach($params_names as $params_name )
1839
- {
1840
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1841
- $param[$params_name] = $temp[0];
1842
- $temp=$temp[1];
1843
- }
1844
-
1845
- if($temp)
1846
- {
1847
- $temp =explode('*:*w_attr_name*:*',$temp);
1848
- $attrs = array_slice($temp,0, count($temp)-1);
1849
- foreach($attrs as $attr)
1850
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1851
- }
1852
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1853
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
1854
-
1855
-
1856
- $images = '';
1857
- for($i=0; $i<$param['w_star_amount']; $i++)
1858
- {
1859
- $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;)">';
1860
- }
1861
-
1862
- $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>';
1863
-
1864
-
1865
- break;
1866
- }
1867
- case 'type_scale_rating':
1868
- {
1869
- $params_names=array('w_field_label_size','w_field_label_pos','w_mini_labels','w_scale_amount','w_required','w_class');
1870
- $temp=$params;
1871
- foreach($params_names as $params_name )
1872
- {
1873
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1874
- $param[$params_name] = $temp[0];
1875
- $temp=$temp[1];
1876
- }
1877
-
1878
- if($temp)
1879
- {
1880
- $temp =explode('*:*w_attr_name*:*',$temp);
1881
- $attrs = array_slice($temp,0, count($temp)-1);
1882
- foreach($attrs as $attr)
1883
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1884
- }
1885
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1886
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
1887
-
1888
- $w_mini_labels = explode('***',$param['w_mini_labels']);
1889
-
1890
- $numbers = '';
1891
- for($i=1; $i<=$param['w_scale_amount']; $i++)
1892
- {
1893
- $numbers .= '<div id="'.$id.'_scale_td1_'.$i.'form_id_temp" style="text-align: center; display: table-cell;"><span>'.$i.'</span></div>';
1894
- }
1895
-
1896
-
1897
- $radio_buttons = '';
1898
- for($k=1; $k<=$param['w_scale_amount']; $k++)
1899
- {
1900
- $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>';
1901
- }
1902
-
1903
- $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>';
1904
-
1905
- break;
1906
- }
1907
- case 'type_spinner':
1908
- {
1909
- $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');
1910
- $temp=$params;
1911
- foreach($params_names as $params_name ) {
1912
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1913
- $param[$params_name] = $temp[0];
1914
- $temp=$temp[1];
1915
- }
1916
- if($temp) {
1917
- $temp =explode('*:*w_attr_name*:*',$temp);
1918
- $attrs = array_slice($temp,0, count($temp)-1);
1919
- foreach($attrs as $attr)
1920
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1921
- }
1922
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1923
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
1924
- $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>';
1925
- break;
1926
- }
1927
- case 'type_slider': {
1928
- $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');
1929
- $temp=$params;
1930
- foreach($params_names as $params_name ) {
1931
- $temp = explode('*:*'.$params_name.'*:*',$temp);
1932
- $param[$params_name] = $temp[0];
1933
- $temp=$temp[1];
1934
- }
1935
- if ($temp) {
1936
- $temp = explode('*:*w_attr_name*:*', $temp);
1937
- $attrs = array_slice($temp,0, count($temp)-1);
1938
- foreach($attrs as $attr) {
1939
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
1940
- }
1941
- }
1942
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1943
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
1944
- $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>';
1945
- break;
1946
- }
1947
- case 'type_range': {
1948
- $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');
1949
- $temp = $params;
1950
- foreach ($params_names as $params_name ) {
1951
- $temp = explode('*:*' . $params_name . '*:*', $temp);
1952
- $param[$params_name] = $temp[0];
1953
- $temp = $temp[1];
1954
- }
1955
- if ($temp) {
1956
- $temp = explode('*:*w_attr_name*:*', $temp);
1957
- $attrs = array_slice($temp, 0, count($temp) - 1);
1958
- foreach($attrs as $attr) {
1959
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1960
- }
1961
- }
1962
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1963
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
1964
- $w_mini_labels = explode('***',$param['w_mini_labels']);
1965
- $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>';
1966
- break;
1967
- }
1968
- case 'type_grading': {
1969
- $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_items', 'w_total', 'w_required', 'w_class');
1970
- $temp = $params;
1971
- foreach($params_names as $params_name) {
1972
- $temp = explode('*:*' . $params_name . '*:*', $temp);
1973
- $param[$params_name] = $temp[0];
1974
- $temp = $temp[1];
1975
- }
1976
- if ($temp) {
1977
- $temp = explode('*:*w_attr_name*:*', $temp);
1978
- $attrs = array_slice($temp, 0, count($temp) - 1);
1979
- foreach ($attrs as $attr) {
1980
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1981
- }
1982
- }
1983
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
1984
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
1985
- $w_items = explode('***', $param['w_items']);
1986
- $grading_items = '';
1987
- for($i=0; $i<count($w_items); $i++)
1988
- {
1989
- $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>';
1990
- }
1991
-
1992
- $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>';
1993
-
1994
- break;
1995
- }
1996
- case 'type_matrix': {
1997
- $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');
1998
- $temp = $params;
1999
- foreach ($params_names as $params_name) {
2000
- $temp = explode('*:*'.$params_name.'*:*',$temp);
2001
- $param[$params_name] = $temp[0];
2002
- $temp = $temp[1];
2003
- }
2004
- if ($temp) {
2005
- $temp = explode('*:*w_attr_name*:*', $temp);
2006
- $attrs = array_slice($temp, 0, count($temp) - 1);
2007
- foreach ($attrs as $attr) {
2008
- $param['attributes'] = $param['attributes'].' add_'.$attr;
2009
- }
2010
- }
2011
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
2012
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
2013
- $param['w_textbox_size'] = isset($param['w_textbox_size']) ? $param['w_textbox_size'] : '100';
2014
- $w_rows = explode('***',$param['w_rows']);
2015
- $w_columns = explode('***',$param['w_columns']);
2016
- $column_labels = '';
2017
- for ($i = 1; $i < count($w_columns); $i++) {
2018
- $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>';
2019
- }
2020
- $rows_columns = '';
2021
- for($i=1; $i<count($w_rows); $i++)
2022
- {
2023
-
2024
- $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>';
2025
-
2026
-
2027
- for($k=1; $k<count($w_columns); $k++)
2028
- {
2029
- if($param['w_field_input_type']=='radio')
2030
- $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>';
2031
- else
2032
- if($param['w_field_input_type']=='checkbox')
2033
- $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>';
2034
- else
2035
- if($param['w_field_input_type']=='text')
2036
- $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>';
2037
- else
2038
- if($param['w_field_input_type']=='select')
2039
- $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>';
2040
-
2041
- }
2042
-
2043
- $rows_columns .= '</div>';
2044
- }
2045
-
2046
-
2047
-
2048
- $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>';
2049
-
2050
- break;
2051
- }
2052
- case 'type_submit_reset': {
2053
- $params_names=array('w_submit_title','w_reset_title','w_class','w_act');
2054
- $temp=$params;
2055
- foreach ($params_names as $params_name) {
2056
- $temp=explode('*:*'.$params_name.'*:*',$temp);
2057
- $param[$params_name] = $temp[0];
2058
- $temp=$temp[1];
2059
- }
2060
- if ($temp) {
2061
- $temp = explode('*:*w_attr_name*:*',$temp);
2062
- $attrs = array_slice($temp,0, count($temp)-1);
2063
- foreach ($attrs as $attr) {
2064
- $param['attributes'] = $param['attributes'].' add_'.$attr;
2065
- }
2066
- }
2067
- $param['w_act'] = ($param['w_act']=="false" ? 'style="display: none;"' : "");
2068
- $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>';
2069
- break;
2070
- }
2071
- case 'type_button': {
2072
- $params_names=array('w_title','w_func','w_class');
2073
- $temp=$params;
2074
- foreach($params_names as $params_name) {
2075
- $temp=explode('*:*'.$params_name.'*:*',$temp);
2076
- $param[$params_name] = $temp[0];
2077
- $temp=$temp[1];
2078
- }
2079
- if ($temp) {
2080
- $temp = explode('*:*w_attr_name*:*',$temp);
2081
- $attrs = array_slice($temp,0, count($temp)-1);
2082
- foreach($attrs as $attr) {
2083
- $param['attributes'] = $param['attributes'].' add_'.$attr;
2084
- }
2085
- }
2086
- $param['w_title'] = explode('***',$param['w_title']);
2087
- $param['w_func'] = explode('***',$param['w_func']);
2088
- $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">';
2089
- foreach ($param['w_title'] as $key => $title) {
2090
- $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>';
2091
- }
2092
- $rep .= '</div></div>';
2093
- break;
2094
- }
2095
- }
2096
-
2097
- $form = str_replace('%' . $id . ' - ' . $labels[$ids_key] . '%', $rep, $form);
2098
- $form = str_replace('%' . $id . ' -' . $labels[$ids_key] . '%', $rep, $form);
2099
- $row->form_front = $form;
2100
- }
2101
- }
2102
- }
2103
- else {
2104
- $row = new stdClass();
2105
- $row->id = 0;
2106
- $row->backup_id ='';
2107
- $row->title = '';
2108
- $row->mail = '';
2109
- $row->form = '';
2110
- $row->form_front = '';
2111
- $row->theme = $wpdb->get_var("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE `default`='1'");
2112
- $row->javascript = '';
2113
- $row->submit_text = '';
2114
- $row->url = '';
2115
- $row->submit_text_type = 0;
2116
- $row->script1 = '';
2117
- $row->script2 = '';
2118
- $row->script_user1 = '';
2119
- $row->script_user2 = '';
2120
- $row->counter = 0;
2121
- $row->label_order = '';
2122
- $row->article_id = '';
2123
- $row->pagination = '';
2124
- $row->show_title = '';
2125
- $row->show_numbers = '';
2126
- $row->public_key = '';
2127
- $row->private_key = '';
2128
- $row->recaptcha_theme = '';
2129
- $row->from_name = '';
2130
- $row->from_mail = '';
2131
- $row->label_order_current = '';
2132
- $row->script_mail_user = '';
2133
- $row->script_mail = '';
2134
- $row->tax = 0;
2135
- $row->payment_currency = '$';
2136
- $row->paypal_email = '';
2137
- $row->checkout_mode = 'testmode';
2138
- $row->paypal_mode = 0;
2139
-
2140
- $row->published = 1;
2141
- $row->form_fields = '';
2142
- $row->savedb = 1;
2143
- $row->sendemail = 1;
2144
- $row->requiredmark = '*';
2145
- $row->reply_to = 0;
2146
- $row->send_to = 0;
2147
- $row->autogen_layout = 1;
2148
- $row->custom_front = '';
2149
- $row->mail_from_user = '';
2150
- $row->mail_from_name_user = '';
2151
- $row->reply_to_user = '';
2152
- $row->save_uploads = 1;
2153
-
2154
- $row->condition = '';
2155
- $row->mail_cc = '';
2156
- $row->mail_cc_user = '';
2157
- $row->mail_bcc = '';
2158
- $row->mail_bcc_user = '';
2159
- $row->mail_subject = '';
2160
- $row->mail_subject_user = '';
2161
- $row->mail_mode = 1;
2162
- $row->mail_mode_user = 1;
2163
- $row->mail_attachment = 1;
2164
- $row->mail_attachment_user = 1;
2165
-
2166
- $row->user_id_wd = '';
2167
- $row->sortable = 1;
2168
- $row->frontend_submit_fields = '';
2169
- $row->frontend_submit_stat_fields = '';
2170
- }
2171
- return $row;
2172
- }
2173
-
2174
- public function get_theme_rows_data($old = '') {
2175
- global $wpdb;
2176
- $rows = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker_themes WHERE css " . ($old ? 'NOT' : '') . " LIKE '%.wdform_section%' ORDER BY title");
2177
- return $rows;
2178
- }
2179
-
2180
- public function get_queries_rows_data($id) {
2181
- global $wpdb;
2182
- $rows = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker_query WHERE form_id=" . $id . " ORDER BY id ASC");
2183
- return $rows;
2184
- }
2185
-
2186
- public function get_labels($id) {
2187
- global $wpdb;
2188
- $rows = $wpdb->get_col("SELECT DISTINCT `element_label` FROM " . $wpdb->prefix . "formmaker_submits WHERE form_id=" . $id);
2189
- return $rows;
2190
- }
2191
-
2192
- public function is_paypal($id) {
2193
- global $wpdb;
2194
- $rows = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker_sessions WHERE form_id=" . $id);
2195
- return $rows;
2196
- }
2197
-
2198
- public function page_nav() {
2199
- global $wpdb;
2200
- $where = 'WHERE `id` NOT IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ')';
2201
- $where .= ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? ' AND title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
2202
- $query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker " . $where;
2203
- $total = $wpdb->get_var($query);
2204
- $page_nav['total'] = $total;
2205
- if (isset($_POST['page_number']) && $_POST['page_number']) {
2206
- $limit = ((int) $_POST['page_number'] - 1) * 20;
2207
- }
2208
- else {
2209
- $limit = 0;
2210
- }
2211
- $page_nav['limit'] = (int) ($limit / 20 + 1);
2212
- return $page_nav;
2213
- }
2214
- ////////////////////////////////////////////////////////////////////////////////////////
2215
- // Getters & Setters //
2216
- ////////////////////////////////////////////////////////////////////////////////////////
2217
- ////////////////////////////////////////////////////////////////////////////////////////
2218
- // Private Methods //
2219
- ////////////////////////////////////////////////////////////////////////////////////////
2220
- ////////////////////////////////////////////////////////////////////////////////////////
2221
- // Listeners //
2222
- ////////////////////////////////////////////////////////////////////////////////////////
2223
  }
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
+ case 'type_date_fields':
1070
+ {
1071
+ $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');
1072
+
1073
+ $temp=$params;
1074
+ foreach($params_names as $params_name )
1075
+ {
1076
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1077
+ $param[$params_name] = $temp[0];
1078
+ $temp=$temp[1];
1079
+ }
1080
+
1081
+ if($temp)
1082
+ {
1083
+ $temp =explode('*:*w_attr_name*:*',$temp);
1084
+ $attrs = array_slice($temp,0, count($temp)-1);
1085
+ foreach($attrs as $attr)
1086
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1087
+ }
1088
+
1089
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1090
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1091
+
1092
+
1093
+ if($param['w_day_type']=="SELECT")
1094
+ {
1095
+
1096
+
1097
+ $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>';
1098
+ for($k=0; $k<=31; $k++)
1099
+ {
1100
+ if($k<10)
1101
+ {
1102
+ if($param['w_day']=='0'.$k)
1103
+ $selected = "selected=\"selected\"";
1104
+ else
1105
+ $selected = "";
1106
+
1107
+ $w_day_type .= '<option value="0'.$k.'" '.$selected.'>0'.$k.'</option>';
1108
+ }
1109
+ else
1110
+ {
1111
+ if($param['w_day']==''.$k)
1112
+ $selected = "selected=\"selected\"";
1113
+ else
1114
+ $selected = "";
1115
+
1116
+ $w_day_type .= '<option value="'.$k.'" '.$selected.'>'.$k.'</option>';
1117
+ }
1118
+
1119
+
1120
+
1121
+ }
1122
+ $w_day_type .= '</select>';
1123
+ }
1124
+ else
1125
+ {
1126
+ $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/>';
1127
+ }
1128
+
1129
+ if($param['w_month_type']=="SELECT")
1130
+ {
1131
+
1132
+ $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>';
1133
+
1134
+ }
1135
+ else
1136
+ {
1137
+ $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/>';
1138
+
1139
+ }
1140
+ $param['w_to'] = isset($param['w_to']) && $param['w_to']!="NaN" ? $param['w_to'] : date("Y");
1141
+ if($param['w_year_type']=="SELECT")
1142
+ {
1143
+ $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>';
1144
+ for($k=$param['w_to']; $k>=$param['w_from']; $k--)
1145
+ {
1146
+ if($param['w_year']==$k)
1147
+ $selected = "selected=\"selected\"";
1148
+ else
1149
+ $selected = "";
1150
+
1151
+ $w_year_type .= '<option value="'.$k.'" '.$selected.'>'.$k.'</option>';
1152
+ }
1153
+ $w_year_type .= '</select>';
1154
+
1155
+ }
1156
+ else
1157
+ {
1158
+ $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/>';
1159
+ }
1160
+
1161
+
1162
+ $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;">
1163
+ '.$w_day_type.'
1164
+
1165
+ </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>';
1166
+
1167
+ break;
1168
+ }
1169
+ case 'type_file_upload':
1170
+ {
1171
+ $params_names=array('w_field_label_size','w_field_label_pos','w_destination','w_extension','w_max_size','w_required','w_multiple','w_class');
1172
+ $temp=$params;
1173
+ foreach($params_names as $params_name )
1174
+ {
1175
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1176
+ $param[$params_name] = $temp[0];
1177
+ if (isset($temp[1])) {
1178
+ $temp = $temp[1];
1179
+ }
1180
+ else {
1181
+ $temp = '';
1182
+ }
1183
+ }
1184
+
1185
+ if($temp)
1186
+ {
1187
+ $temp =explode('*:*w_attr_name*:*',$temp);
1188
+ $attrs = array_slice($temp,0, count($temp)-1);
1189
+ foreach($attrs as $attr)
1190
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1191
+ }
1192
+
1193
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1194
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1195
+ $multiple = ($param['w_multiple']=="yes" ? "multiple='multiple'" : "");
1196
+
1197
+ $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>';
1198
+
1199
+ break;
1200
+ }
1201
+ case 'type_captcha':
1202
+ {
1203
+ $params_names=array('w_field_label_size','w_field_label_pos','w_digit','w_class');
1204
+ $temp=$params;
1205
+ foreach($params_names as $params_name )
1206
+ {
1207
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1208
+ $param[$params_name] = $temp[0];
1209
+ $temp=$temp[1];
1210
+ }
1211
+
1212
+ if($temp)
1213
+ {
1214
+ $temp =explode('*:*w_attr_name*:*',$temp);
1215
+ $attrs = array_slice($temp,0, count($temp)-1);
1216
+ foreach($attrs as $attr)
1217
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1218
+ }
1219
+
1220
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1221
+
1222
+ $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>';
1223
+
1224
+ break;
1225
+ }
1226
+ case 'type_arithmetic_captcha':
1227
+ {
1228
+ $params_names=array('w_field_label_size','w_field_label_pos', 'w_count', 'w_operations','w_class', 'w_input_size');
1229
+ $temp=$params;
1230
+ foreach($params_names as $params_name )
1231
+ {
1232
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1233
+ $param[$params_name] = $temp[0];
1234
+ $temp=$temp[1];
1235
+ }
1236
+
1237
+ if($temp)
1238
+ {
1239
+ $temp =explode('*:*w_attr_name*:*',$temp);
1240
+ $attrs = array_slice($temp,0, count($temp)-1);
1241
+ foreach($attrs as $attr)
1242
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1243
+ }
1244
+
1245
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1246
+ $param['w_count'] = $param['w_count'] ? $param['w_count'] : 1;
1247
+ $param['w_operations'] = $param['w_operations'] ? $param['w_operations'] : '+, -, *, /';
1248
+ $param['w_input_size'] = $param['w_input_size'] ? $param['w_input_size'] : 60;
1249
+
1250
+ $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>';
1251
+
1252
+ break;
1253
+ }
1254
+
1255
+
1256
+ case 'type_recaptcha':
1257
+ {
1258
+ $params_names=array('w_field_label_size','w_field_label_pos','w_public','w_private','w_theme','w_class');
1259
+ $temp=$params;
1260
+ foreach($params_names as $params_name )
1261
+ {
1262
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1263
+ $param[$params_name] = $temp[0];
1264
+ $temp=$temp[1];
1265
+ }
1266
+
1267
+ if($temp)
1268
+ {
1269
+ $temp =explode('*:*w_attr_name*:*',$temp);
1270
+ $attrs = array_slice($temp,0, count($temp)-1);
1271
+ foreach($attrs as $attr)
1272
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1273
+ }
1274
+
1275
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1276
+
1277
+ $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>';
1278
+
1279
+ break;
1280
+ }
1281
+
1282
+ case 'type_hidden':
1283
+ {
1284
+ $params_names=array('w_name','w_value');
1285
+ $temp=$params;
1286
+ foreach($params_names as $params_name )
1287
+ {
1288
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1289
+ $param[$params_name] = $temp[0];
1290
+ $temp=$temp[1];
1291
+ }
1292
+
1293
+ if($temp)
1294
+ {
1295
+ $temp =explode('*:*w_attr_name*:*',$temp);
1296
+ $attrs = array_slice($temp,0, count($temp)-1);
1297
+ foreach($attrs as $attr)
1298
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1299
+ }
1300
+ $param['w_name'] = str_replace('&nbsp;','',$param['w_name']);
1301
+ $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>';
1302
+
1303
+ break;
1304
+ }
1305
+ case 'type_mark_map':
1306
+ {
1307
+ $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');
1308
+ $temp=$params;
1309
+ foreach($params_names as $params_name )
1310
+ {
1311
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1312
+ $param[$params_name] = $temp[0];
1313
+ $temp=$temp[1];
1314
+ }
1315
+
1316
+ if($temp)
1317
+ {
1318
+ $temp =explode('*:*w_attr_name*:*',$temp);
1319
+ $attrs = array_slice($temp,0, count($temp)-1);
1320
+ foreach($attrs as $attr)
1321
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1322
+ }
1323
+
1324
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1325
+
1326
+ $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> ';
1327
+
1328
+ break;
1329
+ }
1330
+
1331
+ case 'type_map':
1332
+ {
1333
+ $params_names=array('w_center_x','w_center_y','w_long','w_lat','w_zoom','w_width','w_height','w_info','w_class');
1334
+ $temp=$params;
1335
+ foreach($params_names as $params_name )
1336
+ {
1337
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1338
+ $param[$params_name] = $temp[0];
1339
+ $temp=$temp[1];
1340
+ }
1341
+
1342
+ if($temp)
1343
+ {
1344
+ $temp =explode('*:*w_attr_name*:*',$temp);
1345
+ $attrs = array_slice($temp,0, count($temp)-1);
1346
+ foreach($attrs as $attr)
1347
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1348
+ }
1349
+
1350
+ $marker='';
1351
+
1352
+ $param['w_long'] = explode('***',$param['w_long']);
1353
+ $param['w_lat'] = explode('***',$param['w_lat']);
1354
+ $param['w_info'] = explode('***',$param['w_info']);
1355
+ foreach($param['w_long'] as $key => $w_long )
1356
+ {
1357
+ $marker.='long'.$key.'="'.$w_long.'" lat'.$key.'="'.$param['w_lat'][$key].'" info'.$key.'="'.$param['w_info'][$key].'"';
1358
+ }
1359
+
1360
+ $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>';
1361
+
1362
+ break;
1363
+ }
1364
+ case 'type_paypal_price':
1365
+ {
1366
+
1367
+ $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');
1368
+ $temp=$params;
1369
+ foreach($params_names as $params_name )
1370
+ {
1371
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1372
+ $param[$params_name] = $temp[0];
1373
+ $temp=$temp[1];
1374
+ }
1375
+
1376
+ if($temp)
1377
+ {
1378
+ $temp =explode('*:*w_attr_name*:*',$temp);
1379
+ $attrs = array_slice($temp,0, count($temp)-1);
1380
+ foreach($attrs as $attr)
1381
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1382
+ }
1383
+
1384
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1385
+ $input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active");
1386
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1387
+ $hide_cents = ($param['w_hide_cents']=="yes" ? "none;" : "table-cell;");
1388
+
1389
+
1390
+ $w_first_val = explode('***',$param['w_first_val']);
1391
+ $w_title = explode('***',$param['w_title']);
1392
+ $w_mini_labels = explode('***',$param['w_mini_labels']);
1393
+
1394
+ $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>';
1395
+ break;
1396
+ }
1397
+
1398
+ case 'type_paypal_select':
1399
+ {
1400
+ $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');
1401
+ $temp=$params;
1402
+ if(strpos($temp, 'w_choices_params') > -1)
1403
+ $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');
1404
+ foreach($params_names as $params_name )
1405
+ {
1406
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1407
+ $param[$params_name] = $temp[0];
1408
+ $temp=$temp[1];
1409
+ }
1410
+
1411
+ if($temp)
1412
+ {
1413
+ $temp =explode('*:*w_attr_name*:*',$temp);
1414
+ $attrs = array_slice($temp,0, count($temp)-1);
1415
+ foreach($attrs as $attr)
1416
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1417
+ }
1418
+
1419
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1420
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1421
+ $param['w_choices'] = explode('***',$param['w_choices']);
1422
+
1423
+ $param['w_choices_price'] = explode('***',$param['w_choices_price']);
1424
+
1425
+ $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
1426
+
1427
+ $param['w_choices_disabled'] = explode('***',$param['w_choices_disabled']);
1428
+ $param['w_property'] = explode('***',$param['w_property']);
1429
+ $param['w_property_values'] = explode('***',$param['w_property_values']);
1430
+ if(isset($param['w_choices_params']))
1431
+ $param['w_choices_params'] = explode('***',$param['w_choices_params']);
1432
+ foreach($param['w_choices_checked'] as $key => $choices_checked )
1433
+ {
1434
+ if($choices_checked=='true')
1435
+ $param['w_choices_checked'][$key]='selected="selected"';
1436
+ else
1437
+ $param['w_choices_checked'][$key]='';
1438
+ }
1439
+
1440
+
1441
+ $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>';
1442
+ foreach($param['w_choices'] as $key => $choice)
1443
+ {
1444
+ $where = '';
1445
+ $order_by = '';
1446
+ $db_info = '';
1447
+ $choice_value = $param['w_choices_disabled'][$key]=="true" ? '' : $param['w_choices_price'][$key];
1448
+
1449
+ if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
1450
+ {
1451
+ $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
1452
+ $where = "where='".$w_choices_params[0]."'";
1453
+ $w_choices_params = explode('[db_info]',$w_choices_params[1]);
1454
+ $order_by = "order_by='".$w_choices_params[0]."'";
1455
+ $db_info = "db_info='".$w_choices_params[1]."'";
1456
+ }
1457
+ $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>';
1458
+ }
1459
+ $rep.='</select><div id="'.$id.'_divform_id_temp">';
1460
+ if($param['w_quantity']=="yes")
1461
+ $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>';
1462
+ if($param['w_property'][0])
1463
+ foreach($param['w_property'] as $key => $property)
1464
+ {
1465
+
1466
+ $rep.='
1467
+ <span id="'.$id.'_property_'.$key.'" style="margin-right: 15px;">
1468
+
1469
+ <label class="mini_label" id="'.$id.'_property_label_form_id_temp'.$key.'" style="margin-right: 5px;">'.$property.'</label>
1470
+ <select id="'.$id.'_propertyform_id_temp'.$key.'" name="'.$id.'_propertyform_id_temp'.$key.'" style="width: auto; margin: 2px 0px;" disabled>';
1471
+ $param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
1472
+ $param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
1473
+ foreach($param['w_property_values'][$key] as $subkey => $property_value)
1474
+ {
1475
+ $rep.='<option id="'.$id.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'">'.$property_value.'</option>';
1476
+ }
1477
+ $rep.='</select></span>';
1478
+ }
1479
+
1480
+ $rep.='</div></div></div>';
1481
+ break;
1482
+ }
1483
+
1484
+ case 'type_paypal_checkbox':
1485
+ {
1486
+
1487
+ $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');
1488
+ $temp=$params;
1489
+ if(strpos($temp, 'w_field_option_pos') > -1)
1490
+ $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');
1491
+ foreach($params_names as $params_name )
1492
+ {
1493
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1494
+ $param[$params_name] = $temp[0];
1495
+ $temp=$temp[1];
1496
+ }
1497
+
1498
+ if($temp)
1499
+ {
1500
+ $temp =explode('*:*w_attr_name*:*',$temp);
1501
+ $attrs = array_slice($temp,0, count($temp)-1);
1502
+ foreach($attrs as $attr)
1503
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1504
+ }
1505
+ if(!isset($param['w_field_option_pos']))
1506
+ $param['w_field_option_pos'] = 'left';
1507
+
1508
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1509
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1510
+ $param['w_choices'] = explode('***',$param['w_choices']);
1511
+ $param['w_choices_price'] = explode('***',$param['w_choices_price']);
1512
+ $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
1513
+ $param['w_property'] = explode('***',$param['w_property']);
1514
+ $param['w_property_values'] = explode('***',$param['w_property_values']);
1515
+
1516
+ if(isset($param['w_choices_params']))
1517
+ $param['w_choices_params'] = explode('***',$param['w_choices_params']);
1518
+
1519
+ foreach($param['w_choices_checked'] as $key => $choices_checked )
1520
+ {
1521
+ if($choices_checked=='true')
1522
+ $param['w_choices_checked'][$key]='checked="checked"';
1523
+ else
1524
+ $param['w_choices_checked'][$key]='';
1525
+ }
1526
+
1527
+ $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;">';
1528
+
1529
+ if($param['w_flow']=='hor')
1530
+ {
1531
+ $rep.= '<div id="'.$id.'_hor" style="display: table-row;">';
1532
+ foreach($param['w_choices'] as $key => $choice)
1533
+ {
1534
+ $where ='';
1535
+ $order_by ='';
1536
+ $db_info = '';
1537
+ if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
1538
+ {
1539
+ $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
1540
+ $where = "where='".$w_choices_params[0]."'";
1541
+ $w_choices_params = explode('[db_info]',$w_choices_params[1]);
1542
+ $order_by = "order_by='".$w_choices_params[0]."'";
1543
+ $db_info = "db_info='".$w_choices_params[1]."'";
1544
+ }
1545
+
1546
+ $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>';
1547
+ }
1548
+ $rep.= '</div>';
1549
+ }
1550
+ else
1551
+ {
1552
+
1553
+ foreach($param['w_choices'] as $key => $choice)
1554
+ {
1555
+ $where ='';
1556
+ $order_by ='';
1557
+ $db_info ='';
1558
+ if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
1559
+ {
1560
+ $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
1561
+ $where = "where='".$w_choices_params[0]."'";
1562
+ $w_choices_params = explode('[db_info]',$w_choices_params[1]);
1563
+ $order_by = "order_by='".$w_choices_params[0]."'";
1564
+ $db_info = "db_info='".$w_choices_params[1]."'";
1565
+ }
1566
+
1567
+ $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>';
1568
+ }
1569
+
1570
+ }
1571
+ $rep.='</div></div>';
1572
+
1573
+ $rep.='<div id="'.$id.'_divform_id_temp">';
1574
+ if($param['w_quantity']=="yes")
1575
+ $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>';
1576
+ if($param['w_property'][0])
1577
+ foreach($param['w_property'] as $key => $property)
1578
+ {
1579
+ $rep.='
1580
+ <span id="'.$id.'_property_'.$key.'" style="margin-right: 15px;">
1581
+
1582
+ <label class="mini_label" id="'.$id.'_property_label_form_id_temp'.$key.'" style="margin-right: 5px;">'.$property.'</label>
1583
+ <select id="'.$id.'_propertyform_id_temp'.$key.'" name="'.$id.'_propertyform_id_temp'.$key.'" style="width: auto; margin: 2px 0px;" disabled>';
1584
+ $param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
1585
+ $param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
1586
+ foreach($param['w_property_values'][$key] as $subkey => $property_value)
1587
+ {
1588
+ $rep.='<option id="'.$id.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'">'.$property_value.'</option>';
1589
+ }
1590
+ $rep.='</select></span>';
1591
+ }
1592
+
1593
+ $rep.='</div></div></div>';
1594
+ break;
1595
+ }
1596
+ case 'type_paypal_radio':
1597
+ {
1598
+
1599
+ $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');
1600
+ $temp=$params;
1601
+ if(strpos($temp, 'w_field_option_pos') > -1)
1602
+ $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');
1603
+ foreach($params_names as $params_name )
1604
+ {
1605
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1606
+ $param[$params_name] = $temp[0];
1607
+ $temp=$temp[1];
1608
+ }
1609
+
1610
+ if($temp)
1611
+ {
1612
+ $temp =explode('*:*w_attr_name*:*',$temp);
1613
+ $attrs = array_slice($temp,0, count($temp)-1);
1614
+ foreach($attrs as $attr)
1615
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1616
+ }
1617
+ if(!isset($param['w_field_option_pos']))
1618
+ $param['w_field_option_pos'] = 'left';
1619
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1620
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1621
+ $param['w_choices'] = explode('***',$param['w_choices']);
1622
+
1623
+ $param['w_choices_price'] = explode('***',$param['w_choices_price']);
1624
+
1625
+ $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
1626
+
1627
+ $param['w_property'] = explode('***',$param['w_property']);
1628
+ $param['w_property_values'] = explode('***',$param['w_property_values']);
1629
+
1630
+ if(isset($param['w_choices_params']))
1631
+ $param['w_choices_params'] = explode('***',$param['w_choices_params']);
1632
+
1633
+ foreach($param['w_choices_checked'] as $key => $choices_checked )
1634
+ {
1635
+ if($choices_checked=='true')
1636
+ $param['w_choices_checked'][$key]='checked="checked"';
1637
+ else
1638
+ $param['w_choices_checked'][$key]='';
1639
+ }
1640
+
1641
+ $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;">';
1642
+
1643
+ if($param['w_flow']=='hor')
1644
+ {
1645
+ $rep.= '<div id="'.$id.'_hor" style="display: table-row;">';
1646
+ foreach($param['w_choices'] as $key => $choice)
1647
+ {
1648
+ $where ='';
1649
+ $order_by ='';
1650
+ $db_info ='';
1651
+ if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
1652
+ {
1653
+ $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
1654
+ $where = "where='".$w_choices_params[0]."'";
1655
+ $w_choices_params = explode('[db_info]',$w_choices_params[1]);
1656
+ $order_by = "order_by='".$w_choices_params[0]."'";
1657
+ $db_info = "db_info='".$w_choices_params[1]."'";
1658
+ }
1659
+
1660
+ $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>';
1661
+ }
1662
+ $rep.= '</div>';
1663
+ }
1664
+ else
1665
+ {
1666
+
1667
+ foreach($param['w_choices'] as $key => $choice)
1668
+ {
1669
+
1670
+ $where ='';
1671
+ $order_by ='';
1672
+ $db_info ='';
1673
+ if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
1674
+ {
1675
+ $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
1676
+ $where = "where='".$w_choices_params[0]."'";
1677
+ $w_choices_params = explode('[db_info]',$w_choices_params[1]);
1678
+ $order_by = "order_by='".$w_choices_params[0]."'";
1679
+ $db_info = "db_info='".$w_choices_params[1]."'";
1680
+ }
1681
+
1682
+ $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>';
1683
+ }
1684
+
1685
+ }
1686
+ $rep.='</div></div>';
1687
+
1688
+ $rep.='<div id="'.$id.'_divform_id_temp">';
1689
+ if($param['w_quantity']=="yes")
1690
+ $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>';
1691
+ if($param['w_property'][0])
1692
+ foreach($param['w_property'] as $key => $property)
1693
+ {
1694
+ $rep.='
1695
+ <span id="'.$id.'_property_'.$key.'" style="margin-right: 15px;">
1696
+
1697
+ <label class="mini_label" id="'.$id.'_property_label_form_id_temp'.$key.'" style="margin-right: 5px;">'.$property.'</label>
1698
+ <select id="'.$id.'_propertyform_id_temp'.$key.'" name="'.$id.'_propertyform_id_temp'.$key.'" style="width: auto; margin: 2px 0px;" disabled>';
1699
+ $param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
1700
+ $param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
1701
+ foreach($param['w_property_values'][$key] as $subkey => $property_value)
1702
+ {
1703
+ $rep.='<option id="'.$id.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'">'.$property_value.'</option>';
1704
+ }
1705
+ $rep.='</select></span>';
1706
+ }
1707
+
1708
+ $rep.='</div></div></div>';
1709
+
1710
+ break;
1711
+ }
1712
+ case 'type_paypal_shipping':
1713
+ {
1714
+
1715
+ $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');
1716
+ $temp=$params;
1717
+ if(strpos($temp, 'w_field_option_pos') > -1)
1718
+ $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');
1719
+ foreach($params_names as $params_name )
1720
+ {
1721
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1722
+ $param[$params_name] = $temp[0];
1723
+ $temp=$temp[1];
1724
+ }
1725
+
1726
+ if($temp)
1727
+ {
1728
+ $temp =explode('*:*w_attr_name*:*',$temp);
1729
+ $attrs = array_slice($temp,0, count($temp)-1);
1730
+ foreach($attrs as $attr)
1731
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1732
+ }
1733
+ if(!isset($param['w_field_option_pos']))
1734
+ $param['w_field_option_pos'] = 'left';
1735
+
1736
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1737
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1738
+ $param['w_choices'] = explode('***',$param['w_choices']);
1739
+
1740
+ $param['w_choices_price'] = explode('***',$param['w_choices_price']);
1741
+
1742
+ $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
1743
+
1744
+ if(isset($param['w_choices_params']))
1745
+ $param['w_choices_params'] = explode('***',$param['w_choices_params']);
1746
+
1747
+ foreach($param['w_choices_checked'] as $key => $choices_checked )
1748
+ {
1749
+ if($choices_checked=='true')
1750
+ $param['w_choices_checked'][$key]='checked="checked"';
1751
+ else
1752
+ $param['w_choices_checked'][$key]='';
1753
+ }
1754
+
1755
+ $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;">';
1756
+
1757
+ if($param['w_flow']=='hor')
1758
+ {
1759
+ $rep.= '<div id="'.$id.'_hor" style="display: table-row;">';
1760
+ foreach($param['w_choices'] as $key => $choice)
1761
+ {
1762
+ $where ='';
1763
+ $order_by ='';
1764
+ $db_info ='';
1765
+ if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
1766
+ {
1767
+ $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
1768
+ $where = "where='".$w_choices_params[0]."'";
1769
+ $w_choices_params = explode('[db_info]',$w_choices_params[1]);
1770
+ $order_by = "order_by='".$w_choices_params[0]."'";
1771
+ $db_info = "db_info='".$w_choices_params[1]."'";
1772
+ }
1773
+
1774
+ $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>';
1775
+ }
1776
+ $rep.= '</div>';
1777
+ }
1778
+ else
1779
+ {
1780
+
1781
+ foreach($param['w_choices'] as $key => $choice)
1782
+ {
1783
+ $where ='';
1784
+ $order_by ='';
1785
+ $db_info ='';
1786
+ if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
1787
+ {
1788
+ $w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
1789
+ $where = "where='".$w_choices_params[0]."'";
1790
+ $w_choices_params = explode('[db_info]',$w_choices_params[1]);
1791
+ $order_by = "order_by='".$w_choices_params[0]."'";
1792
+ $db_info = "db_info='".$w_choices_params[1]."'";
1793
+ }
1794
+
1795
+ $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>';
1796
+ }
1797
+
1798
+ }
1799
+ $rep.='</div></div>';
1800
+
1801
+ $rep.='</div></div>';
1802
+
1803
+ break;
1804
+ }
1805
+ case 'type_paypal_total':
1806
+ {
1807
+ $params_names=array('w_field_label_size','w_field_label_pos','w_class');
1808
+ $temp=$params;
1809
+ foreach($params_names as $params_name )
1810
+ {
1811
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1812
+ $param[$params_name] = $temp[0];
1813
+ $temp=$temp[1];
1814
+ }
1815
+
1816
+ if($temp)
1817
+ {
1818
+ $temp =explode('*:*w_attr_name*:*',$temp);
1819
+ $attrs = array_slice($temp,0, count($temp)-1);
1820
+ foreach($attrs as $attr)
1821
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1822
+ }
1823
+
1824
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1825
+
1826
+
1827
+
1828
+ $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>';
1829
+
1830
+
1831
+ break;
1832
+ }
1833
+
1834
+ case 'type_star_rating':
1835
+ {
1836
+ $params_names=array('w_field_label_size','w_field_label_pos','w_field_label_col','w_star_amount','w_required','w_class');
1837
+ $temp=$params;
1838
+ foreach($params_names as $params_name )
1839
+ {
1840
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1841
+ $param[$params_name] = $temp[0];
1842
+ $temp=$temp[1];
1843
+ }
1844
+
1845
+ if($temp)
1846
+ {
1847
+ $temp =explode('*:*w_attr_name*:*',$temp);
1848
+ $attrs = array_slice($temp,0, count($temp)-1);
1849
+ foreach($attrs as $attr)
1850
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1851
+ }
1852
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1853
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1854
+
1855
+
1856
+ $images = '';
1857
+ for($i=0; $i<$param['w_star_amount']; $i++)
1858
+ {
1859
+ $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;)">';
1860
+ }
1861
+
1862
+ $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>';
1863
+
1864
+
1865
+ break;
1866
+ }
1867
+ case 'type_scale_rating':
1868
+ {
1869
+ $params_names=array('w_field_label_size','w_field_label_pos','w_mini_labels','w_scale_amount','w_required','w_class');
1870
+ $temp=$params;
1871
+ foreach($params_names as $params_name )
1872
+ {
1873
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1874
+ $param[$params_name] = $temp[0];
1875
+ $temp=$temp[1];
1876
+ }
1877
+
1878
+ if($temp)
1879
+ {
1880
+ $temp =explode('*:*w_attr_name*:*',$temp);
1881
+ $attrs = array_slice($temp,0, count($temp)-1);
1882
+ foreach($attrs as $attr)
1883
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1884
+ }
1885
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1886
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1887
+
1888
+ $w_mini_labels = explode('***',$param['w_mini_labels']);
1889
+
1890
+ $numbers = '';
1891
+ for($i=1; $i<=$param['w_scale_amount']; $i++)
1892
+ {
1893
+ $numbers .= '<div id="'.$id.'_scale_td1_'.$i.'form_id_temp" style="text-align: center; display: table-cell;"><span>'.$i.'</span></div>';
1894
+ }
1895
+
1896
+
1897
+ $radio_buttons = '';
1898
+ for($k=1; $k<=$param['w_scale_amount']; $k++)
1899
+ {
1900
+ $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>';
1901
+ }
1902
+
1903
+ $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>';
1904
+
1905
+ break;
1906
+ }
1907
+ case 'type_spinner':
1908
+ {
1909
+ $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');
1910
+ $temp=$params;
1911
+ foreach($params_names as $params_name ) {
1912
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1913
+ $param[$params_name] = $temp[0];
1914
+ $temp=$temp[1];
1915
+ }
1916
+ if($temp) {
1917
+ $temp =explode('*:*w_attr_name*:*',$temp);
1918
+ $attrs = array_slice($temp,0, count($temp)-1);
1919
+ foreach($attrs as $attr)
1920
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1921
+ }
1922
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1923
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1924
+ $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>';
1925
+ break;
1926
+ }
1927
+ case 'type_slider': {
1928
+ $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');
1929
+ $temp=$params;
1930
+ foreach($params_names as $params_name ) {
1931
+ $temp = explode('*:*'.$params_name.'*:*',$temp);
1932
+ $param[$params_name] = $temp[0];
1933
+ $temp=$temp[1];
1934
+ }
1935
+ if ($temp) {
1936
+ $temp = explode('*:*w_attr_name*:*', $temp);
1937
+ $attrs = array_slice($temp,0, count($temp)-1);
1938
+ foreach($attrs as $attr) {
1939
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
1940
+ }
1941
+ }
1942
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1943
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1944
+ $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>';
1945
+ break;
1946
+ }
1947
+ case 'type_range': {
1948
+ $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');
1949
+ $temp = $params;
1950
+ foreach ($params_names as $params_name ) {
1951
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
1952
+ $param[$params_name] = $temp[0];
1953
+ $temp = $temp[1];
1954
+ }
1955
+ if ($temp) {
1956
+ $temp = explode('*:*w_attr_name*:*', $temp);
1957
+ $attrs = array_slice($temp, 0, count($temp) - 1);
1958
+ foreach($attrs as $attr) {
1959
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1960
+ }
1961
+ }
1962
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1963
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1964
+ $w_mini_labels = explode('***',$param['w_mini_labels']);
1965
+ $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>';
1966
+ break;
1967
+ }
1968
+ case 'type_grading': {
1969
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_items', 'w_total', 'w_required', 'w_class');
1970
+ $temp = $params;
1971
+ foreach($params_names as $params_name) {
1972
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
1973
+ $param[$params_name] = $temp[0];
1974
+ $temp = $temp[1];
1975
+ }
1976
+ if ($temp) {
1977
+ $temp = explode('*:*w_attr_name*:*', $temp);
1978
+ $attrs = array_slice($temp, 0, count($temp) - 1);
1979
+ foreach ($attrs as $attr) {
1980
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1981
+ }
1982
+ }
1983
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
1984
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
1985
+ $w_items = explode('***', $param['w_items']);
1986
+ $grading_items = '';
1987
+ for($i=0; $i<count($w_items); $i++)
1988
+ {
1989
+ $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>';
1990
+ }
1991
+
1992
+ $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>';
1993
+
1994
+ break;
1995
+ }
1996
+ case 'type_matrix': {
1997
+ $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');
1998
+ $temp = $params;
1999
+ foreach ($params_names as $params_name) {
2000
+ $temp = explode('*:*'.$params_name.'*:*',$temp);
2001
+ $param[$params_name] = $temp[0];
2002
+ $temp = $temp[1];
2003
+ }
2004
+ if ($temp) {
2005
+ $temp = explode('*:*w_attr_name*:*', $temp);
2006
+ $attrs = array_slice($temp, 0, count($temp) - 1);
2007
+ foreach ($attrs as $attr) {
2008
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
2009
+ }
2010
+ }
2011
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
2012
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
2013
+ $param['w_textbox_size'] = isset($param['w_textbox_size']) ? $param['w_textbox_size'] : '100';
2014
+ $w_rows = explode('***',$param['w_rows']);
2015
+ $w_columns = explode('***',$param['w_columns']);
2016
+ $column_labels = '';
2017
+ for ($i = 1; $i < count($w_columns); $i++) {
2018
+ $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>';
2019
+ }
2020
+ $rows_columns = '';
2021
+ for($i=1; $i<count($w_rows); $i++)
2022
+ {
2023
+
2024
+ $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>';
2025
+
2026
+
2027
+ for($k=1; $k<count($w_columns); $k++)
2028
+ {
2029
+ if($param['w_field_input_type']=='radio')
2030
+ $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>';
2031
+ else
2032
+ if($param['w_field_input_type']=='checkbox')
2033
+ $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>';
2034
+ else
2035
+ if($param['w_field_input_type']=='text')
2036
+ $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>';
2037
+ else
2038
+ if($param['w_field_input_type']=='select')
2039
+ $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>';
2040
+
2041
+ }
2042
+
2043
+ $rows_columns .= '</div>';
2044
+ }
2045
+
2046
+
2047
+
2048
+ $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>';
2049
+
2050
+ break;
2051
+ }
2052
+ case 'type_submit_reset': {
2053
+ $params_names=array('w_submit_title','w_reset_title','w_class','w_act');
2054
+ $temp=$params;
2055
+ foreach ($params_names as $params_name) {
2056
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
2057
+ $param[$params_name] = $temp[0];
2058
+ $temp=$temp[1];
2059
+ }
2060
+ if ($temp) {
2061
+ $temp = explode('*:*w_attr_name*:*',$temp);
2062
+ $attrs = array_slice($temp,0, count($temp)-1);
2063
+ foreach ($attrs as $attr) {
2064
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
2065
+ }
2066
+ }
2067
+ $param['w_act'] = ($param['w_act']=="false" ? 'style="display: none;"' : "");
2068
+ $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>';
2069
+ break;
2070
+ }
2071
+ case 'type_button': {
2072
+ $params_names=array('w_title','w_func','w_class');
2073
+ $temp=$params;
2074
+ foreach($params_names as $params_name) {
2075
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
2076
+ $param[$params_name] = $temp[0];
2077
+ $temp=$temp[1];
2078
+ }
2079
+ if ($temp) {
2080
+ $temp = explode('*:*w_attr_name*:*',$temp);
2081
+ $attrs = array_slice($temp,0, count($temp)-1);
2082
+ foreach($attrs as $attr) {
2083
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
2084
+ }
2085
+ }
2086
+ $param['w_title'] = explode('***',$param['w_title']);
2087
+ $param['w_func'] = explode('***',$param['w_func']);
2088
+ $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">';
2089
+ foreach ($param['w_title'] as $key => $title) {
2090
+ $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>';
2091
+ }
2092
+ $rep .= '</div></div>';
2093
+ break;
2094
+ }
2095
+ }
2096
+
2097
+ $form = str_replace('%' . $id . ' - ' . $labels[$ids_key] . '%', $rep, $form);
2098
+ $form = str_replace('%' . $id . ' -' . $labels[$ids_key] . '%', $rep, $form);
2099
+ $row->form_front = $form;
2100
+ }
2101
+ }
2102
+ }
2103
+ else {
2104
+ $row = new stdClass();
2105
+ $row->id = 0;
2106
+ $row->backup_id ='';
2107
+ $row->title = '';
2108
+ $row->mail = '';
2109
+ $row->form = '';
2110
+ $row->form_front = '';
2111
+ $row->theme = $wpdb->get_var("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE `default`='1'");
2112
+ $row->javascript = '';
2113
+ $row->submit_text = '';
2114
+ $row->url = '';
2115
+ $row->submit_text_type = 0;
2116
+ $row->script1 = '';
2117
+ $row->script2 = '';
2118
+ $row->script_user1 = '';
2119
+ $row->script_user2 = '';
2120
+ $row->counter = 0;
2121
+ $row->label_order = '';
2122
+ $row->article_id = '';
2123
+ $row->pagination = '';
2124
+ $row->show_title = '';
2125
+ $row->show_numbers = '';
2126
+ $row->public_key = '';
2127
+ $row->private_key = '';
2128
+ $row->recaptcha_theme = '';
2129
+ $row->from_name = '';
2130
+ $row->from_mail = '';
2131
+ $row->label_order_current = '';
2132
+ $row->script_mail_user = '';
2133
+ $row->script_mail = '';
2134
+ $row->tax = 0;
2135
+ $row->payment_currency = '$';
2136
+ $row->paypal_email = '';
2137
+ $row->checkout_mode = 'testmode';
2138
+ $row->paypal_mode = 0;
2139
+
2140
+ $row->published = 1;
2141
+ $row->form_fields = '';
2142
+ $row->savedb = 1;
2143
+ $row->sendemail = 1;
2144
+ $row->requiredmark = '*';
2145
+ $row->reply_to = 0;
2146
+ $row->send_to = 0;
2147
+ $row->autogen_layout = 1;
2148
+ $row->custom_front = '';
2149
+ $row->mail_from_user = '';
2150
+ $row->mail_from_name_user = '';
2151
+ $row->reply_to_user = '';
2152
+ $row->save_uploads = 1;
2153
+
2154
+ $row->condition = '';
2155
+ $row->mail_cc = '';
2156
+ $row->mail_cc_user = '';
2157
+ $row->mail_bcc = '';
2158
+ $row->mail_bcc_user = '';
2159
+ $row->mail_subject = '';
2160
+ $row->mail_subject_user = '';
2161
+ $row->mail_mode = 1;
2162
+ $row->mail_mode_user = 1;
2163
+ $row->mail_attachment = 1;
2164
+ $row->mail_attachment_user = 1;
2165
+
2166
+ $row->user_id_wd = '';
2167
+ $row->sortable = 1;
2168
+ $row->frontend_submit_fields = '';
2169
+ $row->frontend_submit_stat_fields = '';
2170
+ }
2171
+ return $row;
2172
+ }
2173
+
2174
+ public function get_theme_rows_data($old = '') {
2175
+ global $wpdb;
2176
+ $rows = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker_themes WHERE css " . ($old ? 'NOT' : '') . " LIKE '%.wdform_section%' ORDER BY title");
2177
+ return $rows;
2178
+ }
2179
+
2180
+ public function get_queries_rows_data($id) {
2181
+ global $wpdb;
2182
+ $rows = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker_query WHERE form_id=" . $id . " ORDER BY id ASC");
2183
+ return $rows;
2184
+ }
2185
+
2186
+ public function get_labels($id) {
2187
+ global $wpdb;
2188
+ $rows = $wpdb->get_col("SELECT DISTINCT `element_label` FROM " . $wpdb->prefix . "formmaker_submits WHERE form_id=" . $id);
2189
+ return $rows;
2190
+ }
2191
+
2192
+ public function is_paypal($id) {
2193
+ global $wpdb;
2194
+ $rows = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker_sessions WHERE form_id=" . $id);
2195
+ return $rows;
2196
+ }
2197
+
2198
+ public function page_nav() {
2199
+ global $wpdb;
2200
+ $where = 'WHERE `id` NOT IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ')';
2201
+ $where .= ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? ' AND title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
2202
+ $query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker " . $where;
2203
+ $total = $wpdb->get_var($query);
2204
+ $page_nav['total'] = $total;
2205
+ if (isset($_POST['page_number']) && $_POST['page_number']) {
2206
+ $limit = ((int) $_POST['page_number'] - 1) * 20;
2207
+ }
2208
+ else {
2209
+ $limit = 0;
2210
+ }
2211
+ $page_nav['limit'] = (int) ($limit / 20 + 1);
2212
+ return $page_nav;
2213
+ }
2214
+ ////////////////////////////////////////////////////////////////////////////////////////
2215
+ // Getters & Setters //
2216
+ ////////////////////////////////////////////////////////////////////////////////////////
2217
+ ////////////////////////////////////////////////////////////////////////////////////////
2218
+ // Private Methods //
2219
+ ////////////////////////////////////////////////////////////////////////////////////////
2220
+ ////////////////////////////////////////////////////////////////////////////////////////
2221
+ // Listeners //
2222
+ ////////////////////////////////////////////////////////////////////////////////////////
2223
  }
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'] == 'desc') ? 'desc' : 'asc');
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'] == 'desc') ? 'desc' : 'asc');
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
- ////////////////////////////////////////////////////////////////////////////////////////
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
+ ////////////////////////////////////////////////////////////////////////////////////////
477
  }
admin/views/FMViewFormMakerSQLMapping.php CHANGED
@@ -1,1467 +1,1467 @@
1
- <?php
2
-
3
- class FMViewFormMakerSQLMapping {
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
-
26
- public function edit_query($id, $form_id) {
27
- wp_print_scripts('jquery');
28
- wp_print_scripts('jquery-ui-tooltip');
29
- ?>
30
- <link media="all" type="text/css" href="<?php echo WD_FM_URL . '/css/style.css'; ?>" rel="stylesheet">
31
- <link rel="stylesheet" href="<?php echo WD_FM_URL . '/css/jquery-ui-1.10.3.custom.css'; ?>">
32
- <?php
33
- $label = $this->model->get_labels($form_id);
34
- $query_obj = $this->model->get_query($id);
35
-
36
- $temp = explode('***wdfcon_typewdf***',$query_obj->details);
37
- $con_type = $temp[0];
38
- $temp = explode('***wdfcon_methodwdf***',$temp[1]);
39
- $con_method = $temp[0];
40
- $temp = explode('***wdftablewdf***',$temp[1]);
41
- $table_cur = $temp[0];
42
- $temp = explode('***wdfhostwdf***',$temp[1]);
43
- $host = $temp[0];
44
- $temp = explode('***wdfportwdf***',$temp[1]);
45
- $port = $temp[0];
46
- $temp = explode('***wdfusernamewdf***',$temp[1]);
47
- $username = $temp[0];
48
- $temp = explode('***wdfpasswordwdf***',$temp[1]);
49
- $password = $temp[0];
50
- $temp = explode('***wdfdatabasewdf***',$temp[1]);
51
- $database = $temp[0];
52
- $details = $temp[1];
53
-
54
- $tables = $this->model->get_tables_saved($con_type, $username, $password, $database, $host);
55
- $table_struct = $this->model->get_table_struct_saved($con_type, $username, $password, $database, $host, $table_cur, $con_method);
56
-
57
- $filter_types=array("type_submit_reset", "type_map", "type_editor", "type_captcha", "type_recaptcha", "type_button", "type_paypal_total", "type_send_copy");
58
- $label_id= array();
59
- $label_order= array();
60
- $label_order_original= array();
61
- $label_type= array();
62
-
63
- $label_all = explode('#****#',$label);
64
- $label_all = array_slice($label_all,0, count($label_all)-1);
65
-
66
- foreach($label_all as $key => $label_each) {
67
- $label_id_each=explode('#**id**#',$label_each);
68
- $label_oder_each=explode('#**label**#', $label_id_each[1]);
69
-
70
- if(in_array($label_oder_each[1],$filter_types))
71
- continue;
72
-
73
- array_push($label_id, $label_id_each[0]);
74
- array_push($label_order_original, $label_oder_each[0]);
75
- $ptn = "/[^a-zA-Z0-9_]/";
76
- $rpltxt = "";
77
- $label_temp=preg_replace($ptn, $rpltxt, $label_oder_each[0]);
78
- array_push($label_order, $label_temp);
79
- array_push($label_type, $label_oder_each[1]);
80
- }
81
-
82
- $form_fields='';
83
- foreach($label_id as $key => $lid) {
84
- $form_fields.='<a onclick="insert_field('.$lid.'); jQuery(\'#fieldlist\').hide();" style="display:block; text-decoration:none;">'.$label_order_original[$key].'</a>';
85
- }
86
- $user_fields = array("subid"=>"Submission ID", "ip"=>"Submitter's IP", "userid"=>"User ID", "username"=>"Username", "useremail"=>"User Email");
87
- foreach($user_fields as $user_key=>$user_field) {
88
- $form_fields.='<a onclick="insert_field(\''.$user_key.'\'); jQuery(\'#fieldlist\').hide();" style="display:block; text-decoration:none;">'.$user_field.'</a>';
89
- }
90
-
91
- $cond='<div id="condid"><select id="sel_condid" style="width: 160px">';
92
- foreach($table_struct as $col) {
93
- $cond.='<option>'.str_replace("'", "SingleQuot", $col->Field).'</option>';
94
- }
95
- $cond.='</select>';
96
- $cond.='<select id="op_condid"><option value="=" selected="selected">=</option><option value="!=">!=</option><option value=">">&gt;</option><option value="<">&lt;</option><option value=">=">&gt;=</option><option value="<=">&lt;=</option><option value="%..%">Like</option><option value="%..">Starts with</option><option value="..%">Ends with</option></select><input id="val_condid" style="width:170px" type="text" /><select id="andor_condid" style="visibility: hidden;"><option value="AND">AND</option><option value="OR">OR</option></select><img src="' . WD_FM_URL . '/images/delete.png?ver='. get_option("wd_form_maker_version").'" onclick="delete_cond(&quot;condid&quot;)" style="vertical-align: middle;"></div>';
97
- ?>
98
- <script>
99
- function connect() {
100
- jQuery("input[type='radio']").attr('disabled','');
101
- jQuery('#struct').html('<div class="fm-loading-container"><div class="fm-loading-content"></div></div>');
102
- jQuery("#struct").load('index.php?option=com_formmaker&task=db_tables&con_type='+jQuery('input[name=con_type]:checked').val()