Version Description
Download this release
Release Info
Developer | webdorado |
Plugin | Form Maker by WD – user-friendly drag & drop Form Builder plugin |
Version | 1.7.19 |
Comparing to | |
See all releases |
Code changes from version 1.7.18 to 1.7.19
- admin/controllers/FMControllerBlocked_ips_fm.php +145 -145
- admin/controllers/FMControllerFormMakerEditCSS.php +97 -97
- admin/controllers/FMControllerFormMakerPreview.php +42 -42
- admin/controllers/FMControllerFormMakerSQLMapping.php +111 -111
- admin/controllers/FMControllerFormmakerwdcaptcha.php +42 -42
- admin/controllers/FMControllerFormmakerwindow.php +42 -42
- admin/controllers/FMControllerFromeditcountryinpopup.php +42 -42
- admin/controllers/FMControllerFromipinfoinpopup.php +42 -42
- admin/controllers/FMControllerFrommapeditinpopup.php +42 -42
- admin/controllers/FMControllerGenerete_csv.php +42 -42
- admin/controllers/FMControllerGenerete_xml.php +42 -42
- admin/controllers/FMControllerLicensing_fm.php +48 -48
- admin/controllers/FMControllerManage_fm.php +992 -992
- admin/controllers/FMControllerShow_matrix.php +42 -42
- admin/controllers/FMControllerSubmissions_fm.php +760 -760
- admin/controllers/FMControllerThemes_fm.php +189 -189
- admin/controllers/FMControllerUninstall_fm.php +56 -56
- admin/controllers/FMControllerWidget.php +60 -60
- admin/models/FMModelBlocked_ips_fm.php +72 -72
- admin/models/FMModelFormMakerEditCSS.php +41 -41
- admin/models/FMModelFormMakerPreview.php +41 -41
- admin/models/FMModelFormMakerSQLMapping.php +120 -120
- admin/models/FMModelFormmakerwdcaptcha.php +30 -30
- admin/models/FMModelFormmakerwindow.php +35 -35
- admin/models/FMModelFromeditcountryinpopup.php +30 -30
- admin/models/FMModelFromipinfoinpopup.php +30 -30
- admin/models/FMModelFrommapeditinpopup.php +30 -30
- admin/models/FMModelGenerete_csv.php +261 -261
- admin/models/FMModelGenerete_xml.php +259 -259
- admin/models/FMModelLicensing_fm.php +29 -29
- admin/models/FMModelManage_fm.php +1836 -1836
- admin/models/FMModelShow_matrix.php +30 -30
- admin/models/FMModelThemes_fm.php +88 -88
- admin/models/FMModelUninstall_fm.php +51 -51
- admin/models/FMModelWidget.php +37 -37
- admin/views/FMViewBlocked_ips_fm.php +147 -147
- admin/views/FMViewFormMakerEditCSS.php +112 -112
- admin/views/FMViewFormMakerPreview.php +476 -476
- admin/views/FMViewFormMakerSQLMapping.php +1272 -1272
- admin/views/FMViewFormmakerwdcaptcha.php +92 -92
- admin/views/FMViewFormmakerwindow.php +112 -112
- admin/views/FMViewFromeditcountryinpopup.php +140 -140
- admin/views/FMViewFromipinfoinpopup.php +100 -100
- admin/views/FMViewFrommapeditinpopup.php +63 -63
- admin/views/FMViewGenerete_csv.php +68 -68
- admin/views/FMViewGenerete_xml.php +61 -66
admin/controllers/FMControllerBlocked_ips_fm.php
CHANGED
@@ -1,146 +1,146 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerBlocked_ips_fm {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function execute() {
|
22 |
-
$task = WDW_FM_Library::get('task');
|
23 |
-
$id = WDW_FM_Library::get('current_id', 0);
|
24 |
-
$message = WDW_FM_Library::get('message');
|
25 |
-
echo WDW_FM_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_FM_DIR . "/admin/models/FMModelBlocked_ips_fm.php";
|
38 |
-
$model = new FMModelBlocked_ips_fm();
|
39 |
-
|
40 |
-
require_once WD_FM_DIR . "/admin/views/FMViewBlocked_ips_fm.php";
|
41 |
-
$view = new FMViewBlocked_ips_fm($model);
|
42 |
-
$view->display();
|
43 |
-
}
|
44 |
-
|
45 |
-
public function save() {
|
46 |
-
$message = $this->save_db();
|
47 |
-
// $this->display();
|
48 |
-
$page = WDW_FM_Library::get('page');
|
49 |
-
WDW_FM_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_FM_Library::get('page');
|
99 |
-
WDW_FM_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_FM_Library::get('page');
|
113 |
-
WDW_FM_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_FM_Library::get('page');
|
134 |
-
WDW_FM_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_fm {
|
4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
+
// Events //
|
6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
+
// Constants //
|
9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
+
// Variables //
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
+
// Constructor & Destructor //
|
15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
+
public function __construct() {
|
17 |
+
}
|
18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
+
// Public Methods //
|
20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
+
public function execute() {
|
22 |
+
$task = WDW_FM_Library::get('task');
|
23 |
+
$id = WDW_FM_Library::get('current_id', 0);
|
24 |
+
$message = WDW_FM_Library::get('message');
|
25 |
+
echo WDW_FM_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_FM_DIR . "/admin/models/FMModelBlocked_ips_fm.php";
|
38 |
+
$model = new FMModelBlocked_ips_fm();
|
39 |
+
|
40 |
+
require_once WD_FM_DIR . "/admin/views/FMViewBlocked_ips_fm.php";
|
41 |
+
$view = new FMViewBlocked_ips_fm($model);
|
42 |
+
$view->display();
|
43 |
+
}
|
44 |
+
|
45 |
+
public function save() {
|
46 |
+
$message = $this->save_db();
|
47 |
+
// $this->display();
|
48 |
+
$page = WDW_FM_Library::get('page');
|
49 |
+
WDW_FM_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_FM_Library::get('page');
|
99 |
+
WDW_FM_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_FM_Library::get('page');
|
113 |
+
WDW_FM_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_FM_Library::get('page');
|
134 |
+
WDW_FM_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/FMControllerFormMakerEditCSS.php
CHANGED
@@ -1,98 +1,98 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerFormMakerEditCSS {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function execute() {
|
22 |
-
$task = ((isset($_POST['task'])) ? esc_html($_POST['task']) : '');
|
23 |
-
$id = ((isset($_POST['current_id'])) ? esc_html($_POST['current_id']) : 0);
|
24 |
-
if (method_exists($this, $task)) {
|
25 |
-
$this->$task($id);
|
26 |
-
}
|
27 |
-
else {
|
28 |
-
$this->display();
|
29 |
-
}
|
30 |
-
}
|
31 |
-
|
32 |
-
public function display() {
|
33 |
-
require_once WD_FM_DIR . "/admin/models/FMModelFormMakerEditCSS.php";
|
34 |
-
$model = new FMModelFormMakerEditCSS();
|
35 |
-
|
36 |
-
require_once WD_FM_DIR . "/admin/views/FMViewFormMakerEditCSS.php";
|
37 |
-
$view = new FMViewFormMakerEditCSS($model);
|
38 |
-
$view->display();
|
39 |
-
}
|
40 |
-
|
41 |
-
public function save() {
|
42 |
-
$this->update_db();
|
43 |
-
}
|
44 |
-
|
45 |
-
public function apply() {
|
46 |
-
$this->update_db();
|
47 |
-
$this->display();
|
48 |
-
}
|
49 |
-
|
50 |
-
public function save_as_new() {
|
51 |
-
$this->insert_db();
|
52 |
-
}
|
53 |
-
|
54 |
-
public function insert_db() {
|
55 |
-
global $wpdb;
|
56 |
-
$title = (isset($_POST['title']) ? esc_html(stripslashes( $_POST['title'])) : '');
|
57 |
-
$css = (isset($_POST['css']) ? stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST['css'])) : '');
|
58 |
-
$default = (isset($_POST['default']) ? esc_html(stripslashes( $_POST['default'])) : 0);
|
59 |
-
$save = $wpdb->insert($wpdb->prefix . 'formmaker_themes', array(
|
60 |
-
'title' => $title,
|
61 |
-
'css' => $css,
|
62 |
-
'default' => $default,
|
63 |
-
), array(
|
64 |
-
'%s',
|
65 |
-
'%s',
|
66 |
-
'%d',
|
67 |
-
));
|
68 |
-
}
|
69 |
-
|
70 |
-
public function update_db() {
|
71 |
-
global $wpdb;
|
72 |
-
$id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes( $_POST['current_id'])) : 0);
|
73 |
-
$title = (isset($_POST['title']) ? esc_html(stripslashes( $_POST['title'])) : '');
|
74 |
-
$css = (isset($_POST['css']) ? stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST['css'])) : '');
|
75 |
-
$default = (isset($_POST['default']) ? esc_html(stripslashes( $_POST['default'])) : 0);
|
76 |
-
$save = $wpdb->update($wpdb->prefix . 'formmaker_themes', array(
|
77 |
-
'title' => $title,
|
78 |
-
'css' => $css,
|
79 |
-
'default' => $default,
|
80 |
-
), array('id' => $id));
|
81 |
-
if ($save !== FALSE) {
|
82 |
-
echo WDW_FM_Library::message('Item Succesfully Saved.', 'updated');
|
83 |
-
}
|
84 |
-
else {
|
85 |
-
echo WDW_FM_Library::message('Error. Please install plugin again.', 'error');
|
86 |
-
}
|
87 |
-
}
|
88 |
-
|
89 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
90 |
-
// Getters & Setters //
|
91 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
92 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
93 |
-
// Private Methods //
|
94 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
95 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
96 |
-
// Listeners //
|
97 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
98 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FMControllerFormMakerEditCSS {
|
4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
+
// Events //
|
6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
+
// Constants //
|
9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
+
// Variables //
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
+
// Constructor & Destructor //
|
15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
+
public function __construct() {
|
17 |
+
}
|
18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
+
// Public Methods //
|
20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
+
public function execute() {
|
22 |
+
$task = ((isset($_POST['task'])) ? esc_html($_POST['task']) : '');
|
23 |
+
$id = ((isset($_POST['current_id'])) ? esc_html($_POST['current_id']) : 0);
|
24 |
+
if (method_exists($this, $task)) {
|
25 |
+
$this->$task($id);
|
26 |
+
}
|
27 |
+
else {
|
28 |
+
$this->display();
|
29 |
+
}
|
30 |
+
}
|
31 |
+
|
32 |
+
public function display() {
|
33 |
+
require_once WD_FM_DIR . "/admin/models/FMModelFormMakerEditCSS.php";
|
34 |
+
$model = new FMModelFormMakerEditCSS();
|
35 |
+
|
36 |
+
require_once WD_FM_DIR . "/admin/views/FMViewFormMakerEditCSS.php";
|
37 |
+
$view = new FMViewFormMakerEditCSS($model);
|
38 |
+
$view->display();
|
39 |
+
}
|
40 |
+
|
41 |
+
public function save() {
|
42 |
+
$this->update_db();
|
43 |
+
}
|
44 |
+
|
45 |
+
public function apply() {
|
46 |
+
$this->update_db();
|
47 |
+
$this->display();
|
48 |
+
}
|
49 |
+
|
50 |
+
public function save_as_new() {
|
51 |
+
$this->insert_db();
|
52 |
+
}
|
53 |
+
|
54 |
+
public function insert_db() {
|
55 |
+
global $wpdb;
|
56 |
+
$title = (isset($_POST['title']) ? esc_html(stripslashes( $_POST['title'])) : '');
|
57 |
+
$css = (isset($_POST['css']) ? stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST['css'])) : '');
|
58 |
+
$default = (isset($_POST['default']) ? esc_html(stripslashes( $_POST['default'])) : 0);
|
59 |
+
$save = $wpdb->insert($wpdb->prefix . 'formmaker_themes', array(
|
60 |
+
'title' => $title,
|
61 |
+
'css' => $css,
|
62 |
+
'default' => $default,
|
63 |
+
), array(
|
64 |
+
'%s',
|
65 |
+
'%s',
|
66 |
+
'%d',
|
67 |
+
));
|
68 |
+
}
|
69 |
+
|
70 |
+
public function update_db() {
|
71 |
+
global $wpdb;
|
72 |
+
$id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes( $_POST['current_id'])) : 0);
|
73 |
+
$title = (isset($_POST['title']) ? esc_html(stripslashes( $_POST['title'])) : '');
|
74 |
+
$css = (isset($_POST['css']) ? stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST['css'])) : '');
|
75 |
+
$default = (isset($_POST['default']) ? esc_html(stripslashes( $_POST['default'])) : 0);
|
76 |
+
$save = $wpdb->update($wpdb->prefix . 'formmaker_themes', array(
|
77 |
+
'title' => $title,
|
78 |
+
'css' => $css,
|
79 |
+
'default' => $default,
|
80 |
+
), array('id' => $id));
|
81 |
+
if ($save !== FALSE) {
|
82 |
+
echo WDW_FM_Library::message('Item Succesfully Saved.', 'updated');
|
83 |
+
}
|
84 |
+
else {
|
85 |
+
echo WDW_FM_Library::message('Error. Please install plugin again.', 'error');
|
86 |
+
}
|
87 |
+
}
|
88 |
+
|
89 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
90 |
+
// Getters & Setters //
|
91 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
92 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
93 |
+
// Private Methods //
|
94 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
95 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
96 |
+
// Listeners //
|
97 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
98 |
}
|
admin/controllers/FMControllerFormMakerPreview.php
CHANGED
@@ -1,43 +1,43 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerFormMakerPreview {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function execute() {
|
22 |
-
$this->display();
|
23 |
-
}
|
24 |
-
|
25 |
-
public function display() {
|
26 |
-
require_once WD_FM_DIR . "/admin/models/FMModelFormMakerPreview.php";
|
27 |
-
$model = new FMModelFormMakerPreview();
|
28 |
-
|
29 |
-
require_once WD_FM_DIR . "/admin/views/FMViewFormMakerPreview.php";
|
30 |
-
$view = new FMViewFormMakerPreview($model);
|
31 |
-
$view->display();
|
32 |
-
}
|
33 |
-
|
34 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
35 |
-
// Getters & Setters //
|
36 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
37 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
38 |
-
// Private Methods //
|
39 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
40 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
41 |
-
// Listeners //
|
42 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
43 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FMControllerFormMakerPreview {
|
4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
+
// Events //
|
6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
+
// Constants //
|
9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
+
// Variables //
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
+
// Constructor & Destructor //
|
15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
+
public function __construct() {
|
17 |
+
}
|
18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
+
// Public Methods //
|
20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
+
public function execute() {
|
22 |
+
$this->display();
|
23 |
+
}
|
24 |
+
|
25 |
+
public function display() {
|
26 |
+
require_once WD_FM_DIR . "/admin/models/FMModelFormMakerPreview.php";
|
27 |
+
$model = new FMModelFormMakerPreview();
|
28 |
+
|
29 |
+
require_once WD_FM_DIR . "/admin/views/FMViewFormMakerPreview.php";
|
30 |
+
$view = new FMViewFormMakerPreview($model);
|
31 |
+
$view->display();
|
32 |
+
}
|
33 |
+
|
34 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
35 |
+
// Getters & Setters //
|
36 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
37 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
38 |
+
// Private Methods //
|
39 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
40 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
41 |
+
// Listeners //
|
42 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
43 |
}
|
admin/controllers/FMControllerFormMakerSQLMapping.php
CHANGED
@@ -1,112 +1,112 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerFormMakerSQLMapping {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function execute() {
|
22 |
-
$task = ((isset($_GET['task'])) ? esc_html($_GET['task']) : 0);
|
23 |
-
$id = ((isset($_GET['id'])) ? esc_html($_GET['id']) : 0);
|
24 |
-
$form_id = ((isset($_GET['form_id'])) ? esc_html($_GET['form_id']) : 0);
|
25 |
-
if ($task && method_exists($this, $task)) {
|
26 |
-
$this->$task($form_id);
|
27 |
-
}
|
28 |
-
else {
|
29 |
-
if ($id) {
|
30 |
-
$this->edit_query($id, $form_id);
|
31 |
-
}
|
32 |
-
else {
|
33 |
-
$this->add_query($form_id);
|
34 |
-
}
|
35 |
-
}
|
36 |
-
}
|
37 |
-
|
38 |
-
public function add_query($form_id) {
|
39 |
-
require_once WD_FM_DIR . "/admin/models/FMModelFormMakerSQLMapping.php";
|
40 |
-
$model = new FMModelFormMakerSQLMapping();
|
41 |
-
|
42 |
-
require_once WD_FM_DIR . "/admin/views/FMViewFormMakerSQLMapping.php";
|
43 |
-
$view = new FMViewFormMakerSQLMapping($model);
|
44 |
-
$view->add_query($form_id);
|
45 |
-
}
|
46 |
-
|
47 |
-
public function edit_query($id, $form_id) {
|
48 |
-
require_once WD_FM_DIR . "/admin/models/FMModelFormMakerSQLMapping.php";
|
49 |
-
$model = new FMModelFormMakerSQLMapping();
|
50 |
-
|
51 |
-
require_once WD_FM_DIR . "/admin/views/FMViewFormMakerSQLMapping.php";
|
52 |
-
$view = new FMViewFormMakerSQLMapping($model);
|
53 |
-
$view->edit_query($id, $form_id);
|
54 |
-
}
|
55 |
-
|
56 |
-
public function db_tables($form_id) {
|
57 |
-
require_once WD_FM_DIR . "/admin/models/FMModelFormMakerSQLMapping.php";
|
58 |
-
$model = new FMModelFormMakerSQLMapping();
|
59 |
-
|
60 |
-
require_once WD_FM_DIR . "/admin/views/FMViewFormMakerSQLMapping.php";
|
61 |
-
$view = new FMViewFormMakerSQLMapping($model);
|
62 |
-
$view->db_tables($form_id);
|
63 |
-
}
|
64 |
-
|
65 |
-
public function db_table_struct($form_id) {
|
66 |
-
require_once WD_FM_DIR . "/admin/models/FMModelFormMakerSQLMapping.php";
|
67 |
-
$model = new FMModelFormMakerSQLMapping();
|
68 |
-
|
69 |
-
require_once WD_FM_DIR . "/admin/views/FMViewFormMakerSQLMapping.php";
|
70 |
-
$view = new FMViewFormMakerSQLMapping($model);
|
71 |
-
$view->db_table_struct($form_id);
|
72 |
-
}
|
73 |
-
|
74 |
-
public function save_query() {
|
75 |
-
global $wpdb;
|
76 |
-
$form_id = ((isset($_GET['form_id'])) ? esc_html($_GET['form_id']) : 0);
|
77 |
-
$query = ((isset($_POST['query'])) ? stripslashes(wp_specialchars_decode($_POST['query'])) : "");
|
78 |
-
$details = ((isset($_POST['details'])) ? esc_html($_POST['details']) : "");
|
79 |
-
$save = $wpdb->insert($wpdb->prefix . 'formmaker_query', array(
|
80 |
-
'form_id' => $form_id,
|
81 |
-
'query' => $query,
|
82 |
-
'details' => $details,
|
83 |
-
), array(
|
84 |
-
'%d',
|
85 |
-
'%s',
|
86 |
-
'%s',
|
87 |
-
));
|
88 |
-
}
|
89 |
-
|
90 |
-
public function update_query() {
|
91 |
-
global $wpdb;
|
92 |
-
$id = ((isset($_GET['id'])) ? esc_html($_GET['id']) : 0);
|
93 |
-
$form_id = ((isset($_GET['form_id'])) ? esc_html($_GET['form_id']) : 0);
|
94 |
-
$query = ((isset($_POST['query'])) ? stripslashes(wp_specialchars_decode($_POST['query'])) : "");
|
95 |
-
$details = ((isset($_POST['details'])) ? esc_html($_POST['details']) : "");
|
96 |
-
$save = $wpdb->update($wpdb->prefix . 'formmaker_query', array(
|
97 |
-
'form_id' => $form_id,
|
98 |
-
'query' => $query,
|
99 |
-
'details' => $details,
|
100 |
-
), array('id' => $id));
|
101 |
-
}
|
102 |
-
|
103 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
104 |
-
// Getters & Setters //
|
105 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
106 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
107 |
-
// Private Methods //
|
108 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
109 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
110 |
-
// Listeners //
|
111 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
112 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FMControllerFormMakerSQLMapping {
|
4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
+
// Events //
|
6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
+
// Constants //
|
9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
+
// Variables //
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
+
// Constructor & Destructor //
|
15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
+
public function __construct() {
|
17 |
+
}
|
18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
+
// Public Methods //
|
20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
+
public function execute() {
|
22 |
+
$task = ((isset($_GET['task'])) ? esc_html($_GET['task']) : 0);
|
23 |
+
$id = ((isset($_GET['id'])) ? esc_html($_GET['id']) : 0);
|
24 |
+
$form_id = ((isset($_GET['form_id'])) ? esc_html($_GET['form_id']) : 0);
|
25 |
+
if ($task && method_exists($this, $task)) {
|
26 |
+
$this->$task($form_id);
|
27 |
+
}
|
28 |
+
else {
|
29 |
+
if ($id) {
|
30 |
+
$this->edit_query($id, $form_id);
|
31 |
+
}
|
32 |
+
else {
|
33 |
+
$this->add_query($form_id);
|
34 |
+
}
|
35 |
+
}
|
36 |
+
}
|
37 |
+
|
38 |
+
public function add_query($form_id) {
|
39 |
+
require_once WD_FM_DIR . "/admin/models/FMModelFormMakerSQLMapping.php";
|
40 |
+
$model = new FMModelFormMakerSQLMapping();
|
41 |
+
|
42 |
+
require_once WD_FM_DIR . "/admin/views/FMViewFormMakerSQLMapping.php";
|
43 |
+
$view = new FMViewFormMakerSQLMapping($model);
|
44 |
+
$view->add_query($form_id);
|
45 |
+
}
|
46 |
+
|
47 |
+
public function edit_query($id, $form_id) {
|
48 |
+
require_once WD_FM_DIR . "/admin/models/FMModelFormMakerSQLMapping.php";
|
49 |
+
$model = new FMModelFormMakerSQLMapping();
|
50 |
+
|
51 |
+
require_once WD_FM_DIR . "/admin/views/FMViewFormMakerSQLMapping.php";
|
52 |
+
$view = new FMViewFormMakerSQLMapping($model);
|
53 |
+
$view->edit_query($id, $form_id);
|
54 |
+
}
|
55 |
+
|
56 |
+
public function db_tables($form_id) {
|
57 |
+
require_once WD_FM_DIR . "/admin/models/FMModelFormMakerSQLMapping.php";
|
58 |
+
$model = new FMModelFormMakerSQLMapping();
|
59 |
+
|
60 |
+
require_once WD_FM_DIR . "/admin/views/FMViewFormMakerSQLMapping.php";
|
61 |
+
$view = new FMViewFormMakerSQLMapping($model);
|
62 |
+
$view->db_tables($form_id);
|
63 |
+
}
|
64 |
+
|
65 |
+
public function db_table_struct($form_id) {
|
66 |
+
require_once WD_FM_DIR . "/admin/models/FMModelFormMakerSQLMapping.php";
|
67 |
+
$model = new FMModelFormMakerSQLMapping();
|
68 |
+
|
69 |
+
require_once WD_FM_DIR . "/admin/views/FMViewFormMakerSQLMapping.php";
|
70 |
+
$view = new FMViewFormMakerSQLMapping($model);
|
71 |
+
$view->db_table_struct($form_id);
|
72 |
+
}
|
73 |
+
|
74 |
+
public function save_query() {
|
75 |
+
global $wpdb;
|
76 |
+
$form_id = ((isset($_GET['form_id'])) ? esc_html($_GET['form_id']) : 0);
|
77 |
+
$query = ((isset($_POST['query'])) ? stripslashes(wp_specialchars_decode($_POST['query'])) : "");
|
78 |
+
$details = ((isset($_POST['details'])) ? esc_html($_POST['details']) : "");
|
79 |
+
$save = $wpdb->insert($wpdb->prefix . 'formmaker_query', array(
|
80 |
+
'form_id' => $form_id,
|
81 |
+
'query' => $query,
|
82 |
+
'details' => $details,
|
83 |
+
), array(
|
84 |
+
'%d',
|
85 |
+
'%s',
|
86 |
+
'%s',
|
87 |
+
));
|
88 |
+
}
|
89 |
+
|
90 |
+
public function update_query() {
|
91 |
+
global $wpdb;
|
92 |
+
$id = ((isset($_GET['id'])) ? esc_html($_GET['id']) : 0);
|
93 |
+
$form_id = ((isset($_GET['form_id'])) ? esc_html($_GET['form_id']) : 0);
|
94 |
+
$query = ((isset($_POST['query'])) ? stripslashes(wp_specialchars_decode($_POST['query'])) : "");
|
95 |
+
$details = ((isset($_POST['details'])) ? esc_html($_POST['details']) : "");
|
96 |
+
$save = $wpdb->update($wpdb->prefix . 'formmaker_query', array(
|
97 |
+
'form_id' => $form_id,
|
98 |
+
'query' => $query,
|
99 |
+
'details' => $details,
|
100 |
+
), array('id' => $id));
|
101 |
+
}
|
102 |
+
|
103 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
104 |
+
// Getters & Setters //
|
105 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
106 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
107 |
+
// Private Methods //
|
108 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
109 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
110 |
+
// Listeners //
|
111 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
112 |
}
|
admin/controllers/FMControllerFormmakerwdcaptcha.php
CHANGED
@@ -1,43 +1,43 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerFormmakerwdcaptcha {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function execute() {
|
22 |
-
$this->display();
|
23 |
-
}
|
24 |
-
|
25 |
-
public function display() {
|
26 |
-
require_once WD_FM_DIR . "/admin/models/FMModelFormmakerwdcaptcha.php";
|
27 |
-
$model = new FMModelFormmakerwdcaptcha();
|
28 |
-
|
29 |
-
require_once WD_FM_DIR . "/admin/views/FMViewFormmakerwdcaptcha.php";
|
30 |
-
$view = new FMViewFormmakerwdcaptcha($model);
|
31 |
-
$view->display();
|
32 |
-
}
|
33 |
-
|
34 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
35 |
-
// Getters & Setters //
|
36 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
37 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
38 |
-
// Private Methods //
|
39 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
40 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
41 |
-
// Listeners //
|
42 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
43 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FMControllerFormmakerwdcaptcha {
|
4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
+
// Events //
|
6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
+
// Constants //
|
9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
+
// Variables //
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
+
// Constructor & Destructor //
|
15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
+
public function __construct() {
|
17 |
+
}
|
18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
+
// Public Methods //
|
20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
+
public function execute() {
|
22 |
+
$this->display();
|
23 |
+
}
|
24 |
+
|
25 |
+
public function display() {
|
26 |
+
require_once WD_FM_DIR . "/admin/models/FMModelFormmakerwdcaptcha.php";
|
27 |
+
$model = new FMModelFormmakerwdcaptcha();
|
28 |
+
|
29 |
+
require_once WD_FM_DIR . "/admin/views/FMViewFormmakerwdcaptcha.php";
|
30 |
+
$view = new FMViewFormmakerwdcaptcha($model);
|
31 |
+
$view->display();
|
32 |
+
}
|
33 |
+
|
34 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
35 |
+
// Getters & Setters //
|
36 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
37 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
38 |
+
// Private Methods //
|
39 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
40 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
41 |
+
// Listeners //
|
42 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
43 |
}
|
admin/controllers/FMControllerFormmakerwindow.php
CHANGED
@@ -1,43 +1,43 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerFormmakerwindow {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function execute() {
|
22 |
-
$this->display();
|
23 |
-
}
|
24 |
-
|
25 |
-
public function display() {
|
26 |
-
require_once WD_FM_DIR . "/admin/models/FMModelFormmakerwindow.php";
|
27 |
-
$model = new FMModelFormmakerwindow();
|
28 |
-
|
29 |
-
require_once WD_FM_DIR . "/admin/views/FMViewFormmakerwindow.php";
|
30 |
-
$view = new FMViewFormmakerwindow($model);
|
31 |
-
$view->display();
|
32 |
-
}
|
33 |
-
|
34 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
35 |
-
// Getters & Setters //
|
36 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
37 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
38 |
-
// Private Methods //
|
39 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
40 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
41 |
-
// Listeners //
|
42 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
43 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FMControllerFormmakerwindow {
|
4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
+
// Events //
|
6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
+
// Constants //
|
9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
+
// Variables //
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
+
// Constructor & Destructor //
|
15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
+
public function __construct() {
|
17 |
+
}
|
18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
+
// Public Methods //
|
20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
+
public function execute() {
|
22 |
+
$this->display();
|
23 |
+
}
|
24 |
+
|
25 |
+
public function display() {
|
26 |
+
require_once WD_FM_DIR . "/admin/models/FMModelFormmakerwindow.php";
|
27 |
+
$model = new FMModelFormmakerwindow();
|
28 |
+
|
29 |
+
require_once WD_FM_DIR . "/admin/views/FMViewFormmakerwindow.php";
|
30 |
+
$view = new FMViewFormmakerwindow($model);
|
31 |
+
$view->display();
|
32 |
+
}
|
33 |
+
|
34 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
35 |
+
// Getters & Setters //
|
36 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
37 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
38 |
+
// Private Methods //
|
39 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
40 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
41 |
+
// Listeners //
|
42 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
43 |
}
|
admin/controllers/FMControllerFromeditcountryinpopup.php
CHANGED
@@ -1,43 +1,43 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerFromeditcountryinpopup {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function execute() {
|
22 |
-
$this->display();
|
23 |
-
}
|
24 |
-
|
25 |
-
public function display() {
|
26 |
-
require_once WD_FM_DIR . "/admin/models/FMModelFromeditcountryinpopup.php";
|
27 |
-
$model = new FMModelFromeditcountryinpopup();
|
28 |
-
|
29 |
-
require_once WD_FM_DIR . "/admin/views/FMViewFromeditcountryinpopup.php";
|
30 |
-
$view = new FMViewFromeditcountryinpopup($model);
|
31 |
-
$view->display();
|
32 |
-
}
|
33 |
-
|
34 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
35 |
-
// Getters & Setters //
|
36 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
37 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
38 |
-
// Private Methods //
|
39 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
40 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
41 |
-
// Listeners //
|
42 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
43 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FMControllerFromeditcountryinpopup {
|
4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
+
// Events //
|
6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
+
// Constants //
|
9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
+
// Variables //
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
+
// Constructor & Destructor //
|
15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
+
public function __construct() {
|
17 |
+
}
|
18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
+
// Public Methods //
|
20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
+
public function execute() {
|
22 |
+
$this->display();
|
23 |
+
}
|
24 |
+
|
25 |
+
public function display() {
|
26 |
+
require_once WD_FM_DIR . "/admin/models/FMModelFromeditcountryinpopup.php";
|
27 |
+
$model = new FMModelFromeditcountryinpopup();
|
28 |
+
|
29 |
+
require_once WD_FM_DIR . "/admin/views/FMViewFromeditcountryinpopup.php";
|
30 |
+
$view = new FMViewFromeditcountryinpopup($model);
|
31 |
+
$view->display();
|
32 |
+
}
|
33 |
+
|
34 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
35 |
+
// Getters & Setters //
|
36 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
37 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
38 |
+
// Private Methods //
|
39 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
40 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
41 |
+
// Listeners //
|
42 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
43 |
}
|
admin/controllers/FMControllerFromipinfoinpopup.php
CHANGED
@@ -1,43 +1,43 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerFromipinfoinpopup {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function execute() {
|
22 |
-
$this->display();
|
23 |
-
}
|
24 |
-
|
25 |
-
public function display() {
|
26 |
-
require_once WD_FM_DIR . "/admin/models/FMModelFromipinfoinpopup.php";
|
27 |
-
$model = new FMModelFromipinfoinpopup();
|
28 |
-
|
29 |
-
require_once WD_FM_DIR . "/admin/views/FMViewFromipinfoinpopup.php";
|
30 |
-
$view = new FMViewFromipinfoinpopup($model);
|
31 |
-
$view->display();
|
32 |
-
}
|
33 |
-
|
34 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
35 |
-
// Getters & Setters //
|
36 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
37 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
38 |
-
// Private Methods //
|
39 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
40 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
41 |
-
// Listeners //
|
42 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
43 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FMControllerFromipinfoinpopup {
|
4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
+
// Events //
|
6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
+
// Constants //
|
9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
+
// Variables //
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
+
// Constructor & Destructor //
|
15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
+
public function __construct() {
|
17 |
+
}
|
18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
+
// Public Methods //
|
20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
+
public function execute() {
|
22 |
+
$this->display();
|
23 |
+
}
|
24 |
+
|
25 |
+
public function display() {
|
26 |
+
require_once WD_FM_DIR . "/admin/models/FMModelFromipinfoinpopup.php";
|
27 |
+
$model = new FMModelFromipinfoinpopup();
|
28 |
+
|
29 |
+
require_once WD_FM_DIR . "/admin/views/FMViewFromipinfoinpopup.php";
|
30 |
+
$view = new FMViewFromipinfoinpopup($model);
|
31 |
+
$view->display();
|
32 |
+
}
|
33 |
+
|
34 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
35 |
+
// Getters & Setters //
|
36 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
37 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
38 |
+
// Private Methods //
|
39 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
40 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
41 |
+
// Listeners //
|
42 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
43 |
}
|
admin/controllers/FMControllerFrommapeditinpopup.php
CHANGED
@@ -1,43 +1,43 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerFrommapeditinpopup {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function execute() {
|
22 |
-
$this->display();
|
23 |
-
}
|
24 |
-
|
25 |
-
public function display() {
|
26 |
-
require_once WD_FM_DIR . "/admin/models/FMModelFrommapeditinpopup.php";
|
27 |
-
$model = new FMModelFrommapeditinpopup();
|
28 |
-
|
29 |
-
require_once WD_FM_DIR . "/admin/views/FMViewFrommapeditinpopup.php";
|
30 |
-
$view = new FMViewFrommapeditinpopup($model);
|
31 |
-
$view->display();
|
32 |
-
}
|
33 |
-
|
34 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
35 |
-
// Getters & Setters //
|
36 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
37 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
38 |
-
// Private Methods //
|
39 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
40 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
41 |
-
// Listeners //
|
42 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
43 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FMControllerFrommapeditinpopup {
|
4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
+
// Events //
|
6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
+
// Constants //
|
9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
+
// Variables //
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
+
// Constructor & Destructor //
|
15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
+
public function __construct() {
|
17 |
+
}
|
18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
+
// Public Methods //
|
20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
+
public function execute() {
|
22 |
+
$this->display();
|
23 |
+
}
|
24 |
+
|
25 |
+
public function display() {
|
26 |
+
require_once WD_FM_DIR . "/admin/models/FMModelFrommapeditinpopup.php";
|
27 |
+
$model = new FMModelFrommapeditinpopup();
|
28 |
+
|
29 |
+
require_once WD_FM_DIR . "/admin/views/FMViewFrommapeditinpopup.php";
|
30 |
+
$view = new FMViewFrommapeditinpopup($model);
|
31 |
+
$view->display();
|
32 |
+
}
|
33 |
+
|
34 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
35 |
+
// Getters & Setters //
|
36 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
37 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
38 |
+
// Private Methods //
|
39 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
40 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
41 |
+
// Listeners //
|
42 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
43 |
}
|
admin/controllers/FMControllerGenerete_csv.php
CHANGED
@@ -1,43 +1,43 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerGenerete_csv {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function execute() {
|
22 |
-
$this->display();
|
23 |
-
}
|
24 |
-
|
25 |
-
public function display() {
|
26 |
-
require_once WD_FM_DIR . "/admin/models/FMModelGenerete_csv.php";
|
27 |
-
$model = new FMModelGenerete_csv();
|
28 |
-
|
29 |
-
require_once WD_FM_DIR . "/admin/views/FMViewGenerete_csv.php";
|
30 |
-
$view = new FMViewGenerete_csv($model);
|
31 |
-
$view->display();
|
32 |
-
}
|
33 |
-
|
34 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
35 |
-
// Getters & Setters //
|
36 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
37 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
38 |
-
// Private Methods //
|
39 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
40 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
41 |
-
// Listeners //
|
42 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
43 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FMControllerGenerete_csv {
|
4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
+
// Events //
|
6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
+
// Constants //
|
9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
+
// Variables //
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
+
// Constructor & Destructor //
|
15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
+
public function __construct() {
|
17 |
+
}
|
18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
+
// Public Methods //
|
20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
+
public function execute() {
|
22 |
+
$this->display();
|
23 |
+
}
|
24 |
+
|
25 |
+
public function display() {
|
26 |
+
require_once WD_FM_DIR . "/admin/models/FMModelGenerete_csv.php";
|
27 |
+
$model = new FMModelGenerete_csv();
|
28 |
+
|
29 |
+
require_once WD_FM_DIR . "/admin/views/FMViewGenerete_csv.php";
|
30 |
+
$view = new FMViewGenerete_csv($model);
|
31 |
+
$view->display();
|
32 |
+
}
|
33 |
+
|
34 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
35 |
+
// Getters & Setters //
|
36 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
37 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
38 |
+
// Private Methods //
|
39 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
40 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
41 |
+
// Listeners //
|
42 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
43 |
}
|
admin/controllers/FMControllerGenerete_xml.php
CHANGED
@@ -1,43 +1,43 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerGenerete_xml {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function execute() {
|
22 |
-
$this->display();
|
23 |
-
}
|
24 |
-
|
25 |
-
public function display() {
|
26 |
-
require_once WD_FM_DIR . "/admin/models/FMModelGenerete_xml.php";
|
27 |
-
$model = new FMModelGenerete_xml();
|
28 |
-
|
29 |
-
require_once WD_FM_DIR . "/admin/views/FMViewGenerete_xml.php";
|
30 |
-
$view = new FMViewGenerete_xml($model);
|
31 |
-
$view->display();
|
32 |
-
}
|
33 |
-
|
34 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
35 |
-
// Getters & Setters //
|
36 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
37 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
38 |
-
// Private Methods //
|
39 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
40 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
41 |
-
// Listeners //
|
42 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
43 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FMControllerGenerete_xml {
|
4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
+
// Events //
|
6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
+
// Constants //
|
9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
+
// Variables //
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
+
// Constructor & Destructor //
|
15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
+
public function __construct() {
|
17 |
+
}
|
18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
+
// Public Methods //
|
20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
+
public function execute() {
|
22 |
+
$this->display();
|
23 |
+
}
|
24 |
+
|
25 |
+
public function display() {
|
26 |
+
require_once WD_FM_DIR . "/admin/models/FMModelGenerete_xml.php";
|
27 |
+
$model = new FMModelGenerete_xml();
|
28 |
+
|
29 |
+
require_once WD_FM_DIR . "/admin/views/FMViewGenerete_xml.php";
|
30 |
+
$view = new FMViewGenerete_xml($model);
|
31 |
+
$view->display();
|
32 |
+
}
|
33 |
+
|
34 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
35 |
+
// Getters & Setters //
|
36 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
37 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
38 |
+
// Private Methods //
|
39 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
40 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
41 |
+
// Listeners //
|
42 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
43 |
}
|
admin/controllers/FMControllerLicensing_fm.php
CHANGED
@@ -1,49 +1,49 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerLicensing_fm {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function execute() {
|
22 |
-
$task = ((isset($_POST['task'])) ? esc_html(stripslashes($_POST['task'])) : '');
|
23 |
-
if (method_exists($this, $task)) {
|
24 |
-
$this->$task($id);
|
25 |
-
}
|
26 |
-
else {
|
27 |
-
$this->display();
|
28 |
-
}
|
29 |
-
}
|
30 |
-
|
31 |
-
public function display() {
|
32 |
-
require_once WD_FM_DIR . "/admin/models/FMModelLicensing_fm.php";
|
33 |
-
$model = new FMModelLicensing_fm();
|
34 |
-
|
35 |
-
require_once WD_FM_DIR . "/admin/views/FMViewLicensing_fm.php";
|
36 |
-
$view = new FMViewLicensing_fm($model);
|
37 |
-
$view->display();
|
38 |
-
}
|
39 |
-
|
40 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
41 |
-
// Getters & Setters //
|
42 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
43 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
44 |
-
// Private Methods //
|
45 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
46 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
47 |
-
// Listeners //
|
48 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
49 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FMControllerLicensing_fm {
|
4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
+
// Events //
|
6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
+
// Constants //
|
9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
+
// Variables //
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
+
// Constructor & Destructor //
|
15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
+
public function __construct() {
|
17 |
+
}
|
18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
+
// Public Methods //
|
20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
+
public function execute() {
|
22 |
+
$task = ((isset($_POST['task'])) ? esc_html(stripslashes($_POST['task'])) : '');
|
23 |
+
if (method_exists($this, $task)) {
|
24 |
+
$this->$task($id);
|
25 |
+
}
|
26 |
+
else {
|
27 |
+
$this->display();
|
28 |
+
}
|
29 |
+
}
|
30 |
+
|
31 |
+
public function display() {
|
32 |
+
require_once WD_FM_DIR . "/admin/models/FMModelLicensing_fm.php";
|
33 |
+
$model = new FMModelLicensing_fm();
|
34 |
+
|
35 |
+
require_once WD_FM_DIR . "/admin/views/FMViewLicensing_fm.php";
|
36 |
+
$view = new FMViewLicensing_fm($model);
|
37 |
+
$view->display();
|
38 |
+
}
|
39 |
+
|
40 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
41 |
+
// Getters & Setters //
|
42 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
43 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
44 |
+
// Private Methods //
|
45 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
46 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
47 |
+
// Listeners //
|
48 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
49 |
}
|
admin/controllers/FMControllerManage_fm.php
CHANGED
@@ -1,993 +1,993 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerManage_fm {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function execute() {
|
22 |
-
// $task = ((isset($_POST['task'])) ? esc_html($_POST['task']) : '');
|
23 |
-
// $id = ((isset($_POST['current_id'])) ? esc_html($_POST['current_id']) : 0);
|
24 |
-
$task = WDW_FM_Library::get('task');
|
25 |
-
$id = WDW_FM_Library::get('current_id', 0);
|
26 |
-
$message = WDW_FM_Library::get('message');
|
27 |
-
echo WDW_FM_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_FM_DIR . "/admin/models/FMModelManage_fm.php";
|
38 |
-
$model = new FMModelManage_fm();
|
39 |
-
|
40 |
-
require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
|
41 |
-
$view = new FMViewManage_fm($model);
|
42 |
-
$view->display();
|
43 |
-
}
|
44 |
-
|
45 |
-
public function add() {
|
46 |
-
require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
|
47 |
-
$model = new FMModelManage_fm();
|
48 |
-
|
49 |
-
require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
|
50 |
-
$view = new FMViewManage_fm($model);
|
51 |
-
$view->edit(0);
|
52 |
-
}
|
53 |
-
|
54 |
-
public function edit() {
|
55 |
-
require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
|
56 |
-
$model = new FMModelManage_fm();
|
57 |
-
|
58 |
-
require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
|
59 |
-
$view = new FMViewManage_fm($model);
|
60 |
-
// $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
|
61 |
-
$id = WDW_FM_Library::get('current_id', 0);
|
62 |
-
$view->edit($id);
|
63 |
-
}
|
64 |
-
|
65 |
-
public function edit_old() {
|
66 |
-
require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
|
67 |
-
$model = new FMModelManage_fm();
|
68 |
-
|
69 |
-
require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
|
70 |
-
$view = new FMViewManage_fm($model);
|
71 |
-
// $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
|
72 |
-
$id = WDW_FM_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_FM_DIR . "/admin/models/FMModelManage_fm.php";
|
82 |
-
$model = new FMModelManage_fm();
|
83 |
-
|
84 |
-
require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
|
85 |
-
$view = new FMViewManage_fm($model);
|
86 |
-
// $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
|
87 |
-
global $wpdb;
|
88 |
-
$id = WDW_FM_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_FM_Library::get('page');
|
96 |
-
$current_id = WDW_FM_Library::get('current_id', 0);
|
97 |
-
WDW_FM_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_FM_DIR . "/admin/models/FMModelManage_fm.php";
|
103 |
-
$model = new FMModelManage_fm();
|
104 |
-
|
105 |
-
require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
|
106 |
-
$view = new FMViewManage_fm($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_FM_Library::get('page');
|
110 |
-
$current_id = WDW_FM_Library::get('current_id', 0);
|
111 |
-
$fieldset_id = WDW_FM_Library::get('fieldset_id', 'general');
|
112 |
-
WDW_FM_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_FM_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_FM_DIR . "/admin/models/FMModelManage_fm.php";
|
198 |
-
$model = new FMModelManage_fm();
|
199 |
-
|
200 |
-
require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
|
201 |
-
$view = new FMViewManage_fm($model);
|
202 |
-
// $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
|
203 |
-
global $wpdb;
|
204 |
-
$id = WDW_FM_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_FM_Library::get('page');
|
212 |
-
$current_id = WDW_FM_Library::get('current_id', 0);
|
213 |
-
WDW_FM_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_FM_DIR . "/admin/models/FMModelManage_fm.php";
|
219 |
-
$model = new FMModelManage_fm();
|
220 |
-
|
221 |
-
require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
|
222 |
-
$view = new FMViewManage_fm($model);
|
223 |
-
// $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
|
224 |
-
$page = WDW_FM_Library::get('page');
|
225 |
-
$current_id = WDW_FM_Library::get('current_id', 0);
|
226 |
-
WDW_FM_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_FM_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_FM_DIR . "/admin/models/FMModelManage_fm.php";
|
253 |
-
$model = new FMModelManage_fm();
|
254 |
-
|
255 |
-
require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
|
256 |
-
$view = new FMViewManage_fm($model);
|
257 |
-
// $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
|
258 |
-
global $wpdb;
|
259 |
-
$id = WDW_FM_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_FM_Library::get('page');
|
267 |
-
$current_id = WDW_FM_Library::get('current_id', 0);
|
268 |
-
WDW_FM_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_FM_DIR . "/admin/models/FMModelManage_fm.php";
|
274 |
-
$model = new FMModelManage_fm();
|
275 |
-
|
276 |
-
require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
|
277 |
-
$view = new FMViewManage_fm($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_FM_Library::get('page');
|
281 |
-
$current_id = WDW_FM_Library::get('current_id', 0);
|
282 |
-
$fieldset_id = WDW_FM_Library::get('fieldset_id', 'general');
|
283 |
-
WDW_FM_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 remove_query() {
|
287 |
-
global $wpdb;
|
288 |
-
$cid = ((isset($_POST['cid']) && $_POST['cid'] != '') ? $_POST['cid'] : NULL);
|
289 |
-
if (count($cid)) {
|
290 |
-
$cids = implode(',', $cid);
|
291 |
-
$query = 'DELETE FROM ' . $wpdb->prefix . 'formmaker_query WHERE id IN ( ' . $cids . ' )';
|
292 |
-
if ($wpdb->query($query)) {
|
293 |
-
echo WDW_FM_Library::message('Items Succesfully Deleted.', 'updated');
|
294 |
-
}
|
295 |
-
else {
|
296 |
-
echo WDW_FM_Library::message('Error. Please install plugin again.', 'error');
|
297 |
-
}
|
298 |
-
}
|
299 |
-
else {
|
300 |
-
echo WDW_FM_Library::message('You must select at least one item.', 'error');
|
301 |
-
}
|
302 |
-
$this->apply_options();
|
303 |
-
}
|
304 |
-
|
305 |
-
public function cancel_options() {
|
306 |
-
$this->edit();
|
307 |
-
}
|
308 |
-
|
309 |
-
public function save_db_options() {
|
310 |
-
$javascript = "// Before the form is loaded.
|
311 |
-
function before_load() {
|
312 |
-
|
313 |
-
}
|
314 |
-
// Before form submit.
|
315 |
-
function before_submit() {
|
316 |
-
|
317 |
-
}
|
318 |
-
// Before form reset.
|
319 |
-
function before_reset() {
|
320 |
-
|
321 |
-
}";
|
322 |
-
global $wpdb;
|
323 |
-
// $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
|
324 |
-
$id = WDW_FM_Library::get('current_id', 0);
|
325 |
-
$published = (isset($_POST['published']) ? esc_html(stripslashes($_POST['published'])) : 1);
|
326 |
-
$savedb = (isset($_POST['savedb']) ? esc_html(stripslashes($_POST['savedb'])) : 1);
|
327 |
-
$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"));
|
328 |
-
$requiredmark = (isset($_POST['requiredmark']) ? esc_html(stripslashes($_POST['requiredmark'])) : '*');
|
329 |
-
$sendemail = (isset($_POST['sendemail']) ? esc_html(stripslashes($_POST['sendemail'])) : 1);
|
330 |
-
$mail = (isset($_POST['mail']) ? esc_html(stripslashes($_POST['mail'])) : '');
|
331 |
-
if (isset($_POST['mailToAdd']) && esc_html(stripslashes($_POST['mailToAdd'])) != '') {
|
332 |
-
$mail .= esc_html(stripslashes($_POST['mailToAdd'])) . ',';
|
333 |
-
}
|
334 |
-
$from_mail = (isset($_POST['from_mail']) ? esc_html(stripslashes($_POST['from_mail'])) : '');
|
335 |
-
$from_name = (isset($_POST['from_name']) ? esc_html(stripslashes($_POST['from_name'])) : '');
|
336 |
-
$reply_to = (isset($_POST['reply_to']) ? esc_html(stripslashes($_POST['reply_to'])) : '');
|
337 |
-
if ($from_mail == "other") {
|
338 |
-
$from_mail = (isset($_POST['mail_from_other']) ? esc_html(stripslashes($_POST['mail_from_other'])) : '');
|
339 |
-
}
|
340 |
-
if ($reply_to == "other") {
|
341 |
-
$reply_to = (isset($_POST['reply_to_other']) ? esc_html(stripslashes($_POST['reply_to_other'])) : '');
|
342 |
-
}
|
343 |
-
$script_mail = (isset($_POST['script_mail']) ? stripslashes($_POST['script_mail']) : '%all%');
|
344 |
-
$mail_from_user = (isset($_POST['mail_from_user']) ? esc_html(stripslashes($_POST['mail_from_user'])) : '');
|
345 |
-
$mail_from_name_user = (isset($_POST['mail_from_name_user']) ? esc_html(stripslashes($_POST['mail_from_name_user'])) : '');
|
346 |
-
$reply_to_user = (isset($_POST['reply_to_user']) ? esc_html(stripslashes($_POST['reply_to_user'])) : '');
|
347 |
-
$condition = (isset($_POST['condition']) ? esc_html(stripslashes($_POST['condition'])) : '');
|
348 |
-
$mail_cc = (isset($_POST['mail_cc']) ? esc_html(stripslashes($_POST['mail_cc'])) : '');
|
349 |
-
$mail_cc_user = (isset($_POST['mail_cc_user']) ? esc_html(stripslashes($_POST['mail_cc_user'])) : '');
|
350 |
-
$mail_bcc = (isset($_POST['mail_bcc']) ? esc_html(stripslashes($_POST['mail_bcc'])) : '');
|
351 |
-
$mail_bcc_user = (isset($_POST['mail_bcc_user']) ? esc_html(stripslashes($_POST['mail_bcc_user'])) : '');
|
352 |
-
$mail_subject = (isset($_POST['mail_subject']) ? esc_html(stripslashes($_POST['mail_subject'])) : '');
|
353 |
-
$mail_subject_user = (isset($_POST['mail_subject_user']) ? esc_html(stripslashes($_POST['mail_subject_user'])) : '');
|
354 |
-
$mail_mode = (isset($_POST['mail_mode']) ? esc_html(stripslashes($_POST['mail_mode'])) : 1);
|
355 |
-
$mail_mode_user = (isset($_POST['mail_mode_user']) ? esc_html(stripslashes($_POST['mail_mode_user'])) : 1);
|
356 |
-
$mail_attachment = (isset($_POST['mail_attachment']) ? esc_html(stripslashes($_POST['mail_attachment'])) : 1);
|
357 |
-
$mail_attachment_user = (isset($_POST['mail_attachment_user']) ? esc_html(stripslashes($_POST['mail_attachment_user'])) : 1);
|
358 |
-
$script_mail_user = (isset($_POST['script_mail_user']) ? stripslashes($_POST['script_mail_user']) : '%all%');
|
359 |
-
$submit_text = (isset($_POST['submit_text']) ? stripslashes($_POST['submit_text']) : '');
|
360 |
-
$url = (isset($_POST['url']) ? esc_html(stripslashes($_POST['url'])) : '');
|
361 |
-
$tax = (isset($_POST['tax']) ? esc_html(stripslashes($_POST['tax'])) : 0);
|
362 |
-
$payment_currency = (isset($_POST['payment_currency']) ? stripslashes($_POST['payment_currency']) : '');
|
363 |
-
$paypal_email = (isset($_POST['paypal_email']) ? esc_html(stripslashes($_POST['paypal_email'])) : '');
|
364 |
-
$checkout_mode = (isset($_POST['checkout_mode']) ? esc_html(stripslashes($_POST['checkout_mode'])) : 'testmode');
|
365 |
-
$paypal_mode = (isset($_POST['paypal_mode']) ? esc_html(stripslashes($_POST['paypal_mode'])) : 0);
|
366 |
-
$javascript = (isset($_POST['javascript']) ? stripslashes($_POST['javascript']) : $javascript);
|
367 |
-
$send_to = '';
|
368 |
-
for ($i = 0; $i < 20; $i++) {
|
369 |
-
if (isset($_POST['send_to' . $i])) {
|
370 |
-
$send_to .= '*' . esc_html(stripslashes($_POST['send_to' . $i])) . '*';
|
371 |
-
}
|
372 |
-
}
|
373 |
-
if (isset($_POST['submit_text_type'])) {
|
374 |
-
$submit_text_type = esc_html(stripslashes($_POST['submit_text_type']));
|
375 |
-
if ($submit_text_type == 5) {
|
376 |
-
$article_id = (isset($_POST['page_name']) ? esc_html(stripslashes($_POST['page_name'])) : 0);
|
377 |
-
}
|
378 |
-
else {
|
379 |
-
$article_id = (isset($_POST['post_name']) ? esc_html(stripslashes($_POST['post_name'])) : 0);
|
380 |
-
}
|
381 |
-
}
|
382 |
-
else {
|
383 |
-
$submit_text_type = 0;
|
384 |
-
$article_id = 0;
|
385 |
-
}
|
386 |
-
$save = $wpdb->update($wpdb->prefix . 'formmaker', array(
|
387 |
-
'published' => $published,
|
388 |
-
'savedb' => $savedb,
|
389 |
-
'theme' => $theme,
|
390 |
-
'requiredmark' => $requiredmark,
|
391 |
-
'sendemail' => $sendemail,
|
392 |
-
'mail' => $mail,
|
393 |
-
'from_mail' => $from_mail,
|
394 |
-
'from_name' => $from_name,
|
395 |
-
'reply_to' => $reply_to,
|
396 |
-
'script_mail' => $script_mail,
|
397 |
-
'mail_from_user' => $mail_from_user,
|
398 |
-
'mail_from_name_user' => $mail_from_name_user,
|
399 |
-
'reply_to_user' => $reply_to_user,
|
400 |
-
'condition' => $condition,
|
401 |
-
'mail_cc' => $mail_cc,
|
402 |
-
'mail_cc_user' => $mail_cc_user,
|
403 |
-
'mail_bcc' => $mail_bcc,
|
404 |
-
'mail_bcc_user' => $mail_bcc_user,
|
405 |
-
'mail_subject' => $mail_subject,
|
406 |
-
'mail_subject_user' => $mail_subject_user,
|
407 |
-
'mail_mode' => $mail_mode,
|
408 |
-
'mail_mode_user' => $mail_mode_user,
|
409 |
-
'mail_attachment' => $mail_attachment,
|
410 |
-
'mail_attachment_user' => $mail_attachment_user,
|
411 |
-
'script_mail_user' => $script_mail_user,
|
412 |
-
'submit_text' => $submit_text,
|
413 |
-
'url' => $url,
|
414 |
-
'submit_text_type' => $submit_text_type,
|
415 |
-
'article_id' => $article_id,
|
416 |
-
'tax' => $tax,
|
417 |
-
'payment_currency' => $payment_currency,
|
418 |
-
'paypal_email' => $paypal_email,
|
419 |
-
'checkout_mode' => $checkout_mode,
|
420 |
-
'paypal_mode' => $paypal_mode,
|
421 |
-
'javascript' => $javascript,
|
422 |
-
'send_to' => $send_to,
|
423 |
-
), array('id' => $id));
|
424 |
-
if ($save !== FALSE) {
|
425 |
-
return 8;
|
426 |
-
}
|
427 |
-
else {
|
428 |
-
return 2;
|
429 |
-
}
|
430 |
-
}
|
431 |
-
|
432 |
-
public function save_as_copy_old() {
|
433 |
-
$message = $this->save_db_as_copy_old();
|
434 |
-
// $this->display();
|
435 |
-
$page = WDW_FM_Library::get('page');
|
436 |
-
WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
437 |
-
}
|
438 |
-
|
439 |
-
public function save_old() {
|
440 |
-
$message = $this->save_db_old();
|
441 |
-
// $this->display();
|
442 |
-
$page = WDW_FM_Library::get('page');
|
443 |
-
WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
444 |
-
}
|
445 |
-
|
446 |
-
public function apply_old() {
|
447 |
-
global $wpdb;
|
448 |
-
$message = $this->save_db_old();
|
449 |
-
// $this->edit_old();
|
450 |
-
$id = (int) $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
|
451 |
-
$current_id = WDW_FM_Library::get('current_id', $id);
|
452 |
-
$page = WDW_FM_Library::get('page');
|
453 |
-
WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'edit_old', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
|
454 |
-
}
|
455 |
-
|
456 |
-
public function save_db_old() {
|
457 |
-
global $wpdb;
|
458 |
-
// $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
|
459 |
-
$id = WDW_FM_Library::get('current_id', 0);
|
460 |
-
$title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
|
461 |
-
$form = (isset($_POST['form']) ? stripslashes($_POST['form']) : '');
|
462 |
-
$form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
|
463 |
-
$counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
|
464 |
-
$label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
|
465 |
-
$label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
|
466 |
-
$pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
|
467 |
-
$show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
|
468 |
-
$show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
|
469 |
-
$public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
|
470 |
-
$private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
|
471 |
-
$recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
|
472 |
-
|
473 |
-
$save = $wpdb->update($wpdb->prefix . 'formmaker', array(
|
474 |
-
'title' => $title,
|
475 |
-
'form' => $form,
|
476 |
-
'form_front' => $form_front,
|
477 |
-
'counter' => $counter,
|
478 |
-
'label_order' => $label_order,
|
479 |
-
'label_order_current' => $label_order_current,
|
480 |
-
'pagination' => $pagination,
|
481 |
-
'show_title' => $show_title,
|
482 |
-
'show_numbers' => $show_numbers,
|
483 |
-
'public_key' => $public_key,
|
484 |
-
'private_key' => $private_key,
|
485 |
-
'recaptcha_theme' => $recaptcha_theme,
|
486 |
-
), array('id' => $id));
|
487 |
-
if ($save !== FALSE) {
|
488 |
-
return 1;
|
489 |
-
}
|
490 |
-
else {
|
491 |
-
return 2;
|
492 |
-
}
|
493 |
-
}
|
494 |
-
|
495 |
-
public function save_db_as_copy_old() {
|
496 |
-
global $wpdb;
|
497 |
-
// $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
|
498 |
-
$id = WDW_FM_Library::get('current_id', 0);
|
499 |
-
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
|
500 |
-
$title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
|
501 |
-
$form = (isset($_POST['form']) ? stripslashes($_POST['form']) : '');
|
502 |
-
$form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
|
503 |
-
$counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
|
504 |
-
$label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
|
505 |
-
$pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
|
506 |
-
$show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
|
507 |
-
$show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
|
508 |
-
$public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
|
509 |
-
$private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
|
510 |
-
$recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
|
511 |
-
|
512 |
-
$save = $wpdb->insert($wpdb->prefix . 'formmaker', array(
|
513 |
-
'title' => $title,
|
514 |
-
'mail' => $row->mail,
|
515 |
-
'form' => $form,
|
516 |
-
'form_front' => $form_front,
|
517 |
-
'theme' => $row->theme,
|
518 |
-
'counter' => $counter,
|
519 |
-
'label_order' => $label_order,
|
520 |
-
'pagination' => $pagination,
|
521 |
-
'show_title' => $show_title,
|
522 |
-
'show_numbers' => $show_numbers,
|
523 |
-
'public_key' => $public_key,
|
524 |
-
'private_key' => $private_key,
|
525 |
-
'recaptcha_theme' => $recaptcha_theme,
|
526 |
-
'javascript' => $row->javascript,
|
527 |
-
'script1' => $row->script1,
|
528 |
-
'script2' => $row->script2,
|
529 |
-
'script_user1' => $row->script_user1,
|
530 |
-
'script_user2' => $row->script_user2,
|
531 |
-
'submit_text' => $row->submit_text,
|
532 |
-
'url' => $row->url,
|
533 |
-
'article_id' => $row->article_id,
|
534 |
-
'submit_text_type' => $row->submit_text_type,
|
535 |
-
'script_mail' => $row->script_mail,
|
536 |
-
'script_mail_user' => $row->script_mail_user,
|
537 |
-
'paypal_mode' => $row->paypal_mode,
|
538 |
-
'checkout_mode' => $row->checkout_mode,
|
539 |
-
'paypal_email' => $row->paypal_email,
|
540 |
-
'payment_currency' => $row->payment_currency,
|
541 |
-
'tax' => $row->tax,
|
542 |
-
'label_order_current' => $row->label_order_current,
|
543 |
-
'from_mail' => $row->from_mail,
|
544 |
-
'from_name' => $row->from_name,
|
545 |
-
'reply_to_user' => $row->reply_to_user,
|
546 |
-
'mail_from_name_user' => $row->mail_from_name_user,
|
547 |
-
'mail_from_user' => $row->mail_from_user,
|
548 |
-
'custom_front' => $row->custom_front,
|
549 |
-
'autogen_layout' => $row->autogen_layout,
|
550 |
-
'send_to' => $row->send_to,
|
551 |
-
'reply_to' => $row->reply_to,
|
552 |
-
'requiredmark' => $row->requiredmark,
|
553 |
-
'sendemail' => $row->sendemail,
|
554 |
-
'savedb' => $row->savedb,
|
555 |
-
'form_fields' => $row->form_fields,
|
556 |
-
'published' => $row->published
|
557 |
-
), array(
|
558 |
-
'%s',
|
559 |
-
'%s',
|
560 |
-
'%s',
|
561 |
-
'%s',
|
562 |
-
'%d',
|
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 |
-
'%s',
|
576 |
-
'%s',
|
577 |
-
'%s',
|
578 |
-
'%s',
|
579 |
-
'%d',
|
580 |
-
'%s',
|
581 |
-
'%s',
|
582 |
-
'%d',
|
583 |
-
'%s',
|
584 |
-
'%s',
|
585 |
-
'%s',
|
586 |
-
'%s',
|
587 |
-
'%s',
|
588 |
-
'%s',
|
589 |
-
'%s',
|
590 |
-
'%s',
|
591 |
-
'%s',
|
592 |
-
'%s',
|
593 |
-
'%s',
|
594 |
-
'%d',
|
595 |
-
'%s',
|
596 |
-
'%s',
|
597 |
-
'%s',
|
598 |
-
'%d',
|
599 |
-
'%d',
|
600 |
-
'%s',
|
601 |
-
'%d'
|
602 |
-
));
|
603 |
-
$id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
|
604 |
-
$wpdb->insert($wpdb->prefix . 'formmaker_views', array(
|
605 |
-
'form_id' => $id,
|
606 |
-
'views' => 0
|
607 |
-
), array(
|
608 |
-
'%d',
|
609 |
-
'%d'
|
610 |
-
));
|
611 |
-
if ($save !== FALSE) {
|
612 |
-
return 1;
|
613 |
-
}
|
614 |
-
else {
|
615 |
-
return 2;
|
616 |
-
}
|
617 |
-
}
|
618 |
-
|
619 |
-
public function save_as_copy() {
|
620 |
-
$message = $this->save_db_as_copy();
|
621 |
-
// $this->display();
|
622 |
-
$page = WDW_FM_Library::get('page');
|
623 |
-
WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
624 |
-
}
|
625 |
-
|
626 |
-
public function save() {
|
627 |
-
$message = $this->save_db();
|
628 |
-
// $this->display();
|
629 |
-
$page = WDW_FM_Library::get('page');
|
630 |
-
WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
631 |
-
}
|
632 |
-
|
633 |
-
public function apply() {
|
634 |
-
$message = $this->save_db();
|
635 |
-
// $this->edit();
|
636 |
-
global $wpdb;
|
637 |
-
$id = (int) $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
|
638 |
-
$current_id = WDW_FM_Library::get('current_id', $id);
|
639 |
-
$page = WDW_FM_Library::get('page');
|
640 |
-
WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
|
641 |
-
}
|
642 |
-
|
643 |
-
public function save_db() {
|
644 |
-
global $wpdb;
|
645 |
-
$javascript = "// before form is load
|
646 |
-
function before_load() {
|
647 |
-
}
|
648 |
-
// before form submit
|
649 |
-
function before_submit() {
|
650 |
-
}
|
651 |
-
// before form reset
|
652 |
-
function before_reset() {
|
653 |
-
}";
|
654 |
-
// $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
|
655 |
-
$id = WDW_FM_Library::get('current_id', 0);
|
656 |
-
$title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
|
657 |
-
$form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
|
658 |
-
$counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
|
659 |
-
$label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
|
660 |
-
$pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
|
661 |
-
$show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
|
662 |
-
$show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
|
663 |
-
$public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
|
664 |
-
$private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
|
665 |
-
$recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
|
666 |
-
$label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
|
667 |
-
$form_fields = (isset($_POST['form_fields']) ? stripslashes($_POST['form_fields']) : '');
|
668 |
-
|
669 |
-
if ($id != 0) {
|
670 |
-
$save = $wpdb->update($wpdb->prefix . 'formmaker', array(
|
671 |
-
'title' => $title,
|
672 |
-
'form_front' => $form_front,
|
673 |
-
'counter' => $counter,
|
674 |
-
'label_order' => $label_order,
|
675 |
-
'label_order_current' => $label_order_current,
|
676 |
-
'pagination' => $pagination,
|
677 |
-
'show_title' => $show_title,
|
678 |
-
'show_numbers' => $show_numbers,
|
679 |
-
'public_key' => $public_key,
|
680 |
-
'private_key' => $private_key,
|
681 |
-
'recaptcha_theme' => $recaptcha_theme,
|
682 |
-
'form_fields' => $form_fields,
|
683 |
-
), array('id' => $id));
|
684 |
-
}
|
685 |
-
else {
|
686 |
-
$save = $wpdb->insert($wpdb->prefix . 'formmaker', array(
|
687 |
-
'title' => $title,
|
688 |
-
'mail' => '',
|
689 |
-
'form_front' => $form_front,
|
690 |
-
'theme' => $wpdb->get_var("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE css LIKE '%.wdform_section%'"),
|
691 |
-
'counter' => $counter,
|
692 |
-
'label_order' => $label_order,
|
693 |
-
'pagination' => $pagination,
|
694 |
-
'show_title' => $show_title,
|
695 |
-
'show_numbers' => $show_numbers,
|
696 |
-
'public_key' => $public_key,
|
697 |
-
'private_key' => $private_key,
|
698 |
-
'recaptcha_theme' => $recaptcha_theme,
|
699 |
-
'javascript' => $javascript,
|
700 |
-
'submit_text' => '',
|
701 |
-
'url' => '',
|
702 |
-
'article_id' => 0,
|
703 |
-
'submit_text_type' => 0,
|
704 |
-
'script_mail' => '%all%',
|
705 |
-
'script_mail_user' => '%all%',
|
706 |
-
'label_order_current' => $label_order_current,
|
707 |
-
'tax' => 0,
|
708 |
-
'payment_currency' => '',
|
709 |
-
'paypal_email' => '',
|
710 |
-
'checkout_mode' => 'testmode',
|
711 |
-
'paypal_mode' => 0,
|
712 |
-
'published' => 1,
|
713 |
-
'form_fields' => $form_fields,
|
714 |
-
'savedb' => 1,
|
715 |
-
'sendemail' => 1,
|
716 |
-
'requiredmark' => '*',
|
717 |
-
'from_mail' => '',
|
718 |
-
'from_name' => '',
|
719 |
-
'reply_to' => '',
|
720 |
-
'send_to' => '',
|
721 |
-
'autogen_layout' => 1,
|
722 |
-
'custom_front' => '',
|
723 |
-
'mail_from_user' => '',
|
724 |
-
'mail_from_name_user' => '',
|
725 |
-
'reply_to_user' => '',
|
726 |
-
'condition' => '',
|
727 |
-
'mail_cc' => '',
|
728 |
-
'mail_cc_user' => '',
|
729 |
-
'mail_bcc' => '',
|
730 |
-
'mail_bcc_user' => '',
|
731 |
-
'mail_subject' => '',
|
732 |
-
'mail_subject_user' => '',
|
733 |
-
'mail_mode' => 1,
|
734 |
-
'mail_mode_user' => 1,
|
735 |
-
'mail_attachment' => 1,
|
736 |
-
'mail_attachment_user' => 1,
|
737 |
-
), array(
|
738 |
-
'%s',
|
739 |
-
'%s',
|
740 |
-
'%s',
|
741 |
-
'%d',
|
742 |
-
'%d',
|
743 |
-
'%s',
|
744 |
-
'%s',
|
745 |
-
'%s',
|
746 |
-
'%s',
|
747 |
-
'%s',
|
748 |
-
'%s',
|
749 |
-
'%s',
|
750 |
-
'%s',
|
751 |
-
'%s',
|
752 |
-
'%s',
|
753 |
-
'%d',
|
754 |
-
'%d',
|
755 |
-
'%s',
|
756 |
-
'%s',
|
757 |
-
'%s',
|
758 |
-
'%s',
|
759 |
-
'%s',
|
760 |
-
'%s',
|
761 |
-
'%s',
|
762 |
-
'%d',
|
763 |
-
'%d',
|
764 |
-
'%s',
|
765 |
-
'%d',
|
766 |
-
'%d',
|
767 |
-
'%s',
|
768 |
-
'%s',
|
769 |
-
'%s',
|
770 |
-
'%s',
|
771 |
-
'%s',
|
772 |
-
'%d',
|
773 |
-
'%s',
|
774 |
-
'%s',
|
775 |
-
'%s',
|
776 |
-
'%s',
|
777 |
-
'%s',
|
778 |
-
'%s',
|
779 |
-
'%s',
|
780 |
-
'%s',
|
781 |
-
'%s',
|
782 |
-
'%s',
|
783 |
-
'%s',
|
784 |
-
'%d',
|
785 |
-
'%d',
|
786 |
-
'%d',
|
787 |
-
'%d',
|
788 |
-
));
|
789 |
-
$id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
|
790 |
-
// $_POST['current_id'] = $id;
|
791 |
-
$wpdb->insert($wpdb->prefix . 'formmaker_views', array(
|
792 |
-
'form_id' => $id,
|
793 |
-
'views' => 0
|
794 |
-
), array(
|
795 |
-
'%d',
|
796 |
-
'%d'
|
797 |
-
));
|
798 |
-
}
|
799 |
-
if ($save !== FALSE) {
|
800 |
-
return 1;
|
801 |
-
}
|
802 |
-
else {
|
803 |
-
return 2;
|
804 |
-
}
|
805 |
-
}
|
806 |
-
|
807 |
-
public function save_db_as_copy() {
|
808 |
-
global $wpdb;
|
809 |
-
// $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
|
810 |
-
$id = WDW_FM_Library::get('current_id', 0);
|
811 |
-
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
|
812 |
-
$title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
|
813 |
-
$form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
|
814 |
-
$counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
|
815 |
-
$label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
|
816 |
-
$label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
|
817 |
-
$pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
|
818 |
-
$show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
|
819 |
-
$show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
|
820 |
-
$public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
|
821 |
-
$private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
|
822 |
-
$recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
|
823 |
-
$form_fields = (isset($_POST['form_fields']) ? stripslashes($_POST['form_fields']) : '');
|
824 |
-
|
825 |
-
$save = $wpdb->insert($wpdb->prefix . 'formmaker', array(
|
826 |
-
'title' => $title,
|
827 |
-
'mail' => $row->mail,
|
828 |
-
'form_front' => $form_front,
|
829 |
-
'theme' => $row->theme,
|
830 |
-
'counter' => $counter,
|
831 |
-
'label_order' => $label_order,
|
832 |
-
'pagination' => $pagination,
|
833 |
-
'show_title' => $show_title,
|
834 |
-
'show_numbers' => $show_numbers,
|
835 |
-
'public_key' => $public_key,
|
836 |
-
'private_key' => $private_key,
|
837 |
-
'recaptcha_theme' => $recaptcha_theme,
|
838 |
-
'javascript' => $row->javascript,
|
839 |
-
'submit_text' => $row->submit_text,
|
840 |
-
'url' => $row->url,
|
841 |
-
'article_id' => $row->article_id,
|
842 |
-
'submit_text_type' => $row->submit_text_type,
|
843 |
-
'script_mail' => $row->script_mail,
|
844 |
-
'script_mail_user' => $row->script_mail_user,
|
845 |
-
'label_order_current' => $label_order_current,
|
846 |
-
'tax' => $row->tax,
|
847 |
-
'payment_currency' => $row->payment_currency,
|
848 |
-
'paypal_email' => $row->paypal_email,
|
849 |
-
'checkout_mode' => $row->checkout_mode,
|
850 |
-
'paypal_mode' => $row->paypal_mode,
|
851 |
-
'published' => $row->published,
|
852 |
-
'form_fields' => $form_fields,
|
853 |
-
'savedb' => $row->savedb,
|
854 |
-
'sendemail' => $row->sendemail,
|
855 |
-
'requiredmark' => $row->requiredmark,
|
856 |
-
'from_mail' => $row->from_mail,
|
857 |
-
'from_name' => $row->from_name,
|
858 |
-
'reply_to' => $row->reply_to,
|
859 |
-
'send_to' => $row->send_to,
|
860 |
-
'autogen_layout' => $row->autogen_layout,
|
861 |
-
'custom_front' => $row->custom_front,
|
862 |
-
'mail_from_user' => $row->mail_from_user,
|
863 |
-
'mail_from_name_user' => $row->mail_from_name_user,
|
864 |
-
'reply_to_user' => $row->reply_to_user,
|
865 |
-
'condition' => $row->condition,
|
866 |
-
'mail_cc' => $row->mail_cc,
|
867 |
-
'mail_cc_user' => $row->mail_cc_user,
|
868 |
-
'mail_bcc' => $row->mail_bcc,
|
869 |
-
'mail_bcc_user' => $row->mail_bcc_user,
|
870 |
-
'mail_subject' => $row->mail_subject,
|
871 |
-
'mail_subject_user' => $row->mail_subject_user,
|
872 |
-
'mail_mode' => $row->mail_mode,
|
873 |
-
'mail_mode_user' => $row->mail_mode_user,
|
874 |
-
'mail_attachment' => $row->mail_attachment,
|
875 |
-
'mail_attachment_user' => $row->mail_attachment_user,
|
876 |
-
), array(
|
877 |
-
'%s',
|
878 |
-
'%s',
|
879 |
-
'%s',
|
880 |
-
'%d',
|
881 |
-
'%d',
|
882 |
-
'%s',
|
883 |
-
'%s',
|
884 |
-
'%s',
|
885 |
-
'%s',
|
886 |
-
'%s',
|
887 |
-
'%s',
|
888 |
-
'%s',
|
889 |
-
'%s',
|
890 |
-
'%s',
|
891 |
-
'%s',
|
892 |
-
'%d',
|
893 |
-
'%d',
|
894 |
-
'%s',
|
895 |
-
'%s',
|
896 |
-
'%s',
|
897 |
-
'%s',
|
898 |
-
'%s',
|
899 |
-
'%s',
|
900 |
-
'%s',
|
901 |
-
'%d',
|
902 |
-
'%d',
|
903 |
-
'%s',
|
904 |
-
'%d',
|
905 |
-
'%d',
|
906 |
-
'%s',
|
907 |
-
'%s',
|
908 |
-
'%s',
|
909 |
-
'%s',
|
910 |
-
'%s',
|
911 |
-
'%d',
|
912 |
-
'%s',
|
913 |
-
'%s',
|
914 |
-
'%s',
|
915 |
-
'%s',
|
916 |
-
'%s',
|
917 |
-
'%s',
|
918 |
-
'%s',
|
919 |
-
'%s',
|
920 |
-
'%s',
|
921 |
-
'%s',
|
922 |
-
'%s',
|
923 |
-
'%d',
|
924 |
-
'%d',
|
925 |
-
'%d',
|
926 |
-
'%d',
|
927 |
-
));
|
928 |
-
$id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
|
929 |
-
$wpdb->insert($wpdb->prefix . 'formmaker_views', array(
|
930 |
-
'form_id' => $id,
|
931 |
-
'views' => 0
|
932 |
-
), array(
|
933 |
-
'%d',
|
934 |
-
'%d'
|
935 |
-
));
|
936 |
-
if ($save !== FALSE) {
|
937 |
-
return 1;
|
938 |
-
}
|
939 |
-
else {
|
940 |
-
return 2;
|
941 |
-
}
|
942 |
-
}
|
943 |
-
|
944 |
-
public function delete($id) {
|
945 |
-
global $wpdb;
|
946 |
-
$query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id);
|
947 |
-
if ($wpdb->query($query)) {
|
948 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="%d"', $id));
|
949 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id="%d"', $id));
|
950 |
-
$message = 3;
|
951 |
-
}
|
952 |
-
else {
|
953 |
-
$message = 2;
|
954 |
-
}
|
955 |
-
// $this->display();
|
956 |
-
$page = WDW_FM_Library::get('page');
|
957 |
-
WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
958 |
-
}
|
959 |
-
|
960 |
-
public function delete_all() {
|
961 |
-
global $wpdb;
|
962 |
-
$flag = FALSE;
|
963 |
-
$isDefault = FALSE;
|
964 |
-
$form_ids_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker');
|
965 |
-
foreach ($form_ids_col as $form_id) {
|
966 |
-
if (isset($_POST['check_' . $form_id])) {
|
967 |
-
$flag = TRUE;
|
968 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $form_id));
|
969 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="%d"', $form_id));
|
970 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id="%d"', $form_id));
|
971 |
-
}
|
972 |
-
}
|
973 |
-
if ($flag) {
|
974 |
-
$message = 5;
|
975 |
-
}
|
976 |
-
else {
|
977 |
-
$message = 6;
|
978 |
-
}
|
979 |
-
// $this->display();
|
980 |
-
$page = WDW_FM_Library::get('page');
|
981 |
-
WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
982 |
-
}
|
983 |
-
|
984 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
985 |
-
// Getters & Setters //
|
986 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
987 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
988 |
-
// Private Methods //
|
989 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
990 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
991 |
-
// Listeners //
|
992 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
993 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FMControllerManage_fm {
|
4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
+
// Events //
|
6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
+
// Constants //
|
9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
+
// Variables //
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
+
// Constructor & Destructor //
|
15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
+
public function __construct() {
|
17 |
+
}
|
18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
+
// Public Methods //
|
20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
+
public function execute() {
|
22 |
+
// $task = ((isset($_POST['task'])) ? esc_html($_POST['task']) : '');
|
23 |
+
// $id = ((isset($_POST['current_id'])) ? esc_html($_POST['current_id']) : 0);
|
24 |
+
$task = WDW_FM_Library::get('task');
|
25 |
+
$id = WDW_FM_Library::get('current_id', 0);
|
26 |
+
$message = WDW_FM_Library::get('message');
|
27 |
+
echo WDW_FM_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_FM_DIR . "/admin/models/FMModelManage_fm.php";
|
38 |
+
$model = new FMModelManage_fm();
|
39 |
+
|
40 |
+
require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
|
41 |
+
$view = new FMViewManage_fm($model);
|
42 |
+
$view->display();
|
43 |
+
}
|
44 |
+
|
45 |
+
public function add() {
|
46 |
+
require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
|
47 |
+
$model = new FMModelManage_fm();
|
48 |
+
|
49 |
+
require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
|
50 |
+
$view = new FMViewManage_fm($model);
|
51 |
+
$view->edit(0);
|
52 |
+
}
|
53 |
+
|
54 |
+
public function edit() {
|
55 |
+
require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
|
56 |
+
$model = new FMModelManage_fm();
|
57 |
+
|
58 |
+
require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
|
59 |
+
$view = new FMViewManage_fm($model);
|
60 |
+
// $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
|
61 |
+
$id = WDW_FM_Library::get('current_id', 0);
|
62 |
+
$view->edit($id);
|
63 |
+
}
|
64 |
+
|
65 |
+
public function edit_old() {
|
66 |
+
require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
|
67 |
+
$model = new FMModelManage_fm();
|
68 |
+
|
69 |
+
require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
|
70 |
+
$view = new FMViewManage_fm($model);
|
71 |
+
// $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
|
72 |
+
$id = WDW_FM_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_FM_DIR . "/admin/models/FMModelManage_fm.php";
|
82 |
+
$model = new FMModelManage_fm();
|
83 |
+
|
84 |
+
require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
|
85 |
+
$view = new FMViewManage_fm($model);
|
86 |
+
// $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
|
87 |
+
global $wpdb;
|
88 |
+
$id = WDW_FM_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_FM_Library::get('page');
|
96 |
+
$current_id = WDW_FM_Library::get('current_id', 0);
|
97 |
+
WDW_FM_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_FM_DIR . "/admin/models/FMModelManage_fm.php";
|
103 |
+
$model = new FMModelManage_fm();
|
104 |
+
|
105 |
+
require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
|
106 |
+
$view = new FMViewManage_fm($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_FM_Library::get('page');
|
110 |
+
$current_id = WDW_FM_Library::get('current_id', 0);
|
111 |
+
$fieldset_id = WDW_FM_Library::get('fieldset_id', 'general');
|
112 |
+
WDW_FM_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_FM_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_FM_DIR . "/admin/models/FMModelManage_fm.php";
|
198 |
+
$model = new FMModelManage_fm();
|
199 |
+
|
200 |
+
require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
|
201 |
+
$view = new FMViewManage_fm($model);
|
202 |
+
// $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
|
203 |
+
global $wpdb;
|
204 |
+
$id = WDW_FM_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_FM_Library::get('page');
|
212 |
+
$current_id = WDW_FM_Library::get('current_id', 0);
|
213 |
+
WDW_FM_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_FM_DIR . "/admin/models/FMModelManage_fm.php";
|
219 |
+
$model = new FMModelManage_fm();
|
220 |
+
|
221 |
+
require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
|
222 |
+
$view = new FMViewManage_fm($model);
|
223 |
+
// $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
|
224 |
+
$page = WDW_FM_Library::get('page');
|
225 |
+
$current_id = WDW_FM_Library::get('current_id', 0);
|
226 |
+
WDW_FM_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_FM_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_FM_DIR . "/admin/models/FMModelManage_fm.php";
|
253 |
+
$model = new FMModelManage_fm();
|
254 |
+
|
255 |
+
require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
|
256 |
+
$view = new FMViewManage_fm($model);
|
257 |
+
// $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
|
258 |
+
global $wpdb;
|
259 |
+
$id = WDW_FM_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_FM_Library::get('page');
|
267 |
+
$current_id = WDW_FM_Library::get('current_id', 0);
|
268 |
+
WDW_FM_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_FM_DIR . "/admin/models/FMModelManage_fm.php";
|
274 |
+
$model = new FMModelManage_fm();
|
275 |
+
|
276 |
+
require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
|
277 |
+
$view = new FMViewManage_fm($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_FM_Library::get('page');
|
281 |
+
$current_id = WDW_FM_Library::get('current_id', 0);
|
282 |
+
$fieldset_id = WDW_FM_Library::get('fieldset_id', 'general');
|
283 |
+
WDW_FM_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 remove_query() {
|
287 |
+
global $wpdb;
|
288 |
+
$cid = ((isset($_POST['cid']) && $_POST['cid'] != '') ? $_POST['cid'] : NULL);
|
289 |
+
if (count($cid)) {
|
290 |
+
$cids = implode(',', $cid);
|
291 |
+
$query = 'DELETE FROM ' . $wpdb->prefix . 'formmaker_query WHERE id IN ( ' . $cids . ' )';
|
292 |
+
if ($wpdb->query($query)) {
|
293 |
+
echo WDW_FM_Library::message('Items Succesfully Deleted.', 'updated');
|
294 |
+
}
|
295 |
+
else {
|
296 |
+
echo WDW_FM_Library::message('Error. Please install plugin again.', 'error');
|
297 |
+
}
|
298 |
+
}
|
299 |
+
else {
|
300 |
+
echo WDW_FM_Library::message('You must select at least one item.', 'error');
|
301 |
+
}
|
302 |
+
$this->apply_options();
|
303 |
+
}
|
304 |
+
|
305 |
+
public function cancel_options() {
|
306 |
+
$this->edit();
|
307 |
+
}
|
308 |
+
|
309 |
+
public function save_db_options() {
|
310 |
+
$javascript = "// Before the form is loaded.
|
311 |
+
function before_load() {
|
312 |
+
|
313 |
+
}
|
314 |
+
// Before form submit.
|
315 |
+
function before_submit() {
|
316 |
+
|
317 |
+
}
|
318 |
+
// Before form reset.
|
319 |
+
function before_reset() {
|
320 |
+
|
321 |
+
}";
|
322 |
+
global $wpdb;
|
323 |
+
// $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
|
324 |
+
$id = WDW_FM_Library::get('current_id', 0);
|
325 |
+
$published = (isset($_POST['published']) ? esc_html(stripslashes($_POST['published'])) : 1);
|
326 |
+
$savedb = (isset($_POST['savedb']) ? esc_html(stripslashes($_POST['savedb'])) : 1);
|
327 |
+
$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"));
|
328 |
+
$requiredmark = (isset($_POST['requiredmark']) ? esc_html(stripslashes($_POST['requiredmark'])) : '*');
|
329 |
+
$sendemail = (isset($_POST['sendemail']) ? esc_html(stripslashes($_POST['sendemail'])) : 1);
|
330 |
+
$mail = (isset($_POST['mail']) ? esc_html(stripslashes($_POST['mail'])) : '');
|
331 |
+
if (isset($_POST['mailToAdd']) && esc_html(stripslashes($_POST['mailToAdd'])) != '') {
|
332 |
+
$mail .= esc_html(stripslashes($_POST['mailToAdd'])) . ',';
|
333 |
+
}
|
334 |
+
$from_mail = (isset($_POST['from_mail']) ? esc_html(stripslashes($_POST['from_mail'])) : '');
|
335 |
+
$from_name = (isset($_POST['from_name']) ? esc_html(stripslashes($_POST['from_name'])) : '');
|
336 |
+
$reply_to = (isset($_POST['reply_to']) ? esc_html(stripslashes($_POST['reply_to'])) : '');
|
337 |
+
if ($from_mail == "other") {
|
338 |
+
$from_mail = (isset($_POST['mail_from_other']) ? esc_html(stripslashes($_POST['mail_from_other'])) : '');
|
339 |
+
}
|
340 |
+
if ($reply_to == "other") {
|
341 |
+
$reply_to = (isset($_POST['reply_to_other']) ? esc_html(stripslashes($_POST['reply_to_other'])) : '');
|
342 |
+
}
|
343 |
+
$script_mail = (isset($_POST['script_mail']) ? stripslashes($_POST['script_mail']) : '%all%');
|
344 |
+
$mail_from_user = (isset($_POST['mail_from_user']) ? esc_html(stripslashes($_POST['mail_from_user'])) : '');
|
345 |
+
$mail_from_name_user = (isset($_POST['mail_from_name_user']) ? esc_html(stripslashes($_POST['mail_from_name_user'])) : '');
|
346 |
+
$reply_to_user = (isset($_POST['reply_to_user']) ? esc_html(stripslashes($_POST['reply_to_user'])) : '');
|
347 |
+
$condition = (isset($_POST['condition']) ? esc_html(stripslashes($_POST['condition'])) : '');
|
348 |
+
$mail_cc = (isset($_POST['mail_cc']) ? esc_html(stripslashes($_POST['mail_cc'])) : '');
|
349 |
+
$mail_cc_user = (isset($_POST['mail_cc_user']) ? esc_html(stripslashes($_POST['mail_cc_user'])) : '');
|
350 |
+
$mail_bcc = (isset($_POST['mail_bcc']) ? esc_html(stripslashes($_POST['mail_bcc'])) : '');
|
351 |
+
$mail_bcc_user = (isset($_POST['mail_bcc_user']) ? esc_html(stripslashes($_POST['mail_bcc_user'])) : '');
|
352 |
+
$mail_subject = (isset($_POST['mail_subject']) ? esc_html(stripslashes($_POST['mail_subject'])) : '');
|
353 |
+
$mail_subject_user = (isset($_POST['mail_subject_user']) ? esc_html(stripslashes($_POST['mail_subject_user'])) : '');
|
354 |
+
$mail_mode = (isset($_POST['mail_mode']) ? esc_html(stripslashes($_POST['mail_mode'])) : 1);
|
355 |
+
$mail_mode_user = (isset($_POST['mail_mode_user']) ? esc_html(stripslashes($_POST['mail_mode_user'])) : 1);
|
356 |
+
$mail_attachment = (isset($_POST['mail_attachment']) ? esc_html(stripslashes($_POST['mail_attachment'])) : 1);
|
357 |
+
$mail_attachment_user = (isset($_POST['mail_attachment_user']) ? esc_html(stripslashes($_POST['mail_attachment_user'])) : 1);
|
358 |
+
$script_mail_user = (isset($_POST['script_mail_user']) ? stripslashes($_POST['script_mail_user']) : '%all%');
|
359 |
+
$submit_text = (isset($_POST['submit_text']) ? stripslashes($_POST['submit_text']) : '');
|
360 |
+
$url = (isset($_POST['url']) ? esc_html(stripslashes($_POST['url'])) : '');
|
361 |
+
$tax = (isset($_POST['tax']) ? esc_html(stripslashes($_POST['tax'])) : 0);
|
362 |
+
$payment_currency = (isset($_POST['payment_currency']) ? stripslashes($_POST['payment_currency']) : '');
|
363 |
+
$paypal_email = (isset($_POST['paypal_email']) ? esc_html(stripslashes($_POST['paypal_email'])) : '');
|
364 |
+
$checkout_mode = (isset($_POST['checkout_mode']) ? esc_html(stripslashes($_POST['checkout_mode'])) : 'testmode');
|
365 |
+
$paypal_mode = (isset($_POST['paypal_mode']) ? esc_html(stripslashes($_POST['paypal_mode'])) : 0);
|
366 |
+
$javascript = (isset($_POST['javascript']) ? stripslashes($_POST['javascript']) : $javascript);
|
367 |
+
$send_to = '';
|
368 |
+
for ($i = 0; $i < 20; $i++) {
|
369 |
+
if (isset($_POST['send_to' . $i])) {
|
370 |
+
$send_to .= '*' . esc_html(stripslashes($_POST['send_to' . $i])) . '*';
|
371 |
+
}
|
372 |
+
}
|
373 |
+
if (isset($_POST['submit_text_type'])) {
|
374 |
+
$submit_text_type = esc_html(stripslashes($_POST['submit_text_type']));
|
375 |
+
if ($submit_text_type == 5) {
|
376 |
+
$article_id = (isset($_POST['page_name']) ? esc_html(stripslashes($_POST['page_name'])) : 0);
|
377 |
+
}
|
378 |
+
else {
|
379 |
+
$article_id = (isset($_POST['post_name']) ? esc_html(stripslashes($_POST['post_name'])) : 0);
|
380 |
+
}
|
381 |
+
}
|
382 |
+
else {
|
383 |
+
$submit_text_type = 0;
|
384 |
+
$article_id = 0;
|
385 |
+
}
|
386 |
+
$save = $wpdb->update($wpdb->prefix . 'formmaker', array(
|
387 |
+
'published' => $published,
|
388 |
+
'savedb' => $savedb,
|
389 |
+
'theme' => $theme,
|
390 |
+
'requiredmark' => $requiredmark,
|
391 |
+
'sendemail' => $sendemail,
|
392 |
+
'mail' => $mail,
|
393 |
+
'from_mail' => $from_mail,
|
394 |
+
'from_name' => $from_name,
|
395 |
+
'reply_to' => $reply_to,
|
396 |
+
'script_mail' => $script_mail,
|
397 |
+
'mail_from_user' => $mail_from_user,
|
398 |
+
'mail_from_name_user' => $mail_from_name_user,
|
399 |
+
'reply_to_user' => $reply_to_user,
|
400 |
+
'condition' => $condition,
|
401 |
+
'mail_cc' => $mail_cc,
|
402 |
+
'mail_cc_user' => $mail_cc_user,
|
403 |
+
'mail_bcc' => $mail_bcc,
|
404 |
+
'mail_bcc_user' => $mail_bcc_user,
|
405 |
+
'mail_subject' => $mail_subject,
|
406 |
+
'mail_subject_user' => $mail_subject_user,
|
407 |
+
'mail_mode' => $mail_mode,
|
408 |
+
'mail_mode_user' => $mail_mode_user,
|
409 |
+
'mail_attachment' => $mail_attachment,
|
410 |
+
'mail_attachment_user' => $mail_attachment_user,
|
411 |
+
'script_mail_user' => $script_mail_user,
|
412 |
+
'submit_text' => $submit_text,
|
413 |
+
'url' => $url,
|
414 |
+
'submit_text_type' => $submit_text_type,
|
415 |
+
'article_id' => $article_id,
|
416 |
+
'tax' => $tax,
|
417 |
+
'payment_currency' => $payment_currency,
|
418 |
+
'paypal_email' => $paypal_email,
|
419 |
+
'checkout_mode' => $checkout_mode,
|
420 |
+
'paypal_mode' => $paypal_mode,
|
421 |
+
'javascript' => $javascript,
|
422 |
+
'send_to' => $send_to,
|
423 |
+
), array('id' => $id));
|
424 |
+
if ($save !== FALSE) {
|
425 |
+
return 8;
|
426 |
+
}
|
427 |
+
else {
|
428 |
+
return 2;
|
429 |
+
}
|
430 |
+
}
|
431 |
+
|
432 |
+
public function save_as_copy_old() {
|
433 |
+
$message = $this->save_db_as_copy_old();
|
434 |
+
// $this->display();
|
435 |
+
$page = WDW_FM_Library::get('page');
|
436 |
+
WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
437 |
+
}
|
438 |
+
|
439 |
+
public function save_old() {
|
440 |
+
$message = $this->save_db_old();
|
441 |
+
// $this->display();
|
442 |
+
$page = WDW_FM_Library::get('page');
|
443 |
+
WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
444 |
+
}
|
445 |
+
|
446 |
+
public function apply_old() {
|
447 |
+
global $wpdb;
|
448 |
+
$message = $this->save_db_old();
|
449 |
+
// $this->edit_old();
|
450 |
+
$id = (int) $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
|
451 |
+
$current_id = WDW_FM_Library::get('current_id', $id);
|
452 |
+
$page = WDW_FM_Library::get('page');
|
453 |
+
WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'edit_old', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
|
454 |
+
}
|
455 |
+
|
456 |
+
public function save_db_old() {
|
457 |
+
global $wpdb;
|
458 |
+
// $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
|
459 |
+
$id = WDW_FM_Library::get('current_id', 0);
|
460 |
+
$title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
|
461 |
+
$form = (isset($_POST['form']) ? stripslashes($_POST['form']) : '');
|
462 |
+
$form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
|
463 |
+
$counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
|
464 |
+
$label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
|
465 |
+
$label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
|
466 |
+
$pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
|
467 |
+
$show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
|
468 |
+
$show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
|
469 |
+
$public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
|
470 |
+
$private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
|
471 |
+
$recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
|
472 |
+
|
473 |
+
$save = $wpdb->update($wpdb->prefix . 'formmaker', array(
|
474 |
+
'title' => $title,
|
475 |
+
'form' => $form,
|
476 |
+
'form_front' => $form_front,
|
477 |
+
'counter' => $counter,
|
478 |
+
'label_order' => $label_order,
|
479 |
+
'label_order_current' => $label_order_current,
|
480 |
+
'pagination' => $pagination,
|
481 |
+
'show_title' => $show_title,
|
482 |
+
'show_numbers' => $show_numbers,
|
483 |
+
'public_key' => $public_key,
|
484 |
+
'private_key' => $private_key,
|
485 |
+
'recaptcha_theme' => $recaptcha_theme,
|
486 |
+
), array('id' => $id));
|
487 |
+
if ($save !== FALSE) {
|
488 |
+
return 1;
|
489 |
+
}
|
490 |
+
else {
|
491 |
+
return 2;
|
492 |
+
}
|
493 |
+
}
|
494 |
+
|
495 |
+
public function save_db_as_copy_old() {
|
496 |
+
global $wpdb;
|
497 |
+
// $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
|
498 |
+
$id = WDW_FM_Library::get('current_id', 0);
|
499 |
+
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
|
500 |
+
$title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
|
501 |
+
$form = (isset($_POST['form']) ? stripslashes($_POST['form']) : '');
|
502 |
+
$form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
|
503 |
+
$counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
|
504 |
+
$label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
|
505 |
+
$pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
|
506 |
+
$show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
|
507 |
+
$show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
|
508 |
+
$public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
|
509 |
+
$private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
|
510 |
+
$recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
|
511 |
+
|
512 |
+
$save = $wpdb->insert($wpdb->prefix . 'formmaker', array(
|
513 |
+
'title' => $title,
|
514 |
+
'mail' => $row->mail,
|
515 |
+
'form' => $form,
|
516 |
+
'form_front' => $form_front,
|
517 |
+
'theme' => $row->theme,
|
518 |
+
'counter' => $counter,
|
519 |
+
'label_order' => $label_order,
|
520 |
+
'pagination' => $pagination,
|
521 |
+
'show_title' => $show_title,
|
522 |
+
'show_numbers' => $show_numbers,
|
523 |
+
'public_key' => $public_key,
|
524 |
+
'private_key' => $private_key,
|
525 |
+
'recaptcha_theme' => $recaptcha_theme,
|
526 |
+
'javascript' => $row->javascript,
|
527 |
+
'script1' => $row->script1,
|
528 |
+
'script2' => $row->script2,
|
529 |
+
'script_user1' => $row->script_user1,
|
530 |
+
'script_user2' => $row->script_user2,
|
531 |
+
'submit_text' => $row->submit_text,
|
532 |
+
'url' => $row->url,
|
533 |
+
'article_id' => $row->article_id,
|
534 |
+
'submit_text_type' => $row->submit_text_type,
|
535 |
+
'script_mail' => $row->script_mail,
|
536 |
+
'script_mail_user' => $row->script_mail_user,
|
537 |
+
'paypal_mode' => $row->paypal_mode,
|
538 |
+
'checkout_mode' => $row->checkout_mode,
|
539 |
+
'paypal_email' => $row->paypal_email,
|
540 |
+
'payment_currency' => $row->payment_currency,
|
541 |
+
'tax' => $row->tax,
|
542 |
+
'label_order_current' => $row->label_order_current,
|
543 |
+
'from_mail' => $row->from_mail,
|
544 |
+
'from_name' => $row->from_name,
|
545 |
+
'reply_to_user' => $row->reply_to_user,
|
546 |
+
'mail_from_name_user' => $row->mail_from_name_user,
|
547 |
+
'mail_from_user' => $row->mail_from_user,
|
548 |
+
'custom_front' => $row->custom_front,
|
549 |
+
'autogen_layout' => $row->autogen_layout,
|
550 |
+
'send_to' => $row->send_to,
|
551 |
+
'reply_to' => $row->reply_to,
|
552 |
+
'requiredmark' => $row->requiredmark,
|
553 |
+
'sendemail' => $row->sendemail,
|
554 |
+
'savedb' => $row->savedb,
|
555 |
+
'form_fields' => $row->form_fields,
|
556 |
+
'published' => $row->published
|
557 |
+
), array(
|
558 |
+
'%s',
|
559 |
+
'%s',
|
560 |
+
'%s',
|
561 |
+
'%s',
|
562 |
+
'%d',
|
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 |
+
'%s',
|
576 |
+
'%s',
|
577 |
+
'%s',
|
578 |
+
'%s',
|
579 |
+
'%d',
|
580 |
+
'%s',
|
581 |
+
'%s',
|
582 |
+
'%d',
|
583 |
+
'%s',
|
584 |
+
'%s',
|
585 |
+
'%s',
|
586 |
+
'%s',
|
587 |
+
'%s',
|
588 |
+
'%s',
|
589 |
+
'%s',
|
590 |
+
'%s',
|
591 |
+
'%s',
|
592 |
+
'%s',
|
593 |
+
'%s',
|
594 |
+
'%d',
|
595 |
+
'%s',
|
596 |
+
'%s',
|
597 |
+
'%s',
|
598 |
+
'%d',
|
599 |
+
'%d',
|
600 |
+
'%s',
|
601 |
+
'%d'
|
602 |
+
));
|
603 |
+
$id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
|
604 |
+
$wpdb->insert($wpdb->prefix . 'formmaker_views', array(
|
605 |
+
'form_id' => $id,
|
606 |
+
'views' => 0
|
607 |
+
), array(
|
608 |
+
'%d',
|
609 |
+
'%d'
|
610 |
+
));
|
611 |
+
if ($save !== FALSE) {
|
612 |
+
return 1;
|
613 |
+
}
|
614 |
+
else {
|
615 |
+
return 2;
|
616 |
+
}
|
617 |
+
}
|
618 |
+
|
619 |
+
public function save_as_copy() {
|
620 |
+
$message = $this->save_db_as_copy();
|
621 |
+
// $this->display();
|
622 |
+
$page = WDW_FM_Library::get('page');
|
623 |
+
WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
624 |
+
}
|
625 |
+
|
626 |
+
public function save() {
|
627 |
+
$message = $this->save_db();
|
628 |
+
// $this->display();
|
629 |
+
$page = WDW_FM_Library::get('page');
|
630 |
+
WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
631 |
+
}
|
632 |
+
|
633 |
+
public function apply() {
|
634 |
+
$message = $this->save_db();
|
635 |
+
// $this->edit();
|
636 |
+
global $wpdb;
|
637 |
+
$id = (int) $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
|
638 |
+
$current_id = WDW_FM_Library::get('current_id', $id);
|
639 |
+
$page = WDW_FM_Library::get('page');
|
640 |
+
WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
|
641 |
+
}
|
642 |
+
|
643 |
+
public function save_db() {
|
644 |
+
global $wpdb;
|
645 |
+
$javascript = "// before form is load
|
646 |
+
function before_load() {
|
647 |
+
}
|
648 |
+
// before form submit
|
649 |
+
function before_submit() {
|
650 |
+
}
|
651 |
+
// before form reset
|
652 |
+
function before_reset() {
|
653 |
+
}";
|
654 |
+
// $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
|
655 |
+
$id = WDW_FM_Library::get('current_id', 0);
|
656 |
+
$title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
|
657 |
+
$form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
|
658 |
+
$counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
|
659 |
+
$label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
|
660 |
+
$pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
|
661 |
+
$show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
|
662 |
+
$show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
|
663 |
+
$public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
|
664 |
+
$private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
|
665 |
+
$recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
|
666 |
+
$label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
|
667 |
+
$form_fields = (isset($_POST['form_fields']) ? stripslashes($_POST['form_fields']) : '');
|
668 |
+
|
669 |
+
if ($id != 0) {
|
670 |
+
$save = $wpdb->update($wpdb->prefix . 'formmaker', array(
|
671 |
+
'title' => $title,
|
672 |
+
'form_front' => $form_front,
|
673 |
+
'counter' => $counter,
|
674 |
+
'label_order' => $label_order,
|
675 |
+
'label_order_current' => $label_order_current,
|
676 |
+
'pagination' => $pagination,
|
677 |
+
'show_title' => $show_title,
|
678 |
+
'show_numbers' => $show_numbers,
|
679 |
+
'public_key' => $public_key,
|
680 |
+
'private_key' => $private_key,
|
681 |
+
'recaptcha_theme' => $recaptcha_theme,
|
682 |
+
'form_fields' => $form_fields,
|
683 |
+
), array('id' => $id));
|
684 |
+
}
|
685 |
+
else {
|
686 |
+
$save = $wpdb->insert($wpdb->prefix . 'formmaker', array(
|
687 |
+
'title' => $title,
|
688 |
+
'mail' => '',
|
689 |
+
'form_front' => $form_front,
|
690 |
+
'theme' => $wpdb->get_var("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE css LIKE '%.wdform_section%'"),
|
691 |
+
'counter' => $counter,
|
692 |
+
'label_order' => $label_order,
|
693 |
+
'pagination' => $pagination,
|
694 |
+
'show_title' => $show_title,
|
695 |
+
'show_numbers' => $show_numbers,
|
696 |
+
'public_key' => $public_key,
|
697 |
+
'private_key' => $private_key,
|
698 |
+
'recaptcha_theme' => $recaptcha_theme,
|
699 |
+
'javascript' => $javascript,
|
700 |
+
'submit_text' => '',
|
701 |
+
'url' => '',
|
702 |
+
'article_id' => 0,
|
703 |
+
'submit_text_type' => 0,
|
704 |
+
'script_mail' => '%all%',
|
705 |
+
'script_mail_user' => '%all%',
|
706 |
+
'label_order_current' => $label_order_current,
|
707 |
+
'tax' => 0,
|
708 |
+
'payment_currency' => '',
|
709 |
+
'paypal_email' => '',
|
710 |
+
'checkout_mode' => 'testmode',
|
711 |
+
'paypal_mode' => 0,
|
712 |
+
'published' => 1,
|
713 |
+
'form_fields' => $form_fields,
|
714 |
+
'savedb' => 1,
|
715 |
+
'sendemail' => 1,
|
716 |
+
'requiredmark' => '*',
|
717 |
+
'from_mail' => '',
|
718 |
+
'from_name' => '',
|
719 |
+
'reply_to' => '',
|
720 |
+
'send_to' => '',
|
721 |
+
'autogen_layout' => 1,
|
722 |
+
'custom_front' => '',
|
723 |
+
'mail_from_user' => '',
|
724 |
+
'mail_from_name_user' => '',
|
725 |
+
'reply_to_user' => '',
|
726 |
+
'condition' => '',
|
727 |
+
'mail_cc' => '',
|
728 |
+
'mail_cc_user' => '',
|
729 |
+
'mail_bcc' => '',
|
730 |
+
'mail_bcc_user' => '',
|
731 |
+
'mail_subject' => '',
|
732 |
+
'mail_subject_user' => '',
|
733 |
+
'mail_mode' => 1,
|
734 |
+
'mail_mode_user' => 1,
|
735 |
+
'mail_attachment' => 1,
|
736 |
+
'mail_attachment_user' => 1,
|
737 |
+
), array(
|
738 |
+
'%s',
|
739 |
+
'%s',
|
740 |
+
'%s',
|
741 |
+
'%d',
|
742 |
+
'%d',
|
743 |
+
'%s',
|
744 |
+
'%s',
|
745 |
+
'%s',
|
746 |
+
'%s',
|
747 |
+
'%s',
|
748 |
+
'%s',
|
749 |
+
'%s',
|
750 |
+
'%s',
|
751 |
+
'%s',
|
752 |
+
'%s',
|
753 |
+
'%d',
|
754 |
+
'%d',
|
755 |
+
'%s',
|
756 |
+
'%s',
|
757 |
+
'%s',
|
758 |
+
'%s',
|
759 |
+
'%s',
|
760 |
+
'%s',
|
761 |
+
'%s',
|
762 |
+
'%d',
|
763 |
+
'%d',
|
764 |
+
'%s',
|
765 |
+
'%d',
|
766 |
+
'%d',
|
767 |
+
'%s',
|
768 |
+
'%s',
|
769 |
+
'%s',
|
770 |
+
'%s',
|
771 |
+
'%s',
|
772 |
+
'%d',
|
773 |
+
'%s',
|
774 |
+
'%s',
|
775 |
+
'%s',
|
776 |
+
'%s',
|
777 |
+
'%s',
|
778 |
+
'%s',
|
779 |
+
'%s',
|
780 |
+
'%s',
|
781 |
+
'%s',
|
782 |
+
'%s',
|
783 |
+
'%s',
|
784 |
+
'%d',
|
785 |
+
'%d',
|
786 |
+
'%d',
|
787 |
+
'%d',
|
788 |
+
));
|
789 |
+
$id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
|
790 |
+
// $_POST['current_id'] = $id;
|
791 |
+
$wpdb->insert($wpdb->prefix . 'formmaker_views', array(
|
792 |
+
'form_id' => $id,
|
793 |
+
'views' => 0
|
794 |
+
), array(
|
795 |
+
'%d',
|
796 |
+
'%d'
|
797 |
+
));
|
798 |
+
}
|
799 |
+
if ($save !== FALSE) {
|
800 |
+
return 1;
|
801 |
+
}
|
802 |
+
else {
|
803 |
+
return 2;
|
804 |
+
}
|
805 |
+
}
|
806 |
+
|
807 |
+
public function save_db_as_copy() {
|
808 |
+
global $wpdb;
|
809 |
+
// $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
|
810 |
+
$id = WDW_FM_Library::get('current_id', 0);
|
811 |
+
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
|
812 |
+
$title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
|
813 |
+
$form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
|
814 |
+
$counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
|
815 |
+
$label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
|
816 |
+
$label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
|
817 |
+
$pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
|
818 |
+
$show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
|
819 |
+
$show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
|
820 |
+
$public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
|
821 |
+
$private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
|
822 |
+
$recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
|
823 |
+
$form_fields = (isset($_POST['form_fields']) ? stripslashes($_POST['form_fields']) : '');
|
824 |
+
|
825 |
+
$save = $wpdb->insert($wpdb->prefix . 'formmaker', array(
|
826 |
+
'title' => $title,
|
827 |
+
'mail' => $row->mail,
|
828 |
+
'form_front' => $form_front,
|
829 |
+
'theme' => $row->theme,
|
830 |
+
'counter' => $counter,
|
831 |
+
'label_order' => $label_order,
|
832 |
+
'pagination' => $pagination,
|
833 |
+
'show_title' => $show_title,
|
834 |
+
'show_numbers' => $show_numbers,
|
835 |
+
'public_key' => $public_key,
|
836 |
+
'private_key' => $private_key,
|
837 |
+
'recaptcha_theme' => $recaptcha_theme,
|
838 |
+
'javascript' => $row->javascript,
|
839 |
+
'submit_text' => $row->submit_text,
|
840 |
+
'url' => $row->url,
|
841 |
+
'article_id' => $row->article_id,
|
842 |
+
'submit_text_type' => $row->submit_text_type,
|
843 |
+
'script_mail' => $row->script_mail,
|
844 |
+
'script_mail_user' => $row->script_mail_user,
|
845 |
+
'label_order_current' => $label_order_current,
|
846 |
+
'tax' => $row->tax,
|
847 |
+
'payment_currency' => $row->payment_currency,
|
848 |
+
'paypal_email' => $row->paypal_email,
|
849 |
+
'checkout_mode' => $row->checkout_mode,
|
850 |
+
'paypal_mode' => $row->paypal_mode,
|
851 |
+
'published' => $row->published,
|
852 |
+
'form_fields' => $form_fields,
|
853 |
+
'savedb' => $row->savedb,
|
854 |
+
'sendemail' => $row->sendemail,
|
855 |
+
'requiredmark' => $row->requiredmark,
|
856 |
+
'from_mail' => $row->from_mail,
|
857 |
+
'from_name' => $row->from_name,
|
858 |
+
'reply_to' => $row->reply_to,
|
859 |
+
'send_to' => $row->send_to,
|
860 |
+
'autogen_layout' => $row->autogen_layout,
|
861 |
+
'custom_front' => $row->custom_front,
|
862 |
+
'mail_from_user' => $row->mail_from_user,
|
863 |
+
'mail_from_name_user' => $row->mail_from_name_user,
|
864 |
+
'reply_to_user' => $row->reply_to_user,
|
865 |
+
'condition' => $row->condition,
|
866 |
+
'mail_cc' => $row->mail_cc,
|
867 |
+
'mail_cc_user' => $row->mail_cc_user,
|
868 |
+
'mail_bcc' => $row->mail_bcc,
|
869 |
+
'mail_bcc_user' => $row->mail_bcc_user,
|
870 |
+
'mail_subject' => $row->mail_subject,
|
871 |
+
'mail_subject_user' => $row->mail_subject_user,
|
872 |
+
'mail_mode' => $row->mail_mode,
|
873 |
+
'mail_mode_user' => $row->mail_mode_user,
|
874 |
+
'mail_attachment' => $row->mail_attachment,
|
875 |
+
'mail_attachment_user' => $row->mail_attachment_user,
|
876 |
+
), array(
|
877 |
+
'%s',
|
878 |
+
'%s',
|
879 |
+
'%s',
|
880 |
+
'%d',
|
881 |
+
'%d',
|
882 |
+
'%s',
|
883 |
+
'%s',
|
884 |
+
'%s',
|
885 |
+
'%s',
|
886 |
+
'%s',
|
887 |
+
'%s',
|
888 |
+
'%s',
|
889 |
+
'%s',
|
890 |
+
'%s',
|
891 |
+
'%s',
|
892 |
+
'%d',
|
893 |
+
'%d',
|
894 |
+
'%s',
|
895 |
+
'%s',
|
896 |
+
'%s',
|
897 |
+
'%s',
|
898 |
+
'%s',
|
899 |
+
'%s',
|
900 |
+
'%s',
|
901 |
+
'%d',
|
902 |
+
'%d',
|
903 |
+
'%s',
|
904 |
+
'%d',
|
905 |
+
'%d',
|
906 |
+
'%s',
|
907 |
+
'%s',
|
908 |
+
'%s',
|
909 |
+
'%s',
|
910 |
+
'%s',
|
911 |
+
'%d',
|
912 |
+
'%s',
|
913 |
+
'%s',
|
914 |
+
'%s',
|
915 |
+
'%s',
|
916 |
+
'%s',
|
917 |
+
'%s',
|
918 |
+
'%s',
|
919 |
+
'%s',
|
920 |
+
'%s',
|
921 |
+
'%s',
|
922 |
+
'%s',
|
923 |
+
'%d',
|
924 |
+
'%d',
|
925 |
+
'%d',
|
926 |
+
'%d',
|
927 |
+
));
|
928 |
+
$id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
|
929 |
+
$wpdb->insert($wpdb->prefix . 'formmaker_views', array(
|
930 |
+
'form_id' => $id,
|
931 |
+
'views' => 0
|
932 |
+
), array(
|
933 |
+
'%d',
|
934 |
+
'%d'
|
935 |
+
));
|
936 |
+
if ($save !== FALSE) {
|
937 |
+
return 1;
|
938 |
+
}
|
939 |
+
else {
|
940 |
+
return 2;
|
941 |
+
}
|
942 |
+
}
|
943 |
+
|
944 |
+
public function delete($id) {
|
945 |
+
global $wpdb;
|
946 |
+
$query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id);
|
947 |
+
if ($wpdb->query($query)) {
|
948 |
+
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="%d"', $id));
|
949 |
+
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id="%d"', $id));
|
950 |
+
$message = 3;
|
951 |
+
}
|
952 |
+
else {
|
953 |
+
$message = 2;
|
954 |
+
}
|
955 |
+
// $this->display();
|
956 |
+
$page = WDW_FM_Library::get('page');
|
957 |
+
WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
958 |
+
}
|
959 |
+
|
960 |
+
public function delete_all() {
|
961 |
+
global $wpdb;
|
962 |
+
$flag = FALSE;
|
963 |
+
$isDefault = FALSE;
|
964 |
+
$form_ids_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker');
|
965 |
+
foreach ($form_ids_col as $form_id) {
|
966 |
+
if (isset($_POST['check_' . $form_id])) {
|
967 |
+
$flag = TRUE;
|
968 |
+
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $form_id));
|
969 |
+
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="%d"', $form_id));
|
970 |
+
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id="%d"', $form_id));
|
971 |
+
}
|
972 |
+
}
|
973 |
+
if ($flag) {
|
974 |
+
$message = 5;
|
975 |
+
}
|
976 |
+
else {
|
977 |
+
$message = 6;
|
978 |
+
}
|
979 |
+
// $this->display();
|
980 |
+
$page = WDW_FM_Library::get('page');
|
981 |
+
WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
982 |
+
}
|
983 |
+
|
984 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
985 |
+
// Getters & Setters //
|
986 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
987 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
988 |
+
// Private Methods //
|
989 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
990 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
991 |
+
// Listeners //
|
992 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
993 |
}
|
admin/controllers/FMControllerShow_matrix.php
CHANGED
@@ -1,43 +1,43 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerShow_matrix {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function execute() {
|
22 |
-
$this->display();
|
23 |
-
}
|
24 |
-
|
25 |
-
public function display() {
|
26 |
-
require_once WD_FM_DIR . "/admin/models/FMModelShow_matrix.php";
|
27 |
-
$model = new FMModelShow_matrix();
|
28 |
-
|
29 |
-
require_once WD_FM_DIR . "/admin/views/FMViewShow_matrix.php";
|
30 |
-
$view = new FMViewShow_matrix($model);
|
31 |
-
$view->display();
|
32 |
-
}
|
33 |
-
|
34 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
35 |
-
// Getters & Setters //
|
36 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
37 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
38 |
-
// Private Methods //
|
39 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
40 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
41 |
-
// Listeners //
|
42 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
43 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FMControllerShow_matrix {
|
4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
+
// Events //
|
6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
+
// Constants //
|
9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
+
// Variables //
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
+
// Constructor & Destructor //
|
15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
+
public function __construct() {
|
17 |
+
}
|
18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
+
// Public Methods //
|
20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
+
public function execute() {
|
22 |
+
$this->display();
|
23 |
+
}
|
24 |
+
|
25 |
+
public function display() {
|
26 |
+
require_once WD_FM_DIR . "/admin/models/FMModelShow_matrix.php";
|
27 |
+
$model = new FMModelShow_matrix();
|
28 |
+
|
29 |
+
require_once WD_FM_DIR . "/admin/views/FMViewShow_matrix.php";
|
30 |
+
$view = new FMViewShow_matrix($model);
|
31 |
+
$view->display();
|
32 |
+
}
|
33 |
+
|
34 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
35 |
+
// Getters & Setters //
|
36 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
37 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
38 |
+
// Private Methods //
|
39 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
40 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
41 |
+
// Listeners //
|
42 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
43 |
}
|
admin/controllers/FMControllerSubmissions_fm.php
CHANGED
@@ -1,761 +1,761 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerSubmissions_fm {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function execute() {
|
22 |
-
$task = ((isset($_POST['task'])) ? esc_html($_POST['task']) : '');
|
23 |
-
$id = ((isset($_POST['current_id'])) ? 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_FM_DIR . "/admin/models/FMModelSubmissions_fm.php";
|
36 |
-
$model = new FMModelSubmissions_fm();
|
37 |
-
|
38 |
-
require_once WD_FM_DIR . "/admin/views/FMViewSubmissions_fm.php";
|
39 |
-
$view = new FMViewSubmissions_fm($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_FM_DIR . "/admin/models/FMModelSubmissions_fm.php";
|
46 |
-
$model = new FMModelSubmissions_fm();
|
47 |
-
|
48 |
-
require_once WD_FM_DIR . "/admin/views/FMViewSubmissions_fm.php";
|
49 |
-
$view = new FMViewSubmissions_fm($model);
|
50 |
-
$view->show_stats($form_id);
|
51 |
-
}
|
52 |
-
|
53 |
-
public function edit() {
|
54 |
-
global $wpdb;
|
55 |
-
$new_form = false;
|
56 |
-
require_once WD_FM_DIR . "/admin/models/FMModelSubmissions_fm.php";
|
57 |
-
$model = new FMModelSubmissions_fm();
|
58 |
-
|
59 |
-
require_once WD_FM_DIR . "/admin/views/FMViewSubmissions_fm.php";
|
60 |
-
$view = new FMViewSubmissions_fm($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_FM_Library::message('Submission Succesfully Saved.', 'updated');
|
657 |
-
}
|
658 |
-
else {
|
659 |
-
echo WDW_FM_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_FM_Library::message('Item Succesfully Deleted.', 'updated');
|
669 |
-
}
|
670 |
-
else {
|
671 |
-
echo WDW_FM_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_FM_Library::message('Items Succesfully Deleted.', 'updated');
|
685 |
-
}
|
686 |
-
else {
|
687 |
-
echo WDW_FM_Library::message('Error. Please install plugin again.', 'error');
|
688 |
-
}
|
689 |
-
}
|
690 |
-
else {
|
691 |
-
echo WDW_FM_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_FM_Library::message('IPs Succesfully Blocked.', 'updated');
|
719 |
-
}
|
720 |
-
else {
|
721 |
-
echo WDW_FM_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_FM_Library::message('IPs Succesfully Unblocked.', 'updated');
|
745 |
-
}
|
746 |
-
else {
|
747 |
-
echo WDW_FM_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_fm {
|
4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
+
// Events //
|
6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
+
// Constants //
|
9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
+
// Variables //
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
+
// Constructor & Destructor //
|
15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
+
public function __construct() {
|
17 |
+
}
|
18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
+
// Public Methods //
|
20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
+
public function execute() {
|
22 |
+
$task = ((isset($_POST['task'])) ? esc_html($_POST['task']) : '');
|
23 |
+
$id = ((isset($_POST['current_id'])) ? 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_FM_DIR . "/admin/models/FMModelSubmissions_fm.php";
|
36 |
+
$model = new FMModelSubmissions_fm();
|
37 |
+
|
38 |
+
require_once WD_FM_DIR . "/admin/views/FMViewSubmissions_fm.php";
|
39 |
+
$view = new FMViewSubmissions_fm($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_FM_DIR . "/admin/models/FMModelSubmissions_fm.php";
|
46 |
+
$model = new FMModelSubmissions_fm();
|
47 |
+
|
48 |
+
require_once WD_FM_DIR . "/admin/views/FMViewSubmissions_fm.php";
|
49 |
+
$view = new FMViewSubmissions_fm($model);
|
50 |
+
$view->show_stats($form_id);
|
51 |
+
}
|
52 |
+
|
53 |
+
public function edit() {
|
54 |
+
global $wpdb;
|
55 |
+
$new_form = false;
|
56 |
+
require_once WD_FM_DIR . "/admin/models/FMModelSubmissions_fm.php";
|
57 |
+
$model = new FMModelSubmissions_fm();
|
58 |
+
|
59 |
+
require_once WD_FM_DIR . "/admin/views/FMViewSubmissions_fm.php";
|
60 |
+
$view = new FMViewSubmissions_fm($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_FM_Library::message('Submission Succesfully Saved.', 'updated');
|
657 |
+
}
|
658 |
+
else {
|
659 |
+
echo WDW_FM_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_FM_Library::message('Item Succesfully Deleted.', 'updated');
|
669 |
+
}
|
670 |
+
else {
|
671 |
+
echo WDW_FM_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_FM_Library::message('Items Succesfully Deleted.', 'updated');
|
685 |
+
}
|
686 |
+
else {
|
687 |
+
echo WDW_FM_Library::message('Error. Please install plugin again.', 'error');
|
688 |
+
}
|
689 |
+
}
|
690 |
+
else {
|
691 |
+
echo WDW_FM_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_FM_Library::message('IPs Succesfully Blocked.', 'updated');
|
719 |
+
}
|
720 |
+
else {
|
721 |
+
echo WDW_FM_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_FM_Library::message('IPs Succesfully Unblocked.', 'updated');
|
745 |
+
}
|
746 |
+
else {
|
747 |
+
echo WDW_FM_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_fm.php
CHANGED
@@ -1,190 +1,190 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerThemes_fm {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function execute() {
|
22 |
-
$task = WDW_FM_Library::get('task');
|
23 |
-
$id = WDW_FM_Library::get('current_id', 0);
|
24 |
-
$message = WDW_FM_Library::get('message');
|
25 |
-
echo WDW_FM_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_FM_DIR . "/admin/models/FMModelThemes_fm.php";
|
38 |
-
$model = new FMModelThemes_fm();
|
39 |
-
|
40 |
-
require_once WD_FM_DIR . "/admin/views/FMViewThemes_fm.php";
|
41 |
-
$view = new FMViewThemes_fm($model);
|
42 |
-
$view->display();
|
43 |
-
}
|
44 |
-
|
45 |
-
public function add() {
|
46 |
-
require_once WD_FM_DIR . "/admin/models/FMModelThemes_fm.php";
|
47 |
-
$model = new FMModelThemes_fm();
|
48 |
-
|
49 |
-
require_once WD_FM_DIR . "/admin/views/FMViewThemes_fm.php";
|
50 |
-
$view = new FMViewThemes_fm($model);
|
51 |
-
$view->edit(0, FALSE);
|
52 |
-
}
|
53 |
-
|
54 |
-
public function edit() {
|
55 |
-
require_once WD_FM_DIR . "/admin/models/FMModelThemes_fm.php";
|
56 |
-
$model = new FMModelThemes_fm();
|
57 |
-
|
58 |
-
require_once WD_FM_DIR . "/admin/views/FMViewThemes_fm.php";
|
59 |
-
$view = new FMViewThemes_fm($model);
|
60 |
-
// $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
|
61 |
-
$id = WDW_FM_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_FM_Library::get('page');
|
69 |
-
WDW_FM_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_FM_Library::get('current_id', $id);
|
80 |
-
$page = WDW_FM_Library::get('page');
|
81 |
-
WDW_FM_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_FM_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_FM_Library::get('page');
|
135 |
-
WDW_FM_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_FM_Library::get('page');
|
163 |
-
WDW_FM_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_FM_Library::get('page');
|
178 |
-
WDW_FM_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_fm {
|
4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
+
// Events //
|
6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
+
// Constants //
|
9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
+
// Variables //
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
+
// Constructor & Destructor //
|
15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
+
public function __construct() {
|
17 |
+
}
|
18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
+
// Public Methods //
|
20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
+
public function execute() {
|
22 |
+
$task = WDW_FM_Library::get('task');
|
23 |
+
$id = WDW_FM_Library::get('current_id', 0);
|
24 |
+
$message = WDW_FM_Library::get('message');
|
25 |
+
echo WDW_FM_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_FM_DIR . "/admin/models/FMModelThemes_fm.php";
|
38 |
+
$model = new FMModelThemes_fm();
|
39 |
+
|
40 |
+
require_once WD_FM_DIR . "/admin/views/FMViewThemes_fm.php";
|
41 |
+
$view = new FMViewThemes_fm($model);
|
42 |
+
$view->display();
|
43 |
+
}
|
44 |
+
|
45 |
+
public function add() {
|
46 |
+
require_once WD_FM_DIR . "/admin/models/FMModelThemes_fm.php";
|
47 |
+
$model = new FMModelThemes_fm();
|
48 |
+
|
49 |
+
require_once WD_FM_DIR . "/admin/views/FMViewThemes_fm.php";
|
50 |
+
$view = new FMViewThemes_fm($model);
|
51 |
+
$view->edit(0, FALSE);
|
52 |
+
}
|
53 |
+
|
54 |
+
public function edit() {
|
55 |
+
require_once WD_FM_DIR . "/admin/models/FMModelThemes_fm.php";
|
56 |
+
$model = new FMModelThemes_fm();
|
57 |
+
|
58 |
+
require_once WD_FM_DIR . "/admin/views/FMViewThemes_fm.php";
|
59 |
+
$view = new FMViewThemes_fm($model);
|
60 |
+
// $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
|
61 |
+
$id = WDW_FM_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_FM_Library::get('page');
|
69 |
+
WDW_FM_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_FM_Library::get('current_id', $id);
|
80 |
+
$page = WDW_FM_Library::get('page');
|
81 |
+
WDW_FM_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_FM_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_FM_Library::get('page');
|
135 |
+
WDW_FM_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_FM_Library::get('page');
|
163 |
+
WDW_FM_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_FM_Library::get('page');
|
178 |
+
WDW_FM_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_fm.php
CHANGED
@@ -1,57 +1,57 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerUninstall_fm {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function execute() {
|
22 |
-
$task = ((isset($_POST['task'])) ? esc_html(stripslashes($_POST['task'])) : '');
|
23 |
-
if (method_exists($this, $task)) {
|
24 |
-
$this->$task();
|
25 |
-
}
|
26 |
-
else {
|
27 |
-
$this->display();
|
28 |
-
}
|
29 |
-
}
|
30 |
-
|
31 |
-
public function display() {
|
32 |
-
require_once WD_FM_DIR . "/admin/models/FMModelUninstall_fm.php";
|
33 |
-
$model = new FMModelUninstall_fm();
|
34 |
-
|
35 |
-
require_once WD_FM_DIR . "/admin/views/FMViewUninstall_fm.php";
|
36 |
-
$view = new FMViewUninstall_fm($model);
|
37 |
-
$view->display();
|
38 |
-
}
|
39 |
-
|
40 |
-
public function uninstall() {
|
41 |
-
require_once WD_FM_DIR . "/admin/models/FMModelUninstall_fm.php";
|
42 |
-
$model = new FMModelUninstall_fm();
|
43 |
-
|
44 |
-
require_once WD_FM_DIR . "/admin/views/FMViewUninstall_fm.php";
|
45 |
-
$view = new FMViewUninstall_fm($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_fm {
|
4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
+
// Events //
|
6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
+
// Constants //
|
9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
+
// Variables //
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
+
// Constructor & Destructor //
|
15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
+
public function __construct() {
|
17 |
+
}
|
18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
+
// Public Methods //
|
20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
+
public function execute() {
|
22 |
+
$task = ((isset($_POST['task'])) ? esc_html(stripslashes($_POST['task'])) : '');
|
23 |
+
if (method_exists($this, $task)) {
|
24 |
+
$this->$task();
|
25 |
+
}
|
26 |
+
else {
|
27 |
+
$this->display();
|
28 |
+
}
|
29 |
+
}
|
30 |
+
|
31 |
+
public function display() {
|
32 |
+
require_once WD_FM_DIR . "/admin/models/FMModelUninstall_fm.php";
|
33 |
+
$model = new FMModelUninstall_fm();
|
34 |
+
|
35 |
+
require_once WD_FM_DIR . "/admin/views/FMViewUninstall_fm.php";
|
36 |
+
$view = new FMViewUninstall_fm($model);
|
37 |
+
$view->display();
|
38 |
+
}
|
39 |
+
|
40 |
+
public function uninstall() {
|
41 |
+
require_once WD_FM_DIR . "/admin/models/FMModelUninstall_fm.php";
|
42 |
+
$model = new FMModelUninstall_fm();
|
43 |
+
|
44 |
+
require_once WD_FM_DIR . "/admin/views/FMViewUninstall_fm.php";
|
45 |
+
$view = new FMViewUninstall_fm($model);
|
46 |
+
$view->uninstall();
|
47 |
+
}
|
48 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
49 |
+
// Getters & Setters //
|
50 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
51 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
52 |
+
// Private Methods //
|
53 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
54 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
55 |
+
// Listeners //
|
56 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
57 |
}
|
admin/controllers/FMControllerWidget.php
CHANGED
@@ -1,61 +1,61 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerWidget extends WP_Widget {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
private $view;
|
14 |
-
private $model;
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
// Constructor & Destructor //
|
17 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
18 |
-
public function __construct() {
|
19 |
-
$widget_ops = array(
|
20 |
-
'classname' => 'form_maker_widget',
|
21 |
-
'description' => 'Add Form Maker widget.'
|
22 |
-
);
|
23 |
-
// Widget Control Settings.
|
24 |
-
$control_ops = array('id_base' => 'form_maker_widget');
|
25 |
-
// Create the widget.
|
26 |
-
$this->WP_Widget('form_maker_widget', 'Form Maker', $widget_ops, $control_ops);
|
27 |
-
require_once WD_FM_DIR . "/admin/models/FMModelWidget.php";
|
28 |
-
$this->model = new FMModelWidget();
|
29 |
-
|
30 |
-
require_once WD_FM_DIR . "/admin/views/FMViewWidget.php";
|
31 |
-
$this->view = new FMViewWidget($this->model);
|
32 |
-
}
|
33 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
34 |
-
// Public Methods //
|
35 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
36 |
-
|
37 |
-
public function widget($args, $instance) {
|
38 |
-
$this->view->widget($args, $instance);
|
39 |
-
}
|
40 |
-
|
41 |
-
public function form( $instance ) {
|
42 |
-
$this->view->form($instance, parent::get_field_id('title'), parent::get_field_name('title'), parent::get_field_id('form_id'), parent::get_field_name('form_id'));
|
43 |
-
}
|
44 |
-
|
45 |
-
// Update Settings.
|
46 |
-
public function update($new_instance, $old_instance) {
|
47 |
-
$instance['title'] = $new_instance['title'];
|
48 |
-
$instance['form_id'] = $new_instance['form_id'];
|
49 |
-
return $instance;
|
50 |
-
}
|
51 |
-
|
52 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
53 |
-
// Getters & Setters //
|
54 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
55 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
56 |
-
// Private Methods //
|
57 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
58 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
59 |
-
// Listeners //
|
60 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
61 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FMControllerWidget extends WP_Widget {
|
4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
+
// Events //
|
6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
+
// Constants //
|
9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
+
// Variables //
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
private $view;
|
14 |
+
private $model;
|
15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
+
// Constructor & Destructor //
|
17 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
18 |
+
public function __construct() {
|
19 |
+
$widget_ops = array(
|
20 |
+
'classname' => 'form_maker_widget',
|
21 |
+
'description' => 'Add Form Maker widget.'
|
22 |
+
);
|
23 |
+
// Widget Control Settings.
|
24 |
+
$control_ops = array('id_base' => 'form_maker_widget');
|
25 |
+
// Create the widget.
|
26 |
+
$this->WP_Widget('form_maker_widget', 'Form Maker', $widget_ops, $control_ops);
|
27 |
+
require_once WD_FM_DIR . "/admin/models/FMModelWidget.php";
|
28 |
+
$this->model = new FMModelWidget();
|
29 |
+
|
30 |
+
require_once WD_FM_DIR . "/admin/views/FMViewWidget.php";
|
31 |
+
$this->view = new FMViewWidget($this->model);
|
32 |
+
}
|
33 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
34 |
+
// Public Methods //
|
35 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
36 |
+
|
37 |
+
public function widget($args, $instance) {
|
38 |
+
$this->view->widget($args, $instance);
|
39 |
+
}
|
40 |
+
|
41 |
+
public function form( $instance ) {
|
42 |
+
$this->view->form($instance, parent::get_field_id('title'), parent::get_field_name('title'), parent::get_field_id('form_id'), parent::get_field_name('form_id'));
|
43 |
+
}
|
44 |
+
|
45 |
+
// Update Settings.
|
46 |
+
public function update($new_instance, $old_instance) {
|
47 |
+
$instance['title'] = $new_instance['title'];
|
48 |
+
$instance['form_id'] = $new_instance['form_id'];
|
49 |
+
return $instance;
|
50 |
+
}
|
51 |
+
|
52 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
53 |
+
// Getters & Setters //
|
54 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
55 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
56 |
+
// Private Methods //
|
57 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
58 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
59 |
+
// Listeners //
|
60 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
61 |
}
|
admin/models/FMModelBlocked_ips_fm.php
CHANGED
@@ -1,73 +1,73 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMModelBlocked_ips_fm {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function get_rows_data() {
|
22 |
-
global $wpdb;
|
23 |
-
$where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE `ip` LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
|
24 |
-
$asc_or_desc = ((isset($_POST['asc_or_desc'])) ? 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_fm {
|
4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
+
// Events //
|
6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
+
// Constants //
|
9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
+
// Variables //
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
+
// Constructor & Destructor //
|
15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
+
public function __construct() {
|
17 |
+
}
|
18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
+
// Public Methods //
|
20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
+
public function get_rows_data() {
|
22 |
+
global $wpdb;
|
23 |
+
$where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE `ip` LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
|
24 |
+
$asc_or_desc = ((isset($_POST['asc_or_desc'])) ? 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/FMModelFormMakerEditCSS.php
CHANGED
@@ -1,42 +1,42 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMModelFormMakerEditCSS {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
|
22 |
-
public function get_theme_row($id) {
|
23 |
-
global $wpdb;
|
24 |
-
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id));
|
25 |
-
return $row;
|
26 |
-
}
|
27 |
-
|
28 |
-
/*public function get_form($form_id) {
|
29 |
-
global $wpdb;
|
30 |
-
$form = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $form_id));
|
31 |
-
return $form;
|
32 |
-
}*/
|
33 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
34 |
-
// Getters & Setters //
|
35 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
36 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
37 |
-
// Private Methods //
|
38 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
39 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
40 |
-
// Listeners //
|
41 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
42 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FMModelFormMakerEditCSS {
|
4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
+
// Events //
|
6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
+
// Constants //
|
9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
+
// Variables //
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
+
// Constructor & Destructor //
|
15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
+
public function __construct() {
|
17 |
+
}
|
18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
+
// Public Methods //
|
20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
+
|
22 |
+
public function get_theme_row($id) {
|
23 |
+
global $wpdb;
|
24 |
+
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id));
|
25 |
+
return $row;
|
26 |
+
}
|
27 |
+
|
28 |
+
/*public function get_form($form_id) {
|
29 |
+
global $wpdb;
|
30 |
+
$form = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $form_id));
|
31 |
+
return $form;
|
32 |
+
}*/
|
33 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
34 |
+
// Getters & Setters //
|
35 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
36 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
37 |
+
// Private Methods //
|
38 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
39 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
40 |
+
// Listeners //
|
41 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
42 |
}
|
admin/models/FMModelFormMakerPreview.php
CHANGED
@@ -1,42 +1,42 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMModelFormMakerPreview {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
|
22 |
-
public function get_theme_css($id) {
|
23 |
-
global $wpdb;
|
24 |
-
$css = $wpdb->get_var($wpdb->prepare('SELECT css FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id));
|
25 |
-
return $css;
|
26 |
-
}
|
27 |
-
|
28 |
-
public function get_form($form_id) {
|
29 |
-
global $wpdb;
|
30 |
-
$form = $wpdb->get_var($wpdb->prepare('SELECT form_front FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $form_id));
|
31 |
-
return $form;
|
32 |
-
}
|
33 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
34 |
-
// Getters & Setters //
|
35 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
36 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
37 |
-
// Private Methods //
|
38 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
39 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
40 |
-
// Listeners //
|
41 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
42 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FMModelFormMakerPreview {
|
4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
+
// Events //
|
6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
+
// Constants //
|
9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
+
// Variables //
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
+
// Constructor & Destructor //
|
15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
+
public function __construct() {
|
17 |
+
}
|
18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
+
// Public Methods //
|
20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
+
|
22 |
+
public function get_theme_css($id) {
|
23 |
+
global $wpdb;
|
24 |
+
$css = $wpdb->get_var($wpdb->prepare('SELECT css FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id));
|
25 |
+
return $css;
|
26 |
+
}
|
27 |
+
|
28 |
+
public function get_form($form_id) {
|
29 |
+
global $wpdb;
|
30 |
+
$form = $wpdb->get_var($wpdb->prepare('SELECT form_front FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $form_id));
|
31 |
+
return $form;
|
32 |
+
}
|
33 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
34 |
+
// Getters & Setters //
|
35 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
36 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
37 |
+
// Private Methods //
|
38 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
39 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
40 |
+
// Listeners //
|
41 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
42 |
}
|
admin/models/FMModelFormMakerSQLMapping.php
CHANGED
@@ -1,121 +1,121 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMModelFormMakerSQLMapping {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
|
22 |
-
function get_query($id) {
|
23 |
-
global $wpdb;
|
24 |
-
$rows = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker_query where id=" . $id);
|
25 |
-
return $rows;
|
26 |
-
}
|
27 |
-
|
28 |
-
function get_labels($form_id) {
|
29 |
-
global $wpdb;
|
30 |
-
// $wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
31 |
-
// wp_set_wpdb_vars();
|
32 |
-
$rows = $wpdb->get_var("SELECT label_order_current FROM " . $wpdb->prefix . "formmaker where id=" . $form_id);
|
33 |
-
return $rows;
|
34 |
-
}
|
35 |
-
|
36 |
-
function get_tables() {
|
37 |
-
global $wpdb;
|
38 |
-
$con_type = $_POST['con_type'];
|
39 |
-
|
40 |
-
if($con_type == 'local') {
|
41 |
-
$query = "SHOW TABLES";
|
42 |
-
$tables = $wpdb->get_col($query);
|
43 |
-
}
|
44 |
-
else if($con_type == 'remote') {
|
45 |
-
$username = isset($_POST['username']) ? $_POST['username'] : '';
|
46 |
-
$password = isset($_POST['password']) ? $_POST['password'] : '';
|
47 |
-
$database = isset($_POST['database']) ? $_POST['database'] : '';
|
48 |
-
$host = isset($_POST['host']) ? $_POST['host'] : '';
|
49 |
-
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
50 |
-
$query = "SHOW TABLES";
|
51 |
-
$tables = $wpdb_temp->get_col($query);
|
52 |
-
}
|
53 |
-
//$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
54 |
-
return $tables;
|
55 |
-
}
|
56 |
-
|
57 |
-
function get_tables_saved($con_type, $username, $password, $database, $host) {
|
58 |
-
global $wpdb;
|
59 |
-
|
60 |
-
if($con_type == 'local') {
|
61 |
-
$query = "SHOW TABLES";
|
62 |
-
$tables = $wpdb->get_col($query);
|
63 |
-
}
|
64 |
-
else if($con_type == 'remote') {
|
65 |
-
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
66 |
-
$query = "SHOW TABLES";
|
67 |
-
$tables = $wpdb_temp->get_col($query);
|
68 |
-
}
|
69 |
-
//$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
70 |
-
return $tables;
|
71 |
-
}
|
72 |
-
|
73 |
-
function get_table_struct() {
|
74 |
-
global $wpdb;
|
75 |
-
$name = isset($_POST['name']) ? $_POST['name'] : NULL;
|
76 |
-
if(!$name)
|
77 |
-
return array();
|
78 |
-
$con_method = $_POST['con_method'];
|
79 |
-
$con_type = $_POST['con_type'];
|
80 |
-
$query = "SHOW COLUMNS FROM " . $name;
|
81 |
-
if($con_type == 'remote') {
|
82 |
-
$username = isset($_POST['username']) ? $_POST['username'] : '';
|
83 |
-
$password = isset($_POST['password']) ? $_POST['password'] : '';
|
84 |
-
$database = isset($_POST['database']) ? $_POST['database'] : '';
|
85 |
-
$host = isset($_POST['host']) ? $_POST['host'] : '';
|
86 |
-
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
87 |
-
$table_struct = $wpdb_temp->get_results($query);
|
88 |
-
}
|
89 |
-
else {
|
90 |
-
$table_struct = $wpdb->get_results($query);
|
91 |
-
}
|
92 |
-
//$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
93 |
-
return $table_struct;
|
94 |
-
}
|
95 |
-
|
96 |
-
function get_table_struct_saved($con_type, $username, $password, $database, $host, $name, $con_method) {
|
97 |
-
global $wpdb;
|
98 |
-
if(!$name)
|
99 |
-
return array();
|
100 |
-
$query = "SHOW COLUMNS FROM " . $name;
|
101 |
-
if($con_type == 'remote') {
|
102 |
-
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
103 |
-
$table_struct = $wpdb_temp->get_results($query);
|
104 |
-
}
|
105 |
-
else {
|
106 |
-
$table_struct = $wpdb->get_results($query);
|
107 |
-
}
|
108 |
-
//$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
109 |
-
return $table_struct;
|
110 |
-
}
|
111 |
-
|
112 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
113 |
-
// Getters & Setters //
|
114 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
115 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
116 |
-
// Private Methods //
|
117 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
118 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
119 |
-
// Listeners //
|
120 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
121 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FMModelFormMakerSQLMapping {
|
4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
+
// Events //
|
6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
+
// Constants //
|
9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
+
// Variables //
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
+
// Constructor & Destructor //
|
15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
+
public function __construct() {
|
17 |
+
}
|
18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
+
// Public Methods //
|
20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
+
|
22 |
+
function get_query($id) {
|
23 |
+
global $wpdb;
|
24 |
+
$rows = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker_query where id=" . $id);
|
25 |
+
return $rows;
|
26 |
+
}
|
27 |
+
|
28 |
+
function get_labels($form_id) {
|
29 |
+
global $wpdb;
|
30 |
+
// $wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
31 |
+
// wp_set_wpdb_vars();
|
32 |
+
$rows = $wpdb->get_var("SELECT label_order_current FROM " . $wpdb->prefix . "formmaker where id=" . $form_id);
|
33 |
+
return $rows;
|
34 |
+
}
|
35 |
+
|
36 |
+
function get_tables() {
|
37 |
+
global $wpdb;
|
38 |
+
$con_type = $_POST['con_type'];
|
39 |
+
|
40 |
+
if($con_type == 'local') {
|
41 |
+
$query = "SHOW TABLES";
|
42 |
+
$tables = $wpdb->get_col($query);
|
43 |
+
}
|
44 |
+
else if($con_type == 'remote') {
|
45 |
+
$username = isset($_POST['username']) ? $_POST['username'] : '';
|
46 |
+
$password = isset($_POST['password']) ? $_POST['password'] : '';
|
47 |
+
$database = isset($_POST['database']) ? $_POST['database'] : '';
|
48 |
+
$host = isset($_POST['host']) ? $_POST['host'] : '';
|
49 |
+
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
50 |
+
$query = "SHOW TABLES";
|
51 |
+
$tables = $wpdb_temp->get_col($query);
|
52 |
+
}
|
53 |
+
//$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
54 |
+
return $tables;
|
55 |
+
}
|
56 |
+
|
57 |
+
function get_tables_saved($con_type, $username, $password, $database, $host) {
|
58 |
+
global $wpdb;
|
59 |
+
|
60 |
+
if($con_type == 'local') {
|
61 |
+
$query = "SHOW TABLES";
|
62 |
+
$tables = $wpdb->get_col($query);
|
63 |
+
}
|
64 |
+
else if($con_type == 'remote') {
|
65 |
+
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
66 |
+
$query = "SHOW TABLES";
|
67 |
+
$tables = $wpdb_temp->get_col($query);
|
68 |
+
}
|
69 |
+
//$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
70 |
+
return $tables;
|
71 |
+
}
|
72 |
+
|
73 |
+
function get_table_struct() {
|
74 |
+
global $wpdb;
|
75 |
+
$name = isset($_POST['name']) ? $_POST['name'] : NULL;
|
76 |
+
if(!$name)
|
77 |
+
return array();
|
78 |
+
$con_method = $_POST['con_method'];
|
79 |
+
$con_type = $_POST['con_type'];
|
80 |
+
$query = "SHOW COLUMNS FROM " . $name;
|
81 |
+
if($con_type == 'remote') {
|
82 |
+
$username = isset($_POST['username']) ? $_POST['username'] : '';
|
83 |
+
$password = isset($_POST['password']) ? $_POST['password'] : '';
|
84 |
+
$database = isset($_POST['database']) ? $_POST['database'] : '';
|
85 |
+
$host = isset($_POST['host']) ? $_POST['host'] : '';
|
86 |
+
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
87 |
+
$table_struct = $wpdb_temp->get_results($query);
|
88 |
+
}
|
89 |
+
else {
|
90 |
+
$table_struct = $wpdb->get_results($query);
|
91 |
+
}
|
92 |
+
//$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
93 |
+
return $table_struct;
|
94 |
+
}
|
95 |
+
|
96 |
+
function get_table_struct_saved($con_type, $username, $password, $database, $host, $name, $con_method) {
|
97 |
+
global $wpdb;
|
98 |
+
if(!$name)
|
99 |
+
return array();
|
100 |
+
$query = "SHOW COLUMNS FROM " . $name;
|
101 |
+
if($con_type == 'remote') {
|
102 |
+
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
103 |
+
$table_struct = $wpdb_temp->get_results($query);
|
104 |
+
}
|
105 |
+
else {
|
106 |
+
$table_struct = $wpdb->get_results($query);
|
107 |
+
}
|
108 |
+
//$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
109 |
+
return $table_struct;
|
110 |
+
}
|
111 |
+
|
112 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
113 |
+
// Getters & Setters //
|
114 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
115 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
116 |
+
// Private Methods //
|
117 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
118 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
119 |
+
// Listeners //
|
120 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
121 |
}
|
admin/models/FMModelFormmakerwdcaptcha.php
CHANGED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMModelFormmakerwdcaptcha {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
|
22 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
23 |
-
// Getters & Setters //
|
24 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
25 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
26 |
-
// Private Methods //
|
27 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
28 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
29 |
-
// Listeners //
|
30 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
31 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FMModelFormmakerwdcaptcha {
|
4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
+
// Events //
|
6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
+
// Constants //
|
9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
+
// Variables //
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
+
// Constructor & Destructor //
|
15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
+
public function __construct() {
|
17 |
+
}
|
18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
+
// Public Methods //
|
20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
+
|
22 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
23 |
+
// Getters & Setters //
|
24 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
25 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
26 |
+
// Private Methods //
|
27 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
28 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
29 |
+
// Listeners //
|
30 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
31 |
}
|
admin/models/FMModelFormmakerwindow.php
CHANGED
@@ -1,36 +1,36 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMModelFormmakerwindow {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
|
22 |
-
public function get_form_data() {
|
23 |
-
global $wpdb;
|
24 |
-
$row = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE `id` NOT IN(" . get_option('contact_form_forms', 0) . ") order by `title`");
|
25 |
-
return $row;
|
26 |
-
}
|
27 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
28 |
-
// Getters & Setters //
|
29 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
30 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
31 |
-
// Private Methods //
|
32 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
33 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
34 |
-
// Listeners //
|
35 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
36 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FMModelFormmakerwindow {
|
4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
+
// Events //
|
6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
+
// Constants //
|
9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
+
// Variables //
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
+
// Constructor & Destructor //
|
15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
+
public function __construct() {
|
17 |
+
}
|
18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
+
// Public Methods //
|
20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
+
|
22 |
+
public function get_form_data() {
|
23 |
+
global $wpdb;
|
24 |
+
$row = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE `id` NOT IN(" . get_option('contact_form_forms', 0) . ") order by `title`");
|
25 |
+
return $row;
|
26 |
+
}
|
27 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
28 |
+
// Getters & Setters //
|
29 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
30 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
31 |
+
// Private Methods //
|
32 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
33 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
34 |
+
// Listeners //
|
35 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
36 |
}
|
admin/models/FMModelFromeditcountryinpopup.php
CHANGED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMModelFromeditcountryinpopup {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
|
22 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
23 |
-
// Getters & Setters //
|
24 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
25 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
26 |
-
// Private Methods //
|
27 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
28 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
29 |
-
// Listeners //
|
30 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
31 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FMModelFromeditcountryinpopup {
|
4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
+
// Events //
|
6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
+
// Constants //
|
9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
+
// Variables //
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
+
// Constructor & Destructor //
|
15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
+
public function __construct() {
|
17 |
+
}
|
18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
+
// Public Methods //
|
20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
+
|
22 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
23 |
+
// Getters & Setters //
|
24 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
25 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
26 |
+
// Private Methods //
|
27 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
28 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
29 |
+
// Listeners //
|
30 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
31 |
}
|
admin/models/FMModelFromipinfoinpopup.php
CHANGED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMModelFromipinfoinpopup {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
|
22 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
23 |
-
// Getters & Setters //
|
24 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
25 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
26 |
-
// Private Methods //
|
27 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
28 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
29 |
-
// Listeners //
|
30 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
31 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FMModelFromipinfoinpopup {
|
4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
+
// Events //
|
6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
+
// Constants //
|
9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
+
// Variables //
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
+
// Constructor & Destructor //
|
15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
+
public function __construct() {
|
17 |
+
}
|
18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
+
// Public Methods //
|
20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
+
|
22 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
23 |
+
// Getters & Setters //
|
24 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
25 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
26 |
+
// Private Methods //
|
27 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
28 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
29 |
+
// Listeners //
|
30 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
31 |
}
|
admin/models/FMModelFrommapeditinpopup.php
CHANGED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMModelFrommapeditinpopup {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
|
22 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
23 |
-
// Getters & Setters //
|
24 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
25 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
26 |
-
// Private Methods //
|
27 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
28 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
29 |
-
// Listeners //
|
30 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
31 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FMModelFrommapeditinpopup {
|
4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
+
// Events //
|
6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
+
// Constants //
|
9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
+
// Variables //
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
+
// Constructor & Destructor //
|
15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
+
public function __construct() {
|
17 |
+
}
|
18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
+
// Public Methods //
|
20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
+
|
22 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
23 |
+
// Getters & Setters //
|
24 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
25 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
26 |
+
// Private Methods //
|
27 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
28 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
29 |
+
// Listeners //
|
30 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
31 |
}
|
admin/models/FMModelGenerete_csv.php
CHANGED
@@ -1,262 +1,262 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMModelGenerete_csv {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
|
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(''', "'", $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 {
|
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(''', "'", $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.php
CHANGED
@@ -1,260 +1,260 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMModelGenerete_xml {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
|
22 |
-
public function get_data() {
|
23 |
-
$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('&', "&", $t->element_value);
|
224 |
-
$val = stripslashes(str_replace(''', "'", $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 {
|
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('&', "&", $t->element_value);
|
224 |
+
$val = stripslashes(str_replace(''', "'", $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_fm.php
CHANGED
@@ -1,30 +1,30 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMModelLicensing_fm {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
22 |
-
// Getters & Setters //
|
23 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
24 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
25 |
-
// Private Methods //
|
26 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
27 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
28 |
-
// Listeners //
|
29 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
30 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FMModelLicensing_fm {
|
4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
+
// Events //
|
6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
+
// Constants //
|
9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
+
// Variables //
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
+
// Constructor & Destructor //
|
15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
+
public function __construct() {
|
17 |
+
}
|
18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
+
// Public Methods //
|
20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
22 |
+
// Getters & Setters //
|
23 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
24 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
25 |
+
// Private Methods //
|
26 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
27 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
28 |
+
// Listeners //
|
29 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
30 |
}
|
admin/models/FMModelManage_fm.php
CHANGED
@@ -1,1837 +1,1837 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMModelManage_fm {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function get_rows_data() {
|
22 |
-
global $wpdb;
|
23 |
-
$where = 'WHERE `id` NOT IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ')';
|
24 |
-
$where .= ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? ' AND title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
|
25 |
-
$asc_or_desc = ((isset($_POST['asc_or_desc'])) ? 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("'.$id.'","","form_id_temp")" '.$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("'.$id.'_elementform_id_temp")" onblur="return_value("'.$id.'_elementform_id_temp")" onchange="change_value("'.$id.'_elementform_id_temp")" 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("'.$id.'_elementform_id_temp")" onblur="return_value("'.$id.'_elementform_id_temp")" onchange="change_value("'.$id.'_elementform_id_temp")" 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("'.$id.'_elementform_id_temp")" onblur="return_value("'.$id.'_elementform_id_temp")" onchange="change_value("'.$id.'_elementform_id_temp")" 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("'.$id.'_element_firstform_id_temp")"onblur="return_value("'.$id.'_element_firstform_id_temp")"onchange="change_value("'.$id.'_element_firstform_id_temp")" 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("'.$id.'_element_lastform_id_temp")"onblur="return_value("'.$id.'_element_lastform_id_temp")" onchange="change_value("'.$id.'_element_lastform_id_temp")" 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("'.$id.'_element_firstform_id_temp")"onblur="return_value("'.$id.'_element_firstform_id_temp")" onchange="change_value("'.$id.'_element_firstform_id_temp")" 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("'.$id.'_element_lastform_id_temp")"onblur="return_value("'.$id.'_element_lastform_id_temp")" onchange="change_value("'.$id.'_element_lastform_id_temp")" 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("'.$id.'_element_titleform_id_temp")" onblur="return_value("'.$id.'_element_titleform_id_temp")" onchange="change_value("'.$id.'_element_titleform_id_temp")" 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("'.$id.'_element_firstform_id_temp")" onblur="return_value("'.$id.'_element_firstform_id_temp")" onchange="change_value("'.$id.'_element_firstform_id_temp")" 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("'.$id.'_element_lastform_id_temp")" onblur="return_value("'.$id.'_element_lastform_id_temp")" onchange="change_value("'.$id.'_element_lastform_id_temp")" 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("'.$id.'_element_middleform_id_temp")" onblur="return_value("'.$id.'_element_middleform_id_temp")" onchange="change_value("'.$id.'_element_middleform_id_temp")" 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("'.$id.'_street1form_id_temp")" 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("'.$id.'_street2form_id_temp")" 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("'.$id.'_cityform_id_temp")" 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("'.$id.'_stateform_id_temp")" 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("'.$id.'_stateform_id_temp")" 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("'.$id.'_postalform_id_temp")" 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("'.$id.'_countryform_id_temp")" 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("'.$id.'_elementform_id_temp")" onblur="return_value("'.$id.'_elementform_id_temp")" onchange="change_value("'.$id.'_elementform_id_temp")" 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("'.$id.'","'.((int)$param['w_rowcol']*$l+$i).'","form_id_temp")) show_other_input("'.$id.'","form_id_temp");" '.$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("'.$id.'","'.((int)$param['w_rowcol']*$l+$i).'","form_id_temp")" '.$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("'.$id.'","'.((int)$param['w_rowcol']*$i+$l).'","form_id_temp")) show_other_input("'.$id.'","form_id_temp");" '.$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("'.$id.'","'.((int)$param['w_rowcol']*$i+$l).'","form_id_temp")" '.$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("'.$id.'","'.((int)$param['w_rowcol']*$i+$l).'","form_id_temp")) show_other_input("'.$id.'","form_id_temp");" '.$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("'.$id.'","'.((int)$param['w_rowcol']*$i+$l).'","form_id_temp")" '.$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("'.$id.'","'.$l.'","form_id_temp")) show_other_input("'.$id.'","form_id_temp");" '.$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("'.$id.'","'.$l.'","form_id_temp")" '.$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("'.$id.'","'.((int)$param['w_rowcol']*$l+$i).'","form_id_temp"); show_other_input("'.$id.'","form_id_temp");" '.$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("'.$id.'","'.((int)$param['w_rowcol']*$l+$i).'","form_id_temp")" '.$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("'.$id.'","'.((int)$param['w_rowcol']*$i+$l).'","form_id_temp"); show_other_input("'.$id.'","form_id_temp");" '.$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("'.$id.'","'.((int)$param['w_rowcol']*$i+$l).'","form_id_temp")" '.$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("'.$id.'","'.((int)$param['w_rowcol']*$i+$l).'","form_id_temp"); show_other_input("'.$id.'","form_id_temp");" '.$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("'.$id.'","'.((int)$param['w_rowcol']*$i+$l).'","form_id_temp")" '.$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("'.$id.'","'.$l.'","form_id_temp"); show_other_input("'.$id.'","form_id_temp");" '.$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("'.$id.'","'.$l.'","form_id_temp")" '.$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("'.$id.'_option'.$key.'")" '.$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;"> : </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, "'.$id.'_ssform_id_temp")" onkeyup="change_second("'.$id.'_ssform_id_temp")" onblur="add_0("'.$id.'_ssform_id_temp")" '.$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, "'.$id.'_hhform_id_temp", "23")" onkeyup="change_hour(event, "'.$id.'_hhform_id_temp","23")" onblur="add_0("'.$id.'_hhform_id_temp")" '.$param['attributes'].'></div><div align="center" style="display: table-cell;"><span class="wdform_colon" style="vertical-align: middle;"> : </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, "'.$id.'_mmform_id_temp")" onkeyup="change_minute(event, "'.$id.'_mmform_id_temp")" onblur="add_0("'.$id.'_mmform_id_temp")" '.$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("'.$id.'_elementform_id_temp")" '.$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("'.$id.'_elementform_id_temp" , "'.$param['w_format'].'")"></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("'.$id.'_dayform_id_temp")" onkeypress="return check_day(event, "'.$id.'_dayform_id_temp")" onblur="if (this.value=="0") this.value=""; else add_0("'.$id.'_dayform_id_temp")" 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, "'.$id.'_monthform_id_temp")" onchange="change_value("'.$id.'_monthform_id_temp")" onblur="if (this.value=="0") this.value=""; else add_0("'.$id.'_monthform_id_temp")" 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("'.$id.'_yearform_id_temp")" onkeypress="return check_year1(event, "'.$id.'_yearform_id_temp")" onblur="check_year2("'.$id.'_yearform_id_temp")" 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' => 'formmakerwdcaptcha', 'digit' => $param['w_digit'], 'i' => 'form_id_temp'), admin_url('admin-ajax.php')) . '" id="_wd_captchaform_id_temp" class="captcha_img" onclick="captcha_refresh("_wd_captcha","form_id_temp")" '.$param['attributes'].'></div><div valign="middle" style="display: table-cell;"><div class="captcha_refresh" id="_element_refreshform_id_temp" onclick="captcha_refresh("_wd_captcha","form_id_temp")" '.$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(' ','',$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--> $ <!--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("'.$id.'_element_dollarsform_id_temp")" onblur="return_value("'.$id.'_element_dollarsform_id_temp")"onchange="change_value("'.$id.'_element_dollarsform_id_temp")" 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;"> . </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("'.$id.'_element_centsform_id_temp")" onblur="return_value("'.$id.'_element_centsform_id_temp"); add_0("'.$id.'_element_centsform_id_temp")"onchange="change_value("'.$id.'_element_centsform_id_temp")" onkeypress="return check_isnum_interval(event,"'.$id.'_element_centsform_id_temp",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("'.$id.'_option'.$key.'")" '.$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("'.$id.'_element_quantityform_id_temp", 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("'.$id.'","'.$key.'","form_id_temp")) show_other_input("'.$id.'","form_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>';
|
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("'.$id.'","'.$key.'","form_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>';
|
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("'.$id.'","'.$key.'","form_id_temp")) show_other_input("'.$id.'","form_id_temp");" 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("'.$id.'","'.$key.'","form_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>'; }
|
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("'.$id.'_element_quantityform_id_temp", 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("'.$id.'","'.$key.'","form_id_temp"); show_other_input("'.$id.'","form_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>';
|
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("'.$id.'","'.$key.'","form_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>';
|
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("'.$id.'","'.$key.'","form_id_temp"); show_other_input("'.$id.'","form_id_temp");" 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("'.$id.'","'.$key.'","form_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>'; }
|
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("'.$id.'_element_quantityform_id_temp", 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("'.$id.'","'.$key.'","form_id_temp"); show_other_input("'.$id.'","form_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>';
|
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("'.$id.'","'.$key.'","form_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>';
|
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("'.$id.'","'.$key.'","form_id_temp"); show_other_input("'.$id.'","form_id_temp");" 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("'.$id.'","'.$key.'","form_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>'; }
|
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_FM_URL . '/images/star.png" onmouseover="change_src('.$i.','.$id.',"form_id_temp")" onmouseout="reset_src('.$i.','.$id.')" onclick="select_star_rating('.$i.','.$id.', "form_id_temp")">';
|
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.',"form_id_temp")" onchange="sum_grading_values('.$id.',"form_id_temp")" '.$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("submit", "form_id_temp");" '.$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("reset");" '.$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_FM_URL . '/images/delete_el.png" title="Remove the field" onclick="remove_section_break("'.$id.'")"></div><div id="edit_'.$id.'" class="element_toolbar"><img src="' . WD_FM_URL . '/images/edit.png" title="Edit the field" onclick="edit("'.$id.'")"><span id="'.$id.'_element_labelform_id_temp" style="display: none;">custom_'.$id.'</span></div><div id="dublicate_'.$id.'" class="element_toolbar"><img src="' . WD_FM_URL . '/images/dublicate.png" title="Dublicate the field" onclick="dublicate("'.$id.'")"></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_FM_URL . '/images/delete_el.png" title="Remove the field" onclick="remove_row("'.$id.'")"></div><div id="left_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/left.png" title="Move the field to the left" onclick="left_row("'.$id.'")"></div><div id="up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/up.png" title="Move the field up" onclick="up_row("'.$id.'")"></div><div id="down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/down.png" title="Move the field down" onclick="down_row("'.$id.'")"></div><div id="right_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/right.png" title="Move the field to the right" onclick="right_row("'.$id.'")"></div><div id="edit_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/edit.png" title="Edit the field" onclick="edit("'.$id.'")"></div><div id="dublicate_'.$id.'" valign="middle" class="element_toolbar"></div><div id="page_up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_up.png" title="Move the field to the upper page" onclick="page_up("'.$id.'")"></div><div id="page_down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_down.png" title="Move the field to the lower page" onclick="page_down("'.$id.'")"></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_FM_URL . '/images/delete_el.png" title="Remove the field" onclick="remove_row("'.$id.'")" onmouseover="chnage_icons_src(this,"delete_el")" onmouseout="chnage_icons_src(this,"delete_el")"></div><div id="left_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/left.png" title="Move the field to the left" onclick="left_row("'.$id.'")" onmouseover="chnage_icons_src(this,"left")" onmouseout="chnage_icons_src(this,"left")"></div><div id="up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/up.png" title="Move the field up" onclick="up_row("'.$id.'")" onmouseover="chnage_icons_src(this,"up")" onmouseout="chnage_icons_src(this,"up")"></div><div id="down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/down.png" title="Move the field down" onclick="down_row("'.$id.'")" onmouseover="chnage_icons_src(this,"down")" onmouseout="chnage_icons_src(this,"down")"></div><div id="right_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/right.png" title="Move the field to the right" onclick="right_row("'.$id.'")" onmouseover="chnage_icons_src(this,"right")" onmouseout="chnage_icons_src(this,"right")"></div><div id="edit_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/edit.png" title="Edit the field" onclick="edit("'.$id.'")" onmouseover="chnage_icons_src(this,"edit")" onmouseout="chnage_icons_src(this,"edit")"></div><div id="dublicate_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/dublicate.png" title="Dublicate the field" onclick="dublicate("'.$id.'")" onmouseover="chnage_icons_src(this,"dublicate")" onmouseout="chnage_icons_src(this,"dublicate")"></div><div id="page_up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_up.png" title="Move the field to the upper page" onclick="page_up("'.$id.'")" onmouseover="chnage_icons_src(this,"page_up")" onmouseout="chnage_icons_src(this,"page_up")"></div><div id="page_down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_down.png" title="Move the field to the lower page" onclick="page_down("'.$id.'")" onmouseover="chnage_icons_src(this,"page_down")" onmouseout="chnage_icons_src(this,"page_down")"></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 get_queries_rows_data($id) {
|
1807 |
-
global $wpdb;
|
1808 |
-
$rows = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker_query WHERE form_id=" . $id . " ORDER BY id ASC");
|
1809 |
-
return $rows;
|
1810 |
-
}
|
1811 |
-
|
1812 |
-
public function page_nav() {
|
1813 |
-
global $wpdb;
|
1814 |
-
$where = 'WHERE `id` NOT IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ')';
|
1815 |
-
$where .= ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? ' AND title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
|
1816 |
-
$query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker " . $where;
|
1817 |
-
$total = $wpdb->get_var($query);
|
1818 |
-
$page_nav['total'] = $total;
|
1819 |
-
if (isset($_POST['page_number']) && $_POST['page_number']) {
|
1820 |
-
$limit = ((int) $_POST['page_number'] - 1) * 20;
|
1821 |
-
}
|
1822 |
-
else {
|
1823 |
-
$limit = 0;
|
1824 |
-
}
|
1825 |
-
$page_nav['limit'] = (int) ($limit / 20 + 1);
|
1826 |
-
return $page_nav;
|
1827 |
-
}
|
1828 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
1829 |
-
// Getters & Setters //
|
1830 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
1831 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
1832 |
-
// Private Methods //
|
1833 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
1834 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
1835 |
-
// Listeners //
|
1836 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
1837 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FMModelManage_fm {
|
4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
+
// Events //
|
6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
+
// Constants //
|
9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
+
// Variables //
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
+
// Constructor & Destructor //
|
15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
+
public function __construct() {
|
17 |
+
}
|
18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
+
// Public Methods //
|
20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
+
public function get_rows_data() {
|
22 |
+
global $wpdb;
|
23 |
+
$where = 'WHERE `id` NOT IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ')';
|
24 |
+
$where .= ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? ' AND title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
|
25 |
+
$asc_or_desc = ((isset($_POST['asc_or_desc'])) ? 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("'.$id.'","","form_id_temp")" '.$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("'.$id.'_elementform_id_temp")" onblur="return_value("'.$id.'_elementform_id_temp")" onchange="change_value("'.$id.'_elementform_id_temp")" 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("'.$id.'_elementform_id_temp")" onblur="return_value("'.$id.'_elementform_id_temp")" onchange="change_value("'.$id.'_elementform_id_temp")" 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("'.$id.'_elementform_id_temp")" onblur="return_value("'.$id.'_elementform_id_temp")" onchange="change_value("'.$id.'_elementform_id_temp")" 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("'.$id.'_element_firstform_id_temp")"onblur="return_value("'.$id.'_element_firstform_id_temp")"onchange="change_value("'.$id.'_element_firstform_id_temp")" 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("'.$id.'_element_lastform_id_temp")"onblur="return_value("'.$id.'_element_lastform_id_temp")" onchange="change_value("'.$id.'_element_lastform_id_temp")" 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("'.$id.'_element_firstform_id_temp")"onblur="return_value("'.$id.'_element_firstform_id_temp")" onchange="change_value("'.$id.'_element_firstform_id_temp")" 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("'.$id.'_element_lastform_id_temp")"onblur="return_value("'.$id.'_element_lastform_id_temp")" onchange="change_value("'.$id.'_element_lastform_id_temp")" 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("'.$id.'_element_titleform_id_temp")" onblur="return_value("'.$id.'_element_titleform_id_temp")" onchange="change_value("'.$id.'_element_titleform_id_temp")" 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("'.$id.'_element_firstform_id_temp")" onblur="return_value("'.$id.'_element_firstform_id_temp")" onchange="change_value("'.$id.'_element_firstform_id_temp")" 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("'.$id.'_element_lastform_id_temp")" onblur="return_value("'.$id.'_element_lastform_id_temp")" onchange="change_value("'.$id.'_element_lastform_id_temp")" 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("'.$id.'_element_middleform_id_temp")" onblur="return_value("'.$id.'_element_middleform_id_temp")" onchange="change_value("'.$id.'_element_middleform_id_temp")" 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("'.$id.'_street1form_id_temp")" 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("'.$id.'_street2form_id_temp")" 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("'.$id.'_cityform_id_temp")" 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("'.$id.'_stateform_id_temp")" 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("'.$id.'_stateform_id_temp")" 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("'.$id.'_postalform_id_temp")" 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("'.$id.'_countryform_id_temp")" 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("'.$id.'_elementform_id_temp")" onblur="return_value("'.$id.'_elementform_id_temp")" onchange="change_value("'.$id.'_elementform_id_temp")" 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("'.$id.'","'.((int)$param['w_rowcol']*$l+$i).'","form_id_temp")) show_other_input("'.$id.'","form_id_temp");" '.$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("'.$id.'","'.((int)$param['w_rowcol']*$l+$i).'","form_id_temp")" '.$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("'.$id.'","'.((int)$param['w_rowcol']*$i+$l).'","form_id_temp")) show_other_input("'.$id.'","form_id_temp");" '.$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("'.$id.'","'.((int)$param['w_rowcol']*$i+$l).'","form_id_temp")" '.$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("'.$id.'","'.((int)$param['w_rowcol']*$i+$l).'","form_id_temp")) show_other_input("'.$id.'","form_id_temp");" '.$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("'.$id.'","'.((int)$param['w_rowcol']*$i+$l).'","form_id_temp")" '.$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("'.$id.'","'.$l.'","form_id_temp")) show_other_input("'.$id.'","form_id_temp");" '.$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("'.$id.'","'.$l.'","form_id_temp")" '.$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("'.$id.'","'.((int)$param['w_rowcol']*$l+$i).'","form_id_temp"); show_other_input("'.$id.'","form_id_temp");" '.$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("'.$id.'","'.((int)$param['w_rowcol']*$l+$i).'","form_id_temp")" '.$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("'.$id.'","'.((int)$param['w_rowcol']*$i+$l).'","form_id_temp"); show_other_input("'.$id.'","form_id_temp");" '.$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("'.$id.'","'.((int)$param['w_rowcol']*$i+$l).'","form_id_temp")" '.$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("'.$id.'","'.((int)$param['w_rowcol']*$i+$l).'","form_id_temp"); show_other_input("'.$id.'","form_id_temp");" '.$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("'.$id.'","'.((int)$param['w_rowcol']*$i+$l).'","form_id_temp")" '.$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("'.$id.'","'.$l.'","form_id_temp"); show_other_input("'.$id.'","form_id_temp");" '.$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("'.$id.'","'.$l.'","form_id_temp")" '.$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("'.$id.'_option'.$key.'")" '.$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;"> : </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, "'.$id.'_ssform_id_temp")" onkeyup="change_second("'.$id.'_ssform_id_temp")" onblur="add_0("'.$id.'_ssform_id_temp")" '.$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, "'.$id.'_hhform_id_temp", "23")" onkeyup="change_hour(event, "'.$id.'_hhform_id_temp","23")" onblur="add_0("'.$id.'_hhform_id_temp")" '.$param['attributes'].'></div><div align="center" style="display: table-cell;"><span class="wdform_colon" style="vertical-align: middle;"> : </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, "'.$id.'_mmform_id_temp")" onkeyup="change_minute(event, "'.$id.'_mmform_id_temp")" onblur="add_0("'.$id.'_mmform_id_temp")" '.$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("'.$id.'_elementform_id_temp")" '.$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("'.$id.'_elementform_id_temp" , "'.$param['w_format'].'")"></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("'.$id.'_dayform_id_temp")" onkeypress="return check_day(event, "'.$id.'_dayform_id_temp")" onblur="if (this.value=="0") this.value=""; else add_0("'.$id.'_dayform_id_temp")" 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, "'.$id.'_monthform_id_temp")" onchange="change_value("'.$id.'_monthform_id_temp")" onblur="if (this.value=="0") this.value=""; else add_0("'.$id.'_monthform_id_temp")" 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("'.$id.'_yearform_id_temp")" onkeypress="return check_year1(event, "'.$id.'_yearform_id_temp")" onblur="check_year2("'.$id.'_yearform_id_temp")" 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' => 'formmakerwdcaptcha', 'digit' => $param['w_digit'], 'i' => 'form_id_temp'), admin_url('admin-ajax.php')) . '" id="_wd_captchaform_id_temp" class="captcha_img" onclick="captcha_refresh("_wd_captcha","form_id_temp")" '.$param['attributes'].'></div><div valign="middle" style="display: table-cell;"><div class="captcha_refresh" id="_element_refreshform_id_temp" onclick="captcha_refresh("_wd_captcha","form_id_temp")" '.$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(' ','',$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--> $ <!--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("'.$id.'_element_dollarsform_id_temp")" onblur="return_value("'.$id.'_element_dollarsform_id_temp")"onchange="change_value("'.$id.'_element_dollarsform_id_temp")" 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;"> . </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("'.$id.'_element_centsform_id_temp")" onblur="return_value("'.$id.'_element_centsform_id_temp"); add_0("'.$id.'_element_centsform_id_temp")"onchange="change_value("'.$id.'_element_centsform_id_temp")" onkeypress="return check_isnum_interval(event,"'.$id.'_element_centsform_id_temp",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("'.$id.'_option'.$key.'")" '.$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("'.$id.'_element_quantityform_id_temp", 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("'.$id.'","'.$key.'","form_id_temp")) show_other_input("'.$id.'","form_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>';
|
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("'.$id.'","'.$key.'","form_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>';
|
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("'.$id.'","'.$key.'","form_id_temp")) show_other_input("'.$id.'","form_id_temp");" 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("'.$id.'","'.$key.'","form_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>'; }
|
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("'.$id.'_element_quantityform_id_temp", 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("'.$id.'","'.$key.'","form_id_temp"); show_other_input("'.$id.'","form_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>';
|
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("'.$id.'","'.$key.'","form_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>';
|
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("'.$id.'","'.$key.'","form_id_temp"); show_other_input("'.$id.'","form_id_temp");" 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("'.$id.'","'.$key.'","form_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>'; }
|
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("'.$id.'_element_quantityform_id_temp", 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("'.$id.'","'.$key.'","form_id_temp"); show_other_input("'.$id.'","form_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>';
|
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("'.$id.'","'.$key.'","form_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>';
|
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("'.$id.'","'.$key.'","form_id_temp"); show_other_input("'.$id.'","form_id_temp");" 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("'.$id.'","'.$key.'","form_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>'; }
|
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_FM_URL . '/images/star.png" onmouseover="change_src('.$i.','.$id.',"form_id_temp")" onmouseout="reset_src('.$i.','.$id.')" onclick="select_star_rating('.$i.','.$id.', "form_id_temp")">';
|
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.',"form_id_temp")" onchange="sum_grading_values('.$id.',"form_id_temp")" '.$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("submit", "form_id_temp");" '.$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("reset");" '.$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_FM_URL . '/images/delete_el.png" title="Remove the field" onclick="remove_section_break("'.$id.'")"></div><div id="edit_'.$id.'" class="element_toolbar"><img src="' . WD_FM_URL . '/images/edit.png" title="Edit the field" onclick="edit("'.$id.'")"><span id="'.$id.'_element_labelform_id_temp" style="display: none;">custom_'.$id.'</span></div><div id="dublicate_'.$id.'" class="element_toolbar"><img src="' . WD_FM_URL . '/images/dublicate.png" title="Dublicate the field" onclick="dublicate("'.$id.'")"></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_FM_URL . '/images/delete_el.png" title="Remove the field" onclick="remove_row("'.$id.'")"></div><div id="left_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/left.png" title="Move the field to the left" onclick="left_row("'.$id.'")"></div><div id="up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/up.png" title="Move the field up" onclick="up_row("'.$id.'")"></div><div id="down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/down.png" title="Move the field down" onclick="down_row("'.$id.'")"></div><div id="right_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/right.png" title="Move the field to the right" onclick="right_row("'.$id.'")"></div><div id="edit_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/edit.png" title="Edit the field" onclick="edit("'.$id.'")"></div><div id="dublicate_'.$id.'" valign="middle" class="element_toolbar"></div><div id="page_up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_up.png" title="Move the field to the upper page" onclick="page_up("'.$id.'")"></div><div id="page_down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_down.png" title="Move the field to the lower page" onclick="page_down("'.$id.'")"></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_FM_URL . '/images/delete_el.png" title="Remove the field" onclick="remove_row("'.$id.'")" onmouseover="chnage_icons_src(this,"delete_el")" onmouseout="chnage_icons_src(this,"delete_el")"></div><div id="left_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/left.png" title="Move the field to the left" onclick="left_row("'.$id.'")" onmouseover="chnage_icons_src(this,"left")" onmouseout="chnage_icons_src(this,"left")"></div><div id="up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/up.png" title="Move the field up" onclick="up_row("'.$id.'")" onmouseover="chnage_icons_src(this,"up")" onmouseout="chnage_icons_src(this,"up")"></div><div id="down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/down.png" title="Move the field down" onclick="down_row("'.$id.'")" onmouseover="chnage_icons_src(this,"down")" onmouseout="chnage_icons_src(this,"down")"></div><div id="right_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/right.png" title="Move the field to the right" onclick="right_row("'.$id.'")" onmouseover="chnage_icons_src(this,"right")" onmouseout="chnage_icons_src(this,"right")"></div><div id="edit_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/edit.png" title="Edit the field" onclick="edit("'.$id.'")" onmouseover="chnage_icons_src(this,"edit")" onmouseout="chnage_icons_src(this,"edit")"></div><div id="dublicate_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/dublicate.png" title="Dublicate the field" onclick="dublicate("'.$id.'")" onmouseover="chnage_icons_src(this,"dublicate")" onmouseout="chnage_icons_src(this,"dublicate")"></div><div id="page_up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_up.png" title="Move the field to the upper page" onclick="page_up("'.$id.'")" onmouseover="chnage_icons_src(this,"page_up")" onmouseout="chnage_icons_src(this,"page_up")"></div><div id="page_down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_down.png" title="Move the field to the lower page" onclick="page_down("'.$id.'")" onmouseover="chnage_icons_src(this,"page_down")" onmouseout="chnage_icons_src(this,"page_down")"></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 get_queries_rows_data($id) {
|
1807 |
+
global $wpdb;
|
1808 |
+
$rows = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker_query WHERE form_id=" . $id . " ORDER BY id ASC");
|
1809 |
+
return $rows;
|
1810 |
+
}
|
1811 |
+
|
1812 |
+
public function page_nav() {
|
1813 |
+
global $wpdb;
|
1814 |
+
$where = 'WHERE `id` NOT IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ')';
|
1815 |
+
$where .= ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? ' AND title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
|
1816 |
+
$query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker " . $where;
|
1817 |
+
$total = $wpdb->get_var($query);
|
1818 |
+
$page_nav['total'] = $total;
|
1819 |
+
if (isset($_POST['page_number']) && $_POST['page_number']) {
|
1820 |
+
$limit = ((int) $_POST['page_number'] - 1) * 20;
|
1821 |
+
}
|
1822 |
+
else {
|
1823 |
+
$limit = 0;
|
1824 |
+
}
|
1825 |
+
$page_nav['limit'] = (int) ($limit / 20 + 1);
|
1826 |
+
return $page_nav;
|
1827 |
+
}
|
1828 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
1829 |
+
// Getters & Setters //
|
1830 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
1831 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
1832 |
+
// Private Methods //
|
1833 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
1834 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
1835 |
+
// Listeners //
|
1836 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
1837 |
}
|
admin/models/FMModelShow_matrix.php
CHANGED
@@ -1,31 +1,31 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMModelShow_matrix {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
|
22 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
23 |
-
// Getters & Setters //
|
24 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
25 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
26 |
-
// Private Methods //
|
27 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
28 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
29 |
-
// Listeners //
|
30 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
31 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FMModelShow_matrix {
|
4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
+
// Events //
|
6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
+
// Constants //
|
9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
+
// Variables //
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
+
// Constructor & Destructor //
|
15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
+
public function __construct() {
|
17 |
+
}
|
18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
+
// Public Methods //
|
20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
+
|
22 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
23 |
+
// Getters & Setters //
|
24 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
25 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
26 |
+
// Private Methods //
|
27 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
28 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
29 |
+
// Listeners //
|
30 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
31 |
}
|
admin/models/FMModelThemes_fm.php
CHANGED
@@ -1,89 +1,89 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMModelThemes_fm {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function get_rows_data() {
|
22 |
-
global $wpdb;
|
23 |
-
$where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
|
24 |
-
$asc_or_desc = ((isset($_POST['asc_or_desc'])) ? 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_fm {
|
4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
+
// Events //
|
6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
+
// Constants //
|
9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
+
// Variables //
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
+
// Constructor & Destructor //
|
15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
+
public function __construct() {
|
17 |
+
}
|
18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
+
// Public Methods //
|
20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
+
public function get_rows_data() {
|
22 |
+
global $wpdb;
|
23 |
+
$where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
|
24 |
+
$asc_or_desc = ((isset($_POST['asc_or_desc'])) ? 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_fm.php
CHANGED
@@ -1,52 +1,52 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMModelUninstall_fm {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function delete_db_tables() {
|
22 |
-
global $wpdb;
|
23 |
-
$true_or_false_forms = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker WHERE `id` IN (" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ")");
|
24 |
-
if ($true_or_false_forms) {
|
25 |
-
$wpdb->query("DELETE FROM " . $wpdb->prefix . "formmaker WHERE `id` NOT IN (" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ")");
|
26 |
-
$wpdb->query("DELETE FROM " . $wpdb->prefix . "formmaker_submits WHERE `form_id` NOT IN (" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ")");
|
27 |
-
$wpdb->query("DELETE FROM " . $wpdb->prefix . "formmaker_views WHERE `form_id` NOT IN (" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ")");
|
28 |
-
}
|
29 |
-
else {
|
30 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker");
|
31 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_submits");
|
32 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_views");
|
33 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_themes");
|
34 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_sessions");
|
35 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_blocked");
|
36 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_query");
|
37 |
-
delete_option('contact_form_forms');
|
38 |
-
delete_option("wd_form_maker_version");
|
39 |
-
delete_option('formmaker_cureent_version');
|
40 |
-
delete_option('form_maker_pro_active');
|
41 |
-
}
|
42 |
-
}
|
43 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
44 |
-
// Getters & Setters //
|
45 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
46 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
47 |
-
// Private Methods //
|
48 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
49 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
50 |
-
// Listeners //
|
51 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
52 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FMModelUninstall_fm {
|
4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
+
// Events //
|
6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
+
// Constants //
|
9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
+
// Variables //
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
+
// Constructor & Destructor //
|
15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
+
public function __construct() {
|
17 |
+
}
|
18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
+
// Public Methods //
|
20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
+
public function delete_db_tables() {
|
22 |
+
global $wpdb;
|
23 |
+
$true_or_false_forms = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker WHERE `id` IN (" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ")");
|
24 |
+
if ($true_or_false_forms) {
|
25 |
+
$wpdb->query("DELETE FROM " . $wpdb->prefix . "formmaker WHERE `id` NOT IN (" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ")");
|
26 |
+
$wpdb->query("DELETE FROM " . $wpdb->prefix . "formmaker_submits WHERE `form_id` NOT IN (" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ")");
|
27 |
+
$wpdb->query("DELETE FROM " . $wpdb->prefix . "formmaker_views WHERE `form_id` NOT IN (" . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ")");
|
28 |
+
}
|
29 |
+
else {
|
30 |
+
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker");
|
31 |
+
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_submits");
|
32 |
+
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_views");
|
33 |
+
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_themes");
|
34 |
+
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_sessions");
|
35 |
+
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_blocked");
|
36 |
+
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_query");
|
37 |
+
delete_option('contact_form_forms');
|
38 |
+
delete_option("wd_form_maker_version");
|
39 |
+
delete_option('formmaker_cureent_version');
|
40 |
+
delete_option('form_maker_pro_active');
|
41 |
+
}
|
42 |
+
}
|
43 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
44 |
+
// Getters & Setters //
|
45 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
46 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
47 |
+
// Private Methods //
|
48 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
49 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
50 |
+
// Listeners //
|
51 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
52 |
}
|
admin/models/FMModelWidget.php
CHANGED
@@ -1,38 +1,38 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMModelWidget {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
|
22 |
-
public function get_gallery_rows_data() {
|
23 |
-
global $wpdb;
|
24 |
-
$query = "SELECT * FROM " . $wpdb->prefix . "formmaker order by `title`";
|
25 |
-
$rows = $wpdb->get_results($query);
|
26 |
-
return $rows;
|
27 |
-
}
|
28 |
-
|
29 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
30 |
-
// Getters & Setters //
|
31 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
32 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
33 |
-
// Private Methods //
|
34 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
35 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
36 |
-
// Listeners //
|
37 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
38 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FMModelWidget {
|
4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
+
// Events //
|
6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
+
// Constants //
|
9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
+
// Variables //
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
+
// Constructor & Destructor //
|
15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
+
public function __construct() {
|
17 |
+
}
|
18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
+
// Public Methods //
|
20 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
+
|
22 |
+
public function get_gallery_rows_data() {
|
23 |
+
global $wpdb;
|
24 |
+
$query = "SELECT * FROM " . $wpdb->prefix . "formmaker order by `title`";
|
25 |
+
$rows = $wpdb->get_results($query);
|
26 |
+
return $rows;
|
27 |
+
}
|
28 |
+
|
29 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
30 |
+
// Getters & Setters //
|
31 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
32 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
33 |
+
// Private Methods //
|
34 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
35 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
36 |
+
// Listeners //
|
37 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
38 |
}
|
admin/views/FMViewBlocked_ips_fm.php
CHANGED
@@ -1,148 +1,148 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMViewBlocked_ips_fm {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
private $model;
|
14 |
-
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
// Constructor & Destructor //
|
17 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
18 |
-
public function __construct($model) {
|
19 |
-
$this->model = $model;
|
20 |
-
}
|
21 |
-
|
22 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
23 |
-
// Public Methods //
|
24 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
25 |
-
public function display() {
|
26 |
-
$rows_data = $this->model->get_rows_data();
|
27 |
-
$page_nav = $this->model->page_nav();
|
28 |
-
$search_value = ((isset($_POST['search_value'])) ? esc_html(stripslashes($_POST['search_value'])) : '');
|
29 |
-
$asc_or_desc = ((isset($_POST['asc_or_desc'])) ? 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/fromFormMaker.php">
|
42 |
-
<img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FM_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_fm" 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_FM_Library::search('IP', $search_value, 'blocked_ips');
|
60 |
-
WDW_FM_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_fm {
|
4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
+
// Events //
|
6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
+
// Constants //
|
9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
+
// Variables //
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
private $model;
|
14 |
+
|
15 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
+
// Constructor & Destructor //
|
17 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
18 |
+
public function __construct($model) {
|
19 |
+
$this->model = $model;
|
20 |
+
}
|
21 |
+
|
22 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
23 |
+
// Public Methods //
|
24 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
25 |
+
public function display() {
|
26 |
+
$rows_data = $this->model->get_rows_data();
|
27 |
+
$page_nav = $this->model->page_nav();
|
28 |
+
$search_value = ((isset($_POST['search_value'])) ? esc_html(stripslashes($_POST['search_value'])) : '');
|
29 |
+
$asc_or_desc = ((isset($_POST['asc_or_desc'])) ? 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/fromFormMaker.php">
|
42 |
+
<img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FM_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_fm" 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_FM_Library::search('IP', $search_value, 'blocked_ips');
|
60 |
+
WDW_FM_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/FMViewFormMakerEditCSS.php
CHANGED
@@ -1,113 +1,113 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMViewFormMakerEditCSS {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
private $model;
|
14 |
-
|
15 |
-
|
16 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
17 |
-
// Constructor & Destructor //
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
public function __construct($model) {
|
20 |
-
$this->model = $model;
|
21 |
-
}
|
22 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
23 |
-
// Public Methods //
|
24 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
25 |
-
public function display() {
|
26 |
-
$theme_id = ((isset($_GET['id'])) ? esc_html(stripslashes($_GET['id'])) : '');
|
27 |
-
$form_id = ((isset($_GET['form_id'])) ? esc_html(stripslashes($_GET['form_id'])) : 0);
|
28 |
-
$row = $this->model->get_theme_row($theme_id);
|
29 |
-
wp_print_scripts('jquery');
|
30 |
-
?>
|
31 |
-
<link media="all" type="text/css" href="<?php echo get_admin_url(); ?>load-styles.php?c=1&dir=ltr&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_FM_URL . '/css/form_maker_tables.css'; ?>" rel="stylesheet">
|
34 |
-
<script src="<?php echo WD_FM_URL . '/js/form_maker_admin.js'; ?>" type="text/javascript"></script>
|
35 |
-
<script src="<?php echo WD_FM_URL . '/js/layout/codemirror.js'; ?>" type="text/javascript"></script>
|
36 |
-
<script src="<?php echo WD_FM_URL . '/js/layout/formatting.js'; ?>" type="text/javascript"></script>
|
37 |
-
<script src="<?php echo WD_FM_URL . '/js/layout/css.js'; ?>" type="text/javascript"></script>
|
38 |
-
<script src="<?php echo WD_FM_URL . '/js/layout/clike.js'; ?>" type="text/javascript"></script>
|
39 |
-
<script src="<?php echo WD_FM_URL . '/js/layout/javascript.js'; ?>" type="text/javascript"></script>
|
40 |
-
<script src="<?php echo WD_FM_URL . '/js/layout/htmlmixed.js'; ?>" type="text/javascript"></script>
|
41 |
-
<script src="<?php echo WD_FM_URL . '/js/layout/xml.js'; ?>" type="text/javascript"></script>
|
42 |
-
<script src="<?php echo WD_FM_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 {
|
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&dir=ltr&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_FM_URL . '/css/form_maker_tables.css'; ?>" rel="stylesheet">
|
34 |
+
<script src="<?php echo WD_FM_URL . '/js/form_maker_admin.js'; ?>" type="text/javascript"></script>
|
35 |
+
<script src="<?php echo WD_FM_URL . '/js/layout/codemirror.js'; ?>" type="text/javascript"></script>
|
36 |
+
<script src="<?php echo WD_FM_URL . '/js/layout/formatting.js'; ?>" type="text/javascript"></script>
|
37 |
+
<script src="<?php echo WD_FM_URL . '/js/layout/css.js'; ?>" type="text/javascript"></script>
|
38 |
+
<script src="<?php echo WD_FM_URL . '/js/layout/clike.js'; ?>" type="text/javascript"></script>
|
39 |
+
<script src="<?php echo WD_FM_URL . '/js/layout/javascript.js'; ?>" type="text/javascript"></script>
|
40 |
+
<script src="<?php echo WD_FM_URL . '/js/layout/htmlmixed.js'; ?>" type="text/javascript"></script>
|
41 |
+
<script src="<?php echo WD_FM_URL . '/js/layout/xml.js'; ?>" type="text/javascript"></script>
|
42 |
+
<script src="<?php echo WD_FM_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.php
CHANGED
@@ -1,477 +1,477 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMViewFormMakerPreview {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
private $model;
|
14 |
-
|
15 |
-
|
16 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
17 |
-
// Constructor & Destructor //
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
public function __construct($model) {
|
20 |
-
$this->model = $model;
|
21 |
-
}
|
22 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
23 |
-
// Public Methods //
|
24 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
25 |
-
public function display() {
|
26 |
-
$form_id = ((isset($_GET['form_id'])) ? esc_html(stripslashes($_GET['form_id'])) : 0);
|
27 |
-
$form = (($form_id) ? $this->model->get_form($form_id) : '');
|
28 |
-
wp_print_scripts('jquery');
|
29 |
-
wp_print_scripts('jquery-ui-widget');
|
30 |
-
wp_print_scripts('jquery-ui-slider');
|
31 |
-
wp_print_scripts('jquery-ui-spinner');
|
32 |
-
?>
|
33 |
-
<script src="https://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
|
34 |
-
<script src="<?php echo WD_FM_URL . '/js/if_gmap_front_end.js'; ?>" type="text/javascript"></script>
|
35 |
-
<script src="<?php echo WD_FM_URL . '/js/calendar/calendar.js'; ?>" type="text/javascript"></script>
|
36 |
-
<script src="<?php echo WD_FM_URL . '/js/calendar/calendar_function.js'; ?>" type="text/javascript"></script>
|
37 |
-
<link media="all" type="text/css" href="<?php echo WD_FM_URL . '/css/calendar-jos.css'; ?>" rel="stylesheet">
|
38 |
-
<link media="all" type="text/css" href="<?php echo WD_FM_URL . '/css/jquery-ui-1.10.3.custom.css'; ?>" rel="stylesheet">
|
39 |
-
<link media="all" type="text/css" href="<?php echo WD_FM_URL . '/css/jquery-ui-spinner.css'; ?>" rel="stylesheet">
|
40 |
-
<?php
|
41 |
-
if (isset($_GET['test_theme'])) {
|
42 |
-
wp_print_scripts('jquery-effects-shake');
|
43 |
-
wp_register_script('main_div_front_end', WD_FM_URL . '/js/main_div_front_end.js', array(), get_option("wd_form_maker_version"));
|
44 |
-
$theme_id = esc_html(stripslashes($_GET['test_theme']));
|
45 |
-
require_once (WD_FM_DIR . '/frontend/controllers/FMControllerForm_maker.php');
|
46 |
-
$controller = new FMControllerForm_maker();
|
47 |
-
echo $controller->execute($form_id, $theme_id);
|
48 |
-
die();
|
49 |
-
}
|
50 |
-
$theme_id = ((isset($_GET['id'])) ? esc_html(stripslashes($_GET['id'])) : '');
|
51 |
-
$css = $this->model->get_theme_css($theme_id);
|
52 |
-
$id = 'form_id_temp';
|
53 |
-
?>
|
54 |
-
<script src="<?php echo WD_FM_URL . '/js/main_front_end.js'; ?>"></script>
|
55 |
-
<style>
|
56 |
-
<?php
|
57 |
-
echo str_replace('[SITE_ROOT]', WD_FM_URL, $css);
|
58 |
-
?>
|
59 |
-
</style>
|
60 |
-
<div id="form_id_temppages" class="wdform_page_navigation" show_title="" show_numbers="" type=""></div>
|
61 |
-
<form id="form_preview"><?php echo $form; ?></form>
|
62 |
-
<?php
|
63 |
-
if ($form) { // Preview from options page.
|
64 |
-
die();
|
65 |
-
}
|
66 |
-
?>
|
67 |
-
<input type="hidden" id="counter<?php echo $id; ?>" value="" name="counter<?php echo $id; ?>" />
|
68 |
-
<script>
|
69 |
-
var plugin_url = "<?php echo WD_FM_URL; ?>";
|
70 |
-
/*JURI_ROOT = '<?php echo WD_FM_URL . '/js' ?>';*/
|
71 |
-
document.getElementById('form_preview').innerHTML = window.parent.document.getElementById('take').innerHTML;
|
72 |
-
document.getElementById('form_id_temppages').setAttribute('show_title', window.parent.document.getElementById('pages').getAttribute('show_title'));
|
73 |
-
document.getElementById('form_id_temppages').setAttribute('show_numbers', window.parent.document.getElementById('pages').getAttribute('show_numbers'));
|
74 |
-
document.getElementById('form_id_temppages').setAttribute('type', window.parent.document.getElementById('pages').getAttribute('type'));
|
75 |
-
document.getElementById('counterform_id_temp').value = window.parent.gen;
|
76 |
-
form_view_count<?php echo $id ?>= 0;
|
77 |
-
for (i = 1; i <= 30; i++) {
|
78 |
-
if (document.getElementById('<?php echo $id ?>form_view' + i)) {
|
79 |
-
form_view_count<?php echo $id ?>++;
|
80 |
-
form_view_max<?php echo $id ?>= i;
|
81 |
-
document.getElementById('<?php echo $id ?>form_view' + i).parentNode.removeAttribute('style');
|
82 |
-
}
|
83 |
-
}
|
84 |
-
refresh_first();
|
85 |
-
if (form_view_count<?php echo $id ?>> 1) {
|
86 |
-
for (i = 1; i <= form_view_max<?php echo $id ?>; i++) {
|
87 |
-
if (document.getElementById('<?php echo $id ?>form_view' + i)) {
|
88 |
-
first_form_view<?php echo $id ?>= i;
|
89 |
-
break;
|
90 |
-
}
|
91 |
-
}
|
92 |
-
generate_page_nav(first_form_view<?php echo $id ?>, '<?php echo $id ?>', form_view_count<?php echo $id ?>, form_view_max<?php echo $id ?>);
|
93 |
-
}
|
94 |
-
function remove_add_(id) {
|
95 |
-
attr_name = new Array();
|
96 |
-
attr_value = new Array();
|
97 |
-
var input = document.getElementById(id);
|
98 |
-
atr = input.attributes;
|
99 |
-
for (v = 0; v < 30; v++)
|
100 |
-
if (atr[v]) {
|
101 |
-
if (atr[v].name.indexOf("add_") == 0) {
|
102 |
-
attr_name.push(atr[v].name.replace('add_', ''));
|
103 |
-
attr_value.push(atr[v].value);
|
104 |
-
input.removeAttribute(atr[v].name);
|
105 |
-
v--;
|
106 |
-
}
|
107 |
-
}
|
108 |
-
for (v = 0; v < attr_name.length; v++) {
|
109 |
-
input.setAttribute(attr_name[v], attr_value[v])
|
110 |
-
}
|
111 |
-
}
|
112 |
-
function refresh_first() {
|
113 |
-
n = window.parent.gen;
|
114 |
-
for (i = 0; i < n; i++) {
|
115 |
-
if (document.getElementById(i)) {
|
116 |
-
for (z = 0; z < document.getElementById(i).childNodes.length; z++) {
|
117 |
-
if (document.getElementById(i).childNodes[z].nodeType == 3) {
|
118 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[z]);
|
119 |
-
}
|
120 |
-
}
|
121 |
-
if (document.getElementById(i).getAttribute('type') == "type_map") {
|
122 |
-
if_gmap_init(i);
|
123 |
-
for (q = 0; q < 20; q++) {
|
124 |
-
if (document.getElementById(i + "_elementform_id_temp").getAttribute("long" + q)) {
|
125 |
-
w_long = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("long" + q));
|
126 |
-
w_lat = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("lat" + q));
|
127 |
-
w_info = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("info" + q));
|
128 |
-
add_marker_on_map(i, q, w_long, w_lat, w_info, false);
|
129 |
-
}
|
130 |
-
}
|
131 |
-
}
|
132 |
-
if (document.getElementById(i).getAttribute('type') == "type_mark_map") {
|
133 |
-
if_gmap_init(i);
|
134 |
-
w_long = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("long" + 0));
|
135 |
-
w_lat = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("lat" + 0));
|
136 |
-
w_info = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("info" + 0));
|
137 |
-
add_marker_on_map(i, 0, w_long, w_lat, w_info, true);
|
138 |
-
}
|
139 |
-
if (document.getElementById(i).getAttribute('type') == "type_captcha" || document.getElementById(i).getAttribute('type') == "type_recaptcha") {
|
140 |
-
if (document.getElementById(i).childNodes[10]) {
|
141 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
142 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
143 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
144 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
145 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
146 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
147 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
148 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
149 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
150 |
-
}
|
151 |
-
else {
|
152 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
153 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
154 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
155 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
156 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
157 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
158 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
159 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
160 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
161 |
-
}
|
162 |
-
continue;
|
163 |
-
}
|
164 |
-
if (document.getElementById(i).getAttribute('type') == "type_section_break") {
|
165 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
166 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
167 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
168 |
-
continue;
|
169 |
-
}
|
170 |
-
if (document.getElementById(i).childNodes[10]) {
|
171 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
172 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
173 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
174 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
175 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
176 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
177 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
178 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
179 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
180 |
-
}
|
181 |
-
else {
|
182 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
183 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
184 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
185 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
186 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
187 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
188 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
189 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
190 |
-
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
191 |
-
}
|
192 |
-
}
|
193 |
-
}
|
194 |
-
for (i = 0; i <= n; i++) {
|
195 |
-
if (document.getElementById(i)) {
|
196 |
-
type = document.getElementById(i).getAttribute("type");
|
197 |
-
switch (type) {
|
198 |
-
case "type_text":
|
199 |
-
case "type_number":
|
200 |
-
case "type_password":
|
201 |
-
case "type_submitter_mail":
|
202 |
-
case "type_own_select":
|
203 |
-
case "type_country":
|
204 |
-
case "type_hidden":
|
205 |
-
case "type_map": {
|
206 |
-
remove_add_(i + "_elementform_id_temp");
|
207 |
-
break;
|
208 |
-
}
|
209 |
-
case "type_submit_reset": {
|
210 |
-
remove_add_(i + "_element_submitform_id_temp");
|
211 |
-
if (document.getElementById(i + "_element_resetform_id_temp")) {
|
212 |
-
remove_add_(i + "_element_resetform_id_temp");
|
213 |
-
}
|
214 |
-
break;
|
215 |
-
}
|
216 |
-
|
217 |
-
case "type_captcha": {
|
218 |
-
remove_add_("_wd_captchaform_id_temp");
|
219 |
-
remove_add_("_element_refreshform_id_temp");
|
220 |
-
remove_add_("_wd_captcha_inputform_id_temp");
|
221 |
-
break;
|
222 |
-
}
|
223 |
-
case "type_recaptcha": {
|
224 |
-
remove_add_("wd_recaptchaform_id_temp");
|
225 |
-
break;
|
226 |
-
}
|
227 |
-
case "type_file_upload": {
|
228 |
-
remove_add_(i + "_elementform_id_temp");
|
229 |
-
break;
|
230 |
-
}
|
231 |
-
case "type_textarea": {
|
232 |
-
remove_add_(i + "_elementform_id_temp");
|
233 |
-
break;
|
234 |
-
}
|
235 |
-
case "type_name": {
|
236 |
-
if (document.getElementById(i + "_element_titleform_id_temp")) {
|
237 |
-
remove_add_(i + "_element_titleform_id_temp");
|
238 |
-
remove_add_(i + "_element_firstform_id_temp");
|
239 |
-
remove_add_(i + "_element_lastform_id_temp");
|
240 |
-
remove_add_(i + "_element_middleform_id_temp");
|
241 |
-
}
|
242 |
-
else {
|
243 |
-
remove_add_(i + "_element_firstform_id_temp");
|
244 |
-
remove_add_(i + "_element_lastform_id_temp");
|
245 |
-
|
246 |
-
}
|
247 |
-
break;
|
248 |
-
}
|
249 |
-
case "type_phone": {
|
250 |
-
remove_add_(i + "_element_firstform_id_temp");
|
251 |
-
remove_add_(i + "_element_lastform_id_temp");
|
252 |
-
break;
|
253 |
-
}
|
254 |
-
case "type_address": {
|
255 |
-
if(document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute('street1')=='no')
|
256 |
-
remove_add_(i+"_street1form_id_temp");
|
257 |
-
if(document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute('street2')=='no')
|
258 |
-
remove_add_(i+"_street2form_id_temp");
|
259 |
-
if(document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute('city')=='no')
|
260 |
-
remove_add_(i+"_cityform_id_temp");
|
261 |
-
if(document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute('state')=='no')
|
262 |
-
remove_add_(i+"_stateform_id_temp");
|
263 |
-
if(document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute('postal')=='no')
|
264 |
-
remove_add_(i+"_postalform_id_temp");
|
265 |
-
if(document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute('country')=='no')
|
266 |
-
remove_add_(i+"_countryform_id_temp");
|
267 |
-
break;
|
268 |
-
}
|
269 |
-
case "type_checkbox":
|
270 |
-
case "type_radio": {
|
271 |
-
is = true;
|
272 |
-
for (j = 0; j < 100; j++) {
|
273 |
-
if (document.getElementById(i + "_elementform_id_temp" + j)) {
|
274 |
-
remove_add_(i + "_elementform_id_temp" + j);
|
275 |
-
}
|
276 |
-
}
|
277 |
-
break;
|
278 |
-
}
|
279 |
-
case "type_button": {
|
280 |
-
for (j = 0; j < 100; j++) {
|
281 |
-
if (document.getElementById(i + "_elementform_id_temp" + j)) {
|
282 |
-
remove_add_(i + "_elementform_id_temp" + j);
|
283 |
-
}
|
284 |
-
}
|
285 |
-
break;
|
286 |
-
}
|
287 |
-
case "type_time": {
|
288 |
-
if (document.getElementById(i + "_ssform_id_temp")) {
|
289 |
-
remove_add_(i + "_ssform_id_temp");
|
290 |
-
remove_add_(i + "_mmform_id_temp");
|
291 |
-
remove_add_(i + "_hhform_id_temp");
|
292 |
-
}
|
293 |
-
else {
|
294 |
-
remove_add_(i + "_mmform_id_temp");
|
295 |
-
remove_add_(i + "_hhform_id_temp");
|
296 |
-
}
|
297 |
-
break;
|
298 |
-
}
|
299 |
-
case "type_date": {
|
300 |
-
remove_add_(i + "_elementform_id_temp");
|
301 |
-
remove_add_(i + "_buttonform_id_temp");
|
302 |
-
break;
|
303 |
-
}
|
304 |
-
case "type_date_fields": {
|
305 |
-
remove_add_(i + "_dayform_id_temp");
|
306 |
-
remove_add_(i + "_monthform_id_temp");
|
307 |
-
remove_add_(i + "_yearform_id_temp");
|
308 |
-
break;
|
309 |
-
}
|
310 |
-
case "type_star_rating": {
|
311 |
-
remove_add_(i+"_elementform_id_temp");
|
312 |
-
break;
|
313 |
-
}
|
314 |
-
case "type_scale_rating": {
|
315 |
-
remove_add_(i+"_elementform_id_temp");
|
316 |
-
break;
|
317 |
-
}
|
318 |
-
case "type_spinner": {
|
319 |
-
remove_add_(i+"_elementform_id_temp");
|
320 |
-
var spinner_value = document.getElementById(i+"_elementform_id_temp").getAttribute( "aria-valuenow" );
|
321 |
-
var spinner_min_value = document.getElementById(i+"_min_valueform_id_temp").value;
|
322 |
-
var spinner_max_value = document.getElementById(i+"_max_valueform_id_temp").value;
|
323 |
-
var spinner_step = document.getElementById(i+"_stepform_id_temp").value;
|
324 |
-
jQuery( "#"+i+"_elementform_id_temp" ).removeClass( "ui-spinner-input" )
|
325 |
-
.prop( "disabled", false )
|
326 |
-
.removeAttr( "autocomplete" )
|
327 |
-
.removeAttr( "role" )
|
328 |
-
.removeAttr( "aria-valuemin" )
|
329 |
-
.removeAttr( "aria-valuemax" )
|
330 |
-
.removeAttr( "aria-valuenow" );
|
331 |
-
span_ui= document.getElementById(i+"_elementform_id_temp").parentNode;
|
332 |
-
span_ui.parentNode.appendChild(document.getElementById(i+"_elementform_id_temp"));
|
333 |
-
span_ui.parentNode.removeChild(span_ui);
|
334 |
-
jQuery("#"+i+"_elementform_id_temp")[0].spin = null;
|
335 |
-
spinner = jQuery( "#"+i+"_elementform_id_temp" ).spinner();
|
336 |
-
spinner.spinner( "value", spinner_value );
|
337 |
-
jQuery( "#"+i+"_elementform_id_temp" ).spinner({ min: spinner_min_value});
|
338 |
-
jQuery( "#"+i+"_elementform_id_temp" ).spinner({ max: spinner_max_value});
|
339 |
-
jQuery( "#"+i+"_elementform_id_temp" ).spinner({ step: spinner_step});
|
340 |
-
break;
|
341 |
-
}
|
342 |
-
case "type_slider": {
|
343 |
-
remove_add_(i+"_elementform_id_temp");
|
344 |
-
var slider_value = document.getElementById(i+"_slider_valueform_id_temp").value;
|
345 |
-
var slider_min_value = document.getElementById(i+"_slider_min_valueform_id_temp").value;
|
346 |
-
var slider_max_value = document.getElementById(i+"_slider_max_valueform_id_temp").value;
|
347 |
-
var slider_element_value = document.getElementById( i+"_element_valueform_id_temp" );
|
348 |
-
var slider_value_save = document.getElementById( i+"_slider_valueform_id_temp" );
|
349 |
-
document.getElementById(i+"_elementform_id_temp").innerHTML = "";
|
350 |
-
document.getElementById(i+"_elementform_id_temp").removeAttribute( "class" );
|
351 |
-
document.getElementById(i+"_elementform_id_temp").removeAttribute( "aria-disabled" );
|
352 |
-
jQuery("#"+i+"_elementform_id_temp")[0].slide = null;
|
353 |
-
jQuery( "#"+i+"_elementform_id_temp").slider({
|
354 |
-
range: "min",
|
355 |
-
value: eval(slider_value),
|
356 |
-
min: eval(slider_min_value),
|
357 |
-
max: eval(slider_max_value),
|
358 |
-
slide: function( event, ui ) {
|
359 |
-
slider_element_value.innerHTML = "" + ui.value ;
|
360 |
-
slider_value_save.value = "" + ui.value;
|
361 |
-
|
362 |
-
}
|
363 |
-
});
|
364 |
-
break;
|
365 |
-
}
|
366 |
-
case "type_range": {
|
367 |
-
remove_add_(i+"_elementform_id_temp0");
|
368 |
-
remove_add_(i+"_elementform_id_temp1");
|
369 |
-
var spinner_value0 = document.getElementById(i+"_elementform_id_temp0").getAttribute( "aria-valuenow" );
|
370 |
-
var spinner_step = document.getElementById(i+"_range_stepform_id_temp").value;
|
371 |
-
jQuery( "#"+i+"_elementform_id_temp0" ).removeClass( "ui-spinner-input" )
|
372 |
-
.prop( "disabled", false )
|
373 |
-
.removeAttr( "autocomplete" )
|
374 |
-
.removeAttr( "role" )
|
375 |
-
.removeAttr( "aria-valuenow" );
|
376 |
-
span_ui= document.getElementById(i+"_elementform_id_temp0").parentNode;
|
377 |
-
span_ui.parentNode.appendChild(document.getElementById(i+"_elementform_id_temp0"));
|
378 |
-
span_ui.parentNode.removeChild(span_ui);
|
379 |
-
jQuery("#"+i+"_elementform_id_temp0")[0].spin = null;
|
380 |
-
jQuery("#"+i+"_elementform_id_temp1")[0].spin = null;
|
381 |
-
spinner0 = jQuery( "#"+i+"_elementform_id_temp0" ).spinner();
|
382 |
-
spinner0.spinner( "value", spinner_value0 );
|
383 |
-
jQuery( "#"+i+"_elementform_id_temp0" ).spinner({ step: spinner_step});
|
384 |
-
var spinner_value1 = document.getElementById(i+"_elementform_id_temp1").getAttribute( "aria-valuenow" );
|
385 |
-
jQuery( "#"+i+"_elementform_id_temp1" ).removeClass( "ui-spinner-input" )
|
386 |
-
.prop( "disabled", false )
|
387 |
-
.removeAttr( "autocomplete" )
|
388 |
-
.removeAttr( "role" )
|
389 |
-
.removeAttr( "aria-valuenow" );
|
390 |
-
span_ui1= document.getElementById(i+"_elementform_id_temp1").parentNode;
|
391 |
-
span_ui1.parentNode.appendChild(document.getElementById(i+"_elementform_id_temp1"));
|
392 |
-
span_ui1.parentNode.removeChild(span_ui1);
|
393 |
-
spinner1 = jQuery( "#"+i+"_elementform_id_temp1" ).spinner();
|
394 |
-
spinner1.spinner( "value", spinner_value1 );
|
395 |
-
jQuery( "#"+i+"_elementform_id_temp1" ).spinner({ step: spinner_step});
|
396 |
-
break;
|
397 |
-
}
|
398 |
-
case "type_grading": {
|
399 |
-
for (k=0; k<100; k++) {
|
400 |
-
if (document.getElementById(i+"_elementform_id_temp"+k)) {
|
401 |
-
remove_add_(i+"_elementform_id_temp"+k);
|
402 |
-
}
|
403 |
-
}
|
404 |
-
break;
|
405 |
-
}
|
406 |
-
case "type_matrix": {
|
407 |
-
remove_add_(i+"_elementform_id_temp");
|
408 |
-
break;
|
409 |
-
}
|
410 |
-
}
|
411 |
-
}
|
412 |
-
}
|
413 |
-
for (t = 1; t <= form_view_max<?php echo $id ?>; t++) {
|
414 |
-
if (document.getElementById('form_id_tempform_view' + t)) {
|
415 |
-
form_view_element = document.getElementById('form_id_tempform_view' + t);
|
416 |
-
remove_whitespace(form_view_element);
|
417 |
-
xy = form_view_element.childNodes.length - 2;
|
418 |
-
for (z = 0; z <= xy; z++) {
|
419 |
-
if (form_view_element.childNodes[z]) {
|
420 |
-
if (form_view_element.childNodes[z].nodeType != 3) {
|
421 |
-
if (!form_view_element.childNodes[z].id) {
|
422 |
-
del = true;
|
423 |
-
GLOBAL_tr = form_view_element.childNodes[z];
|
424 |
-
//////////////////////////////////////////////////////////////////////////////////////////
|
425 |
-
for (x = 0; x < GLOBAL_tr.firstChild.childNodes.length; x++) {
|
426 |
-
table = GLOBAL_tr.firstChild.childNodes[x];
|
427 |
-
tbody = table.firstChild;
|
428 |
-
if (tbody.childNodes.length) {
|
429 |
-
del = false;
|
430 |
-
}
|
431 |
-
}
|
432 |
-
if (del) {
|
433 |
-
form_view_element.removeChild(form_view_element.childNodes[z]);
|
434 |
-
}
|
435 |
-
}
|
436 |
-
}
|
437 |
-
}
|
438 |
-
}
|
439 |
-
}
|
440 |
-
}
|
441 |
-
for (i = 1; i <= window.parent.form_view_max; i++) {
|
442 |
-
if (document.getElementById('form_id_tempform_view' + i)) {
|
443 |
-
document.getElementById('form_id_tempform_view' + i).parentNode.removeChild(document.getElementById('form_id_tempform_view_img' + i));
|
444 |
-
document.getElementById('form_id_tempform_view' + i).removeAttribute('style');
|
445 |
-
}
|
446 |
-
}
|
447 |
-
}
|
448 |
-
function remove_whitespace(node) {
|
449 |
-
var ttt;
|
450 |
-
for (ttt = 0; ttt < node.childNodes.length; ttt++) {
|
451 |
-
if (node.childNodes[ttt] && node.childNodes[ttt].nodeType == '3' && !/\S/.test(node.childNodes[ttt].nodeValue)) {
|
452 |
-
node.removeChild(node.childNodes[ttt]);
|
453 |
-
ttt--;
|
454 |
-
}
|
455 |
-
else {
|
456 |
-
if (node.childNodes[ttt].childNodes.length) {
|
457 |
-
remove_whitespace(node.childNodes[ttt]);
|
458 |
-
}
|
459 |
-
}
|
460 |
-
}
|
461 |
-
return;
|
462 |
-
}
|
463 |
-
</script>
|
464 |
-
<?php
|
465 |
-
die();
|
466 |
-
}
|
467 |
-
|
468 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
469 |
-
// Getters & Setters //
|
470 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
471 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
472 |
-
// Private Methods //
|
473 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
474 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
475 |
-
// Listeners //
|
476 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
477 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FMViewFormMakerPreview {
|
4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
+
// Events //
|
6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
+
// Constants //
|
9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
+
// Variables //
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
private $model;
|
14 |
+
|
15 |
+
|
16 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
17 |
+
// Constructor & Destructor //
|
18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
+
public function __construct($model) {
|
20 |
+
$this->model = $model;
|
21 |
+
}
|
22 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
23 |
+
// Public Methods //
|
24 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
25 |
+
public function display() {
|
26 |
+
$form_id = ((isset($_GET['form_id'])) ? esc_html(stripslashes($_GET['form_id'])) : 0);
|
27 |
+
$form = (($form_id) ? $this->model->get_form($form_id) : '');
|
28 |
+
wp_print_scripts('jquery');
|
29 |
+
wp_print_scripts('jquery-ui-widget');
|
30 |
+
wp_print_scripts('jquery-ui-slider');
|
31 |
+
wp_print_scripts('jquery-ui-spinner');
|
32 |
+
?>
|
33 |
+
<script src="https://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
|
34 |
+
<script src="<?php echo WD_FM_URL . '/js/if_gmap_front_end.js'; ?>" type="text/javascript"></script>
|
35 |
+
<script src="<?php echo WD_FM_URL . '/js/calendar/calendar.js'; ?>" type="text/javascript"></script>
|
36 |
+
<script src="<?php echo WD_FM_URL . '/js/calendar/calendar_function.js'; ?>" type="text/javascript"></script>
|
37 |
+
<link media="all" type="text/css" href="<?php echo WD_FM_URL . '/css/calendar-jos.css'; ?>" rel="stylesheet">
|
38 |
+
<link media="all" type="text/css" href="<?php echo WD_FM_URL . '/css/jquery-ui-1.10.3.custom.css'; ?>" rel="stylesheet">
|
39 |
+
<link media="all" type="text/css" href="<?php echo WD_FM_URL . '/css/jquery-ui-spinner.css'; ?>" rel="stylesheet">
|
40 |
+
<?php
|
41 |
+
if (isset($_GET['test_theme'])) {
|
42 |
+
wp_print_scripts('jquery-effects-shake');
|
43 |
+
wp_register_script('main_div_front_end', WD_FM_URL . '/js/main_div_front_end.js', array(), get_option("wd_form_maker_version"));
|
44 |
+
$theme_id = esc_html(stripslashes($_GET['test_theme']));
|
45 |
+
require_once (WD_FM_DIR . '/frontend/controllers/FMControllerForm_maker.php');
|
46 |
+
$controller = new FMControllerForm_maker();
|
47 |
+
echo $controller->execute($form_id, $theme_id);
|
48 |
+
die();
|
49 |
+
}
|
50 |
+
$theme_id = ((isset($_GET['id'])) ? esc_html(stripslashes($_GET['id'])) : '');
|
51 |
+
$css = $this->model->get_theme_css($theme_id);
|
52 |
+
$id = 'form_id_temp';
|
53 |
+
?>
|
54 |
+
<script src="<?php echo WD_FM_URL . '/js/main_front_end.js'; ?>"></script>
|
55 |
+
<style>
|
56 |
+
<?php
|
57 |
+
echo str_replace('[SITE_ROOT]', WD_FM_URL, $css);
|
58 |
+
?>
|
59 |
+
</style>
|
60 |
+
<div id="form_id_temppages" class="wdform_page_navigation" show_title="" show_numbers="" type=""></div>
|
61 |
+
<form id="form_preview"><?php echo $form; ?></form>
|
62 |
+
<?php
|
63 |
+
if ($form) { // Preview from options page.
|
64 |
+
die();
|
65 |
+
}
|
66 |
+
?>
|
67 |
+
<input type="hidden" id="counter<?php echo $id; ?>" value="" name="counter<?php echo $id; ?>" />
|
68 |
+
<script>
|
69 |
+
var plugin_url = "<?php echo WD_FM_URL; ?>";
|
70 |
+
/*JURI_ROOT = '<?php echo WD_FM_URL . '/js' ?>';*/
|
71 |
+
document.getElementById('form_preview').innerHTML = window.parent.document.getElementById('take').innerHTML;
|
72 |
+
document.getElementById('form_id_temppages').setAttribute('show_title', window.parent.document.getElementById('pages').getAttribute('show_title'));
|
73 |
+
document.getElementById('form_id_temppages').setAttribute('show_numbers', window.parent.document.getElementById('pages').getAttribute('show_numbers'));
|
74 |
+
document.getElementById('form_id_temppages').setAttribute('type', window.parent.document.getElementById('pages').getAttribute('type'));
|
75 |
+
document.getElementById('counterform_id_temp').value = window.parent.gen;
|
76 |
+
form_view_count<?php echo $id ?>= 0;
|
77 |
+
for (i = 1; i <= 30; i++) {
|
78 |
+
if (document.getElementById('<?php echo $id ?>form_view' + i)) {
|
79 |
+
form_view_count<?php echo $id ?>++;
|
80 |
+
form_view_max<?php echo $id ?>= i;
|
81 |
+
document.getElementById('<?php echo $id ?>form_view' + i).parentNode.removeAttribute('style');
|
82 |
+
}
|
83 |
+
}
|
84 |
+
refresh_first();
|
85 |
+
if (form_view_count<?php echo $id ?>> 1) {
|
86 |
+
for (i = 1; i <= form_view_max<?php echo $id ?>; i++) {
|
87 |
+
if (document.getElementById('<?php echo $id ?>form_view' + i)) {
|
88 |
+
first_form_view<?php echo $id ?>= i;
|
89 |
+
break;
|
90 |
+
}
|
91 |
+
}
|
92 |
+
generate_page_nav(first_form_view<?php echo $id ?>, '<?php echo $id ?>', form_view_count<?php echo $id ?>, form_view_max<?php echo $id ?>);
|
93 |
+
}
|
94 |
+
function remove_add_(id) {
|
95 |
+
attr_name = new Array();
|
96 |
+
attr_value = new Array();
|
97 |
+
var input = document.getElementById(id);
|
98 |
+
atr = input.attributes;
|
99 |
+
for (v = 0; v < 30; v++)
|
100 |
+
if (atr[v]) {
|
101 |
+
if (atr[v].name.indexOf("add_") == 0) {
|
102 |
+
attr_name.push(atr[v].name.replace('add_', ''));
|
103 |
+
attr_value.push(atr[v].value);
|
104 |
+
input.removeAttribute(atr[v].name);
|
105 |
+
v--;
|
106 |
+
}
|
107 |
+
}
|
108 |
+
for (v = 0; v < attr_name.length; v++) {
|
109 |
+
input.setAttribute(attr_name[v], attr_value[v])
|
110 |
+
}
|
111 |
+
}
|
112 |
+
function refresh_first() {
|
113 |
+
n = window.parent.gen;
|
114 |
+
for (i = 0; i < n; i++) {
|
115 |
+
if (document.getElementById(i)) {
|
116 |
+
for (z = 0; z < document.getElementById(i).childNodes.length; z++) {
|
117 |
+
if (document.getElementById(i).childNodes[z].nodeType == 3) {
|
118 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[z]);
|
119 |
+
}
|
120 |
+
}
|
121 |
+
if (document.getElementById(i).getAttribute('type') == "type_map") {
|
122 |
+
if_gmap_init(i);
|
123 |
+
for (q = 0; q < 20; q++) {
|
124 |
+
if (document.getElementById(i + "_elementform_id_temp").getAttribute("long" + q)) {
|
125 |
+
w_long = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("long" + q));
|
126 |
+
w_lat = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("lat" + q));
|
127 |
+
w_info = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("info" + q));
|
128 |
+
add_marker_on_map(i, q, w_long, w_lat, w_info, false);
|
129 |
+
}
|
130 |
+
}
|
131 |
+
}
|
132 |
+
if (document.getElementById(i).getAttribute('type') == "type_mark_map") {
|
133 |
+
if_gmap_init(i);
|
134 |
+
w_long = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("long" + 0));
|
135 |
+
w_lat = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("lat" + 0));
|
136 |
+
w_info = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("info" + 0));
|
137 |
+
add_marker_on_map(i, 0, w_long, w_lat, w_info, true);
|
138 |
+
}
|
139 |
+
if (document.getElementById(i).getAttribute('type') == "type_captcha" || document.getElementById(i).getAttribute('type') == "type_recaptcha") {
|
140 |
+
if (document.getElementById(i).childNodes[10]) {
|
141 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
142 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
143 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
144 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
145 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
146 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
147 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
148 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
149 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
150 |
+
}
|
151 |
+
else {
|
152 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
153 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
154 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
155 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
156 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
157 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
158 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
159 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
160 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
161 |
+
}
|
162 |
+
continue;
|
163 |
+
}
|
164 |
+
if (document.getElementById(i).getAttribute('type') == "type_section_break") {
|
165 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
166 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
167 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
168 |
+
continue;
|
169 |
+
}
|
170 |
+
if (document.getElementById(i).childNodes[10]) {
|
171 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
172 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
173 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
174 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
175 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
176 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
177 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
178 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
179 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
|
180 |
+
}
|
181 |
+
else {
|
182 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
183 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
184 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
185 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
186 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
187 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
188 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
189 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
190 |
+
document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
|
191 |
+
}
|
192 |
+
}
|
193 |
+
}
|
194 |
+
for (i = 0; i <= n; i++) {
|
195 |
+
if (document.getElementById(i)) {
|
196 |
+
type = document.getElementById(i).getAttribute("type");
|
197 |
+
switch (type) {
|
198 |
+
case "type_text":
|
199 |
+
case "type_number":
|
200 |
+
case "type_password":
|
201 |
+
case "type_submitter_mail":
|
202 |
+
case "type_own_select":
|
203 |
+
case "type_country":
|
204 |
+
case "type_hidden":
|
205 |
+
case "type_map": {
|
206 |
+
remove_add_(i + "_elementform_id_temp");
|
207 |
+
break;
|
208 |
+
}
|
209 |
+
case "type_submit_reset": {
|
210 |
+
remove_add_(i + "_element_submitform_id_temp");
|
211 |
+
if (document.getElementById(i + "_element_resetform_id_temp")) {
|
212 |
+
remove_add_(i + "_element_resetform_id_temp");
|
213 |
+
}
|
214 |
+
break;
|
215 |
+
}
|
216 |
+
|
217 |
+
case "type_captcha": {
|
218 |
+
remove_add_("_wd_captchaform_id_temp");
|
219 |
+
remove_add_("_element_refreshform_id_temp");
|
220 |
+
remove_add_("_wd_captcha_inputform_id_temp");
|
221 |
+
break;
|
222 |
+
}
|
223 |
+
case "type_recaptcha": {
|
224 |
+
remove_add_("wd_recaptchaform_id_temp");
|
225 |
+
break;
|
226 |
+
}
|
227 |
+
case "type_file_upload": {
|
228 |
+
remove_add_(i + "_elementform_id_temp");
|
229 |
+
break;
|
230 |
+
}
|
231 |
+
case "type_textarea": {
|
232 |
+
remove_add_(i + "_elementform_id_temp");
|
233 |
+
break;
|
234 |
+
}
|
235 |
+
case "type_name": {
|
236 |
+
if (document.getElementById(i + "_element_titleform_id_temp")) {
|
237 |
+
remove_add_(i + "_element_titleform_id_temp");
|
238 |
+
remove_add_(i + "_element_firstform_id_temp");
|
239 |
+
remove_add_(i + "_element_lastform_id_temp");
|
240 |
+
remove_add_(i + "_element_middleform_id_temp");
|
241 |
+
}
|
242 |
+
else {
|
243 |
+
remove_add_(i + "_element_firstform_id_temp");
|
244 |
+
remove_add_(i + "_element_lastform_id_temp");
|
245 |
+
|
246 |
+
}
|
247 |
+
break;
|
248 |
+
}
|
249 |
+
case "type_phone": {
|
250 |
+
remove_add_(i + "_element_firstform_id_temp");
|
251 |
+
remove_add_(i + "_element_lastform_id_temp");
|
252 |
+
break;
|
253 |
+
}
|
254 |
+
case "type_address": {
|
255 |
+
if(document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute('street1')=='no')
|
256 |
+
remove_add_(i+"_street1form_id_temp");
|
257 |
+
if(document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute('street2')=='no')
|
258 |
+
remove_add_(i+"_street2form_id_temp");
|
259 |
+
if(document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute('city')=='no')
|
260 |
+
remove_add_(i+"_cityform_id_temp");
|
261 |
+
if(document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute('state')=='no')
|
262 |
+
remove_add_(i+"_stateform_id_temp");
|
263 |
+
if(document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute('postal')=='no')
|
264 |
+
remove_add_(i+"_postalform_id_temp");
|
265 |
+
if(document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute('country')=='no')
|
266 |
+
remove_add_(i+"_countryform_id_temp");
|
267 |
+
break;
|
268 |
+
}
|
269 |
+
case "type_checkbox":
|
270 |
+
case "type_radio": {
|
271 |
+
is = true;
|
272 |
+
for (j = 0; j < 100; j++) {
|
273 |
+
if (document.getElementById(i + "_elementform_id_temp" + j)) {
|
274 |
+
remove_add_(i + "_elementform_id_temp" + j);
|
275 |
+
}
|
276 |
+
}
|
277 |
+
break;
|
278 |
+
}
|
279 |
+
case "type_button": {
|
280 |
+
for (j = 0; j < 100; j++) {
|
281 |
+
if (document.getElementById(i + "_elementform_id_temp" + j)) {
|
282 |
+
remove_add_(i + "_elementform_id_temp" + j);
|
283 |
+
}
|
284 |
+
}
|
285 |
+
break;
|
286 |
+
}
|
287 |
+
case "type_time": {
|
288 |
+
if (document.getElementById(i + "_ssform_id_temp")) {
|
289 |
+
remove_add_(i + "_ssform_id_temp");
|
290 |
+
remove_add_(i + "_mmform_id_temp");
|
291 |
+
remove_add_(i + "_hhform_id_temp");
|
292 |
+
}
|
293 |
+
else {
|
294 |
+
remove_add_(i + "_mmform_id_temp");
|
295 |
+
remove_add_(i + "_hhform_id_temp");
|
296 |
+
}
|
297 |
+
break;
|
298 |
+
}
|
299 |
+
case "type_date": {
|
300 |
+
remove_add_(i + "_elementform_id_temp");
|
301 |
+
remove_add_(i + "_buttonform_id_temp");
|
302 |
+
break;
|
303 |
+
}
|
304 |
+
case "type_date_fields": {
|
305 |
+
remove_add_(i + "_dayform_id_temp");
|
306 |
+
remove_add_(i + "_monthform_id_temp");
|
307 |
+
remove_add_(i + "_yearform_id_temp");
|
308 |
+
break;
|
309 |
+
}
|
310 |
+
case "type_star_rating": {
|
311 |
+
remove_add_(i+"_elementform_id_temp");
|
312 |
+
break;
|
313 |
+
}
|
314 |
+
case "type_scale_rating": {
|
315 |
+
remove_add_(i+"_elementform_id_temp");
|
316 |
+
break;
|
317 |
+
}
|
318 |
+
case "type_spinner": {
|
319 |
+
remove_add_(i+"_elementform_id_temp");
|
320 |
+
var spinner_value = document.getElementById(i+"_elementform_id_temp").getAttribute( "aria-valuenow" );
|
321 |
+
var spinner_min_value = document.getElementById(i+"_min_valueform_id_temp").value;
|
322 |
+
var spinner_max_value = document.getElementById(i+"_max_valueform_id_temp").value;
|
323 |
+
var spinner_step = document.getElementById(i+"_stepform_id_temp").value;
|
324 |
+
jQuery( "#"+i+"_elementform_id_temp" ).removeClass( "ui-spinner-input" )
|
325 |
+
.prop( "disabled", false )
|
326 |
+
.removeAttr( "autocomplete" )
|
327 |
+
.removeAttr( "role" )
|
328 |
+
.removeAttr( "aria-valuemin" )
|
329 |
+
.removeAttr( "aria-valuemax" )
|
330 |
+
.removeAttr( "aria-valuenow" );
|
331 |
+
span_ui= document.getElementById(i+"_elementform_id_temp").parentNode;
|
332 |
+
span_ui.parentNode.appendChild(document.getElementById(i+"_elementform_id_temp"));
|
333 |
+
span_ui.parentNode.removeChild(span_ui);
|
334 |
+
jQuery("#"+i+"_elementform_id_temp")[0].spin = null;
|
335 |
+
spinner = jQuery( "#"+i+"_elementform_id_temp" ).spinner();
|
336 |
+
spinner.spinner( "value", spinner_value );
|
337 |
+
jQuery( "#"+i+"_elementform_id_temp" ).spinner({ min: spinner_min_value});
|
338 |
+
jQuery( "#"+i+"_elementform_id_temp" ).spinner({ max: spinner_max_value});
|
339 |
+
jQuery( "#"+i+"_elementform_id_temp" ).spinner({ step: spinner_step});
|
340 |
+
break;
|
341 |
+
}
|
342 |
+
case "type_slider": {
|
343 |
+
remove_add_(i+"_elementform_id_temp");
|
344 |
+
var slider_value = document.getElementById(i+"_slider_valueform_id_temp").value;
|
345 |
+
var slider_min_value = document.getElementById(i+"_slider_min_valueform_id_temp").value;
|
346 |
+
var slider_max_value = document.getElementById(i+"_slider_max_valueform_id_temp").value;
|
347 |
+
var slider_element_value = document.getElementById( i+"_element_valueform_id_temp" );
|
348 |
+
var slider_value_save = document.getElementById( i+"_slider_valueform_id_temp" );
|
349 |
+
document.getElementById(i+"_elementform_id_temp").innerHTML = "";
|
350 |
+
document.getElementById(i+"_elementform_id_temp").removeAttribute( "class" );
|
351 |
+
document.getElementById(i+"_elementform_id_temp").removeAttribute( "aria-disabled" );
|
352 |
+
jQuery("#"+i+"_elementform_id_temp")[0].slide = null;
|
353 |
+
jQuery( "#"+i+"_elementform_id_temp").slider({
|
354 |
+
range: "min",
|
355 |
+
value: eval(slider_value),
|
356 |
+
min: eval(slider_min_value),
|
357 |
+
max: eval(slider_max_value),
|
358 |
+
slide: function( event, ui ) {
|
359 |
+
slider_element_value.innerHTML = "" + ui.value ;
|
360 |
+
slider_value_save.value = "" + ui.value;
|
361 |
+
|
362 |
+
}
|
363 |
+
});
|
364 |
+
break;
|
365 |
+
}
|
366 |
+
case "type_range": {
|
367 |
+
remove_add_(i+"_elementform_id_temp0");
|
368 |
+
remove_add_(i+"_elementform_id_temp1");
|
369 |
+
var spinner_value0 = document.getElementById(i+"_elementform_id_temp0").getAttribute( "aria-valuenow" );
|
370 |
+
var spinner_step = document.getElementById(i+"_range_stepform_id_temp").value;
|
371 |
+
jQuery( "#"+i+"_elementform_id_temp0" ).removeClass( "ui-spinner-input" )
|
372 |
+
.prop( "disabled", false )
|
373 |
+
.removeAttr( "autocomplete" )
|
374 |
+
.removeAttr( "role" )
|
375 |
+
.removeAttr( "aria-valuenow" );
|
376 |
+
span_ui= document.getElementById(i+"_elementform_id_temp0").parentNode;
|
377 |
+
span_ui.parentNode.appendChild(document.getElementById(i+"_elementform_id_temp0"));
|
378 |
+
span_ui.parentNode.removeChild(span_ui);
|
379 |
+
jQuery("#"+i+"_elementform_id_temp0")[0].spin = null;
|
380 |
+
jQuery("#"+i+"_elementform_id_temp1")[0].spin = null;
|
381 |
+
spinner0 = jQuery( "#"+i+"_elementform_id_temp0" ).spinner();
|
382 |
+
spinner0.spinner( "value", spinner_value0 );
|
383 |
+
jQuery( "#"+i+"_elementform_id_temp0" ).spinner({ step: spinner_step});
|
384 |
+
var spinner_value1 = document.getElementById(i+"_elementform_id_temp1").getAttribute( "aria-valuenow" );
|
385 |
+
jQuery( "#"+i+"_elementform_id_temp1" ).removeClass( "ui-spinner-input" )
|
386 |
+
.prop( "disabled", false )
|
387 |
+
.removeAttr( "autocomplete" )
|
388 |
+
.removeAttr( "role" )
|
389 |
+
.removeAttr( "aria-valuenow" );
|
390 |
+
span_ui1= document.getElementById(i+"_elementform_id_temp1").parentNode;
|
391 |
+
span_ui1.parentNode.appendChild(document.getElementById(i+"_elementform_id_temp1"));
|
392 |
+
span_ui1.parentNode.removeChild(span_ui1);
|
393 |
+
spinner1 = jQuery( "#"+i+"_elementform_id_temp1" ).spinner();
|
394 |
+
spinner1.spinner( "value", spinner_value1 );
|
395 |
+
jQuery( "#"+i+"_elementform_id_temp1" ).spinner({ step: spinner_step});
|
396 |
+
break;
|
397 |
+
}
|
398 |
+
case "type_grading": {
|
399 |
+
for (k=0; k<100; k++) {
|
400 |
+
if (document.getElementById(i+"_elementform_id_temp"+k)) {
|
401 |
+
remove_add_(i+"_elementform_id_temp"+k);
|
402 |
+
}
|
403 |
+
}
|
404 |
+
break;
|
405 |
+
}
|
406 |
+
case "type_matrix": {
|
407 |
+
remove_add_(i+"_elementform_id_temp");
|
408 |
+
break;
|
409 |
+
}
|
410 |
+
}
|
411 |
+
}
|
412 |
+
}
|
413 |
+
for (t = 1; t <= form_view_max<?php echo $id ?>; t++) {
|
414 |
+
if (document.getElementById('form_id_tempform_view' + t)) {
|
415 |
+
form_view_element = document.getElementById('form_id_tempform_view' + t);
|
416 |
+
remove_whitespace(form_view_element);
|
417 |
+
xy = form_view_element.childNodes.length - 2;
|
418 |
+
for (z = 0; z <= xy; z++) {
|
419 |
+
if (form_view_element.childNodes[z]) {
|
420 |
+
if (form_view_element.childNodes[z].nodeType != 3) {
|
421 |
+
if (!form_view_element.childNodes[z].id) {
|
422 |
+
del = true;
|
423 |
+
GLOBAL_tr = form_view_element.childNodes[z];
|
424 |
+
//////////////////////////////////////////////////////////////////////////////////////////
|
425 |
+
for (x = 0; x < GLOBAL_tr.firstChild.childNodes.length; x++) {
|
426 |
+
table = GLOBAL_tr.firstChild.childNodes[x];
|
427 |
+
tbody = table.firstChild;
|
428 |
+
if (tbody.childNodes.length) {
|
429 |
+
del = false;
|
430 |
+
}
|
431 |
+
}
|
432 |
+
if (del) {
|
433 |
+
form_view_element.removeChild(form_view_element.childNodes[z]);
|
434 |
+
}
|
435 |
+
}
|
436 |
+
}
|
437 |
+
}
|
438 |
+
}
|
439 |
+
}
|
440 |
+
}
|
441 |
+
for (i = 1; i <= window.parent.form_view_max; i++) {
|
442 |
+
if (document.getElementById('form_id_tempform_view' + i)) {
|
443 |
+
document.getElementById('form_id_tempform_view' + i).parentNode.removeChild(document.getElementById('form_id_tempform_view_img' + i));
|
444 |
+
document.getElementById('form_id_tempform_view' + i).removeAttribute('style');
|
445 |
+
}
|
446 |
+
}
|
447 |
+
}
|
448 |
+
function remove_whitespace(node) {
|
449 |
+
var ttt;
|
450 |
+
for (ttt = 0; ttt < node.childNodes.length; ttt++) {
|
451 |
+
if (node.childNodes[ttt] && node.childNodes[ttt].nodeType == '3' && !/\S/.test(node.childNodes[ttt].nodeValue)) {
|
452 |
+
node.removeChild(node.childNodes[ttt]);
|
453 |
+
ttt--;
|
454 |
+
}
|
455 |
+
else {
|
456 |
+
if (node.childNodes[ttt].childNodes.length) {
|
457 |
+
remove_whitespace(node.childNodes[ttt]);
|
458 |
+
}
|
459 |
+
}
|
460 |
+
}
|
461 |
+
return;
|
462 |
+
}
|
463 |
+
</script>
|
464 |
+
<?php
|
465 |
+
die();
|
466 |
+
}
|
467 |
+
|
468 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
469 |
+
// Getters & Setters //
|
470 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
471 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
472 |
+
// Private Methods //
|
473 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
474 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
475 |
+
// Listeners //
|
476 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
477 |
}
|
admin/views/FMViewFormMakerSQLMapping.php
CHANGED
@@ -1,1273 +1,1273 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMViewFormMakerSQLMapping {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
private $model;
|
14 |
-
|
15 |
-
|
16 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
17 |
-
// Constructor & Destructor //
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
public function __construct($model) {
|
20 |
-
$this->model = $model;
|
21 |
-
}
|
22 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
23 |
-
// Public Methods //
|
24 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
25 |
-
|
26 |
-
public function edit_query($id, $form_id) {
|
27 |
-
wp_print_scripts('jquery');
|
28 |
-
wp_print_scripts('jquery-ui-tooltip');
|
29 |
-
?>
|
30 |
-
<link media="all" type="text/css" href="<?php echo WD_FM_URL . '/css/style.css'; ?>" rel="stylesheet">
|
31 |
-
<link rel="stylesheet" href="<?php echo WD_FM_URL . '/css/jquery-ui-1.10.3.custom.css'; ?>">
|
32 |
-
<?php
|
33 |
-
$label = $this->model->get_labels($form_id);
|
34 |
-
$query_obj = $this->model->get_query($id);
|
35 |
-
|
36 |
-
$temp = explode('***wdfcon_typewdf***',$query_obj->details);
|
37 |
-
$con_type = $temp[0];
|
38 |
-
$temp = explode('***wdfcon_methodwdf***',$temp[1]);
|
39 |
-
$con_method = $temp[0];
|
40 |
-
$temp = explode('***wdftablewdf***',$temp[1]);
|
41 |
-
$table_cur = $temp[0];
|
42 |
-
$temp = explode('***wdfhostwdf***',$temp[1]);
|
43 |
-
$host = $temp[0];
|
44 |
-
$temp = explode('***wdfportwdf***',$temp[1]);
|
45 |
-
$port = $temp[0];
|
46 |
-
$temp = explode('***wdfusernamewdf***',$temp[1]);
|
47 |
-
$username = $temp[0];
|
48 |
-
$temp = explode('***wdfpasswordwdf***',$temp[1]);
|
49 |
-
$password = $temp[0];
|
50 |
-
$temp = explode('***wdfdatabasewdf***',$temp[1]);
|
51 |
-
$database = $temp[0];
|
52 |
-
|
53 |
-
$details = $temp[1];
|
54 |
-
|
55 |
-
$tables = $this->model->get_tables_saved($con_type, $username, $password, $database, $host);
|
56 |
-
$table_struct = $this->model->get_table_struct_saved($con_type, $username, $password, $database, $host, $table_cur, $con_method);
|
57 |
-
|
58 |
-
$filter_types=array("type_submit_reset", "type_map", "type_editor", "type_captcha", "type_recaptcha", "type_button", "type_paypal_total", "type_send_copy");
|
59 |
-
$label_id= array();
|
60 |
-
$label_order= array();
|
61 |
-
$label_order_original= array();
|
62 |
-
$label_type= array();
|
63 |
-
|
64 |
-
///stexic
|
65 |
-
$label_all = explode('#****#',$label);
|
66 |
-
$label_all = array_slice($label_all,0, count($label_all)-1);
|
67 |
-
|
68 |
-
foreach($label_all as $key => $label_each) {
|
69 |
-
$label_id_each=explode('#**id**#',$label_each);
|
70 |
-
$label_oder_each=explode('#**label**#', $label_id_each[1]);
|
71 |
-
|
72 |
-
if(in_array($label_oder_each[1],$filter_types))
|
73 |
-
continue;
|
74 |
-
|
75 |
-
array_push($label_id, $label_id_each[0]);
|
76 |
-
array_push($label_order_original, $label_oder_each[0]);
|
77 |
-
$ptn = "/[^a-zA-Z0-9_]/";
|
78 |
-
$rpltxt = "";
|
79 |
-
$label_temp=preg_replace($ptn, $rpltxt, $label_oder_each[0]);
|
80 |
-
array_push($label_order, $label_temp);
|
81 |
-
array_push($label_type, $label_oder_each[1]);
|
82 |
-
}
|
83 |
-
|
84 |
-
$form_fields='';
|
85 |
-
foreach($label_id as $key => $lid) {
|
86 |
-
$form_fields.='<a onclick="insert_field('.$lid.'); jQuery(\'#fieldlist\').hide();" style="display:block; text-decoration:none;">'.$label_order_original[$key].'</a>';
|
87 |
-
}
|
88 |
-
$cond='<div id="condid"><select id="sel_condid" style="width: 110px">';
|
89 |
-
foreach($table_struct as $col) {
|
90 |
-
$cond.='<option>'.$col->Field.'</option>';
|
91 |
-
}
|
92 |
-
$cond.='</select>';
|
93 |
-
$cond.='<select id="op_condid"><option value="=" selected="selected">=</option><option value="!=">!=</option><option value=">">></option><option value="<"><</option><option value=">=">>=</option><option value="<="><=</option><option value="%..%">Like</option><option value="%..">Starts with</option><option value="..%">Ends with</option></select><input id="val_condid" style="width:120px" type="text" /><select id="andor_condid" style="visibility: hidden;"><option value="AND">AND</option><option value="OR">OR</option></select><img src="' . WD_FM_URL . '/images/delete.png" onclick="delete_cond("condid")" style="vertical-align: middle;"></div>';
|
94 |
-
?>
|
95 |
-
<script>
|
96 |
-
function connect() {
|
97 |
-
jQuery("input[type='radio']").attr('disabled','');
|
98 |
-
jQuery('#struct').html('<div id="saving"><div id="saving_text">Loading</div><div id="fadingBarsG"><div id="fadingBarsG_1" class="fadingBarsG"></div><div id="fadingBarsG_2" class="fadingBarsG"></div><div id="fadingBarsG_3" class="fadingBarsG"></div><div id="fadingBarsG_4" class="fadingBarsG"></div><div id="fadingBarsG_5" class="fadingBarsG"></div><div id="fadingBarsG_6" class="fadingBarsG"></div><div id="fadingBarsG_7" class="fadingBarsG"></div><div id="fadingBarsG_8" class="fadingBarsG"></div></div></div>');
|
99 |
-
|
100 |
-
jQuery("#struct").load('index.php?option=com_formmaker&task=db_tables&con_type='+jQuery('input[name=con_type]:checked').val()+'&con_method='+jQuery('input[name=con_method]:checked').val()+'&format=row');
|
101 |
-
}
|
102 |
-
jQuery(document).ready(function() {
|
103 |
-
jQuery("#tables").change(function (){
|
104 |
-
jQuery('#table_struct').html('<div id="saving"><div id="saving_text">Loading</div><div id="fadingBarsG"><div id="fadingBarsG_1" class="fadingBarsG"></div><div id="fadingBarsG_2" class="fadingBarsG"></div><div id="fadingBarsG_3" class="fadingBarsG"></div><div id="fadingBarsG_4" class="fadingBarsG"></div><div id="fadingBarsG_5" class="fadingBarsG"></div><div id="fadingBarsG_6" class="fadingBarsG"></div><div id="fadingBarsG_7" class="fadingBarsG"></div><div id="fadingBarsG_8" class="fadingBarsG"></div></div></div>');
|
105 |
-
|
106 |
-
jQuery("#table_struct").load('index.php?option=com_formmaker&task=db_table_struct&name='+jQuery(this).val()+'&con_type='+jQuery('input[name=con_type]:checked').val()+'&con_method='+jQuery('input[name=con_method]:checked').val()+'&host='+jQuery('#host_rem').val()+'&port='+jQuery('#port_rem').val()+'&username='+jQuery('#username_rem').val()+'&password='+jQuery('#password_rem').val()+'&database='+jQuery('#database_rem').val()+'&format=row&id='+jQuery("#form_id").val());
|
107 |
-
});
|
108 |
-
jQuery('html').click(function() {
|
109 |
-
if(jQuery("#fieldlist").css('display')=="block") {
|
110 |
-
jQuery("#fieldlist").hide();
|
111 |
-
}
|
112 |
-
});
|
113 |
-
jQuery('.cols input[type="text"]').live('click', function() {
|
114 |
-
event.stopPropagation();
|
115 |
-
jQuery("#fieldlist").css("top",jQuery(this).offset().top+jQuery(this).height()+2);
|
116 |
-
jQuery("#fieldlist").css("left",jQuery(this).offset().left);
|
117 |
-
jQuery("#fieldlist").slideDown('fast');
|
118 |
-
selected_field=this.id;
|
119 |
-
});
|
120 |
-
jQuery('#query_txt').click(function() {
|
121 |
-
event.stopPropagation();
|
122 |
-
jQuery("#fieldlist").css("top",jQuery(this).offset().top+jQuery(this).height()+2);
|
123 |
-
jQuery("#fieldlist").css("left",jQuery(this).offset().left);
|
124 |
-
jQuery("#fieldlist").slideDown('fast');
|
125 |
-
selected_field=this.id;
|
126 |
-
});
|
127 |
-
jQuery('#fieldlist').click(function(event){
|
128 |
-
event.stopPropagation();
|
129 |
-
});
|
130 |
-
jQuery('.add_cond').click( function() {
|
131 |
-
jQuery('.cols').append(conds.replace(/condid/g, cond_id++));
|
132 |
-
update_vis();
|
133 |
-
}
|
134 |
-
);
|
135 |
-
});
|
136 |
-
var selected_field ='';
|
137 |
-
var isvisible = 1;
|
138 |
-
var cond_id = 1;
|
139 |
-
conds='<?php echo $cond ?>';
|
140 |
-
fields=new Array(<?php
|
141 |
-
$fields = "";
|
142 |
-
if($table_struct) {
|
143 |
-
foreach($table_struct as $col) {
|
144 |
-
$fields.=' "'.$col->Field.'",';
|
145 |
-
}
|
146 |
-
echo substr($fields, 0, -1);
|
147 |
-
}
|
148 |
-
?>);
|
149 |
-
|
150 |
-
function dis(id, x) {
|
151 |
-
if(x)
|
152 |
-
jQuery('#'+id).removeAttr('disabled');
|
153 |
-
else
|
154 |
-
jQuery('#'+id).attr('disabled','disabled');
|
155 |
-
}
|
156 |
-
function update_vis() {
|
157 |
-
previous=0;
|
158 |
-
for(i=1; i<cond_id; i++) {
|
159 |
-
if(jQuery('#'+i).html()) {
|
160 |
-
jQuery('#andor_'+i).css('visibility', 'hidden');
|
161 |
-
if(previous)
|
162 |
-
jQuery('#andor_'+previous).css('visibility', 'visible');
|
163 |
-
previous=i;
|
164 |
-
}
|
165 |
-
}
|
166 |
-
}
|
167 |
-
function delete_cond(id) {
|
168 |
-
jQuery('#'+id).remove();
|
169 |
-
update_vis();
|
170 |
-
}
|
171 |
-
function save_query() {
|
172 |
-
con_type =jQuery('input[name=con_type]:checked').val();
|
173 |
-
con_method =jQuery('input[name=con_method]:checked').val();
|
174 |
-
table =jQuery('#tables').val();
|
175 |
-
host =jQuery('#host_rem').val();
|
176 |
-
port =jQuery('#port_rem').val();
|
177 |
-
username =jQuery('#username_rem').val();
|
178 |
-
password =jQuery('#password_rem').val();
|
179 |
-
database =jQuery('#database_rem').val();
|
180 |
-
|
181 |
-
str=con_type+"***wdfcon_typewdf***"+con_method+"***wdfcon_methodwdf***"+table+"***wdftablewdf***"+host+"***wdfhostwdf***"+port+"***wdfportwdf***"+username+"***wdfusernamewdf***"+password+"***wdfpasswordwdf***"+database+"***wdfdatabasewdf***";
|
182 |
-
|
183 |
-
if(fields.length) {
|
184 |
-
for(i=0; i<fields.length; i++) {
|
185 |
-
str+=fields[i]+'***wdfnamewdf***'+jQuery('#'+fields[i]).val()+'***wdfvaluewdf***'+jQuery('#ch_'+fields[i]+":checked" ).length+'***wdffieldwdf***';
|
186 |
-
}
|
187 |
-
}
|
188 |
-
|
189 |
-
for(i=1; i<cond_id; i++) {
|
190 |
-
if(jQuery('#'+i).html()) {
|
191 |
-
str+=jQuery('#sel_'+i).val()+'***sel***'+jQuery('#op_'+i).val()+'***op***'+jQuery('#val_'+i).val()+'***val***'+jQuery('#andor_'+i).val()+'***where***';
|
192 |
-
}
|
193 |
-
}
|
194 |
-
if(!jQuery('#query_txt').val()) {
|
195 |
-
gen_query();
|
196 |
-
}
|
197 |
-
jQuery('#details').val(str);
|
198 |
-
var datatxt = jQuery("#query_form").serialize()+'&form_id='+jQuery("#form_id").val();
|
199 |
-
|
200 |
-
if(jQuery('#query_txt').val()) {
|
201 |
-
jQuery('.c1').html('<div id="saving"><div id="saving_text">Saving</div><div id="fadingBarsG"><div id="fadingBarsG_1" class="fadingBarsG"></div><div id="fadingBarsG_2" class="fadingBarsG"></div><div id="fadingBarsG_3" class="fadingBarsG"></div><div id="fadingBarsG_4" class="fadingBarsG"></div><div id="fadingBarsG_5" class="fadingBarsG"></div><div id="fadingBarsG_6" class="fadingBarsG"></div><div id="fadingBarsG_7" class="fadingBarsG"></div><div id="fadingBarsG_8" class="fadingBarsG"></div></div></div>');
|
202 |
-
|
203 |
-
jQuery.ajax({
|
204 |
-
type: "POST",
|
205 |
-
url: "<?php echo add_query_arg(array('action' => 'FormMakerSQLMapping', 'id' => $id, 'form_id' => $form_id, 'task' => 'update_query', 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>",
|
206 |
-
data: datatxt,
|
207 |
-
success: function(data) {
|
208 |
-
window.parent.wd_fm_apply_options();
|
209 |
-
window.parent.tb_remove();
|
210 |
-
}
|
211 |
-
});
|
212 |
-
}
|
213 |
-
else {
|
214 |
-
alert('The query is empty.');
|
215 |
-
}
|
216 |
-
return false;
|
217 |
-
}
|
218 |
-
|
219 |
-
function gen_query() {
|
220 |
-
if(jQuery('#query_txt').val())
|
221 |
-
if(!confirm('Are you sure you want to replace the Query? All the modifications to the Query will be lost.'))
|
222 |
-
return;
|
223 |
-
|
224 |
-
query="";
|
225 |
-
fields=new Array(<?php
|
226 |
-
$fields = "";
|
227 |
-
if($table_struct) {
|
228 |
-
foreach($table_struct as $col) {
|
229 |
-
$fields.=' "'.$col->Field.'",';
|
230 |
-
}
|
231 |
-
echo substr($fields, 0, -1);
|
232 |
-
}
|
233 |
-
?>);
|
234 |
-
|
235 |
-
con_type =jQuery('input[name=con_type]:checked').val();
|
236 |
-
con_method =jQuery('input[name=con_method]:checked').val();
|
237 |
-
table =jQuery('#tables').val();
|
238 |
-
fls='';
|
239 |
-
vals='';
|
240 |
-
valsA=new Array();
|
241 |
-
flsA=new Array();
|
242 |
-
|
243 |
-
if(fields.length) {
|
244 |
-
for(i=0; i<fields.length; i++) {
|
245 |
-
if(jQuery('#ch_'+fields[i]+":checked" ).length) {
|
246 |
-
flsA.push(fields[i]);
|
247 |
-
valsA.push(jQuery('#'+fields[i]).val());
|
248 |
-
}
|
249 |
-
}
|
250 |
-
}
|
251 |
-
if(con_method=="insert") {
|
252 |
-
if(flsA.length) {
|
253 |
-
for(i=0; i<flsA.length-1; i++) {
|
254 |
-
fls+= '`'+flsA[i]+'`, ';
|
255 |
-
vals+= '"'+valsA[i]+'", ';
|
256 |
-
}
|
257 |
-
fls+= '`'+flsA[i]+'`';
|
258 |
-
vals+= '"'+valsA[i]+'"';
|
259 |
-
}
|
260 |
-
if(fls)
|
261 |
-
query="INSERT INTO "+jQuery('#tables').val()+" (" +fls+") VALUES ("+vals+")";
|
262 |
-
}
|
263 |
-
|
264 |
-
if(con_method=="update") {
|
265 |
-
if(flsA.length) {
|
266 |
-
for(i=0; i<flsA.length-1; i++) {
|
267 |
-
vals+= '`'+flsA[i]+'`="'+valsA[i]+'", ';
|
268 |
-
}
|
269 |
-
vals+= '`'+flsA[i]+'`="'+valsA[i]+'"';
|
270 |
-
}
|
271 |
-
where="";
|
272 |
-
previous='';
|
273 |
-
|
274 |
-
for(i=1; i<cond_id; i++) {
|
275 |
-
if(jQuery('#'+i).html()) {
|
276 |
-
if(jQuery('#op_'+i).val()=="%..%")
|
277 |
-
op_val=' LIKE "%'+jQuery('#val_'+i).val()+'%"';
|
278 |
-
else if(jQuery('#op_'+i).val()=="%..")
|
279 |
-
op_val=' LIKE "%'+jQuery('#val_'+i).val()+'"';
|
280 |
-
else if(jQuery('#op_'+i).val()=="..%")
|
281 |
-
op_val=' LIKE "'+jQuery('#val_'+i).val()+'%"';
|
282 |
-
else
|
283 |
-
op_val=' '+jQuery('#op_'+i).val()+' "'+jQuery('#val_'+i).val()+'"';
|
284 |
-
where+=previous+' `'+jQuery('#sel_'+i).val()+'`'+op_val;
|
285 |
-
previous=' '+ jQuery('#andor_'+i).val();
|
286 |
-
}
|
287 |
-
}
|
288 |
-
if(vals)
|
289 |
-
query="UPDATE "+jQuery('#tables').val()+" SET " + vals+(where? ' WHERE'+where: '') ;
|
290 |
-
}
|
291 |
-
if(con_method=="delete") {
|
292 |
-
where="";
|
293 |
-
previous='';
|
294 |
-
for(i=1; i<cond_id; i++) {
|
295 |
-
if(jQuery('#'+i).html()) {
|
296 |
-
if(jQuery('#op_'+i).val()=="%..%")
|
297 |
-
op_val=' LIKE "%'+jQuery('#val_'+i).val()+'%"';
|
298 |
-
else if(jQuery('#op_'+i).val()=="%..")
|
299 |
-
op_val=' LIKE "%'+jQuery('#val_'+i).val()+'"';
|
300 |
-
else if(jQuery('#op_'+i).val()=="..%")
|
301 |
-
op_val=' LIKE "'+jQuery('#val_'+i).val()+'%"';
|
302 |
-
else
|
303 |
-
op_val=' '+jQuery('#op_'+i).val()+' "'+jQuery('#val_'+i).val()+'"';
|
304 |
-
where+=previous+' '+jQuery('#sel_'+i).val()+op_val;
|
305 |
-
previous=' '+ jQuery('#andor_'+i).val();
|
306 |
-
}
|
307 |
-
}
|
308 |
-
if(where)
|
309 |
-
query="DELETE FROM "+jQuery('#tables').val()+ ' WHERE'+where ;
|
310 |
-
}
|
311 |
-
jQuery('#query_txt').val(query);
|
312 |
-
}
|
313 |
-
|
314 |
-
jQuery(document).ready(function () {
|
315 |
-
jQuery(".hasTip").tooltip({
|
316 |
-
track: true,
|
317 |
-
content: function () {
|
318 |
-
return jQuery(this).prop('title');
|
319 |
-
}
|
320 |
-
});
|
321 |
-
});
|
322 |
-
|
323 |
-
function insert_field(myValue) {
|
324 |
-
if(!selected_field)
|
325 |
-
return;
|
326 |
-
myField=document.getElementById(selected_field);
|
327 |
-
if (document.selection) {
|
328 |
-
myField.focus();
|
329 |
-
sel = document.selection.createRange();
|
330 |
-
sel.text = myValue;
|
331 |
-
}
|
332 |
-
else {
|
333 |
-
if (myField.selectionStart || myField.selectionStart == '0') {
|
334 |
-
var startPos = myField.selectionStart;
|
335 |
-
var endPos = myField.selectionEnd;
|
336 |
-
myField.value = myField.value.substring(0, startPos)
|
337 |
-
+ "{"+myValue+"}"
|
338 |
-
+ myField.value.substring(endPos, myField.value.length);
|
339 |
-
}
|
340 |
-
else {
|
341 |
-
myField.value += "{"+myValue+"}";
|
342 |
-
}
|
343 |
-
}
|
344 |
-
}
|
345 |
-
</script>
|
346 |
-
|
347 |
-
<style>
|
348 |
-
.main_func {
|
349 |
-
font-size: 12px;
|
350 |
-
display:inline-block;
|
351 |
-
width:480px;
|
352 |
-
vertical-align:top;
|
353 |
-
}
|
354 |
-
.desc {
|
355 |
-
font-size: 12px;
|
356 |
-
display:inline-block;
|
357 |
-
width:250px;
|
358 |
-
position:fixed;
|
359 |
-
margin:15px;
|
360 |
-
padding-left:55px;
|
361 |
-
}
|
362 |
-
.desc button {
|
363 |
-
max-width: 200px;
|
364 |
-
overflow: hidden;
|
365 |
-
white-space: nowrap;
|
366 |
-
text-overflow: ellipsis;
|
367 |
-
}
|
368 |
-
.key label {
|
369 |
-
display:inline-block;
|
370 |
-
width:150px;
|
371 |
-
}
|
372 |
-
.cols {
|
373 |
-
border: 3px solid red;
|
374 |
-
padding: 4px;
|
375 |
-
}
|
376 |
-
.cols div:nth-child(even) {background: #FFF}
|
377 |
-
.cols div:nth-child(odd) {background: #F5F5F5}
|
378 |
-
.cols div {
|
379 |
-
height: 28px;
|
380 |
-
padding: 5px
|
381 |
-
}
|
382 |
-
.cols label {
|
383 |
-
display:inline-block;
|
384 |
-
width:200px;
|
385 |
-
font-size:15px;
|
386 |
-
overflow: hidden;
|
387 |
-
white-space: nowrap;
|
388 |
-
text-overflow: ellipsis;
|
389 |
-
vertical-align: middle;
|
390 |
-
}
|
391 |
-
.cols input[type="text"] {
|
392 |
-
width: 220px;
|
393 |
-
line-height: 18px;
|
394 |
-
height: 20px;
|
395 |
-
}
|
396 |
-
.cols input[type="text"]:disabled {
|
397 |
-
cursor: not-allowed;
|
398 |
-
background-color: #eee;
|
399 |
-
}
|
400 |
-
.cols input[type="checkbox"] {
|
401 |
-
width: 20px;
|
402 |
-
line-height: 18px;
|
403 |
-
height: 20px;
|
404 |
-
vertical-align: middle;
|
405 |
-
}
|
406 |
-
.cols select {
|
407 |
-
line-height: 18px;
|
408 |
-
height: 24px;
|
409 |
-
}
|
410 |
-
#fieldlist {
|
411 |
-
position: absolute;
|
412 |
-
width:225px;
|
413 |
-
background: #fff;
|
414 |
-
border: solid 1px #c7c7c7;
|
415 |
-
top: 0;
|
416 |
-
left: 0;
|
417 |
-
z-index: 1000;
|
418 |
-
}
|
419 |
-
#fieldlist a {
|
420 |
-
padding: 5px;
|
421 |
-
cursor:pointer;
|
422 |
-
overflow: hidden;
|
423 |
-
white-space: nowrap;
|
424 |
-
text-overflow: ellipsis;
|
425 |
-
}
|
426 |
-
#fieldlist a:hover {
|
427 |
-
background: #ccc;
|
428 |
-
}
|
429 |
-
.gen_query, .gen_query:focus {
|
430 |
-
width: 200px;
|
431 |
-
height: 38px;
|
432 |
-
background: #0E73D4;
|
433 |
-
color: white;
|
434 |
-
cursor: pointer;
|
435 |
-
border: 0px;
|
436 |
-
font-size: 16px;
|
437 |
-
font-weight: bold;
|
438 |
-
margin: 20px;
|
439 |
-
}
|
440 |
-
.gen_query:active {
|
441 |
-
background: #ccc;
|
442 |
-
}
|
443 |
-
</style>
|
444 |
-
|
445 |
-
<div class="c1">
|
446 |
-
<div class="main_func">
|
447 |
-
<table class="admintable">
|
448 |
-
<tr valign="top">
|
449 |
-
<td class="key">
|
450 |
-
<label title="asf">Connection type: </label>
|
451 |
-
</td>
|
452 |
-
<td >
|
453 |
-
<input type="radio" name="con_type" id="local" value="local" <?php if($con_type=='local') echo 'checked="checked"'?> disabled>
|
454 |
-
<label for="local">Local</label>
|
455 |
-
<input type="radio" name="con_type" id="remote" value="remote" <?php if($con_type=='remote') echo 'checked="checked"'?> disabled>
|
456 |
-
<label for="remote">Remote</label>
|
457 |
-
</td>
|
458 |
-
</tr>
|
459 |
-
<tr class="remote_info" <?php if($con_type=='local') echo 'style="display:none"'?>>
|
460 |
-
<td class="key">Host</td>
|
461 |
-
<td>
|
462 |
-
<input type="text" name="host" id="host_rem" style="width:180px" value="<?php echo $host; ?>" disabled>
|
463 |
-
Port : <input type="text" name="port" id="port_rem" value="<?php echo $port; ?>" style="width:50px" disabled>
|
464 |
-
</td>
|
465 |
-
</tr>
|
466 |
-
<tr class="remote_info" <?php if($con_type=='local') echo 'style="display:none"'?>>
|
467 |
-
<td class="key">Username</td>
|
468 |
-
<td>
|
469 |
-
<input type="text" name="username" id="username_rem" style="width:272px" value="<?php echo $username; ?>" disabled>
|
470 |
-
</td>
|
471 |
-
</tr>
|
472 |
-
<tr class="remote_info" <?php if($con_type=='local') echo 'style="display:none"'?>>
|
473 |
-
<td class="key">Password</td>
|
474 |
-
<td>
|
475 |
-
<input type="password" name="password" id="password_rem" style="width:272px" value="<?php echo $password; ?>" disabled>
|
476 |
-
</td>
|
477 |
-
</tr>
|
478 |
-
<tr class="remote_info" <?php if($con_type=='local') echo 'style="display:none"'?>>
|
479 |
-
<td class="key">Database</td>
|
480 |
-
<td>
|
481 |
-
<input type="text"name="database" id="database_rem" style="width:272px" value="<?php echo $database; ?>" disabled>
|
482 |
-
</td>
|
483 |
-
</tr>
|
484 |
-
<tr valign="top">
|
485 |
-
<td class="key">
|
486 |
-
<label>Method: </label>
|
487 |
-
</td>
|
488 |
-
<td >
|
489 |
-
<input type="radio" name="con_method" id="insert" value="insert" <?php if($con_method=='insert') echo 'checked="checked"'?> disabled>
|
490 |
-
<label for="insert">Insert</label>
|
491 |
-
<input type="radio" name="con_method" id="update" value="update" <?php if($con_method=='update') echo 'checked="checked"'?> disabled>
|
492 |
-
<label for="update">Update</label>
|
493 |
-
<input type="radio" name="con_method" id="delete" value="delete" <?php if($con_method=='delete') echo 'checked="checked"'?> disabled>
|
494 |
-
<label for="delete">Delete</label>
|
495 |
-
</td>
|
496 |
-
</tr>
|
497 |
-
<tr valign="top">
|
498 |
-
<td class="key">
|
499 |
-
</td>
|
500 |
-
<td >
|
501 |
-
<input type="button" value="Connect" onclick="connect()" disabled>
|
502 |
-
</td>
|
503 |
-
</tr>
|
504 |
-
</table>
|
505 |
-
<div id="struct">
|
506 |
-
<label for="tables" style="display:inline-block;width:157px;font-weight: bold;">Select a table</label>
|
507 |
-
<select name="tables" id="tables" disabled>
|
508 |
-
<option value="" ></option>
|
509 |
-
<?php
|
510 |
-
|
511 |
-
foreach($tables as $table)
|
512 |
-
echo '<option value="'.$table.'" '.($table_cur==$table ? 'selected' : '').' >'.$table.'</option>';
|
513 |
-
?>
|
514 |
-
</select>
|
515 |
-
<br/><br/>
|
516 |
-
|
517 |
-
|
518 |
-
<div id="table_struct">
|
519 |
-
|
520 |
-
<?php
|
521 |
-
if($table_struct)
|
522 |
-
{
|
523 |
-
?>
|
524 |
-
|
525 |
-
<div class="cols">
|
526 |
-
<?php
|
527 |
-
|
528 |
-
$temps=explode('***wdffieldwdf***',$details);
|
529 |
-
$wheres = $temps[count($temps)-1];
|
530 |
-
$temps = array_slice($temps,0, count($temps)-1);
|
531 |
-
$col_names= array();
|
532 |
-
$col_vals= array();
|
533 |
-
$col_checks= array();
|
534 |
-
|
535 |
-
foreach($temps as $temp)
|
536 |
-
{
|
537 |
-
$temp=explode('***wdfnamewdf***',$temp);
|
538 |
-
array_push($col_names, $temp[0]);
|
539 |
-
$temp=explode('***wdfvaluewdf***',$temp[1]);
|
540 |
-
array_push($col_vals, $temp[0]);
|
541 |
-
array_push($col_checks, $temp[1]);
|
542 |
-
}
|
543 |
-
if($con_method=='insert' or $con_method=='update')
|
544 |
-
{
|
545 |
-
echo '<div style="background: none;text-align: center;font-size: 20px;color: rgb(0, 164, 228);font-weight: bold;"> SET </div>';
|
546 |
-
|
547 |
-
foreach($table_struct as $key =>$col)
|
548 |
-
{
|
549 |
-
|
550 |
-
$title=' '.$col->Field;
|
551 |
-
$title.="<ul style='padding-left: 17px;'>";
|
552 |
-
$title.="<li>Type - ".$col->Type."</li>";
|
553 |
-
$title.="<li>Null - ".$col->Null."</li>";
|
554 |
-
$title.="<li>Key - ".$col->Key."</li>";
|
555 |
-
$title.="<li>Default - ".$col->Default."</li>";
|
556 |
-
$title.="<li>Extra - ".$col->Extra."</li>";
|
557 |
-
$title.="</ul>";
|
558 |
-
|
559 |
-
?>
|
560 |
-
<div><label title="<?php echo $title; ?>" class="hasTip"><b><?php echo $col->Field; ?></b><img src="<?php echo WD_FM_URL . '/images/info.png'; ?>" style="width:20px; vertical-align:middle;padding-left: 10px;" /></label><input type="text" id="<?php echo $col->Field; ?>" <?php if(!$col_checks[$key]) echo 'disabled="disabled"'?> value="<?php echo $col_vals[$key]; ?>" /><input id="ch_<?php echo $col->Field; ?>" type="checkbox" onClick="dis('<?php echo $col->Field; ?>', this.checked)" <?php if($col_checks[$key]) echo 'checked="checked"'?> /></div>
|
561 |
-
<?php
|
562 |
-
}
|
563 |
-
}
|
564 |
-
|
565 |
-
if($con_method=='delete' or $con_method=='update')
|
566 |
-
{
|
567 |
-
echo '<div style="background: none;text-align: center;font-size: 20px;color: rgb(0, 164, 228);font-weight: bold;"> WHERE </div>
|
568 |
-
<img src="' . WD_FM_URL . '/images/add_condition.png" title="ADD" class="add_cond"/></br>';
|
569 |
-
|
570 |
-
if($wheres)
|
571 |
-
{
|
572 |
-
echo '<script>';
|
573 |
-
|
574 |
-
$wheres =explode('***where***',$wheres);
|
575 |
-
$wheres = array_slice($wheres,0, count($wheres)-1);
|
576 |
-
foreach($wheres as $where)
|
577 |
-
{
|
578 |
-
$temp=explode('***sel***',$where);
|
579 |
-
$sel = $temp[0];
|
580 |
-
$temp=explode('***op***',$temp[1]);
|
581 |
-
$op = $temp[0];
|
582 |
-
$temp=explode('***val***',$temp[1]);
|
583 |
-
$val = $temp[0];
|
584 |
-
$andor = $temp[1];
|
585 |
-
echo 'jQuery(".cols").append(conds.replace(/condid/g, cond_id++)); update_vis();
|
586 |
-
jQuery("#sel_"+(cond_id-1)).val("'.$sel.'");
|
587 |
-
jQuery("#op_"+(cond_id-1)).val("'.$op.'");
|
588 |
-
jQuery("#val_"+(cond_id-1)).val("'.$val.'");
|
589 |
-
jQuery("#andor_"+(cond_id-1)).val("'.$andor.'");
|
590 |
-
';
|
591 |
-
|
592 |
-
}
|
593 |
-
echo '</script>';
|
594 |
-
|
595 |
-
}
|
596 |
-
|
597 |
-
|
598 |
-
}
|
599 |
-
?>
|
600 |
-
<div style="color:red; background: none">The changes above will not affect the query until you click "Generate query".</div>
|
601 |
-
</div>
|
602 |
-
<br/>
|
603 |
-
<input type="button" value="Generate Query" class="gen_query" onclick="gen_query()">
|
604 |
-
<br/>
|
605 |
-
<form name="query_form" id="query_form" >
|
606 |
-
<label style="vertical-align: top;" for="query_txt" > Query: </label><textarea id="query_txt" name="query" rows=5 style="width:428px" ><?php echo $query_obj->query; ?></textarea>
|
607 |
-
<input type="hidden" name="details" id="details">
|
608 |
-
<input type="hidden" name="id" value="<?php echo $query_obj->id; ?>">
|
609 |
-
</form>
|
610 |
-
<input type="button" value="Save" style="float: right;width: 200px;height: 38px;background: #0E73D4;color: white;cursor: pointer;border: 0px;font-size: 16px;font-weight: bold;margin: 20px;" onclick="save_query()">
|
611 |
-
|
612 |
-
|
613 |
-
<div id="fieldlist" style="display: none;">
|
614 |
-
<?php echo $form_fields ?>
|
615 |
-
</div>
|
616 |
-
|
617 |
-
|
618 |
-
<?php
|
619 |
-
}
|
620 |
-
?>
|
621 |
-
</div>
|
622 |
-
</div>
|
623 |
-
<input type="hidden" value="<?php echo $form_id ?>" id="form_id">
|
624 |
-
|
625 |
-
</div>
|
626 |
-
|
627 |
-
<div class="desc">
|
628 |
-
<?php
|
629 |
-
foreach($label_id as $key => $lid)
|
630 |
-
{
|
631 |
-
echo '<div>{'.$lid.'} - <button onclick="insert_field('.$lid.');">'.$label_order_original[$key].'</button></div>';
|
632 |
-
|
633 |
-
}
|
634 |
-
|
635 |
-
?>
|
636 |
-
</div>
|
637 |
-
</div>
|
638 |
-
<?php
|
639 |
-
die();
|
640 |
-
}
|
641 |
-
|
642 |
-
public function add_query($form_id){
|
643 |
-
wp_print_scripts('jquery');
|
644 |
-
wp_print_scripts('jquery-ui-tooltip');
|
645 |
-
?>
|
646 |
-
<link media="all" type="text/css" href="<?php echo WD_FM_URL . '/css/style.css'; ?>" rel="stylesheet">
|
647 |
-
<link rel="stylesheet" href="<?php echo WD_FM_URL . '/css/jquery-ui-1.10.3.custom.css'; ?>">
|
648 |
-
<?php
|
649 |
-
$label = $this->model->get_labels($form_id);
|
650 |
-
|
651 |
-
$filter_types=array("type_submit_reset", "type_map", "type_editor", "type_captcha", "type_recaptcha", "type_button", "type_paypal_total", "type_send_copy");
|
652 |
-
$label_id= array();
|
653 |
-
$label_order= array();
|
654 |
-
$label_order_original= array();
|
655 |
-
$label_type= array();
|
656 |
-
|
657 |
-
///stexic
|
658 |
-
$label_all = explode('#****#',$label);
|
659 |
-
$label_all = array_slice($label_all,0, count($label_all)-1);
|
660 |
-
|
661 |
-
foreach($label_all as $key => $label_each) {
|
662 |
-
$label_id_each=explode('#**id**#',$label_each);
|
663 |
-
$label_oder_each=explode('#**label**#', $label_id_each[1]);
|
664 |
-
|
665 |
-
if(in_array($label_oder_each[1],$filter_types))
|
666 |
-
continue;
|
667 |
-
|
668 |
-
array_push($label_id, $label_id_each[0]);
|
669 |
-
|
670 |
-
|
671 |
-
array_push($label_order_original, $label_oder_each[0]);
|
672 |
-
|
673 |
-
$ptn = "/[^a-zA-Z0-9_]/";
|
674 |
-
$rpltxt = "";
|
675 |
-
$label_temp=preg_replace($ptn, $rpltxt, $label_oder_each[0]);
|
676 |
-
array_push($label_order, $label_temp);
|
677 |
-
|
678 |
-
array_push($label_type, $label_oder_each[1]);
|
679 |
-
}
|
680 |
-
?>
|
681 |
-
<script>
|
682 |
-
function insert_field(){}
|
683 |
-
|
684 |
-
function connect() {
|
685 |
-
jQuery("input[type='radio']").attr('disabled','');
|
686 |
-
jQuery(".connect").attr('disabled','');
|
687 |
-
jQuery('#struct').html('<div id="saving"><div id="saving_text">Loading</div><div id="fadingBarsG"><div id="fadingBarsG_1" class="fadingBarsG"></div><div id="fadingBarsG_2" class="fadingBarsG"></div><div id="fadingBarsG_3" class="fadingBarsG"></div><div id="fadingBarsG_4" class="fadingBarsG"></div><div id="fadingBarsG_5" class="fadingBarsG"></div><div id="fadingBarsG_6" class="fadingBarsG"></div><div id="fadingBarsG_7" class="fadingBarsG"></div><div id="fadingBarsG_8" class="fadingBarsG"></div></div></div>');
|
688 |
-
jQuery.ajax({
|
689 |
-
type: "POST",
|
690 |
-
url: "<?php echo add_query_arg(array('action' => 'FormMakerSQLMapping', 'id' => 0, 'form_id' => $form_id, 'task' => 'db_tables', 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>",
|
691 |
-
data: 'con_type='+jQuery('input[name=con_type]:checked').val()+'&con_method='+jQuery('input[name=con_method]:checked').val()+'&host='+jQuery('#host_rem').val()+'&port='+jQuery('#port_rem').val()+'&username='+jQuery('#username_rem').val()+'&password='+jQuery('#password_rem').val()+'&database='+jQuery('#database_rem').val()+'&format=row',
|
692 |
-
success: function(data) {
|
693 |
-
if(data==1) {
|
694 |
-
jQuery("#struct").html('<div style="font-size: 22px; text-align: center; padding-top: 15px;">Could not connect to MySQL.</div>')
|
695 |
-
jQuery(".connect").removeAttr('disabled');
|
696 |
-
jQuery("input[type='radio']").removeAttr('disabled','');
|
697 |
-
}
|
698 |
-
else {
|
699 |
-
jQuery("#struct").html(data);
|
700 |
-
}
|
701 |
-
}
|
702 |
-
});
|
703 |
-
}
|
704 |
-
|
705 |
-
function shh(x) {
|
706 |
-
if(x)
|
707 |
-
jQuery(".remote_info").show();
|
708 |
-
else
|
709 |
-
jQuery(".remote_info").hide();
|
710 |
-
}
|
711 |
-
|
712 |
-
</script>
|
713 |
-
<style>
|
714 |
-
.main_func {
|
715 |
-
font-size: 12px;
|
716 |
-
display:inline-block;
|
717 |
-
width:480px;
|
718 |
-
vertical-align:top;
|
719 |
-
}
|
720 |
-
|
721 |
-
.desc {
|
722 |
-
font-size: 12px;
|
723 |
-
display:inline-block;
|
724 |
-
width:250px;
|
725 |
-
position:fixed;
|
726 |
-
margin:15px;
|
727 |
-
margin-left:55px;
|
728 |
-
}
|
729 |
-
|
730 |
-
.desc button {
|
731 |
-
max-width: 200px;
|
732 |
-
overflow: hidden;
|
733 |
-
white-space: nowrap;
|
734 |
-
text-overflow: ellipsis;
|
735 |
-
}
|
736 |
-
|
737 |
-
.key label {
|
738 |
-
display:inline-block;
|
739 |
-
width:150px;
|
740 |
-
}
|
741 |
-
</style>
|
742 |
-
|
743 |
-
<div class="c1">
|
744 |
-
<div class="main_func">
|
745 |
-
<table class="admintable">
|
746 |
-
<tr valign="top">
|
747 |
-
<td class="key">
|
748 |
-
<label title="asf">Connection type: </label>
|
749 |
-
</td>
|
750 |
-
<td >
|
751 |
-
<input type="radio" name="con_type" id="local" value="local" checked="checked" onclick="shh(false)">
|
752 |
-
<label for="local">Local</label>
|
753 |
-
<input type="radio" name="con_type" id="remote" value="remote" onclick="shh(true)">
|
754 |
-
<label for="remote">Remote</label>
|
755 |
-
</td>
|
756 |
-
</tr>
|
757 |
-
<tr class="remote_info" style="display:none">
|
758 |
-
<td class="key">Host</td>
|
759 |
-
<td>
|
760 |
-
<input type="text" name="host" id="host_rem" style="width:180px">
|
761 |
-
Port : <input type="text" name="port" id="port_rem" value="3306" style="width:50px">
|
762 |
-
</td>
|
763 |
-
</tr>
|
764 |
-
<tr class="remote_info" style="display:none">
|
765 |
-
<td class="key">Username</td>
|
766 |
-
<td>
|
767 |
-
<input type="text" name="username" id="username_rem" style="width:272px">
|
768 |
-
</td>
|
769 |
-
</tr>
|
770 |
-
<tr class="remote_info" style="display:none">
|
771 |
-
<td class="key">Password</td>
|
772 |
-
<td>
|
773 |
-
<input type="password" name="password" id="password_rem" style="width:272px">
|
774 |
-
</td>
|
775 |
-
</tr>
|
776 |
-
<tr class="remote_info" style="display:none">
|
777 |
-
<td class="key">Database</td>
|
778 |
-
<td>
|
779 |
-
<input type="text"name="database" id="database_rem" style="width:272px">
|
780 |
-
</td>
|
781 |
-
</tr>
|
782 |
-
<tr valign="top">
|
783 |
-
<td class="key">
|
784 |
-
<label>Method: </label>
|
785 |
-
</td>
|
786 |
-
<td >
|
787 |
-
<input type="radio" name="con_method" id="insert" value="insert" checked="checked">
|
788 |
-
<label for="insert">Insert</label>
|
789 |
-
<input type="radio" name="con_method" id="update" value="update">
|
790 |
-
<label for="update">Update</label>
|
791 |
-
<input type="radio" name="con_method" id="delete" value="delete">
|
792 |
-
<label for="delete">Delete</label>
|
793 |
-
</td>
|
794 |
-
</tr>
|
795 |
-
<tr valign="top">
|
796 |
-
<td class="key">
|
797 |
-
</td>
|
798 |
-
<td >
|
799 |
-
<input type="button" value="Connect" onclick="connect()" class="connect">
|
800 |
-
</td>
|
801 |
-
</tr>
|
802 |
-
</table>
|
803 |
-
<div id="struct">
|
804 |
-
</div>
|
805 |
-
<input type="hidden" value="<?php echo $form_id ?>" id="form_id">
|
806 |
-
</div>
|
807 |
-
<div class="desc">
|
808 |
-
<?php
|
809 |
-
foreach($label_id as $key => $lid) {
|
810 |
-
echo '<div>{'.$lid.'} - <button onclick="insert_field('.$lid.');">'.$label_order_original[$key].'</button></div>';
|
811 |
-
}
|
812 |
-
?>
|
813 |
-
</div>
|
814 |
-
</div>
|
815 |
-
<?php
|
816 |
-
die();
|
817 |
-
}
|
818 |
-
|
819 |
-
public function db_tables($form_id){
|
820 |
-
$tables = $this->model->get_tables();
|
821 |
-
?>
|
822 |
-
<label for="tables" style="display:inline-block;width:157px;font-weight: bold;">Select a table</label>
|
823 |
-
<select name="tables" id="tables">
|
824 |
-
<option value="" ></option>
|
825 |
-
<?php
|
826 |
-
foreach($tables as $table) {
|
827 |
-
echo '<option value="' . $table . '" >' . $table . '</option>';
|
828 |
-
}
|
829 |
-
?>
|
830 |
-
</select>
|
831 |
-
<br/><br/>
|
832 |
-
<div id="table_struct">
|
833 |
-
</div>
|
834 |
-
<script>
|
835 |
-
jQuery("#tables").change(function (){
|
836 |
-
jQuery('#table_struct').html('<div id="saving"><div id="saving_text">Loading</div><div id="fadingBarsG"><div id="fadingBarsG_1" class="fadingBarsG"></div><div id="fadingBarsG_2" class="fadingBarsG"></div><div id="fadingBarsG_3" class="fadingBarsG"></div><div id="fadingBarsG_4" class="fadingBarsG"></div><div id="fadingBarsG_5" class="fadingBarsG"></div><div id="fadingBarsG_6" class="fadingBarsG"></div><div id="fadingBarsG_7" class="fadingBarsG"></div><div id="fadingBarsG_8" class="fadingBarsG"></div></div></div>');
|
837 |
-
|
838 |
-
jQuery.ajax({
|
839 |
-
type: "POST",
|
840 |
-
url: "<?php echo add_query_arg(array('action' => 'FormMakerSQLMapping', 'id' => 0, 'form_id' => $form_id, 'task' => 'db_table_struct', 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>",
|
841 |
-
data: 'name='+jQuery(this).val()+'&con_type='+jQuery('input[name=con_type]:checked').val()+'&con_method='+jQuery('input[name=con_method]:checked').val()+'&host='+jQuery('#host_rem').val()+'&port='+jQuery('#port_rem').val()+'&username='+jQuery('#username_rem').val()+'&password='+jQuery('#password_rem').val()+'&database='+jQuery('#database_rem').val()+'&format=row',
|
842 |
-
success: function(data) {
|
843 |
-
jQuery("#table_struct").html(data);
|
844 |
-
}
|
845 |
-
});
|
846 |
-
})
|
847 |
-
</script>
|
848 |
-
<?php
|
849 |
-
die();
|
850 |
-
}
|
851 |
-
|
852 |
-
public function db_table_struct ($form_id) {
|
853 |
-
$table_struct = $this->model->get_table_struct();
|
854 |
-
$label = $this->model->get_labels($form_id);
|
855 |
-
$con_method = isset($_POST['con_method']) ? $_POST['con_method'] : '';
|
856 |
-
$filter_types=array("type_submit_reset", "type_map", "type_editor", "type_captcha", "type_recaptcha", "type_button", "type_paypal_total", "type_send_copy");
|
857 |
-
$label_id= array();
|
858 |
-
$label_order= array();
|
859 |
-
$label_order_original= array();
|
860 |
-
$label_type= array();
|
861 |
-
|
862 |
-
///stexic
|
863 |
-
$label_all = explode('#****#',$label);
|
864 |
-
$label_all = array_slice($label_all,0, count($label_all)-1);
|
865 |
-
|
866 |
-
foreach($label_all as $key => $label_each) {
|
867 |
-
$label_id_each=explode('#**id**#',$label_each);
|
868 |
-
$label_oder_each=explode('#**label**#', $label_id_each[1]);
|
869 |
-
|
870 |
-
if(in_array($label_oder_each[1],$filter_types)) {
|
871 |
-
continue;
|
872 |
-
}
|
873 |
-
array_push($label_id, $label_id_each[0]);
|
874 |
-
array_push($label_order_original, $label_oder_each[0]);
|
875 |
-
$ptn = "/[^a-zA-Z0-9_]/";
|
876 |
-
$rpltxt = "";
|
877 |
-
$label_temp=preg_replace($ptn, $rpltxt, $label_oder_each[0]);
|
878 |
-
array_push($label_order, $label_temp);
|
879 |
-
array_push($label_type, $label_oder_each[1]);
|
880 |
-
}
|
881 |
-
$form_fields='';
|
882 |
-
foreach($label_id as $key => $id) {
|
883 |
-
$form_fields.='<a onclick="insert_field('.$id.'); jQuery(\'#fieldlist\').hide();" style="display:block; text-decoration:none;">'.$label_order_original[$key].'</a>';
|
884 |
-
}
|
885 |
-
$cond='<div id="condid"><select id="sel_condid" style="width: 110px">';
|
886 |
-
foreach($table_struct as $col) {
|
887 |
-
$cond.='<option>'.$col->Field.'</option>';
|
888 |
-
}
|
889 |
-
$cond.='</select>';
|
890 |
-
|
891 |
-
$cond.='<select id="op_condid"><option value="=" selected="selected">=</option><option value="!=">!=</option><option value=">">></option><option value="<"><</option><option value=">=">>=</option><option value="<="><=</option><option value="%..%">Like</option><option value="%..">Starts with</option><option value="..%">Ends with</option></select><input id="val_condid" style="width:120px" type="text" /><select id="andor_condid" style="visibility: hidden;"><option value="AND">AND</option><option value="OR">OR</option></select><img src="' . WD_FM_URL . '/images/delete.png" onclick="delete_cond("condid")" style="vertical-align: middle;"></div>';
|
892 |
-
?>
|
893 |
-
<script>
|
894 |
-
var selected_field ='';
|
895 |
-
var isvisible = 1;
|
896 |
-
var cond_id = 1;
|
897 |
-
//onclick="gen_query()"
|
898 |
-
conds='<?php echo $cond ?>';
|
899 |
-
fields=new Array(<?php
|
900 |
-
$fields = "";
|
901 |
-
if($table_struct) {
|
902 |
-
foreach($table_struct as $col) {
|
903 |
-
$fields.=' "'.$col->Field.'",';
|
904 |
-
}
|
905 |
-
echo substr($fields, 0, -1);
|
906 |
-
}
|
907 |
-
?>);
|
908 |
-
function dis(id, x) {
|
909 |
-
if(x)
|
910 |
-
jQuery('#'+id).removeAttr('disabled');
|
911 |
-
else
|
912 |
-
jQuery('#'+id).attr('disabled','disabled');
|
913 |
-
}
|
914 |
-
|
915 |
-
function update_vis() {
|
916 |
-
previous=0;
|
917 |
-
for(i=1; i<cond_id; i++) {
|
918 |
-
if(jQuery('#'+i).html()) {
|
919 |
-
jQuery('#andor_'+i).css('visibility', 'hidden');
|
920 |
-
if(previous) {
|
921 |
-
jQuery('#andor_'+previous).css('visibility', 'visible');
|
922 |
-
}
|
923 |
-
previous=i;
|
924 |
-
}
|
925 |
-
}
|
926 |
-
}
|
927 |
-
|
928 |
-
function delete_cond(id) {
|
929 |
-
jQuery('#'+id).remove();
|
930 |
-
update_vis();
|
931 |
-
}
|
932 |
-
|
933 |
-
jQuery('.add_cond').click( function() {
|
934 |
-
jQuery('.cols').append(conds.replace(/condid/g, cond_id++));
|
935 |
-
update_vis();
|
936 |
-
}
|
937 |
-
);
|
938 |
-
|
939 |
-
jQuery('html').click(function() {
|
940 |
-
if(jQuery("#fieldlist").css('display')=="block") {
|
941 |
-
jQuery("#fieldlist").hide();
|
942 |
-
}
|
943 |
-
});
|
944 |
-
|
945 |
-
jQuery('.cols input[type="text"]').live('click', function() {
|
946 |
-
event.stopPropagation();
|
947 |
-
jQuery("#fieldlist").css("top",jQuery(this).offset().top+jQuery(this).height()+2);
|
948 |
-
jQuery("#fieldlist").css("left",jQuery(this).offset().left);
|
949 |
-
jQuery("#fieldlist").slideDown('fast');
|
950 |
-
selected_field=this.id;
|
951 |
-
});
|
952 |
-
|
953 |
-
jQuery('#query_txt').click(function() {
|
954 |
-
event.stopPropagation();
|
955 |
-
jQuery("#fieldlist").css("top",jQuery(this).offset().top+jQuery(this).height()+2);
|
956 |
-
jQuery("#fieldlist").css("left",jQuery(this).offset().left);
|
957 |
-
jQuery("#fieldlist").slideDown('fast');
|
958 |
-
selected_field=this.id;
|
959 |
-
});
|
960 |
-
|
961 |
-
jQuery('#fieldlist').click(function(event){
|
962 |
-
event.stopPropagation();
|
963 |
-
});
|
964 |
-
|
965 |
-
function save_query() {
|
966 |
-
con_type =jQuery('input[name=con_type]:checked').val();
|
967 |
-
con_method =jQuery('input[name=con_method]:checked').val();
|
968 |
-
table =jQuery('#tables').val();
|
969 |
-
table =jQuery('#tables').val();
|
970 |
-
host =jQuery('#host_rem').val();
|
971 |
-
port =jQuery('#port_rem').val();
|
972 |
-
username =jQuery('#username_rem').val();
|
973 |
-
password =jQuery('#password_rem').val();
|
974 |
-
database =jQuery('#database_rem').val();
|
975 |
-
|
976 |
-
str=con_type+"***wdfcon_typewdf***"+con_method+"***wdfcon_methodwdf***"+table+"***wdftablewdf***"+host+"***wdfhostwdf***"+port+"***wdfportwdf***"+username+"***wdfusernamewdf***"+password+"***wdfpasswordwdf***"+database+"***wdfdatabasewdf***";
|
977 |
-
|
978 |
-
if(fields.length) {
|
979 |
-
for(i=0; i<fields.length; i++) {
|
980 |
-
str+=fields[i]+'***wdfnamewdf***'+jQuery('#'+fields[i]).val()+'***wdfvaluewdf***'+jQuery('#ch_'+fields[i]+":checked" ).length+'***wdffieldwdf***';
|
981 |
-
}
|
982 |
-
}
|
983 |
-
|
984 |
-
for(i=1; i<cond_id; i++) {
|
985 |
-
if(jQuery('#'+i).html()) {
|
986 |
-
str+=jQuery('#sel_'+i).val()+'***sel***'+jQuery('#op_'+i).val()+'***op***'+jQuery('#val_'+i).val()+'***val***'+jQuery('#andor_'+i).val()+'***where***';
|
987 |
-
}
|
988 |
-
}
|
989 |
-
|
990 |
-
if(!jQuery('#query_txt').val()) {
|
991 |
-
gen_query();
|
992 |
-
}
|
993 |
-
|
994 |
-
jQuery('#details').val(str);
|
995 |
-
|
996 |
-
var datatxt = jQuery("#query_form").serialize()+'&form_id='+jQuery("#form_id").val();
|
997 |
-
if(jQuery('#query_txt').val()) {
|
998 |
-
jQuery('.c1').html('<div id="saving"><div id="saving_text">Saving</div><div id="fadingBarsG"><div id="fadingBarsG_1" class="fadingBarsG"></div><div id="fadingBarsG_2" class="fadingBarsG"></div><div id="fadingBarsG_3" class="fadingBarsG"></div><div id="fadingBarsG_4" class="fadingBarsG"></div><div id="fadingBarsG_5" class="fadingBarsG"></div><div id="fadingBarsG_6" class="fadingBarsG"></div><div id="fadingBarsG_7" class="fadingBarsG"></div><div id="fadingBarsG_8" class="fadingBarsG"></div></div></div>');
|
999 |
-
jQuery.ajax({
|
1000 |
-
type: "POST",
|
1001 |
-
url: "<?php echo add_query_arg(array('action' => 'FormMakerSQLMapping', 'id' => 0, 'form_id' => $form_id, 'task' => 'save_query', 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>",
|
1002 |
-
data: datatxt,
|
1003 |
-
success: function(data) {
|
1004 |
-
window.parent.wd_fm_apply_options();
|
1005 |
-
window.parent.tb_remove();
|
1006 |
-
}
|
1007 |
-
});
|
1008 |
-
}
|
1009 |
-
else {
|
1010 |
-
alert('The query is empty.');
|
1011 |
-
}
|
1012 |
-
return false;
|
1013 |
-
}
|
1014 |
-
|
1015 |
-
function gen_query() {
|
1016 |
-
if(jQuery('#query_txt').val()) {
|
1017 |
-
if(!confirm('Are you sure you want to replace the Query? All the modifications to the Query will be lost.')) {
|
1018 |
-
return;
|
1019 |
-
}
|
1020 |
-
}
|
1021 |
-
query="";
|
1022 |
-
fields=new Array(<?php
|
1023 |
-
$fields = "";
|
1024 |
-
if($table_struct) {
|
1025 |
-
foreach($table_struct as $col) {
|
1026 |
-
$fields.=' "'.$col->Field.'",';
|
1027 |
-
}
|
1028 |
-
echo substr($fields, 0, -1);
|
1029 |
-
}
|
1030 |
-
?>);
|
1031 |
-
|
1032 |
-
con_type =jQuery('input[name=con_type]:checked').val();
|
1033 |
-
con_method =jQuery('input[name=con_method]:checked').val();
|
1034 |
-
table =jQuery('#tables').val();
|
1035 |
-
fls='';
|
1036 |
-
vals='';
|
1037 |
-
valsA=new Array();
|
1038 |
-
flsA=new Array();
|
1039 |
-
|
1040 |
-
if(fields.length) {
|
1041 |
-
for(i=0; i<fields.length; i++) {
|
1042 |
-
if(jQuery('#ch_'+fields[i]+":checked" ).length) {
|
1043 |
-
flsA.push(fields[i]);
|
1044 |
-
valsA.push(jQuery('#'+fields[i]).val());
|
1045 |
-
}
|
1046 |
-
}
|
1047 |
-
}
|
1048 |
-
|
1049 |
-
if(con_method=="insert") {
|
1050 |
-
if(flsA.length) {
|
1051 |
-
for(i=0; i<flsA.length-1; i++) {
|
1052 |
-
fls+= '`'+flsA[i]+'`, ';
|
1053 |
-
vals+= '"'+valsA[i]+'", ';
|
1054 |
-
}
|
1055 |
-
fls+= '`'+flsA[i]+'`';
|
1056 |
-
vals+= '"'+valsA[i]+'"';
|
1057 |
-
}
|
1058 |
-
if(fls) {
|
1059 |
-
query="INSERT INTO "+jQuery('#tables').val()+" (" +fls+") VALUES ("+vals+")";
|
1060 |
-
}
|
1061 |
-
}
|
1062 |
-
|
1063 |
-
if(con_method=="update") {
|
1064 |
-
if(flsA.length) {
|
1065 |
-
for(i=0; i<flsA.length-1; i++) {
|
1066 |
-
vals+= '`'+flsA[i]+'`="'+valsA[i]+'", ';
|
1067 |
-
}
|
1068 |
-
vals+= '`'+flsA[i]+'`="'+valsA[i]+'"';
|
1069 |
-
}
|
1070 |
-
where="";
|
1071 |
-
previous='';
|
1072 |
-
for(i=1; i<cond_id; i++) {
|
1073 |
-
if(jQuery('#'+i).html()) {
|
1074 |
-
if(jQuery('#op_'+i).val()=="%..%")
|
1075 |
-
op_val=' LIKE "%'+jQuery('#val_'+i).val()+'%"';
|
1076 |
-
else if(jQuery('#op_'+i).val()=="%..")
|
1077 |
-
op_val=' LIKE "%'+jQuery('#val_'+i).val()+'"';
|
1078 |
-
else if(jQuery('#op_'+i).val()=="..%")
|
1079 |
-
op_val=' LIKE "'+jQuery('#val_'+i).val()+'%"';
|
1080 |
-
else
|
1081 |
-
op_val=' '+jQuery('#op_'+i).val()+' "'+jQuery('#val_'+i).val()+'"';
|
1082 |
-
where+=previous+' `'+jQuery('#sel_'+i).val()+'`'+op_val;
|
1083 |
-
previous=' '+ jQuery('#andor_'+i).val();
|
1084 |
-
}
|
1085 |
-
}
|
1086 |
-
if(vals) {
|
1087 |
-
query="UPDATE "+jQuery('#tables').val()+" SET " + vals+(where? ' WHERE'+where: '') ;
|
1088 |
-
}
|
1089 |
-
}
|
1090 |
-
|
1091 |
-
if(con_method=="delete") {
|
1092 |
-
where="";
|
1093 |
-
previous='';
|
1094 |
-
for(i=1; i<cond_id; i++) {
|
1095 |
-
if(jQuery('#'+i).html()) {
|
1096 |
-
if(jQuery('#op_'+i).val()=="%..%")
|
1097 |
-
op_val=' LIKE "%'+jQuery('#val_'+i).val()+'%"';
|
1098 |
-
|
1099 |
-
else if(jQuery('#op_'+i).val()=="%..")
|
1100 |
-
op_val=' LIKE "%'+jQuery('#val_'+i).val()+'"';
|
1101 |
-
|
1102 |
-
else if(jQuery('#op_'+i).val()=="..%")
|
1103 |
-
op_val=' LIKE "'+jQuery('#val_'+i).val()+'%"';
|
1104 |
-
|
1105 |
-
else
|
1106 |
-
op_val=' '+jQuery('#op_'+i).val()+' "'+jQuery('#val_'+i).val()+'"';
|
1107 |
-
where+=previous+' '+jQuery('#sel_'+i).val()+op_val;
|
1108 |
-
previous=' '+ jQuery('#andor_'+i).val();
|
1109 |
-
}
|
1110 |
-
}
|
1111 |
-
if(where) {
|
1112 |
-
query="DELETE FROM "+jQuery('#tables').val()+ ' WHERE'+where ;
|
1113 |
-
}
|
1114 |
-
}
|
1115 |
-
jQuery('#query_txt').val(query);
|
1116 |
-
}
|
1117 |
-
|
1118 |
-
jQuery(document).ready(function () {
|
1119 |
-
jQuery(".hasTip").tooltip({
|
1120 |
-
track: true,
|
1121 |
-
content: function () {
|
1122 |
-
return jQuery(this).prop('title');
|
1123 |
-
}
|
1124 |
-
});
|
1125 |
-
});
|
1126 |
-
|
1127 |
-
function insert_field(myValue) {
|
1128 |
-
if(!selected_field)
|
1129 |
-
return;
|
1130 |
-
myField=document.getElementById(selected_field);
|
1131 |
-
if (document.selection) {
|
1132 |
-
myField.focus();
|
1133 |
-
sel = document.selection.createRange();
|
1134 |
-
sel.text = myValue;
|
1135 |
-
}
|
1136 |
-
else {
|
1137 |
-
if (myField.selectionStart || myField.selectionStart == '0') {
|
1138 |
-
var startPos = myField.selectionStart;
|
1139 |
-
var endPos = myField.selectionEnd;
|
1140 |
-
myField.value = myField.value.substring(0, startPos)
|
1141 |
-
+ "{"+myValue+"}"
|
1142 |
-
+ myField.value.substring(endPos, myField.value.length);
|
1143 |
-
}
|
1144 |
-
else {
|
1145 |
-
myField.value += "{"+myValue+"}";
|
1146 |
-
}
|
1147 |
-
}
|
1148 |
-
}
|
1149 |
-
</script>
|
1150 |
-
<style>
|
1151 |
-
.cols div:nth-child(even) {background: #FFF;}
|
1152 |
-
.cols div:nth-child(odd) {background: #F5F5F5;}
|
1153 |
-
.cols div {
|
1154 |
-
height: 28px;
|
1155 |
-
padding: 5px;
|
1156 |
-
}
|
1157 |
-
.cols label {
|
1158 |
-
display:inline-block;
|
1159 |
-
width:200px;
|
1160 |
-
font-size:15px;
|
1161 |
-
overflow: hidden;
|
1162 |
-
white-space: nowrap;
|
1163 |
-
text-overflow: ellipsis;
|
1164 |
-
vertical-align: middle;
|
1165 |
-
}
|
1166 |
-
.cols input[type="text"] {
|
1167 |
-
width: 220px;
|
1168 |
-
line-height: 18px;
|
1169 |
-
height: 20px;
|
1170 |
-
}
|
1171 |
-
.cols input[type="text"]:disabled {
|
1172 |
-
cursor: not-allowed;
|
1173 |
-
background-color: #eee;
|
1174 |
-
}
|
1175 |
-
.cols input[type="checkbox"] {
|
1176 |
-
width: 20px;
|
1177 |
-
line-height: 18px;
|
1178 |
-
height: 20px;
|
1179 |
-
vertical-align: middle;
|
1180 |
-
}
|
1181 |
-
.cols select {
|
1182 |
-
line-height: 18px;
|
1183 |
-
height: 24px;
|
1184 |
-
}
|
1185 |
-
#fieldlist {
|
1186 |
-
position: absolute;
|
1187 |
-
width:225px;
|
1188 |
-
background: #fff;
|
1189 |
-
border: solid 1px #c7c7c7;
|
1190 |
-
top: 0;
|
1191 |
-
left: 0;
|
1192 |
-
z-index: 1000;
|
1193 |
-
}
|
1194 |
-
#fieldlist a {
|
1195 |
-
padding: 5px;
|
1196 |
-
cursor:pointer;
|
1197 |
-
overflow: hidden;
|
1198 |
-
white-space: nowrap;
|
1199 |
-
text-overflow: ellipsis;
|
1200 |
-
}
|
1201 |
-
#fieldlist a:hover {
|
1202 |
-
background: #ccc;
|
1203 |
-
}
|
1204 |
-
.gen_query, .gen_query:focus {
|
1205 |
-
width: 200px;
|
1206 |
-
height: 38px;
|
1207 |
-
background: #0E73D4;
|
1208 |
-
color: white;
|
1209 |
-
cursor: pointer;
|
1210 |
-
border: 0px;
|
1211 |
-
font-size: 16px;
|
1212 |
-
font-weight: bold;
|
1213 |
-
margin: 20px;
|
1214 |
-
}
|
1215 |
-
.gen_query:active {
|
1216 |
-
background: #ccc;
|
1217 |
-
}
|
1218 |
-
</style>
|
1219 |
-
<?php
|
1220 |
-
if($table_struct) {
|
1221 |
-
?>
|
1222 |
-
|
1223 |
-
<div class="cols">
|
1224 |
-
<?php
|
1225 |
-
if($con_method=='insert' or $con_method=='update') {
|
1226 |
-
echo '<div style="background: none;text-align: center;font-size: 20px;color: rgb(0, 164, 228);font-weight: bold;"> SET </div>';
|
1227 |
-
foreach($table_struct as $col) {
|
1228 |
-
$title=' '.$col->Field;
|
1229 |
-
$title.="<ul style='padding-left: 17px;'>";
|
1230 |
-
$title.="<li>Type - ".$col->Type."</li>";
|
1231 |
-
$title.="<li>Null - ".$col->Null."</li>";
|
1232 |
-
$title.="<li>Key - ".$col->Key."</li>";
|
1233 |
-
$title.="<li>Default - ".$col->Default."</li>";
|
1234 |
-
$title.="<li>Extra - ".$col->Extra."</li>";
|
1235 |
-
$title.="</ul>";
|
1236 |
-
?>
|
1237 |
-
<div><label title="<?php echo $title; ?>" class="hasTip"><b><?php echo $col->Field; ?></b><img src="<?php echo WD_FM_URL . '/images/info.png'; ?>" style="width:20px; vertical-align:middle;padding-left: 10px;" /></label><input type="text" id="<?php echo $col->Field; ?>" disabled="disabled"/><input id="ch_<?php echo $col->Field; ?>" type="checkbox" onClick="dis('<?php echo $col->Field; ?>', this.checked)"/></div>
|
1238 |
-
<?php
|
1239 |
-
}
|
1240 |
-
}
|
1241 |
-
if($con_method=='delete' or $con_method=='update') {
|
1242 |
-
echo '<div style="background: none;text-align: center;font-size: 20px;color: rgb(0, 164, 228);font-weight: bold;"> WHERE </div>
|
1243 |
-
|
1244 |
-
<img src="' . WD_FM_URL . '/images/add_condition.png" title="ADD" class="add_cond"/></br>';
|
1245 |
-
}
|
1246 |
-
?>
|
1247 |
-
</div>
|
1248 |
-
<br/>
|
1249 |
-
<input type="button" value="Generate Query" class="gen_query" onclick="gen_query()">
|
1250 |
-
<br/>
|
1251 |
-
<form name="query_form" id="query_form" >
|
1252 |
-
<label style="vertical-align: top;" for="query_txt" > Query: </label><textarea id="query_txt" name="query" rows=5 style="width:428px"></textarea>
|
1253 |
-
<input type="hidden" name="details" id="details">
|
1254 |
-
</form>
|
1255 |
-
<input type="button" value="Save" style="float: right;width: 200px;height: 38px;background: #0E73D4;color: white;cursor: pointer;border: 0px;font-size: 16px;font-weight: bold;margin: 20px;" onclick="save_query()">
|
1256 |
-
<div id="fieldlist" style="display: none;">
|
1257 |
-
<?php echo $form_fields ?>
|
1258 |
-
</div>
|
1259 |
-
<?php
|
1260 |
-
}
|
1261 |
-
die();
|
1262 |
-
}
|
1263 |
-
|
1264 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
1265 |
-
// Getters & Setters //
|
1266 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
1267 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
1268 |
-
// Private Methods //
|
1269 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
1270 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
1271 |
-
// Listeners //
|
1272 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
1273 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FMViewFormMakerSQLMapping {
|
4 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
+
// Events //
|
6 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
+
// Constants //
|
9 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
+
// Variables //
|
12 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
+
private $model;
|
14 |
+
|
15 |
+
|
16 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
17 |
+
// Constructor & Destructor //
|
18 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
+
public function __construct($model) {
|
20 |
+
$this->model = $model;
|
21 |
+
}
|
22 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
23 |
+
// Public Methods //
|
24 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
25 |
+
|
26 |
+
public function edit_query($id, $form_id) {
|
27 |
+
wp_print_scripts('jquery');
|
28 |
+
wp_print_scripts('jquery-ui-tooltip');
|
29 |
+
?>
|
30 |
+
<link media="all" type="text/css" href="<?php echo WD_FM_URL . '/css/style.css'; ?>" rel="stylesheet">
|
31 |
+
<link rel="stylesheet" href="<?php echo WD_FM_URL . '/css/jquery-ui-1.10.3.custom.css'; ?>">
|
32 |
+
<?php
|
33 |
+
$label = $this->model->get_labels($form_id);
|
34 |
+
$query_obj = $this->model->get_query($id);
|
35 |
+
|
36 |
+
$temp = explode('***wdfcon_typewdf***',$query_obj->details);
|
37 |
+
$con_type = $temp[0];
|
38 |
+
$temp = explode('***wdfcon_methodwdf***',$temp[1]);
|
39 |
+
$con_method = $temp[0];
|
40 |
+
$temp = explode('***wdftablewdf***',$temp[1]);
|
41 |
+
$table_cur = $temp[0];
|
42 |
+
$temp = explode('***wdfhostwdf***',$temp[1]);
|
43 |
+
$host = $temp[0];
|
44 |
+
$temp = explode('***wdfportwdf***',$temp[1]);
|
45 |
+
$port = $temp[0];
|
46 |
+
$temp = explode('***wdfusernamewdf***',$temp[1]);
|
47 |
+
$username = $temp[0];
|
48 |
+
$temp = explode('***wdfpasswordwdf***',$temp[1]);
|
49 |
+
$password = $temp[0];
|
50 |
+
$temp = explode('***wdfdatabasewdf***',$temp[1]);
|
51 |
+
$database = $temp[0];
|
52 |
+
|
53 |
+
$details = $temp[1];
|
54 |
+
|
55 |
+
$tables = $this->model->get_tables_saved($con_type, $username, $password, $database, $host);
|
56 |
+
$table_struct = $this->model->get_table_struct_saved($con_type, $username, $password, $database, $host, $table_cur, $con_method);
|
57 |
+
|
58 |
+
$filter_types=array("type_submit_reset", "type_map", "type_editor", "type_captcha", "type_recaptcha", "type_button", "type_paypal_total", "type_send_copy");
|
59 |
+
$label_id= array();
|
60 |
+
$label_order= array();
|
61 |
+
$label_order_original= array();
|
62 |
+
$label_type= array();
|
63 |
+
|
64 |
+
///stexic
|
65 |
+
$label_all = explode('#****#',$label);
|
66 |
+
$label_all = array_slice($label_all,0, count($label_all)-1);
|
67 |
+
|
68 |
+
foreach($label_all as $key => $label_each) {
|
69 |
+
$label_id_each=explode('#**id**#',$label_each);
|
70 |
+
$label_oder_each=explode('#**label**#', $label_id_each[1]);
|
71 |
+
|
72 |
+
if(in_array($label_oder_each[1],$filter_types))
|
73 |
+
continue;
|
74 |
+
|
75 |
+
array_push($label_id, $label_id_each[0]);
|
76 |
+
array_push($label_order_original, $label_oder_each[0]);
|
77 |
+
$ptn = "/[^a-zA-Z0-9_]/";
|
78 |
+
$rpltxt = "";
|
79 |
+
$label_temp=preg_replace($ptn, $rpltxt, $label_oder_each[0]);
|
80 |
+
array_push($label_order, $label_temp);
|
81 |
+
array_push($label_type, $label_oder_each[1]);
|
82 |
+
}
|
83 |
+
|
84 |
+
$form_fields='';
|
85 |
+
foreach($label_id as $key => $lid) {
|
86 |
+
$form_fields.='<a onclick="insert_field('.$lid.'); jQuery(\'#fieldlist\').hide();" style="display:block; text-decoration:none;">'.$label_order_original[$key].'</a>';
|
87 |
+
}
|
88 |
+
$cond='<div id="condid"><select id="sel_condid" style="width: 110px">';
|
89 |
+
foreach($table_struct as $col) {
|
90 |
+
$cond.='<option>'.$col->Field.'</option>';
|
91 |
+
}
|
92 |
+
$cond.='</select>';
|
93 |
+
$cond.='<select id="op_condid"><option value="=" selected="selected">=</option><option value="!=">!=</option><option value=">">></option><option value="<"><</option><option value=">=">>=</option><option value="<="><=</option><option value="%..%">Like</option><option value="%..">Starts with</option><option value="..%">Ends with</option></select><input id="val_condid" style="width:120px" type="text" /><select id="andor_condid" style="visibility: hidden;"><option value="AND">AND</option><option value="OR">OR</option></select><img src="' . WD_FM_URL . '/images/delete.png" onclick="delete_cond("condid")" style="vertical-align: middle;"></div>';
|
94 |
+
?>
|
95 |
+
<script>
|
96 |
+
function connect() {
|
97 |
+
jQuery("input[type='radio']").attr('disabled','');
|
98 |
+
jQuery('#struct').html('<div id="saving"><div id="saving_text">Loading</div><div id="fadingBarsG"><div id="fadingBarsG_1" class="fadingBarsG"></div><div id="fadingBarsG_2" class="fadingBarsG"></div><div id="fadingBarsG_3" class="fadingBarsG"></div><div id="fadingBarsG_4" class="fadingBarsG"></div><div id="fadingBarsG_5" class="fadingBarsG"></div><div id="fadingBarsG_6" class="fadingBarsG"></div><div id="fadingBarsG_7" class="fadingBarsG"></div><div id="fadingBarsG_8" class="fadingBarsG"></div></div></div>');
|
99 |
+
|
100 |
+
jQuery("#struct").load('index.php?option=com_formmaker&task=db_tables&con_type='+jQuery('input[name=con_type]:checked').val()+'&con_method='+jQuery('input[name=con_method]:checked').val()+'&format=row');
|
101 |
+
}
|
102 |
+
jQuery(document).ready(function() {
|
103 |
+
jQuery("#tables").change(function (){
|
104 |
+
jQuery('#table_struct').html('<div id="saving"><div id="saving_text">Loading</div><div id="fadingBarsG"><div id="fadingBarsG_1" class="fadingBarsG"></div><div id="fadingBarsG_2" class="fadingBarsG"></div><div id="fadingBarsG_3" class="fadingBarsG"></div><div id="fadingBarsG_4" class="fadingBarsG"></div><div id="fadingBarsG_5" class="fadingBarsG"></div><div id="fadingBarsG_6" class="fadingBarsG"></div><div id="fadingBarsG_7" class="fadingBarsG"></div><div id="fadingBarsG_8" class="fadingBarsG"></div></div></div>');
|
105 |
+
|
106 |
+
jQuery("#table_struct").load('index.php?option=com_formmaker&task=db_table_struct&name='+jQuery(this).val()+'&con_type='+jQuery('input[name=con_type]:checked').val()+'&con_method='+jQuery('input[name=con_method]:checked').val()+'&host='+jQuery('#host_rem').val()+'&port='+jQuery('#port_rem').val()+'&username='+jQuery('#username_rem').val()+'&password='+jQuery('#password_rem').val()+'&database='+jQuery('#database_rem').val()+'&format=row&id='+jQuery("#form_id").val());
|
107 |
+
});
|
108 |
+
jQuery('html').click(function() {
|
109 |
+
if(jQuery("#fieldlist").css('display')=="block") {
|
110 |
+
jQuery("#fieldlist").hide();
|
111 |
+
}
|
112 |
+
});
|
113 |
+
jQuery('.cols input[type="text"]').live('click', function() {
|
114 |
+
event.stopPropagation();
|
115 |
+
jQuery("#fieldlist").css("top",jQuery(this).offset().top+jQuery(this).height()+2);
|
116 |
+
jQuery("#fieldlist").css("left",jQuery(this).offset().left);
|
117 |
+
jQuery("#fieldlist").slideDown('fast');
|
118 |
+
selected_field=this.id;
|
119 |
+
});
|
120 |
+
jQuery('#query_txt').click(function() {
|
121 |
+
event.stopPropagation();
|
122 |
+
jQuery("#fieldlist").css("top",jQuery(this).offset().top+jQuery(this).height()+2);
|
123 |
+
jQuery("#fieldlist").css("left",jQuery(this).offset().left);
|
124 |
+
jQuery("#fieldlist").slideDown('fast');
|
125 |
+
selected_field=this.id;
|
126 |
+
});
|
127 |
+
jQuery('#fieldlist').click(function(event){
|
128 |
+
event.stopPropagation();
|
129 |
+
});
|
130 |
+
jQuery('.add_cond').click( function() {
|
131 |
+
jQuery('.cols').append(conds.replace(/condid/g, cond_id++));
|
132 |
+
update_vis();
|
133 |
+
}
|
134 |
+
);
|
135 |
+
});
|
136 |
+
var selected_field ='';
|
137 |
+
var isvisible = 1;
|
138 |
+
var cond_id = 1;
|
139 |
+
conds='<?php echo $cond ?>';
|
140 |
+
fields=new Array(<?php
|
141 |
+
$fields = "";
|
142 |
+
if($table_struct) {
|
143 |
+
foreach($table_struct as $col) {
|
144 |
+
$fields.=' "'.$col->Field.'",';
|
145 |
+
}
|
146 |
+
echo substr($fields, 0, -1);
|
147 |
+
}
|
148 |
+
?>);
|
149 |
+
|
150 |
+
function dis(id, x) {
|
151 |
+
if(x)
|
152 |
+
jQuery('#'+id).removeAttr('disabled');
|
153 |
+
else
|
154 |
+
jQuery('#'+id).attr('disabled','disabled');
|
155 |
+
}
|
156 |
+
function update_vis() {
|
157 |
+
previous=0;
|
158 |
+
for(i=1; i<cond_id; i++) {
|
159 |
+
if(jQuery('#'+i).html()) {
|
160 |
+
jQuery('#andor_'+i).css('visibility', 'hidden');
|
161 |
+
if(previous)
|
162 |
+
jQuery('#andor_'+previous).css('visibility', 'visible');
|
163 |
+
previous=i;
|
164 |
+
}
|
165 |
+
}
|
166 |
+
}
|
167 |
+
function delete_cond(id) {
|
168 |
+
jQuery('#'+id).remove();
|
169 |
+
update_vis();
|
170 |
+
}
|
171 |
+
function save_query() {
|
172 |
+
con_type =jQuery('input[name=con_type]:checked').val();
|
173 |
+
con_method =jQuery('input[name=con_method]:checked').val();
|
174 |
+
table =jQuery('#tables').val();
|
175 |
+
host =jQuery('#host_rem').val();
|
176 |
+
port =jQuery('#port_rem').val();
|
177 |
+
username =jQuery('#username_rem').val();
|
178 |
+
password =jQuery('#password_rem').val();
|
179 |
+
database =jQuery('#database_rem').val();
|
180 |
+
|
181 |
+
str=con_type+"***wdfcon_typewdf***"+con_method+"***wdfcon_methodwdf***"+table+"***wdftablewdf***"+host+"***wdfhostwdf***"+port+"***wdfportwdf***"+username+"***wdfusernamewdf***"+password+"***wdfpasswordwdf***"+database+"***wdfdatabasewdf***";
|
182 |
+
|
183 |
+
if(fields.length) {
|
184 |
+
for(i=0; i<fields.length; i++) {
|
185 |
+
str+=fields[i]+'***wdfnamewdf***'+jQuery('#'+fields[i]).val()+'***wdfvaluewdf***'+jQuery('#ch_'+fields[i]+":checked" ).length+'***wdffieldwdf***';
|
186 |
+
}
|
187 |
+
}
|
188 |
+
|
189 |
+
for(i=1; i<cond_id; i++) {
|
190 |
+
if(jQuery('#'+i).html()) {
|
191 |
+
str+=jQuery('#sel_'+i).val()+'***sel***'+jQuery('#op_'+i).val()+'***op***'+jQuery('#val_'+i).val()+'***val***'+jQuery('#andor_'+i).val()+'***where***';
|
192 |
+
}
|
193 |
+
}
|
194 |
+
if(!jQuery('#query_txt').val()) {
|
195 |
+
gen_query();
|
196 |
+
}
|
197 |
+
jQuery('#details').val(str);
|
198 |
+
var datatxt = jQuery("#query_form").serialize()+'&form_id='+jQuery("#form_id").val();
|
199 |
+
|
200 |
+
if(jQuery('#query_txt').val()) {
|
201 |
+
jQuery('.c1').html('<div id="saving"><div id="saving_text">Saving</div><div id="fadingBarsG"><div id="fadingBarsG_1" class="fadingBarsG"></div><div id="fadingBarsG_2" class="fadingBarsG"></div><div id="fadingBarsG_3" class="fadingBarsG"></div><div id="fadingBarsG_4" class="fadingBarsG"></div><div id="fadingBarsG_5" class="fadingBarsG"></div><div id="fadingBarsG_6" class="fadingBarsG"></div><div id="fadingBarsG_7" class="fadingBarsG"></div><div id="fadingBarsG_8" class="fadingBarsG"></div></div></div>');
|
202 |
+
|
203 |
+
jQuery.ajax({
|
204 |
+
type: "POST",
|
205 |
+
url: "<?php echo add_query_arg(array('action' => 'FormMakerSQLMapping', 'id' => $id, 'form_id' => $form_id, 'task' => 'update_query', 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>",
|
206 |
+
data: datatxt,
|
207 |
+
success: function(data) {
|
208 |
+
window.parent.wd_fm_apply_options();
|
209 |
+
window.parent.tb_remove();
|
210 |
+
}
|
211 |
+
});
|
212 |
+
}
|
213 |
+
else {
|
214 |
+
alert('The query is empty.');
|
215 |
+
}
|
216 |
+
return false;
|
217 |
+
}
|
218 |
+
|
219 |
+
function gen_query() {
|
220 |
+
if(jQuery('#query_txt').val())
|
221 |
+
if(!confirm('Are you sure you want to replace the Query? All the modifications to the Query will be lost.'))
|
222 |
+
return;
|
223 |
+
|
224 |
+
query="";
|
225 |
+
fields=new Array(<?php
|
226 |
+
$fields = "";
|
227 |
+
if($table_struct) {
|
228 |
+
foreach($table_struct as $col) {
|
229 |
+
$fields.=' "'.$col->Field.'",';
|
230 |
+
}
|
231 |
+
echo substr($fields, 0, -1);
|
232 |
+
}
|
233 |
+
?>);
|
234 |
+
|
235 |
+
con_type =jQuery('input[name=con_type]:checked').val();
|
236 |
+
con_method =jQuery('input[name=con_method]:checked').val();
|
237 |
+
table =jQuery('#tables').val();
|
238 |
+
fls='';
|
239 |
+
vals='';
|
240 |
+
valsA=new Array();
|
241 |
+
flsA=new Array();
|
242 |
+
|
243 |
+
if(fields.length) {
|
244 |
+
for(i=0; i<fields.length; i++) {
|
245 |
+
if(jQuery('#ch_'+fields[i]+":checked" ).length) {
|
246 |
+
flsA.push(fields[i]);
|
247 |
+
valsA.push(jQuery('#'+fields[i]).val());
|
248 |
+
}
|
249 |
+
}
|
250 |
+
}
|
251 |
+
if(con_method=="insert") {
|
252 |
+
if(flsA.length) {
|
253 |
+
for(i=0; i<flsA.length-1; i++) {
|
254 |
+
fls+= '`'+flsA[i]+'`, ';
|
255 |
+
vals+= '"'+valsA[i]+'", ';
|
256 |
+
}
|
257 |
+
fls+= '`'+flsA[i]+'`';
|
258 |
+
vals+= '"'+valsA[i]+'"';
|
259 |
+
}
|
260 |
+
if(fls)
|
261 |
+
query="INSERT INTO "+jQuery('#tables').val()+" (" +fls+") VALUES ("+vals+")";
|
262 |
+
}
|
263 |
+
|
264 |
+
if(con_method=="update") {
|
265 |
+
if(flsA.length) {
|
266 |
+
for(i=0; i<flsA.length-1; i++) {
|
267 |
+
vals+= '`'+flsA[i]+'`="'+valsA[i]+'", ';
|
268 |
+
}
|
269 |
+
vals+= '`'+flsA[i]+'`="'+valsA[i]+'"';
|
270 |
+
}
|
271 |
+
where="";
|
272 |
+
previous='';
|
273 |
+
|
274 |
+
for(i=1; i<cond_id; i++) {
|
275 |
+
if(jQuery('#'+i).html()) {
|
276 |
+
if(jQuery('#op_'+i).val()=="%..%")
|
277 |
+
op_val=' LIKE "%'+jQuery('#val_'+i).val()+'%"';
|
278 |
+
else if(jQuery('#op_'+i).val()=="%..")
|
279 |
+
op_val=' LIKE "%'+jQuery('#val_'+i).val()+'"';
|
280 |
+
else if(jQuery('#op_'+i).val()=="..%")
|
281 |
+
op_val=' LIKE "'+jQuery('#val_'+i).val()+'%"';
|
282 |
+
else
|
283 |
+
op_val=' '+jQuery('#op_'+i).val()+' "'+jQuery('#val_'+i).val()+'"';
|
284 |
+
where+=previous+' `'+jQuery('#sel_'+i).val()+'`'+op_val;
|
285 |
+
previous=' '+ jQuery('#andor_'+i).val();
|
286 |
+
}
|
287 |
+
}
|
288 |
+
if(vals)
|
289 |
+
query="UPDATE "+jQuery('#tables').val()+" SET " + vals+(where? ' WHERE'+where: '') ;
|
290 |
+
}
|
291 |
+
if(con_method=="delete") {
|
292 |
+
where="";
|
293 |
+
previous='';
|
294 |
+
for(i=1; i<cond_id; i++) {
|
295 |
+
if(jQuery('#'+i).html()) {
|
296 |
+
if(jQuery('#op_'+i).val()=="%..%")
|
297 |
+
op_val=' LIKE "%'+jQuery('#val_'+i).val()+'%"';
|
298 |
+
else if(jQuery('#op_'+i).val()=="%..")
|
299 |
+
op_val=' LIKE "%'+jQuery('#val_'+i).val()+'"';
|
300 |
+
else if(jQuery('#op_'+i).val()=="..%")
|
301 |
+
op_val=' LIKE "'+jQuery('#val_'+i).val()+'%"';
|
302 |
+
else
|
303 |
+
op_val=' '+jQuery('#op_'+i).val()+' "'+jQuery('#val_'+i).val()+'"';
|
304 |
+
where+=previous+' '+jQuery('#sel_'+i).val()+op_val;
|
305 |
+
previous=' '+ jQuery('#andor_'+i).val();
|
306 |
+
}
|
307 |
+
}
|
308 |
+
if(where)
|
309 |
+
query="DELETE FROM "+jQuery('#tables').val()+ ' WHERE'+where ;
|
310 |
+
}
|
311 |
+
jQuery('#query_txt').val(query);
|
312 |
+
}
|
313 |
+
|
314 |
+
jQuery(document).ready(function () {
|
315 |
+
jQuery(".hasTip").tooltip({
|
316 |
+
track: true,
|
317 |
+
content: function () {
|
318 |
+
return jQuery(this).prop('title');
|
319 |
+
}
|
320 |
+
});
|
321 |
+
});
|
322 |
+
|
323 |
+
function insert_field(myValue) {
|
324 |
+
if(!selected_field)
|
325 |
+
return;
|
326 |
+
myField=document.getElementById(selected_field);
|
327 |
+
if (document.selection) {
|
328 |
+
myField.focus();
|
329 |
+
sel = document.selection.createRange();
|
330 |
+
sel.text = myValue;
|
331 |
+
}
|
332 |
+
else {
|
333 |
+
if (myField.selectionStart || myField.selectionStart == '0') {
|
334 |
+
var startPos = myField.selectionStart;
|
335 |
+
var endPos = myField.selectionEnd;
|
336 |
+
myField.value = myField.value.substring(0, startPos)
|
337 |
+
+ "{"+myValue+"}"
|
338 |
+
+ myField.value.substring(endPos, myField.value.length);
|
339 |
+
}
|
340 |
+
else {
|
341 |
+
myField.value += "{"+myValue+"}";
|
342 |
+
}
|
343 |
+
}
|
344 |
+
}
|
345 |
+
</script>
|
346 |
+
|
347 |
+
<style>
|
348 |
+
.main_func {
|
349 |
+
font-size: 12px;
|
350 |
+
display:inline-block;
|
351 |
+
width:480px;
|
352 |
+
vertical-align:top;
|
353 |
+
}
|
354 |
+
.desc {
|
355 |
+
font-size: 12px;
|
356 |
+
display:inline-block;
|
357 |
+
width:250px;
|
358 |
+
position:fixed;
|
359 |
+
margin:15px;
|
360 |
+
padding-left:55px;
|
361 |
+
}
|
362 |
+
.desc button {
|
363 |
+
max-width: 200px;
|
364 |
+
overflow: hidden;
|
365 |
+
white-space: nowrap;
|
366 |
+
text-overflow: ellipsis;
|
367 |
+
}
|
368 |
+
.key label {
|
369 |
+
display:inline-block;
|
370 |
+
width:150px;
|
371 |
+
}
|
372 |
+
.cols {
|
373 |
+
border: 3px solid red;
|
374 |
+
padding: 4px;
|
375 |
+
}
|
376 |
+
.cols div:nth-child(even) {background: #FFF}
|
377 |
+
.cols div:nth-child(odd) {background: #F5F5F5}
|
378 |
+
.cols div {
|
379 |
+
height: 28px;
|
380 |
+
padding: 5px
|
381 |
+
}
|
382 |
+
.cols label {
|
383 |
+
display:inline-block;
|
384 |
+
width:200px;
|
385 |
+
font-size:15px;
|
386 |
+
overflow: hidden;
|
387 |
+
white-space: nowrap;
|
388 |
+
text-overflow: ellipsis;
|
389 |
+
vertical-align: middle;
|
390 |
+
}
|
391 |
+
.cols input[type="text"] {
|
392 |
+
width: 220px;
|
393 |
+
line-height: 18px;
|
394 |
+
height: 20px;
|
395 |
+
}
|
396 |
+
.cols input[type="text"]:disabled {
|
397 |
+
cursor: not-allowed;
|
398 |
+
background-color: #eee;
|
399 |
+
}
|
400 |
+
.cols input[type="checkbox"] {
|
401 |
+
width: 20px;
|
402 |
+
line-height: 18px;
|
403 |
+
height: 20px;
|
404 |
+
vertical-align: middle;
|
405 |
+
}
|
406 |
+
.cols select {
|
407 |
+
line-height: 18px;
|
408 |
+
height: 24px;
|
409 |
+
}
|
410 |
+
#fieldlist {
|
411 |
+
position: absolute;
|
412 |
+
width:225px;
|
413 |
+
background: #fff;
|
414 |
+
border: solid 1px #c7c7c7;
|
415 |
+
top: 0;
|
416 |
+
left: 0;
|
417 |
+
z-index: 1000;
|
418 |
+
}
|
419 |
+
#fieldlist a {
|
420 |
+
padding: 5px;
|
421 |
+
cursor:pointer;
|
422 |
+
overflow: hidden;
|
423 |
+
white-space: nowrap;
|
424 |
+
text-overflow: ellipsis;
|
425 |
+
}
|
426 |
+
#fieldlist a:hover {
|
427 |
+
background: #ccc;
|
428 |
+
}
|
429 |
+
.gen_query, .gen_query:focus {
|
430 |
+
width: 200px;
|
431 |
+
height: 38px;
|
432 |
+
background: #0E73D4;
|
433 |
+
color: white;
|
434 |
+
cursor: pointer;
|
435 |
+
border: 0px;
|
436 |
+
font-size: 16px;
|
437 |
+
font-weight: bold;
|
438 |
+
margin: 20px;
|
439 |
+
}
|
440 |
+
.gen_query:active {
|
441 |
+
background: #ccc;
|
442 |
+
}
|
443 |
+
</style>
|
444 |
+
|
445 |
+
<div class="c1">
|
446 |
+
<div class="main_func">
|
447 |
+
<table class="admintable">
|
448 |
+
<tr valign="top">
|
449 |
+
<td class="key">
|
450 |
+
<label title="asf">Connection type: </label>
|
451 |
+
</td>
|
452 |
+
<td >
|
453 |
+
<input type="radio" name="con_type" id="local" value="local" <?php if($con_type=='local') echo 'checked="checked"'?> disabled>
|
454 |
+
<label for="local">Local</label>
|
455 |
+
<input type="radio" name="con_type" id="remote" value="remote" <?php if($con_type=='remote') echo 'checked="checked"'?> disabled>
|
456 |
+
<label for="remote">Remote</label>
|
457 |
+
</td>
|
458 |
+
</tr>
|
459 |
+
<tr class="remote_info" <?php if($con_type=='local') echo 'style="display:none"'?>>
|
460 |
+
<td class="key">Host</td>
|
461 |
+
<td>
|
462 |
+
<input type="text" name="host" id="host_rem" style="width:180px" value="<?php echo $host; ?>" disabled>
|
463 |
+
Port : <input type="text" name="port" id="port_rem" value="<?php echo $port; ?>" style="width:50px" disabled>
|
464 |
+
</td>
|
465 |
+
</tr>
|
466 |
+
<tr class="remote_info" <?php if($con_type=='local') echo 'style="display:none"'?>>
|
467 |
+
<td class="key">Username</td>
|
468 |
+
<td>
|
469 |
+
<input type="text" name="username" id="username_rem" style="width:272px" value="<?php echo $username; ?>" disabled>
|
470 |
+
</td>
|
471 |
+
</tr>
|
472 |
+
<tr class="remote_info" <?php if($con_type=='local') echo 'style="display:none"'?>>
|
473 |
+
<td class="key">Password</td>
|
474 |
+
<td>
|
475 |
+
<input type="password" name="password" id="password_rem" style="width:272px" value="<?php echo $password; ?>" disabled>
|
476 |
+
</td>
|
477 |
+
</tr>
|
478 |
+
<tr class="remote_info" <?php if($con_type=='local') echo 'style="display:none"'?>>
|
479 |
+
<td class="key">Database</td>
|
480 |
+
<td>
|
481 |
+
<input type="text"name="database" id="database_rem" style="width:272px" value="<?php echo $database; ?>" disabled>
|
482 |
+
</td>
|
483 |
+
</tr>
|
484 |
+
<tr valign="top">
|
485 |
+
<td class="key">
|
486 |
+
<label>Method: </label>
|
487 |
+
</td>
|
488 |
+
<td >
|
489 |
+
<input type="radio" name="con_method" id="insert" value="insert" <?php if($con_method=='insert') echo 'checked="checked"'?> disabled>
|
490 |
+
<label for="insert">Insert</label>
|
491 |
+
<input type="radio" name="con_method" id="update" value="update" <?php if($con_method=='update') echo 'checked="checked"'?> disabled>
|
492 |
+
<label for="update">Update</label>
|
493 |
+
<input type="radio" name="con_method" id="delete" value="delete" <?php if($con_method=='delete') echo 'checked="checked"'?> disabled>
|
494 |
+
<label for="delete">Delete</label>
|
495 |
+
</td>
|
496 |
+
</tr>
|
497 |
+
<tr valign="top">
|
498 |
+
<td class="key">
|
499 |
+
</td>
|
500 |
+
<td >
|
501 |
+
<input type="button" value="Connect" onclick="connect()" disabled>
|
502 |
+
</td>
|
503 |
+
</tr>
|
504 |
+
</table>
|
505 |
+
<div id="struct">
|
506 |
+
<label for="tables" style="display:inline-block;width:157px;font-weight: bold;">Select a table</label>
|
507 |
+
<select name="tables" id="tables" disabled>
|
508 |
+
<option value="" ></option>
|
509 |
+
<?php
|
510 |
+
|
511 |
+
foreach($tables as $table)
|
512 |
+
echo '<option value="'.$table.'" '.($table_cur==$table ? 'selected' : '').' >'.$table.'</option>';
|
513 |
+
?>
|
514 |
+
</select>
|
515 |
+
<br/><br/>
|
516 |
+
|
517 |
+
|
518 |
+
<div id="table_struct">
|
519 |
+
|
520 |
+
<?php
|
521 |
+
if($table_struct)
|
522 |
+
{
|
523 |
+
?>
|
524 |
+
|
525 |
+
<div class="cols">
|
526 |
+
<?php
|
527 |
+
|
528 |
+
$temps=explode('***wdffieldwdf***',$details);
|
529 |
+
$wheres = $temps[count($temps)-1];
|
530 |
+
$temps = array_slice($temps,0, count($temps)-1);
|
531 |
+
$col_names= array();
|
532 |
+
$col_vals= array();
|
533 |
+
$col_checks= array();
|
534 |
+
|
535 |
+
foreach($temps as $temp)
|
536 |
+
{
|
537 |
+
$temp=explode('***wdfnamewdf***',$temp);
|
538 |
+
array_push($col_names, $temp[0]);
|
539 |
+
$temp=explode('***wdfvaluewdf***',$temp[1]);
|
540 |
+
array_push($col_vals, $temp[0]);
|
541 |
+
array_push($col_checks, $temp[1]);
|
542 |
+
}
|
543 |
+
if($con_method=='insert' or $con_method=='update')
|
544 |
+
{
|
545 |
+
echo '<div style="background: none;text-align: center;font-size: 20px;color: rgb(0, 164, 228);font-weight: bold;"> SET </div>';
|
546 |
+
|
547 |
+
foreach($table_struct as $key =>$col)
|
548 |
+
{
|
549 |
+
|
550 |
+
$title=' '.$col->Field;
|
551 |
+
$title.="<ul style='padding-left: 17px;'>";
|
552 |
+
$title.="<li>Type - ".$col->Type."</li>";
|
553 |
+
$title.="<li>Null - ".$col->Null."</li>";
|
554 |
+
$title.="<li>Key - ".$col->Key."</li>";
|
555 |
+
$title.="<li>Default - ".$col->Default."</li>";
|
556 |
+
$title.="<li>Extra - ".$col->Extra."</li>";
|
557 |
+
$title.="</ul>";
|
558 |
+
|
559 |
+
?>
|
560 |
+
<div><label title="<?php echo $title; ?>" class="hasTip"><b><?php echo $col->Field; ?></b><img src="<?php echo WD_FM_URL . '/images/info.png'; ?>" style="width:20px; vertical-align:middle;padding-left: 10px;" /></label><input type="text" id="<?php echo $col->Field; ?>" <?php if(!$col_checks[$key]) echo 'disabled="disabled"'?> value="<?php echo $col_vals[$key]; ?>" /><input id="ch_<?php echo $col->Field; ?>" type="checkbox" onClick="dis('<?php echo $col->Field; ?>', this.checked)" <?php if($col_checks[$key]) echo 'checked="checked"'?> /></div>
|
561 |
+
<?php
|
562 |
+
}
|
563 |
+
}
|
564 |
+
|
565 |
+
if($con_method=='delete' or $con_method=='update')
|
566 |
+
{
|
567 |
+
echo '<div style="background: none;text-align: center;font-size: 20px;color: rgb(0, 164, 228);font-weight: bold;"> WHERE </div>
|
568 |
+
<img src="' . WD_FM_URL . '/images/add_condition.png" title="ADD" class="add_cond"/></br>';
|
569 |
+
|
570 |
+
if($wheres)
|
571 |
+
{
|
572 |
+
echo '<script>';
|
573 |
+
|
574 |
+
$wheres =explode('***where***',$wheres);
|
575 |
+
$wheres = array_slice($wheres,0, count($wheres)-1);
|
576 |
+
foreach($wheres as $where)
|
577 |
+
{
|
578 |
+
$temp=explode('***sel***',$where);
|
579 |
+
$sel = $temp[0];
|
580 |
+
$temp=explode('***op***',$temp[1]);
|
581 |
+
$op = $temp[0];
|
582 |
+
$temp=explode('***val***',$temp[1]);
|
583 |
+
$val = $temp[0];
|
584 |
+
$andor = $temp[1];
|
585 |
+
echo 'jQuery(".cols").append(conds.replace(/condid/g, cond_id++)); update_vis();
|
586 |
+
jQuery("#sel_"+(cond_id-1)).val("'.$sel.'");
|
587 |
+
jQuery("#op_"+(cond_id-1)).val("'.$op.'");
|
588 |
+
jQuery("#val_"+(cond_id-1)).val("'.$val.'");
|
589 |
+
jQuery("#andor_"+(cond_id-1)).val("'.$andor.'");
|
590 |
+
';
|
591 |
+
|
592 |
+
}
|
593 |
+
echo '</script>';
|
594 |
+
|
595 |
+
}
|
596 |
+
|
597 |
+
|
598 |
+
}
|
599 |
+
?>
|
600 |
+
<div style="color:red; background: none">The changes above will not affect the query until you click "Generate query".</div>
|
601 |
+
</div>
|
602 |
+
<br/>
|
603 |
+
<input type="button" value="Generate Query" class="gen_query" onclick="gen_query()">
|
604 |
+
<br/>
|
605 |
+
<form name="query_form" id="query_form" >
|
606 |
+
<label style="vertical-align: top;" for="query_txt" > Query: </label><textarea id="query_txt" name="query" rows=5 style="width:428px" ><?php echo $query_obj->query; ?></textarea>
|
607 |
+
<input type="hidden" name="details" id="details">
|
608 |
+
<input type="hidden" name="id" value="<?php echo $query_obj->id; ?>">
|
609 |
+
</form>
|
610 |
+
<input type="button" value="Save" style="float: right;width: 200px;height: 38px;background: #0E73D4;color: white;cursor: pointer;border: 0px;font-size: 16px;font-weight: bold;margin: 20px;" onclick="save_query()">
|
611 |
+
|
612 |
+
|
613 |
+
<div id="fieldlist" style="display: none;">
|
614 |
+
<?php echo $form_fields ?>
|
615 |
+
</div>
|
616 |
+
|
617 |
+
|
618 |
+
<?php
|
619 |
+
}
|
620 |
+
?>
|
621 |
+
</div>
|
622 |
+
</div>
|
623 |
+
<input type="hidden" value="<?php echo $form_id ?>" id="form_id">
|
624 |
+
|
625 |
+
</div>
|
626 |
+
|
627 |
+
<div class="desc">
|
628 |
+
<?php
|
629 |
+
foreach($label_id as $key => $lid)
|
630 |
+
{
|
631 |
+
echo '<div>{'.$lid.'} - <button onclick="insert_field('.$lid.');">'.$label_order_original[$key].'</button></div>';
|
632 |
+
|
633 |
+
}
|
634 |
+
|
635 |
+
?>
|
636 |
+
</div>
|
637 |
+
</div>
|
638 |
+
<?php
|
639 |
+
die();
|
640 |
+
}
|
641 |
+
|
642 |
+
public function add_query($form_id){
|
643 |
+
wp_print_scripts('jquery');
|
644 |
+
wp_print_scripts('jquery-ui-tooltip');
|
645 |
+
?>
|
646 |
+
<link media="all" type="text/css" href="<?php echo WD_FM_URL . '/css/style.css'; ?>" rel="stylesheet">
|
647 |
+
<link rel="stylesheet" href="<?php echo WD_FM_URL . '/css/jquery-ui-1.10.3.custom.css'; ?>">
|
648 |
+
<?php
|
649 |
+
$label = $this->model->get_labels($form_id);
|
650 |
+
|
651 |
+
$filter_types=array("type_submit_reset", "type_map", "type_editor", "type_captcha", "type_recaptcha", "type_button", "type_paypal_total", "type_send_copy");
|
652 |
+
$label_id= array();
|
653 |
+
$label_order= array();
|
654 |
+
$label_order_original= array();
|
655 |
+
$label_type= array();
|
656 |
+
|
657 |
+
///stexic
|
658 |
+
$label_all = explode('#****#',$label);
|
659 |
+
$label_all = array_slice($label_all,0, count($label_all)-1);
|
660 |
+
|
661 |
+
foreach($label_all as $key => $label_each) {
|
662 |
+
$label_id_each=explode('#**id**#',$label_each);
|
663 |
+
$label_oder_each=explode('#**label**#', $label_id_each[1]);
|
664 |
+
|
665 |
+
if(in_array($label_oder_each[1],$filter_types))
|
666 |
+
continue;
|
667 |
+
|
668 |
+
array_push($label_id, $label_id_each[0]);
|
669 |
+
|
670 |
+
|
671 |
+
array_push($label_order_original, $label_oder_each[0]);
|
672 |
+
|
673 |
+
$ptn = "/[^a-zA-Z0-9_]/";
|
674 |
+
$rpltxt = "";
|
675 |
+
$label_temp=preg_replace($ptn, $rpltxt, $label_oder_each[0]);
|
676 |
+
array_push($label_order, $label_temp);
|
677 |
+
|
678 |
+
array_push($label_type, $label_oder_each[1]);
|
679 |
+
}
|
680 |
+
?>
|
681 |
+
<script>
|
682 |
+
function insert_field(){}
|
683 |
+
|
684 |
+
function connect() {
|
685 |
+
jQuery("input[type='radio']").attr('disabled','');
|
686 |
+
jQuery(".connect").attr('disabled','');
|
687 |
+
jQuery('#struct').html('<div id="saving"><div id="saving_text">Loading</div><div id="fadingBarsG"><div id="fadingBarsG_1" class="fadingBarsG"></div><div id="fadingBarsG_2" class="fadingBarsG"></div><div id="fadingBarsG_3" class="fadingBarsG"></div><div id="fadingBarsG_4" class="fadingBarsG"></div><div id="fadingBarsG_5" class="fadingBarsG"></div><div id="fadingBarsG_6" class="fadingBarsG"></div><div id="fadingBarsG_7" class="fadingBarsG"></div><div id="fadingBarsG_8" class="fadingBarsG"></div></div></div>');
|
688 |
+
jQuery.ajax({
|
689 |
+
type: "POST",
|
690 |
+
url: "<?php echo add_query_arg(array('action' => 'FormMakerSQLMapping', 'id' => 0, 'form_id' => $form_id, 'task' => 'db_tables', 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>",
|
691 |
+
data: 'con_type='+jQuery('input[name=con_type]:checked').val()+'&con_method='+jQuery('input[name=con_method]:checked').val()+'&host='+jQuery('#host_rem').val()+'&port='+jQuery('#port_rem').val()+'&username='+jQuery('#username_rem').val()+'&password='+jQuery('#password_rem').val()+'&database='+jQuery('#database_rem').val()+'&format=row',
|
692 |
+
success: function(data) {
|
693 |
+
if(data==1) {
|
694 |
+
jQuery("#struct").html('<div style="font-size: 22px; text-align: center; padding-top: 15px;">Could not connect to MySQL.</div>')
|
695 |
+
jQuery(".connect").removeAttr('disabled');
|
696 |
+
jQuery("input[type='radio']").removeAttr('disabled','');
|
697 |
+
}
|
698 |
+
else {
|
699 |
+
jQuery("#struct").html(data);
|
700 |
+
}
|
701 |
+
}
|
702 |
+
});
|
703 |
+
}
|
704 |
+
|
705 |
+
function shh(x) {
|
706 |
+
if(x)
|
707 |
+
jQuery(".remote_info").show();
|
708 |
+
else
|
709 |
+
jQuery(".remote_info").hide();
|
710 |
+
}
|
711 |
+
|
712 |
+
</script>
|
713 |
+
<style>
|
714 |
+
.main_func {
|
715 |
+
font-size: 12px;
|
716 |
+
display:inline-block;
|
717 |
+
width:480px;
|
718 |
+
vertical-align:top;
|
719 |
+
}
|
720 |
+
|
721 |
+
.desc {
|
722 |
+
font-size: 12px;
|
723 |
+
display:inline-block;
|
724 |
+
width:250px;
|
725 |
+
position:fixed;
|
726 |
+
margin:15px;
|
727 |
+
margin-left:55px;
|
728 |
+
}
|
729 |
+
|
730 |
+
.desc button {
|
731 |
+
max-width: 200px;
|
732 |
+
overflow: hidden;
|
733 |
+
white-space: nowrap;
|
734 |
+
text-overflow: ellipsis;
|
735 |
+
}
|
736 |
+
|
737 |
+
.key label {
|
738 |
+
display:inline-block;
|
739 |
+
width:150px;
|
740 |
+
}
|
741 |
+
</style>
|
742 |
+
|
743 |
+
<div class="c1">
|
744 |
+
<div class="main_func">
|
745 |
+
<table class="admintable">
|
746 |
+
<tr valign="top">
|
747 |
+
<td class="key">
|
748 |
+
<label title="asf">Connection type: </label>
|
749 |
+
</td>
|
750 |
+
<td >
|
751 |
+
<input type="radio" name="con_type" id="local" value="local" checked="checked" onclick="shh(false)">
|
752 |
+
<label for="local">Local</label>
|
753 |
+
<input type="radio" name="con_type" id="remote" value="remote" onclick="shh(true)">
|
754 |
+
<label for="remote">Remote</label>
|
755 |
+
</td>
|
756 |
+
</tr>
|
757 |
+
<tr class="remote_info" style="display:none">
|
758 |
+
<td class="key">Host</td>
|
759 |
+
<td>
|
760 |
+
<input type="text" name="host" id="host_rem" style="width:180px">
|
761 |
+
Port : <input type="text" name="port" id="port_rem" value="3306" style="width:50px">
|
762 |
+
</td>
|
763 |
+
</tr>
|
764 |
+
<tr class="remote_info" style="display:none">
|
765 |
+
<td class="key">Username</td>
|
766 |
+
<td>
|
767 |
+
<input type="text" name="username" id="username_rem" style="width:272px">
|
768 |
+
</td>
|
769 |
+
</tr>
|
770 |
+
<tr class="remote_info" style="display:none">
|
771 |
+
<td class="key">Password</td>
|
772 |
+
<td>
|
773 |
+
<input type="password" name="password" id="password_rem" style="width:272px">
|
774 |
+
</td>
|
775 |
+
</tr>
|
776 |
+
<tr class="remote_info" style="display:none">
|
777 |
+
<td class="key">Database</td>
|
778 |
+
<td>
|
779 |
+
<input type="text"name="database" id="database_rem" style="width:272px">
|
780 |
+
</td>
|
781 |
+
</tr>
|
782 |
+
<tr valign="top">
|
783 |
+
<td class="key">
|
784 |
+
<label>Method: </label>
|
785 |
+
</td>
|
786 |
+
<td >
|
787 |
+
<input type="radio" name="con_method" id="insert" value="insert" checked="checked">
|
788 |
+
<label for="insert">Insert</label>
|
789 |
+
<input type="radio" name="con_method" id="update" value="update">
|
790 |
+
<label for="update">Update</label>
|
791 |
+
<input type="radio" name="con_method" id="delete" value="delete">
|
792 |
+
<label for="delete">Delete</label>
|
793 |
+
</td>
|
794 |
+
</tr>
|
795 |
+
<tr valign="top">
|
796 |
+
<td class="key">
|
797 |
+
</td>
|
798 |
+
<td >
|
799 |
+
<input type="button" value="Connect" onclick="connect()" class="connect">
|
800 |
+
</td>
|
801 |
+
</tr>
|
802 |
+
</table>
|
803 |
+
<div id="struct">
|
804 |
+
</div>
|
805 |
+
<input type="hidden" value="<?php echo $form_id ?>" id="form_id">
|
806 |
+
</div>
|
807 |
+
<div class="desc">
|
808 |
+
<?php
|
809 |
+
foreach($label_id as $key => $lid) {
|
810 |
+
echo '<div>{'.$lid.'} - <button onclick="insert_field('.$lid.');">'.$label_order_original[$key].'</button></div>';
|
811 |
+
}
|
812 |
+
?>
|
813 |
+
</div>
|
814 |
+
</div>
|
815 |
+
<?php
|
816 |
+
die();
|
817 |
+
}
|
818 |
+
|
819 |
+
public function db_tables($form_id){
|
820 |
+
$tables = $this->model->get_tables();
|
821 |
+
?>
|
822 |
+
<label for="tables" style="display:inline-block;width:157px;font-weight: bold;">Select a table</label>
|
823 |
+
<select name="tables" id="tables">
|
824 |
+
<option value="" ></option>
|
825 |
+
<?php
|
826 |
+
foreach($tables as $table) {
|
827 |
+
echo '<option value="' . $table . '" >' . $table . '</option>';
|
828 |
+
}
|
829 |
+
?>
|
830 |
+
</select>
|
831 |
+
<br/><br/>
|
832 |
+
<div id="table_struct">
|
833 |
+
</div>
|
834 |
+
<script>
|
835 |
+
jQuery("#tables").change(function (){
|
836 |
+
jQuery('#table_struct').html('<div id="saving"><div id="saving_text">Loading</div><div id="fadingBarsG"><div id="fadingBarsG_1" class="fadingBarsG"></div><div id="fadingBarsG_2" class="fadingBarsG"></div><div id="fadingBarsG_3" class="fadingBarsG"></div><div id="fadingBarsG_4" class="fadingBarsG"></div><div id="fadingBarsG_5" class="fadingBarsG"></div><div id="fadingBarsG_6" class="fadingBarsG"></div><div id="fadingBarsG_7" class="fadingBarsG"></div><div id="fadingBarsG_8" class="fadingBarsG"></div></div></div>');
|
837 |
+
|
838 |
+
jQuery.ajax({
|
839 |
+
type: "POST",
|
840 |
+
url: "<?php echo add_query_arg(array('action' => 'FormMakerSQLMapping', 'id' => 0, 'form_id' => $form_id, 'task' => 'db_table_struct', 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>",
|
841 |
+
data: 'name='+jQuery(this).val()+'&con_type='+jQuery('input[name=con_type]:checked').val()+'&con_method='+jQuery('input[name=con_method]:checked').val()+'&host='+jQuery('#host_rem').val()+'&port='+jQuery('#port_rem').val()+'&username='+jQuery('#username_rem').val()+'&password='+jQuery('#password_rem').val()+'&database='+jQuery('#database_rem').val()+'&format=row',
|
842 |
+
success: function(data) {
|
843 |
+
jQuery("#table_struct").html(data);
|
844 |
+
}
|
845 |
+
});
|
846 |
+
})
|
847 |
+
</script>
|
848 |
+
<?php
|
849 |
+
die();
|
850 |
+
}
|
851 |
+
|
852 |
+
public function db_table_struct ($form_id) {
|
853 |
+
$table_struct = $this->model->get_table_struct();
|
854 |
+
$label = $this->model->get_labels($form_id);
|
855 |
+
$con_method = isset($_POST['con_method']) ? $_POST['con_method'] : '';
|
856 |
+
$filter_types=array("type_submit_reset", "type_map", "type_editor", "type_captcha", "type_recaptcha", "type_button", "type_paypal_total", "type_send_copy");
|
857 |
+
$label_id= array();
|
858 |
+
$label_order= array();
|
859 |
+
$label_order_original= array();
|
860 |
+
$label_type= array();
|
861 |
+
|
862 |
+
///stexic
|
863 |
+
$label_all = explode('#****#',$label);
|
864 |
+
$label_all = array_slice($label_all,0, count($label_all)-1);
|
865 |
+
|
866 |
+
foreach($label_all as $key => $label_each) {
|
867 |
+
$label_id_each=explode('#**id**#',$label_each);
|
868 |
+
$label_oder_each=explode('#**label**#', $label_id_each[1]);
|
869 |
+
|
870 |
+
if(in_array($label_oder_each[1],$filter_types)) {
|
871 |
+
continue;
|
872 |
+
}
|
873 |
+
array_push($label_id, $label_id_each[0]);
|
874 |
+
array_push($label_order_original, $label_oder_each[0]);
|
875 |
+
$ptn = "/[^a-zA-Z0-9_]/";
|
876 |
+
$rpltxt = "";
|
877 |
+
$label_temp=preg_replace($ptn, $rpltxt, $label_oder_each[0]);
|
878 |
+
array_push($label_order, $label_temp);
|
879 |
+
array_push($label_type, $label_oder_each[1]);
|
880 |
+
}
|
881 |
+
$form_fields='';
|
882 |
+
foreach($label_id as $key => $id) {
|
883 |
+
$form_fields.='<a onclick="insert_field('.$id.'); jQuery(\'#fieldlist\').hide();" style="display:block; text-decoration:none;">'.$label_order_original[$key].'</a>';
|
884 |
+
}
|
885 |
+
$cond='<div id="condid"><select id="sel_condid" style="width: 110px">';
|
886 |
+
foreach($table_struct as $col) {
|
887 |
+
$cond.='<option>'.$col->Field.'</option>';
|
888 |
+
}
|
889 |
+
$cond.='</select>';
|
890 |
+
|
891 |
+
$cond.='<select id="op_condid"><option value="=" selected="selected">=</option><option value="!=">!=</option><option value=">">></option><option value="<"><</option><option value=">=">>=</option><option value="<="><=</option><option value="%..%">Like</option><option value="%..">Starts with</option><option value="..%">Ends with</option></select><input id="val_condid" style="width:120px" type="text" /><select id="andor_condid" style="visibility: hidden;"><option value="AND">AND</option><option value="OR">OR</option></select><img src="' . WD_FM_URL . '/images/delete.png" onclick="delete_cond("condid")" style="vertical-align: middle;"></div>';
|
892 |
+
?>
|
893 |
+
<script>
|
894 |
+
var selected_field ='';
|
895 |
+
var isvisible = 1;
|
896 |
+
var cond_id = 1;
|
897 |
+
//onclick="gen_query()"
|
898 |
+
conds='<?php echo $cond ?>';
|
899 |
+
fields=new Array(<?php
|
900 |
+
$fields = "";
|
901 |
+
if($table_struct) {
|
902 |
+
foreach($table_struct as $col) {
|
903 |
+
$fields.=' "'.$col->Field.'",';
|
904 |
+
}
|
905 |
+
echo substr($fields, 0, -1);
|
906 |
+
}
|
907 |
+
?>);
|
908 |
+
function dis(id, x) {
|
909 |
+
if(x)
|
910 |
+
jQuery('#'+id).removeAttr('disabled');
|
911 |
+
else
|
912 |
+
jQuery('#'+id).attr('disabled','disabled');
|
913 |
+
}
|
914 |
+
|
915 |
+
function update_vis() {
|
916 |
+
previous=0;
|
917 |
+
for(i=1; i<cond_id; i++) {
|
918 |
+
if(jQuery('#'+i).html()) {
|
919 |
+
jQuery('#andor_'+i).css('visibility', 'hidden');
|
920 |
+
if(previous) {
|
921 |
+
jQuery('#andor_'+previous).css('visibility', 'visible');
|
922 |
+
}
|
923 |
+
previous=i;
|
924 |
+
}
|
925 |
+
}
|
926 |
+
}
|
927 |
+
|
928 |
+
function delete_cond(id) {
|
929 |
+
jQuery('#'+id).remove();
|
930 |
+
update_vis();
|
931 |
+
}
|
932 |
+
|
933 |
+
jQuery('.add_cond').click( function() {
|
934 |
+
jQuery('.cols').append(conds.replace(/condid/g, cond_id++));
|
935 |
+
update_vis();
|
936 |
+
}
|
937 |
+
);
|
938 |
+
|
939 |
+
jQuery('html').click(function() {
|
940 |
+
if(jQuery("#fieldlist").css('display')=="block") {
|
941 |
+
jQuery("#fieldlist").hide();
|
942 |
+
}
|
943 |
+
});
|
944 |
+
|
945 |
+
jQuery('.cols input[type="text"]').live('click', function() {
|
946 |
+
event.stopPropagation();
|
947 |
+
jQuery("#fieldlist").css("top",jQuery(this).offset().top+jQuery(this).height()+2);
|
948 |
+
jQuery("#fieldlist").css("left",jQuery(this).offset().left);
|
949 |
+
jQuery("#fieldlist").slideDown('fast');
|
950 |
+
selected_field=this.id;
|
951 |
+
});
|
952 |
+
|
953 |
+
jQuery('#query_txt').click(function() {
|
954 |
+
event.stopPropagation();
|
955 |
+
jQuery("#fieldlist").css("top",jQuery(this).offset().top+jQuery(this).height()+2);
|
956 |
+
jQuery("#fieldlist").css("left",jQuery(this).offset().left);
|
957 |
+
jQuery("#fieldlist").slideDown('fast');
|
958 |
+
selected_field=this.id;
|
959 |
+
});
|
960 |
+
|
961 |
+
jQuery('#fieldlist').click(function(event){
|
962 |
+
event.stopPropagation();
|
963 |
+
});
|
964 |
+
|
965 |
+
function save_query() {
|
966 |
+
con_type =jQuery('input[name=con_type]:checked').val();
|
967 |
+
con_method =jQuery('input[name=con_method]:checked').val();
|
968 |
+
table =jQuery('#tables').val();
|
969 |
+
table =jQuery('#tables').val();
|
970 |
+
host =jQuery('#host_rem').val();
|
971 |
+
port =jQuery('#port_rem').val();
|
972 |
+
username =jQuery('#username_rem').val();
|
973 |
+
password =jQuery('#password_rem').val();
|
974 |
+
database =jQuery('#database_rem').val();
|
975 |
+
|
976 |
+
str=con_type+"***wdfcon_typewdf***"+con_method+"***wdfcon_methodwdf***"+table+"***wdftablewdf***"+host+"***wdfhostwdf***"+port+"***wdfportwdf***"+username+"***wdfusernamewdf***"+password+"***wdfpasswordwdf***"+database+"***wdfdatabasewdf***";
|
977 |
+
|
978 |
+
if(fields.length) {
|
979 |
+
for(i=0; i<fields.length; i++) {
|
980 |
+
str+=fields[i]+'***wdfnamewdf***'+jQuery('#'+fields[i]).val()+'***wdfvaluewdf***'+jQuery('#ch_'+fields[i]+":checked" ).length+'***wdffieldwdf***';
|
981 |
+
}
|
982 |
+
}
|
983 |
+
|
984 |
+
for(i=1; i<cond_id; i++) {
|
985 |
+
if(jQuery('#'+i).html()) {
|
986 |
+
str+=jQuery('#sel_'+i).val()+'***sel***'+jQuery('#op_'+i).val()+'***op***'+jQuery('#val_'+i).val()+'***val***'+jQuery('#andor_'+i).val()+'***where***';
|
987 |
+
}
|
988 |
+
}
|
989 |
+
|
990 |
+
if(!jQuery('#query_txt').val()) {
|
991 |
+
gen_query();
|
992 |
+
}
|
993 |
+
|
994 |
+
jQuery('#details').val(str);
|
995 |
+
|
996 |
+
var datatxt = jQuery("#query_form").serialize()+'&form_id='+jQuery("#form_id").val();
|
997 |
+
if(jQuery('#query_txt').val()) {
|
998 |
+
jQuery('.c1').html('<div id="saving"><div id="saving_text">Saving</div><div id="fadingBarsG"><div id="fadingBarsG_1" class="fadingBarsG"></div><div id="fadingBarsG_2" class="fadingBarsG"></div><div id="fadingBarsG_3" class="fadingBarsG"></div><div id="fadingBarsG_4" class="fadingBarsG"></div><div id="fadingBarsG_5" class="fadingBarsG"></div><div id="fadingBarsG_6" class="fadingBarsG"></div><div id="fadingBarsG_7" class="fadingBarsG"></div><div id="fadingBarsG_8" class="fadingBarsG"></div></div></div>');
|
999 |
+
jQuery.ajax({
|
1000 |
+
type: "POST",
|
1001 |
+
url: "<?php echo add_query_arg(array('action' => 'FormMakerSQLMapping', 'id' => 0, 'form_id' => $form_id, 'task' => 'save_query', 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>",
|
1002 |
+
data: datatxt,
|
1003 |
+
success: function(data) {
|
1004 |
+
window.parent.wd_fm_apply_options();
|
1005 |
+
window.parent.tb_remove();
|
1006 |
+
}
|
1007 |
+
});
|
1008 |
+
}
|
1009 |
+
else {
|
1010 |
+
alert('The query is empty.');
|
1011 |
+
}
|
1012 |
+
return false;
|
1013 |
+
}
|
1014 |
+
|
1015 |
+
function gen_query() {
|
1016 |
+
if(jQuery('#query_txt').val()) {
|
1017 |
+
if(!confirm('Are you sure you want to replace the Query? All the modifications to the Query will be lost.')) {
|
1018 |
+
return;
|
1019 |
+
}
|
1020 |
+
}
|
1021 |
+
query="";
|
1022 |
+
fields=new Array(<?php
|
1023 |
+
$fields = "";
|
1024 |
+
if($table_struct) {
|
1025 |
+
foreach($table_struct as $col) {
|
1026 |
+
$fields.=' "'.$col->Field.'",';
|
1027 |
+
}
|
1028 |
+
echo substr($fields, 0, -1);
|
1029 |
+
}
|
1030 |
+
?>);
|
1031 |
+
|
1032 |
+
con_type =jQuery('input[name=con_type]:checked').val();
|
1033 |
+
con_method =jQuery('input[name=con_method]:checked').val();
|
1034 |
+
table =jQuery('#tables').val();
|
1035 |
+
fls='';
|
1036 |
+
vals='';
|
1037 |
+
valsA=new Array();
|
1038 |
+
flsA=new Array();
|
1039 |
+
|
1040 |
+
if(fields.length) {
|
1041 |
+
for(i=0; i<fields.length; i++) {
|
1042 |
+
if(jQuery('#ch_'+fields[i]+":checked" ).length) {
|
1043 |
+
flsA.push(fields[i]);
|
1044 |
+
valsA.push(jQuery('#'+fields[i]).val());
|
1045 |
+
}
|
1046 |
+
}
|
1047 |
+
}
|
1048 |
+
|
1049 |
+
if(con_method=="insert") {
|
1050 |
+
if(flsA.length) {
|
1051 |
+
for(i=0; i<flsA.length-1; i++) {
|
1052 |
+
fls+= '`'+flsA[i]+'`, ';
|
1053 |
+
vals+= '"'+valsA[i]+'", ';
|
1054 |
+
}
|
1055 |
+
fls+= '`'+flsA[i]+'`';
|
1056 |
+
vals+= '"'+valsA[i]+'"';
|
1057 |
+
}
|
1058 |
+
if(fls) {
|
1059 |
+
query="INSERT INTO "+jQuery('#tables').val()+" (" +fls+") VALUES ("+vals+")";
|
1060 |
+
}
|
1061 |
+
}
|
1062 |
+
|
1063 |
+
if(con_method=="update") {
|
1064 |
+
if(flsA.length) {
|
1065 |
+
for(i=0; i<flsA.length-1; i++) {
|
1066 |
+
vals+= '`'+flsA[i]+'`="'+valsA[i]+'", ';
|
1067 |
+
}
|
1068 |
+
vals+= '`'+flsA[i]+'`="'+valsA[i]+'"';
|
1069 |
+
}
|
1070 |
+
where="";
|
1071 |
+
previous='';
|
1072 |
+
for(i=1; i<cond_id; i++) {
|
1073 |
+
if(jQuery('#'+i).html()) {
|
1074 |
+
if(jQuery('#op_'+i).val()=="%..%")
|
1075 |
+
op_val=' LIKE "%'+jQuery('#val_'+i).val()+'%"';
|
1076 |
+
else if(jQuery('#op_'+i).val()=="%..")
|
1077 |
+
op_val=' LIKE "%'+jQuery('#val_'+i).val()+'"';
|
1078 |
+
else if(jQuery('#op_'+i).val()=="..%")
|
1079 |
+
op_val=' LIKE "'+jQuery('#val_'+i).val()+'%"';
|
1080 |
+
else
|
1081 |
+
op_val=' '+jQuery('#op_'+i).val()+' "'+jQuery('#val_'+i).val()+'"';
|
1082 |
+
where+=previous+' `'+jQuery('#sel_'+i).val()+'`'+op_val;
|
1083 |
+
previous=' '+ jQuery('#andor_'+i).val();
|
1084 |
+
}
|
1085 |
+
}
|
1086 |
+
if(vals) {
|
1087 |
+
query="UPDATE "+jQuery('#tables').val()+" SET " + vals+(where? ' WHERE'+where: '') ;
|
1088 |
+
}
|
1089 |
+
}
|
1090 |
+
|
1091 |
+
if(con_method=="delete") {
|
1092 |
+
where="";
|
1093 |
+
previous='';
|
1094 |
+
for(i=1; i<cond_id; i++) {
|
1095 |
+
if(jQuery('#'+i).html()) {
|
1096 |
+
if(jQuery('#op_'+i).val()=="%..%")
|
1097 |
+
op_val=' LIKE "%'+jQuery('#val_'+i).val()+'%"';
|
1098 |
+
|
1099 |
+
else if(jQuery('#op_'+i).val()=="%..")
|
1100 |
+
op_val=' LIKE "%'+jQuery('#val_'+i).val()+'"';
|
1101 |
+
|
1102 |
+
else if(jQuery('#op_'+i).val()=="..%")
|
1103 |
+
op_val=' LIKE "'+jQuery('#val_'+i).val()+'%"';
|
1104 |
+
|
1105 |
+
else
|
1106 |
+
op_val=' '+jQuery('#op_'+i).val()+' "'+jQuery('#val_'+i).val()+'"';
|
1107 |
+
where+=previous+' '+jQuery('#sel_'+i).val()+op_val;
|
1108 |
+
previous=' '+ jQuery('#andor_'+i).val();
|
1109 |
+
}
|
1110 |
+
}
|
1111 |
+
if(where) {
|
1112 |
+
query="DELETE FROM "+jQuery('#tables').val()+ ' WHERE'+where ;
|
1113 |
+
}
|
1114 |
+
}
|
1115 |
+
jQuery('#query_txt').val(query);
|
1116 |
+
}
|
1117 |
+
|
1118 |
+
jQuery(document).ready(function () {
|
1119 |
+
jQuery(".hasTip").tooltip({
|
1120 |
+
track: true,
|
1121 |
+
content: function () {
|
1122 |
+
return jQuery(this).prop('title');
|
1123 |
+
}
|
1124 |
+
});
|
1125 |
+
});
|
1126 |
+
|
1127 |
+
function insert_field(myValue) {
|
1128 |
+
if(!selected_field)
|
1129 |
+
return;
|
1130 |
+
myField=document.getElementById(selected_field);
|
1131 |
+
if (document.selection) {
|
1132 |
+
myField.focus();
|
1133 |
+
sel = document.selection.createRange();
|
1134 |
+
sel.text = myValue;
|
1135 |
+
}
|
1136 |
+
else {
|
1137 |
+
if (myField.selectionStart || myField.selectionStart == '0') {
|
1138 |
+
var startPos = myField.selectionStart;
|
1139 |
+
var endPos = myField.selectionEnd;
|
1140 |
+
myField.value = myField.value.substring(0, startPos)
|
1141 |
+
+ "{"+myValue+"}"
|
1142 |
+
+ myField.value.substring(endPos, myField.value.length);
|
1143 |
+
}
|
1144 |
+
else {
|
1145 |
+
myField.value += "{"+myValue+"}";
|
1146 |
+
}
|
1147 |
+
}
|
1148 |
+
}
|
1149 |
+
</script>
|
1150 |
+
<style>
|
1151 |
+
.cols div:nth-child(even) {background: #FFF;}
|
1152 |
+
.cols div:nth-child(odd) {background: #F5F5F5;}
|
1153 |
+
.cols div {
|
1154 |
+
height: 28px;
|
1155 |
+
padding: 5px;
|
1156 |
+
}
|
1157 |
+
.cols label {
|
1158 |
+
display:inline-block;
|
1159 |
+
width:200px;
|
1160 |
+
font-size:15px;
|
1161 |
+
overflow: hidden;
|
1162 |
+
white-space: nowrap;
|
1163 |
+
text-overflow: ellipsis;
|
1164 |
+
vertical-align: middle;
|
1165 |
+
}
|
1166 |
+
.cols input[type="text"] {
|
1167 |
+
width: 220px;
|
1168 |
+
line-height: 18px;
|
1169 |
+
height: 20px;
|
1170 |
+
}
|
1171 |
+
.cols input[type="text"]:disabled {
|
1172 |
+
cursor: not-allowed;
|
1173 |
+
background-color: #eee;
|
1174 |
+
}
|
1175 |
+
.cols input[type="checkbox"] {
|
1176 |
+
width: 20px;
|
1177 |
+
line-height: 18px;
|
1178 |
+
height: 20px;
|
1179 |
+
vertical-align: middle;
|
1180 |
+
}
|
1181 |
+
.cols select {
|
1182 |
+
line-height: 18px;
|
1183 |
+
height: 24px;
|
1184 |
+
}
|
1185 |
+
#fieldlist {
|
1186 |
+
position: absolute;
|
1187 |
+
width:225px;
|
1188 |
+
background: #fff;
|
1189 |
+
border: solid 1px #c7c7c7;
|
1190 |
+
top: 0;
|
1191 |
+
left: 0;
|
1192 |
+
z-index: 1000;
|
1193 |
+
}
|
1194 |
+
#fieldlist a {
|
1195 |
+
padding: 5px;
|
1196 |
+
cursor:pointer;
|
1197 |
+
overflow: hidden;
|
1198 |
+
white-space: nowrap;
|
1199 |
+
text-overflow: ellipsis;
|
1200 |
+
}
|
1201 |
+
#fieldlist a:hover {
|
1202 |
+
background: #ccc;
|
1203 |
+
}
|
1204 |
+
.gen_query, .gen_query:focus {
|
1205 |
+
width: 200px;
|
1206 |
+
height: 38px;
|
1207 |
+
background: #0E73D4;
|
1208 |
+
color: white;
|
1209 |
+
cursor: pointer;
|
1210 |
+
border: 0px;
|
1211 |
+
font-size: 16px;
|
1212 |
+
font-weight: bold;
|
1213 |
+
margin: 20px;
|
1214 |
+
}
|
1215 |
+
.gen_query:active {
|
1216 |
+
background: #ccc;
|
1217 |
+
}
|
1218 |
+
</style>
|
1219 |
+
<?php
|
1220 |
+
if($table_struct) {
|
1221 |
+
?>
|
1222 |
+
|
1223 |
+
<div class="cols">
|
1224 |
+
<?php
|
1225 |
+
if($con_method=='insert' or $con_method=='update') {
|
1226 |
+
echo '<div style="background: none;text-align: center;font-size: 20px;color: rgb(0, 164, 228);font-weight: bold;"> SET </div>';
|
1227 |
+
foreach($table_struct as $col) {
|
1228 |
+
$title=' '.$col->Field;
|
1229 |
+
$title.="<ul style='padding-left: 17px;'>";
|
1230 |
+
$title.="<li>Type - ".$col->Type."</li>";
|
1231 |
+
$title.="<li>Null - ".$col->Null."</li>";
|
1232 |
+
$title.="<li>Key - ".$col->Key."</li>";
|
1233 |
+
$title.="<li>Default - ".$col->Default."</li>";
|
1234 |
+
$title.="<li>Extra - ".$col->Extra."</li>";
|
1235 |
+
$title.="</ul>";
|
1236 |
+
?>
|
1237 |
+
<div><label title="<?php echo $title; ?>" class="hasTip"><b><?php echo $col->Field; ?></b><img src="<?php echo WD_FM_URL . '/images/info.png'; ?>" style="width:20px; vertical-align:middle;padding-left: 10px;" /></label><input type="text" id="<?php echo $col->Field; ?>" disabled="disabled"/><input id="ch_<?php echo $col->Field; ?>" type="checkbox" onClick="dis('<?php echo $col->Field; ?>', this.checked)"/></div>
|
1238 |
+
<?php
|
1239 |
+
}
|
1240 |
+
}
|
1241 |
+
if($con_method=='delete' or $con_method=='update') {
|
1242 |
+
echo '<div style="background: none;text-align: center;font-size: 20px;color: rgb(0, 164, 228);font-weight: bold;"> WHERE </div>
|
1243 |
+
|
1244 |
+
<img src="' . WD_FM_URL . '/images/add_condition.png" title="ADD" class="add_cond"/></br>';
|
1245 |
+
}
|
1246 |
+
?>
|
1247 |
+
</div>
|
1248 |
+
<br/>
|
1249 |
+
<input type="button" value="Generate Query" class="gen_query" onclick="gen_query()">
|
1250 |
+
<br/>
|
1251 |
+
<form name="query_form" id="query_form" >
|
1252 |
+
<label style="vertical-align: top;" for="query_txt" > Query: </label><textarea id="query_txt" name="query" rows=5 style="width:428px"></textarea>
|
1253 |
+
<input type="hidden" name="details" id="details">
|
1254 |
+
</form>
|
1255 |
+
<input type="button" value="Save" style="float: right;width: 200px;height: 38px;background: #0E73D4;color: white;cursor: pointer;border: 0px;font-size: 16px;font-weight: bold;margin: 20px;" onclick="save_query()">
|
1256 |
+
<div id="fieldlist" style="display: none;">
|
1257 |
+
<?php echo $form_fields ?>
|
1258 |
+
</div>
|
1259 |
+
<?php
|
1260 |
+
}
|
1261 |
+
die();
|
1262 |
+
}
|
1263 |
+
|
1264 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
1265 |
+
// Getters & Setters //
|
1266 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
1267 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
1268 |
+
// Private Methods //
|
1269 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
1270 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
1271 |
+
// Listeners //
|
1272 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
1273 |
}
|
admin/views/FMViewFormmakerwdcaptcha.php
CHANGED
@@ -1,93 +1,93 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMViewFormmakerwdcaptcha {
|
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']) == 'formmakerwdcaptcha') {
|
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 FMViewFormmakerwdcaptcha {
|
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']) == 'formmakerwdcaptcha') {
|
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/FMViewFormmakerwindow.php
CHANGED
@@ -1,113 +1,113 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMViewFormmakerwindow {
|
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>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">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 = '[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 FMViewFormmakerwindow {
|
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>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">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 = '[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/FMViewFromeditcountryinpopup.php
CHANGED
@@ -1,141 +1,141 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMViewFromeditcountryinpopup {
|
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 |
-
$id = ((isset($_GET['field_id'])) ? esc_html(stripslashes($_GET['field_id'])) : 0);
|
27 |
-
wp_print_scripts('jquery');
|
28 |
-
wp_print_scripts('jquery-ui-core');
|
29 |
-
wp_print_scripts('jquery-ui-widget');
|
30 |
-
wp_print_scripts('jquery-ui-mouse');
|
31 |
-
wp_print_scripts('jquery-ui-slider');
|
32 |
-
wp_print_scripts('jquery-ui-sortable');
|
33 |
-
?>
|
34 |
-
<span style="position: absolute; right: 8px;">
|
35 |
-
<img title="Add" style="cursor: pointer; vertical-align: middle;" src="<?php echo WD_FM_URL . '/images/save.png'; ?>" onClick="save_list()" />
|
36 |
-
<img title="Cancel" style=" cursor: pointer; vertical-align: middle;" src="<?php echo WD_FM_URL . '/images/cancel_but.png'; ?>" onClick="window.parent.tb_remove();" />
|
37 |
-
</span>
|
38 |
-
<button class="button-secondary" onClick="select_all()">Select all</button>
|
39 |
-
<button class="button-secondary" onClick="remove_all()">Remove all</button>
|
40 |
-
<ul id="countries_list" style="list-style: none; padding: 0px;"></ul>
|
41 |
-
<script>
|
42 |
-
selec_coutries = [];
|
43 |
-
coutries = ["", "Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Antigua and Barbuda", "Argentina", "Armenia", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Central African Republic", "Chad", "Chile", "China", "Colombi", "Comoros", "Congo (Brazzaville)", "Congo", "Costa Rica", "Cote d'Ivoire", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor (Timor Timur)", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Fiji", "Finland", "France", "Gabon", "Gambia, The", "Georgia", "Germany", "Ghana", "Greece", "Grenada", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Honduras", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, North", "Korea, South", "Kuwait", "Kyrgyzstan", "Laos", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Mauritania", "Mauritius", "Mexico", "Micronesia", "Moldova", "Monaco", "Mongolia", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepa", "Netherlands", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland", "Portugal", "Qatar", "Romania", "Russia", "Rwanda", "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Serbia and Montenegro", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "Spain", "Sri Lanka", "Sudan", "Suriname", "Swaziland", "Sweden", "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "Togo", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "Uruguay", "Uzbekistan", "Vanuatu", "Vatican City", "Venezuela", "Vietnam", "Yemen", "Zambia", "Zimbabwe"];
|
44 |
-
select_ = window.parent.document.getElementById('<?php echo $id ?>_elementform_id_temp');
|
45 |
-
n = select_.childNodes.length;
|
46 |
-
for (i = 0; i < n; i++) {
|
47 |
-
selec_coutries.push(select_.childNodes[i].value);
|
48 |
-
var ch = document.createElement('input');
|
49 |
-
ch.setAttribute("type", "checkbox");
|
50 |
-
ch.setAttribute("checked", "checked");
|
51 |
-
ch.value = select_.childNodes[i].value;
|
52 |
-
ch.id = i + "ch";
|
53 |
-
//ch.setAttribute("id",i);
|
54 |
-
var p = document.createElement('span');
|
55 |
-
p.style.cssText = "color:#000000; font-size: 13px; cursor:move";
|
56 |
-
p.innerHTML = select_.childNodes[i].value;
|
57 |
-
var li = document.createElement('li');
|
58 |
-
li.style.cssText = "margin:3px; vertical-align:middle";
|
59 |
-
li.id = i;
|
60 |
-
li.appendChild(ch);
|
61 |
-
li.appendChild(p);
|
62 |
-
document.getElementById('countries_list').appendChild(li);
|
63 |
-
}
|
64 |
-
cur = i;
|
65 |
-
m = coutries.length;
|
66 |
-
for (i = 0; i < m; i++) {
|
67 |
-
isin = isValueInArray(selec_coutries, coutries[i]);
|
68 |
-
if (!isin) {
|
69 |
-
var ch = document.createElement('input');
|
70 |
-
ch.setAttribute("type", "checkbox");
|
71 |
-
ch.value = coutries[i];
|
72 |
-
ch.id = cur + "ch";
|
73 |
-
|
74 |
-
var p = document.createElement('span');
|
75 |
-
p.style.cssText = "color:#000000; font-size: 13px; cursor:move";
|
76 |
-
p.innerHTML = coutries[i];
|
77 |
-
var li = document.createElement('li');
|
78 |
-
li.style.cssText = "margin:3px; vertical-align:middle";
|
79 |
-
li.id = cur;
|
80 |
-
li.appendChild(ch);
|
81 |
-
li.appendChild(p);
|
82 |
-
document.getElementById('countries_list').appendChild(li);
|
83 |
-
cur++;
|
84 |
-
}
|
85 |
-
}
|
86 |
-
jQuery(function () {
|
87 |
-
jQuery("#countries_list").sortable();
|
88 |
-
jQuery("#countries_list").disableSelection();
|
89 |
-
});
|
90 |
-
|
91 |
-
function isValueInArray(arr, val) {
|
92 |
-
inArray = false;
|
93 |
-
for (x = 0; x < arr.length; x++) {
|
94 |
-
if (val == arr[x]) {
|
95 |
-
inArray = true;
|
96 |
-
}
|
97 |
-
}
|
98 |
-
return inArray;
|
99 |
-
}
|
100 |
-
function save_list() {
|
101 |
-
select_.innerHTML = ""
|
102 |
-
ul = document.getElementById('countries_list');
|
103 |
-
n = ul.childNodes.length;
|
104 |
-
for (i = 0; i < n; i++) {
|
105 |
-
if (ul.childNodes[i].tagName == "LI") {
|
106 |
-
id = ul.childNodes[i].id;
|
107 |
-
if (document.getElementById(id + 'ch').checked) {
|
108 |
-
var option_ = document.createElement('option');
|
109 |
-
option_.setAttribute("value", document.getElementById(id + 'ch').value);
|
110 |
-
option_.innerHTML = document.getElementById(id + 'ch').value;
|
111 |
-
select_.appendChild(option_);
|
112 |
-
}
|
113 |
-
}
|
114 |
-
}
|
115 |
-
window.parent.tb_remove();
|
116 |
-
}
|
117 |
-
function select_all() {
|
118 |
-
for (i = 0; i < 194; i++) {
|
119 |
-
document.getElementById(i + 'ch').checked = true;
|
120 |
-
}
|
121 |
-
}
|
122 |
-
function remove_all() {
|
123 |
-
for (i = 0; i < 194; i++) {
|
124 |
-
document.getElementById(i + 'ch').checked = false;
|
125 |
-
}
|
126 |
-
}
|
127 |
-
</script>
|
128 |
-
<?php
|
129 |
-
die();
|
130 |
-
}
|
131 |
-
|
132 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
133 |
-
// Getters & Setters //
|
134 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
135 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
136 |
-
// Private Methods //
|
137 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
138 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
139 |
-
// Listeners //
|
140 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
141 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FMViewFromeditcountryinpopup {
|
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 |
+
$id = ((isset($_GET['field_id'])) ? esc_html(stripslashes($_GET['field_id'])) : 0);
|
27 |
+
wp_print_scripts('jquery');
|
28 |
+
wp_print_scripts('jquery-ui-core');
|
29 |
+
wp_print_scripts('jquery-ui-widget');
|
30 |
+
wp_print_scripts('jquery-ui-mouse');
|
31 |
+
wp_print_scripts('jquery-ui-slider');
|
32 |
+
wp_print_scripts('jquery-ui-sortable');
|
33 |
+
?>
|
34 |
+
<span style="position: absolute; right: 8px;">
|
35 |
+
<img title="Add" style="cursor: pointer; vertical-align: middle;" src="<?php echo WD_FM_URL . '/images/save.png'; ?>" onClick="save_list()" />
|
36 |
+
<img title="Cancel" style=" cursor: pointer; vertical-align: middle;" src="<?php echo WD_FM_URL . '/images/cancel_but.png'; ?>" onClick="window.parent.tb_remove();" />
|
37 |
+
</span>
|
38 |
+
<button class="button-secondary" onClick="select_all()">Select all</button>
|
39 |
+
<button class="button-secondary" onClick="remove_all()">Remove all</button>
|
40 |
+
<ul id="countries_list" style="list-style: none; padding: 0px;"></ul>
|
41 |
+
<script>
|
42 |
+
selec_coutries = [];
|
43 |
+
coutries = ["", "Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Antigua and Barbuda", "Argentina", "Armenia", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Central African Republic", "Chad", "Chile", "China", "Colombi", "Comoros", "Congo (Brazzaville)", "Congo", "Costa Rica", "Cote d'Ivoire", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor (Timor Timur)", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Fiji", "Finland", "France", "Gabon", "Gambia, The", "Georgia", "Germany", "Ghana", "Greece", "Grenada", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Honduras", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, North", "Korea, South", "Kuwait", "Kyrgyzstan", "Laos", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Mauritania", "Mauritius", "Mexico", "Micronesia", "Moldova", "Monaco", "Mongolia", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepa", "Netherlands", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland", "Portugal", "Qatar", "Romania", "Russia", "Rwanda", "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Serbia and Montenegro", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "Spain", "Sri Lanka", "Sudan", "Suriname", "Swaziland", "Sweden", "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "Togo", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "Uruguay", "Uzbekistan", "Vanuatu", "Vatican City", "Venezuela", "Vietnam", "Yemen", "Zambia", "Zimbabwe"];
|
44 |
+
select_ = window.parent.document.getElementById('<?php echo $id ?>_elementform_id_temp');
|
45 |
+
n = select_.childNodes.length;
|
46 |
+
for (i = 0; i < n; i++) {
|
47 |
+
selec_coutries.push(select_.childNodes[i].value);
|
48 |
+
var ch = document.createElement('input');
|
49 |
+
ch.setAttribute("type", "checkbox");
|
50 |
+
ch.setAttribute("checked", "checked");
|
51 |
+
ch.value = select_.childNodes[i].value;
|
52 |
+
ch.id = i + "ch";
|
53 |
+
//ch.setAttribute("id",i);
|
54 |
+
var p = document.createElement('span');
|
55 |
+
p.style.cssText = "color:#000000; font-size: 13px; cursor:move";
|
56 |
+
p.innerHTML = select_.childNodes[i].value;
|
57 |
+
var li = document.createElement('li');
|
58 |
+
li.style.cssText = "margin:3px; vertical-align:middle";
|
59 |
+
li.id = i;
|
60 |
+
li.appendChild(ch);
|
61 |
+
li.appendChild(p);
|
62 |
+
document.getElementById('countries_list').appendChild(li);
|
63 |
+
}
|
64 |
+
cur = i;
|
65 |
+
m = coutries.length;
|
66 |
+
for (i = 0; i < m; i++) {
|
67 |
+
isin = isValueInArray(selec_coutries, coutries[i]);
|
68 |
+
if (!isin) {
|
69 |
+
var ch = document.createElement('input');
|
70 |
+
ch.setAttribute("type", "checkbox");
|
71 |
+
ch.value = coutries[i];
|
72 |
+
ch.id = cur + "ch";
|
73 |
+
|
74 |
+
var p = document.createElement('span');
|
75 |
+
p.style.cssText = "color:#000000; font-size: 13px; cursor:move";
|
76 |
+
p.innerHTML = coutries[i];
|
77 |
+
var li = document.createElement('li');
|
78 |
+
li.style.cssText = "margin:3px; vertical-align:middle";
|
79 |
+
li.id = cur;
|
80 |
+
li.appendChild(ch);
|
81 |
+
li.appendChild(p);
|
82 |
+
document.getElementById('countries_list').appendChild(li);
|
83 |
+
cur++;
|
84 |
+
}
|
85 |
+
}
|
86 |
+
jQuery(function () {
|
87 |
+
jQuery("#countries_list").sortable();
|
88 |
+
jQuery("#countries_list").disableSelection();
|
89 |
+
});
|
90 |
+
|
91 |
+
function isValueInArray(arr, val) {
|
92 |
+
inArray = false;
|
93 |
+
for (x = 0; x < arr.length; x++) {
|
94 |
+
if (val == arr[x]) {
|
95 |
+
inArray = true;
|
96 |
+
}
|
97 |
+
}
|
98 |
+
return inArray;
|
99 |
+
}
|
100 |
+
function save_list() {
|
101 |
+
select_.innerHTML = ""
|
102 |
+
ul = document.getElementById('countries_list');
|
103 |
+
n = ul.childNodes.length;
|
104 |
+
for (i = 0; i < n; i++) {
|
105 |
+
if (ul.childNodes[i].tagName == "LI") {
|
106 |
+
id = ul.childNodes[i].id;
|
107 |
+
if (document.getElementById(id + 'ch').checked) {
|
108 |
+
var option_ = document.createElement('option');
|
109 |
+
option_.setAttribute("value", document.getElementById(id + 'ch').value);
|
110 |
+
option_.innerHTML = document.getElementById(id + 'ch').value;
|
111 |
+
select_.appendChild(option_);
|
112 |
+
}
|
113 |
+
}
|
114 |
+
}
|
115 |
+
window.parent.tb_remove();
|
116 |
+
}
|
117 |
+
function select_all() {
|
118 |
+
for (i = 0; i < 194; i++) {
|
119 |
+
document.getElementById(i + 'ch').checked = true;
|
120 |
+
}
|
121 |
+
}
|
122 |
+
function remove_all() {
|
123 |
+
for (i = 0; i < 194; i++) {
|
124 |
+
document.getElementById(i + 'ch').checked = false;
|
125 |
+
}
|
126 |
+
}
|
127 |
+
</script>
|
128 |
+
<?php
|
129 |
+
die();
|
130 |
+
}
|
131 |
+
|
132 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
133 |
+
// Getters & Setters //
|
134 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
135 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
136 |
+
// Private Methods //
|
137 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
138 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
139 |
+
// Listeners //
|
140 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
141 |
}
|
admin/views/FMViewFromipinfoinpopup.php
CHANGED
@@ -1,101 +1,101 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMViewFromipinfoinpopup {
|
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_FM_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 |
-
// Getters & Setters //
|
94 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
95 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
96 |
-
// Private Methods //
|
97 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
98 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
99 |
-
// Listeners //
|
100 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
101 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FMViewFromipinfoinpopup {
|
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_FM_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 |
+
// Getters & Setters //
|
94 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
95 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
96 |
+
// Private Methods //
|
97 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
98 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
99 |
+
// Listeners //
|
100 |
+
////////////////////////////////////////////////////////////////////////////////////////
|
101 |
}
|
admin/views/FMViewFrommapeditinpopup.php
CHANGED
@@ -1,64 +1,64 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMViewFrommapeditinpopup {
|
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_FM_URL . '/js/main_front_end.js'; ?>"></script>
|
30 |
-
<script src="<?php echo WD_FM_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 {
|
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_FM_URL . '/js/main_front_end.js'; ?>"></script>
|
30 |
+
<script src="<?php echo WD_FM_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.php
CHANGED
@@ -1,69 +1,69 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMViewGenerete_csv {
|
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 {
|
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.php
CHANGED
@@ -1,67 +1,67 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMViewGenerete_xml {
|
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 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FMViewGenerete_xml {
|
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 |
+
//////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|