Contact Form by WD – responsive drag & drop contact form builder tool - Version 1.7.20

Version Description

Download this release

Release Info

Developer webdorado
Plugin Icon 128x128 Contact Form by WD – responsive drag & drop contact form builder tool
Version 1.7.20
Comparing to
See all releases

Code changes from version 1.7.19 to 1.7.20

Files changed (43) hide show
  1. admin/controllers/FMControllerBlocked_ips_fmc.php +145 -145
  2. admin/controllers/FMControllerFeatured_plugins_fmc.php +48 -48
  3. admin/controllers/FMControllerFormMakerEditCSS_fmc.php +97 -97
  4. admin/controllers/FMControllerFormMakerPreview_fmc.php +42 -42
  5. admin/controllers/FMControllerFormcontactwdcaptcha.php +42 -42
  6. admin/controllers/FMControllerFormcontactwindow.php +42 -42
  7. admin/controllers/FMControllerFromipinfoinpopup_fmc.php +42 -42
  8. admin/controllers/FMControllerFrommapeditinpopup_fmc.php +42 -42
  9. admin/controllers/FMControllerGenerete_csv_fmc.php +42 -42
  10. admin/controllers/FMControllerGenerete_xml_fmc.php +42 -42
  11. admin/controllers/FMControllerLicensing_fmc.php +48 -48
  12. admin/controllers/FMControllerManage_fmc.php +984 -984
  13. admin/controllers/FMControllerSubmissions_fmc.php +760 -760
  14. admin/controllers/FMControllerThemes_fmc.php +189 -189
  15. admin/controllers/FMControllerUninstall_fmc.php +56 -56
  16. admin/controllers/FMControllerWidget_fmc.php +60 -60
  17. admin/models/FMModelBlocked_ips_fmc.php +72 -72
  18. admin/models/FMModelFeatured_plugins_fmc.php +29 -29
  19. admin/models/FMModelFormMakerEditCSS_fmc.php +41 -41
  20. admin/models/FMModelFormMakerPreview_fmc.php +41 -41
  21. admin/models/FMModelFormcontactwdcaptcha.php +30 -30
  22. admin/models/FMModelFormcontactwindow.php +35 -35
  23. admin/models/FMModelFromipinfoinpopup_fmc.php +30 -30
  24. admin/models/FMModelFrommapeditinpopup_fmc.php +30 -30
  25. admin/models/FMModelGenerete_csv_fmc.php +261 -261
  26. admin/models/FMModelGenerete_xml_fmc.php +259 -259
  27. admin/models/FMModelLicensing_fmc.php +29 -29
  28. admin/models/FMModelManage_fmc.php +1830 -1830
  29. admin/models/FMModelThemes_fmc.php +88 -88
  30. admin/models/FMModelUninstall_fmc.php +52 -52
  31. admin/models/FMModelWidget_fmc.php +37 -37
  32. admin/views/FMViewBlocked_ips_fmc.php +147 -147
  33. admin/views/FMViewFeatured_plugins_fmc.php +170 -170
  34. admin/views/FMViewFormMakerEditCSS_fmc.php +112 -112
  35. admin/views/FMViewFormMakerPreview_fmc.php +476 -476
  36. admin/views/FMViewFormcontactwdcaptcha.php +92 -92
  37. admin/views/FMViewFormcontactwindow.php +112 -112
  38. admin/views/FMViewFromipinfoinpopup_fmc.php +101 -101
  39. admin/views/FMViewFrommapeditinpopup_fmc.php +63 -63
  40. admin/views/FMViewGenerete_csv_fmc.php +68 -68
  41. admin/views/FMViewGenerete_xml_fmc.php +66 -66
  42. admin/views/FMViewLicensing_fmc.php +53 -53
  43. admin/views/FMViewManage_fmc.php +0 -2248
admin/controllers/FMControllerBlocked_ips_fmc.php CHANGED
@@ -1,146 +1,146 @@
1
- <?php
2
-
3
- class FMControllerBlocked_ips_fmc {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $task = WDW_FMC_Library::get('task');
23
- $id = WDW_FMC_Library::get('current_id', 0);
24
- $message = WDW_FMC_Library::get('message');
25
- echo WDW_FMC_Library::message_id($message);
26
- // $task = ((isset($_POST['task'])) ? esc_html($_POST['task']) : '');
27
- // $id = ((isset($_POST['current_id'])) ? esc_html($_POST['current_id']) : 0);
28
- if (method_exists($this, $task)) {
29
- $this->$task($id);
30
- }
31
- else {
32
- $this->display();
33
- }
34
- }
35
-
36
- public function display() {
37
- require_once WD_FMC_DIR . "/admin/models/FMModelBlocked_ips_fmc.php";
38
- $model = new FMModelBlocked_ips_fmc();
39
-
40
- require_once WD_FMC_DIR . "/admin/views/FMViewBlocked_ips_fmc.php";
41
- $view = new FMViewBlocked_ips_fmc($model);
42
- $view->display();
43
- }
44
-
45
- public function save() {
46
- $message = $this->save_db();
47
- // $this->display();
48
- $page = WDW_FMC_Library::get('page');
49
- WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
50
- }
51
-
52
- public function save_db() {
53
- global $wpdb;
54
- $id = (isset($_POST['current_id']) ? (int) $_POST['current_id'] : 0);
55
- $ip = (isset($_POST['ip']) ? esc_html(stripslashes($_POST['ip'])) : '');
56
- if ($id != 0) {
57
- $save = $wpdb->update($wpdb->prefix . 'formmaker_blocked', array(
58
- 'ip' => $ip,
59
- ), array('id' => $id));
60
- }
61
- else {
62
- $save = $wpdb->insert($wpdb->prefix . 'formmaker_blocked', array(
63
- 'ip' => $ip,
64
- ), array(
65
- '%s',
66
- ));
67
- }
68
- if ($save !== FALSE) {
69
- $message = 1;
70
- }
71
- else {
72
- $message = 2;
73
- }
74
- }
75
-
76
- public function save_all() {
77
- global $wpdb;
78
- $flag = FALSE;
79
- $ips_id_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker_blocked');
80
- foreach ($ips_id_col as $ip_id) {
81
- if (isset($_POST['ip' . $ip_id])) {
82
- $ip = esc_html(stripslashes($_POST['ip' . $ip_id]));
83
- if ($ip == '') {
84
- $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $ip_id));
85
- }
86
- else {
87
- $flag = TRUE;
88
- $wpdb->update($wpdb->prefix . 'formmaker_blocked', array(
89
- 'ip' => $ip,
90
- ), array('id' => $ip_id));
91
- }
92
- }
93
- }
94
- if ($flag) {
95
- $message = 1;
96
- }
97
- // $this->display();
98
- $page = WDW_FMC_Library::get('page');
99
- WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
100
- }
101
-
102
- public function delete($id) {
103
- global $wpdb;
104
- $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $id);
105
- if ($wpdb->query($query)) {
106
- $message = 3;
107
- }
108
- else {
109
- $message = 2;
110
- }
111
- // $this->display();
112
- $page = WDW_FMC_Library::get('page');
113
- WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
114
- }
115
-
116
- public function delete_all() {
117
- global $wpdb;
118
- $flag = FALSE;
119
- $ips_id_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker_blocked');
120
- foreach ($ips_id_col as $ip_id) {
121
- if (isset($_POST['check_' . $ip_id])) {
122
- $flag = TRUE;
123
- $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $ip_id));
124
- }
125
- }
126
- if ($flag) {
127
- $message = 5;
128
- }
129
- else {
130
- $message = 2;
131
- }
132
- // $this->display();
133
- $page = WDW_FMC_Library::get('page');
134
- WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
135
- }
136
-
137
- ////////////////////////////////////////////////////////////////////////////////////////
138
- // Getters & Setters //
139
- ////////////////////////////////////////////////////////////////////////////////////////
140
- ////////////////////////////////////////////////////////////////////////////////////////
141
- // Private Methods //
142
- ////////////////////////////////////////////////////////////////////////////////////////
143
- ////////////////////////////////////////////////////////////////////////////////////////
144
- // Listeners //
145
- ////////////////////////////////////////////////////////////////////////////////////////
146
  }
1
+ <?php
2
+
3
+ class FMControllerBlocked_ips_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $task = WDW_FMC_Library::get('task');
23
+ $id = WDW_FMC_Library::get('current_id', 0);
24
+ $message = WDW_FMC_Library::get('message');
25
+ echo WDW_FMC_Library::message_id($message);
26
+ // $task = ((isset($_POST['task'])) ? esc_html($_POST['task']) : '');
27
+ // $id = ((isset($_POST['current_id'])) ? esc_html($_POST['current_id']) : 0);
28
+ if (method_exists($this, $task)) {
29
+ $this->$task($id);
30
+ }
31
+ else {
32
+ $this->display();
33
+ }
34
+ }
35
+
36
+ public function display() {
37
+ require_once WD_FMC_DIR . "/admin/models/FMModelBlocked_ips_fmc.php";
38
+ $model = new FMModelBlocked_ips_fmc();
39
+
40
+ require_once WD_FMC_DIR . "/admin/views/FMViewBlocked_ips_fmc.php";
41
+ $view = new FMViewBlocked_ips_fmc($model);
42
+ $view->display();
43
+ }
44
+
45
+ public function save() {
46
+ $message = $this->save_db();
47
+ // $this->display();
48
+ $page = WDW_FMC_Library::get('page');
49
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
50
+ }
51
+
52
+ public function save_db() {
53
+ global $wpdb;
54
+ $id = (isset($_POST['current_id']) ? (int) $_POST['current_id'] : 0);
55
+ $ip = (isset($_POST['ip']) ? esc_html(stripslashes($_POST['ip'])) : '');
56
+ if ($id != 0) {
57
+ $save = $wpdb->update($wpdb->prefix . 'formmaker_blocked', array(
58
+ 'ip' => $ip,
59
+ ), array('id' => $id));
60
+ }
61
+ else {
62
+ $save = $wpdb->insert($wpdb->prefix . 'formmaker_blocked', array(
63
+ 'ip' => $ip,
64
+ ), array(
65
+ '%s',
66
+ ));
67
+ }
68
+ if ($save !== FALSE) {
69
+ $message = 1;
70
+ }
71
+ else {
72
+ $message = 2;
73
+ }
74
+ }
75
+
76
+ public function save_all() {
77
+ global $wpdb;
78
+ $flag = FALSE;
79
+ $ips_id_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker_blocked');
80
+ foreach ($ips_id_col as $ip_id) {
81
+ if (isset($_POST['ip' . $ip_id])) {
82
+ $ip = esc_html(stripslashes($_POST['ip' . $ip_id]));
83
+ if ($ip == '') {
84
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $ip_id));
85
+ }
86
+ else {
87
+ $flag = TRUE;
88
+ $wpdb->update($wpdb->prefix . 'formmaker_blocked', array(
89
+ 'ip' => $ip,
90
+ ), array('id' => $ip_id));
91
+ }
92
+ }
93
+ }
94
+ if ($flag) {
95
+ $message = 1;
96
+ }
97
+ // $this->display();
98
+ $page = WDW_FMC_Library::get('page');
99
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
100
+ }
101
+
102
+ public function delete($id) {
103
+ global $wpdb;
104
+ $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $id);
105
+ if ($wpdb->query($query)) {
106
+ $message = 3;
107
+ }
108
+ else {
109
+ $message = 2;
110
+ }
111
+ // $this->display();
112
+ $page = WDW_FMC_Library::get('page');
113
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
114
+ }
115
+
116
+ public function delete_all() {
117
+ global $wpdb;
118
+ $flag = FALSE;
119
+ $ips_id_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker_blocked');
120
+ foreach ($ips_id_col as $ip_id) {
121
+ if (isset($_POST['check_' . $ip_id])) {
122
+ $flag = TRUE;
123
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $ip_id));
124
+ }
125
+ }
126
+ if ($flag) {
127
+ $message = 5;
128
+ }
129
+ else {
130
+ $message = 2;
131
+ }
132
+ // $this->display();
133
+ $page = WDW_FMC_Library::get('page');
134
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
135
+ }
136
+
137
+ ////////////////////////////////////////////////////////////////////////////////////////
138
+ // Getters & Setters //
139
+ ////////////////////////////////////////////////////////////////////////////////////////
140
+ ////////////////////////////////////////////////////////////////////////////////////////
141
+ // Private Methods //
142
+ ////////////////////////////////////////////////////////////////////////////////////////
143
+ ////////////////////////////////////////////////////////////////////////////////////////
144
+ // Listeners //
145
+ ////////////////////////////////////////////////////////////////////////////////////////
146
  }
admin/controllers/FMControllerFeatured_plugins_fmc.php CHANGED
@@ -1,49 +1,49 @@
1
- <?php
2
-
3
- class FMControllerFeatured_plugins_fmc {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $task = ((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_FMC_DIR . "/admin/models/FMModelFeatured_plugins_fmc.php";
33
- $model = new FMModelFeatured_plugins_fmc();
34
-
35
- require_once WD_FMC_DIR . "/admin/views/FMViewFeatured_plugins_fmc.php";
36
- $view = new FMViewFeatured_plugins_fmc($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 FMControllerFeatured_plugins_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $task = ((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_FMC_DIR . "/admin/models/FMModelFeatured_plugins_fmc.php";
33
+ $model = new FMModelFeatured_plugins_fmc();
34
+
35
+ require_once WD_FMC_DIR . "/admin/views/FMViewFeatured_plugins_fmc.php";
36
+ $view = new FMViewFeatured_plugins_fmc($model);
37
+ $view->display();
38
+ }
39
+
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Getters & Setters //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
+ ////////////////////////////////////////////////////////////////////////////////////////
44
+ // Private Methods //
45
+ ////////////////////////////////////////////////////////////////////////////////////////
46
+ ////////////////////////////////////////////////////////////////////////////////////////
47
+ // Listeners //
48
+ ////////////////////////////////////////////////////////////////////////////////////////
49
  }
admin/controllers/FMControllerFormMakerEditCSS_fmc.php CHANGED
@@ -1,98 +1,98 @@
1
- <?php
2
-
3
- class FMControllerFormMakerEditCSS_fmc {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $task = ((isset($_POST['task'])) ? esc_html($_POST['task']) : '');
23
- $id = ((isset($_POST['current_id'])) ? 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_FMC_DIR . "/admin/models/FMModelFormMakerEditCSS_fmc.php";
34
- $model = new FMModelFormMakerEditCSS_fmc();
35
-
36
- require_once WD_FMC_DIR . "/admin/views/FMViewFormMakerEditCSS_fmc.php";
37
- $view = new FMViewFormMakerEditCSS_fmc($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_FMC_Library::message('Item Succesfully Saved.', 'updated');
83
- }
84
- else {
85
- echo WDW_FMC_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_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $task = ((isset($_POST['task'])) ? esc_html($_POST['task']) : '');
23
+ $id = ((isset($_POST['current_id'])) ? 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_FMC_DIR . "/admin/models/FMModelFormMakerEditCSS_fmc.php";
34
+ $model = new FMModelFormMakerEditCSS_fmc();
35
+
36
+ require_once WD_FMC_DIR . "/admin/views/FMViewFormMakerEditCSS_fmc.php";
37
+ $view = new FMViewFormMakerEditCSS_fmc($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_FMC_Library::message('Item Succesfully Saved.', 'updated');
83
+ }
84
+ else {
85
+ echo WDW_FMC_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_fmc.php CHANGED
@@ -1,43 +1,43 @@
1
- <?php
2
-
3
- class FMControllerFormMakerPreview_fmc {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $this->display();
23
- }
24
-
25
- public function display() {
26
- require_once WD_FMC_DIR . "/admin/models/FMModelFormMakerPreview_fmc.php";
27
- $model = new FMModelFormMakerPreview_fmc();
28
-
29
- require_once WD_FMC_DIR . "/admin/views/FMViewFormMakerPreview_fmc.php";
30
- $view = new FMViewFormMakerPreview_fmc($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_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $this->display();
23
+ }
24
+
25
+ public function display() {
26
+ require_once WD_FMC_DIR . "/admin/models/FMModelFormMakerPreview_fmc.php";
27
+ $model = new FMModelFormMakerPreview_fmc();
28
+
29
+ require_once WD_FMC_DIR . "/admin/views/FMViewFormMakerPreview_fmc.php";
30
+ $view = new FMViewFormMakerPreview_fmc($model);
31
+ $view->display();
32
+ }
33
+
34
+ ////////////////////////////////////////////////////////////////////////////////////////
35
+ // Getters & Setters //
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
+ ////////////////////////////////////////////////////////////////////////////////////////
38
+ // Private Methods //
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Listeners //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
  }
admin/controllers/FMControllerFormcontactwdcaptcha.php CHANGED
@@ -1,43 +1,43 @@
1
- <?php
2
-
3
- class FMControllerFormcontactwdcaptcha {
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_FMC_DIR . "/admin/models/FMModelFormcontactwdcaptcha.php";
27
- $model = new FMModelFormcontactwdcaptcha();
28
-
29
- require_once WD_FMC_DIR . "/admin/views/FMViewFormcontactwdcaptcha.php";
30
- $view = new FMViewFormcontactwdcaptcha($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 FMControllerFormcontactwdcaptcha {
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_FMC_DIR . "/admin/models/FMModelFormcontactwdcaptcha.php";
27
+ $model = new FMModelFormcontactwdcaptcha();
28
+
29
+ require_once WD_FMC_DIR . "/admin/views/FMViewFormcontactwdcaptcha.php";
30
+ $view = new FMViewFormcontactwdcaptcha($model);
31
+ $view->display();
32
+ }
33
+
34
+ ////////////////////////////////////////////////////////////////////////////////////////
35
+ // Getters & Setters //
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
+ ////////////////////////////////////////////////////////////////////////////////////////
38
+ // Private Methods //
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Listeners //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
  }
admin/controllers/FMControllerFormcontactwindow.php CHANGED
@@ -1,43 +1,43 @@
1
- <?php
2
-
3
- class FMControllerFormcontactwindow {
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_FMC_DIR . "/admin/models/FMModelFormcontactwindow.php";
27
- $model = new FMModelFormcontactwindow();
28
-
29
- require_once WD_FMC_DIR . "/admin/views/FMViewFormcontactwindow.php";
30
- $view = new FMViewFormcontactwindow($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 FMControllerFormcontactwindow {
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_FMC_DIR . "/admin/models/FMModelFormcontactwindow.php";
27
+ $model = new FMModelFormcontactwindow();
28
+
29
+ require_once WD_FMC_DIR . "/admin/views/FMViewFormcontactwindow.php";
30
+ $view = new FMViewFormcontactwindow($model);
31
+ $view->display();
32
+ }
33
+
34
+ ////////////////////////////////////////////////////////////////////////////////////////
35
+ // Getters & Setters //
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
+ ////////////////////////////////////////////////////////////////////////////////////////
38
+ // Private Methods //
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Listeners //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
  }
admin/controllers/FMControllerFromipinfoinpopup_fmc.php CHANGED
@@ -1,43 +1,43 @@
1
- <?php
2
-
3
- class FMControllerFromipinfoinpopup_fmc {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $this->display();
23
- }
24
-
25
- public function display() {
26
- require_once WD_FMC_DIR . "/admin/models/FMModelFromipinfoinpopup_fmc.php";
27
- $model = new FMModelFromipinfoinpopup_fmc();
28
-
29
- require_once WD_FMC_DIR . "/admin/views/FMViewFromipinfoinpopup_fmc.php";
30
- $view = new FMViewFromipinfoinpopup_fmc($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_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $this->display();
23
+ }
24
+
25
+ public function display() {
26
+ require_once WD_FMC_DIR . "/admin/models/FMModelFromipinfoinpopup_fmc.php";
27
+ $model = new FMModelFromipinfoinpopup_fmc();
28
+
29
+ require_once WD_FMC_DIR . "/admin/views/FMViewFromipinfoinpopup_fmc.php";
30
+ $view = new FMViewFromipinfoinpopup_fmc($model);
31
+ $view->display();
32
+ }
33
+
34
+ ////////////////////////////////////////////////////////////////////////////////////////
35
+ // Getters & Setters //
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
+ ////////////////////////////////////////////////////////////////////////////////////////
38
+ // Private Methods //
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Listeners //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
  }
admin/controllers/FMControllerFrommapeditinpopup_fmc.php CHANGED
@@ -1,43 +1,43 @@
1
- <?php
2
-
3
- class FMControllerFrommapeditinpopup_fmc {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $this->display();
23
- }
24
-
25
- public function display() {
26
- require_once WD_FMC_DIR . "/admin/models/FMModelFrommapeditinpopup_fmc.php";
27
- $model = new FMModelFrommapeditinpopup_fmc();
28
-
29
- require_once WD_FMC_DIR . "/admin/views/FMViewFrommapeditinpopup_fmc.php";
30
- $view = new FMViewFrommapeditinpopup_fmc($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_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $this->display();
23
+ }
24
+
25
+ public function display() {
26
+ require_once WD_FMC_DIR . "/admin/models/FMModelFrommapeditinpopup_fmc.php";
27
+ $model = new FMModelFrommapeditinpopup_fmc();
28
+
29
+ require_once WD_FMC_DIR . "/admin/views/FMViewFrommapeditinpopup_fmc.php";
30
+ $view = new FMViewFrommapeditinpopup_fmc($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_fmc.php CHANGED
@@ -1,43 +1,43 @@
1
- <?php
2
-
3
- class FMControllerGenerete_csv_fmc {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $this->display();
23
- }
24
-
25
- public function display() {
26
- require_once WD_FMC_DIR . "/admin/models/FMModelGenerete_csv_fmc.php";
27
- $model = new FMModelGenerete_csv_fmc();
28
-
29
- require_once WD_FMC_DIR . "/admin/views/FMViewGenerete_csv_fmc.php";
30
- $view = new FMViewGenerete_csv_fmc($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_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $this->display();
23
+ }
24
+
25
+ public function display() {
26
+ require_once WD_FMC_DIR . "/admin/models/FMModelGenerete_csv_fmc.php";
27
+ $model = new FMModelGenerete_csv_fmc();
28
+
29
+ require_once WD_FMC_DIR . "/admin/views/FMViewGenerete_csv_fmc.php";
30
+ $view = new FMViewGenerete_csv_fmc($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_fmc.php CHANGED
@@ -1,43 +1,43 @@
1
- <?php
2
-
3
- class FMControllerGenerete_xml_fmc {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $this->display();
23
- }
24
-
25
- public function display() {
26
- require_once WD_FMC_DIR . "/admin/models/FMModelGenerete_xml_fmc.php";
27
- $model = new FMModelGenerete_xml_fmc();
28
-
29
- require_once WD_FMC_DIR . "/admin/views/FMViewGenerete_xml_fmc.php";
30
- $view = new FMViewGenerete_xml_fmc($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_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $this->display();
23
+ }
24
+
25
+ public function display() {
26
+ require_once WD_FMC_DIR . "/admin/models/FMModelGenerete_xml_fmc.php";
27
+ $model = new FMModelGenerete_xml_fmc();
28
+
29
+ require_once WD_FMC_DIR . "/admin/views/FMViewGenerete_xml_fmc.php";
30
+ $view = new FMViewGenerete_xml_fmc($model);
31
+ $view->display();
32
+ }
33
+
34
+ ////////////////////////////////////////////////////////////////////////////////////////
35
+ // Getters & Setters //
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
+ ////////////////////////////////////////////////////////////////////////////////////////
38
+ // Private Methods //
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Listeners //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
  }
admin/controllers/FMControllerLicensing_fmc.php CHANGED
@@ -1,49 +1,49 @@
1
- <?php
2
-
3
- class FMControllerLicensing_fmc {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $task = ((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_FMC_DIR . "/admin/models/FMModelLicensing_fmc.php";
33
- $model = new FMModelLicensing_fmc();
34
-
35
- require_once WD_FMC_DIR . "/admin/views/FMViewLicensing_fmc.php";
36
- $view = new FMViewLicensing_fmc($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_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $task = ((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_FMC_DIR . "/admin/models/FMModelLicensing_fmc.php";
33
+ $model = new FMModelLicensing_fmc();
34
+
35
+ require_once WD_FMC_DIR . "/admin/views/FMViewLicensing_fmc.php";
36
+ $view = new FMViewLicensing_fmc($model);
37
+ $view->display();
38
+ }
39
+
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Getters & Setters //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
+ ////////////////////////////////////////////////////////////////////////////////////////
44
+ // Private Methods //
45
+ ////////////////////////////////////////////////////////////////////////////////////////
46
+ ////////////////////////////////////////////////////////////////////////////////////////
47
+ // Listeners //
48
+ ////////////////////////////////////////////////////////////////////////////////////////
49
  }
admin/controllers/FMControllerManage_fmc.php CHANGED
@@ -1,985 +1,985 @@
1
- <?php
2
-
3
- class FMControllerManage_fmc {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- // $task = ((isset($_POST['task'])) ? esc_html($_POST['task']) : '');
23
- // $id = ((isset($_POST['current_id'])) ? esc_html($_POST['current_id']) : 0);
24
- $task = WDW_FMC_Library::get('task');
25
- $id = WDW_FMC_Library::get('current_id', 0);
26
- $message = WDW_FMC_Library::get('message');
27
- echo WDW_FMC_Library::message_id($message);
28
- if (method_exists($this, $task)) {
29
- $this->$task($id);
30
- }
31
- else {
32
- $this->display();
33
- }
34
- }
35
-
36
- public function display() {
37
- require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
38
- $model = new FMModelManage_fmc();
39
-
40
- require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
41
- $view = new FMViewManage_fmc($model);
42
- $view->display();
43
- }
44
-
45
- public function add() {
46
- require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
47
- $model = new FMModelManage_fmc();
48
-
49
- require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
50
- $view = new FMViewManage_fmc($model);
51
- $view->edit(0);
52
- }
53
-
54
- public function edit() {
55
- require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
56
- $model = new FMModelManage_fmc();
57
-
58
- require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
59
- $view = new FMViewManage_fmc($model);
60
- // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
61
- $id = WDW_FMC_Library::get('current_id', 0);
62
- $view->edit($id);
63
- }
64
-
65
- public function edit_old() {
66
- require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
67
- $model = new FMModelManage_fmc();
68
-
69
- require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
70
- $view = new FMViewManage_fmc($model);
71
- // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
72
- $id = WDW_FMC_Library::get('current_id', 0);
73
- // var_dump('s');
74
- $view->edit_old($id);
75
- }
76
-
77
- public function form_options_old() {
78
- if (!isset($_GET['task'])) {
79
- $this->save_db();
80
- }
81
- require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
82
- $model = new FMModelManage_fmc();
83
-
84
- require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
85
- $view = new FMViewManage_fmc($model);
86
- // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
87
- global $wpdb;
88
- $id = WDW_FMC_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
89
- $view->form_options_old($id);
90
- }
91
-
92
- public function save_options_old() {
93
- $message = $this->save_db_options_old();
94
- // $this->edit_old();
95
- $page = WDW_FMC_Library::get('page');
96
- $current_id = WDW_FMC_Library::get('current_id', 0);
97
- WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'edit_old', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
98
- }
99
-
100
- public function apply_options_old() {
101
- $message = $this->save_db_options_old();
102
- require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
103
- $model = new FMModelManage_fmc();
104
-
105
- require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
106
- $view = new FMViewManage_fmc($model);
107
- // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
108
- // $view->form_options_old($id);
109
- $page = WDW_FMC_Library::get('page');
110
- $current_id = WDW_FMC_Library::get('current_id', 0);
111
- $fieldset_id = WDW_FMC_Library::get('fieldset_id', 'general');
112
- WDW_FMC_Library::spider_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')));
113
- }
114
-
115
- public function save_db_options_old() {
116
- $javascript = "// Before the form is loaded.
117
- function before_load() {
118
-
119
- }
120
- // Before form submit.
121
- function before_submit() {
122
-
123
- }
124
- // Before form reset.
125
- function before_reset() {
126
-
127
- }";
128
- global $wpdb;
129
- // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
130
- $id = WDW_FMC_Library::get('current_id', 0);
131
- $mail = (isset($_POST['mail']) ? esc_html(stripslashes($_POST['mail'])) : '');
132
- $theme = (isset($_POST['theme']) ? esc_html(stripslashes($_POST['theme'])) : 1);
133
- $javascript = (isset($_POST['javascript']) ? stripslashes($_POST['javascript']) : $javascript);
134
- $script1 = (isset($_POST['script1']) ? esc_html(stripslashes($_POST['script1'])) : '');
135
- $script2 = (isset($_POST['script2']) ? esc_html(stripslashes($_POST['script2'])) : '');
136
- $script_user1 = (isset($_POST['script_user1']) ? esc_html(stripslashes($_POST['script_user1'])) : '');
137
- $script_user2 = (isset($_POST['script_user2']) ? esc_html(stripslashes($_POST['script_user2'])) : '');
138
- $submit_text = (isset($_POST['submit_text']) ? stripslashes($_POST['submit_text']) : '');
139
- $url = (isset($_POST['url']) ? esc_html(stripslashes($_POST['url'])) : '');
140
- $script_mail = (isset($_POST['script_mail']) ? stripslashes($_POST['script_mail']) : '%all%');
141
- $script_mail_user = (isset($_POST['script_mail_user']) ? stripslashes($_POST['script_mail_user']) : '%all%');
142
- $label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
143
- $tax = (isset($_POST['tax']) ? esc_html(stripslashes($_POST['tax'])) : 0);
144
- $payment_currency = (isset($_POST['payment_currency']) ? stripslashes($_POST['payment_currency']) : '');
145
- $paypal_email = (isset($_POST['paypal_email']) ? esc_html(stripslashes($_POST['paypal_email'])) : '');
146
- $checkout_mode = (isset($_POST['checkout_mode']) ? esc_html(stripslashes($_POST['checkout_mode'])) : 'testmode');
147
- $paypal_mode = (isset($_POST['paypal_mode']) ? esc_html(stripslashes($_POST['paypal_mode'])) : 0);
148
- $from_mail = (isset($_POST['from_mail']) ? esc_html(stripslashes($_POST['from_mail'])) : '');
149
- $from_name = (isset($_POST['from_name']) ? esc_html(stripslashes($_POST['from_name'])) : '');
150
- if (isset($_POST['submit_text_type'])) {
151
- $submit_text_type = esc_html(stripslashes($_POST['submit_text_type']));
152
- if ($submit_text_type == 5) {
153
- $article_id = (isset($_POST['page_name']) ? esc_html(stripslashes($_POST['page_name'])) : 0);
154
- }
155
- else {
156
- $article_id = (isset($_POST['post_name']) ? esc_html(stripslashes($_POST['post_name'])) : 0);
157
- }
158
- }
159
- else {
160
- $submit_text_type = 0;
161
- $article_id = 0;
162
- }
163
- $save = $wpdb->update($wpdb->prefix . 'formmaker', array(
164
- 'mail' => $mail,
165
- 'theme' => $theme,
166
- 'javascript' => $javascript,
167
- 'submit_text' => $submit_text,
168
- 'url' => $url,
169
- 'submit_text_type' => $submit_text_type,
170
- 'script_mail' => $script_mail,
171
- 'script_mail_user' => $script_mail_user,
172
- 'article_id' => $article_id,
173
- 'paypal_mode' => $paypal_mode,
174
- 'checkout_mode' => $checkout_mode,
175
- 'paypal_email' => $paypal_email,
176
- 'payment_currency' => $payment_currency,
177
- 'tax' => $tax,
178
- 'from_mail' => $from_mail,
179
- 'from_name' => $from_name,
180
- ), array('id' => $id));
181
- if ($save !== FALSE) {
182
- return 8;
183
- }
184
- else {
185
- return 2;
186
- }
187
- }
188
-
189
- public function cancel_options_old() {
190
- $this->edit_old();
191
- }
192
-
193
- public function form_layout() {
194
- if (!isset($_GET['task'])) {
195
- $this->save_db();
196
- }
197
- require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
198
- $model = new FMModelManage_fmc();
199
-
200
- require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
201
- $view = new FMViewManage_fmc($model);
202
- // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
203
- global $wpdb;
204
- $id = WDW_FMC_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
205
- $view->form_layout($id);
206
- }
207
-
208
- public function save_layout() {
209
- $message = $this->save_db_layout();
210
- // $this->edit();
211
- $page = WDW_FMC_Library::get('page');
212
- $current_id = WDW_FMC_Library::get('current_id', 0);
213
- WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
214
- }
215
-
216
- public function apply_layout() {
217
- $message = $this->save_db_layout();
218
- require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
219
- $model = new FMModelManage_fmc();
220
-
221
- require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
222
- $view = new FMViewManage_fmc($model);
223
- // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
224
- $page = WDW_FMC_Library::get('page');
225
- $current_id = WDW_FMC_Library::get('current_id', 0);
226
- WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'form_layout', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
227
- // $view->form_layout($id);
228
- }
229
-
230
- public function save_db_layout() {
231
- global $wpdb;
232
- // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
233
- $id = WDW_FMC_Library::get('current_id', 0);
234
- $custom_front = (isset($_POST['custom_front']) ? stripslashes($_POST['custom_front']) : '');
235
- $autogen_layout = (isset($_POST['autogen_layout']) ? 1 : 0);
236
- $save = $wpdb->update($wpdb->prefix . 'formmaker', array(
237
- 'custom_front' => $custom_front,
238
- 'autogen_layout' => $autogen_layout
239
- ), array('id' => $id));
240
- if ($save !== FALSE) {
241
- return 1;
242
- }
243
- else {
244
- return 2;
245
- }
246
- }
247
-
248
- public function form_options() {
249
- if (!isset($_GET['task'])) {
250
- $this->save_db();
251
- }
252
- require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
253
- $model = new FMModelManage_fmc();
254
-
255
- require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
256
- $view = new FMViewManage_fmc($model);
257
- // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
258
- global $wpdb;
259
- $id = WDW_FMC_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
260
- $view->form_options($id);
261
- }
262
-
263
- public function save_options() {
264
- $message = $this->save_db_options();
265
- // $this->edit();
266
- $page = WDW_FMC_Library::get('page');
267
- $current_id = WDW_FMC_Library::get('current_id', 0);
268
- WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
269
- }
270
-
271
- public function apply_options() {
272
- $message = $this->save_db_options();
273
- require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
274
- $model = new FMModelManage_fmc();
275
-
276
- require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
277
- $view = new FMViewManage_fmc($model);
278
- // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
279
- // $view->form_options($id);
280
- $page = WDW_FMC_Library::get('page');
281
- $current_id = WDW_FMC_Library::get('current_id', 0);
282
- $fieldset_id = WDW_FMC_Library::get('fieldset_id', 'general');
283
- WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'form_options', 'current_id' => $current_id, 'message' => $message, 'fieldset_id' => $fieldset_id), admin_url('admin.php')));
284
- }
285
-
286
- public function cancel_options() {
287
- $this->edit();
288
- }
289
-
290
- public function save_db_options() {
291
- $javascript = "// Before the form is loaded.
292
- function before_load() {
293
-
294
- }
295
- // Before form submit.
296
- function before_submit() {
297
-
298
- }
299
- // Before form reset.
300
- function before_reset() {
301
-
302
- }";
303
- global $wpdb;
304
- // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
305
- $id = WDW_FMC_Library::get('current_id', 0);
306
- $published = (isset($_POST['published']) ? esc_html(stripslashes($_POST['published'])) : 1);
307
- $savedb = (isset($_POST['savedb']) ? esc_html(stripslashes($_POST['savedb'])) : 1);
308
- $theme = ((isset($_POST['theme']) && (esc_html($_POST['theme']) != 0)) ? esc_html(stripslashes($_POST['theme'])) : $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker_themes"));
309
- $requiredmark = (isset($_POST['requiredmark']) ? esc_html(stripslashes($_POST['requiredmark'])) : '*');
310
- $sendemail = (isset($_POST['sendemail']) ? esc_html(stripslashes($_POST['sendemail'])) : 1);
311
- $mail = (isset($_POST['mail']) ? esc_html(stripslashes($_POST['mail'])) : '');
312
- if (isset($_POST['mailToAdd']) && esc_html(stripslashes($_POST['mailToAdd'])) != '') {
313
- $mail .= esc_html(stripslashes($_POST['mailToAdd'])) . ',';
314
- }
315
- $from_mail = (isset($_POST['from_mail']) ? esc_html(stripslashes($_POST['from_mail'])) : '');
316
- $from_name = (isset($_POST['from_name']) ? esc_html(stripslashes($_POST['from_name'])) : '');
317
- $reply_to = (isset($_POST['reply_to']) ? esc_html(stripslashes($_POST['reply_to'])) : '');
318
- if ($from_mail == "other") {
319
- $from_mail = (isset($_POST['mail_from_other']) ? esc_html(stripslashes($_POST['mail_from_other'])) : '');
320
- }
321
- if ($reply_to == "other") {
322
- $reply_to = (isset($_POST['reply_to_other']) ? esc_html(stripslashes($_POST['reply_to_other'])) : '');
323
- }
324
- $script_mail = (isset($_POST['script_mail']) ? stripslashes($_POST['script_mail']) : '%all%');
325
- $mail_from_user = (isset($_POST['mail_from_user']) ? esc_html(stripslashes($_POST['mail_from_user'])) : '');
326
- $mail_from_name_user = (isset($_POST['mail_from_name_user']) ? esc_html(stripslashes($_POST['mail_from_name_user'])) : '');
327
- $reply_to_user = (isset($_POST['reply_to_user']) ? esc_html(stripslashes($_POST['reply_to_user'])) : '');
328
- $condition = (isset($_POST['condition']) ? esc_html(stripslashes($_POST['condition'])) : '');
329
- $mail_cc = (isset($_POST['mail_cc']) ? esc_html(stripslashes($_POST['mail_cc'])) : '');
330
- $mail_cc_user = (isset($_POST['mail_cc_user']) ? esc_html(stripslashes($_POST['mail_cc_user'])) : '');
331
- $mail_bcc = (isset($_POST['mail_bcc']) ? esc_html(stripslashes($_POST['mail_bcc'])) : '');
332
- $mail_bcc_user = (isset($_POST['mail_bcc_user']) ? esc_html(stripslashes($_POST['mail_bcc_user'])) : '');
333
- $mail_subject = (isset($_POST['mail_subject']) ? esc_html(stripslashes($_POST['mail_subject'])) : '');
334
- $mail_subject_user = (isset($_POST['mail_subject_user']) ? esc_html(stripslashes($_POST['mail_subject_user'])) : '');
335
- $mail_mode = (isset($_POST['mail_mode']) ? esc_html(stripslashes($_POST['mail_mode'])) : 1);
336
- $mail_mode_user = (isset($_POST['mail_mode_user']) ? esc_html(stripslashes($_POST['mail_mode_user'])) : 1);
337
- $mail_attachment = (isset($_POST['mail_attachment']) ? esc_html(stripslashes($_POST['mail_attachment'])) : 1);
338
- $mail_attachment_user = (isset($_POST['mail_attachment_user']) ? esc_html(stripslashes($_POST['mail_attachment_user'])) : 1);
339
- $script_mail_user = (isset($_POST['script_mail_user']) ? stripslashes($_POST['script_mail_user']) : '%all%');
340
- $submit_text = (isset($_POST['submit_text']) ? stripslashes($_POST['submit_text']) : '');
341
- $url = (isset($_POST['url']) ? esc_html(stripslashes($_POST['url'])) : '');
342
- $tax = (isset($_POST['tax']) ? esc_html(stripslashes($_POST['tax'])) : 0);
343
- $payment_currency = (isset($_POST['payment_currency']) ? stripslashes($_POST['payment_currency']) : '');
344
- $paypal_email = (isset($_POST['paypal_email']) ? esc_html(stripslashes($_POST['paypal_email'])) : '');
345
- $checkout_mode = (isset($_POST['checkout_mode']) ? esc_html(stripslashes($_POST['checkout_mode'])) : 'testmode');
346
- $paypal_mode = (isset($_POST['paypal_mode']) ? esc_html(stripslashes($_POST['paypal_mode'])) : 0);
347
- $javascript = (isset($_POST['javascript']) ? stripslashes($_POST['javascript']) : $javascript);
348
- $send_to = '';
349
- for ($i = 0; $i < 20; $i++) {
350
- if (isset($_POST['send_to' . $i])) {
351
- $send_to .= '*' . esc_html(stripslashes($_POST['send_to' . $i])) . '*';
352
- }
353
- }
354
- if (isset($_POST['submit_text_type'])) {
355
- $submit_text_type = esc_html(stripslashes($_POST['submit_text_type']));
356
- if ($submit_text_type == 5) {
357
- $article_id = (isset($_POST['page_name']) ? esc_html(stripslashes($_POST['page_name'])) : 0);
358
- }
359
- else {
360
- $article_id = (isset($_POST['post_name']) ? esc_html(stripslashes($_POST['post_name'])) : 0);
361
- }
362
- }
363
- else {
364
- $submit_text_type = 0;
365
- $article_id = 0;
366
- }
367
- $save = $wpdb->update($wpdb->prefix . 'formmaker', array(
368
- 'published' => $published,
369
- 'savedb' => $savedb,
370
- 'theme' => $theme,
371
- 'requiredmark' => $requiredmark,
372
- 'sendemail' => $sendemail,
373
- 'mail' => $mail,
374
- 'from_mail' => $from_mail,
375
- 'from_name' => $from_name,
376
- 'reply_to' => $reply_to,
377
- 'script_mail' => $script_mail,
378
- 'mail_from_user' => $mail_from_user,
379
- 'mail_from_name_user' => $mail_from_name_user,
380
- 'reply_to_user' => $reply_to_user,
381
- 'condition' => $condition,
382
- 'mail_cc' => $mail_cc,
383
- 'mail_cc_user' => $mail_cc_user,
384
- 'mail_bcc' => $mail_bcc,
385
- 'mail_bcc_user' => $mail_bcc_user,
386
- 'mail_subject' => $mail_subject,
387
- 'mail_subject_user' => $mail_subject_user,
388
- 'mail_mode' => $mail_mode,
389
- 'mail_mode_user' => $mail_mode_user,
390
- 'mail_attachment' => $mail_attachment,
391
- 'mail_attachment_user' => $mail_attachment_user,
392
- 'script_mail_user' => $script_mail_user,
393
- 'submit_text' => $submit_text,
394
- 'url' => $url,
395
- 'submit_text_type' => $submit_text_type,
396
- 'article_id' => $article_id,
397
- 'tax' => $tax,
398
- 'payment_currency' => $payment_currency,
399
- 'paypal_email' => $paypal_email,
400
- 'checkout_mode' => $checkout_mode,
401
- 'paypal_mode' => $paypal_mode,
402
- 'javascript' => $javascript,
403
- 'send_to' => $send_to,
404
- ), array('id' => $id));
405
- if ($save !== FALSE) {
406
- return 8;
407
- }
408
- else {
409
- return 2;
410
- }
411
- }
412
-
413
- public function save_as_copy_old() {
414
- $message = $this->save_db_as_copy_old();
415
- // $this->display();
416
- $page = WDW_FMC_Library::get('page');
417
- WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
418
- }
419
-
420
- public function save_old() {
421
- $message = $this->save_db_old();
422
- // $this->display();
423
- $page = WDW_FMC_Library::get('page');
424
- WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
425
- }
426
-
427
- public function apply_old() {
428
- global $wpdb;
429
- $message = $this->save_db_old();
430
- // $this->edit_old();
431
- $id = (int) $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
432
- $current_id = WDW_FMC_Library::get('current_id', $id);
433
- $page = WDW_FMC_Library::get('page');
434
- WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'edit_old', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
435
- }
436
-
437
- public function save_db_old() {
438
- global $wpdb;
439
- // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
440
- $id = WDW_FMC_Library::get('current_id', 0);
441
- $title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
442
- $form = (isset($_POST['form']) ? stripslashes($_POST['form']) : '');
443
- $form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
444
- $counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
445
- $label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
446
- $label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
447
- $pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
448
- $show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
449
- $show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
450
- $public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
451
- $private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
452
- $recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
453
-
454
- $save = $wpdb->update($wpdb->prefix . 'formmaker', array(
455
- 'title' => $title,
456
- 'form' => $form,
457
- 'form_front' => $form_front,
458
- 'counter' => $counter,
459
- 'label_order' => $label_order,
460
- 'label_order_current' => $label_order_current,
461
- 'pagination' => $pagination,
462
- 'show_title' => $show_title,
463
- 'show_numbers' => $show_numbers,
464
- 'public_key' => $public_key,
465
- 'private_key' => $private_key,
466
- 'recaptcha_theme' => $recaptcha_theme,
467
- ), array('id' => $id));
468
- if ($save !== FALSE) {
469
- return 1;
470
- }
471
- else {
472
- return 2;
473
- }
474
- }
475
-
476
- public function save_db_as_copy_old() {
477
- global $wpdb;
478
- // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
479
- $id = WDW_FMC_Library::get('current_id', 0);
480
- $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
481
- $title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
482
- $form = (isset($_POST['form']) ? stripslashes($_POST['form']) : '');
483
- $form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
484
- $counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
485
- $label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
486
- $pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
487
- $show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
488
- $show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
489
- $public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
490
- $private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
491
- $recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
492
-
493
- $save = $wpdb->insert($wpdb->prefix . 'formmaker', array(
494
- 'title' => $title,
495
- 'mail' => $row->mail,
496
- 'form' => $form,
497
- 'form_front' => $form_front,
498
- 'theme' => $row->theme,
499
- 'counter' => $counter,
500
- 'label_order' => $label_order,
501
- 'pagination' => $pagination,
502
- 'show_title' => $show_title,
503
- 'show_numbers' => $show_numbers,
504
- 'public_key' => $public_key,
505
- 'private_key' => $private_key,
506
- 'recaptcha_theme' => $recaptcha_theme,
507
- 'javascript' => $row->javascript,
508
- 'script1' => $row->script1,
509
- 'script2' => $row->script2,
510
- 'script_user1' => $row->script_user1,
511
- 'script_user2' => $row->script_user2,
512
- 'submit_text' => $row->submit_text,
513
- 'url' => $row->url,
514
- 'article_id' => $row->article_id,
515
- 'submit_text_type' => $row->submit_text_type,
516
- 'script_mail' => $row->script_mail,
517
- 'script_mail_user' => $row->script_mail_user,
518
- 'paypal_mode' => $row->paypal_mode,
519
- 'checkout_mode' => $row->checkout_mode,
520
- 'paypal_email' => $row->paypal_email,
521
- 'payment_currency' => $row->payment_currency,
522
- 'tax' => $row->tax,
523
- 'label_order_current' => $row->label_order_current,
524
- 'from_mail' => $row->from_mail,
525
- 'from_name' => $row->from_name,
526
- 'reply_to_user' => $row->reply_to_user,
527
- 'mail_from_name_user' => $row->mail_from_name_user,
528
- 'mail_from_user' => $row->mail_from_user,
529
- 'custom_front' => $row->custom_front,
530
- 'autogen_layout' => $row->autogen_layout,
531
- 'send_to' => $row->send_to,
532
- 'reply_to' => $row->reply_to,
533
- 'requiredmark' => $row->requiredmark,
534
- 'sendemail' => $row->sendemail,
535
- 'savedb' => $row->savedb,
536
- 'form_fields' => $row->form_fields,
537
- 'published' => $row->published
538
- ), array(
539
- '%s',
540
- '%s',
541
- '%s',
542
- '%s',
543
- '%d',
544
- '%d',
545
- '%s',
546
- '%s',
547
- '%s',
548
- '%s',
549
- '%s',
550
- '%s',
551
- '%s',
552
- '%s',
553
- '%s',
554
- '%s',
555
- '%s',
556
- '%s',
557
- '%s',
558
- '%s',
559
- '%s',
560
- '%d',
561
- '%s',
562
- '%s',
563
- '%d',
564
- '%s',
565
- '%s',
566
- '%s',
567
- '%s',
568
- '%s',
569
- '%s',
570
- '%s',
571
- '%s',
572
- '%s',
573
- '%s',
574
- '%s',
575
- '%d',
576
- '%s',
577
- '%s',
578
- '%s',
579
- '%d',
580
- '%d',
581
- '%s',
582
- '%d'
583
- ));
584
- $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
585
- update_option('contact_form_forms', ((get_option('contact_form_forms')) ? (get_option('contact_form_forms')) . ',' . $id : $id));
586
- $wpdb->insert($wpdb->prefix . 'formmaker_views', array(
587
- 'form_id' => $id,
588
- 'views' => 0
589
- ), array(
590
- '%d',
591
- '%d'
592
- ));
593
- if ($save !== FALSE) {
594
- return 1;
595
- }
596
- else {
597
- return 2;
598
- }
599
- }
600
-
601
- public function save_as_copy() {
602
- $message = $this->save_db_as_copy();
603
- // $this->display();
604
- $page = WDW_FMC_Library::get('page');
605
- WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
606
- }
607
-
608
- public function save() {
609
- $message = $this->save_db();
610
- // $this->display();
611
- $page = WDW_FMC_Library::get('page');
612
- WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
613
- }
614
-
615
- public function apply() {
616
- $message = $this->save_db();
617
- // $this->edit();
618
- global $wpdb;
619
- $id = (int) $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
620
- $current_id = WDW_FMC_Library::get('current_id', $id);
621
- $page = WDW_FMC_Library::get('page');
622
- WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
623
- }
624
-
625
- public function save_db() {
626
- global $wpdb;
627
- $javascript = "// before form is load
628
- function before_load() {
629
- }
630
- // before form submit
631
- function before_submit() {
632
- }
633
- // before form reset
634
- function before_reset() {
635
- }";
636
- // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
637
- $id = WDW_FMC_Library::get('current_id', 0);
638
- $title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
639
- $form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
640
- $counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
641
- $label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
642
- $pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
643
- $show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
644
- $show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
645
- $public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
646
- $private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
647
- $recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
648
- $label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
649
- $form_fields = (isset($_POST['form_fields']) ? stripslashes($_POST['form_fields']) : '');
650
-
651
- if ($id != 0) {
652
- $save = $wpdb->update($wpdb->prefix . 'formmaker', array(
653
- 'title' => $title,
654
- 'form_front' => $form_front,
655
- 'counter' => $counter,
656
- 'label_order' => $label_order,
657
- 'label_order_current' => $label_order_current,
658
- 'pagination' => $pagination,
659
- 'show_title' => $show_title,
660
- 'show_numbers' => $show_numbers,
661
- 'public_key' => $public_key,
662
- 'private_key' => $private_key,
663
- 'recaptcha_theme' => $recaptcha_theme,
664
- 'form_fields' => $form_fields,
665
- ), array('id' => $id));
666
- }
667
- else {
668
- $save = $wpdb->insert($wpdb->prefix . 'formmaker', array(
669
- 'title' => $title,
670
- 'mail' => '',
671
- 'form_front' => $form_front,
672
- 'theme' => $wpdb->get_var("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE css LIKE '%.wdform_section%'"),
673
- 'counter' => $counter,
674
- 'label_order' => $label_order,
675
- 'pagination' => $pagination,
676
- 'show_title' => $show_title,
677
- 'show_numbers' => $show_numbers,
678
- 'public_key' => $public_key,
679
- 'private_key' => $private_key,
680
- 'recaptcha_theme' => $recaptcha_theme,
681
- 'javascript' => $javascript,
682
- 'submit_text' => '',
683
- 'url' => '',
684
- 'article_id' => 0,
685
- 'submit_text_type' => 0,
686
- 'script_mail' => '%all%',
687
- 'script_mail_user' => '%all%',
688
- 'label_order_current' => $label_order_current,
689
- 'tax' => 0,
690
- 'payment_currency' => '',
691
- 'paypal_email' => '',
692
- 'checkout_mode' => 'testmode',
693
- 'paypal_mode' => 0,
694
- 'published' => 1,
695
- 'form_fields' => $form_fields,
696
- 'savedb' => 1,
697
- 'sendemail' => 1,
698
- 'requiredmark' => '*',
699
- 'from_mail' => '',
700
- 'from_name' => '',
701
- 'reply_to' => '',
702
- 'send_to' => '',
703
- 'autogen_layout' => 1,
704
- 'custom_front' => '',
705
- 'mail_from_user' => '',
706
- 'mail_from_name_user' => '',
707
- 'reply_to_user' => '',
708
- 'condition' => '',
709
- 'mail_cc' => '',
710
- 'mail_cc_user' => '',
711
- 'mail_bcc' => '',
712
- 'mail_bcc_user' => '',
713
- 'mail_subject' => '',
714
- 'mail_subject_user' => '',
715
- 'mail_mode' => 1,
716
- 'mail_mode_user' => 1,
717
- 'mail_attachment' => 1,
718
- 'mail_attachment_user' => 1,
719
- ), array(
720
- '%s',
721
- '%s',
722
- '%s',
723
- '%d',
724
- '%d',
725
- '%s',
726
- '%s',
727
- '%s',
728
- '%s',
729
- '%s',
730
- '%s',
731
- '%s',
732
- '%s',
733
- '%s',
734
- '%s',
735
- '%d',
736
- '%d',
737
- '%s',
738
- '%s',
739
- '%s',
740
- '%s',
741
- '%s',
742
- '%s',
743
- '%s',
744
- '%d',
745
- '%d',
746
- '%s',
747
- '%d',
748
- '%d',
749
- '%s',
750
- '%s',
751
- '%s',
752
- '%s',
753
- '%s',
754
- '%d',
755
- '%s',
756
- '%s',
757
- '%s',
758
- '%s',
759
- '%s',
760
- '%s',
761
- '%s',
762
- '%s',
763
- '%s',
764
- '%s',
765
- '%s',
766
- '%d',
767
- '%d',
768
- '%d',
769
- '%d',
770
- ));
771
- $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
772
- update_option('contact_form_forms', ((get_option('contact_form_forms')) ? (get_option('contact_form_forms')) . ',' . $id : $id));
773
- // $_POST['current_id'] = $id;
774
- $wpdb->insert($wpdb->prefix . 'formmaker_views', array(
775
- 'form_id' => $id,
776
- 'views' => 0
777
- ), array(
778
- '%d',
779
- '%d'
780
- ));
781
- }
782
- if ($save !== FALSE) {
783
- return 1;
784
- }
785
- else {
786
- return 2;
787
- }
788
- }
789
-
790
- public function save_db_as_copy() {
791
- global $wpdb;
792
- // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
793
- $id = WDW_FMC_Library::get('current_id', 0);
794
- $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
795
- $title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
796
- $form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
797
- $counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
798
- $label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
799
- $label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
800
- $pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
801
- $show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
802
- $show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
803
- $public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
804
- $private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
805
- $recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
806
- $form_fields = (isset($_POST['form_fields']) ? stripslashes($_POST['form_fields']) : '');
807
-
808
- $save = $wpdb->insert($wpdb->prefix . 'formmaker', array(
809
- 'title' => $title,
810
- 'mail' => $row->mail,
811
- 'form_front' => $form_front,
812
- 'theme' => $row->theme,
813
- 'counter' => $counter,
814
- 'label_order' => $label_order,
815
- 'pagination' => $pagination,
816
- 'show_title' => $show_title,
817
- 'show_numbers' => $show_numbers,
818
- 'public_key' => $public_key,
819
- 'private_key' => $private_key,
820
- 'recaptcha_theme' => $recaptcha_theme,
821
- 'javascript' => $row->javascript,
822
- 'submit_text' => $row->submit_text,
823
- 'url' => $row->url,
824
- 'article_id' => $row->article_id,
825
- 'submit_text_type' => $row->submit_text_type,
826
- 'script_mail' => $row->script_mail,
827
- 'script_mail_user' => $row->script_mail_user,
828
- 'label_order_current' => $label_order_current,
829
- 'tax' => $row->tax,
830
- 'payment_currency' => $row->payment_currency,
831
- 'paypal_email' => $row->paypal_email,
832
- 'checkout_mode' => $row->checkout_mode,
833
- 'paypal_mode' => $row->paypal_mode,
834
- 'published' => $row->published,
835
- 'form_fields' => $form_fields,
836
- 'savedb' => $row->savedb,
837
- 'sendemail' => $row->sendemail,
838
- 'requiredmark' => $row->requiredmark,
839
- 'from_mail' => $row->from_mail,
840
- 'from_name' => $row->from_name,
841
- 'reply_to' => $row->reply_to,
842
- 'send_to' => $row->send_to,
843
- 'autogen_layout' => $row->autogen_layout,
844
- 'custom_front' => $row->custom_front,
845
- 'mail_from_user' => $row->mail_from_user,
846
- 'mail_from_name_user' => $row->mail_from_name_user,
847
- 'reply_to_user' => $row->reply_to_user,
848
- 'condition' => $row->condition,
849
- 'mail_cc' => $row->mail_cc,
850
- 'mail_cc_user' => $row->mail_cc_user,
851
- 'mail_bcc' => $row->mail_bcc,
852
- 'mail_bcc_user' => $row->mail_bcc_user,
853
- 'mail_subject' => $row->mail_subject,
854
- 'mail_subject_user' => $row->mail_subject_user,
855
- 'mail_mode' => $row->mail_mode,
856
- 'mail_mode_user' => $row->mail_mode_user,
857
- 'mail_attachment' => $row->mail_attachment,
858
- 'mail_attachment_user' => $row->mail_attachment_user,
859
- ), array(
860
- '%s',
861
- '%s',
862
- '%s',
863
- '%d',
864
- '%d',
865
- '%s',
866
- '%s',
867
- '%s',
868
- '%s',
869
- '%s',
870
- '%s',
871
- '%s',
872
- '%s',
873
- '%s',
874
- '%s',
875
- '%d',
876
- '%d',
877
- '%s',
878
- '%s',
879
- '%s',
880
- '%s',
881
- '%s',
882
- '%s',
883
- '%s',
884
- '%d',
885
- '%d',
886
- '%s',
887
- '%d',
888
- '%d',
889
- '%s',
890
- '%s',
891
- '%s',
892
- '%s',
893
- '%s',
894
- '%d',
895
- '%s',
896
- '%s',
897
- '%s',
898
- '%s',
899
- '%s',
900
- '%s',
901
- '%s',
902
- '%s',
903
- '%s',
904
- '%s',
905
- '%s',
906
- '%d',
907
- '%d',
908
- '%d',
909
- '%d',
910
- ));
911
- $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
912
- update_option('contact_form_forms', ((get_option('contact_form_forms')) ? (get_option('contact_form_forms')) . ',' . $id : $id));
913
- $wpdb->insert($wpdb->prefix . 'formmaker_views', array(
914
- 'form_id' => $id,
915
- 'views' => 0
916
- ), array(
917
- '%d',
918
- '%d'
919
- ));
920
- if ($save !== FALSE) {
921
- return 1;
922
- }
923
- else {
924
- return 2;
925
- }
926
- }
927
-
928
- public function delete($id) {
929
- global $wpdb;
930
- $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id);
931
- if ($wpdb->query($query)) {
932
- $arr = explode(',', get_option('contact_form_forms'));
933
- $arr = array_diff($arr, array($id));
934
- $arr = implode(',', $arr);
935
- update_option('contact_form_forms', $arr);
936
- $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="%d"', $id));
937
- $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id="%d"', $id));
938
- $message = 3;
939
- }
940
- else {
941
- $message = 2;
942
- }
943
- // $this->display();
944
- $page = WDW_FMC_Library::get('page');
945
- WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
946
- }
947
-
948
- public function delete_all() {
949
- global $wpdb;
950
- $flag = FALSE;
951
- $isDefault = FALSE;
952
- $form_ids_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker');
953
- foreach ($form_ids_col as $form_id) {
954
- if (isset($_POST['check_' . $form_id])) {
955
- $flag = TRUE;
956
- $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $form_id));
957
- $arr = explode(',', get_option('contact_form_forms'));
958
- $arr = array_diff($arr, array($form_id));
959
- $arr = implode(',', $arr);
960
- update_option('contact_form_forms', $arr);
961
- $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="%d"', $form_id));
962
- $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id="%d"', $form_id));
963
- }
964
- }
965
- if ($flag) {
966
- $message = 5;
967
- }
968
- else {
969
- $message = 6;
970
- }
971
- // $this->display();
972
- $page = WDW_FMC_Library::get('page');
973
- WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
974
- }
975
-
976
- ////////////////////////////////////////////////////////////////////////////////////////
977
- // Getters & Setters //
978
- ////////////////////////////////////////////////////////////////////////////////////////
979
- ////////////////////////////////////////////////////////////////////////////////////////
980
- // Private Methods //
981
- ////////////////////////////////////////////////////////////////////////////////////////
982
- ////////////////////////////////////////////////////////////////////////////////////////
983
- // Listeners //
984
- ////////////////////////////////////////////////////////////////////////////////////////
985
  }
1
+ <?php
2
+
3
+ class FMControllerManage_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ // $task = ((isset($_POST['task'])) ? esc_html($_POST['task']) : '');
23
+ // $id = ((isset($_POST['current_id'])) ? esc_html($_POST['current_id']) : 0);
24
+ $task = WDW_FMC_Library::get('task');
25
+ $id = WDW_FMC_Library::get('current_id', 0);
26
+ $message = WDW_FMC_Library::get('message');
27
+ echo WDW_FMC_Library::message_id($message);
28
+ if (method_exists($this, $task)) {
29
+ $this->$task($id);
30
+ }
31
+ else {
32
+ $this->display();
33
+ }
34
+ }
35
+
36
+ public function display() {
37
+ require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
38
+ $model = new FMModelManage_fmc();
39
+
40
+ require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
41
+ $view = new FMViewManage_fmc($model);
42
+ $view->display();
43
+ }
44
+
45
+ public function add() {
46
+ require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
47
+ $model = new FMModelManage_fmc();
48
+
49
+ require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
50
+ $view = new FMViewManage_fmc($model);
51
+ $view->edit(0);
52
+ }
53
+
54
+ public function edit() {
55
+ require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
56
+ $model = new FMModelManage_fmc();
57
+
58
+ require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
59
+ $view = new FMViewManage_fmc($model);
60
+ // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
61
+ $id = WDW_FMC_Library::get('current_id', 0);
62
+ $view->edit($id);
63
+ }
64
+
65
+ public function edit_old() {
66
+ require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
67
+ $model = new FMModelManage_fmc();
68
+
69
+ require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
70
+ $view = new FMViewManage_fmc($model);
71
+ // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
72
+ $id = WDW_FMC_Library::get('current_id', 0);
73
+ // var_dump('s');
74
+ $view->edit_old($id);
75
+ }
76
+
77
+ public function form_options_old() {
78
+ if (!isset($_GET['task'])) {
79
+ $this->save_db();
80
+ }
81
+ require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
82
+ $model = new FMModelManage_fmc();
83
+
84
+ require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
85
+ $view = new FMViewManage_fmc($model);
86
+ // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
87
+ global $wpdb;
88
+ $id = WDW_FMC_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
89
+ $view->form_options_old($id);
90
+ }
91
+
92
+ public function save_options_old() {
93
+ $message = $this->save_db_options_old();
94
+ // $this->edit_old();
95
+ $page = WDW_FMC_Library::get('page');
96
+ $current_id = WDW_FMC_Library::get('current_id', 0);
97
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'edit_old', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
98
+ }
99
+
100
+ public function apply_options_old() {
101
+ $message = $this->save_db_options_old();
102
+ require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
103
+ $model = new FMModelManage_fmc();
104
+
105
+ require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
106
+ $view = new FMViewManage_fmc($model);
107
+ // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
108
+ // $view->form_options_old($id);
109
+ $page = WDW_FMC_Library::get('page');
110
+ $current_id = WDW_FMC_Library::get('current_id', 0);
111
+ $fieldset_id = WDW_FMC_Library::get('fieldset_id', 'general');
112
+ WDW_FMC_Library::spider_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')));
113
+ }
114
+
115
+ public function save_db_options_old() {
116
+ $javascript = "// Before the form is loaded.
117
+ function before_load() {
118
+
119
+ }
120
+ // Before form submit.
121
+ function before_submit() {
122
+
123
+ }
124
+ // Before form reset.
125
+ function before_reset() {
126
+
127
+ }";
128
+ global $wpdb;
129
+ // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
130
+ $id = WDW_FMC_Library::get('current_id', 0);
131
+ $mail = (isset($_POST['mail']) ? esc_html(stripslashes($_POST['mail'])) : '');
132
+ $theme = (isset($_POST['theme']) ? esc_html(stripslashes($_POST['theme'])) : 1);
133
+ $javascript = (isset($_POST['javascript']) ? stripslashes($_POST['javascript']) : $javascript);
134
+ $script1 = (isset($_POST['script1']) ? esc_html(stripslashes($_POST['script1'])) : '');
135
+ $script2 = (isset($_POST['script2']) ? esc_html(stripslashes($_POST['script2'])) : '');
136
+ $script_user1 = (isset($_POST['script_user1']) ? esc_html(stripslashes($_POST['script_user1'])) : '');
137
+ $script_user2 = (isset($_POST['script_user2']) ? esc_html(stripslashes($_POST['script_user2'])) : '');
138
+ $submit_text = (isset($_POST['submit_text']) ? stripslashes($_POST['submit_text']) : '');
139
+ $url = (isset($_POST['url']) ? esc_html(stripslashes($_POST['url'])) : '');
140
+ $script_mail = (isset($_POST['script_mail']) ? stripslashes($_POST['script_mail']) : '%all%');
141
+ $script_mail_user = (isset($_POST['script_mail_user']) ? stripslashes($_POST['script_mail_user']) : '%all%');
142
+ $label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
143
+ $tax = (isset($_POST['tax']) ? esc_html(stripslashes($_POST['tax'])) : 0);
144
+ $payment_currency = (isset($_POST['payment_currency']) ? stripslashes($_POST['payment_currency']) : '');
145
+ $paypal_email = (isset($_POST['paypal_email']) ? esc_html(stripslashes($_POST['paypal_email'])) : '');
146
+ $checkout_mode = (isset($_POST['checkout_mode']) ? esc_html(stripslashes($_POST['checkout_mode'])) : 'testmode');
147
+ $paypal_mode = (isset($_POST['paypal_mode']) ? esc_html(stripslashes($_POST['paypal_mode'])) : 0);
148
+ $from_mail = (isset($_POST['from_mail']) ? esc_html(stripslashes($_POST['from_mail'])) : '');
149
+ $from_name = (isset($_POST['from_name']) ? esc_html(stripslashes($_POST['from_name'])) : '');
150
+ if (isset($_POST['submit_text_type'])) {
151
+ $submit_text_type = esc_html(stripslashes($_POST['submit_text_type']));
152
+ if ($submit_text_type == 5) {
153
+ $article_id = (isset($_POST['page_name']) ? esc_html(stripslashes($_POST['page_name'])) : 0);
154
+ }
155
+ else {
156
+ $article_id = (isset($_POST['post_name']) ? esc_html(stripslashes($_POST['post_name'])) : 0);
157
+ }
158
+ }
159
+ else {
160
+ $submit_text_type = 0;
161
+ $article_id = 0;
162
+ }
163
+ $save = $wpdb->update($wpdb->prefix . 'formmaker', array(
164
+ 'mail' => $mail,
165
+ 'theme' => $theme,
166
+ 'javascript' => $javascript,
167
+ 'submit_text' => $submit_text,
168
+ 'url' => $url,
169
+ 'submit_text_type' => $submit_text_type,
170
+ 'script_mail' => $script_mail,
171
+ 'script_mail_user' => $script_mail_user,
172
+ 'article_id' => $article_id,
173
+ 'paypal_mode' => $paypal_mode,
174
+ 'checkout_mode' => $checkout_mode,
175
+ 'paypal_email' => $paypal_email,
176
+ 'payment_currency' => $payment_currency,
177
+ 'tax' => $tax,
178
+ 'from_mail' => $from_mail,
179
+ 'from_name' => $from_name,
180
+ ), array('id' => $id));
181
+ if ($save !== FALSE) {
182
+ return 8;
183
+ }
184
+ else {
185
+ return 2;
186
+ }
187
+ }
188
+
189
+ public function cancel_options_old() {
190
+ $this->edit_old();
191
+ }
192
+
193
+ public function form_layout() {
194
+ if (!isset($_GET['task'])) {
195
+ $this->save_db();
196
+ }
197
+ require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
198
+ $model = new FMModelManage_fmc();
199
+
200
+ require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
201
+ $view = new FMViewManage_fmc($model);
202
+ // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
203
+ global $wpdb;
204
+ $id = WDW_FMC_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
205
+ $view->form_layout($id);
206
+ }
207
+
208
+ public function save_layout() {
209
+ $message = $this->save_db_layout();
210
+ // $this->edit();
211
+ $page = WDW_FMC_Library::get('page');
212
+ $current_id = WDW_FMC_Library::get('current_id', 0);
213
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
214
+ }
215
+
216
+ public function apply_layout() {
217
+ $message = $this->save_db_layout();
218
+ require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
219
+ $model = new FMModelManage_fmc();
220
+
221
+ require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
222
+ $view = new FMViewManage_fmc($model);
223
+ // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
224
+ $page = WDW_FMC_Library::get('page');
225
+ $current_id = WDW_FMC_Library::get('current_id', 0);
226
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'form_layout', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
227
+ // $view->form_layout($id);
228
+ }
229
+
230
+ public function save_db_layout() {
231
+ global $wpdb;
232
+ // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
233
+ $id = WDW_FMC_Library::get('current_id', 0);
234
+ $custom_front = (isset($_POST['custom_front']) ? stripslashes($_POST['custom_front']) : '');
235
+ $autogen_layout = (isset($_POST['autogen_layout']) ? 1 : 0);
236
+ $save = $wpdb->update($wpdb->prefix . 'formmaker', array(
237
+ 'custom_front' => $custom_front,
238
+ 'autogen_layout' => $autogen_layout
239
+ ), array('id' => $id));
240
+ if ($save !== FALSE) {
241
+ return 1;
242
+ }
243
+ else {
244
+ return 2;
245
+ }
246
+ }
247
+
248
+ public function form_options() {
249
+ if (!isset($_GET['task'])) {
250
+ $this->save_db();
251
+ }
252
+ require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
253
+ $model = new FMModelManage_fmc();
254
+
255
+ require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
256
+ $view = new FMViewManage_fmc($model);
257
+ // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
258
+ global $wpdb;
259
+ $id = WDW_FMC_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
260
+ $view->form_options($id);
261
+ }
262
+
263
+ public function save_options() {
264
+ $message = $this->save_db_options();
265
+ // $this->edit();
266
+ $page = WDW_FMC_Library::get('page');
267
+ $current_id = WDW_FMC_Library::get('current_id', 0);
268
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
269
+ }
270
+
271
+ public function apply_options() {
272
+ $message = $this->save_db_options();
273
+ require_once WD_FMC_DIR . "/admin/models/FMModelManage_fmc.php";
274
+ $model = new FMModelManage_fmc();
275
+
276
+ require_once WD_FMC_DIR . "/admin/views/FMViewManage_fmc.php";
277
+ $view = new FMViewManage_fmc($model);
278
+ // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
279
+ // $view->form_options($id);
280
+ $page = WDW_FMC_Library::get('page');
281
+ $current_id = WDW_FMC_Library::get('current_id', 0);
282
+ $fieldset_id = WDW_FMC_Library::get('fieldset_id', 'general');
283
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'form_options', 'current_id' => $current_id, 'message' => $message, 'fieldset_id' => $fieldset_id), admin_url('admin.php')));
284
+ }
285
+
286
+ public function cancel_options() {
287
+ $this->edit();
288
+ }
289
+
290
+ public function save_db_options() {
291
+ $javascript = "// Before the form is loaded.
292
+ function before_load() {
293
+
294
+ }
295
+ // Before form submit.
296
+ function before_submit() {
297
+
298
+ }
299
+ // Before form reset.
300
+ function before_reset() {
301
+
302
+ }";
303
+ global $wpdb;
304
+ // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
305
+ $id = WDW_FMC_Library::get('current_id', 0);
306
+ $published = (isset($_POST['published']) ? esc_html(stripslashes($_POST['published'])) : 1);
307
+ $savedb = (isset($_POST['savedb']) ? esc_html(stripslashes($_POST['savedb'])) : 1);
308
+ $theme = ((isset($_POST['theme']) && (esc_html($_POST['theme']) != 0)) ? esc_html(stripslashes($_POST['theme'])) : $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker_themes"));
309
+ $requiredmark = (isset($_POST['requiredmark']) ? esc_html(stripslashes($_POST['requiredmark'])) : '*');
310
+ $sendemail = (isset($_POST['sendemail']) ? esc_html(stripslashes($_POST['sendemail'])) : 1);
311
+ $mail = (isset($_POST['mail']) ? esc_html(stripslashes($_POST['mail'])) : '');
312
+ if (isset($_POST['mailToAdd']) && esc_html(stripslashes($_POST['mailToAdd'])) != '') {
313
+ $mail .= esc_html(stripslashes($_POST['mailToAdd'])) . ',';
314
+ }
315
+ $from_mail = (isset($_POST['from_mail']) ? esc_html(stripslashes($_POST['from_mail'])) : '');
316
+ $from_name = (isset($_POST['from_name']) ? esc_html(stripslashes($_POST['from_name'])) : '');
317
+ $reply_to = (isset($_POST['reply_to']) ? esc_html(stripslashes($_POST['reply_to'])) : '');
318
+ if ($from_mail == "other") {
319
+ $from_mail = (isset($_POST['mail_from_other']) ? esc_html(stripslashes($_POST['mail_from_other'])) : '');
320
+ }
321
+ if ($reply_to == "other") {
322
+ $reply_to = (isset($_POST['reply_to_other']) ? esc_html(stripslashes($_POST['reply_to_other'])) : '');
323
+ }
324
+ $script_mail = (isset($_POST['script_mail']) ? stripslashes($_POST['script_mail']) : '%all%');
325
+ $mail_from_user = (isset($_POST['mail_from_user']) ? esc_html(stripslashes($_POST['mail_from_user'])) : '');
326
+ $mail_from_name_user = (isset($_POST['mail_from_name_user']) ? esc_html(stripslashes($_POST['mail_from_name_user'])) : '');
327
+ $reply_to_user = (isset($_POST['reply_to_user']) ? esc_html(stripslashes($_POST['reply_to_user'])) : '');
328
+ $condition = (isset($_POST['condition']) ? esc_html(stripslashes($_POST['condition'])) : '');
329
+ $mail_cc = (isset($_POST['mail_cc']) ? esc_html(stripslashes($_POST['mail_cc'])) : '');
330
+ $mail_cc_user = (isset($_POST['mail_cc_user']) ? esc_html(stripslashes($_POST['mail_cc_user'])) : '');
331
+ $mail_bcc = (isset($_POST['mail_bcc']) ? esc_html(stripslashes($_POST['mail_bcc'])) : '');
332
+ $mail_bcc_user = (isset($_POST['mail_bcc_user']) ? esc_html(stripslashes($_POST['mail_bcc_user'])) : '');
333
+ $mail_subject = (isset($_POST['mail_subject']) ? esc_html(stripslashes($_POST['mail_subject'])) : '');
334
+ $mail_subject_user = (isset($_POST['mail_subject_user']) ? esc_html(stripslashes($_POST['mail_subject_user'])) : '');
335
+ $mail_mode = (isset($_POST['mail_mode']) ? esc_html(stripslashes($_POST['mail_mode'])) : 1);
336
+ $mail_mode_user = (isset($_POST['mail_mode_user']) ? esc_html(stripslashes($_POST['mail_mode_user'])) : 1);
337
+ $mail_attachment = (isset($_POST['mail_attachment']) ? esc_html(stripslashes($_POST['mail_attachment'])) : 1);
338
+ $mail_attachment_user = (isset($_POST['mail_attachment_user']) ? esc_html(stripslashes($_POST['mail_attachment_user'])) : 1);
339
+ $script_mail_user = (isset($_POST['script_mail_user']) ? stripslashes($_POST['script_mail_user']) : '%all%');
340
+ $submit_text = (isset($_POST['submit_text']) ? stripslashes($_POST['submit_text']) : '');
341
+ $url = (isset($_POST['url']) ? esc_html(stripslashes($_POST['url'])) : '');
342
+ $tax = (isset($_POST['tax']) ? esc_html(stripslashes($_POST['tax'])) : 0);
343
+ $payment_currency = (isset($_POST['payment_currency']) ? stripslashes($_POST['payment_currency']) : '');
344
+ $paypal_email = (isset($_POST['paypal_email']) ? esc_html(stripslashes($_POST['paypal_email'])) : '');
345
+ $checkout_mode = (isset($_POST['checkout_mode']) ? esc_html(stripslashes($_POST['checkout_mode'])) : 'testmode');
346
+ $paypal_mode = (isset($_POST['paypal_mode']) ? esc_html(stripslashes($_POST['paypal_mode'])) : 0);
347
+ $javascript = (isset($_POST['javascript']) ? stripslashes($_POST['javascript']) : $javascript);
348
+ $send_to = '';
349
+ for ($i = 0; $i < 20; $i++) {
350
+ if (isset($_POST['send_to' . $i])) {
351
+ $send_to .= '*' . esc_html(stripslashes($_POST['send_to' . $i])) . '*';
352
+ }
353
+ }
354
+ if (isset($_POST['submit_text_type'])) {
355
+ $submit_text_type = esc_html(stripslashes($_POST['submit_text_type']));
356
+ if ($submit_text_type == 5) {
357
+ $article_id = (isset($_POST['page_name']) ? esc_html(stripslashes($_POST['page_name'])) : 0);
358
+ }
359
+ else {
360
+ $article_id = (isset($_POST['post_name']) ? esc_html(stripslashes($_POST['post_name'])) : 0);
361
+ }
362
+ }
363
+ else {
364
+ $submit_text_type = 0;
365
+ $article_id = 0;
366
+ }
367
+ $save = $wpdb->update($wpdb->prefix . 'formmaker', array(
368
+ 'published' => $published,
369
+ 'savedb' => $savedb,
370
+ 'theme' => $theme,
371
+ 'requiredmark' => $requiredmark,
372
+ 'sendemail' => $sendemail,
373
+ 'mail' => $mail,
374
+ 'from_mail' => $from_mail,
375
+ 'from_name' => $from_name,
376
+ 'reply_to' => $reply_to,
377
+ 'script_mail' => $script_mail,
378
+ 'mail_from_user' => $mail_from_user,
379
+ 'mail_from_name_user' => $mail_from_name_user,
380
+ 'reply_to_user' => $reply_to_user,
381
+ 'condition' => $condition,
382
+ 'mail_cc' => $mail_cc,
383
+ 'mail_cc_user' => $mail_cc_user,
384
+ 'mail_bcc' => $mail_bcc,
385
+ 'mail_bcc_user' => $mail_bcc_user,
386
+ 'mail_subject' => $mail_subject,
387
+ 'mail_subject_user' => $mail_subject_user,
388
+ 'mail_mode' => $mail_mode,
389
+ 'mail_mode_user' => $mail_mode_user,
390
+ 'mail_attachment' => $mail_attachment,
391
+ 'mail_attachment_user' => $mail_attachment_user,
392
+ 'script_mail_user' => $script_mail_user,
393
+ 'submit_text' => $submit_text,
394
+ 'url' => $url,
395
+ 'submit_text_type' => $submit_text_type,
396
+ 'article_id' => $article_id,
397
+ 'tax' => $tax,
398
+ 'payment_currency' => $payment_currency,
399
+ 'paypal_email' => $paypal_email,
400
+ 'checkout_mode' => $checkout_mode,
401
+ 'paypal_mode' => $paypal_mode,
402
+ 'javascript' => $javascript,
403
+ 'send_to' => $send_to,
404
+ ), array('id' => $id));
405
+ if ($save !== FALSE) {
406
+ return 8;
407
+ }
408
+ else {
409
+ return 2;
410
+ }
411
+ }
412
+
413
+ public function save_as_copy_old() {
414
+ $message = $this->save_db_as_copy_old();
415
+ // $this->display();
416
+ $page = WDW_FMC_Library::get('page');
417
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
418
+ }
419
+
420
+ public function save_old() {
421
+ $message = $this->save_db_old();
422
+ // $this->display();
423
+ $page = WDW_FMC_Library::get('page');
424
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
425
+ }
426
+
427
+ public function apply_old() {
428
+ global $wpdb;
429
+ $message = $this->save_db_old();
430
+ // $this->edit_old();
431
+ $id = (int) $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
432
+ $current_id = WDW_FMC_Library::get('current_id', $id);
433
+ $page = WDW_FMC_Library::get('page');
434
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'edit_old', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
435
+ }
436
+
437
+ public function save_db_old() {
438
+ global $wpdb;
439
+ // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
440
+ $id = WDW_FMC_Library::get('current_id', 0);
441
+ $title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
442
+ $form = (isset($_POST['form']) ? stripslashes($_POST['form']) : '');
443
+ $form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
444
+ $counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
445
+ $label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
446
+ $label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
447
+ $pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
448
+ $show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
449
+ $show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
450
+ $public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
451
+ $private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
452
+ $recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
453
+
454
+ $save = $wpdb->update($wpdb->prefix . 'formmaker', array(
455
+ 'title' => $title,
456
+ 'form' => $form,
457
+ 'form_front' => $form_front,
458
+ 'counter' => $counter,
459
+ 'label_order' => $label_order,
460
+ 'label_order_current' => $label_order_current,
461
+ 'pagination' => $pagination,
462
+ 'show_title' => $show_title,
463
+ 'show_numbers' => $show_numbers,
464
+ 'public_key' => $public_key,
465
+ 'private_key' => $private_key,
466
+ 'recaptcha_theme' => $recaptcha_theme,
467
+ ), array('id' => $id));
468
+ if ($save !== FALSE) {
469
+ return 1;
470
+ }
471
+ else {
472
+ return 2;
473
+ }
474
+ }
475
+
476
+ public function save_db_as_copy_old() {
477
+ global $wpdb;
478
+ // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
479
+ $id = WDW_FMC_Library::get('current_id', 0);
480
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
481
+ $title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
482
+ $form = (isset($_POST['form']) ? stripslashes($_POST['form']) : '');
483
+ $form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
484
+ $counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
485
+ $label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
486
+ $pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
487
+ $show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
488
+ $show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
489
+ $public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
490
+ $private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
491
+ $recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
492
+
493
+ $save = $wpdb->insert($wpdb->prefix . 'formmaker', array(
494
+ 'title' => $title,
495
+ 'mail' => $row->mail,
496
+ 'form' => $form,
497
+ 'form_front' => $form_front,
498
+ 'theme' => $row->theme,
499
+ 'counter' => $counter,
500
+ 'label_order' => $label_order,
501
+ 'pagination' => $pagination,
502
+ 'show_title' => $show_title,
503
+ 'show_numbers' => $show_numbers,
504
+ 'public_key' => $public_key,
505
+ 'private_key' => $private_key,
506
+ 'recaptcha_theme' => $recaptcha_theme,
507
+ 'javascript' => $row->javascript,
508
+ 'script1' => $row->script1,
509
+ 'script2' => $row->script2,
510
+ 'script_user1' => $row->script_user1,
511
+ 'script_user2' => $row->script_user2,
512
+ 'submit_text' => $row->submit_text,
513
+ 'url' => $row->url,
514
+ 'article_id' => $row->article_id,
515
+ 'submit_text_type' => $row->submit_text_type,
516
+ 'script_mail' => $row->script_mail,
517
+ 'script_mail_user' => $row->script_mail_user,
518
+ 'paypal_mode' => $row->paypal_mode,
519
+ 'checkout_mode' => $row->checkout_mode,
520
+ 'paypal_email' => $row->paypal_email,
521
+ 'payment_currency' => $row->payment_currency,
522
+ 'tax' => $row->tax,
523
+ 'label_order_current' => $row->label_order_current,
524
+ 'from_mail' => $row->from_mail,
525
+ 'from_name' => $row->from_name,
526
+ 'reply_to_user' => $row->reply_to_user,
527
+ 'mail_from_name_user' => $row->mail_from_name_user,
528
+ 'mail_from_user' => $row->mail_from_user,
529
+ 'custom_front' => $row->custom_front,
530
+ 'autogen_layout' => $row->autogen_layout,
531
+ 'send_to' => $row->send_to,
532
+ 'reply_to' => $row->reply_to,
533
+ 'requiredmark' => $row->requiredmark,
534
+ 'sendemail' => $row->sendemail,
535
+ 'savedb' => $row->savedb,
536
+ 'form_fields' => $row->form_fields,
537
+ 'published' => $row->published
538
+ ), array(
539
+ '%s',
540
+ '%s',
541
+ '%s',
542
+ '%s',
543
+ '%d',
544
+ '%d',
545
+ '%s',
546
+ '%s',
547
+ '%s',
548
+ '%s',
549
+ '%s',
550
+ '%s',
551
+ '%s',
552
+ '%s',
553
+ '%s',
554
+ '%s',
555
+ '%s',
556
+ '%s',
557
+ '%s',
558
+ '%s',
559
+ '%s',
560
+ '%d',
561
+ '%s',
562
+ '%s',
563
+ '%d',
564
+ '%s',
565
+ '%s',
566
+ '%s',
567
+ '%s',
568
+ '%s',
569
+ '%s',
570
+ '%s',
571
+ '%s',
572
+ '%s',
573
+ '%s',
574
+ '%s',
575
+ '%d',
576
+ '%s',
577
+ '%s',
578
+ '%s',
579
+ '%d',
580
+ '%d',
581
+ '%s',
582
+ '%d'
583
+ ));
584
+ $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
585
+ update_option('contact_form_forms', ((get_option('contact_form_forms')) ? (get_option('contact_form_forms')) . ',' . $id : $id));
586
+ $wpdb->insert($wpdb->prefix . 'formmaker_views', array(
587
+ 'form_id' => $id,
588
+ 'views' => 0
589
+ ), array(
590
+ '%d',
591
+ '%d'
592
+ ));
593
+ if ($save !== FALSE) {
594
+ return 1;
595
+ }
596
+ else {
597
+ return 2;
598
+ }
599
+ }
600
+
601
+ public function save_as_copy() {
602
+ $message = $this->save_db_as_copy();
603
+ // $this->display();
604
+ $page = WDW_FMC_Library::get('page');
605
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
606
+ }
607
+
608
+ public function save() {
609
+ $message = $this->save_db();
610
+ // $this->display();
611
+ $page = WDW_FMC_Library::get('page');
612
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
613
+ }
614
+
615
+ public function apply() {
616
+ $message = $this->save_db();
617
+ // $this->edit();
618
+ global $wpdb;
619
+ $id = (int) $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
620
+ $current_id = WDW_FMC_Library::get('current_id', $id);
621
+ $page = WDW_FMC_Library::get('page');
622
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
623
+ }
624
+
625
+ public function save_db() {
626
+ global $wpdb;
627
+ $javascript = "// before form is load
628
+ function before_load() {
629
+ }
630
+ // before form submit
631
+ function before_submit() {
632
+ }
633
+ // before form reset
634
+ function before_reset() {
635
+ }";
636
+ // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
637
+ $id = WDW_FMC_Library::get('current_id', 0);
638
+ $title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
639
+ $form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
640
+ $counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
641
+ $label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
642
+ $pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
643
+ $show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
644
+ $show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
645
+ $public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
646
+ $private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
647
+ $recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
648
+ $label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
649
+ $form_fields = (isset($_POST['form_fields']) ? stripslashes($_POST['form_fields']) : '');
650
+
651
+ if ($id != 0) {
652
+ $save = $wpdb->update($wpdb->prefix . 'formmaker', array(
653
+ 'title' => $title,
654
+ 'form_front' => $form_front,
655
+ 'counter' => $counter,
656
+ 'label_order' => $label_order,
657
+ 'label_order_current' => $label_order_current,
658
+ 'pagination' => $pagination,
659
+ 'show_title' => $show_title,
660
+ 'show_numbers' => $show_numbers,
661
+ 'public_key' => $public_key,
662
+ 'private_key' => $private_key,
663
+ 'recaptcha_theme' => $recaptcha_theme,
664
+ 'form_fields' => $form_fields,
665
+ ), array('id' => $id));
666
+ }
667
+ else {
668
+ $save = $wpdb->insert($wpdb->prefix . 'formmaker', array(
669
+ 'title' => $title,
670
+ 'mail' => '',
671
+ 'form_front' => $form_front,
672
+ 'theme' => $wpdb->get_var("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE css LIKE '%.wdform_section%'"),
673
+ 'counter' => $counter,
674
+ 'label_order' => $label_order,
675
+ 'pagination' => $pagination,
676
+ 'show_title' => $show_title,
677
+ 'show_numbers' => $show_numbers,
678
+ 'public_key' => $public_key,
679
+ 'private_key' => $private_key,
680
+ 'recaptcha_theme' => $recaptcha_theme,
681
+ 'javascript' => $javascript,
682
+ 'submit_text' => '',
683
+ 'url' => '',
684
+ 'article_id' => 0,
685
+ 'submit_text_type' => 0,
686
+ 'script_mail' => '%all%',
687
+ 'script_mail_user' => '%all%',
688
+ 'label_order_current' => $label_order_current,
689
+ 'tax' => 0,
690
+ 'payment_currency' => '',
691
+ 'paypal_email' => '',
692
+ 'checkout_mode' => 'testmode',
693
+ 'paypal_mode' => 0,
694
+ 'published' => 1,
695
+ 'form_fields' => $form_fields,
696
+ 'savedb' => 1,
697
+ 'sendemail' => 1,
698
+ 'requiredmark' => '*',
699
+ 'from_mail' => '',
700
+ 'from_name' => '',
701
+ 'reply_to' => '',
702
+ 'send_to' => '',
703
+ 'autogen_layout' => 1,
704
+ 'custom_front' => '',
705
+ 'mail_from_user' => '',
706
+ 'mail_from_name_user' => '',
707
+ 'reply_to_user' => '',
708
+ 'condition' => '',
709
+ 'mail_cc' => '',
710
+ 'mail_cc_user' => '',
711
+ 'mail_bcc' => '',
712
+ 'mail_bcc_user' => '',
713
+ 'mail_subject' => '',
714
+ 'mail_subject_user' => '',
715
+ 'mail_mode' => 1,
716
+ 'mail_mode_user' => 1,
717
+ 'mail_attachment' => 1,
718
+ 'mail_attachment_user' => 1,
719
+ ), array(
720
+ '%s',
721
+ '%s',
722
+ '%s',
723
+ '%d',
724
+ '%d',
725
+ '%s',
726
+ '%s',
727
+ '%s',
728
+ '%s',
729
+ '%s',
730
+ '%s',
731
+ '%s',
732
+ '%s',
733
+ '%s',
734
+ '%s',
735
+ '%d',
736
+ '%d',
737
+ '%s',
738
+ '%s',
739
+ '%s',
740
+ '%s',
741
+ '%s',
742
+ '%s',
743
+ '%s',
744
+ '%d',
745
+ '%d',
746
+ '%s',
747
+ '%d',
748
+ '%d',
749
+ '%s',
750
+ '%s',
751
+ '%s',
752
+ '%s',
753
+ '%s',
754
+ '%d',
755
+ '%s',
756
+ '%s',
757
+ '%s',
758
+ '%s',
759
+ '%s',
760
+ '%s',
761
+ '%s',
762
+ '%s',
763
+ '%s',
764
+ '%s',
765
+ '%s',
766
+ '%d',
767
+ '%d',
768
+ '%d',
769
+ '%d',
770
+ ));
771
+ $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
772
+ update_option('contact_form_forms', ((get_option('contact_form_forms')) ? (get_option('contact_form_forms')) . ',' . $id : $id));
773
+ // $_POST['current_id'] = $id;
774
+ $wpdb->insert($wpdb->prefix . 'formmaker_views', array(
775
+ 'form_id' => $id,
776
+ 'views' => 0
777
+ ), array(
778
+ '%d',
779
+ '%d'
780
+ ));
781
+ }
782
+ if ($save !== FALSE) {
783
+ return 1;
784
+ }
785
+ else {
786
+ return 2;
787
+ }
788
+ }
789
+
790
+ public function save_db_as_copy() {
791
+ global $wpdb;
792
+ // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
793
+ $id = WDW_FMC_Library::get('current_id', 0);
794
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
795
+ $title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
796
+ $form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
797
+ $counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
798
+ $label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
799
+ $label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
800
+ $pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
801
+ $show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
802
+ $show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
803
+ $public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
804
+ $private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
805
+ $recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
806
+ $form_fields = (isset($_POST['form_fields']) ? stripslashes($_POST['form_fields']) : '');
807
+
808
+ $save = $wpdb->insert($wpdb->prefix . 'formmaker', array(
809
+ 'title' => $title,
810
+ 'mail' => $row->mail,
811
+ 'form_front' => $form_front,
812
+ 'theme' => $row->theme,
813
+ 'counter' => $counter,
814
+ 'label_order' => $label_order,
815
+ 'pagination' => $pagination,
816
+ 'show_title' => $show_title,
817
+ 'show_numbers' => $show_numbers,
818
+ 'public_key' => $public_key,
819
+ 'private_key' => $private_key,
820
+ 'recaptcha_theme' => $recaptcha_theme,
821
+ 'javascript' => $row->javascript,
822
+ 'submit_text' => $row->submit_text,
823
+ 'url' => $row->url,
824
+ 'article_id' => $row->article_id,
825
+ 'submit_text_type' => $row->submit_text_type,
826
+ 'script_mail' => $row->script_mail,
827
+ 'script_mail_user' => $row->script_mail_user,
828
+ 'label_order_current' => $label_order_current,
829
+ 'tax' => $row->tax,
830
+ 'payment_currency' => $row->payment_currency,
831
+ 'paypal_email' => $row->paypal_email,
832
+ 'checkout_mode' => $row->checkout_mode,
833
+ 'paypal_mode' => $row->paypal_mode,
834
+ 'published' => $row->published,
835
+ 'form_fields' => $form_fields,
836
+ 'savedb' => $row->savedb,
837
+ 'sendemail' => $row->sendemail,
838
+ 'requiredmark' => $row->requiredmark,
839
+ 'from_mail' => $row->from_mail,
840
+ 'from_name' => $row->from_name,
841
+ 'reply_to' => $row->reply_to,
842
+ 'send_to' => $row->send_to,
843
+ 'autogen_layout' => $row->autogen_layout,
844
+ 'custom_front' => $row->custom_front,
845
+ 'mail_from_user' => $row->mail_from_user,
846
+ 'mail_from_name_user' => $row->mail_from_name_user,
847
+ 'reply_to_user' => $row->reply_to_user,
848
+ 'condition' => $row->condition,
849
+ 'mail_cc' => $row->mail_cc,
850
+ 'mail_cc_user' => $row->mail_cc_user,
851
+ 'mail_bcc' => $row->mail_bcc,
852
+ 'mail_bcc_user' => $row->mail_bcc_user,
853
+ 'mail_subject' => $row->mail_subject,
854
+ 'mail_subject_user' => $row->mail_subject_user,
855
+ 'mail_mode' => $row->mail_mode,
856
+ 'mail_mode_user' => $row->mail_mode_user,
857
+ 'mail_attachment' => $row->mail_attachment,
858
+ 'mail_attachment_user' => $row->mail_attachment_user,
859
+ ), array(
860
+ '%s',
861
+ '%s',
862
+ '%s',
863
+ '%d',
864
+ '%d',
865
+ '%s',
866
+ '%s',
867
+ '%s',
868
+ '%s',
869
+ '%s',
870
+ '%s',
871
+ '%s',
872
+ '%s',
873
+ '%s',
874
+ '%s',
875
+ '%d',
876
+ '%d',
877
+ '%s',
878
+ '%s',
879
+ '%s',
880
+ '%s',
881
+ '%s',
882
+ '%s',
883
+ '%s',
884
+ '%d',
885
+ '%d',
886
+ '%s',
887
+ '%d',
888
+ '%d',
889
+ '%s',
890
+ '%s',
891
+ '%s',
892
+ '%s',
893
+ '%s',
894
+ '%d',
895
+ '%s',
896
+ '%s',
897
+ '%s',
898
+ '%s',
899
+ '%s',
900
+ '%s',
901
+ '%s',
902
+ '%s',
903
+ '%s',
904
+ '%s',
905
+ '%s',
906
+ '%d',
907
+ '%d',
908
+ '%d',
909
+ '%d',
910
+ ));
911
+ $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
912
+ update_option('contact_form_forms', ((get_option('contact_form_forms')) ? (get_option('contact_form_forms')) . ',' . $id : $id));
913
+ $wpdb->insert($wpdb->prefix . 'formmaker_views', array(
914
+ 'form_id' => $id,
915
+ 'views' => 0
916
+ ), array(
917
+ '%d',
918
+ '%d'
919
+ ));
920
+ if ($save !== FALSE) {
921
+ return 1;
922
+ }
923
+ else {
924
+ return 2;
925
+ }
926
+ }
927
+
928
+ public function delete($id) {
929
+ global $wpdb;
930
+ $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id);
931
+ if ($wpdb->query($query)) {
932
+ $arr = explode(',', get_option('contact_form_forms'));
933
+ $arr = array_diff($arr, array($id));
934
+ $arr = implode(',', $arr);
935
+ update_option('contact_form_forms', $arr);
936
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="%d"', $id));
937
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id="%d"', $id));
938
+ $message = 3;
939
+ }
940
+ else {
941
+ $message = 2;
942
+ }
943
+ // $this->display();
944
+ $page = WDW_FMC_Library::get('page');
945
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
946
+ }
947
+
948
+ public function delete_all() {
949
+ global $wpdb;
950
+ $flag = FALSE;
951
+ $isDefault = FALSE;
952
+ $form_ids_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker');
953
+ foreach ($form_ids_col as $form_id) {
954
+ if (isset($_POST['check_' . $form_id])) {
955
+ $flag = TRUE;
956
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $form_id));
957
+ $arr = explode(',', get_option('contact_form_forms'));
958
+ $arr = array_diff($arr, array($form_id));
959
+ $arr = implode(',', $arr);
960
+ update_option('contact_form_forms', $arr);
961
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="%d"', $form_id));
962
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id="%d"', $form_id));
963
+ }
964
+ }
965
+ if ($flag) {
966
+ $message = 5;
967
+ }
968
+ else {
969
+ $message = 6;
970
+ }
971
+ // $this->display();
972
+ $page = WDW_FMC_Library::get('page');
973
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
974
+ }
975
+
976
+ ////////////////////////////////////////////////////////////////////////////////////////
977
+ // Getters & Setters //
978
+ ////////////////////////////////////////////////////////////////////////////////////////
979
+ ////////////////////////////////////////////////////////////////////////////////////////
980
+ // Private Methods //
981
+ ////////////////////////////////////////////////////////////////////////////////////////
982
+ ////////////////////////////////////////////////////////////////////////////////////////
983
+ // Listeners //
984
+ ////////////////////////////////////////////////////////////////////////////////////////
985
  }
admin/controllers/FMControllerSubmissions_fmc.php CHANGED
@@ -1,761 +1,761 @@
1
- <?php
2
-
3
- class FMControllerSubmissions_fmc {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $task = ((isset($_POST['task'])) ? esc_html($_POST['task']) : '');
23
- $id = ((isset($_POST['current_id'])) ? esc_html($_POST['current_id']) : 0);
24
- $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
25
- if (method_exists($this, $task)) {
26
- $this->$task($id);
27
- }
28
- else {
29
- $this->display($form_id);
30
- }
31
- }
32
-
33
- public function display($form_id) {
34
- $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
35
- require_once WD_FMC_DIR . "/admin/models/FMModelSubmissions_fmc.php";
36
- $model = new FMModelSubmissions_fmc();
37
-
38
- require_once WD_FMC_DIR . "/admin/views/FMViewSubmissions_fmc.php";
39
- $view = new FMViewSubmissions_fmc($model);
40
- $view->display($form_id);
41
- }
42
-
43
- public function show_stats() {
44
- $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
45
- require_once WD_FMC_DIR . "/admin/models/FMModelSubmissions_fmc.php";
46
- $model = new FMModelSubmissions_fmc();
47
-
48
- require_once WD_FMC_DIR . "/admin/views/FMViewSubmissions_fmc.php";
49
- $view = new FMViewSubmissions_fmc($model);
50
- $view->show_stats($form_id);
51
- }
52
-
53
- public function edit() {
54
- global $wpdb;
55
- $new_form = false;
56
- require_once WD_FMC_DIR . "/admin/models/FMModelSubmissions_fmc.php";
57
- $model = new FMModelSubmissions_fmc();
58
-
59
- require_once WD_FMC_DIR . "/admin/views/FMViewSubmissions_fmc.php";
60
- $view = new FMViewSubmissions_fmc($model);
61
- $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
62
-
63
- $form_id = $wpdb->get_var("SELECT form_id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "'");
64
- $theme_id = $wpdb->get_var("SELECT theme FROM " . $wpdb->prefix . "formmaker WHERE id='" . $form_id . "'");
65
- $css = $wpdb->get_var("SELECT css FROM " . $wpdb->prefix . "formmaker_themes WHERE id='" . $theme_id . "'");
66
-
67
- if (strpos($css,'.wdform_section') > -1) {
68
- $new_form = true;
69
- }
70
- if ($new_form == false) {
71
- $view->edit($id);
72
- }
73
- else {
74
- $view->new_edit($id);
75
- }
76
- }
77
-
78
- public function save() {
79
- $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
80
- $this->save_db();
81
- $this->display($form_id);
82
- }
83
-
84
- public function apply() {
85
- $this->save_db();
86
- $this->edit();
87
- }
88
-
89
- public function save_db() {
90
- global $wpdb;
91
- $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes( $_POST['current_id'])) : 0);
92
- $group_id = $id;
93
- $date = esc_html($_POST['date']);
94
- $ip = esc_html($_POST['ip']);
95
- $form_id = $wpdb->get_var("SELECT form_id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "'");
96
- $form = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id='" . $form_id . "'");
97
- $label_id = array();
98
- $label_order_original = array();
99
- $label_type = array();
100
- $old = false;
101
- $form_currency = '$';
102
-
103
- if (strpos($form->label_order, 'type_paypal_')) {
104
- $form->label_order = $form->label_order."0#**id**#Payment Status#**label**#type_paypal_payment_status#****#";
105
- }
106
- $label_all = explode('#****#', $form->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, $label_oder_each[0]);
113
- array_push($label_type, $label_oder_each[1]);
114
- }
115
-
116
- if(isset($form->form))
117
- $old = true;
118
-
119
- if($old == false || ($old == true && $form->form=='')) {
120
-
121
- foreach($label_type as $key => $type) {
122
-
123
- $value='';
124
- 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")
125
- continue;
126
-
127
- $i=$label_id[$key];
128
- $id = 'form_id_temp';
129
- switch ($type) {
130
-
131
- case 'type_text':
132
- case 'type_password':
133
- case 'type_textarea':
134
- case "type_submitter_mail":
135
- case "type_date":
136
- case "type_own_select":
137
- case "type_country":
138
- case "type_number": {
139
- $value = (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL);
140
- break;
141
- }
142
- case "type_wdeditor": {
143
- $value = (isset($_POST['wdform_'.$i.'_wd_editor'.$id]) ? $_POST['wdform_'.$i.'_wd_editor'.$id] : NULL);
144
- break;
145
- }
146
- case "type_mark_map": {
147
- $long = (isset($_POST['wdform_'.$i."_long".$id]) ? $_POST['wdform_'.$i."_long".$id] : NULL);
148
- $lat = (isset($_POST['wdform_'.$i."_lat".$id]) ? $_POST['wdform_'.$i."_lat".$id] : NULL);
149
- if($long and $lat)
150
- $value = $long . '***map***' . $lat;
151
-
152
- break;
153
- }
154
-
155
- case "type_date_fields": {
156
- $day = (isset($_POST['wdform_'.$i."_day".$id]) ? $_POST['wdform_'.$i."_day".$id] : NULL);
157
- $month = (isset($_POST['wdform_'.$i."_month".$id]) ? $_POST['wdform_'.$i."_month".$id] : NULL);
158
- $year = (isset($_POST['wdform_'.$i."_year".$id]) ? $_POST['wdform_'.$i."_year".$id] : NULL);
159
- if($day or $month or $year)
160
- $value = $day . '-' . $month . '-' . $year;
161
- break;
162
- }
163
-
164
- case "type_time": {
165
- $ss = (isset($_POST['wdform_'.$i."_ss".$id]) ? $_POST['wdform_'.$i."_ss".$id] : NULL);
166
- $hh = (isset($_POST['wdform_'.$i."_hh".$id]) ? $_POST['wdform_'.$i."_hh".$id] : NULL);
167
- $mm = (isset($_POST['wdform_'.$i."_mm".$id]) ? $_POST['wdform_'.$i."_mm".$id] : NULL);
168
-
169
- if(isset($ss))
170
- $value = $hh .':'. $mm .':' . $ss;
171
- else
172
- $value = $hh .':' . $mm;
173
-
174
- $am_pm = (isset($_POST['wdform_'.$i."_am_pm".$id]) ? $_POST['wdform_'.$i."_am_pm".$id] : NULL);
175
- if(isset($am_pm))
176
- $value = $value . ' ' . $am_pm;
177
-
178
- break;
179
- }
180
-
181
- case "type_phone": {
182
- $first = (isset($_POST['wdform_'.$i."_element_first".$id]) ? $_POST['wdform_'.$i."_element_first".$id] : NULL);
183
- $last = (isset($_POST['wdform_'.$i."_element_last".$id]) ? $_POST['wdform_'.$i."_element_last".$id] : NULL);
184
- if($first or $last)
185
- $value = $first . ' ' . $last;
186
-
187
- break;
188
- }
189
-
190
- case "type_name": {
191
-
192
- $element_title = (isset($_POST['wdform_'.$i."_element_title".$id]) ? $_POST['wdform_'.$i."_element_title".$id] : NULL);
193
- $element_first = (isset($_POST['wdform_'.$i."_element_first".$id]) ? $_POST['wdform_'.$i."_element_first".$id] : NULL);
194
- $element_last = (isset($_POST['wdform_'.$i."_element_last".$id]) ? $_POST['wdform_'.$i."_element_last".$id] : NULL);
195
- $element_middle = (isset($_POST['wdform_'.$i."_element_middle".$id]) ? $_POST['wdform_'.$i."_element_middle".$id] : NULL);
196
-
197
- if(isset($element_title))
198
- $value = $element_title . '@@@' . $element_first . '@@@' . $element_last . '@@@' . $element_middle;
199
- else
200
- $value = $element_first . '@@@' . $element_last;
201
-
202
- break;
203
- }
204
-
205
- case "type_file_upload": {
206
- break;
207
- }
208
-
209
- case 'type_address': {
210
- $value='*#*#*#';
211
- $element = (isset($_POST['wdform_'.$i."_street1".$id]) ? $_POST['wdform_'.$i."_street1".$id] : NULL);
212
- if($element) {
213
- $value = $element;
214
- break;
215
- }
216
-
217
- $element = (isset($_POST['wdform_'.$i."_street2".$id]) ? $_POST['wdform_'.$i."_street2".$id] : NULL);
218
- if($element) {
219
- $value = $element;
220
- break;
221
- }
222
-
223
- $element = (isset($_POST['wdform_'.$i."_city".$id]) ? $_POST['wdform_'.$i."_city".$id] : NULL);
224
- if(isset($element)) {
225
- $value = $element;
226
- break;
227
- }
228
-
229
- $element = (isset($_POST['wdform_'.$i."_state".$id]) ? $_POST['wdform_'.$i."_state".$id] : NULL);
230
- if(isset($element)) {
231
- $value = $element;
232
- break;
233
- }
234
-
235
- $element = (isset($_POST['wdform_'.$i."_postal".$id]) ? $_POST['wdform_'.$i."_postal".$id] : NULL);
236
- if(isset($element)) {
237
- $value = $element;
238
- break;
239
- }
240
-
241
- $element = (isset($_POST['wdform_'.$i."_country".$id]) ? $_POST['wdform_'.$i."_country".$id] : NULL);
242
- if(isset($element)) {
243
- $value = $element;
244
- break;
245
- }
246
-
247
- break;
248
- }
249
-
250
- case "type_hidden": {
251
- $value = (isset($_POST[$label_order_original[$key]]) ? $_POST[$label_order_original[$key]] : NULL);
252
- break;
253
- }
254
-
255
- case "type_radio": {
256
- $element = (isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : NULL);
257
- if(isset($element)) {
258
- $value = $element;
259
- break;
260
- }
261
-
262
- $value = (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL);
263
- break;
264
- }
265
-
266
- case "type_checkbox": {
267
- $start=-1;
268
- $value='';
269
- for($j=0; $j<100; $j++) {
270
-
271
- $element = (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL);
272
-
273
- if(isset($element)) {
274
- $start = $j;
275
- break;
276
- }
277
- }
278
-
279
- $other_element_id=-1;
280
- $is_other = (isset($_POST['wdform_'.$i."_allow_other".$id]) ? $_POST['wdform_'.$i."_allow_other".$id] : NULL);
281
- if($is_other == "yes") {
282
- $other_element_id = (isset($_POST['wdform_'.$i."_allow_other_num".$id]) ? $_POST['wdform_'.$i."_allow_other_num".$id] : NULL);
283
- }
284
-
285
- if($start!=-1) {
286
- for($j=$start; $j<100; $j++) {
287
- $element = (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL);
288
- if(isset($element))
289
- if($j == $other_element_id) {
290
- $value = $value . (isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : NULL) . '***br***';
291
- }
292
- else
293
- $value = $value . (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL) . '***br***';
294
- }
295
- }
296
-
297
- break;
298
- }
299
-
300
- case "type_paypal_price": {
301
- $value=0;
302
- if((isset($_POST['wdform_'.$i."_element_dollars".$id]) ? $_POST['wdform_'.$i."_element_dollars".$id] : NULL))
303
- $value = (isset($_POST['wdform_'.$i."_element_dollars".$id]) ? $_POST['wdform_'.$i."_element_dollars".$id] : NULL);
304
-
305
- $value = (int) preg_replace('/\D/', '', $value);
306
-
307
- if((isset($_POST['wdform_'.$i."_element_cents".$id]) ? $_POST['wdform_'.$i."_element_cents".$id] : NULL))
308
- $value = $value . '.' . ( preg_replace('/\D/', '', (isset($_POST['wdform_'.$i."_element_cents".$id]) ? $_POST['wdform_'.$i."_element_cents".$id] : NULL)));
309
-
310
-
311
- $value = $value;
312
- break;
313
- }
314
-
315
- case "type_paypal_select": {
316
-
317
- if((isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL))
318
- $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;
319
- else
320
- $value = '';
321
-
322
- $element_quantity = (isset($_POST['wdform_'.$i."element_quantity".$id]) ? $_POST['wdform_'.$i."element_quantity".$id] : NULL);
323
- if(isset($element_quantity) && $value!='')
324
- $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);
325
-
326
-
327
- for($k=0; $k<50; $k++) {
328
- $temp_val = (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL);
329
- if(isset($temp_val) && $value!='') {
330
- $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***';
331
- }
332
- }
333
-
334
- break;
335
- }
336
-
337
- case "type_paypal_radio": {
338
-
339
- if((isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL))
340
- $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;
341
- else
342
- $value='';
343
-
344
-
345
- $element_quantity = (isset($_POST['wdform_'.$i."element_quantity".$id]) ? $_POST['wdform_'.$i."element_quantity".$id] : NULL);
346
- if(isset($element_quantity) && $value!='')
347
- $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***';
348
-
349
-
350
- for($k=0; $k<50; $k++) {
351
- $temp_val = (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL);
352
- if(isset($temp_val) && $value!='') {
353
-
354
- $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***';
355
- }
356
- }
357
-
358
- break;
359
- }
360
-
361
- case "type_paypal_shipping": {
362
-
363
- if((isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL))
364
- $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;
365
- else
366
- $value='';
367
- $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);
368
-
369
- $paypal['shipping'] = (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL);
370
-
371
- break;
372
- }
373
-
374
- case "type_paypal_checkbox": {
375
- $start=-1;
376
- $value='';
377
- for($j=0; $j<100; $j++) {
378
-
379
- $element = (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL);
380
-
381
- if(isset($element)) {
382
- $start=$j;
383
- break;
384
- }
385
- }
386
-
387
- $other_element_id = -1;
388
- $is_other = (isset($_POST['wdform_'.$i."_allow_other".$id]) ? $_POST['wdform_'.$i."_allow_other".$id] : NULL);
389
- if($is_other=="yes") {
390
- $other_element_id = (isset($_POST['wdform_'.$i."_allow_other_num".$id]) ? $_POST['wdform_'.$i."_allow_other_num".$id] : NULL);
391
- }
392
-
393
- if($start!=-1) {
394
- for($j=$start; $j<100; $j++) {
395
- $element = (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL);
396
- if(isset($element))
397
- if($j==$other_element_id) {
398
- $value = $value . (isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : NULL) . '***br***';
399
-
400
- }
401
- else {
402
-
403
- $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***';
404
-
405
- }
406
- }
407
-
408
- $element_quantity = (isset($_POST['wdform_'.$i."element_quantity".$id]) ? $_POST['wdform_'.$i."element_quantity".$id] : NULL);
409
- if(isset($element_quantity))
410
- $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***';
411
-
412
- for($k=0; $k<50; $k++) {
413
- $temp_val = (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL);
414
- if(isset($temp_val)) {
415
-
416
- $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***';
417
- }
418
- }
419
-
420
- }
421
-
422
-
423
- break;
424
- }
425
-
426
- case "type_star_rating": {
427
-
428
- if((isset($_POST['wdform_'.$i."_selected_star_amount".$id]) ? $_POST['wdform_'.$i."_selected_star_amount".$id] : NULL) == "")
429
- $selected_star_amount = 0;
430
- else {
431
- $selected_star_amount = (isset($_POST['wdform_'.$i."_selected_star_amount".$id]) ? $_POST['wdform_'.$i."_selected_star_amount".$id] : NULL);
432
- }
433
- $value = $selected_star_amount . '/' . (isset($_POST['wdform_'.$i."_star_amount".$id]) ? $_POST['wdform_'.$i."_star_amount".$id] : NULL);
434
- break;
435
- }
436
-
437
- case "type_scale_rating": {
438
-
439
- $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);
440
- break;
441
- }
442
-
443
- case "type_spinner": {
444
- $value = (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL);
445
-
446
- break;
447
- }
448
-
449
- case "type_slider": {
450
- $value = (isset($_POST['wdform_'.$i."_slider_value".$id]) ? $_POST['wdform_'.$i."_slider_value".$id] : NULL);
451
-
452
- break;
453
- }
454
- case "type_range": {
455
- $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);
456
-
457
- break;
458
- }
459
- case "type_grading": {
460
- $value ="";
461
- $items = explode(":",(isset($_POST['wdform_'.$i."_hidden_item".$id]) ? $_POST['wdform_'.$i."_hidden_item".$id] : NULL));
462
- for($k=0; $k<sizeof($items)-1; $k++)
463
- $value .= (isset($_POST['wdform_'.$i."_element".$id.'_'.$k]) ? $_POST['wdform_'.$i."_element".$id.'_'.$k] : NULL) . ':';
464
-
465
- $value .= (isset($_POST['wdform_'.$i."_hidden_item".$id]) ? $_POST['wdform_'.$i."_hidden_item".$id] : NULL) . '***grading***';
466
-
467
- break;
468
- }
469
-
470
- case "type_matrix": {
471
-
472
- $rows_of_matrix = explode("***",(isset($_POST['wdform_'.$i."_hidden_row".$id]) ? $_POST['wdform_'.$i."_hidden_row".$id] : NULL));
473
- $rows_count = sizeof($rows_of_matrix)-1;
474
- $column_of_matrix = explode("***",(isset($_POST['wdform_'.$i."_hidden_column".$id]) ? $_POST['wdform_'.$i."_hidden_column".$id] : NULL));
475
- $columns_count = sizeof($column_of_matrix)-1;
476
-
477
-
478
- if((isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) == "radio") {
479
- $input_value="";
480
-
481
- for($k=1; $k<=$rows_count; $k++)
482
- $input_value .= (isset($_POST['wdform_'.$i."_input_element".$id.$k]) ? $_POST['wdform_'.$i."_input_element".$id.$k] : 0) ."***";
483
-
484
- }
485
- if((isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) == "checkbox") {
486
- $input_value="";
487
-
488
- for($k=1; $k<=$rows_count; $k++)
489
- for($j=1; $j<=$columns_count; $j++)
490
- $input_value .= (isset($_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j]) ? $_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j] : 0) . "***";
491
- }
492
-
493
- if((isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) == "text") {
494
- $input_value="";
495
- for($k=1; $k<=$rows_count; $k++)
496
- for($j=1; $j<=$columns_count; $j++)
497
- $input_value .= (isset($_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j]) ? $_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j] : NULL) . "***";
498
- }
499
-
500
- if((isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) == "select") {
501
- $input_value="";
502
- for($k=1; $k<=$rows_count; $k++)
503
- for($j=1; $j<=$columns_count; $j++)
504
- $input_value .= (isset($_POST['wdform_'.$i."_select_yes_no".$id.$k.'_'.$j]) ? $_POST['wdform_'.$i."_select_yes_no".$id.$k.'_'.$j] : NULL) . "***";
505
- }
506
-
507
- $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***';
508
-
509
- break;
510
- }
511
-
512
- }
513
-
514
- if($type == "type_address")
515
- if($value == '*#*#*#')
516
- continue;
517
-
518
-
519
- if($value) {
520
- $query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $group_id . "' AND element_label='" . $i . "'";
521
- $result = $wpdb->get_var($query);
522
-
523
- if($result) {
524
- $save = $wpdb->update($wpdb->prefix . "formmaker_submits", array(
525
- 'element_value' => stripslashes($value),
526
- ), array(
527
- 'group_id' => $group_id,
528
- 'element_label' => $i
529
- ), array(
530
- '%s',
531
- ), array(
532
- '%d',
533
- '%s'
534
- ));
535
- }
536
- else {
537
-
538
- $save = $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
539
- 'form_id' => $form_id,
540
- 'element_label' => $i,
541
- 'element_value' => stripslashes($value),
542
- 'group_id' => $group_id,
543
- 'date' => $date,
544
- 'ip' => $ip
545
- ), array(
546
- '%d',
547
- '%s',
548
- '%s',
549
- '%d',
550
- '%s',
551
- '%s'
552
- )
553
- );
554
-
555
-
556
- }
557
- }
558
-
559
-
560
-
561
- }
562
- }
563
-
564
- else {
565
-
566
- foreach ($label_id as $key => $label_id_1) {
567
- $element_value = (isset($_POST["submission_" . $label_id_1]) ? esc_html(stripslashes($_POST["submission_" . $label_id_1])) : " ");
568
- if (isset($_POST["submission_" . $label_id_1])) {
569
- $query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
570
- $result = $wpdb->get_var($query);
571
- if ($label_type[$key] == 'type_file_upload')
572
- if ($element_value)
573
- $element_value = $element_value . "*@@url@@*";
574
- if ($result) {
575
- $save = $wpdb->update($wpdb->prefix . "formmaker_submits", array(
576
- 'element_value' => stripslashes($element_value),
577
- ), array(
578
- 'group_id' => $id,
579
- 'element_label' => $label_id_1
580
- ), array(
581
- '%s',
582
- ), array(
583
- '%d',
584
- '%s'
585
- ));
586
- }
587
- else {
588
- $save = $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
589
- 'form_id' => $form_id,
590
- 'element_label' => $label_id_1,
591
- 'element_value' => stripslashes($element_value),
592
- 'group_id' => $id,
593
- 'date' => $date,
594
- 'ip' => $ip
595
- ), array(
596
- '%d',
597
- '%s',
598
- '%s',
599
- '%d',
600
- '%s',
601
- '%s'
602
- )
603
- );
604
- }
605
- }
606
- else {
607
- $element_value_ch = (isset($_POST["submission_" . $label_id_1 . '_0']) ? esc_html(stripslashes($_POST["submission_" . $label_id_1 . '_0'])) : " ");
608
- if (isset($_POST["submission_" . $label_id_1 . '_0'])) {
609
- for ($z = 0; $z < 21; $z++) {
610
- $element_value_ch = $_POST["submission_" . $label_id_1 . '_' . $z];
611
- if (isset($element_value_ch))
612
- $element_value = $element_value . $element_value_ch . '***br***';
613
- else
614
- break;
615
- }
616
- $query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
617
- $result = $wpdb->get_var($query);
618
- if ($result) {
619
- $query = "UPDATE " . $wpdb->prefix . "formmaker_submits SET `element_value`='" . stripslashes($element_value) . "' WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
620
- $save = $wpdb->update($wpdb->prefix . "formmaker_submits", array(
621
- 'element_value' => stripslashes($element_value),
622
- ), array(
623
- 'group_id' => $id,
624
- 'element_label' => $label_id_1
625
- ), array(
626
- '%s',
627
- ), array(
628
- '%d',
629
- '%s'
630
- ));
631
- }
632
- else {
633
- $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 . "')";
634
- $save = $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
635
- 'form_id' => $form_id,
636
- 'element_label' => $label_id_1,
637
- 'element_value' => stripslashes($element_value),
638
- 'group_id' => $id,
639
- 'date' => $date,
640
- 'ip' => $ip
641
- ), array(
642
- '%d',
643
- '%s',
644
- '%s',
645
- '%d',
646
- '%s',
647
- '%s'
648
- )
649
- );
650
- }
651
- }
652
- }
653
- }
654
- }
655
- if ($save !== FALSE) {
656
- echo WDW_FMC_Library::message('Submission Succesfully Saved.', 'updated');
657
- }
658
- else {
659
- echo WDW_FMC_Library::message('Error. Please install plugin again.', 'error');
660
- }
661
- }
662
-
663
- public function delete($id) {
664
- global $wpdb;
665
- $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
666
- $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id="%d"', $id);
667
- if ($wpdb->query($query)) {
668
- echo WDW_FMC_Library::message('Item Succesfully Deleted.', 'updated');
669
- }
670
- else {
671
- echo WDW_FMC_Library::message('Error. Please install plugin again.', 'error');
672
- }
673
- $this->display($form_id);
674
- }
675
-
676
- public function delete_all() {
677
- global $wpdb;
678
- $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
679
- $cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
680
- if (count($cid)) {
681
- $cids = implode(',', $cid);
682
- $query = 'DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( ' . $cids . ' )';
683
- if ($wpdb->query($query)) {
684
- echo WDW_FMC_Library::message('Items Succesfully Deleted.', 'updated');
685
- }
686
- else {
687
- echo WDW_FMC_Library::message('Error. Please install plugin again.', 'error');
688
- }
689
- }
690
- else {
691
- echo WDW_FMC_Library::message('You must select at least one item.', 'error');
692
- }
693
- $this->display($form_id);
694
- }
695
-
696
- public function block_ip() {
697
- global $wpdb;
698
- $flag = FALSE;
699
- $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
700
- $cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
701
- if (count($cid)) {
702
- $cids = implode(',', $cid);
703
- $query = 'SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( '. $cids .' )';
704
- $rows = $wpdb->get_results($query);
705
- foreach ($rows as $row) {
706
- $ips = $wpdb->get_var($wpdb->prepare('SELECT ip FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $row->ip));
707
- $flag = TRUE;
708
- if (!$ips) {
709
- $save = $wpdb->insert($wpdb->prefix . 'formmaker_blocked', array(
710
- 'ip' => $row->ip,
711
- ), array(
712
- '%s',
713
- ));
714
- }
715
- }
716
- }
717
- if ($flag) {
718
- echo WDW_FMC_Library::message('IPs Succesfully Blocked.', 'updated');
719
- }
720
- else {
721
- echo WDW_FMC_Library::message('You must select at least one item.', 'error');
722
- }
723
- $this->display($form_id);
724
- }
725
-
726
- public function unblock_ip() {
727
- global $wpdb;
728
- $flag = FALSE;
729
- $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
730
- $cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
731
- if (count($cid)) {
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
- $flag = TRUE;
737
- $ips = $wpdb->get_var($wpdb->prepare('SELECT ip FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $row->ip));
738
- if ($ips) {
739
- $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $ips));
740
- }
741
- }
742
- }
743
- if ($flag) {
744
- echo WDW_FMC_Library::message('IPs Succesfully Unblocked.', 'updated');
745
- }
746
- else {
747
- echo WDW_FMC_Library::message('You must select at least one item.', 'error');
748
- }
749
- $this->display($form_id);
750
- }
751
-
752
- ////////////////////////////////////////////////////////////////////////////////////////
753
- // Getters & Setters //
754
- ////////////////////////////////////////////////////////////////////////////////////////
755
- ////////////////////////////////////////////////////////////////////////////////////////
756
- // Private Methods //
757
- ////////////////////////////////////////////////////////////////////////////////////////
758
- ////////////////////////////////////////////////////////////////////////////////////////
759
- // Listeners //
760
- ////////////////////////////////////////////////////////////////////////////////////////
761
  }
1
+ <?php
2
+
3
+ class FMControllerSubmissions_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $task = ((isset($_POST['task'])) ? esc_html($_POST['task']) : '');
23
+ $id = ((isset($_POST['current_id'])) ? esc_html($_POST['current_id']) : 0);
24
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
25
+ if (method_exists($this, $task)) {
26
+ $this->$task($id);
27
+ }
28
+ else {
29
+ $this->display($form_id);
30
+ }
31
+ }
32
+
33
+ public function display($form_id) {
34
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
35
+ require_once WD_FMC_DIR . "/admin/models/FMModelSubmissions_fmc.php";
36
+ $model = new FMModelSubmissions_fmc();
37
+
38
+ require_once WD_FMC_DIR . "/admin/views/FMViewSubmissions_fmc.php";
39
+ $view = new FMViewSubmissions_fmc($model);
40
+ $view->display($form_id);
41
+ }
42
+
43
+ public function show_stats() {
44
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
45
+ require_once WD_FMC_DIR . "/admin/models/FMModelSubmissions_fmc.php";
46
+ $model = new FMModelSubmissions_fmc();
47
+
48
+ require_once WD_FMC_DIR . "/admin/views/FMViewSubmissions_fmc.php";
49
+ $view = new FMViewSubmissions_fmc($model);
50
+ $view->show_stats($form_id);
51
+ }
52
+
53
+ public function edit() {
54
+ global $wpdb;
55
+ $new_form = false;
56
+ require_once WD_FMC_DIR . "/admin/models/FMModelSubmissions_fmc.php";
57
+ $model = new FMModelSubmissions_fmc();
58
+
59
+ require_once WD_FMC_DIR . "/admin/views/FMViewSubmissions_fmc.php";
60
+ $view = new FMViewSubmissions_fmc($model);
61
+ $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
62
+
63
+ $form_id = $wpdb->get_var("SELECT form_id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "'");
64
+ $theme_id = $wpdb->get_var("SELECT theme FROM " . $wpdb->prefix . "formmaker WHERE id='" . $form_id . "'");
65
+ $css = $wpdb->get_var("SELECT css FROM " . $wpdb->prefix . "formmaker_themes WHERE id='" . $theme_id . "'");
66
+
67
+ if (strpos($css,'.wdform_section') > -1) {
68
+ $new_form = true;
69
+ }
70
+ if ($new_form == false) {
71
+ $view->edit($id);
72
+ }
73
+ else {
74
+ $view->new_edit($id);
75
+ }
76
+ }
77
+
78
+ public function save() {
79
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
80
+ $this->save_db();
81
+ $this->display($form_id);
82
+ }
83
+
84
+ public function apply() {
85
+ $this->save_db();
86
+ $this->edit();
87
+ }
88
+
89
+ public function save_db() {
90
+ global $wpdb;
91
+ $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes( $_POST['current_id'])) : 0);
92
+ $group_id = $id;
93
+ $date = esc_html($_POST['date']);
94
+ $ip = esc_html($_POST['ip']);
95
+ $form_id = $wpdb->get_var("SELECT form_id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "'");
96
+ $form = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id='" . $form_id . "'");
97
+ $label_id = array();
98
+ $label_order_original = array();
99
+ $label_type = array();
100
+ $old = false;
101
+ $form_currency = '$';
102
+
103
+ if (strpos($form->label_order, 'type_paypal_')) {
104
+ $form->label_order = $form->label_order."0#**id**#Payment Status#**label**#type_paypal_payment_status#****#";
105
+ }
106
+ $label_all = explode('#****#', $form->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, $label_oder_each[0]);
113
+ array_push($label_type, $label_oder_each[1]);
114
+ }
115
+
116
+ if(isset($form->form))
117
+ $old = true;
118
+
119
+ if($old == false || ($old == true && $form->form=='')) {
120
+
121
+ foreach($label_type as $key => $type) {
122
+
123
+ $value='';
124
+ 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")
125
+ continue;
126
+
127
+ $i=$label_id[$key];
128
+ $id = 'form_id_temp';
129
+ switch ($type) {
130
+
131
+ case 'type_text':
132
+ case 'type_password':
133
+ case 'type_textarea':
134
+ case "type_submitter_mail":
135
+ case "type_date":
136
+ case "type_own_select":
137
+ case "type_country":
138
+ case "type_number": {
139
+ $value = (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL);
140
+ break;
141
+ }
142
+ case "type_wdeditor": {
143
+ $value = (isset($_POST['wdform_'.$i.'_wd_editor'.$id]) ? $_POST['wdform_'.$i.'_wd_editor'.$id] : NULL);
144
+ break;
145
+ }
146
+ case "type_mark_map": {
147
+ $long = (isset($_POST['wdform_'.$i."_long".$id]) ? $_POST['wdform_'.$i."_long".$id] : NULL);
148
+ $lat = (isset($_POST['wdform_'.$i."_lat".$id]) ? $_POST['wdform_'.$i."_lat".$id] : NULL);
149
+ if($long and $lat)
150
+ $value = $long . '***map***' . $lat;
151
+
152
+ break;
153
+ }
154
+
155
+ case "type_date_fields": {
156
+ $day = (isset($_POST['wdform_'.$i."_day".$id]) ? $_POST['wdform_'.$i."_day".$id] : NULL);
157
+ $month = (isset($_POST['wdform_'.$i."_month".$id]) ? $_POST['wdform_'.$i."_month".$id] : NULL);
158
+ $year = (isset($_POST['wdform_'.$i."_year".$id]) ? $_POST['wdform_'.$i."_year".$id] : NULL);
159
+ if($day or $month or $year)
160
+ $value = $day . '-' . $month . '-' . $year;
161
+ break;
162
+ }
163
+
164
+ case "type_time": {
165
+ $ss = (isset($_POST['wdform_'.$i."_ss".$id]) ? $_POST['wdform_'.$i."_ss".$id] : NULL);
166
+ $hh = (isset($_POST['wdform_'.$i."_hh".$id]) ? $_POST['wdform_'.$i."_hh".$id] : NULL);
167
+ $mm = (isset($_POST['wdform_'.$i."_mm".$id]) ? $_POST['wdform_'.$i."_mm".$id] : NULL);
168
+
169
+ if(isset($ss))
170
+ $value = $hh .':'. $mm .':' . $ss;
171
+ else
172
+ $value = $hh .':' . $mm;
173
+
174
+ $am_pm = (isset($_POST['wdform_'.$i."_am_pm".$id]) ? $_POST['wdform_'.$i."_am_pm".$id] : NULL);
175
+ if(isset($am_pm))
176
+ $value = $value . ' ' . $am_pm;
177
+
178
+ break;
179
+ }
180
+
181
+ case "type_phone": {
182
+ $first = (isset($_POST['wdform_'.$i."_element_first".$id]) ? $_POST['wdform_'.$i."_element_first".$id] : NULL);
183
+ $last = (isset($_POST['wdform_'.$i."_element_last".$id]) ? $_POST['wdform_'.$i."_element_last".$id] : NULL);
184
+ if($first or $last)
185
+ $value = $first . ' ' . $last;
186
+
187
+ break;
188
+ }
189
+
190
+ case "type_name": {
191
+
192
+ $element_title = (isset($_POST['wdform_'.$i."_element_title".$id]) ? $_POST['wdform_'.$i."_element_title".$id] : NULL);
193
+ $element_first = (isset($_POST['wdform_'.$i."_element_first".$id]) ? $_POST['wdform_'.$i."_element_first".$id] : NULL);
194
+ $element_last = (isset($_POST['wdform_'.$i."_element_last".$id]) ? $_POST['wdform_'.$i."_element_last".$id] : NULL);
195
+ $element_middle = (isset($_POST['wdform_'.$i."_element_middle".$id]) ? $_POST['wdform_'.$i."_element_middle".$id] : NULL);
196
+
197
+ if(isset($element_title))
198
+ $value = $element_title . '@@@' . $element_first . '@@@' . $element_last . '@@@' . $element_middle;
199
+ else
200
+ $value = $element_first . '@@@' . $element_last;
201
+
202
+ break;
203
+ }
204
+
205
+ case "type_file_upload": {
206
+ break;
207
+ }
208
+
209
+ case 'type_address': {
210
+ $value='*#*#*#';
211
+ $element = (isset($_POST['wdform_'.$i."_street1".$id]) ? $_POST['wdform_'.$i."_street1".$id] : NULL);
212
+ if($element) {
213
+ $value = $element;
214
+ break;
215
+ }
216
+
217
+ $element = (isset($_POST['wdform_'.$i."_street2".$id]) ? $_POST['wdform_'.$i."_street2".$id] : NULL);
218
+ if($element) {
219
+ $value = $element;
220
+ break;
221
+ }
222
+
223
+ $element = (isset($_POST['wdform_'.$i."_city".$id]) ? $_POST['wdform_'.$i."_city".$id] : NULL);
224
+ if(isset($element)) {
225
+ $value = $element;
226
+ break;
227
+ }
228
+
229
+ $element = (isset($_POST['wdform_'.$i."_state".$id]) ? $_POST['wdform_'.$i."_state".$id] : NULL);
230
+ if(isset($element)) {
231
+ $value = $element;
232
+ break;
233
+ }
234
+
235
+ $element = (isset($_POST['wdform_'.$i."_postal".$id]) ? $_POST['wdform_'.$i."_postal".$id] : NULL);
236
+ if(isset($element)) {
237
+ $value = $element;
238
+ break;
239
+ }
240
+
241
+ $element = (isset($_POST['wdform_'.$i."_country".$id]) ? $_POST['wdform_'.$i."_country".$id] : NULL);
242
+ if(isset($element)) {
243
+ $value = $element;
244
+ break;
245
+ }
246
+
247
+ break;
248
+ }
249
+
250
+ case "type_hidden": {
251
+ $value = (isset($_POST[$label_order_original[$key]]) ? $_POST[$label_order_original[$key]] : NULL);
252
+ break;
253
+ }
254
+
255
+ case "type_radio": {
256
+ $element = (isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : NULL);
257
+ if(isset($element)) {
258
+ $value = $element;
259
+ break;
260
+ }
261
+
262
+ $value = (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL);
263
+ break;
264
+ }
265
+
266
+ case "type_checkbox": {
267
+ $start=-1;
268
+ $value='';
269
+ for($j=0; $j<100; $j++) {
270
+
271
+ $element = (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL);
272
+
273
+ if(isset($element)) {
274
+ $start = $j;
275
+ break;
276
+ }
277
+ }
278
+
279
+ $other_element_id=-1;
280
+ $is_other = (isset($_POST['wdform_'.$i."_allow_other".$id]) ? $_POST['wdform_'.$i."_allow_other".$id] : NULL);
281
+ if($is_other == "yes") {
282
+ $other_element_id = (isset($_POST['wdform_'.$i."_allow_other_num".$id]) ? $_POST['wdform_'.$i."_allow_other_num".$id] : NULL);
283
+ }
284
+
285
+ if($start!=-1) {
286
+ for($j=$start; $j<100; $j++) {
287
+ $element = (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL);
288
+ if(isset($element))
289
+ if($j == $other_element_id) {
290
+ $value = $value . (isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : NULL) . '***br***';
291
+ }
292
+ else
293
+ $value = $value . (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL) . '***br***';
294
+ }
295
+ }
296
+
297
+ break;
298
+ }
299
+
300
+ case "type_paypal_price": {
301
+ $value=0;
302
+ if((isset($_POST['wdform_'.$i."_element_dollars".$id]) ? $_POST['wdform_'.$i."_element_dollars".$id] : NULL))
303
+ $value = (isset($_POST['wdform_'.$i."_element_dollars".$id]) ? $_POST['wdform_'.$i."_element_dollars".$id] : NULL);
304
+
305
+ $value = (int) preg_replace('/\D/', '', $value);
306
+
307
+ if((isset($_POST['wdform_'.$i."_element_cents".$id]) ? $_POST['wdform_'.$i."_element_cents".$id] : NULL))
308
+ $value = $value . '.' . ( preg_replace('/\D/', '', (isset($_POST['wdform_'.$i."_element_cents".$id]) ? $_POST['wdform_'.$i."_element_cents".$id] : NULL)));
309
+
310
+
311
+ $value = $value;
312
+ break;
313
+ }
314
+
315
+ case "type_paypal_select": {
316
+
317
+ if((isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL))
318
+ $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;
319
+ else
320
+ $value = '';
321
+
322
+ $element_quantity = (isset($_POST['wdform_'.$i."element_quantity".$id]) ? $_POST['wdform_'.$i."element_quantity".$id] : NULL);
323
+ if(isset($element_quantity) && $value!='')
324
+ $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);
325
+
326
+
327
+ for($k=0; $k<50; $k++) {
328
+ $temp_val = (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL);
329
+ if(isset($temp_val) && $value!='') {
330
+ $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***';
331
+ }
332
+ }
333
+
334
+ break;
335
+ }
336
+
337
+ case "type_paypal_radio": {
338
+
339
+ if((isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL))
340
+ $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;
341
+ else
342
+ $value='';
343
+
344
+
345
+ $element_quantity = (isset($_POST['wdform_'.$i."element_quantity".$id]) ? $_POST['wdform_'.$i."element_quantity".$id] : NULL);
346
+ if(isset($element_quantity) && $value!='')
347
+ $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***';
348
+
349
+
350
+ for($k=0; $k<50; $k++) {
351
+ $temp_val = (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL);
352
+ if(isset($temp_val) && $value!='') {
353
+
354
+ $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***';
355
+ }
356
+ }
357
+
358
+ break;
359
+ }
360
+
361
+ case "type_paypal_shipping": {
362
+
363
+ if((isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL))
364
+ $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;
365
+ else
366
+ $value='';
367
+ $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);
368
+
369
+ $paypal['shipping'] = (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL);
370
+
371
+ break;
372
+ }
373
+
374
+ case "type_paypal_checkbox": {
375
+ $start=-1;
376
+ $value='';
377
+ for($j=0; $j<100; $j++) {
378
+
379
+ $element = (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL);
380
+
381
+ if(isset($element)) {
382
+ $start=$j;
383
+ break;
384
+ }
385
+ }
386
+
387
+ $other_element_id = -1;
388
+ $is_other = (isset($_POST['wdform_'.$i."_allow_other".$id]) ? $_POST['wdform_'.$i."_allow_other".$id] : NULL);
389
+ if($is_other=="yes") {
390
+ $other_element_id = (isset($_POST['wdform_'.$i."_allow_other_num".$id]) ? $_POST['wdform_'.$i."_allow_other_num".$id] : NULL);
391
+ }
392
+
393
+ if($start!=-1) {
394
+ for($j=$start; $j<100; $j++) {
395
+ $element = (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL);
396
+ if(isset($element))
397
+ if($j==$other_element_id) {
398
+ $value = $value . (isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : NULL) . '***br***';
399
+
400
+ }
401
+ else {
402
+
403
+ $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***';
404
+
405
+ }
406
+ }
407
+
408
+ $element_quantity = (isset($_POST['wdform_'.$i."element_quantity".$id]) ? $_POST['wdform_'.$i."element_quantity".$id] : NULL);
409
+ if(isset($element_quantity))
410
+ $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***';
411
+
412
+ for($k=0; $k<50; $k++) {
413
+ $temp_val = (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL);
414
+ if(isset($temp_val)) {
415
+
416
+ $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***';
417
+ }
418
+ }
419
+
420
+ }
421
+
422
+
423
+ break;
424
+ }
425
+
426
+ case "type_star_rating": {
427
+
428
+ if((isset($_POST['wdform_'.$i."_selected_star_amount".$id]) ? $_POST['wdform_'.$i."_selected_star_amount".$id] : NULL) == "")
429
+ $selected_star_amount = 0;
430
+ else {
431
+ $selected_star_amount = (isset($_POST['wdform_'.$i."_selected_star_amount".$id]) ? $_POST['wdform_'.$i."_selected_star_amount".$id] : NULL);
432
+ }
433
+ $value = $selected_star_amount . '/' . (isset($_POST['wdform_'.$i."_star_amount".$id]) ? $_POST['wdform_'.$i."_star_amount".$id] : NULL);
434
+ break;
435
+ }
436
+
437
+ case "type_scale_rating": {
438
+
439
+ $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);
440
+ break;
441
+ }
442
+
443
+ case "type_spinner": {
444
+ $value = (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL);
445
+
446
+ break;
447
+ }
448
+
449
+ case "type_slider": {
450
+ $value = (isset($_POST['wdform_'.$i."_slider_value".$id]) ? $_POST['wdform_'.$i."_slider_value".$id] : NULL);
451
+
452
+ break;
453
+ }
454
+ case "type_range": {
455
+ $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);
456
+
457
+ break;
458
+ }
459
+ case "type_grading": {
460
+ $value ="";
461
+ $items = explode(":",(isset($_POST['wdform_'.$i."_hidden_item".$id]) ? $_POST['wdform_'.$i."_hidden_item".$id] : NULL));
462
+ for($k=0; $k<sizeof($items)-1; $k++)
463
+ $value .= (isset($_POST['wdform_'.$i."_element".$id.'_'.$k]) ? $_POST['wdform_'.$i."_element".$id.'_'.$k] : NULL) . ':';
464
+
465
+ $value .= (isset($_POST['wdform_'.$i."_hidden_item".$id]) ? $_POST['wdform_'.$i."_hidden_item".$id] : NULL) . '***grading***';
466
+
467
+ break;
468
+ }
469
+
470
+ case "type_matrix": {
471
+
472
+ $rows_of_matrix = explode("***",(isset($_POST['wdform_'.$i."_hidden_row".$id]) ? $_POST['wdform_'.$i."_hidden_row".$id] : NULL));
473
+ $rows_count = sizeof($rows_of_matrix)-1;
474
+ $column_of_matrix = explode("***",(isset($_POST['wdform_'.$i."_hidden_column".$id]) ? $_POST['wdform_'.$i."_hidden_column".$id] : NULL));
475
+ $columns_count = sizeof($column_of_matrix)-1;
476
+
477
+
478
+ if((isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) == "radio") {
479
+ $input_value="";
480
+
481
+ for($k=1; $k<=$rows_count; $k++)
482
+ $input_value .= (isset($_POST['wdform_'.$i."_input_element".$id.$k]) ? $_POST['wdform_'.$i."_input_element".$id.$k] : 0) ."***";
483
+
484
+ }
485
+ if((isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) == "checkbox") {
486
+ $input_value="";
487
+
488
+ for($k=1; $k<=$rows_count; $k++)
489
+ for($j=1; $j<=$columns_count; $j++)
490
+ $input_value .= (isset($_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j]) ? $_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j] : 0) . "***";
491
+ }
492
+
493
+ if((isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) == "text") {
494
+ $input_value="";
495
+ for($k=1; $k<=$rows_count; $k++)
496
+ for($j=1; $j<=$columns_count; $j++)
497
+ $input_value .= (isset($_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j]) ? $_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j] : NULL) . "***";
498
+ }
499
+
500
+ if((isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) == "select") {
501
+ $input_value="";
502
+ for($k=1; $k<=$rows_count; $k++)
503
+ for($j=1; $j<=$columns_count; $j++)
504
+ $input_value .= (isset($_POST['wdform_'.$i."_select_yes_no".$id.$k.'_'.$j]) ? $_POST['wdform_'.$i."_select_yes_no".$id.$k.'_'.$j] : NULL) . "***";
505
+ }
506
+
507
+ $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***';
508
+
509
+ break;
510
+ }
511
+
512
+ }
513
+
514
+ if($type == "type_address")
515
+ if($value == '*#*#*#')
516
+ continue;
517
+
518
+
519
+ if($value) {
520
+ $query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $group_id . "' AND element_label='" . $i . "'";
521
+ $result = $wpdb->get_var($query);
522
+
523
+ if($result) {
524
+ $save = $wpdb->update($wpdb->prefix . "formmaker_submits", array(
525
+ 'element_value' => stripslashes($value),
526
+ ), array(
527
+ 'group_id' => $group_id,
528
+ 'element_label' => $i
529
+ ), array(
530
+ '%s',
531
+ ), array(
532
+ '%d',
533
+ '%s'
534
+ ));
535
+ }
536
+ else {
537
+
538
+ $save = $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
539
+ 'form_id' => $form_id,
540
+ 'element_label' => $i,
541
+ 'element_value' => stripslashes($value),
542
+ 'group_id' => $group_id,
543
+ 'date' => $date,
544
+ 'ip' => $ip
545
+ ), array(
546
+ '%d',
547
+ '%s',
548
+ '%s',
549
+ '%d',
550
+ '%s',
551
+ '%s'
552
+ )
553
+ );
554
+
555
+
556
+ }
557
+ }
558
+
559
+
560
+
561
+ }
562
+ }
563
+
564
+ else {
565
+
566
+ foreach ($label_id as $key => $label_id_1) {
567
+ $element_value = (isset($_POST["submission_" . $label_id_1]) ? esc_html(stripslashes($_POST["submission_" . $label_id_1])) : " ");
568
+ if (isset($_POST["submission_" . $label_id_1])) {
569
+ $query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
570
+ $result = $wpdb->get_var($query);
571
+ if ($label_type[$key] == 'type_file_upload')
572
+ if ($element_value)
573
+ $element_value = $element_value . "*@@url@@*";
574
+ if ($result) {
575
+ $save = $wpdb->update($wpdb->prefix . "formmaker_submits", array(
576
+ 'element_value' => stripslashes($element_value),
577
+ ), array(
578
+ 'group_id' => $id,
579
+ 'element_label' => $label_id_1
580
+ ), array(
581
+ '%s',
582
+ ), array(
583
+ '%d',
584
+ '%s'
585
+ ));
586
+ }
587
+ else {
588
+ $save = $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
589
+ 'form_id' => $form_id,
590
+ 'element_label' => $label_id_1,
591
+ 'element_value' => stripslashes($element_value),
592
+ 'group_id' => $id,
593
+ 'date' => $date,
594
+ 'ip' => $ip
595
+ ), array(
596
+ '%d',
597
+ '%s',
598
+ '%s',
599
+ '%d',
600
+ '%s',
601
+ '%s'
602
+ )
603
+ );
604
+ }
605
+ }
606
+ else {
607
+ $element_value_ch = (isset($_POST["submission_" . $label_id_1 . '_0']) ? esc_html(stripslashes($_POST["submission_" . $label_id_1 . '_0'])) : " ");
608
+ if (isset($_POST["submission_" . $label_id_1 . '_0'])) {
609
+ for ($z = 0; $z < 21; $z++) {
610
+ $element_value_ch = $_POST["submission_" . $label_id_1 . '_' . $z];
611
+ if (isset($element_value_ch))
612
+ $element_value = $element_value . $element_value_ch . '***br***';
613
+ else
614
+ break;
615
+ }
616
+ $query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
617
+ $result = $wpdb->get_var($query);
618
+ if ($result) {
619
+ $query = "UPDATE " . $wpdb->prefix . "formmaker_submits SET `element_value`='" . stripslashes($element_value) . "' WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
620
+ $save = $wpdb->update($wpdb->prefix . "formmaker_submits", array(
621
+ 'element_value' => stripslashes($element_value),
622
+ ), array(
623
+ 'group_id' => $id,
624
+ 'element_label' => $label_id_1
625
+ ), array(
626
+ '%s',
627
+ ), array(
628
+ '%d',
629
+ '%s'
630
+ ));
631
+ }
632
+ else {
633
+ $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 . "')";
634
+ $save = $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
635
+ 'form_id' => $form_id,
636
+ 'element_label' => $label_id_1,
637
+ 'element_value' => stripslashes($element_value),
638
+ 'group_id' => $id,
639
+ 'date' => $date,
640
+ 'ip' => $ip
641
+ ), array(
642
+ '%d',
643
+ '%s',
644
+ '%s',
645
+ '%d',
646
+ '%s',
647
+ '%s'
648
+ )
649
+ );
650
+ }
651
+ }
652
+ }
653
+ }
654
+ }
655
+ if ($save !== FALSE) {
656
+ echo WDW_FMC_Library::message('Submission Succesfully Saved.', 'updated');
657
+ }
658
+ else {
659
+ echo WDW_FMC_Library::message('Error. Please install plugin again.', 'error');
660
+ }
661
+ }
662
+
663
+ public function delete($id) {
664
+ global $wpdb;
665
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
666
+ $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id="%d"', $id);
667
+ if ($wpdb->query($query)) {
668
+ echo WDW_FMC_Library::message('Item Succesfully Deleted.', 'updated');
669
+ }
670
+ else {
671
+ echo WDW_FMC_Library::message('Error. Please install plugin again.', 'error');
672
+ }
673
+ $this->display($form_id);
674
+ }
675
+
676
+ public function delete_all() {
677
+ global $wpdb;
678
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
679
+ $cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
680
+ if (count($cid)) {
681
+ $cids = implode(',', $cid);
682
+ $query = 'DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( ' . $cids . ' )';
683
+ if ($wpdb->query($query)) {
684
+ echo WDW_FMC_Library::message('Items Succesfully Deleted.', 'updated');
685
+ }
686
+ else {
687
+ echo WDW_FMC_Library::message('Error. Please install plugin again.', 'error');
688
+ }
689
+ }
690
+ else {
691
+ echo WDW_FMC_Library::message('You must select at least one item.', 'error');
692
+ }
693
+ $this->display($form_id);
694
+ }
695
+
696
+ public function block_ip() {
697
+ global $wpdb;
698
+ $flag = FALSE;
699
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
700
+ $cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
701
+ if (count($cid)) {
702
+ $cids = implode(',', $cid);
703
+ $query = 'SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( '. $cids .' )';
704
+ $rows = $wpdb->get_results($query);
705
+ foreach ($rows as $row) {
706
+ $ips = $wpdb->get_var($wpdb->prepare('SELECT ip FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $row->ip));
707
+ $flag = TRUE;
708
+ if (!$ips) {
709
+ $save = $wpdb->insert($wpdb->prefix . 'formmaker_blocked', array(
710
+ 'ip' => $row->ip,
711
+ ), array(
712
+ '%s',
713
+ ));
714
+ }
715
+ }
716
+ }
717
+ if ($flag) {
718
+ echo WDW_FMC_Library::message('IPs Succesfully Blocked.', 'updated');
719
+ }
720
+ else {
721
+ echo WDW_FMC_Library::message('You must select at least one item.', 'error');
722
+ }
723
+ $this->display($form_id);
724
+ }
725
+
726
+ public function unblock_ip() {
727
+ global $wpdb;
728
+ $flag = FALSE;
729
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
730
+ $cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
731
+ if (count($cid)) {
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
+ $flag = TRUE;
737
+ $ips = $wpdb->get_var($wpdb->prepare('SELECT ip FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $row->ip));
738
+ if ($ips) {
739
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $ips));
740
+ }
741
+ }
742
+ }
743
+ if ($flag) {
744
+ echo WDW_FMC_Library::message('IPs Succesfully Unblocked.', 'updated');
745
+ }
746
+ else {
747
+ echo WDW_FMC_Library::message('You must select at least one item.', 'error');
748
+ }
749
+ $this->display($form_id);
750
+ }
751
+
752
+ ////////////////////////////////////////////////////////////////////////////////////////
753
+ // Getters & Setters //
754
+ ////////////////////////////////////////////////////////////////////////////////////////
755
+ ////////////////////////////////////////////////////////////////////////////////////////
756
+ // Private Methods //
757
+ ////////////////////////////////////////////////////////////////////////////////////////
758
+ ////////////////////////////////////////////////////////////////////////////////////////
759
+ // Listeners //
760
+ ////////////////////////////////////////////////////////////////////////////////////////
761
  }
admin/controllers/FMControllerThemes_fmc.php CHANGED
@@ -1,190 +1,190 @@
1
- <?php
2
-
3
- class FMControllerThemes_fmc {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $task = WDW_FMC_Library::get('task');
23
- $id = WDW_FMC_Library::get('current_id', 0);
24
- $message = WDW_FMC_Library::get('message');
25
- echo WDW_FMC_Library::message_id($message);
26
- // $task = ((isset($_POST['task'])) ? esc_html($_POST['task']) : '');
27
- // $id = ((isset($_POST['current_id'])) ? esc_html($_POST['current_id']) : 0);
28
- if (method_exists($this, $task)) {
29
- $this->$task($id);
30
- }
31
- else {
32
- $this->display();
33
- }
34
- }
35
-
36
- public function display() {
37
- require_once WD_FMC_DIR . "/admin/models/FMModelThemes_fmc.php";
38
- $model = new FMModelThemes_fmc();
39
-
40
- require_once WD_FMC_DIR . "/admin/views/FMViewThemes_fmc.php";
41
- $view = new FMViewThemes_fmc($model);
42
- $view->display();
43
- }
44
-
45
- public function add() {
46
- require_once WD_FMC_DIR . "/admin/models/FMModelThemes_fmc.php";
47
- $model = new FMModelThemes_fmc();
48
-
49
- require_once WD_FMC_DIR . "/admin/views/FMViewThemes_fmc.php";
50
- $view = new FMViewThemes_fmc($model);
51
- $view->edit(0, FALSE);
52
- }
53
-
54
- public function edit() {
55
- require_once WD_FMC_DIR . "/admin/models/FMModelThemes_fmc.php";
56
- $model = new FMModelThemes_fmc();
57
-
58
- require_once WD_FMC_DIR . "/admin/views/FMViewThemes_fmc.php";
59
- $view = new FMViewThemes_fmc($model);
60
- // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
61
- $id = WDW_FMC_Library::get('current_id', 0);
62
- $view->edit($id, FALSE);
63
- }
64
-
65
- public function save() {
66
- $message = $this->save_db();
67
- // $this->display();
68
- $page = WDW_FMC_Library::get('page');
69
- WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
70
- }
71
-
72
- public function apply() {
73
- $message = $this->save_db();
74
- global $wpdb;
75
- // if (!isset($_POST['current_id']) || (esc_html($_POST['current_id']) == 0) || (esc_html($_POST['current_id']) == '')) {
76
-
77
- // }
78
- $id = (int) $wpdb->get_var('SELECT MAX(`id`) FROM ' . $wpdb->prefix . 'formmaker_themes');
79
- $current_id = WDW_FMC_Library::get('current_id', $id);
80
- $page = WDW_FMC_Library::get('page');
81
- WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
82
- // $this->edit();
83
- }
84
-
85
- public function save_db() {
86
- global $wpdb;
87
- // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes( $_POST['current_id'])) : 0);
88
- $id = (int) WDW_FMC_Library::get('current_id', 0);
89
- $title = (isset($_POST['title']) ? esc_html(stripslashes( $_POST['title'])) : '');
90
- $css = (isset($_POST['css']) ? stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST['css'])) : '');
91
- $default = (isset($_POST['default']) ? esc_html(stripslashes( $_POST['default'])) : 0);
92
- if ($id != 0) {
93
- $save = $wpdb->update($wpdb->prefix . 'formmaker_themes', array(
94
- 'title' => $title,
95
- 'css' => $css,
96
- 'default' => $default,
97
- ), array('id' => $id));
98
- }
99
- else {
100
- $save = $wpdb->insert($wpdb->prefix . 'formmaker_themes', array(
101
- 'title' => $title,
102
- 'css' => $css,
103
- 'default' => $default,
104
- ), array(
105
- '%s',
106
- '%s',
107
- '%d',
108
- ));
109
- }
110
- if ($save !== FALSE) {
111
- return 1;
112
- }
113
- else {
114
- return 2;
115
- }
116
- }
117
-
118
- public function delete($id) {
119
- global $wpdb;
120
- $isDefault = $wpdb->get_var($wpdb->prepare('SELECT default FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id));
121
- if ($isDefault) {
122
- $message = 4;
123
- }
124
- else {
125
- $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id);
126
- if ($wpdb->query($query)) {
127
- $message = 3;
128
- }
129
- else {
130
- $message = 2;
131
- }
132
- }
133
- // $this->display();
134
- $page = WDW_FMC_Library::get('page');
135
- WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
136
- }
137
-
138
- public function delete_all() {
139
- global $wpdb;
140
- $flag = FALSE;
141
- $isDefault = FALSE;
142
- $theme_ids_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker_themes');
143
- foreach ($theme_ids_col as $theme_id) {
144
- if (isset($_POST['check_' . $theme_id])) {
145
- $isDefault = $wpdb->get_var($wpdb->prepare('SELECT default FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $theme_id));
146
- if ($isDefault) {
147
- $message = 4;
148
- }
149
- else {
150
- $flag = TRUE;
151
- $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $theme_id));
152
- }
153
- }
154
- }
155
- if ($flag) {
156
- $message = 5;
157
- }
158
- else {
159
- $message = 6;
160
- }
161
- // $this->display();
162
- $page = WDW_FMC_Library::get('page');
163
- WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
164
- }
165
-
166
- public function setdefault($id) {
167
- global $wpdb;
168
- $wpdb->update($wpdb->prefix . 'formmaker_themes', array('default' => 0), array('default' => 1));
169
- $save = $wpdb->update($wpdb->prefix . 'formmaker_themes', array('default' => 1), array('id' => $id));
170
- if ($save !== FALSE) {
171
- $message = 7;
172
- }
173
- else {
174
- $message = 2;
175
- }
176
- // $this->display();
177
- $page = WDW_FMC_Library::get('page');
178
- WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
179
- }
180
-
181
- ////////////////////////////////////////////////////////////////////////////////////////
182
- // Getters & Setters //
183
- ////////////////////////////////////////////////////////////////////////////////////////
184
- ////////////////////////////////////////////////////////////////////////////////////////
185
- // Private Methods //
186
- ////////////////////////////////////////////////////////////////////////////////////////
187
- ////////////////////////////////////////////////////////////////////////////////////////
188
- // Listeners //
189
- ////////////////////////////////////////////////////////////////////////////////////////
190
  }
1
+ <?php
2
+
3
+ class FMControllerThemes_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $task = WDW_FMC_Library::get('task');
23
+ $id = WDW_FMC_Library::get('current_id', 0);
24
+ $message = WDW_FMC_Library::get('message');
25
+ echo WDW_FMC_Library::message_id($message);
26
+ // $task = ((isset($_POST['task'])) ? esc_html($_POST['task']) : '');
27
+ // $id = ((isset($_POST['current_id'])) ? esc_html($_POST['current_id']) : 0);
28
+ if (method_exists($this, $task)) {
29
+ $this->$task($id);
30
+ }
31
+ else {
32
+ $this->display();
33
+ }
34
+ }
35
+
36
+ public function display() {
37
+ require_once WD_FMC_DIR . "/admin/models/FMModelThemes_fmc.php";
38
+ $model = new FMModelThemes_fmc();
39
+
40
+ require_once WD_FMC_DIR . "/admin/views/FMViewThemes_fmc.php";
41
+ $view = new FMViewThemes_fmc($model);
42
+ $view->display();
43
+ }
44
+
45
+ public function add() {
46
+ require_once WD_FMC_DIR . "/admin/models/FMModelThemes_fmc.php";
47
+ $model = new FMModelThemes_fmc();
48
+
49
+ require_once WD_FMC_DIR . "/admin/views/FMViewThemes_fmc.php";
50
+ $view = new FMViewThemes_fmc($model);
51
+ $view->edit(0, FALSE);
52
+ }
53
+
54
+ public function edit() {
55
+ require_once WD_FMC_DIR . "/admin/models/FMModelThemes_fmc.php";
56
+ $model = new FMModelThemes_fmc();
57
+
58
+ require_once WD_FMC_DIR . "/admin/views/FMViewThemes_fmc.php";
59
+ $view = new FMViewThemes_fmc($model);
60
+ // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
61
+ $id = WDW_FMC_Library::get('current_id', 0);
62
+ $view->edit($id, FALSE);
63
+ }
64
+
65
+ public function save() {
66
+ $message = $this->save_db();
67
+ // $this->display();
68
+ $page = WDW_FMC_Library::get('page');
69
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
70
+ }
71
+
72
+ public function apply() {
73
+ $message = $this->save_db();
74
+ global $wpdb;
75
+ // if (!isset($_POST['current_id']) || (esc_html($_POST['current_id']) == 0) || (esc_html($_POST['current_id']) == '')) {
76
+
77
+ // }
78
+ $id = (int) $wpdb->get_var('SELECT MAX(`id`) FROM ' . $wpdb->prefix . 'formmaker_themes');
79
+ $current_id = WDW_FMC_Library::get('current_id', $id);
80
+ $page = WDW_FMC_Library::get('page');
81
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
82
+ // $this->edit();
83
+ }
84
+
85
+ public function save_db() {
86
+ global $wpdb;
87
+ // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes( $_POST['current_id'])) : 0);
88
+ $id = (int) WDW_FMC_Library::get('current_id', 0);
89
+ $title = (isset($_POST['title']) ? esc_html(stripslashes( $_POST['title'])) : '');
90
+ $css = (isset($_POST['css']) ? stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST['css'])) : '');
91
+ $default = (isset($_POST['default']) ? esc_html(stripslashes( $_POST['default'])) : 0);
92
+ if ($id != 0) {
93
+ $save = $wpdb->update($wpdb->prefix . 'formmaker_themes', array(
94
+ 'title' => $title,
95
+ 'css' => $css,
96
+ 'default' => $default,
97
+ ), array('id' => $id));
98
+ }
99
+ else {
100
+ $save = $wpdb->insert($wpdb->prefix . 'formmaker_themes', array(
101
+ 'title' => $title,
102
+ 'css' => $css,
103
+ 'default' => $default,
104
+ ), array(
105
+ '%s',
106
+ '%s',
107
+ '%d',
108
+ ));
109
+ }
110
+ if ($save !== FALSE) {
111
+ return 1;
112
+ }
113
+ else {
114
+ return 2;
115
+ }
116
+ }
117
+
118
+ public function delete($id) {
119
+ global $wpdb;
120
+ $isDefault = $wpdb->get_var($wpdb->prepare('SELECT default FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id));
121
+ if ($isDefault) {
122
+ $message = 4;
123
+ }
124
+ else {
125
+ $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id);
126
+ if ($wpdb->query($query)) {
127
+ $message = 3;
128
+ }
129
+ else {
130
+ $message = 2;
131
+ }
132
+ }
133
+ // $this->display();
134
+ $page = WDW_FMC_Library::get('page');
135
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
136
+ }
137
+
138
+ public function delete_all() {
139
+ global $wpdb;
140
+ $flag = FALSE;
141
+ $isDefault = FALSE;
142
+ $theme_ids_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker_themes');
143
+ foreach ($theme_ids_col as $theme_id) {
144
+ if (isset($_POST['check_' . $theme_id])) {
145
+ $isDefault = $wpdb->get_var($wpdb->prepare('SELECT default FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $theme_id));
146
+ if ($isDefault) {
147
+ $message = 4;
148
+ }
149
+ else {
150
+ $flag = TRUE;
151
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $theme_id));
152
+ }
153
+ }
154
+ }
155
+ if ($flag) {
156
+ $message = 5;
157
+ }
158
+ else {
159
+ $message = 6;
160
+ }
161
+ // $this->display();
162
+ $page = WDW_FMC_Library::get('page');
163
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
164
+ }
165
+
166
+ public function setdefault($id) {
167
+ global $wpdb;
168
+ $wpdb->update($wpdb->prefix . 'formmaker_themes', array('default' => 0), array('default' => 1));
169
+ $save = $wpdb->update($wpdb->prefix . 'formmaker_themes', array('default' => 1), array('id' => $id));
170
+ if ($save !== FALSE) {
171
+ $message = 7;
172
+ }
173
+ else {
174
+ $message = 2;
175
+ }
176
+ // $this->display();
177
+ $page = WDW_FMC_Library::get('page');
178
+ WDW_FMC_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
179
+ }
180
+
181
+ ////////////////////////////////////////////////////////////////////////////////////////
182
+ // Getters & Setters //
183
+ ////////////////////////////////////////////////////////////////////////////////////////
184
+ ////////////////////////////////////////////////////////////////////////////////////////
185
+ // Private Methods //
186
+ ////////////////////////////////////////////////////////////////////////////////////////
187
+ ////////////////////////////////////////////////////////////////////////////////////////
188
+ // Listeners //
189
+ ////////////////////////////////////////////////////////////////////////////////////////
190
  }
admin/controllers/FMControllerUninstall_fmc.php CHANGED
@@ -1,57 +1,57 @@
1
- <?php
2
-
3
- class FMControllerUninstall_fmc {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function execute() {
22
- $task = ((isset($_POST['task'])) ? esc_html(stripslashes($_POST['task'])) : '');
23
- if (method_exists($this, $task)) {
24
- $this->$task();
25
- }
26
- else {
27
- $this->display();
28
- }
29
- }
30
-
31
- public function display() {
32
- require_once WD_FMC_DIR . "/admin/models/FMModelUninstall_fmc.php";
33
- $model = new FMModelUninstall_fmc();
34
-
35
- require_once WD_FMC_DIR . "/admin/views/FMViewUninstall_fmc.php";
36
- $view = new FMViewUninstall_fmc($model);
37
- $view->display();
38
- }
39
-
40
- public function uninstall() {
41
- require_once WD_FMC_DIR . "/admin/models/FMModelUninstall_fmc.php";
42
- $model = new FMModelUninstall_fmc();
43
-
44
- require_once WD_FMC_DIR . "/admin/views/FMViewUninstall_fmc.php";
45
- $view = new FMViewUninstall_fmc($model);
46
- $view->uninstall();
47
- }
48
- ////////////////////////////////////////////////////////////////////////////////////////
49
- // Getters & Setters //
50
- ////////////////////////////////////////////////////////////////////////////////////////
51
- ////////////////////////////////////////////////////////////////////////////////////////
52
- // Private Methods //
53
- ////////////////////////////////////////////////////////////////////////////////////////
54
- ////////////////////////////////////////////////////////////////////////////////////////
55
- // Listeners //
56
- ////////////////////////////////////////////////////////////////////////////////////////
57
  }
1
+ <?php
2
+
3
+ class FMControllerUninstall_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $task = ((isset($_POST['task'])) ? esc_html(stripslashes($_POST['task'])) : '');
23
+ if (method_exists($this, $task)) {
24
+ $this->$task();
25
+ }
26
+ else {
27
+ $this->display();
28
+ }
29
+ }
30
+
31
+ public function display() {
32
+ require_once WD_FMC_DIR . "/admin/models/FMModelUninstall_fmc.php";
33
+ $model = new FMModelUninstall_fmc();
34
+
35
+ require_once WD_FMC_DIR . "/admin/views/FMViewUninstall_fmc.php";
36
+ $view = new FMViewUninstall_fmc($model);
37
+ $view->display();
38
+ }
39
+
40
+ public function uninstall() {
41
+ require_once WD_FMC_DIR . "/admin/models/FMModelUninstall_fmc.php";
42
+ $model = new FMModelUninstall_fmc();
43
+
44
+ require_once WD_FMC_DIR . "/admin/views/FMViewUninstall_fmc.php";
45
+ $view = new FMViewUninstall_fmc($model);
46
+ $view->uninstall();
47
+ }
48
+ ////////////////////////////////////////////////////////////////////////////////////////
49
+ // Getters & Setters //
50
+ ////////////////////////////////////////////////////////////////////////////////////////
51
+ ////////////////////////////////////////////////////////////////////////////////////////
52
+ // Private Methods //
53
+ ////////////////////////////////////////////////////////////////////////////////////////
54
+ ////////////////////////////////////////////////////////////////////////////////////////
55
+ // Listeners //
56
+ ////////////////////////////////////////////////////////////////////////////////////////
57
  }
admin/controllers/FMControllerWidget_fmc.php CHANGED
@@ -1,61 +1,61 @@
1
- <?php
2
-
3
- class FMControllerWidget_fmc 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 Contact Form Maker widget.'
22
- );
23
- // Widget Control Settings.
24
- $control_ops = array('id_base' => 'form_maker_widget');
25
- // Create the widget.
26
- $this->WP_Widget('form_maker_widget', 'Contact Form Maker', $widget_ops, $control_ops);
27
- require_once WD_FMC_DIR . "/admin/models/FMModelWidget_fmc.php";
28
- $this->model = new FMModelWidget_fmc();
29
-
30
- require_once WD_FMC_DIR . "/admin/views/FMViewWidget_fmc.php";
31
- $this->view = new FMViewWidget_fmc($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_fmc 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 Contact Form Maker widget.'
22
+ );
23
+ // Widget Control Settings.
24
+ $control_ops = array('id_base' => 'form_maker_widget');
25
+ // Create the widget.
26
+ $this->WP_Widget('form_maker_widget', 'Contact Form Maker', $widget_ops, $control_ops);
27
+ require_once WD_FMC_DIR . "/admin/models/FMModelWidget_fmc.php";
28
+ $this->model = new FMModelWidget_fmc();
29
+
30
+ require_once WD_FMC_DIR . "/admin/views/FMViewWidget_fmc.php";
31
+ $this->view = new FMViewWidget_fmc($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_fmc.php CHANGED
@@ -1,73 +1,73 @@
1
- <?php
2
-
3
- class FMModelBlocked_ips_fmc {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function 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'])) ? esc_html($_POST['asc_or_desc']) : 'desc');
25
- $order_by = ' ORDER BY ' . ((isset($_POST['order_by']) && esc_html($_POST['order_by']) != '') ? esc_html($_POST['order_by']) : 'id') . ' ' . $asc_or_desc;
26
- if (isset($_POST['page_number']) && $_POST['page_number']) {
27
- $limit = ((int) $_POST['page_number'] - 1) * 20;
28
- }
29
- else {
30
- $limit = 0;
31
- }
32
- $query = "SELECT * FROM " . $wpdb->prefix . "formmaker_blocked " . $where . $order_by . " LIMIT " . $limit . ",20";
33
- $rows = $wpdb->get_results($query);
34
- return $rows;
35
- }
36
-
37
- public function get_row_data($id) {
38
- global $wpdb;
39
- if ($id != 0) {
40
- $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $id));
41
- }
42
- else {
43
- $row->id = 0;
44
- $row->ip = '';
45
- }
46
- return $row;
47
- }
48
-
49
- public function page_nav() {
50
- global $wpdb;
51
- $where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE `ip` LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
52
- $query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker_blocked " . $where;
53
- $total = $wpdb->get_var($query);
54
- $page_nav['total'] = $total;
55
- if (isset($_POST['page_number']) && $_POST['page_number']) {
56
- $limit = ((int) $_POST['page_number'] - 1) * 20;
57
- }
58
- else {
59
- $limit = 0;
60
- }
61
- $page_nav['limit'] = (int) ($limit / 20 + 1);
62
- return $page_nav;
63
- }
64
- ////////////////////////////////////////////////////////////////////////////////////////
65
- // Getters & Setters //
66
- ////////////////////////////////////////////////////////////////////////////////////////
67
- ////////////////////////////////////////////////////////////////////////////////////////
68
- // Private Methods //
69
- ////////////////////////////////////////////////////////////////////////////////////////
70
- ////////////////////////////////////////////////////////////////////////////////////////
71
- // Listeners //
72
- ////////////////////////////////////////////////////////////////////////////////////////
73
  }
1
+ <?php
2
+
3
+ class FMModelBlocked_ips_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function 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'])) ? esc_html($_POST['asc_or_desc']) : 'desc');
25
+ $order_by = ' ORDER BY ' . ((isset($_POST['order_by']) && esc_html($_POST['order_by']) != '') ? esc_html($_POST['order_by']) : 'id') . ' ' . $asc_or_desc;
26
+ if (isset($_POST['page_number']) && $_POST['page_number']) {
27
+ $limit = ((int) $_POST['page_number'] - 1) * 20;
28
+ }
29
+ else {
30
+ $limit = 0;
31
+ }
32
+ $query = "SELECT * FROM " . $wpdb->prefix . "formmaker_blocked " . $where . $order_by . " LIMIT " . $limit . ",20";
33
+ $rows = $wpdb->get_results($query);
34
+ return $rows;
35
+ }
36
+
37
+ public function get_row_data($id) {
38
+ global $wpdb;
39
+ if ($id != 0) {
40
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $id));
41
+ }
42
+ else {
43
+ $row->id = 0;
44
+ $row->ip = '';
45
+ }
46
+ return $row;
47
+ }
48
+
49
+ public function page_nav() {
50
+ global $wpdb;
51
+ $where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE `ip` LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
52
+ $query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker_blocked " . $where;
53
+ $total = $wpdb->get_var($query);
54
+ $page_nav['total'] = $total;
55
+ if (isset($_POST['page_number']) && $_POST['page_number']) {
56
+ $limit = ((int) $_POST['page_number'] - 1) * 20;
57
+ }
58
+ else {
59
+ $limit = 0;
60
+ }
61
+ $page_nav['limit'] = (int) ($limit / 20 + 1);
62
+ return $page_nav;
63
+ }
64
+ ////////////////////////////////////////////////////////////////////////////////////////
65
+ // Getters & Setters //
66
+ ////////////////////////////////////////////////////////////////////////////////////////
67
+ ////////////////////////////////////////////////////////////////////////////////////////
68
+ // Private Methods //
69
+ ////////////////////////////////////////////////////////////////////////////////////////
70
+ ////////////////////////////////////////////////////////////////////////////////////////
71
+ // Listeners //
72
+ ////////////////////////////////////////////////////////////////////////////////////////
73
  }
admin/models/FMModelFeatured_plugins_fmc.php CHANGED
@@ -1,30 +1,30 @@
1
- <?php
2
-
3
- class FMModelFeatured_plugins_fmc {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- ////////////////////////////////////////////////////////////////////////////////////////
22
- // Getters & Setters //
23
- ////////////////////////////////////////////////////////////////////////////////////////
24
- ////////////////////////////////////////////////////////////////////////////////////////
25
- // Private Methods //
26
- ////////////////////////////////////////////////////////////////////////////////////////
27
- ////////////////////////////////////////////////////////////////////////////////////////
28
- // Listeners //
29
- ////////////////////////////////////////////////////////////////////////////////////////
30
  }
1
+ <?php
2
+
3
+ class FMModelFeatured_plugins_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ ////////////////////////////////////////////////////////////////////////////////////////
22
+ // Getters & Setters //
23
+ ////////////////////////////////////////////////////////////////////////////////////////
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ // Private Methods //
26
+ ////////////////////////////////////////////////////////////////////////////////////////
27
+ ////////////////////////////////////////////////////////////////////////////////////////
28
+ // Listeners //
29
+ ////////////////////////////////////////////////////////////////////////////////////////
30
  }
admin/models/FMModelFormMakerEditCSS_fmc.php CHANGED
@@ -1,42 +1,42 @@
1
- <?php
2
-
3
- class FMModelFormMakerEditCSS_fmc {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
-
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_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
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_fmc.php CHANGED
@@ -1,42 +1,42 @@
1
- <?php
2
-
3
- class FMModelFormMakerPreview_fmc {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
-
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_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
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/FMModelFormcontactwdcaptcha.php CHANGED
@@ -1,31 +1,31 @@
1
- <?php
2
-
3
- class FMModelFormcontactwdcaptcha {
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 FMModelFormcontactwdcaptcha {
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/FMModelFormcontactwindow.php CHANGED
@@ -1,36 +1,36 @@
1
- <?php
2
-
3
- class FMModelFormcontactwindow {
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` 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 FMModelFormcontactwindow {
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` 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/FMModelFromipinfoinpopup_fmc.php CHANGED
@@ -1,31 +1,31 @@
1
- <?php
2
-
3
- class FMModelFromipinfoinpopup_fmc {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
-
22
- ////////////////////////////////////////////////////////////////////////////////////////
23
- // Getters & Setters //
24
- ////////////////////////////////////////////////////////////////////////////////////////
25
- ////////////////////////////////////////////////////////////////////////////////////////
26
- // Private Methods //
27
- ////////////////////////////////////////////////////////////////////////////////////////
28
- ////////////////////////////////////////////////////////////////////////////////////////
29
- // Listeners //
30
- ////////////////////////////////////////////////////////////////////////////////////////
31
  }
1
+ <?php
2
+
3
+ class FMModelFromipinfoinpopup_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Getters & Setters //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ ////////////////////////////////////////////////////////////////////////////////////////
26
+ // Private Methods //
27
+ ////////////////////////////////////////////////////////////////////////////////////////
28
+ ////////////////////////////////////////////////////////////////////////////////////////
29
+ // Listeners //
30
+ ////////////////////////////////////////////////////////////////////////////////////////
31
  }
admin/models/FMModelFrommapeditinpopup_fmc.php CHANGED
@@ -1,31 +1,31 @@
1
- <?php
2
-
3
- class FMModelFrommapeditinpopup_fmc {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
-
22
- ////////////////////////////////////////////////////////////////////////////////////////
23
- // Getters & Setters //
24
- ////////////////////////////////////////////////////////////////////////////////////////
25
- ////////////////////////////////////////////////////////////////////////////////////////
26
- // Private Methods //
27
- ////////////////////////////////////////////////////////////////////////////////////////
28
- ////////////////////////////////////////////////////////////////////////////////////////
29
- // Listeners //
30
- ////////////////////////////////////////////////////////////////////////////////////////
31
  }
1
+ <?php
2
+
3
+ class FMModelFrommapeditinpopup_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Getters & Setters //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ ////////////////////////////////////////////////////////////////////////////////////////
26
+ // Private Methods //
27
+ ////////////////////////////////////////////////////////////////////////////////////////
28
+ ////////////////////////////////////////////////////////////////////////////////////////
29
+ // Listeners //
30
+ ////////////////////////////////////////////////////////////////////////////////////////
31
  }
admin/models/FMModelGenerete_csv_fmc.php CHANGED
@@ -1,262 +1,262 @@
1
- <?php
2
-
3
- class FMModelGenerete_csv_fmc {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
-
22
- public function get_data() {
23
- $is_paypal_info = FALSE;
24
- global $wpdb;
25
- $params = array();
26
- $form_id = $_REQUEST['form_id'];
27
- $paypal_info_fields = array('currency', 'ord_last_modified', 'status', 'full_name', 'fax', 'mobile_phone', 'email', 'phone', 'address', 'paypal_info', 'ipn', 'tax', 'shipping');
28
- $query = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker_submits where form_id= %d ORDER BY date ASC", $form_id);
29
- $rows = $wpdb->get_results($query);
30
- $n = count($rows);
31
- $labels = array();
32
- for ($i = 0; $i < $n; $i++) {
33
- $row = &$rows[$i];
34
- if (!in_array($row->element_label, $labels)) {
35
- array_push($labels, $row->element_label);
36
- }
37
- }
38
- $label_titles = array();
39
- $sorted_labels = array();
40
- $query_lable = $wpdb->prepare("SELECT label_order,title FROM " . $wpdb->prefix . "formmaker where id= %d", $form_id);
41
- $rows_lable = $wpdb->get_results($query_lable);
42
- $ptn = "/[^a-zA-Z0-9_]/";
43
- $rpltxt = "";
44
- $title = preg_replace($ptn, $rpltxt, $rows_lable[0]->title);
45
- $sorted_labels_id = array();
46
- $sorted_labels = array();
47
- $label_titles = array();
48
- if ($labels) {
49
- $label_id = array();
50
- $label_order = array();
51
- $label_order_original = array();
52
- $label_type = array();
53
- ///stexic
54
- $label_all = explode('#****#', $rows_lable[0]->label_order);
55
- $label_all = array_slice($label_all, 0, count($label_all) - 1);
56
- foreach ($label_all as $key => $label_each) {
57
- $label_id_each = explode('#**id**#', $label_each);
58
- array_push($label_id, $label_id_each[0]);
59
- $label_oder_each = explode('#**label**#', $label_id_each[1]);
60
- array_push($label_order_original, $label_oder_each[0]);
61
- $ptn = "/[^a-zA-Z0-9_]/";
62
- $rpltxt = "";
63
- $label_temp = preg_replace($ptn, $rpltxt, $label_oder_each[0]);
64
- array_push($label_order, $label_temp);
65
- array_push($label_type, $label_oder_each[1]);
66
- }
67
- foreach ($label_id as $key => $label) {
68
- if (in_array($label, $labels)) {
69
- array_push($sorted_labels, $label_order[$key]);
70
- array_push($sorted_labels_id, $label);
71
- array_push($label_titles, stripslashes($label_order_original[$key]));
72
- }
73
- }
74
- }
75
- $m = count($sorted_labels);
76
- $group_id_s = array();
77
- $l = 0;
78
- if (count($rows) > 0 and $m)
79
- for ($i = 0; $i < count($rows); $i++) {
80
- $row = &$rows[$i];
81
- if (!in_array($row->group_id, $group_id_s)) {
82
- array_push($group_id_s, $row->group_id);
83
- }
84
- }
85
- $data = array();
86
- $temp_all = array();
87
- for ($j = 0; $j < $n; $j++) {
88
- $row = &$rows[$j];
89
- $key = $row->group_id;
90
- if (!isset($temp_all[$key])) {
91
- $temp_all[$key] = array();
92
- }
93
- array_push($temp_all[$key], $row);
94
- }
95
- for ($www = 0; $www < count($group_id_s); $www++) {
96
- $i = $group_id_s[$www];
97
- $temp = array();
98
- $temp = $temp_all[$i];
99
- $f = $temp[0];
100
- $date = $f->date;
101
- $ip = $f->ip;
102
- $data_temp['Submit date'] = $date;
103
- $data_temp['Ip'] = $ip;
104
- $ttt = count($temp);
105
- for ($h = 0; $h < $m; $h++) {
106
- $data_temp[stripslashes($label_titles[$h])] = '';
107
- for ($g = 0; $g < $ttt; $g++) {
108
- $t = $temp[$g];
109
- if ($t->element_label == $sorted_labels_id[$h]) {
110
- if (strpos($t->element_value, "*@@url@@*")) {
111
- $file_names = '';
112
- $new_files = explode("*@@url@@*", $t->element_value);
113
- foreach ($new_files as $new_file) {
114
- if ($new_file) {
115
- $file_names .= $new_file . ", ";
116
- }
117
- }
118
- $data_temp[stripslashes($label_titles[$h])] = $file_names;
119
- }
120
- elseif (strpos($t->element_value, "***br***")) {
121
- $element_value = str_replace("***br***", ', ', $t->element_value);
122
- if (strpos($element_value, "***quantity***")) {
123
- $element_value = str_replace("***quantity***", '', $element_value);
124
- }
125
- if (strpos($element_value, "***property***")) {
126
- $element_value = str_replace("***property***", '', $element_value);
127
- }
128
- if(substr($element_value, -2) == ', ') {
129
- $data_temp[stripslashes($label_titles[$h])]= substr($element_value, 0, -2);
130
- }
131
- else {
132
- $data_temp[stripslashes($label_titles[$h])]= $element_value;
133
- }
134
- }
135
- elseif (strpos($t->element_value, "***map***")) {
136
- $data_temp[stripslashes($label_titles[$h])] = 'Longitude:' . str_replace("***map***", ', Latitude:', $t->element_value);
137
- }
138
- elseif (strpos($t->element_value, "***star_rating***")) {
139
- $element = str_replace("***star_rating***", '', $t->element_value);
140
- $element = explode("***", $element);
141
- $data_temp[stripslashes($label_titles[$h])] = ' ' . $element[1] . '/' . $element[0];
142
- }
143
- elseif (strpos($t->element_value, "@@@") || $t->element_value == "@@@" || $t->element_value == "@@@@@@@@@") {
144
- $data_temp[stripslashes($label_titles[$h])] = str_replace("@@@", ' ', $t->element_value);
145
- }
146
- elseif (strpos($t->element_value, "***grading***")) {
147
- $element = str_replace("***grading***", '', $t->element_value);
148
- $grading = explode(":", $element);
149
- $items_count = sizeof($grading) - 1;
150
- $items = "";
151
- $total = "";
152
- for ($k = 0; $k < $items_count / 2; $k++) {
153
- $items .= $grading[$items_count / 2 + $k] . ": " . $grading[$k] . ", ";
154
- $total += $grading[$k];
155
- }
156
- $items .= "Total: " . $total;
157
- $data_temp[stripslashes($label_titles[$h])] = $items;
158
- }
159
- elseif (strpos($t->element_value, "***matrix***")) {
160
- $element = str_replace("***matrix***", '', $t->element_value);
161
- $matrix_value = explode('***', $element);
162
- $matrix_value = array_slice($matrix_value, 0, count($matrix_value) - 1);
163
- $mat_rows = $matrix_value[0];
164
- $mat_columns = $matrix_value[$mat_rows + 1];
165
- $matrix = "";
166
- $aaa = Array();
167
- $var_checkbox = 1;
168
- $selected_value = "";
169
- $selected_value_yes = "";
170
- $selected_value_no = "";
171
- for ($k = 1; $k <= $mat_rows; $k++) {
172
- if ($matrix_value[$mat_rows + $mat_columns + 2] == "radio") {
173
- if ($matrix_value[$mat_rows + $mat_columns + 2 + $k] == 0) {
174
- $checked = "0";
175
- $aaa[1] = "";
176
- }
177
- else {
178
- $aaa = explode("_", $matrix_value[$mat_rows + $mat_columns + 2 + $k]);
179
- }
180
- for ($l = 1; $l <= $mat_columns; $l++) {
181
- if ($aaa[1] == $l) {
182
- $checked = '1';
183
- }
184
- else {
185
- $checked = '0';
186
- }
187
- $matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$checked."; ";
188
- }
189
- }
190
- else {
191
- if ($matrix_value[$mat_rows+$mat_columns + 2] == "checkbox") {
192
- for ($l = 1; $l <= $mat_columns; $l++) {
193
- if ($matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox] == 1) {
194
- $checked = '1';
195
- }
196
- else {
197
- $checked = '0';
198
- }
199
- $matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$checked."; ";
200
- $var_checkbox++;
201
- }
202
- }
203
- else {
204
- if ($matrix_value[$mat_rows+$mat_columns + 2] == "text") {
205
- for ($l = 1; $l <= $mat_columns; $l++) {
206
- $text_value = $matrix_value[$mat_rows+$mat_columns+2+$var_checkbox];
207
- $matrix .='['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$text_value."; ";
208
- $var_checkbox++;
209
- }
210
- }
211
- else {
212
- for ($l = 1; $l <= $mat_columns; $l++) {
213
- $selected_text = $matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox];
214
- $matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows + 1 + $l].']='.$selected_text."; ";
215
- $var_checkbox++;
216
- }
217
- }
218
- }
219
- }
220
- }
221
- $data_temp[stripslashes($label_titles[$h])] = $matrix;
222
- }
223
- else {
224
- $val = htmlspecialchars_decode($t->element_value);
225
- $val = stripslashes(str_replace('&#039;', "'", $val));
226
- $data_temp[stripslashes($label_titles[$h])] = ($t->element_value ? $val : '');
227
- }
228
- }
229
- }
230
- }
231
- $query = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker_sessions where group_id= %d", $f->group_id);
232
- $paypal_info = $wpdb->get_results($query);
233
- if ($paypal_info) {
234
- $is_paypal_info = TRUE;
235
- }
236
- if ($is_paypal_info) {
237
- foreach ($paypal_info_fields as $paypal_info_field) {
238
- if ($paypal_info) {
239
- $data_temp['PAYPAL_' . $paypal_info_field] = $paypal_info[0]->$paypal_info_field;
240
- }
241
- else {
242
- $data_temp['PAYPAL_' . $paypal_info_field] = '';
243
- }
244
- }
245
- }
246
- $data[] = $data_temp;
247
- }
248
- array_push($params, $data);
249
- array_push($params, $title);
250
- array_push($params, $is_paypal_info);
251
- return $params;
252
- }
253
- ////////////////////////////////////////////////////////////////////////////////////////
254
- // Getters & Setters //
255
- ////////////////////////////////////////////////////////////////////////////////////////
256
- ////////////////////////////////////////////////////////////////////////////////////////
257
- // Private Methods //
258
- ////////////////////////////////////////////////////////////////////////////////////////
259
- ////////////////////////////////////////////////////////////////////////////////////////
260
- // Listeners //
261
- ////////////////////////////////////////////////////////////////////////////////////////
262
  }
1
+ <?php
2
+
3
+ class FMModelGenerete_csv_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
22
+ public function get_data() {
23
+ $is_paypal_info = FALSE;
24
+ global $wpdb;
25
+ $params = array();
26
+ $form_id = $_REQUEST['form_id'];
27
+ $paypal_info_fields = array('currency', 'ord_last_modified', 'status', 'full_name', 'fax', 'mobile_phone', 'email', 'phone', 'address', 'paypal_info', 'ipn', 'tax', 'shipping');
28
+ $query = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker_submits where form_id= %d ORDER BY date ASC", $form_id);
29
+ $rows = $wpdb->get_results($query);
30
+ $n = count($rows);
31
+ $labels = array();
32
+ for ($i = 0; $i < $n; $i++) {
33
+ $row = &$rows[$i];
34
+ if (!in_array($row->element_label, $labels)) {
35
+ array_push($labels, $row->element_label);
36
+ }
37
+ }
38
+ $label_titles = array();
39
+ $sorted_labels = array();
40
+ $query_lable = $wpdb->prepare("SELECT label_order,title FROM " . $wpdb->prefix . "formmaker where id= %d", $form_id);
41
+ $rows_lable = $wpdb->get_results($query_lable);
42
+ $ptn = "/[^a-zA-Z0-9_]/";
43
+ $rpltxt = "";
44
+ $title = preg_replace($ptn, $rpltxt, $rows_lable[0]->title);
45
+ $sorted_labels_id = array();
46
+ $sorted_labels = array();
47
+ $label_titles = array();
48
+ if ($labels) {
49
+ $label_id = array();
50
+ $label_order = array();
51
+ $label_order_original = array();
52
+ $label_type = array();
53
+ ///stexic
54
+ $label_all = explode('#****#', $rows_lable[0]->label_order);
55
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
56
+ foreach ($label_all as $key => $label_each) {
57
+ $label_id_each = explode('#**id**#', $label_each);
58
+ array_push($label_id, $label_id_each[0]);
59
+ $label_oder_each = explode('#**label**#', $label_id_each[1]);
60
+ array_push($label_order_original, $label_oder_each[0]);
61
+ $ptn = "/[^a-zA-Z0-9_]/";
62
+ $rpltxt = "";
63
+ $label_temp = preg_replace($ptn, $rpltxt, $label_oder_each[0]);
64
+ array_push($label_order, $label_temp);
65
+ array_push($label_type, $label_oder_each[1]);
66
+ }
67
+ foreach ($label_id as $key => $label) {
68
+ if (in_array($label, $labels)) {
69
+ array_push($sorted_labels, $label_order[$key]);
70
+ array_push($sorted_labels_id, $label);
71
+ array_push($label_titles, stripslashes($label_order_original[$key]));
72
+ }
73
+ }
74
+ }
75
+ $m = count($sorted_labels);
76
+ $group_id_s = array();
77
+ $l = 0;
78
+ if (count($rows) > 0 and $m)
79
+ for ($i = 0; $i < count($rows); $i++) {
80
+ $row = &$rows[$i];
81
+ if (!in_array($row->group_id, $group_id_s)) {
82
+ array_push($group_id_s, $row->group_id);
83
+ }
84
+ }
85
+ $data = array();
86
+ $temp_all = array();
87
+ for ($j = 0; $j < $n; $j++) {
88
+ $row = &$rows[$j];
89
+ $key = $row->group_id;
90
+ if (!isset($temp_all[$key])) {
91
+ $temp_all[$key] = array();
92
+ }
93
+ array_push($temp_all[$key], $row);
94
+ }
95
+ for ($www = 0; $www < count($group_id_s); $www++) {
96
+ $i = $group_id_s[$www];
97
+ $temp = array();
98
+ $temp = $temp_all[$i];
99
+ $f = $temp[0];
100
+ $date = $f->date;
101
+ $ip = $f->ip;
102
+ $data_temp['Submit date'] = $date;
103
+ $data_temp['Ip'] = $ip;
104
+ $ttt = count($temp);
105
+ for ($h = 0; $h < $m; $h++) {
106
+ $data_temp[stripslashes($label_titles[$h])] = '';
107
+ for ($g = 0; $g < $ttt; $g++) {
108
+ $t = $temp[$g];
109
+ if ($t->element_label == $sorted_labels_id[$h]) {
110
+ if (strpos($t->element_value, "*@@url@@*")) {
111
+ $file_names = '';
112
+ $new_files = explode("*@@url@@*", $t->element_value);
113
+ foreach ($new_files as $new_file) {
114
+ if ($new_file) {
115
+ $file_names .= $new_file . ", ";
116
+ }
117
+ }
118
+ $data_temp[stripslashes($label_titles[$h])] = $file_names;
119
+ }
120
+ elseif (strpos($t->element_value, "***br***")) {
121
+ $element_value = str_replace("***br***", ', ', $t->element_value);
122
+ if (strpos($element_value, "***quantity***")) {
123
+ $element_value = str_replace("***quantity***", '', $element_value);
124
+ }
125
+ if (strpos($element_value, "***property***")) {
126
+ $element_value = str_replace("***property***", '', $element_value);
127
+ }
128
+ if(substr($element_value, -2) == ', ') {
129
+ $data_temp[stripslashes($label_titles[$h])]= substr($element_value, 0, -2);
130
+ }
131
+ else {
132
+ $data_temp[stripslashes($label_titles[$h])]= $element_value;
133
+ }
134
+ }
135
+ elseif (strpos($t->element_value, "***map***")) {
136
+ $data_temp[stripslashes($label_titles[$h])] = 'Longitude:' . str_replace("***map***", ', Latitude:', $t->element_value);
137
+ }
138
+ elseif (strpos($t->element_value, "***star_rating***")) {
139
+ $element = str_replace("***star_rating***", '', $t->element_value);
140
+ $element = explode("***", $element);
141
+ $data_temp[stripslashes($label_titles[$h])] = ' ' . $element[1] . '/' . $element[0];
142
+ }
143
+ elseif (strpos($t->element_value, "@@@") || $t->element_value == "@@@" || $t->element_value == "@@@@@@@@@") {
144
+ $data_temp[stripslashes($label_titles[$h])] = str_replace("@@@", ' ', $t->element_value);
145
+ }
146
+ elseif (strpos($t->element_value, "***grading***")) {
147
+ $element = str_replace("***grading***", '', $t->element_value);
148
+ $grading = explode(":", $element);
149
+ $items_count = sizeof($grading) - 1;
150
+ $items = "";
151
+ $total = "";
152
+ for ($k = 0; $k < $items_count / 2; $k++) {
153
+ $items .= $grading[$items_count / 2 + $k] . ": " . $grading[$k] . ", ";
154
+ $total += $grading[$k];
155
+ }
156
+ $items .= "Total: " . $total;
157
+ $data_temp[stripslashes($label_titles[$h])] = $items;
158
+ }
159
+ elseif (strpos($t->element_value, "***matrix***")) {
160
+ $element = str_replace("***matrix***", '', $t->element_value);
161
+ $matrix_value = explode('***', $element);
162
+ $matrix_value = array_slice($matrix_value, 0, count($matrix_value) - 1);
163
+ $mat_rows = $matrix_value[0];
164
+ $mat_columns = $matrix_value[$mat_rows + 1];
165
+ $matrix = "";
166
+ $aaa = Array();
167
+ $var_checkbox = 1;
168
+ $selected_value = "";
169
+ $selected_value_yes = "";
170
+ $selected_value_no = "";
171
+ for ($k = 1; $k <= $mat_rows; $k++) {
172
+ if ($matrix_value[$mat_rows + $mat_columns + 2] == "radio") {
173
+ if ($matrix_value[$mat_rows + $mat_columns + 2 + $k] == 0) {
174
+ $checked = "0";
175
+ $aaa[1] = "";
176
+ }
177
+ else {
178
+ $aaa = explode("_", $matrix_value[$mat_rows + $mat_columns + 2 + $k]);
179
+ }
180
+ for ($l = 1; $l <= $mat_columns; $l++) {
181
+ if ($aaa[1] == $l) {
182
+ $checked = '1';
183
+ }
184
+ else {
185
+ $checked = '0';
186
+ }
187
+ $matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$checked."; ";
188
+ }
189
+ }
190
+ else {
191
+ if ($matrix_value[$mat_rows+$mat_columns + 2] == "checkbox") {
192
+ for ($l = 1; $l <= $mat_columns; $l++) {
193
+ if ($matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox] == 1) {
194
+ $checked = '1';
195
+ }
196
+ else {
197
+ $checked = '0';
198
+ }
199
+ $matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$checked."; ";
200
+ $var_checkbox++;
201
+ }
202
+ }
203
+ else {
204
+ if ($matrix_value[$mat_rows+$mat_columns + 2] == "text") {
205
+ for ($l = 1; $l <= $mat_columns; $l++) {
206
+ $text_value = $matrix_value[$mat_rows+$mat_columns+2+$var_checkbox];
207
+ $matrix .='['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$text_value."; ";
208
+ $var_checkbox++;
209
+ }
210
+ }
211
+ else {
212
+ for ($l = 1; $l <= $mat_columns; $l++) {
213
+ $selected_text = $matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox];
214
+ $matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows + 1 + $l].']='.$selected_text."; ";
215
+ $var_checkbox++;
216
+ }
217
+ }
218
+ }
219
+ }
220
+ }
221
+ $data_temp[stripslashes($label_titles[$h])] = $matrix;
222
+ }
223
+ else {
224
+ $val = htmlspecialchars_decode($t->element_value);
225
+ $val = stripslashes(str_replace('&#039;', "'", $val));
226
+ $data_temp[stripslashes($label_titles[$h])] = ($t->element_value ? $val : '');
227
+ }
228
+ }
229
+ }
230
+ }
231
+ $query = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker_sessions where group_id= %d", $f->group_id);
232
+ $paypal_info = $wpdb->get_results($query);
233
+ if ($paypal_info) {
234
+ $is_paypal_info = TRUE;
235
+ }
236
+ if ($is_paypal_info) {
237
+ foreach ($paypal_info_fields as $paypal_info_field) {
238
+ if ($paypal_info) {
239
+ $data_temp['PAYPAL_' . $paypal_info_field] = $paypal_info[0]->$paypal_info_field;
240
+ }
241
+ else {
242
+ $data_temp['PAYPAL_' . $paypal_info_field] = '';
243
+ }
244
+ }
245
+ }
246
+ $data[] = $data_temp;
247
+ }
248
+ array_push($params, $data);
249
+ array_push($params, $title);
250
+ array_push($params, $is_paypal_info);
251
+ return $params;
252
+ }
253
+ ////////////////////////////////////////////////////////////////////////////////////////
254
+ // Getters & Setters //
255
+ ////////////////////////////////////////////////////////////////////////////////////////
256
+ ////////////////////////////////////////////////////////////////////////////////////////
257
+ // Private Methods //
258
+ ////////////////////////////////////////////////////////////////////////////////////////
259
+ ////////////////////////////////////////////////////////////////////////////////////////
260
+ // Listeners //
261
+ ////////////////////////////////////////////////////////////////////////////////////////
262
  }
admin/models/FMModelGenerete_xml_fmc.php CHANGED
@@ -1,260 +1,260 @@
1
- <?php
2
-
3
- class FMModelGenerete_xml_fmc {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
-
22
- public function get_data() {
23
- $is_paypal_info = FALSE;
24
- global $wpdb;
25
- $params = array();
26
- $form_id = $_REQUEST['form_id'];
27
- $paypal_info_fields = array('ip', 'ord_date', 'ord_last_modified', 'status', 'full_name', 'fax', 'mobile_phone', 'email', 'phone', 'address', 'paypal_info', 'without_paypal_info', 'ipn', 'checkout_method', 'tax', 'shipping', 'shipping_type', 'read');
28
- $query = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker_submits where form_id= %d ORDER BY date ASC", $form_id);
29
- $rows = $wpdb->get_results($query);
30
- $n = count($rows);
31
- $labels = array();
32
- for ($i = 0; $i < $n; $i++) {
33
- $row = &$rows[$i];
34
- if (!in_array($row->element_label, $labels)) {
35
- array_push($labels, $row->element_label);
36
- }
37
- }
38
- $label_titles = array();
39
- $sorted_labels = array();
40
- $query_lable = "SELECT label_order,title FROM " . $wpdb->prefix . "formmaker where id=$form_id ";
41
- $rows_lable = $wpdb->get_results($query_lable);
42
- $ptn = "/[^a-zA-Z0-9_]/";
43
- $rpltxt = "";
44
- $title = preg_replace($ptn, $rpltxt, $rows_lable[0]->title);
45
- $sorted_labels_id = array();
46
- $sorted_labels = array();
47
- $label_titles = array();
48
- if ($labels) {
49
- $label_id = array();
50
- $label_order = array();
51
- $label_order_original = array();
52
- $label_type = array();
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
- $ptn = "/[^a-zA-Z0-9_]/";
61
- $rpltxt = "";
62
- $label_temp = preg_replace($ptn, $rpltxt, $label_oder_each[0]);
63
- array_push($label_order, $label_temp);
64
- array_push($label_type, $label_oder_each[1]);
65
- }
66
- foreach ($label_id as $key => $label) {
67
- if (in_array($label, $labels)) {
68
- array_push($sorted_labels, $label_order[$key]);
69
- array_push($sorted_labels_id, $label);
70
- array_push($label_titles, stripslashes($label_order_original[$key]));
71
- }
72
- }
73
- }
74
- $m = count($sorted_labels);
75
- $group_id_s = array();
76
- $l = 0;
77
- if (count($rows) > 0 and $m) {
78
- for ($i = 0; $i < count($rows); $i++) {
79
- $row = &$rows[$i];
80
- if (!in_array($row->group_id, $group_id_s)) {
81
- array_push($group_id_s, $row->group_id);
82
- }
83
- }
84
- }
85
- $data = array();
86
- $temp_all = array();
87
- for ($j = 0; $j < $n; $j++) {
88
- $row = &$rows[$j];
89
- $key = $row->group_id;
90
- if (!isset($temp_all[$key])) {
91
- $temp_all[$key] = array();
92
- }
93
- array_push($temp_all[$key], $row);
94
- }
95
- for ($www = 0; $www < count($group_id_s); $www++) {
96
- $i = $group_id_s[$www];
97
- $temp = array();
98
- $temp = $temp_all[$i];
99
- $f = $temp[0];
100
- $date = $f->date;
101
- $ip = $f->ip;
102
- $data_temp['Submit date'] = $date;
103
- $data_temp['Ip'] = $ip;
104
- $ttt = count($temp);
105
- for ($h = 0; $h < $m; $h++) {
106
- for ($g = 0; $g < $ttt; $g++) {
107
- $t = $temp[$g];
108
- if ($t->element_label == $sorted_labels_id[$h]) {
109
- if (strpos($t->element_value, "*@@url@@*")) {
110
- $file_names = '';
111
- $new_files = explode("*@@url@@*", $t->element_value);
112
- foreach ($new_files as $new_file) {
113
- if ($new_file) {
114
- $file_names .= $new_file . ", ";
115
- }
116
- }
117
- $data_temp[stripslashes($label_titles[$h])] = $file_names;
118
- }
119
- elseif (strpos($t->element_value, "***br***")) {
120
- $element_value = str_replace("***br***", ', ', $t->element_value);
121
- if (strpos($element_value, "***quantity***")) {
122
- $element_value = str_replace("***quantity***", '', $element_value);
123
- }
124
- if (strpos($element_value, "***property***")) {
125
- $element_value = str_replace("***property***", '', $element_value);
126
- }
127
- if(substr($element_value, -2) == ', ') {
128
- $data_temp[stripslashes($label_titles[$h])]= substr($element_value, 0, -2);
129
- }
130
- else {
131
- $data_temp[stripslashes($label_titles[$h])]= $element_value;
132
- }
133
- }
134
- elseif (strpos($t->element_value, "***map***")) {
135
- $data_temp[stripslashes($label_titles[$h])] = 'Longitude:' . str_replace("***map***", ', Latitude:', $t->element_value);
136
- }
137
- elseif (strpos($t->element_value,"***star_rating***")) {
138
- $element = str_replace("***star_rating***", '', $t->element_value);
139
- $element = explode("***", $element);
140
- $data_temp[stripslashes($label_titles[$h])] = ' ' . $element[1] . '/' . $element[0];
141
- }
142
- elseif (strpos($t->element_value, "@@@") || $t->element_value == "@@@" || $t->element_value == "@@@@@@@@@") {
143
- $data_temp[stripslashes($label_titles[$h])] = str_replace("@@@", ' ', $t->element_value);
144
- }
145
- elseif (strpos($t->element_value, "***grading***")) {
146
- $element = str_replace("***grading***", '', $t->element_value);
147
- $grading = explode(":", $element);
148
- $items_count = sizeof($grading) - 1;
149
- $items = "";
150
- $total = "";
151
- for ($k = 0; $k < $items_count / 2; $k++) {
152
- $items .= $grading[$items_count / 2 + $k] . ": " . $grading[$k] . ", ";
153
- $total += $grading[$k];
154
- }
155
- $items .= "Total: " . $total;
156
- $data_temp[stripslashes($label_titles[$h])] = $items;
157
- }
158
- elseif (strpos($t->element_value, "***matrix***")) {
159
- $element = str_replace("***matrix***", '', $t->element_value);
160
- $matrix_value = explode('***', $element);
161
- $matrix_value = array_slice($matrix_value, 0, count($matrix_value) - 1);
162
- $mat_rows = $matrix_value[0];
163
- $mat_columns = $matrix_value[$mat_rows + 1];
164
- $matrix = "";
165
- $aaa = Array();
166
- $var_checkbox = 1;
167
- $selected_value = "";
168
- $selected_value_yes = "";
169
- $selected_value_no = "";
170
- for ($k = 1; $k <= $mat_rows; $k++) {
171
- if ($matrix_value[$mat_rows + $mat_columns + 2] == "radio") {
172
- if ($matrix_value[$mat_rows + $mat_columns + 2 + $k] == 0) {
173
- $checked = "0";
174
- $aaa[1] = "";
175
- }
176
- else {
177
- $aaa = explode("_", $matrix_value[$mat_rows + $mat_columns + 2 + $k]);
178
- }
179
- for ($l = 1; $l <= $mat_columns; $l++) {
180
- if ($aaa[1] == $l) {
181
- $checked = '1';
182
- }
183
- else {
184
- $checked = '0';
185
- }
186
- $matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$checked."; ";
187
- }
188
- }
189
- else {
190
- if ($matrix_value[$mat_rows+$mat_columns + 2] == "checkbox") {
191
- for ($l = 1; $l <= $mat_columns; $l++) {
192
- if ($matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox] == 1) {
193
- $checked = '1';
194
- }
195
- else {
196
- $checked = '0';
197
- }
198
- $matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$checked."; ";
199
- $var_checkbox++;
200
- }
201
- }
202
- else {
203
- if ($matrix_value[$mat_rows+$mat_columns + 2] == "text") {
204
- for ($l = 1; $l <= $mat_columns; $l++) {
205
- $text_value = $matrix_value[$mat_rows+$mat_columns+2+$var_checkbox];
206
- $matrix .='['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$text_value."; ";
207
- $var_checkbox++;
208
- }
209
- }
210
- else {
211
- for ($l = 1; $l <= $mat_columns; $l++) {
212
- $selected_text = $matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox];
213
- $matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows + 1 + $l].']='.$selected_text."; ";
214
- $var_checkbox++;
215
- }
216
- }
217
- }
218
- }
219
- }
220
- $data_temp[stripslashes($label_titles[$h])] = $matrix;
221
- }
222
- else {
223
- $val = str_replace('&amp;', "&", $t->element_value);
224
- $val = stripslashes(str_replace('&#039;', "'", $t->element_value));
225
- $data_temp[stripslashes($label_titles[$h])] = ($t->element_value ? $val : '');
226
- }
227
- }
228
- }
229
- }
230
- $query = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker_sessions where group_id= %d", $f->group_id);
231
- $paypal_info = $wpdb->get_results($query);
232
- if ($paypal_info) {
233
- $is_paypal_info = TRUE;
234
- }
235
- if ($is_paypal_info) {
236
- foreach ($paypal_info_fields as $paypal_info_field) {
237
- if ($paypal_info) {
238
- $data_temp['PAYPAL_' . $paypal_info_field] = $paypal_info[0]->$paypal_info_field;
239
- }
240
- else {
241
- $data_temp['PAYPAL_' . $paypal_info_field] = '';
242
- }
243
- }
244
- }
245
- $data[] = $data_temp;
246
- }
247
- array_push($params, $data);
248
- array_push($params, $title);
249
- return $params;
250
- }
251
- ////////////////////////////////////////////////////////////////////////////////////////
252
- // Getters & Setters //
253
- ////////////////////////////////////////////////////////////////////////////////////////
254
- ////////////////////////////////////////////////////////////////////////////////////////
255
- // Private Methods //
256
- ////////////////////////////////////////////////////////////////////////////////////////
257
- ////////////////////////////////////////////////////////////////////////////////////////
258
- // Listeners //
259
- ////////////////////////////////////////////////////////////////////////////////////////
260
  }
1
+ <?php
2
+
3
+ class FMModelGenerete_xml_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
22
+ public function get_data() {
23
+ $is_paypal_info = FALSE;
24
+ global $wpdb;
25
+ $params = array();
26
+ $form_id = $_REQUEST['form_id'];
27
+ $paypal_info_fields = array('ip', 'ord_date', 'ord_last_modified', 'status', 'full_name', 'fax', 'mobile_phone', 'email', 'phone', 'address', 'paypal_info', 'without_paypal_info', 'ipn', 'checkout_method', 'tax', 'shipping', 'shipping_type', 'read');
28
+ $query = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker_submits where form_id= %d ORDER BY date ASC", $form_id);
29
+ $rows = $wpdb->get_results($query);
30
+ $n = count($rows);
31
+ $labels = array();
32
+ for ($i = 0; $i < $n; $i++) {
33
+ $row = &$rows[$i];
34
+ if (!in_array($row->element_label, $labels)) {
35
+ array_push($labels, $row->element_label);
36
+ }
37
+ }
38
+ $label_titles = array();
39
+ $sorted_labels = array();
40
+ $query_lable = "SELECT label_order,title FROM " . $wpdb->prefix . "formmaker where id=$form_id ";
41
+ $rows_lable = $wpdb->get_results($query_lable);
42
+ $ptn = "/[^a-zA-Z0-9_]/";
43
+ $rpltxt = "";
44
+ $title = preg_replace($ptn, $rpltxt, $rows_lable[0]->title);
45
+ $sorted_labels_id = array();
46
+ $sorted_labels = array();
47
+ $label_titles = array();
48
+ if ($labels) {
49
+ $label_id = array();
50
+ $label_order = array();
51
+ $label_order_original = array();
52
+ $label_type = array();
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
+ $ptn = "/[^a-zA-Z0-9_]/";
61
+ $rpltxt = "";
62
+ $label_temp = preg_replace($ptn, $rpltxt, $label_oder_each[0]);
63
+ array_push($label_order, $label_temp);
64
+ array_push($label_type, $label_oder_each[1]);
65
+ }
66
+ foreach ($label_id as $key => $label) {
67
+ if (in_array($label, $labels)) {
68
+ array_push($sorted_labels, $label_order[$key]);
69
+ array_push($sorted_labels_id, $label);
70
+ array_push($label_titles, stripslashes($label_order_original[$key]));
71
+ }
72
+ }
73
+ }
74
+ $m = count($sorted_labels);
75
+ $group_id_s = array();
76
+ $l = 0;
77
+ if (count($rows) > 0 and $m) {
78
+ for ($i = 0; $i < count($rows); $i++) {
79
+ $row = &$rows[$i];
80
+ if (!in_array($row->group_id, $group_id_s)) {
81
+ array_push($group_id_s, $row->group_id);
82
+ }
83
+ }
84
+ }
85
+ $data = array();
86
+ $temp_all = array();
87
+ for ($j = 0; $j < $n; $j++) {
88
+ $row = &$rows[$j];
89
+ $key = $row->group_id;
90
+ if (!isset($temp_all[$key])) {
91
+ $temp_all[$key] = array();
92
+ }
93
+ array_push($temp_all[$key], $row);
94
+ }
95
+ for ($www = 0; $www < count($group_id_s); $www++) {
96
+ $i = $group_id_s[$www];
97
+ $temp = array();
98
+ $temp = $temp_all[$i];
99
+ $f = $temp[0];
100
+ $date = $f->date;
101
+ $ip = $f->ip;
102
+ $data_temp['Submit date'] = $date;
103
+ $data_temp['Ip'] = $ip;
104
+ $ttt = count($temp);
105
+ for ($h = 0; $h < $m; $h++) {
106
+ for ($g = 0; $g < $ttt; $g++) {
107
+ $t = $temp[$g];
108
+ if ($t->element_label == $sorted_labels_id[$h]) {
109
+ if (strpos($t->element_value, "*@@url@@*")) {
110
+ $file_names = '';
111
+ $new_files = explode("*@@url@@*", $t->element_value);
112
+ foreach ($new_files as $new_file) {
113
+ if ($new_file) {
114
+ $file_names .= $new_file . ", ";
115
+ }
116
+ }
117
+ $data_temp[stripslashes($label_titles[$h])] = $file_names;
118
+ }
119
+ elseif (strpos($t->element_value, "***br***")) {
120
+ $element_value = str_replace("***br***", ', ', $t->element_value);
121
+ if (strpos($element_value, "***quantity***")) {
122
+ $element_value = str_replace("***quantity***", '', $element_value);
123
+ }
124
+ if (strpos($element_value, "***property***")) {
125
+ $element_value = str_replace("***property***", '', $element_value);
126
+ }
127
+ if(substr($element_value, -2) == ', ') {
128
+ $data_temp[stripslashes($label_titles[$h])]= substr($element_value, 0, -2);
129
+ }
130
+ else {
131
+ $data_temp[stripslashes($label_titles[$h])]= $element_value;
132
+ }
133
+ }
134
+ elseif (strpos($t->element_value, "***map***")) {
135
+ $data_temp[stripslashes($label_titles[$h])] = 'Longitude:' . str_replace("***map***", ', Latitude:', $t->element_value);
136
+ }
137
+ elseif (strpos($t->element_value,"***star_rating***")) {
138
+ $element = str_replace("***star_rating***", '', $t->element_value);
139
+ $element = explode("***", $element);
140
+ $data_temp[stripslashes($label_titles[$h])] = ' ' . $element[1] . '/' . $element[0];
141
+ }
142
+ elseif (strpos($t->element_value, "@@@") || $t->element_value == "@@@" || $t->element_value == "@@@@@@@@@") {
143
+ $data_temp[stripslashes($label_titles[$h])] = str_replace("@@@", ' ', $t->element_value);
144
+ }
145
+ elseif (strpos($t->element_value, "***grading***")) {
146
+ $element = str_replace("***grading***", '', $t->element_value);
147
+ $grading = explode(":", $element);
148
+ $items_count = sizeof($grading) - 1;
149
+ $items = "";
150
+ $total = "";
151
+ for ($k = 0; $k < $items_count / 2; $k++) {
152
+ $items .= $grading[$items_count / 2 + $k] . ": " . $grading[$k] . ", ";
153
+ $total += $grading[$k];
154
+ }
155
+ $items .= "Total: " . $total;
156
+ $data_temp[stripslashes($label_titles[$h])] = $items;
157
+ }
158
+ elseif (strpos($t->element_value, "***matrix***")) {
159
+ $element = str_replace("***matrix***", '', $t->element_value);
160
+ $matrix_value = explode('***', $element);
161
+ $matrix_value = array_slice($matrix_value, 0, count($matrix_value) - 1);
162
+ $mat_rows = $matrix_value[0];
163
+ $mat_columns = $matrix_value[$mat_rows + 1];
164
+ $matrix = "";
165
+ $aaa = Array();
166
+ $var_checkbox = 1;
167
+ $selected_value = "";
168
+ $selected_value_yes = "";
169
+ $selected_value_no = "";
170
+ for ($k = 1; $k <= $mat_rows; $k++) {
171
+ if ($matrix_value[$mat_rows + $mat_columns + 2] == "radio") {
172
+ if ($matrix_value[$mat_rows + $mat_columns + 2 + $k] == 0) {
173
+ $checked = "0";
174
+ $aaa[1] = "";
175
+ }
176
+ else {
177
+ $aaa = explode("_", $matrix_value[$mat_rows + $mat_columns + 2 + $k]);
178
+ }
179
+ for ($l = 1; $l <= $mat_columns; $l++) {
180
+ if ($aaa[1] == $l) {
181
+ $checked = '1';
182
+ }
183
+ else {
184
+ $checked = '0';
185
+ }
186
+ $matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$checked."; ";
187
+ }
188
+ }
189
+ else {
190
+ if ($matrix_value[$mat_rows+$mat_columns + 2] == "checkbox") {
191
+ for ($l = 1; $l <= $mat_columns; $l++) {
192
+ if ($matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox] == 1) {
193
+ $checked = '1';
194
+ }
195
+ else {
196
+ $checked = '0';
197
+ }
198
+ $matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$checked."; ";
199
+ $var_checkbox++;
200
+ }
201
+ }
202
+ else {
203
+ if ($matrix_value[$mat_rows+$mat_columns + 2] == "text") {
204
+ for ($l = 1; $l <= $mat_columns; $l++) {
205
+ $text_value = $matrix_value[$mat_rows+$mat_columns+2+$var_checkbox];
206
+ $matrix .='['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$text_value."; ";
207
+ $var_checkbox++;
208
+ }
209
+ }
210
+ else {
211
+ for ($l = 1; $l <= $mat_columns; $l++) {
212
+ $selected_text = $matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox];
213
+ $matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows + 1 + $l].']='.$selected_text."; ";
214
+ $var_checkbox++;
215
+ }
216
+ }
217
+ }
218
+ }
219
+ }
220
+ $data_temp[stripslashes($label_titles[$h])] = $matrix;
221
+ }
222
+ else {
223
+ $val = str_replace('&amp;', "&", $t->element_value);
224
+ $val = stripslashes(str_replace('&#039;', "'", $t->element_value));
225
+ $data_temp[stripslashes($label_titles[$h])] = ($t->element_value ? $val : '');
226
+ }
227
+ }
228
+ }
229
+ }
230
+ $query = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker_sessions where group_id= %d", $f->group_id);
231
+ $paypal_info = $wpdb->get_results($query);
232
+ if ($paypal_info) {
233
+ $is_paypal_info = TRUE;
234
+ }
235
+ if ($is_paypal_info) {
236
+ foreach ($paypal_info_fields as $paypal_info_field) {
237
+ if ($paypal_info) {
238
+ $data_temp['PAYPAL_' . $paypal_info_field] = $paypal_info[0]->$paypal_info_field;
239
+ }
240
+ else {
241
+ $data_temp['PAYPAL_' . $paypal_info_field] = '';
242
+ }
243
+ }
244
+ }
245
+ $data[] = $data_temp;
246
+ }
247
+ array_push($params, $data);
248
+ array_push($params, $title);
249
+ return $params;
250
+ }
251
+ ////////////////////////////////////////////////////////////////////////////////////////
252
+ // Getters & Setters //
253
+ ////////////////////////////////////////////////////////////////////////////////////////
254
+ ////////////////////////////////////////////////////////////////////////////////////////
255
+ // Private Methods //
256
+ ////////////////////////////////////////////////////////////////////////////////////////
257
+ ////////////////////////////////////////////////////////////////////////////////////////
258
+ // Listeners //
259
+ ////////////////////////////////////////////////////////////////////////////////////////
260
  }
admin/models/FMModelLicensing_fmc.php CHANGED
@@ -1,30 +1,30 @@
1
- <?php
2
-
3
- class FMModelLicensing_fmc {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- ////////////////////////////////////////////////////////////////////////////////////////
22
- // Getters & Setters //
23
- ////////////////////////////////////////////////////////////////////////////////////////
24
- ////////////////////////////////////////////////////////////////////////////////////////
25
- // Private Methods //
26
- ////////////////////////////////////////////////////////////////////////////////////////
27
- ////////////////////////////////////////////////////////////////////////////////////////
28
- // Listeners //
29
- ////////////////////////////////////////////////////////////////////////////////////////
30
  }
1
+ <?php
2
+
3
+ class FMModelLicensing_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ ////////////////////////////////////////////////////////////////////////////////////////
22
+ // Getters & Setters //
23
+ ////////////////////////////////////////////////////////////////////////////////////////
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ // Private Methods //
26
+ ////////////////////////////////////////////////////////////////////////////////////////
27
+ ////////////////////////////////////////////////////////////////////////////////////////
28
+ // Listeners //
29
+ ////////////////////////////////////////////////////////////////////////////////////////
30
  }
admin/models/FMModelManage_fmc.php CHANGED
@@ -1,1831 +1,1831 @@
1
- <?php
2
-
3
- class FMModelManage_fmc {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function get_rows_data() {
22
- global $wpdb;
23
- $where = 'WHERE `id` 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'])) ? esc_html($_POST['asc_or_desc']) : 'asc');
26
- $order_by = ' ORDER BY ' . ((isset($_POST['order_by']) && esc_html($_POST['order_by']) != '') ? esc_html($_POST['order_by']) : 'id') . ' ' . $asc_or_desc;
27
- if (isset($_POST['page_number']) && $_POST['page_number']) {
28
- $limit = ((int) $_POST['page_number'] - 1) * 20;
29
- }
30
- else {
31
- $limit = 0;
32
- }
33
- $query = "SELECT * FROM " . $wpdb->prefix . "formmaker " . $where . $order_by . " LIMIT " . $limit . ",20";
34
- $rows = $wpdb->get_results($query);
35
- return $rows;
36
- }
37
-
38
- public function get_row_data($id) {
39
- global $wpdb;
40
- if ($id != 0) {
41
- $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
42
- }
43
- else {
44
- $row = new stdClass();
45
- $row->id = 0;
46
- $row->title = '';
47
- $row->mail = '';
48
- $row->form = '';
49
- $row->form_front = '';
50
- $row->theme = 0;
51
- $row->javascript = '';
52
- $row->submit_text = '';
53
- $row->url = '';
54
- $row->submit_text_type = 0;
55
- $row->script1 = '';
56
- $row->script2 = '';
57
- $row->script_user1 = '';
58
- $row->script_user2 = '';
59
- $row->counter = 0;
60
- $row->label_order = '';
61
- $row->article_id = '';
62
- $row->pagination = '';
63
- $row->show_title = '';
64
- $row->show_numbers = '';
65
- $row->public_key = '';
66
- $row->private_key = '';
67
- $row->recaptcha_theme = '';
68
- $row->from_name = '';
69
- $row->from_mail = '';
70
- $row->label_order_current = '';
71
- $row->script_mail_user = '';
72
- $row->script_mail = '';
73
- $row->tax = 0;
74
- $row->payment_currency = '$';
75
- $row->paypal_email = '';
76
- $row->checkout_mode = 'testmode';
77
- $row->paypal_mode = 0;
78
-
79
- $row->published = 1;
80
- $row->form_fields = '';
81
- $row->savedb = 1;
82
- $row->sendemail = 1;
83
- $row->requiredmark = '*';
84
- $row->reply_to = 0;
85
- $row->send_to = 0;
86
- $row->autogen_layout = 1;
87
- $row->custom_front = '';
88
- $row->mail_from_user = '';
89
- $row->mail_from_name_user = '';
90
- $row->reply_to_user = '';
91
- }
92
- return $row;
93
- }
94
-
95
- public function get_row_data_new($id) {
96
- global $wpdb;
97
- if ($id != 0) {
98
- $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
99
- $labels2 = array();
100
- $label_id = array();
101
- $label_order_original = array();
102
- $label_type = array();
103
- $label_all = explode('#****#', $row->label_order);
104
- $label_all = array_slice($label_all, 0, count($label_all) - 1);
105
- foreach($label_all as $key => $label_each) {
106
- $label_id_each=explode('#**id**#',$label_each);
107
- array_push($label_id, $label_id_each[0]);
108
- $label_oder_each=explode('#**label**#', $label_id_each[1]);
109
- array_push($label_order_original, addslashes($label_oder_each[0]));
110
- array_push($label_type, $label_oder_each[1]);
111
- }
112
- $labels2['id'] = '"' . implode('","', $label_id) . '"';
113
- $labels2['label'] = '"' . implode('","', $label_order_original) . '"';
114
- $labels2['type'] = '"' . implode('","', $label_type) . '"';
115
- $ids = array();
116
- $types = array();
117
- $labels = array();
118
- $paramss = array();
119
- $fields = explode('*:*new_field*:*', $row->form_fields);
120
- $fields = array_slice($fields, 0, count($fields) - 1);
121
- foreach ($fields as $field) {
122
- $temp=explode('*:*id*:*',$field);
123
- array_push($ids, $temp[0]);
124
- $temp=explode('*:*type*:*',$temp[1]);
125
- array_push($types, $temp[0]);
126
- $temp=explode('*:*w_field_label*:*',$temp[1]);
127
- array_push($labels, $temp[0]);
128
- array_push($paramss, $temp[1]);
129
- }
130
- $form = $row->form_front;
131
- foreach ($ids as $ids_key => $id) {
132
- $label = $labels[$ids_key];
133
- $type = $types[$ids_key];
134
- $params = $paramss[$ids_key];
135
- if (strpos($form, '%'.$id.' - '.$label.'%') || strpos($form, '%'.$id.' -'.$label.'%')) {
136
- $rep = '';
137
- $param = array();
138
- $param['attributes'] = '';
139
- switch ($type) {
140
- case 'type_section_break': {
141
- $params_names = array('w_editor');
142
- $temp = $params;
143
- foreach ($params_names as $params_name) {
144
- $temp = explode('*:*' . $params_name . '*:*', $temp);
145
- $param[$params_name] = $temp[0];
146
- $temp = $temp[1];
147
- }
148
- $rep ='<div id="wdform_field'.$id.'" type="type_section_break" class="wdform_field_section_break"><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">'.html_entity_decode($param['w_editor']).'</div></div>';
149
- break;
150
- }
151
- case 'type_editor': {
152
- $params_names = array('w_editor');
153
- $temp = $params;
154
- foreach ($params_names as $params_name ) {
155
- $temp = explode('*:*' . $params_name . '*:*', $temp);
156
- $param[$params_name] = $temp[0];
157
- $temp = $temp[1];
158
- }
159
- $rep ='<div id="wdform_field'.$id.'" type="type_editor" class="wdform_field" style="display: table-cell;">'.html_entity_decode($param['w_editor']).'</div><span id="'.$id.'_element_labelform_id_temp" style="display: none;">custom_'.$id.'</span>';
160
- break;
161
- }
162
- case 'type_send_copy': {
163
- $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_required');
164
- $temp = $params;
165
- foreach ($params_names as $params_name ) {
166
- $temp = explode('*:*' . $params_name . '*:*', $temp);
167
- $param[$params_name] = $temp[0];
168
- $temp = $temp[1];
169
- }
170
- if ($temp) {
171
- $temp = explode('*:*w_attr_name*:*', $temp);
172
- $attrs = array_slice($temp, 0, count($temp) - 1);
173
- foreach ($attrs as $attr) {
174
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
175
- }
176
- }
177
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
178
- $input_active = ($param['w_first_val'] == 'true' ? "checked='checked'" : "");
179
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
180
- $rep = '<div id="wdform_field'.$id.'" type="type_send_copy" class="wdform_field" style="display: table-cell;"><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'].'></div></div>';
181
- break;
182
- }
183
- case 'type_text': {
184
- $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_first_val', 'w_title', 'w_required', 'w_unique');
185
- $temp = $params;
186
- foreach ($params_names as $params_name) {
187
- $temp = explode('*:*' . $params_name . '*:*', $temp);
188
- $param[$params_name] = $temp[0];
189
- $temp = $temp[1];
190
- }
191
- if ($temp) {
192
- $temp = explode('*:*w_attr_name*:*', $temp);
193
- $attrs = array_slice($temp, 0, count($temp) - 1);
194
- foreach ($attrs as $attr) {
195
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
196
- }
197
- }
198
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
199
- $input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
200
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
201
- $rep = '<div id="wdform_field'.$id.'" type="type_text" class="wdform_field" style="display: table-cell;"><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_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'].'></div></div>';
202
- break;
203
- }
204
- case 'type_number': {
205
- $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_first_val', 'w_title', 'w_required', 'w_unique', 'w_class');
206
- $temp = $params;
207
- foreach ($params_names as $params_name) {
208
- $temp = explode('*:*' . $params_name . '*:*', $temp);
209
- $param[$params_name] = $temp[0];
210
- $temp = $temp[1];
211
- }
212
- if ($temp) {
213
- $temp = explode('*:*w_attr_name*:*', $temp);
214
- $attrs = array_slice($temp, 0, count($temp) - 1);
215
- foreach ($attrs as $attr) {
216
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
217
- }
218
- }
219
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
220
- $input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
221
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
222
- $rep = '<div id="wdform_field'.$id.'" type="type_number" class="wdform_field" style="display: table-cell;"><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'].'></div></div>';
223
- break;
224
- }
225
- case 'type_password': {
226
- $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_required', 'w_unique', 'w_class');
227
- $temp = $params;
228
- foreach ($params_names as $params_name) {
229
- $temp = explode('*:*' . $params_name . '*:*', $temp);
230
- $param[$params_name] = $temp[0];
231
- $temp = $temp[1];
232
- }
233
- if ($temp) {
234
- $temp = explode('*:*w_attr_name*:*', $temp);
235
- $attrs = array_slice($temp, 0, count($temp) - 1);
236
- foreach ($attrs as $attr) {
237
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
238
- }
239
- }
240
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
241
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
242
- $rep = '<div id="wdform_field'.$id.'" type="type_password" class="wdform_field" style="display: table-cell;"><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'].'></div></div>';
243
- break;
244
- }
245
- case 'type_textarea': {
246
- $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');
247
- $temp = $params;
248
- foreach ($params_names as $params_name) {
249
- $temp = explode('*:*' . $params_name . '*:*', $temp);
250
- $param[$params_name] = $temp[0];
251
- $temp = $temp[1];
252
- }
253
- if ($temp) {
254
- $temp = explode('*:*w_attr_name*:*', $temp);
255
- $attrs = array_slice($temp, 0, count($temp) - 1);
256
- foreach ($attrs as $attr) {
257
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
258
- }
259
- }
260
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
261
- $input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
262
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
263
- $rep = '<div id="wdform_field'.$id.'" type="type_textarea" class="wdform_field" style="display: table-cell;"><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: 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'].'>'.$param['w_first_val'].'</textarea></div></div>';
264
- break;
265
- }
266
- case 'type_wdeditor': {
267
- $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size_w', 'w_size_h', 'w_title', 'w_required', 'w_class');
268
- $temp = $params;
269
- foreach ($params_names as $params_name) {
270
- $temp = explode('*:*' . $params_name . '*:*', $temp);
271
- $param[$params_name] = $temp[0];
272
- $temp = $temp[1];
273
- }
274
- if ($temp) {
275
- $temp = explode('*:*w_attr_name*:*', $temp);
276
- $attrs = array_slice($temp, 0, count($temp) - 1);
277
- foreach ($attrs as $attr) {
278
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
279
- }
280
- }
281
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
282
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
283
- $rep = '<div id="wdform_field'.$id.'" type="type_wdeditor" class="wdform_field" style="display: table-cell;"><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_wdeditor" 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">
284
- <input class="" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" type="hidden" value="" title="'.$param['w_title'].'" style="width: '.$param['w_size_w'].'px; height: '.$param['w_size_h'].'px;" '.$param['attributes'].'><span style="color: red; font-style: italic;">Editor doesn\'t display in back end</span></div></div>';
285
- break;
286
- }
287
- case 'type_phone': {
288
- $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');
289
- $temp = $params;
290
- foreach ($params_names as $params_name) {
291
- $temp = explode('*:*' . $params_name . '*:*', $temp);
292
- $param[$params_name] = $temp[0];
293
- $temp = $temp[1];
294
- }
295
- if ($temp) {
296
- $temp = explode('*:*w_attr_name*:*', $temp);
297
- $attrs = array_slice($temp, 0, count($temp) - 1);
298
- foreach ($attrs as $attr) {
299
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
300
- }
301
- }
302
- $w_first_val = explode('***', $param['w_first_val']);
303
- $w_title = explode('***', $param['w_title']);
304
- $w_mini_labels = explode('***', $param['w_mini_labels']);
305
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
306
- $input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
307
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
308
- $rep = '<div id="wdform_field'.$id.'" type="type_phone" class="wdform_field" style="display: table-cell;"><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'].'><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'].'></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>';
309
- break;
310
- }
311
- case 'type_name': {
312
- $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');
313
- $temp = $params;
314
- foreach ($params_names as $params_name) {
315
- $temp = explode('*:*' . $params_name . '*:*', $temp);
316
- $param[$params_name] = $temp[0];
317
- $temp = $temp[1];
318
- }
319
- if ($temp) {
320
- $temp = explode('*:*w_attr_name*:*', $temp);
321
- $attrs = array_slice($temp, 0, count($temp) - 1);
322
- foreach ($attrs as $attr) {
323
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
324
- }
325
- }
326
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
327
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
328
- $w_first_val = explode('***', $param['w_first_val']);
329
- $w_title = explode('***', $param['w_title']);
330
- $w_mini_labels = explode('***', $param['w_mini_labels']);
331
- if ($param['w_name_format'] == 'normal') {
332
- $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'].'></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'].'></div>';
333
- $w_name_format_mini_labels = '<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_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></div>';
334
- }
335
- else {
336
- $w_name_format = '<div id="'.$id.'_td_name_input_title" style="display: table-cell;"><input type="text" class="'.($w_first_val[0]==$w_title[0] ? "input_deactive" : "input_active").'" id="'.$id.'_element_titleform_id_temp" name="'.$id.'_element_titleform_id_temp" value="'.$w_first_val[0].'" title="'.$w_title[0].'" 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;"></div><div id="'.$id.'_td_name_input_first" style="display: table-cell;"><input type="text" class="'.($w_first_val[1]==$w_title[1] ? "input_deactive" : "input_active").'" id="'.$id.'_element_firstform_id_temp" name="'.$id.'_element_firstform_id_temp" value="'.$w_first_val[1].'" title="'.$w_title[1].'" 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;"></div><div id="'.$id.'_td_name_input_last" style="display: table-cell;"><input type="text" class="'.($w_first_val[2]==$w_title[2] ? "input_deactive" : "input_active").'" id="'.$id.'_element_lastform_id_temp" name="'.$id.'_element_lastform_id_temp" value="'.$w_first_val[2].'" title="'.$w_title[2].'" 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;"></div><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;"></div>';
337
- $w_name_format_mini_labels ='<div id="'.$id.'_tr_name2" style="display: table-row;"><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><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><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></div>';
338
- }
339
- $rep = '<div id="wdform_field'.$id.'" type="type_name" class="wdform_field" style="display: table-cell;"><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"><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>'.$w_name_format_mini_labels.' </div></div></div>';
340
- break;
341
- }
342
- case 'type_address': {
343
- $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_mini_labels', 'w_disabled_fields', 'w_required', 'w_class');
344
- $temp = $params;
345
- foreach ($params_names as $params_name) {
346
- $temp = explode('*:*' . $params_name . '*:*', $temp);
347
- $param[$params_name] = $temp[0];
348
- $temp = $temp[1];
349
- }
350
- if ($temp) {
351
- $temp = explode('*:*w_attr_name*:*', $temp);
352
- $attrs = array_slice($temp, 0, count($temp) - 1);
353
- foreach ($attrs as $attr) {
354
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
355
- }
356
- }
357
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
358
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
359
- $w_mini_labels = explode('***', $param['w_mini_labels']);
360
- $w_disabled_fields = explode('***', $param['w_disabled_fields']);
361
- $hidden_inputs = '';
362
- $labels_for_id = array('street1', 'street2', 'city', 'state', 'postal', 'country');
363
- foreach ($w_disabled_fields as $key => $w_disabled_field) {
364
- if ($key != 6) {
365
- if ($w_disabled_field == 'yes') {
366
- $hidden_inputs .= '<input type="hidden" id="'.$id.'_'.$labels_for_id[$key].'form_id_temp" value="'.$w_mini_labels[$key].'" id_for_label="'.($id+$key).'">';
367
- }
368
- }
369
- }
370
- $address_fields = '';
371
- $g = 0;
372
- if (isset($w_disabled_fields[0]) && $w_disabled_fields[0] == 'no') {
373
- $g += 2;
374
- $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'].'><label class="mini_label" id="'.$id.'_mini_label_street1" style="display: block;">'.$w_mini_labels[0].'</label></span>';
375
- }
376
- if (isset($w_disabled_fields[1]) && $w_disabled_fields[1] == 'no') {
377
- $g += 2;
378
- $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'].'><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_street2">'.$w_mini_labels[1].'</label></span>';
379
- }
380
- if (isset($w_disabled_fields[2]) && $w_disabled_fields[2] == 'no') {
381
- $g++;
382
- $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'].'><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_city">'.$w_mini_labels[2].'</label></span>';
383
- }
384
- if (isset($w_disabled_fields[3]) && $w_disabled_fields[3] == 'no') {
385
- $g++;
386
- if (isset($w_disabled_fields[5]) && isset($w_disabled_fields[6]) && $w_disabled_fields[5] == 'yes' && $w_disabled_fields[6] == 'yes') {
387
- $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'].'><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>';
388
- }
389
- else {
390
- $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'].'><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_state">'.$w_mini_labels[3].'</label></span>';
391
- }
392
- }
393
- if (isset($w_disabled_fields[4]) && $w_disabled_fields[4] == 'no') {
394
- $g++;
395
- $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'].'><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_postal">'.$w_mini_labels[4].'</label></span>';
396
- }
397
- if (isset($w_disabled_fields[5]) && $w_disabled_fields[5] == 'no') {
398
- $g++;
399
- $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'].'><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="Colombi">Colombi</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="Nepa">Nepa</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>';
400
- }
401
- $rep = '<div id="wdform_field'.$id.'" type="type_address" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="vertical-align: top; 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_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="'.(isset($w_disabled_fields[0]) ? $w_disabled_fields[0] : '').'" street2="'.(isset($w_disabled_fields[1]) ? $w_disabled_fields[1] : '').'" city="'.(isset($w_disabled_fields[2]) ? $w_disabled_fields[2] : '').'" state="'.(isset($w_disabled_fields[3]) ? $w_disabled_fields[3] : '').'" postal="'.(isset($w_disabled_fields[4]) ? $w_disabled_fields[4] : '').'" country="'.(isset($w_disabled_fields[5]) ? $w_disabled_fields[5] : '').'" us_states="'.(isset($w_disabled_fields[6]) ? $w_disabled_fields[6] : '').'"><div id="'.$id.'_div_address" style="width: '.$param['w_size'].'px;">'.$address_fields.$hidden_inputs.'</div></div></div>';
402
- break;
403
- }
404
- case 'type_submitter_mail': {
405
- $params_names=array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_required','w_unique', 'w_class');
406
- $temp=$params;
407
- foreach($params_names as $params_name )
408
- {
409
- $temp=explode('*:*'.$params_name.'*:*',$temp);
410
- $param[$params_name] = $temp[0];
411
- $temp=$temp[1];
412
- }
413
-
414
- if($temp)
415
- {
416
- $temp =explode('*:*w_attr_name*:*',$temp);
417
- $attrs = array_slice($temp,0, count($temp)-1);
418
- foreach($attrs as $attr)
419
- $param['attributes'] = $param['attributes'].' add_'.$attr;
420
- }
421
-
422
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
423
- $input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active");
424
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
425
-
426
- $rep ='<div id="wdform_field'.$id.'" type="type_submitter_mail" class="wdform_field" style="display: table-cell;"><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="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'].'></div></div>';
427
- break;
428
- }
429
- case 'type_checkbox':
430
- {
431
- $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');
432
- $temp=$params;
433
- foreach($params_names as $params_name )
434
- {
435
- $temp=explode('*:*'.$params_name.'*:*',$temp);
436
- $param[$params_name] = $temp[0];
437
- $temp=$temp[1];
438
- }
439
-
440
- if($temp)
441
- {
442
- $temp =explode('*:*w_attr_name*:*',$temp);
443
- $attrs = array_slice($temp,0, count($temp)-1);
444
- foreach($attrs as $attr)
445
- $param['attributes'] = $param['attributes'].' add_'.$attr;
446
- }
447
-
448
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
449
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
450
- $param['w_choices'] = explode('***',$param['w_choices']);
451
- $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
452
-
453
- foreach($param['w_choices_checked'] as $key => $choices_checked )
454
- {
455
- if($choices_checked=='true')
456
- $param['w_choices_checked'][$key]='checked="checked"';
457
- else
458
- $param['w_choices_checked'][$key]='';
459
- }
460
-
461
- $rep='<div id="wdform_field'.$id.'" type="type_checkbox" class="wdform_field" style="display: table-cell;"><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"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;" '.($param['w_flow']=='hor' ? 'for_hor="'.$id.'_hor"' : '').'>';
462
-
463
- if($param['w_flow']=='hor')
464
- {
465
- $j = 0;
466
- for($i=0; $i<(int)$param['w_rowcol']; $i++)
467
- {
468
- $rep.='<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;">';
469
-
470
- for($l=0; $l<=(int)(count($param['w_choices'])/$param['w_rowcol']); $l++)
471
- {
472
- if($j >= count($param['w_choices'])%$param['w_rowcol'] && $l==(int)(count($param['w_choices'])/$param['w_rowcol']))
473
- continue;
474
-
475
- if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
476
- $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="'.$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'.((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'].'><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>';
477
- else
478
- $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="'.$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'.((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'].'><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>';
479
- }
480
-
481
- $j++;
482
- $rep.='</div>';
483
-
484
- }
485
-
486
- }
487
- else
488
- {
489
- for($i=0; $i<(int)(count($param['w_choices'])/$param['w_rowcol']); $i++)
490
- {
491
- $rep.='<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;">';
492
-
493
- if(count($param['w_choices']) > (int)$param['w_rowcol'])
494
- for($l=0; $l<$param['w_rowcol']; $l++)
495
- {
496
- if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
497
- $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="'.$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'.((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'].'><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>';
498
- else
499
- $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="'.$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'.((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'].'><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>';
500
- }
501
- else
502
- for($l=0; $l<count($param['w_choices']); $l++)
503
- {
504
- if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
505
- $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="'.$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'.((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'].'><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>';
506
- else
507
- $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="'.$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'.((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'].'><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>';
508
- }
509
-
510
- $rep.='</div>';
511
- }
512
-
513
- if(count($param['w_choices'])%$param['w_rowcol']!=0)
514
- {
515
- $rep.='<div id="'.$id.'_element_tr'.((int)(count($param['w_choices'])/(int)$param['w_rowcol'])).'" style="display: table-row;">';
516
-
517
- for($k=0; $k<count($param['w_choices'])%$param['w_rowcol']; $k++)
518
- {
519
- $l = count($param['w_choices']) - count($param['w_choices'])%$param['w_rowcol'] + $k;
520
- if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$l)
521
- $rep.='<div valign="top" id="'.$id.'_td_little'.$l.'" idi="'.$l.'" style="display: table-cell;"><input type="checkbox" value="'.$param['w_choices'][$l].'" 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'].'><label id="'.$id.'_label_element'.$l.'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.$l.'">'.$param['w_choices'][$l].'</label></div>';
522
- else
523
- $rep.='<div valign="top" id="'.$id.'_td_little'.$l.'" idi="'.$l.'" style="display: table-cell;"><input type="checkbox" value="'.$param['w_choices'][$l].'" 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'].'><label id="'.$id.'_label_element'.$l.'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.$l.'">'.$param['w_choices'][$l].'</label></div>';
524
- }
525
-
526
- $rep.='</div>';
527
- }
528
-
529
-
530
-
531
- }
532
- $rep.='</div></div></div></div>';
533
- break;
534
- }
535
- case 'type_radio':
536
- {
537
-
538
- $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');
539
- $temp=$params;
540
- foreach($params_names as $params_name )
541
- {
542
- $temp=explode('*:*'.$params_name.'*:*',$temp);
543
- $param[$params_name] = $temp[0];
544
- $temp=$temp[1];
545
- }
546
-
547
- if($temp)
548
- {
549
- $temp =explode('*:*w_attr_name*:*',$temp);
550
- $attrs = array_slice($temp,0, count($temp)-1);
551
- foreach($attrs as $attr)
552
- $param['attributes'] = $param['attributes'].' add_'.$attr;
553
- }
554
-
555
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
556
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
557
- $param['w_choices'] = explode('***',$param['w_choices']);
558
- $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
559
-
560
-
561
- foreach($param['w_choices_checked'] as $key => $choices_checked )
562
- {
563
- if($choices_checked=='true')
564
- $param['w_choices_checked'][$key]='checked="checked"';
565
- else
566
- $param['w_choices_checked'][$key]='';
567
- }
568
-
569
- $rep='<div id="wdform_field'.$id.'" type="type_radio" class="wdform_field" style="display: table-cell;"><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"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;" '.($param['w_flow']=='hor' ? 'for_hor="'.$id.'_hor"' : '').'>';
570
-
571
-
572
- if($param['w_flow']=='hor')
573
- {
574
- $j = 0;
575
- for($i=0; $i<(int)$param['w_rowcol']; $i++)
576
- {
577
- $rep.='<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;">';
578
-
579
- for($l=0; $l<=(int)(count($param['w_choices'])/$param['w_rowcol']); $l++)
580
- {
581
- if($j >= count($param['w_choices'])%$param['w_rowcol'] && $l==(int)(count($param['w_choices'])/$param['w_rowcol']))
582
- continue;
583
-
584
- if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
585
- $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'].'><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>';
586
- else
587
- $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" 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'].'><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>';
588
- }
589
-
590
- $j++;
591
- $rep.='</div>';
592
-
593
- }
594
-
595
- }
596
- else
597
- {
598
- for($i=0; $i<(int)(count($param['w_choices'])/$param['w_rowcol']); $i++)
599
- {
600
- $rep.='<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;">';
601
-
602
- if(count($param['w_choices']) > (int)$param['w_rowcol'])
603
- for($l=0; $l<$param['w_rowcol']; $l++)
604
- {
605
- if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
606
- $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'].'><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>';
607
- else
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="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" 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'].'><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
- }
610
- else
611
- for($l=0; $l<count($param['w_choices']); $l++)
612
- {
613
- if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
614
- $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'].'><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>';
615
- else
616
- $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" 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'].'><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>';
617
- }
618
-
619
- $rep.='</div>';
620
- }
621
-
622
- if(count($param['w_choices'])%$param['w_rowcol']!=0)
623
- {
624
- $rep.='<div id="'.$id.'_element_tr'.((int)(count($param['w_choices'])/(int)$param['w_rowcol'])).'" style="display: table-row;">';
625
-
626
- for($k=0; $k<count($param['w_choices'])%$param['w_rowcol']; $k++)
627
- {
628
- $l = count($param['w_choices']) - count($param['w_choices'])%$param['w_rowcol'] + $k;
629
- if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$l)
630
- $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'].'><label id="'.$id.'_label_element'.$l.'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.$l.'">'.$param['w_choices'][$l].'</label></div>';
631
- else
632
- $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" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.$l.'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][$l].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$l.'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.$l.'">'.$param['w_choices'][$l].'</label></div>';
633
- }
634
-
635
- $rep.='</div>';
636
- }
637
-
638
- }
639
-
640
-
641
-
642
- $rep.='</div></div></div></div>';
643
-
644
- break;
645
- }
646
- case 'type_own_select':
647
- {
648
- $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');
649
- $temp=$params;
650
- foreach($params_names as $params_name )
651
- {
652
- $temp=explode('*:*'.$params_name.'*:*',$temp);
653
- $param[$params_name] = $temp[0];
654
- $temp=$temp[1];
655
- }
656
-
657
- if($temp)
658
- {
659
- $temp =explode('*:*w_attr_name*:*',$temp);
660
- $attrs = array_slice($temp,0, count($temp)-1);
661
- foreach($attrs as $attr)
662
- $param['attributes'] = $param['attributes'].' add_'.$attr;
663
- }
664
-
665
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
666
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
667
- $param['w_choices'] = explode('***',$param['w_choices']);
668
- $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
669
- $param['w_choices_disabled'] = explode('***',$param['w_choices_disabled']);
670
-
671
- foreach($param['w_choices_checked'] as $key => $choices_checked )
672
- {
673
- if($choices_checked=='true')
674
- $param['w_choices_checked'][$key]='selected="selected"';
675
- else
676
- $param['w_choices_checked'][$key]='';
677
- }
678
-
679
- $rep='<div id="wdform_field'.$id.'" type="type_own_select" class="wdform_field" style="display: table-cell;"><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"><select id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" onchange="set_select(this)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].'>';
680
- foreach($param['w_choices'] as $key => $choice)
681
- {
682
- if($param['w_choices_disabled'][$key]=="true")
683
- $choice_value='';
684
- else
685
- $choice_value=$choice;
686
- $rep.='<option id="'.$id.'_option'.$key.'" value="'.$choice_value.'" onselect="set_select(&quot;'.$id.'_option'.$key.'&quot;)" '.$param['w_choices_checked'][$key].'>'.$choice.'</option>';
687
- }
688
- $rep.='</select></div></div>';
689
- break;
690
- }
691
-
692
- case 'type_country':
693
- {
694
- $params_names=array('w_field_label_size','w_field_label_pos','w_size','w_countries','w_required','w_class');
695
- $temp=$params;
696
- foreach($params_names as $params_name )
697
- {
698
- $temp=explode('*:*'.$params_name.'*:*',$temp);
699
- $param[$params_name] = $temp[0];
700
- $temp=$temp[1];
701
- }
702
-
703
- if($temp)
704
- {
705
- $temp =explode('*:*w_attr_name*:*',$temp);
706
- $attrs = array_slice($temp,0, count($temp)-1);
707
- foreach($attrs as $attr)
708
- $param['attributes'] = $param['attributes'].' add_'.$attr;
709
- }
710
-
711
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
712
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
713
- $param['w_countries'] = explode('***',$param['w_countries']);
714
-
715
- $rep='<div id="wdform_field'.$id.'" type="type_country" class="wdform_field" style="display: table-cell;"><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'].'>';
716
- foreach($param['w_countries'] as $key => $choice)
717
- {
718
- $choice_value=$choice;
719
- $rep.='<option value="'.$choice_value.'">'.$choice.'</option>';
720
- }
721
- $rep.='</select></div></div>';
722
- break;
723
- }
724
-
725
- case 'type_time':
726
- {
727
- $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');
728
- $temp=$params;
729
- foreach($params_names as $params_name )
730
- {
731
- $temp=explode('*:*'.$params_name.'*:*',$temp);
732
- $param[$params_name] = $temp[0];
733
- $temp=$temp[1];
734
- }
735
-
736
- if($temp)
737
- {
738
- $temp =explode('*:*w_attr_name*:*',$temp);
739
- $attrs = array_slice($temp,0, count($temp)-1);
740
- foreach($attrs as $attr)
741
- $param['attributes'] = $param['attributes'].' add_'.$attr;
742
- }
743
-
744
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
745
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
746
-
747
- $w_mini_labels = explode('***',$param['w_mini_labels']);
748
-
749
-
750
- if($param['w_sec']=='1')
751
- {
752
- $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'].'></div>';
753
- $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>';
754
- }
755
- else
756
- {
757
- $w_sec = '';
758
- $w_sec_label='';
759
- }
760
-
761
- if($param['w_time_type']=='12')
762
- {
763
- if($param['w_am_pm']=='am')
764
- {
765
- $am_ = "selected=\"selected\"";
766
- $pm_ = "";
767
- }
768
- else
769
- {
770
- $am_ = "";
771
- $pm_ = "selected=\"selected\"";
772
-
773
- }
774
-
775
- $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>';
776
-
777
- $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>';
778
-
779
- }
780
- else
781
- {
782
- $w_time_type='';
783
- $w_time_type_label = '';
784
- }
785
-
786
-
787
- $rep ='<div id="wdform_field'.$id.'" type="type_time" class="wdform_field" style="display: table-cell;"><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'].'></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'].'></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>';
788
-
789
- break;
790
- }
791
- case 'type_date':
792
- {
793
- $params_names=array('w_field_label_size','w_field_label_pos','w_date','w_required','w_class','w_format','w_but_val');
794
- $temp=$params;
795
- foreach($params_names as $params_name )
796
- {
797
- $temp=explode('*:*'.$params_name.'*:*',$temp);
798
- $param[$params_name] = $temp[0];
799
- $temp=$temp[1];
800
- }
801
-
802
- if($temp)
803
- {
804
- $temp =explode('*:*w_attr_name*:*',$temp);
805
- $attrs = array_slice($temp,0, count($temp)-1);
806
- foreach($attrs as $attr)
807
- $param['attributes'] = $param['attributes'].' add_'.$attr;
808
- }
809
-
810
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
811
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
812
-
813
-
814
-
815
- $rep ='<div id="wdform_field'.$id.'" type="type_date" class="wdform_field" style="display: table-cell;"><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="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'].'><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" alt="calendario" '.$param['attributes'].' onclick="return showCalendar(&quot;'.$id.'_elementform_id_temp&quot; , &quot;'.$param['w_format'].'&quot;)"></div></div>';
816
-
817
- break;
818
- }
819
- case 'type_date_fields':
820
- {
821
- $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');
822
-
823
- $temp=$params;
824
- foreach($params_names as $params_name )
825
- {
826
- $temp=explode('*:*'.$params_name.'*:*',$temp);
827
- $param[$params_name] = $temp[0];
828
- $temp=$temp[1];
829
- }
830
-
831
- if($temp)
832
- {
833
- $temp =explode('*:*w_attr_name*:*',$temp);
834
- $attrs = array_slice($temp,0, count($temp)-1);
835
- foreach($attrs as $attr)
836
- $param['attributes'] = $param['attributes'].' add_'.$attr;
837
- }
838
-
839
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
840
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
841
-
842
-
843
- if($param['w_day_type']=="SELECT")
844
- {
845
-
846
-
847
- $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'].'><option value=""></option>';
848
- for($k=0; $k<=31; $k++)
849
- {
850
- if($k<10)
851
- {
852
- if($param['w_day']=='0'.$k)
853
- $selected = "selected=\"selected\"";
854
- else
855
- $selected = "";
856
-
857
- $w_day_type .= '<option value="0'.$k.'" '.$selected.'>0'.$k.'</option>';
858
- }
859
- else
860
- {
861
- if($param['w_day']==''.$k)
862
- $selected = "selected=\"selected\"";
863
- else
864
- $selected = "";
865
-
866
- $w_day_type .= '<option value="'.$k.'" '.$selected.'>'.$k.'</option>';
867
- }
868
-
869
-
870
-
871
- }
872
- $w_day_type .= '</select>';
873
- }
874
- else
875
- {
876
- $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=""; else add_0(&quot;'.$id.'_dayform_id_temp&quot;)" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].'>';
877
- }
878
-
879
- if($param['w_month_type']=="SELECT")
880
- {
881
-
882
- $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'].'><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>';
883
-
884
- }
885
- else
886
- {
887
- $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=""; else add_0(&quot;'.$id.'_monthform_id_temp&quot;)" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].'>';
888
-
889
- }
890
-
891
- if($param['w_year_type']=="SELECT")
892
- {
893
- $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'].'><option value=""></option>';
894
- for($k=$param['w_to']; $k>=$param['w_from']; $k--)
895
- {
896
- if($param['w_year']==$k)
897
- $selected = "selected=\"selected\"";
898
- else
899
- $selected = "";
900
-
901
- $w_year_type .= '<option value="'.$k.'" '.$selected.'>'.$k.'</option>';
902
- }
903
- $w_year_type .= '</select>';
904
-
905
- }
906
- else
907
- {
908
- $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'].'>';
909
- }
910
-
911
-
912
- $rep ='<div id="wdform_field'.$id.'" type="type_date_fields" class="wdform_field" style="display: table-cell;"><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;">
913
- '.$w_day_type.'
914
-
915
- </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>';
916
-
917
- break;
918
- }
919
- case 'type_file_upload':
920
- {
921
- $params_names=array('w_field_label_size','w_field_label_pos','w_destination','w_extension','w_max_size','w_required','w_multiple','w_class');
922
- $temp=$params;
923
- foreach($params_names as $params_name )
924
- {
925
- $temp=explode('*:*'.$params_name.'*:*',$temp);
926
- $param[$params_name] = $temp[0];
927
- if (isset($temp[1])) {
928
- $temp = $temp[1];
929
- }
930
- else {
931
- $temp = '';
932
- }
933
- }
934
-
935
- if($temp)
936
- {
937
- $temp =explode('*:*w_attr_name*:*',$temp);
938
- $attrs = array_slice($temp,0, count($temp)-1);
939
- foreach($attrs as $attr)
940
- $param['attributes'] = $param['attributes'].' add_'.$attr;
941
- }
942
-
943
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
944
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
945
- $multiple = ($param['w_multiple']=="yes" ? "multiple='multiple'" : "");
946
-
947
- $rep ='<div id="wdform_field'.$id.'" type="type_file_upload" class="wdform_field" style="display: table-cell;"><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'].'/></div></div>';
948
-
949
- break;
950
- }
951
- case 'type_captcha':
952
- {
953
- $params_names=array('w_field_label_size','w_field_label_pos','w_digit','w_class');
954
- $temp=$params;
955
- foreach($params_names as $params_name )
956
- {
957
- $temp=explode('*:*'.$params_name.'*:*',$temp);
958
- $param[$params_name] = $temp[0];
959
- $temp=$temp[1];
960
- }
961
-
962
- if($temp)
963
- {
964
- $temp =explode('*:*w_attr_name*:*',$temp);
965
- $attrs = array_slice($temp,0, count($temp)-1);
966
- foreach($attrs as $attr)
967
- $param['attributes'] = $param['attributes'].' add_'.$attr;
968
- }
969
-
970
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
971
-
972
- $rep ='<div id="wdform_field'.$id.'" type="type_captcha" class="wdform_field" style="display: table-cell;"><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' => 'formcontactwdcaptcha', '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'].'></div></div></div></div></div>';
973
-
974
- break;
975
- }
976
- case 'type_recaptcha':
977
- {
978
- $params_names=array('w_field_label_size','w_field_label_pos','w_public','w_private','w_theme','w_class');
979
- $temp=$params;
980
- foreach($params_names as $params_name )
981
- {
982
- $temp=explode('*:*'.$params_name.'*:*',$temp);
983
- $param[$params_name] = $temp[0];
984
- $temp=$temp[1];
985
- }
986
-
987
- if($temp)
988
- {
989
- $temp =explode('*:*w_attr_name*:*',$temp);
990
- $attrs = array_slice($temp,0, count($temp)-1);
991
- foreach($attrs as $attr)
992
- $param['attributes'] = $param['attributes'].' add_'.$attr;
993
- }
994
-
995
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
996
-
997
- $rep ='<div id="wdform_field'.$id.'" type="type_recaptcha" class="wdform_field" style="display: table-cell;"><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>';
998
-
999
- break;
1000
- }
1001
-
1002
- case 'type_hidden':
1003
- {
1004
- $params_names=array('w_name','w_value');
1005
- $temp=$params;
1006
- foreach($params_names as $params_name )
1007
- {
1008
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1009
- $param[$params_name] = $temp[0];
1010
- $temp=$temp[1];
1011
- }
1012
-
1013
- if($temp)
1014
- {
1015
- $temp =explode('*:*w_attr_name*:*',$temp);
1016
- $attrs = array_slice($temp,0, count($temp)-1);
1017
- foreach($attrs as $attr)
1018
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1019
- }
1020
- $param['w_name'] = str_replace('&nbsp;','',$param['w_name']);
1021
- $rep ='<div id="wdform_field'.$id.'" type="type_hidden" class="wdform_field" style="display: table-cell;"><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></div><div align="left" id="'.$id.'_element_sectionform_id_temp" style="display: table-cell;"><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></div>';
1022
-
1023
- break;
1024
- }
1025
- case 'type_mark_map':
1026
- {
1027
- $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');
1028
- $temp=$params;
1029
- foreach($params_names as $params_name )
1030
- {
1031
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1032
- $param[$params_name] = $temp[0];
1033
- $temp=$temp[1];
1034
- }
1035
-
1036
- if($temp)
1037
- {
1038
- $temp =explode('*:*w_attr_name*:*',$temp);
1039
- $attrs = array_slice($temp,0, count($temp)-1);
1040
- foreach($attrs as $attr)
1041
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1042
- }
1043
-
1044
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1045
-
1046
- $rep ='<div id="wdform_field'.$id.'" type="type_mark_map" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="vertical-align: top; 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> ';
1047
-
1048
- break;
1049
- }
1050
-
1051
- case 'type_map':
1052
- {
1053
- $params_names=array('w_center_x','w_center_y','w_long','w_lat','w_zoom','w_width','w_height','w_info','w_class');
1054
- $temp=$params;
1055
- foreach($params_names as $params_name )
1056
- {
1057
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1058
- $param[$params_name] = $temp[0];
1059
- $temp=$temp[1];
1060
- }
1061
-
1062
- if($temp)
1063
- {
1064
- $temp =explode('*:*w_attr_name*:*',$temp);
1065
- $attrs = array_slice($temp,0, count($temp)-1);
1066
- foreach($attrs as $attr)
1067
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1068
- }
1069
-
1070
- $marker='';
1071
-
1072
- $param['w_long'] = explode('***',$param['w_long']);
1073
- $param['w_lat'] = explode('***',$param['w_lat']);
1074
- $param['w_info'] = explode('***',$param['w_info']);
1075
- foreach($param['w_long'] as $key => $w_long )
1076
- {
1077
- $marker.='long'.$key.'="'.$w_long.'" lat'.$key.'="'.$param['w_lat'][$key].'" info'.$key.'="'.$param['w_info'][$key].'"';
1078
- }
1079
-
1080
- $rep ='<div id="wdform_field'.$id.'" type="type_map" class="wdform_field" style="display: table-cell;"><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>';
1081
-
1082
- break;
1083
- }
1084
- case 'type_paypal_price':
1085
- {
1086
-
1087
- $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');
1088
- $temp=$params;
1089
- foreach($params_names as $params_name )
1090
- {
1091
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1092
- $param[$params_name] = $temp[0];
1093
- $temp=$temp[1];
1094
- }
1095
-
1096
- if($temp)
1097
- {
1098
- $temp =explode('*:*w_attr_name*:*',$temp);
1099
- $attrs = array_slice($temp,0, count($temp)-1);
1100
- foreach($attrs as $attr)
1101
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1102
- }
1103
-
1104
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1105
- $input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active");
1106
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
1107
- $hide_cents = ($param['w_hide_cents']=="yes" ? "none;" : "table-cell;");
1108
-
1109
-
1110
- $w_first_val = explode('***',$param['w_first_val']);
1111
- $w_title = explode('***',$param['w_title']);
1112
- $w_mini_labels = explode('***',$param['w_mini_labels']);
1113
-
1114
- $rep ='<div id="wdform_field'.$id.'" type="type_paypal_price" class="wdform_field" style="display: table-cell;"><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'].'></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'].'></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>';
1115
- break;
1116
- }
1117
-
1118
- case 'type_paypal_select':
1119
- {
1120
- $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');
1121
- $temp=$params;
1122
- foreach($params_names as $params_name )
1123
- {
1124
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1125
- $param[$params_name] = $temp[0];
1126
- $temp=$temp[1];
1127
- }
1128
-
1129
- if($temp)
1130
- {
1131
- $temp =explode('*:*w_attr_name*:*',$temp);
1132
- $attrs = array_slice($temp,0, count($temp)-1);
1133
- foreach($attrs as $attr)
1134
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1135
- }
1136
-
1137
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1138
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
1139
- $param['w_choices'] = explode('***',$param['w_choices']);
1140
-
1141
- $param['w_choices_price'] = explode('***',$param['w_choices_price']);
1142
-
1143
- $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
1144
-
1145
- $param['w_choices_disabled'] = explode('***',$param['w_choices_disabled']);
1146
- $param['w_property'] = explode('***',$param['w_property']);
1147
- $param['w_property_values'] = explode('***',$param['w_property_values']);
1148
-
1149
- foreach($param['w_choices_checked'] as $key => $choices_checked )
1150
- {
1151
- if($choices_checked=='true')
1152
- $param['w_choices_checked'][$key]='selected="selected"';
1153
- else
1154
- $param['w_choices_checked'][$key]='';
1155
- }
1156
-
1157
-
1158
- $rep='<div id="wdform_field'.$id.'" type="type_paypal_select" class="wdform_field" style="display: table-cell;"><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'].'>';
1159
- foreach($param['w_choices'] as $key => $choice)
1160
- {
1161
- if($param['w_choices_disabled'][$key]=="true")
1162
- $choice_value='';
1163
- else
1164
- $choice_value=$param['w_choices_price'][$key];
1165
- $rep.='<option id="'.$id.'_option'.$key.'" value="'.$choice_value.'" onselect="set_select(&quot;'.$id.'_option'.$key.'&quot;)" '.$param['w_choices_checked'][$key].'>'.$choice.'</option>';
1166
- }
1167
- $rep.='</select><div id="'.$id.'_divform_id_temp">';
1168
- if($param['w_quantity']=="yes")
1169
- $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;"></span>';
1170
- if($param['w_property'][0])
1171
- foreach($param['w_property'] as $key => $property)
1172
- {
1173
-
1174
- $rep.='
1175
- <span id="'.$id.'_property_'.$key.'" style="margin-right: 15px;">
1176
-
1177
- <label class="mini_label" id="'.$id.'_property_label_form_id_temp'.$key.'" style="margin-right: 5px;">'.$property.'</label>
1178
- <select id="'.$id.'_propertyform_id_temp'.$key.'" name="'.$id.'_propertyform_id_temp'.$key.'" style="width: auto; margin: 2px 0px;">';
1179
- $param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
1180
- $param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
1181
- foreach($param['w_property_values'][$key] as $subkey => $property_value)
1182
- {
1183
- $rep.='<option id="'.$id.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'">'.$property_value.'</option>';
1184
- }
1185
- $rep.='</select></span>';
1186
- }
1187
-
1188
- $rep.='</div></div></div>';
1189
- break;
1190
- }
1191
-
1192
- case 'type_paypal_checkbox':
1193
- {
1194
-
1195
- $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');
1196
- $temp=$params;
1197
- foreach($params_names as $params_name )
1198
- {
1199
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1200
- $param[$params_name] = $temp[0];
1201
- $temp=$temp[1];
1202
- }
1203
-
1204
- if($temp)
1205
- {
1206
- $temp =explode('*:*w_attr_name*:*',$temp);
1207
- $attrs = array_slice($temp,0, count($temp)-1);
1208
- foreach($attrs as $attr)
1209
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1210
- }
1211
-
1212
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1213
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
1214
- $param['w_choices'] = explode('***',$param['w_choices']);
1215
- $param['w_choices_price'] = explode('***',$param['w_choices_price']);
1216
- $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
1217
- $param['w_property'] = explode('***',$param['w_property']);
1218
- $param['w_property_values'] = explode('***',$param['w_property_values']);
1219
-
1220
- foreach($param['w_choices_checked'] as $key => $choices_checked )
1221
- {
1222
- if($choices_checked=='true')
1223
- $param['w_choices_checked'][$key]='checked="checked"';
1224
- else
1225
- $param['w_choices_checked'][$key]='';
1226
- }
1227
-
1228
- $rep='<div id="wdform_field'.$id.'" type="type_paypal_checkbox" class="wdform_field" style="display: table-cell;"><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_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"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;">';
1229
-
1230
- if($param['w_flow']=='hor')
1231
- {
1232
- $rep.= '<div id="'.$id.'_hor" style="display: table-row;">';
1233
- foreach($param['w_choices'] as $key => $choice)
1234
- {
1235
- if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key)
1236
- $rep.='<div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="checkbox" other="1" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp'.$key.'" value="'.$param['w_choices_price'][$key].'" onclick="if(set_checked(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;)) show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div>';
1237
- else
1238
- $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'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div>';
1239
- }
1240
- $rep.= '</div>';
1241
- }
1242
- else
1243
- {
1244
- $rep.= '<div id="'.$id.'_table_little" style="display: table-row-group;">';
1245
- foreach($param['w_choices'] as $key => $choice)
1246
- {
1247
- if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key)
1248
- $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" value="'.$param['w_choices_price'][$key].'" other="1" id="'.$id.'_elementform_id_temp'.$key.'" onclick="if(set_checked(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;)) show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" name="'.$id.'_elementform_id_temp'.$key.'" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div></div>';
1249
- else
1250
- $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'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div></div>'; }
1251
- $rep.= '</div>';
1252
- }
1253
- $rep.='</div></div>';
1254
-
1255
- $rep.='<div id="'.$id.'_divform_id_temp">';
1256
- if($param['w_quantity']=="yes")
1257
- $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;"></span>';
1258
- if($param['w_property'][0])
1259
- foreach($param['w_property'] as $key => $property)
1260
- {
1261
- $rep.='
1262
- <span id="'.$id.'_property_'.$key.'" style="margin-right: 15px;">
1263
-
1264
- <label class="mini_label" id="'.$id.'_property_label_form_id_temp'.$key.'" style="margin-right: 5px;">'.$property.'</label>
1265
- <select id="'.$id.'_propertyform_id_temp'.$key.'" name="'.$id.'_propertyform_id_temp'.$key.'" style="width: auto; margin: 2px 0px;">';
1266
- $param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
1267
- $param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
1268
- foreach($param['w_property_values'][$key] as $subkey => $property_value)
1269
- {
1270
- $rep.='<option id="'.$id.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'">'.$property_value.'</option>';
1271
- }
1272
- $rep.='</select></span>';
1273
- }
1274
-
1275
- $rep.='</div></div></div>';
1276
- break;
1277
- }
1278
- case 'type_paypal_radio':
1279
- {
1280
-
1281
- $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');
1282
- $temp=$params;
1283
- foreach($params_names as $params_name )
1284
- {
1285
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1286
- $param[$params_name] = $temp[0];
1287
- $temp=$temp[1];
1288
- }
1289
-
1290
- if($temp)
1291
- {
1292
- $temp =explode('*:*w_attr_name*:*',$temp);
1293
- $attrs = array_slice($temp,0, count($temp)-1);
1294
- foreach($attrs as $attr)
1295
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1296
- }
1297
-
1298
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1299
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
1300
- $param['w_choices'] = explode('***',$param['w_choices']);
1301
-
1302
- $param['w_choices_price'] = explode('***',$param['w_choices_price']);
1303
-
1304
- $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
1305
-
1306
- $param['w_property'] = explode('***',$param['w_property']);
1307
- $param['w_property_values'] = explode('***',$param['w_property_values']);
1308
-
1309
- foreach($param['w_choices_checked'] as $key => $choices_checked )
1310
- {
1311
- if($choices_checked=='true')
1312
- $param['w_choices_checked'][$key]='checked="checked"';
1313
- else
1314
- $param['w_choices_checked'][$key]='';
1315
- }
1316
-
1317
- $rep='<div id="wdform_field'.$id.'" type="type_paypal_radio" class="wdform_field" style="display: table-cell;"><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_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"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;">';
1318
-
1319
- if($param['w_flow']=='hor')
1320
- {
1321
- $rep.= '<div id="'.$id.'_hor" style="display: table-row;">';
1322
- foreach($param['w_choices'] as $key => $choice)
1323
- {
1324
- if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key)
1325
- $rep.='<div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="radio" other="1" 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;); show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div>';
1326
- else
1327
- $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'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div>';
1328
- }
1329
- $rep.= '</div>';
1330
- }
1331
- else
1332
- {
1333
- $rep.= '<div id="'.$id.'_table_little" style="display: table-row-group;">';
1334
- foreach($param['w_choices'] as $key => $choice)
1335
- {
1336
- if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key)
1337
- $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" value="'.$param['w_choices_price'][$key].'" other="1" id="'.$id.'_elementform_id_temp'.$key.'" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;); show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" name="'.$id.'_elementform_id_temp" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div></div>';
1338
- else
1339
- $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'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div></div>'; }
1340
- $rep.= '</div>';
1341
- }
1342
- $rep.='</div></div>';
1343
-
1344
- $rep.='<div id="'.$id.'_divform_id_temp">';
1345
- if($param['w_quantity']=="yes")
1346
- $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;"></span>';
1347
- if($param['w_property'][0])
1348
- foreach($param['w_property'] as $key => $property)
1349
- {
1350
- $rep.='
1351
- <span id="'.$id.'_property_'.$key.'" style="margin-right: 15px;">
1352
-
1353
- <label class="mini_label" id="'.$id.'_property_label_form_id_temp'.$key.'" style="margin-right: 5px;">'.$property.'</label>
1354
- <select id="'.$id.'_propertyform_id_temp'.$key.'" name="'.$id.'_propertyform_id_temp'.$key.'" style="width: auto; margin: 2px 0px;">';
1355
- $param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
1356
- $param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
1357
- foreach($param['w_property_values'][$key] as $subkey => $property_value)
1358
- {
1359
- $rep.='<option id="'.$id.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'">'.$property_value.'</option>';
1360
- }
1361
- $rep.='</select></span>';
1362
- }
1363
-
1364
- $rep.='</div></div></div>';
1365
-
1366
- break;
1367
- }
1368
- case 'type_paypal_shipping':
1369
- {
1370
-
1371
- $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');
1372
- $temp=$params;
1373
- foreach($params_names as $params_name )
1374
- {
1375
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1376
- $param[$params_name] = $temp[0];
1377
- $temp=$temp[1];
1378
- }
1379
-
1380
- if($temp)
1381
- {
1382
- $temp =explode('*:*w_attr_name*:*',$temp);
1383
- $attrs = array_slice($temp,0, count($temp)-1);
1384
- foreach($attrs as $attr)
1385
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1386
- }
1387
-
1388
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1389
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
1390
- $param['w_choices'] = explode('***',$param['w_choices']);
1391
-
1392
- $param['w_choices_price'] = explode('***',$param['w_choices_price']);
1393
-
1394
- $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
1395
-
1396
-
1397
- foreach($param['w_choices_checked'] as $key => $choices_checked )
1398
- {
1399
- if($choices_checked=='true')
1400
- $param['w_choices_checked'][$key]='checked="checked"';
1401
- else
1402
- $param['w_choices_checked'][$key]='';
1403
- }
1404
-
1405
- $rep='<div id="wdform_field'.$id.'" type="type_paypal_shipping" class="wdform_field" style="display: table-cell;"><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_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"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;">';
1406
-
1407
- if($param['w_flow']=='hor')
1408
- {
1409
- $rep.= '<div id="'.$id.'_hor" style="display: table-row;">';
1410
- foreach($param['w_choices'] as $key => $choice)
1411
- {
1412
- if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key)
1413
- $rep.='<div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="radio" other="1" 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;); show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div>';
1414
- else
1415
- $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'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div>';
1416
- }
1417
- $rep.= '</div>';
1418
- }
1419
- else
1420
- {
1421
- $rep.= '<div id="'.$id.'_table_little" style="display: table-row-group;">';
1422
- foreach($param['w_choices'] as $key => $choice)
1423
- {
1424
- if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key)
1425
- $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" value="'.$param['w_choices_price'][$key].'" other="1" id="'.$id.'_elementform_id_temp'.$key.'" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;); show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" name="'.$id.'_elementform_id_temp" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div></div>';
1426
- else
1427
- $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'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div></div>'; }
1428
- $rep.= '</div>';
1429
- }
1430
- $rep.='</div></div>';
1431
-
1432
- $rep.='</div></div>';
1433
-
1434
- break;
1435
- }
1436
- case 'type_paypal_total':
1437
- {
1438
- $params_names=array('w_field_label_size','w_field_label_pos','w_class');
1439
- $temp=$params;
1440
- foreach($params_names as $params_name )
1441
- {
1442
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1443
- $param[$params_name] = $temp[0];
1444
- $temp=$temp[1];
1445
- }
1446
-
1447
- if($temp)
1448
- {
1449
- $temp =explode('*:*w_attr_name*:*',$temp);
1450
- $attrs = array_slice($temp,0, count($temp)-1);
1451
- foreach($attrs as $attr)
1452
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1453
- }
1454
-
1455
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1456
-
1457
-
1458
-
1459
- $rep='<div id="wdform_field'.$id.'" type="type_paypal_total" class="wdform_field" style="display: table-cell;"><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>';
1460
-
1461
-
1462
- break;
1463
- }
1464
-
1465
- case 'type_star_rating':
1466
- {
1467
- $params_names=array('w_field_label_size','w_field_label_pos','w_field_label_col','w_star_amount','w_required','w_class');
1468
- $temp=$params;
1469
- foreach($params_names as $params_name )
1470
- {
1471
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1472
- $param[$params_name] = $temp[0];
1473
- $temp=$temp[1];
1474
- }
1475
-
1476
- if($temp)
1477
- {
1478
- $temp =explode('*:*w_attr_name*:*',$temp);
1479
- $attrs = array_slice($temp,0, count($temp)-1);
1480
- foreach($attrs as $attr)
1481
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1482
- }
1483
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1484
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
1485
-
1486
-
1487
- $images = '';
1488
- for($i=0; $i<$param['w_star_amount']; $i++)
1489
- {
1490
- $images .= '<img id="'.$id.'_star_'.$i.'" src="' . WD_FMC_URL . '/images/star.png" 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;)">';
1491
- }
1492
-
1493
- $rep ='<div id="wdform_field'.$id.'" type="type_star_rating" class="wdform_field" style="display: table-cell;"><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>';
1494
-
1495
-
1496
- break;
1497
- }
1498
- case 'type_scale_rating':
1499
- {
1500
- $params_names=array('w_field_label_size','w_field_label_pos','w_mini_labels','w_scale_amount','w_required','w_class');
1501
- $temp=$params;
1502
- foreach($params_names as $params_name )
1503
- {
1504
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1505
- $param[$params_name] = $temp[0];
1506
- $temp=$temp[1];
1507
- }
1508
-
1509
- if($temp)
1510
- {
1511
- $temp =explode('*:*w_attr_name*:*',$temp);
1512
- $attrs = array_slice($temp,0, count($temp)-1);
1513
- foreach($attrs as $attr)
1514
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1515
- }
1516
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1517
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
1518
-
1519
- $w_mini_labels = explode('***',$param['w_mini_labels']);
1520
-
1521
- $numbers = '';
1522
- for($i=1; $i<=$param['w_scale_amount']; $i++)
1523
- {
1524
- $numbers .= '<div id="'.$id.'_scale_td1_'.$i.'form_id_temp" style="text-align: center; display: table-cell;"><span>'.$i.'</span></div>';
1525
- }
1526
-
1527
-
1528
- $radio_buttons = '';
1529
- for($k=1; $k<=$param['w_scale_amount']; $k++)
1530
- {
1531
- $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>';
1532
- }
1533
-
1534
- $rep ='<div id="wdform_field'.$id.'" type="type_scale_rating" class="wdform_field" style="display: table-cell;"><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>';
1535
-
1536
- break;
1537
- }
1538
- case 'type_spinner':
1539
- {
1540
- $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');
1541
- $temp=$params;
1542
- foreach($params_names as $params_name ) {
1543
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1544
- $param[$params_name] = $temp[0];
1545
- $temp=$temp[1];
1546
- }
1547
- if($temp) {
1548
- $temp =explode('*:*w_attr_name*:*',$temp);
1549
- $attrs = array_slice($temp,0, count($temp)-1);
1550
- foreach($attrs as $attr)
1551
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1552
- }
1553
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1554
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
1555
- $rep ='<div id="wdform_field'.$id.'" type="type_spinner" class="wdform_field" style="display: table-cell;"><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'].'></div></div>';
1556
- break;
1557
- }
1558
- case 'type_slider': {
1559
- $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');
1560
- $temp=$params;
1561
- foreach($params_names as $params_name ) {
1562
- $temp = explode('*:*'.$params_name.'*:*',$temp);
1563
- $param[$params_name] = $temp[0];
1564
- $temp=$temp[1];
1565
- }
1566
- if ($temp) {
1567
- $temp = explode('*:*w_attr_name*:*', $temp);
1568
- $attrs = array_slice($temp,0, count($temp)-1);
1569
- foreach($attrs as $attr) {
1570
- $param['attributes'] = $param['attributes'] . ' add_' . $attr;
1571
- }
1572
- }
1573
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1574
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
1575
- $rep ='<div id="wdform_field'.$id.'" type="type_slider" class="wdform_field" style="display: table-cell;"><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>';
1576
- break;
1577
- }
1578
- case 'type_range': {
1579
- $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');
1580
- $temp = $params;
1581
- foreach ($params_names as $params_name ) {
1582
- $temp = explode('*:*' . $params_name . '*:*', $temp);
1583
- $param[$params_name] = $temp[0];
1584
- $temp = $temp[1];
1585
- }
1586
- if ($temp) {
1587
- $temp = explode('*:*w_attr_name*:*', $temp);
1588
- $attrs = array_slice($temp, 0, count($temp) - 1);
1589
- foreach($attrs as $attr) {
1590
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1591
- }
1592
- }
1593
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1594
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
1595
- $w_mini_labels = explode('***',$param['w_mini_labels']);
1596
- $rep ='<div id="wdform_field'.$id.'" type="type_range" class="wdform_field" style="display: table-cell;"><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'].'></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'].'></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>';
1597
- break;
1598
- }
1599
- case 'type_grading': {
1600
- $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_items', 'w_total', 'w_required', 'w_class');
1601
- $temp = $params;
1602
- foreach($params_names as $params_name) {
1603
- $temp = explode('*:*' . $params_name . '*:*', $temp);
1604
- $param[$params_name] = $temp[0];
1605
- $temp = $temp[1];
1606
- }
1607
- if ($temp) {
1608
- $temp = explode('*:*w_attr_name*:*', $temp);
1609
- $attrs = array_slice($temp, 0, count($temp) - 1);
1610
- foreach ($attrs as $attr) {
1611
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1612
- }
1613
- }
1614
- $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
1615
- $required_sym = ($param['w_required'] == "yes" ? " *" : "");
1616
- $w_items = explode('***', $param['w_items']);
1617
- $grading_items = '';
1618
- for ($i = 0; $i < count($w_items); $i++) {
1619
- $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'].'><label id="'.$id.'_label_elementform_id_temp'.$i.'" class="ch-rad-label">'.$w_items[$i].'</label></div>';
1620
- }
1621
- $rep ='<div id="wdform_field'.$id.'" type="type_grading" class="wdform_field" style="display: table-cell;"><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>';
1622
- break;
1623
- }
1624
- case 'type_matrix': {
1625
- $params_names=array('w_field_label_size','w_field_label_pos', 'w_field_input_type', 'w_rows', 'w_columns', 'w_required','w_class');
1626
- $temp = $params;
1627
- foreach ($params_names as $params_name) {
1628
- $temp = explode('*:*'.$params_name.'*:*',$temp);
1629
- $param[$params_name] = $temp[0];
1630
- $temp = $temp[1];
1631
- }
1632
- if ($temp) {
1633
- $temp = explode('*:*w_attr_name*:*', $temp);
1634
- $attrs = array_slice($temp, 0, count($temp) - 1);
1635
- foreach ($attrs as $attr) {
1636
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1637
- }
1638
- }
1639
- $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1640
- $required_sym = ($param['w_required']=="yes" ? " *" : "");
1641
- $w_rows = explode('***',$param['w_rows']);
1642
- $w_columns = explode('***',$param['w_columns']);
1643
- $column_labels = '';
1644
- for ($i = 1; $i < count($w_columns); $i++) {
1645
- $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>';
1646
- }
1647
- $rows_columns = '';
1648
- for ($i = 1; $i < count($w_rows); $i++) {
1649
- $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>';
1650
- for ($k = 1; $k < count($w_columns); $k++) {
1651
- if($param['w_field_input_type']=='radio') {
1652
- $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.'"></div>';
1653
- }
1654
- elseif ($param['w_field_input_type']=='checkbox') {
1655
- $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"></div>';
1656
- }
1657
- elseif ($param['w_field_input_type']=='text') {
1658
- $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="text" name="'.$id.'_input_elementform_id_temp'.$i.'_'.$k.'" value=""></div>';
1659
- }
1660
- elseif ($param['w_field_input_type']=='select') {
1661
- $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.'"><option value=""> </option><option value="yes">Yes</option><option value="no">No</option></select></div>';
1662
- }
1663
- }
1664
- $rows_columns .= '</div>';
1665
- }
1666
- $rep ='<div id="wdform_field'.$id.'" type="type_matrix" class="wdform_field" style="display: table-cell;"><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"><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>';
1667
- break;
1668
- }
1669
- case 'type_submit_reset': {
1670
- $params_names=array('w_submit_title','w_reset_title','w_class','w_act');
1671
- $temp=$params;
1672
- foreach ($params_names as $params_name) {
1673
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1674
- $param[$params_name] = $temp[0];
1675
- $temp=$temp[1];
1676
- }
1677
- if ($temp) {
1678
- $temp = explode('*:*w_attr_name*:*',$temp);
1679
- $attrs = array_slice($temp,0, count($temp)-1);
1680
- foreach ($attrs as $attr) {
1681
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1682
- }
1683
- }
1684
- $param['w_act'] = ($param['w_act']=="false" ? 'style="display: none;"' : "");
1685
- $rep='<div id="wdform_field'.$id.'" type="type_submit_reset" class="wdform_field" style="display: table-cell;"><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>';
1686
- break;
1687
- }
1688
- case 'type_button': {
1689
- $params_names=array('w_title','w_func','w_class');
1690
- $temp=$params;
1691
- foreach($params_names as $params_name) {
1692
- $temp=explode('*:*'.$params_name.'*:*',$temp);
1693
- $param[$params_name] = $temp[0];
1694
- $temp=$temp[1];
1695
- }
1696
- if ($temp) {
1697
- $temp = explode('*:*w_attr_name*:*',$temp);
1698
- $attrs = array_slice($temp,0, count($temp)-1);
1699
- foreach($attrs as $attr) {
1700
- $param['attributes'] = $param['attributes'].' add_'.$attr;
1701
- }
1702
- }
1703
- $param['w_title'] = explode('***',$param['w_title']);
1704
- $param['w_func'] = explode('***',$param['w_func']);
1705
- $rep.='<div id="wdform_field'.$id.'" type="type_button" class="wdform_field" style="display: table-cell;"><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">';
1706
- foreach ($param['w_title'] as $key => $title) {
1707
- $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>';
1708
- }
1709
- $rep .= '</div></div>';
1710
- break;
1711
- }
1712
- }
1713
- // Arrows.
1714
- switch ($type) {
1715
- case 'type_section_break': {
1716
- $rep =$rep.'<div id="wdform_arrows'.$id.'" class="wdform_arrows_section"><div id="X_'.$id.'" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/delete_el.png" title="Remove the field" onclick="remove_section_break(&quot;'.$id.'&quot;)"></div><div id="edit_'.$id.'" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/edit.png" title="Edit the field" onclick="edit(&quot;'.$id.'&quot;)"><span id="'.$id.'_element_labelform_id_temp" style="display: none;">custom_'.$id.'</span></div><div id="dublicate_'.$id.'" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/dublicate.png" title="Dublicate the field" onclick="dublicate(&quot;'.$id.'&quot;)"></div></div>';
1717
- break;
1718
- }
1719
- case 'type_send_copy':
1720
- case 'type_captcha':
1721
- case 'type_recaptcha': {
1722
- $rep =$rep.'<div id="wdform_arrows'.$id.'" class="wdform_arrows" style="display: table-cell;"><div id="X_'.$id.'" valign="middle" align="right" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/delete_el.png" title="Remove the field" onclick="remove_row(&quot;'.$id.'&quot;)"></div><div id="left_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/left.png" title="Move the field to the left" onclick="left_row(&quot;'.$id.'&quot;)"></div><div id="up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/up.png" title="Move the field up" onclick="up_row(&quot;'.$id.'&quot;)"></div><div id="down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/down.png" title="Move the field down" onclick="down_row(&quot;'.$id.'&quot;)"></div><div id="right_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/right.png" title="Move the field to the right" onclick="right_row(&quot;'.$id.'&quot;)"></div><div id="edit_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/edit.png" title="Edit the field" onclick="edit(&quot;'.$id.'&quot;)"></div><div id="dublicate_'.$id.'" valign="middle" class="element_toolbar"></div><div id="page_up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/page_up.png" title="Move the field to the upper page" onclick="page_up(&quot;'.$id.'&quot;)"></div><div id="page_down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/page_down.png" title="Move the field to the lower page" onclick="page_down(&quot;'.$id.'&quot;)"></div></div>';
1723
- break;
1724
- }
1725
- default: {
1726
- $rep =$rep.'<div id="wdform_arrows'.$id.'" class="wdform_arrows" style="display: table-cell;"><div id="X_'.$id.'" valign="middle" align="right" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/delete_el.png" 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_FMC_URL . '/images/left.png" 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_FMC_URL . '/images/up.png" 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_FMC_URL . '/images/down.png" 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_FMC_URL . '/images/right.png" 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_FMC_URL . '/images/edit.png" 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="dublicate_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/dublicate.png" title="Dublicate the field" onclick="dublicate(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;dublicate&quot;)" onmouseout="chnage_icons_src(this,&quot;dublicate&quot;)"></div><div id="page_up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/page_up.png" 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_FMC_URL . '/images/page_down.png" 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>';
1727
- break;
1728
- }
1729
- }
1730
- $form = str_replace('%' . $id . ' - ' . $labels[$ids_key] . '%', $rep, $form);
1731
- $form = str_replace('%' . $id . ' -' . $labels[$ids_key] . '%', $rep, $form);
1732
- $row->form_front = $form;
1733
- }
1734
- }
1735
- }
1736
- else {
1737
- $row = new stdClass();
1738
- $row->id = 0;
1739
- $row->title = '';
1740
- $row->mail = '';
1741
- $row->form = '';
1742
- $row->form_front = '';
1743
- $row->theme = 0;
1744
- $row->javascript = '';
1745
- $row->submit_text = '';
1746
- $row->url = '';
1747
- $row->submit_text_type = 0;
1748
- $row->script1 = '';
1749
- $row->script2 = '';
1750
- $row->script_user1 = '';
1751
- $row->script_user2 = '';
1752
- $row->counter = 0;
1753
- $row->label_order = '';
1754
- $row->article_id = '';
1755
- $row->pagination = '';
1756
- $row->show_title = '';
1757
- $row->show_numbers = '';
1758
- $row->public_key = '';
1759
- $row->private_key = '';
1760
- $row->recaptcha_theme = '';
1761
- $row->from_name = '';
1762
- $row->from_mail = '';
1763
- $row->label_order_current = '';
1764
- $row->script_mail_user = '';
1765
- $row->script_mail = '';
1766
- $row->tax = 0;
1767
- $row->payment_currency = '$';
1768
- $row->paypal_email = '';
1769
- $row->checkout_mode = 'testmode';
1770
- $row->paypal_mode = 0;
1771
-
1772
- $row->published = 1;
1773
- $row->form_fields = '';
1774
- $row->savedb = 1;
1775
- $row->sendemail = 1;
1776
- $row->requiredmark = '*';
1777
- $row->reply_to = 0;
1778
- $row->send_to = 0;
1779
- $row->autogen_layout = 1;
1780
- $row->custom_front = '';
1781
- $row->mail_from_user = '';
1782
- $row->mail_from_name_user = '';
1783
- $row->reply_to_user = '';
1784
-
1785
- $row->condition = '';
1786
- $row->mail_cc = '';
1787
- $row->mail_cc_user = '';
1788
- $row->mail_bcc = '';
1789
- $row->mail_bcc_user = '';
1790
- $row->mail_subject = '';
1791
- $row->mail_subject_user = '';
1792
- $row->mail_mode = 1;
1793
- $row->mail_mode_user = 1;
1794
- $row->mail_attachment = 1;
1795
- $row->mail_attachment_user = 1;
1796
- }
1797
- return $row;
1798
- }
1799
-
1800
- public function get_theme_rows_data($old = '') {
1801
- global $wpdb;
1802
- $rows = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker_themes WHERE css " . ($old ? 'NOT' : '') . " LIKE '%.wdform_section%' ORDER BY title");
1803
- return $rows;
1804
- }
1805
-
1806
- public function page_nav() {
1807
- global $wpdb;
1808
- $where = 'WHERE `id` IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ')';
1809
- $where .= ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? ' AND title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
1810
- $query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker " . $where;
1811
- $total = $wpdb->get_var($query);
1812
- $page_nav['total'] = $total;
1813
- if (isset($_POST['page_number']) && $_POST['page_number']) {
1814
- $limit = ((int) $_POST['page_number'] - 1) * 20;
1815
- }
1816
- else {
1817
- $limit = 0;
1818
- }
1819
- $page_nav['limit'] = (int) ($limit / 20 + 1);
1820
- return $page_nav;
1821
- }
1822
- ////////////////////////////////////////////////////////////////////////////////////////
1823
- // Getters & Setters //
1824
- ////////////////////////////////////////////////////////////////////////////////////////
1825
- ////////////////////////////////////////////////////////////////////////////////////////
1826
- // Private Methods //
1827
- ////////////////////////////////////////////////////////////////////////////////////////
1828
- ////////////////////////////////////////////////////////////////////////////////////////
1829
- // Listeners //
1830
- ////////////////////////////////////////////////////////////////////////////////////////
1831
  }
1
+ <?php
2
+
3
+ class FMModelManage_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function get_rows_data() {
22
+ global $wpdb;
23
+ $where = 'WHERE `id` 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'])) ? esc_html($_POST['asc_or_desc']) : 'asc');
26
+ $order_by = ' ORDER BY ' . ((isset($_POST['order_by']) && esc_html($_POST['order_by']) != '') ? esc_html($_POST['order_by']) : 'id') . ' ' . $asc_or_desc;
27
+ if (isset($_POST['page_number']) && $_POST['page_number']) {
28
+ $limit = ((int) $_POST['page_number'] - 1) * 20;
29
+ }
30
+ else {
31
+ $limit = 0;
32
+ }
33
+ $query = "SELECT * FROM " . $wpdb->prefix . "formmaker " . $where . $order_by . " LIMIT " . $limit . ",20";
34
+ $rows = $wpdb->get_results($query);
35
+ return $rows;
36
+ }
37
+
38
+ public function get_row_data($id) {
39
+ global $wpdb;
40
+ if ($id != 0) {
41
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
42
+ }
43
+ else {
44
+ $row = new stdClass();
45
+ $row->id = 0;
46
+ $row->title = '';
47
+ $row->mail = '';
48
+ $row->form = '';
49
+ $row->form_front = '';
50
+ $row->theme = 0;
51
+ $row->javascript = '';
52
+ $row->submit_text = '';
53
+ $row->url = '';
54
+ $row->submit_text_type = 0;
55
+ $row->script1 = '';
56
+ $row->script2 = '';
57
+ $row->script_user1 = '';
58
+ $row->script_user2 = '';
59
+ $row->counter = 0;
60
+ $row->label_order = '';
61
+ $row->article_id = '';
62
+ $row->pagination = '';
63
+ $row->show_title = '';
64
+ $row->show_numbers = '';
65
+ $row->public_key = '';
66
+ $row->private_key = '';
67
+ $row->recaptcha_theme = '';
68
+ $row->from_name = '';
69
+ $row->from_mail = '';
70
+ $row->label_order_current = '';
71
+ $row->script_mail_user = '';
72
+ $row->script_mail = '';
73
+ $row->tax = 0;
74
+ $row->payment_currency = '$';
75
+ $row->paypal_email = '';
76
+ $row->checkout_mode = 'testmode';
77
+ $row->paypal_mode = 0;
78
+
79
+ $row->published = 1;
80
+ $row->form_fields = '';
81
+ $row->savedb = 1;
82
+ $row->sendemail = 1;
83
+ $row->requiredmark = '*';
84
+ $row->reply_to = 0;
85
+ $row->send_to = 0;
86
+ $row->autogen_layout = 1;
87
+ $row->custom_front = '';
88
+ $row->mail_from_user = '';
89
+ $row->mail_from_name_user = '';
90
+ $row->reply_to_user = '';
91
+ }
92
+ return $row;
93
+ }
94
+
95
+ public function get_row_data_new($id) {
96
+ global $wpdb;
97
+ if ($id != 0) {
98
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
99
+ $labels2 = array();
100
+ $label_id = array();
101
+ $label_order_original = array();
102
+ $label_type = array();
103
+ $label_all = explode('#****#', $row->label_order);
104
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
105
+ foreach($label_all as $key => $label_each) {
106
+ $label_id_each=explode('#**id**#',$label_each);
107
+ array_push($label_id, $label_id_each[0]);
108
+ $label_oder_each=explode('#**label**#', $label_id_each[1]);
109
+ array_push($label_order_original, addslashes($label_oder_each[0]));
110
+ array_push($label_type, $label_oder_each[1]);
111
+ }
112
+ $labels2['id'] = '"' . implode('","', $label_id) . '"';
113
+ $labels2['label'] = '"' . implode('","', $label_order_original) . '"';
114
+ $labels2['type'] = '"' . implode('","', $label_type) . '"';
115
+ $ids = array();
116
+ $types = array();
117
+ $labels = array();
118
+ $paramss = array();
119
+ $fields = explode('*:*new_field*:*', $row->form_fields);
120
+ $fields = array_slice($fields, 0, count($fields) - 1);
121
+ foreach ($fields as $field) {
122
+ $temp=explode('*:*id*:*',$field);
123
+ array_push($ids, $temp[0]);
124
+ $temp=explode('*:*type*:*',$temp[1]);
125
+ array_push($types, $temp[0]);
126
+ $temp=explode('*:*w_field_label*:*',$temp[1]);
127
+ array_push($labels, $temp[0]);
128
+ array_push($paramss, $temp[1]);
129
+ }
130
+ $form = $row->form_front;
131
+ foreach ($ids as $ids_key => $id) {
132
+ $label = $labels[$ids_key];
133
+ $type = $types[$ids_key];
134
+ $params = $paramss[$ids_key];
135
+ if (strpos($form, '%'.$id.' - '.$label.'%') || strpos($form, '%'.$id.' -'.$label.'%')) {
136
+ $rep = '';
137
+ $param = array();
138
+ $param['attributes'] = '';
139
+ switch ($type) {
140
+ case 'type_section_break': {
141
+ $params_names = array('w_editor');
142
+ $temp = $params;
143
+ foreach ($params_names as $params_name) {
144
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
145
+ $param[$params_name] = $temp[0];
146
+ $temp = $temp[1];
147
+ }
148
+ $rep ='<div id="wdform_field'.$id.'" type="type_section_break" class="wdform_field_section_break"><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">'.html_entity_decode($param['w_editor']).'</div></div>';
149
+ break;
150
+ }
151
+ case 'type_editor': {
152
+ $params_names = array('w_editor');
153
+ $temp = $params;
154
+ foreach ($params_names as $params_name ) {
155
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
156
+ $param[$params_name] = $temp[0];
157
+ $temp = $temp[1];
158
+ }
159
+ $rep ='<div id="wdform_field'.$id.'" type="type_editor" class="wdform_field" style="display: table-cell;">'.html_entity_decode($param['w_editor']).'</div><span id="'.$id.'_element_labelform_id_temp" style="display: none;">custom_'.$id.'</span>';
160
+ break;
161
+ }
162
+ case 'type_send_copy': {
163
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_required');
164
+ $temp = $params;
165
+ foreach ($params_names as $params_name ) {
166
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
167
+ $param[$params_name] = $temp[0];
168
+ $temp = $temp[1];
169
+ }
170
+ if ($temp) {
171
+ $temp = explode('*:*w_attr_name*:*', $temp);
172
+ $attrs = array_slice($temp, 0, count($temp) - 1);
173
+ foreach ($attrs as $attr) {
174
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
175
+ }
176
+ }
177
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
178
+ $input_active = ($param['w_first_val'] == 'true' ? "checked='checked'" : "");
179
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
180
+ $rep = '<div id="wdform_field'.$id.'" type="type_send_copy" class="wdform_field" style="display: table-cell;"><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'].'></div></div>';
181
+ break;
182
+ }
183
+ case 'type_text': {
184
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_first_val', 'w_title', 'w_required', 'w_unique');
185
+ $temp = $params;
186
+ foreach ($params_names as $params_name) {
187
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
188
+ $param[$params_name] = $temp[0];
189
+ $temp = $temp[1];
190
+ }
191
+ if ($temp) {
192
+ $temp = explode('*:*w_attr_name*:*', $temp);
193
+ $attrs = array_slice($temp, 0, count($temp) - 1);
194
+ foreach ($attrs as $attr) {
195
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
196
+ }
197
+ }
198
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
199
+ $input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
200
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
201
+ $rep = '<div id="wdform_field'.$id.'" type="type_text" class="wdform_field" style="display: table-cell;"><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_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'].'></div></div>';
202
+ break;
203
+ }
204
+ case 'type_number': {
205
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_first_val', 'w_title', 'w_required', 'w_unique', 'w_class');
206
+ $temp = $params;
207
+ foreach ($params_names as $params_name) {
208
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
209
+ $param[$params_name] = $temp[0];
210
+ $temp = $temp[1];
211
+ }
212
+ if ($temp) {
213
+ $temp = explode('*:*w_attr_name*:*', $temp);
214
+ $attrs = array_slice($temp, 0, count($temp) - 1);
215
+ foreach ($attrs as $attr) {
216
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
217
+ }
218
+ }
219
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
220
+ $input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
221
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
222
+ $rep = '<div id="wdform_field'.$id.'" type="type_number" class="wdform_field" style="display: table-cell;"><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'].'></div></div>';
223
+ break;
224
+ }
225
+ case 'type_password': {
226
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_required', 'w_unique', 'w_class');
227
+ $temp = $params;
228
+ foreach ($params_names as $params_name) {
229
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
230
+ $param[$params_name] = $temp[0];
231
+ $temp = $temp[1];
232
+ }
233
+ if ($temp) {
234
+ $temp = explode('*:*w_attr_name*:*', $temp);
235
+ $attrs = array_slice($temp, 0, count($temp) - 1);
236
+ foreach ($attrs as $attr) {
237
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
238
+ }
239
+ }
240
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
241
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
242
+ $rep = '<div id="wdform_field'.$id.'" type="type_password" class="wdform_field" style="display: table-cell;"><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'].'></div></div>';
243
+ break;
244
+ }
245
+ case 'type_textarea': {
246
+ $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');
247
+ $temp = $params;
248
+ foreach ($params_names as $params_name) {
249
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
250
+ $param[$params_name] = $temp[0];
251
+ $temp = $temp[1];
252
+ }
253
+ if ($temp) {
254
+ $temp = explode('*:*w_attr_name*:*', $temp);
255
+ $attrs = array_slice($temp, 0, count($temp) - 1);
256
+ foreach ($attrs as $attr) {
257
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
258
+ }
259
+ }
260
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
261
+ $input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
262
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
263
+ $rep = '<div id="wdform_field'.$id.'" type="type_textarea" class="wdform_field" style="display: table-cell;"><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: 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'].'>'.$param['w_first_val'].'</textarea></div></div>';
264
+ break;
265
+ }
266
+ case 'type_wdeditor': {
267
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size_w', 'w_size_h', 'w_title', 'w_required', 'w_class');
268
+ $temp = $params;
269
+ foreach ($params_names as $params_name) {
270
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
271
+ $param[$params_name] = $temp[0];
272
+ $temp = $temp[1];
273
+ }
274
+ if ($temp) {
275
+ $temp = explode('*:*w_attr_name*:*', $temp);
276
+ $attrs = array_slice($temp, 0, count($temp) - 1);
277
+ foreach ($attrs as $attr) {
278
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
279
+ }
280
+ }
281
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
282
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
283
+ $rep = '<div id="wdform_field'.$id.'" type="type_wdeditor" class="wdform_field" style="display: table-cell;"><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_wdeditor" 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">
284
+ <input class="" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" type="hidden" value="" title="'.$param['w_title'].'" style="width: '.$param['w_size_w'].'px; height: '.$param['w_size_h'].'px;" '.$param['attributes'].'><span style="color: red; font-style: italic;">Editor doesn\'t display in back end</span></div></div>';
285
+ break;
286
+ }
287
+ case 'type_phone': {
288
+ $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');
289
+ $temp = $params;
290
+ foreach ($params_names as $params_name) {
291
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
292
+ $param[$params_name] = $temp[0];
293
+ $temp = $temp[1];
294
+ }
295
+ if ($temp) {
296
+ $temp = explode('*:*w_attr_name*:*', $temp);
297
+ $attrs = array_slice($temp, 0, count($temp) - 1);
298
+ foreach ($attrs as $attr) {
299
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
300
+ }
301
+ }
302
+ $w_first_val = explode('***', $param['w_first_val']);
303
+ $w_title = explode('***', $param['w_title']);
304
+ $w_mini_labels = explode('***', $param['w_mini_labels']);
305
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
306
+ $input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
307
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
308
+ $rep = '<div id="wdform_field'.$id.'" type="type_phone" class="wdform_field" style="display: table-cell;"><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'].'><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'].'></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>';
309
+ break;
310
+ }
311
+ case 'type_name': {
312
+ $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');
313
+ $temp = $params;
314
+ foreach ($params_names as $params_name) {
315
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
316
+ $param[$params_name] = $temp[0];
317
+ $temp = $temp[1];
318
+ }
319
+ if ($temp) {
320
+ $temp = explode('*:*w_attr_name*:*', $temp);
321
+ $attrs = array_slice($temp, 0, count($temp) - 1);
322
+ foreach ($attrs as $attr) {
323
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
324
+ }
325
+ }
326
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
327
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
328
+ $w_first_val = explode('***', $param['w_first_val']);
329
+ $w_title = explode('***', $param['w_title']);
330
+ $w_mini_labels = explode('***', $param['w_mini_labels']);
331
+ if ($param['w_name_format'] == 'normal') {
332
+ $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'].'></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'].'></div>';
333
+ $w_name_format_mini_labels = '<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_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></div>';
334
+ }
335
+ else {
336
+ $w_name_format = '<div id="'.$id.'_td_name_input_title" style="display: table-cell;"><input type="text" class="'.($w_first_val[0]==$w_title[0] ? "input_deactive" : "input_active").'" id="'.$id.'_element_titleform_id_temp" name="'.$id.'_element_titleform_id_temp" value="'.$w_first_val[0].'" title="'.$w_title[0].'" 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;"></div><div id="'.$id.'_td_name_input_first" style="display: table-cell;"><input type="text" class="'.($w_first_val[1]==$w_title[1] ? "input_deactive" : "input_active").'" id="'.$id.'_element_firstform_id_temp" name="'.$id.'_element_firstform_id_temp" value="'.$w_first_val[1].'" title="'.$w_title[1].'" 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;"></div><div id="'.$id.'_td_name_input_last" style="display: table-cell;"><input type="text" class="'.($w_first_val[2]==$w_title[2] ? "input_deactive" : "input_active").'" id="'.$id.'_element_lastform_id_temp" name="'.$id.'_element_lastform_id_temp" value="'.$w_first_val[2].'" title="'.$w_title[2].'" 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;"></div><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;"></div>';
337
+ $w_name_format_mini_labels ='<div id="'.$id.'_tr_name2" style="display: table-row;"><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><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><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></div>';
338
+ }
339
+ $rep = '<div id="wdform_field'.$id.'" type="type_name" class="wdform_field" style="display: table-cell;"><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"><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>'.$w_name_format_mini_labels.' </div></div></div>';
340
+ break;
341
+ }
342
+ case 'type_address': {
343
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_mini_labels', 'w_disabled_fields', 'w_required', 'w_class');
344
+ $temp = $params;
345
+ foreach ($params_names as $params_name) {
346
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
347
+ $param[$params_name] = $temp[0];
348
+ $temp = $temp[1];
349
+ }
350
+ if ($temp) {
351
+ $temp = explode('*:*w_attr_name*:*', $temp);
352
+ $attrs = array_slice($temp, 0, count($temp) - 1);
353
+ foreach ($attrs as $attr) {
354
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
355
+ }
356
+ }
357
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
358
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
359
+ $w_mini_labels = explode('***', $param['w_mini_labels']);
360
+ $w_disabled_fields = explode('***', $param['w_disabled_fields']);
361
+ $hidden_inputs = '';
362
+ $labels_for_id = array('street1', 'street2', 'city', 'state', 'postal', 'country');
363
+ foreach ($w_disabled_fields as $key => $w_disabled_field) {
364
+ if ($key != 6) {
365
+ if ($w_disabled_field == 'yes') {
366
+ $hidden_inputs .= '<input type="hidden" id="'.$id.'_'.$labels_for_id[$key].'form_id_temp" value="'.$w_mini_labels[$key].'" id_for_label="'.($id+$key).'">';
367
+ }
368
+ }
369
+ }
370
+ $address_fields = '';
371
+ $g = 0;
372
+ if (isset($w_disabled_fields[0]) && $w_disabled_fields[0] == 'no') {
373
+ $g += 2;
374
+ $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'].'><label class="mini_label" id="'.$id.'_mini_label_street1" style="display: block;">'.$w_mini_labels[0].'</label></span>';
375
+ }
376
+ if (isset($w_disabled_fields[1]) && $w_disabled_fields[1] == 'no') {
377
+ $g += 2;
378
+ $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'].'><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_street2">'.$w_mini_labels[1].'</label></span>';
379
+ }
380
+ if (isset($w_disabled_fields[2]) && $w_disabled_fields[2] == 'no') {
381
+ $g++;
382
+ $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'].'><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_city">'.$w_mini_labels[2].'</label></span>';
383
+ }
384
+ if (isset($w_disabled_fields[3]) && $w_disabled_fields[3] == 'no') {
385
+ $g++;
386
+ if (isset($w_disabled_fields[5]) && isset($w_disabled_fields[6]) && $w_disabled_fields[5] == 'yes' && $w_disabled_fields[6] == 'yes') {
387
+ $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'].'><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>';
388
+ }
389
+ else {
390
+ $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'].'><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_state">'.$w_mini_labels[3].'</label></span>';
391
+ }
392
+ }
393
+ if (isset($w_disabled_fields[4]) && $w_disabled_fields[4] == 'no') {
394
+ $g++;
395
+ $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'].'><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_postal">'.$w_mini_labels[4].'</label></span>';
396
+ }
397
+ if (isset($w_disabled_fields[5]) && $w_disabled_fields[5] == 'no') {
398
+ $g++;
399
+ $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'].'><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="Colombi">Colombi</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="Nepa">Nepa</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>';
400
+ }
401
+ $rep = '<div id="wdform_field'.$id.'" type="type_address" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="vertical-align: top; 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_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="'.(isset($w_disabled_fields[0]) ? $w_disabled_fields[0] : '').'" street2="'.(isset($w_disabled_fields[1]) ? $w_disabled_fields[1] : '').'" city="'.(isset($w_disabled_fields[2]) ? $w_disabled_fields[2] : '').'" state="'.(isset($w_disabled_fields[3]) ? $w_disabled_fields[3] : '').'" postal="'.(isset($w_disabled_fields[4]) ? $w_disabled_fields[4] : '').'" country="'.(isset($w_disabled_fields[5]) ? $w_disabled_fields[5] : '').'" us_states="'.(isset($w_disabled_fields[6]) ? $w_disabled_fields[6] : '').'"><div id="'.$id.'_div_address" style="width: '.$param['w_size'].'px;">'.$address_fields.$hidden_inputs.'</div></div></div>';
402
+ break;
403
+ }
404
+ case 'type_submitter_mail': {
405
+ $params_names=array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_required','w_unique', 'w_class');
406
+ $temp=$params;
407
+ foreach($params_names as $params_name )
408
+ {
409
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
410
+ $param[$params_name] = $temp[0];
411
+ $temp=$temp[1];
412
+ }
413
+
414
+ if($temp)
415
+ {
416
+ $temp =explode('*:*w_attr_name*:*',$temp);
417
+ $attrs = array_slice($temp,0, count($temp)-1);
418
+ foreach($attrs as $attr)
419
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
420
+ }
421
+
422
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
423
+ $input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active");
424
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
425
+
426
+ $rep ='<div id="wdform_field'.$id.'" type="type_submitter_mail" class="wdform_field" style="display: table-cell;"><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="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'].'></div></div>';
427
+ break;
428
+ }
429
+ case 'type_checkbox':
430
+ {
431
+ $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');
432
+ $temp=$params;
433
+ foreach($params_names as $params_name )
434
+ {
435
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
436
+ $param[$params_name] = $temp[0];
437
+ $temp=$temp[1];
438
+ }
439
+
440
+ if($temp)
441
+ {
442
+ $temp =explode('*:*w_attr_name*:*',$temp);
443
+ $attrs = array_slice($temp,0, count($temp)-1);
444
+ foreach($attrs as $attr)
445
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
446
+ }
447
+
448
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
449
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
450
+ $param['w_choices'] = explode('***',$param['w_choices']);
451
+ $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
452
+
453
+ foreach($param['w_choices_checked'] as $key => $choices_checked )
454
+ {
455
+ if($choices_checked=='true')
456
+ $param['w_choices_checked'][$key]='checked="checked"';
457
+ else
458
+ $param['w_choices_checked'][$key]='';
459
+ }
460
+
461
+ $rep='<div id="wdform_field'.$id.'" type="type_checkbox" class="wdform_field" style="display: table-cell;"><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"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;" '.($param['w_flow']=='hor' ? 'for_hor="'.$id.'_hor"' : '').'>';
462
+
463
+ if($param['w_flow']=='hor')
464
+ {
465
+ $j = 0;
466
+ for($i=0; $i<(int)$param['w_rowcol']; $i++)
467
+ {
468
+ $rep.='<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;">';
469
+
470
+ for($l=0; $l<=(int)(count($param['w_choices'])/$param['w_rowcol']); $l++)
471
+ {
472
+ if($j >= count($param['w_choices'])%$param['w_rowcol'] && $l==(int)(count($param['w_choices'])/$param['w_rowcol']))
473
+ continue;
474
+
475
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
476
+ $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="'.$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'.((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'].'><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>';
477
+ else
478
+ $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="'.$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'.((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'].'><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>';
479
+ }
480
+
481
+ $j++;
482
+ $rep.='</div>';
483
+
484
+ }
485
+
486
+ }
487
+ else
488
+ {
489
+ for($i=0; $i<(int)(count($param['w_choices'])/$param['w_rowcol']); $i++)
490
+ {
491
+ $rep.='<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;">';
492
+
493
+ if(count($param['w_choices']) > (int)$param['w_rowcol'])
494
+ for($l=0; $l<$param['w_rowcol']; $l++)
495
+ {
496
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
497
+ $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="'.$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'.((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'].'><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>';
498
+ else
499
+ $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="'.$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'.((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'].'><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>';
500
+ }
501
+ else
502
+ for($l=0; $l<count($param['w_choices']); $l++)
503
+ {
504
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
505
+ $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="'.$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'.((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'].'><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>';
506
+ else
507
+ $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="'.$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'.((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'].'><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>';
508
+ }
509
+
510
+ $rep.='</div>';
511
+ }
512
+
513
+ if(count($param['w_choices'])%$param['w_rowcol']!=0)
514
+ {
515
+ $rep.='<div id="'.$id.'_element_tr'.((int)(count($param['w_choices'])/(int)$param['w_rowcol'])).'" style="display: table-row;">';
516
+
517
+ for($k=0; $k<count($param['w_choices'])%$param['w_rowcol']; $k++)
518
+ {
519
+ $l = count($param['w_choices']) - count($param['w_choices'])%$param['w_rowcol'] + $k;
520
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$l)
521
+ $rep.='<div valign="top" id="'.$id.'_td_little'.$l.'" idi="'.$l.'" style="display: table-cell;"><input type="checkbox" value="'.$param['w_choices'][$l].'" 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'].'><label id="'.$id.'_label_element'.$l.'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.$l.'">'.$param['w_choices'][$l].'</label></div>';
522
+ else
523
+ $rep.='<div valign="top" id="'.$id.'_td_little'.$l.'" idi="'.$l.'" style="display: table-cell;"><input type="checkbox" value="'.$param['w_choices'][$l].'" 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'].'><label id="'.$id.'_label_element'.$l.'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.$l.'">'.$param['w_choices'][$l].'</label></div>';
524
+ }
525
+
526
+ $rep.='</div>';
527
+ }
528
+
529
+
530
+
531
+ }
532
+ $rep.='</div></div></div></div>';
533
+ break;
534
+ }
535
+ case 'type_radio':
536
+ {
537
+
538
+ $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');
539
+ $temp=$params;
540
+ foreach($params_names as $params_name )
541
+ {
542
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
543
+ $param[$params_name] = $temp[0];
544
+ $temp=$temp[1];
545
+ }
546
+
547
+ if($temp)
548
+ {
549
+ $temp =explode('*:*w_attr_name*:*',$temp);
550
+ $attrs = array_slice($temp,0, count($temp)-1);
551
+ foreach($attrs as $attr)
552
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
553
+ }
554
+
555
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
556
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
557
+ $param['w_choices'] = explode('***',$param['w_choices']);
558
+ $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
559
+
560
+
561
+ foreach($param['w_choices_checked'] as $key => $choices_checked )
562
+ {
563
+ if($choices_checked=='true')
564
+ $param['w_choices_checked'][$key]='checked="checked"';
565
+ else
566
+ $param['w_choices_checked'][$key]='';
567
+ }
568
+
569
+ $rep='<div id="wdform_field'.$id.'" type="type_radio" class="wdform_field" style="display: table-cell;"><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"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;" '.($param['w_flow']=='hor' ? 'for_hor="'.$id.'_hor"' : '').'>';
570
+
571
+
572
+ if($param['w_flow']=='hor')
573
+ {
574
+ $j = 0;
575
+ for($i=0; $i<(int)$param['w_rowcol']; $i++)
576
+ {
577
+ $rep.='<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;">';
578
+
579
+ for($l=0; $l<=(int)(count($param['w_choices'])/$param['w_rowcol']); $l++)
580
+ {
581
+ if($j >= count($param['w_choices'])%$param['w_rowcol'] && $l==(int)(count($param['w_choices'])/$param['w_rowcol']))
582
+ continue;
583
+
584
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
585
+ $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'].'><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>';
586
+ else
587
+ $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" 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'].'><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>';
588
+ }
589
+
590
+ $j++;
591
+ $rep.='</div>';
592
+
593
+ }
594
+
595
+ }
596
+ else
597
+ {
598
+ for($i=0; $i<(int)(count($param['w_choices'])/$param['w_rowcol']); $i++)
599
+ {
600
+ $rep.='<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;">';
601
+
602
+ if(count($param['w_choices']) > (int)$param['w_rowcol'])
603
+ for($l=0; $l<$param['w_rowcol']; $l++)
604
+ {
605
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
606
+ $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'].'><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>';
607
+ else
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="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" 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'].'><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
+ }
610
+ else
611
+ for($l=0; $l<count($param['w_choices']); $l++)
612
+ {
613
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
614
+ $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'].'><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>';
615
+ else
616
+ $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" 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'].'><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>';
617
+ }
618
+
619
+ $rep.='</div>';
620
+ }
621
+
622
+ if(count($param['w_choices'])%$param['w_rowcol']!=0)
623
+ {
624
+ $rep.='<div id="'.$id.'_element_tr'.((int)(count($param['w_choices'])/(int)$param['w_rowcol'])).'" style="display: table-row;">';
625
+
626
+ for($k=0; $k<count($param['w_choices'])%$param['w_rowcol']; $k++)
627
+ {
628
+ $l = count($param['w_choices']) - count($param['w_choices'])%$param['w_rowcol'] + $k;
629
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$l)
630
+ $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'].'><label id="'.$id.'_label_element'.$l.'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.$l.'">'.$param['w_choices'][$l].'</label></div>';
631
+ else
632
+ $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" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.$l.'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][$l].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$l.'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.$l.'">'.$param['w_choices'][$l].'</label></div>';
633
+ }
634
+
635
+ $rep.='</div>';
636
+ }
637
+
638
+ }
639
+
640
+
641
+
642
+ $rep.='</div></div></div></div>';
643
+
644
+ break;
645
+ }
646
+ case 'type_own_select':
647
+ {
648
+ $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');
649
+ $temp=$params;
650
+ foreach($params_names as $params_name )
651
+ {
652
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
653
+ $param[$params_name] = $temp[0];
654
+ $temp=$temp[1];
655
+ }
656
+
657
+ if($temp)
658
+ {
659
+ $temp =explode('*:*w_attr_name*:*',$temp);
660
+ $attrs = array_slice($temp,0, count($temp)-1);
661
+ foreach($attrs as $attr)
662
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
663
+ }
664
+
665
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
666
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
667
+ $param['w_choices'] = explode('***',$param['w_choices']);
668
+ $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
669
+ $param['w_choices_disabled'] = explode('***',$param['w_choices_disabled']);
670
+
671
+ foreach($param['w_choices_checked'] as $key => $choices_checked )
672
+ {
673
+ if($choices_checked=='true')
674
+ $param['w_choices_checked'][$key]='selected="selected"';
675
+ else
676
+ $param['w_choices_checked'][$key]='';
677
+ }
678
+
679
+ $rep='<div id="wdform_field'.$id.'" type="type_own_select" class="wdform_field" style="display: table-cell;"><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"><select id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" onchange="set_select(this)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].'>';
680
+ foreach($param['w_choices'] as $key => $choice)
681
+ {
682
+ if($param['w_choices_disabled'][$key]=="true")
683
+ $choice_value='';
684
+ else
685
+ $choice_value=$choice;
686
+ $rep.='<option id="'.$id.'_option'.$key.'" value="'.$choice_value.'" onselect="set_select(&quot;'.$id.'_option'.$key.'&quot;)" '.$param['w_choices_checked'][$key].'>'.$choice.'</option>';
687
+ }
688
+ $rep.='</select></div></div>';
689
+ break;
690
+ }
691
+
692
+ case 'type_country':
693
+ {
694
+ $params_names=array('w_field_label_size','w_field_label_pos','w_size','w_countries','w_required','w_class');
695
+ $temp=$params;
696
+ foreach($params_names as $params_name )
697
+ {
698
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
699
+ $param[$params_name] = $temp[0];
700
+ $temp=$temp[1];
701
+ }
702
+
703
+ if($temp)
704
+ {
705
+ $temp =explode('*:*w_attr_name*:*',$temp);
706
+ $attrs = array_slice($temp,0, count($temp)-1);
707
+ foreach($attrs as $attr)
708
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
709
+ }
710
+
711
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
712
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
713
+ $param['w_countries'] = explode('***',$param['w_countries']);
714
+
715
+ $rep='<div id="wdform_field'.$id.'" type="type_country" class="wdform_field" style="display: table-cell;"><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'].'>';
716
+ foreach($param['w_countries'] as $key => $choice)
717
+ {
718
+ $choice_value=$choice;
719
+ $rep.='<option value="'.$choice_value.'">'.$choice.'</option>';
720
+ }
721
+ $rep.='</select></div></div>';
722
+ break;
723
+ }
724
+
725
+ case 'type_time':
726
+ {
727
+ $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');
728
+ $temp=$params;
729
+ foreach($params_names as $params_name )
730
+ {
731
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
732
+ $param[$params_name] = $temp[0];
733
+ $temp=$temp[1];
734
+ }
735
+
736
+ if($temp)
737
+ {
738
+ $temp =explode('*:*w_attr_name*:*',$temp);
739
+ $attrs = array_slice($temp,0, count($temp)-1);
740
+ foreach($attrs as $attr)
741
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
742
+ }
743
+
744
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
745
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
746
+
747
+ $w_mini_labels = explode('***',$param['w_mini_labels']);
748
+
749
+
750
+ if($param['w_sec']=='1')
751
+ {
752
+ $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'].'></div>';
753
+ $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>';
754
+ }
755
+ else
756
+ {
757
+ $w_sec = '';
758
+ $w_sec_label='';
759
+ }
760
+
761
+ if($param['w_time_type']=='12')
762
+ {
763
+ if($param['w_am_pm']=='am')
764
+ {
765
+ $am_ = "selected=\"selected\"";
766
+ $pm_ = "";
767
+ }
768
+ else
769
+ {
770
+ $am_ = "";
771
+ $pm_ = "selected=\"selected\"";
772
+
773
+ }
774
+
775
+ $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>';
776
+
777
+ $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>';
778
+
779
+ }
780
+ else
781
+ {
782
+ $w_time_type='';
783
+ $w_time_type_label = '';
784
+ }
785
+
786
+
787
+ $rep ='<div id="wdform_field'.$id.'" type="type_time" class="wdform_field" style="display: table-cell;"><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'].'></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'].'></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>';
788
+
789
+ break;
790
+ }
791
+ case 'type_date':
792
+ {
793
+ $params_names=array('w_field_label_size','w_field_label_pos','w_date','w_required','w_class','w_format','w_but_val');
794
+ $temp=$params;
795
+ foreach($params_names as $params_name )
796
+ {
797
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
798
+ $param[$params_name] = $temp[0];
799
+ $temp=$temp[1];
800
+ }
801
+
802
+ if($temp)
803
+ {
804
+ $temp =explode('*:*w_attr_name*:*',$temp);
805
+ $attrs = array_slice($temp,0, count($temp)-1);
806
+ foreach($attrs as $attr)
807
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
808
+ }
809
+
810
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
811
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
812
+
813
+
814
+
815
+ $rep ='<div id="wdform_field'.$id.'" type="type_date" class="wdform_field" style="display: table-cell;"><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="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'].'><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" alt="calendario" '.$param['attributes'].' onclick="return showCalendar(&quot;'.$id.'_elementform_id_temp&quot; , &quot;'.$param['w_format'].'&quot;)"></div></div>';
816
+
817
+ break;
818
+ }
819
+ case 'type_date_fields':
820
+ {
821
+ $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');
822
+
823
+ $temp=$params;
824
+ foreach($params_names as $params_name )
825
+ {
826
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
827
+ $param[$params_name] = $temp[0];
828
+ $temp=$temp[1];
829
+ }
830
+
831
+ if($temp)
832
+ {
833
+ $temp =explode('*:*w_attr_name*:*',$temp);
834
+ $attrs = array_slice($temp,0, count($temp)-1);
835
+ foreach($attrs as $attr)
836
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
837
+ }
838
+
839
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
840
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
841
+
842
+
843
+ if($param['w_day_type']=="SELECT")
844
+ {
845
+
846
+
847
+ $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'].'><option value=""></option>';
848
+ for($k=0; $k<=31; $k++)
849
+ {
850
+ if($k<10)
851
+ {
852
+ if($param['w_day']=='0'.$k)
853
+ $selected = "selected=\"selected\"";
854
+ else
855
+ $selected = "";
856
+
857
+ $w_day_type .= '<option value="0'.$k.'" '.$selected.'>0'.$k.'</option>';
858
+ }
859
+ else
860
+ {
861
+ if($param['w_day']==''.$k)
862
+ $selected = "selected=\"selected\"";
863
+ else
864
+ $selected = "";
865
+
866
+ $w_day_type .= '<option value="'.$k.'" '.$selected.'>'.$k.'</option>';
867
+ }
868
+
869
+
870
+
871
+ }
872
+ $w_day_type .= '</select>';
873
+ }
874
+ else
875
+ {
876
+ $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=""; else add_0(&quot;'.$id.'_dayform_id_temp&quot;)" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].'>';
877
+ }
878
+
879
+ if($param['w_month_type']=="SELECT")
880
+ {
881
+
882
+ $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'].'><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>';
883
+
884
+ }
885
+ else
886
+ {
887
+ $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=""; else add_0(&quot;'.$id.'_monthform_id_temp&quot;)" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].'>';
888
+
889
+ }
890
+
891
+ if($param['w_year_type']=="SELECT")
892
+ {
893
+ $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'].'><option value=""></option>';
894
+ for($k=$param['w_to']; $k>=$param['w_from']; $k--)
895
+ {
896
+ if($param['w_year']==$k)
897
+ $selected = "selected=\"selected\"";
898
+ else
899
+ $selected = "";
900
+
901
+ $w_year_type .= '<option value="'.$k.'" '.$selected.'>'.$k.'</option>';
902
+ }
903
+ $w_year_type .= '</select>';
904
+
905
+ }
906
+ else
907
+ {
908
+ $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'].'>';
909
+ }
910
+
911
+
912
+ $rep ='<div id="wdform_field'.$id.'" type="type_date_fields" class="wdform_field" style="display: table-cell;"><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;">
913
+ '.$w_day_type.'
914
+
915
+ </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>';
916
+
917
+ break;
918
+ }
919
+ case 'type_file_upload':
920
+ {
921
+ $params_names=array('w_field_label_size','w_field_label_pos','w_destination','w_extension','w_max_size','w_required','w_multiple','w_class');
922
+ $temp=$params;
923
+ foreach($params_names as $params_name )
924
+ {
925
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
926
+ $param[$params_name] = $temp[0];
927
+ if (isset($temp[1])) {
928
+ $temp = $temp[1];
929
+ }
930
+ else {
931
+ $temp = '';
932
+ }
933
+ }
934
+
935
+ if($temp)
936
+ {
937
+ $temp =explode('*:*w_attr_name*:*',$temp);
938
+ $attrs = array_slice($temp,0, count($temp)-1);
939
+ foreach($attrs as $attr)
940
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
941
+ }
942
+
943
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
944
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
945
+ $multiple = ($param['w_multiple']=="yes" ? "multiple='multiple'" : "");
946
+
947
+ $rep ='<div id="wdform_field'.$id.'" type="type_file_upload" class="wdform_field" style="display: table-cell;"><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'].'/></div></div>';
948
+
949
+ break;
950
+ }
951
+ case 'type_captcha':
952
+ {
953
+ $params_names=array('w_field_label_size','w_field_label_pos','w_digit','w_class');
954
+ $temp=$params;
955
+ foreach($params_names as $params_name )
956
+ {
957
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
958
+ $param[$params_name] = $temp[0];
959
+ $temp=$temp[1];
960
+ }
961
+
962
+ if($temp)
963
+ {
964
+ $temp =explode('*:*w_attr_name*:*',$temp);
965
+ $attrs = array_slice($temp,0, count($temp)-1);
966
+ foreach($attrs as $attr)
967
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
968
+ }
969
+
970
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
971
+
972
+ $rep ='<div id="wdform_field'.$id.'" type="type_captcha" class="wdform_field" style="display: table-cell;"><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' => 'formcontactwdcaptcha', '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'].'></div></div></div></div></div>';
973
+
974
+ break;
975
+ }
976
+ case 'type_recaptcha':
977
+ {
978
+ $params_names=array('w_field_label_size','w_field_label_pos','w_public','w_private','w_theme','w_class');
979
+ $temp=$params;
980
+ foreach($params_names as $params_name )
981
+ {
982
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
983
+ $param[$params_name] = $temp[0];
984
+ $temp=$temp[1];
985
+ }
986
+
987
+ if($temp)
988
+ {
989
+ $temp =explode('*:*w_attr_name*:*',$temp);
990
+ $attrs = array_slice($temp,0, count($temp)-1);
991
+ foreach($attrs as $attr)
992
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
993
+ }
994
+
995
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
996
+
997
+ $rep ='<div id="wdform_field'.$id.'" type="type_recaptcha" class="wdform_field" style="display: table-cell;"><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>';
998
+
999
+ break;
1000
+ }
1001
+
1002
+ case 'type_hidden':
1003
+ {
1004
+ $params_names=array('w_name','w_value');
1005
+ $temp=$params;
1006
+ foreach($params_names as $params_name )
1007
+ {
1008
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1009
+ $param[$params_name] = $temp[0];
1010
+ $temp=$temp[1];
1011
+ }
1012
+
1013
+ if($temp)
1014
+ {
1015
+ $temp =explode('*:*w_attr_name*:*',$temp);
1016
+ $attrs = array_slice($temp,0, count($temp)-1);
1017
+ foreach($attrs as $attr)
1018
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1019
+ }
1020
+ $param['w_name'] = str_replace('&nbsp;','',$param['w_name']);
1021
+ $rep ='<div id="wdform_field'.$id.'" type="type_hidden" class="wdform_field" style="display: table-cell;"><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></div><div align="left" id="'.$id.'_element_sectionform_id_temp" style="display: table-cell;"><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></div>';
1022
+
1023
+ break;
1024
+ }
1025
+ case 'type_mark_map':
1026
+ {
1027
+ $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');
1028
+ $temp=$params;
1029
+ foreach($params_names as $params_name )
1030
+ {
1031
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1032
+ $param[$params_name] = $temp[0];
1033
+ $temp=$temp[1];
1034
+ }
1035
+
1036
+ if($temp)
1037
+ {
1038
+ $temp =explode('*:*w_attr_name*:*',$temp);
1039
+ $attrs = array_slice($temp,0, count($temp)-1);
1040
+ foreach($attrs as $attr)
1041
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1042
+ }
1043
+
1044
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1045
+
1046
+ $rep ='<div id="wdform_field'.$id.'" type="type_mark_map" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="vertical-align: top; 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> ';
1047
+
1048
+ break;
1049
+ }
1050
+
1051
+ case 'type_map':
1052
+ {
1053
+ $params_names=array('w_center_x','w_center_y','w_long','w_lat','w_zoom','w_width','w_height','w_info','w_class');
1054
+ $temp=$params;
1055
+ foreach($params_names as $params_name )
1056
+ {
1057
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1058
+ $param[$params_name] = $temp[0];
1059
+ $temp=$temp[1];
1060
+ }
1061
+
1062
+ if($temp)
1063
+ {
1064
+ $temp =explode('*:*w_attr_name*:*',$temp);
1065
+ $attrs = array_slice($temp,0, count($temp)-1);
1066
+ foreach($attrs as $attr)
1067
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1068
+ }
1069
+
1070
+ $marker='';
1071
+
1072
+ $param['w_long'] = explode('***',$param['w_long']);
1073
+ $param['w_lat'] = explode('***',$param['w_lat']);
1074
+ $param['w_info'] = explode('***',$param['w_info']);
1075
+ foreach($param['w_long'] as $key => $w_long )
1076
+ {
1077
+ $marker.='long'.$key.'="'.$w_long.'" lat'.$key.'="'.$param['w_lat'][$key].'" info'.$key.'="'.$param['w_info'][$key].'"';
1078
+ }
1079
+
1080
+ $rep ='<div id="wdform_field'.$id.'" type="type_map" class="wdform_field" style="display: table-cell;"><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>';
1081
+
1082
+ break;
1083
+ }
1084
+ case 'type_paypal_price':
1085
+ {
1086
+
1087
+ $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');
1088
+ $temp=$params;
1089
+ foreach($params_names as $params_name )
1090
+ {
1091
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1092
+ $param[$params_name] = $temp[0];
1093
+ $temp=$temp[1];
1094
+ }
1095
+
1096
+ if($temp)
1097
+ {
1098
+ $temp =explode('*:*w_attr_name*:*',$temp);
1099
+ $attrs = array_slice($temp,0, count($temp)-1);
1100
+ foreach($attrs as $attr)
1101
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1102
+ }
1103
+
1104
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1105
+ $input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active");
1106
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1107
+ $hide_cents = ($param['w_hide_cents']=="yes" ? "none;" : "table-cell;");
1108
+
1109
+
1110
+ $w_first_val = explode('***',$param['w_first_val']);
1111
+ $w_title = explode('***',$param['w_title']);
1112
+ $w_mini_labels = explode('***',$param['w_mini_labels']);
1113
+
1114
+ $rep ='<div id="wdform_field'.$id.'" type="type_paypal_price" class="wdform_field" style="display: table-cell;"><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'].'></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'].'></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>';
1115
+ break;
1116
+ }
1117
+
1118
+ case 'type_paypal_select':
1119
+ {
1120
+ $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');
1121
+ $temp=$params;
1122
+ foreach($params_names as $params_name )
1123
+ {
1124
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1125
+ $param[$params_name] = $temp[0];
1126
+ $temp=$temp[1];
1127
+ }
1128
+
1129
+ if($temp)
1130
+ {
1131
+ $temp =explode('*:*w_attr_name*:*',$temp);
1132
+ $attrs = array_slice($temp,0, count($temp)-1);
1133
+ foreach($attrs as $attr)
1134
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1135
+ }
1136
+
1137
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1138
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1139
+ $param['w_choices'] = explode('***',$param['w_choices']);
1140
+
1141
+ $param['w_choices_price'] = explode('***',$param['w_choices_price']);
1142
+
1143
+ $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
1144
+
1145
+ $param['w_choices_disabled'] = explode('***',$param['w_choices_disabled']);
1146
+ $param['w_property'] = explode('***',$param['w_property']);
1147
+ $param['w_property_values'] = explode('***',$param['w_property_values']);
1148
+
1149
+ foreach($param['w_choices_checked'] as $key => $choices_checked )
1150
+ {
1151
+ if($choices_checked=='true')
1152
+ $param['w_choices_checked'][$key]='selected="selected"';
1153
+ else
1154
+ $param['w_choices_checked'][$key]='';
1155
+ }
1156
+
1157
+
1158
+ $rep='<div id="wdform_field'.$id.'" type="type_paypal_select" class="wdform_field" style="display: table-cell;"><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'].'>';
1159
+ foreach($param['w_choices'] as $key => $choice)
1160
+ {
1161
+ if($param['w_choices_disabled'][$key]=="true")
1162
+ $choice_value='';
1163
+ else
1164
+ $choice_value=$param['w_choices_price'][$key];
1165
+ $rep.='<option id="'.$id.'_option'.$key.'" value="'.$choice_value.'" onselect="set_select(&quot;'.$id.'_option'.$key.'&quot;)" '.$param['w_choices_checked'][$key].'>'.$choice.'</option>';
1166
+ }
1167
+ $rep.='</select><div id="'.$id.'_divform_id_temp">';
1168
+ if($param['w_quantity']=="yes")
1169
+ $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;"></span>';
1170
+ if($param['w_property'][0])
1171
+ foreach($param['w_property'] as $key => $property)
1172
+ {
1173
+
1174
+ $rep.='
1175
+ <span id="'.$id.'_property_'.$key.'" style="margin-right: 15px;">
1176
+
1177
+ <label class="mini_label" id="'.$id.'_property_label_form_id_temp'.$key.'" style="margin-right: 5px;">'.$property.'</label>
1178
+ <select id="'.$id.'_propertyform_id_temp'.$key.'" name="'.$id.'_propertyform_id_temp'.$key.'" style="width: auto; margin: 2px 0px;">';
1179
+ $param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
1180
+ $param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
1181
+ foreach($param['w_property_values'][$key] as $subkey => $property_value)
1182
+ {
1183
+ $rep.='<option id="'.$id.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'">'.$property_value.'</option>';
1184
+ }
1185
+ $rep.='</select></span>';
1186
+ }
1187
+
1188
+ $rep.='</div></div></div>';
1189
+ break;
1190
+ }
1191
+
1192
+ case 'type_paypal_checkbox':
1193
+ {
1194
+
1195
+ $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');
1196
+ $temp=$params;
1197
+ foreach($params_names as $params_name )
1198
+ {
1199
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1200
+ $param[$params_name] = $temp[0];
1201
+ $temp=$temp[1];
1202
+ }
1203
+
1204
+ if($temp)
1205
+ {
1206
+ $temp =explode('*:*w_attr_name*:*',$temp);
1207
+ $attrs = array_slice($temp,0, count($temp)-1);
1208
+ foreach($attrs as $attr)
1209
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1210
+ }
1211
+
1212
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1213
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1214
+ $param['w_choices'] = explode('***',$param['w_choices']);
1215
+ $param['w_choices_price'] = explode('***',$param['w_choices_price']);
1216
+ $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
1217
+ $param['w_property'] = explode('***',$param['w_property']);
1218
+ $param['w_property_values'] = explode('***',$param['w_property_values']);
1219
+
1220
+ foreach($param['w_choices_checked'] as $key => $choices_checked )
1221
+ {
1222
+ if($choices_checked=='true')
1223
+ $param['w_choices_checked'][$key]='checked="checked"';
1224
+ else
1225
+ $param['w_choices_checked'][$key]='';
1226
+ }
1227
+
1228
+ $rep='<div id="wdform_field'.$id.'" type="type_paypal_checkbox" class="wdform_field" style="display: table-cell;"><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_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"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;">';
1229
+
1230
+ if($param['w_flow']=='hor')
1231
+ {
1232
+ $rep.= '<div id="'.$id.'_hor" style="display: table-row;">';
1233
+ foreach($param['w_choices'] as $key => $choice)
1234
+ {
1235
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key)
1236
+ $rep.='<div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="checkbox" other="1" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp'.$key.'" value="'.$param['w_choices_price'][$key].'" onclick="if(set_checked(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;)) show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div>';
1237
+ else
1238
+ $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'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div>';
1239
+ }
1240
+ $rep.= '</div>';
1241
+ }
1242
+ else
1243
+ {
1244
+ $rep.= '<div id="'.$id.'_table_little" style="display: table-row-group;">';
1245
+ foreach($param['w_choices'] as $key => $choice)
1246
+ {
1247
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key)
1248
+ $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" value="'.$param['w_choices_price'][$key].'" other="1" id="'.$id.'_elementform_id_temp'.$key.'" onclick="if(set_checked(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;)) show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" name="'.$id.'_elementform_id_temp'.$key.'" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div></div>';
1249
+ else
1250
+ $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'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div></div>'; }
1251
+ $rep.= '</div>';
1252
+ }
1253
+ $rep.='</div></div>';
1254
+
1255
+ $rep.='<div id="'.$id.'_divform_id_temp">';
1256
+ if($param['w_quantity']=="yes")
1257
+ $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;"></span>';
1258
+ if($param['w_property'][0])
1259
+ foreach($param['w_property'] as $key => $property)
1260
+ {
1261
+ $rep.='
1262
+ <span id="'.$id.'_property_'.$key.'" style="margin-right: 15px;">
1263
+
1264
+ <label class="mini_label" id="'.$id.'_property_label_form_id_temp'.$key.'" style="margin-right: 5px;">'.$property.'</label>
1265
+ <select id="'.$id.'_propertyform_id_temp'.$key.'" name="'.$id.'_propertyform_id_temp'.$key.'" style="width: auto; margin: 2px 0px;">';
1266
+ $param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
1267
+ $param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
1268
+ foreach($param['w_property_values'][$key] as $subkey => $property_value)
1269
+ {
1270
+ $rep.='<option id="'.$id.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'">'.$property_value.'</option>';
1271
+ }
1272
+ $rep.='</select></span>';
1273
+ }
1274
+
1275
+ $rep.='</div></div></div>';
1276
+ break;
1277
+ }
1278
+ case 'type_paypal_radio':
1279
+ {
1280
+
1281
+ $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');
1282
+ $temp=$params;
1283
+ foreach($params_names as $params_name )
1284
+ {
1285
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1286
+ $param[$params_name] = $temp[0];
1287
+ $temp=$temp[1];
1288
+ }
1289
+
1290
+ if($temp)
1291
+ {
1292
+ $temp =explode('*:*w_attr_name*:*',$temp);
1293
+ $attrs = array_slice($temp,0, count($temp)-1);
1294
+ foreach($attrs as $attr)
1295
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1296
+ }
1297
+
1298
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1299
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1300
+ $param['w_choices'] = explode('***',$param['w_choices']);
1301
+
1302
+ $param['w_choices_price'] = explode('***',$param['w_choices_price']);
1303
+
1304
+ $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
1305
+
1306
+ $param['w_property'] = explode('***',$param['w_property']);
1307
+ $param['w_property_values'] = explode('***',$param['w_property_values']);
1308
+
1309
+ foreach($param['w_choices_checked'] as $key => $choices_checked )
1310
+ {
1311
+ if($choices_checked=='true')
1312
+ $param['w_choices_checked'][$key]='checked="checked"';
1313
+ else
1314
+ $param['w_choices_checked'][$key]='';
1315
+ }
1316
+
1317
+ $rep='<div id="wdform_field'.$id.'" type="type_paypal_radio" class="wdform_field" style="display: table-cell;"><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_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"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;">';
1318
+
1319
+ if($param['w_flow']=='hor')
1320
+ {
1321
+ $rep.= '<div id="'.$id.'_hor" style="display: table-row;">';
1322
+ foreach($param['w_choices'] as $key => $choice)
1323
+ {
1324
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key)
1325
+ $rep.='<div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="radio" other="1" 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;); show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div>';
1326
+ else
1327
+ $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'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div>';
1328
+ }
1329
+ $rep.= '</div>';
1330
+ }
1331
+ else
1332
+ {
1333
+ $rep.= '<div id="'.$id.'_table_little" style="display: table-row-group;">';
1334
+ foreach($param['w_choices'] as $key => $choice)
1335
+ {
1336
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key)
1337
+ $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" value="'.$param['w_choices_price'][$key].'" other="1" id="'.$id.'_elementform_id_temp'.$key.'" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;); show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" name="'.$id.'_elementform_id_temp" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div></div>';
1338
+ else
1339
+ $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'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div></div>'; }
1340
+ $rep.= '</div>';
1341
+ }
1342
+ $rep.='</div></div>';
1343
+
1344
+ $rep.='<div id="'.$id.'_divform_id_temp">';
1345
+ if($param['w_quantity']=="yes")
1346
+ $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;"></span>';
1347
+ if($param['w_property'][0])
1348
+ foreach($param['w_property'] as $key => $property)
1349
+ {
1350
+ $rep.='
1351
+ <span id="'.$id.'_property_'.$key.'" style="margin-right: 15px;">
1352
+
1353
+ <label class="mini_label" id="'.$id.'_property_label_form_id_temp'.$key.'" style="margin-right: 5px;">'.$property.'</label>
1354
+ <select id="'.$id.'_propertyform_id_temp'.$key.'" name="'.$id.'_propertyform_id_temp'.$key.'" style="width: auto; margin: 2px 0px;">';
1355
+ $param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
1356
+ $param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
1357
+ foreach($param['w_property_values'][$key] as $subkey => $property_value)
1358
+ {
1359
+ $rep.='<option id="'.$id.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'">'.$property_value.'</option>';
1360
+ }
1361
+ $rep.='</select></span>';
1362
+ }
1363
+
1364
+ $rep.='</div></div></div>';
1365
+
1366
+ break;
1367
+ }
1368
+ case 'type_paypal_shipping':
1369
+ {
1370
+
1371
+ $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');
1372
+ $temp=$params;
1373
+ foreach($params_names as $params_name )
1374
+ {
1375
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1376
+ $param[$params_name] = $temp[0];
1377
+ $temp=$temp[1];
1378
+ }
1379
+
1380
+ if($temp)
1381
+ {
1382
+ $temp =explode('*:*w_attr_name*:*',$temp);
1383
+ $attrs = array_slice($temp,0, count($temp)-1);
1384
+ foreach($attrs as $attr)
1385
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1386
+ }
1387
+
1388
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1389
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1390
+ $param['w_choices'] = explode('***',$param['w_choices']);
1391
+
1392
+ $param['w_choices_price'] = explode('***',$param['w_choices_price']);
1393
+
1394
+ $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
1395
+
1396
+
1397
+ foreach($param['w_choices_checked'] as $key => $choices_checked )
1398
+ {
1399
+ if($choices_checked=='true')
1400
+ $param['w_choices_checked'][$key]='checked="checked"';
1401
+ else
1402
+ $param['w_choices_checked'][$key]='';
1403
+ }
1404
+
1405
+ $rep='<div id="wdform_field'.$id.'" type="type_paypal_shipping" class="wdform_field" style="display: table-cell;"><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_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"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;">';
1406
+
1407
+ if($param['w_flow']=='hor')
1408
+ {
1409
+ $rep.= '<div id="'.$id.'_hor" style="display: table-row;">';
1410
+ foreach($param['w_choices'] as $key => $choice)
1411
+ {
1412
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key)
1413
+ $rep.='<div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="radio" other="1" 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;); show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div>';
1414
+ else
1415
+ $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'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div>';
1416
+ }
1417
+ $rep.= '</div>';
1418
+ }
1419
+ else
1420
+ {
1421
+ $rep.= '<div id="'.$id.'_table_little" style="display: table-row-group;">';
1422
+ foreach($param['w_choices'] as $key => $choice)
1423
+ {
1424
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key)
1425
+ $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" value="'.$param['w_choices_price'][$key].'" other="1" id="'.$id.'_elementform_id_temp'.$key.'" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;); show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" name="'.$id.'_elementform_id_temp" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div></div>';
1426
+ else
1427
+ $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'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div></div>'; }
1428
+ $rep.= '</div>';
1429
+ }
1430
+ $rep.='</div></div>';
1431
+
1432
+ $rep.='</div></div>';
1433
+
1434
+ break;
1435
+ }
1436
+ case 'type_paypal_total':
1437
+ {
1438
+ $params_names=array('w_field_label_size','w_field_label_pos','w_class');
1439
+ $temp=$params;
1440
+ foreach($params_names as $params_name )
1441
+ {
1442
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1443
+ $param[$params_name] = $temp[0];
1444
+ $temp=$temp[1];
1445
+ }
1446
+
1447
+ if($temp)
1448
+ {
1449
+ $temp =explode('*:*w_attr_name*:*',$temp);
1450
+ $attrs = array_slice($temp,0, count($temp)-1);
1451
+ foreach($attrs as $attr)
1452
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1453
+ }
1454
+
1455
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1456
+
1457
+
1458
+
1459
+ $rep='<div id="wdform_field'.$id.'" type="type_paypal_total" class="wdform_field" style="display: table-cell;"><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>';
1460
+
1461
+
1462
+ break;
1463
+ }
1464
+
1465
+ case 'type_star_rating':
1466
+ {
1467
+ $params_names=array('w_field_label_size','w_field_label_pos','w_field_label_col','w_star_amount','w_required','w_class');
1468
+ $temp=$params;
1469
+ foreach($params_names as $params_name )
1470
+ {
1471
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1472
+ $param[$params_name] = $temp[0];
1473
+ $temp=$temp[1];
1474
+ }
1475
+
1476
+ if($temp)
1477
+ {
1478
+ $temp =explode('*:*w_attr_name*:*',$temp);
1479
+ $attrs = array_slice($temp,0, count($temp)-1);
1480
+ foreach($attrs as $attr)
1481
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1482
+ }
1483
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1484
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1485
+
1486
+
1487
+ $images = '';
1488
+ for($i=0; $i<$param['w_star_amount']; $i++)
1489
+ {
1490
+ $images .= '<img id="'.$id.'_star_'.$i.'" src="' . WD_FMC_URL . '/images/star.png" 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;)">';
1491
+ }
1492
+
1493
+ $rep ='<div id="wdform_field'.$id.'" type="type_star_rating" class="wdform_field" style="display: table-cell;"><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>';
1494
+
1495
+
1496
+ break;
1497
+ }
1498
+ case 'type_scale_rating':
1499
+ {
1500
+ $params_names=array('w_field_label_size','w_field_label_pos','w_mini_labels','w_scale_amount','w_required','w_class');
1501
+ $temp=$params;
1502
+ foreach($params_names as $params_name )
1503
+ {
1504
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1505
+ $param[$params_name] = $temp[0];
1506
+ $temp=$temp[1];
1507
+ }
1508
+
1509
+ if($temp)
1510
+ {
1511
+ $temp =explode('*:*w_attr_name*:*',$temp);
1512
+ $attrs = array_slice($temp,0, count($temp)-1);
1513
+ foreach($attrs as $attr)
1514
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1515
+ }
1516
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1517
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1518
+
1519
+ $w_mini_labels = explode('***',$param['w_mini_labels']);
1520
+
1521
+ $numbers = '';
1522
+ for($i=1; $i<=$param['w_scale_amount']; $i++)
1523
+ {
1524
+ $numbers .= '<div id="'.$id.'_scale_td1_'.$i.'form_id_temp" style="text-align: center; display: table-cell;"><span>'.$i.'</span></div>';
1525
+ }
1526
+
1527
+
1528
+ $radio_buttons = '';
1529
+ for($k=1; $k<=$param['w_scale_amount']; $k++)
1530
+ {
1531
+ $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>';
1532
+ }
1533
+
1534
+ $rep ='<div id="wdform_field'.$id.'" type="type_scale_rating" class="wdform_field" style="display: table-cell;"><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>';
1535
+
1536
+ break;
1537
+ }
1538
+ case 'type_spinner':
1539
+ {
1540
+ $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');
1541
+ $temp=$params;
1542
+ foreach($params_names as $params_name ) {
1543
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1544
+ $param[$params_name] = $temp[0];
1545
+ $temp=$temp[1];
1546
+ }
1547
+ if($temp) {
1548
+ $temp =explode('*:*w_attr_name*:*',$temp);
1549
+ $attrs = array_slice($temp,0, count($temp)-1);
1550
+ foreach($attrs as $attr)
1551
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1552
+ }
1553
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1554
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1555
+ $rep ='<div id="wdform_field'.$id.'" type="type_spinner" class="wdform_field" style="display: table-cell;"><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'].'></div></div>';
1556
+ break;
1557
+ }
1558
+ case 'type_slider': {
1559
+ $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');
1560
+ $temp=$params;
1561
+ foreach($params_names as $params_name ) {
1562
+ $temp = explode('*:*'.$params_name.'*:*',$temp);
1563
+ $param[$params_name] = $temp[0];
1564
+ $temp=$temp[1];
1565
+ }
1566
+ if ($temp) {
1567
+ $temp = explode('*:*w_attr_name*:*', $temp);
1568
+ $attrs = array_slice($temp,0, count($temp)-1);
1569
+ foreach($attrs as $attr) {
1570
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
1571
+ }
1572
+ }
1573
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1574
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1575
+ $rep ='<div id="wdform_field'.$id.'" type="type_slider" class="wdform_field" style="display: table-cell;"><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>';
1576
+ break;
1577
+ }
1578
+ case 'type_range': {
1579
+ $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');
1580
+ $temp = $params;
1581
+ foreach ($params_names as $params_name ) {
1582
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
1583
+ $param[$params_name] = $temp[0];
1584
+ $temp = $temp[1];
1585
+ }
1586
+ if ($temp) {
1587
+ $temp = explode('*:*w_attr_name*:*', $temp);
1588
+ $attrs = array_slice($temp, 0, count($temp) - 1);
1589
+ foreach($attrs as $attr) {
1590
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1591
+ }
1592
+ }
1593
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1594
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1595
+ $w_mini_labels = explode('***',$param['w_mini_labels']);
1596
+ $rep ='<div id="wdform_field'.$id.'" type="type_range" class="wdform_field" style="display: table-cell;"><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'].'></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'].'></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>';
1597
+ break;
1598
+ }
1599
+ case 'type_grading': {
1600
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_items', 'w_total', 'w_required', 'w_class');
1601
+ $temp = $params;
1602
+ foreach($params_names as $params_name) {
1603
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
1604
+ $param[$params_name] = $temp[0];
1605
+ $temp = $temp[1];
1606
+ }
1607
+ if ($temp) {
1608
+ $temp = explode('*:*w_attr_name*:*', $temp);
1609
+ $attrs = array_slice($temp, 0, count($temp) - 1);
1610
+ foreach ($attrs as $attr) {
1611
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1612
+ }
1613
+ }
1614
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
1615
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
1616
+ $w_items = explode('***', $param['w_items']);
1617
+ $grading_items = '';
1618
+ for ($i = 0; $i < count($w_items); $i++) {
1619
+ $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'].'><label id="'.$id.'_label_elementform_id_temp'.$i.'" class="ch-rad-label">'.$w_items[$i].'</label></div>';
1620
+ }
1621
+ $rep ='<div id="wdform_field'.$id.'" type="type_grading" class="wdform_field" style="display: table-cell;"><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>';
1622
+ break;
1623
+ }
1624
+ case 'type_matrix': {
1625
+ $params_names=array('w_field_label_size','w_field_label_pos', 'w_field_input_type', 'w_rows', 'w_columns', 'w_required','w_class');
1626
+ $temp = $params;
1627
+ foreach ($params_names as $params_name) {
1628
+ $temp = explode('*:*'.$params_name.'*:*',$temp);
1629
+ $param[$params_name] = $temp[0];
1630
+ $temp = $temp[1];
1631
+ }
1632
+ if ($temp) {
1633
+ $temp = explode('*:*w_attr_name*:*', $temp);
1634
+ $attrs = array_slice($temp, 0, count($temp) - 1);
1635
+ foreach ($attrs as $attr) {
1636
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1637
+ }
1638
+ }
1639
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1640
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1641
+ $w_rows = explode('***',$param['w_rows']);
1642
+ $w_columns = explode('***',$param['w_columns']);
1643
+ $column_labels = '';
1644
+ for ($i = 1; $i < count($w_columns); $i++) {
1645
+ $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>';
1646
+ }
1647
+ $rows_columns = '';
1648
+ for ($i = 1; $i < count($w_rows); $i++) {
1649
+ $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>';
1650
+ for ($k = 1; $k < count($w_columns); $k++) {
1651
+ if($param['w_field_input_type']=='radio') {
1652
+ $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.'"></div>';
1653
+ }
1654
+ elseif ($param['w_field_input_type']=='checkbox') {
1655
+ $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"></div>';
1656
+ }
1657
+ elseif ($param['w_field_input_type']=='text') {
1658
+ $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="text" name="'.$id.'_input_elementform_id_temp'.$i.'_'.$k.'" value=""></div>';
1659
+ }
1660
+ elseif ($param['w_field_input_type']=='select') {
1661
+ $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.'"><option value=""> </option><option value="yes">Yes</option><option value="no">No</option></select></div>';
1662
+ }
1663
+ }
1664
+ $rows_columns .= '</div>';
1665
+ }
1666
+ $rep ='<div id="wdform_field'.$id.'" type="type_matrix" class="wdform_field" style="display: table-cell;"><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"><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>';
1667
+ break;
1668
+ }
1669
+ case 'type_submit_reset': {
1670
+ $params_names=array('w_submit_title','w_reset_title','w_class','w_act');
1671
+ $temp=$params;
1672
+ foreach ($params_names as $params_name) {
1673
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1674
+ $param[$params_name] = $temp[0];
1675
+ $temp=$temp[1];
1676
+ }
1677
+ if ($temp) {
1678
+ $temp = explode('*:*w_attr_name*:*',$temp);
1679
+ $attrs = array_slice($temp,0, count($temp)-1);
1680
+ foreach ($attrs as $attr) {
1681
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1682
+ }
1683
+ }
1684
+ $param['w_act'] = ($param['w_act']=="false" ? 'style="display: none;"' : "");
1685
+ $rep='<div id="wdform_field'.$id.'" type="type_submit_reset" class="wdform_field" style="display: table-cell;"><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>';
1686
+ break;
1687
+ }
1688
+ case 'type_button': {
1689
+ $params_names=array('w_title','w_func','w_class');
1690
+ $temp=$params;
1691
+ foreach($params_names as $params_name) {
1692
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1693
+ $param[$params_name] = $temp[0];
1694
+ $temp=$temp[1];
1695
+ }
1696
+ if ($temp) {
1697
+ $temp = explode('*:*w_attr_name*:*',$temp);
1698
+ $attrs = array_slice($temp,0, count($temp)-1);
1699
+ foreach($attrs as $attr) {
1700
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1701
+ }
1702
+ }
1703
+ $param['w_title'] = explode('***',$param['w_title']);
1704
+ $param['w_func'] = explode('***',$param['w_func']);
1705
+ $rep.='<div id="wdform_field'.$id.'" type="type_button" class="wdform_field" style="display: table-cell;"><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">';
1706
+ foreach ($param['w_title'] as $key => $title) {
1707
+ $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>';
1708
+ }
1709
+ $rep .= '</div></div>';
1710
+ break;
1711
+ }
1712
+ }
1713
+ // Arrows.
1714
+ switch ($type) {
1715
+ case 'type_section_break': {
1716
+ $rep =$rep.'<div id="wdform_arrows'.$id.'" class="wdform_arrows_section"><div id="X_'.$id.'" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/delete_el.png" title="Remove the field" onclick="remove_section_break(&quot;'.$id.'&quot;)"></div><div id="edit_'.$id.'" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/edit.png" title="Edit the field" onclick="edit(&quot;'.$id.'&quot;)"><span id="'.$id.'_element_labelform_id_temp" style="display: none;">custom_'.$id.'</span></div><div id="dublicate_'.$id.'" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/dublicate.png" title="Dublicate the field" onclick="dublicate(&quot;'.$id.'&quot;)"></div></div>';
1717
+ break;
1718
+ }
1719
+ case 'type_send_copy':
1720
+ case 'type_captcha':
1721
+ case 'type_recaptcha': {
1722
+ $rep =$rep.'<div id="wdform_arrows'.$id.'" class="wdform_arrows" style="display: table-cell;"><div id="X_'.$id.'" valign="middle" align="right" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/delete_el.png" title="Remove the field" onclick="remove_row(&quot;'.$id.'&quot;)"></div><div id="left_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/left.png" title="Move the field to the left" onclick="left_row(&quot;'.$id.'&quot;)"></div><div id="up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/up.png" title="Move the field up" onclick="up_row(&quot;'.$id.'&quot;)"></div><div id="down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/down.png" title="Move the field down" onclick="down_row(&quot;'.$id.'&quot;)"></div><div id="right_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/right.png" title="Move the field to the right" onclick="right_row(&quot;'.$id.'&quot;)"></div><div id="edit_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/edit.png" title="Edit the field" onclick="edit(&quot;'.$id.'&quot;)"></div><div id="dublicate_'.$id.'" valign="middle" class="element_toolbar"></div><div id="page_up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/page_up.png" title="Move the field to the upper page" onclick="page_up(&quot;'.$id.'&quot;)"></div><div id="page_down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/page_down.png" title="Move the field to the lower page" onclick="page_down(&quot;'.$id.'&quot;)"></div></div>';
1723
+ break;
1724
+ }
1725
+ default: {
1726
+ $rep =$rep.'<div id="wdform_arrows'.$id.'" class="wdform_arrows" style="display: table-cell;"><div id="X_'.$id.'" valign="middle" align="right" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/delete_el.png" 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_FMC_URL . '/images/left.png" 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_FMC_URL . '/images/up.png" 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_FMC_URL . '/images/down.png" 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_FMC_URL . '/images/right.png" 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_FMC_URL . '/images/edit.png" 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="dublicate_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/dublicate.png" title="Dublicate the field" onclick="dublicate(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;dublicate&quot;)" onmouseout="chnage_icons_src(this,&quot;dublicate&quot;)"></div><div id="page_up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/page_up.png" 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_FMC_URL . '/images/page_down.png" 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>';
1727
+ break;
1728
+ }
1729
+ }
1730
+ $form = str_replace('%' . $id . ' - ' . $labels[$ids_key] . '%', $rep, $form);
1731
+ $form = str_replace('%' . $id . ' -' . $labels[$ids_key] . '%', $rep, $form);
1732
+ $row->form_front = $form;
1733
+ }
1734
+ }
1735
+ }
1736
+ else {
1737
+ $row = new stdClass();
1738
+ $row->id = 0;
1739
+ $row->title = '';
1740
+ $row->mail = '';
1741
+ $row->form = '';
1742
+ $row->form_front = '';
1743
+ $row->theme = 0;
1744
+ $row->javascript = '';
1745
+ $row->submit_text = '';
1746
+ $row->url = '';
1747
+ $row->submit_text_type = 0;
1748
+ $row->script1 = '';
1749
+ $row->script2 = '';
1750
+ $row->script_user1 = '';
1751
+ $row->script_user2 = '';
1752
+ $row->counter = 0;
1753
+ $row->label_order = '';
1754
+ $row->article_id = '';
1755
+ $row->pagination = '';
1756
+ $row->show_title = '';
1757
+ $row->show_numbers = '';
1758
+ $row->public_key = '';
1759
+ $row->private_key = '';
1760
+ $row->recaptcha_theme = '';
1761
+ $row->from_name = '';
1762
+ $row->from_mail = '';
1763
+ $row->label_order_current = '';
1764
+ $row->script_mail_user = '';
1765
+ $row->script_mail = '';
1766
+ $row->tax = 0;
1767
+ $row->payment_currency = '$';
1768
+ $row->paypal_email = '';
1769
+ $row->checkout_mode = 'testmode';
1770
+ $row->paypal_mode = 0;
1771
+
1772
+ $row->published = 1;
1773
+ $row->form_fields = '';
1774
+ $row->savedb = 1;
1775
+ $row->sendemail = 1;
1776
+ $row->requiredmark = '*';
1777
+ $row->reply_to = 0;
1778
+ $row->send_to = 0;
1779
+ $row->autogen_layout = 1;
1780
+ $row->custom_front = '';
1781
+ $row->mail_from_user = '';
1782
+ $row->mail_from_name_user = '';
1783
+ $row->reply_to_user = '';
1784
+
1785
+ $row->condition = '';
1786
+ $row->mail_cc = '';
1787
+ $row->mail_cc_user = '';
1788
+ $row->mail_bcc = '';
1789
+ $row->mail_bcc_user = '';
1790
+ $row->mail_subject = '';
1791
+ $row->mail_subject_user = '';
1792
+ $row->mail_mode = 1;
1793
+ $row->mail_mode_user = 1;
1794
+ $row->mail_attachment = 1;
1795
+ $row->mail_attachment_user = 1;
1796
+ }
1797
+ return $row;
1798
+ }
1799
+
1800
+ public function get_theme_rows_data($old = '') {
1801
+ global $wpdb;
1802
+ $rows = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker_themes WHERE css " . ($old ? 'NOT' : '') . " LIKE '%.wdform_section%' ORDER BY title");
1803
+ return $rows;
1804
+ }
1805
+
1806
+ public function page_nav() {
1807
+ global $wpdb;
1808
+ $where = 'WHERE `id` IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ')';
1809
+ $where .= ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? ' AND title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
1810
+ $query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker " . $where;
1811
+ $total = $wpdb->get_var($query);
1812
+ $page_nav['total'] = $total;
1813
+ if (isset($_POST['page_number']) && $_POST['page_number']) {
1814
+ $limit = ((int) $_POST['page_number'] - 1) * 20;
1815
+ }
1816
+ else {
1817
+ $limit = 0;
1818
+ }
1819
+ $page_nav['limit'] = (int) ($limit / 20 + 1);
1820
+ return $page_nav;
1821
+ }
1822
+ ////////////////////////////////////////////////////////////////////////////////////////
1823
+ // Getters & Setters //
1824
+ ////////////////////////////////////////////////////////////////////////////////////////
1825
+ ////////////////////////////////////////////////////////////////////////////////////////
1826
+ // Private Methods //
1827
+ ////////////////////////////////////////////////////////////////////////////////////////
1828
+ ////////////////////////////////////////////////////////////////////////////////////////
1829
+ // Listeners //
1830
+ ////////////////////////////////////////////////////////////////////////////////////////
1831
  }
admin/models/FMModelThemes_fmc.php CHANGED
@@ -1,89 +1,89 @@
1
- <?php
2
-
3
- class FMModelThemes_fmc {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function 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'])) ? esc_html($_POST['asc_or_desc']) : 'asc');
25
- $order_by = ' ORDER BY ' . ((isset($_POST['order_by']) && esc_html($_POST['order_by']) != '') ? esc_html($_POST['order_by']) : 'id') . ' ' . $asc_or_desc;
26
- if (isset($_POST['page_number']) && $_POST['page_number']) {
27
- $limit = ((int) $_POST['page_number'] - 1) * 20;
28
- }
29
- else {
30
- $limit = 0;
31
- }
32
- $query = "SELECT * FROM " . $wpdb->prefix . "formmaker_themes " . $where . $order_by . " LIMIT " . $limit . ",20";
33
- $rows = $wpdb->get_results($query);
34
- return $rows;
35
- }
36
-
37
- public function get_row_data($id, $reset) {
38
- global $wpdb;
39
- if ($id != 0) {
40
- $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id));
41
- if ($reset) {
42
- if (!$row->default) {
43
- $row_id = $row->id;
44
- $row_title = $row->title;
45
- $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_themes WHERE default="%d"', 1));
46
- $row->id = $row_id;
47
- $row->title = $row_title;
48
- $row->default = FALSE;
49
- }
50
- else {
51
- $row->css = '';
52
- }
53
- }
54
- }
55
- else {
56
- $row = new stdClass();
57
- $row->id = 0;
58
- $row->title = '';
59
- $row->css = '';
60
- $row->default = 0;
61
- }
62
- return $row;
63
- }
64
-
65
- public function page_nav() {
66
- global $wpdb;
67
- $where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
68
- $query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker_themes " . $where;
69
- $total = $wpdb->get_var($query);
70
- $page_nav['total'] = $total;
71
- if (isset($_POST['page_number']) && $_POST['page_number']) {
72
- $limit = ((int) $_POST['page_number'] - 1) * 20;
73
- }
74
- else {
75
- $limit = 0;
76
- }
77
- $page_nav['limit'] = (int) ($limit / 20 + 1);
78
- return $page_nav;
79
- }
80
- ////////////////////////////////////////////////////////////////////////////////////////
81
- // Getters & Setters //
82
- ////////////////////////////////////////////////////////////////////////////////////////
83
- ////////////////////////////////////////////////////////////////////////////////////////
84
- // Private Methods //
85
- ////////////////////////////////////////////////////////////////////////////////////////
86
- ////////////////////////////////////////////////////////////////////////////////////////
87
- // Listeners //
88
- ////////////////////////////////////////////////////////////////////////////////////////
89
  }
1
+ <?php
2
+
3
+ class FMModelThemes_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function 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'])) ? esc_html($_POST['asc_or_desc']) : 'asc');
25
+ $order_by = ' ORDER BY ' . ((isset($_POST['order_by']) && esc_html($_POST['order_by']) != '') ? esc_html($_POST['order_by']) : 'id') . ' ' . $asc_or_desc;
26
+ if (isset($_POST['page_number']) && $_POST['page_number']) {
27
+ $limit = ((int) $_POST['page_number'] - 1) * 20;
28
+ }
29
+ else {
30
+ $limit = 0;
31
+ }
32
+ $query = "SELECT * FROM " . $wpdb->prefix . "formmaker_themes " . $where . $order_by . " LIMIT " . $limit . ",20";
33
+ $rows = $wpdb->get_results($query);
34
+ return $rows;
35
+ }
36
+
37
+ public function get_row_data($id, $reset) {
38
+ global $wpdb;
39
+ if ($id != 0) {
40
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id));
41
+ if ($reset) {
42
+ if (!$row->default) {
43
+ $row_id = $row->id;
44
+ $row_title = $row->title;
45
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_themes WHERE default="%d"', 1));
46
+ $row->id = $row_id;
47
+ $row->title = $row_title;
48
+ $row->default = FALSE;
49
+ }
50
+ else {
51
+ $row->css = '';
52
+ }
53
+ }
54
+ }
55
+ else {
56
+ $row = new stdClass();
57
+ $row->id = 0;
58
+ $row->title = '';
59
+ $row->css = '';
60
+ $row->default = 0;
61
+ }
62
+ return $row;
63
+ }
64
+
65
+ public function page_nav() {
66
+ global $wpdb;
67
+ $where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
68
+ $query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker_themes " . $where;
69
+ $total = $wpdb->get_var($query);
70
+ $page_nav['total'] = $total;
71
+ if (isset($_POST['page_number']) && $_POST['page_number']) {
72
+ $limit = ((int) $_POST['page_number'] - 1) * 20;
73
+ }
74
+ else {
75
+ $limit = 0;
76
+ }
77
+ $page_nav['limit'] = (int) ($limit / 20 + 1);
78
+ return $page_nav;
79
+ }
80
+ ////////////////////////////////////////////////////////////////////////////////////////
81
+ // Getters & Setters //
82
+ ////////////////////////////////////////////////////////////////////////////////////////
83
+ ////////////////////////////////////////////////////////////////////////////////////////
84
+ // Private Methods //
85
+ ////////////////////////////////////////////////////////////////////////////////////////
86
+ ////////////////////////////////////////////////////////////////////////////////////////
87
+ // Listeners //
88
+ ////////////////////////////////////////////////////////////////////////////////////////
89
  }
admin/models/FMModelUninstall_fmc.php CHANGED
@@ -1,53 +1,53 @@
1
- <?php
2
-
3
- class FMModelUninstall_fmc {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
- public function delete_db_tables() {
22
- global $wpdb;
23
- $true_or_false_forms = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker WHERE `id` NOT 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` IN (" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ")");
26
- $wpdb->query("DELETE FROM " . $wpdb->prefix . "formmaker_submits WHERE `form_id` IN (" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ")");
27
- $wpdb->query("DELETE FROM " . $wpdb->prefix . "formmaker_views WHERE `form_id` IN (" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ")");
28
- delete_option('contact_form_forms');
29
- }
30
- else {
31
- $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker");
32
- $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_submits");
33
- $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_views");
34
- $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_themes");
35
- $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_sessions");
36
- $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_blocked");
37
- $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_query");
38
- delete_option('contact_form_forms');
39
- delete_option("wd_form_maker_version");
40
- delete_option('formmaker_cureent_version');
41
- delete_option('form_maker_pro_active');
42
- }
43
- }
44
- ////////////////////////////////////////////////////////////////////////////////////////
45
- // Getters & Setters //
46
- ////////////////////////////////////////////////////////////////////////////////////////
47
- ////////////////////////////////////////////////////////////////////////////////////////
48
- // Private Methods //
49
- ////////////////////////////////////////////////////////////////////////////////////////
50
- ////////////////////////////////////////////////////////////////////////////////////////
51
- // Listeners //
52
- ////////////////////////////////////////////////////////////////////////////////////////
53
  }
1
+ <?php
2
+
3
+ class FMModelUninstall_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function delete_db_tables() {
22
+ global $wpdb;
23
+ $true_or_false_forms = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker WHERE `id` NOT 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` IN (" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ")");
26
+ $wpdb->query("DELETE FROM " . $wpdb->prefix . "formmaker_submits WHERE `form_id` IN (" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ")");
27
+ $wpdb->query("DELETE FROM " . $wpdb->prefix . "formmaker_views WHERE `form_id` IN (" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ")");
28
+ delete_option('contact_form_forms');
29
+ }
30
+ else {
31
+ $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker");
32
+ $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_submits");
33
+ $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_views");
34
+ $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_themes");
35
+ $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_sessions");
36
+ $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_blocked");
37
+ $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_query");
38
+ delete_option('contact_form_forms');
39
+ delete_option("wd_form_maker_version");
40
+ delete_option('formmaker_cureent_version');
41
+ delete_option('form_maker_pro_active');
42
+ }
43
+ }
44
+ ////////////////////////////////////////////////////////////////////////////////////////
45
+ // Getters & Setters //
46
+ ////////////////////////////////////////////////////////////////////////////////////////
47
+ ////////////////////////////////////////////////////////////////////////////////////////
48
+ // Private Methods //
49
+ ////////////////////////////////////////////////////////////////////////////////////////
50
+ ////////////////////////////////////////////////////////////////////////////////////////
51
+ // Listeners //
52
+ ////////////////////////////////////////////////////////////////////////////////////////
53
  }
admin/models/FMModelWidget_fmc.php CHANGED
@@ -1,38 +1,38 @@
1
- <?php
2
-
3
- class FMModelWidget_fmc {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- ////////////////////////////////////////////////////////////////////////////////////////
14
- // Constructor & Destructor //
15
- ////////////////////////////////////////////////////////////////////////////////////////
16
- public function __construct() {
17
- }
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- // Public Methods //
20
- ////////////////////////////////////////////////////////////////////////////////////////
21
-
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_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
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_fmc.php CHANGED
@@ -1,148 +1,148 @@
1
- <?php
2
-
3
- class FMViewBlocked_ips_fmc {
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'])) ? esc_html(stripslashes($_POST['asc_or_desc'])) : 'desc');
30
- $order_by = (isset($_POST['order_by']) ? esc_html(stripslashes($_POST['order_by'])) : 'id');
31
- $order_class = 'manage-column column-title sorted ' . $asc_or_desc;
32
- $ids_string = '';
33
- ?>
34
- <div id="fm_blocked_ips_message" style="width: 99%; display: none;"></div>
35
- <div style="clear: both; float: left; width: 99%;">
36
- <div style="float:left; font-size: 14px; font-weight: bold;">
37
- This section allows you to block IPs.
38
- <a style="color: blue; text-decoration: none;" target="_blank" href="http://web-dorado.com/wordpress-form-maker-guide-2.html">Read More in User Manual</a>
39
- </div>
40
- <div style="float: right; text-align: right;">
41
- <a style="text-decoration: none;" target="_blank" href="http://web-dorado.com/files/fromContactForm.php">
42
- <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FMC_URL . '/images/wd_logo.png'; ?>" />
43
- </a>
44
- </div>
45
- </div>
46
- <form onkeypress="spider_doNothing(event)" class="wrap" id="blocked_ips" method="post" action="admin.php?page=blocked_ips_fmc" style="float: left; width: 99%;">
47
- <span class="block_icon"></span>
48
- <h2>Blocked IPs</h2>
49
- <div class="buttons_div">
50
- <input class="button-primary" type="submit" value="Save" onclick="spider_set_input_value('task', 'save_all');" />
51
- <input class="button-secondary" type="submit" value="Delete" onclick="if (confirm('Do you want to unblock selected IPs?')) {
52
- spider_set_input_value('task', 'delete_all');
53
- } else {
54
- return false;
55
- }" />
56
- </div>
57
- <div class="tablenav top">
58
- <?php
59
- WDW_FMC_Library::search('IP', $search_value, 'blocked_ips');
60
- WDW_FMC_Library::html_page_nav($page_nav['total'], $page_nav['limit'], 'blocked_ips');
61
- ?>
62
- </div>
63
- <table class="wp-list-table widefat fixed pages">
64
- <thead>
65
- <tr>
66
- <th class="manage-column column-cb check-column table_small_col"><input id="check_all" type="checkbox" style="margin: 0;" /></th>
67
- <th class="table_small_col <?php if ($order_by == 'id') {echo $order_class;} ?>">
68
- <a onclick="spider_set_input_value('task', '');
69
- spider_set_input_value('order_by', 'id');
70
- spider_set_input_value('asc_or_desc', '<?php echo ((isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && (esc_html(stripslashes($_POST['order_by'])) == 'id') && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc') ? 'desc' : 'asc'); ?>');
71
- spider_form_submit(event, 'blocked_ips')" href="">
72
- <span>ID</span><span class="sorting-indicator"></span></th>
73
- </a>
74
- <th class="<?php if ($order_by == 'ip') {echo $order_class;} ?>">
75
- <a onclick="spider_set_input_value('task', '');
76
- spider_set_input_value('order_by', 'ip');
77
- spider_set_input_value('asc_or_desc', '<?php echo ((isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && (esc_html(stripslashes($_POST['order_by'])) == 'ip') && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc') ? 'desc' : 'asc'); ?>');
78
- spider_form_submit(event, 'blocked_ips')" href="">
79
- <span>IP</span><span class="sorting-indicator"></span>
80
- </a>
81
- </th>
82
- <th class="table_big_col">Edit</th>
83
- <th class="table_big_col">Delete</th>
84
- </tr>
85
- <tr id="tr">
86
- <th></th>
87
- <th></th>
88
- <th class="edit_input"><input type="text" class="input_th" id="ip" name="ip" onkeypress="return spider_check_isnum(event)"></th>
89
- <th class="table_big_col">
90
- <a class="add_tag_th button-primary button button-small" onclick="if (spider_check_required('ip', 'IP')) {return false;}
91
- spider_set_input_value('task', 'save');
92
- spider_set_input_value('current_id', '');
93
- spider_form_submit(event, 'blocked_ips')" href="">Add IP</a>
94
- </th>
95
- <th></th>
96
- </tr>
97
- </thead>
98
- <tbody id="tbody_arr">
99
- <?php
100
- if ($rows_data) {
101
- foreach ($rows_data as $row_data) {
102
- $alternate = (!isset($alternate) || $alternate == 'class="alternate"') ? '' : 'class="alternate"';
103
- ?>
104
- <tr id="tr_<?php echo $row_data->id; ?>" <?php echo $alternate; ?>>
105
- <td class="table_small_col check-column" id="td_check_<?php echo $row_data->id; ?>" >
106
- <input id="check_<?php echo $row_data->id; ?>" name="check_<?php echo $row_data->id; ?>" type="checkbox" />
107
- </td>
108
- <td class="table_small_col" id="td_id_<?php echo $row_data->id; ?>" ><?php echo $row_data->id; ?></td>
109
- <td id="td_ip_<?php echo $row_data->id; ?>" >
110
- <a class="pointer" id="ip<?php echo $row_data->id; ?>"
111
- onclick="spider_edit_ip(<?php echo $row_data->id; ?>)"
112
- title="Edit"><?php echo $row_data->ip; ?></a>
113
- </td>
114
- <td class="table_big_col" id="td_edit_<?php echo $row_data->id; ?>">
115
- <a onclick="spider_edit_ip(<?php echo $row_data->id; ?>)">Edit</a>
116
- </td>
117
- <td class="table_big_col" id="td_delete_<?php echo $row_data->id; ?>">
118
- <a onclick="spider_set_input_value('task', 'delete');
119
- spider_set_input_value('current_id', <?php echo $row_data->id; ?>);
120
- spider_form_submit(event, 'blocked_ips')" href="">Delete</a>
121
- </td>
122
- </tr>
123
- <?php
124
- $ids_string .= $row_data->id . ',';
125
- }
126
- }
127
- ?>
128
- </tbody>
129
- </table>
130
- <input id="task" name="task" type="hidden" value="" />
131
- <input id="current_id" name="current_id" type="hidden" value="" />
132
- <input id="ids_string" name="ids_string" type="hidden" value="<?php echo $ids_string; ?>" />
133
- <input id="asc_or_desc" name="asc_or_desc" type="hidden" value="<?php echo $asc_or_desc; ?>" />
134
- <input id="order_by" name="order_by" type="hidden" value="<?php echo $order_by; ?>" />
135
- </form>
136
- <?php
137
- }
138
-
139
- ////////////////////////////////////////////////////////////////////////////////////////
140
- // Getters & Setters //
141
- ////////////////////////////////////////////////////////////////////////////////////////
142
- ////////////////////////////////////////////////////////////////////////////////////////
143
- // Private Methods //
144
- ////////////////////////////////////////////////////////////////////////////////////////
145
- ////////////////////////////////////////////////////////////////////////////////////////
146
- // Listeners //
147
- ////////////////////////////////////////////////////////////////////////////////////////
148
  }
1
+ <?php
2
+
3
+ class FMViewBlocked_ips_fmc {
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'])) ? esc_html(stripslashes($_POST['asc_or_desc'])) : 'desc');
30
+ $order_by = (isset($_POST['order_by']) ? esc_html(stripslashes($_POST['order_by'])) : 'id');
31
+ $order_class = 'manage-column column-title sorted ' . $asc_or_desc;
32
+ $ids_string = '';
33
+ ?>
34
+ <div id="fm_blocked_ips_message" style="width: 99%; display: none;"></div>
35
+ <div style="clear: both; float: left; width: 99%;">
36
+ <div style="float:left; font-size: 14px; font-weight: bold;">
37
+ This section allows you to block IPs.
38
+ <a style="color: blue; text-decoration: none;" target="_blank" href="http://web-dorado.com/wordpress-form-maker-guide-2.html">Read More in User Manual</a>
39
+ </div>
40
+ <div style="float: right; text-align: right;">
41
+ <a style="text-decoration: none;" target="_blank" href="http://web-dorado.com/files/fromContactForm.php">
42
+ <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FMC_URL . '/images/wd_logo.png'; ?>" />
43
+ </a>
44
+ </div>
45
+ </div>
46
+ <form onkeypress="spider_doNothing(event)" class="wrap" id="blocked_ips" method="post" action="admin.php?page=blocked_ips_fmc" style="float: left; width: 99%;">
47
+ <span class="block_icon"></span>
48
+ <h2>Blocked IPs</h2>
49
+ <div class="buttons_div">
50
+ <input class="button-primary" type="submit" value="Save" onclick="spider_set_input_value('task', 'save_all');" />
51
+ <input class="button-secondary" type="submit" value="Delete" onclick="if (confirm('Do you want to unblock selected IPs?')) {
52
+ spider_set_input_value('task', 'delete_all');
53
+ } else {
54
+ return false;
55
+ }" />
56
+ </div>
57
+ <div class="tablenav top">
58
+ <?php
59
+ WDW_FMC_Library::search('IP', $search_value, 'blocked_ips');
60
+ WDW_FMC_Library::html_page_nav($page_nav['total'], $page_nav['limit'], 'blocked_ips');
61
+ ?>
62
+ </div>
63
+ <table class="wp-list-table widefat fixed pages">
64
+ <thead>
65
+ <tr>
66
+ <th class="manage-column column-cb check-column table_small_col"><input id="check_all" type="checkbox" style="margin: 0;" /></th>
67
+ <th class="table_small_col <?php if ($order_by == 'id') {echo $order_class;} ?>">
68
+ <a onclick="spider_set_input_value('task', '');
69
+ spider_set_input_value('order_by', 'id');
70
+ spider_set_input_value('asc_or_desc', '<?php echo ((isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && (esc_html(stripslashes($_POST['order_by'])) == 'id') && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc') ? 'desc' : 'asc'); ?>');
71
+ spider_form_submit(event, 'blocked_ips')" href="">
72
+ <span>ID</span><span class="sorting-indicator"></span></th>
73
+ </a>
74
+ <th class="<?php if ($order_by == 'ip') {echo $order_class;} ?>">
75
+ <a onclick="spider_set_input_value('task', '');
76
+ spider_set_input_value('order_by', 'ip');
77
+ spider_set_input_value('asc_or_desc', '<?php echo ((isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && (esc_html(stripslashes($_POST['order_by'])) == 'ip') && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc') ? 'desc' : 'asc'); ?>');
78
+ spider_form_submit(event, 'blocked_ips')" href="">
79
+ <span>IP</span><span class="sorting-indicator"></span>
80
+ </a>
81
+ </th>
82
+ <th class="table_big_col">Edit</th>
83
+ <th class="table_big_col">Delete</th>
84
+ </tr>
85
+ <tr id="tr">
86
+ <th></th>
87
+ <th></th>
88
+ <th class="edit_input"><input type="text" class="input_th" id="ip" name="ip" onkeypress="return spider_check_isnum(event)"></th>
89
+ <th class="table_big_col">
90
+ <a class="add_tag_th button-primary button button-small" onclick="if (spider_check_required('ip', 'IP')) {return false;}
91
+ spider_set_input_value('task', 'save');
92
+ spider_set_input_value('current_id', '');
93
+ spider_form_submit(event, 'blocked_ips')" href="">Add IP</a>
94
+ </th>
95
+ <th></th>
96
+ </tr>
97
+ </thead>
98
+ <tbody id="tbody_arr">
99
+ <?php
100
+ if ($rows_data) {
101
+ foreach ($rows_data as $row_data) {
102
+ $alternate = (!isset($alternate) || $alternate == 'class="alternate"') ? '' : 'class="alternate"';
103
+ ?>
104
+ <tr id="tr_<?php echo $row_data->id; ?>" <?php echo $alternate; ?>>
105
+ <td class="table_small_col check-column" id="td_check_<?php echo $row_data->id; ?>" >
106
+ <input id="check_<?php echo $row_data->id; ?>" name="check_<?php echo $row_data->id; ?>" type="checkbox" />
107
+ </td>
108
+ <td class="table_small_col" id="td_id_<?php echo $row_data->id; ?>" ><?php echo $row_data->id; ?></td>
109
+ <td id="td_ip_<?php echo $row_data->id; ?>" >
110
+ <a class="pointer" id="ip<?php echo $row_data->id; ?>"
111
+ onclick="spider_edit_ip(<?php echo $row_data->id; ?>)"
112
+ title="Edit"><?php echo $row_data->ip; ?></a>
113
+ </td>
114
+ <td class="table_big_col" id="td_edit_<?php echo $row_data->id; ?>">
115
+ <a onclick="spider_edit_ip(<?php echo $row_data->id; ?>)">Edit</a>
116
+ </td>
117
+ <td class="table_big_col" id="td_delete_<?php echo $row_data->id; ?>">
118
+ <a onclick="spider_set_input_value('task', 'delete');
119
+ spider_set_input_value('current_id', <?php echo $row_data->id; ?>);
120
+ spider_form_submit(event, 'blocked_ips')" href="">Delete</a>
121
+ </td>
122
+ </tr>
123
+ <?php
124
+ $ids_string .= $row_data->id . ',';
125
+ }
126
+ }
127
+ ?>
128
+ </tbody>
129
+ </table>
130
+ <input id="task" name="task" type="hidden" value="" />
131
+ <input id="current_id" name="current_id" type="hidden" value="" />
132
+ <input id="ids_string" name="ids_string" type="hidden" value="<?php echo $ids_string; ?>" />
133
+ <input id="asc_or_desc" name="asc_or_desc" type="hidden" value="<?php echo $asc_or_desc; ?>" />
134
+ <input id="order_by" name="order_by" type="hidden" value="<?php echo $order_by; ?>" />
135
+ </form>
136
+ <?php
137
+ }
138
+
139
+ ////////////////////////////////////////////////////////////////////////////////////////
140
+ // Getters & Setters //
141
+ ////////////////////////////////////////////////////////////////////////////////////////
142
+ ////////////////////////////////////////////////////////////////////////////////////////
143
+ // Private Methods //
144
+ ////////////////////////////////////////////////////////////////////////////////////////
145
+ ////////////////////////////////////////////////////////////////////////////////////////
146
+ // Listeners //
147
+ ////////////////////////////////////////////////////////////////////////////////////////
148
  }
admin/views/FMViewFeatured_plugins_fmc.php CHANGED
@@ -1,171 +1,171 @@
1
- <?php
2
-
3
- class FMViewFeatured_plugins_fmc {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- private $model;
14
-
15
-
16
- ////////////////////////////////////////////////////////////////////////////////////////
17
- // Constructor & Destructor //
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- public function __construct($model) {
20
- $this->model = $model;
21
- }
22
- ////////////////////////////////////////////////////////////////////////////////////////
23
- // Public Methods //
24
- ////////////////////////////////////////////////////////////////////////////////////////
25
- public function display() {
26
- ?>
27
- <div id="main_featured_plugins_page">
28
- <table align="center" width="90%" style="margin-top: 0px;border-bottom: rgb(111, 111, 111) solid 2px;">
29
- <tr>
30
- <td colspan="2" style="height: 70px;"><h3 style="margin: 0px;font-family:Segoe UI;padding-bottom: 15px;color: rgb(111, 111, 111); font-size:18pt;">Featured Plugins</h3></td>
31
- <td></td>
32
- </tr>
33
- </table>
34
- <form method="post">
35
- <ul id="featured-plugins-list">
36
- <li class="photo-gallery">
37
- <div class="product">
38
- <div class="title">
39
- <strong class="heading">Photo Gallery</strong>
40
- <p>WordPress Photo Gallery plugin</p>
41
- </div>
42
- </div>
43
- <div class="description">
44
- <p>Photo Gallery is a fully responsive WordPress Gallery plugin with advanced functionality.
45
- It allows having different image galleries for your posts and pages, as well as different widgets.</p>
46
- <a target="_blank" href="http://web-dorado.com/products/wordpress-photo-gallery-plugin.html" class="download">Download</a>
47
- </div>
48
- </li>
49
- <li class="spider-calendar">
50
- <div class="product">
51
- <div class="title">
52
- <strong class="heading">Spider Calendar</strong>
53
- <p>WordPress event calendar plugin</p>
54
- </div>
55
- </div>
56
- <div class="description">
57
- <p>Spider Event Calendar is a highly configurable product which allows you to have multiple organized events.</p>
58
- <a target="_blank" href="http://web-dorado.com/products/wordpress-calendar.html" class="download">Download</a>
59
- </div>
60
- </li>
61
- <li class="catalog">
62
- <div class="product">
63
- <div class="title">
64
- <strong class="heading">Spider Catalog</strong>
65
- <p>WordPress product catalog plugin</p>
66
- </div>
67
- </div>
68
- <div class="description">
69
- <p>Spider Catalog for WordPress is a convenient tool for organizing the products represented on your website into catalogs.</p>
70
- <a target="_blank" href="http://web-dorado.com/products/wordpress-catalog.html" class="download">Download</a>
71
- </div>
72
- </li>
73
- <li class="player">
74
- <div class="product">
75
- <div class="title">
76
- <strong class="heading">Video Player</strong>
77
- <p>WordPress Video player plugin</p>
78
- </div>
79
- </div>
80
- <div class="description">
81
- <p>Spider Video Player for WordPress is a Flash & HTML5 video player plugin that allows you to easily add videos to your website with the possibility</p>
82
- <a target="_blank" href="http://web-dorado.com/products/wordpress-player.html" class="download">Download</a>
83
- </div>
84
- </li>
85
- <li class="contacts">
86
- <div class="product">
87
- <div class="title">
88
- <strong class="heading">Spider Contacts</strong>
89
- <p>Wordpress staff list plugin</p>
90
- </div>
91
- </div>
92
- <div class="description">
93
- <p>Spider Contacts helps you to display information about the group of people more intelligible, effective and convenient.</p>
94
- <a target="_blank" href="http://web-dorado.com/products/wordpress-contacts-plugin.html" class="download">Download</a>
95
- </div>
96
- </li>
97
- <li class="facebook">
98
- <div class="product">
99
- <div class="title">
100
- <strong class="heading">Spider Facebook</strong>
101
- <p>WordPress Facebook plugin</p>
102
- </div>
103
- </div>
104
- <div class="description">
105
- <p>Spider Facebook is a WordPress integration tool for Facebook.It includes all the available Facebook social plugins and widgets to be added to your web</p>
106
- <a target="_blank" href="http://web-dorado.com/products/wordpress-facebook.html" class="download">Download</a>
107
- </div>
108
- </li>
109
- <li class="twitter-widget">
110
- <div class="product">
111
- <div class="title">
112
- <strong class="heading">Widget Twitter</strong>
113
- <p>WordPress Widget Twitter plugin</p>
114
- </div>
115
- </div>
116
- <div class="description">
117
- <p>The Widget Twitter plugin lets you to fully integrate your WordPress site with your Twitter account.</p>
118
- <a target="_blank" href="http://web-dorado.com/products/wordpress-twitter-integration-plugin.html" class="download">Download</a>
119
- </div>
120
- </li>
121
- <li class="faq">
122
- <div class="product">
123
- <div class="title">
124
- <strong class="heading">Spider FAQ</strong>
125
- <p>WordPress FAQ Plugin</p>
126
- </div>
127
- </div>
128
- <div class="description">
129
- <p>The Spider FAQ WordPress plugin is for creating an FAQ (Frequently Asked Questions) section for your website.</p>
130
- <a target="_blank" href="http://web-dorado.com/products/wordpress-faq-plugin.html" class="download">Download</a>
131
- </div>
132
- </li>
133
- <li class="zoom">
134
- <div class="product">
135
- <div class="title">
136
- <strong class="heading">Zoom</strong>
137
- <p>WordPress text zoom plugin</p>
138
- </div>
139
- </div>
140
- <div class="description">
141
- <p>Zoom enables site users to resize the predefined areas of the web site.</p>
142
- <a target="_blank" href="http://web-dorado.com/products/wordpress-zoom.html" class="download">Download</a>
143
- </div>
144
- </li>
145
- <li class="flash-calendar">
146
- <div class="product">
147
- <div class="title">
148
- <strong class="heading">Flash Calendar</strong>
149
- <p>WordPress flash calendar plugin</p>
150
- </div>
151
- </div>
152
- <div class="description">
153
- <p>Spider Flash Calendar is a highly configurable Flash calendar plugin which allows you to have multiple organized events.</p>
154
- <a target="_blank" href="http://web-dorado.com/products/wordpress-events-calendar.html" class="download">Download</a>
155
- </div>
156
- </li>
157
- </ul>
158
- </form>
159
- </div >
160
- <?php
161
- }
162
- ////////////////////////////////////////////////////////////////////////////////////////
163
- // Getters & Setters //
164
- ////////////////////////////////////////////////////////////////////////////////////////
165
- ////////////////////////////////////////////////////////////////////////////////////////
166
- // Private Methods //
167
- ////////////////////////////////////////////////////////////////////////////////////////
168
- ////////////////////////////////////////////////////////////////////////////////////////
169
- // Listeners //
170
- ////////////////////////////////////////////////////////////////////////////////////////
171
  }
1
+ <?php
2
+
3
+ class FMViewFeatured_plugins_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+
16
+ ////////////////////////////////////////////////////////////////////////////////////////
17
+ // Constructor & Destructor //
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ public function __construct($model) {
20
+ $this->model = $model;
21
+ }
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
26
+ ?>
27
+ <div id="main_featured_plugins_page">
28
+ <table align="center" width="90%" style="margin-top: 0px;border-bottom: rgb(111, 111, 111) solid 2px;">
29
+ <tr>
30
+ <td colspan="2" style="height: 70px;"><h3 style="margin: 0px;font-family:Segoe UI;padding-bottom: 15px;color: rgb(111, 111, 111); font-size:18pt;">Featured Plugins</h3></td>
31
+ <td></td>
32
+ </tr>
33
+ </table>
34
+ <form method="post">
35
+ <ul id="featured-plugins-list">
36
+ <li class="photo-gallery">
37
+ <div class="product">
38
+ <div class="title">
39
+ <strong class="heading">Photo Gallery</strong>
40
+ <p>WordPress Photo Gallery plugin</p>
41
+ </div>
42
+ </div>
43
+ <div class="description">
44
+ <p>Photo Gallery is a fully responsive WordPress Gallery plugin with advanced functionality.
45
+ It allows having different image galleries for your posts and pages, as well as different widgets.</p>
46
+ <a target="_blank" href="http://web-dorado.com/products/wordpress-photo-gallery-plugin.html" class="download">Download</a>
47
+ </div>
48
+ </li>
49
+ <li class="spider-calendar">
50
+ <div class="product">
51
+ <div class="title">
52
+ <strong class="heading">Spider Calendar</strong>
53
+ <p>WordPress event calendar plugin</p>
54
+ </div>
55
+ </div>
56
+ <div class="description">
57
+ <p>Spider Event Calendar is a highly configurable product which allows you to have multiple organized events.</p>
58
+ <a target="_blank" href="http://web-dorado.com/products/wordpress-calendar.html" class="download">Download</a>
59
+ </div>
60
+ </li>
61
+ <li class="catalog">
62
+ <div class="product">
63
+ <div class="title">
64
+ <strong class="heading">Spider Catalog</strong>
65
+ <p>WordPress product catalog plugin</p>
66
+ </div>
67
+ </div>
68
+ <div class="description">
69
+ <p>Spider Catalog for WordPress is a convenient tool for organizing the products represented on your website into catalogs.</p>
70
+ <a target="_blank" href="http://web-dorado.com/products/wordpress-catalog.html" class="download">Download</a>
71
+ </div>
72
+ </li>
73
+ <li class="player">
74
+ <div class="product">
75
+ <div class="title">
76
+ <strong class="heading">Video Player</strong>
77
+ <p>WordPress Video player plugin</p>
78
+ </div>
79
+ </div>
80
+ <div class="description">
81
+ <p>Spider Video Player for WordPress is a Flash & HTML5 video player plugin that allows you to easily add videos to your website with the possibility</p>
82
+ <a target="_blank" href="http://web-dorado.com/products/wordpress-player.html" class="download">Download</a>
83
+ </div>
84
+ </li>
85
+ <li class="contacts">
86
+ <div class="product">
87
+ <div class="title">
88
+ <strong class="heading">Spider Contacts</strong>
89
+ <p>Wordpress staff list plugin</p>
90
+ </div>
91
+ </div>
92
+ <div class="description">
93
+ <p>Spider Contacts helps you to display information about the group of people more intelligible, effective and convenient.</p>
94
+ <a target="_blank" href="http://web-dorado.com/products/wordpress-contacts-plugin.html" class="download">Download</a>
95
+ </div>
96
+ </li>
97
+ <li class="facebook">
98
+ <div class="product">
99
+ <div class="title">
100
+ <strong class="heading">Spider Facebook</strong>
101
+ <p>WordPress Facebook plugin</p>
102
+ </div>
103
+ </div>
104
+ <div class="description">
105
+ <p>Spider Facebook is a WordPress integration tool for Facebook.It includes all the available Facebook social plugins and widgets to be added to your web</p>
106
+ <a target="_blank" href="http://web-dorado.com/products/wordpress-facebook.html" class="download">Download</a>
107
+ </div>
108
+ </li>
109
+ <li class="twitter-widget">
110
+ <div class="product">
111
+ <div class="title">
112
+ <strong class="heading">Widget Twitter</strong>
113
+ <p>WordPress Widget Twitter plugin</p>
114
+ </div>
115
+ </div>
116
+ <div class="description">
117
+ <p>The Widget Twitter plugin lets you to fully integrate your WordPress site with your Twitter account.</p>
118
+ <a target="_blank" href="http://web-dorado.com/products/wordpress-twitter-integration-plugin.html" class="download">Download</a>
119
+ </div>
120
+ </li>
121
+ <li class="faq">
122
+ <div class="product">
123
+ <div class="title">
124
+ <strong class="heading">Spider FAQ</strong>
125
+ <p>WordPress FAQ Plugin</p>
126
+ </div>
127
+ </div>
128
+ <div class="description">
129
+ <p>The Spider FAQ WordPress plugin is for creating an FAQ (Frequently Asked Questions) section for your website.</p>
130
+ <a target="_blank" href="http://web-dorado.com/products/wordpress-faq-plugin.html" class="download">Download</a>
131
+ </div>
132
+ </li>
133
+ <li class="zoom">
134
+ <div class="product">
135
+ <div class="title">
136
+ <strong class="heading">Zoom</strong>
137
+ <p>WordPress text zoom plugin</p>
138
+ </div>
139
+ </div>
140
+ <div class="description">
141
+ <p>Zoom enables site users to resize the predefined areas of the web site.</p>
142
+ <a target="_blank" href="http://web-dorado.com/products/wordpress-zoom.html" class="download">Download</a>
143
+ </div>
144
+ </li>
145
+ <li class="flash-calendar">
146
+ <div class="product">
147
+ <div class="title">
148
+ <strong class="heading">Flash Calendar</strong>
149
+ <p>WordPress flash calendar plugin</p>
150
+ </div>
151
+ </div>
152
+ <div class="description">
153
+ <p>Spider Flash Calendar is a highly configurable Flash calendar plugin which allows you to have multiple organized events.</p>
154
+ <a target="_blank" href="http://web-dorado.com/products/wordpress-events-calendar.html" class="download">Download</a>
155
+ </div>
156
+ </li>
157
+ </ul>
158
+ </form>
159
+ </div >
160
+ <?php
161
+ }
162
+ ////////////////////////////////////////////////////////////////////////////////////////
163
+ // Getters & Setters //
164
+ ////////////////////////////////////////////////////////////////////////////////////////
165
+ ////////////////////////////////////////////////////////////////////////////////////////
166
+ // Private Methods //
167
+ ////////////////////////////////////////////////////////////////////////////////////////
168
+ ////////////////////////////////////////////////////////////////////////////////////////
169
+ // Listeners //
170
+ ////////////////////////////////////////////////////////////////////////////////////////
171
  }
admin/views/FMViewFormMakerEditCSS_fmc.php CHANGED
@@ -1,113 +1,113 @@
1
- <?php
2
-
3
- class FMViewFormMakerEditCSS_fmc {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- private $model;
14
-
15
-
16
- ////////////////////////////////////////////////////////////////////////////////////////
17
- // Constructor & Destructor //
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- public function __construct($model) {
20
- $this->model = $model;
21
- }
22
- ////////////////////////////////////////////////////////////////////////////////////////
23
- // Public Methods //
24
- ////////////////////////////////////////////////////////////////////////////////////////
25
- public function display() {
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
- <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">
32
- <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">
33
- <link media="all" type="text/css" href="<?php echo WD_FMC_URL . '/css/form_maker_tables.css'; ?>" rel="stylesheet">
34
- <script src="<?php echo WD_FMC_URL . '/js/form_maker_admin.js'; ?>" type="text/javascript"></script>
35
- <script src="<?php echo WD_FMC_URL . '/js/layout/codemirror.js'; ?>" type="text/javascript"></script>
36
- <script src="<?php echo WD_FMC_URL . '/js/layout/formatting.js'; ?>" type="text/javascript"></script>
37
- <script src="<?php echo WD_FMC_URL . '/js/layout/css.js'; ?>" type="text/javascript"></script>
38
- <script src="<?php echo WD_FMC_URL . '/js/layout/clike.js'; ?>" type="text/javascript"></script>
39
- <script src="<?php echo WD_FMC_URL . '/js/layout/javascript.js'; ?>" type="text/javascript"></script>
40
- <script src="<?php echo WD_FMC_URL . '/js/layout/htmlmixed.js'; ?>" type="text/javascript"></script>
41
- <script src="<?php echo WD_FMC_URL . '/js/layout/xml.js'; ?>" type="text/javascript"></script>
42
- <script src="<?php echo WD_FMC_URL . '/js/layout/php.js'; ?>" type="text/javascript"></script>
43
- <link media="all" type="text/css" href="<?php echo WD_FM_URL . '/css/codemirror.css'; ?>" rel="stylesheet">
44
-
45
- <style>
46
- .CodeMirror {
47
- border: 1px solid #ccc;
48
- font-size: 12px;
49
- margin-bottom: 6px;
50
- background: white;
51
- }
52
- </style>
53
-
54
- <form id="fm_theme" class="wrap wp-core-ui" method="post" action="#" style="width: 99%; margin: 5px 0 0 5px;">
55
- <div style="float: right; margin: 0 5px 0 0;">
56
- <input class="button-secondary" type="submit" onclick="if (spider_check_required('title', 'Theme title')) {return false;};
57
- spider_set_input_value('task', 'save');
58
- window.parent.jQuery('#theme option[value=<?php echo $theme_id; ?>]').html(jQuery('#title').val());
59
- window.parent.tb_remove();" value="Save"/>
60
- <input class="button-secondary" type="submit" onclick="if (spider_check_required('title', 'Theme title')) {return false;};
61
- spider_set_input_value('task', 'apply');
62
- window.parent.jQuery('#theme option[value=<?php echo $theme_id; ?>]').html(jQuery('#title').val());" value="Apply"/>
63
- <input class="button-secondary" type="submit" onclick="if (spider_check_required('title', 'Theme title')) {return false;};
64
- spider_set_input_value('task', 'save_as_new');
65
- window.parent.jQuery('#theme').append('<option value=0>' + jQuery('#title').val() + '</option>');
66
- window.parent.tb_remove();" value="Save as New"/>
67
- <input class="button-primary" type="button" onclick="jQuery('#css').val(jQuery('#main_theme').html());" value="Reset"/>
68
- <input class="button-secondary" type="button" onclick="window.parent.tb_remove();" value="Cancel"/>
69
- </div>
70
- <table style="clear: both;">
71
- <tbody>
72
- <tr>
73
- <td class="spider_label"><label for="title">Theme title: <span style="color:#FF0000;"> * </span> </label></td>
74
- <td><input type="text" id="title" name="title" value="<?php echo $row->title; ?>" class="spider_text_input" /></td>
75
- </tr>
76
- <tr>
77
- <td class="spider_label"><label for="css">Css: </label></td>
78
- <td style="width: 90%;"><textarea id="css" name="css" rows="25" style="width: 100%;"><?php echo htmlspecialchars($row->css); ?></textarea></td>
79
- </tr>
80
- </tbody>
81
- </table>
82
- <div style="display: none;" id="main_theme"><?php echo str_replace('"', '\"', $row->css); ?></div>
83
- <input type="hidden" id="task" name="task" value="" />
84
- <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
85
- <input type="hidden" id="default" name="default" value="<?php echo $row->default; ?>" />
86
- <input type="hidden" name="form_id" id="form_id" value="<?php echo $form_id; ?>" />
87
- </form>
88
- <script>
89
- var editor = CodeMirror.fromTextArea(
90
- document.getElementById("css"), {
91
- lineNumbers: true,
92
- lineWrapping: true,
93
- mode: "css"
94
- });
95
-
96
- CodeMirror.commands["selectAll"](editor);
97
- editor.autoFormatRange(editor.getCursor(true), editor.getCursor(false));
98
- editor.scrollTo(0,0);
99
- </script>
100
- <?php
101
- die();
102
- }
103
-
104
- ////////////////////////////////////////////////////////////////////////////////////////
105
- // Getters & Setters //
106
- ////////////////////////////////////////////////////////////////////////////////////////
107
- ////////////////////////////////////////////////////////////////////////////////////////
108
- // Private Methods //
109
- ////////////////////////////////////////////////////////////////////////////////////////
110
- ////////////////////////////////////////////////////////////////////////////////////////
111
- // Listeners //
112
- ////////////////////////////////////////////////////////////////////////////////////////
113
  }
1
+ <?php
2
+
3
+ class FMViewFormMakerEditCSS_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+
16
+ ////////////////////////////////////////////////////////////////////////////////////////
17
+ // Constructor & Destructor //
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ public function __construct($model) {
20
+ $this->model = $model;
21
+ }
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
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
+ <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">
32
+ <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">
33
+ <link media="all" type="text/css" href="<?php echo WD_FMC_URL . '/css/form_maker_tables.css'; ?>" rel="stylesheet">
34
+ <script src="<?php echo WD_FMC_URL . '/js/form_maker_admin.js'; ?>" type="text/javascript"></script>
35
+ <script src="<?php echo WD_FMC_URL . '/js/layout/codemirror.js'; ?>" type="text/javascript"></script>
36
+ <script src="<?php echo WD_FMC_URL . '/js/layout/formatting.js'; ?>" type="text/javascript"></script>
37
+ <script src="<?php echo WD_FMC_URL . '/js/layout/css.js'; ?>" type="text/javascript"></script>
38
+ <script src="<?php echo WD_FMC_URL . '/js/layout/clike.js'; ?>" type="text/javascript"></script>
39
+ <script src="<?php echo WD_FMC_URL . '/js/layout/javascript.js'; ?>" type="text/javascript"></script>
40
+ <script src="<?php echo WD_FMC_URL . '/js/layout/htmlmixed.js'; ?>" type="text/javascript"></script>
41
+ <script src="<?php echo WD_FMC_URL . '/js/layout/xml.js'; ?>" type="text/javascript"></script>
42
+ <script src="<?php echo WD_FMC_URL . '/js/layout/php.js'; ?>" type="text/javascript"></script>
43
+ <link media="all" type="text/css" href="<?php echo WD_FM_URL . '/css/codemirror.css'; ?>" rel="stylesheet">
44
+
45
+ <style>
46
+ .CodeMirror {
47
+ border: 1px solid #ccc;
48
+ font-size: 12px;
49
+ margin-bottom: 6px;
50
+ background: white;
51
+ }
52
+ </style>
53
+
54
+ <form id="fm_theme" class="wrap wp-core-ui" method="post" action="#" style="width: 99%; margin: 5px 0 0 5px;">
55
+ <div style="float: right; margin: 0 5px 0 0;">
56
+ <input class="button-secondary" type="submit" onclick="if (spider_check_required('title', 'Theme title')) {return false;};
57
+ spider_set_input_value('task', 'save');
58
+ window.parent.jQuery('#theme option[value=<?php echo $theme_id; ?>]').html(jQuery('#title').val());
59
+ window.parent.tb_remove();" value="Save"/>
60
+ <input class="button-secondary" type="submit" onclick="if (spider_check_required('title', 'Theme title')) {return false;};
61
+ spider_set_input_value('task', 'apply');
62
+ window.parent.jQuery('#theme option[value=<?php echo $theme_id; ?>]').html(jQuery('#title').val());" value="Apply"/>
63
+ <input class="button-secondary" type="submit" onclick="if (spider_check_required('title', 'Theme title')) {return false;};
64
+ spider_set_input_value('task', 'save_as_new');
65
+ window.parent.jQuery('#theme').append('<option value=0>' + jQuery('#title').val() + '</option>');
66
+ window.parent.tb_remove();" value="Save as New"/>
67
+ <input class="button-primary" type="button" onclick="jQuery('#css').val(jQuery('#main_theme').html());" value="Reset"/>
68
+ <input class="button-secondary" type="button" onclick="window.parent.tb_remove();" value="Cancel"/>
69
+ </div>
70
+ <table style="clear: both;">
71
+ <tbody>
72
+ <tr>
73
+ <td class="spider_label"><label for="title">Theme title: <span style="color:#FF0000;"> * </span> </label></td>
74
+ <td><input type="text" id="title" name="title" value="<?php echo $row->title; ?>" class="spider_text_input" /></td>
75
+ </tr>
76
+ <tr>
77
+ <td class="spider_label"><label for="css">Css: </label></td>
78
+ <td style="width: 90%;"><textarea id="css" name="css" rows="25" style="width: 100%;"><?php echo htmlspecialchars($row->css); ?></textarea></td>
79
+ </tr>
80
+ </tbody>
81
+ </table>
82
+ <div style="display: none;" id="main_theme"><?php echo str_replace('"', '\"', $row->css); ?></div>
83
+ <input type="hidden" id="task" name="task" value="" />
84
+ <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
85
+ <input type="hidden" id="default" name="default" value="<?php echo $row->default; ?>" />
86
+ <input type="hidden" name="form_id" id="form_id" value="<?php echo $form_id; ?>" />
87
+ </form>
88
+ <script>
89
+ var editor = CodeMirror.fromTextArea(
90
+ document.getElementById("css"), {
91
+ lineNumbers: true,
92
+ lineWrapping: true,
93
+ mode: "css"
94
+ });
95
+
96
+ CodeMirror.commands["selectAll"](editor);
97
+ editor.autoFormatRange(editor.getCursor(true), editor.getCursor(false));
98
+ editor.scrollTo(0,0);
99
+ </script>
100
+ <?php
101
+ die();
102
+ }
103
+
104
+ ////////////////////////////////////////////////////////////////////////////////////////
105
+ // Getters & Setters //
106
+ ////////////////////////////////////////////////////////////////////////////////////////
107
+ ////////////////////////////////////////////////////////////////////////////////////////
108
+ // Private Methods //
109
+ ////////////////////////////////////////////////////////////////////////////////////////
110
+ ////////////////////////////////////////////////////////////////////////////////////////
111
+ // Listeners //
112
+ ////////////////////////////////////////////////////////////////////////////////////////
113
  }
admin/views/FMViewFormMakerPreview_fmc.php CHANGED
@@ -1,477 +1,477 @@
1
- <?php
2
-
3
- class FMViewFormMakerPreview_fmc {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- private $model;
14
-
15
-
16
- ////////////////////////////////////////////////////////////////////////////////////////
17
- // Constructor & Destructor //
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- public function __construct($model) {
20
- $this->model = $model;
21
- }
22
- ////////////////////////////////////////////////////////////////////////////////////////
23
- // Public Methods //
24
- ////////////////////////////////////////////////////////////////////////////////////////
25
- public function display() {
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?sensor=false" type="text/javascript"></script>
34
- <script src="<?php echo WD_FMC_URL . '/js/if_gmap_front_end.js'; ?>" type="text/javascript"></script>
35
- <script src="<?php echo WD_FMC_URL . '/js/calendar/calendar.js'; ?>" type="text/javascript"></script>
36
- <script src="<?php echo WD_FMC_URL . '/js/calendar/calendar_function.js'; ?>" type="text/javascript"></script>
37
- <link media="all" type="text/css" href="<?php echo WD_FMC_URL . '/css/calendar-jos.css'; ?>" rel="stylesheet">
38
- <link media="all" type="text/css" href="<?php echo WD_FMC_URL . '/css/jquery-ui-1.10.3.custom.css'; ?>" rel="stylesheet">
39
- <link media="all" type="text/css" href="<?php echo WD_FMC_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_FMC_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_FMC_DIR . '/frontend/controllers/FMControllerForm_maker_fmc.php');
46
- $controller = new FMControllerForm_maker_fmc();
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_FMC_URL . '/js/main_front_end.js'; ?>"></script>
55
- <style>
56
- <?php
57
- echo str_replace('[SITE_ROOT]', WD_FMC_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 fmc_plugin_url = "<?php echo WD_FMC_URL; ?>";
70
- /*JURI_ROOT = '<?php echo WD_FMC_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_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+
16
+ ////////////////////////////////////////////////////////////////////////////////////////
17
+ // Constructor & Destructor //
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ public function __construct($model) {
20
+ $this->model = $model;
21
+ }
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
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?sensor=false" type="text/javascript"></script>
34
+ <script src="<?php echo WD_FMC_URL . '/js/if_gmap_front_end.js'; ?>" type="text/javascript"></script>
35
+ <script src="<?php echo WD_FMC_URL . '/js/calendar/calendar.js'; ?>" type="text/javascript"></script>
36
+ <script src="<?php echo WD_FMC_URL . '/js/calendar/calendar_function.js'; ?>" type="text/javascript"></script>
37
+ <link media="all" type="text/css" href="<?php echo WD_FMC_URL . '/css/calendar-jos.css'; ?>" rel="stylesheet">
38
+ <link media="all" type="text/css" href="<?php echo WD_FMC_URL . '/css/jquery-ui-1.10.3.custom.css'; ?>" rel="stylesheet">
39
+ <link media="all" type="text/css" href="<?php echo WD_FMC_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_FMC_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_FMC_DIR . '/frontend/controllers/FMControllerForm_maker_fmc.php');
46
+ $controller = new FMControllerForm_maker_fmc();
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_FMC_URL . '/js/main_front_end.js'; ?>"></script>
55
+ <style>
56
+ <?php
57
+ echo str_replace('[SITE_ROOT]', WD_FMC_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 fmc_plugin_url = "<?php echo WD_FMC_URL; ?>";
70
+ /*JURI_ROOT = '<?php echo WD_FMC_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/FMViewFormcontactwdcaptcha.php CHANGED
@@ -1,93 +1,93 @@
1
- <?php
2
-
3
- class FMViewFormcontactwdcaptcha {
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
- if (isset($_GET['action']) && esc_html($_GET['action']) == 'formcontactwdcaptcha') {
27
- $i = (isset($_GET["i"]) ? esc_html($_GET["i"]) : '');
28
- $r2 = (isset($_GET["r2"]) ? (int) $_GET["r2"] : 0);
29
- $rrr = (isset($_GET["rrr"]) ? (int) $_GET["rrr"] : 0);
30
- $randNum = 0 + $r2 + $rrr;
31
- $digit = (isset($_GET["digit"]) ? (int) $_GET["digit"] : 6);
32
- $cap_width = $digit * 10 + 15;
33
- $cap_height = 26;
34
- $cap_quality = 100;
35
- $cap_length_min = $digit;
36
- $cap_length_max = $digit;
37
- $cap_digital = 1;
38
- $cap_latin_char = 1;
39
- function code_generic($_length, $_digital = 1, $_latin_char = 1) {
40
- $dig = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
41
- $lat = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z');
42
- $main = array();
43
- if ($_digital) {
44
- $main = array_merge($main, $dig);
45
- }
46
- if ($_latin_char) {
47
- $main = array_merge($main, $lat);
48
- }
49
- shuffle($main);
50
- $pass = substr(implode('', $main), 0, $_length);
51
- return $pass;
52
- }
53
- $l = rand($cap_length_min, $cap_length_max);
54
- $code = code_generic($l, $cap_digital, $cap_latin_char);
55
- if (session_id() == '' || (function_exists('session_status') && (session_status() == PHP_SESSION_NONE))) {
56
- @session_start();
57
- }
58
- $_SESSION[$i . '_wd_captcha_code'] = $code;
59
- $canvas = imagecreatetruecolor($cap_width, $cap_height);
60
- $c = imagecolorallocate($canvas, rand(150, 255), rand(150, 255), rand(150, 255));
61
- imagefilledrectangle($canvas, 0, 0, $cap_width, $cap_height, $c);
62
- $count = strlen($code);
63
- $color_text = imagecolorallocate($canvas, 0, 0, 0);
64
- for ($it = 0; $it < $count; $it++) {
65
- $letter = $code[$it];
66
- imagestring($canvas, 6, (10 * $it + 10), $cap_height / 4, $letter, $color_text);
67
- }
68
- for ($c = 0; $c < 150; $c++) {
69
- $x = rand(0, $cap_width - 1);
70
- $y = rand(0, 29);
71
- $col = '0x' . rand(0, 9) . '0' . rand(0, 9) . '0' . rand(0, 9) . '0';
72
- imagesetpixel($canvas, $x, $y, $col);
73
- }
74
- header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
75
- header('Cache-Control: no-store, no-cache, must-revalidate');
76
- header('Cache-Control: post-check=0, pre-check=0', FALSE);
77
- header('Pragma: no-cache');
78
- header('Content-Type: image/jpeg');
79
- imagejpeg($canvas, NULL, $cap_quality);
80
- }
81
- die('');
82
- }
83
-
84
- ////////////////////////////////////////////////////////////////////////////////////////
85
- // Getters & Setters //
86
- ////////////////////////////////////////////////////////////////////////////////////////
87
- ////////////////////////////////////////////////////////////////////////////////////////
88
- // Private Methods //
89
- ////////////////////////////////////////////////////////////////////////////////////////
90
- ////////////////////////////////////////////////////////////////////////////////////////
91
- // Listeners //
92
- ////////////////////////////////////////////////////////////////////////////////////////
93
  }
1
+ <?php
2
+
3
+ class FMViewFormcontactwdcaptcha {
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
+ if (isset($_GET['action']) && esc_html($_GET['action']) == 'formcontactwdcaptcha') {
27
+ $i = (isset($_GET["i"]) ? esc_html($_GET["i"]) : '');
28
+ $r2 = (isset($_GET["r2"]) ? (int) $_GET["r2"] : 0);
29
+ $rrr = (isset($_GET["rrr"]) ? (int) $_GET["rrr"] : 0);
30
+ $randNum = 0 + $r2 + $rrr;
31
+ $digit = (isset($_GET["digit"]) ? (int) $_GET["digit"] : 6);
32
+ $cap_width = $digit * 10 + 15;
33
+ $cap_height = 26;
34
+ $cap_quality = 100;
35
+ $cap_length_min = $digit;
36
+ $cap_length_max = $digit;
37
+ $cap_digital = 1;
38
+ $cap_latin_char = 1;
39
+ function code_generic($_length, $_digital = 1, $_latin_char = 1) {
40
+ $dig = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
41
+ $lat = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z');
42
+ $main = array();
43
+ if ($_digital) {
44
+ $main = array_merge($main, $dig);
45
+ }
46
+ if ($_latin_char) {
47
+ $main = array_merge($main, $lat);
48
+ }
49
+ shuffle($main);
50
+ $pass = substr(implode('', $main), 0, $_length);
51
+ return $pass;
52
+ }
53
+ $l = rand($cap_length_min, $cap_length_max);
54
+ $code = code_generic($l, $cap_digital, $cap_latin_char);
55
+ if (session_id() == '' || (function_exists('session_status') && (session_status() == PHP_SESSION_NONE))) {
56
+ @session_start();
57
+ }
58
+ $_SESSION[$i . '_wd_captcha_code'] = $code;
59
+ $canvas = imagecreatetruecolor($cap_width, $cap_height);
60
+ $c = imagecolorallocate($canvas, rand(150, 255), rand(150, 255), rand(150, 255));
61
+ imagefilledrectangle($canvas, 0, 0, $cap_width, $cap_height, $c);
62
+ $count = strlen($code);
63
+ $color_text = imagecolorallocate($canvas, 0, 0, 0);
64
+ for ($it = 0; $it < $count; $it++) {
65
+ $letter = $code[$it];
66
+ imagestring($canvas, 6, (10 * $it + 10), $cap_height / 4, $letter, $color_text);
67
+ }
68
+ for ($c = 0; $c < 150; $c++) {
69
+ $x = rand(0, $cap_width - 1);
70
+ $y = rand(0, 29);
71
+ $col = '0x' . rand(0, 9) . '0' . rand(0, 9) . '0' . rand(0, 9) . '0';
72
+ imagesetpixel($canvas, $x, $y, $col);
73
+ }
74
+ header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
75
+ header('Cache-Control: no-store, no-cache, must-revalidate');
76
+ header('Cache-Control: post-check=0, pre-check=0', FALSE);
77
+ header('Pragma: no-cache');
78
+ header('Content-Type: image/jpeg');
79
+ imagejpeg($canvas, NULL, $cap_quality);
80
+ }
81
+ die('');
82
+ }
83
+
84
+ ////////////////////////////////////////////////////////////////////////////////////////
85
+ // Getters & Setters //
86
+ ////////////////////////////////////////////////////////////////////////////////////////
87
+ ////////////////////////////////////////////////////////////////////////////////////////
88
+ // Private Methods //
89
+ ////////////////////////////////////////////////////////////////////////////////////////
90
+ ////////////////////////////////////////////////////////////////////////////////////////
91
+ // Listeners //
92
+ ////////////////////////////////////////////////////////////////////////////////////////
93
  }
admin/views/FMViewFormcontactwindow.php CHANGED
@@ -1,113 +1,113 @@
1
- <?php
2
-
3
- class FMViewFormcontactwindow {
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
- $rows = $this->model->get_form_data();
27
- ?>
28
- <html xmlns="http://www.w3.org/1999/xhtml">
29
- <head>
30
- <title>Contact Form Maker</title>
31
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
32
- <script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script>
33
- <script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/utils/mctabs.js"></script>
34
- <script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/utils/form_utils.js"></script>
35
-
36
- <?php
37
- wp_print_scripts('jquery');
38
- ?>
39
- <base target="_self">
40
- </head>
41
- <body id="link" onLoad="tinyMCEPopup.executeOnLoad('init();');document.body.style.display='';" dir="ltr" class="forceColors">
42
- <div class="tabs" role="tablist" tabindex="-1">
43
- <ul>
44
- <li id="display_tab" class="current" role="tab" tabindex="0">
45
- <span>
46
- <a href="javascript:mcTabs.displayTab('display_tab','display_panel');" onMouseDown="return false;" tabindex="-1">Contact Form Maker</a>
47
- </span>
48
- </li>
49
- </ul>
50
- </div>
51
- <style>
52
- .panel_wrapper {
53
- height: 170px !important;
54
- }
55
- </style>
56
- <div class="panel_wrapper">
57
- <div id="display_panel" class="panel current">
58
- <table>
59
- <tr>
60
- <td style="vertical-align: middle; text-align: left;">Select a Form</td>
61
- <td style="vertical-align: middle; text-align: left;">
62
- <select name="form_maker_id" id="form_maker_id" style="width: 230px; text-align: left;">
63
- <option value="- Select Form -" selected="selected">- Select a Form -</option>
64
- <?php
65
- foreach ($rows as $row) {
66
- ?>
67
- <option value="<?php echo $row->id; ?>"><?php echo $row->title; ?></option>
68
- <?php
69
- }
70
- ?>
71
- </select>
72
- </td>
73
- </tr>
74
- </table>
75
- </div>
76
- </div>
77
- <div class="mceActionPanel">
78
- <div style="float: left;">
79
- <input type="button" id="cancel" name="cancel" value="Cancel" onClick="tinyMCEPopup.close();"/>
80
- </div>
81
- <div style="float: right;">
82
- <input type="submit" id="insert" name="insert" value="Insert" onClick="form_maker_insert_shortcode();"/>
83
- </div>
84
- </div>
85
- <script type="text/javascript">
86
- function form_maker_insert_shortcode() {
87
- if (document.getElementById('form_maker_id').value == '- Select Form -') {
88
- tinyMCEPopup.close();
89
- }
90
- else {
91
- var tagtext;
92
- tagtext = '[wd_contact_form id="' + document.getElementById('form_maker_id').value + '"]';
93
- window.tinyMCE.execCommand('mceInsertContent', false, tagtext);
94
- tinyMCEPopup.close();
95
- }
96
- }
97
- </script>
98
- </body>
99
- </html>
100
- <?php
101
- die();
102
- }
103
-
104
- ////////////////////////////////////////////////////////////////////////////////////////
105
- // Getters & Setters //
106
- ////////////////////////////////////////////////////////////////////////////////////////
107
- ////////////////////////////////////////////////////////////////////////////////////////
108
- // Private Methods //
109
- ////////////////////////////////////////////////////////////////////////////////////////
110
- ////////////////////////////////////////////////////////////////////////////////////////
111
- // Listeners //
112
- ////////////////////////////////////////////////////////////////////////////////////////
113
  }
1
+ <?php
2
+
3
+ class FMViewFormcontactwindow {
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
+ $rows = $this->model->get_form_data();
27
+ ?>
28
+ <html xmlns="http://www.w3.org/1999/xhtml">
29
+ <head>
30
+ <title>Contact Form Maker</title>
31
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
32
+ <script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script>
33
+ <script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/utils/mctabs.js"></script>
34
+ <script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/utils/form_utils.js"></script>
35
+
36
+ <?php
37
+ wp_print_scripts('jquery');
38
+ ?>
39
+ <base target="_self">
40
+ </head>
41
+ <body id="link" onLoad="tinyMCEPopup.executeOnLoad('init();');document.body.style.display='';" dir="ltr" class="forceColors">
42
+ <div class="tabs" role="tablist" tabindex="-1">
43
+ <ul>
44
+ <li id="display_tab" class="current" role="tab" tabindex="0">
45
+ <span>
46
+ <a href="javascript:mcTabs.displayTab('display_tab','display_panel');" onMouseDown="return false;" tabindex="-1">Contact Form Maker</a>
47
+ </span>
48
+ </li>
49
+ </ul>
50
+ </div>
51
+ <style>
52
+ .panel_wrapper {
53
+ height: 170px !important;
54
+ }
55
+ </style>
56
+ <div class="panel_wrapper">
57
+ <div id="display_panel" class="panel current">
58
+ <table>
59
+ <tr>
60
+ <td style="vertical-align: middle; text-align: left;">Select a Form</td>
61
+ <td style="vertical-align: middle; text-align: left;">
62
+ <select name="form_maker_id" id="form_maker_id" style="width: 230px; text-align: left;">
63
+ <option value="- Select Form -" selected="selected">- Select a Form -</option>
64
+ <?php
65
+ foreach ($rows as $row) {
66
+ ?>
67
+ <option value="<?php echo $row->id; ?>"><?php echo $row->title; ?></option>
68
+ <?php
69
+ }
70
+ ?>
71
+ </select>
72
+ </td>
73
+ </tr>
74
+ </table>
75
+ </div>
76
+ </div>
77
+ <div class="mceActionPanel">
78
+ <div style="float: left;">
79
+ <input type="button" id="cancel" name="cancel" value="Cancel" onClick="tinyMCEPopup.close();"/>
80
+ </div>
81
+ <div style="float: right;">
82
+ <input type="submit" id="insert" name="insert" value="Insert" onClick="form_maker_insert_shortcode();"/>
83
+ </div>
84
+ </div>
85
+ <script type="text/javascript">
86
+ function form_maker_insert_shortcode() {
87
+ if (document.getElementById('form_maker_id').value == '- Select Form -') {
88
+ tinyMCEPopup.close();
89
+ }
90
+ else {
91
+ var tagtext;
92
+ tagtext = '[wd_contact_form id="' + document.getElementById('form_maker_id').value + '"]';
93
+ window.tinyMCE.execCommand('mceInsertContent', false, tagtext);
94
+ tinyMCEPopup.close();
95
+ }
96
+ }
97
+ </script>
98
+ </body>
99
+ </html>
100
+ <?php
101
+ die();
102
+ }
103
+
104
+ ////////////////////////////////////////////////////////////////////////////////////////
105
+ // Getters & Setters //
106
+ ////////////////////////////////////////////////////////////////////////////////////////
107
+ ////////////////////////////////////////////////////////////////////////////////////////
108
+ // Private Methods //
109
+ ////////////////////////////////////////////////////////////////////////////////////////
110
+ ////////////////////////////////////////////////////////////////////////////////////////
111
+ // Listeners //
112
+ ////////////////////////////////////////////////////////////////////////////////////////
113
  }
admin/views/FMViewFromipinfoinpopup_fmc.php CHANGED
@@ -1,102 +1,102 @@
1
- <?php
2
-
3
- class FMViewFromipinfoinpopup_fmc {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- private $model;
14
-
15
-
16
- ////////////////////////////////////////////////////////////////////////////////////////
17
- // Constructor & Destructor //
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- public function __construct($model) {
20
- $this->model = $model;
21
- }
22
- ////////////////////////////////////////////////////////////////////////////////////////
23
- // Public Methods //
24
- ////////////////////////////////////////////////////////////////////////////////////////
25
- public function display() {
26
- $data_ip = ((isset($_GET['data_ip'])) ? esc_html(stripslashes($_GET['data_ip'])) : 0);
27
- $query = @unserialize(file_get_contents('http://ip-api.com/php/' . $data_ip));
28
- if ($query && $query['status'] == 'success' && $query['countryCode']) {
29
- $country_flag = '<img width="16px" src="' . WD_FMC_URL . '/images/flags/' . strtolower($query['countryCode']) . '.png" class="sub-align" alt="' . $query['country'] . '" title="' . $query['country'] . '" />';
30
- $country = $query['country'] ;
31
- $countryCode = $query['countryCode'] ;
32
- $city = $query['city'];
33
- $timezone = $query['timezone'];
34
- $lat = $query['lat'];
35
- $lon = $query['lon'];
36
- }
37
- else {
38
- $country_flag = '';
39
- $country = '';
40
- $countryCode = '';
41
- $city = '';
42
- $timezone = '';
43
- $lat = '';
44
- $lon = '';
45
- }
46
- ?>
47
- <style>
48
- .admintable {
49
- height: 100%;
50
- margin: 0 auto;
51
- padding: 0;
52
- width: 100%;
53
- }
54
- table.admintable td.key, table.admintable td.paramlist_key {
55
- background-color: #F6F6F6;
56
- border-bottom: 1px solid #E9E9E9;
57
- border-right: 1px solid #E9E9E9;
58
- color: #666666;
59
- font-weight: bold;
60
- margin-right: 10px;
61
- text-align: right;
62
- width: 140px;
63
- }
64
- </style>
65
- <table class="admintable">
66
- <tr>
67
- <td class="key"><b>IP:</b></td><td><?php echo $data_ip; ?></td>
68
- </tr>
69
- <tr>
70
- <td class="key"><b>Country:</b></td><td><?php echo $country . ' ' . $country_flag; ?></td>
71
- </tr>
72
- <tr>
73
- <td class="key"><b>CountryCode:</b></td><td><?php echo $countryCode; ?></td>
74
- </tr>
75
- <tr>
76
- <td class="key"><b>City:</b></td><td><?php echo $city; ?></td>
77
- </tr>
78
- <tr>
79
- <td class="key"><b>Timezone:</b></td><td><?php echo $timezone; ?></td>
80
- </tr>
81
- <tr>
82
- <td class="key"><b>Latitude:</b></td><td><?php echo $lat; ?></td>
83
- </tr>
84
- <tr>
85
- <td class="key"><b>Longitude:</b></td><td><?php echo $lon; ?></td>
86
- </tr>
87
- </table>
88
- <?php
89
- die();
90
- }
91
-
92
-
93
- ////////////////////////////////////////////////////////////////////////////////////////
94
- // Getters & Setters //
95
- ////////////////////////////////////////////////////////////////////////////////////////
96
- ////////////////////////////////////////////////////////////////////////////////////////
97
- // Private Methods //
98
- ////////////////////////////////////////////////////////////////////////////////////////
99
- ////////////////////////////////////////////////////////////////////////////////////////
100
- // Listeners //
101
- ////////////////////////////////////////////////////////////////////////////////////////
102
  }
1
+ <?php
2
+
3
+ class FMViewFromipinfoinpopup_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+
16
+ ////////////////////////////////////////////////////////////////////////////////////////
17
+ // Constructor & Destructor //
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ public function __construct($model) {
20
+ $this->model = $model;
21
+ }
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
26
+ $data_ip = ((isset($_GET['data_ip'])) ? esc_html(stripslashes($_GET['data_ip'])) : 0);
27
+ $query = @unserialize(file_get_contents('http://ip-api.com/php/' . $data_ip));
28
+ if ($query && $query['status'] == 'success' && $query['countryCode']) {
29
+ $country_flag = '<img width="16px" src="' . WD_FMC_URL . '/images/flags/' . strtolower($query['countryCode']) . '.png" class="sub-align" alt="' . $query['country'] . '" title="' . $query['country'] . '" />';
30
+ $country = $query['country'] ;
31
+ $countryCode = $query['countryCode'] ;
32
+ $city = $query['city'];
33
+ $timezone = $query['timezone'];
34
+ $lat = $query['lat'];
35
+ $lon = $query['lon'];
36
+ }
37
+ else {
38
+ $country_flag = '';
39
+ $country = '';
40
+ $countryCode = '';
41
+ $city = '';
42
+ $timezone = '';
43
+ $lat = '';
44
+ $lon = '';
45
+ }
46
+ ?>
47
+ <style>
48
+ .admintable {
49
+ height: 100%;
50
+ margin: 0 auto;
51
+ padding: 0;
52
+ width: 100%;
53
+ }
54
+ table.admintable td.key, table.admintable td.paramlist_key {
55
+ background-color: #F6F6F6;
56
+ border-bottom: 1px solid #E9E9E9;
57
+ border-right: 1px solid #E9E9E9;
58
+ color: #666666;
59
+ font-weight: bold;
60
+ margin-right: 10px;
61
+ text-align: right;
62
+ width: 140px;
63
+ }
64
+ </style>
65
+ <table class="admintable">
66
+ <tr>
67
+ <td class="key"><b>IP:</b></td><td><?php echo $data_ip; ?></td>
68
+ </tr>
69
+ <tr>
70
+ <td class="key"><b>Country:</b></td><td><?php echo $country . ' ' . $country_flag; ?></td>
71
+ </tr>
72
+ <tr>
73
+ <td class="key"><b>CountryCode:</b></td><td><?php echo $countryCode; ?></td>
74
+ </tr>
75
+ <tr>
76
+ <td class="key"><b>City:</b></td><td><?php echo $city; ?></td>
77
+ </tr>
78
+ <tr>
79
+ <td class="key"><b>Timezone:</b></td><td><?php echo $timezone; ?></td>
80
+ </tr>
81
+ <tr>
82
+ <td class="key"><b>Latitude:</b></td><td><?php echo $lat; ?></td>
83
+ </tr>
84
+ <tr>
85
+ <td class="key"><b>Longitude:</b></td><td><?php echo $lon; ?></td>
86
+ </tr>
87
+ </table>
88
+ <?php
89
+ die();
90
+ }
91
+
92
+
93
+ ////////////////////////////////////////////////////////////////////////////////////////
94
+ // Getters & Setters //
95
+ ////////////////////////////////////////////////////////////////////////////////////////
96
+ ////////////////////////////////////////////////////////////////////////////////////////
97
+ // Private Methods //
98
+ ////////////////////////////////////////////////////////////////////////////////////////
99
+ ////////////////////////////////////////////////////////////////////////////////////////
100
+ // Listeners //
101
+ ////////////////////////////////////////////////////////////////////////////////////////
102
  }
admin/views/FMViewFrommapeditinpopup_fmc.php CHANGED
@@ -1,64 +1,64 @@
1
- <?php
2
-
3
- class FMViewFrommapeditinpopup_fmc {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- private $model;
14
-
15
-
16
- ////////////////////////////////////////////////////////////////////////////////////////
17
- // Constructor & Destructor //
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- public function __construct($model) {
20
- $this->model = $model;
21
- }
22
- ////////////////////////////////////////////////////////////////////////////////////////
23
- // Public Methods //
24
- ////////////////////////////////////////////////////////////////////////////////////////
25
- public function display() {
26
- $long = ((isset($_GET['long'])) ? esc_html(stripslashes($_GET['long'])) : 0);
27
- $lat = ((isset($_GET['lat'])) ? esc_html(stripslashes($_GET['lat'])) : 0);
28
- ?>
29
- <script src="<?php echo WD_FMC_URL . '/js/main_front_end.js'; ?>"></script>
30
- <script src="<?php echo WD_FMC_URL . '/js/if_gmap_back_end.js'; ?>"></script>
31
- <script src="http://maps.google.com/maps/api/js?sensor=false"></script>
32
- <table style="margin:0px; padding:0px">
33
- <tr>
34
- <td><b>Address:</b></td>
35
- <td><input type="text" id="addrval0" style="border:0px; background:none" size="80" readonly/></td>
36
- </tr>
37
- <tr>
38
- <td><b>Longitude:</b></td>
39
- <td><input type="text" id="longval0" style="border:0px; background:none" size="80" readonly/></td>
40
- </tr>
41
- <tr>
42
- <td><b>Latitude:</b></td>
43
- <td><input type="text" id="latval0" style="border:0px; background:none" size="80" readonly/></td>
44
- </tr>
45
- </table>
46
- <div id="0_elementform_id_temp" long="<?php echo $long ?>" center_x="<?php echo $long ?>" center_y="<?php echo $lat ?>" lat="<?php echo $lat ?>" zoom="8" info="" style="width:600px; height:400px; "></div>
47
- <script>
48
- if_gmap_init("0");
49
- add_marker_on_map(0, 0, "<?php echo $long; ?>", "<?php echo $lat; ?>", "");
50
- </script>
51
- <?php
52
- die();
53
- }
54
-
55
- ////////////////////////////////////////////////////////////////////////////////////////
56
- // Getters & Setters //
57
- ////////////////////////////////////////////////////////////////////////////////////////
58
- ////////////////////////////////////////////////////////////////////////////////////////
59
- // Private Methods //
60
- ////////////////////////////////////////////////////////////////////////////////////////
61
- ////////////////////////////////////////////////////////////////////////////////////////
62
- // Listeners //
63
- ////////////////////////////////////////////////////////////////////////////////////////
64
  }
1
+ <?php
2
+
3
+ class FMViewFrommapeditinpopup_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+
16
+ ////////////////////////////////////////////////////////////////////////////////////////
17
+ // Constructor & Destructor //
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ public function __construct($model) {
20
+ $this->model = $model;
21
+ }
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
26
+ $long = ((isset($_GET['long'])) ? esc_html(stripslashes($_GET['long'])) : 0);
27
+ $lat = ((isset($_GET['lat'])) ? esc_html(stripslashes($_GET['lat'])) : 0);
28
+ ?>
29
+ <script src="<?php echo WD_FMC_URL . '/js/main_front_end.js'; ?>"></script>
30
+ <script src="<?php echo WD_FMC_URL . '/js/if_gmap_back_end.js'; ?>"></script>
31
+ <script src="http://maps.google.com/maps/api/js?sensor=false"></script>
32
+ <table style="margin:0px; padding:0px">
33
+ <tr>
34
+ <td><b>Address:</b></td>
35
+ <td><input type="text" id="addrval0" style="border:0px; background:none" size="80" readonly/></td>
36
+ </tr>
37
+ <tr>
38
+ <td><b>Longitude:</b></td>
39
+ <td><input type="text" id="longval0" style="border:0px; background:none" size="80" readonly/></td>
40
+ </tr>
41
+ <tr>
42
+ <td><b>Latitude:</b></td>
43
+ <td><input type="text" id="latval0" style="border:0px; background:none" size="80" readonly/></td>
44
+ </tr>
45
+ </table>
46
+ <div id="0_elementform_id_temp" long="<?php echo $long ?>" center_x="<?php echo $long ?>" center_y="<?php echo $lat ?>" lat="<?php echo $lat ?>" zoom="8" info="" style="width:600px; height:400px; "></div>
47
+ <script>
48
+ if_gmap_init("0");
49
+ add_marker_on_map(0, 0, "<?php echo $long; ?>", "<?php echo $lat; ?>", "");
50
+ </script>
51
+ <?php
52
+ die();
53
+ }
54
+
55
+ ////////////////////////////////////////////////////////////////////////////////////////
56
+ // Getters & Setters //
57
+ ////////////////////////////////////////////////////////////////////////////////////////
58
+ ////////////////////////////////////////////////////////////////////////////////////////
59
+ // Private Methods //
60
+ ////////////////////////////////////////////////////////////////////////////////////////
61
+ ////////////////////////////////////////////////////////////////////////////////////////
62
+ // Listeners //
63
+ ////////////////////////////////////////////////////////////////////////////////////////
64
  }
admin/views/FMViewGenerete_csv_fmc.php CHANGED
@@ -1,69 +1,69 @@
1
- <?php
2
-
3
- class FMViewGenerete_csv_fmc {
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
- $params = $this->model->get_data();
27
- $data = $params[0];
28
- $title = $params[1];
29
- $is_paypal_info = $params[2];
30
-
31
- function cleanData(&$str) {
32
- $str = preg_replace("/\t/", "\\t", $str);
33
- $str = preg_replace("/\r?\n/", "\\n", $str);
34
- if (strstr($str, '"'))
35
- $str = '"' . str_replace('"', '""', $str) . '"';
36
- }
37
- // File name for download.
38
- $filename = $title . "_" . date('Ymd') . ".csv";
39
- header('Content-Encoding: Windows-1252');
40
- header('Content-type: text/csv; charset=Windows-1252');
41
- header("Content-Disposition: attachment; filename=\"$filename\"");
42
- $flag = FALSE;
43
- foreach ($data as $row) {
44
- if (!$flag) {
45
- # display field/column names as first row
46
- echo "sep=,\r\n";
47
- echo '"' . implode('","', array_keys($row));
48
- if ($is_paypal_info) {
49
- echo '","Currency","Last modified","Status","Full Name","Fax","Mobile phone","Email","Phone","Address","Paypal info","IPN","Tax","Shipping';
50
- }
51
- echo "\"\r\n";
52
- $flag = TRUE;
53
- }
54
- array_walk($row, 'cleanData');
55
- echo '"' . implode('","', array_values($row)) . "\"\r\n";
56
- }
57
- die('');
58
- }
59
-
60
- ////////////////////////////////////////////////////////////////////////////////////////
61
- // Getters & Setters //
62
- ////////////////////////////////////////////////////////////////////////////////////////
63
- ////////////////////////////////////////////////////////////////////////////////////////
64
- // Private Methods //
65
- ////////////////////////////////////////////////////////////////////////////////////////
66
- ////////////////////////////////////////////////////////////////////////////////////////
67
- // Listeners //
68
- ////////////////////////////////////////////////////////////////////////////////////////
69
  }
1
+ <?php
2
+
3
+ class FMViewGenerete_csv_fmc {
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
+ $params = $this->model->get_data();
27
+ $data = $params[0];
28
+ $title = $params[1];
29
+ $is_paypal_info = $params[2];
30
+
31
+ function cleanData(&$str) {
32
+ $str = preg_replace("/\t/", "\\t", $str);
33
+ $str = preg_replace("/\r?\n/", "\\n", $str);
34
+ if (strstr($str, '"'))
35
+ $str = '"' . str_replace('"', '""', $str) . '"';
36
+ }
37
+ // File name for download.
38
+ $filename = $title . "_" . date('Ymd') . ".csv";
39
+ header('Content-Encoding: Windows-1252');
40
+ header('Content-type: text/csv; charset=Windows-1252');
41
+ header("Content-Disposition: attachment; filename=\"$filename\"");
42
+ $flag = FALSE;
43
+ foreach ($data as $row) {
44
+ if (!$flag) {
45
+ # display field/column names as first row
46
+ echo "sep=,\r\n";
47
+ echo '"' . implode('","', array_keys($row));
48
+ if ($is_paypal_info) {
49
+ echo '","Currency","Last modified","Status","Full Name","Fax","Mobile phone","Email","Phone","Address","Paypal info","IPN","Tax","Shipping';
50
+ }
51
+ echo "\"\r\n";
52
+ $flag = TRUE;
53
+ }
54
+ array_walk($row, 'cleanData');
55
+ echo '"' . implode('","', array_values($row)) . "\"\r\n";
56
+ }
57
+ die('');
58
+ }
59
+
60
+ ////////////////////////////////////////////////////////////////////////////////////////
61
+ // Getters & Setters //
62
+ ////////////////////////////////////////////////////////////////////////////////////////
63
+ ////////////////////////////////////////////////////////////////////////////////////////
64
+ // Private Methods //
65
+ ////////////////////////////////////////////////////////////////////////////////////////
66
+ ////////////////////////////////////////////////////////////////////////////////////////
67
+ // Listeners //
68
+ ////////////////////////////////////////////////////////////////////////////////////////
69
  }
admin/views/FMViewGenerete_xml_fmc.php CHANGED
@@ -1,67 +1,67 @@
1
- <?php
2
-
3
- class FMViewGenerete_xml_fmc{
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
- $params = $this->model->get_data();
27
- $data = $params[0];
28
- $title = $params[1];
29
- $filename = $title . "_" . date('Ymd') . ".xml";
30
- header("Content-Disposition: attachment; filename=\"$filename\"");
31
- header("Content-Type:text/xml, charset=utf-8");
32
- $flag = FALSE;
33
- echo '<?xml version="1.0" encoding="utf-8" ?>';
34
- ?>
35
- <form title="<?php echo $title; ?>">
36
- <?php
37
- foreach ($data as $key1 => $value1) {
38
- ?>
39
- <submission>
40
- <?php
41
- foreach ($value1 as $key => $value) {
42
- ?>
43
- <field title="<?php echo $key; ?>">
44
- <![CDATA[<?php echo $value; ?>]]>
45
- </field>
46
- <?php
47
- }
48
- ?>
49
- </submission>
50
- <?php
51
- }
52
- ?>
53
- </form>
54
- <?php
55
- die('');
56
- }
57
-
58
- ////////////////////////////////////////////////////////////////////////////////////////
59
- // Getters & Setters //
60
- ////////////////////////////////////////////////////////////////////////////////////////
61
- ////////////////////////////////////////////////////////////////////////////////////////
62
- // Private Methods //
63
- ////////////////////////////////////////////////////////////////////////////////////////
64
- ////////////////////////////////////////////////////////////////////////////////////////
65
- // Listeners //
66
- ////////////////////////////////////////////////////////////////////////////////////////
67
  }
1
+ <?php
2
+
3
+ class FMViewGenerete_xml_fmc{
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
+ $params = $this->model->get_data();
27
+ $data = $params[0];
28
+ $title = $params[1];
29
+ $filename = $title . "_" . date('Ymd') . ".xml";
30
+ header("Content-Disposition: attachment; filename=\"$filename\"");
31
+ header("Content-Type:text/xml, charset=utf-8");
32
+ $flag = FALSE;
33
+ echo '<?xml version="1.0" encoding="utf-8" ?>';
34
+ ?>
35
+ <form title="<?php echo $title; ?>">
36
+ <?php
37
+ foreach ($data as $key1 => $value1) {
38
+ ?>
39
+ <submission>
40
+ <?php
41
+ foreach ($value1 as $key => $value) {
42
+ ?>
43
+ <field title="<?php echo $key; ?>">
44
+ <![CDATA[<?php echo $value; ?>]]>
45
+ </field>
46
+ <?php
47
+ }
48
+ ?>
49
+ </submission>
50
+ <?php
51
+ }
52
+ ?>
53
+ </form>
54
+ <?php
55
+ die('');
56
+ }
57
+
58
+ ////////////////////////////////////////////////////////////////////////////////////////
59
+ // Getters & Setters //
60
+ ////////////////////////////////////////////////////////////////////////////////////////
61
+ ////////////////////////////////////////////////////////////////////////////////////////
62
+ // Private Methods //
63
+ ////////////////////////////////////////////////////////////////////////////////////////
64
+ ////////////////////////////////////////////////////////////////////////////////////////
65
+ // Listeners //
66
+ ////////////////////////////////////////////////////////////////////////////////////////
67
  }
admin/views/FMViewLicensing_fmc.php CHANGED
@@ -1,54 +1,54 @@
1
- <?php
2
-
3
- class FMViewLicensing_fmc {
4
- ////////////////////////////////////////////////////////////////////////////////////////
5
- // Events //
6
- ////////////////////////////////////////////////////////////////////////////////////////
7
- ////////////////////////////////////////////////////////////////////////////////////////
8
- // Constants //
9
- ////////////////////////////////////////////////////////////////////////////////////////
10
- ////////////////////////////////////////////////////////////////////////////////////////
11
- // Variables //
12
- ////////////////////////////////////////////////////////////////////////////////////////
13
- private $model;
14
-
15
-
16
- ////////////////////////////////////////////////////////////////////////////////////////
17
- // Constructor & Destructor //
18
- ////////////////////////////////////////////////////////////////////////////////////////
19
- public function __construct($model) {
20
- $this->model = $model;
21
- }
22
- ////////////////////////////////////////////////////////////////////////////////////////
23
- // Public Methods //
24
- ////////////////////////////////////////////////////////////////////////////////////////
25
- public function display() {
26
- ?>
27
- <div style="width:99%">
28
- <p>This plugin is the non-commercial version of the Contact Form Maker. Use of this plugin is free. You can add not more than 7 fields. The limitation is on the some types of the fields (File Upload, Map and Paypal). If you want to use those fields, you are required to purchase a license. </p>
29
- <br/>
30
- <a href="http://web-dorado.com/files/fromContactForm.php" class="button-primary" target="_blank">Purchase a License</a>
31
- <br/><br/>
32
- <p>After the purchasing the commercial version follow this steps:</p>
33
- <ol>
34
- <li>Deactivate Contact Form Maker Plugin.</li>
35
- <li>Delete Contact Form Maker Plugin.</li>
36
- <li>Install the downloaded commercial version of the plugin.</li>
37
- </ol>
38
- <br/>
39
- <p>If you enjoy using Contact Form Maker and find it useful, please consider making a donation. Your donation will help encourage and support the plugin's continued development and better user support.</p>
40
- <br/>
41
- <a href="http://web-dorado.com/files/donate_redirect.php" target="_blank"><img src="<?php echo WD_FMC_URL . '/images/btn_donateCC_LG.gif'; ?>" /></a>
42
- </div>
43
- <?php
44
- }
45
- ////////////////////////////////////////////////////////////////////////////////////////
46
- // Getters & Setters //
47
- ////////////////////////////////////////////////////////////////////////////////////////
48
- ////////////////////////////////////////////////////////////////////////////////////////
49
- // Private Methods //
50
- ////////////////////////////////////////////////////////////////////////////////////////
51
- ////////////////////////////////////////////////////////////////////////////////////////
52
- // Listeners //
53
- ////////////////////////////////////////////////////////////////////////////////////////
54
  }
1
+ <?php
2
+
3
+ class FMViewLicensing_fmc {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+
16
+ ////////////////////////////////////////////////////////////////////////////////////////
17
+ // Constructor & Destructor //
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ public function __construct($model) {
20
+ $this->model = $model;
21
+ }
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
26
+ ?>
27
+ <div style="width:99%">
28
+ <p>This plugin is the non-commercial version of the Contact Form Maker. Use of this plugin is free. You can add not more than 7 fields. The limitation is on the some types of the fields (File Upload, Map and Paypal). If you want to use those fields, you are required to purchase a license. </p>
29
+ <br/>
30
+ <a href="http://web-dorado.com/files/fromContactForm.php" class="button-primary" target="_blank">Purchase a License</a>
31
+ <br/><br/>
32
+ <p>After the purchasing the commercial version follow this steps:</p>
33
+ <ol>
34
+ <li>Deactivate Contact Form Maker Plugin.</li>
35
+ <li>Delete Contact Form Maker Plugin.</li>
36
+ <li>Install the downloaded commercial version of the plugin.</li>
37
+ </ol>
38
+ <br/>
39
+ <p>If you enjoy using Contact Form Maker and find it useful, please consider making a donation. Your donation will help encourage and support the plugin's continued development and better user support.</p>
40
+ <br/>
41
+ <a href="http://web-dorado.com/files/donate_redirect.php" target="_blank"><img src="<?php echo WD_FMC_URL . '/images/btn_donateCC_LG.gif'; ?>" /></a>
42
+ </div>
43
+ <?php
44
+ }
45
+ ////////////////////////////////////////////////////////////////////////////////////////
46
+ // Getters & Setters //
47
+ ////////////////////////////////////////////////////////////////////////////////////////
48
+ ////////////////////////////////////////////////////////////////////////////////////////
49
+ // Private Methods //
50
+ ////////////////////////////////////////////////////////////////////////////////////////
51
+ ////////////////////////////////////////////////////////////////////////////////////////
52
+ // Listeners //
53
+ ////////////////////////////////////////////////////////////////////////////////////////
54
  }
admin/views/FMViewManage_fmc.php CHANGED
@@ -1,3802 +1,3802 @@
1
- <?php
2
-
3
- class FMViewManage_fmc {
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($_POST['search_value']) : '');
29
- $search_select_value = ((isset($_POST['search_select_value'])) ? (int) $_POST['search_select_value'] : 0);
30
- $asc_or_desc = ((isset($_POST['asc_or_desc'])) ? esc_html($_POST['asc_or_desc']) : 'asc');
31
- $order_by = (isset($_POST['order_by']) ? esc_html($_POST['order_by']) : 'id');
32
- $order_class = 'manage-column column-title sorted ' . $asc_or_desc;
33
- $ids_string = '';
34
- ?>
35
- <div style="clear: both; float: left; width: 99%;">
36
- <div style="float:left; font-size: 14px; font-weight: bold;">
37
- This section allows you to create, edit forms.
38
- <a style="color: blue; text-decoration: none;" target="_blank" href="http://web-dorado.com/wordpress-form-maker-guide-2.html">Read More in User Manual</a>
39
- </div>
40
- <div style="float: right; text-align: right;">
41
- <a style="text-decoration: none;" target="_blank" href="http://web-dorado.com/files/fromContactForm.php">
42
- <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FMC_URL . '/images/wd_logo.png'; ?>" />
43
- </a>
44
- </div>
45
- </div>
46
- <form onkeypress="spider_doNothing(event)" class="wrap" id="manage_form" method="post" action="admin.php?page=manage_fmc" style="float: left; width: 99%;">
47
- <span class="form_maker_icon"></span>
48
- <h2>
49
- Contact Form Maker
50
- <a href="" class="add-new-h2" onclick="spider_set_input_value('task', 'add');
51
- spider_form_submit(event, 'manage_form')">Add new</a>
52
- </h2>
53
- <div class="tablenav top">
54
- <?php
55
- WDW_FMC_Library::search('Title', $search_value, 'manage_form');
56
- WDW_FMC_Library::html_page_nav($page_nav['total'], $page_nav['limit'], 'manage_form');
57
- ?>
58
- </div>
59
- <table class="wp-list-table widefat fixed pages">
60
- <thead>
61
- <th class="manage-column column-cb check-column table_small_col"><input id="check_all" type="checkbox" style="margin:0;"/></th>
62
- <th class="table_small_col <?php if ($order_by == 'id') { echo $order_class; } ?>">
63
- <a onclick="spider_set_input_value('task', '');
64
- spider_set_input_value('order_by', 'id');
65
- spider_set_input_value('asc_or_desc', '<?php echo ((isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && (esc_html($_POST['order_by']) == 'id') && esc_html($_POST['asc_or_desc']) == 'asc') ? 'desc' : 'asc'); ?>');
66
- spider_form_submit(event, 'manage_form')" href="">
67
- <span>ID</span><span class="sorting-indicator"></span></a>
68
- </th>
69
- <th class="<?php if ($order_by == 'title') { echo $order_class; } ?>">
70
- <a onclick="spider_set_input_value('task', '');
71
- spider_set_input_value('order_by', 'title');
72
- spider_set_input_value('asc_or_desc', '<?php echo ((isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && (esc_html($_POST['order_by']) == 'title') && esc_html($_POST['asc_or_desc']) == 'asc') ? 'desc' : 'asc'); ?>');
73
- spider_form_submit(event, 'manage_form')" href="">
74
- <span>Title</span><span class="sorting-indicator"></span></a>
75
- </th>
76
- <th class="<?php if ($order_by == 'mail') { echo $order_class; } ?>">
77
- <a onclick="spider_set_input_value('task', '');
78
- spider_set_input_value('order_by', 'mail');
79
- spider_set_input_value('asc_or_desc', '<?php echo ((isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && (esc_html($_POST['order_by']) == 'mail') && esc_html($_POST['asc_or_desc']) == 'asc') ? 'desc' : 'asc'); ?>');
80
- spider_form_submit(event, 'manage_form')" href="">
81
- <span>Email to send submissions to</span><span class="sorting-indicator"></span></a>
82
- </th>
83
- <th class="table_big_col" style="width: 140px;">Shortcode</th>
84
- <th class="table_big_col">Edit</th>
85
- <th class="table_big_col"><a title="Delete selected items" href="" onclick="if (confirm('Do you want to delete selected items?')) {
86
- spider_set_input_value('task', 'delete_all');
87
- spider_form_submit(event, 'manage_form');
88
- } else {
89
- return false;
90
- }">Delete</a></th>
91
- </thead>
92
- <tbody id="tbody_arr">
93
- <?php
94
- if ($rows_data) {
95
- foreach ($rows_data as $row_data) {
96
- $alternate = (!isset($alternate) || $alternate == 'class="alternate"') ? '' : 'class="alternate"';
97
- $old = '';
98
- if (isset($row_data->form) && ($row_data->form != '')) {
99
- $old = '_old';
100
- }
101
- ?>
102
- <tr id="tr_<?php echo $row_data->id; ?>" <?php echo $alternate; ?>>
103
- <td class="table_small_col check-column">
104
- <input id="check_<?php echo $row_data->id; ?>" name="check_<?php echo $row_data->id; ?>" type="checkbox"/>
105
- </td>
106
- <td class="table_small_col"><?php echo $row_data->id; ?></td>
107
- <td>
108
- <a onclick="spider_set_input_value('task', 'edit<?php echo $old; ?>');
109
- spider_set_input_value('current_id', '<?php echo $row_data->id; ?>');
110
- spider_form_submit(event, 'manage_form')" href="" title="Edit"><?php echo $row_data->title; ?></a>
111
- </td>
112
- <td><?php echo $row_data->mail; ?></td>
113
- <td class="table_big_col" style="padding-left: 0; padding-right: 0; width: 140px;">
114
- <input type="text" value='[wd_contact_form id="<?php echo $row_data->id; ?>"]' onclick="spider_select_value(this)" size="12" readonly="readonly" style="padding-left: 1px; padding-right: 1px;width: 139px;"/>
115
- </td>
116
- <td class="table_big_col">
117
- <a onclick="spider_set_input_value('task', 'edit<?php echo $old; ?>');
118
- spider_set_input_value('current_id', '<?php echo $row_data->id; ?>');
119
- spider_form_submit(event, 'manage_form')" href="">Edit</a>
120
- </td>
121
- <td class="table_big_col">
122
- <a onclick="spider_set_input_value('task', 'delete');
123
- spider_set_input_value('current_id', '<?php echo $row_data->id; ?>');
124
- spider_form_submit(event, 'manage_form')" href="">Delete</a>
125
- </td>
126
- </tr>
127
- <?php
128
- $ids_string .= $row_data->id . ',';
129
- }
130
- }
131
- ?>
132
- </tbody>
133
- </table>
134
- <input id="task" name="task" type="hidden" value=""/>
135
- <input id="current_id" name="current_id" type="hidden" value=""/>
136
- <input id="ids_string" name="ids_string" type="hidden" value="<?php echo $ids_string; ?>"/>
137
- <input id="asc_or_desc" name="asc_or_desc" type="hidden" value="asc"/>
138
- <input id="order_by" name="order_by" type="hidden" value="<?php echo $order_by; ?>"/>
139
- </form>
140
- <?php
141
- }
142
-
143
- public function edit($id) {
144
- // header("X-XSS-Protection: 0");
145
- $row = $this->model->get_row_data_new($id);
146
- $themes = $this->model->get_theme_rows_data();
147
- $labels = array();
148
- $label_id = array();
149
- $label_order_original = array();
150
- $label_type = array();
151
- $label_all = explode('#****#', $row->label_order);
152
- $label_all = array_slice($label_all, 0, count($label_all) - 1);
153
- foreach ($label_all as $key => $label_each) {
154
- $label_id_each = explode('#**id**#', $label_each);
155
- array_push($label_id, $label_id_each[0]);
156
- $label_oder_each = explode('#**label**#', $label_id_each[1]);
157
- array_push($label_order_original, addslashes($label_oder_each[0]));
158
- array_push($label_type, $label_oder_each[1]);
159
- }
160
- $labels['id'] = '"' . implode('","', $label_id) . '"';
161
- $labels['label'] = '"' . implode('","', $label_order_original) . '"';
162
- $labels['type'] = '"' . implode('","', $label_type) . '"';
163
- $page_title = (($id != 0) ? 'Edit form ' . $row->title : 'Create new form');
164
- ?>
165
- <script type="text/javascript">
166
- var fmc_plugin_url = "<?php echo WD_FMC_URL; ?>";
167
- </script>
168
- <script src="<?php echo WD_FMC_URL . '/js/formmaker_div_free.js'; ?>" type="text/javascript"></script>
169
- <script type="text/javascript">
170
- form_view = 1;
171
- form_view_count = 1;
172
- form_view_max = 1;
173
- function submitbutton() {
174
- <?php
175
- if ($id) {
176
- ?>
177
- if (!document.getElementById('araqel') || (document.getElementById('araqel').value == '0')) {
178
- alert('Please wait while page loading.');
179
- return false;
180
- }
181
- <?php
182
- }
183
- ?>
184
- tox = '';
185
- form_fields = '';
186
- document.getElementById('take').style.display = "none";
187
- document.getElementById('page_bar').style.display = "none";
188
- document.getElementById('saving').style.display = "block";
189
- remove_whitespace(document.getElementById('take'));
190
- l_id_array = [<?php echo $labels['id']?>];
191
- l_label_array = [<?php echo $labels['label']?>];
192
- l_type_array = [<?php echo $labels['type']?>];
193
- l_id_removed = [];
194
- for (x = 0; x < l_id_array.length; x++) {
195
- l_id_removed[l_id_array[x]] = true;
196
- }
197
- for (t = 1; t <= form_view_max; t++) {
198
- if (document.getElementById('form_id_tempform_view' + t)) {
199
- wdform_page = document.getElementById('form_id_tempform_view' + t);
200
- remove_whitespace(wdform_page);
201
- n = wdform_page.childNodes.length - 2;
202
- for (q = 0; q <= n; q++) {
203
- if (!wdform_page.childNodes[q].getAttribute("wdid")) {
204
- wdform_section = wdform_page.childNodes[q];
205
- for (x = 0; x < wdform_section.childNodes.length; x++) {
206
- wdform_column = wdform_section.childNodes[x];
207
- if (wdform_column.firstChild) {
208
- for (y=0; y < wdform_column.childNodes.length; y++) {
209
- is_in_old = false;
210
- wdform_row = wdform_column.childNodes[y];
211
- if (wdform_row.nodeType == 3) {
212
- continue;
213
- }
214
- wdid = wdform_row.getAttribute("wdid");
215
- if (!wdid) {
216
- continue;
217
- }
218
- l_id = wdid;
219
- l_label = document.getElementById(wdid + '_element_labelform_id_temp').innerHTML;
220
- l_label = l_label.replace(/(\r\n|\n|\r)/gm," ");
221
- wdtype = wdform_row.firstChild.getAttribute('type');
222
- for (z = 0; z < l_id_array.length; z++) {
223
- if (l_id_array[z] == wdid) {
224
- if (l_type_array[z] == "type_address") {
225
- if (document.getElementById(l_id + "_mini_label_street1")) {
226
- l_id_removed[l_id_array[z]] = false;
227
- }
228
- if (document.getElementById(l_id + "_mini_label_street2")) {
229
- l_id_removed[parseInt(l_id_array[z]) + 1] = false;
230
- }
231
- if (document.getElementById(l_id + "_mini_label_city")) {
232
- l_id_removed[parseInt(l_id_array[z]) + 2] = false;
233
- }
234
- if (document.getElementById(l_id + "_mini_label_state")) {
235
- l_id_removed[parseInt(l_id_array[z]) + 3] = false;
236
- }
237
- if (document.getElementById(l_id+"_mini_label_postal")) {
238
- l_id_removed[parseInt(l_id_array[z]) + 4] = false;
239
- }
240
- if (document.getElementById(l_id+"_mini_label_country")) {
241
- l_id_removed[parseInt(l_id_array[z]) + 5] = false;
242
- }
243
- z = z + 5;
244
- }
245
- else {
246
- l_id_removed[l_id] = false;
247
- }
248
- }
249
- }
250
- if (wdtype == "type_address") {
251
- addr_id = parseInt(wdid);
252
- id_for_country = addr_id;
253
- if (document.getElementById(id_for_country + "_mini_label_street1"))
254
- tox = tox + addr_id + '#**id**#' + document.getElementById(id_for_country + "_mini_label_street1").innerHTML + '#**label**#type_address#****#';
255
- addr_id++;
256
- if (document.getElementById(id_for_country + "_mini_label_street2"))
257
- tox = tox + addr_id + '#**id**#' + document.getElementById(id_for_country + "_mini_label_street2").innerHTML + '#**label**#type_address#****#';
258
- addr_id++;
259
- if (document.getElementById(id_for_country+"_mini_label_city"))
260
- tox = tox + addr_id + '#**id**#' + document.getElementById(id_for_country + "_mini_label_city").innerHTML + '#**label**#type_address#****#';
261
- addr_id++;
262
- if (document.getElementById(id_for_country + "_mini_label_state"))
263
- tox = tox + addr_id + '#**id**#' + document.getElementById(id_for_country + "_mini_label_state").innerHTML + '#**label**#type_address#****#';
264
- addr_id++;
265
- if (document.getElementById(id_for_country + "_mini_label_postal"))
266
- tox = tox + addr_id + '#**id**#' + document.getElementById(id_for_country + "_mini_label_postal").innerHTML + '#**label**#type_address#****#';
267
- addr_id++;
268
- if (document.getElementById(id_for_country+"_mini_label_country")) {
269
- tox=tox + addr_id + '#**id**#' + document.getElementById(id_for_country + "_mini_label_country").innerHTML + '#**label**#type_address#****#';
270
- }
271
- }
272
- else {
273
- tox = tox + wdid + '#**id**#' + l_label + '#**label**#' + wdtype + '#****#';
274
- }
275
- id = wdid;
276
- form_fields += wdid + "*:*id*:*";
277
- form_fields += wdtype + "*:*type*:*";
278
- w_choices = new Array();
279
- w_choices_checked = new Array();
280
- w_choices_disabled = new Array();
281
- w_allow_other_num = 0;
282
- w_property = new Array();
283
- w_property_type = new Array();
284
- w_property_values = new Array();
285
- w_choices_price = new Array();
286
- if (document.getElementById(id+'_element_labelform_id_temp').innerHTML) {
287
- w_field_label = document.getElementById(id + '_element_labelform_id_temp').innerHTML.replace(/(\r\n|\n|\r)/gm," ");
288
- }
289
- else {
290
- w_field_label = " ";
291
- }
292
- if (document.getElementById(id + '_label_sectionform_id_temp')) {
293
- if (document.getElementById(id + '_label_sectionform_id_temp').style.display == "block") {
294
- w_field_label_pos = "top";
295
- }
296
- else {
297
- w_field_label_pos = "left";
298
- }
299
- }
300
- if (document.getElementById(id + "_elementform_id_temp")) {
301
- s = document.getElementById(id + "_elementform_id_temp").style.width;
302
- w_size=s.substring(0,s.length - 2);
303
- }
304
- if (document.getElementById(id + "_label_sectionform_id_temp")) {
305
- s = document.getElementById(id + "_label_sectionform_id_temp").style.width;
306
- w_field_label_size = s.substring(0, s.length - 2);
307
- }
308
- if (document.getElementById(id + "_requiredform_id_temp")) {
309
- w_required = document.getElementById(id + "_requiredform_id_temp").value;
310
- }
311
- if (document.getElementById(id + "_uniqueform_id_temp")) {
312
- w_unique = document.getElementById(id + "_uniqueform_id_temp").value;
313
- }
314
- if (document.getElementById(id + '_label_sectionform_id_temp')) {
315
- w_class = document.getElementById(id + '_label_sectionform_id_temp').getAttribute("class");
316
- if (!w_class) {
317
- w_class = "";
318
- }
319
- }
320
- gen_form_fields();
321
- wdform_row.innerHTML = "%" + id + " - " + l_label + "%";
322
- }
323
- }
324
- }
325
- }
326
- else {
327
- id = wdform_page.childNodes[q].getAttribute("wdid");
328
- w_editor = document.getElementById(id + "_element_sectionform_id_temp").innerHTML;
329
- form_fields += id + "*:*id*:*";
330
- form_fields += "type_section_break" + "*:*type*:*";
331
- form_fields += "custom_" + id + "*:*w_field_label*:*";
332
- form_fields += w_editor + "*:*w_editor*:*";
333
- form_fields += "*:*new_field*:*";
334
- wdform_page.childNodes[q].innerHTML = "%" + id + " - " + "custom_" + id + "%";
335
- }
336
- }
337
- }
338
- }
339
- document.getElementById('label_order_current').value = tox;
340
- for (x = 0; x < l_id_array.length; x++) {
341
- if (l_id_removed[l_id_array[x]]) {
342
- tox = tox + l_id_array[x] + '#**id**#' + l_label_array[x] + '#**label**#' + l_type_array[x] + '#****#';
343
- }
344
- }
345
- document.getElementById('label_order').value = tox;
346
- document.getElementById('form_fields').value = form_fields;
347
- refresh_();
348
- document.getElementById('pagination').value=document.getElementById('pages').getAttribute("type");
349
- document.getElementById('show_title').value=document.getElementById('pages').getAttribute("show_title");
350
- document.getElementById('show_numbers').value=document.getElementById('pages').getAttribute("show_numbers");
351
- return true;
352
- }
353
-
354
- gen = <?php echo (($id != 0) ? $row->counter : 1); ?>;
355
-
356
- function enable() {
357
- alltypes = Array('customHTML', 'text', 'checkbox', 'radio', 'time_and_date', 'select', 'file_upload', 'captcha', 'map', 'button', 'page_break', 'section_break', 'paypal', 'survey');
358
- for (x = 0; x < 14; x++) {
359
- document.getElementById('img_' + alltypes[x]).src = "<?php echo WD_FMC_URL . '/images/'; ?>" + alltypes[x] + ".png";
360
- }
361
- if (document.getElementById('formMakerDiv').style.display == 'block') {
362
- jQuery('#formMakerDiv').slideToggle(200);
363
- }
364
- else {
365
- jQuery('#formMakerDiv').slideToggle(400);
366
- }
367
- if (document.getElementById('formMakerDiv').offsetWidth) {
368
- document.getElementById('formMakerDiv1').style.width = (document.getElementById('formMakerDiv').offsetWidth - 60) + 'px';
369
- }
370
- if (document.getElementById('formMakerDiv1').style.display == 'block') {
371
- jQuery('#formMakerDiv1').slideToggle(200);
372
- }
373
- else {
374
- jQuery('#formMakerDiv1').slideToggle(400);
375
- }
376
- document.getElementById('when_edit').style.display = 'none';
377
- }
378
-
379
- function enable2() {
380
- alltypes = Array('customHTML', 'text', 'checkbox', 'radio', 'time_and_date', 'select', 'file_upload', 'captcha', 'map', 'button', 'page_break', 'section_break', 'paypal', 'survey');
381
- for (x = 0; x < 14; x++) {
382
- document.getElementById('img_' + alltypes[x]).src = "<?php echo WD_FMC_URL . '/images/'; ?>" + alltypes[x] + ".png";
383
- }
384
- if (document.getElementById('formMakerDiv').style.display == 'block') {
385
- jQuery('#formMakerDiv').slideToggle(200);
386
- }
387
- else {
388
- jQuery('#formMakerDiv').slideToggle(400);
389
- }
390
- if (document.getElementById('formMakerDiv').offsetWidth) {
391
- document.getElementById('formMakerDiv1').style.width = (document.getElementById('formMakerDiv').offsetWidth - 60) + 'px';
392
- }
393
- if (document.getElementById('formMakerDiv1').style.display == 'block') {
394
- jQuery('#formMakerDiv1').slideToggle(200);
395
- }
396
- else {
397
- jQuery('#formMakerDiv1').slideToggle(400);
398
- }
399
- document.getElementById('when_edit').style.display = 'block';
400
- if (document.getElementById('field_types').offsetWidth) {
401
- document.getElementById('when_edit').style.width = document.getElementById('field_types').offsetWidth + 'px';
402
- }
403
- if (document.getElementById('field_types').offsetHeight) {
404
- document.getElementById('when_edit').style.height = document.getElementById('field_types').offsetHeight + 'px';
405
- }
406
- }
407
- </script>
408
- <div style="clear: both; float: left; width: 99%;">
409
- <div style="float:left; font-size: 14px; font-weight: bold;">
410
- This section allows you to add fields to your form.
411
- <a style="color: blue; text-decoration: none;" target="_blank" href="http://web-dorado.com/wordpress-form-maker-guide-4.html">Read More in User Manual</a>
412
- </div>
413
- <div style="float: right; text-align: right;">
414
- <a style="text-decoration: none;" target="_blank" href="http://web-dorado.com/files/fromContactForm.php">
415
- <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FMC_URL . '/images/wd_logo.png'; ?>" />
416
- </a>
417
- </div>
418
- </div>
419
- <form class="wrap" id="manage_form" method="post" action="admin.php?page=manage_fmc" style="float: left; width: 99%;">
420
- <h2><?php echo $page_title; ?></h2>
421
- <div style="float: right; margin: 0 5px 0 0;">
422
- <input class="button-primary" type="submit" onclick="if (spider_check_required('title', 'Form title') || !submitbutton()) {return false;}; spider_set_input_value('task', 'form_options');" value="Form Options"/>
423
- <input class="button-primary" type="submit" onclick="if (spider_check_required('title', 'Form title') || !submitbutton()) {return false;}; spider_set_input_value('task', 'form_layout');" value="Form Layout"/>
424
- <?php
425
- if ($id) {
426
- ?>
427
- <input class="button-secondary" type="submit" onclick="if (spider_check_required('title', 'Form title') || !submitbutton()) {return false;}; spider_set_input_value('task', 'save_as_copy')" value="Save as Copy"/>
428
- <?php
429
- }
430
- ?>
431
- <input class="button-secondary" type="submit" onclick="if (spider_check_required('title', 'Form title') || !submitbutton()) {return false;}; spider_set_input_value('task', 'save')" value="Save"/>
432
- <input class="button-secondary" type="submit" onclick="if (spider_check_required('title', 'Form title') || !submitbutton()) {return false;}; spider_set_input_value('task', 'apply');" value="Apply"/>
433
- <input class="button-secondary" type="submit" onclick="spider_set_input_value('task', 'cancel')" value="Cancel"/>
434
- </div>
435
-
436
- <div class="formmaker_table" width="100%">
437
- <div style="float: left; text-align: left;"><br />
438
- <span class="cfm_logo cfm_black">Contact</span>
439
- <span class="cfm_logo cfm_white">Form</span>
440
- <span class="cfm_logo cfm_black">Maker</span><br /><br />
441
- <img src="<?php echo WD_FMC_URL . '/images/logo.png'; ?>" />
442
- </div>
443
- <div style="float:right">
444
- <span style="font-size: 16.76pt; font-family: tahoma; color: #FFFFFF; vertical-align: middle;">Form title:&nbsp;&nbsp;</span>
445
- <input id="title" name="title" class="form_maker_title" value="<?php echo $row->title; ?>"/>
446
- <br />
447
- <img src="<?php echo WD_FMC_URL . '/images/formoptions.png'; ?>" onclick="if (spider_check_required('title', 'Form title') || !submitbutton()) {return false;}; spider_set_input_value('task', 'form_options'); spider_form_submit(event, 'manage_form');" style="cursor: pointer; margin: 10px 0 10px 10px; float: right;"/>
448
- <br /><br /><br />
449
- <img src="<?php echo WD_FMC_URL . '/images/addanewfield.png'; ?>" onclick=" enable(); Enable(); " style="cursor: pointer; margin:10px 0 10px 10px; float: right;"/>
450
- </div>
451
- </div>
452
-
453
- <div id="formMakerDiv" onclick="close_window()"></div>
454
- <div id="formMakerDiv1" style="padding-top: 20px;" align="center">
455
- <table border="0" width="100%" cellpadding="0" cellspacing="0" height="100%" style="border: 6px #00aeef solid; background-color: #FFF;">
456
- <tr>
457
- <td style="padding:0px">
458
- <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
459
- <tr valign="top">
460
- <td width="15%" height="100%" style="border-right: dotted black 1px;" id="field_types">
461
- <div id="when_edit" style="display: none;"></div>
462
- <table border="0" cellpadding="0" cellspacing="3" width="100%">
463
- <tr>
464
- <td align="center" onClick="addRow('customHTML')" style="cursor:pointer" id="table_editor" class="field_buttons">
465
- <img src="<?php echo WD_FMC_URL . '/images/customHTML.png'; ?>" style="margin:5px" id="img_customHTML"/>
466
- </td>
467
- <td align="center" onClick="addRow('text')" style="cursor:pointer" id="table_text" class="field_buttons">
468
- <img src="<?php echo WD_FMC_URL . '/images/text.png'; ?>" style="margin:5px" id="img_text"/>
469
- </td>
470
- </tr>
471
- <tr>
472
- <td align="center" onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" id="table_checkbox" class="field_buttons">
473
- <img src="<?php echo WD_FMC_URL . '/images/checkbox.png'; ?>" style="margin:5px" id="img_checkbox"/>
474
- </td>
475
- <td align="center" onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" id="table_radio" class="field_buttons">
476
- <img src="<?php echo WD_FMC_URL . '/images/radio.png'; ?>" style="margin:5px" id="img_radio"/>
477
- </td>
478
- </tr>
479
- <tr>
480
- <td align="center" onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" class="field_buttons" id="table_survey">
481
- <img src="<?php echo WD_FMC_URL . '/images/survey.png'; ?>" style="margin:5px" id="img_survey"/>
482
- </td>
483
- <td align="center" onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" id="table_time_and_date" class="field_buttons">
484
- <img src="<?php echo WD_FMC_URL . '/images/time_and_date.png'; ?>" style="margin:5px" id="img_time_and_date"/>
485
- </td>
486
- </tr>
487
- <tr>
488
- <td align="center" onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" id="table_select" class="field_buttons">
489
- <img src="<?php echo WD_FMC_URL . '/images/select.png'; ?>" style="margin:5px" id="img_select"/>
490
- </td>
491
- <td align="center" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" id="table_file_upload" class="field_buttons"
492
- onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')">
493
- <img src="<?php echo WD_FMC_URL . '/images/file_upload.png'; ?>" style="margin:5px" id="img_file_upload" />
494
- </td>
495
- </tr>
496
- <tr>
497
- <td align="center" onClick="addRow('section_break')" style="cursor:pointer" id="table_section_break" class="field_buttons">
498
- <img src="<?php echo WD_FMC_URL . '/images/section_break.png'; ?>" style="margin:5px" id="img_section_break"/>
499
- </td>
500
- <td align="center" onClick="addRow('page_break')" style="cursor:pointer" id="table_page_break" class="field_buttons">
501
- <img src="<?php echo WD_FMC_URL . '/images/page_break.png'; ?>" style="margin:5px" id="img_page_break"/>
502
- </td>
503
- </tr>
504
- <tr>
505
- <td align="center" id="table_map" class="field_buttons" onClick="addRow('map')">
506
- <img src="<?php echo WD_FMC_URL . '/images/map.png'; ?>" style="margin:5px" id="img_map" />
507
- </td>
508
- <td align="center" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" id="table_paypal" class="field_buttons"
509
- onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')">
510
- <img src="<?php echo WD_FMC_URL . '/images/paypal.png'; ?>" style="margin:5px" id="img_paypal" />
511
- </td>
512
- </tr>
513
- <tr>
514
- <td align="center" onClick="addRow('captcha')" style="cursor:pointer" id="table_captcha" class="field_buttons">
515
- <img src="<?php echo WD_FMC_URL . '/images/captcha.png'; ?>" style="margin:5px" id="img_captcha"/>
516
- </td>
517
- <td align="center" onClick="addRow('button')" id="table_button" class="field_buttons">
518
- <img src="<?php echo WD_FMC_URL . '/images/button.png'; ?>" style="margin:5px" id="img_button"/>
519
- </td>
520
- </tr>
521
- </table>
522
- </td>
523
- <td width="35%" height="100%" align="left">
524
- <div id="edit_table" style="padding:0px; overflow-y:scroll; height:575px"></div>
525
- </td>
526
- <td align="center" valign="top" style="background: url("<?php echo WD_FMC_URL . '/images/border2.png'; ?>") repeat-y;">&nbsp;</td>
527
- <td style="padding:15px">
528
- <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
529
- <tr>
530
- <td align="right">
531
- <input type="radio" value="end" name="el_pos" checked="checked" id="pos_end" onclick="Disable()"/>
532
- At The End
533
- <input type="radio" value="begin" name="el_pos" id="pos_begin" onclick="Disable()"/>
534
- At The Beginning
535
- <input type="radio" value="before" name="el_pos" id="pos_before" onclick="Enable()"/>
536
- Before
537
- <select style="width: 100px; margin-left: 5px;" id="sel_el_pos" onclick="change_before()" disabled="disabled"></select>
538
- <img alt="ADD" title="add" style="cursor:pointer; vertical-align:middle; margin:5px" src="<?php echo WD_FMC_URL . '/images/save.png'; ?>" onClick="add(0)"/>
539
- <img alt="CANCEL" title="cancel" style="cursor: pointer; vertical-align:middle; margin:5px" src="<?php echo WD_FMC_URL . '/images/cancel_but.png'; ?>" onClick="close_window()"/>
540
- <hr style=" margin-bottom:10px" />
541
- </td>
542
- </tr>
543
- <tr height="100%" valign="top">
544
- <td id="show_table"></td>
545
- </tr>
546
- </table>
547
- </td>
548
- </tr>
549
- </table>
550
- </td>
551
- </tr>
552
- </table>
553
- <input type="hidden" id="old" />
554
- <input type="hidden" id="old_selected" />
555
- <input type="hidden" id="element_type" />
556
- <input type="hidden" id="editing_id" />
557
- <input type="hidden" value="<?php echo WD_FMC_URL; ?>" id="form_plugins_url" />
558
- <div id="main_editor" style="position: absolute; display: none; z-index: 140;">
559
- <?php
560
- if (user_can_richedit()) {
561
- wp_editor('', 'form_maker_editor', array('teeny' => FALSE, 'textarea_name' => 'form_maker_editor', 'media_buttons' => FALSE, 'textarea_rows' => 5));
562
- }
563
- else {
564
- ?>
565
- <textarea name="form_maker_editor" id="form_maker_editor" cols="40" rows="5" style="width: 440px; height: 350px;" class="mce_editable" aria-hidden="true"></textarea>
566
- <?php
567
- }
568
- ?>
569
- </div>
570
- </div>
571
- <?php
572
- if (!function_exists('the_editor')) {
573
- ?>
574
- <iframe id="tinymce" style="display: none;"></iframe>
575
- <?php
576
- }
577
- ?>
578
- <br /><br />
579
- <fieldset>
580
- <legend><h2 style="color: #00aeef;">Form</h2></legend>
581
- <div id="saving" style="display:none;">
582
- <div id="saving_text">Saving</div>
583
- <div id="fadingBarsG">
584
- <div id="fadingBarsG_1" class="fadingBarsG"></div>
585
- <div id="fadingBarsG_2" class="fadingBarsG"></div>
586
- <div id="fadingBarsG_3" class="fadingBarsG"></div>
587
- <div id="fadingBarsG_4" class="fadingBarsG"></div>
588
- <div id="fadingBarsG_5" class="fadingBarsG"></div>
589
- <div id="fadingBarsG_6" class="fadingBarsG"></div>
590
- <div id="fadingBarsG_7" class="fadingBarsG"></div>
591
- <div id="fadingBarsG_8" class="fadingBarsG"></div>
592
- </div>
593
- </div>
594
- <?php
595
- if ($id) {
596
- ?>
597
- <div style="margin: 8px; display: table; width: 100%;" id="page_bar">
598
- <div id="page_navigation" style="display: table-row;">
599
- <div align="center" id="pages" show_title="<?php echo $row->show_title; ?>" show_numbers="<?php echo $row->show_numbers; ?>" type="<?php echo $row->pagination; ?>" style="display: table-cell; width:90%;"></div>
600
- <div align="left" id="edit_page_navigation" style="display: table-cell; vertical-align: middle;"></div>
601
- </div>
602
- </div>
603
- <div id="take" class="main">
604
- <?php
605
- echo $row->form_front;
606
- ?>
607
- </div>
608
- <?php
609
- }
610
- else {
611
- ?>
612
- <div style="margin:8px; display:table; width:100%" id="page_bar">
613
- <div id="page_navigation" style="display:table-row">
614
- <div align="center" id="pages" show_title="false" show_numbers="true" type="none" style="display:table-cell; width:90%"></div>
615
- <div align="left" id="edit_page_navigation" style="display:table-cell; vertical-align: middle;"></div>
616
- </div>
617
- </div>
618
- <div id="take" class="main">
619
- <div class="wdform-page-and-images" style="display:table; border-top:0px solid black;">
620
- <div id="form_id_tempform_view1" class="wdform_page" page_title="Untitled page" next_title="Next" next_type="text" next_class="wdform-page-button" next_checkable="false" previous_title="Previous" previous_type="text" previous_class="wdform-page-button" previous_checkable="false">
621
- <div class="wdform_section"><div class="wdform_column"></div></div>
622
- <div valign="top" class="wdform_footer" style="width: 100%;">
623
- <div style="width: 100%;">
624
- <div style="width: 100%; display: table;">
625
- <div style="display: table-row-group;">
626
- <div id="form_id_temppage_nav1" style="display: table-row;"></div>
627
- </div>
628
- </div>
629
- </div>
630
- </div>
631
- </div>
632
- <div id="form_id_tempform_view_img1" style="float: right;">
633
- <div>
634
- <img src="<?php echo WD_FMC_URL . '/images/minus.png'; ?>" title="Show or hide the page" class="page_toolbar" onClick="show_or_hide('1')" onMouseOver="chnage_icons_src(this,'minus')" onmouseout="chnage_icons_src(this,'minus')" id="show_page_img_1"/>
635
- <img src="<?php echo WD_FMC_URL . '/images/page_delete.png'; ?>" title="Delete the page" class="page_toolbar" onClick="remove_page('1')" onMouseOver="chnage_icons_src(this,'page_delete')" onmouseout="chnage_icons_src(this,'page_delete')"/>
636
- <img src="<?php echo WD_FMC_URL . '/images/page_delete_all.png'; ?>" title="Delete the page with fields" class="page_toolbar" onClick="remove_page_all('1')" onMouseOver="chnage_icons_src(this,'page_delete_all')" onmouseout="chnage_icons_src(this,'page_delete_all')"/>
637
- <img src="<?php echo WD_FMC_URL . '/images/page_edit.png'; ?>" title="Edit the page" class="page_toolbar" onClick="edit_page_break('1')" onMouseOver="chnage_icons_src(this,'page_edit')" onmouseout="chnage_icons_src(this,'page_edit')"/>
638
- </div>
639
- </div>
640
- </div>
641
- </div>
642
- <?php
643
- }
644
- ?>
645
- </fieldset>
646
- <input type="hidden" name="form_front" id="form_front" />
647
- <input type="hidden" name="form_fields" id="form_fields" />
648
- <input type="hidden" name="pagination" id="pagination" />
649
- <input type="hidden" name="show_title" id="show_title" />
650
- <input type="hidden" name="show_numbers" id="show_numbers" />
651
- <input type="hidden" name="public_key" id="public_key" />
652
- <input type="hidden" name="private_key" id="private_key" />
653
- <input type="hidden" name="recaptcha_theme" id="recaptcha_theme" />
654
- <input type="hidden" id="label_order" name="label_order" value="<?php echo $row->label_order; ?>" />
655
- <input type="hidden" id="label_order_current" name="label_order_current" value="<?php echo $row->label_order_current; ?>" />
656
- <input type="hidden" name="counter" id="counter" value="<?php echo $row->counter; ?>" />
657
- <input type="hidden" id="araqel" value="0" />
658
- <?php
659
- if ($id) {
660
- ?>
661
- <script type="text/javascript">
662
- function formOnload() {
663
- // Enable maps.
664
- for (t = 0; t < <?php echo $row->counter; ?>; t++) {
665
- if (document.getElementById(t + "_typeform_id_temp")) {
666
- if (document.getElementById(t + "_typeform_id_temp").value == "type_map" || document.getElementById(t + "_typeform_id_temp").value == "type_mark_map") {
667
- if_gmap_init(t);
668
- for (q = 0; q < 20; q++) {
669
- if (document.getElementById(t + "_elementform_id_temp").getAttribute("long" + q)) {
670
- w_long = parseFloat(document.getElementById(t + "_elementform_id_temp").getAttribute("long" + q));
671
- w_lat = parseFloat(document.getElementById(t + "_elementform_id_temp").getAttribute("lat" + q));
672
- w_info = parseFloat(document.getElementById(t + "_elementform_id_temp").getAttribute("info" + q));
673
- add_marker_on_map(t, q, w_long, w_lat, w_info, false);
674
- }
675
- }
676
- }
677
- else if (document.getElementById(t + "_typeform_id_temp").value == "type_date") {
678
- // Calendar.setup({
679
- // inputField:t + "_elementform_id_temp",
680
- // ifFormat:document.getElementById(t + "_buttonform_id_temp").getAttribute('format'),
681
- // button:t + "_buttonform_id_temp",
682
- // align:"Tl",
683
- // singleClick:true,
684
- // firstDay:0
685
- // });
686
- }
687
- else if (document.getElementById(t + "_typeform_id_temp").value == "type_name") {
688
- var myu = t;
689
- jQuery(document).ready(function () {
690
- jQuery("#" + myu + "_mini_label_first").click(function () {
691
- if (jQuery(this).children('input').length == 0) {
692
- var first = "<input type='text' id='first' class='first' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
693
- jQuery(this).html(first);
694
- jQuery("input.first").focus();
695
- jQuery("input.first").blur(function () {
696
- var id_for_blur = document.getElementById('first').parentNode.id.split('_');
697
- var value = jQuery(this).val();
698
- jQuery("#" + id_for_blur[0] + "_mini_label_first").text(value);
699
- });
700
- }
701
- });
702
- jQuery("label#" + myu + "_mini_label_last").click(function () {
703
- if (jQuery(this).children('input').length == 0) {
704
- var last = "<input type='text' id='last' class='last' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
705
- jQuery(this).html(last);
706
- jQuery("input.last").focus();
707
- jQuery("input.last").blur(function () {
708
- var id_for_blur = document.getElementById('last').parentNode.id.split('_');
709
- var value = jQuery(this).val();
710
- jQuery("#" + id_for_blur[0] + "_mini_label_last").text(value);
711
- });
712
- }
713
- });
714
- jQuery("label#" + myu + "_mini_label_title").click(function () {
715
- if (jQuery(this).children('input').length == 0) {
716
- var title_ = "<input type='text' id='title_' class='title_' style='outline:none; border:none; background:none; width:50px;' value=\"" + jQuery(this).text() + "\">";
717
- jQuery(this).html(title_);
718
- jQuery("input.title_").focus();
719
- jQuery("input.title_").blur(function () {
720
- var id_for_blur = document.getElementById('title_').parentNode.id.split('_');
721
- var value = jQuery(this).val();
722
- jQuery("#" + id_for_blur[0] + "_mini_label_title").text(value);
723
- });
724
- }
725
- });
726
- jQuery("label#" + myu + "_mini_label_middle").click(function () {
727
- if (jQuery(this).children('input').length == 0) {
728
- var middle = "<input type='text' id='middle' class='middle' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
729
- jQuery(this).html(middle);
730
- jQuery("input.middle").focus();
731
- jQuery("input.middle").blur(function () {
732
- var id_for_blur = document.getElementById('middle').parentNode.id.split('_');
733
- var value = jQuery(this).val();
734
- jQuery("#" + id_for_blur[0] + "_mini_label_middle").text(value);
735
- });
736
- }
737
- });
738
- });
739
- }
740
- else if (document.getElementById(t + "_typeform_id_temp").value == "type_phone") {
741
- var myu = t;
742
- jQuery(document).ready(function () {
743
- jQuery("label#" + myu + "_mini_label_area_code").click(function () {
744
- if (jQuery(this).children('input').length == 0) {
745
- var area_code = "<input type='text' id='area_code' class='area_code' size='10' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
746
- jQuery(this).html(area_code);
747
- jQuery("input.area_code").focus();
748
- jQuery("input.area_code").blur(function () {
749
- var id_for_blur = document.getElementById('area_code').parentNode.id.split('_');
750
- var value = jQuery(this).val();
751
- jQuery("#" + id_for_blur[0] + "_mini_label_area_code").text(value);
752
- });
753
- }
754
- });
755
- jQuery("label#" + myu + "_mini_label_phone_number").click(function () {
756
- if (jQuery(this).children('input').length == 0) {
757
- var phone_number = "<input type='text' id='phone_number' class='phone_number' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
758
- jQuery(this).html(phone_number);
759
- jQuery("input.phone_number").focus();
760
- jQuery("input.phone_number").blur(function () {
761
- var id_for_blur = document.getElementById('phone_number').parentNode.id.split('_');
762
- var value = jQuery(this).val();
763
- jQuery("#" + id_for_blur[0] + "_mini_label_phone_number").text(value);
764
- });
765
- }
766
- });
767
- });
768
- }
769
- else if (document.getElementById(t + "_typeform_id_temp").value == "type_date_fields") {
770
- var myu = t;
771
- jQuery(document).ready(function () {
772
- jQuery("label#" + myu + "_day_label").click(function () {
773
- if (jQuery(this).children('input').length == 0) {
774
- var day = "<input type='text' id='day' class='day' size='8' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
775
- jQuery(this).html(day);
776
- jQuery("input.day").focus();
777
- jQuery("input.day").blur(function () {
778
- var id_for_blur = document.getElementById('day').parentNode.id.split('_');
779
- var value = jQuery(this).val();
780
- jQuery("#" + id_for_blur[0] + "_day_label").text(value);
781
- });
782
- }
783
- });
784
- jQuery("label#" + myu + "_month_label").click(function () {
785
- if (jQuery(this).children('input').length == 0) {
786
- var month = "<input type='text' id='month' class='month' size='8' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
787
- jQuery(this).html(month);
788
- jQuery("input.month").focus();
789
- jQuery("input.month").blur(function () {
790
- var id_for_blur = document.getElementById('month').parentNode.id.split('_');
791
- var value = jQuery(this).val();
792
- jQuery("#" + id_for_blur[0] + "_month_label").text(value);
793
- });
794
- }
795
- });
796
- jQuery("label#" + myu + "_year_label").click(function () {
797
- if (jQuery(this).children('input').length == 0) {
798
- var year = "<input type='text' id='year' class='year' size='8' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
799
- jQuery(this).html(year);
800
- jQuery("input.year").focus();
801
- jQuery("input.year").blur(function () {
802
- var id_for_blur = document.getElementById('year').parentNode.id.split('_');
803
- var value = jQuery(this).val();
804
- jQuery("#" + id_for_blur[0] + "_year_label").text(value);
805
- });
806
- }
807
- });
808
- });
809
- }
810
- else if (document.getElementById(t + "_typeform_id_temp").value == "type_time") {
811
- var myu = t;
812
- jQuery(document).ready(function () {
813
- jQuery("label#" + myu + "_mini_label_hh").click(function () {
814
- if (jQuery(this).children('input').length == 0) {
815
- var hh = "<input type='text' id='hh' class='hh' size='4' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
816
- jQuery(this).html(hh);
817
- jQuery("input.hh").focus();
818
- jQuery("input.hh").blur(function () {
819
- var id_for_blur = document.getElementById('hh').parentNode.id.split('_');
820
- var value = jQuery(this).val();
821
- jQuery("#" + id_for_blur[0] + "_mini_label_hh").text(value);
822
- });
823
- }
824
- });
825
- jQuery("label#" + myu + "_mini_label_mm").click(function () {
826
- if (jQuery(this).children('input').length == 0) {
827
- var mm = "<input type='text' id='mm' class='mm' size='4' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
828
- jQuery(this).html(mm);
829
- jQuery("input.mm").focus();
830
- jQuery("input.mm").blur(function () {
831
- var id_for_blur = document.getElementById('mm').parentNode.id.split('_');
832
- var value = jQuery(this).val();
833
- jQuery("#" + id_for_blur[0] + "_mini_label_mm").text(value);
834
- });
835
- }
836
- });
837
- jQuery("label#" + myu + "_mini_label_ss").click(function () {
838
- if (jQuery(this).children('input').length == 0) {
839
- var ss = "<input type='text' id='ss' class='ss' size='4' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
840
- jQuery(this).html(ss);
841
- jQuery("input.ss").focus();
842
- jQuery("input.ss").blur(function () {
843
- var id_for_blur = document.getElementById('ss').parentNode.id.split('_');
844
- var value = jQuery(this).val();
845
- jQuery("#" + id_for_blur[0] + "_mini_label_ss").text(value);
846
- });
847
- }
848
- });
849
- jQuery("label#" + myu + "_mini_label_am_pm").click(function () {
850
- if (jQuery(this).children('input').length == 0) {
851
- var am_pm = "<input type='text' id='am_pm' class='am_pm' size='4' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
852
- jQuery(this).html(am_pm);
853
- jQuery("input.am_pm").focus();
854
- jQuery("input.am_pm").blur(function () {
855
- var id_for_blur = document.getElementById('am_pm').parentNode.id.split('_');
856
- var value = jQuery(this).val();
857
- jQuery("#" + id_for_blur[0] + "_mini_label_am_pm").text(value);
858
- });
859
- }
860
- });
861
- });
862
- }
863
- else if (document.getElementById(t + "_typeform_id_temp").value == "type_paypal_price") {
864
- var myu = t;
865
- jQuery(document).ready(function () {
866
- jQuery("#" + myu + "_mini_label_dollars").click(function () {
867
- if (jQuery(this).children('input').length == 0) {
868
- var dollars = "<input type='text' id='dollars' class='dollars' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
869
- jQuery(this).html(dollars);
870
- jQuery("input.dollars").focus();
871
- jQuery("input.dollars").blur(function () {
872
- var id_for_blur = document.getElementById('dollars').parentNode.id.split('_');
873
- var value = jQuery(this).val();
874
- jQuery("#" + id_for_blur[0] + "_mini_label_dollars").text(value);
875
- });
876
- }
877
- });
878
- jQuery("label#" + myu + "_mini_label_cents").click(function () {
879
- if (jQuery(this).children('input').length == 0) {
880
- var cents = "<input type='text' id='cents' class='cents' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
881
- jQuery(this).html(cents);
882
- jQuery("input.cents").focus();
883
- jQuery("input.cents").blur(function () {
884
- var id_for_blur = document.getElementById('cents').parentNode.id.split('_');
885
- var value = jQuery(this).val();
886
- jQuery("#" + id_for_blur[0] + "_mini_label_cents").text(value);
887
- });
888
- }
889
- });
890
- });
891
- }
892
- else if (document.getElementById(t + "_typeform_id_temp").value == "type_address") {
893
- var myu = t;
894
- jQuery(document).ready(function () {
895
- jQuery("label#" + myu + "_mini_label_street1").click(function () {
896
- if (jQuery(this).children('input').length == 0) {
897
- var street1 = "<input type='text' id='street1' class='street1' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
898
- jQuery(this).html(street1);
899
- jQuery("input.street1").focus();
900
- jQuery("input.street1").blur(function () {
901
- var id_for_blur = document.getElementById('street1').parentNode.id.split('_');
902
- var value = jQuery(this).val();
903
- jQuery("#" + id_for_blur[0] + "_mini_label_street1").text(value);
904
- });
905
- }
906
- });
907
- jQuery("label#" + myu + "_mini_label_street2").click(function () {
908
- if (jQuery(this).children('input').length == 0) {
909
- var street2 = "<input type='text' id='street2' class='street2' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
910
- jQuery(this).html(street2);
911
- jQuery("input.street2").focus();
912
- jQuery("input.street2").blur(function () {
913
- var id_for_blur = document.getElementById('street2').parentNode.id.split('_');
914
- var value = jQuery(this).val();
915
- jQuery("#" + id_for_blur[0] + "_mini_label_street2").text(value);
916
- });
917
- }
918
- });
919
- jQuery("label#" + myu + "_mini_label_city").click(function () {
920
- if (jQuery(this).children('input').length == 0) {
921
- var city = "<input type='text' id='city' class='city' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
922
- jQuery(this).html(city);
923
- jQuery("input.city").focus();
924
- jQuery("input.city").blur(function () {
925
- var id_for_blur = document.getElementById('city').parentNode.id.split('_');
926
- var value = jQuery(this).val();
927
- jQuery("#" + id_for_blur[0] + "_mini_label_city").text(value);
928
- });
929
- }
930
- });
931
- jQuery("label#" + myu + "_mini_label_state").click(function () {
932
- if (jQuery(this).children('input').length == 0) {
933
- var state = "<input type='text' id='state' class='state' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
934
- jQuery(this).html(state);
935
- jQuery("input.state").focus();
936
- jQuery("input.state").blur(function () {
937
- var id_for_blur = document.getElementById('state').parentNode.id.split('_');
938
- var value = jQuery(this).val();
939
- jQuery("#" + id_for_blur[0] + "_mini_label_state").text(value);
940
- });
941
- }
942
- });
943
- jQuery("label#" + myu + "_mini_label_postal").click(function () {
944
- if (jQuery(this).children('input').length == 0) {
945
- var postal = "<input type='text' id='postal' class='postal' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
946
- jQuery(this).html(postal);
947
- jQuery("input.postal").focus();
948
- jQuery("input.postal").blur(function () {
949
- var id_for_blur = document.getElementById('postal').parentNode.id.split('_');
950
- var value = jQuery(this).val();
951
- jQuery("#" + id_for_blur[0] + "_mini_label_postal").text(value);
952
- });
953
- }
954
- });
955
- jQuery("label#" + myu + "_mini_label_country").click(function () {
956
- if (jQuery(this).children('input').length == 0) {
957
- var country = "<input type='country' id='country' class='country' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
958
- jQuery(this).html(country);
959
- jQuery("input.country").focus();
960
- jQuery("input.country").blur(function () {
961
- var id_for_blur = document.getElementById('country').parentNode.id.split('_');
962
- var value = jQuery(this).val();
963
- jQuery("#" + id_for_blur[0] + "_mini_label_country").text(value);
964
- });
965
- }
966
- });
967
- });
968
- }
969
- else if (document.getElementById(t + "_typeform_id_temp").value == "type_scale_rating") {
970
- var myu = t;
971
- jQuery(document).ready(function () {
972
- jQuery("#" + myu + "_mini_label_worst").click(function () {
973
- if (jQuery(this).children('input').length == 0) {
974
- var worst = "<input type='text' id='worst' class='worst' size='6' style='outline:none; border:none; background:none; font-size:11px;' value=\"" + jQuery(this).text() + "\">";
975
- jQuery(this).html(worst);
976
- jQuery("input.worst").focus();
977
- jQuery("input.worst").blur(function () {
978
- var id_for_blur = document.getElementById('worst').parentNode.id.split('_');
979
- var value = jQuery(this).val();
980
- jQuery("#" + id_for_blur[0] + "_mini_label_worst").text(value);
981
- });
982
- }
983
- });
984
- jQuery("label#" + myu + "_mini_label_best").click(function () {
985
- if (jQuery(this).children('input').length == 0) {
986
-
987
- var best = "<input type='text' id='best' class='best' size='6' style='outline:none; border:none; background:none; font-size:11px;' value=\"" + jQuery(this).text() + "\">";
988
- jQuery(this).html(best);
989
- jQuery("input.best").focus();
990
- jQuery("input.best").blur(function () {
991
- var id_for_blur = document.getElementById('best').parentNode.id.split('_');
992
- var value = jQuery(this).val();
993
- jQuery("#" + id_for_blur[0] + "_mini_label_best").text(value);
994
- });
995
- }
996
- });
997
- });
998
- }
999
- else if (document.getElementById(t + "_typeform_id_temp").value == "type_spinner") {
1000
- var spinner_value = document.getElementById(t + "_elementform_id_temp").value;
1001
- var spinner_min_value = document.getElementById(t + "_min_valueform_id_temp").value;
1002
- var spinner_max_value = document.getElementById(t + "_max_valueform_id_temp").value;
1003
- var spinner_step = document.getElementById(t + "_stepform_id_temp").value;
1004
- jQuery("#" + t + "_elementform_id_temp")[0].spin = null;
1005
- spinner = jQuery("#" + t + "_elementform_id_temp").spinner();
1006
- spinner.spinner("value", spinner_value);
1007
- jQuery("#" + t + "_elementform_id_temp").spinner({ min:spinner_min_value});
1008
- jQuery("#" + t + "_elementform_id_temp").spinner({ max:spinner_max_value});
1009
- jQuery("#" + t + "_elementform_id_temp").spinner({ step:spinner_step});
1010
- }
1011
- else if (document.getElementById(t + "_typeform_id_temp").value == "type_slider") {
1012
- var slider_value = document.getElementById(t + "_slider_valueform_id_temp").value;
1013
- var slider_min_value = document.getElementById(t + "_slider_min_valueform_id_temp").value;
1014
- var slider_max_value = document.getElementById(t + "_slider_max_valueform_id_temp").value;
1015
- var slider_element_value = document.getElementById(t + "_element_valueform_id_temp");
1016
- var slider_value_save = document.getElementById(t + "_slider_valueform_id_temp");
1017
- jQuery("#" + t + "_elementform_id_temp")[0].slide = null;
1018
- jQuery(function () {
1019
- jQuery("#" + t + "_elementform_id_temp").slider({
1020
- range:"min",
1021
- value:eval(slider_value),
1022
- min:eval(slider_min_value),
1023
- max:eval(slider_max_value),
1024
- slide:function (event, ui) {
1025
- slider_element_value.innerHTML = "" + ui.value;
1026
- slider_value_save.value = "" + ui.value;
1027
- }
1028
- });
1029
- });
1030
- }
1031
- else if (document.getElementById(t + "_typeform_id_temp").value == "type_range") {
1032
- var spinner_value0 = document.getElementById(t + "_elementform_id_temp0").value;
1033
- var spinner_step = document.getElementById(t + "_range_stepform_id_temp").value;
1034
- jQuery("#" + t + "_elementform_id_temp0")[0].spin = null;
1035
- jQuery("#" + t + "_elementform_id_temp1")[0].spin = null;
1036
- spinner0 = jQuery("#" + t + "_elementform_id_temp0").spinner();
1037
- spinner0.spinner("value", spinner_value0);
1038
- jQuery("#" + t + "_elementform_id_temp0").spinner({ step:spinner_step});
1039
- var spinner_value1 = document.getElementById(t + "_elementform_id_temp1").value;
1040
- spinner1 = jQuery("#" + t + "_elementform_id_temp1").spinner();
1041
- spinner1.spinner("value", spinner_value1);
1042
- jQuery("#" + t + "_elementform_id_temp1").spinner({ step:spinner_step});
1043
- var myu = t;
1044
- jQuery(document).ready(function () {
1045
- jQuery("#" + myu + "_mini_label_from").click(function () {
1046
- if (jQuery(this).children('input').length == 0) {
1047
- var from = "<input type='text' id='from' class='from' size='6' style='outline:none; border:none; background:none; font-size:11px;' value=\"" + jQuery(this).text() + "\">";
1048
- jQuery(this).html(from);
1049
- jQuery("input.from").focus();
1050
- jQuery("input.from").blur(function () {
1051
- var id_for_blur = document.getElementById('from').parentNode.id.split('_');
1052
- var value = jQuery(this).val();
1053
- jQuery("#" + id_for_blur[0] + "_mini_label_from").text(value);
1054
- });
1055
- }
1056
- });
1057
- jQuery("label#" + myu + "_mini_label_to").click(function () {
1058
- if (jQuery(this).children('input').length == 0) {
1059
- var to = "<input type='text' id='to' class='to' size='6' style='outline:none; border:none; background:none; font-size:11px;' value=\"" + jQuery(this).text() + "\">";
1060
- jQuery(this).html(to);
1061
- jQuery("input.to").focus();
1062
- jQuery("input.to").blur(function () {
1063
- var id_for_blur = document.getElementById('to').parentNode.id.split('_');
1064
- var value = jQuery(this).val();
1065
- jQuery("#" + id_for_blur[0] + "_mini_label_to").text(value);
1066
- });
1067
- }
1068
- });
1069
- });
1070
- }
1071
- }
1072
- }
1073
- remove_whitespace(document.getElementById('take'));
1074
- form_view = 1;
1075
- form_view_count = 0;
1076
- for (i = 1; i <= 30; i++) {
1077
- if (document.getElementById('form_id_tempform_view' + i)) {
1078
- form_view_count++;
1079
- form_view_max = i;
1080
- tbody_img = document.createElement('div');
1081
- tbody_img.setAttribute('id', 'form_id_tempform_view_img' + i);
1082
- tbody_img.style.cssText = "float:right";
1083
- tr_img = document.createElement('div');
1084
- var img = document.createElement('img');
1085
- img.setAttribute('src', '<?php echo WD_FMC_URL; ?>/images/minus.png');
1086
- img.setAttribute('title', 'Show or hide the page');
1087
- img.setAttribute("class", "page_toolbar");
1088
- img.setAttribute('id', 'show_page_img_' + i);
1089
- img.setAttribute('onClick', 'show_or_hide("' + i + '")');
1090
- img.setAttribute("onmouseover", 'chnage_icons_src(this,"minus")');
1091
- img.setAttribute("onmouseout", 'chnage_icons_src(this,"minus")');
1092
- var img_X = document.createElement("img");
1093
- img_X.setAttribute("src", "<?php echo WD_FMC_URL; ?>/images/page_delete.png");
1094
- img_X.setAttribute('title', 'Delete the page');
1095
- img_X.setAttribute("class", "page_toolbar");
1096
- img_X.setAttribute("onclick", 'remove_page("' + i + '")');
1097
- img_X.setAttribute("onmouseover", 'chnage_icons_src(this,"page_delete")');
1098
- img_X.setAttribute("onmouseout", 'chnage_icons_src(this,"page_delete")');
1099
- var img_X_all = document.createElement("img");
1100
- img_X_all.setAttribute("src", "<?php echo WD_FMC_URL; ?>/images/page_delete_all.png");
1101
- img_X_all.setAttribute('title', 'Delete the page with fields');
1102
- img_X_all.setAttribute("class", "page_toolbar");
1103
- img_X_all.setAttribute("onclick", 'remove_page_all("' + i + '")');
1104
- img_X_all.setAttribute("onmouseover", 'chnage_icons_src(this,"page_delete_all")');
1105
- img_X_all.setAttribute("onmouseout", 'chnage_icons_src(this,"page_delete_all")');
1106
- var img_EDIT = document.createElement("img");
1107
- img_EDIT.setAttribute("src", "<?php echo WD_FMC_URL; ?>/images/page_edit.png");
1108
- img_EDIT.setAttribute('title', 'Edit the page');
1109
- img_EDIT.setAttribute("class", "page_toolbar");
1110
- img_EDIT.setAttribute("onclick", 'edit_page_break("' + i + '")');
1111
- img_EDIT.setAttribute("onmouseover", 'chnage_icons_src(this,"page_edit")');
1112
- img_EDIT.setAttribute("onmouseout", 'chnage_icons_src(this,"page_edit")');
1113
- tr_img.appendChild(img);
1114
- tr_img.appendChild(img_X);
1115
- tr_img.appendChild(img_X_all);
1116
- tr_img.appendChild(img_EDIT);
1117
- tbody_img.appendChild(tr_img);
1118
- document.getElementById('form_id_tempform_view' + i).parentNode.appendChild(tbody_img);
1119
- }
1120
- }
1121
- if (form_view_count > 1) {
1122
- for (i = 1; i <= form_view_max; i++) {
1123
- if (document.getElementById('form_id_tempform_view' + i)) {
1124
- first_form_view = i;
1125
- break;
1126
- }
1127
- }
1128
- form_view = form_view_max;
1129
- need_enable = false;
1130
- generate_page_nav(first_form_view);
1131
- var img_EDIT = document.createElement("img");
1132
- img_EDIT.setAttribute("src", "<?php echo WD_FMC_URL . '/images/edit.png'; ?>");
1133
- img_EDIT.style.cssText = "margin-left:40px; cursor:pointer";
1134
- img_EDIT.setAttribute("onclick", 'el_page_navigation()');
1135
- var td_EDIT = document.getElementById("edit_page_navigation");
1136
- td_EDIT.appendChild(img_EDIT);
1137
- document.getElementById('page_navigation').appendChild(td_EDIT);
1138
- }
1139
- document.getElementById('araqel').value = 1;
1140
- }
1141
- jQuery(window).load(function () {
1142
- formOnload();
1143
- });
1144
- </script>
1145
- <?php
1146
- }
1147
- ?>
1148
-
1149
- <input type="hidden" name="option" value="com_formmaker" />
1150
- <input type="hidden" name="id" value="<?php echo $row->id; ?>" />
1151
- <input type="hidden" name="cid[]" value="<?php echo $row->id; ?>" />
1152
-
1153
- <input type="hidden" id="task" name="task" value=""/>
1154
- <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
1155
- </form>
1156
- <?php
1157
- }
1158
-
1159
- public function edit_old($id) {
1160
- // header("X-XSS-Protection: 0");
1161
- $row = $this->model->get_row_data($id);
1162
- $themes = $this->model->get_theme_rows_data('old');
1163
- $labels = array();
1164
- $label_id = array();
1165
- $label_order_original = array();
1166
- $label_type = array();
1167
- $label_all = explode('#****#', $row->label_order);
1168
- $label_all = array_slice($label_all, 0, count($label_all) - 1);
1169
- foreach ($label_all as $key => $label_each) {
1170
- $label_id_each = explode('#**id**#', $label_each);
1171
- array_push($label_id, $label_id_each[0]);
1172
- $label_oder_each = explode('#**label**#', $label_id_each[1]);
1173
- array_push($label_order_original, addslashes($label_oder_each[0]));
1174
- array_push($label_type, $label_oder_each[1]);
1175
- }
1176
- $labels['id'] = '"' . implode('","', $label_id) . '"';
1177
- $labels['label'] = '"' . implode('","', $label_order_original) . '"';
1178
- $labels['type'] = '"' . implode('","', $label_type) . '"';
1179
-
1180
- $page_title = (($id != 0) ? 'Edit form ' . $row->title : 'Create new form');
1181
- ?>
1182
- <script type="text/javascript">
1183
- var fmc_plugin_url = "<?php echo WD_FMC_URL; ?>";
1184
- </script>
1185
- <script src="<?php echo WD_FMC_URL . '/js/formmaker_free.js'; ?>" type="text/javascript"></script>
1186
- <script type="text/javascript">
1187
- function submitbutton() {
1188
- if (!document.getElementById('araqel') || (document.getElementById('araqel').value == '0')) {
1189
- alert('Please wait while page loading.');
1190
- return false;
1191
- }
1192
- tox = '';
1193
- l_id_array = [<?php echo $labels['id']?>];
1194
- l_label_array = [<?php echo $labels['label']?>];
1195
- l_type_array = [<?php echo $labels['type']?>];
1196
- l_id_removed = [];
1197
- for (x=0; x< l_id_array.length; x++) {
1198
- l_id_removed[l_id_array[x]]=true;
1199
- }
1200
- for (t=1;t<=form_view_max;t++) {
1201
- if (document.getElementById('form_id_tempform_view'+t)) {
1202
- form_view_element=document.getElementById('form_id_tempform_view'+t);
1203
- n=form_view_element.childNodes.length-2;
1204
- for(q=0;q<=n;q++) {
1205
- if (form_view_element.childNodes[q].nodeType!=3) {
1206
- if (!form_view_element.childNodes[q].id) {
1207
- GLOBAL_tr=form_view_element.childNodes[q];
1208
- for (x=0; x < GLOBAL_tr.firstChild.childNodes.length; x++) {
1209
- table=GLOBAL_tr.firstChild.childNodes[x];
1210
- tbody=table.firstChild;
1211
- for (y=0; y < tbody.childNodes.length; y++) {
1212
- is_in_old=false;
1213
- tr=tbody.childNodes[y];
1214
- l_id=tr.id;
1215
- l_label=document.getElementById( tr.id+'_element_labelform_id_temp').innerHTML;
1216
- l_label = l_label.replace(/(\r\n|\n|\r)/gm," ");
1217
- l_type=tr.getAttribute('type');
1218
- for (z = 0; z < l_id_array.length; z++) {
1219
- if (l_id_array[z] == l_id) {
1220
- if (l_type_array[z] == "type_address") {
1221
- if (document.getElementById(l_id + "_mini_label_street1")) {
1222
- l_id_removed[l_id_array[z]] = false;
1223
- }
1224
- if (document.getElementById(l_id+"_mini_label_street2")) {
1225
- l_id_removed[parseInt(l_id_array[z]) + 1] = false;
1226
- }
1227
- if (document.getElementById(l_id+"_mini_label_city")) {
1228
- l_id_removed[parseInt(l_id_array[z]) + 2] = false;
1229
- }
1230
- if (document.getElementById(l_id+"_mini_label_state")) {
1231
- l_id_removed[parseInt(l_id_array[z]) + 3] = false;
1232
- }
1233
- if (document.getElementById(l_id+"_mini_label_postal")) {
1234
- l_id_removed[parseInt(l_id_array[z]) + 4] = false;
1235
- }
1236
- if (document.getElementById(l_id+"_mini_label_country")) {
1237
- l_id_removed[parseInt(l_id_array[z]) + 5] = false;
1238
- }
1239
- z = z + 5;
1240
- }
1241
- else {
1242
- l_id_removed[l_id] = false;
1243
- }
1244
- }
1245
- }
1246
- if (tr.getAttribute('type')=="type_address") {
1247
- addr_id=parseInt(tr.id);
1248
- id_for_country= addr_id;
1249
- if(document.getElementById(id_for_country+"_mini_label_street1"))
1250
- tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_street1").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#';addr_id++;
1251
- if(document.getElementById(id_for_country+"_mini_label_street2"))
1252
- tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_street2").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#';addr_id++;
1253
- if(document.getElementById(id_for_country+"_mini_label_city"))
1254
- tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_city").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
1255
- if(document.getElementById(id_for_country+"_mini_label_state"))
1256
- tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_state").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
1257
- if(document.getElementById(id_for_country+"_mini_label_postal"))
1258
- tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_postal").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
1259
- if(document.getElementById(id_for_country+"_mini_label_country"))
1260
- tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_country").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#';
1261
- }
1262
- else {
1263
- tox = tox+l_id+'#**id**#'+l_label+'#**label**#'+l_type+'#****#';
1264
- }
1265
- }
1266
- }
1267
- }
1268
- }
1269
- }
1270
- }
1271
- }
1272
- document.getElementById('label_order_current').value = tox;
1273
- for (x = 0; x < l_id_array.length; x++) {
1274
- if (l_id_removed[l_id_array[x]]) {
1275
- tox = tox + l_id_array[x] + '#**id**#' + l_label_array[x] + '#**label**#' + l_type_array[x] + '#****#';
1276
- }
1277
- }
1278
- document.getElementById('label_order').value = tox;
1279
- refresh_old();
1280
- document.getElementById('pagination').value=document.getElementById('pages').getAttribute("type");
1281
- document.getElementById('show_title').value=document.getElementById('pages').getAttribute("show_title");
1282
- document.getElementById('show_numbers').value=document.getElementById('pages').getAttribute("show_numbers");
1283
- return true;
1284
- }
1285
-
1286
- gen = <?php echo (($id != 0) ? $row->counter : 1); ?>;
1287
-
1288
- function enable() {
1289
- alltypes = Array('customHTML', 'text', 'checkbox', 'radio', 'time_and_date', 'select', 'file_upload', 'captcha', 'map', 'button', 'page_break', 'section_break', 'paypal', 'survey');
1290
- for (x = 0; x < 14; x++) {
1291
- document.getElementById('img_' + alltypes[x]).src = "<?php echo WD_FMC_URL . '/images/'; ?>" + alltypes[x] + ".png";
1292
- }
1293
- if (document.getElementById('formMakerDiv').style.display == 'block') {
1294
- jQuery('#formMakerDiv').slideToggle(200);
1295
- }
1296
- else {
1297
- jQuery('#formMakerDiv').slideToggle(400);
1298
- }
1299
- if (document.getElementById('formMakerDiv').offsetWidth) {
1300
- document.getElementById('formMakerDiv1').style.width = (document.getElementById('formMakerDiv').offsetWidth - 60) + 'px';
1301
- }
1302
- if (document.getElementById('formMakerDiv1').style.display == 'block') {
1303
- jQuery('#formMakerDiv1').slideToggle(200);
1304
- }
1305
- else {
1306
- jQuery('#formMakerDiv1').slideToggle(400);
1307
- }
1308
- document.getElementById('when_edit').style.display = 'none';
1309
- }
1310
-
1311
- function enable2() {
1312
- alltypes = Array('customHTML', 'text', 'checkbox', 'radio', 'time_and_date', 'select', 'file_upload', 'captcha', 'map', 'button', 'page_break', 'section_break', 'paypal', 'survey');
1313
- for (x = 0; x < 14; x++) {
1314
- document.getElementById('img_' + alltypes[x]).src = "<?php echo WD_FMC_URL . '/images/'; ?>" + alltypes[x] + ".png";
1315
- }
1316
- if (document.getElementById('formMakerDiv').style.display == 'block') {
1317
- jQuery('#formMakerDiv').slideToggle(200);
1318
- }
1319
- else {
1320
- jQuery('#formMakerDiv').slideToggle(400);
1321
- }
1322
- if (document.getElementById('formMakerDiv').offsetWidth) {
1323
- document.getElementById('formMakerDiv1').style.width = (document.getElementById('formMakerDiv').offsetWidth - 60) + 'px';
1324
- }
1325
- if (document.getElementById('formMakerDiv1').style.display == 'block') {
1326
- jQuery('#formMakerDiv1').slideToggle(200);
1327
- }
1328
- else {
1329
- jQuery('#formMakerDiv1').slideToggle(400);
1330
- }
1331
- document.getElementById('when_edit').style.display = 'block';
1332
- if (document.getElementById('field_types').offsetWidth) {
1333
- document.getElementById('when_edit').style.width = document.getElementById('field_types').offsetWidth + 'px';
1334
- }
1335
- if (document.getElementById('field_types').offsetHeight) {
1336
- document.getElementById('when_edit').style.height = document.getElementById('field_types').offsetHeight + 'px';
1337
- }
1338
- }
1339
- </script>
1340
- <div style="clear: both; float: left; width: 99%;">
1341
- <div style="float:left; font-size: 14px; font-weight: bold;">
1342
- This section allows you to add fields to your form.
1343
- <a style="color: blue; text-decoration: none;" target="_blank" href="http://web-dorado.com/wordpress-form-maker-guide-4.html">Read More in User Manual</a>
1344
- </div>
1345
- <div style="float: right; text-align: right;">
1346
- <a style="text-decoration: none;" target="_blank" href="http://web-dorado.com/files/fromContactForm.php">
1347
- <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FMC_URL . '/images/wd_logo.png'; ?>" />
1348
- </a>
1349
- </div>
1350
- </div>
1351
- <form class="wrap" id="manage_form" method="post" action="admin.php?page=manage_fmc" style="float: left; width: 99%;">
1352
- <h2><?php echo $page_title; ?></h2>
1353
- <div style="float: right; margin: 0 5px 0 0;">
1354
- <a href="<?php echo add_query_arg(array('action' => 'FormMakerPreview_fmc', 'id' => $row->theme, 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>" class="button-primary thickbox thickbox-preview" id="preview_form" title="Form Preview" onclick="return false;">
1355
- Preview
1356
- </a>
1357
- <input class="button-primary" type="submit" onclick="if (spider_check_required('title', 'Form title') || !submitbutton()) {return false;}; spider_set_input_value('task', 'form_options_old');" value="Form options"/>
1358
- <?php
1359
- if ($id) {
1360
- ?>
1361
- <input class="button-secondary" type="submit" onclick="if (spider_check_required('title', 'Form title') || !submitbutton()) {return false;}; spider_set_input_value('task', 'save_as_copy_old')" value="Save as Copy"/>
1362
- <?php
1363
- }
1364
- ?>
1365
- <input class="button-secondary" type="submit" onclick="if (spider_check_required('title', 'Form title') || !submitbutton()) {return false;}; spider_set_input_value('task', 'save_old')" value="Save"/>
1366
- <input class="button-secondary" type="submit" onclick="if (spider_check_required('title', 'Form title') || !submitbutton()) {return false;}; spider_set_input_value('task', 'apply_old')" value="Apply"/>
1367
- <input class="button-secondary" type="submit" onclick="spider_set_input_value('task', 'cancel')" value="Cancel"/>
1368
- </div>
1369
-
1370
- <div class="formmaker_table" width="100%">
1371
- <div style="float: left; text-align: left;"><br />
1372
- <span class="cfm_logo cfm_black">Contact</span>
1373
- <span class="cfm_logo cfm_white">Form</span>
1374
- <span class="cfm_logo cfm_black">Maker</span><br /><br />
1375
- <img src="<?php echo WD_FMC_URL . '/images/logo.png'; ?>" />
1376
- </div>
1377
- <div style="float:right">
1378
- <span style="font-size: 16.76pt; font-family: tahoma; color: #FFFFFF; vertical-align: middle;">Form title:&nbsp;&nbsp;</span>
1379
- <input id="title" name="title" class="form_maker_title" value="<?php echo $row->title; ?>"/>
1380
- <br />
1381
- <img src="<?php echo WD_FMC_URL . '/images/formoptions.png'; ?>" onclick="if (spider_check_required('title', 'Form title')) {return false;}; submitbutton(); spider_set_input_value('task', 'form_options_old'); spider_form_submit(event, 'manage_form');" style="cursor: pointer; margin: 10px 0 10px 10px; float: right;"/>
1382
- <br /><br /><br />
1383
- <img src="<?php echo WD_FMC_URL . '/images/addanewfield.png'; ?>" onclick="enable(); Enable(); " style="cursor: pointer; margin:10px 0 10px 10px; float: right;"/>
1384
- </div>
1385
- </div>
1386
-
1387
- <div id="formMakerDiv" onclick="close_window()"></div>
1388
- <div id="formMakerDiv1" style="padding-top: 20px;" align="center">
1389
- <table border="0" width="100%" cellpadding="0" cellspacing="0" height="100%" style="border: 6px #00aeef solid; background-color: #FFF;">
1390
- <tr>
1391
- <td style="padding:0px">
1392
- <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
1393
- <tr valign="top">
1394
- <td width="15%" height="100%" style="border-right: dotted black 1px;" id="field_types">
1395
- <div id="when_edit" style="display: none;"></div>
1396
- <table border="0" cellpadding="0" cellspacing="3" width="100%">
1397
- <tr>
1398
- <td align="center" onClick="addRow('customHTML')" style="cursor:pointer" id="table_editor" class="field_buttons">
1399
- <img src="<?php echo WD_FMC_URL . '/images/customHTML.png'; ?>" style="margin:5px" id="img_customHTML"/>
1400
- </td>
1401
- <td align="center" onClick="addRow('text')" style="cursor:pointer" id="table_text" class="field_buttons">
1402
- <img src="<?php echo WD_FMC_URL . '/images/text.png'; ?>" style="margin:5px" id="img_text"/>
1403
- </td>
1404
- </tr>
1405
- <tr>
1406
- <td align="center" onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" id="table_time_and_date" class="field_buttons">
1407
- <img src="<?php echo WD_FMC_URL . '/images/time_and_date.png'; ?>" style="margin:5px" id="img_time_and_date"/>
1408
- </td>
1409
- <td align="center" onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" id="table_select" class="field_buttons">
1410
- <img src="<?php echo WD_FMC_URL . '/images/select.png'; ?>" style="margin:5px" id="img_select"/>
1411
- </td>
1412
- </tr>
1413
- <tr>
1414
- <td align="center" onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" id="table_checkbox" class="field_buttons">
1415
- <img src="<?php echo WD_FMC_URL . '/images/checkbox.png'; ?>" style="margin:5px" id="img_checkbox"/>
1416
- </td>
1417
- <td align="center" onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" id="table_radio" class="field_buttons">
1418
- <img src="<?php echo WD_FMC_URL . '/images/radio.png'; ?>" style="margin:5px" id="img_radio"/>
1419
- </td>
1420
- </tr>
1421
- <tr>
1422
- <td align="center" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" id="table_file_upload" class="field_buttons"
1423
- onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')">
1424
- <img src="<?php echo WD_FMC_URL . '/images/file_upload.png'; ?>" style="margin:5px" id="img_file_upload" />
1425
- </td>
1426
- <td align="center" onClick="addRow('captcha')" style="cursor:pointer" id="table_captcha" class="field_buttons">
1427
- <img src="<?php echo WD_FMC_URL . '/images/captcha.png'; ?>" style="margin:5px" id="img_captcha"/>
1428
- </td>
1429
- </tr>
1430
- <tr>
1431
- <td align="center" onClick="addRow('page_break')" style="cursor:pointer" id="table_page_break" class="field_buttons">
1432
- <img src="<?php echo WD_FMC_URL . '/images/page_break.png'; ?>" style="margin:5px" id="img_page_break"/>
1433
- </td>
1434
- <td align="center" onClick="addRow('section_break')" style="cursor:pointer" id="table_section_break" class="field_buttons">
1435
- <img src="<?php echo WD_FMC_URL . '/images/section_break.png'; ?>" style="margin:5px" id="img_section_break"/>
1436
- </td>
1437
- </tr>
1438
- <tr>
1439
- <td align="center" id="table_map" class="field_buttons" onClick="addRow('map')">
1440
- <img src="<?php echo WD_FMC_URL . '/images/map.png'; ?>" style="margin:5px" id="img_map" />
1441
- </td>
1442
- <td align="center" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" id="table_paypal" class="field_buttons"
1443
- onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')">
1444
- <img src="<?php echo WD_FMC_URL . '/images/paypal.png'; ?>" style="margin:5px" id="img_paypal" />
1445
- </td>
1446
- </tr>
1447
- <tr>
1448
- <td align="center" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" class="field_buttons" id="table_survey"
1449
- onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')">
1450
- <img src="<?php echo WD_FMC_URL . '/images/survey.png'; ?>" style="margin:5px" id="img_survey"/>
1451
- </td>
1452
- <td align="center" onClick="addRow('button')" id="table_button" class="field_buttons">
1453
- <img src="<?php echo WD_FMC_URL . '/images/button.png'; ?>" style="margin:5px" id="img_button"/>
1454
- </td>
1455
- </tr>
1456
- </table>
1457
- </td>
1458
- <td width="35%" height="100%" align="left">
1459
- <div id="edit_table" style="padding:0px; overflow-y:scroll; height:575px"></div>
1460
- </td>
1461
- <td align="center" valign="top" style="background: url("<?php echo WD_FMC_URL . '/images/border2.png'; ?>") repeat-y;">&nbsp;</td>
1462
- <td style="padding:15px">
1463
- <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
1464
- <tr>
1465
- <td align="right">
1466
- <input type="radio" value="end" name="el_pos" checked="checked" id="pos_end" onclick="Disable()"/>
1467
- At The End
1468
- <input type="radio" value="begin" name="el_pos" id="pos_begin" onclick="Disable()"/>
1469
- At The Beginning
1470
- <input type="radio" value="before" name="el_pos" id="pos_before" onclick="Enable()"/>
1471
- Before
1472
- <select style="width: 100px; margin-left: 5px;" id="sel_el_pos" disabled="disabled"></select>
1473
- <img alt="ADD" title="add" style="cursor:pointer; vertical-align:middle; margin:5px" src="<?php echo WD_FMC_URL . '/images/save.png'; ?>" onClick="add(0)"/>
1474
- <img alt="CANCEL" title="cancel" style="cursor: pointer; vertical-align:middle; margin:5px" src="<?php echo WD_FMC_URL . '/images/cancel_but.png'; ?>" onClick="close_window()"/>
1475
- <hr style=" margin-bottom:10px" />
1476
- </td>
1477
- </tr>
1478
- <tr height="100%" valign="top">
1479
- <td id="show_table"></td>
1480
- </tr>
1481
- </table>
1482
- </td>
1483
- </tr>
1484
- </table>
1485
- </td>
1486
- </tr>
1487
- </table>
1488
- <input type="hidden" id="old" />
1489
- <input type="hidden" id="old_selected" />
1490
- <input type="hidden" id="element_type" />
1491
- <input type="hidden" id="editing_id" />
1492
- <input type="hidden" value="<?php echo WD_FMC_URL; ?>" id="form_plugins_url" />
1493
- <div id="main_editor" style="position: absolute; display: none; z-index: 140;">
1494
- <?php
1495
- if (user_can_richedit()) {
1496
- wp_editor('', 'form_maker_editor', array('teeny' => FALSE, 'textarea_name' => 'form_maker_editor', 'media_buttons' => FALSE, 'textarea_rows' => 5));
1497
- }
1498
- else {
1499
- ?>
1500
- <textarea cols="36" rows="5" id="form_maker_editor" name="form_maker_editor" style="width: 440px; height: 350px; resize: vertical;" class="mce_editable" aria-hidden="true"></textarea>
1501
- <?php
1502
- }
1503
- ?>
1504
- </div>
1505
- </div>
1506
- <?php
1507
- if (!function_exists('the_editor')) {
1508
- ?>
1509
- <iframe id="tinymce" style="display: none;"></iframe>
1510
- <?php
1511
- }
1512
- ?>
1513
- <br /><br />
1514
- <fieldset>
1515
- <legend><h2 style="color: #00aeef;">Form</h2></legend>
1516
- <table width="100%" style="margin:8px">
1517
- <tr id="page_navigation">
1518
- <td align="center" width="90%" id="pages" show_title="<?php echo $row->show_title; ?>" show_numbers="<?php echo $row->show_numbers; ?>" type="<?php echo $row->pagination; ?>"></td>
1519
- <td align="left" id="edit_page_navigation"></td>
1520
- </tr>
1521
- </table>
1522
- <div id="take">
1523
- <?php
1524
- if ($row->form) {
1525
- echo $row->form;
1526
- }
1527
- else {
1528
- ?>
1529
- <table border="0" cellpadding="4" cellspacing="0" class="wdform_table1" style="width: 100%;">
1530
- <tbody id="form_id_tempform_view1" class="wdform_tbody1" page_title="Untitled page" next_title="Next" next_type="button" next_class="wdform_page_button" next_checkable="false" previous_title="Previous" previous_type="button" previous_class="wdform_page_button" previous_checkable="false">
1531
- <tr class="wdform_tr1">
1532
- <td class="wdform_td1" >
1533
- <table class="wdform_table2">
1534
- <tbody class="wdform_tbody2"></tbody>
1535
- </table>
1536
- </td>
1537
- </tr>
1538
- <tr class="wdform_footer">
1539
- <td colspan="100" valign="top">
1540
- <table width="100%" style="padding-right:170px"><tbody><tr id="form_id_temppage_nav1"></tr></tbody></table>
1541
- </td>
1542
- </tr>
1543
- <tbody id="form_id_tempform_view_img1" style="float: right !important;" >
1544
- <tr>
1545
- <td width="0%"></td>
1546
- <td align="right">
1547
- <img src="<?php echo WD_FMC_URL . '/images/minus.png'; ?>" title="Show or hide the page" class="page_toolbar" onclick="show_or_hide('1')" onmouseover="chnage_icons_src(this,'minus')" onmouseout="chnage_icons_src(this,'minus')" id="show_page_img_1" />
1548
- </td>
1549
- <td>
1550
- <img src="<?php echo WD_FMC_URL . '/images/page_delete.png'; ?>" title="Delete the page" class="page_toolbar" onclick="remove_page('1')" onmouseover="chnage_icons_src(this,'page_delete')" onmouseout="chnage_icons_src(this,'page_delete')" />
1551
- </td>
1552
- <td>
1553
- <img src="<?php echo WD_FMC_URL . '/images/page_delete_all.png'; ?>" title="Delete the page with fields" class="page_toolbar" onclick="remove_page_all('1')" onmouseover="chnage_icons_src(this,'page_delete_all')" onmouseout="chnage_icons_src(this,'page_delete_all')" />
1554
- </td>
1555
- <td>
1556
- <img src="<?php echo WD_FMC_URL . '/images/page_edit.png'; ?>" title="Edit the page" class="page_toolbar" onclick="edit_page_break('1')" onmouseover="chnage_icons_src(this,'page_edit')" onmouseout="chnage_icons_src(this,'page_edit')" />
1557
- </td>
1558
- </tr>
1559
- </tbody>
1560
- </table>
1561
- <?php
1562
- }
1563
- ?>
1564
- </div>
1565
- </fieldset>
1566
- <input type="hidden" name="form" id="form" />
1567
- <input type="hidden" name="form_front" id="form_front" />
1568
- <input type="hidden" name="pagination" id="pagination" />
1569
- <input type="hidden" name="show_title" id="show_title" />
1570
- <input type="hidden" name="show_numbers" id="show_numbers" />
1571
- <input type="hidden" name="public_key" id="public_key" />
1572
- <input type="hidden" name="private_key" id="private_key" />
1573
- <input type="hidden" name="recaptcha_theme" id="recaptcha_theme" />
1574
- <input type="hidden" id="label_order" name="label_order" value="<?php echo $row->label_order; ?>" />
1575
- <input type="hidden" id="label_order_current" name="label_order_current" value="<?php echo $row->label_order_current; ?>" />
1576
- <input type="hidden" name="counter" id="counter" value="<?php echo $row->counter; ?>" />
1577
- <input type="hidden" id="araqel" value="0" />
1578
- <script type="text/javascript">
1579
- form_view = 1;
1580
- form_view_count = 1;
1581
- form_view_max = 1;
1582
- function formOnload() {
1583
- // Enable maps.
1584
- for (t = 0; t < <?php echo $row->counter;?>; t++)
1585
- if (document.getElementById(t+"_typeform_id_temp")) {
1586
- if (document.getElementById(t+"_typeform_id_temp").value=="type_map" || document.getElementById(t+"_typeform_id_temp").value=="type_mark_map") {
1587
- if_gmap_init(t);
1588
- for (q = 0; q < 20; q++) {
1589
- if (document.getElementById(t+"_elementform_id_temp").getAttribute("long"+q)) {
1590
- w_long=parseFloat(document.getElementById(t+"_elementform_id_temp").getAttribute("long"+q));
1591
- w_lat=parseFloat(document.getElementById(t+"_elementform_id_temp").getAttribute("lat"+q));
1592
- w_info=parseFloat(document.getElementById(t+"_elementform_id_temp").getAttribute("info"+q));
1593
- add_marker_on_map(t,q, w_long, w_lat, w_info, false);
1594
- }
1595
- }
1596
- }
1597
- else
1598
- if (document.getElementById(t+"_typeform_id_temp").value == "type_date") {
1599
- // Calendar.setup({
1600
- // inputField: t+"_elementform_id_temp",
1601
- // ifFormat: document.getElementById(t+"_buttonform_id_temp").getAttribute('format'),
1602
- // button: t+"_buttonform_id_temp",
1603
- // align: "Tl",
1604
- // singleClick: true,
1605
- // firstDay: 0
1606
- // });
1607
- }
1608
- else
1609
- if(document.getElementById(t+"_typeform_id_temp").value=="type_spinner") {
1610
- var spinner_value = jQuery("#" + t + "_elementform_id_temp").get( "aria-valuenow" );
1611
- var spinner_min_value = document.getElementById(t+"_min_valueform_id_temp").value;
1612
- var spinner_max_value = document.getElementById(t+"_max_valueform_id_temp").value;
1613
- var spinner_step = document.getElementById(t+"_stepform_id_temp").value;
1614
-
1615
- jQuery( "#"+t+"_elementform_id_temp" ).removeClass( "ui-spinner-input" )
1616
- .prop( "disabled", false )
1617
- .removeAttr( "autocomplete" )
1618
- .removeAttr( "role" )
1619
- .removeAttr( "aria-valuemin" )
1620
- .removeAttr( "aria-valuemax" )
1621
- .removeAttr( "aria-valuenow" );
1622
-
1623
- span_ui= document.getElementById(t+"_elementform_id_temp").parentNode;
1624
- span_ui.parentNode.appendChild(document.getElementById(t+"_elementform_id_temp"));
1625
- span_ui.parentNode.removeChild(span_ui);
1626
-
1627
- jQuery("#"+t+"_elementform_id_temp")[0].spin = null;
1628
-
1629
- spinner = jQuery( "#"+t+"_elementform_id_temp" ).spinner();
1630
- spinner.spinner( "value", spinner_value );
1631
- jQuery( "#"+t+"_elementform_id_temp" ).spinner({ min: spinner_min_value});
1632
- jQuery( "#"+t+"_elementform_id_temp" ).spinner({ max: spinner_max_value});
1633
- jQuery( "#"+t+"_elementform_id_temp" ).spinner({ step: spinner_step});
1634
-
1635
- }
1636
- else
1637
- if(document.getElementById(t+"_typeform_id_temp").value=="type_slider") {
1638
-
1639
- var slider_value = document.getElementById(t+"_slider_valueform_id_temp").value;
1640
- var slider_min_value = document.getElementById(t+"_slider_min_valueform_id_temp").value;
1641
- var slider_max_value = document.getElementById(t+"_slider_max_valueform_id_temp").value;
1642
-
1643
- var slider_element_value = document.getElementById( t+"_element_valueform_id_temp" );
1644
- var slider_value_save = document.getElementById( t+"_slider_valueform_id_temp" );
1645
-
1646
- document.getElementById(t+"_elementform_id_temp").innerHTML = "";
1647
- document.getElementById(t+"_elementform_id_temp").removeAttribute( "class" );
1648
- document.getElementById(t+"_elementform_id_temp").removeAttribute( "aria-disabled" );
1649
-
1650
- jQuery("#"+t+"_elementform_id_temp")[0].slide = null;
1651
-
1652
- jQuery(function() {
1653
- jQuery( "#"+t+"_elementform_id_temp").slider({
1654
- range: "min",
1655
- value: eval(slider_value),
1656
- min: eval(slider_min_value),
1657
- max: eval(slider_max_value),
1658
- slide: function( event, ui ) {
1659
- slider_element_value.innerHTML = "" + ui.value ;
1660
- slider_value_save.value = "" + ui.value;
1661
-
1662
- }
1663
- });
1664
-
1665
-
1666
- });
1667
-
1668
-
1669
- }
1670
- else
1671
- if(document.getElementById(t+"_typeform_id_temp").value=="type_range"){
1672
- var spinner_value0 = jQuery("#" + t+"_elementform_id_temp0").get( "aria-valuenow" );
1673
- var spinner_step = document.getElementById(t+"_range_stepform_id_temp").value;
1674
-
1675
- jQuery( "#"+t+"_elementform_id_temp0" ).removeClass( "ui-spinner-input" )
1676
- .prop( "disabled", false )
1677
- .removeAttr( "autocomplete" )
1678
- .removeAttr( "role" )
1679
- .removeAttr( "aria-valuenow" );
1680
-
1681
- span_ui= document.getElementById(t+"_elementform_id_temp0").parentNode;
1682
- span_ui.parentNode.appendChild(document.getElementById(t+"_elementform_id_temp0"));
1683
- span_ui.parentNode.removeChild(span_ui);
1684
-
1685
-
1686
- jQuery("#"+t+"_elementform_id_temp0")[0].spin = null;
1687
- jQuery("#"+t+"_elementform_id_temp1")[0].spin = null;
1688
-
1689
- spinner0 = jQuery( "#"+t+"_elementform_id_temp0" ).spinner();
1690
- spinner0.spinner( "value", spinner_value0 );
1691
- jQuery( "#"+t+"_elementform_id_temp0" ).spinner({ step: spinner_step});
1692
-
1693
-
1694
-
1695
- var spinner_value1 = jQuery("#" + t+"_elementform_id_temp1").get( "aria-valuenow" );
1696
-
1697
- jQuery( "#"+t+"_elementform_id_temp1" ).removeClass( "ui-spinner-input" )
1698
- .prop( "disabled", false )
1699
- .removeAttr( "autocomplete" )
1700
- .removeAttr( "role" )
1701
- .removeAttr( "aria-valuenow" );
1702
-
1703
- span_ui1= document.getElementById(t+"_elementform_id_temp1").parentNode;
1704
- span_ui1.parentNode.appendChild(document.getElementById(t+"_elementform_id_temp1"));
1705
- span_ui1.parentNode.removeChild(span_ui1);
1706
-
1707
- spinner1 = jQuery( "#"+t+"_elementform_id_temp1" ).spinner();
1708
- spinner1.spinner( "value", spinner_value1 );
1709
- jQuery( "#"+t+"_elementform_id_temp1" ).spinner({ step: spinner_step});
1710
-
1711
- var myu = t;
1712
- jQuery(document).ready(function() {
1713
-
1714
- jQuery("#"+myu+"_mini_label_from").click(function() {
1715
- if (jQuery(this).children('input').length == 0) {
1716
- var from = "<input type='text' id='from' class='from' size='6' style='outline:none; border:none; background:none; font-size:11px;' value=\""+jQuery(this).text()+"\">";
1717
- jQuery(this).html(from);
1718
- jQuery("input.from").focus();
1719
- jQuery("input.from").blur(function() {
1720
- var id_for_blur = document.getElementById('from').parentNode.id.split('_');
1721
- var value = jQuery(this).val();
1722
- jQuery("#"+id_for_blur[0]+"_mini_label_from").text(value);
1723
- });
1724
- }
1725
- });
1726
-
1727
- jQuery("label#"+myu+"_mini_label_to").click(function() {
1728
- if (jQuery(this).children('input').length == 0) {
1729
-
1730
- var to = "<input type='text' id='to' class='to' size='6' style='outline:none; border:none; background:none; font-size:11px;' value=\""+jQuery(this).text()+"\">";
1731
- jQuery(this).html(to);
1732
- jQuery("input.to").focus();
1733
- jQuery("input.to").blur(function() {
1734
- var id_for_blur = document.getElementById('to').parentNode.id.split('_');
1735
- var value = jQuery(this).val();
1736
-
1737
- jQuery("#"+id_for_blur[0]+"_mini_label_to").text(value);
1738
- });
1739
-
1740
- }
1741
- });
1742
-
1743
-
1744
-
1745
- });
1746
- }
1747
-
1748
- else
1749
- if(document.getElementById(t+"_typeform_id_temp").value=="type_name"){
1750
- var myu = t;
1751
- jQuery(document).ready(function() {
1752
-
1753
- jQuery("#"+myu+"_mini_label_first").click(function() {
1754
-
1755
- if (jQuery(this).children('input').length == 0) {
1756
-
1757
- var first = "<input type='text' id='first' class='first' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1758
- jQuery(this).html(first);
1759
- jQuery("input.first").focus();
1760
- jQuery("input.first").blur(function() {
1761
-
1762
- var id_for_blur = document.getElementById('first').parentNode.id.split('_');
1763
- var value = jQuery(this).val();
1764
- jQuery("#"+id_for_blur[0]+"_mini_label_first").text(value);
1765
- });
1766
- }
1767
- });
1768
-
1769
- jQuery("label#"+myu+"_mini_label_last").click(function() {
1770
- if (jQuery(this).children('input').length == 0) {
1771
-
1772
- var last = "<input type='text' id='last' class='last' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1773
- jQuery(this).html(last);
1774
- jQuery("input.last").focus();
1775
- jQuery("input.last").blur(function() {
1776
- var id_for_blur = document.getElementById('last').parentNode.id.split('_');
1777
- var value = jQuery(this).val();
1778
-
1779
- jQuery("#"+id_for_blur[0]+"_mini_label_last").text(value);
1780
- });
1781
-
1782
- }
1783
- });
1784
-
1785
- jQuery("label#"+myu+"_mini_label_title").click(function() {
1786
- if (jQuery(this).children('input').length == 0) {
1787
- var title = "<input type='text' id='title' class='title' size='10' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1788
- jQuery(this).html(title);
1789
- jQuery("input.title").focus();
1790
- jQuery("input.title").blur(function() {
1791
- var id_for_blur = document.getElementById('title').parentNode.id.split('_');
1792
- var value = jQuery(this).val();
1793
-
1794
-
1795
- jQuery("#"+id_for_blur[0]+"_mini_label_title").text(value);
1796
- });
1797
- }
1798
-
1799
- });
1800
-
1801
-
1802
- jQuery("label#"+myu+"_mini_label_middle").click(function() {
1803
- if (jQuery(this).children('input').length == 0) {
1804
- var middle = "<input type='text' id='middle' class='middle' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1805
- jQuery(this).html(middle);
1806
- jQuery("input.middle").focus();
1807
- jQuery("input.middle").blur(function() {
1808
- var id_for_blur = document.getElementById('middle').parentNode.id.split('_');
1809
- var value = jQuery(this).val();
1810
-
1811
- jQuery("#"+id_for_blur[0]+"_mini_label_middle").text(value);
1812
- });
1813
- }
1814
- });
1815
-
1816
- });
1817
- }
1818
- else
1819
- if(document.getElementById(t+"_typeform_id_temp").value=="type_address"){
1820
- var myu = t;
1821
-
1822
- jQuery(document).ready(function() {
1823
- jQuery("label#"+myu+"_mini_label_street1").click(function() {
1824
-
1825
- if (jQuery(this).children('input').length == 0) {
1826
- var street1 = "<input type='text' id='street1' class='street1' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1827
- jQuery(this).html(street1);
1828
- jQuery("input.street1").focus();
1829
- jQuery("input.street1").blur(function() {
1830
- var id_for_blur = document.getElementById('street1').parentNode.id.split('_');
1831
- var value = jQuery(this).val();
1832
- jQuery("#"+id_for_blur[0]+"_mini_label_street1").text(value);
1833
- });
1834
- }
1835
- });
1836
-
1837
- jQuery("label#"+myu+"_mini_label_street2").click(function() {
1838
- if (jQuery(this).children('input').length == 0) {
1839
- var street2 = "<input type='text' id='street2' class='street2' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1840
- jQuery(this).html(street2);
1841
- jQuery("input.street2").focus();
1842
- jQuery("input.street2").blur(function() {
1843
- var id_for_blur = document.getElementById('street2').parentNode.id.split('_');
1844
- var value = jQuery(this).val();
1845
- jQuery("#"+id_for_blur[0]+"_mini_label_street2").text(value);
1846
- });
1847
- }
1848
- });
1849
-
1850
-
1851
- jQuery("label#"+myu+"_mini_label_city").click(function() {
1852
- if (jQuery(this).children('input').length == 0) {
1853
- var city = "<input type='text' id='city' class='city' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1854
- jQuery(this).html(city);
1855
- jQuery("input.city").focus();
1856
- jQuery("input.city").blur(function() {
1857
- var id_for_blur = document.getElementById('city').parentNode.id.split('_');
1858
- var value = jQuery(this).val();
1859
- jQuery("#"+id_for_blur[0]+"_mini_label_city").text(value);
1860
- });
1861
- }
1862
- });
1863
-
1864
- jQuery("label#"+myu+"_mini_label_state").click(function() {
1865
- if (jQuery(this).children('input').length == 0) {
1866
- var state = "<input type='text' id='state' class='state' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1867
- jQuery(this).html(state);
1868
- jQuery("input.state").focus();
1869
- jQuery("input.state").blur(function() {
1870
- var id_for_blur = document.getElementById('state').parentNode.id.split('_');
1871
- var value = jQuery(this).val();
1872
- jQuery("#"+id_for_blur[0]+"_mini_label_state").text(value);
1873
- });
1874
- }
1875
- });
1876
-
1877
- jQuery("label#"+myu+"_mini_label_postal").click(function() {
1878
- if (jQuery(this).children('input').length == 0) {
1879
- var postal = "<input type='text' id='postal' class='postal' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1880
- jQuery(this).html(postal);
1881
- jQuery("input.postal").focus();
1882
- jQuery("input.postal").blur(function() {
1883
- var id_for_blur = document.getElementById('postal').parentNode.id.split('_');
1884
- var value = jQuery(this).val();
1885
- jQuery("#"+id_for_blur[0]+"_mini_label_postal").text(value);
1886
- });
1887
- }
1888
- });
1889
-
1890
-
1891
- jQuery("label#"+myu+"_mini_label_country").click(function() {
1892
- if (jQuery(this).children('input').length == 0) {
1893
- var country = "<input type='country' id='country' class='country' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1894
- jQuery(this).html(country);
1895
- jQuery("input.country").focus();
1896
- jQuery("input.country").blur(function() {
1897
- var id_for_blur = document.getElementById('country').parentNode.id.split('_');
1898
- var value = jQuery(this).val();
1899
- jQuery("#"+id_for_blur[0]+"_mini_label_country").text(value);
1900
- });
1901
- }
1902
- });
1903
- });
1904
-
1905
- }
1906
- else
1907
- if(document.getElementById(t+"_typeform_id_temp").value=="type_phone"){
1908
- var myu = t;
1909
-
1910
- jQuery(document).ready(function() {
1911
- jQuery("label#"+myu+"_mini_label_area_code").click(function() {
1912
- if (jQuery(this).children('input').length == 0) {
1913
-
1914
- var area_code = "<input type='text' id='area_code' class='area_code' size='10' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1915
-
1916
- jQuery(this).html(area_code);
1917
- jQuery("input.area_code").focus();
1918
- jQuery("input.area_code").blur(function() {
1919
- var id_for_blur = document.getElementById('area_code').parentNode.id.split('_');
1920
- var value = jQuery(this).val();
1921
- jQuery("#"+id_for_blur[0]+"_mini_label_area_code").text(value);
1922
- });
1923
- }
1924
- });
1925
-
1926
-
1927
- jQuery("label#"+myu+"_mini_label_phone_number").click(function() {
1928
-
1929
- if (jQuery(this).children('input').length == 0) {
1930
- var phone_number = "<input type='text' id='phone_number' class='phone_number' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1931
-
1932
- jQuery(this).html(phone_number);
1933
-
1934
- jQuery("input.phone_number").focus();
1935
- jQuery("input.phone_number").blur(function() {
1936
- var id_for_blur = document.getElementById('phone_number').parentNode.id.split('_');
1937
- var value = jQuery(this).val();
1938
- jQuery("#"+id_for_blur[0]+"_mini_label_phone_number").text(value);
1939
- });
1940
- }
1941
- });
1942
-
1943
- });
1944
- }
1945
- else
1946
- if(document.getElementById(t+"_typeform_id_temp").value=="type_date_fields"){
1947
- var myu = t;
1948
-
1949
- jQuery(document).ready(function() {
1950
- jQuery("label#"+myu+"_day_label").click(function() {
1951
- if (jQuery(this).children('input').length == 0) {
1952
- var day = "<input type='text' id='day' class='day' size='8' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1953
- jQuery(this).html(day);
1954
- jQuery("input.day").focus();
1955
- jQuery("input.day").blur(function() {
1956
- var id_for_blur = document.getElementById('day').parentNode.id.split('_');
1957
- var value = jQuery(this).val();
1958
-
1959
- jQuery("#"+id_for_blur[0]+"_day_label").text(value);
1960
- });
1961
- }
1962
- });
1963
-
1964
-
1965
- jQuery("label#"+myu+"_month_label").click(function() {
1966
- if (jQuery(this).children('input').length == 0) {
1967
- var month = "<input type='text' id='month' class='month' size='8' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1968
- jQuery(this).html(month);
1969
- jQuery("input.month").focus();
1970
- jQuery("input.month").blur(function() {
1971
- var id_for_blur = document.getElementById('month').parentNode.id.split('_');
1972
- var value = jQuery(this).val();
1973
-
1974
- jQuery("#"+id_for_blur[0]+"_month_label").text(value);
1975
- });
1976
- }
1977
- });
1978
-
1979
- jQuery("label#"+myu+"_year_label").click(function() {
1980
- if (jQuery(this).children('input').length == 0) {
1981
- var year = "<input type='text' id='year' class='year' size='8' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1982
- jQuery(this).html(year);
1983
- jQuery("input.year").focus();
1984
- jQuery("input.year").blur(function() {
1985
- var id_for_blur = document.getElementById('year').parentNode.id.split('_');
1986
- var value = jQuery(this).val();
1987
-
1988
- jQuery("#"+id_for_blur[0]+"_year_label").text(value);
1989
- });
1990
- }
1991
- });
1992
-
1993
- });
1994
-
1995
-
1996
- }
1997
- else
1998
- if(document.getElementById(t+"_typeform_id_temp").value=="type_time"){
1999
- var myu = t;
2000
-
2001
- jQuery(document).ready(function() {
2002
- jQuery("label#"+myu+"_mini_label_hh").click(function() {
2003
- if (jQuery(this).children('input').length == 0) {
2004
- var hh = "<input type='text' id='hh' class='hh' size='4' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2005
- jQuery(this).html(hh);
2006
- jQuery("input.hh").focus();
2007
- jQuery("input.hh").blur(function() {
2008
- var id_for_blur = document.getElementById('hh').parentNode.id.split('_');
2009
- var value = jQuery(this).val();
2010
-
2011
-
2012
- jQuery("#"+id_for_blur[0]+"_mini_label_hh").text(value);
2013
- });
2014
- }
2015
- });
2016
-
2017
-
2018
- jQuery("label#"+myu+"_mini_label_mm").click(function() {
2019
- if (jQuery(this).children('input').length == 0) {
2020
- var mm = "<input type='text' id='mm' class='mm' size='4' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2021
- jQuery(this).html(mm);
2022
- jQuery("input.mm").focus();
2023
- jQuery("input.mm").blur(function() {
2024
- var id_for_blur = document.getElementById('mm').parentNode.id.split('_');
2025
- var value = jQuery(this).val();
2026
-
2027
- jQuery("#"+id_for_blur[0]+"_mini_label_mm").text(value);
2028
- });
2029
- }
2030
- });
2031
-
2032
- jQuery("label#"+myu+"_mini_label_ss").click(function() {
2033
- if (jQuery(this).children('input').length == 0) {
2034
- var ss = "<input type='text' id='ss' class='ss' size='4' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2035
- jQuery(this).html(ss);
2036
- jQuery("input.ss").focus();
2037
- jQuery("input.ss").blur(function() {
2038
- var id_for_blur = document.getElementById('ss').parentNode.id.split('_');
2039
- var value = jQuery(this).val();
2040
-
2041
- jQuery("#"+id_for_blur[0]+"_mini_label_ss").text(value);
2042
- });
2043
- }
2044
- });
2045
-
2046
- jQuery("label#"+myu+"_mini_label_am_pm").click(function() {
2047
- if (jQuery(this).children('input').length == 0) {
2048
- var am_pm = "<input type='text' id='am_pm' class='am_pm' size='4' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2049
- jQuery(this).html(am_pm);
2050
- jQuery("input.am_pm").focus();
2051
- jQuery("input.am_pm").blur(function() {
2052
- var id_for_blur = document.getElementById('am_pm').parentNode.id.split('_');
2053
- var value = jQuery(this).val();
2054
-
2055
- jQuery("#"+id_for_blur[0]+"_mini_label_am_pm").text(value);
2056
- });
2057
- }
2058
- });
2059
- });
2060
-
2061
- }
2062
-
2063
- else
2064
- if(document.getElementById(t+"_typeform_id_temp").value=="type_paypal_price"){
2065
- var myu = t;
2066
- jQuery(document).ready(function() {
2067
-
2068
- jQuery("#"+myu+"_mini_label_dollars").click(function() {
2069
-
2070
- if (jQuery(this).children('input').length == 0) {
2071
-
2072
- var dollars = "<input type='text' id='dollars' class='dollars' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2073
- jQuery(this).html(dollars);
2074
- jQuery("input.dollars").focus();
2075
- jQuery("input.dollars").blur(function() {
2076
-
2077
- var id_for_blur = document.getElementById('dollars').parentNode.id.split('_');
2078
- var value = jQuery(this).val();
2079
- jQuery("#"+id_for_blur[0]+"_mini_label_dollars").text(value);
2080
- });
2081
- }
2082
- });
2083
-
2084
- jQuery("label#"+myu+"_mini_label_cents").click(function() {
2085
- if (jQuery(this).children('input').length == 0) {
2086
-
2087
- var cents = "<input type='text' id='cents' class='cents' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2088
- jQuery(this).html(cents);
2089
- jQuery("input.cents").focus();
2090
- jQuery("input.cents").blur(function() {
2091
- var id_for_blur = document.getElementById('cents').parentNode.id.split('_');
2092
- var value = jQuery(this).val();
2093
-
2094
- jQuery("#"+id_for_blur[0]+"_mini_label_cents").text(value);
2095
- });
2096
-
2097
- }
2098
- });
2099
- });
2100
- }
2101
- else
2102
- if(document.getElementById(t+"_typeform_id_temp").value=="type_scale_rating"){
2103
- var myu = t;
2104
- jQuery(document).ready(function() {
2105
-
2106
- jQuery("#"+myu+"_mini_label_worst").click(function() {
2107
-
2108
- if (jQuery(this).children('input').length == 0) {
2109
-
2110
- var worst = "<input type='text' id='worst' class='worst' size='6' style='outline:none; border:none; background:none; font-size:11px;' value=\""+jQuery(this).text()+"\">";
2111
- jQuery(this).html(worst);
2112
- jQuery("input.worst").focus();
2113
- jQuery("input.worst").blur(function() {
2114
-
2115
- var id_for_blur = document.getElementById('worst').parentNode.id.split('_');
2116
- var value = jQuery(this).val();
2117
- jQuery("#"+id_for_blur[0]+"_mini_label_worst").text(value);
2118
- });
2119
- }
2120
- });
2121
-
2122
- jQuery("label#"+myu+"_mini_label_best").click(function() {
2123
- if (jQuery(this).children('input').length == 0) {
2124
-
2125
- var best = "<input type='text' id='best' class='best' size='6' style='outline:none; border:none; background:none; font-size:11px;' value=\""+jQuery(this).text()+"\">";
2126
- jQuery(this).html(best);
2127
- jQuery("input.best").focus();
2128
- jQuery("input.best").blur(function() {
2129
- var id_for_blur = document.getElementById('best').parentNode.id.split('_');
2130
- var value = jQuery(this).val();
2131
-
2132
- jQuery("#"+id_for_blur[0]+"_mini_label_best").text(value);
2133
- });
2134
-
2135
- }
2136
- });
2137
-
2138
-
2139
-
2140
- });
2141
- }
2142
- }
2143
- form_view = 1;
2144
- form_view_count = 0;
2145
- for (i = 1; i <= 30; i++) {
2146
- if (document.getElementById('form_id_tempform_view'+i)) {
2147
- form_view_count++;
2148
- form_view_max=i;
2149
- }
2150
- }
2151
- if (form_view_count > 1) {
2152
- for (i=1; i<=form_view_max; i++) {
2153
- if (document.getElementById('form_id_tempform_view'+i)) {
2154
- first_form_view=i;
2155
- break;
2156
- }
2157
- }
2158
- form_view=form_view_max;
2159
- generate_page_nav(first_form_view);
2160
- var img_EDIT = document.createElement("img");
2161
- img_EDIT.setAttribute("src", "<?php echo WD_FMC_URL . '/images/edit.png'; ?>");
2162
- img_EDIT.style.cssText = "margin-left:40px; cursor:pointer";
2163
- img_EDIT.setAttribute("onclick", 'el_page_navigation()');
2164
- var td_EDIT = document.getElementById("edit_page_navigation");
2165
- td_EDIT.appendChild(img_EDIT);
2166
- document.getElementById('page_navigation').appendChild(td_EDIT);
2167
- }
2168
- //if(document.getElementById('take').innerHTML.indexOf('up_row(')==-1) location.reload(true);
2169
- //else
2170
-
2171
- document.getElementById('form').value=document.getElementById('take').innerHTML;
2172
- document.getElementById('araqel').value = 1;
2173
- }
2174
- jQuery(window).load(function () {
2175
- formOnload();
2176
- });
2177
- </script>
2178
-
2179
- <input type="hidden" name="option" value="com_formmaker" />
2180
- <input type="hidden" name="id" value="<?php echo $row->id; ?>" />
2181
- <input type="hidden" name="cid[]" value="<?php echo $row->id; ?>" />
2182
-
2183
- <input type="hidden" id="task" name="task" value=""/>
2184
- <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
2185
- </form>
2186
- <script>
2187
- jQuery(window).load(function() {
2188
- spider_popup();
2189
- });
2190
- </script>
2191
- <?php
2192
- }
2193
-
2194
- public function form_options_old($id) {
2195
- $row = $this->model->get_row_data($id);
2196
- $themes = $this->model->get_theme_rows_data('_old');
2197
- $page_title = $row->title . ' form options';
2198
- $label_id = array();
2199
- $label_label = array();
2200
- $label_type = array();
2201
- $label_all = explode('#****#', $row->label_order_current);
2202
- $label_all = array_slice($label_all, 0, count($label_all) - 1);
2203
- foreach ($label_all as $key => $label_each) {
2204
- $label_id_each = explode('#**id**#', $label_each);
2205
- array_push($label_id, $label_id_each[0]);
2206
- $label_order_each = explode('#**label**#', $label_id_each[1]);
2207
- array_push($label_label, $label_order_each[0]);
2208
- array_push($label_type, $label_order_each[1]);
2209
- }
2210
- ?>
2211
- <script>
2212
- gen = "<?php echo $row->counter; ?>";
2213
- form_view_max = 20;
2214
- function set_preview() {
2215
- document.getElementById('preview_form').href = '<?php echo add_query_arg(array('action' => 'FormMakerPreview_fmc', 'form_id' => $row->id), admin_url('admin-ajax.php')); ?>&id='+document.getElementById('theme').value+'&width=1000&height=500&TB_iframe=1';
2216
- }
2217
- </script>
2218
- <div style="clear: both; float: left; width: 99%;">
2219
- <div style="float:left; font-size: 14px; font-weight: bold;">
2220
- This section allows you to edit form options.
2221
- <a style="color: blue; text-decoration: none;" target="_blank" href="http://web-dorado.com/wordpress-form-maker-guide-3.html">Read More in User Manual</a>
2222
- </div>
2223
- <div style="float: right; text-align: right;">
2224
- <a style="text-decoration: none;" target="_blank" href="http://web-dorado.com/files/fromContactForm.php">
2225
- <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FMC_URL . '/images/wd_logo.png'; ?>" />
2226
- </a>
2227
- </div>
2228
- </div>
2229
- <form class="wrap" method="post" action="admin.php?page=manage_fmc" style="float: left; width: 99%;" name="adminForm" id="adminForm">
2230
- <h2><?php echo $page_title; ?></h2>
2231
- <div style="float: right; margin: 0 5px 0 0;">
2232
- <input class="button-secondary" type="submit" onclick="if (spider_check_email('mail') ||
2233
- spider_check_email('from_mail') ||
2234
- spider_check_email('paypal_email')) {return false;}; spider_set_input_value('task', 'save_options_old')" value="Save"/>
2235
- <input class="button-secondary" type="submit" onclick="if (spider_check_email('mail') ||
2236
- spider_check_email('from_mail') ||
2237
- spider_check_email('paypal_email')) {return false;}; spider_set_input_value('task', 'apply_options_old')" value="Apply"/>
2238
- <input class="button-secondary" type="submit" onclick="spider_set_input_value('task', 'cancel_options_old')" value="Cancel"/>
2239
- </div>
2240
- <input type="hidden" name="take" id="take" value="<?php $row->form ?>">
2241
- <div class="submenu-box" style="width: 99%; float: left; margin: 15px 0 0 0;">
2242
- <div class="submenu-pad">
2243
- <ul id="submenu" class="configuration">
2244
- <li>
2245
- <a id="general" class="fm_fieldset_tab" onclick="form_maker_options_tabs('general')" href="#">General Options</a>
2246
- </li>
2247
- <li>
2248
- <a id="actions" class="fm_fieldset_