Version Description
- Changed: Improved user interface of forms, submissions and options.
- Changed: Improved Drag & Drop Form Builder functionality.
- Added: Full width functionality for fields.
- Added: New Default Theme.
- Changed: Simplified the structure of Form Options tabs.
- Improved: Responsiveness.
- Added: Invisibe reCAPTCHA.
- Updated: WD Library.
- Updated: Support forum link.
- Changed: Date field calendar icon.
- Fixed: Time, Date of Birth and Number fields validation on mobile.
- Fixed: Conflict with Yoast SEO plugin.
- Changed: Remove Font Awesome.
- Fixed: Border types bug
- Changed: Separated field types into Basic, User Info, Layout, Advanced and Payment sections.
Download this release
Release Info
Developer | webdorado |
Plugin | Contact Form by WD – responsive drag & drop contact form builder tool |
Version | 1.12.9 |
Comparing to | |
See all releases |
Code changes from version 1.11.15 to 1.12.9
- .gitignore +4 -0
- admin/controllers/Blocked_ips_fm.php +270 -0
- admin/controllers/Checkpaypal.php +177 -0
- admin/controllers/FMControllerBlocked_ips_fm.php +0 -148
- admin/controllers/FMControllerFormMakerPreview.php +0 -43
- admin/controllers/FMControllerFormMakerSQLMapping.php +0 -112
- admin/controllers/FMControllerFormMakerSubmits.php +0 -43
- admin/controllers/FMControllerFormmakerwdcaptcha.php +0 -43
- admin/controllers/FMControllerFormmakerwdmathcaptcha.php +0 -43
- admin/controllers/FMControllerFormmakerwindow.php +0 -43
- admin/controllers/FMControllerFromeditcountryinpopup.php +0 -43
- admin/controllers/FMControllerFromipinfoinpopup.php +0 -43
- admin/controllers/FMControllerFrommapeditinpopup.php +0 -43
- admin/controllers/FMControllerGenerete_csv.php +0 -43
- admin/controllers/FMControllerGenerete_xml.php +0 -43
- admin/controllers/FMControllerGoptions_fm.php +0 -44
- admin/controllers/FMControllerLicensing_fm.php +0 -49
- admin/controllers/FMControllerManage_fm.php +0 -1211
- admin/controllers/FMControllerSelect_data_from_db.php +0 -70
- admin/controllers/FMControllerShow_matrix.php +0 -43
- admin/controllers/FMControllerSubmissions_fm.php +0 -291
- admin/controllers/FMControllerThemes_fm.php +0 -219
- admin/controllers/FMControllerUninstall_fm.php +0 -66
- admin/controllers/FMControllerWidget.php +0 -61
- admin/controllers/FMShortocde.php +43 -0
- admin/controllers/FormMakerEditCountryinPopup.php +31 -0
- admin/controllers/FormMakerIpinfoinPopup.php +58 -0
- admin/controllers/FormMakerMapEditinPopup.php +35 -0
- admin/controllers/FormMakerSQLMapping.php +167 -0
- admin/controllers/FormMakerSubmits.php +44 -0
- admin/controllers/Formmakerwdcaptcha.php +29 -0
- admin/controllers/Formmakerwdmathcaptcha.php +30 -0
- admin/controllers/Generete_csv.php +71 -0
- admin/controllers/Generete_xml.php +61 -0
- admin/controllers/Licensing_fm.php +26 -0
- admin/controllers/Manage_fm.php +1415 -0
- admin/controllers/Options_fm.php +43 -0
- admin/controllers/Paypal_info.php +38 -0
- admin/controllers/Product_option.php +36 -0
- admin/controllers/Select_data_from_db.php +93 -0
- admin/controllers/Show_matrix.php +27 -0
- admin/controllers/Submissions_fm.php +557 -0
- admin/controllers/Themes_fm.php +3074 -0
- admin/controllers/Uninstall_fm.php +66 -0
- admin/controllers/Widget.php +45 -0
- admin/models/Blocked_ips_fm.php +113 -0
- admin/models/Checkpaypal.php +108 -0
- admin/models/FMModelBlocked_ips_fm.php +0 -75
- admin/models/FMModelFormMakerPreview.php +0 -36
- admin/models/FMModelFormMakerSQLMapping.php +0 -121
- admin/models/FMModelFormMakerSubmits.php +0 -43
- admin/models/FMModelFormmakerwdcaptcha.php +0 -31
- admin/models/FMModelFormmakerwdmathcaptcha.php +0 -31
- admin/models/FMModelFormmakerwindow.php +0 -36
- admin/models/FMModelFromeditcountryinpopup.php +0 -31
- admin/models/FMModelFromipinfoinpopup.php +0 -31
- admin/models/FMModelFrommapeditinpopup.php +0 -31
- admin/models/FMModelGenerete_csv.php +0 -300
- admin/models/FMModelGenerete_xml.php +0 -301
- admin/models/FMModelGoptions_fm.php +0 -4
- admin/models/FMModelLicensing_fm.php +0 -30
- admin/models/FMModelManage_fm.php +0 -2887
- admin/models/FMModelSelect_data_from_db.php +0 -111
- admin/models/FMModelShow_matrix.php +0 -31
- admin/models/FMModelSubmissions_fm.php +0 -744
- admin/models/FMModelUninstall_fm.php +0 -55
- admin/models/FMModelWidget.php +0 -38
- admin/models/FMPaypalInfo.php +20 -0
- admin/models/FMSelectDataFromDb.php +134 -0
- admin/models/FMShortocde.php +17 -0
- admin/models/FMSqlMapping.php +119 -0
- admin/models/FormMakerSubmits.php +20 -0
- admin/models/Manage_fm.php +3846 -0
- admin/models/Options_fm.php +27 -0
- admin/models/Submissions_fm.php +21 -0
.gitignore
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
.idea
|
2 |
+
css/frontend/*
|
3 |
+
js/frontend/*
|
4 |
+
!.gitignore
|
admin/controllers/Blocked_ips_fm.php
ADDED
@@ -0,0 +1,270 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class FMControllerBlocked_ips_fmc
|
5 |
+
*/
|
6 |
+
class FMControllerBlocked_ips_fmc {
|
7 |
+
private $model;
|
8 |
+
private $view;
|
9 |
+
private $bulk_action_name = '';
|
10 |
+
private $items_per_page = 20;
|
11 |
+
private $actions = array();
|
12 |
+
|
13 |
+
public function __construct() {
|
14 |
+
require_once WDCFM()->plugin_dir . "/admin/models/Blocked_ips_fm.php";
|
15 |
+
require_once WDCFM()->plugin_dir . "/admin/views/Blocked_ips_fm.php";
|
16 |
+
$this->model = new FMModelBlocked_ips_fmc();
|
17 |
+
$this->view = new FMViewBlocked_ips_fmc();
|
18 |
+
|
19 |
+
$this->page = WDW_FMC_Library::get('page');
|
20 |
+
|
21 |
+
$this->bulk_action_name = 'bulk_action';
|
22 |
+
|
23 |
+
$this->actions = array(
|
24 |
+
'delete' => array(
|
25 |
+
'title' => __('Delete', WDCFM()->prefix),
|
26 |
+
$this->bulk_action_name => __('deleted', WDCFM()->prefix),
|
27 |
+
),
|
28 |
+
);
|
29 |
+
}
|
30 |
+
|
31 |
+
public function execute() {
|
32 |
+
$task = WDW_FMC_Library::get('task');
|
33 |
+
$id = (int) WDW_FMC_Library::get('current_id', 0);
|
34 |
+
|
35 |
+
if ( method_exists($this, $task) ) {
|
36 |
+
check_admin_referer(WDCFM()->nonce, WDCFM()->nonce);
|
37 |
+
$block_action = $this->bulk_action_name;
|
38 |
+
$action = WDW_FMC_Library::get( $block_action, -1 );
|
39 |
+
if ( $action != -1 ) {
|
40 |
+
$this->$block_action($action);
|
41 |
+
}
|
42 |
+
else {
|
43 |
+
$this->$task($id);
|
44 |
+
}
|
45 |
+
}
|
46 |
+
else {
|
47 |
+
$this->display();
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
public function display() {
|
52 |
+
$params = array();
|
53 |
+
$params['order'] = WDW_FMC_Library::get('order', 'desc');
|
54 |
+
$params['orderby'] = WDW_FMC_Library::get('orderby', 'id');
|
55 |
+
// To prevent SQL injections.
|
56 |
+
if ( !in_array($params['orderby'], array( 'id', 'ip' )) ) {
|
57 |
+
$params['orderby'] = 'id';
|
58 |
+
}
|
59 |
+
$params['order'] = $params['order'] == 'desc' ? 'desc' : 'asc';
|
60 |
+
|
61 |
+
$params['items_per_page'] = $this->items_per_page;
|
62 |
+
|
63 |
+
$params['rows_data'] = $this->model->get_rows_data($params);
|
64 |
+
|
65 |
+
$params['total'] = $this->model->total();
|
66 |
+
|
67 |
+
$params['actions'] = $this->actions;
|
68 |
+
$params['page'] = $this->page;
|
69 |
+
|
70 |
+
$this->view->display($params);
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Bulk actions.
|
75 |
+
*
|
76 |
+
* @param $task
|
77 |
+
*/
|
78 |
+
public function bulk_action($task) {
|
79 |
+
$message = 0;
|
80 |
+
$successfully_updated = 0;
|
81 |
+
$check = WDW_FMC_Library::get('check', '');
|
82 |
+
if ( $check ) {
|
83 |
+
foreach ( $check as $id => $item ) {
|
84 |
+
if ( method_exists($this, $task) ) {
|
85 |
+
$message = $this->$task($id, TRUE);
|
86 |
+
if ( $message != 2 ) {
|
87 |
+
// Increase successfully updated items count, if action doesn't failed.
|
88 |
+
$successfully_updated++;
|
89 |
+
}
|
90 |
+
}
|
91 |
+
}
|
92 |
+
if ( $successfully_updated ) {
|
93 |
+
$block_action = $this->bulk_action_name;
|
94 |
+
$message = sprintf(_n('%s item successfully %s.', '%s items successfully %s.', $successfully_updated, WDCFM()->prefix), $successfully_updated, $this->actions[$task][$block_action]);
|
95 |
+
}
|
96 |
+
}
|
97 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array(
|
98 |
+
'page' => $this->page,
|
99 |
+
'task' => 'display',
|
100 |
+
($message === 2 ? 'message' : 'msg') => $message,
|
101 |
+
), admin_url('admin.php')));
|
102 |
+
}
|
103 |
+
|
104 |
+
public function insert_blocked_ip() {
|
105 |
+
|
106 |
+
$page = WDW_FMC_Library::get('page');
|
107 |
+
|
108 |
+
$ip = WDW_FMC_Library::get('ip','');
|
109 |
+
|
110 |
+
$insert = $this->model->insert_fm_blocked(array('ip' => $ip,), array('%s',));
|
111 |
+
if( !$insert ){
|
112 |
+
$message = 2;
|
113 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array(
|
114 |
+
'page' => $page,
|
115 |
+
'task' => 'display',
|
116 |
+
'message' => $message,
|
117 |
+
), admin_url('admin.php')));
|
118 |
+
}
|
119 |
+
}
|
120 |
+
|
121 |
+
public function delete_blocked_ip( $id ) {
|
122 |
+
$page = WDW_FMC_Library::get('page');
|
123 |
+
// check id for db
|
124 |
+
if(isset($id) && $id != "") {
|
125 |
+
$id = intval($id);
|
126 |
+
$delete = $this->model->delete_data($id);
|
127 |
+
|
128 |
+
if( !$delete ){
|
129 |
+
$message = 2;
|
130 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array(
|
131 |
+
'page' => $page,
|
132 |
+
'task' => 'display',
|
133 |
+
'message' => $message,
|
134 |
+
), admin_url('admin.php')));
|
135 |
+
}
|
136 |
+
|
137 |
+
}
|
138 |
+
else { // return message Failed
|
139 |
+
$message = 2;
|
140 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array(
|
141 |
+
'page' => $page,
|
142 |
+
'task' => 'display',
|
143 |
+
'message' => $message,
|
144 |
+
), admin_url('admin.php')));
|
145 |
+
}
|
146 |
+
|
147 |
+
$total = $this->model->total(); // get total count of blocked IPs
|
148 |
+
if( ($total % $this->items_per_page) == 0 ) {
|
149 |
+
|
150 |
+
echo '<div id="total_for_paging">'.$total/$this->items_per_page.'</div>'; // send to JS page number
|
151 |
+
}
|
152 |
+
|
153 |
+
|
154 |
+
}
|
155 |
+
|
156 |
+
public function update_blocked_ip( $id ) {
|
157 |
+
$page = WDW_FMC_Library::get('page');
|
158 |
+
|
159 |
+
// check id for db
|
160 |
+
if(isset($id) && $id != "") {
|
161 |
+
$id = intval($id);
|
162 |
+
$ip = WDW_FMC_Library::get('ip', '');
|
163 |
+
$update = $this->model->update_fm_blocked(array('ip' => $ip,), array('id' => $id));
|
164 |
+
|
165 |
+
if( !$update ){
|
166 |
+
$message = 2;
|
167 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array(
|
168 |
+
'page' => $page,
|
169 |
+
'task' => 'display',
|
170 |
+
'message' => $message,
|
171 |
+
), admin_url('admin.php')));
|
172 |
+
}
|
173 |
+
|
174 |
+
}
|
175 |
+
else { // return message Failed
|
176 |
+
$message = 2;
|
177 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array(
|
178 |
+
'page' => $page,
|
179 |
+
'task' => 'display',
|
180 |
+
'message' => $message,
|
181 |
+
), admin_url('admin.php')));
|
182 |
+
}
|
183 |
+
|
184 |
+
}
|
185 |
+
|
186 |
+
public function delete( $id, $bulk = FALSE ) {
|
187 |
+
if ( $this->model->delete_data($id) ) {
|
188 |
+
$message = 3;
|
189 |
+
}
|
190 |
+
else {
|
191 |
+
$message = 2;
|
192 |
+
}
|
193 |
+
|
194 |
+
if ( $bulk ) {
|
195 |
+
return $message;
|
196 |
+
}
|
197 |
+
else {
|
198 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array(
|
199 |
+
'page' => $this->page,
|
200 |
+
'task' => 'display',
|
201 |
+
'message' => $message,
|
202 |
+
), admin_url('admin.php')));
|
203 |
+
}
|
204 |
+
}
|
205 |
+
|
206 |
+
public function save() {
|
207 |
+
$message = $this->save_db();
|
208 |
+
$page = WDW_FMC_Library::get('page');
|
209 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array(
|
210 |
+
'page' => $page,
|
211 |
+
'task' => 'display',
|
212 |
+
'message' => $message,
|
213 |
+
), admin_url('admin.php')));
|
214 |
+
}
|
215 |
+
|
216 |
+
public function save_db() {
|
217 |
+
$id = (isset($_POST['current_id']) ? (int) $_POST['current_id'] : 0);
|
218 |
+
$ip = (isset($_POST['ip']) ? esc_html(stripslashes($_POST['ip'])) : '');
|
219 |
+
if ( $id != 0 ) {
|
220 |
+
$save = $this->model->update_fm_blocked(array(
|
221 |
+
'ip' => $ip,
|
222 |
+
), array( 'id' => $id ));
|
223 |
+
}
|
224 |
+
else {
|
225 |
+
$save = $this->model->insert_fm_blocked(array(
|
226 |
+
'ip' => $ip,
|
227 |
+
), array(
|
228 |
+
'%s',
|
229 |
+
));
|
230 |
+
}
|
231 |
+
if ( $save !== FALSE ) {
|
232 |
+
$message = 1;
|
233 |
+
}
|
234 |
+
else {
|
235 |
+
$message = 2;
|
236 |
+
}
|
237 |
+
return $message;
|
238 |
+
}
|
239 |
+
|
240 |
+
public function save_all() {
|
241 |
+
$flag = FALSE;
|
242 |
+
$ips_id_col = $this->model->get_col_data();
|
243 |
+
foreach ( $ips_id_col as $ip_id ) {
|
244 |
+
if ( isset($_POST['ip' . $ip_id]) ) {
|
245 |
+
$ip = esc_html(stripslashes($_POST['ip' . $ip_id]));
|
246 |
+
if ( $ip == '' ) {
|
247 |
+
$this->model->delete_data($ip_id);
|
248 |
+
}
|
249 |
+
else {
|
250 |
+
$flag = TRUE;
|
251 |
+
$this->model->update_fm_blocked(array(
|
252 |
+
'ip' => $ip,
|
253 |
+
), array( 'id' => $ip_id ));
|
254 |
+
}
|
255 |
+
}
|
256 |
+
}
|
257 |
+
if ( $flag ) {
|
258 |
+
$message = 1;
|
259 |
+
}
|
260 |
+
else {
|
261 |
+
$message = 0;
|
262 |
+
}
|
263 |
+
$page = WDW_FMC_Library::get('page');
|
264 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array(
|
265 |
+
'page' => $page,
|
266 |
+
'task' => 'display',
|
267 |
+
'message' => $message,
|
268 |
+
), admin_url('admin.php')));
|
269 |
+
}
|
270 |
+
}
|
admin/controllers/Checkpaypal.php
ADDED
@@ -0,0 +1,177 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class FMControllerCheckpaypal
|
5 |
+
*/
|
6 |
+
class FMControllerCheckpaypal {
|
7 |
+
/**
|
8 |
+
* @var $model
|
9 |
+
*/
|
10 |
+
private $model;
|
11 |
+
/**
|
12 |
+
* @var $view
|
13 |
+
*/
|
14 |
+
private $view;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* FMControllerCheckpaypal constructor.
|
18 |
+
*/
|
19 |
+
public function __construct() {
|
20 |
+
// Load FMModelCheckpaypal class.
|
21 |
+
require_once WDCFM()->plugin_dir . "/admin/models/Checkpaypal.php";
|
22 |
+
$this->model = new FMModelCheckpaypal();
|
23 |
+
// Load FMViewCheckpaypal class.
|
24 |
+
require_once WDCFM()->plugin_dir . "/admin/views/Checkpaypal.php";
|
25 |
+
$this->view = new FMViewCheckpaypal();
|
26 |
+
}
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Execute.
|
30 |
+
*/
|
31 |
+
public function execute() {
|
32 |
+
$this->display();
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Display.
|
37 |
+
*/
|
38 |
+
public function display() {
|
39 |
+
// Get form by id.
|
40 |
+
$form_id = WDW_FMC_Library::get('form_id', 0);
|
41 |
+
$form = $this->model->get_form_by_id($form_id);
|
42 |
+
// Get form session by group id.
|
43 |
+
$group_id = WDW_FMC_Library::get('group_id', 0);
|
44 |
+
$form_session = $this->model->get_form_session_by_group_id($group_id);
|
45 |
+
// Connect to paypal.
|
46 |
+
$post_fields = '';
|
47 |
+
if ( isset($_POST) && !empty($_POST) ) {
|
48 |
+
foreach ( $_POST as $key => $value ) {
|
49 |
+
$post_fields .= $key . '=' . urlencode($value) . '&';
|
50 |
+
}
|
51 |
+
}
|
52 |
+
$post_fields .= 'cmd=_notify-validate';
|
53 |
+
$paypal_params = array( 'checkout_mode' => $form->checkout_mode, 'post_fields' => $post_fields );
|
54 |
+
$response = $this->model->connect_to_paypal($paypal_params);
|
55 |
+
$tax = WDW_FMC_Library::get('tax', 0);
|
56 |
+
$total = WDW_FMC_Library::get('mc_gross', 0);
|
57 |
+
$shipping = WDW_FMC_Library::get('mc_shipping', 0);
|
58 |
+
$payment_status = WDW_FMC_Library::get('payment_status', 0);
|
59 |
+
// Update payment status for formmaker_submits table.
|
60 |
+
$this->model->update_submission_status($payment_status, $group_id);
|
61 |
+
$form_currency = '$';
|
62 |
+
$currency_code = array(
|
63 |
+
'USD',
|
64 |
+
'EUR',
|
65 |
+
'GBP',
|
66 |
+
'JPY',
|
67 |
+
'CAD',
|
68 |
+
'MXN',
|
69 |
+
'HKD',
|
70 |
+
'HUF',
|
71 |
+
'NOK',
|
72 |
+
'NZD',
|
73 |
+
'SGD',
|
74 |
+
'SEK',
|
75 |
+
'PLN',
|
76 |
+
'AUD',
|
77 |
+
'DKK',
|
78 |
+
'CHF',
|
79 |
+
'CZK',
|
80 |
+
'ILS',
|
81 |
+
'BRL',
|
82 |
+
'TWD',
|
83 |
+
'MYR',
|
84 |
+
'PHP',
|
85 |
+
'THB',
|
86 |
+
);
|
87 |
+
$currency_sign = array(
|
88 |
+
'$',
|
89 |
+
'€',
|
90 |
+
'£',
|
91 |
+
'¥',
|
92 |
+
'C$',
|
93 |
+
'Mex$',
|
94 |
+
'HK$',
|
95 |
+
'Ft',
|
96 |
+
'kr',
|
97 |
+
'NZ$',
|
98 |
+
'S$',
|
99 |
+
'kr',
|
100 |
+
'zl',
|
101 |
+
'A$',
|
102 |
+
'kr',
|
103 |
+
'CHF',
|
104 |
+
'Kc',
|
105 |
+
'₪',
|
106 |
+
'R$',
|
107 |
+
'NT$',
|
108 |
+
'RM',
|
109 |
+
'₱',
|
110 |
+
'฿',
|
111 |
+
);
|
112 |
+
// Checking payment currency and set new value fo currency.
|
113 |
+
$payment_currency = !empty($form->payment_currency) ? $form->payment_currency : $form_currency;
|
114 |
+
if ( !empty($payment_currency) ) {
|
115 |
+
$form_currency = $currency_sign[array_search($payment_currency, $currency_code)];
|
116 |
+
}
|
117 |
+
$currency = $payment_currency . $form_currency;
|
118 |
+
$email = WDW_FMC_Library::get('payer_email', '');
|
119 |
+
$first_name = WDW_FMC_Library::get('first_name', '');
|
120 |
+
$last_name = WDW_FMC_Library::get('last_name', '');
|
121 |
+
$full_name = (($first_name != '') ? $first_name : '') . (($last_name != '') ? ' ' . $last_name : '');
|
122 |
+
$phone_a = WDW_FMC_Library::get('night_phone_a', '');
|
123 |
+
$phone_b = WDW_FMC_Library::get('night_phone_b', '');
|
124 |
+
$phone_c = WDW_FMC_Library::get('night_phone_c', '');
|
125 |
+
$phone = (($phone_a != '') ? $phone_a : '') . (($phone_b != '') ? ' - ' . $phone_b : '') . (($phone_c != '') ? ' - ' . $phone_c : '');
|
126 |
+
$address = '';
|
127 |
+
$address .= (WDW_FMC_Library::get('address_country', '') != '') ? "Country: " . WDW_FMC_Library::get('address_country', '') : '';
|
128 |
+
$address .= (WDW_FMC_Library::get('address_state', '') != '') ? "<br>State: " . WDW_FMC_Library::get('address_state', '') : '';
|
129 |
+
$address .= (WDW_FMC_Library::get('address_city', '') != '') ? "<br>City: " . WDW_FMC_Library::get('address_city', '') : '';
|
130 |
+
$address .= (WDW_FMC_Library::get('address_street', '') != '') ? "<br>Street: " . WDW_FMC_Library::get('address_street', '') : '';
|
131 |
+
$address .= (WDW_FMC_Library::get('address_zip', '') != '') ? "<br>Zip Code: " . WDW_FMC_Library::get('address_zip', '') : '';
|
132 |
+
$address .= (WDW_FMC_Library::get('address_status', '') != '') ? "<br>Address Status: " . WDW_FMC_Library::get('address_status', '') : '';
|
133 |
+
$address .= (WDW_FMC_Library::get('address_name', '') != '') ? "<br>Name: " . WDW_FMC_Library::get('address_name', '') : '';
|
134 |
+
$paypal_info = "";
|
135 |
+
$paypal_info .= (WDW_FMC_Library::get('payer_status', '') != '') ? "<br>Payer Status - " . WDW_FMC_Library::get('payer_status', '') : '';
|
136 |
+
$paypal_info .= (WDW_FMC_Library::get('payer_email', '') != '') ? "<br>Payer Email - " . WDW_FMC_Library::get('payer_email', '') : '';
|
137 |
+
$paypal_info .= (WDW_FMC_Library::get('txn_id', '') != '') ? "<br>Transaction - " . WDW_FMC_Library::get('txn_id', '') : '';
|
138 |
+
$paypal_info .= (WDW_FMC_Library::get('payment_type', '') != '') ? "<br>Payment Type - " . WDW_FMC_Library::get('payment_type', '') : '';
|
139 |
+
$paypal_info .= (WDW_FMC_Library::get('residence_country', '') != '') ? "<br>Residence Country - " . WDW_FMC_Library::get('residence_country', '') : '';
|
140 |
+
$post = array(
|
141 |
+
'form_id' => $form_id,
|
142 |
+
'group_id' => $group_id,
|
143 |
+
'full_name' => $full_name,
|
144 |
+
'email' => $email,
|
145 |
+
'phone' => $phone,
|
146 |
+
'address' => $address,
|
147 |
+
'status' => $payment_status,
|
148 |
+
'ipn' => $response,
|
149 |
+
'currency' => $currency,
|
150 |
+
'paypal_info' => $paypal_info,
|
151 |
+
'tax' => $tax,
|
152 |
+
'total' => $total,
|
153 |
+
'shipping' => $shipping,
|
154 |
+
'ord_last_modified' => date('Y-m-d H:i:s'),
|
155 |
+
);
|
156 |
+
if ( !$form_session ) {
|
157 |
+
$this->model->add_formmaker_sessions($post);
|
158 |
+
}
|
159 |
+
else {
|
160 |
+
$this->model->update_formmaker_sessions_by_group_id($group_id, $post);
|
161 |
+
}
|
162 |
+
// Get form session by group id.
|
163 |
+
$form_session = $this->model->get_form_session_by_group_id($group_id);
|
164 |
+
// Send mail to payer
|
165 |
+
if ( $form->mail && !empty($form_session) ) {
|
166 |
+
$to = $form->mail;
|
167 |
+
$subject = "Payment information";
|
168 |
+
// Get template for payment information.
|
169 |
+
$template_params = array( 'form_session' => $form_session, 'data' => $post );
|
170 |
+
$message = $this->view->payment_information_template($template_params);
|
171 |
+
add_filter('wp_mail_content_type', create_function('', 'return "text/html";'));
|
172 |
+
wp_mail($to, $subject, $message);
|
173 |
+
}
|
174 |
+
|
175 |
+
return 0;
|
176 |
+
}
|
177 |
+
}
|
admin/controllers/FMControllerBlocked_ips_fm.php
DELETED
@@ -1,148 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerBlocked_ips_fmc {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function execute() {
|
22 |
-
$task = WDW_FMC_Library::get('task');
|
23 |
-
$id = (int)WDW_FMC_Library::get('current_id', 0);
|
24 |
-
$message = WDW_FMC_Library::get('message');
|
25 |
-
echo WDW_FMC_Library::message_id($message);
|
26 |
-
if (method_exists($this, $task)) {
|
27 |
-
check_admin_referer('nonce_fm', 'nonce_fm');
|
28 |
-
$this->$task($id);
|
29 |
-
}
|
30 |
-
else {
|
31 |
-
$this->display();
|
32 |
-
}
|
33 |
-
}
|
34 |
-
|
35 |
-
public function display() {
|
36 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelBlocked_ips_fm.php";
|
37 |
-
$model = new FMModelBlocked_ips_fmc();
|
38 |
-
|
39 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewBlocked_ips_fm.php";
|
40 |
-
$view = new FMViewBlocked_ips_fmc($model);
|
41 |
-
$view->display();
|
42 |
-
}
|
43 |
-
|
44 |
-
public function save() {
|
45 |
-
$message = $this->save_db();
|
46 |
-
// $this->display();
|
47 |
-
$page = WDW_FMC_Library::get('page');
|
48 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
49 |
-
}
|
50 |
-
|
51 |
-
public function save_db() {
|
52 |
-
global $wpdb;
|
53 |
-
$id = (isset($_POST['current_id']) ? (int) $_POST['current_id'] : 0);
|
54 |
-
$ip = (isset($_POST['ip']) ? esc_html(stripslashes($_POST['ip'])) : '');
|
55 |
-
if ($id != 0) {
|
56 |
-
$save = $wpdb->update($wpdb->prefix . 'formmaker_blocked', array(
|
57 |
-
'ip' => $ip,
|
58 |
-
), array('id' => $id));
|
59 |
-
}
|
60 |
-
else {
|
61 |
-
$save = $wpdb->insert($wpdb->prefix . 'formmaker_blocked', array(
|
62 |
-
'ip' => $ip,
|
63 |
-
), array(
|
64 |
-
'%s',
|
65 |
-
));
|
66 |
-
}
|
67 |
-
if ($save !== FALSE) {
|
68 |
-
$message = 1;
|
69 |
-
}
|
70 |
-
else {
|
71 |
-
$message = 2;
|
72 |
-
}
|
73 |
-
}
|
74 |
-
|
75 |
-
public function save_all() {
|
76 |
-
global $wpdb;
|
77 |
-
$flag = FALSE;
|
78 |
-
$ips_id_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker_blocked');
|
79 |
-
foreach ($ips_id_col as $ip_id) {
|
80 |
-
if (isset($_POST['ip' . $ip_id])) {
|
81 |
-
$ip = esc_html(stripslashes($_POST['ip' . $ip_id]));
|
82 |
-
if ($ip == '') {
|
83 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $ip_id));
|
84 |
-
}
|
85 |
-
else {
|
86 |
-
$flag = TRUE;
|
87 |
-
$wpdb->update($wpdb->prefix . 'formmaker_blocked', array(
|
88 |
-
'ip' => $ip,
|
89 |
-
), array('id' => $ip_id));
|
90 |
-
}
|
91 |
-
}
|
92 |
-
}
|
93 |
-
if ($flag) {
|
94 |
-
$message = 1;
|
95 |
-
}
|
96 |
-
else {
|
97 |
-
$message = 0;
|
98 |
-
}
|
99 |
-
// $this->display();
|
100 |
-
$page = WDW_FMC_Library::get('page');
|
101 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
102 |
-
}
|
103 |
-
|
104 |
-
public function delete($id) {
|
105 |
-
global $wpdb;
|
106 |
-
$query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $id);
|
107 |
-
if ($wpdb->query($query)) {
|
108 |
-
$message = 3;
|
109 |
-
}
|
110 |
-
else {
|
111 |
-
$message = 2;
|
112 |
-
}
|
113 |
-
// $this->display();
|
114 |
-
$page = WDW_FMC_Library::get('page');
|
115 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
116 |
-
}
|
117 |
-
|
118 |
-
public function delete_all() {
|
119 |
-
global $wpdb;
|
120 |
-
$flag = FALSE;
|
121 |
-
$ips_id_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker_blocked');
|
122 |
-
foreach ($ips_id_col as $ip_id) {
|
123 |
-
if (isset($_POST['check_' . $ip_id])) {
|
124 |
-
$flag = TRUE;
|
125 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $ip_id));
|
126 |
-
}
|
127 |
-
}
|
128 |
-
if ($flag) {
|
129 |
-
$message = 5;
|
130 |
-
}
|
131 |
-
else {
|
132 |
-
$message = 2;
|
133 |
-
}
|
134 |
-
// $this->display();
|
135 |
-
$page = WDW_FMC_Library::get('page');
|
136 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
137 |
-
}
|
138 |
-
|
139 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
140 |
-
// Getters & Setters //
|
141 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
142 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
143 |
-
// Private Methods //
|
144 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
145 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
146 |
-
// Listeners //
|
147 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
148 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/controllers/FMControllerFormMakerPreview.php
DELETED
@@ -1,43 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerFormMakerPreview_fmc {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function execute() {
|
22 |
-
$this->display();
|
23 |
-
}
|
24 |
-
|
25 |
-
public function display() {
|
26 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelFormMakerPreview.php";
|
27 |
-
$model = new FMModelFormMakerPreview_fmc();
|
28 |
-
|
29 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewFormMakerPreview.php";
|
30 |
-
$view = new FMViewFormMakerPreview_fmc($model);
|
31 |
-
$view->display();
|
32 |
-
}
|
33 |
-
|
34 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
35 |
-
// Getters & Setters //
|
36 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
37 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
38 |
-
// Private Methods //
|
39 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
40 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
41 |
-
// Listeners //
|
42 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
43 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/controllers/FMControllerFormMakerSQLMapping.php
DELETED
@@ -1,112 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerFormMakerSQLMapping_fmc {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function execute() {
|
22 |
-
$task = ((isset($_GET['task'])) ? esc_html($_GET['task']) : 0);
|
23 |
-
$id = ((isset($_GET['id'])) ? (int) $_GET['id'] : 0);
|
24 |
-
$form_id = ((isset($_GET['form_id'])) ? (int) $_GET['form_id'] : 0);
|
25 |
-
if ($task && method_exists($this, $task)) {
|
26 |
-
$this->$task($form_id);
|
27 |
-
}
|
28 |
-
else {
|
29 |
-
if ($id) {
|
30 |
-
$this->edit_query($id, $form_id);
|
31 |
-
}
|
32 |
-
else {
|
33 |
-
$this->add_query($form_id);
|
34 |
-
}
|
35 |
-
}
|
36 |
-
}
|
37 |
-
|
38 |
-
public function add_query($form_id) {
|
39 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelFormMakerSQLMapping.php";
|
40 |
-
$model = new FMModelFormMakerSQLMapping_fmc();
|
41 |
-
|
42 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewFormMakerSQLMapping.php";
|
43 |
-
$view = new FMViewFormMakerSQLMapping_fmc($model);
|
44 |
-
$view->add_query($form_id);
|
45 |
-
}
|
46 |
-
|
47 |
-
public function edit_query($id, $form_id) {
|
48 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelFormMakerSQLMapping.php";
|
49 |
-
$model = new FMModelFormMakerSQLMapping_fmc();
|
50 |
-
|
51 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewFormMakerSQLMapping.php";
|
52 |
-
$view = new FMViewFormMakerSQLMapping_fmc($model);
|
53 |
-
$view->edit_query($id, $form_id);
|
54 |
-
}
|
55 |
-
|
56 |
-
public function db_tables($form_id) {
|
57 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelFormMakerSQLMapping.php";
|
58 |
-
$model = new FMModelFormMakerSQLMapping_fmc();
|
59 |
-
|
60 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewFormMakerSQLMapping.php";
|
61 |
-
$view = new FMViewFormMakerSQLMapping_fmc($model);
|
62 |
-
$view->db_tables($form_id);
|
63 |
-
}
|
64 |
-
|
65 |
-
public function db_table_struct($form_id) {
|
66 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelFormMakerSQLMapping.php";
|
67 |
-
$model = new FMModelFormMakerSQLMapping_fmc();
|
68 |
-
|
69 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewFormMakerSQLMapping.php";
|
70 |
-
$view = new FMViewFormMakerSQLMapping_fmc($model);
|
71 |
-
$view->db_table_struct($form_id);
|
72 |
-
}
|
73 |
-
|
74 |
-
public function save_query() {
|
75 |
-
global $wpdb;
|
76 |
-
$form_id = ((isset($_GET['form_id'])) ? (int) $_GET['form_id'] : 0);
|
77 |
-
$query = ((isset($_POST['query'])) ? stripslashes(wp_specialchars_decode($_POST['query'])) : "");
|
78 |
-
$details = ((isset($_POST['details'])) ? esc_html($_POST['details']) : "");
|
79 |
-
$save = $wpdb->insert($wpdb->prefix . 'formmaker_query', array(
|
80 |
-
'form_id' => $form_id,
|
81 |
-
'query' => $query,
|
82 |
-
'details' => $details,
|
83 |
-
), array(
|
84 |
-
'%d',
|
85 |
-
'%s',
|
86 |
-
'%s',
|
87 |
-
));
|
88 |
-
}
|
89 |
-
|
90 |
-
public function update_query() {
|
91 |
-
global $wpdb;
|
92 |
-
$id = ((isset($_GET['id'])) ? (int) $_GET['id'] : 0);
|
93 |
-
$form_id = ((isset($_GET['form_id'])) ? (int) $_GET['form_id'] : 0);
|
94 |
-
$query = ((isset($_POST['query'])) ? stripslashes(wp_specialchars_decode($_POST['query'])) : "");
|
95 |
-
$details = ((isset($_POST['details'])) ? esc_html($_POST['details']) : "");
|
96 |
-
$save = $wpdb->update($wpdb->prefix . 'formmaker_query', array(
|
97 |
-
'form_id' => $form_id,
|
98 |
-
'query' => $query,
|
99 |
-
'details' => $details,
|
100 |
-
), array('id' => $id));
|
101 |
-
}
|
102 |
-
|
103 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
104 |
-
// Getters & Setters //
|
105 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
106 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
107 |
-
// Private Methods //
|
108 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
109 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
110 |
-
// Listeners //
|
111 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
112 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/controllers/FMControllerFormMakerSubmits.php
DELETED
@@ -1,43 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerFormMakerSubmits_fmc {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function execute() {
|
22 |
-
$this->display();
|
23 |
-
}
|
24 |
-
|
25 |
-
public function display() {
|
26 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelFormMakerSubmits.php";
|
27 |
-
$model = new FMModelFormMakerSubmits_fmc();
|
28 |
-
|
29 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewFormMakerSubmits.php";
|
30 |
-
$view = new FMViewFormMakerSubmits_fmc($model);
|
31 |
-
$view->display();
|
32 |
-
}
|
33 |
-
|
34 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
35 |
-
// Getters & Setters //
|
36 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
37 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
38 |
-
// Private Methods //
|
39 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
40 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
41 |
-
// Listeners //
|
42 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
43 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/controllers/FMControllerFormmakerwdcaptcha.php
DELETED
@@ -1,43 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerFormmakerwdcaptcha_fmc {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function execute() {
|
22 |
-
$this->display();
|
23 |
-
}
|
24 |
-
|
25 |
-
public function display() {
|
26 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelFormmakerwdcaptcha.php";
|
27 |
-
$model = new FMModelFormmakerwdcaptcha_fmc();
|
28 |
-
|
29 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewFormmakerwdcaptcha.php";
|
30 |
-
$view = new FMViewFormmakerwdcaptcha_fmc($model);
|
31 |
-
$view->display();
|
32 |
-
}
|
33 |
-
|
34 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
35 |
-
// Getters & Setters //
|
36 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
37 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
38 |
-
// Private Methods //
|
39 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
40 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
41 |
-
// Listeners //
|
42 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
43 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/controllers/FMControllerFormmakerwdmathcaptcha.php
DELETED
@@ -1,43 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerFormmakerwdmathcaptcha_fmc {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function execute() {
|
22 |
-
$this->display();
|
23 |
-
}
|
24 |
-
|
25 |
-
public function display() {
|
26 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelFormmakerwdmathcaptcha.php";
|
27 |
-
$model = new FMModelFormmakerwdmathcaptcha_fmc();
|
28 |
-
|
29 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewFormmakerwdmathcaptcha.php";
|
30 |
-
$view = new FMViewFormmakerwdmathcaptcha_fmc($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
DELETED
@@ -1,43 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerFormmakerwindow_fmc {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function execute() {
|
22 |
-
$this->display();
|
23 |
-
}
|
24 |
-
|
25 |
-
public function display() {
|
26 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelFormmakerwindow.php";
|
27 |
-
$model = new FMModelFormmakerwindow_fmc();
|
28 |
-
|
29 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewFormmakerwindow.php";
|
30 |
-
$view = new FMViewFormmakerwindow_fmc($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
DELETED
@@ -1,43 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerFromeditcountryinpopup_fmc {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function execute() {
|
22 |
-
$this->display();
|
23 |
-
}
|
24 |
-
|
25 |
-
public function display() {
|
26 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelFromeditcountryinpopup.php";
|
27 |
-
$model = new FMModelFromeditcountryinpopup_fmc();
|
28 |
-
|
29 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewFromeditcountryinpopup.php";
|
30 |
-
$view = new FMViewFromeditcountryinpopup_fmc($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
DELETED
@@ -1,43 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerFromipinfoinpopup_fmc {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function execute() {
|
22 |
-
$this->display();
|
23 |
-
}
|
24 |
-
|
25 |
-
public function display() {
|
26 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelFromipinfoinpopup.php";
|
27 |
-
$model = new FMModelFromipinfoinpopup_fmc();
|
28 |
-
|
29 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewFromipinfoinpopup.php";
|
30 |
-
$view = new FMViewFromipinfoinpopup_fmc($model);
|
31 |
-
$view->display();
|
32 |
-
}
|
33 |
-
|
34 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
35 |
-
// Getters & Setters //
|
36 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
37 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
38 |
-
// Private Methods //
|
39 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
40 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
41 |
-
// Listeners //
|
42 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
43 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/controllers/FMControllerFrommapeditinpopup.php
DELETED
@@ -1,43 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerFrommapeditinpopup_fmc {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function execute() {
|
22 |
-
$this->display();
|
23 |
-
}
|
24 |
-
|
25 |
-
public function display() {
|
26 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelFrommapeditinpopup.php";
|
27 |
-
$model = new FMModelFrommapeditinpopup_fmc();
|
28 |
-
|
29 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewFrommapeditinpopup.php";
|
30 |
-
$view = new FMViewFrommapeditinpopup_fmc($model);
|
31 |
-
$view->display();
|
32 |
-
}
|
33 |
-
|
34 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
35 |
-
// Getters & Setters //
|
36 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
37 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
38 |
-
// Private Methods //
|
39 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
40 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
41 |
-
// Listeners //
|
42 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
43 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/controllers/FMControllerGenerete_csv.php
DELETED
@@ -1,43 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerGenerete_csv_fmc {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function execute() {
|
22 |
-
$this->display();
|
23 |
-
}
|
24 |
-
|
25 |
-
public function display() {
|
26 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelGenerete_csv.php";
|
27 |
-
$model = new FMModelGenerete_csv_fmc();
|
28 |
-
|
29 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewGenerete_csv.php";
|
30 |
-
$view = new FMViewGenerete_csv_fmc($model);
|
31 |
-
$view->display();
|
32 |
-
}
|
33 |
-
|
34 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
35 |
-
// Getters & Setters //
|
36 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
37 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
38 |
-
// Private Methods //
|
39 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
40 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
41 |
-
// Listeners //
|
42 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
43 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/controllers/FMControllerGenerete_xml.php
DELETED
@@ -1,43 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerGenerete_xml_fmc {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function execute() {
|
22 |
-
$this->display();
|
23 |
-
}
|
24 |
-
|
25 |
-
public function display() {
|
26 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelGenerete_xml.php";
|
27 |
-
$model = new FMModelGenerete_xml_fmc();
|
28 |
-
|
29 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewGenerete_xml.php";
|
30 |
-
$view = new FMViewGenerete_xml_fmc($model);
|
31 |
-
$view->display();
|
32 |
-
}
|
33 |
-
|
34 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
35 |
-
// Getters & Setters //
|
36 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
37 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
38 |
-
// Private Methods //
|
39 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
40 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
41 |
-
// Listeners //
|
42 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
43 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/controllers/FMControllerGoptions_fm.php
DELETED
@@ -1,44 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerGoptions_fmc {
|
4 |
-
public function execute() {
|
5 |
-
$task = WDW_FMC_Library::get('task');
|
6 |
-
$id = (int)WDW_FMC_Library::get('current_id', 0);
|
7 |
-
$message = WDW_FMC_Library::get('message');
|
8 |
-
echo WDW_FMC_Library::message_id($message);
|
9 |
-
if (method_exists($this, $task)) {
|
10 |
-
check_admin_referer('nonce_fm', 'nonce_fm');
|
11 |
-
$this->$task($id);
|
12 |
-
}
|
13 |
-
else {
|
14 |
-
$this->display();
|
15 |
-
}
|
16 |
-
}
|
17 |
-
|
18 |
-
public function display() {
|
19 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelGoptions_fm.php";
|
20 |
-
$model = new FMModelGoptions_fmc();
|
21 |
-
|
22 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewGoptions_fm.php";
|
23 |
-
$view = new FMViewGoptions_fmc($model);
|
24 |
-
$view->display();
|
25 |
-
}
|
26 |
-
|
27 |
-
public function save() {
|
28 |
-
$message = $this->save_db();
|
29 |
-
$page = WDW_FMC_Library::get('page');
|
30 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
31 |
-
}
|
32 |
-
|
33 |
-
public function save_db() {
|
34 |
-
$public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
|
35 |
-
$private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
|
36 |
-
$csv_delimiter = (isset($_POST['csv_delimiter']) && $_POST['csv_delimiter'] != '' ? esc_html(stripslashes($_POST['csv_delimiter'])) : ',');
|
37 |
-
$fm_shortcode = (isset($_POST['fm_shortcode']) ? "old" : '');
|
38 |
-
$fm_advanced_layout = (isset($_POST['fm_advanced_layout']) ? '1' : '');
|
39 |
-
|
40 |
-
$map_key = (isset($_POST['map_key']) ? esc_html(stripslashes($_POST['map_key'])) : '');
|
41 |
-
update_option('fmc_settings', array('public_key' => $public_key, 'private_key' => $private_key, 'csv_delimiter' => $csv_delimiter, 'map_key' => $map_key, 'fm_shortcode' => $fm_shortcode, 'fm_advanced_layout' => $fm_advanced_layout,));
|
42 |
-
}
|
43 |
-
|
44 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/controllers/FMControllerLicensing_fm.php
DELETED
@@ -1,49 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerLicensing_fmc {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function execute() {
|
22 |
-
$task = ((isset($_POST['task'])) ? esc_html(stripslashes($_POST['task'])) : '');
|
23 |
-
if (method_exists($this, $task)) {
|
24 |
-
$this->$task($id);
|
25 |
-
}
|
26 |
-
else {
|
27 |
-
$this->display();
|
28 |
-
}
|
29 |
-
}
|
30 |
-
|
31 |
-
public function display() {
|
32 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelLicensing_fm.php";
|
33 |
-
$model = new FMModelLicensing_fmc();
|
34 |
-
|
35 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewLicensing_fm.php";
|
36 |
-
$view = new FMViewLicensing_fmc($model);
|
37 |
-
$view->display();
|
38 |
-
}
|
39 |
-
|
40 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
41 |
-
// Getters & Setters //
|
42 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
43 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
44 |
-
// Private Methods //
|
45 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
46 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
47 |
-
// Listeners //
|
48 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
49 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/controllers/FMControllerManage_fm.php
DELETED
@@ -1,1211 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerManage_fmc {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function execute() {
|
22 |
-
$task = WDW_FMC_Library::get('task');
|
23 |
-
$id = (int)WDW_FMC_Library::get('current_id', 0);
|
24 |
-
$message = WDW_FMC_Library::get('message');
|
25 |
-
echo WDW_FMC_Library::message_id($message);
|
26 |
-
if (method_exists($this, $task)) {
|
27 |
-
check_admin_referer('nonce_fm', 'nonce_fm');
|
28 |
-
$this->$task($id);
|
29 |
-
}
|
30 |
-
else {
|
31 |
-
$this->display();
|
32 |
-
}
|
33 |
-
}
|
34 |
-
|
35 |
-
public function undo() {
|
36 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelManage_fm.php";
|
37 |
-
$model = new FMModelManage_fmc();
|
38 |
-
|
39 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewManage_fm.php";
|
40 |
-
|
41 |
-
global $wpdb;
|
42 |
-
$backup_id = (int)WDW_FMC_Library::get('backup_id');
|
43 |
-
$id = (int)WDW_FMC_Library::get('id');
|
44 |
-
|
45 |
-
$query = "SELECT backup_id FROM ".$wpdb->prefix."formmaker_backup WHERE backup_id < $backup_id AND id = $id ORDER BY backup_id DESC LIMIT 0 , 1 ";
|
46 |
-
$backup_id = $wpdb->get_var($query);
|
47 |
-
|
48 |
-
$view = new FMViewManage_fmc($model);
|
49 |
-
$view->edit($backup_id);
|
50 |
-
}
|
51 |
-
|
52 |
-
public function redo() {
|
53 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelManage_fm.php";
|
54 |
-
$model = new FMModelManage_fmc();
|
55 |
-
|
56 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewManage_fm.php";
|
57 |
-
global $wpdb;
|
58 |
-
$backup_id = (int)WDW_FMC_Library::get('backup_id');
|
59 |
-
$id = (int)WDW_FMC_Library::get('id');
|
60 |
-
|
61 |
-
$query = "SELECT backup_id FROM ".$wpdb->prefix."formmaker_backup WHERE backup_id > $backup_id AND id = $id ORDER BY backup_id ASC LIMIT 0 , 1 ";
|
62 |
-
$backup_id = $wpdb->get_var($query);
|
63 |
-
|
64 |
-
$view = new FMViewManage_fmc($model);
|
65 |
-
$view->edit($backup_id);
|
66 |
-
}
|
67 |
-
|
68 |
-
public function display() {
|
69 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelManage_fm.php";
|
70 |
-
$model = new FMModelManage_fmc();
|
71 |
-
|
72 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewManage_fm.php";
|
73 |
-
$view = new FMViewManage_fmc($model);
|
74 |
-
$view->display();
|
75 |
-
}
|
76 |
-
|
77 |
-
public function add() {
|
78 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelManage_fm.php";
|
79 |
-
$model = new FMModelManage_fmc();
|
80 |
-
|
81 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewManage_fm.php";
|
82 |
-
$view = new FMViewManage_fmc($model);
|
83 |
-
$view->edit(0);
|
84 |
-
}
|
85 |
-
|
86 |
-
public function edit() {
|
87 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelManage_fm.php";
|
88 |
-
$model = new FMModelManage_fmc();
|
89 |
-
|
90 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewManage_fm.php";
|
91 |
-
$view = new FMViewManage_fmc($model);
|
92 |
-
$id = (int)WDW_FMC_Library::get('current_id', 0);
|
93 |
-
|
94 |
-
global $wpdb;
|
95 |
-
$query = "SELECT backup_id FROM ".$wpdb->prefix."formmaker_backup WHERE cur=1 and id=".$id;
|
96 |
-
$backup_id = $wpdb->get_var($query);
|
97 |
-
|
98 |
-
if(!$backup_id) {
|
99 |
-
$query = "SELECT max(backup_id) FROM ".$wpdb->prefix."formmaker_backup";
|
100 |
-
$backup_id = $wpdb->get_var($query);
|
101 |
-
if($backup_id)
|
102 |
-
$backup_id++;
|
103 |
-
else
|
104 |
-
$backup_id=1;
|
105 |
-
$query = "INSERT INTO ".$wpdb->prefix."formmaker_backup SELECT ".$backup_id." AS backup_id, 1 AS cur, formmakerbkup.id, formmakerbkup.title, formmakerbkup.type, formmakerbkup.mail, formmakerbkup.form_front, formmakerbkup.theme, formmakerbkup.javascript, formmakerbkup.submit_text, formmakerbkup.url, formmakerbkup.submit_text_type, formmakerbkup.script_mail, formmakerbkup.script_mail_user, formmakerbkup.counter, formmakerbkup.published, formmakerbkup.label_order, formmakerbkup.label_order_current, formmakerbkup.article_id, formmakerbkup.pagination, formmakerbkup.show_title, formmakerbkup.show_numbers, formmakerbkup.public_key, formmakerbkup.private_key, formmakerbkup.recaptcha_theme, formmakerbkup.paypal_mode, formmakerbkup.checkout_mode, formmakerbkup.paypal_email, formmakerbkup.payment_currency, formmakerbkup.tax, formmakerbkup.form_fields, formmakerbkup.savedb, formmakerbkup.sendemail, formmakerbkup.requiredmark, formmakerbkup.from_mail, formmakerbkup.from_name, formmakerbkup.reply_to, formmakerbkup.send_to, formmakerbkup.autogen_layout, formmakerbkup.custom_front, formmakerbkup.mail_from_user, formmakerbkup.mail_from_name_user, formmakerbkup.reply_to_user, formmakerbkup.condition, formmakerbkup.mail_cc, formmakerbkup.mail_cc_user, formmakerbkup.mail_bcc, formmakerbkup.mail_bcc_user, formmakerbkup.mail_subject, formmakerbkup.mail_subject_user, formmakerbkup.mail_mode, formmakerbkup.mail_mode_user, formmakerbkup.mail_attachment, formmakerbkup.mail_attachment_user, formmakerbkup.user_id_wd, formmakerbkup.sortable, formmakerbkup.frontend_submit_fields, formmakerbkup.frontend_submit_stat_fields, formmakerbkup.mail_emptyfields, formmakerbkup.mail_verify, formmakerbkup.mail_verify_expiretime, formmakerbkup.mail_verification_post_id, formmakerbkup.save_uploads, formmakerbkup.header_title, formmakerbkup.header_description, formmakerbkup.header_image_url, formmakerbkup.header_image_animation, formmakerbkup.header_hide_image FROM ".$wpdb->prefix."formmaker as formmakerbkup WHERE id=".$id;
|
106 |
-
$wpdb->query($query);
|
107 |
-
}
|
108 |
-
$view->edit($backup_id);
|
109 |
-
}
|
110 |
-
|
111 |
-
public function form_layout() {
|
112 |
-
if (!isset($_GET['task'])) {
|
113 |
-
$this->save_db();
|
114 |
-
}
|
115 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelManage_fm.php";
|
116 |
-
$model = new FMModelManage_fmc();
|
117 |
-
|
118 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewManage_fm.php";
|
119 |
-
$view = new FMViewManage_fmc($model);
|
120 |
-
global $wpdb;
|
121 |
-
$id = (int)WDW_FMC_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
|
122 |
-
$view->form_layout($id);
|
123 |
-
}
|
124 |
-
|
125 |
-
public function save_layout() {
|
126 |
-
$message = $this->save_db_layout();
|
127 |
-
$page = WDW_FMC_Library::get('page');
|
128 |
-
$current_id = (int)WDW_FMC_Library::get('current_id', 0);
|
129 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
|
130 |
-
}
|
131 |
-
|
132 |
-
public function apply_layout() {
|
133 |
-
$message = $this->save_db_layout();
|
134 |
-
$page = WDW_FMC_Library::get('page');
|
135 |
-
$current_id = (int)WDW_FMC_Library::get('current_id', 0);
|
136 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'form_layout', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
|
137 |
-
}
|
138 |
-
|
139 |
-
public function save_db_layout() {
|
140 |
-
global $wpdb;
|
141 |
-
$id = (int)WDW_FMC_Library::get('current_id', 0);
|
142 |
-
$custom_front = (isset($_POST['custom_front']) ? stripslashes($_POST['custom_front']) : '');
|
143 |
-
$autogen_layout = (isset($_POST['autogen_layout']) ? 1 : 0);
|
144 |
-
$save = $wpdb->update($wpdb->prefix . 'formmaker', array(
|
145 |
-
'custom_front' => $custom_front,
|
146 |
-
'autogen_layout' => $autogen_layout
|
147 |
-
), array('id' => $id));
|
148 |
-
if ($save !== FALSE) {
|
149 |
-
return 1;
|
150 |
-
}
|
151 |
-
else {
|
152 |
-
return 2;
|
153 |
-
}
|
154 |
-
}
|
155 |
-
|
156 |
-
public function form_options() {
|
157 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelManage_fm.php";
|
158 |
-
$model = new FMModelManage_fmc();
|
159 |
-
|
160 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewManage_fm.php";
|
161 |
-
$view = new FMViewManage_fmc($model);
|
162 |
-
|
163 |
-
global $wpdb;
|
164 |
-
$id = (int)WDW_FMC_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
|
165 |
-
$view->form_options($id);
|
166 |
-
}
|
167 |
-
|
168 |
-
public function display_options() {
|
169 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelManage_fm.php";
|
170 |
-
$model = new FMModelManage_fmc();
|
171 |
-
|
172 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewManage_fm.php";
|
173 |
-
$view = new FMViewManage_fmc($model);
|
174 |
-
|
175 |
-
global $wpdb;
|
176 |
-
$id = (int)WDW_FMC_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
|
177 |
-
$view->display_options($id);
|
178 |
-
}
|
179 |
-
|
180 |
-
public function save_options() {
|
181 |
-
$message = $this->save_db_options();
|
182 |
-
// $this->edit();
|
183 |
-
$page = WDW_FMC_Library::get('page');
|
184 |
-
$current_id = (int)WDW_FMC_Library::get('current_id', 0);
|
185 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
|
186 |
-
}
|
187 |
-
|
188 |
-
public function save_display_options() {
|
189 |
-
$message = $this->save_dis_options();
|
190 |
-
$page = WDW_FMC_Library::get('page');
|
191 |
-
$current_id = (int)WDW_FMC_Library::get('current_id', 0);
|
192 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
|
193 |
-
}
|
194 |
-
|
195 |
-
public function view_options() {
|
196 |
-
if (!isset($_GET['task'])) {
|
197 |
-
$this->save_db();
|
198 |
-
}
|
199 |
-
global $wpdb;
|
200 |
-
$page = WDW_FMC_Library::get('page');
|
201 |
-
$current_id = (int)WDW_FMC_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
|
202 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'form_options', 'current_id' => $current_id), admin_url('admin.php')));
|
203 |
-
}
|
204 |
-
|
205 |
-
public function view_display_options() {
|
206 |
-
if (!isset($_GET['task'])) {
|
207 |
-
$this->save_db();
|
208 |
-
}
|
209 |
-
global $wpdb;
|
210 |
-
$page = WDW_FMC_Library::get('page');
|
211 |
-
$current_id = (int)WDW_FMC_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
|
212 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display_options', 'current_id' => $current_id), admin_url('admin.php')));
|
213 |
-
}
|
214 |
-
|
215 |
-
public function apply_options() {
|
216 |
-
$message = $this->save_db_options();
|
217 |
-
$page = WDW_FMC_Library::get('page');
|
218 |
-
$current_id = (int)WDW_FMC_Library::get('current_id', 0);
|
219 |
-
$fieldset_id = WDW_FMC_Library::get('fieldset_id', 'general');
|
220 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'form_options', 'current_id' => $current_id, 'message' => $message, 'fieldset_id' => $fieldset_id), admin_url('admin.php')));
|
221 |
-
}
|
222 |
-
|
223 |
-
public function apply_display_options() {
|
224 |
-
$message = $this->save_dis_options();
|
225 |
-
$page = WDW_FMC_Library::get('page');
|
226 |
-
$current_id = (int)WDW_FMC_Library::get('current_id', 0);
|
227 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display_options', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
|
228 |
-
}
|
229 |
-
|
230 |
-
public function remove_query() {
|
231 |
-
global $wpdb;
|
232 |
-
$cid = ((isset($_POST['cid']) && $_POST['cid'] != '') ? $_POST['cid'] : NULL);
|
233 |
-
if (count($cid)) {
|
234 |
-
array_walk($cid, create_function('&$value', '$value = (int)$value;'));
|
235 |
-
$cids = implode(',', $cid);
|
236 |
-
$query = 'DELETE FROM ' . $wpdb->prefix . 'formmaker_query WHERE id IN ( ' . $cids . ' )';
|
237 |
-
if ($wpdb->query($query)) {
|
238 |
-
echo WDW_FMC_Library::message('Items Succesfully Deleted.', 'updated');
|
239 |
-
}
|
240 |
-
else {
|
241 |
-
echo WDW_FMC_Library::message('Error. Please install plugin again.', 'error');
|
242 |
-
}
|
243 |
-
}
|
244 |
-
else {
|
245 |
-
echo WDW_FMC_Library::message('You must select at least one item.', 'error');
|
246 |
-
}
|
247 |
-
$this->apply_options();
|
248 |
-
}
|
249 |
-
|
250 |
-
public function cancel_options() {
|
251 |
-
$this->edit();
|
252 |
-
}
|
253 |
-
|
254 |
-
public function save_db_options() {
|
255 |
-
$javascript = "// Occurs before the form is loaded
|
256 |
-
function before_load() {
|
257 |
-
|
258 |
-
}
|
259 |
-
// Occurs just before submitting the form
|
260 |
-
function before_submit() {
|
261 |
-
// IMPORTANT! If you want to interrupt (stop) the submitting of the form, this function should return true. You don't need to return any value if you don't want to stop the submission.
|
262 |
-
}
|
263 |
-
// Occurs just before resetting the form
|
264 |
-
function before_reset() {
|
265 |
-
|
266 |
-
}";
|
267 |
-
global $wpdb;
|
268 |
-
// $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
|
269 |
-
$id = (int)WDW_FMC_Library::get('current_id', 0);
|
270 |
-
$published = (isset($_POST['published']) ? esc_html(stripslashes($_POST['published'])) : 1);
|
271 |
-
$savedb = (isset($_POST['savedb']) ? esc_html(stripslashes($_POST['savedb'])) : 1);
|
272 |
-
$theme = (int)(isset($_POST['theme']) ? esc_html(stripslashes($_POST['theme'])) : $wpdb->get_var("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE `default`='1'"));
|
273 |
-
$requiredmark = (isset($_POST['requiredmark']) ? esc_html(stripslashes($_POST['requiredmark'])) : '*');
|
274 |
-
$sendemail = (isset($_POST['sendemail']) ? esc_html(stripslashes($_POST['sendemail'])) : 1);
|
275 |
-
$save_uploads = (isset($_POST['save_uploads']) ? esc_html(stripslashes($_POST['save_uploads'])) : 1);
|
276 |
-
$mail = (isset($_POST['mail']) ? esc_html(stripslashes($_POST['mail'])) : '');
|
277 |
-
if (isset($_POST['mailToAdd']) && esc_html(stripslashes($_POST['mailToAdd'])) != '') {
|
278 |
-
$mail .= esc_html(stripslashes($_POST['mailToAdd'])) . ',';
|
279 |
-
}
|
280 |
-
$from_mail = (isset($_POST['from_mail']) ? esc_html(stripslashes($_POST['from_mail'])) : '');
|
281 |
-
$from_name = (isset($_POST['from_name']) ? esc_html(stripslashes($_POST['from_name'])) : '');
|
282 |
-
$reply_to = (isset($_POST['reply_to']) ? esc_html(stripslashes($_POST['reply_to'])) : '');
|
283 |
-
if ($from_mail == "other") {
|
284 |
-
$from_mail = (isset($_POST['mail_from_other']) ? esc_html(stripslashes($_POST['mail_from_other'])) : '');
|
285 |
-
}
|
286 |
-
if ($reply_to == "other") {
|
287 |
-
$reply_to = (isset($_POST['reply_to_other']) ? esc_html(stripslashes($_POST['reply_to_other'])) : '');
|
288 |
-
}
|
289 |
-
$script_mail = (isset($_POST['script_mail']) ? stripslashes($_POST['script_mail']) : '%all%');
|
290 |
-
$mail_from_user = (isset($_POST['mail_from_user']) ? esc_html(stripslashes($_POST['mail_from_user'])) : '');
|
291 |
-
$mail_from_name_user = (isset($_POST['mail_from_name_user']) ? esc_html(stripslashes($_POST['mail_from_name_user'])) : '');
|
292 |
-
$reply_to_user = (isset($_POST['reply_to_user']) ? esc_html(stripslashes($_POST['reply_to_user'])) : '');
|
293 |
-
$condition = (isset($_POST['condition']) ? esc_html(stripslashes($_POST['condition'])) : '');
|
294 |
-
$mail_cc = (isset($_POST['mail_cc']) ? esc_html(stripslashes($_POST['mail_cc'])) : '');
|
295 |
-
$mail_cc_user = (isset($_POST['mail_cc_user']) ? esc_html(stripslashes($_POST['mail_cc_user'])) : '');
|
296 |
-
$mail_bcc = (isset($_POST['mail_bcc']) ? esc_html(stripslashes($_POST['mail_bcc'])) : '');
|
297 |
-
$mail_bcc_user = (isset($_POST['mail_bcc_user']) ? esc_html(stripslashes($_POST['mail_bcc_user'])) : '');
|
298 |
-
$mail_subject = (isset($_POST['mail_subject']) ? esc_html(stripslashes($_POST['mail_subject'])) : '');
|
299 |
-
$mail_subject_user = (isset($_POST['mail_subject_user']) ? esc_html(stripslashes($_POST['mail_subject_user'])) : '');
|
300 |
-
$mail_mode = (isset($_POST['mail_mode']) ? esc_html(stripslashes($_POST['mail_mode'])) : 1);
|
301 |
-
$mail_mode_user = (isset($_POST['mail_mode_user']) ? esc_html(stripslashes($_POST['mail_mode_user'])) : 1);
|
302 |
-
$mail_attachment = (isset($_POST['mail_attachment']) ? esc_html(stripslashes($_POST['mail_attachment'])) : 1);
|
303 |
-
$mail_attachment_user = (isset($_POST['mail_attachment_user']) ? esc_html(stripslashes($_POST['mail_attachment_user'])) : 1);
|
304 |
-
$script_mail_user = (isset($_POST['script_mail_user']) ? stripslashes($_POST['script_mail_user']) : '%all%');
|
305 |
-
$submit_text = (isset($_POST['submit_text']) ? stripslashes($_POST['submit_text']) : '');
|
306 |
-
$url = (isset($_POST['url']) ? esc_html(stripslashes($_POST['url'])) : '');
|
307 |
-
$tax = (isset($_POST['tax']) ? esc_html(stripslashes($_POST['tax'])) : 0);
|
308 |
-
$payment_currency = (isset($_POST['payment_currency']) ? stripslashes($_POST['payment_currency']) : '');
|
309 |
-
$paypal_email = (isset($_POST['paypal_email']) ? esc_html(stripslashes($_POST['paypal_email'])) : '');
|
310 |
-
$checkout_mode = (isset($_POST['checkout_mode']) ? esc_html(stripslashes($_POST['checkout_mode'])) : 'testmode');
|
311 |
-
$paypal_mode = (isset($_POST['paypal_mode']) ? esc_html(stripslashes($_POST['paypal_mode'])) : 0);
|
312 |
-
$javascript = (isset($_POST['javascript']) ? stripslashes($_POST['javascript']) : $javascript);
|
313 |
-
$user_id_wd = (isset($_POST['user_id_wd']) ? stripslashes($_POST['user_id_wd']) : 'administrator,');
|
314 |
-
$frontend_submit_fields = (isset($_POST['frontend_submit_fields']) ? stripslashes($_POST['frontend_submit_fields']) : '');
|
315 |
-
$frontend_submit_stat_fields = (isset($_POST['frontend_submit_stat_fields']) ? stripslashes($_POST['frontend_submit_stat_fields']) : '');
|
316 |
-
$mail_emptyfields = (isset($_POST['mail_emptyfields']) ? esc_html(stripslashes($_POST['mail_emptyfields'])) : 0);
|
317 |
-
$mail_verify = (isset($_POST['mail_verify']) ? esc_html(stripslashes($_POST['mail_verify'])) : 0);
|
318 |
-
$mail_verify_expiretime = (isset($_POST['mail_verify_expiretime']) ? esc_html(stripslashes($_POST['mail_verify_expiretime'])) : '');
|
319 |
-
$send_to = '';
|
320 |
-
for ($i = 0; $i < 20; $i++) {
|
321 |
-
if (isset($_POST['send_to' . $i])) {
|
322 |
-
$send_to .= '*' . esc_html(stripslashes($_POST['send_to' . $i])) . '*';
|
323 |
-
}
|
324 |
-
}
|
325 |
-
if (isset($_POST['submit_text_type'])) {
|
326 |
-
$submit_text_type = esc_html(stripslashes($_POST['submit_text_type']));
|
327 |
-
if ($submit_text_type == 5) {
|
328 |
-
$article_id = (isset($_POST['page_name']) ? esc_html(stripslashes($_POST['page_name'])) : 0);
|
329 |
-
}
|
330 |
-
else {
|
331 |
-
$article_id = (isset($_POST['post_name']) ? esc_html(stripslashes($_POST['post_name'])) : 0);
|
332 |
-
}
|
333 |
-
}
|
334 |
-
else {
|
335 |
-
$submit_text_type = 1;
|
336 |
-
$article_id = 0;
|
337 |
-
}
|
338 |
-
|
339 |
-
$mail_verification_post_id = (int)$wpdb->get_var('SELECT mail_verification_post_id FROM ' . $wpdb->prefix . 'formmaker WHERE mail_verification_post_id!=0');
|
340 |
-
if($mail_verify) {
|
341 |
-
$email_verification_post = array(
|
342 |
-
'post_title' => 'Email Verification',
|
343 |
-
'post_content' => '[email_verification]',
|
344 |
-
'post_status' => 'publish',
|
345 |
-
'post_author' => 1,
|
346 |
-
'post_type' => 'fmemailverification',
|
347 |
-
);
|
348 |
-
|
349 |
-
if(!$mail_verification_post_id || get_post( $mail_verification_post_id )===NULL) {
|
350 |
-
$mail_verification_post_id = wp_insert_post($email_verification_post);
|
351 |
-
$wpdb->update($wpdb->prefix . "formmaker", array(
|
352 |
-
'mail_verification_post_id' => $mail_verification_post_id,
|
353 |
-
), array('id' => 1), array(
|
354 |
-
'%d',
|
355 |
-
), array('%d'));
|
356 |
-
}
|
357 |
-
}
|
358 |
-
$paypal_mode = $paypal_mode == 'paypal' ? 1 : 0;
|
359 |
-
$save = $wpdb->update($wpdb->prefix . 'formmaker', array(
|
360 |
-
'published' => $published,
|
361 |
-
'savedb' => $savedb,
|
362 |
-
'theme' => $theme,
|
363 |
-
'requiredmark' => $requiredmark,
|
364 |
-
'sendemail' => $sendemail,
|
365 |
-
'save_uploads' => $save_uploads,
|
366 |
-
'mail' => $mail,
|
367 |
-
'from_mail' => $from_mail,
|
368 |
-
'from_name' => $from_name,
|
369 |
-
'reply_to' => $reply_to,
|
370 |
-
'script_mail' => $script_mail,
|
371 |
-
'mail_from_user' => $mail_from_user,
|
372 |
-
'mail_from_name_user' => $mail_from_name_user,
|
373 |
-
'reply_to_user' => $reply_to_user,
|
374 |
-
'condition' => $condition,
|
375 |
-
'mail_cc' => $mail_cc,
|
376 |
-
'mail_cc_user' => $mail_cc_user,
|
377 |
-
'mail_bcc' => $mail_bcc,
|
378 |
-
'mail_bcc_user' => $mail_bcc_user,
|
379 |
-
'mail_subject' => $mail_subject,
|
380 |
-
'mail_subject_user' => $mail_subject_user,
|
381 |
-
'mail_mode' => $mail_mode,
|
382 |
-
'mail_mode_user' => $mail_mode_user,
|
383 |
-
'mail_attachment' => $mail_attachment,
|
384 |
-
'mail_attachment_user' => $mail_attachment_user,
|
385 |
-
'script_mail_user' => $script_mail_user,
|
386 |
-
'submit_text' => $submit_text,
|
387 |
-
'url' => $url,
|
388 |
-
'submit_text_type' => $submit_text_type,
|
389 |
-
'article_id' => $article_id,
|
390 |
-
'tax' => $tax,
|
391 |
-
'payment_currency' => $payment_currency,
|
392 |
-
'paypal_email' => $paypal_email,
|
393 |
-
'checkout_mode' => $checkout_mode,
|
394 |
-
'paypal_mode' => $paypal_mode,
|
395 |
-
'javascript' => $javascript,
|
396 |
-
'user_id_wd' => $user_id_wd,
|
397 |
-
'send_to' => $send_to,
|
398 |
-
'frontend_submit_fields' => $frontend_submit_fields,
|
399 |
-
'frontend_submit_stat_fields' => $frontend_submit_stat_fields,
|
400 |
-
'mail_emptyfields' => $mail_emptyfields,
|
401 |
-
'mail_verify' => $mail_verify,
|
402 |
-
'mail_verify_expiretime' => $mail_verify_expiretime,
|
403 |
-
'mail_verification_post_id' => $mail_verification_post_id,
|
404 |
-
), array('id' => $id));
|
405 |
-
if ($save !== FALSE) {
|
406 |
-
$save_theme_in_backup = $wpdb->update($wpdb->prefix . 'formmaker_backup', array(
|
407 |
-
'theme' => $theme
|
408 |
-
), array('id' => $id));
|
409 |
-
return 8;
|
410 |
-
}
|
411 |
-
else {
|
412 |
-
return 2;
|
413 |
-
}
|
414 |
-
}
|
415 |
-
|
416 |
-
public function save_dis_options() {
|
417 |
-
global $wpdb;
|
418 |
-
$id = (int)WDW_FMC_Library::get('current_id', 0);
|
419 |
-
$scrollbox_loading_delay = (isset($_POST['scrollbox_loading_delay']) ? esc_html(stripslashes($_POST['scrollbox_loading_delay'])) : 0);
|
420 |
-
$popover_animate_effect = (isset($_POST['popover_animate_effect']) ? esc_html(stripslashes($_POST['popover_animate_effect'])) : '');
|
421 |
-
$popover_loading_delay = (isset($_POST['popover_loading_delay']) ? esc_html(stripslashes($_POST['popover_loading_delay'])) : 0);
|
422 |
-
$popover_frequency = (isset($_POST['popover_frequency']) ? esc_html(stripslashes($_POST['popover_frequency'])) : 0);
|
423 |
-
$topbar_position = (isset($_POST['topbar_position']) ? esc_html(stripslashes($_POST['topbar_position'])) : 1);
|
424 |
-
$topbar_remain_top = (isset($_POST['topbar_remain_top']) ? esc_html(stripslashes($_POST['topbar_remain_top'])) : 1);
|
425 |
-
$topbar_closing = (isset($_POST['topbar_closing']) ? esc_html(stripslashes($_POST['topbar_closing'])) : 1);
|
426 |
-
$topbar_hide_duration = (isset($_POST['topbar_hide_duration']) ? esc_html(stripslashes($_POST['topbar_hide_duration'])) : 0);
|
427 |
-
$scrollbox_position = (isset($_POST['scrollbox_position']) ? esc_html(stripslashes($_POST['scrollbox_position'])) : 1);
|
428 |
-
$scrollbox_trigger_point = (isset($_POST['scrollbox_trigger_point']) ? esc_html(stripslashes($_POST['scrollbox_trigger_point'])) : 20);
|
429 |
-
$scrollbox_hide_duration = (isset($_POST['scrollbox_hide_duration']) ? esc_html(stripslashes($_POST['scrollbox_hide_duration'])) : 0);
|
430 |
-
$scrollbox_auto_hide = (isset($_POST['scrollbox_auto_hide']) ? esc_html(stripslashes($_POST['scrollbox_auto_hide'])) :1);
|
431 |
-
$hide_mobile = (isset($_POST['hide_mobile']) ? esc_html(stripslashes($_POST['hide_mobile'])) : 0);
|
432 |
-
$scrollbox_closing = (isset($_POST['scrollbox_closing']) ? esc_html(stripslashes($_POST['scrollbox_closing'])) : 1);
|
433 |
-
$scrollbox_minimize = (isset($_POST['scrollbox_minimize']) ? esc_html(stripslashes($_POST['scrollbox_minimize'])) : 1);
|
434 |
-
$scrollbox_minimize_text = (isset($_POST['scrollbox_minimize_text']) ? esc_html(stripslashes($_POST['scrollbox_minimize_text'])) : '');
|
435 |
-
|
436 |
-
$type = (isset($_POST['form_type']) ? esc_html(stripslashes($_POST['form_type'])) : 'embadded');
|
437 |
-
$display_on = (isset($_POST['display_on']) ? esc_html(implode(',', $_POST['display_on'])) : '');
|
438 |
-
$posts_include = (isset($_POST['posts_include']) ? esc_html(stripslashes($_POST['posts_include'])) : '');
|
439 |
-
$pages_include = (isset($_POST['pages_include']) ? esc_html(stripslashes($_POST['pages_include'])) : '');
|
440 |
-
$display_on_categories = (isset($_POST['display_on_categories']) ? esc_html(implode(',', $_POST['display_on_categories'])) : '');
|
441 |
-
$current_categories = (isset($_POST['current_categories']) ? esc_html(stripslashes($_POST['current_categories'])) : '');
|
442 |
-
$show_for_admin = (isset($_POST['show_for_admin']) ? esc_html(stripslashes($_POST['show_for_admin'])) : 0);
|
443 |
-
|
444 |
-
$save = $wpdb->replace($wpdb->prefix . 'formmaker_display_options', array(
|
445 |
-
'form_id' => $id,
|
446 |
-
'type' => $type,
|
447 |
-
'scrollbox_loading_delay' => $scrollbox_loading_delay,
|
448 |
-
'popover_animate_effect' => $popover_animate_effect,
|
449 |
-
'popover_loading_delay' => $popover_loading_delay,
|
450 |
-
'popover_frequency' => $popover_frequency,
|
451 |
-
'topbar_position' => $topbar_position,
|
452 |
-
'topbar_remain_top' => $topbar_remain_top,
|
453 |
-
'topbar_closing' => $topbar_closing,
|
454 |
-
'topbar_hide_duration' => $topbar_hide_duration,
|
455 |
-
'scrollbox_position' => $scrollbox_position,
|
456 |
-
'scrollbox_trigger_point' => $scrollbox_trigger_point,
|
457 |
-
'scrollbox_hide_duration' => $scrollbox_hide_duration,
|
458 |
-
'scrollbox_auto_hide' => $scrollbox_auto_hide,
|
459 |
-
'hide_mobile' => $hide_mobile,
|
460 |
-
'scrollbox_closing' => $scrollbox_closing,
|
461 |
-
'scrollbox_minimize' => $scrollbox_minimize,
|
462 |
-
'scrollbox_minimize_text' => $scrollbox_minimize_text,
|
463 |
-
'display_on' => $display_on,
|
464 |
-
'posts_include' => $posts_include,
|
465 |
-
'pages_include' => $pages_include,
|
466 |
-
'display_on_categories' => $display_on_categories,
|
467 |
-
'current_categories' => $current_categories,
|
468 |
-
'show_for_admin' => $show_for_admin,
|
469 |
-
));
|
470 |
-
|
471 |
-
if ($save !== FALSE) {
|
472 |
-
$save_in_backup = $wpdb->update($wpdb->prefix . 'formmaker_backup', array(
|
473 |
-
'type' => $type
|
474 |
-
), array('id' => $id));
|
475 |
-
|
476 |
-
$save_in_form = $wpdb->update($wpdb->prefix . 'formmaker', array(
|
477 |
-
'type' => $type
|
478 |
-
), array('id' => $id));
|
479 |
-
return 8;
|
480 |
-
}
|
481 |
-
else {
|
482 |
-
return 2;
|
483 |
-
}
|
484 |
-
}
|
485 |
-
|
486 |
-
public function save_as_copy() {
|
487 |
-
$message = $this->save_db_as_copy();
|
488 |
-
$page = WDW_FMC_Library::get('page');
|
489 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
490 |
-
}
|
491 |
-
|
492 |
-
public function save() {
|
493 |
-
$message = $this->save_db();
|
494 |
-
$page = WDW_FMC_Library::get('page');
|
495 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
496 |
-
}
|
497 |
-
|
498 |
-
public function apply() {
|
499 |
-
$message = $this->save_db();
|
500 |
-
global $wpdb;
|
501 |
-
$id = (int) $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
|
502 |
-
$current_id = (int)WDW_FMC_Library::get('current_id', $id);
|
503 |
-
$page = WDW_FMC_Library::get('page');
|
504 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
|
505 |
-
}
|
506 |
-
|
507 |
-
public function save_db() {
|
508 |
-
global $wpdb;
|
509 |
-
$javascript = "// Occurs before the form is loaded
|
510 |
-
function before_load() {
|
511 |
-
}
|
512 |
-
// Occurs just before submitting the form
|
513 |
-
function before_submit() {
|
514 |
-
// IMPORTANT! If you want to interrupt (stop) the submitting of the form, this function should return true. You don't need to return any value if you don't want to stop the submission.
|
515 |
-
}
|
516 |
-
// Occurs just before resetting the form
|
517 |
-
function before_reset() {
|
518 |
-
}";
|
519 |
-
$id = (int)WDW_FMC_Library::get('current_id', 0);
|
520 |
-
$title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
|
521 |
-
$theme = (isset($_POST['theme']) ? esc_html(stripslashes($_POST['theme'])) : $wpdb->get_var("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE `default`='1'"));
|
522 |
-
$form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
|
523 |
-
$sortable = (isset($_POST['sortable']) ? stripslashes($_POST['sortable']) : 1);
|
524 |
-
$counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
|
525 |
-
$label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
|
526 |
-
$pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
|
527 |
-
$show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
|
528 |
-
$show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
|
529 |
-
$public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
|
530 |
-
$private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
|
531 |
-
$recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
|
532 |
-
$label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
|
533 |
-
$form_fields = (isset($_POST['form_fields']) ? stripslashes($_POST['form_fields']) : '');
|
534 |
-
|
535 |
-
$header_title = (isset($_POST['header_title']) ? esc_html(stripslashes($_POST['header_title'])) : '');
|
536 |
-
$header_description = (isset($_POST['header_description']) ? htmlspecialchars_decode(esc_html(stripslashes($_POST['header_description']))) : '');
|
537 |
-
$header_image_url = (isset($_POST['header_image_url']) ? esc_html(stripslashes($_POST['header_image_url'])) : '');
|
538 |
-
$header_image_animation = (isset($_POST['header_image_animation']) ? esc_html(stripslashes($_POST['header_image_animation'])) : '');
|
539 |
-
$header_hide_image = (isset($_POST['header_hide_image']) ? esc_html(stripslashes($_POST['header_hide_image'])) : 0);
|
540 |
-
$type = (isset($_POST['form_type']) ? esc_html(stripslashes($_POST['form_type'])) : 'embedded');
|
541 |
-
$scrollbox_minimize_text = $header_title ? $header_title : 'The form is minimized.';
|
542 |
-
|
543 |
-
if ($id != 0) {
|
544 |
-
$save = $wpdb->update($wpdb->prefix . 'formmaker', array(
|
545 |
-
'title' => $title,
|
546 |
-
'theme' => $theme,
|
547 |
-
'form_front' => $form_front,
|
548 |
-
'sortable' => $sortable,
|
549 |
-
'counter' => $counter,
|
550 |
-
'label_order' => $label_order,
|
551 |
-
'label_order_current' => $label_order_current,
|
552 |
-
'pagination' => $pagination,
|
553 |
-
'show_title' => $show_title,
|
554 |
-
'show_numbers' => $show_numbers,
|
555 |
-
'public_key' => $public_key,
|
556 |
-
'private_key' => $private_key,
|
557 |
-
'recaptcha_theme' => $recaptcha_theme,
|
558 |
-
'form_fields' => $form_fields,
|
559 |
-
'header_title' => $header_title,
|
560 |
-
'header_description' => $header_description,
|
561 |
-
'header_image_url' => $header_image_url,
|
562 |
-
'header_image_animation' => $header_image_animation,
|
563 |
-
'header_hide_image' => $header_hide_image,
|
564 |
-
), array('id' => $id));
|
565 |
-
}
|
566 |
-
else {
|
567 |
-
$save = $wpdb->insert($wpdb->prefix . 'formmaker', array(
|
568 |
-
'title' => $title,
|
569 |
-
'type' => $type,
|
570 |
-
'mail' => '',
|
571 |
-
'form_front' => $form_front,
|
572 |
-
'theme' => $theme,
|
573 |
-
'counter' => $counter,
|
574 |
-
'label_order' => $label_order,
|
575 |
-
'pagination' => $pagination,
|
576 |
-
'show_title' => $show_title,
|
577 |
-
'show_numbers' => $show_numbers,
|
578 |
-
'public_key' => $public_key,
|
579 |
-
'private_key' => $private_key,
|
580 |
-
'recaptcha_theme' => $recaptcha_theme,
|
581 |
-
'javascript' => $javascript,
|
582 |
-
'submit_text' => '',
|
583 |
-
'url' => '',
|
584 |
-
'article_id' => 0,
|
585 |
-
'submit_text_type' => 1,
|
586 |
-
'script_mail' => '%all%',
|
587 |
-
'script_mail_user' => '%all%',
|
588 |
-
'label_order_current' => $label_order_current,
|
589 |
-
'tax' => 0,
|
590 |
-
'payment_currency' => '',
|
591 |
-
'paypal_email' => '',
|
592 |
-
'checkout_mode' => 'testmode',
|
593 |
-
'paypal_mode' => 0,
|
594 |
-
'published' => 1,
|
595 |
-
'form_fields' => $form_fields,
|
596 |
-
'savedb' => 1,
|
597 |
-
'sendemail' => 1,
|
598 |
-
'requiredmark' => '*',
|
599 |
-
'from_mail' => '',
|
600 |
-
'from_name' => '',
|
601 |
-
'reply_to' => '',
|
602 |
-
'send_to' => '',
|
603 |
-
'autogen_layout' => 1,
|
604 |
-
'custom_front' => '',
|
605 |
-
'mail_from_user' => '',
|
606 |
-
'mail_from_name_user' => '',
|
607 |
-
'reply_to_user' => '',
|
608 |
-
'condition' => '',
|
609 |
-
'mail_cc' => '',
|
610 |
-
'mail_cc_user' => '',
|
611 |
-
'mail_bcc' => '',
|
612 |
-
'mail_bcc_user' => '',
|
613 |
-
'mail_subject' => '',
|
614 |
-
'mail_subject_user' => '',
|
615 |
-
'mail_mode' => 1,
|
616 |
-
'mail_mode_user' => 1,
|
617 |
-
'mail_attachment' => 1,
|
618 |
-
'mail_attachment_user' => 1,
|
619 |
-
'sortable' => $sortable,
|
620 |
-
'user_id_wd' => 'administrator,',
|
621 |
-
'frontend_submit_fields' => '',
|
622 |
-
'frontend_submit_stat_fields' => '',
|
623 |
-
'save_uploads' => 1,
|
624 |
-
|
625 |
-
'header_title' => $header_title,
|
626 |
-
'header_description' => $header_description,
|
627 |
-
'header_image_url' => $header_image_url,
|
628 |
-
'header_image_animation' => $header_image_animation,
|
629 |
-
'header_hide_image' => $header_hide_image,
|
630 |
-
));
|
631 |
-
$id = (int)$wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
|
632 |
-
update_option('contact_form_forms', ((get_option('contact_form_forms')) ? (get_option('contact_form_forms')) . ',' . $id : $id));
|
633 |
-
$save_display_options = $wpdb->insert($wpdb->prefix . 'formmaker_display_options', array(
|
634 |
-
'form_id' => $id,
|
635 |
-
'type' => $type,
|
636 |
-
'scrollbox_loading_delay' => 0,
|
637 |
-
'popover_animate_effect' => '',
|
638 |
-
'popover_loading_delay' => 0,
|
639 |
-
'popover_frequency' => 0,
|
640 |
-
'topbar_position' => 1,
|
641 |
-
'topbar_remain_top' => 1,
|
642 |
-
'topbar_closing' => 1,
|
643 |
-
'topbar_hide_duration' => 0,
|
644 |
-
'scrollbox_position' => 1,
|
645 |
-
'scrollbox_trigger_point' => 20,
|
646 |
-
'scrollbox_hide_duration' => 0,
|
647 |
-
'scrollbox_auto_hide' => 1,
|
648 |
-
'hide_mobile' => 0,
|
649 |
-
'scrollbox_closing' => 1,
|
650 |
-
'scrollbox_minimize' => 1,
|
651 |
-
'scrollbox_minimize_text' => $scrollbox_minimize_text,
|
652 |
-
'display_on' => 'home,post,page',
|
653 |
-
'posts_include' => '',
|
654 |
-
'pages_include' => '',
|
655 |
-
'display_on_categories' => '',
|
656 |
-
'current_categories' => '',
|
657 |
-
'show_for_admin' => 0,
|
658 |
-
), array(
|
659 |
-
'%d',
|
660 |
-
'%s',
|
661 |
-
'%d',
|
662 |
-
'%s',
|
663 |
-
'%d',
|
664 |
-
'%d',
|
665 |
-
'%d',
|
666 |
-
'%d',
|
667 |
-
'%d',
|
668 |
-
'%d',
|
669 |
-
'%d',
|
670 |
-
'%d',
|
671 |
-
'%d',
|
672 |
-
'%d',
|
673 |
-
'%d',
|
674 |
-
'%d',
|
675 |
-
'%d',
|
676 |
-
'%s',
|
677 |
-
'%s',
|
678 |
-
'%s',
|
679 |
-
'%s',
|
680 |
-
'%s',
|
681 |
-
'%s',
|
682 |
-
'%d',
|
683 |
-
));
|
684 |
-
$wpdb->insert($wpdb->prefix . 'formmaker_views', array(
|
685 |
-
'form_id' => $id,
|
686 |
-
'views' => 0
|
687 |
-
), array(
|
688 |
-
'%d',
|
689 |
-
'%d'
|
690 |
-
));
|
691 |
-
}
|
692 |
-
|
693 |
-
$backup_id = (isset($_POST['backup_id']) ? (int)esc_html(stripslashes($_POST['backup_id'])) : '');
|
694 |
-
|
695 |
-
if($backup_id)
|
696 |
-
{
|
697 |
-
$query = "SELECT backup_id FROM ".$wpdb->prefix."formmaker_backup WHERE backup_id > ".$backup_id." AND id = ".$id." ORDER BY backup_id ASC LIMIT 0 , 1 ";
|
698 |
-
|
699 |
-
if($wpdb->get_var($query))
|
700 |
-
{
|
701 |
-
$query = "DELETE FROM ".$wpdb->prefix."formmaker_backup WHERE backup_id > ".$backup_id." AND id = ".$id;
|
702 |
-
$wpdb->query($query);
|
703 |
-
}
|
704 |
-
|
705 |
-
$row = $wpdb->get_row($wpdb->prepare("SELECT form_fields, form_front FROM ".$wpdb->prefix."formmaker_backup WHERE backup_id = '%d'", $backup_id));
|
706 |
-
|
707 |
-
if($row->form_fields==$form_fields and $row->form_front==$form_front)
|
708 |
-
{
|
709 |
-
$save = $wpdb->update($wpdb->prefix . 'formmaker_backup', array(
|
710 |
-
'cur' => 1,
|
711 |
-
'title' => $title,
|
712 |
-
'theme' => $theme,
|
713 |
-
'form_front' => $form_front,
|
714 |
-
'sortable' => $sortable,
|
715 |
-
'counter' => $counter,
|
716 |
-
'label_order' => $label_order,
|
717 |
-
'label_order_current' => $label_order_current,
|
718 |
-
'pagination' => $pagination,
|
719 |
-
'show_title' => $show_title,
|
720 |
-
'show_numbers' => $show_numbers,
|
721 |
-
'public_key' => $public_key,
|
722 |
-
'private_key' => $private_key,
|
723 |
-
'recaptcha_theme' => $recaptcha_theme,
|
724 |
-
'form_fields' => $form_fields,
|
725 |
-
'header_title' => $header_title,
|
726 |
-
'header_description' => $header_description,
|
727 |
-
'header_image_url' => $header_image_url,
|
728 |
-
'header_image_animation' => $header_image_animation,
|
729 |
-
'header_hide_image' => $header_hide_image,
|
730 |
-
), array('backup_id' => $backup_id));
|
731 |
-
|
732 |
-
|
733 |
-
if ($save !== FALSE) {
|
734 |
-
return 1;
|
735 |
-
}
|
736 |
-
else {
|
737 |
-
return 2;
|
738 |
-
}
|
739 |
-
}
|
740 |
-
}
|
741 |
-
|
742 |
-
$wpdb->query("UPDATE ".$wpdb->prefix."formmaker_backup SET cur=0 WHERE id=".$id );
|
743 |
-
$save = $wpdb->insert($wpdb->prefix . 'formmaker_backup', array(
|
744 |
-
'cur' => 1,
|
745 |
-
'id' => $id,
|
746 |
-
'title' => $title,
|
747 |
-
'mail' => '',
|
748 |
-
'form_front' => $form_front,
|
749 |
-
'theme' => $theme,
|
750 |
-
'counter' => $counter,
|
751 |
-
'label_order' => $label_order,
|
752 |
-
'pagination' => $pagination,
|
753 |
-
'show_title' => $show_title,
|
754 |
-
'show_numbers' => $show_numbers,
|
755 |
-
'public_key' => $public_key,
|
756 |
-
'private_key' => $private_key,
|
757 |
-
'recaptcha_theme' => $recaptcha_theme,
|
758 |
-
'javascript' => $javascript,
|
759 |
-
'submit_text' => '',
|
760 |
-
'url' => '',
|
761 |
-
'article_id' => 0,
|
762 |
-
'submit_text_type' => 1,
|
763 |
-
'script_mail' => '%all%',
|
764 |
-
'script_mail_user' => '%all%',
|
765 |
-
'label_order_current' => $label_order_current,
|
766 |
-
'tax' => 0,
|
767 |
-
'payment_currency' => '',
|
768 |
-
'paypal_email' => '',
|
769 |
-
'checkout_mode' => 'testmode',
|
770 |
-
'paypal_mode' => 0,
|
771 |
-
'published' => 1,
|
772 |
-
'form_fields' => $form_fields,
|
773 |
-
'savedb' => 1,
|
774 |
-
'sendemail' => 1,
|
775 |
-
'requiredmark' => '*',
|
776 |
-
'from_mail' => '',
|
777 |
-
'from_name' => '',
|
778 |
-
'reply_to' => '',
|
779 |
-
'send_to' => '',
|
780 |
-
'autogen_layout' => 1,
|
781 |
-
'custom_front' => '',
|
782 |
-
'mail_from_user' => '',
|
783 |
-
'mail_from_name_user' => '',
|
784 |
-
'reply_to_user' => '',
|
785 |
-
'condition' => '',
|
786 |
-
'mail_cc' => '',
|
787 |
-
'mail_cc_user' => '',
|
788 |
-
'mail_bcc' => '',
|
789 |
-
'mail_bcc_user' => '',
|
790 |
-
'mail_subject' => '',
|
791 |
-
'mail_subject_user' => '',
|
792 |
-
'mail_mode' => 1,
|
793 |
-
'mail_mode_user' => 1,
|
794 |
-
'mail_attachment' => 1,
|
795 |
-
'mail_attachment_user' => 1,
|
796 |
-
'sortable' => $sortable,
|
797 |
-
'user_id_wd' => 'administrator,',
|
798 |
-
'frontend_submit_fields' => '',
|
799 |
-
'frontend_submit_stat_fields' => '',
|
800 |
-
'header_title' => $header_title,
|
801 |
-
'header_description' => $header_description,
|
802 |
-
'header_image_url' => $header_image_url,
|
803 |
-
'header_image_animation' => $header_image_animation,
|
804 |
-
'header_hide_image' => $header_hide_image,
|
805 |
-
), array(
|
806 |
-
'%d',
|
807 |
-
'%d',
|
808 |
-
'%s',
|
809 |
-
'%s',
|
810 |
-
'%s',
|
811 |
-
'%d',
|
812 |
-
'%d',
|
813 |
-
'%s',
|
814 |
-
'%s',
|
815 |
-
'%s',
|
816 |
-
'%s',
|
817 |
-
'%s',
|
818 |
-
'%s',
|
819 |
-
'%s',
|
820 |
-
'%s',
|
821 |
-
'%s',
|
822 |
-
'%s',
|
823 |
-
'%d',
|
824 |
-
'%d',
|
825 |
-
'%s',
|
826 |
-
'%s',
|
827 |
-
'%s',
|
828 |
-
'%s',
|
829 |
-
'%s',
|
830 |
-
'%s',
|
831 |
-
'%s',
|
832 |
-
'%d',
|
833 |
-
'%d',
|
834 |
-
'%s',
|
835 |
-
'%d',
|
836 |
-
'%d',
|
837 |
-
'%s',
|
838 |
-
'%s',
|
839 |
-
'%s',
|
840 |
-
'%s',
|
841 |
-
'%s',
|
842 |
-
'%d',
|
843 |
-
'%s',
|
844 |
-
'%s',
|
845 |
-
'%s',
|
846 |
-
'%s',
|
847 |
-
'%s',
|
848 |
-
'%s',
|
849 |
-
'%s',
|
850 |
-
'%s',
|
851 |
-
'%s',
|
852 |
-
'%s',
|
853 |
-
'%s',
|
854 |
-
'%d',
|
855 |
-
'%d',
|
856 |
-
'%d',
|
857 |
-
'%d',
|
858 |
-
'%d',
|
859 |
-
'%s',
|
860 |
-
'%s',
|
861 |
-
'%s',
|
862 |
-
'%s',
|
863 |
-
'%s',
|
864 |
-
'%s',
|
865 |
-
'%s',
|
866 |
-
'%d',
|
867 |
-
)) ;
|
868 |
-
|
869 |
-
$query = "SELECT count(backup_id) FROM ".$wpdb->prefix."formmaker_backup WHERE id = ".$id;
|
870 |
-
$wpdb->get_var($query);
|
871 |
-
if($wpdb->get_var($query)>10)
|
872 |
-
{
|
873 |
-
$query = "DELETE FROM ".$wpdb->prefix."formmaker_backup WHERE id = ".$id." ORDER BY backup_id ASC LIMIT 1 ";
|
874 |
-
$wpdb->query($query);
|
875 |
-
}
|
876 |
-
|
877 |
-
if ($save !== FALSE) {
|
878 |
-
return 1;
|
879 |
-
}
|
880 |
-
else {
|
881 |
-
return 2;
|
882 |
-
}
|
883 |
-
}
|
884 |
-
|
885 |
-
public function save_db_as_copy() {
|
886 |
-
global $wpdb;
|
887 |
-
$id = (int)WDW_FMC_Library::get('current_id', 0);
|
888 |
-
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
|
889 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelManage_fm.php";
|
890 |
-
$model = new FMModelManage_fmc();
|
891 |
-
$row_display = $model->get_display_options($id);
|
892 |
-
$title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
|
893 |
-
$theme = (isset($_POST['theme']) ? esc_html(stripslashes($_POST['theme'])) : 0);
|
894 |
-
$form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
|
895 |
-
$sortable = (isset($_POST['sortable']) ? stripslashes($_POST['sortable']) : 1);
|
896 |
-
$counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
|
897 |
-
$label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
|
898 |
-
$label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
|
899 |
-
$pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
|
900 |
-
$show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
|
901 |
-
$show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
|
902 |
-
$public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
|
903 |
-
$private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
|
904 |
-
$recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
|
905 |
-
$form_fields = (isset($_POST['form_fields']) ? stripslashes($_POST['form_fields']) : '');
|
906 |
-
|
907 |
-
$save = $wpdb->insert($wpdb->prefix . 'formmaker', array(
|
908 |
-
'title' => $title,
|
909 |
-
'type' => $row->type,
|
910 |
-
'mail' => $row->mail,
|
911 |
-
'form_front' => $form_front,
|
912 |
-
'theme' => $theme,
|
913 |
-
'counter' => $counter,
|
914 |
-
'label_order' => $label_order,
|
915 |
-
'pagination' => $pagination,
|
916 |
-
'show_title' => $show_title,
|
917 |
-
'show_numbers' => $show_numbers,
|
918 |
-
'public_key' => $public_key,
|
919 |
-
'private_key' => $private_key,
|
920 |
-
'recaptcha_theme' => $recaptcha_theme,
|
921 |
-
'javascript' => $row->javascript,
|
922 |
-
'submit_text' => $row->submit_text,
|
923 |
-
'url' => $row->url,
|
924 |
-
'article_id' => $row->article_id,
|
925 |
-
'submit_text_type' => $row->submit_text_type,
|
926 |
-
'script_mail' => $row->script_mail,
|
927 |
-
'script_mail_user' => $row->script_mail_user,
|
928 |
-
'label_order_current' => $label_order_current,
|
929 |
-
'tax' => $row->tax,
|
930 |
-
'payment_currency' => $row->payment_currency,
|
931 |
-
'paypal_email' => $row->paypal_email,
|
932 |
-
'checkout_mode' => $row->checkout_mode,
|
933 |
-
'paypal_mode' => $row->paypal_mode,
|
934 |
-
'published' => $row->published,
|
935 |
-
'form_fields' => $form_fields,
|
936 |
-
'savedb' => $row->savedb,
|
937 |
-
'sendemail' => $row->sendemail,
|
938 |
-
'requiredmark' => $row->requiredmark,
|
939 |
-
'from_mail' => $row->from_mail,
|
940 |
-
'from_name' => $row->from_name,
|
941 |
-
'reply_to' => $row->reply_to,
|
942 |
-
'send_to' => $row->send_to,
|
943 |
-
'autogen_layout' => $row->autogen_layout,
|
944 |
-
'custom_front' => $row->custom_front,
|
945 |
-
'mail_from_user' => $row->mail_from_user,
|
946 |
-
'mail_from_name_user' => $row->mail_from_name_user,
|
947 |
-
'reply_to_user' => $row->reply_to_user,
|
948 |
-
'condition' => $row->condition,
|
949 |
-
'mail_cc' => $row->mail_cc,
|
950 |
-
'mail_cc_user' => $row->mail_cc_user,
|
951 |
-
'mail_bcc' => $row->mail_bcc,
|
952 |
-
'mail_bcc_user' => $row->mail_bcc_user,
|
953 |
-
'mail_subject' => $row->mail_subject,
|
954 |
-
'mail_subject_user' => $row->mail_subject_user,
|
955 |
-
'mail_mode' => $row->mail_mode,
|
956 |
-
'mail_mode_user' => $row->mail_mode_user,
|
957 |
-
'mail_attachment' => $row->mail_attachment,
|
958 |
-
'mail_attachment_user' => $row->mail_attachment_user,
|
959 |
-
'sortable' => $sortable,
|
960 |
-
'user_id_wd' => $row->user_id_wd,
|
961 |
-
'frontend_submit_fields' => $row->frontend_submit_fields,
|
962 |
-
'frontend_submit_stat_fields' => $row->frontend_submit_stat_fields,
|
963 |
-
'save_uploads' => $row->save_uploads,
|
964 |
-
|
965 |
-
'header_title' => $row->header_title,
|
966 |
-
'header_description' => $row->header_description,
|
967 |
-
'header_image_url' => $row->header_image_url,
|
968 |
-
'header_image_animation' => $row->header_image_animation,
|
969 |
-
'header_hide_image' => $row->header_hide_image,
|
970 |
-
));
|
971 |
-
$new_id = (int)$wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
|
972 |
-
update_option('contact_form_forms', ((get_option('contact_form_forms')) ? (get_option('contact_form_forms')) . ',' . $new_id : $new_id));
|
973 |
-
$save = $wpdb->insert($wpdb->prefix . 'formmaker_display_options', array(
|
974 |
-
'form_id' => $new_id,
|
975 |
-
'type' => $row_display->type,
|
976 |
-
'scrollbox_loading_delay' => $row_display->scrollbox_loading_delay,
|
977 |
-
'popover_animate_effect' => $row_display->popover_animate_effect,
|
978 |
-
'popover_loading_delay' => $row_display->popover_loading_delay,
|
979 |
-
'popover_frequency' => $row_display->popover_frequency,
|
980 |
-
'topbar_position' => $row_display->topbar_position,
|
981 |
-
'topbar_remain_top' => $row_display->topbar_remain_top,
|
982 |
-
'topbar_closing' => $row_display->topbar_closing,
|
983 |
-
'topbar_hide_duration' => $row_display->topbar_hide_duration,
|
984 |
-
'scrollbox_position' => $row_display->scrollbox_position,
|
985 |
-
'scrollbox_trigger_point' => $row_display->scrollbox_trigger_point,
|
986 |
-
'scrollbox_hide_duration' => $row_display->scrollbox_hide_duration,
|
987 |
-
'scrollbox_auto_hide' => $row_display->scrollbox_auto_hide,
|
988 |
-
'hide_mobile' => $row_display->hide_mobile,
|
989 |
-
'scrollbox_closing' => $row_display->scrollbox_closing,
|
990 |
-
'scrollbox_minimize' => $row_display->scrollbox_minimize,
|
991 |
-
'scrollbox_minimize_text' => $row_display->scrollbox_minimize_text,
|
992 |
-
'display_on' => $row_display->display_on,
|
993 |
-
'posts_include' => $row_display->posts_include,
|
994 |
-
'pages_include' => $row_display->pages_include,
|
995 |
-
'display_on_categories' => $row_display->display_on_categories,
|
996 |
-
'current_categories' => $row_display->current_categories,
|
997 |
-
'show_for_admin' => $row_display->show_for_admin,
|
998 |
-
), array(
|
999 |
-
'%d',
|
1000 |
-
'%s',
|
1001 |
-
'%d',
|
1002 |
-
'%s',
|
1003 |
-
'%d',
|
1004 |
-
'%d',
|
1005 |
-
'%d',
|
1006 |
-
'%d',
|
1007 |
-
'%d',
|
1008 |
-
'%d',
|
1009 |
-
'%d',
|
1010 |
-
'%d',
|
1011 |
-
'%d',
|
1012 |
-
'%d',
|
1013 |
-
'%d',
|
1014 |
-
'%d',
|
1015 |
-
'%d',
|
1016 |
-
'%s',
|
1017 |
-
'%s',
|
1018 |
-
'%s',
|
1019 |
-
'%s',
|
1020 |
-
'%s',
|
1021 |
-
'%s',
|
1022 |
-
'%d'
|
1023 |
-
));
|
1024 |
-
$wpdb->insert($wpdb->prefix . 'formmaker_views', array(
|
1025 |
-
'form_id' => $new_id,
|
1026 |
-
'views' => 0
|
1027 |
-
), array(
|
1028 |
-
'%d',
|
1029 |
-
'%d'
|
1030 |
-
));
|
1031 |
-
if ($save !== FALSE) {
|
1032 |
-
$addons = array('WD_FM_EMAIL_COND' => 'Conditional Emails', 'WD_FM_PDF' => 'PDF Integration', 'WD_FM_SAVE_PROG' => 'Save Form Progress', 'WD_FM_CALCULATOR' => 'Calculator');
|
1033 |
-
$addons_array = array();
|
1034 |
-
foreach($addons as $addon => $addon_name) {
|
1035 |
-
if (defined($addon) && is_plugin_active(constant($addon))) {
|
1036 |
-
$_GET['addon_task'] = 'save_as_copy';
|
1037 |
-
$_GET['form_id'] = $id;
|
1038 |
-
$_GET['form_id_new'] = $new_id;
|
1039 |
-
do_action($addon.'_init');
|
1040 |
-
}
|
1041 |
-
}
|
1042 |
-
return 1;
|
1043 |
-
}
|
1044 |
-
else {
|
1045 |
-
return 2;
|
1046 |
-
}
|
1047 |
-
}
|
1048 |
-
|
1049 |
-
public function delete($id) {
|
1050 |
-
global $wpdb;
|
1051 |
-
$query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id);
|
1052 |
-
if ($wpdb->query($query)) {
|
1053 |
-
$arr = explode(',', get_option('contact_form_forms'));
|
1054 |
-
$arr = array_diff($arr, array($id));
|
1055 |
-
$arr = implode(',', $arr);
|
1056 |
-
update_option('contact_form_forms', $arr);
|
1057 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="%d"', $id));
|
1058 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id="%d"', $id));
|
1059 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_sessions WHERE form_id="%d"', $id));
|
1060 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_backup WHERE id="%d"', $id));
|
1061 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_display_options WHERE form_id="%d"', $id));
|
1062 |
-
$addons = array('WD_FM_EMAIL_COND' => 'Conditional Emails', 'WD_FM_PDF' => 'PDF Integration', 'WD_FM_SAVE_PROG' => 'Save Form Progress', 'WD_FM_CALCULATOR' => 'Calculator');
|
1063 |
-
$addons_array = array();
|
1064 |
-
foreach($addons as $addon => $addon_name) {
|
1065 |
-
if (defined($addon) && is_plugin_active(constant($addon))) {
|
1066 |
-
$_GET['addon_task'] = 'delete';
|
1067 |
-
$_GET['form_id'] = $id;
|
1068 |
-
do_action($addon.'_init');
|
1069 |
-
}
|
1070 |
-
}
|
1071 |
-
$message = 3;
|
1072 |
-
}
|
1073 |
-
else {
|
1074 |
-
$message = 2;
|
1075 |
-
}
|
1076 |
-
$page = WDW_FMC_Library::get('page');
|
1077 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
1078 |
-
}
|
1079 |
-
|
1080 |
-
public function delete_all() {
|
1081 |
-
global $wpdb;
|
1082 |
-
$flag = FALSE;
|
1083 |
-
$isDefault = FALSE;
|
1084 |
-
$form_ids_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker');
|
1085 |
-
foreach ($form_ids_col as $form_id) {
|
1086 |
-
if (isset($_POST['check_' . $form_id])) {
|
1087 |
-
$flag = TRUE;
|
1088 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $form_id));
|
1089 |
-
$arr = explode(',', get_option('contact_form_forms'));
|
1090 |
-
$arr = array_diff($arr, array($form_id));
|
1091 |
-
$arr = implode(',', $arr);
|
1092 |
-
update_option('contact_form_forms', $arr);
|
1093 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="%d"', $form_id));
|
1094 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id="%d"', $form_id));
|
1095 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_sessions WHERE form_id="%d"', $form_id));
|
1096 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_backup WHERE id="%d"', $form_id));
|
1097 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_display_options WHERE form_id="%d"', $form_id));
|
1098 |
-
}
|
1099 |
-
}
|
1100 |
-
if ($flag) {
|
1101 |
-
$message = 5;
|
1102 |
-
}
|
1103 |
-
else {
|
1104 |
-
$message = 6;
|
1105 |
-
}
|
1106 |
-
$page = WDW_FMC_Library::get('page');
|
1107 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
1108 |
-
}
|
1109 |
-
|
1110 |
-
public function fm_live_search() {
|
1111 |
-
$search_string = ! empty( $_POST['pp_live_search'] ) ? sanitize_text_field( $_POST['pp_live_search'] ) : '';
|
1112 |
-
$post_type = ! empty( $_POST['pp_post_type'] ) ? sanitize_text_field( $_POST['pp_post_type'] ) : 'any';
|
1113 |
-
$full_content = ! empty( $_POST['pp_full_content'] ) ? sanitize_text_field( $_POST['pp_full_content'] ) : 'true';
|
1114 |
-
|
1115 |
-
$args['s'] = $search_string;
|
1116 |
-
|
1117 |
-
$results = $this->fm_posts_query( $args, $post_type );
|
1118 |
-
/* if ('true' === $full_content) { */
|
1119 |
-
$output = '<ul class="pp_search_results">';
|
1120 |
-
/* } else {
|
1121 |
-
$output = '';
|
1122 |
-
} */
|
1123 |
-
|
1124 |
-
if (empty($results)) {
|
1125 |
-
/* if ( 'true' === $full_content ) { */
|
1126 |
-
$output .= sprintf(
|
1127 |
-
'<li class="pp_no_res">%1$s</li>',
|
1128 |
-
esc_html__( 'No results found', 'fm-text' )
|
1129 |
-
);
|
1130 |
-
/* } */
|
1131 |
-
} else {
|
1132 |
-
foreach( $results as $single_post ) {
|
1133 |
-
$output .= sprintf(
|
1134 |
-
'<li data-post_id="%2$s">[%3$s] - %1$s</li>',
|
1135 |
-
esc_html( $single_post['title'] ),
|
1136 |
-
esc_attr( $single_post['id'] ),
|
1137 |
-
esc_html( $single_post['post_type'] )
|
1138 |
-
);
|
1139 |
-
}
|
1140 |
-
}
|
1141 |
-
|
1142 |
-
/* if ( 'true' === $full_content ) { */
|
1143 |
-
$output .= '</ul>';
|
1144 |
-
/* } */
|
1145 |
-
|
1146 |
-
die( $output );
|
1147 |
-
}
|
1148 |
-
|
1149 |
-
public function fm_posts_query( $args = array(), $include_post_type = '' ) {
|
1150 |
-
if ( 'only_pages' === $include_post_type ) {
|
1151 |
-
$pt_names = array( 'page' );
|
1152 |
-
} elseif ( 'any' === $include_post_type || 'only_posts' === $include_post_type ) {
|
1153 |
-
$default_post_types = array( 'post', 'page' );
|
1154 |
-
$custom_post_types = get_post_types( array(
|
1155 |
-
'public' => true,
|
1156 |
-
'_builtin' => false,
|
1157 |
-
) );
|
1158 |
-
|
1159 |
-
$post_types = array_merge($default_post_types, $custom_post_types);
|
1160 |
-
$pt_names = array_values($post_types);
|
1161 |
-
|
1162 |
-
if ( 'only_posts' === $include_post_type ) {
|
1163 |
-
unset($pt_names[1]);
|
1164 |
-
}
|
1165 |
-
} else {
|
1166 |
-
$pt_names = $include_post_type;
|
1167 |
-
}
|
1168 |
-
|
1169 |
-
$query = array(
|
1170 |
-
'post_type' => $pt_names,
|
1171 |
-
'suppress_filters' => true,
|
1172 |
-
'update_post_term_cache' => false,
|
1173 |
-
'update_post_meta_cache' => false,
|
1174 |
-
'post_status' => 'publish',
|
1175 |
-
'posts_per_page' => -1,
|
1176 |
-
);
|
1177 |
-
|
1178 |
-
if ( isset( $args['s'] ) ) {
|
1179 |
-
$query['s'] = $args['s'];
|
1180 |
-
}
|
1181 |
-
|
1182 |
-
$get_posts = new WP_Query;
|
1183 |
-
$posts = $get_posts->query( $query );
|
1184 |
-
if ( ! $get_posts->post_count ) {
|
1185 |
-
return false;
|
1186 |
-
}
|
1187 |
-
|
1188 |
-
$results = array();
|
1189 |
-
foreach ($posts as $post) {
|
1190 |
-
$results[] = array(
|
1191 |
-
'id' => (int) $post->ID,
|
1192 |
-
'title' => trim( esc_html( strip_tags( get_the_title( $post ) ) ) ),
|
1193 |
-
'post_type' => $post->post_type,
|
1194 |
-
);
|
1195 |
-
}
|
1196 |
-
|
1197 |
-
wp_reset_postdata();
|
1198 |
-
|
1199 |
-
return $results;
|
1200 |
-
}
|
1201 |
-
|
1202 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
1203 |
-
// Getters & Setters //
|
1204 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
1205 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
1206 |
-
// Private Methods //
|
1207 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
1208 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
1209 |
-
// Listeners //
|
1210 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
1211 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/controllers/FMControllerSelect_data_from_db.php
DELETED
@@ -1,70 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerSelect_data_from_db_fmc {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function execute() {
|
22 |
-
$task = ((isset($_GET['task'])) ? esc_html($_GET['task']) : 0);
|
23 |
-
$id = ((isset($_GET['id'])) ? (int)esc_html($_GET['id']) : 0);
|
24 |
-
$form_id = ((isset($_GET['form_id'])) ? (int)esc_html($_GET['form_id']) : 0);
|
25 |
-
$field_id = ((isset($_GET['field_id'])) ? esc_html($_GET['field_id']) : 0);
|
26 |
-
$field_type = ((isset($_GET['field_type'])) ? esc_html($_GET['field_type']) : 0);
|
27 |
-
$value_disabled = ((isset($_GET['value_disabled'])) ? esc_html($_GET['value_disabled']) : 0);
|
28 |
-
if ($task && method_exists($this, $task)) {
|
29 |
-
$this->$task($form_id,$field_type="");
|
30 |
-
}
|
31 |
-
else
|
32 |
-
$this->display($id, $field_id, $field_type, $value_disabled,$form_id);
|
33 |
-
}
|
34 |
-
|
35 |
-
public function display($id, $field_id, $field_type, $value_disabled,$form_id) {
|
36 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelSelect_data_from_db.php";
|
37 |
-
$model = new FMModelSelect_data_from_db_fmc();
|
38 |
-
|
39 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewSelect_data_from_db.php";
|
40 |
-
$view = new FMViewSelect_data_from_db_fmc($model);
|
41 |
-
$view->display($id, $field_id, $field_type, $value_disabled,$form_id);
|
42 |
-
}
|
43 |
-
|
44 |
-
public function db_tables($form_id,$field_type) {
|
45 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelSelect_data_from_db.php";
|
46 |
-
$model = new FMModelSelect_data_from_db_fmc();
|
47 |
-
|
48 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewSelect_data_from_db.php";
|
49 |
-
$view = new FMViewSelect_data_from_db_fmc($model);
|
50 |
-
$view->db_tables((int)$form_id, $field_type);
|
51 |
-
}
|
52 |
-
public function db_table_struct_select($form_id,$field_type) {
|
53 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelSelect_data_from_db.php";
|
54 |
-
$model = new FMModelSelect_data_from_db_fmc();
|
55 |
-
|
56 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewSelect_data_from_db.php";
|
57 |
-
$view = new FMViewSelect_data_from_db_fmc($model);
|
58 |
-
$view->db_table_struct_select((int)$form_id,$field_type);
|
59 |
-
}
|
60 |
-
|
61 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
62 |
-
// Getters & Setters //
|
63 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
64 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
65 |
-
// Private Methods //
|
66 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
67 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
68 |
-
// Listeners //
|
69 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
70 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/controllers/FMControllerShow_matrix.php
DELETED
@@ -1,43 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerShow_matrix_fmc {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function execute() {
|
22 |
-
$this->display();
|
23 |
-
}
|
24 |
-
|
25 |
-
public function display() {
|
26 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelShow_matrix.php";
|
27 |
-
$model = new FMModelShow_matrix_fmc();
|
28 |
-
|
29 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewShow_matrix.php";
|
30 |
-
$view = new FMViewShow_matrix_fmc($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
DELETED
@@ -1,291 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerSubmissions_fmc {
|
4 |
-
public function execute() {
|
5 |
-
$task = ((isset($_POST['task'])) ? esc_html($_POST['task']) : '');
|
6 |
-
$id = ((isset($_POST['current_id'])) ? (int)esc_html($_POST['current_id']) : 0);
|
7 |
-
$form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
|
8 |
-
|
9 |
-
if (method_exists($this, $task)) {
|
10 |
-
if ($task != 'show_stats') {
|
11 |
-
check_admin_referer('nonce_fm', 'nonce_fm');
|
12 |
-
}
|
13 |
-
else {
|
14 |
-
check_ajax_referer('nonce_fm_ajax', 'nonce_fm_ajax');
|
15 |
-
}
|
16 |
-
$this->$task($id);
|
17 |
-
}
|
18 |
-
else {
|
19 |
-
$this->display($form_id);
|
20 |
-
}
|
21 |
-
}
|
22 |
-
|
23 |
-
public function display($form_id) {
|
24 |
-
$form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
|
25 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelSubmissions_fm.php";
|
26 |
-
$model = new FMModelSubmissions_fmc();
|
27 |
-
|
28 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewSubmissions_fm.php";
|
29 |
-
$view = new FMViewSubmissions_fmc($model);
|
30 |
-
$view->display($form_id);
|
31 |
-
}
|
32 |
-
|
33 |
-
public function show_stats() {
|
34 |
-
$form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
|
35 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelSubmissions_fm.php";
|
36 |
-
$model = new FMModelSubmissions_fmc();
|
37 |
-
|
38 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewSubmissions_fm.php";
|
39 |
-
$view = new FMViewSubmissions_fmc($model);
|
40 |
-
$view->show_stats($form_id);
|
41 |
-
}
|
42 |
-
|
43 |
-
public function edit() {
|
44 |
-
global $wpdb;
|
45 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelSubmissions_fm.php";
|
46 |
-
$model = new FMModelSubmissions_fmc();
|
47 |
-
|
48 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewSubmissions_fm.php";
|
49 |
-
$view = new FMViewSubmissions_fmc($model);
|
50 |
-
$id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? (int)$_POST['current_id'] : 0);
|
51 |
-
|
52 |
-
$form_id = (int)$wpdb->get_var("SELECT form_id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "'");
|
53 |
-
$form = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id='" . $form_id . "'");
|
54 |
-
|
55 |
-
$view->edit($id);
|
56 |
-
}
|
57 |
-
|
58 |
-
public function save() {
|
59 |
-
$form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
|
60 |
-
$this->save_db();
|
61 |
-
$this->display($form_id);
|
62 |
-
}
|
63 |
-
|
64 |
-
public function apply() {
|
65 |
-
$this->save_db();
|
66 |
-
$this->edit();
|
67 |
-
}
|
68 |
-
|
69 |
-
public function save_db() {
|
70 |
-
global $wpdb;
|
71 |
-
$id = (isset($_POST['current_id']) ? (int)esc_html(stripslashes($_POST['current_id'])) : 0);
|
72 |
-
$date = esc_html($_POST['date']);
|
73 |
-
$ip = esc_html($_POST['ip']);
|
74 |
-
$form_id = (int)$wpdb->get_var("SELECT form_id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "'");
|
75 |
-
$form = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id='" . $form_id . "'");
|
76 |
-
$label_id = array();
|
77 |
-
$label_order_original = array();
|
78 |
-
$label_type = array();
|
79 |
-
|
80 |
-
if (strpos($form->label_order, 'type_paypal_')) {
|
81 |
-
$form->label_order = $form->label_order . "0#**id**#Payment Status#**label**#type_paypal_payment_status#****#";
|
82 |
-
}
|
83 |
-
$label_all = explode('#****#', $form->label_order);
|
84 |
-
$label_all = array_slice($label_all, 0, count($label_all) - 1);
|
85 |
-
foreach ($label_all as $key => $label_each) {
|
86 |
-
$label_id_each = explode('#**id**#', $label_each);
|
87 |
-
array_push($label_id, $label_id_each[0]);
|
88 |
-
$label_oder_each = explode('#**label**#', $label_id_each[1]);
|
89 |
-
array_push($label_order_original, $label_oder_each[0]);
|
90 |
-
array_push($label_type, $label_oder_each[1]);
|
91 |
-
}
|
92 |
-
|
93 |
-
foreach ($label_id as $key => $label_id_1) {
|
94 |
-
if (isset($_POST["submission_" . $label_id_1])) {
|
95 |
-
$element_value = (isset($_POST["submission_" . $label_id_1]) ? esc_html(stripslashes($_POST["submission_" . $label_id_1])) : " ");
|
96 |
-
$query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
|
97 |
-
$result = $wpdb->get_var($query);
|
98 |
-
if ($label_type[$key] == 'type_file_upload') {
|
99 |
-
if ($element_value) {
|
100 |
-
$element_value = $element_value . "*@@url@@*";
|
101 |
-
}
|
102 |
-
}
|
103 |
-
if ($result) {
|
104 |
-
$save = $wpdb->update($wpdb->prefix . "formmaker_submits", array(
|
105 |
-
'element_value' => stripslashes($element_value),
|
106 |
-
), array(
|
107 |
-
'group_id' => $id,
|
108 |
-
'element_label' => $label_id_1
|
109 |
-
), array(
|
110 |
-
'%s',
|
111 |
-
), array(
|
112 |
-
'%d',
|
113 |
-
'%s'
|
114 |
-
));
|
115 |
-
}
|
116 |
-
else {
|
117 |
-
$save = $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
|
118 |
-
'form_id' => $form_id,
|
119 |
-
'element_label' => $label_id_1,
|
120 |
-
'element_value' => stripslashes($element_value),
|
121 |
-
'group_id' => $id,
|
122 |
-
'date' => $date,
|
123 |
-
'ip' => $ip
|
124 |
-
), array(
|
125 |
-
'%d',
|
126 |
-
'%s',
|
127 |
-
'%s',
|
128 |
-
'%d',
|
129 |
-
'%s',
|
130 |
-
'%s'
|
131 |
-
)
|
132 |
-
);
|
133 |
-
}
|
134 |
-
}
|
135 |
-
else {
|
136 |
-
if (isset($_POST["submission_" . $label_id_1 . '_0'])) {
|
137 |
-
$element_value = '';
|
138 |
-
for ($z = 0; $z < 21; $z++) {
|
139 |
-
$element_value_ch = isset($_POST["submission_" . $label_id_1 . '_' . $z]) ? $_POST["submission_" . $label_id_1 . '_' . $z] : null;
|
140 |
-
if (isset($element_value_ch)) {
|
141 |
-
$element_value = $element_value . $element_value_ch . '***br***';
|
142 |
-
}
|
143 |
-
else {
|
144 |
-
break;
|
145 |
-
}
|
146 |
-
}
|
147 |
-
$query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
|
148 |
-
$result = $wpdb->get_var($query);
|
149 |
-
if ($result) {
|
150 |
-
$save = $wpdb->update($wpdb->prefix . "formmaker_submits", array(
|
151 |
-
'element_value' => stripslashes($element_value),
|
152 |
-
), array(
|
153 |
-
'group_id' => $id,
|
154 |
-
'element_label' => $label_id_1
|
155 |
-
), array(
|
156 |
-
'%s',
|
157 |
-
), array(
|
158 |
-
'%d',
|
159 |
-
'%s'
|
160 |
-
));
|
161 |
-
}
|
162 |
-
else {
|
163 |
-
$save = $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
|
164 |
-
'form_id' => $form_id,
|
165 |
-
'element_label' => $label_id_1,
|
166 |
-
'element_value' => stripslashes($element_value),
|
167 |
-
'group_id' => $id,
|
168 |
-
'date' => $date,
|
169 |
-
'ip' => $ip
|
170 |
-
), array(
|
171 |
-
'%d',
|
172 |
-
'%s',
|
173 |
-
'%s',
|
174 |
-
'%d',
|
175 |
-
'%s',
|
176 |
-
'%s'
|
177 |
-
)
|
178 |
-
);
|
179 |
-
}
|
180 |
-
}
|
181 |
-
}
|
182 |
-
}
|
183 |
-
if ($save !== FALSE) {
|
184 |
-
echo WDW_FMC_Library::message('Submission Succesfully Saved.', 'updated');
|
185 |
-
}
|
186 |
-
else {
|
187 |
-
echo WDW_FMC_Library::message('Error. Please install plugin again.', 'error');
|
188 |
-
}
|
189 |
-
}
|
190 |
-
|
191 |
-
public function delete($id) {
|
192 |
-
global $wpdb;
|
193 |
-
$form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
|
194 |
-
$query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id="%d"', $id);
|
195 |
-
if ($wpdb->query($query)) {
|
196 |
-
echo WDW_FMC_Library::message('Item Succesfully Deleted.', 'updated');
|
197 |
-
}
|
198 |
-
else {
|
199 |
-
echo WDW_FMC_Library::message('Error. Please install plugin again.', 'error');
|
200 |
-
}
|
201 |
-
|
202 |
-
$query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_sessions WHERE form_id="%d" AND group_id="%d"', $form_id, $id);
|
203 |
-
$wpdb->query($query);
|
204 |
-
|
205 |
-
$this->display($form_id);
|
206 |
-
}
|
207 |
-
|
208 |
-
public function delete_all() {
|
209 |
-
global $wpdb;
|
210 |
-
$form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
|
211 |
-
$cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
|
212 |
-
if (count($cid)) {
|
213 |
-
array_walk($cid, create_function('&$value', '$value = (int)$value;'));
|
214 |
-
$cids = implode(',', $cid);
|
215 |
-
$query = 'DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( ' . $cids . ' )';
|
216 |
-
|
217 |
-
if ($wpdb->query($query)) {
|
218 |
-
echo WDW_FMC_Library::message('Items Succesfully Deleted.', 'updated');
|
219 |
-
}
|
220 |
-
else {
|
221 |
-
echo WDW_FMC_Library::message('Error. Please install plugin again.', 'error');
|
222 |
-
}
|
223 |
-
|
224 |
-
$query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_sessions WHERE form_id="%d" AND group_id IN ( "%s" )', $form_id, $cids);
|
225 |
-
$wpdb->query($query);
|
226 |
-
}
|
227 |
-
else {
|
228 |
-
echo WDW_FMC_Library::message('You must select at least one item.', 'error');
|
229 |
-
}
|
230 |
-
$this->display($form_id);
|
231 |
-
}
|
232 |
-
|
233 |
-
public function block_ip() {
|
234 |
-
global $wpdb;
|
235 |
-
$flag = FALSE;
|
236 |
-
$form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
|
237 |
-
$cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
|
238 |
-
if (count($cid)) {
|
239 |
-
array_walk($cid, create_function('&$value', '$value = (int)$value;'));
|
240 |
-
$cids = implode(',', $cid);
|
241 |
-
$query = 'SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( ' . $cids . ' )';
|
242 |
-
$rows = $wpdb->get_results($query);
|
243 |
-
foreach ($rows as $row) {
|
244 |
-
$ips = $wpdb->get_var($wpdb->prepare('SELECT ip FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $row->ip));
|
245 |
-
$flag = TRUE;
|
246 |
-
if (!$ips) {
|
247 |
-
$save = $wpdb->insert($wpdb->prefix . 'formmaker_blocked', array(
|
248 |
-
'ip' => $row->ip,
|
249 |
-
), array(
|
250 |
-
'%s',
|
251 |
-
));
|
252 |
-
}
|
253 |
-
}
|
254 |
-
}
|
255 |
-
if ($flag) {
|
256 |
-
echo WDW_FMC_Library::message('IPs Succesfully Blocked.', 'updated');
|
257 |
-
}
|
258 |
-
else {
|
259 |
-
echo WDW_FMC_Library::message('You must select at least one item.', 'error');
|
260 |
-
}
|
261 |
-
$this->display($form_id);
|
262 |
-
}
|
263 |
-
|
264 |
-
public function unblock_ip() {
|
265 |
-
global $wpdb;
|
266 |
-
$flag = FALSE;
|
267 |
-
$form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? (int)esc_html($_POST['form_id']) : 0);
|
268 |
-
$cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
|
269 |
-
if (count($cid)) {
|
270 |
-
array_walk($cid, create_function('&$value', '$value = (int)$value;'));
|
271 |
-
$cids = implode(',', $cid);
|
272 |
-
$query = 'SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( ' . $cids . ' )';
|
273 |
-
$rows = $wpdb->get_results($query);
|
274 |
-
foreach ($rows as $row) {
|
275 |
-
$flag = TRUE;
|
276 |
-
$ips = $wpdb->get_var($wpdb->prepare('SELECT ip FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $row->ip));
|
277 |
-
if ($ips) {
|
278 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $ips));
|
279 |
-
}
|
280 |
-
}
|
281 |
-
}
|
282 |
-
if ($flag) {
|
283 |
-
echo WDW_FMC_Library::message('IPs Succesfully Unblocked.', 'updated');
|
284 |
-
}
|
285 |
-
else {
|
286 |
-
echo WDW_FMC_Library::message('You must select at least one item.', 'error');
|
287 |
-
}
|
288 |
-
$this->display($form_id);
|
289 |
-
}
|
290 |
-
|
291 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/controllers/FMControllerThemes_fm.php
DELETED
@@ -1,219 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerThemes_fmc {
|
4 |
-
|
5 |
-
public function execute() {
|
6 |
-
$task = WDW_FMC_Library::get('task');
|
7 |
-
$id = (int)WDW_FMC_Library::get('current_id', 0);
|
8 |
-
$message = WDW_FMC_Library::get('message');
|
9 |
-
echo WDW_FMC_Library::message_id($message);
|
10 |
-
if (method_exists($this, $task)) {
|
11 |
-
check_admin_referer('nonce_fm', 'nonce_fm');
|
12 |
-
$this->$task($id);
|
13 |
-
}
|
14 |
-
else {
|
15 |
-
$this->display();
|
16 |
-
}
|
17 |
-
}
|
18 |
-
|
19 |
-
public function display() {
|
20 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelThemes_fm.php";
|
21 |
-
$model = new FMModelThemes_fmc();
|
22 |
-
|
23 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewThemes_fm.php";
|
24 |
-
$view = new FMViewThemes_fmc($model);
|
25 |
-
$view->display();
|
26 |
-
}
|
27 |
-
|
28 |
-
public function add() {
|
29 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelThemes_fm.php";
|
30 |
-
$model = new FMModelThemes_fmc();
|
31 |
-
|
32 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewThemes_fm.php";
|
33 |
-
$view = new FMViewThemes_fmc($model);
|
34 |
-
$view->edit(0, FALSE);
|
35 |
-
}
|
36 |
-
|
37 |
-
public function edit() {
|
38 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelThemes_fm.php";
|
39 |
-
$model = new FMModelThemes_fmc();
|
40 |
-
|
41 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewThemes_fm.php";
|
42 |
-
$view = new FMViewThemes_fmc($model);
|
43 |
-
$id = (int)WDW_FMC_Library::get('current_id', 0);
|
44 |
-
$view->edit($id, FALSE);
|
45 |
-
}
|
46 |
-
|
47 |
-
public function save() {
|
48 |
-
$message = $this->save_db();
|
49 |
-
$page = WDW_FMC_Library::get('page');
|
50 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
51 |
-
}
|
52 |
-
|
53 |
-
public function apply() {
|
54 |
-
$message = $this->save_db();
|
55 |
-
global $wpdb;
|
56 |
-
$id = (int) $wpdb->get_var('SELECT MAX(`id`) FROM ' . $wpdb->prefix . 'formmaker_themes');
|
57 |
-
$current_id = (int)WDW_FMC_Library::get('current_id', $id);
|
58 |
-
$page = WDW_FMC_Library::get('page');
|
59 |
-
$active_tab = WDW_FMC_Library::get('active_tab');
|
60 |
-
$pagination = WDW_FMC_Library::get('pagination-type');
|
61 |
-
$form_type = WDW_FMC_Library::get('form_type');
|
62 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message, 'active_tab' => $active_tab, 'pagination' => $pagination, 'form_type' => $form_type), admin_url('admin.php')));
|
63 |
-
}
|
64 |
-
|
65 |
-
public function copy_themes() {
|
66 |
-
global $wpdb;
|
67 |
-
$theme_ids_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker_themes');
|
68 |
-
foreach ($theme_ids_col as $theme_id) {
|
69 |
-
if (isset($_POST['check_' . $theme_id])) {
|
70 |
-
$theme = $wpdb->get_row('SELECT * FROM ' . $wpdb->prefix . 'formmaker_themes where id=' . $theme_id);
|
71 |
-
$title = $theme->title;
|
72 |
-
$params = $theme->css;
|
73 |
-
$version = $theme->version;
|
74 |
-
$save = $wpdb->insert($wpdb->prefix . 'formmaker_themes',
|
75 |
-
array(
|
76 |
-
'title' => $title,
|
77 |
-
'css' => $params,
|
78 |
-
'version' => $version,
|
79 |
-
'default' => 0
|
80 |
-
));
|
81 |
-
}
|
82 |
-
}
|
83 |
-
|
84 |
-
if ($save !== FALSE) {
|
85 |
-
$message = 1;
|
86 |
-
}
|
87 |
-
else {
|
88 |
-
$message = 2;
|
89 |
-
}
|
90 |
-
|
91 |
-
$page = WDW_FMC_Library::get('page');
|
92 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
93 |
-
}
|
94 |
-
|
95 |
-
public function save_as_copy() {
|
96 |
-
$message = $this->save_db_as_copy();
|
97 |
-
$page = WDW_FMC_Library::get('page');
|
98 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
99 |
-
}
|
100 |
-
|
101 |
-
public function save_db() {
|
102 |
-
global $wpdb;
|
103 |
-
$id = (int) WDW_FMC_Library::get('current_id', 0);
|
104 |
-
$title = (isset($_POST['title']) ? esc_html(stripslashes( $_POST['title'])) : '');
|
105 |
-
$version = 2;
|
106 |
-
$params = (isset($_POST['params']) ? stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST['params'])) : '');
|
107 |
-
$default = (isset($_POST['default']) ? esc_html(stripslashes( $_POST['default'])) : 0);
|
108 |
-
if ($id != 0) {
|
109 |
-
$save = $wpdb->update($wpdb->prefix . 'formmaker_themes', array(
|
110 |
-
'title' => $title,
|
111 |
-
'css' => $params,
|
112 |
-
'default' => $default,
|
113 |
-
), array('id' => $id));
|
114 |
-
$version = $wpdb->get_var($wpdb->prepare("SELECT version FROM " . $wpdb->prefix . "formmaker_themes WHERE id=%d", $id));
|
115 |
-
}
|
116 |
-
else {
|
117 |
-
$save = $wpdb->insert($wpdb->prefix . 'formmaker_themes', array(
|
118 |
-
'title' => $title,
|
119 |
-
'css' => $params,
|
120 |
-
'default' => $default,
|
121 |
-
'version' => $version,
|
122 |
-
));
|
123 |
-
$id = $wpdb->insert_id;
|
124 |
-
}
|
125 |
-
if ($save !== FALSE) {
|
126 |
-
require_once WD_FMC_DIR . "/frontend/models/FMModelForm_maker.php";
|
127 |
-
$model_frontend = new FMModelForm_maker_fmc();
|
128 |
-
$form_theme = json_decode(html_entity_decode($params), true);
|
129 |
-
$model_frontend->create_css($id, $form_theme, $version == 1, true);
|
130 |
-
return 1;
|
131 |
-
}
|
132 |
-
else {
|
133 |
-
return 2;
|
134 |
-
}
|
135 |
-
}
|
136 |
-
|
137 |
-
public function save_db_as_copy() {
|
138 |
-
global $wpdb;
|
139 |
-
$id = (int) WDW_FMC_Library::get('current_id', 0);
|
140 |
-
$title = isset($_POST['title']) ? esc_html(stripslashes( $_POST['title'])) : '';
|
141 |
-
$params = isset($_POST['params']) ? stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST['params'])) : '';
|
142 |
-
$version = $wpdb->get_var($wpdb->prepare("SELECT version FROM " . $wpdb->prefix . "formmaker_themes WHERE id=%d", $id));
|
143 |
-
$save = $wpdb->insert($wpdb->prefix . 'formmaker_themes',
|
144 |
-
array(
|
145 |
-
'title' => $title,
|
146 |
-
'css' => $params,
|
147 |
-
'version' => $version,
|
148 |
-
'default' => 0
|
149 |
-
));
|
150 |
-
|
151 |
-
if ($save !== FALSE) {
|
152 |
-
return 1;
|
153 |
-
}
|
154 |
-
else {
|
155 |
-
return 2;
|
156 |
-
}
|
157 |
-
}
|
158 |
-
|
159 |
-
public function delete($id) {
|
160 |
-
global $wpdb;
|
161 |
-
$isDefault = $wpdb->get_var($wpdb->prepare('SELECT `default` FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id));
|
162 |
-
if ($isDefault) {
|
163 |
-
$message = 4;
|
164 |
-
}
|
165 |
-
else {
|
166 |
-
$query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id);
|
167 |
-
if ($wpdb->query($query)) {
|
168 |
-
$message = 3;
|
169 |
-
}
|
170 |
-
else {
|
171 |
-
$message = 2;
|
172 |
-
}
|
173 |
-
}
|
174 |
-
$page = WDW_FMC_Library::get('page');
|
175 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
176 |
-
}
|
177 |
-
|
178 |
-
public function delete_all() {
|
179 |
-
global $wpdb;
|
180 |
-
$flag = FALSE;
|
181 |
-
$isDefault = FALSE;
|
182 |
-
$theme_ids_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker_themes');
|
183 |
-
foreach ($theme_ids_col as $theme_id) {
|
184 |
-
if (isset($_POST['check_' . $theme_id])) {
|
185 |
-
$isDefault = $wpdb->get_var($wpdb->prepare('SELECT `default` FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $theme_id));
|
186 |
-
if ($isDefault) {
|
187 |
-
$message = 4;
|
188 |
-
}
|
189 |
-
else {
|
190 |
-
$flag = TRUE;
|
191 |
-
$wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $theme_id));
|
192 |
-
}
|
193 |
-
}
|
194 |
-
}
|
195 |
-
if ($flag) {
|
196 |
-
$message = 5;
|
197 |
-
}
|
198 |
-
else {
|
199 |
-
$message = 6;
|
200 |
-
}
|
201 |
-
$page = WDW_FMC_Library::get('page');
|
202 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
203 |
-
}
|
204 |
-
|
205 |
-
public function setdefault($id) {
|
206 |
-
global $wpdb;
|
207 |
-
$wpdb->update($wpdb->prefix . 'formmaker_themes', array('default' => 0), array('default' => 1));
|
208 |
-
$save = $wpdb->update($wpdb->prefix . 'formmaker_themes', array('default' => 1), array('id' => $id));
|
209 |
-
if ($save !== FALSE) {
|
210 |
-
$message = 7;
|
211 |
-
}
|
212 |
-
else {
|
213 |
-
$message = 2;
|
214 |
-
}
|
215 |
-
$page = WDW_FMC_Library::get('page');
|
216 |
-
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
|
217 |
-
}
|
218 |
-
|
219 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/controllers/FMControllerUninstall_fm.php
DELETED
@@ -1,66 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerUninstall_fmc {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
global $cfm_options;
|
18 |
-
if (!class_exists("DoradoWebConfig")) {
|
19 |
-
include_once(WD_FMC_DIR . "/wd/config.php");
|
20 |
-
}
|
21 |
-
$config = new DoradoWebConfig();
|
22 |
-
$config->set_options($cfm_options);
|
23 |
-
$deactivate_reasons = new DoradoWebDeactivate($config);
|
24 |
-
$deactivate_reasons->submit_and_deactivate();
|
25 |
-
}
|
26 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
27 |
-
// Public Methods //
|
28 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
29 |
-
public function execute() {
|
30 |
-
$task = ((isset($_POST['task'])) ? esc_html(stripslashes($_POST['task'])) : '');
|
31 |
-
if (method_exists($this, $task)) {
|
32 |
-
check_admin_referer('nonce_fm', 'nonce_fm');
|
33 |
-
$this->$task();
|
34 |
-
}
|
35 |
-
else {
|
36 |
-
$this->display();
|
37 |
-
}
|
38 |
-
}
|
39 |
-
|
40 |
-
public function display() {
|
41 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelUninstall_fm.php";
|
42 |
-
$model = new FMModelUninstall_fmc();
|
43 |
-
|
44 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewUninstall_fm.php";
|
45 |
-
$view = new FMViewUninstall_fmc($model);
|
46 |
-
$view->display();
|
47 |
-
}
|
48 |
-
|
49 |
-
public function uninstall() {
|
50 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelUninstall_fm.php";
|
51 |
-
$model = new FMModelUninstall_fmc();
|
52 |
-
|
53 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewUninstall_fm.php";
|
54 |
-
$view = new FMViewUninstall_fmc($model);
|
55 |
-
$view->uninstall();
|
56 |
-
}
|
57 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
58 |
-
// Getters & Setters //
|
59 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
60 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
61 |
-
// Private Methods //
|
62 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
63 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
64 |
-
// Listeners //
|
65 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
66 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/controllers/FMControllerWidget.php
DELETED
@@ -1,61 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMControllerWidget_fmc extends WP_Widget {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
private $view;
|
14 |
-
private $model;
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
// Constructor & Destructor //
|
17 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
18 |
-
public function __construct() {
|
19 |
-
$widget_ops = array(
|
20 |
-
'classname' => 'form_maker_widget',
|
21 |
-
'description' => 'Add Form Maker widget.'
|
22 |
-
);
|
23 |
-
// Widget Control Settings.
|
24 |
-
$control_ops = array('id_base' => 'form_maker_widget');
|
25 |
-
// Create the widget.
|
26 |
-
parent::__construct('form_maker_widget', 'Form Maker', $widget_ops, $control_ops);
|
27 |
-
require_once WD_FMC_DIR . "/admin/models/FMModelWidget.php";
|
28 |
-
$this->model = new FMModelWidget_fmc();
|
29 |
-
|
30 |
-
require_once WD_FMC_DIR . "/admin/views/FMViewWidget.php";
|
31 |
-
$this->view = new FMViewWidget_fmc($this->model);
|
32 |
-
}
|
33 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
34 |
-
// Public Methods //
|
35 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
36 |
-
|
37 |
-
public function widget($args, $instance) {
|
38 |
-
$this->view->widget($args, $instance);
|
39 |
-
}
|
40 |
-
|
41 |
-
public function form( $instance ) {
|
42 |
-
$this->view->form($instance, parent::get_field_id('title'), parent::get_field_name('title'), parent::get_field_id('form_id'), parent::get_field_name('form_id'));
|
43 |
-
}
|
44 |
-
|
45 |
-
// Update Settings.
|
46 |
-
public function update($new_instance, $old_instance) {
|
47 |
-
$instance['title'] = $new_instance['title'];
|
48 |
-
$instance['form_id'] = $new_instance['form_id'];
|
49 |
-
return $instance;
|
50 |
-
}
|
51 |
-
|
52 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
53 |
-
// Getters & Setters //
|
54 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
55 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
56 |
-
// Private Methods //
|
57 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
58 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
59 |
-
// Listeners //
|
60 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
61 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/controllers/FMShortocde.php
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class FMControllerFMShortocde
|
5 |
+
*/
|
6 |
+
class FMControllerFMShortocde_fmc {
|
7 |
+
private $model;
|
8 |
+
private $view;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* FMControllerFMShortocde constructor.
|
12 |
+
*/
|
13 |
+
public function __construct() {
|
14 |
+
require_once WDCFM()->plugin_dir . "/admin/models/FMShortocde.php";
|
15 |
+
$this->model = new FMModelFMShortocde_fmc();
|
16 |
+
|
17 |
+
require_once WDCFM()->plugin_dir . "/admin/views/FMShortocde.php";
|
18 |
+
$this->view = new FMViewFMShortocde_fmc();
|
19 |
+
}
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Execute.
|
23 |
+
*/
|
24 |
+
public function execute() {
|
25 |
+
$task = WDW_FMC_Library::get('task');
|
26 |
+
$this->display($task);
|
27 |
+
}
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Display.
|
31 |
+
*/
|
32 |
+
public function display($task) {
|
33 |
+
// Get forms.
|
34 |
+
$forms = $this->model->get_form_data();
|
35 |
+
|
36 |
+
if ( method_exists($this->view, $task) ) {
|
37 |
+
$this->view->$task($forms);
|
38 |
+
}
|
39 |
+
else {
|
40 |
+
$this->view->form($forms);
|
41 |
+
}
|
42 |
+
}
|
43 |
+
}
|
admin/controllers/FormMakerEditCountryinPopup.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class FMControllerFormmakereditcountryinpopup_fmc
|
5 |
+
*/
|
6 |
+
class FMControllerFormmakereditcountryinpopup_fmc {
|
7 |
+
/**
|
8 |
+
* @var $view
|
9 |
+
*/
|
10 |
+
private $view;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Execute.
|
14 |
+
*/
|
15 |
+
public function execute() {
|
16 |
+
$this->display();
|
17 |
+
}
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Display.
|
21 |
+
*/
|
22 |
+
public function display() {
|
23 |
+
// Load FMViewFromeditcountryinpopup class.
|
24 |
+
require_once WDCFM()->plugin_dir . "/admin/views/FMEditCountryinPopup.php";
|
25 |
+
$this->view = new FMViewFromeditcountryinpopup_fmc();
|
26 |
+
// Set params for view.
|
27 |
+
$params = array();
|
28 |
+
$params['field_id'] = WDW_FMC_Library::get('field_id', 0);
|
29 |
+
$this->view->display($params);
|
30 |
+
}
|
31 |
+
}
|
admin/controllers/FormMakerIpinfoinPopup.php
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class FMControllerFormmakeripinfoinpopup_fmc
|
5 |
+
*/
|
6 |
+
class FMControllerFormmakeripinfoinpopup_fmc {
|
7 |
+
/**
|
8 |
+
* @var view
|
9 |
+
*/
|
10 |
+
private $view;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Execute.
|
14 |
+
*/
|
15 |
+
public function execute() {
|
16 |
+
$this->display();
|
17 |
+
}
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Display.
|
21 |
+
*/
|
22 |
+
public function display() {
|
23 |
+
// Load FMViewFromipinfoinpopup class.
|
24 |
+
require_once WDCFM()->plugin_dir . "/admin/views/FMIpinfoinPopup.php";
|
25 |
+
$this->view = new FMViewFromipinfoinpopup_fmc();
|
26 |
+
// Get IP
|
27 |
+
$ip = WDW_FMC_Library::get('data_ip', '');
|
28 |
+
// Connect to IP api service and get IP info.
|
29 |
+
$ipinfo = @unserialize(file_get_contents('http://ip-api.com/php/' . $ip));
|
30 |
+
$city = '-';
|
31 |
+
$country = '-';
|
32 |
+
$countryCode = '-';
|
33 |
+
$country_flag = '-';
|
34 |
+
$timezone = '-';
|
35 |
+
$lat = '-';
|
36 |
+
$lon = '-';
|
37 |
+
if ( $ipinfo && $ipinfo['status'] == 'success' && $ipinfo['countryCode'] ) {
|
38 |
+
$city = $ipinfo['city'];
|
39 |
+
$country = $ipinfo['country'];
|
40 |
+
$countryCode = $ipinfo['countryCode'];
|
41 |
+
$country_flag = '<img width="16px" src="' . WDCFM()->plugin_url . '/images/flags/' . strtolower($ipinfo['countryCode']) . '.png" class="sub-align" alt="' . $ipinfo['country'] . '" title="' . $ipinfo['country'] . '" />';
|
42 |
+
$timezone = $ipinfo['timezone'];
|
43 |
+
$lat = $ipinfo['lat'];
|
44 |
+
$lon = $ipinfo['lon'];
|
45 |
+
}
|
46 |
+
// Set params for view.
|
47 |
+
$params = array();
|
48 |
+
$params['ip'] = $ip;
|
49 |
+
$params['city'] = $city;
|
50 |
+
$params['country'] = $country;
|
51 |
+
$params['country_flag'] = $country_flag;
|
52 |
+
$params['countryCode'] = $countryCode;
|
53 |
+
$params['timezone'] = $timezone;
|
54 |
+
$params['lat'] = $lat;
|
55 |
+
$params['lon'] = $lon;
|
56 |
+
$this->view->display($params);
|
57 |
+
}
|
58 |
+
}
|
admin/controllers/FormMakerMapEditinPopup.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class FMControllerFormmakermapeditinpopup_fmc
|
5 |
+
*/
|
6 |
+
class FMControllerFormmakermapeditinpopup_fmc {
|
7 |
+
/**
|
8 |
+
* @var view
|
9 |
+
*/
|
10 |
+
private $view;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Execute.
|
14 |
+
*/
|
15 |
+
public function execute() {
|
16 |
+
$this->display();
|
17 |
+
}
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Display.
|
21 |
+
*/
|
22 |
+
public function display() {
|
23 |
+
// Load FMViewFrommapeditinpopup class.
|
24 |
+
require_once WDCFM()->plugin_dir . "/admin/views/FMMapEditinPopup.php";
|
25 |
+
$this->view = new FMViewFrommapeditinpopup_fmc();
|
26 |
+
// Get form maker settings.
|
27 |
+
$fm_settings = get_option('fmc_settings');
|
28 |
+
// Set params for view.
|
29 |
+
$params = array();
|
30 |
+
$params['map_key'] = !empty($fm_settings['map_key']) ? '&key=' . $fm_settings['map_key'] : '';
|
31 |
+
$params['long'] = WDW_FMC_Library::get('long', 0);
|
32 |
+
$params['lat'] = WDW_FMC_Library::get('lat', 0);
|
33 |
+
$this->view->display($params);
|
34 |
+
}
|
35 |
+
}
|
admin/controllers/FormMakerSQLMapping.php
ADDED
@@ -0,0 +1,167 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class FMControllerFormMakerSQLMapping_fmc
|
5 |
+
*/
|
6 |
+
class FMControllerFormMakerSQLMapping_fmc {
|
7 |
+
/**
|
8 |
+
* @var $model
|
9 |
+
*/
|
10 |
+
private $model;
|
11 |
+
/**
|
12 |
+
* @var $view
|
13 |
+
*/
|
14 |
+
private $view;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* FMControllerFormMakerSQLMapping constructor.
|
18 |
+
*/
|
19 |
+
public function __construct() {
|
20 |
+
// Load FMModelFormMakerSQLMapping class.
|
21 |
+
require_once WDCFM()->plugin_dir . "/admin/models/FMSqlMapping.php";
|
22 |
+
$this->model = new FMModelFormMakerSQLMapping_fmc();
|
23 |
+
// Load FMViewFormMakerSQLMapping class.
|
24 |
+
require_once WDCFM()->plugin_dir . "/admin/views/FMSqlMapping.php";
|
25 |
+
$this->view = new FMViewFormMakerSQLMapping_fmc();
|
26 |
+
}
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Execute.
|
30 |
+
*/
|
31 |
+
public function execute() {
|
32 |
+
$id = WDW_FMC_Library::get('id', '');
|
33 |
+
$form_id = WDW_FMC_Library::get('form_id', '');
|
34 |
+
$task = WDW_FMC_Library::get('task', '');
|
35 |
+
if ( $task && method_exists($this, $task) ) {
|
36 |
+
$this->$task($form_id);
|
37 |
+
}
|
38 |
+
else {
|
39 |
+
if ( $id ) {
|
40 |
+
$this->edit_query($id, $form_id);
|
41 |
+
}
|
42 |
+
else {
|
43 |
+
$this->add_query($form_id);
|
44 |
+
}
|
45 |
+
}
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Add query.
|
50 |
+
*
|
51 |
+
* @param int $form_id
|
52 |
+
*/
|
53 |
+
public function add_query( $form_id ) {
|
54 |
+
// Get labels by form id.
|
55 |
+
$label = $this->model->get_labels($form_id);
|
56 |
+
// Set params for view.
|
57 |
+
$params = array();
|
58 |
+
$params['label'] = $label;
|
59 |
+
$params['form_id'] = $form_id;
|
60 |
+
$this->view->add_query($params);
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Edit query.
|
65 |
+
*
|
66 |
+
* @param int $id
|
67 |
+
* @param int $form_id
|
68 |
+
*/
|
69 |
+
public function edit_query( $id, $form_id ) {
|
70 |
+
// Get labels by form id.
|
71 |
+
$label = $this->model->get_labels($form_id);
|
72 |
+
// Get query by id.
|
73 |
+
$query_obj = $this->model->get_query($id);
|
74 |
+
$temp = explode('***wdfcon_typewdf***', $query_obj->details);
|
75 |
+
$con_type = $temp[0];
|
76 |
+
$temp = explode('***wdfcon_methodwdf***', $temp[1]);
|
77 |
+
$con_method = $temp[0];
|
78 |
+
$temp = explode('***wdftablewdf***', $temp[1]);
|
79 |
+
$table_cur = $temp[0];
|
80 |
+
$temp = explode('***wdfhostwdf***', $temp[1]);
|
81 |
+
$host = $temp[0];
|
82 |
+
$temp = explode('***wdfportwdf***', $temp[1]);
|
83 |
+
$port = $temp[0];
|
84 |
+
$temp = explode('***wdfusernamewdf***', $temp[1]);
|
85 |
+
$username = $temp[0];
|
86 |
+
$temp = explode('***wdfpasswordwdf***', $temp[1]);
|
87 |
+
$password = $temp[0];
|
88 |
+
$temp = explode('***wdfdatabasewdf***', $temp[1]);
|
89 |
+
$database = $temp[0];
|
90 |
+
$details = $temp[1];
|
91 |
+
$tables = $this->model->get_tables_saved($con_type, $username, $password, $database, $host);
|
92 |
+
$table_struct = $this->model->get_table_struct_saved($con_type, $username, $password, $database, $host, $table_cur, $con_method);
|
93 |
+
// Set params for view.
|
94 |
+
$params = array();
|
95 |
+
$params['id'] = $id;
|
96 |
+
$params['form_id'] = $form_id;
|
97 |
+
$params['label'] = $label;
|
98 |
+
$params['query_obj'] = $query_obj;
|
99 |
+
$params['tables'] = $tables;
|
100 |
+
$params['table_struct'] = $table_struct;
|
101 |
+
$this->view->edit_query($params);
|
102 |
+
}
|
103 |
+
|
104 |
+
/**
|
105 |
+
* DB tables.
|
106 |
+
*
|
107 |
+
* @param int $form_id
|
108 |
+
*/
|
109 |
+
public function db_tables( $form_id ) {
|
110 |
+
// Get all tables.
|
111 |
+
$tables = $this->model->get_tables();
|
112 |
+
// Set params for view.
|
113 |
+
$params = array();
|
114 |
+
$params['tables'] = $tables;
|
115 |
+
$params['form_id'] = $form_id;
|
116 |
+
$this->view->db_tables($params);
|
117 |
+
}
|
118 |
+
|
119 |
+
/**
|
120 |
+
* DB table struct.
|
121 |
+
*
|
122 |
+
* @param int $form_id
|
123 |
+
*/
|
124 |
+
public function db_table_struct( $form_id ) {
|
125 |
+
$con_method = WDW_FMC_Library::get('con_method', '');
|
126 |
+
// Get labels by form id.
|
127 |
+
$label = $this->model->get_labels($form_id);
|
128 |
+
// Get table struct.
|
129 |
+
$table_struct = $this->model->get_table_struct();
|
130 |
+
// Set params for view.
|
131 |
+
$params = array();
|
132 |
+
$params['form_id'] = $form_id;
|
133 |
+
$params['label'] = $label;
|
134 |
+
$params['table_struct'] = $table_struct;
|
135 |
+
$params['con_method'] = $con_method;
|
136 |
+
$this->view->db_table_struct($params);
|
137 |
+
}
|
138 |
+
|
139 |
+
public function save_query() {
|
140 |
+
global $wpdb;
|
141 |
+
$form_id = ((isset($_GET['form_id'])) ? (int) $_GET['form_id'] : 0);
|
142 |
+
$query = ((isset($_POST['query'])) ? stripslashes(wp_specialchars_decode($_POST['query'])) : "");
|
143 |
+
$details = ((isset($_POST['details'])) ? esc_html($_POST['details']) : "");
|
144 |
+
$save = $wpdb->insert($wpdb->prefix . 'formmaker_query', array(
|
145 |
+
'form_id' => $form_id,
|
146 |
+
'query' => $query,
|
147 |
+
'details' => $details,
|
148 |
+
), array(
|
149 |
+
'%d',
|
150 |
+
'%s',
|
151 |
+
'%s',
|
152 |
+
));
|
153 |
+
}
|
154 |
+
|
155 |
+
public function update_query() {
|
156 |
+
global $wpdb;
|
157 |
+
$id = ((isset($_GET['id'])) ? (int) $_GET['id'] : 0);
|
158 |
+
$form_id = ((isset($_GET['form_id'])) ? (int) $_GET['form_id'] : 0);
|
159 |
+
$query = ((isset($_POST['query'])) ? stripslashes(wp_specialchars_decode($_POST['query'])) : "");
|
160 |
+
$details = ((isset($_POST['details'])) ? esc_html($_POST['details']) : "");
|
161 |
+
$save = $wpdb->update($wpdb->prefix . 'formmaker_query', array(
|
162 |
+
'form_id' => $form_id,
|
163 |
+
'query' => $query,
|
164 |
+
'details' => $details,
|
165 |
+
), array( 'id' => $id ));
|
166 |
+
}
|
167 |
+
}
|
admin/controllers/FormMakerSubmits.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class FMControllerFormMakerSubmits_fmc
|
5 |
+
*/
|
6 |
+
class FMControllerFormMakerSubmits_fmc {
|
7 |
+
private $model;
|
8 |
+
private $view;
|
9 |
+
|
10 |
+
public function __construct() {
|
11 |
+
require_once WDCFM()->plugin_dir . "/admin/models/FormMakerSubmits.php";
|
12 |
+
$this->model = new FMModelFormMakerSubmits_fmc();
|
13 |
+
require_once WDCFM()->plugin_dir . "/admin/views/FormMakerSubmits.php";
|
14 |
+
$this->view = new FMViewFormMakerSubmits_fmc();
|
15 |
+
}
|
16 |
+
|
17 |
+
public function execute() {
|
18 |
+
$this->display();
|
19 |
+
}
|
20 |
+
|
21 |
+
public function display() {
|
22 |
+
$params = array();
|
23 |
+
$form_id = esc_html(stripslashes($_GET['form_id']));
|
24 |
+
$params['label_order'] = $this->model->get_from_label_order($form_id);
|
25 |
+
$group_id = esc_html(stripslashes($_GET['group_id']));
|
26 |
+
$params['rows'] = $this->model->get_submissions($group_id);
|
27 |
+
$labels_id = array();
|
28 |
+
$labels_name = array();
|
29 |
+
$labels_type = array();
|
30 |
+
$label_all = explode('#****#', $params['label_order']);
|
31 |
+
$label_all = array_slice($label_all, 0, count($label_all) - 1);
|
32 |
+
foreach ( $label_all as $key => $label_each ) {
|
33 |
+
$label_id_each = explode('#**id**#', $label_each);
|
34 |
+
array_push($labels_id, $label_id_each[0]);
|
35 |
+
$label_oder_each = explode('#**label**#', $label_id_each[1]);
|
36 |
+
array_push($labels_name, $label_oder_each[0]);
|
37 |
+
array_push($labels_type, $label_oder_each[1]);
|
38 |
+
}
|
39 |
+
$params['labels_id'] = $labels_id;
|
40 |
+
$params['labels_name'] = $labels_name;
|
41 |
+
$params['labels_type'] = $labels_type;
|
42 |
+
$this->view->display($params);
|
43 |
+
}
|
44 |
+
}
|
admin/controllers/Formmakerwdcaptcha.php
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class FMControllerFormmakerwdcaptcha_fmc
|
4 |
+
*/
|
5 |
+
class FMControllerFormmakerwdcaptcha_fmc {
|
6 |
+
/**
|
7 |
+
* @var view
|
8 |
+
*/
|
9 |
+
private $view;
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Execute.
|
13 |
+
*/
|
14 |
+
public function execute() {
|
15 |
+
$this->display();
|
16 |
+
}
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Display.
|
20 |
+
*/
|
21 |
+
public function display() {
|
22 |
+
// Load FMViewFormmakerwdcaptcha class.
|
23 |
+
require_once WDCFM()->plugin_dir . "/admin/views/FMCaptcha.php";
|
24 |
+
$this->view = new FMViewFormmakerwdcaptcha_fmc();
|
25 |
+
// Set params for view.
|
26 |
+
$params = array();
|
27 |
+
$this->view->display($params);
|
28 |
+
}
|
29 |
+
}
|
admin/controllers/Formmakerwdmathcaptcha.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class FMControllerFormmakerwdmathcaptcha_fmc
|
5 |
+
*/
|
6 |
+
class FMControllerFormmakerwdmathcaptcha_fmc {
|
7 |
+
/**
|
8 |
+
* @var $view
|
9 |
+
*/
|
10 |
+
private $view;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Execute.
|
14 |
+
*/
|
15 |
+
public function execute() {
|
16 |
+
$this->display();
|
17 |
+
}
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Display.
|
21 |
+
*/
|
22 |
+
public function display() {
|
23 |
+
// Load FMViewFormmakerwdmathcaptcha class.
|
24 |
+
require_once WDCFM()->plugin_dir . "/admin/views/FMMathCaptcha.php";
|
25 |
+
$this->view = new FMViewFormmakerwdmathcaptcha_fmc();
|
26 |
+
// Set params for view.
|
27 |
+
$params = array();
|
28 |
+
$this->view->display($params);
|
29 |
+
}
|
30 |
+
}
|
admin/controllers/Generete_csv.php
ADDED
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class FMControllerGenerete_csv_fmc
|
5 |
+
*/
|
6 |
+
class FMControllerGenerete_csv_fmc {
|
7 |
+
/**
|
8 |
+
* Execute.
|
9 |
+
*/
|
10 |
+
public function execute() {
|
11 |
+
$this->display();
|
12 |
+
}
|
13 |
+
|
14 |
+
/**
|
15 |
+
* display.
|
16 |
+
*/
|
17 |
+
public function display() {
|
18 |
+
// Get form maker settings
|
19 |
+
$fm_settings = get_option('fmc_settings');
|
20 |
+
$csv_delimiter = isset($fm_settings['csv_delimiter']) ? $fm_settings['csv_delimiter'] : ',';
|
21 |
+
$form_id = (int) $_REQUEST['form_id'];
|
22 |
+
$limitstart = (int) $_REQUEST['limitstart'];
|
23 |
+
$send_header = (int) $_REQUEST['send_header'];
|
24 |
+
$params = WDW_FMC_Library::get_submissions_to_export();
|
25 |
+
$data = $params[0];
|
26 |
+
$title = $params[1];
|
27 |
+
$is_paypal_info = $params[2];
|
28 |
+
$all_keys = array();
|
29 |
+
foreach ( $data as $row ) {
|
30 |
+
$all_keys = array_merge($all_keys, $row);
|
31 |
+
}
|
32 |
+
$keys_array = array_keys($all_keys);
|
33 |
+
foreach ( $data as $key => $row ) {
|
34 |
+
foreach ( $keys_array as $key1 => $value ) {
|
35 |
+
if ( !array_key_exists($value, $row) ) {
|
36 |
+
array_splice($row, $key1, 0, '');
|
37 |
+
}
|
38 |
+
}
|
39 |
+
$data[$key] = $row;
|
40 |
+
}
|
41 |
+
$upload_dir = wp_upload_dir();
|
42 |
+
$file_path = $upload_dir['basedir'] . '/form-maker';
|
43 |
+
if ( !is_dir($file_path) ) {
|
44 |
+
mkdir($file_path, 0777);
|
45 |
+
}
|
46 |
+
$tempfile = $file_path . '/export' . $form_id . '.txt';
|
47 |
+
if ( $limitstart == 0 && file_exists($tempfile) ) {
|
48 |
+
unlink($tempfile);
|
49 |
+
}
|
50 |
+
$output = fopen($tempfile, "a");
|
51 |
+
if ( $limitstart == 0 ) {
|
52 |
+
fputcsv($output, str_replace('PAYPAL_', '', $keys_array), $csv_delimiter);
|
53 |
+
}
|
54 |
+
foreach ( $data as $record ) {
|
55 |
+
fputcsv($output, $record, $csv_delimiter);
|
56 |
+
}
|
57 |
+
fclose($output);
|
58 |
+
if ( $send_header == 1 ) {
|
59 |
+
$txtfile = fopen($tempfile, "r");
|
60 |
+
$txtfilecontent = fread($txtfile, filesize($tempfile));
|
61 |
+
fclose($txtfile);
|
62 |
+
$filename = $title . "_" . date('Ymd') . ".csv";
|
63 |
+
header('Content-Encoding: Windows-1252');
|
64 |
+
header('Content-type: text/csv; charset=Windows-1252');
|
65 |
+
header("Content-Disposition: attachment; filename=\"$filename\"");
|
66 |
+
echo $txtfilecontent;
|
67 |
+
unlink($tempfile);
|
68 |
+
}
|
69 |
+
die();
|
70 |
+
}
|
71 |
+
}
|
admin/controllers/Generete_xml.php
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class FMControllerGenerete_xml_fmc
|
5 |
+
*/
|
6 |
+
class FMControllerGenerete_xml_fmc {
|
7 |
+
/**
|
8 |
+
* Execute.
|
9 |
+
*/
|
10 |
+
public function execute() {
|
11 |
+
$this->display();
|
12 |
+
}
|
13 |
+
|
14 |
+
public function display() {
|
15 |
+
$form_id = (int) $_REQUEST['form_id'];
|
16 |
+
$limitstart = (int) $_REQUEST['limitstart'];
|
17 |
+
$send_header = (int) $_REQUEST['send_header'];
|
18 |
+
$params = WDW_FMC_Library::get_submissions_to_export();
|
19 |
+
$data = $params[0];
|
20 |
+
$title = $params[1];
|
21 |
+
define('PHP_TAB', "\t");
|
22 |
+
$upload_dir = wp_upload_dir();
|
23 |
+
$file_path = $upload_dir['basedir'] . '/form-maker';
|
24 |
+
if ( !is_dir($file_path) ) {
|
25 |
+
mkdir($file_path, 0777);
|
26 |
+
}
|
27 |
+
$tempfile = $file_path . '/export' . $form_id . '.txt';
|
28 |
+
if ( $limitstart == 0 && file_exists($tempfile) ) {
|
29 |
+
unlink($tempfile);
|
30 |
+
}
|
31 |
+
$output = fopen($tempfile, "a");
|
32 |
+
if ( $limitstart == 0 ) {
|
33 |
+
fwrite($output, '<?xml version="1.0" encoding="utf-8" ?>' . PHP_EOL);
|
34 |
+
fwrite($output, '<form title="' . $title . '">' . PHP_EOL);
|
35 |
+
}
|
36 |
+
foreach ( $data as $key1 => $value1 ) {
|
37 |
+
fwrite($output, PHP_TAB . '<submission id="' . $key1 . '">' . PHP_EOL);
|
38 |
+
foreach ( $value1 as $key => $value ) {
|
39 |
+
fwrite($output, PHP_TAB . PHP_TAB . '<field title="' . $key . '">' . PHP_EOL);
|
40 |
+
fwrite($output, PHP_TAB . PHP_TAB . PHP_TAB . '<![CDATA[' . $value . ']]>' . PHP_EOL);
|
41 |
+
fwrite($output, PHP_TAB . PHP_TAB . '</field>' . PHP_EOL);
|
42 |
+
}
|
43 |
+
fwrite($output, PHP_TAB . '</submission>' . PHP_EOL);
|
44 |
+
}
|
45 |
+
if ( $send_header == 1 ) {
|
46 |
+
fwrite($output, '</form>');
|
47 |
+
fclose($output);
|
48 |
+
$txtfile = fopen($tempfile, "r");
|
49 |
+
$txtfilecontent = fread($txtfile, filesize($tempfile));
|
50 |
+
fclose($txtfile);
|
51 |
+
$filename = $title . "_" . date('Ymd') . ".xml";
|
52 |
+
header('Content-Encoding: Windows-1252');
|
53 |
+
header('Content-type: text/xml; charset=utf-8');
|
54 |
+
header("Content-Disposition: attachment; filename=\"$filename\"");
|
55 |
+
echo $txtfilecontent;
|
56 |
+
unlink($tempfile);
|
57 |
+
}
|
58 |
+
|
59 |
+
die();
|
60 |
+
}
|
61 |
+
}
|
admin/controllers/Licensing_fm.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class FMControllerLicensing_fmc
|
5 |
+
*/
|
6 |
+
class FMControllerLicensing_fmc {
|
7 |
+
private $view;
|
8 |
+
public function __construct() {
|
9 |
+
require_once WDCFM()->plugin_dir . "/admin/views/Licensing_fm.php";
|
10 |
+
$this->view = new FMViewLicensing_fmc();
|
11 |
+
}
|
12 |
+
public function execute() {
|
13 |
+
$task = WDW_FMC_Library::get('task');
|
14 |
+
$id = (int) WDW_FMC_Library::get('current_id', 0);
|
15 |
+
if (method_exists($this, $task)) {
|
16 |
+
$this->$task($id);
|
17 |
+
}
|
18 |
+
else {
|
19 |
+
$this->display();
|
20 |
+
}
|
21 |
+
}
|
22 |
+
|
23 |
+
public function display() {
|
24 |
+
$this->view->display();
|
25 |
+
}
|
26 |
+
}
|
admin/controllers/Manage_fm.php
ADDED
@@ -0,0 +1,1415 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class FMControllerManage_fmc {
|
3 |
+
private $model;
|
4 |
+
private $view;
|
5 |
+
private $page;
|
6 |
+
private $page_url;
|
7 |
+
private $bulk_action_name = '';
|
8 |
+
private $items_per_page = 20;
|
9 |
+
private $animation_effects = array();
|
10 |
+
private $actions = array();
|
11 |
+
|
12 |
+
function __construct() {
|
13 |
+
require_once WDCFM()->plugin_dir . "/admin/models/Manage_fm.php";
|
14 |
+
require_once WDCFM()->plugin_dir . "/admin/views/Manage_fm.php";
|
15 |
+
$this->model = new FMModelManage_fmc();
|
16 |
+
$this->view = new FMViewManage_fmc();
|
17 |
+
|
18 |
+
$this->page = WDW_FMC_Library::get('page');
|
19 |
+
$this->page_url = add_query_arg(array(
|
20 |
+
'page' => $this->page,
|
21 |
+
WDCFM()->nonce => wp_create_nonce(WDCFM()->nonce),
|
22 |
+
), admin_url('admin.php')
|
23 |
+
);
|
24 |
+
$this->bulk_action_name = 'bulk_action';
|
25 |
+
|
26 |
+
$this->actions = array(
|
27 |
+
'publish' => array(
|
28 |
+
'title' => __('Publish', WDCFM()->prefix),
|
29 |
+
$this->bulk_action_name => __('published', WDCFM()->prefix),
|
30 |
+
),
|
31 |
+
'unpublish' => array(
|
32 |
+
'title' => __('Unpublish', WDCFM()->prefix),
|
33 |
+
$this->bulk_action_name => __('unpublished', WDCFM()->prefix),
|
34 |
+
),
|
35 |
+
'duplicate' => array(
|
36 |
+
'title' => __('Duplicate', WDCFM()->prefix),
|
37 |
+
$this->bulk_action_name => __('duplicated', WDCFM()->prefix),
|
38 |
+
),
|
39 |
+
'delete' => array(
|
40 |
+
'title' => __('Delete', WDCFM()->prefix),
|
41 |
+
$this->bulk_action_name => __('deleted', WDCFM()->prefix),
|
42 |
+
),
|
43 |
+
);
|
44 |
+
|
45 |
+
$this->animation_effects = array(
|
46 |
+
'none' => 'None',
|
47 |
+
'bounce' => 'Bounce',
|
48 |
+
'tada' => 'Tada',
|
49 |
+
'bounceInDown' => 'BounceInDown',
|
50 |
+
'fadeInLeft' => 'FadeInLeft',
|
51 |
+
'flash' => 'Flash',
|
52 |
+
'pulse' => 'Pulse',
|
53 |
+
'rubberBand' => 'RubberBand',
|
54 |
+
'shake' => 'Shake',
|
55 |
+
'swing' => 'Swing',
|
56 |
+
'wobble' => 'Wobble',
|
57 |
+
'hinge' => 'Hinge',
|
58 |
+
'lightSpeedIn' => 'LightSpeedIn',
|
59 |
+
'rollIn' => 'RollIn',
|
60 |
+
'bounceIn' => 'BounceIn',
|
61 |
+
'bounceInLeft' => 'BounceInLeft',
|
62 |
+
'bounceInRight' => 'BounceInRight',
|
63 |
+
'bounceInUp' => 'BounceInUp',
|
64 |
+
'fadeIn' => 'FadeIn',
|
65 |
+
'fadeInDown' => 'FadeInDown',
|
66 |
+
'fadeInDownBig' => 'FadeInDownBig',
|
67 |
+
'fadeInLeftBig' => 'FadeInLeftBig',
|
68 |
+
'fadeInRight' => 'FadeInRight',
|
69 |
+
'fadeInRightBig' => 'FadeInRightBig',
|
70 |
+
'fadeInUp' => 'FadeInUp',
|
71 |
+
'fadeInUpBig' => 'FadeInUpBig',
|
72 |
+
'flip' => 'Flip',
|
73 |
+
'flipInX' => 'FlipInX',
|
74 |
+
'flipInY' => 'FlipInY',
|
75 |
+
'rotateIn' => 'RotateIn',
|
76 |
+
'rotateInDownLeft' => 'RotateInDownLeft',
|
77 |
+
'rotateInDownRight' => 'RotateInDownRight',
|
78 |
+
'rotateInUpLeft' => 'RotateInUpLeft',
|
79 |
+
'rotateInUpRight' => 'RotateInUpRight',
|
80 |
+
'zoomIn' => 'ZoomIn',
|
81 |
+
'zoomInDown' => 'ZoomInDown',
|
82 |
+
'zoomInLeft' => 'ZoomInLeft',
|
83 |
+
'zoomInRight' => 'ZoomInRight',
|
84 |
+
'zoomInUp' => 'ZoomInUp',
|
85 |
+
);
|
86 |
+
}
|
87 |
+
|
88 |
+
public function execute() {
|
89 |
+
$task = WDW_FMC_Library::get('task');
|
90 |
+
$id = (int) WDW_FMC_Library::get('current_id', 0);
|
91 |
+
if ( method_exists($this, $task) ) {
|
92 |
+
if ( $task != 'add' && $task != 'edit' && $task != 'display' ) {
|
93 |
+
check_admin_referer(WDCFM()->nonce, WDCFM()->nonce);
|
94 |
+
}
|
95 |
+
$block_action = $this->bulk_action_name;
|
96 |
+
$action = WDW_FMC_Library::get( $block_action, -1 );
|
97 |
+
if ( $action != -1 ) {
|
98 |
+
$this->$block_action($action);
|
99 |
+
}
|
100 |
+
else {
|
101 |
+
$this->$task($id);
|
102 |
+
}
|
103 |
+
}
|
104 |
+
else {
|
105 |
+
$this->display();
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
public function display() {
|
110 |
+
$params = array();
|
111 |
+
$params['order'] = WDW_FMC_Library::get('order', 'asc');
|
112 |
+
$params['orderby'] = WDW_FMC_Library::get('orderby', 'id');
|
113 |
+
// To prevent SQL injections.
|
114 |
+
if ( !in_array($params['orderby'], array( 'id', 'title', 'type' )) ) {
|
115 |
+
$params['orderby'] = 'id';
|
116 |
+
}
|
117 |
+
$params['order'] = $params['order'] == 'desc' ? 'desc' : 'asc';
|
118 |
+
|
119 |
+
$params['items_per_page'] = $this->items_per_page;
|
120 |
+
|
121 |
+
$params['rows_data'] = $this->model->get_rows_data($params);
|
122 |
+
|
123 |
+
$params['total'] = $this->model->total();
|
124 |
+
|
125 |
+
$params['actions'] = $this->actions;
|
126 |
+
$params['page'] = $this->page;
|
127 |
+
$params['form_preview_link'] = $this->model->get_form_preview_post();
|
128 |
+
|
129 |
+
$this->view->display($params);
|
130 |
+
}
|
131 |
+
|
132 |
+
/**
|
133 |
+
* Bulk actions.
|
134 |
+
*
|
135 |
+
* @param $task
|
136 |
+
*/
|
137 |
+
public function bulk_action($task) {
|
138 |
+
$message = 0;
|
139 |
+
$successfully_updated = 0;
|
140 |
+
|
141 |
+
$check = WDW_FMC_Library::get('check', '');
|
142 |
+
|
143 |
+
if ( $check ) {
|
144 |
+
foreach ( $check as $id => $item ) {
|
145 |
+
if ( method_exists($this, $task) ) {
|
146 |
+
$message = $this->$task($id, TRUE);
|
147 |
+
if ( $message != 2 ) {
|
148 |
+
// Increase successfully updated items count, if action doesn't failed.
|
149 |
+
$successfully_updated++;
|
150 |
+
}
|
151 |
+
}
|
152 |
+
}
|
153 |
+
if ( $successfully_updated ) {
|
154 |
+
$block_action = $this->bulk_action_name;
|
155 |
+
$message = sprintf(_n('%s item successfully %s.', '%s items successfully %s.', $successfully_updated, WDCFM()->prefix), $successfully_updated, $this->actions[$task][$block_action]);
|
156 |
+
}
|
157 |
+
}
|
158 |
+
|
159 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array(
|
160 |
+
'page' => $this->page,
|
161 |
+
'task' => 'display',
|
162 |
+
($message === 2 ? 'message' : 'msg') => $message,
|
163 |
+
), admin_url('admin.php')));
|
164 |
+
|
165 |
+
}
|
166 |
+
|
167 |
+
/**
|
168 |
+
* Delete form by id.
|
169 |
+
*
|
170 |
+
* @param $id
|
171 |
+
* @param bool $bulk
|
172 |
+
*
|
173 |
+
* @return int
|
174 |
+
*/
|
175 |
+
public function delete( $id, $bulk = FALSE ) {
|
176 |
+
if ( $this->model->delete_rows(array( "table" => "formmaker", "where" => "id = " . $id )) ) {
|
177 |
+
$this->model->delete_rows(array( "table" => "formmaker_views", "where" => "form_id = " . $id ));
|
178 |
+
$this->model->delete_rows(array( "table" => "formmaker_submits", "where" => "form_id = " . $id ));
|
179 |
+
$this->model->delete_rows(array( "table" => "formmaker_sessions", "where" => "form_id = " . $id ));
|
180 |
+
$this->model->delete_rows(array( "table" => "formmaker_backup", "where" => "id = " . $id ));
|
181 |
+
$this->model->delete_rows(array( "table" => "formmaker_display_options", "where" => "form_id = " . $id ));
|
182 |
+
if (WDCFM()->is_free == 2) {
|
183 |
+
$arr = explode(',', get_option('contact_form_forms'));
|
184 |
+
$arr = array_diff($arr, array($id));
|
185 |
+
$arr = implode(',', $arr);
|
186 |
+
update_option('contact_form_forms', $arr);
|
187 |
+
}
|
188 |
+
// To delete DB rows with form ids from add-ons.
|
189 |
+
if (WDCFM()->is_free != 2) {
|
190 |
+
do_action('fm_delete_addon_init', $id);
|
191 |
+
}
|
192 |
+
$message = 3;
|
193 |
+
}
|
194 |
+
else {
|
195 |
+
$message = 2;
|
196 |
+
}
|
197 |
+
|
198 |
+
if ( $bulk ) {
|
199 |
+
return $message;
|
200 |
+
}
|
201 |
+
else {
|
202 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array(
|
203 |
+
'page' => $this->page,
|
204 |
+
'task' => 'display',
|
205 |
+
'message' => $message,
|
206 |
+
), admin_url('admin.php')));
|
207 |
+
}
|
208 |
+
}
|
209 |
+
|
210 |
+
/**
|
211 |
+
* Publish by id.
|
212 |
+
*
|
213 |
+
* @param $id
|
214 |
+
* @param bool $bulk
|
215 |
+
*
|
216 |
+
* @return int
|
217 |
+
*/
|
218 |
+
public function publish( $id, $bulk = FALSE ) {
|
219 |
+
$updated = $this->model->update_data("formmaker", array('published' => 1), array('id' => $id));
|
220 |
+
if ( $updated !== FALSE ) {
|
221 |
+
$message = 9;
|
222 |
+
}
|
223 |
+
else {
|
224 |
+
$message = 2;
|
225 |
+
}
|
226 |
+
|
227 |
+
if ( $bulk ) {
|
228 |
+
return $message;
|
229 |
+
}
|
230 |
+
else {
|
231 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array(
|
232 |
+
'page' => $this->page,
|
233 |
+
'task' => 'display',
|
234 |
+
'message' => $message,
|
235 |
+
), admin_url('admin.php')));
|
236 |
+
}
|
237 |
+
}
|
238 |
+
|
239 |
+
/**
|
240 |
+
* Unpublish by id.
|
241 |
+
*
|
242 |
+
* @param $id
|
243 |
+
* @param bool $bulk
|
244 |
+
*
|
245 |
+
* @return int
|
246 |
+
*/
|
247 |
+
public function unpublish( $id, $bulk = FALSE ) {
|
248 |
+
$updated = $this->model->update_data("formmaker", array('published' => 0), array('id' => $id));
|
249 |
+
if ( $updated !== FALSE ) {
|
250 |
+
$message = 10;
|
251 |
+
}
|
252 |
+
else {
|
253 |
+
$message = 2;
|
254 |
+
}
|
255 |
+
|
256 |
+
if ( $bulk ) {
|
257 |
+
return $message;
|
258 |
+
}
|
259 |
+
else {
|
260 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array(
|
261 |
+
'page' => $this->page,
|
262 |
+
'task' => 'display',
|
263 |
+
'message' => $message,
|
264 |
+
), admin_url('admin.php')));
|
265 |
+
}
|
266 |
+
}
|
267 |
+
|
268 |
+
/**
|
269 |
+
* Duplicate by id.
|
270 |
+
*
|
271 |
+
* @param $id
|
272 |
+
* @param bool $bulk
|
273 |
+
*
|
274 |
+
* @return int
|
275 |
+
*/
|
276 |
+
public function duplicate( $id, $bulk = FALSE ) {
|
277 |
+
$message = 2;
|
278 |
+
$row = $this->model->select_rows("get_row", array(
|
279 |
+
"selection" => "*",
|
280 |
+
"table" => "formmaker",
|
281 |
+
"where" => "id=" . (int) $id,
|
282 |
+
));
|
283 |
+
|
284 |
+
if ( $row ) {
|
285 |
+
$row = (array) $row;
|
286 |
+
unset($row['id']);
|
287 |
+
$inserted = $this->model->insert_data_to_db("formmaker", (array) $row);
|
288 |
+
$id = (int) $this->model->get_max_row('formmaker', 'id');
|
289 |
+
if (WDCFM()->is_free == 2) {
|
290 |
+
update_option('contact_form_forms', ((get_option('contact_form_forms')) ? (get_option('contact_form_forms')) . ',' . $id : $id));
|
291 |
+
}
|
292 |
+
if ( $inserted !== FALSE ) {
|
293 |
+
$message = 11;
|
294 |
+
}
|
295 |
+
}
|
296 |
+
|
297 |
+
if ( $bulk ) {
|
298 |
+
return $message;
|
299 |
+
}
|
300 |
+
else {
|
301 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array(
|
302 |
+
'page' => $this->page,
|
303 |
+
'task' => 'display',
|
304 |
+
'message' => $message,
|
305 |
+
), admin_url('admin.php')));
|
306 |
+
}
|
307 |
+
}
|
308 |
+
|
309 |
+
public function add() {
|
310 |
+
$backup_id = 0;
|
311 |
+
$params = array();
|
312 |
+
$params['id'] = $backup_id;
|
313 |
+
$params['row'] = $this->model->get_row_data_new($backup_id);
|
314 |
+
$params['page_url'] = $this->page_url;
|
315 |
+
// Check if Stripe add-on is active.
|
316 |
+
$stripe_addon = array('enable' => 0);
|
317 |
+
$addon_stripe = $this->get_stripe_addon(0);
|
318 |
+
if( !empty($addon_stripe['html']) ) {
|
319 |
+
$stripe_addon = $addon_stripe;
|
320 |
+
}
|
321 |
+
$params['stripe_addon'] = $stripe_addon;
|
322 |
+
|
323 |
+
$params['themes'] = $this->model->get_theme_rows_data();
|
324 |
+
$params['default_theme'] = $this->model->get_default_theme_id();
|
325 |
+
$params['form_preview_link'] = "";
|
326 |
+
|
327 |
+
$params['autogen_layout'] = 1;
|
328 |
+
$labels = array();
|
329 |
+
$label_id = array();
|
330 |
+
$label_order_original = array();
|
331 |
+
$label_type = array();
|
332 |
+
$label_all = explode('#****#', $params['row']->label_order);
|
333 |
+
$label_all = array_slice($label_all, 0, count($label_all) - 1);
|
334 |
+
foreach ( $label_all as $key => $label_each ) {
|
335 |
+
$label_id_each = explode('#**id**#', $label_each);
|
336 |
+
array_push($label_id, $label_id_each[0]);
|
337 |
+
$label_oder_each = explode('#**label**#', $label_id_each[1]);
|
338 |
+
array_push($label_order_original, addslashes($label_oder_each[0]));
|
339 |
+
array_push($label_type, $label_oder_each[1]);
|
340 |
+
}
|
341 |
+
|
342 |
+
$labels['id'] = '"' . implode('","', $label_id) . '"';
|
343 |
+
$labels['label'] = '"' . implode('","', $label_order_original) . '"';
|
344 |
+
$labels['type'] = '"' . implode('","', $label_type) . '"';
|
345 |
+
$params['labels'] = $labels;
|
346 |
+
|
347 |
+
$params['page_title'] = __('Create new form', WDCFM()->prefix);
|
348 |
+
$params['animation_effects'] = $this->animation_effects;
|
349 |
+
|
350 |
+
$this->view->edit($params);
|
351 |
+
}
|
352 |
+
|
353 |
+
public function edit($id = 0, $backup_id = 0) {
|
354 |
+
$fm_settings = get_option('fmc_settings');
|
355 |
+
$fm_advanced_layout = isset($fm_settings['fm_advanced_layout']) && $fm_settings['fm_advanced_layout'] == '1' ? 1 : 0;
|
356 |
+
if ( $id && !$fm_advanced_layout ) {
|
357 |
+
$fm_advanced_layout = !$this->model->get_autogen_layout($id);
|
358 |
+
}
|
359 |
+
if ( !$backup_id ) {
|
360 |
+
$backup_id = $this->model->select_rows("get_var", array(
|
361 |
+
"selection" => "backup_id",
|
362 |
+
"table" => "formmaker_backup",
|
363 |
+
"where" => "cur=1 and id=" . $id,
|
364 |
+
));
|
365 |
+
|
366 |
+
if ( !$backup_id ) {
|
367 |
+
$backup_id = $this->model->get_max_row("formmaker_backup", "backup_id");
|
368 |
+
if ( $backup_id ) {
|
369 |
+
$backup_id++;
|
370 |
+
}
|
371 |
+
else {
|
372 |
+
$backup_id = 1;
|
373 |
+
}
|
374 |
+
$this->model->insert_formmaker_backup($backup_id, $id);
|
375 |
+
}
|
376 |
+
}
|
377 |
+
|
378 |
+
$params = array();
|
379 |
+
$params['id'] = $id;
|
380 |
+
$params['row'] = $this->model->get_row_data_new($backup_id);
|
381 |
+
if ( empty($params['row']) ) {
|
382 |
+
WDW_FMC_Library::fm_redirect( add_query_arg( array('page' => $this->page, 'task' => 'display'), admin_url('admin.php') ) );
|
383 |
+
}
|
384 |
+
|
385 |
+
// Check stripe add-on is active.
|
386 |
+
$stripe_addon = array( 'enable' => 0 );
|
387 |
+
$addon_stripe = $this->get_stripe_addon($id);
|
388 |
+
if ( !empty($addon_stripe['html']) ) {
|
389 |
+
$stripe_addon = $addon_stripe;
|
390 |
+
}
|
391 |
+
$params['stripe_addon'] = $stripe_addon;
|
392 |
+
$params['page_url'] = $this->page_url;
|
393 |
+
$params['themes'] = $this->model->get_theme_rows_data();
|
394 |
+
$params['default_theme'] = $this->model->get_default_theme_id();
|
395 |
+
|
396 |
+
$params['form_preview_link'] = $this->model->get_form_preview_post();
|
397 |
+
|
398 |
+
if ( $id ) {
|
399 |
+
$params['form_options_url'] = add_query_arg( array( 'page' => $this->page , 'task' => 'form_options', 'current_id' => $id ), $this->page_url );
|
400 |
+
$params['display_options_url'] = add_query_arg( array( 'page' => $this->page , 'task' => 'display_options', 'current_id' => $id ), $this->page_url );
|
401 |
+
$params['advanced_layout_url'] = $fm_advanced_layout ? add_query_arg( array( 'page' => $this->page , 'task' => 'form_layout', 'current_id' => $id ), $this->page_url ) : '';
|
402 |
+
}
|
403 |
+
|
404 |
+
if ( isset($params['row']->backup_id) ) {
|
405 |
+
if ( $params['row']->backup_id != "" ) {
|
406 |
+
$params['next_backup_id'] = $this->model->get_backup_id($params['row']->backup_id, $params['row']->id);
|
407 |
+
$params['prev_backup_id'] = $this->model->get_prev_backup_id($params['row']->backup_id, $params['row']->id);
|
408 |
+
}
|
409 |
+
}
|
410 |
+
|
411 |
+
$labels = array();
|
412 |
+
$label_id = array();
|
413 |
+
$label_order_original = array();
|
414 |
+
$label_type = array();
|
415 |
+
$label_all = explode('#****#', $params['row']->label_order);
|
416 |
+
$label_all = array_slice($label_all, 0, count($label_all) - 1);
|
417 |
+
foreach ( $label_all as $key => $label_each ) {
|
418 |
+
$label_id_each = explode('#**id**#', $label_each);
|
419 |
+
array_push($label_id, $label_id_each[0]);
|
420 |
+
$label_oder_each = explode('#**label**#', $label_id_each[1]);
|
421 |
+
array_push($label_order_original, addslashes($label_oder_each[0]));
|
422 |
+
array_push($label_type, $label_oder_each[1]);
|
423 |
+
}
|
424 |
+
|
425 |
+
$labels['id'] = '"' . implode('","', $label_id) . '"';
|
426 |
+
$labels['label'] = '"' . implode('","', $label_order_original) . '"';
|
427 |
+
$labels['type'] = '"' . implode('","', $label_type) . '"';
|
428 |
+
$params['labels'] = $labels;
|
429 |
+
|
430 |
+
$params['page_title'] = (($params['id'] != 0) ? 'Edit form ' . $params['row']->title : 'Create new form');
|
431 |
+
|
432 |
+
$params['animation_effects'] = $this->animation_effects;
|
433 |
+
|
434 |
+
$this->view->edit($params);
|
435 |
+
}
|
436 |
+
|
437 |
+
public function undo() {
|
438 |
+
$backup_id = (int) WDW_FMC_Library::get('backup_id');
|
439 |
+
$id = (int) WDW_FMC_Library::get('id');
|
440 |
+
$backup_id = $this->model->get_undo_redo_id($backup_id, $id, 0);
|
441 |
+
$this->edit($id, $backup_id);
|
442 |
+
}
|
443 |
+
|
444 |
+
public function redo() {
|
445 |
+
$backup_id = (int) WDW_FMC_Library::get('backup_id');
|
446 |
+
$id = (int) WDW_FMC_Library::get('id');
|
447 |
+
$backup_id = $this->model->get_undo_redo_id($backup_id, $id, 1);
|
448 |
+
$this->edit($id, $backup_id);
|
449 |
+
}
|
450 |
+
|
451 |
+
/**
|
452 |
+
* Form options.
|
453 |
+
*
|
454 |
+
* @param int $id
|
455 |
+
*/
|
456 |
+
public function form_options( $id ) {
|
457 |
+
// Set params for view.
|
458 |
+
$params = array();
|
459 |
+
$params['id'] = $id;
|
460 |
+
$params['page'] = $this->page;
|
461 |
+
$params['page_url'] = $this->page_url;
|
462 |
+
|
463 |
+
$params['back_url'] = add_query_arg( array (
|
464 |
+
'page' => 'manage' . WDCFM()->menu_postfix,
|
465 |
+
'task' => 'edit',
|
466 |
+
'current_id' => $id,
|
467 |
+
|
468 |
+
), admin_url('admin.php')
|
469 |
+
);
|
470 |
+
|
471 |
+
$params['fieldset_id'] = WDW_FMC_Library::get('fieldset_id', 'general');
|
472 |
+
|
473 |
+
$params['row'] = $this->model->get_row_data($id);
|
474 |
+
if ( empty($params['row']) ) {
|
475 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array('page' => $this->page), admin_url('admin.php')));
|
476 |
+
}
|
477 |
+
|
478 |
+
$params['themes'] = $this->model->get_theme_rows_data();
|
479 |
+
$params['default_theme'] = $this->model->get_default_theme_id();
|
480 |
+
$params['queries'] = $this->model->get_queries_rows_data($id);
|
481 |
+
$params['userGroups'] = get_editable_roles();
|
482 |
+
$params['page_title'] = '"' . $params['row']->title . '" ' . __('options', WDCFM()->prefix);
|
483 |
+
|
484 |
+
$label_id = array();
|
485 |
+
$label_label = array();
|
486 |
+
$label_type = array();
|
487 |
+
$label_all = explode('#****#', $params['row']->label_order_current);
|
488 |
+
$label_all = array_slice($label_all, 0, count($label_all) - 1);
|
489 |
+
foreach ( $label_all as $key => $label_each ) {
|
490 |
+
$label_id_each = explode('#**id**#', $label_each);
|
491 |
+
array_push($label_id, $label_id_each[0]);
|
492 |
+
$label_order_each = explode('#**label**#', $label_id_each[1]);
|
493 |
+
array_push($label_label, $label_order_each[0]);
|
494 |
+
array_push($label_type, $label_order_each[1]);
|
495 |
+
}
|
496 |
+
$params['fields'] = explode('*:*id*:*type_submitter_mail*:*type*:*', $params['row']->form_fields);
|
497 |
+
$params['fields_count'] = count($params['fields']);
|
498 |
+
|
499 |
+
// chechk stripe addon is active.
|
500 |
+
$stripe_addon = array('enable' => 0);
|
501 |
+
$addon_stripe = $this->get_stripe_addon($id);
|
502 |
+
if( !empty($addon_stripe['html']) ) {
|
503 |
+
$stripe_addon = $addon_stripe;
|
504 |
+
}
|
505 |
+
$params['stripe_addon'] = $stripe_addon;
|
506 |
+
|
507 |
+
/*
|
508 |
+
TODO.
|
509 |
+
Remember. 0 => none, 1 => paypal, 2 => stripe
|
510 |
+
Change. rename paypal_mode name to payment_method of wp_formmaker table.
|
511 |
+
*/
|
512 |
+
$paypal_mode = $params['row']->paypal_mode;
|
513 |
+
$payment_method = 'none';
|
514 |
+
if($paypal_mode == 1){
|
515 |
+
$payment_method = 'paypal';
|
516 |
+
}
|
517 |
+
if($paypal_mode == 2 && isset($stripe_addon['stripe_enable']) && $stripe_addon['stripe_enable'] == 1 ){
|
518 |
+
$payment_method = 'stripe';
|
519 |
+
}
|
520 |
+
|
521 |
+
$params['payment_method'] = $payment_method;
|
522 |
+
$params['label_label'] = $label_label;
|
523 |
+
$params['label_type'] = $label_type;
|
524 |
+
$params['labels_for_submissions'] = $this->model->get_labels($id);
|
525 |
+
$params['payment_info'] = $this->model->is_paypal($id);
|
526 |
+
|
527 |
+
$labels_id_for_submissions = array();
|
528 |
+
$label_titles_for_submissions = array();
|
529 |
+
$labels_type_for_submissions = array();
|
530 |
+
if ( $params['labels_for_submissions'] ) {
|
531 |
+
$label_id_for_submissions = array();
|
532 |
+
$label_order_original_for_submissions = array();
|
533 |
+
$label_type_for_submissions = array();
|
534 |
+
if ( strpos($params['row']->label_order, 'type_paypal_') ) {
|
535 |
+
$params['row']->label_order = $params['row']->label_order . "item_total#**id**#Item Total#**label**#type_paypal_payment_total#****#total#**id**#Total#**label**#type_paypal_payment_total#****#0#**id**#Payment Status#**label**#type_paypal_payment_status#****#";
|
536 |
+
}
|
537 |
+
$label_all_for_submissions = explode('#****#', $params['row']->label_order);
|
538 |
+
$label_all_for_submissions = array_slice($label_all_for_submissions, 0, count($label_all_for_submissions) - 1);
|
539 |
+
foreach ( $label_all_for_submissions as $key => $label_each ) {
|
540 |
+
$label_id_each = explode('#**id**#', $label_each);
|
541 |
+
array_push($label_id_for_submissions, $label_id_each[0]);
|
542 |
+
$label_order_each = explode('#**label**#', $label_id_each[1]);
|
543 |
+
array_push($label_order_original_for_submissions, $label_order_each[0]);
|
544 |
+
array_push($label_type_for_submissions, $label_order_each[1]);
|
545 |
+
}
|
546 |
+
foreach ( $label_id_for_submissions as $key => $label ) {
|
547 |
+
if ( in_array($label, $params['labels_for_submissions']) ) {
|
548 |
+
array_push($labels_type_for_submissions, $label_type_for_submissions[$key]);
|
549 |
+
array_push($labels_id_for_submissions, $label);
|
550 |
+
array_push($label_titles_for_submissions, $label_order_original_for_submissions[$key]);
|
551 |
+
}
|
552 |
+
}
|
553 |
+
$params['labels_id_for_submissions'] = $labels_id_for_submissions;
|
554 |
+
$params['label_titles_for_submissions'] = $label_titles_for_submissions;
|
555 |
+
}
|
556 |
+
|
557 |
+
$stats_labels = array();
|
558 |
+
$stats_labels_ids = array();
|
559 |
+
foreach ( $labels_type_for_submissions as $key => $label_type_cur ) {
|
560 |
+
if ( $label_type_cur == "type_checkbox" || $label_type_cur == "type_radio" || $label_type_cur == "type_own_select" || $label_type_cur == "type_country" || $label_type_cur == "type_paypal_select" || $label_type_cur == "type_paypal_radio" || $label_type_cur == "type_paypal_checkbox" || $label_type_cur == "type_paypal_shipping" ) {
|
561 |
+
$stats_labels_ids[] = $labels_id_for_submissions[$key];
|
562 |
+
$stats_labels[] = $label_titles_for_submissions[$key];
|
563 |
+
}
|
564 |
+
}
|
565 |
+
|
566 |
+
$params['stats_labels_ids'] = $stats_labels_ids;
|
567 |
+
$params['stats_labels'] = $stats_labels;
|
568 |
+
$params['mail_ver_id'] = $this->model->get_emailverification_post_id();
|
569 |
+
|
570 |
+
$params['addons'] = $this->get_addon_tabs( array('form_id' => $id) );
|
571 |
+
|
572 |
+
$this->view->form_options($params);
|
573 |
+
}
|
574 |
+
|
575 |
+
/**
|
576 |
+
* Get active addons.
|
577 |
+
*
|
578 |
+
* @param $params
|
579 |
+
*
|
580 |
+
* @return mixed|void
|
581 |
+
*/
|
582 |
+
private function get_addon_tabs( $params ) {
|
583 |
+
$addons = array('tabs' => array(), 'html' => array());
|
584 |
+
if (WDCFM()->is_free != 2) {
|
585 |
+
$addons = apply_filters('fm_get_addon_init', $addons, $params);
|
586 |
+
}
|
587 |
+
return $addons;
|
588 |
+
}
|
589 |
+
|
590 |
+
/**
|
591 |
+
* Apply form options.
|
592 |
+
*
|
593 |
+
* @param int $id
|
594 |
+
*/
|
595 |
+
public function apply_form_options( $id ) {
|
596 |
+
$fieldset_id = WDW_FMC_Library::get('fieldset_id', 'general');
|
597 |
+
$message = $this->save_db_form_options( $id );
|
598 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array(
|
599 |
+
'page' => $this->page,
|
600 |
+
'task' => 'form_options',
|
601 |
+
'current_id' => $id,
|
602 |
+
'fieldset_id' => $fieldset_id,
|
603 |
+
'message' => $message,
|
604 |
+
), admin_url('admin.php')));
|
605 |
+
}
|
606 |
+
|
607 |
+
/**
|
608 |
+
* Save db Form options.
|
609 |
+
*
|
610 |
+
* @param int $id
|
611 |
+
*
|
612 |
+
* @return int $id_message
|
613 |
+
*/
|
614 |
+
public function save_db_form_options( $id ) {
|
615 |
+
$javascript = "// Occurs before the form is loaded
|
616 |
+
function before_load() {
|
617 |
+
|
618 |
+
}
|
619 |
+
// Occurs just before submitting the form
|
620 |
+
function before_submit() {
|
621 |
+
// IMPORTANT! If you want to interrupt (stop) the submitting of the form, this function should return true. You don't need to return any value if you don't want to stop the submission.
|
622 |
+
}
|
623 |
+
// Occurs just before resetting the form
|
624 |
+
function before_reset() {
|
625 |
+
|
626 |
+
}";
|
627 |
+
|
628 |
+
$published = stripslashes(WDW_FMC_Library::get('published', ''));
|
629 |
+
$savedb = stripslashes(WDW_FMC_Library::get('savedb', ''));
|
630 |
+
$theme = (int) WDW_FMC_Library::get('theme', 0);
|
631 |
+
$theme = ($theme) ? $theme : $this->model->get_default_theme_id();
|
632 |
+
$requiredmark = stripslashes(WDW_FMC_Library::get('requiredmark', '*'));
|
633 |
+
$sendemail = stripslashes(WDW_FMC_Library::get('sendemail', ''));
|
634 |
+
$save_uploads = stripslashes(WDW_FMC_Library::get('save_uploads', ''));
|
635 |
+
$mail = stripslashes(WDW_FMC_Library::get('mail', ''));
|
636 |
+
if ( isset($_POST['mailToAdd']) && esc_html(stripslashes($_POST['mailToAdd'])) != '' ) {
|
637 |
+
$mail .= esc_html(stripslashes($_POST['mailToAdd'])) . ',';
|
638 |
+
}
|
639 |
+
$from_mail = stripslashes(WDW_FMC_Library::get('from_mail', ''));
|
640 |
+
$from_name = stripslashes(WDW_FMC_Library::get('from_name', ''));
|
641 |
+
$reply_to = stripslashes(WDW_FMC_Library::get('reply_to', ''));
|
642 |
+
if ( $from_mail == "other" ) {
|
643 |
+
$from_mail = stripslashes(WDW_FMC_Library::get('mail_from_other', ''));
|
644 |
+
}
|
645 |
+
if ( $reply_to == "other" ) {
|
646 |
+
$reply_to = stripslashes(WDW_FMC_Library::get('reply_to_other', ''));
|
647 |
+
}
|
648 |
+
$script_mail = WDW_FMC_Library::get('script_mail', '%all%', FALSE);
|
649 |
+
$mail_from_user = WDW_FMC_Library::get('mail_from_user', '');
|
650 |
+
$mail_from_name_user = WDW_FMC_Library::get('mail_from_name_user', '');
|
651 |
+
$reply_to_user = WDW_FMC_Library::get('reply_to_user', '');
|
652 |
+
$condition = WDW_FMC_Library::get('condition', '');
|
653 |
+
$mail_cc = WDW_FMC_Library::get('mail_cc', '');
|
654 |
+
$mail_cc_user = WDW_FMC_Library::get('mail_cc_user', '');
|
655 |
+
$mail_bcc = WDW_FMC_Library::get('mail_bcc', '');
|
656 |
+
$mail_bcc_user = WDW_FMC_Library::get('mail_bcc_user', '');
|
657 |
+
$mail_subject = WDW_FMC_Library::get('mail_subject', '');
|
658 |
+
$mail_subject_user = WDW_FMC_Library::get('mail_subject_user', '');
|
659 |
+
$mail_mode = WDW_FMC_Library::get('mail_mode', '');
|
660 |
+
$mail_mode_user = WDW_FMC_Library::get('mail_mode_user', '');
|
661 |
+
$mail_attachment = WDW_FMC_Library::get('mail_attachment', '');
|
662 |
+
$mail_attachment_user = WDW_FMC_Library::get('mail_attachment_user', '');
|
663 |
+
$script_mail_user = WDW_FMC_Library::get('script_mail_user', '%all%', FALSE);
|
664 |
+
$submit_text = WDW_FMC_Library::get('submit_text', '', FALSE);
|
665 |
+
$url = WDW_FMC_Library::get('url', '');
|
666 |
+
$tax = WDW_FMC_Library::get('tax', 0);
|
667 |
+
$payment_currency = WDW_FMC_Library::get('payment_currency', '');
|
668 |
+
$paypal_email = WDW_FMC_Library::get('paypal_email', '');
|
669 |
+
$checkout_mode = WDW_FMC_Library::get('checkout_mode', 'testmode');
|
670 |
+
$paypal_mode = WDW_FMC_Library::get('paypal_mode', 0);
|
671 |
+
|
672 |
+
// TODO Seclude payment method and payment status.
|
673 |
+
if ( $paypal_mode == 'paypal' ) {
|
674 |
+
$paypal_mode = 1;
|
675 |
+
}
|
676 |
+
if ( $paypal_mode == 'stripe' ) {
|
677 |
+
$paypal_mode = 2;
|
678 |
+
}
|
679 |
+
|
680 |
+
$javascript = stripslashes(WDW_FMC_Library::get('javascript', $javascript, false));
|
681 |
+
$user_id_wd = stripslashes(WDW_FMC_Library::get('user_id_wd', 'administrator,'));
|
682 |
+
$frontend_submit_fields = stripslashes(WDW_FMC_Library::get('frontend_submit_fields', ''));
|
683 |
+
$frontend_submit_stat_fields = stripslashes(WDW_FMC_Library::get('frontend_submit_stat_fields', ''));
|
684 |
+
$mail_emptyfields = stripslashes(WDW_FMC_Library::get('mail_emptyfields', 0));
|
685 |
+
$mail_verify = stripslashes(WDW_FMC_Library::get('mail_verify', 0));
|
686 |
+
$mail_verify_expiretime = stripslashes(WDW_FMC_Library::get('mail_verify_expiretime', ''));
|
687 |
+
$send_to = '';
|
688 |
+
for ( $i = 0; $i < 20; $i++ ) {
|
689 |
+
if ( WDW_FMC_Library::get('send_to' . $i, 0) ) {
|
690 |
+
$send_to .= '*' . WDW_FMC_Library::get('send_to' . $i, 0) . '*';
|
691 |
+
}
|
692 |
+
}
|
693 |
+
if ( WDW_FMC_Library::get('submit_text_type', 0) ) {
|
694 |
+
$submit_text_type = WDW_FMC_Library::get('submit_text_type', 0);
|
695 |
+
if ( $submit_text_type == 5 ) {
|
696 |
+
$article_id = WDW_FMC_Library::get('page_name', 0);
|
697 |
+
}
|
698 |
+
else {
|
699 |
+
$article_id = WDW_FMC_Library::get('post_name', 0);
|
700 |
+
}
|
701 |
+
}
|
702 |
+
else {
|
703 |
+
$submit_text_type = 1;
|
704 |
+
$article_id = 0;
|
705 |
+
}
|
706 |
+
$mail_verification_post_id = (int) $this->model->get_mail_verification_post_id();
|
707 |
+
if ( $mail_verify ) {
|
708 |
+
$email_verification_post = array(
|
709 |
+
'post_title' => 'Email Verification',
|
710 |
+
'post_content' => '[email_verification]',
|
711 |
+
'post_status' => 'publish',
|
712 |
+
'post_author' => 1,
|
713 |
+
'post_type' => 'fmemailverification',
|
714 |
+
);
|
715 |
+
if ( !$mail_verification_post_id || get_post($mail_verification_post_id) === NULL ) {
|
716 |
+
$mail_verification_post_id = wp_insert_post($email_verification_post);
|
717 |
+
}
|
718 |
+
}
|
719 |
+
|
720 |
+
$data = array(
|
721 |
+
'published' => $published,
|
722 |
+
'savedb' => $savedb,
|
723 |
+
'theme' => $theme,
|
724 |
+
'requiredmark' => $requiredmark,
|
725 |
+
'sendemail' => $sendemail,
|
726 |
+
'save_uploads' => $save_uploads,
|
727 |
+
'mail' => $mail,
|
728 |
+
'from_mail' => $from_mail,
|
729 |
+
'from_name' => $from_name,
|
730 |
+
'reply_to' => $reply_to,
|
731 |
+
'script_mail' => $script_mail,
|
732 |
+
'mail_from_user' => $mail_from_user,
|
733 |
+
'mail_from_name_user' => $mail_from_name_user,
|
734 |
+
'reply_to_user' => $reply_to_user,
|
735 |
+
'condition' => $condition,
|
736 |
+
'mail_cc' => $mail_cc,
|
737 |
+
'mail_cc_user' => $mail_cc_user,
|
738 |
+
'mail_bcc' => $mail_bcc,
|
739 |
+
'mail_bcc_user' => $mail_bcc_user,
|
740 |
+
'mail_subject' => $mail_subject,
|
741 |
+
'mail_subject_user' => $mail_subject_user,
|
742 |
+
'mail_mode' => $mail_mode,
|
743 |
+
'mail_mode_user' => $mail_mode_user,
|
744 |
+
'mail_attachment' => $mail_attachment,
|
745 |
+
'mail_attachment_user' => $mail_attachment_user,
|
746 |
+
'script_mail_user' => $script_mail_user,
|
747 |
+
'submit_text' => $submit_text,
|
748 |
+
'url' => $url,
|
749 |
+
'submit_text_type' => $submit_text_type,
|
750 |
+
'article_id' => $article_id,
|
751 |
+
'tax' => $tax,
|
752 |
+
'payment_currency' => $payment_currency,
|
753 |
+
'paypal_email' => $paypal_email,
|
754 |
+
'checkout_mode' => $checkout_mode,
|
755 |
+
'paypal_mode' => $paypal_mode,
|
756 |
+
'javascript' => $javascript,
|
757 |
+
'user_id_wd' => $user_id_wd,
|
758 |
+
'send_to' => $send_to,
|
759 |
+
'frontend_submit_fields' => $frontend_submit_fields,
|
760 |
+
'frontend_submit_stat_fields' => $frontend_submit_stat_fields,
|
761 |
+
'mail_emptyfields' => $mail_emptyfields,
|
762 |
+
'mail_verify' => $mail_verify,
|
763 |
+
'mail_verify_expiretime' => $mail_verify_expiretime,
|
764 |
+
'mail_verification_post_id' => $mail_verification_post_id,
|
765 |
+
);
|
766 |
+
|
767 |
+
$message_id = 2;
|
768 |
+
$save = $this->model->update_data('formmaker', $data, array( 'id' => $id ));
|
769 |
+
if ( $save !== FALSE ) {
|
770 |
+
$this->model->update_data("formmaker_backup", array(
|
771 |
+
'theme' => $theme,
|
772 |
+
), array( 'id' => $id )); //save theme in backup
|
773 |
+
$this->model->create_js($id);
|
774 |
+
if (WDCFM()->is_free != 2) {
|
775 |
+
$save_addon = do_action('fm_save_addon_init', $id);
|
776 |
+
}
|
777 |
+
$message_id = 8;
|
778 |
+
}
|
779 |
+
return $message_id;
|
780 |
+
}
|
781 |
+
|
782 |
+
/**
|
783 |
+
* Form layout.
|
784 |
+
*
|
785 |
+
* @param int $id
|
786 |
+
*/
|
787 |
+
public function form_layout( $id ) {
|
788 |
+
$ids = array();
|
789 |
+
$types = array();
|
790 |
+
$labels = array();
|
791 |
+
|
792 |
+
$row = $this->model->get_row_data( $id );
|
793 |
+
if ( empty($row) ) {
|
794 |
+
WDW_FMC_Library::fm_redirect( add_query_arg( array('page' => $this->page, 'task' => 'display'), admin_url('admin.php') ) );
|
795 |
+
}
|
796 |
+
$fields = explode('*:*new_field*:*', $row->form_fields);
|
797 |
+
$fields = array_slice($fields, 0, count($fields) - 1);
|
798 |
+
foreach ( $fields as $field ) {
|
799 |
+
$temp = explode('*:*id*:*', $field);
|
800 |
+
array_push($ids, $temp[0]);
|
801 |
+
$temp = explode('*:*type*:*', $temp[1]);
|
802 |
+
array_push($types, $temp[0]);
|
803 |
+
$temp = explode('*:*w_field_label*:*', $temp[1]);
|
804 |
+
array_push($labels, $temp[0]);
|
805 |
+
}
|
806 |
+
|
807 |
+
// Set params for view.
|
808 |
+
$params = array();
|
809 |
+
$params['id'] = $id;
|
810 |
+
$params['row'] = $row;
|
811 |
+
$params['page'] = $this->page;
|
812 |
+
$params['page_url'] = $this->page_url;
|
813 |
+
$params['page_title'] = '"'. $row->title . '" ' . __('layout', WDCFM()->prefix);
|
814 |
+
$params['back_url'] = add_query_arg( array ('page' => 'manage' . WDCFM()->menu_postfix,'task' => 'edit','current_id' => $id ), admin_url('admin.php'));
|
815 |
+
$params['ids'] = $ids;
|
816 |
+
$params['types'] = $types;
|
817 |
+
$params['labels'] = $labels;
|
818 |
+
$this->view->form_layout($params);
|
819 |
+
}
|
820 |
+
|
821 |
+
public function apply_layout( $id ) {
|
822 |
+
$message = $this->save_db_layout( $id );
|
823 |
+
WDW_FMC_Library::fm_redirect( add_query_arg( array('page' => $this->page, 'task' => 'form_layout', 'current_id' => $id, 'message' => $message), admin_url('admin.php') ) );
|
824 |
+
}
|
825 |
+
|
826 |
+
/**
|
827 |
+
* Save db layout.
|
828 |
+
*
|
829 |
+
* @param int $id
|
830 |
+
*
|
831 |
+
* @return int $id_message
|
832 |
+
*/
|
833 |
+
public function save_db_layout( $id ) {
|
834 |
+
$custom_front = WDW_FMC_Library::get('custom_front', '', false);
|
835 |
+
$autogen_layout = WDW_FMC_Library::get('autogen_layout', '');
|
836 |
+
|
837 |
+
$update = $this->model->update_data('formmaker', array(
|
838 |
+
'custom_front' => $custom_front,
|
839 |
+
'autogen_layout' => $autogen_layout,
|
840 |
+
), array( 'id' => $id ));
|
841 |
+
if ( $update !== FALSE ) {
|
842 |
+
return 1;
|
843 |
+
}
|
844 |
+
else {
|
845 |
+
return 2;
|
846 |
+
}
|
847 |
+
}
|
848 |
+
|
849 |
+
public function display_options() {
|
850 |
+
$id = (int) WDW_FMC_Library::get('current_id', $this->model->get_max_row("formmaker", "id"));
|
851 |
+
$params = array();
|
852 |
+
$params['row_form'] = $this->model->get_row_data($id);
|
853 |
+
if ( empty($params['row_form']) ) {
|
854 |
+
WDW_FMC_Library::fm_redirect( add_query_arg( array('page' => $this->page, 'task' => 'display'), admin_url('admin.php') ) );
|
855 |
+
}
|
856 |
+
$params['row'] = $this->model->get_display_options($id);
|
857 |
+
$params['page_title'] = '"'. $params['row_form']->title . '" ' . __('display options', WDCFM()->prefix);
|
858 |
+
$params['animation_effects'] = $this->animation_effects;
|
859 |
+
$params['posts_and_pages'] = $this->model->fm_posts_query();
|
860 |
+
$params['categories'] = $this->model->fm_categories_query();
|
861 |
+
$params['selected_categories'] = explode(',', $params['row']->display_on_categories);
|
862 |
+
$params['current_categories_array'] = explode(',', $params['row']->current_categories);
|
863 |
+
$params['id'] = $id;
|
864 |
+
$params['page'] = $this->page;
|
865 |
+
$params['page_url'] = $this->page_url;
|
866 |
+
$params['back_url'] = add_query_arg( array (
|
867 |
+
'page' => 'manage' . WDCFM()->menu_postfix,
|
868 |
+
'task' => 'edit',
|
869 |
+
'current_id' => $id,
|
870 |
+
), admin_url('admin.php')
|
871 |
+
);
|
872 |
+
|
873 |
+
$params['fieldset_id'] = WDW_FMC_Library::get('fieldset_id', 'embedded');
|
874 |
+
$this->view->display_options($params);
|
875 |
+
}
|
876 |
+
|
877 |
+
public function save_display_options() {
|
878 |
+
$message = $this->save_dis_options();
|
879 |
+
$page = WDW_FMC_Library::get('page');
|
880 |
+
|
881 |
+
$current_id = (int) WDW_FMC_Library::get('current_id', 0);
|
882 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array(
|
883 |
+
'page' => $page,
|
884 |
+
'task' => 'edit',
|
885 |
+
'current_id' => $current_id,
|
886 |
+
'message' => $message,
|
887 |
+
), admin_url('admin.php')));
|
888 |
+
}
|
889 |
+
|
890 |
+
public function apply_display_options() {
|
891 |
+
$message = $this->save_dis_options();
|
892 |
+
$page = WDW_FMC_Library::get('page');
|
893 |
+
$fieldset_id = WDW_FMC_Library::get('fieldset_id', 'embedded');
|
894 |
+
$current_id = (int) WDW_FMC_Library::get('current_id', 0);
|
895 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array(
|
896 |
+
'page' => $page,
|
897 |
+
'task' => 'display_options',
|
898 |
+
'current_id' => $current_id,
|
899 |
+
'fieldset_id'=> $fieldset_id,
|
900 |
+
'message' => $message,
|
901 |
+
), admin_url('admin.php')));
|
902 |
+
}
|
903 |
+
|
904 |
+
/**
|
905 |
+
* Remove query for MySQL Mapping.
|
906 |
+
* @param int $id
|
907 |
+
*/
|
908 |
+
public function remove_query( $id ) {
|
909 |
+
$fieldset_id = WDW_FMC_Library::get('fieldset_id', 'general');
|
910 |
+
$query_id = WDW_FMC_Library::get('query_id',0);
|
911 |
+
$message = 2;
|
912 |
+
if( $this->model->delete_formmaker_query( $query_id ) ) {
|
913 |
+
$message = 3;
|
914 |
+
}
|
915 |
+
|
916 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array(
|
917 |
+
'page' => $this->page,
|
918 |
+
'task' => 'form_options',
|
919 |
+
'current_id' => $id,
|
920 |
+
'fieldset_id' => $fieldset_id,
|
921 |
+
'message' => $message,
|
922 |
+
), admin_url('admin.php')));
|
923 |
+
}
|
924 |
+
|
925 |
+
/**
|
926 |
+
* Check if loading_delay or frequency is positive numbers
|
927 |
+
*
|
928 |
+
* @param int $delay
|
929 |
+
*
|
930 |
+
* @return int
|
931 |
+
*/
|
932 |
+
public function set_delay_freq_positive_val( $delay ) {
|
933 |
+
if( $delay < 0 ) return 0;
|
934 |
+
return $delay;
|
935 |
+
}
|
936 |
+
|
937 |
+
public function save_dis_options() {
|
938 |
+
$option_data = array(
|
939 |
+
'form_id' => (int) WDW_FMC_Library::get('current_id', 0),
|
940 |
+
'scrollbox_loading_delay' => $this->set_delay_freq_positive_val( WDW_FMC_Library::get('scrollbox_loading_delay', 0) ),
|
941 |
+
'popover_animate_effect' => WDW_FMC_Library::get('popover_animate_effect', ''),
|
942 |
+
'popover_loading_delay' => $this->set_delay_freq_positive_val( WDW_FMC_Library::get('popover_loading_delay', 0) ),
|
943 |
+
'popover_frequency' => $this->set_delay_freq_positive_val( WDW_FMC_Library::get('popover_frequency', 0) ),
|
944 |
+
'topbar_position' => WDW_FMC_Library::get('topbar_position', 1),
|
945 |
+
'topbar_remain_top' => WDW_FMC_Library::get('topbar_remain_top', 1),
|
946 |
+
'topbar_closing' => WDW_FMC_Library::get('topbar_closing', 1),
|
947 |
+
'topbar_hide_duration' => $this->set_delay_freq_positive_val( WDW_FMC_Library::get('topbar_hide_duration', 0) ),
|
948 |
+
'scrollbox_position' => WDW_FMC_Library::get('scrollbox_position', 1),
|
949 |
+
'scrollbox_trigger_point' => WDW_FMC_Library::get('scrollbox_trigger_point', 20),
|
950 |
+
'scrollbox_hide_duration' => $this->set_delay_freq_positive_val( WDW_FMC_Library::get('scrollbox_hide_duration', 0)),
|
951 |
+
'scrollbox_auto_hide' => WDW_FMC_Library::get('scrollbox_auto_hide', 1),
|
952 |
+
'hide_mobile' => WDW_FMC_Library::get('hide_mobile', 0),
|
953 |
+
'scrollbox_closing' => WDW_FMC_Library::get('scrollbox_closing', 1),
|
954 |
+
'scrollbox_minimize' => WDW_FMC_Library::get('scrollbox_minimize', 1),
|
955 |
+
'scrollbox_minimize_text' => WDW_FMC_Library::get('scrollbox_minimize_text', ''),
|
956 |
+
'type' => WDW_FMC_Library::get('form_type', 'embadded'),
|
957 |
+
'display_on' => implode(',', WDW_FMC_Library::get('display_on', array())),
|
958 |
+
'posts_include' => WDW_FMC_Library::get('posts_include', ''),
|
959 |
+
'pages_include' => WDW_FMC_Library::get('pages_include', ''),
|
960 |
+
'display_on_categories' => implode(',', WDW_FMC_Library::get('display_on_categories', array())),
|
961 |
+
'current_categories' => WDW_FMC_Library::get('current_categories', ''),
|
962 |
+
'show_for_admin' => WDW_FMC_Library::get('show_for_admin', 0),
|
963 |
+
);
|
964 |
+
|
965 |
+
$save = $this->model->replace_display_options($option_data);
|
966 |
+
if ( $save !== FALSE ) {
|
967 |
+
$this->model->update_data('formmaker_backup', array(
|
968 |
+
'type' => $option_data['type'],
|
969 |
+
), array( 'id' => $option_data['form_id'] ));
|
970 |
+
$this->model->update_data('formmaker', array(
|
971 |
+
'type' => $option_data['type'],
|
972 |
+
), array( 'id' => $option_data['form_id'] ));
|
973 |
+
$this->model->create_js($option_data['form_id']);
|
974 |
+
|
975 |
+
return 8;
|
976 |
+
}
|
977 |
+
else {
|
978 |
+
return 2;
|
979 |
+
}
|
980 |
+
}
|
981 |
+
|
982 |
+
// TODO: remove this function.
|
983 |
+
public function save_as_copy() {
|
984 |
+
$message = $this->save_db_as_copy();
|
985 |
+
$page = WDW_FMC_Library::get('page');
|
986 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array(
|
987 |
+
'page' => $page,
|
988 |
+
'task' => 'display',
|
989 |
+
'message' => $message,
|
990 |
+
), admin_url('admin.php')));
|
991 |
+
}
|
992 |
+
|
993 |
+
public function save() {
|
994 |
+
$message = $this->save_db();
|
995 |
+
$page = WDW_FMC_Library::get('page');
|
996 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array(
|
997 |
+
'page' => $page,
|
998 |
+
'task' => 'display',
|
999 |
+
'message' => $message,
|
1000 |
+
), admin_url('admin.php')));
|
1001 |
+
}
|
1002 |
+
|
1003 |
+
public function apply() {
|
1004 |
+
$message = $this->save_db();
|
1005 |
+
$current_id = (int) WDW_FMC_Library::get('current_id', 0);
|
1006 |
+
if ( !$current_id ) {
|
1007 |
+
$current_id = (int) $this->model->get_max_row('formmaker', 'id');
|
1008 |
+
}
|
1009 |
+
$page = WDW_FMC_Library::get('page');
|
1010 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array(
|
1011 |
+
'page' => $page,
|
1012 |
+
'task' => 'edit',
|
1013 |
+
'current_id' => $current_id,
|
1014 |
+
'message' => $message,
|
1015 |
+
), admin_url('admin.php')));
|
1016 |
+
}
|
1017 |
+
|
1018 |
+
public function save_db() {
|
1019 |
+
$javascript = "// Occurs before the form is loaded
|
1020 |
+
function before_load() {
|
1021 |
+
}
|
1022 |
+
// Occurs just before submitting the form
|
1023 |
+
function before_submit() {
|
1024 |
+
// IMPORTANT! If you want to interrupt (stop) the submitting of the form, this function should return true. You don't need to return any value if you don't want to stop the submission.
|
1025 |
+
}
|
1026 |
+
// Occurs just before resetting the form
|
1027 |
+
function before_reset() {
|
1028 |
+
}";
|
1029 |
+
$id = (int) WDW_FMC_Library::get('current_id', 0);
|
1030 |
+
$title = WDW_FMC_Library::get('title', '');
|
1031 |
+
$theme = (int) WDW_FMC_Library::get('theme', 0);
|
1032 |
+
$theme = ($theme) ? $theme : $this->model->get_default_theme_id();
|
1033 |
+
$form_front = WDW_FMC_Library::get('form_front', '', false);
|
1034 |
+
$sortable = WDW_FMC_Library::get('sortable', 0);
|
1035 |
+
$counter = WDW_FMC_Library::get('counter', 0);
|
1036 |
+
$label_order = WDW_FMC_Library::get('label_order', '');
|
1037 |
+
$pagination = WDW_FMC_Library::get('pagination', '');
|
1038 |
+
$show_title = WDW_FMC_Library::get('show_title', '');
|
1039 |
+
$show_numbers = WDW_FMC_Library::get('show_numbers', '');
|
1040 |
+
$public_key = WDW_FMC_Library::get('public_key', '');
|
1041 |
+
$private_key = WDW_FMC_Library::get('private_key', '');
|
1042 |
+
$recaptcha_theme = WDW_FMC_Library::get('recaptcha_theme', '');
|
1043 |
+
$label_order_current = WDW_FMC_Library::get('label_order_current', '');
|
1044 |
+
$form_fields = WDW_FMC_Library::get('form_fields', '', false);
|
1045 |
+
$header_title = WDW_FMC_Library::get('header_title', '');
|
1046 |
+
$header_description = WDW_FMC_Library::get('header_description', '', FALSE);
|
1047 |
+
$header_image_url = WDW_FMC_Library::get('header_image_url', '');
|
1048 |
+
$header_image_animation = WDW_FMC_Library::get('header_image_animation', '');
|
1049 |
+
$header_hide_image = WDW_FMC_Library::get('header_hide_image', 0);
|
1050 |
+
$type = WDW_FMC_Library::get('form_type', 'embedded');
|
1051 |
+
$scrollbox_minimize_text = $header_title ? $header_title : 'The form is minimized.';
|
1052 |
+
if ( $id != 0 ) {
|
1053 |
+
$save = $this->model->update_data('formmaker', array(
|
1054 |
+
'title' => $title,
|
1055 |
+
'theme' => $theme,
|
1056 |
+
'form_front' => $form_front,
|
1057 |
+
'sortable' => $sortable,
|
1058 |
+
'counter' => $counter,
|
1059 |
+
'label_order' => $label_order,
|
1060 |
+
'label_order_current' => $label_order_current,
|
1061 |
+
'pagination' => $pagination,
|
1062 |
+
'show_title' => $show_title,
|
1063 |
+
'show_numbers' => $show_numbers,
|
1064 |
+
'public_key' => $public_key,
|
1065 |
+
'private_key' => $private_key,
|
1066 |
+
'recaptcha_theme' => $recaptcha_theme,
|
1067 |
+
'form_fields' => $form_fields,
|
1068 |
+
'header_title' => $header_title,
|
1069 |
+
'header_description' => $header_description,
|
1070 |
+
'header_image_url' => $header_image_url,
|
1071 |
+
'header_image_animation' => $header_image_animation,
|
1072 |
+
'header_hide_image' => $header_hide_image,
|
1073 |
+
), array( 'id' => $id ));
|
1074 |
+
}
|
1075 |
+
else {
|
1076 |
+
$this->model->insert_data_to_db('formmaker', array(
|
1077 |
+
'title' => $title,
|
1078 |
+
'type' => $type,
|
1079 |
+
'mail' => '',
|
1080 |
+
'form_front' => $form_front,
|
1081 |
+
'theme' => $theme,
|
1082 |
+
'counter' => $counter,
|
1083 |
+
'label_order' => $label_order,
|
1084 |
+
'pagination' => $pagination,
|
1085 |
+
'show_title' => $show_title,
|
1086 |
+
'show_numbers' => $show_numbers,
|
1087 |
+
'public_key' => $public_key,
|
1088 |
+
'private_key' => $private_key,
|
1089 |
+
'recaptcha_theme' => $recaptcha_theme,
|
1090 |
+
'javascript' => $javascript,
|
1091 |
+
'submit_text' => '',
|
1092 |
+
'url' => '',
|
1093 |
+
'article_id' => 0,
|
1094 |
+
'submit_text_type' => 1,
|
1095 |
+
'script_mail' => '%all%',
|
1096 |
+
'script_mail_user' => '%all%',
|
1097 |
+
'label_order_current' => $label_order_current,
|
1098 |
+
'tax' => 0,
|
1099 |
+
'payment_currency' => '',
|
1100 |
+
'paypal_email' => '',
|
1101 |
+
'checkout_mode' => 'testmode',
|
1102 |
+
'paypal_mode' => 0,
|
1103 |
+
'published' => 1,
|
1104 |
+
'form_fields' => $form_fields,
|
1105 |
+
'savedb' => 1,
|
1106 |
+
'sendemail' => 1,
|
1107 |
+
'requiredmark' => '*',
|
1108 |
+
'from_mail' => '',
|
1109 |
+
'from_name' => '',
|
1110 |
+
'reply_to' => '',
|
1111 |
+
'send_to' => '',
|
1112 |
+
'autogen_layout' => 1,
|
1113 |
+
'custom_front' => '',
|
1114 |
+
'mail_from_user' => '',
|
1115 |
+
'mail_from_name_user' => '',
|
1116 |
+
'reply_to_user' => '',
|
1117 |
+
'condition' => '',
|
1118 |
+
'mail_cc' => '',
|
1119 |
+
'mail_cc_user' => '',
|
1120 |
+
'mail_bcc' => '',
|
1121 |
+
'mail_bcc_user' => '',
|
1122 |
+
'mail_subject' => '',
|
1123 |
+
'mail_subject_user' => '',
|
1124 |
+
'mail_mode' => 1,
|
1125 |
+
'mail_mode_user' => 1,
|
1126 |
+
'mail_attachment' => 1,
|
1127 |
+
'mail_attachment_user' => 1,
|
1128 |
+
'sortable' => $sortable,
|
1129 |
+
'user_id_wd' => 'administrator,',
|
1130 |
+
'frontend_submit_fields' => '',
|
1131 |
+
'frontend_submit_stat_fields' => '',
|
1132 |
+
'save_uploads' => 1,
|
1133 |
+
'header_title' => $header_title,
|
1134 |
+
'header_description' => $header_description,
|
1135 |
+
'header_image_url' => $header_image_url,
|
1136 |
+
'header_image_animation' => $header_image_animation,
|
1137 |
+
'header_hide_image' => $header_hide_image,
|
1138 |
+
));
|
1139 |
+
$id = (int) $this->model->get_max_row('formmaker', 'id');
|
1140 |
+
if (WDCFM()->is_free == 2) {
|
1141 |
+
update_option('contact_form_forms', ((get_option('contact_form_forms')) ? (get_option('contact_form_forms')) . ',' . $id : $id));
|
1142 |
+
}
|
1143 |
+
$this->model->insert_data_to_db('formmaker_display_options', array(
|
1144 |
+
'form_id' => $id,
|
1145 |
+
'type' => $type,
|
1146 |
+
'scrollbox_loading_delay' => 0,
|
1147 |
+
'popover_animate_effect' => '',
|
1148 |
+
'popover_loading_delay' => 0,
|
1149 |
+
'popover_frequency' => 0,
|
1150 |
+
'topbar_position' => 1,
|
1151 |
+
'topbar_remain_top' => 1,
|
1152 |
+
'topbar_closing' => 1,
|
1153 |
+
'topbar_hide_duration' => 0,
|
1154 |
+
'scrollbox_position' => 1,
|
1155 |
+
'scrollbox_trigger_point' => 20,
|
1156 |
+
'scrollbox_hide_duration' => 0,
|
1157 |
+
'scrollbox_auto_hide' => 1,
|
1158 |
+
'hide_mobile' => 0,
|
1159 |
+
'scrollbox_closing' => 1,
|
1160 |
+
'scrollbox_minimize' => 1,
|
1161 |
+
'scrollbox_minimize_text' => $scrollbox_minimize_text,
|
1162 |
+
'display_on' => 'home,post,page',
|
1163 |
+
'posts_include' => '',
|
1164 |
+
'pages_include' => '',
|
1165 |
+
'display_on_categories' => '',
|
1166 |
+
'current_categories' => '',
|
1167 |
+
'show_for_admin' => 0,
|
1168 |
+
));
|
1169 |
+
$this->model->insert_data_to_db('formmaker_views', array(
|
1170 |
+
'form_id' => $id,
|
1171 |
+
'views' => 0,
|
1172 |
+
));
|
1173 |
+
}
|
1174 |
+
$backup_id = (int) WDW_FMC_Library::get('backup_id', '');
|
1175 |
+
if ( $backup_id ) {
|
1176 |
+
if ( $this->model->get_backup_id($backup_id, $id) ) {
|
1177 |
+
$this->model->delete_rows(array(
|
1178 |
+
"table" => "formmaker_backup",
|
1179 |
+
"where" => "backup_id > " . $backup_id . " AND id = " . $id,
|
1180 |
+
));
|
1181 |
+
}
|
1182 |
+
// Get form_fields, form_front
|
1183 |
+
$row1 = $this->model->select_rows("get_row", array(
|
1184 |
+
"selection" => "form_fields, form_front",
|
1185 |
+
"table" => "formmaker_backup",
|
1186 |
+
"where" => "backup_id = " . $backup_id,
|
1187 |
+
));
|
1188 |
+
if ( $row1->form_fields == $form_fields and $row1->form_front == $form_front ) {
|
1189 |
+
$save = $this->model->update_data('formmaker_backup', array(
|
1190 |
+
'cur' => 1,
|
1191 |
+
'title' => $title,
|
1192 |
+
'theme' => $theme,
|
1193 |
+
'form_front' => $form_front,
|
1194 |
+
'sortable' => $sortable,
|
1195 |
+
'counter' => $counter,
|
1196 |
+
'label_order' => $label_order,
|
1197 |
+
'label_order_current' => $label_order_current,
|
1198 |
+
'pagination' => $pagination,
|
1199 |
+
'show_title' => $show_title,
|
1200 |
+
'show_numbers' => $show_numbers,
|
1201 |
+
'public_key' => $public_key,
|
1202 |
+
'private_key' => $private_key,
|
1203 |
+
'recaptcha_theme' => $recaptcha_theme,
|
1204 |
+
'form_fields' => $form_fields,
|
1205 |
+
'header_title' => $header_title,
|
1206 |
+
'header_description' => $header_description,
|
1207 |
+
'header_image_url' => $header_image_url,
|
1208 |
+
'header_image_animation' => $header_image_animation,
|
1209 |
+
'header_hide_image' => $header_hide_image,
|
1210 |
+
), array( 'backup_id' => $backup_id ));
|
1211 |
+
if ( $save !== FALSE ) {
|
1212 |
+
$this->model->create_js($id);
|
1213 |
+
|
1214 |
+
return 1;
|
1215 |
+
}
|
1216 |
+
else {
|
1217 |
+
return 2;
|
1218 |
+
}
|
1219 |
+
}
|
1220 |
+
}
|
1221 |
+
$this->model->update_data('formmaker_backup', array( 'cur' => 0 ), array( 'id' => $id ));
|
1222 |
+
$save = $this->model->insert_data_to_db('formmaker_backup', array(
|
1223 |
+
'cur' => 1,
|
1224 |
+
'id' => $id,
|
1225 |
+
'title' => $title,
|
1226 |
+
'mail' => '',
|
1227 |
+
'form_front' => $form_front,
|
1228 |
+
'theme' => $theme,
|
1229 |
+
'counter' => $counter,
|
1230 |
+
'label_order' => $label_order,
|
1231 |
+
'pagination' => $pagination,
|
1232 |
+
'show_title' => $show_title,
|
1233 |
+
'show_numbers' => $show_numbers,
|
1234 |
+
'public_key' => $public_key,
|
1235 |
+
'private_key' => $private_key,
|
1236 |
+
'recaptcha_theme' => $recaptcha_theme,
|
1237 |
+
'javascript' => $javascript,
|
1238 |
+
'submit_text' => '',
|
1239 |
+
'url' => '',
|
1240 |
+
'article_id' => 0,
|
1241 |
+
'submit_text_type' => 1,
|
1242 |
+
'script_mail' => '%all%',
|
1243 |
+
'script_mail_user' => '%all%',
|
1244 |
+
'label_order_current' => $label_order_current,
|
1245 |
+
'tax' => 0,
|
1246 |
+
'payment_currency' => '',
|
1247 |
+
'paypal_email' => '',
|
1248 |
+
'checkout_mode' => 'testmode',
|
1249 |
+
'paypal_mode' => 0,
|
1250 |
+
'published' => 1,
|
1251 |
+
'form_fields' => $form_fields,
|
1252 |
+
'savedb' => 1,
|
1253 |
+
'sendemail' => 1,
|
1254 |
+
'requiredmark' => '*',
|
1255 |
+
'from_mail' => '',
|
1256 |
+
'from_name' => '',
|
1257 |
+
'reply_to' => '',
|
1258 |
+
'send_to' => '',
|
1259 |
+
'autogen_layout' => 1,
|
1260 |
+
'custom_front' => '',
|
1261 |
+
'mail_from_user' => '',
|
1262 |
+
'mail_from_name_user' => '',
|
1263 |
+
'reply_to_user' => '',
|
1264 |
+
'condition' => '',
|
1265 |
+
'mail_cc' => '',
|
1266 |
+
'mail_cc_user' => '',
|
1267 |
+
'mail_bcc' => '',
|
1268 |
+
'mail_bcc_user' => '',
|
1269 |
+
'mail_subject' => '',
|
1270 |
+
'mail_subject_user' => '',
|
1271 |
+
'mail_mode' => 1,
|
1272 |
+
'mail_mode_user' => 1,
|
1273 |
+
'mail_attachment' => 1,
|
1274 |
+
'mail_attachment_user' => 1,
|
1275 |
+
'sortable' => $sortable,
|
1276 |
+
'user_id_wd' => 'administrator,',
|
1277 |
+
'frontend_submit_fields' => '',
|
1278 |
+
'frontend_submit_stat_fields' => '',
|
1279 |
+
'header_title' => $header_title,
|
1280 |
+
'header_description' => $header_description,
|
1281 |
+
'header_image_url' => $header_image_url,
|
1282 |
+
'header_image_animation' => $header_image_animation,
|
1283 |
+
'header_hide_image' => $header_hide_image,
|
1284 |
+
));
|
1285 |
+
|
1286 |
+
$backup_count = $this->model->get_count(array(
|
1287 |
+
"selection" => "backup_id",
|
1288 |
+
"table" => "formmaker_backup",
|
1289 |
+
"where" => "backup_id = " . $id,
|
1290 |
+
));
|
1291 |
+
if ( $backup_count > 10 ) {
|
1292 |
+
$this->model->delete_rows(array(
|
1293 |
+
"table" => "formmaker_backup",
|
1294 |
+
"where" => "id = " . $id,
|
1295 |
+
"order_by" => "ORDER BY backup_id ASC",
|
1296 |
+
"limit" => "LIMIT 1",
|
1297 |
+
));
|
1298 |
+
}
|
1299 |
+
if ( $save !== FALSE ) {
|
1300 |
+
$this->model->create_js($id);
|
1301 |
+
return 1;
|
1302 |
+
}
|
1303 |
+
else {
|
1304 |
+
return 2;
|
1305 |
+
}
|
1306 |
+
}
|
1307 |
+
|
1308 |
+
public function fm_live_search() {
|
1309 |
+
$search_string = !empty($_POST['pp_live_search']) ? sanitize_text_field($_POST['pp_live_search']) : '';
|
1310 |
+
$post_type = !empty($_POST['pp_post_type']) ? sanitize_text_field($_POST['pp_post_type']) : 'any';
|
1311 |
+
$full_content = !empty($_POST['pp_full_content']) ? sanitize_text_field($_POST['pp_full_content']) : 'true';
|
1312 |
+
$args['s'] = $search_string;
|
1313 |
+
$results = $this->fm_posts_query($args, $post_type);
|
1314 |
+
$output = '<ul class="pp_search_results">';
|
1315 |
+
if ( empty($results) ) {
|
1316 |
+
$output .= sprintf('<li class="pp_no_res">%1$s</li>', esc_html__('No results found', 'fm-text'));
|
1317 |
+
}
|
1318 |
+
else {
|
1319 |
+
foreach ( $results as $single_post ) {
|
1320 |
+
$output .= sprintf('<li data-post_id="%2$s">[%3$s] - %1$s</li>', esc_html($single_post['title']), esc_attr($single_post['id']), esc_html($single_post['post_type']));
|
1321 |
+
}
|
1322 |
+
}
|
1323 |
+
$output .= '</ul>';
|
1324 |
+
die($output);
|
1325 |
+
}
|
1326 |
+
|
1327 |
+
public function fm_posts_query( $args = array(), $include_post_type = '' ) {
|
1328 |
+
if ( 'only_pages' === $include_post_type ) {
|
1329 |
+
$pt_names = array( 'page' );
|
1330 |
+
}
|
1331 |
+
elseif ( 'any' === $include_post_type || 'only_posts' === $include_post_type ) {
|
1332 |
+
$default_post_types = array( 'post', 'page' );
|
1333 |
+
$custom_post_types = get_post_types(array(
|
1334 |
+
'public' => TRUE,
|
1335 |
+
'_builtin' => FALSE,
|
1336 |
+
));
|
1337 |
+
$post_types = array_merge($default_post_types, $custom_post_types);
|
1338 |
+
$pt_names = array_values($post_types);
|
1339 |
+
if ( 'only_posts' === $include_post_type ) {
|
1340 |
+
unset($pt_names[1]);
|
1341 |
+
}
|
1342 |
+
}
|
1343 |
+
else {
|
1344 |
+
$pt_names = $include_post_type;
|
1345 |
+
}
|
1346 |
+
$query = array(
|
1347 |
+
'post_type' => $pt_names,
|
1348 |
+
'suppress_filters' => TRUE,
|
1349 |
+
'update_post_term_cache' => FALSE,
|
1350 |
+
'update_post_meta_cache' => FALSE,
|
1351 |
+
'post_status' => 'publish',
|
1352 |
+
'posts_per_page' => -1,
|
1353 |
+
);
|
1354 |
+
if ( isset($args['s']) ) {
|
1355 |
+
$query['s'] = $args['s'];
|
1356 |
+
}
|
1357 |
+
$get_posts = new WP_Query;
|
1358 |
+
$posts = $get_posts->query($query);
|
1359 |
+
if ( !$get_posts->post_count ) {
|
1360 |
+
return FALSE;
|
1361 |
+
}
|
1362 |
+
$results = array();
|
1363 |
+
foreach ( $posts as $post ) {
|
1364 |
+
$results[] = array(
|
1365 |
+
'id' => (int) $post->ID,
|
1366 |
+
'title' => trim(esc_html(strip_tags(get_the_title($post)))),
|
1367 |
+
'post_type' => $post->post_type,
|
1368 |
+
);
|
1369 |
+
}
|
1370 |
+
wp_reset_postdata();
|
1371 |
+
|
1372 |
+
return $results;
|
1373 |
+
}
|
1374 |
+
|
1375 |
+
public function update_form_title( $id ) {
|
1376 |
+
$page = WDW_FMC_Library::get('page');
|
1377 |
+
$form_name = WDW_FMC_Library::get('form_name', '');
|
1378 |
+
|
1379 |
+
// check id for db
|
1380 |
+
if(isset($id) && $id != "") {
|
1381 |
+
$id = intval($id);
|
1382 |
+
$update = $this->model->update_data( "forms", array('title' => $form_name,), array('id' => $id) );
|
1383 |
+
if( !$update ){
|
1384 |
+
$message = 2;
|
1385 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array(
|
1386 |
+
'page' => $page,
|
1387 |
+
'task' => 'display',
|
1388 |
+
'message' => $message,
|
1389 |
+
), admin_url('admin.php')));
|
1390 |
+
}
|
1391 |
+
|
1392 |
+
}
|
1393 |
+
else { // return message Failed
|
1394 |
+
$message = 2;
|
1395 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array(
|
1396 |
+
'page' => $page,
|
1397 |
+
'task' => 'display',
|
1398 |
+
'message' => $message,
|
1399 |
+
), admin_url('admin.php')));
|
1400 |
+
}
|
1401 |
+
|
1402 |
+
return $message = 1;
|
1403 |
+
}
|
1404 |
+
/**
|
1405 |
+
* Get stripe addon.
|
1406 |
+
*
|
1407 |
+
* @param int $id
|
1408 |
+
*
|
1409 |
+
* @return array $data
|
1410 |
+
*/
|
1411 |
+
private function get_stripe_addon($id) {
|
1412 |
+
return apply_filters('fm_stripe_display_init', array('form_id' => $id) );
|
1413 |
+
}
|
1414 |
+
|
1415 |
+
}
|
admin/controllers/Options_fm.php
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class FMControllerOptions_fmc
|
5 |
+
*/
|
6 |
+
class FMControllerOptions_fmc {
|
7 |
+
private $model;
|
8 |
+
private $view;
|
9 |
+
|
10 |
+
public function __construct() {
|
11 |
+
require_once WDCFM()->plugin_dir . "/admin/models/Options_fm.php";
|
12 |
+
$this->model = new FMModelOptions_fmc();
|
13 |
+
require_once WDCFM()->plugin_dir . "/admin/views/Options_fm.php";
|
14 |
+
$this->view = new FMViewOptions_fmc();
|
15 |
+
}
|
16 |
+
|
17 |
+
public function execute() {
|
18 |
+
$task = WDW_FMC_Library::get('task');
|
19 |
+
$id = (int) WDW_FMC_Library::get('current_id', 0);
|
20 |
+
if ( method_exists($this, $task) ) {
|
21 |
+
check_admin_referer(WDCFM()->nonce, WDCFM()->nonce);
|
22 |
+
$this->$task($id);
|
23 |
+
}
|
24 |
+
else {
|
25 |
+
$this->display();
|
26 |
+
}
|
27 |
+
}
|
28 |
+
|
29 |
+
public function display() {
|
30 |
+
$fm_settings = get_option('fmc_settings');
|
31 |
+
$this->view->display($fm_settings);
|
32 |
+
}
|
33 |
+
|
34 |
+
public function save() {
|
35 |
+
$message = $this->model->save_db();
|
36 |
+
$page = WDW_FMC_Library::get('page');
|
37 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array(
|
38 |
+
'page' => $page,
|
39 |
+
'task' => 'display',
|
40 |
+
'message' => $message,
|
41 |
+
), admin_url('admin.php')));
|
42 |
+
}
|
43 |
+
}
|
admin/controllers/Paypal_info.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FMControllerPaypal_info {
|
4 |
+
/**
|
5 |
+
* @var $model
|
6 |
+
*/
|
7 |
+
private $model;
|
8 |
+
/**
|
9 |
+
* @var $view
|
10 |
+
*/
|
11 |
+
private $view;
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Execute.
|
15 |
+
*/
|
16 |
+
public function execute() {
|
17 |
+
$this->display();
|
18 |
+
}
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Display.
|
22 |
+
*/
|
23 |
+
public function display() {
|
24 |
+
// Load FMModelPaypal_info class.
|
25 |
+
require_once WDCFM()->plugin_dir . "/admin/models/FMPaypalInfo.php";
|
26 |
+
$this->model = new FMModelPaypal_info();
|
27 |
+
// Load FMViewPaypal_info class.
|
28 |
+
require_once WDCFM()->plugin_dir . "/admin/views/FMPaypalInfo.php";
|
29 |
+
$this->view = new FMViewPaypal_info();
|
30 |
+
$id = WDW_FMC_Library::get('id', 0);
|
31 |
+
// Get form session by id.
|
32 |
+
$row = $this->model->get_form_session($id);
|
33 |
+
// Set params for view.
|
34 |
+
$params = array();
|
35 |
+
$params['row'] = $row;
|
36 |
+
$this->view->display($params);
|
37 |
+
}
|
38 |
+
}
|
admin/controllers/Product_option.php
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class FMControllerProduct_option
|
5 |
+
*/
|
6 |
+
class FMControllerProduct_option {
|
7 |
+
/**
|
8 |
+
* @var $view
|
9 |
+
*/
|
10 |
+
private $view;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Execute.
|
14 |
+
*/
|
15 |
+
public function execute() {
|
16 |
+
$this->display();
|
17 |
+
}
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Display.
|
21 |
+
*/
|
22 |
+
public function display() {
|
23 |
+
// Load FMViewProduct_option class.
|
24 |
+
require_once WDCFM()->plugin_dir . "/admin/views/FMProductOption.php";
|
25 |
+
$this->view = new FMViewProduct_option();
|
26 |
+
$field_id = WDW_FMC_Library::get('field_id', 0);
|
27 |
+
$property_id = WDW_FMC_Library::get('property_id', '-1');
|
28 |
+
$url_for_ajax = WDW_FMC_Library::get('url_for_ajax', '');
|
29 |
+
// Set params for view.
|
30 |
+
$params = array();
|
31 |
+
$params['field_id'] = $field_id;
|
32 |
+
$params['property_id'] = $property_id;
|
33 |
+
$params['url_for_ajax'] = $url_for_ajax;
|
34 |
+
$this->view->display($params);
|
35 |
+
}
|
36 |
+
}
|
admin/controllers/Select_data_from_db.php
ADDED
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class FMControllerSelect_data_from_db_fmc
|
5 |
+
*/
|
6 |
+
class FMControllerSelect_data_from_db_fmc {
|
7 |
+
/**
|
8 |
+
* @var $model
|
9 |
+
*/
|
10 |
+
private $model;
|
11 |
+
/**
|
12 |
+
* @var $view
|
13 |
+
*/
|
14 |
+
private $view;
|
15 |
+
|
16 |
+
public function __construct() {
|
17 |
+
// Load FMModelSelect_data_from_db class.
|
18 |
+
require_once WDCFM()->plugin_dir . "/admin/models/FMSelectDataFromDb.php";
|
19 |
+
$this->model = new FMModelSelect_data_from_db_fmc();
|
20 |
+
// Load FMViewSelect_data_from_db class.
|
21 |
+
require_once WDCFM()->plugin_dir . "/admin/views/FMSelectDataFromDb.php";
|
22 |
+
$this->view = new FMViewSelect_data_from_db_fmc();
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Execute.
|
27 |
+
*/
|
28 |
+
public function execute() {
|
29 |
+
$task = WDW_FMC_Library::get('task', 0);
|
30 |
+
$id = WDW_FMC_Library::get('id', 0);
|
31 |
+
$form_id = WDW_FMC_Library::get('form_id', 0);
|
32 |
+
$field_id = WDW_FMC_Library::get('field_id', 0);
|
33 |
+
$value_disabled = WDW_FMC_Library::get('value_disabled', 0);
|
34 |
+
$field_type = WDW_FMC_Library::get('field_type', '');
|
35 |
+
if ( $task && method_exists($this, $task) ) {
|
36 |
+
$this->$task($form_id, $field_type = "");
|
37 |
+
}
|
38 |
+
else {
|
39 |
+
$this->display($id, $form_id, $field_id, $field_type, $value_disabled);
|
40 |
+
}
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Display.
|
45 |
+
*
|
46 |
+
* @param int $id
|
47 |
+
* @param int $form_id
|
48 |
+
* @param int $field_id
|
49 |
+
* @param string $field_type
|
50 |
+
* @param int $value_disabled
|
51 |
+
*/
|
52 |
+
public function display( $id, $form_id, $field_id, $field_type, $value_disabled ) {
|
53 |
+
// Set params for view.
|
54 |
+
$params = array();
|
55 |
+
$params['id'] = $id;
|
56 |
+
$params['form_id'] = $form_id;
|
57 |
+
$params['field_id'] = $field_id;
|
58 |
+
$params['field_type'] = $field_type;
|
59 |
+
$params['value_disabled'] = $value_disabled;
|
60 |
+
$this->view->display($params);
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Data base tables.
|
65 |
+
*
|
66 |
+
* @param int $form_id
|
67 |
+
* @param string $field_type
|
68 |
+
*/
|
69 |
+
public function db_tables( $form_id, $field_type ) {
|
70 |
+
// Get tables.
|
71 |
+
$tables = $this->model->get_tables();
|
72 |
+
// Set params for view.
|
73 |
+
$params = array();
|
74 |
+
$params['form_id'] = $form_id;
|
75 |
+
$params['field_type'] = $field_type;
|
76 |
+
$params['tables'] = $tables;
|
77 |
+
$this->view->db_tables($params);
|
78 |
+
}
|
79 |
+
|
80 |
+
public function db_table_struct_select( $form_id, $field_type ) {
|
81 |
+
// Get labels by form id.
|
82 |
+
$label = $this->model->get_labels($form_id);
|
83 |
+
// Get table struct.
|
84 |
+
$table_struct = $this->model->get_table_struct();
|
85 |
+
// Set params for view.
|
86 |
+
$params = array();
|
87 |
+
$params['form_id'] = $form_id;
|
88 |
+
$params['field_type'] = $field_type;
|
89 |
+
$params['label'] = $label;
|
90 |
+
$params['table_struct'] = $table_struct;
|
91 |
+
$this->view->db_table_struct_select($params);
|
92 |
+
}
|
93 |
+
}
|
admin/controllers/Show_matrix.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FMControllerShow_matrix_fmc {
|
4 |
+
/**
|
5 |
+
* @var $view
|
6 |
+
*/
|
7 |
+
private $view;
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Execute.
|
11 |
+
*/
|
12 |
+
public function execute() {
|
13 |
+
$this->display();
|
14 |
+
}
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Display.
|
18 |
+
*/
|
19 |
+
public function display() {
|
20 |
+
// Load FMViewShow_matrix class.
|
21 |
+
require_once WDCFM()->plugin_dir . "/admin/views/FMShowMatrix.php";
|
22 |
+
$this->view = new FMViewShow_matrix_fmc();
|
23 |
+
// Set params for view.
|
24 |
+
$params = array();
|
25 |
+
$this->view->display($params);
|
26 |
+
}
|
27 |
+
}
|
admin/controllers/Submissions_fm.php
ADDED
@@ -0,0 +1,557 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class FMControllerSubmissions_fmc
|
4 |
+
*/
|
5 |
+
class FMControllerSubmissions_fmc {
|
6 |
+
/**
|
7 |
+
* @var $model
|
8 |
+
*/
|
9 |
+
private $model;
|
10 |
+
/**
|
11 |
+
* @var $view
|
12 |
+
*/
|
13 |
+
private $view;
|
14 |
+
/**
|
15 |
+
* @var string $page
|
16 |
+
*/
|
17 |
+
private $page;
|
18 |
+
/**
|
19 |
+
* @var string $bulk_action_name
|
20 |
+
*/
|
21 |
+
private $bulk_action_name;
|
22 |
+
/**
|
23 |
+
* @var string $page_url
|
24 |
+
*/
|
25 |
+
private $page_url;
|
26 |
+
/**
|
27 |
+
* @var int $page_per_num
|
28 |
+
*/
|
29 |
+
private $page_per_num = 20;
|
30 |
+
/**
|
31 |
+
* @var array $actions
|
32 |
+
*/
|
33 |
+
private $actions = array();
|
34 |
+
|
35 |
+
public function __construct() {
|
36 |
+
// Load FMModelSubmissions_fm class.
|
37 |
+
require_once WDCFM()->plugin_dir . "/admin/models/Submissions_fm.php";
|
38 |
+
$this->model = new FMModelSubmissions_fmc();
|
39 |
+
// Load FMViewSubmissions_fm class.
|
40 |
+
require_once WDCFM()->plugin_dir . "/admin/views/Submissions_fm.php";
|
41 |
+
$this->view = new FMViewSubmissions_fmc($this->model);
|
42 |
+
|
43 |
+
$this->page = WDW_FMC_Library::get('page');
|
44 |
+
$this->page_url = add_query_arg( array (
|
45 |
+
'page' => $this->page,
|
46 |
+
WDCFM()->nonce => wp_create_nonce(WDCFM()->nonce),
|
47 |
+
), admin_url('admin.php')
|
48 |
+
);
|
49 |
+
|
50 |
+
$this->bulk_action_name = 'bulk_action';
|
51 |
+
$this->actions = array(
|
52 |
+
'block_ip' => array(
|
53 |
+
'title' => __('Block IPs', WDCFM()->prefix),
|
54 |
+
$this->bulk_action_name => __('Blocked', WDCFM()->prefix),
|
55 |
+
),
|
56 |
+
'unblock_ip' => array(
|
57 |
+
'title' => __('Unblock IPs', WDCFM()->prefix),
|
58 |
+
$this->bulk_action_name => __('Unblocked', WDCFM()->prefix),
|
59 |
+
),
|
60 |
+
'delete' => array(
|
61 |
+
'title' => __('Delete', WDCFM()->prefix),
|
62 |
+
$this->bulk_action_name => __('Deleted', WDCFM()->prefix),
|
63 |
+
),
|
64 |
+
);
|
65 |
+
|
66 |
+
$user = get_current_user_id();
|
67 |
+
$screen = get_current_screen();
|
68 |
+
if ( !empty($user) && !empty($screen) ) {
|
69 |
+
$option = $screen->get_option('per_page', 'option');
|
70 |
+
$per_page = get_user_meta($user, $option, true);
|
71 |
+
if ( $per_page ) {
|
72 |
+
$this->page_per_num = $per_page;
|
73 |
+
}
|
74 |
+
}
|
75 |
+
}
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Execute.
|
79 |
+
*/
|
80 |
+
public function execute() {
|
81 |
+
$task = WDW_FMC_Library::get('task');
|
82 |
+
$id = (int) WDW_FMC_Library::get('current_id', 0);
|
83 |
+
if ( method_exists($this, $task) ) {
|
84 |
+
if ( $task != 'display' ) {
|
85 |
+
check_admin_referer(WDCFM()->nonce, WDCFM()->nonce);
|
86 |
+
}
|
87 |
+
$block_action = $this->bulk_action_name;
|
88 |
+
$action = WDW_FMC_Library::get( $block_action , -1 );
|
89 |
+
if ( $action != -1 ) {
|
90 |
+
$this->$block_action($action);
|
91 |
+
}
|
92 |
+
else {
|
93 |
+
$this->$task($id);
|
94 |
+
}
|
95 |
+
}
|
96 |
+
else {
|
97 |
+
$this->forms($id);
|
98 |
+
}
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Bulk actions.
|
103 |
+
*
|
104 |
+
* @param $task
|
105 |
+
*/
|
106 |
+
public function bulk_action($task) {
|
107 |
+
$form_id = WDW_FMC_Library::get('form_id', 0);
|
108 |
+
$check = WDW_FMC_Library::get('check', '');
|
109 |
+
|
110 |
+
$message = 0;
|
111 |
+
$successfully_updated = 0;
|
112 |
+
|
113 |
+
if ( $check ) {
|
114 |
+
foreach ( $check as $id => $item ) {
|
115 |
+
if ( method_exists($this, $task) ) {
|
116 |
+
$message = $this->$task($id, TRUE);
|
117 |
+
if ( $message != 2 ) {
|
118 |
+
// Increase successfully updated items count, if action doesn't failed.
|
119 |
+
$successfully_updated++;
|
120 |
+
}
|
121 |
+
}
|
122 |
+
}
|
123 |
+
if ( $successfully_updated ) {
|
124 |
+
$block_action = $this->bulk_action_name;
|
125 |
+
$message = sprintf(_n('%s item successfully %s.', '%s items successfully %s.', $successfully_updated, WDCFM()->prefix), $successfully_updated, $this->actions[$task][$block_action]);
|
126 |
+
}
|
127 |
+
}
|
128 |
+
WDW_FMC_Library::fm_redirect( add_query_arg( array('page' => $this->page, 'task' => 'display', 'current_id' => $form_id, ($message === 2 ? 'message' : 'msg') => $message), admin_url('admin.php') ) );
|
129 |
+
}
|
130 |
+
|
131 |
+
/**
|
132 |
+
* Forms.
|
133 |
+
* @param int $id
|
134 |
+
*/
|
135 |
+
public function forms($id) {
|
136 |
+
// Set params for view.
|
137 |
+
$params = array();
|
138 |
+
$params['id'] = $id;
|
139 |
+
$params['page'] = $this->page;
|
140 |
+
$params['page_url'] = $this->page_url;
|
141 |
+
$params['page_title'] = __('Submissions', WDCFM()->prefix);
|
142 |
+
$params['forms'] = $this->model->get_forms();
|
143 |
+
|
144 |
+
$this->view->forms($params);
|
145 |
+
}
|
146 |
+
|
147 |
+
/**
|
148 |
+
* Display.
|
149 |
+
* @param int $id
|
150 |
+
*/
|
151 |
+
public function display( $id = 0 ) {
|
152 |
+
// Set params for view.
|
153 |
+
$params = array();
|
154 |
+
$params['id'] = $id;
|
155 |
+
$params['page'] = $this->page;
|
156 |
+
$params['page_url'] = $this->page_url;
|
157 |
+
$params['page_title'] = __('Submissions', WDCFM()->prefix);
|
158 |
+
$params['actions'] = $this->actions;
|
159 |
+
|
160 |
+
// Set pagination params.
|
161 |
+
$params['pagination_url'] = add_query_arg( array( 'task' => 'display', 'current_id' => $id ), $this->page_url );
|
162 |
+
$params['page_per_num'] = $this->page_per_num;
|
163 |
+
$page = (int) WDW_FMC_Library::get('paged', 1);
|
164 |
+
$page_num = $page ? ($page - 1) * $params['page_per_num'] : 0;
|
165 |
+
|
166 |
+
$params['forms'] = $this->model->get_forms();
|
167 |
+
$params['statistics'] = $this->model->get_statistics( $id );
|
168 |
+
$params['blocked_ips'] = $this->model->blocked_ips();
|
169 |
+
|
170 |
+
$labels_parameters = $this->model->get_labels_parameters( $id , $page_num, $params['page_per_num'] );
|
171 |
+
$params['sorted_labels_id'] = $labels_parameters[0];
|
172 |
+
$params['sorted_label_types'] = $labels_parameters[1];
|
173 |
+
$params['sorted_label_names'] = $labels_parameters[3];
|
174 |
+
$params['sorted_label_names_original'] = $labels_parameters[4];
|
175 |
+
|
176 |
+
$label_name_ids = array();
|
177 |
+
foreach($labels_parameters[0] as $key => $label_id) {
|
178 |
+
$label_name_ids[$label_id] = $labels_parameters[4][$key];
|
179 |
+
}
|
180 |
+
$params['label_name_ids'] = $label_name_ids;
|
181 |
+
$group_ids = ((isset($labels_parameters[6])) ? $labels_parameters[6] : NULL);
|
182 |
+
$params['group_id_s'] = $this->model->sort_group_ids(count($params['sorted_label_names']), $group_ids);
|
183 |
+
$params['where_choices'] = $labels_parameters[7];
|
184 |
+
$params['searched_ids'] = $labels_parameters[8] ? implode(',', $labels_parameters[8]) : '';
|
185 |
+
|
186 |
+
$params['order_by'] = (isset($_POST['order_by']) ? esc_html(stripslashes($_POST['order_by'])) : 'group_id');
|
187 |
+
$params['asc_or_desc'] = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'asc') ? 'asc' : 'desc');
|
188 |
+
|
189 |
+
$lists = $labels_parameters[2];
|
190 |
+
$params['lists'] = $lists;
|
191 |
+
$params['style_id'] = $this->model->hide_or_not($lists['hide_label_list'], '@submitid@');
|
192 |
+
$params['style_date'] = $this->model->hide_or_not($lists['hide_label_list'], '@submitdate@');
|
193 |
+
$params['style_ip'] = $this->model->hide_or_not($lists['hide_label_list'], '@submitterip@');
|
194 |
+
$params['style_username'] = $this->model->hide_or_not($lists['hide_label_list'], '@submitterusername@');
|
195 |
+
$params['style_useremail'] = $this->model->hide_or_not($lists['hide_label_list'], '@submitteremail@');
|
196 |
+
$params['style_payment_info'] = $this->model->hide_or_not($lists['hide_label_list'], '@payment_info@');
|
197 |
+
|
198 |
+
$params['oder_class_default'] = "manage-column column-autor sortable desc";
|
199 |
+
$params['oder_class'] = "manage-column column-autor column-title sorted " . $params['asc_or_desc'];
|
200 |
+
$params['m'] = count($params['sorted_label_names']);
|
201 |
+
|
202 |
+
$is_search = false;
|
203 |
+
foreach($lists as $list_key => $list_val){
|
204 |
+
if(!empty($_POST[$list_key])) {
|
205 |
+
$is_search = true;
|
206 |
+
}
|
207 |
+
}
|
208 |
+
$params['is_search'] = $is_search; // (($lists['ip_search'] || $lists['startdate'] || $lists['enddate'] || $lists['username_search'] || $lists['useremail_search'] || $lists['id_search']) ? true : false );
|
209 |
+
$params['is_stats'] = FALSE;
|
210 |
+
|
211 |
+
$params['rows_data'] = $lists;
|
212 |
+
$params['rows'] = $labels_parameters[5];
|
213 |
+
$params['subs_count'] = $labels_parameters[2]['total'];
|
214 |
+
|
215 |
+
// Check is active pdf-integration add-on.
|
216 |
+
$params['pdf_data'] = array();
|
217 |
+
if ( defined('WD_FM_PDF') && is_plugin_active(constant('WD_FM_PDF')) ) {
|
218 |
+
require_once(WD_FM_PDF_DIR . '/model.php');
|
219 |
+
$params['pdf_data'] = WD_FM_PDF_model::get_pdf_data( $id );
|
220 |
+
}
|
221 |
+
|
222 |
+
$this->view->display($params);
|
223 |
+
}
|
224 |
+
|
225 |
+
/**
|
226 |
+
* Show stats.
|
227 |
+
* @param int $id
|
228 |
+
*/
|
229 |
+
public function show_stats( $id = 0 ) {
|
230 |
+
ob_clean();
|
231 |
+
$key = (int) WDW_FMC_Library::get('sorted_label_key', '');
|
232 |
+
|
233 |
+
$page = (int) WDW_FMC_Library::get('paged', 1);
|
234 |
+
$page_num = $page ? ($page - 1) * $this->page_per_num : 0;
|
235 |
+
|
236 |
+
$labels_parameters = $this->model->get_labels_parameters( $id, $page_num, $this->page_per_num);
|
237 |
+
$where_choices = $labels_parameters[7];
|
238 |
+
$sorted_label_names_original = $labels_parameters[4];
|
239 |
+
$sorted_labels_id = $labels_parameters[0];
|
240 |
+
|
241 |
+
$all = 0;
|
242 |
+
$choices_labels = array();
|
243 |
+
$sorted_label_name_original = '';
|
244 |
+
$choices_count = '';
|
245 |
+
$unanswered = NULL;
|
246 |
+
$colors = array();
|
247 |
+
$choices_colors = array();
|
248 |
+
if ( count($sorted_labels_id) != 0 ) {
|
249 |
+
$choices_params = $this->model->statistic_for_radio($where_choices, $sorted_labels_id[$key]);
|
250 |
+
$sorted_label_name_original = $sorted_label_names_original[$key];
|
251 |
+
$choices_count = $choices_params[0];
|
252 |
+
$choices_labels = $choices_params[1];
|
253 |
+
$unanswered = $choices_params[2];
|
254 |
+
$all = $choices_params[3];
|
255 |
+
$colors = $choices_params[4];
|
256 |
+
$choices_colors = $choices_params[5];
|
257 |
+
}
|
258 |
+
|
259 |
+
// Set params for view.
|
260 |
+
$params = array();
|
261 |
+
$params['key'] = $key;
|
262 |
+
$params['all'] = $all;
|
263 |
+
$params['choices_labels'] = $choices_labels;
|
264 |
+
$params['sorted_label_name_original'] = $sorted_label_name_original;
|
265 |
+
$params['choices_count'] = $choices_count;
|
266 |
+
$params['unanswered'] = $unanswered;
|
267 |
+
$params['colors'] = $colors;
|
268 |
+
$params['choices_colors'] = $choices_colors;
|
269 |
+
|
270 |
+
$json = array();
|
271 |
+
$json['html'] = $this->view->show_stats($params);
|
272 |
+
echo json_encode($json); exit;
|
273 |
+
}
|
274 |
+
|
275 |
+
/**
|
276 |
+
* Edit.
|
277 |
+
* @param int $id
|
278 |
+
*/
|
279 |
+
public function edit( $id=0 ) {
|
280 |
+
$form_id = WDW_FMC_Library::get('form_id', 0);
|
281 |
+
$data = $this->model->get_data_of_group_id( $id );
|
282 |
+
if ( empty($data[0]) ) {
|
283 |
+
WDW_FMC_Library::fm_redirect( add_query_arg( array('page' => $this->page, 'task' => 'display', 'current_id' => $id ), admin_url('admin.php') ) );
|
284 |
+
}
|
285 |
+
|
286 |
+
$labels_id = '';
|
287 |
+
$rows = array();
|
288 |
+
$labels_type = array();
|
289 |
+
$labels_name = array();
|
290 |
+
$ispaypal = array();
|
291 |
+
if ( !empty($data) ) {
|
292 |
+
$labels_id = $data[1];
|
293 |
+
$rows = $data[0];
|
294 |
+
$labels_name = $data[2];
|
295 |
+
$labels_type = $data[3];
|
296 |
+
$ispaypal = $data[4];
|
297 |
+
$form = $data[5];
|
298 |
+
$userinfo = get_userdata($rows[0]->user_id_wd);
|
299 |
+
}
|
300 |
+
|
301 |
+
$username = $userinfo ? $userinfo->display_name : "";
|
302 |
+
$useremail = $userinfo ? $userinfo->user_email : "";
|
303 |
+
|
304 |
+
// Set params for view.
|
305 |
+
$params = array();
|
306 |
+
$params['form_id'] = $form_id;
|
307 |
+
$params['form'] = $form;
|
308 |
+
$params['current_id'] = $id;
|
309 |
+
$params['rows'] = $rows;
|
310 |
+
$params['labels_id'] = $labels_id;
|
311 |
+
$params['labels_name'] = $labels_name;
|
312 |
+
$params['labels_type'] = $labels_type;
|
313 |
+
$params['ispaypal'] = $ispaypal;
|
314 |
+
$params['username'] = $username;
|
315 |
+
$params['useremail'] = $useremail;
|
316 |
+
$this->view->edit($params);
|
317 |
+
}
|
318 |
+
|
319 |
+
/**
|
320 |
+
* Save.
|
321 |
+
* @param int $id
|
322 |
+
*/
|
323 |
+
public function save( $id = 0 ) {
|
324 |
+
$form_id = WDW_FMC_Library::get('form_id', 0);
|
325 |
+
$this->save_db( $id, $form_id );
|
326 |
+
}
|
327 |
+
|
328 |
+
/**
|
329 |
+
* Save.
|
330 |
+
* @param int $id
|
331 |
+
* @param int $form_id
|
332 |
+
*/
|
333 |
+
public function save_db( $id, $form_id) {
|
334 |
+
$id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
|
335 |
+
$date = esc_html($_POST['date']);
|
336 |
+
$ip = esc_html($_POST['ip']);
|
337 |
+
|
338 |
+
$form = $this->model->get_all($form_id);
|
339 |
+
$label_id = array();
|
340 |
+
$label_order_original = array();
|
341 |
+
$label_type = array();
|
342 |
+
if ( strpos($form->label_order, 'type_paypal_') ) {
|
343 |
+
$form->label_order = $form->label_order . "0#**id**#Payment Status#**label**#type_paypal_payment_status#****#";
|
344 |
+
}
|
345 |
+
$label_all = explode('#****#', $form->label_order);
|
346 |
+
$label_all = array_slice($label_all, 0, count($label_all) - 1);
|
347 |
+
foreach ( $label_all as $key => $label_each ) {
|
348 |
+
$label_id_each = explode('#**id**#', $label_each);
|
349 |
+
array_push($label_id, $label_id_each[0]);
|
350 |
+
$label_oder_each = explode('#**label**#', $label_id_each[1]);
|
351 |
+
array_push($label_order_original, $label_oder_each[0]);
|
352 |
+
array_push($label_type, $label_oder_each[1]);
|
353 |
+
}
|
354 |
+
foreach ( $label_id as $key => $label_id_1 ) {
|
355 |
+
if ( isset($_POST["submission_" . $label_id_1]) ) {
|
356 |
+
$element_value = (isset($_POST["submission_" . $label_id_1]) ? esc_html(stripslashes($_POST["submission_" . $label_id_1])) : " ");
|
357 |
+
$result = $this->model->get_id($id, $label_id_1);
|
358 |
+
if ( $label_type[$key] == 'type_file_upload' ) {
|
359 |
+
if ( $element_value ) {
|
360 |
+
$element_value = $element_value . "*@@url@@*";
|
361 |
+
}
|
362 |
+
}
|
363 |
+
if ( $result ) {
|
364 |
+
$save = $this->model->update_fm_submits(array(
|
365 |
+
'element_value' => stripslashes($element_value),
|
366 |
+
), array(
|
367 |
+
'group_id' => $id,
|
368 |
+
'element_label' => $label_id_1,
|
369 |
+
), array(
|
370 |
+
'%s',
|
371 |
+
), array(
|
372 |
+
'%d',
|
373 |
+
'%s',
|
374 |
+
));
|
375 |
+
}
|
376 |
+
else {
|
377 |
+
$save = $this->model->insert_fm_submits(array(
|
378 |
+
'form_id' => $form_id,
|
379 |
+
'element_label' => $label_id_1,
|
380 |
+
'element_value' => stripslashes($element_value),
|
381 |
+
'group_id' => $id,
|
382 |
+
'date' => $date,
|
383 |
+
'ip' => $ip,
|
384 |
+
), array(
|
385 |
+
'%d',
|
386 |
+
'%s',
|
387 |
+
'%s',
|
388 |
+
'%d',
|
389 |
+
'%s',
|
390 |
+
'%s',
|
391 |
+
));
|
392 |
+
}
|
393 |
+
}
|
394 |
+
else {
|
395 |
+
if ( isset($_POST["submission_" . $label_id_1 . '_0']) ) {
|
396 |
+
$element_value = '';
|
397 |
+
for ( $z = 0; $z < 21; $z++ ) {
|
398 |
+
$element_value_ch = isset($_POST["submission_" . $label_id_1 . '_' . $z]) ? $_POST["submission_" . $label_id_1 . '_' . $z] : NULL;
|
399 |
+
if ( isset($element_value_ch) ) {
|
400 |
+
$element_value = $element_value . $element_value_ch . '***br***';
|
401 |
+
}
|
402 |
+
else {
|
403 |
+
break;
|
404 |
+
}
|
405 |
+
}
|
406 |
+
$result = $this->model->get_id($id, $label_id_1);
|
407 |
+
if ( $result ) {
|
408 |
+
$save = $this->model->update_fm_submits(array(
|
409 |
+
'element_value' => stripslashes($element_value),
|
410 |
+
), array(
|
411 |
+
'group_id' => $id,
|
412 |
+
'element_label' => $label_id_1,
|
413 |
+
), array(
|
414 |
+
'%s',
|
415 |
+
), array(
|
416 |
+
'%d',
|
417 |
+
'%s',
|
418 |
+
));
|
419 |
+
}
|
420 |
+
else {
|
421 |
+
$save = $this->model->insert_fm_submits(array(
|
422 |
+
'form_id' => $form_id,
|
423 |
+
'element_label' => $label_id_1,
|
424 |
+
'element_value' => stripslashes($element_value),
|
425 |
+
'group_id' => $id,
|
426 |
+
'date' => $date,
|
427 |
+
'ip' => $ip,
|
428 |
+
), array(
|
429 |
+
'%d',
|
430 |
+
'%s',
|
431 |
+
'%s',
|
432 |
+
'%d',
|
433 |
+
'%s',
|
434 |
+
'%s',
|
435 |
+
));
|
436 |
+
}
|
437 |
+
}
|
438 |
+
}
|
439 |
+
}
|
440 |
+
|
441 |
+
$message = 2;
|
442 |
+
if ( $save !== FALSE ) {
|
443 |
+
$message = 14;
|
444 |
+
}
|
445 |
+
$args = array(
|
446 |
+
'page' => $this->page,
|
447 |
+
'task' => 'edit',
|
448 |
+
'current_id' => $id,
|
449 |
+
'form_id' => $form_id,
|
450 |
+
'message' => $message,
|
451 |
+
);
|
452 |
+
|
453 |
+
WDW_FMC_Library::fm_redirect(add_query_arg( $args, admin_url('admin.php')) );
|
454 |
+
}
|
455 |
+
|
456 |
+
/**
|
457 |
+
* Delete form by id.
|
458 |
+
*
|
459 |
+
* @param $id
|
460 |
+
* @param bool $bulk
|
461 |
+
*
|
462 |
+
* @return int
|
463 |
+
*/
|
464 |
+
public function delete( $id, $bulk = FALSE ) {
|
465 |
+
$form_id = (int) WDW_FMC_Library::get('form_id', 0);
|
466 |
+
$delete = $this->model->delete_row($id);
|
467 |
+
$message = 2;
|
468 |
+
if ( $delete ) {
|
469 |
+
$message = 3;
|
470 |
+
}
|
471 |
+
|
472 |
+
if ( $bulk ) {
|
473 |
+
return $message;
|
474 |
+
}
|
475 |
+
|
476 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array(
|
477 |
+
'page' => $this->page,
|
478 |
+
'task' => 'display',
|
479 |
+
'current_id'=> $form_id,
|
480 |
+
'message' => $message,
|
481 |
+
), admin_url('admin.php')));
|
482 |
+
}
|
483 |
+
|
484 |
+
/**
|
485 |
+
* Block IP form by id.
|
486 |
+
*
|
487 |
+
* @param $id
|
488 |
+
* @param bool $bulk
|
489 |
+
*
|
490 |
+
* @return int
|
491 |
+
*/
|
492 |
+
public function block_ip( $id, $bulk = FALSE ) {
|
493 |
+
global $wpdb;
|
494 |
+
|
495 |
+
$form_id = (int) WDW_FMC_Library::get('form_id', 0);
|
496 |
+
$q = $wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id ="%d"', $id);
|
497 |
+
$row = $wpdb->get_row($q);
|
498 |
+
$message = 2;
|
499 |
+
|
500 |
+
if( !empty($row) ) {
|
501 |
+
if( !$this->model->get_ips( $row->ip ) ) {
|
502 |
+
$save = $this->model->set_ips( array('ip' => $row->ip), array( '%s', ) );
|
503 |
+
|
504 |
+
if($save){
|
505 |
+
$message = 12;
|
506 |
+
}
|
507 |
+
}
|
508 |
+
}
|
509 |
+
if ( $bulk ) {
|
510 |
+
return $message;
|
511 |
+
}
|
512 |
+
|
513 |
+
WDW_FMC_Library::fm_redirect(add_query_arg( array(
|
514 |
+
'page' => $this->page,
|
515 |
+
'task' => 'display',
|
516 |
+
'current_id'=> $form_id,
|
517 |
+
'message' => $message,
|
518 |
+
), admin_url('admin.php')) );
|
519 |
+
}
|
520 |
+
|
521 |
+
/**
|
522 |
+
* Unblock IP form by id.
|
523 |
+
*
|
524 |
+
* @param $id
|
525 |
+
* @param bool $bulk
|
526 |
+
*
|
527 |
+
* @return int
|
528 |
+
*/
|
529 |
+
public function unblock_ip( $id, $bulk = FALSE ) {
|
530 |
+
global $wpdb;
|
531 |
+
|
532 |
+
$form_id = (int) WDW_FMC_Library::get('form_id', 0);
|
533 |
+
$q = $wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id ="%d"', $id);
|
534 |
+
$row = $wpdb->get_row($q);
|
535 |
+
$message = 2;
|
536 |
+
|
537 |
+
if( !empty($row) ) {
|
538 |
+
if( $this->model->get_ips( $row->ip ) ) {
|
539 |
+
$delete = $this->model->delete_by_ip( $row->ip );
|
540 |
+
if($delete){
|
541 |
+
$message = 13;
|
542 |
+
}
|
543 |
+
}
|
544 |
+
}
|
545 |
+
|
546 |
+
if ( $bulk ) {
|
547 |
+
return $message;
|
548 |
+
}
|
549 |
+
|
550 |
+
WDW_FMC_Library::fm_redirect(add_query_arg( array(
|
551 |
+
'page' => $this->page,
|
552 |
+
'task' => 'display',
|
553 |
+
'current_id'=> $form_id,
|
554 |
+
'message' => $message,
|
555 |
+
), admin_url('admin.php')) );
|
556 |
+
}
|
557 |
+
}
|
admin/controllers/Themes_fm.php
ADDED
@@ -0,0 +1,3074 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class FMControllerThemes_fmc
|
5 |
+
*/
|
6 |
+
class FMControllerThemes_fmc {
|
7 |
+
/**
|
8 |
+
* @var $model
|
9 |
+
*/
|
10 |
+
private $model;
|
11 |
+
/**
|
12 |
+
* @var $view
|
13 |
+
*/
|
14 |
+
private $view;
|
15 |
+
/**
|
16 |
+
* @var string $page
|
17 |
+
*/
|
18 |
+
private $page;
|
19 |
+
/**
|
20 |
+
* @var string $bulk_action_name
|
21 |
+
*/
|
22 |
+
private $bulk_action_name;
|
23 |
+
/**
|
24 |
+
* @var int $items_per_page
|
25 |
+
*/
|
26 |
+
private $items_per_page = 20;
|
27 |
+
/**
|
28 |
+
* @var array $actions
|
29 |
+
*/
|
30 |
+
private $actions = array();
|
31 |
+
|
32 |
+
public function __construct() {
|
33 |
+
require_once WDCFM()->plugin_dir . "/admin/models/Themes_fm.php";
|
34 |
+
$this->model = new FMModelThemes_fmc();
|
35 |
+
require_once WDCFM()->plugin_dir . "/admin/views/Themes_fm.php";
|
36 |
+
$this->view = new FMViewThemes_fmc();
|
37 |
+
$this->page = WDW_FMC_Library::get('page');
|
38 |
+
$this->bulk_action_name = 'bulk_action';
|
39 |
+
|
40 |
+
$this->actions = array(
|
41 |
+
'duplicate' => array(
|
42 |
+
'title' => __('Duplicate', WDCFM()->prefix),
|
43 |
+
$this->bulk_action_name => __('duplicated', WDCFM()->prefix),
|
44 |
+
),
|
45 |
+
'delete' => array(
|
46 |
+
'title' => __('Delete', WDCFM()->prefix),
|
47 |
+
$this->bulk_action_name => __('deleted', WDCFM()->prefix),
|
48 |
+
),
|
49 |
+
);
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Execute.
|
54 |
+
*/
|
55 |
+
public function execute() {
|
56 |
+
$task = WDW_FMC_Library::get('task');
|
57 |
+
$id = (int) WDW_FMC_Library::get('current_id', 0);
|
58 |
+
if ( method_exists($this, $task) ) {
|
59 |
+
if ( $task != 'add' && $task != 'edit' && $task != 'display' ) {
|
60 |
+
check_admin_referer(WDCFM()->nonce, WDCFM()->nonce);
|
61 |
+
}
|
62 |
+
$block_action = $this->bulk_action_name;
|
63 |
+
$action = WDW_FMC_Library::get($block_action, -1);
|
64 |
+
if ( $action != -1 ) {
|
65 |
+
$this->$block_action($action);
|
66 |
+
}
|
67 |
+
else {
|
68 |
+
$this->$task($id);
|
69 |
+
}
|
70 |
+
}
|
71 |
+
else {
|
72 |
+
$this->display();
|
73 |
+
}
|
74 |
+
}
|
75 |
+
|
76 |
+
/**
|
77 |
+
* Display.
|
78 |
+
*/
|
79 |
+
public function display() {
|
80 |
+
// Set params for view.
|
81 |
+
$params = array();
|
82 |
+
$params['page'] = $this->page;
|
83 |
+
$params['page_title'] = __('Themes', WDCFM()->prefix);
|
84 |
+
$params['actions'] = $this->actions;
|
85 |
+
$params['order'] = WDW_FMC_Library::get('order', 'desc');
|
86 |
+
$params['orderby'] = WDW_FMC_Library::get('orderby', 'default');
|
87 |
+
// To prevent SQL injections.
|
88 |
+
$params['order'] = ($params['order'] == 'desc') ? 'desc' : 'asc';
|
89 |
+
if ( !in_array($params['orderby'], array( 'title', 'default' )) ) {
|
90 |
+
$params['orderby'] = 'default';
|
91 |
+
}
|
92 |
+
$params['items_per_page'] = $this->items_per_page;
|
93 |
+
$page = (int) WDW_FMC_Library::get('paged', 1);
|
94 |
+
$page_num = $page ? ($page - 1) * $params['items_per_page'] : 0;
|
95 |
+
$params['page_num'] = $page_num;
|
96 |
+
$params['search'] = WDW_FMC_Library::get('s', '');;
|
97 |
+
$params['total'] = $this->model->total();
|
98 |
+
$params['rows_data'] = $this->model->get_rows_data($params);
|
99 |
+
$this->view->display($params);
|
100 |
+
}
|
101 |
+
|
102 |
+
/**
|
103 |
+
* Bulk actions.
|
104 |
+
*
|
105 |
+
* @param $task
|
106 |
+
*/
|
107 |
+
public function bulk_action($task) {
|
108 |
+
$message = 0;
|
109 |
+
$successfully_updated = 0;
|
110 |
+
|
111 |
+
$check = WDW_FMC_Library::get('check', '');
|
112 |
+
|
113 |
+
if ( $check ) {
|
114 |
+
foreach ( $check as $form_id => $item ) {
|
115 |
+
if ( method_exists($this, $task) ) {
|
116 |
+
$message = $this->$task($form_id, TRUE);
|
117 |
+
if ( $message != 2 ) {
|
118 |
+
// Increase successfully updated items count, if action doesn't failed.
|
119 |
+
$successfully_updated++;
|
120 |
+
}
|
121 |
+
}
|
122 |
+
}
|
123 |
+
if ( $successfully_updated ) {
|
124 |
+
$block_action = $this->bulk_action_name;
|
125 |
+
$message = sprintf(_n('%s item successfully %s.', '%s items successfully %s.', $successfully_updated, WDCFM()->prefix), $successfully_updated, $this->actions[$task][$block_action]);
|
126 |
+
}
|
127 |
+
}
|
128 |
+
|
129 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array(
|
130 |
+
'page' => $this->page,
|
131 |
+
'task' => 'display',
|
132 |
+
($message === 2 ? 'message' : 'msg') => $message,
|
133 |
+
), admin_url('admin.php')));
|
134 |
+
|
135 |
+
}
|
136 |
+
|
137 |
+
/**
|
138 |
+
* Delete form by id.
|
139 |
+
*
|
140 |
+
* @param $id
|
141 |
+
* @param bool $bulk
|
142 |
+
*
|
143 |
+
* @return int
|
144 |
+
*/
|
145 |
+
public function delete( $id, $bulk = FALSE ) {
|
146 |
+
$isDefault = $this->model->get_default($id);
|
147 |
+
if ( $isDefault ) {
|
148 |
+
$message = 4;
|
149 |
+
}
|
150 |
+
else {
|
151 |
+
$table = 'formmaker_themes';
|
152 |
+
$delete = $this->model->delete_rows(array(
|
153 |
+
'table' => $table,
|
154 |
+
'where' => 'id = ' . $id,
|
155 |
+
));
|
156 |
+
if ( $delete ) {
|
157 |
+
$message = 3;
|
158 |
+
}
|
159 |
+
else {
|
160 |
+
$message = 2;
|
161 |
+
}
|
162 |
+
}
|
163 |
+
if ( $bulk ) {
|
164 |
+
return $message;
|
165 |
+
}
|
166 |
+
WDW_FMC_Library::fm_redirect( add_query_arg( array('page' => $this->page, 'task' => 'display', 'message' => $message), admin_url('admin.php') ) );
|
167 |
+
}
|
168 |
+
|
169 |
+
/**
|
170 |
+
* Duplicate by id.
|
171 |
+
*
|
172 |
+
* @param $id
|
173 |
+
* @param bool $bulk
|
174 |
+
*
|
175 |
+
* @return int
|
176 |
+
*/
|
177 |
+
public function duplicate( $id, $bulk = FALSE ) {
|
178 |
+
$message = 2;
|
179 |
+
$table = 'formmaker_themes';
|
180 |
+
$row = $this->model->select_rows("get_row", array(
|
181 |
+
"selection" => "*",
|
182 |
+
"table" => $table,
|
183 |
+
"where" => "id=" . (int) $id,
|
184 |
+
));
|
185 |
+
if ( $row ) {
|
186 |
+
$row = (array) $row;
|
187 |
+
unset($row['id']);
|
188 |
+
$row['default'] = 0;
|
189 |
+
$inserted = $this->model->insert_data_to_db($table, (array) $row);
|
190 |
+
if ( $inserted !== FALSE ) {
|
191 |
+
$message = 11;
|
192 |
+
}
|
193 |
+
}
|
194 |
+
if ( $bulk ) {
|
195 |
+
return $message;
|
196 |
+
}
|
197 |
+
else {
|
198 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array(
|
199 |
+
'page' => $this->page,
|
200 |
+
'task' => 'display',
|
201 |
+
'message' => $message,
|
202 |
+
), admin_url('admin.php')));
|
203 |
+
}
|
204 |
+
}
|
205 |
+
|
206 |
+
/**
|
207 |
+
* Edit.
|
208 |
+
*
|
209 |
+
* @param int $id
|
210 |
+
*/
|
211 |
+
public function edit($id = 0 ) {
|
212 |
+
$params = array();
|
213 |
+
$params['id'] = (int) $id;
|
214 |
+
$params['row'] = $this->model->get_row_data($params['id'], FALSE);
|
215 |
+
if ( empty($params['row']->id) ) {
|
216 |
+
WDW_FMC_Library::fm_redirect( add_query_arg( array('page' => $this->page, 'task' => 'display'), admin_url('admin.php') ) );
|
217 |
+
}
|
218 |
+
$params['page_title'] = $params['row']->title;
|
219 |
+
$params['param_values'] = $params['row']->css;
|
220 |
+
$params['tabs'] = array(
|
221 |
+
'global' => __('Global Parameters', WDCFM()->prefix),
|
222 |
+
'header' => __('Header', WDCFM()->prefix),
|
223 |
+
'content' => __('Content', WDCFM()->prefix),
|
224 |
+
'input_select' => __('Inputbox', WDCFM()->prefix),
|
225 |
+
'choices' => __('Choices', WDCFM()->prefix),
|
226 |
+
'subscribe' => __('General Buttons', WDCFM()->prefix),
|
227 |
+
'paigination' => __('Pagination', WDCFM()->prefix),
|
228 |
+
'buttons' => __('Buttons', WDCFM()->prefix),
|
229 |
+
'close_button' => __('Close(Minimize) Button', WDCFM()->prefix),
|
230 |
+
'minimize' => __('Minimize Text', WDCFM()->prefix),
|
231 |
+
'other' => __('Other', WDCFM()->prefix),
|
232 |
+
'custom_css' => __('Custom CSS', WDCFM()->prefix),
|
233 |
+
);
|
234 |
+
$border_types = array(
|
235 |
+
'' => '',
|
236 |
+
'solid' => 'Solid',
|
237 |
+
'dotted' => 'Dotted',
|
238 |
+
'dashed' => 'Dashed',
|
239 |
+
'double' => 'Double',
|
240 |
+
'groove' => 'Groove',
|
241 |
+
'ridge' => 'Ridge',
|
242 |
+
'inset' => 'Inset',
|
243 |
+
'outset' => 'Outset',
|
244 |
+
'initial' => 'Initial',
|
245 |
+
'inherit' => 'Inherit',
|
246 |
+
'hidden' => 'Hidden',
|
247 |
+
'none' => 'None',
|
248 |
+
);
|
249 |
+
$borders = array(
|
250 |
+
'' => '',
|
251 |
+
'top' => __('Top', WDCFM()->prefix),
|
252 |
+
'right' => __('Right', WDCFM()->prefix),
|
253 |
+
'bottom' => __('Bottom', WDCFM()->prefix),
|
254 |
+
'left' => __('Left', WDCFM()->prefix)
|
255 |
+
);
|
256 |
+
$position_types = array(
|
257 |
+
'' => '',
|
258 |
+
'static' => 'Static',
|
259 |
+
'relative' => 'Relative',
|
260 |
+
'fixed' => 'Fixed',
|
261 |
+
'absolute' => 'Absolute',
|
262 |
+
);
|
263 |
+
$font_weights = array(
|
264 |
+
'' => '',
|
265 |
+
'normal' => 'Normal',
|
266 |
+
'bold' => 'Bold',
|
267 |
+
'bolder' => 'Bolder',
|
268 |
+
'lighter' => 'Lighter',
|
269 |
+
'initial' => 'Initial',
|
270 |
+
);
|
271 |
+
$aligns = array( '' => '', 'left' => __('Left', WDCFM()->prefix), 'center' => __('Center', WDCFM()->prefix), 'right' => __('Right', WDCFM()->prefix) );
|
272 |
+
$basic_fonts = array(
|
273 |
+
'' => '',
|
274 |
+
'arial' => 'Arial',
|
275 |
+
'lucida grande' => 'Lucida grande',
|
276 |
+
'segoe ui' => 'Segoe ui',
|
277 |
+
'tahoma' => 'Tahoma',
|
278 |
+
'trebuchet ms' => 'Trebuchet ms',
|
279 |
+
'verdana' => 'Verdana',
|
280 |
+
'cursive' => 'Cursive',
|
281 |
+
'fantasy' => 'Fantasy',
|
282 |
+
'monospace' => 'Monospace',
|
283 |
+
'serif' => 'Serif',
|
284 |
+
);
|
285 |
+
$bg_repeats = array(
|
286 |
+
'' => '',
|
287 |
+
'repeat' => 'repeat',
|
288 |
+
'repeat-x' => 'repeat-x',
|
289 |
+
'repeat-y' => 'repeat-y',
|
290 |
+
'no-repeat' => 'no-repeat',
|
291 |
+
'initial' => 'initial',
|
292 |
+
'inherit' => 'inherit',
|
293 |
+
);
|
294 |
+
$google_fonts = WDW_FMC_Library::get_google_fonts();
|
295 |
+
$font_families = $basic_fonts + $google_fonts;
|
296 |
+
$params['fonts'] = implode("|", str_replace(' ', '+', $google_fonts));
|
297 |
+
$params['all_params'] = $this->all_params($params['param_values'], $borders, $border_types, $font_weights, $position_types, $aligns, $bg_repeats, $font_families);
|
298 |
+
$this->view->edit($params);
|
299 |
+
}
|
300 |
+
|
301 |
+
// set all params in array
|
302 |
+
public function all_params( $param_values, $borders, $border_types, $font_weights, $position_types, $aligns, $bg_repeats, $font_families ) {
|
303 |
+
$all_params = array(
|
304 |
+
'global' => array(
|
305 |
+
array(
|
306 |
+
'label' => '',
|
307 |
+
'type' => 'panel',
|
308 |
+
'class' => 'col-md-12',
|
309 |
+
'label_class' => '',
|
310 |
+
'after' => '',
|
311 |
+
),
|
312 |
+
array(
|
313 |
+
'label' => __('Font Family', WDCFM()->prefix),
|
314 |
+
'name' => 'GPFontFamily',
|
315 |
+
'type' => 'select',
|
316 |
+
'options' => $font_families,
|
317 |
+
'class' => '',
|
318 |
+
'value' => isset($param_values->GPFontFamily) ? $param_values->GPFontFamily : '',
|
319 |
+
'after' => '',
|
320 |
+
),
|
321 |
+
array(
|
322 |
+
'label' => __('Width', WDCFM()->prefix),
|
323 |
+
'name' => 'AGPWidth',
|
324 |
+
'type' => 'text',
|
325 |
+
'class' => '',
|
326 |
+
'value' => isset($param_values->AGPWidth) ? $param_values->AGPWidth : '',
|
327 |
+
'after' => '%',
|
328 |
+
),
|
329 |
+
array(
|
330 |
+
'label' => __('Width (for scrollbox, popup form types)', WDCFM()->prefix),
|
331 |
+
'name' => 'AGPSPWidth',
|
332 |
+
'type' => 'text',
|
333 |
+
'class' => '',
|
334 |
+
'value' => isset($param_values->AGPSPWidth) ? $param_values->AGPSPWidth : '',
|
335 |
+
'after' => '%',
|
336 |
+
),
|
337 |
+
array(
|
338 |
+
'label' => __('Padding', WDCFM()->prefix),
|
339 |
+
'name' => 'AGPPadding',
|
340 |
+
'type' => 'text',
|
341 |
+
'class' => '',
|
342 |
+
'placeholder' => __('e.g. 3px 5px or 3% 5%', WDCFM()->prefix),
|
343 |
+
'value' => isset($param_values->AGPPadding) ? $param_values->AGPPadding : '',
|
344 |
+
'after' => '',
|
345 |
+
),
|
346 |
+
array(
|
347 |
+
'label' => __('Margin', WDCFM()->prefix),
|
348 |
+
'name' => 'AGPMargin',
|
349 |
+
'type' => 'text',
|
350 |
+
'class' => '',
|
351 |
+
'value' => isset($param_values->AGPMargin) ? $param_values->AGPMargin : '',
|
352 |
+
'placeholder' => __('e.g. 5px 10px or 5% 10%', WDCFM()->prefix),
|
353 |
+
'after' => '',
|
354 |
+
),
|
355 |
+
array(
|
356 |
+
'label' => __('Border', WDCFM()->prefix),
|
357 |
+
'name' => 'AGPBorder',
|
358 |
+
'type' => 'checkbox',
|
359 |
+
'options' => $borders,
|
360 |
+
'class' => '',
|
361 |
+
'after' => '',
|
362 |
+
),
|
363 |
+
array(
|
364 |
+
'label' => __('Border Color', WDCFM()->prefix),
|
365 |
+
'name' => 'AGPBorderColor',
|
366 |
+
'type' => 'text',
|
367 |
+
'class' => 'color',
|
368 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #e5e5e5',
|
369 |
+
'value' => isset($param_values->AGPBorderColor) ? $param_values->AGPBorderColor : '',
|
370 |
+
'after' => '',
|
371 |
+
),
|
372 |
+
array(
|
373 |
+
'label' => __('Border Type', WDCFM()->prefix),
|
374 |
+
'name' => 'AGPBorderType',
|
375 |
+
'type' => 'select',
|
376 |
+
'options' => $border_types,
|
377 |
+
'class' => '',
|
378 |
+
'value' => isset($param_values->AGPBorderType) ? $param_values->AGPBorderType : '',
|
379 |
+
'after' => '',
|
380 |
+
),
|
381 |
+
array(
|
382 |
+
'label' => __('Border Width', WDCFM()->prefix),
|
383 |
+
'name' => 'AGPBorderWidth',
|
384 |
+
'type' => 'text',
|
385 |
+
'class' => '',
|
386 |
+
'value' => isset($param_values->AGPBorderWidth) ? $param_values->AGPBorderWidth : '',
|
387 |
+
'after' => 'px',
|
388 |
+
),
|
389 |
+
array(
|
390 |
+
'label' => __('Border Radius', WDCFM()->prefix),
|
391 |
+
'name' => 'AGPBorderRadius',
|
392 |
+
'type' => 'text',
|
393 |
+
'class' => '',
|
394 |
+
'value' => isset($param_values->AGPBorderRadius) ? $param_values->AGPBorderRadius : '',
|
395 |
+
'after' => 'px',
|
396 |
+
),
|
397 |
+
array(
|
398 |
+
'label' => __('Box Shadow', WDCFM()->prefix),
|
399 |
+
'name' => 'AGPBoxShadow',
|
400 |
+
'type' => 'text',
|
401 |
+
'class' => '',
|
402 |
+
'value' => isset($param_values->AGPBoxShadow) ? $param_values->AGPBoxShadow : '',
|
403 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' 5px 5px 2px #888888',
|
404 |
+
'after' => '</div>',
|
405 |
+
),
|
406 |
+
),
|
407 |
+
'header' => array(
|
408 |
+
array(
|
409 |
+
'label' => __('General Parameters', WDCFM()->prefix),
|
410 |
+
'type' => 'panel',
|
411 |
+
'class' => 'col-md-12',
|
412 |
+
'label_class' => 'fm-mini-title',
|
413 |
+
'after' => '<br/>',
|
414 |
+
),
|
415 |
+
array(
|
416 |
+
'label' => __('Alignment', WDCFM()->prefix),
|
417 |
+
'name' => 'HPAlign',
|
418 |
+
'type' => 'select',
|
419 |
+
'options' => $borders,
|
420 |
+
'class' => '',
|
421 |
+
'value' => isset($param_values->HPAlign) ? $param_values->HPAlign : '',
|
422 |
+
'after' => '',
|
423 |
+
),
|
424 |
+
array(
|
425 |
+
'label' => __('Background Color', WDCFM()->prefix),
|
426 |
+
'name' => 'HPBGColor',
|
427 |
+
'type' => 'text',
|
428 |
+
'class' => 'color',
|
429 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) .' #efefef',
|
430 |
+
'value' => isset($param_values->HPBGColor) ? $param_values->HPBGColor : '',
|
431 |
+
'after' => '',
|
432 |
+
),
|
433 |
+
array(
|
434 |
+
'label' => __('Width', WDCFM()->prefix),
|
435 |
+
'name' => 'HPWidth',
|
436 |
+
'type' => 'text',
|
437 |
+
'class' => '',
|
438 |
+
'value' => isset($param_values->HPWidth) ? $param_values->HPWidth : '',
|
439 |
+
'after' => '%',
|
440 |
+
),
|
441 |
+
array(
|
442 |
+
'label' => __('Width (for topbar form type)', WDCFM()->prefix),
|
443 |
+
'name' => 'HTPWidth',
|
444 |
+
'type' => 'text',
|
445 |
+
'class' => '',
|
446 |
+
'value' => isset($param_values->HTPWidth) ? $param_values->HTPWidth : '',
|
447 |
+
'after' => '%',
|
448 |
+
),
|
449 |
+
array(
|
450 |
+
'label' => __('Padding', WDCFM()->prefix),
|
451 |
+
'name' => 'HPPadding',
|
452 |
+
'type' => 'text',
|
453 |
+
'class' => '',
|
454 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) .' 3px 5px or 3% 5%',
|
455 |
+
'value' => isset($param_values->HPPadding) ? $param_values->HPPadding : '',
|
456 |
+
'after' => '',
|
457 |
+
),
|
458 |
+
array(
|
459 |
+
'label' => __('Margin', WDCFM()->prefix),
|
460 |
+
'name' => 'HPMargin',
|
461 |
+
'type' => 'text',
|
462 |
+
'class' => '',
|
463 |
+
'value' => isset($param_values->HPMargin) ? $param_values->HPMargin : '',
|
464 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) .' 5px 10px or 5% 10%',
|
465 |
+
'after' => '',
|
466 |
+
),
|
467 |
+
array(
|
468 |
+
'label' => __('Text Align', WDCFM()->prefix),
|
469 |
+
'name' => 'HPTextAlign',
|
470 |
+
'type' => 'select',
|
471 |
+
'options' => $aligns,
|
472 |
+
'class' => '',
|
473 |
+
'value' => isset($param_values->HPTextAlign) ? $param_values->HPTextAlign : '',
|
474 |
+
'after' => '',
|
475 |
+
),
|
476 |
+
array(
|
477 |
+
'label' => __('Border', WDCFM()->prefix),
|
478 |
+
'name' => 'HPBorder',
|
479 |
+
'type' => 'checkbox',
|
480 |
+
'options' => $borders,
|
481 |
+
'class' => '',
|
482 |
+
'after' => '',
|
483 |
+
),
|
484 |
+
array(
|
485 |
+
'label' => __('Border Color', WDCFM()->prefix),
|
486 |
+
'name' => 'HPBorderColor',
|
487 |
+
'type' => 'text',
|
488 |
+
'class' => 'color',
|
489 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) .' #efefef',
|
490 |
+
'value' => isset($param_values->HPBorderColor) ? $param_values->HPBorderColor : '',
|
491 |
+
'after' => '',
|
492 |
+
),
|
493 |
+
array(
|
494 |
+
'label' => __('Border Type', WDCFM()->prefix),
|
495 |
+
'name' => 'HPBorderType',
|
496 |
+
'type' => 'select',
|
497 |
+
'options' => $border_types,
|
498 |
+
'class' => '',
|
499 |
+
'value' => isset($param_values->HPBorderType) ? $param_values->HPBorderType : '',
|
500 |
+
'after' => '',
|
501 |
+
),
|
502 |
+
array(
|
503 |
+
'label' => __('Border Width', WDCFM()->prefix),
|
504 |
+
'name' => 'HPBorderWidth',
|
505 |
+
'type' => 'text',
|
506 |
+
'class' => '',
|
507 |
+
'value' => isset($param_values->HPBorderWidth) ? $param_values->HPBorderWidth : '',
|
508 |
+
'after' => 'px',
|
509 |
+
),
|
510 |
+
array(
|
511 |
+
'label' => __('Border Radius', WDCFM()->prefix),
|
512 |
+
'name' => 'HPBorderRadius',
|
513 |
+
'type' => 'text',
|
514 |
+
'class' => '',
|
515 |
+
'value' => isset($param_values->HPBorderRadius) ? $param_values->HPBorderRadius : '',
|
516 |
+
'after' => 'px</div>',
|
517 |
+
),
|
518 |
+
array(
|
519 |
+
'label' => __('Title Parameters', WDCFM()->prefix),
|
520 |
+
'type' => 'panel',
|
521 |
+
'class' => 'col-md-12',
|
522 |
+
'label_class' => 'fm-mini-title',
|
523 |
+
'after' => '<br/>',
|
524 |
+
),
|
525 |
+
array(
|
526 |
+
'label' => __('Font Size', WDCFM()->prefix),
|
527 |
+
'name' => 'HTPFontSize',
|
528 |
+
'type' => 'text',
|
529 |
+
'class' => '',
|
530 |
+
'value' => isset($param_values->HTPFontSize) ? $param_values->HTPFontSize : '',
|
531 |
+
'after' => 'px',
|
532 |
+
),
|
533 |
+
array(
|
534 |
+
'label' => __('Font Weight', WDCFM()->prefix),
|
535 |
+
'name' => 'HTPWeight',
|
536 |
+
'type' => 'select',
|
537 |
+
'options' => $font_weights,
|
538 |
+
'class' => '',
|
539 |
+
'value' => isset($param_values->HTPWeight) ? $param_values->HTPWeight : '',
|
540 |
+
'after' => '',
|
541 |
+
),
|
542 |
+
array(
|
543 |
+
'label' => __('Color', WDCFM()->prefix),
|
544 |
+
'name' => 'HTPColor',
|
545 |
+
'type' => 'text',
|
546 |
+
'class' => 'color',
|
547 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) .' #efefef',
|
548 |
+
'value' => isset($param_values->HTPColor) ? $param_values->HTPColor : '',
|
549 |
+
'after' => '',
|
550 |
+
),
|
551 |
+
array(
|
552 |
+
'label' => __('Description Parameters', WDCFM()->prefix),
|
553 |
+
'type' => 'label',
|
554 |
+
'class' => 'fm-mini-title',
|
555 |
+
'after' => '<br/>',
|
556 |
+
),
|
557 |
+
array(
|
558 |
+
'label' => __('Font Size', WDCFM()->prefix),
|
559 |
+
'name' => 'HDPFontSize',
|
560 |
+
'type' => 'text',
|
561 |
+
'class' => '',
|
562 |
+
'value' => isset($param_values->HDPFontSize) ? $param_values->HDPFontSize : '',
|
563 |
+
'after' => 'px',
|
564 |
+
),
|
565 |
+
array(
|
566 |
+
'label' => __('Color', WDCFM()->prefix),
|
567 |
+
'name' => 'HDPColor',
|
568 |
+
'type' => 'text',
|
569 |
+
'class' => 'color',
|
570 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) .' #efefef',
|
571 |
+
'value' => isset($param_values->HDPColor) ? $param_values->HDPColor : '',
|
572 |
+
'after' => '',
|
573 |
+
),
|
574 |
+
array(
|
575 |
+
'label' => __('Image Parameters', WDCFM()->prefix),
|
576 |
+
'type' => 'label',
|
577 |
+
'class' => 'fm-mini-title',
|
578 |
+
'after' => '<br/>',
|
579 |
+
),
|
580 |
+
array(
|
581 |
+
'label' => __('Alignment', WDCFM()->prefix),
|
582 |
+
'name' => 'HIPAlign',
|
583 |
+
'type' => 'select',
|
584 |
+
'options' => $borders,
|
585 |
+
'class' => '',
|
586 |
+
'value' => isset($param_values->HIPAlign) ? $param_values->HIPAlign : '',
|
587 |
+
'after' => '',
|
588 |
+
),
|
589 |
+
array(
|
590 |
+
'label' => __('Width', WDCFM()->prefix),
|
591 |
+
'name' => 'HIPWidth',
|
592 |
+
'type' => 'text',
|
593 |
+
'class' => '',
|
594 |
+
'value' => isset($param_values->HIPWidth) ? $param_values->HIPWidth : '',
|
595 |
+
'after' => 'px',
|
596 |
+
),
|
597 |
+
array(
|
598 |
+
'label' => __('Height', WDCFM()->prefix),
|
599 |
+
'name' => 'HIPHeight',
|
600 |
+
'type' => 'text',
|
601 |
+
'class' => '',
|
602 |
+
'value' => isset($param_values->HIPHeight) ? $param_values->HIPHeight : '',
|
603 |
+
'after' => 'px</div>',
|
604 |
+
),
|
605 |
+
),
|
606 |
+
'content' => array(
|
607 |
+
array(
|
608 |
+
'label' => __('General Parameters', WDCFM()->prefix),
|
609 |
+
'type' => 'panel',
|
610 |
+
'class' => 'col-md-12',
|
611 |
+
'label_class' => 'fm-mini-title',
|
612 |
+
'after' => '<br/>',
|
613 |
+
),
|
614 |
+
array(
|
615 |
+
'label' => __('Background Color', WDCFM()->prefix),
|
616 |
+
'name' => 'GPBGColor',
|
617 |
+
'type' => 'text',
|
618 |
+
'class' => 'color',
|
619 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) .' #efefef',
|
620 |
+
'value' => isset($param_values->GPBGColor) ? $param_values->GPBGColor : '',
|
621 |
+
'after' => '',
|
622 |
+
),
|
623 |
+
array(
|
624 |
+
'label' => __('Font Size', WDCFM()->prefix),
|
625 |
+
'name' => 'GPFontSize',
|
626 |
+
'type' => 'text',
|
627 |
+
'class' => '',
|
628 |
+
'value' => isset($param_values->GPFontSize) ? $param_values->GPFontSize : '',
|
629 |
+
'after' => 'px',
|
630 |
+
),
|
631 |
+
array(
|
632 |
+
'label' => __('Font Weight', WDCFM()->prefix),
|
633 |
+
'name' => 'GPFontWeight',
|
634 |
+
'type' => 'select',
|
635 |
+
'options' => $font_weights,
|
636 |
+
'class' => '',
|
637 |
+
'value' => isset($param_values->GPFontWeight) ? $param_values->GPFontWeight : '',
|
638 |
+
'after' => '',
|
639 |
+
),
|
640 |
+
array(
|
641 |
+
'label' => __('Width', WDCFM()->prefix),
|
642 |
+
'name' => 'GPWidth',
|
643 |
+
'type' => 'text',
|
644 |
+
'class' => '',
|
645 |
+
'value' => isset($param_values->GPWidth) ? $param_values->GPWidth : '',
|
646 |
+
'after' => '%',
|
647 |
+
),
|
648 |
+
array(
|
649 |
+
'label' => __('Width (for topbar form type)', WDCFM()->prefix),
|
650 |
+
'name' => 'GTPWidth',
|
651 |
+
'type' => 'text',
|
652 |
+
'class' => '',
|
653 |
+
'value' => isset($param_values->GTPWidth) ? $param_values->GTPWidth : '',
|
654 |
+
'after' => '%',
|
655 |
+
),
|
656 |
+
array(
|
657 |
+
'label' => __('Alignment', WDCFM()->prefix),
|
658 |
+
'name' => 'GPAlign',
|
659 |
+
'type' => 'select',
|
660 |
+
'options' => $aligns,
|
661 |
+
'class' => '',
|
662 |
+
'value' => isset($param_values->GPAlign) ? $param_values->GPAlign : '',
|
663 |
+
'after' => '',
|
664 |
+
),
|
665 |
+
array(
|
666 |
+
'label' => __('Background URL', WDCFM()->prefix),
|
667 |
+
'name' => 'GPBackground',
|
668 |
+
'type' => 'text',
|
669 |
+
'class' => '',
|
670 |
+
// 'placeholder' => __('e.g. http:// or https://', WDCFM()->prefix),
|
671 |
+
'value' => isset($param_values->GPBackground) ? $param_values->GPBackground : '',
|
672 |
+
'after' => '',
|
673 |
+
),
|
674 |
+
array(
|
675 |
+
'label' => __('Background Repeat', WDCFM()->prefix),
|
676 |
+
'name' => 'GPBackgroundRepeat',
|
677 |
+
'type' => 'select',
|
678 |
+
'options' => $bg_repeats,
|
679 |
+
'class' => '',
|
680 |
+
'value' => isset($param_values->GPBackgroundRepeat) ? $param_values->GPBackgroundRepeat : '',
|
681 |
+
'after' => '',
|
682 |
+
),
|
683 |
+
array(
|
684 |
+
'label' => __('Background Position', WDCFM()->prefix),
|
685 |
+
'name1' => 'GPBGPosition1',
|
686 |
+
'name2' => 'GPBGPosition2',
|
687 |
+
'type' => '2text',
|
688 |
+
'class' => 'fm-2text',
|
689 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' px|%, top|bottom|left|right|center',
|
690 |
+
'value1' => isset($param_values->GPBGPosition1) ? $param_values->GPBGPosition1 : '',
|
691 |
+
'value2' => isset($param_values->GPBGPosition2) ? $param_values->GPBGPosition2 : '',
|
692 |
+
'before1' => '',
|
693 |
+
'before2' => '',
|
694 |
+
'after' => '',
|
695 |
+
),
|
696 |
+
array(
|
697 |
+
'label' => __('Background Size', WDCFM()->prefix),
|
698 |
+
'name1' => 'GPBGSize1',
|
699 |
+
'name2' => 'GPBGSize2',
|
700 |
+
'type' => '2text',
|
701 |
+
'class' => 'fm-2text',
|
702 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) .' px|%, auto|cover|contain',
|
703 |
+
'value1' => isset($param_values->GPBGSize1) ? $param_values->GPBGSize1 : '',
|
704 |
+
'value2' => isset($param_values->GPBGSize2) ? $param_values->GPBGSize2 : '',
|
705 |
+
'before1' => '',
|
706 |
+
'before2' => '',
|
707 |
+
'after' => '',
|
708 |
+
),
|
709 |
+
array(
|
710 |
+
'label' => __('Color', WDCFM()->prefix),
|
711 |
+
'name' => 'GPColor',
|
712 |
+
'type' => 'text',
|
713 |
+
'class' => 'color',
|
714 |
+
'value' => isset($param_values->GPColor) ? $param_values->GPColor : '',
|
715 |
+
'after' => '',
|
716 |
+
),
|
717 |
+
array(
|
718 |
+
'label' => __('Padding', WDCFM()->prefix),
|
719 |
+
'name' => 'GPPadding',
|
720 |
+
'type' => 'text',
|
721 |
+
'class' => '',
|
722 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) .' 3px 5px or 3% 5%',
|
723 |
+
'value' => isset($param_values->GPPadding) ? $param_values->GPPadding : '',
|
724 |
+
'after' => '',
|
725 |
+
),
|
726 |
+
array(
|
727 |
+
'label' => __('Margin', WDCFM()->prefix),
|
728 |
+
'name' => 'GPMargin',
|
729 |
+
'type' => 'text',
|
730 |
+
'class' => '',
|
731 |
+
'value' => isset($param_values->GPMargin) ? $param_values->GPMargin : '',
|
732 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) .' 5px 10px or 5% 10%',
|
733 |
+
'after' => '',
|
734 |
+
),
|
735 |
+
array(
|
736 |
+
'label' => __('Border', WDCFM()->prefix),
|
737 |
+
'name' => 'GPBorder',
|
738 |
+
'type' => 'checkbox',
|
739 |
+
'options' => $borders,
|
740 |
+
'class' => '',
|
741 |
+
'after' => '',
|
742 |
+
),
|
743 |
+
array(
|
744 |
+
'label' => __('Border Color', WDCFM()->prefix),
|
745 |
+
'name' => 'GPBorderColor',
|
746 |
+
'type' => 'text',
|
747 |
+
'class' => 'color',
|
748 |
+
'value' => isset($param_values->GPBorderColor) ? $param_values->GPBorderColor : '',
|
749 |
+
'after' => '',
|
750 |
+
),
|
751 |
+
array(
|
752 |
+
'label' => __('Border Type', WDCFM()->prefix),
|
753 |
+
'name' => 'GPBorderType',
|
754 |
+
'type' => 'select',
|
755 |
+
'options' => $border_types,
|
756 |
+
'class' => '',
|
757 |
+
'value' => isset($param_values->GPBorderType) ? $param_values->GPBorderType : '',
|
758 |
+
'after' => '',
|
759 |
+
),
|
760 |
+
array(
|
761 |
+
'label' => __('Border Width', WDCFM()->prefix),
|
762 |
+
'name' => 'GPBorderWidth',
|
763 |
+
'type' => 'text',
|
764 |
+
'class' => '',
|
765 |
+
'value' => isset($param_values->GPBorderWidth) ? $param_values->GPBorderWidth : '',
|
766 |
+
'after' => 'px',
|
767 |
+
),
|
768 |
+
array(
|
769 |
+
'label' => __('Border Radius', WDCFM()->prefix),
|
770 |
+
'name' => 'GPBorderRadius',
|
771 |
+
'type' => 'text',
|
772 |
+
'class' => '',
|
773 |
+
'value' => isset($param_values->GPBorderRadius) ? $param_values->GPBorderRadius : '',
|
774 |
+
'after' => 'px</div>',
|
775 |
+
),
|
776 |
+
array(
|
777 |
+
'label' => __('Mini labels (name, phone, address, checkbox, radio) Parameters', WDCFM()->prefix),
|
778 |
+
'type' => 'panel',
|
779 |
+
'class' => 'col-md-12',
|
780 |
+
'label_class' => 'fm-mini-title',
|
781 |
+
'after' => '<br/>',
|
782 |
+
),
|
783 |
+
array(
|
784 |
+
'label' => __('Font Size', WDCFM()->prefix),
|
785 |
+
'name' => 'GPMLFontSize',
|
786 |
+
'type' => 'text',
|
787 |
+
'class' => '',
|
788 |
+
'value' => isset($param_values->GPMLFontSize) ? $param_values->GPMLFontSize : '',
|
789 |
+
'after' => 'px',
|
790 |
+
),
|
791 |
+
array(
|
792 |
+
'label' => __('Font Weight', WDCFM()->prefix),
|
793 |
+
'name' => 'GPMLFontWeight',
|
794 |
+
'type' => 'select',
|
795 |
+
'options' => $font_weights,
|
796 |
+
'class' => '',
|
797 |
+
'value' => isset($param_values->GPMLFontWeight) ? $param_values->GPMLFontWeight : '',
|
798 |
+
'after' => '',
|
799 |
+
),
|
800 |
+
array(
|
801 |
+
'label' => __('Color', WDCFM()->prefix),
|
802 |
+
'name' => 'GPMLColor',
|
803 |
+
'type' => 'text',
|
804 |
+
'class' => 'color',
|
805 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) .' #efefef',
|
806 |
+
'value' => isset($param_values->GPMLColor) ? $param_values->GPMLColor : '',
|
807 |
+
'after' => '',
|
808 |
+
),
|
809 |
+
array(
|
810 |
+
'label' => __('Padding', WDCFM()->prefix),
|
811 |
+
'name' => 'GPMLPadding',
|
812 |
+
'type' => 'text',
|
813 |
+
'class' => '',
|
814 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) .' 3px 5px or 3% 5%',
|
815 |
+
'value' => isset($param_values->GPMLPadding) ? $param_values->GPMLPadding : '',
|
816 |
+
'after' => '',
|
817 |
+
),
|
818 |
+
array(
|
819 |
+
'label' => __('Margin', WDCFM()->prefix),
|
820 |
+
'name' => 'GPMLMargin',
|
821 |
+
'type' => 'text',
|
822 |
+
'class' => '',
|
823 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) .' 5px 10px or 5% 10%',
|
824 |
+
'value' => isset($param_values->GPMLMargin) ? $param_values->GPMLMargin : '',
|
825 |
+
'after' => '',
|
826 |
+
),
|
827 |
+
array(
|
828 |
+
'label' => __('Section Parameters', WDCFM()->prefix),
|
829 |
+
'type' => 'label',
|
830 |
+
'class' => 'fm-mini-title',
|
831 |
+
'after' => '<br/>',
|
832 |
+
),
|
833 |
+
array(
|
834 |
+
'label' => __('Background Color', WDCFM()->prefix),
|
835 |
+
'name' => 'SEPBGColor',
|
836 |
+
'type' => 'text',
|
837 |
+
'class' => 'color',
|
838 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) .' #efefef',
|
839 |
+
'value' => isset($param_values->SEPBGColor) ? $param_values->SEPBGColor : '',
|
840 |
+
'after' => '',
|
841 |
+
),
|
842 |
+
array(
|
843 |
+
'label' => __('Padding', WDCFM()->prefix),
|
844 |
+
'name' => 'SEPPadding',
|
845 |
+
'type' => 'text',
|
846 |
+
'class' => '',
|
847 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) .' 3px 5px or 3% 5%',
|
848 |
+
'value' => isset($param_values->SEPPadding) ? $param_values->SEPPadding : '',
|
849 |
+
'after' => '',
|
850 |
+
),
|
851 |
+
array(
|
852 |
+
'label' => __('Margin', WDCFM()->prefix),
|
853 |
+
'name' => 'SEPMargin',
|
854 |
+
'type' => 'text',
|
855 |
+
'class' => '',
|
856 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) .' 5px 10px or 5% 10%',
|
857 |
+
'value' => isset($param_values->SEPMargin) ? $param_values->SEPMargin : '',
|
858 |
+
'after' => '',
|
859 |
+
),
|
860 |
+
array(
|
861 |
+
'label' => __('Section Column Parameters', WDCFM()->prefix),
|
862 |
+
'type' => 'label',
|
863 |
+
'class' => 'fm-mini-title',
|
864 |
+
'after' => '<br/>',
|
865 |
+
),
|
866 |
+
array(
|
867 |
+
'label' => __('Padding', WDCFM()->prefix),
|
868 |
+
'name' => 'COPPadding',
|
869 |
+
'type' => 'text',
|
870 |
+
'class' => '',
|
871 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) .' 3px 5px or 3% 5%',
|
872 |
+
'value' => isset($param_values->COPPadding) ? $param_values->COPPadding : '',
|
873 |
+
'after' => '',
|
874 |
+
),
|
875 |
+
array(
|
876 |
+
'label' => __('Margin', WDCFM()->prefix),
|
877 |
+
'name' => 'COPMargin',
|
878 |
+
'type' => 'text',
|
879 |
+
'class' => '',
|
880 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) .' 5px 10px or 5% 10%',
|
881 |
+
'value' => isset($param_values->COPMargin) ? $param_values->COPMargin : '',
|
882 |
+
'after' => '',
|
883 |
+
),
|
884 |
+
array(
|
885 |
+
'label' => __('Footer Parameters', WDCFM()->prefix),
|
886 |
+
'type' => 'label',
|
887 |
+
'class' => 'fm-mini-title',
|
888 |
+
'after' => '<br/>',
|
889 |
+
),
|
890 |
+
array(
|
891 |
+
'label' => __('Width', WDCFM()->prefix),
|
892 |
+
'name' => 'FPWidth',
|
893 |
+
'type' => 'text',
|
894 |
+
'class' => '',
|
895 |
+
'value' => isset($param_values->FPWidth) ? $param_values->FPWidth : '',
|
896 |
+
'after' => '%',
|
897 |
+
),
|
898 |
+
array(
|
899 |
+
'label' => __('Padding', WDCFM()->prefix),
|
900 |
+
'name' => 'FPPadding',
|
901 |
+
'type' => 'text',
|
902 |
+
'class' => '',
|
903 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) .' 3px 5px or 3% 5%',
|
904 |
+
'value' => isset($param_values->FPPadding) ? $param_values->FPPadding : '',
|
905 |
+
'after' => '',
|
906 |
+
),
|
907 |
+
array(
|
908 |
+
'label' => __('Margin', WDCFM()->prefix),
|
909 |
+
'name' => 'FPMargin',
|
910 |
+
'type' => 'text',
|
911 |
+
'class' => '',
|
912 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) .' 5px 10px or 5% 10%',
|
913 |
+
'value' => isset($param_values->FPMargin) ? $param_values->FPMargin : '',
|
914 |
+
'after' => '</div>',
|
915 |
+
),
|
916 |
+
),
|
917 |
+
'input_select' => array(
|
918 |
+
array(
|
919 |
+
'label' => '',
|
920 |
+
'type' => 'panel',
|
921 |
+
'class' => 'col-md-12',
|
922 |
+
'label_class' => '',
|
923 |
+
'after' => '',
|
924 |
+
),
|
925 |
+
array(
|
926 |
+
'label' => __('Height', WDCFM()->prefix),
|
927 |
+
'name' => 'IPHeight',
|
928 |
+
'type' => 'text',
|
929 |
+
'class' => '',
|
930 |
+
'value' => isset($param_values->IPHeight) ? $param_values->IPHeight : '',
|
931 |
+
'after' => 'px',
|
932 |
+
),
|
933 |
+
array(
|
934 |
+
'label' => __('Font Size', WDCFM()->prefix),
|
935 |
+
'name' => 'IPFontSize',
|
936 |
+
'type' => 'text',
|
937 |
+
'class' => '',
|
938 |
+
'value' => isset($param_values->IPFontSize) ? $param_values->IPFontSize : '',
|
939 |
+
'after' => 'px',
|
940 |
+
),
|
941 |
+
array(
|
942 |
+
'label' => __('Font Weight', WDCFM()->prefix),
|
943 |
+
'name' => 'IPFontWeight',
|
944 |
+
'type' => 'select',
|
945 |
+
'options' => $font_weights,
|
946 |
+
'class' => '',
|
947 |
+
'value' => isset($param_values->IPFontWeight) ? $param_values->IPFontWeight : '',
|
948 |
+
'after' => '',
|
949 |
+
),
|
950 |
+
array(
|
951 |
+
'label' => __('Background Color', WDCFM()->prefix),
|
952 |
+
'name' => 'IPBGColor',
|
953 |
+
'type' => 'text',
|
954 |
+
'class' => 'color',
|
955 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) .' #efefef',
|
956 |
+
'value' => isset($param_values->IPBGColor) ? $param_values->IPBGColor : '',
|
957 |
+
'after' => '',
|
958 |
+
),
|
959 |
+
array(
|
960 |
+
'label' => __('Color', WDCFM()->prefix),
|
961 |
+
'name' => 'IPColor',
|
962 |
+
'type' => 'text',
|
963 |
+
'class' => 'color',
|
964 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) .' #efefef',
|
965 |
+
'value' => isset($param_values->IPColor) ? $param_values->IPColor : '',
|
966 |
+
'after' => '',
|
967 |
+
),
|
968 |
+
array(
|
969 |
+
'label' => __('Padding', WDCFM()->prefix),
|
970 |
+
'name' => 'IPPadding',
|
971 |
+
'type' => 'text',
|
972 |
+
'class' => '',
|
973 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) .' 3px 5px or 3% 5%',
|
974 |
+
'value' => isset($param_values->IPPadding) ? $param_values->IPPadding : '',
|
975 |
+
'after' => '',
|
976 |
+
),
|
977 |
+
array(
|
978 |
+
'label' => __('Margin', WDCFM()->prefix),
|
979 |
+
'name' => 'IPMargin',
|
980 |
+
'type' => 'text',
|
981 |
+
'class' => '',
|
982 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) .' 5px 10px or 5% 10%',
|
983 |
+
'value' => isset($param_values->IPMargin) ? $param_values->IPMargin : '',
|
984 |
+
'after' => '',
|
985 |
+
),
|
986 |
+
array(
|
987 |
+
'label' => __('Border', WDCFM()->prefix),
|
988 |
+
'name' => 'IPBorder',
|
989 |
+
'type' => 'checkbox',
|
990 |
+
'options' => $borders,
|
991 |
+
'class' => '',
|
992 |
+
'after' => '',
|
993 |
+
),
|
994 |
+
array(
|
995 |
+
'label' => __('Border Color', WDCFM()->prefix),
|
996 |
+
'name' => 'IPBorderColor',
|
997 |
+
'type' => 'text',
|
998 |
+
'class' => 'color',
|
999 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) .' #efefef',
|
1000 |
+
'value' => isset($param_values->IPBorderColor) ? $param_values->IPBorderColor : '',
|
1001 |
+
'after' => '',
|
1002 |
+
),
|
1003 |
+
array(
|
1004 |
+
'label' => __('Border Type', WDCFM()->prefix),
|
1005 |
+
'name' => 'IPBorderType',
|
1006 |
+
'type' => 'select',
|
1007 |
+
'options' => $border_types,
|
1008 |
+
'class' => '',
|
1009 |
+
'value' => isset($param_values->IPBorderType) ? $param_values->IPBorderType : '',
|
1010 |
+
'after' => '',
|
1011 |
+
),
|
1012 |
+
array(
|
1013 |
+
'label' => __('Border Width', WDCFM()->prefix),
|
1014 |
+
'name' => 'IPBorderWidth',
|
1015 |
+
'type' => 'text',
|
1016 |
+
'class' => '',
|
1017 |
+
'value' => isset($param_values->IPBorderWidth) ? $param_values->IPBorderWidth : '',
|
1018 |
+
'after' => 'px',
|
1019 |
+
),
|
1020 |
+
array(
|
1021 |
+
'label' => __('Border Radius', WDCFM()->prefix),
|
1022 |
+
'name' => 'IPBorderRadius',
|
1023 |
+
'type' => 'text',
|
1024 |
+
'class' => '',
|
1025 |
+
'value' => isset($param_values->IPBorderRadius) ? $param_values->IPBorderRadius : '',
|
1026 |
+
'after' => 'px',
|
1027 |
+
),
|
1028 |
+
array(
|
1029 |
+
'label' => __('Box Shadow', WDCFM()->prefix),
|
1030 |
+
'name' => 'IPBoxShadow',
|
1031 |
+
'type' => 'text',
|
1032 |
+
'class' => '',
|
1033 |
+
'value' => isset($param_values->IPBoxShadow) ? $param_values->IPBoxShadow : '',
|
1034 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) .' 5px 5px 2px #888888',
|
1035 |
+
'after' => '</div>',
|
1036 |
+
),
|
1037 |
+
array(
|
1038 |
+
'label' => __('Dropdown additional', WDCFM()->prefix),
|
1039 |
+
'type' => 'panel',
|
1040 |
+
'class' => 'col-md-12',
|
1041 |
+
'label_class' => 'fm-mini-title',
|
1042 |
+
'after' => '<br/>',
|
1043 |
+
),
|
1044 |
+
array(
|
1045 |
+
'label' => __('Appearance', WDCFM()->prefix),
|
1046 |
+
'name' => 'SBPAppearance',
|
1047 |
+
'type' => 'text',
|
1048 |
+
'class' => '',
|
1049 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) .' normal, icon, window, button, menu, field',
|
1050 |
+
'value' => isset($param_values->SBPAppearance) ? $param_values->SBPAppearance : '',
|
1051 |
+
'after' => '',
|
1052 |
+
),
|
1053 |
+
array(
|
1054 |
+
'label' => __('Background URL', WDCFM()->prefix),
|
1055 |
+
'name' => 'SBPBackground',
|
1056 |
+
'type' => 'text',
|
1057 |
+
'class' => '',
|
1058 |
+
// 'placeholder' => __('e.g. http:// or https://', WDCFM()->prefix),
|
1059 |
+
'value' => isset($param_values->SBPBackground) ? $param_values->SBPBackground : '',
|
1060 |
+
'after' => '',
|
1061 |
+
),
|
1062 |
+
array(
|
1063 |
+
'label' => __('Background Repeat', WDCFM()->prefix),
|
1064 |
+
'name' => 'SBPBGRepeat',
|
1065 |
+
'type' => 'select',
|
1066 |
+
'options' => $bg_repeats,
|
1067 |
+
'class' => '',
|
1068 |
+
'value' => isset($param_values->SBPBGRepeat) ? $param_values->SBPBGRepeat : '',
|
1069 |
+
'after' => '',
|
1070 |
+
),
|
1071 |
+
array(
|
1072 |
+
'label' => '',
|
1073 |
+
'type' => 'label',
|
1074 |
+
'class' => '',
|
1075 |
+
'after' => '</div>',
|
1076 |
+
),
|
1077 |
+
),
|
1078 |
+
'choices' => array(
|
1079 |
+
array(
|
1080 |
+
'label' => __('Single Choice', WDCFM()->prefix),
|
1081 |
+
'type' => 'panel',
|
1082 |
+
'class' => 'col-md-12',
|
1083 |
+
'label_class' => 'fm-mini-title',
|
1084 |
+
'after' => '<br/>',
|
1085 |
+
),
|
1086 |
+
array(
|
1087 |
+
'label' => __('Background Color', WDCFM()->prefix),
|
1088 |
+
'name' => 'SCPBGColor',
|
1089 |
+
'type' => 'text',
|
1090 |
+
'class' => 'color',
|
1091 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) .' #efefef',
|
1092 |
+
'value' => isset($param_values->SCPBGColor) ? $param_values->SCPBGColor : '',
|
1093 |
+
'after' => '',
|
1094 |
+
),
|
1095 |
+
array(
|
1096 |
+
'label' => __('Width', WDCFM()->prefix),
|
1097 |
+
'name' => 'SCPWidth',
|
1098 |
+
'type' => 'text',
|
1099 |
+
'class' => '',
|
1100 |
+
'value' => isset($param_values->SCPWidth) ? $param_values->SCPWidth : '',
|
1101 |
+
'after' => 'px',
|
1102 |
+
),
|
1103 |
+
array(
|
1104 |
+
'label' => __('Height', WDCFM()->prefix),
|
1105 |
+
'name' => 'SCPHeight',
|
1106 |
+
'type' => 'text',
|
1107 |
+
'class' => '',
|
1108 |
+
'value' => isset($param_values->SCPHeight) ? $param_values->SCPHeight : '',
|
1109 |
+
'after' => 'px',
|
1110 |
+
),
|
1111 |
+
array(
|
1112 |
+
'label' => __('Margin', WDCFM()->prefix),
|
1113 |
+
'name' => 'SCPMargin',
|
1114 |
+
'type' => 'text',
|
1115 |
+
'class' => '5px',
|
1116 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) .' 5px 10px or 5% 10%',
|
1117 |
+
'value' => isset($param_values->SCPMargin) ? $param_values->SCPMargin : '',
|
1118 |
+
'after' => '',
|
1119 |
+
),
|
1120 |
+
array(
|
1121 |
+
'label' => __('Border', WDCFM()->prefix),
|
1122 |
+
'name' => 'SCPBorder',
|
1123 |
+
'type' => 'checkbox',
|
1124 |
+
'options' => $borders,
|
1125 |
+
'class' => '',
|
1126 |
+
'after' => '',
|
1127 |
+
),
|
1128 |
+
array(
|
1129 |
+
'label' => __('Border Color', WDCFM()->prefix),
|
1130 |
+
'name' => 'SCPBorderColor',
|
1131 |
+
'type' => 'text',
|
1132 |
+
'class' => 'color',
|
1133 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) .' #efefef',
|
1134 |
+
'value' => isset($param_values->SCPBorderColor) ? $param_values->SCPBorderColor : '',
|
1135 |
+
'after' => '',
|
1136 |
+
),
|
1137 |
+
array(
|
1138 |
+
'label' => __('Border Type', WDCFM()->prefix),
|
1139 |
+
'name' => 'SCPBorderType',
|
1140 |
+
'type' => 'select',
|
1141 |
+
'options' => $border_types,
|
1142 |
+
'class' => '',
|
1143 |
+
'value' => isset($param_values->SCPBorderType) ? $param_values->SCPBorderType : '',
|
1144 |
+
'after' => '',
|
1145 |
+
),
|
1146 |
+
array(
|
1147 |
+
'label' => __('Border Width', WDCFM()->prefix),
|
1148 |
+
'name' => 'SCPBorderWidth',
|
1149 |
+
'type' => 'text',
|
1150 |
+
'class' => '',
|
1151 |
+
'value' => isset($param_values->SCPBorderWidth) ? $param_values->SCPBorderWidth : '',
|
1152 |
+
'after' => 'px',
|
1153 |
+
),
|
1154 |
+
array(
|
1155 |
+
'label' => __('Border Radius', WDCFM()->prefix),
|
1156 |
+
'name' => 'SCPBorderRadius',
|
1157 |
+
'type' => 'text',
|
1158 |
+
'class' => '',
|
1159 |
+
'value' => isset($param_values->SCPBorderRadius) ? $param_values->SCPBorderRadius : '',
|
1160 |
+
'after' => 'px',
|
1161 |
+
),
|
1162 |
+
array(
|
1163 |
+
'label' => __('Box Shadow', WDCFM()->prefix),
|
1164 |
+
'name' => 'SCPBoxShadow',
|
1165 |
+
'type' => 'text',
|
1166 |
+
'class' => '',
|
1167 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) .' 5px 5px 2px #888888',
|
1168 |
+
'value' => isset($param_values->SCPBoxShadow) ? $param_values->SCPBoxShadow : '',
|
1169 |
+
'after' => '',
|
1170 |
+
),
|
1171 |
+
array(
|
1172 |
+
'label' => __('Checked Parameters', WDCFM()->prefix),
|
1173 |
+
'type' => 'label',
|
1174 |
+
'class' => 'fm-mini-title',
|
1175 |
+
'after' => '<br/>',
|
1176 |
+
),
|
1177 |
+
array(
|
1178 |
+
'label' => __('Background Color', WDCFM()->prefix),
|
1179 |
+
'name' => 'SCCPBGColor',
|
1180 |
+
'type' => 'text',
|
1181 |
+
'class' => 'color',
|
1182 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) .' #efefef',
|
1183 |
+
'value' => isset($param_values->SCCPBGColor) ? $param_values->SCCPBGColor : '',
|
1184 |
+
'after' => '',
|
1185 |
+
),
|
1186 |
+
array(
|
1187 |
+
'label' => __('Width', WDCFM()->prefix),
|
1188 |
+
'name' => 'SCCPWidth',
|
1189 |
+
'type' => 'text',
|
1190 |
+
'class' => '',
|
1191 |
+
'value' => isset($param_values->SCCPWidth) ? $param_values->SCCPWidth : '',
|
1192 |
+
'after' => 'px',
|
1193 |
+
),
|
1194 |
+
array(
|
1195 |
+
'label' => __('Height', WDCFM()->prefix),
|
1196 |
+
'name' => 'SCCPHeight',
|
1197 |
+
'type' => 'text',
|
1198 |
+
'class' => '',
|
1199 |
+
'value' => isset($param_values->SCCPHeight) ? $param_values->SCCPHeight : '',
|
1200 |
+
'after' => 'px',
|
1201 |
+
),
|
1202 |
+
array(
|
1203 |
+
'label' => __('Margin', WDCFM()->prefix),
|
1204 |
+
'name' => 'SCCPMargin',
|
1205 |
+
'type' => 'text',
|
1206 |
+
'class' => '',
|
1207 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) .' 5px 10px or 5% 10%',
|
1208 |
+
'value' => isset($param_values->SCCPMargin) ? $param_values->SCCPMargin : '',
|
1209 |
+
'after' => '',
|
1210 |
+
),
|
1211 |
+
array(
|
1212 |
+
'label' => __('Border Radius', WDCFM()->prefix),
|
1213 |
+
'name' => 'SCCPBorderRadius',
|
1214 |
+
'type' => 'text',
|
1215 |
+
'class' => '',
|
1216 |
+
'value' => isset($param_values->SCCPBorderRadius) ? $param_values->SCCPBorderRadius : '',
|
1217 |
+
'after' => 'px</div>',
|
1218 |
+
),
|
1219 |
+
array(
|
1220 |
+
'label' => __('Multiple Choice', WDCFM()->prefix),
|
1221 |
+
'type' => 'panel',
|
1222 |
+
'class' => 'col-md-12',
|
1223 |
+
'label_class' => 'fm-mini-title',
|
1224 |
+
'after' => '<br/>',
|
1225 |
+
),
|
1226 |
+
array(
|
1227 |
+
'label' => __('Background Color', WDCFM()->prefix),
|
1228 |
+
'name' => 'MCPBGColor',
|
1229 |
+
'type' => 'text',
|
1230 |
+
'class' => 'color',
|
1231 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) .' #efefef',
|
1232 |
+
'value' => isset($param_values->MCPBGColor) ? $param_values->MCPBGColor : '',
|
1233 |
+
'after' => '',
|
1234 |
+
),
|
1235 |
+
array(
|
1236 |
+
'label' => __('Width', WDCFM()->prefix),
|
1237 |
+
'name' => 'MCPWidth',
|
1238 |
+
'type' => 'text',
|
1239 |
+
'class' => '',
|
1240 |
+
'value' => isset($param_values->MCPWidth) ? $param_values->MCPWidth : '',
|
1241 |
+
'after' => 'px',
|
1242 |
+
),
|
1243 |
+
array(
|
1244 |
+
'label' => __('Height', WDCFM()->prefix),
|
1245 |
+
'name' => 'MCPHeight',
|
1246 |
+
'type' => 'text',
|
1247 |
+
'class' => '',
|
1248 |
+
'value' => isset($param_values->MCPHeight) ? $param_values->MCPHeight : '',
|
1249 |
+
'after' => 'px',
|
1250 |
+
),
|
1251 |
+
array(
|
1252 |
+
'label' => __('Margin', WDCFM()->prefix),
|
1253 |
+
'name' => 'MCPMargin',
|
1254 |
+
'type' => 'text',
|
1255 |
+
'class' => '5px',
|
1256 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) .' 5px 10px or 5% 10%',
|
1257 |
+
'value' => isset($param_values->MCPMargin) ? $param_values->MCPMargin : '',
|
1258 |
+
'after' => '',
|
1259 |
+
),
|
1260 |
+
array(
|
1261 |
+
'label' => __('Border', WDCFM()->prefix),
|
1262 |
+
'name' => 'MCPBorder',
|
1263 |
+
'type' => 'checkbox',
|
1264 |
+
'options' => $borders,
|
1265 |
+
'class' => '',
|
1266 |
+
'after' => '',
|
1267 |
+
),
|
1268 |
+
array(
|
1269 |
+
'label' => __('Border Color', WDCFM()->prefix),
|
1270 |
+
'name' => 'MCPBorderColor',
|
1271 |
+
'type' => 'text',
|
1272 |
+
'class' => 'color',
|
1273 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) .' #efefef',
|
1274 |
+
'value' => isset($param_values->MCPBorderColor) ? $param_values->MCPBorderColor : '',
|
1275 |
+
'after' => '',
|
1276 |
+
),
|
1277 |
+
array(
|
1278 |
+
'label' => __('Border Type', WDCFM()->prefix),
|
1279 |
+
'name' => 'MCPBorderType',
|
1280 |
+
'type' => 'select',
|
1281 |
+
'options' => $border_types,
|
1282 |
+
'class' => '',
|
1283 |
+
'value' => isset($param_values->MCPBorderType) ? $param_values->MCPBorderType : '',
|
1284 |
+
'after' => '',
|
1285 |
+
),
|
1286 |
+
array(
|
1287 |
+
'label' => __('Border Width', WDCFM()->prefix),
|
1288 |
+
'name' => 'MCPBorderWidth',
|
1289 |
+
'type' => 'text',
|
1290 |
+
'class' => '',
|
1291 |
+
'value' => isset($param_values->MCPBorderWidth) ? $param_values->MCPBorderWidth : '',
|
1292 |
+
'after' => 'px',
|
1293 |
+
),
|
1294 |
+
|
1295 |
+
array(
|
1296 |
+
'label' => __('Border Radius', WDCFM()->prefix),
|
1297 |
+
'name' => 'MCPBorderRadius',
|
1298 |
+
'type' => 'text',
|
1299 |
+
'class' => '',
|
1300 |
+
'value' => isset($param_values->MCPBorderRadius) ? $param_values->MCPBorderRadius : '',
|
1301 |
+
'after' => 'px',
|
1302 |
+
),
|
1303 |
+
array(
|
1304 |
+
'label' => __('Box Shadow', WDCFM()->prefix),
|
1305 |
+
'name' => 'MCPBoxShadow',
|
1306 |
+
'type' => 'text',
|
1307 |
+
'class' => '',
|
1308 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) .' 5px 5px 2px #888888',
|
1309 |
+
'value' => isset($param_values->MCPBoxShadow) ? $param_values->MCPBoxShadow : '',
|
1310 |
+
'after' => '',
|
1311 |
+
),
|
1312 |
+
array(
|
1313 |
+
'label' => __('Checked Parameters', WDCFM()->prefix),
|
1314 |
+
'type' => 'label',
|
1315 |
+
'class' => 'fm-mini-title',
|
1316 |
+
'after' => '<br/>',
|
1317 |
+
),
|
1318 |
+
array(
|
1319 |
+
'label' => __('Background Color', WDCFM()->prefix),
|
1320 |
+
'name' => 'MCCPBGColor',
|
1321 |
+
'type' => 'text',
|
1322 |
+
'class' => 'color',
|
1323 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) .'#efefef',
|
1324 |
+
'value' => isset($param_values->MCCPBGColor) ? $param_values->MCCPBGColor : '',
|
1325 |
+
'after' => '',
|
1326 |
+
),
|
1327 |
+
array(
|
1328 |
+
'label' => __('Background URL', WDCFM()->prefix),
|
1329 |
+
'name' => 'MCCPBackground',
|
1330 |
+
'type' => 'text',
|
1331 |
+
'class' => '',
|
1332 |
+
// 'placeholder' => __('e.g. http:// or https://', WDCFM()->prefix),
|
1333 |
+
'value' => isset($param_values->MCCPBackground) ? $param_values->MCCPBackground : '',
|
1334 |
+
'after' => '',
|
1335 |
+
),
|
1336 |
+
array(
|
1337 |
+
'label' => __('Background Repeat', WDCFM()->prefix),
|
1338 |
+
'name' => 'MCCPBGRepeat',
|
1339 |
+
'type' => 'select',
|
1340 |
+
'options' => $bg_repeats,
|
1341 |
+
'class' => '',
|
1342 |
+
'value' => isset($param_values->MCCPBGRepeat) ? $param_values->MCCPBGRepeat : '',
|
1343 |
+
'after' => '',
|
1344 |
+
),
|
1345 |
+
array(
|
1346 |
+
'label' => __('Background Position', WDCFM()->prefix),
|
1347 |
+
'name1' => 'MCCPBGPos1',
|
1348 |
+
'name2' => 'MCCPBGPos2',
|
1349 |
+
'type' => '2text',
|
1350 |
+
'class' => 'fm-2text',
|
1351 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' px|%, top|bottom|left|right|center',
|
1352 |
+
'value1' => isset($param_values->MCCPBGPos1) ? $param_values->MCCPBGPos1 : '',
|
1353 |
+
'value2' => isset($param_values->MCCPBGPos2) ? $param_values->MCCPBGPos2 : '',
|
1354 |
+
'before1' => '',
|
1355 |
+
'before2' => '',
|
1356 |
+
'after' => '',
|
1357 |
+
),
|
1358 |
+
array(
|
1359 |
+
'label' => __('Width', WDCFM()->prefix),
|
1360 |
+
'name' => 'MCCPWidth',
|
1361 |
+
'type' => 'text',
|
1362 |
+
'class' => '',
|
1363 |
+
'value' => isset($param_values->MCCPWidth) ? $param_values->MCCPWidth : '',
|
1364 |
+
'after' => 'px',
|
1365 |
+
),
|
1366 |
+
array(
|
1367 |
+
'label' => __('Height', WDCFM()->prefix),
|
1368 |
+
'name' => 'MCCPHeight',
|
1369 |
+
'type' => 'text',
|
1370 |
+
'class' => '',
|
1371 |
+
'value' => isset($param_values->MCCPHeight) ? $param_values->MCCPHeight : '',
|
1372 |
+
'after' => 'px',
|
1373 |
+
),
|
1374 |
+
array(
|
1375 |
+
'label' => __('Margin', WDCFM()->prefix),
|
1376 |
+
'name' => 'MCCPMargin',
|
1377 |
+
'type' => 'text',
|
1378 |
+
'class' => '',
|
1379 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' 5px 10px or 5% 10%',
|
1380 |
+
'value' => isset($param_values->MCCPMargin) ? $param_values->MCCPMargin : '',
|
1381 |
+
'after' => '',
|
1382 |
+
),
|
1383 |
+
array(
|
1384 |
+
'label' => __('Border Radius', WDCFM()->prefix),
|
1385 |
+
'name' => 'MCCPBorderRadius',
|
1386 |
+
'type' => 'text',
|
1387 |
+
'class' => '',
|
1388 |
+
'value' => isset($param_values->MCCPBorderRadius) ? $param_values->MCCPBorderRadius : '',
|
1389 |
+
'after' => 'px</div>',
|
1390 |
+
),
|
1391 |
+
),
|
1392 |
+
'subscribe' => array(
|
1393 |
+
array(
|
1394 |
+
'label' => __('Global Parameters', WDCFM()->prefix),
|
1395 |
+
'type' => 'panel',
|
1396 |
+
'class' => 'col-md-12',
|
1397 |
+
'label_class' => 'fm-mini-title',
|
1398 |
+
'after' => '<br/>',
|
1399 |
+
),
|
1400 |
+
array(
|
1401 |
+
'label' => __('Alignment', WDCFM()->prefix),
|
1402 |
+
'name' => 'SPAlign',
|
1403 |
+
'type' => 'select',
|
1404 |
+
'options' => $aligns,
|
1405 |
+
'class' => '',
|
1406 |
+
'value' => isset($param_values->SPAlign) ? $param_values->SPAlign : '',
|
1407 |
+
'after' => '</div>',
|
1408 |
+
),
|
1409 |
+
array(
|
1410 |
+
'label' => __('Submit', WDCFM()->prefix),
|
1411 |
+
'type' => 'panel',
|
1412 |
+
'class' => 'col-md-12',
|
1413 |
+
'label_class' => 'fm-mini-title',
|
1414 |
+
'after' => '<br/>',
|
1415 |
+
),
|
1416 |
+
array(
|
1417 |
+
'label' => __('Background Color', WDCFM()->prefix),
|
1418 |
+
'name' => 'SPBGColor',
|
1419 |
+
'type' => 'text',
|
1420 |
+
'class' => 'color',
|
1421 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
1422 |
+
'value' => isset($param_values->SPBGColor) ? $param_values->SPBGColor : '',
|
1423 |
+
'after' => '',
|
1424 |
+
),
|
1425 |
+
array(
|
1426 |
+
'label' => __('Width', WDCFM()->prefix),
|
1427 |
+
'name' => 'SPWidth',
|
1428 |
+
'type' => 'text',
|
1429 |
+
'class' => '',
|
1430 |
+
'value' => isset($param_values->SPWidth) ? $param_values->SPWidth : '',
|
1431 |
+
'after' => 'px',
|
1432 |
+
),
|
1433 |
+
array(
|
1434 |
+
'label' => __('Height', WDCFM()->prefix),
|
1435 |
+
'name' => 'SPHeight',
|
1436 |
+
'type' => 'text',
|
1437 |
+
'class' => '',
|
1438 |
+
'value' => isset($param_values->SPHeight) ? $param_values->SPHeight : '',
|
1439 |
+
'after' => 'px',
|
1440 |
+
),
|
1441 |
+
array(
|
1442 |
+
'label' => __('Font Size', WDCFM()->prefix),
|
1443 |
+
'name' => 'SPFontSize',
|
1444 |
+
'type' => 'text',
|
1445 |
+
'class' => '',
|
1446 |
+
'value' => isset($param_values->SPFontSize) ? $param_values->SPFontSize : '',
|
1447 |
+
'after' => 'px',
|
1448 |
+
),
|
1449 |
+
array(
|
1450 |
+
'label' => __('Font Weight', WDCFM()->prefix),
|
1451 |
+
'name' => 'SPFontWeight',
|
1452 |
+
'type' => 'select',
|
1453 |
+
'options' => $font_weights,
|
1454 |
+
'class' => '',
|
1455 |
+
'value' => isset($param_values->SPFontWeight) ? $param_values->SPFontWeight : '',
|
1456 |
+
'after' => '',
|
1457 |
+
),
|
1458 |
+
array(
|
1459 |
+
'label' => __('Color', WDCFM()->prefix),
|
1460 |
+
'name' => 'SPColor',
|
1461 |
+
'type' => 'text',
|
1462 |
+
'class' => 'color',
|
1463 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
1464 |
+
'value' => isset($param_values->SPColor) ? $param_values->SPColor : '',
|
1465 |
+
'after' => '',
|
1466 |
+
),
|
1467 |
+
array(
|
1468 |
+
'label' => __('Padding', WDCFM()->prefix),
|
1469 |
+
'name' => 'SPPadding',
|
1470 |
+
'type' => 'text',
|
1471 |
+
'class' => '',
|
1472 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' 3px 5px or 3% 5%',
|
1473 |
+
'value' => isset($param_values->SPPadding) ? $param_values->SPPadding : '',
|
1474 |
+
'after' => '',
|
1475 |
+
),
|
1476 |
+
array(
|
1477 |
+
'label' => __('Margin', WDCFM()->prefix),
|
1478 |
+
'name' => 'SPMargin',
|
1479 |
+
'type' => 'text',
|
1480 |
+
'class' => '',
|
1481 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' 5px 10px or 5% 10%',
|
1482 |
+
'value' => isset($param_values->SPMargin) ? $param_values->SPMargin : '',
|
1483 |
+
'after' => '',
|
1484 |
+
),
|
1485 |
+
array(
|
1486 |
+
'label' => __('Border', WDCFM()->prefix),
|
1487 |
+
'name' => 'SPBorder',
|
1488 |
+
'type' => 'checkbox',
|
1489 |
+
'options' => $borders,
|
1490 |
+
'class' => '',
|
1491 |
+
'after' => '',
|
1492 |
+
),
|
1493 |
+
array(
|
1494 |
+
'label' => __('Border Color', WDCFM()->prefix),
|
1495 |
+
'name' => 'SPBorderColor',
|
1496 |
+
'type' => 'text',
|
1497 |
+
'class' => 'color',
|
1498 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
1499 |
+
'value' => isset($param_values->SPBorderColor) ? $param_values->SPBorderColor : '',
|
1500 |
+
'after' => '',
|
1501 |
+
),
|
1502 |
+
array(
|
1503 |
+
'label' => __('Border Type', WDCFM()->prefix),
|
1504 |
+
'name' => 'SPBorderType',
|
1505 |
+
'type' => 'select',
|
1506 |
+
'options' => $border_types,
|
1507 |
+
'class' => '',
|
1508 |
+
'value' => isset($param_values->SPBorderType) ? $param_values->SPBorderType : '',
|
1509 |
+
'after' => '',
|
1510 |
+
),
|
1511 |
+
array(
|
1512 |
+
'label' => __('Border Width', WDCFM()->prefix),
|
1513 |
+
'name' => 'SPBorderWidth',
|
1514 |
+
'type' => 'text',
|
1515 |
+
'class' => '',
|
1516 |
+
'value' => isset($param_values->SPBorderWidth) ? $param_values->SPBorderWidth : '',
|
1517 |
+
'after' => 'px',
|
1518 |
+
),
|
1519 |
+
array(
|
1520 |
+
'label' => __('Border Radius', WDCFM()->prefix),
|
1521 |
+
'name' => 'SPBorderRadius',
|
1522 |
+
'type' => 'text',
|
1523 |
+
'class' => '',
|
1524 |
+
'value' => isset($param_values->SPBorderRadius) ? $param_values->SPBorderRadius : '',
|
1525 |
+
'after' => 'px',
|
1526 |
+
),
|
1527 |
+
array(
|
1528 |
+
'label' => __('Box Shadow', WDCFM()->prefix),
|
1529 |
+
'name' => 'SPBoxShadow',
|
1530 |
+
'type' => 'text',
|
1531 |
+
'class' => '',
|
1532 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' 5px 5px 2px #888888',
|
1533 |
+
'value' => isset($param_values->SPBoxShadow) ? $param_values->SPBoxShadow : '',
|
1534 |
+
'after' => '',
|
1535 |
+
),
|
1536 |
+
array(
|
1537 |
+
'label' => __('Hover Parameters', WDCFM()->prefix),
|
1538 |
+
'type' => 'label',
|
1539 |
+
'class' => 'fm-mini-title',
|
1540 |
+
'after' => '<br/>',
|
1541 |
+
),
|
1542 |
+
array(
|
1543 |
+
'label' => __('Background Color', WDCFM()->prefix),
|
1544 |
+
'name' => 'SHPBGColor',
|
1545 |
+
'type' => 'text',
|
1546 |
+
'class' => 'color',
|
1547 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
1548 |
+
'value' => isset($param_values->SHPBGColor) ? $param_values->SHPBGColor : '',
|
1549 |
+
'after' => '',
|
1550 |
+
),
|
1551 |
+
array(
|
1552 |
+
'label' => __('Color', WDCFM()->prefix),
|
1553 |
+
'name' => 'SHPColor',
|
1554 |
+
'type' => 'text',
|
1555 |
+
'class' => 'color',
|
1556 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
1557 |
+
'value' => isset($param_values->SHPColor) ? $param_values->SHPColor : '',
|
1558 |
+
'after' => '',
|
1559 |
+
),
|
1560 |
+
array(
|
1561 |
+
'label' => __('Border', WDCFM()->prefix),
|
1562 |
+
'name' => 'SHPBorder',
|
1563 |
+
'type' => 'checkbox',
|
1564 |
+
'options' => $borders,
|
1565 |
+
'class' => '',
|
1566 |
+
'after' => '',
|
1567 |
+
),
|
1568 |
+
array(
|
1569 |
+
'label' => __('Border Color', WDCFM()->prefix),
|
1570 |
+
'name' => 'SHPBorderColor',
|
1571 |
+
'type' => 'text',
|
1572 |
+
'class' => 'color',
|
1573 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
1574 |
+
'value' => isset($param_values->SHPBorderColor) ? $param_values->SHPBorderColor : '',
|
1575 |
+
'after' => '',
|
1576 |
+
),
|
1577 |
+
array(
|
1578 |
+
'label' => __('Border Type', WDCFM()->prefix),
|
1579 |
+
'name' => 'SHPBorderType',
|
1580 |
+
'type' => 'select',
|
1581 |
+
'options' => $border_types,
|
1582 |
+
'class' => '',
|
1583 |
+
'value' => isset($param_values->SHPBorderType) ? $param_values->SHPBorderType : '',
|
1584 |
+
'after' => '',
|
1585 |
+
),
|
1586 |
+
array(
|
1587 |
+
'label' => __('Border Width', WDCFM()->prefix),
|
1588 |
+
'name' => 'SHPBorderWidth',
|
1589 |
+
'type' => 'text',
|
1590 |
+
'class' => '',
|
1591 |
+
'value' => isset($param_values->SHPBorderWidth) ? $param_values->SHPBorderWidth : '',
|
1592 |
+
'after' => 'px</div>',
|
1593 |
+
),
|
1594 |
+
array(
|
1595 |
+
'label' => __('Reset', WDCFM()->prefix),
|
1596 |
+
'type' => 'panel',
|
1597 |
+
'class' => 'col-md-12',
|
1598 |
+
'label_class' => 'fm-mini-title',
|
1599 |
+
'after' => '<br/>',
|
1600 |
+
),
|
1601 |
+
array(
|
1602 |
+
'label' => __('Background Color', WDCFM()->prefix),
|
1603 |
+
'name' => 'BPBGColor',
|
1604 |
+
'type' => 'text',
|
1605 |
+
'class' => 'color',
|
1606 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
1607 |
+
'value' => isset($param_values->BPBGColor) ? $param_values->BPBGColor : '',
|
1608 |
+
'after' => '',
|
1609 |
+
),
|
1610 |
+
array(
|
1611 |
+
'label' => __('Width', WDCFM()->prefix),
|
1612 |
+
'name' => 'BPWidth',
|
1613 |
+
'type' => 'text',
|
1614 |
+
'class' => '',
|
1615 |
+
'value' => isset($param_values->BPWidth) ? $param_values->BPWidth : '',
|
1616 |
+
'after' => 'px',
|
1617 |
+
),
|
1618 |
+
array(
|
1619 |
+
'label' => __('Height', WDCFM()->prefix),
|
1620 |
+
'name' => 'BPHeight',
|
1621 |
+
'type' => 'text',
|
1622 |
+
'class' => '',
|
1623 |
+
'value' => isset($param_values->BPHeight) ? $param_values->BPHeight : '',
|
1624 |
+
'after' => 'px',
|
1625 |
+
),
|
1626 |
+
array(
|
1627 |
+
'label' => __('Font Size', WDCFM()->prefix),
|
1628 |
+
'name' => 'BPFontSize',
|
1629 |
+
'type' => 'text',
|
1630 |
+
'class' => '',
|
1631 |
+
'value' => isset($param_values->BPFontSize) ? $param_values->BPFontSize : '',
|
1632 |
+
'after' => 'px',
|
1633 |
+
),
|
1634 |
+
array(
|
1635 |
+
'label' => __('Font Weight', WDCFM()->prefix),
|
1636 |
+
'name' => 'BPFontWeight',
|
1637 |
+
'type' => 'select',
|
1638 |
+
'options' => $font_weights,
|
1639 |
+
'class' => '',
|
1640 |
+
'value' => isset($param_values->BPFontWeight) ? $param_values->BPFontWeight : '',
|
1641 |
+
'after' => '',
|
1642 |
+
),
|
1643 |
+
array(
|
1644 |
+
'label' => __('Color', WDCFM()->prefix),
|
1645 |
+
'name' => 'BPColor',
|
1646 |
+
'type' => 'text',
|
1647 |
+
'class' => 'color',
|
1648 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
1649 |
+
'value' => isset($param_values->BPColor) ? $param_values->BPColor : '',
|
1650 |
+
'after' => '',
|
1651 |
+
),
|
1652 |
+
array(
|
1653 |
+
'label' => __('Padding', WDCFM()->prefix),
|
1654 |
+
'name' => 'BPPadding',
|
1655 |
+
'type' => 'text',
|
1656 |
+
'class' => '',
|
1657 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' 3px 5xp or 3% 5%',
|
1658 |
+
'value' => isset($param_values->BPPadding) ? $param_values->BPPadding : '',
|
1659 |
+
'after' => '',
|
1660 |
+
),
|
1661 |
+
array(
|
1662 |
+
'label' => __('Margin', WDCFM()->prefix),
|
1663 |
+
'name' => 'BPMargin',
|
1664 |
+
'type' => 'text',
|
1665 |
+
'class' => '',
|
1666 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' 5px 10xp or 5% 10%',
|
1667 |
+
'value' => isset($param_values->BPMargin) ? $param_values->BPMargin : '',
|
1668 |
+
'after' => '',
|
1669 |
+
),
|
1670 |
+
array(
|
1671 |
+
'label' => __('Border', WDCFM()->prefix),
|
1672 |
+
'name' => 'BPBorder',
|
1673 |
+
'type' => 'checkbox',
|
1674 |
+
'options' => $borders,
|
1675 |
+
'class' => '',
|
1676 |
+
'after' => '',
|
1677 |
+
),
|
1678 |
+
array(
|
1679 |
+
'label' => __('Border Color', WDCFM()->prefix),
|
1680 |
+
'name' => 'BPBorderColor',
|
1681 |
+
'type' => 'text',
|
1682 |
+
'class' => 'color',
|
1683 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
1684 |
+
'value' => isset($param_values->BPBorderColor) ? $param_values->BPBorderColor : '',
|
1685 |
+
'after' => '',
|
1686 |
+
),
|
1687 |
+
array(
|
1688 |
+
'label' => __('Border Type', WDCFM()->prefix),
|
1689 |
+
'name' => 'BPBorderType',
|
1690 |
+
'type' => 'select',
|
1691 |
+
'options' => $border_types,
|
1692 |
+
'class' => '',
|
1693 |
+
'value' => isset($param_values->BPBorderType) ? $param_values->BPBorderType : '',
|
1694 |
+
'after' => '',
|
1695 |
+
),
|
1696 |
+
array(
|
1697 |
+
'label' => __('Border Width', WDCFM()->prefix),
|
1698 |
+
'name' => 'BPBorderWidth',
|
1699 |
+
'type' => 'text',
|
1700 |
+
'class' => '',
|
1701 |
+
'value' => isset($param_values->BPBorderWidth) ? $param_values->BPBorderWidth : '',
|
1702 |
+
'after' => 'px',
|
1703 |
+
),
|
1704 |
+
array(
|
1705 |
+
'label' => __('Border Radius', WDCFM()->prefix),
|
1706 |
+
'name' => 'BPBorderRadius',
|
1707 |
+
'type' => 'text',
|
1708 |
+
'class' => '',
|
1709 |
+
'value' => isset($param_values->BPBorderRadius) ? $param_values->BPBorderRadius : '',
|
1710 |
+
'after' => 'px',
|
1711 |
+
),
|
1712 |
+
array(
|
1713 |
+
'label' => __('Box Shadow', WDCFM()->prefix),
|
1714 |
+
'name' => 'BPBoxShadow',
|
1715 |
+
'type' => 'text',
|
1716 |
+
'class' => '',
|
1717 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' 5px 5px 2px #888888',
|
1718 |
+
'value' => isset($param_values->BPBoxShadow) ? $param_values->BPBoxShadow : '',
|
1719 |
+
'after' => '',
|
1720 |
+
),
|
1721 |
+
array(
|
1722 |
+
'label' => __('Hover Parameters', WDCFM()->prefix),
|
1723 |
+
'type' => 'label',
|
1724 |
+
'class' => 'fm-mini-title',
|
1725 |
+
'after' => '<br/>',
|
1726 |
+
),
|
1727 |
+
array(
|
1728 |
+
'label' => __('Background Color', WDCFM()->prefix),
|
1729 |
+
'name' => 'BHPBGColor',
|
1730 |
+
'type' => 'text',
|
1731 |
+
'class' => 'color',
|
1732 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
1733 |
+
'value' => isset($param_values->BHPBGColor) ? $param_values->BHPBGColor : '',
|
1734 |
+
'after' => '',
|
1735 |
+
),
|
1736 |
+
array(
|
1737 |
+
'label' => __('Color', WDCFM()->prefix),
|
1738 |
+
'name' => 'BHPColor',
|
1739 |
+
'type' => 'text',
|
1740 |
+
'class' => 'color',
|
1741 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
1742 |
+
'value' => isset($param_values->BHPColor) ? $param_values->BHPColor : '',
|
1743 |
+
'after' => '',
|
1744 |
+
),
|
1745 |
+
array(
|
1746 |
+
'label' => __('Border', WDCFM()->prefix),
|
1747 |
+
'name' => 'BHPBorder',
|
1748 |
+
'type' => 'checkbox',
|
1749 |
+
'options' => $borders,
|
1750 |
+
'class' => '',
|
1751 |
+
'after' => '',
|
1752 |
+
),
|
1753 |
+
array(
|
1754 |
+
'label' => __('Border Color', WDCFM()->prefix),
|
1755 |
+
'name' => 'BHPBorderColor',
|
1756 |
+
'type' => 'text',
|
1757 |
+
'class' => 'color',
|
1758 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
1759 |
+
'value' => isset($param_values->BHPBorderColor) ? $param_values->BHPBorderColor : '',
|
1760 |
+
'after' => '',
|
1761 |
+
),
|
1762 |
+
array(
|
1763 |
+
'label' => __('Border Type', WDCFM()->prefix),
|
1764 |
+
'name' => 'BHPBorderType',
|
1765 |
+
'type' => 'select',
|
1766 |
+
'options' => $border_types,
|
1767 |
+
'class' => '',
|
1768 |
+
'value' => isset($param_values->BHPBorderType) ? $param_values->BHPBorderType : '',
|
1769 |
+
'after' => '',
|
1770 |
+
),
|
1771 |
+
array(
|
1772 |
+
'label' => __('Border Width', WDCFM()->prefix),
|
1773 |
+
'name' => 'BHPBorderWidth',
|
1774 |
+
'type' => 'text',
|
1775 |
+
'class' => '',
|
1776 |
+
'value' => isset($param_values->BHPBorderWidth) ? $param_values->BHPBorderWidth : '',
|
1777 |
+
'after' => 'px</div>',
|
1778 |
+
),
|
1779 |
+
),
|
1780 |
+
'paigination' => array(
|
1781 |
+
array(
|
1782 |
+
'label' => __('Active', WDCFM()->prefix),
|
1783 |
+
'type' => 'panel',
|
1784 |
+
'class' => 'col-md-12',
|
1785 |
+
'label_class' => 'fm-mini-title',
|
1786 |
+
'after' => '',
|
1787 |
+
),
|
1788 |
+
array(
|
1789 |
+
'label' => __('Background Color', WDCFM()->prefix),
|
1790 |
+
'name' => 'PSAPBGColor',
|
1791 |
+
'type' => 'text',
|
1792 |
+
'class' => 'color',
|
1793 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
1794 |
+
'value' => isset($param_values->PSAPBGColor) ? $param_values->PSAPBGColor : '',
|
1795 |
+
'after' => '',
|
1796 |
+
),
|
1797 |
+
array(
|
1798 |
+
'label' => __('Font Size', WDCFM()->prefix),
|
1799 |
+
'name' => 'PSAPFontSize',
|
1800 |
+
'type' => 'text',
|
1801 |
+
'class' => '',
|
1802 |
+
'value' => isset($param_values->PSAPFontSize) ? $param_values->PSAPFontSize : '',
|
1803 |
+
'after' => 'px',
|
1804 |
+
),
|
1805 |
+
array(
|
1806 |
+
'label' => __('Font Weight', WDCFM()->prefix),
|
1807 |
+
'name' => 'PSAPFontWeight',
|
1808 |
+
'type' => 'select',
|
1809 |
+
'options' => $font_weights,
|
1810 |
+
'class' => '',
|
1811 |
+
'value' => isset($param_values->PSAPFontWeight) ? $param_values->PSAPFontWeight : '',
|
1812 |
+
'after' => '',
|
1813 |
+
),
|
1814 |
+
array(
|
1815 |
+
'label' => __('Color', WDCFM()->prefix),
|
1816 |
+
'name' => 'PSAPColor',
|
1817 |
+
'type' => 'text',
|
1818 |
+
'class' => 'color',
|
1819 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
1820 |
+
'value' => isset($param_values->PSAPColor) ? $param_values->PSAPColor : '',
|
1821 |
+
'after' => '',
|
1822 |
+
),
|
1823 |
+
array(
|
1824 |
+
'label' => __('Height', WDCFM()->prefix),
|
1825 |
+
'name' => 'PSAPHeight',
|
1826 |
+
'type' => 'text',
|
1827 |
+
'class' => '',
|
1828 |
+
'value' => isset($param_values->PSAPHeight) ? $param_values->PSAPHeight : '',
|
1829 |
+
'after' => 'px',
|
1830 |
+
),
|
1831 |
+
array(
|
1832 |
+
'label' => __('Line Height', WDCFM()->prefix),
|
1833 |
+
'name' => 'PSAPLineHeight',
|
1834 |
+
'type' => 'text',
|
1835 |
+
'class' => '',
|
1836 |
+
'value' => isset($param_values->PSAPLineHeight) ? $param_values->PSAPLineHeight : '',
|
1837 |
+
'after' => 'px',
|
1838 |
+
),
|
1839 |
+
array(
|
1840 |
+
'label' => __('Padding', WDCFM()->prefix),
|
1841 |
+
'name' => 'PSAPPadding',
|
1842 |
+
'type' => 'text',
|
1843 |
+
'class' => '',
|
1844 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' 3px 5px or 3% 5%',
|
1845 |
+
'value' => isset($param_values->PSAPPadding) ? $param_values->PSAPPadding : '',
|
1846 |
+
'after' => '',
|
1847 |
+
),
|
1848 |
+
array(
|
1849 |
+
'label' => __('Margin', WDCFM()->prefix),
|
1850 |
+
'name' => 'PSAPMargin',
|
1851 |
+
'type' => 'text',
|
1852 |
+
'class' => '',
|
1853 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' 5px 10px or 5% 10%',
|
1854 |
+
'value' => isset($param_values->PSAPMargin) ? $param_values->PSAPMargin : '',
|
1855 |
+
'after' => '',
|
1856 |
+
),
|
1857 |
+
array(
|
1858 |
+
'label' => __('Border', WDCFM()->prefix),
|
1859 |
+
'name' => 'PSAPBorder',
|
1860 |
+
'type' => 'checkbox',
|
1861 |
+
'options' => $borders,
|
1862 |
+
'class' => '',
|
1863 |
+
'after' => '',
|
1864 |
+
),
|
1865 |
+
array(
|
1866 |
+
'label' => __('Border Color', WDCFM()->prefix),
|
1867 |
+
'name' => 'PSAPBorderColor',
|
1868 |
+
'type' => 'text',
|
1869 |
+
'class' => 'color',
|
1870 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
1871 |
+
'value' => isset($param_values->PSAPBorderColor) ? $param_values->PSAPBorderColor : '',
|
1872 |
+
'after' => '',
|
1873 |
+
),
|
1874 |
+
array(
|
1875 |
+
'label' => __('Border Type', WDCFM()->prefix),
|
1876 |
+
'name' => 'PSAPBorderType',
|
1877 |
+
'type' => 'select',
|
1878 |
+
'options' => $border_types,
|
1879 |
+
'class' => '',
|
1880 |
+
'value' => isset($param_values->PSAPBorderType) ? $param_values->PSAPBorderType : '',
|
1881 |
+
'after' => '',
|
1882 |
+
),
|
1883 |
+
array(
|
1884 |
+
'label' => __('Border Width', WDCFM()->prefix),
|
1885 |
+
'name' => 'PSAPBorderWidth',
|
1886 |
+
'type' => 'text',
|
1887 |
+
'class' => '',
|
1888 |
+
'value' => isset($param_values->PSAPBorderWidth) ? $param_values->PSAPBorderWidth : '',
|
1889 |
+
'after' => 'px',
|
1890 |
+
),
|
1891 |
+
array(
|
1892 |
+
'label' => __('Border Radius', WDCFM()->prefix),
|
1893 |
+
'name' => 'PSAPBorderRadius',
|
1894 |
+
'type' => 'text',
|
1895 |
+
'class' => '',
|
1896 |
+
'value' => isset($param_values->PSAPBorderRadius) ? $param_values->PSAPBorderRadius : '',
|
1897 |
+
'after' => 'px</div>',
|
1898 |
+
),
|
1899 |
+
array(
|
1900 |
+
'label' => __('Inactive', WDCFM()->prefix),
|
1901 |
+
'type' => 'panel',
|
1902 |
+
'class' => 'col-md-12',
|
1903 |
+
'label_class' => 'fm-mini-title',
|
1904 |
+
'after' => '',
|
1905 |
+
),
|
1906 |
+
array(
|
1907 |
+
'label' => __('Background Color', WDCFM()->prefix),
|
1908 |
+
'name' => 'PSDPBGColor',
|
1909 |
+
'type' => 'text',
|
1910 |
+
'class' => 'color',
|
1911 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
1912 |
+
'value' => isset($param_values->PSDPBGColor) ? $param_values->PSDPBGColor : '',
|
1913 |
+
'after' => '',
|
1914 |
+
),
|
1915 |
+
array(
|
1916 |
+
'label' => __('Font Size', WDCFM()->prefix),
|
1917 |
+
'name' => 'PSDPFontSize',
|
1918 |
+
'type' => 'text',
|
1919 |
+
'class' => '',
|
1920 |
+
'value' => isset($param_values->PSDPFontSize) ? $param_values->PSDPFontSize : '',
|
1921 |
+
'after' => 'px',
|
1922 |
+
),
|
1923 |
+
array(
|
1924 |
+
'label' => __('Font Weight', WDCFM()->prefix),
|
1925 |
+
'name' => 'PSDPFontWeight',
|
1926 |
+
'type' => 'select',
|
1927 |
+
'options' => $font_weights,
|
1928 |
+
'class' => '',
|
1929 |
+
'value' => isset($param_values->PSDPFontWeight) ? $param_values->PSDPFontWeight : '',
|
1930 |
+
'after' => '',
|
1931 |
+
),
|
1932 |
+
array(
|
1933 |
+
'label' => __('Color', WDCFM()->prefix),
|
1934 |
+
'name' => 'PSDPColor',
|
1935 |
+
'type' => 'text',
|
1936 |
+
'class' => 'color',
|
1937 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
1938 |
+
'value' => isset($param_values->PSDPColor) ? $param_values->PSDPColor : '',
|
1939 |
+
'after' => '',
|
1940 |
+
),
|
1941 |
+
array(
|
1942 |
+
'label' => __('Height', WDCFM()->prefix),
|
1943 |
+
'name' => 'PSDPHeight',
|
1944 |
+
'type' => 'text',
|
1945 |
+
'class' => '',
|
1946 |
+
'value' => isset($param_values->PSDPHeight) ? $param_values->PSDPHeight : '',
|
1947 |
+
'after' => 'px',
|
1948 |
+
),
|
1949 |
+
array(
|
1950 |
+
'label' => __('Line Height', WDCFM()->prefix),
|
1951 |
+
'name' => 'PSDPLineHeight',
|
1952 |
+
'type' => 'text',
|
1953 |
+
'class' => '',
|
1954 |
+
'value' => isset($param_values->PSDPLineHeight) ? $param_values->PSDPLineHeight : '',
|
1955 |
+
'after' => 'px',
|
1956 |
+
),
|
1957 |
+
array(
|
1958 |
+
'label' => __('Padding', WDCFM()->prefix),
|
1959 |
+
'name' => 'PSDPPadding',
|
1960 |
+
'type' => 'text',
|
1961 |
+
'class' => '',
|
1962 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' 3px 5px or 3% 5%',
|
1963 |
+
'value' => isset($param_values->PSDPPadding) ? $param_values->PSDPPadding : '',
|
1964 |
+
'after' => '',
|
1965 |
+
),
|
1966 |
+
array(
|
1967 |
+
'label' => __('Margin', WDCFM()->prefix),
|
1968 |
+
'name' => 'PSDPMargin',
|
1969 |
+
'type' => 'text',
|
1970 |
+
'class' => '',
|
1971 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' 5px 10px or 5% 10%',
|
1972 |
+
'value' => isset($param_values->PSDPMargin) ? $param_values->PSDPMargin : '',
|
1973 |
+
'after' => '',
|
1974 |
+
),
|
1975 |
+
array(
|
1976 |
+
'label' => __('Border', WDCFM()->prefix),
|
1977 |
+
'name' => 'PSDPBorder',
|
1978 |
+
'type' => 'checkbox',
|
1979 |
+
'options' => $borders,
|
1980 |
+
'class' => '',
|
1981 |
+
'after' => '',
|
1982 |
+
),
|
1983 |
+
array(
|
1984 |
+
'label' => __('Border Color', WDCFM()->prefix),
|
1985 |
+
'name' => 'PSDPBorderColor',
|
1986 |
+
'type' => 'text',
|
1987 |
+
'class' => 'color',
|
1988 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
1989 |
+
'value' => isset($param_values->PSDPBorderColor) ? $param_values->PSDPBorderColor : '',
|
1990 |
+
'after' => '',
|
1991 |
+
),
|
1992 |
+
array(
|
1993 |
+
'label' => __('Border Type', WDCFM()->prefix),
|
1994 |
+
'name' => 'PSDPBorderType',
|
1995 |
+
'type' => 'select',
|
1996 |
+
'options' => $border_types,
|
1997 |
+
'class' => '',
|
1998 |
+
'value' => isset($param_values->PSDPBorderType) ? $param_values->PSDPBorderType : '',
|
1999 |
+
'after' => '',
|
2000 |
+
),
|
2001 |
+
array(
|
2002 |
+
'label' => __('Border Width', WDCFM()->prefix),
|
2003 |
+
'name' => 'PSDPBorderWidth',
|
2004 |
+
'type' => 'text',
|
2005 |
+
'class' => '',
|
2006 |
+
'value' => isset($param_values->PSDPBorderWidth) ? $param_values->PSDPBorderWidth : '',
|
2007 |
+
'after' => 'px',
|
2008 |
+
),
|
2009 |
+
array(
|
2010 |
+
'label' => __('Border Radius', WDCFM()->prefix),
|
2011 |
+
'name' => 'PSDPBorderRadius',
|
2012 |
+
'type' => 'text',
|
2013 |
+
'class' => '',
|
2014 |
+
'value' => isset($param_values->PSDPBorderRadius) ? $param_values->PSDPBorderRadius : '',
|
2015 |
+
'after' => 'px</div>',
|
2016 |
+
),
|
2017 |
+
array(
|
2018 |
+
'label' => __('Steps', WDCFM()->prefix),
|
2019 |
+
'type' => 'panel',
|
2020 |
+
'class' => 'col-md-12',
|
2021 |
+
'label_class' => 'fm-mini-title',
|
2022 |
+
'after' => '',
|
2023 |
+
),
|
2024 |
+
array(
|
2025 |
+
'label' => __('Alignment', WDCFM()->prefix),
|
2026 |
+
'name' => 'PSAPAlign',
|
2027 |
+
'type' => 'select',
|
2028 |
+
'options' => $aligns,
|
2029 |
+
'class' => '',
|
2030 |
+
'value' => isset($param_values->PSAPAlign) ? $param_values->PSAPAlign : '',
|
2031 |
+
'after' => '',
|
2032 |
+
),
|
2033 |
+
array(
|
2034 |
+
'label' => __('Width', WDCFM()->prefix),
|
2035 |
+
'name' => 'PSAPWidth',
|
2036 |
+
'type' => 'text',
|
2037 |
+
'class' => '',
|
2038 |
+
'value' => isset($param_values->PSAPWidth) ? $param_values->PSAPWidth : '',
|
2039 |
+
'after' => 'px</div>',
|
2040 |
+
),
|
2041 |
+
array(
|
2042 |
+
'label' => __('Percentage', WDCFM()->prefix),
|
2043 |
+
'type' => 'panel',
|
2044 |
+
'class' => 'col-md-12',
|
2045 |
+
'label_class' => 'fm-mini-title',
|
2046 |
+
'after' => '',
|
2047 |
+
),
|
2048 |
+
array(
|
2049 |
+
'label' => __('Width', WDCFM()->prefix),
|
2050 |
+
'name' => 'PPAPWidth',
|
2051 |
+
'type' => 'text',
|
2052 |
+
'class' => '',
|
2053 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' 500px or 50%',
|
2054 |
+
'value' => isset($param_values->PPAPWidth) ? $param_values->PPAPWidth : '',
|
2055 |
+
'after' => '</div>',
|
2056 |
+
),
|
2057 |
+
),
|
2058 |
+
'buttons' => array(
|
2059 |
+
array(
|
2060 |
+
'label' => __('Global Parameters', WDCFM()->prefix),
|
2061 |
+
'type' => 'panel',
|
2062 |
+
'class' => 'col-md-12',
|
2063 |
+
'label_class' => 'fm-mini-title',
|
2064 |
+
'after' => '<br/>',
|
2065 |
+
),
|
2066 |
+
array(
|
2067 |
+
'label' => __('Font Size', WDCFM()->prefix),
|
2068 |
+
'name' => 'BPFontSize',
|
2069 |
+
'type' => 'text',
|
2070 |
+
'class' => '',
|
2071 |
+
'value' => isset($param_values->BPFontSize) ? $param_values->BPFontSize : '',
|
2072 |
+
'after' => 'px',
|
2073 |
+
),
|
2074 |
+
array(
|
2075 |
+
'label' => __('Font Weight', WDCFM()->prefix),
|
2076 |
+
'name' => 'BPFontWeight',
|
2077 |
+
'type' => 'select',
|
2078 |
+
'options' => $font_weights,
|
2079 |
+
'class' => '',
|
2080 |
+
'value' => isset($param_values->BPFontWeight) ? $param_values->BPFontWeight : '',
|
2081 |
+
'after' => '</div>',
|
2082 |
+
),
|
2083 |
+
array(
|
2084 |
+
'label' => __('Next Button Parameters', WDCFM()->prefix),
|
2085 |
+
'type' => 'panel',
|
2086 |
+
'class' => 'col-md-12',
|
2087 |
+
'label_class' => 'fm-mini-title',
|
2088 |
+
'after' => '<br/>',
|
2089 |
+
),
|
2090 |
+
array(
|
2091 |
+
'label' => __('Background Color', WDCFM()->prefix),
|
2092 |
+
'name' => 'NBPBGColor',
|
2093 |
+
'type' => 'text',
|
2094 |
+
'class' => 'color',
|
2095 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
2096 |
+
'value' => isset($param_values->NBPBGColor) ? $param_values->NBPBGColor : '',
|
2097 |
+
'after' => '',
|
2098 |
+
),
|
2099 |
+
array(
|
2100 |
+
'label' => __('Width', WDCFM()->prefix),
|
2101 |
+
'name' => 'NBPWidth',
|
2102 |
+
'type' => 'text',
|
2103 |
+
'class' => '',
|
2104 |
+
'value' => isset($param_values->NBPWidth) ? $param_values->NBPWidth : '',
|
2105 |
+
'after' => 'px',
|
2106 |
+
),
|
2107 |
+
array(
|
2108 |
+
'label' => __('Height', WDCFM()->prefix),
|
2109 |
+
'name' => 'NBPHeight',
|
2110 |
+
'type' => 'text',
|
2111 |
+
'class' => '',
|
2112 |
+
'value' => isset($param_values->NBPHeight) ? $param_values->NBPHeight : '',
|
2113 |
+
'after' => 'px',
|
2114 |
+
),
|
2115 |
+
array(
|
2116 |
+
'label' => __('Line Height', WDCFM()->prefix),
|
2117 |
+
'name' => 'NBPLineHeight',
|
2118 |
+
'type' => 'text',
|
2119 |
+
'class' => '',
|
2120 |
+
'value' => isset($param_values->NBPLineHeight) ? $param_values->NBPLineHeight : '',
|
2121 |
+
'after' => 'px',
|
2122 |
+
),
|
2123 |
+
array(
|
2124 |
+
'label' => __('Color', WDCFM()->prefix),
|
2125 |
+
'name' => 'NBPColor',
|
2126 |
+
'type' => 'text',
|
2127 |
+
'class' => 'color',
|
2128 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
2129 |
+
'value' => isset($param_values->NBPColor) ? $param_values->NBPColor : '',
|
2130 |
+
'after' => '',
|
2131 |
+
),
|
2132 |
+
array(
|
2133 |
+
'label' => __('Padding', WDCFM()->prefix),
|
2134 |
+
'name' => 'NBPPadding',
|
2135 |
+
'type' => 'text',
|
2136 |
+
'class' => '',
|
2137 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' 3px 5px or 3% 5%',
|
2138 |
+
'value' => isset($param_values->NBPPadding) ? $param_values->NBPPadding : '',
|
2139 |
+
'after' => '',
|
2140 |
+
),
|
2141 |
+
array(
|
2142 |
+
'label' => __('Margin', WDCFM()->prefix),
|
2143 |
+
'name' => 'NBPMargin',
|
2144 |
+
'type' => 'text',
|
2145 |
+
'class' => '',
|
2146 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' 5px 10px or 5% 10%',
|
2147 |
+
'value' => isset($param_values->NBPMargin) ? $param_values->NBPMargin : '',
|
2148 |
+
'after' => '',
|
2149 |
+
),
|
2150 |
+
array(
|
2151 |
+
'label' => __('Border', WDCFM()->prefix),
|
2152 |
+
'name' => 'NBPBorder',
|
2153 |
+
'type' => 'checkbox',
|
2154 |
+
'options' => $borders,
|
2155 |
+
'class' => '',
|
2156 |
+
'after' => '',
|
2157 |
+
),
|
2158 |
+
array(
|
2159 |
+
'label' => __('Border Color', WDCFM()->prefix),
|
2160 |
+
'name' => 'NBPBorderColor',
|
2161 |
+
'type' => 'text',
|
2162 |
+
'class' => 'color',
|
2163 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
2164 |
+
'value' => isset($param_values->NBPBorderColor) ? $param_values->NBPBorderColor : '',
|
2165 |
+
'after' => '',
|
2166 |
+
),
|
2167 |
+
array(
|
2168 |
+
'label' => __('Border Type', WDCFM()->prefix),
|
2169 |
+
'name' => 'NBPBorderType',
|
2170 |
+
'type' => 'select',
|
2171 |
+
'options' => $border_types,
|
2172 |
+
'class' => '',
|
2173 |
+
'value' => isset($param_values->NBPBorderType) ? $param_values->NBPBorderType : '',
|
2174 |
+
'after' => '',
|
2175 |
+
),
|
2176 |
+
array(
|
2177 |
+
'label' => __('Border Width', WDCFM()->prefix),
|
2178 |
+
'name' => 'NBPBorderWidth',
|
2179 |
+
'type' => 'text',
|
2180 |
+
'class' => '',
|
2181 |
+
'value' => isset($param_values->NBPBorderWidth) ? $param_values->NBPBorderWidth : '',
|
2182 |
+
'after' => 'px',
|
2183 |
+
),
|
2184 |
+
array(
|
2185 |
+
'label' => __('Border Radius', WDCFM()->prefix),
|
2186 |
+
'name' => 'NBPBorderRadius',
|
2187 |
+
'type' => 'text',
|
2188 |
+
'class' => '',
|
2189 |
+
'value' => isset($param_values->NBPBorderRadius) ? $param_values->NBPBorderRadius : '',
|
2190 |
+
'after' => 'px',
|
2191 |
+
),
|
2192 |
+
array(
|
2193 |
+
'label' => __('Box Shadow', WDCFM()->prefix),
|
2194 |
+
'name' => 'NBPBoxShadow',
|
2195 |
+
'type' => 'text',
|
2196 |
+
'class' => '',
|
2197 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' 5px 5px 2px #888888',
|
2198 |
+
'value' => isset($param_values->NBPBoxShadow) ? $param_values->NBPBoxShadow : '',
|
2199 |
+
'after' => '',
|
2200 |
+
),
|
2201 |
+
array(
|
2202 |
+
'label' => __('Hover Parameters', WDCFM()->prefix),
|
2203 |
+
'type' => 'label',
|
2204 |
+
'class' => 'fm-mini-title',
|
2205 |
+
'after' => '<br/>',
|
2206 |
+
),
|
2207 |
+
array(
|
2208 |
+
'label' => __('Background Color', WDCFM()->prefix),
|
2209 |
+
'name' => 'NBHPBGColor',
|
2210 |
+
'type' => 'text',
|
2211 |
+
'class' => 'color',
|
2212 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
2213 |
+
'value' => isset($param_values->NBHPBGColor) ? $param_values->NBHPBGColor : '',
|
2214 |
+
'after' => '',
|
2215 |
+
),
|
2216 |
+
array(
|
2217 |
+
'label' => __('Color', WDCFM()->prefix),
|
2218 |
+
'name' => 'NBHPColor',
|
2219 |
+
'type' => 'text',
|
2220 |
+
'class' => 'color',
|
2221 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
2222 |
+
'value' => isset($param_values->NBHPColor) ? $param_values->NBHPColor : '',
|
2223 |
+
'after' => '',
|
2224 |
+
),
|
2225 |
+
array(
|
2226 |
+
'label' => __('Border', WDCFM()->prefix),
|
2227 |
+
'name' => 'NBHPBorder',
|
2228 |
+
'type' => 'checkbox',
|
2229 |
+
'options' => $borders,
|
2230 |
+
'class' => '',
|
2231 |
+
'after' => '',
|
2232 |
+
),
|
2233 |
+
array(
|
2234 |
+
'label' => __('Border Color', WDCFM()->prefix),
|
2235 |
+
'name' => 'NBHPBorderColor',
|
2236 |
+
'type' => 'text',
|
2237 |
+
'class' => 'color',
|
2238 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
2239 |
+
'value' => isset($param_values->NBHPBorderColor) ? $param_values->NBHPBorderColor : '',
|
2240 |
+
'after' => '',
|
2241 |
+
),
|
2242 |
+
array(
|
2243 |
+
'label' => __('Border Type', WDCFM()->prefix),
|
2244 |
+
'name' => 'NBHPBorderType',
|
2245 |
+
'type' => 'select',
|
2246 |
+
'options' => $border_types,
|
2247 |
+
'class' => '',
|
2248 |
+
'value' => isset($param_values->NBHPBorderType) ? $param_values->NBHPBorderType : '',
|
2249 |
+
'after' => '',
|
2250 |
+
),
|
2251 |
+
array(
|
2252 |
+
'label' => __('Border Width', WDCFM()->prefix),
|
2253 |
+
'name' => 'NBHPBorderWidth',
|
2254 |
+
'type' => 'text',
|
2255 |
+
'class' => '',
|
2256 |
+
'value' => isset($param_values->NBHPBorderWidth) ? $param_values->NBHPBorderWidth : '',
|
2257 |
+
'after' => 'px</div>',
|
2258 |
+
),
|
2259 |
+
array(
|
2260 |
+
'label' => __('Previous Button Parameters', WDCFM()->prefix),
|
2261 |
+
'type' => 'panel',
|
2262 |
+
'class' => 'col-md-12',
|
2263 |
+
'label_class' => 'fm-mini-title',
|
2264 |
+
'after' => '<br/>',
|
2265 |
+
),
|
2266 |
+
array(
|
2267 |
+
'label' => __('Background Color', WDCFM()->prefix),
|
2268 |
+
'name' => 'PBPBGColor',
|
2269 |
+
'type' => 'text',
|
2270 |
+
'class' => 'color',
|
2271 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
2272 |
+
'value' => isset($param_values->PBPBGColor) ? $param_values->PBPBGColor : '',
|
2273 |
+
'after' => '',
|
2274 |
+
),
|
2275 |
+
array(
|
2276 |
+
'label' => __('Width', WDCFM()->prefix),
|
2277 |
+
'name' => 'PBPWidth',
|
2278 |
+
'type' => 'text',
|
2279 |
+
'class' => '',
|
2280 |
+
'value' => isset($param_values->PBPWidth) ? $param_values->PBPWidth : '',
|
2281 |
+
'after' => 'px',
|
2282 |
+
),
|
2283 |
+
array(
|
2284 |
+
'label' => __('Height', WDCFM()->prefix),
|
2285 |
+
'name' => 'PBPHeight',
|
2286 |
+
'type' => 'text',
|
2287 |
+
'class' => '',
|
2288 |
+
'value' => isset($param_values->PBPHeight) ? $param_values->PBPHeight : '',
|
2289 |
+
'after' => 'px',
|
2290 |
+
),
|
2291 |
+
array(
|
2292 |
+
'label' => __('Line Height', WDCFM()->prefix),
|
2293 |
+
'name' => 'PBPLineHeight',
|
2294 |
+
'type' => 'text',
|
2295 |
+
'class' => '',
|
2296 |
+
'value' => isset($param_values->PBPLineHeight) ? $param_values->PBPLineHeight : '',
|
2297 |
+
'after' => 'px',
|
2298 |
+
),
|
2299 |
+
array(
|
2300 |
+
'label' => __('Color', WDCFM()->prefix),
|
2301 |
+
'name' => 'PBPColor',
|
2302 |
+
'type' => 'text',
|
2303 |
+
'class' => 'color',
|
2304 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
2305 |
+
'value' => isset($param_values->PBPColor) ? $param_values->PBPColor : '',
|
2306 |
+
'after' => '',
|
2307 |
+
),
|
2308 |
+
array(
|
2309 |
+
'label' => __('Padding', WDCFM()->prefix),
|
2310 |
+
'name' => 'PBPPadding',
|
2311 |
+
'type' => 'text',
|
2312 |
+
'class' => '',
|
2313 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' 3px 5px or 3% 5%',
|
2314 |
+
'value' => isset($param_values->PBPPadding) ? $param_values->PBPPadding : '',
|
2315 |
+
'after' => '',
|
2316 |
+
),
|
2317 |
+
array(
|
2318 |
+
'label' => __('Margin', WDCFM()->prefix),
|
2319 |
+
'name' => 'PBPMargin',
|
2320 |
+
'type' => 'text',
|
2321 |
+
'class' => '',
|
2322 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' 5px 10px or 5% 10%',
|
2323 |
+
'value' => isset($param_values->PBPMargin) ? $param_values->PBPMargin : '',
|
2324 |
+
'after' => '',
|
2325 |
+
),
|
2326 |
+
array(
|
2327 |
+
'label' => __('Border', WDCFM()->prefix),
|
2328 |
+
'name' => 'PBPBorder',
|
2329 |
+
'type' => 'checkbox',
|
2330 |
+
'options' => $borders,
|
2331 |
+
'class' => '',
|
2332 |
+
'after' => '',
|
2333 |
+
),
|
2334 |
+
array(
|
2335 |
+
'label' => __('Border Color', WDCFM()->prefix),
|
2336 |
+
'name' => 'PBPBorderColor',
|
2337 |
+
'type' => 'text',
|
2338 |
+
'class' => 'color',
|
2339 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
2340 |
+
'value' => isset($param_values->PBPBorderColor) ? $param_values->PBPBorderColor : '',
|
2341 |
+
'after' => '',
|
2342 |
+
),
|
2343 |
+
array(
|
2344 |
+
'label' => __('Border Type', WDCFM()->prefix),
|
2345 |
+
'name' => 'PBPBorderType',
|
2346 |
+
'type' => 'select',
|
2347 |
+
'options' => $border_types,
|
2348 |
+
'class' => '',
|
2349 |
+
'value' => isset($param_values->PBPBorderType) ? $param_values->PBPBorderType : '',
|
2350 |
+
'after' => '',
|
2351 |
+
),
|
2352 |
+
array(
|
2353 |
+
'label' => __('Border Width', WDCFM()->prefix),
|
2354 |
+
'name' => 'PBPBorderWidth',
|
2355 |
+
'type' => 'text',
|
2356 |
+
'class' => '',
|
2357 |
+
'value' => isset($param_values->PBPBorderWidth) ? $param_values->PBPBorderWidth : '',
|
2358 |
+
'after' => 'px',
|
2359 |
+
),
|
2360 |
+
array(
|
2361 |
+
'label' => __('Border Radius', WDCFM()->prefix),
|
2362 |
+
'name' => 'PBPBorderRadius',
|
2363 |
+
'type' => 'text',
|
2364 |
+
'class' => '',
|
2365 |
+
'value' => isset($param_values->PBPBorderRadius) ? $param_values->PBPBorderRadius : '',
|
2366 |
+
'after' => 'px',
|
2367 |
+
),
|
2368 |
+
array(
|
2369 |
+
'label' => __('Box Shadow', WDCFM()->prefix),
|
2370 |
+
'name' => 'PBPBoxShadow',
|
2371 |
+
'type' => 'text',
|
2372 |
+
'class' => '',
|
2373 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' 5px 5px 2px #888888',
|
2374 |
+
'value' => isset($param_values->PBPBoxShadow) ? $param_values->PBPBoxShadow : '',
|
2375 |
+
'after' => '',
|
2376 |
+
),
|
2377 |
+
array(
|
2378 |
+
'label' => __('Hover Parameters', WDCFM()->prefix),
|
2379 |
+
'type' => 'label',
|
2380 |
+
'class' => 'fm-mini-title',
|
2381 |
+
'after' => '<br/>',
|
2382 |
+
),
|
2383 |
+
array(
|
2384 |
+
'label' => __('Background Color', WDCFM()->prefix),
|
2385 |
+
'name' => 'PBHPBGColor',
|
2386 |
+
'type' => 'text',
|
2387 |
+
'class' => 'color',
|
2388 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
2389 |
+
'value' => isset($param_values->PBHPBGColor) ? $param_values->PBHPBGColor : '',
|
2390 |
+
'after' => '',
|
2391 |
+
),
|
2392 |
+
array(
|
2393 |
+
'label' => __('Color', WDCFM()->prefix),
|
2394 |
+
'name' => 'PBHPColor',
|
2395 |
+
'type' => 'text',
|
2396 |
+
'class' => 'color',
|
2397 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
2398 |
+
'value' => isset($param_values->PBHPColor) ? $param_values->PBHPColor : '',
|
2399 |
+
'after' => '',
|
2400 |
+
),
|
2401 |
+
array(
|
2402 |
+
'label' => __('Border', WDCFM()->prefix),
|
2403 |
+
'name' => 'PBHPBorder',
|
2404 |
+
'type' => 'checkbox',
|
2405 |
+
'options' => $borders,
|
2406 |
+
'class' => '',
|
2407 |
+
'after' => '',
|
2408 |
+
),
|
2409 |
+
array(
|
2410 |
+
'label' => __('Border Color', WDCFM()->prefix),
|
2411 |
+
'name' => 'PBHPBorderColor',
|
2412 |
+
'type' => 'text',
|
2413 |
+
'class' => 'color',
|
2414 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
2415 |
+
'value' => isset($param_values->PBHPBorderColor) ? $param_values->PBHPBorderColor : '',
|
2416 |
+
'after' => '',
|
2417 |
+
),
|
2418 |
+
array(
|
2419 |
+
'label' => __('Border Type', WDCFM()->prefix),
|
2420 |
+
'name' => 'PBHPBorderType',
|
2421 |
+
'type' => 'select',
|
2422 |
+
'options' => $border_types,
|
2423 |
+
'class' => '',
|
2424 |
+
'value' => isset($param_values->PBHPBorderType) ? $param_values->PBHPBorderType : '',
|
2425 |
+
'after' => '',
|
2426 |
+
),
|
2427 |
+
array(
|
2428 |
+
'label' => __('Border Width', WDCFM()->prefix),
|
2429 |
+
'name' => 'PBHPBorderWidth',
|
2430 |
+
'type' => 'text',
|
2431 |
+
'class' => '',
|
2432 |
+
'value' => isset($param_values->PBHPBorderWidth) ? $param_values->PBHPBorderWidth : '',
|
2433 |
+
'after' => 'px</div>',
|
2434 |
+
),
|
2435 |
+
),
|
2436 |
+
'close_button' => array(
|
2437 |
+
array(
|
2438 |
+
'label' => '',
|
2439 |
+
'type' => 'panel',
|
2440 |
+
'class' => 'col-md-12',
|
2441 |
+
'label_class' => '',
|
2442 |
+
'after' => '',
|
2443 |
+
),
|
2444 |
+
array(
|
2445 |
+
'label' => __('Position', WDCFM()->prefix),
|
2446 |
+
'name' => 'CBPPosition',
|
2447 |
+
'type' => 'select',
|
2448 |
+
'options' => $position_types,
|
2449 |
+
'class' => '',
|
2450 |
+
'value' => isset($param_values->CBPPosition) ? $param_values->CBPPosition : '',
|
2451 |
+
'after' => '',
|
2452 |
+
),
|
2453 |
+
array(
|
2454 |
+
'label' => __('Top', WDCFM()->prefix),
|
2455 |
+
'name' => 'CBPTop',
|
2456 |
+
'type' => 'text',
|
2457 |
+
'class' => '',
|
2458 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' 100px or 10%',
|
2459 |
+
'value' => isset($param_values->CBPTop) ? $param_values->CBPTop : '',
|
2460 |
+
'after' => '',
|
2461 |
+
),
|
2462 |
+
array(
|
2463 |
+
'label' => __('Right', WDCFM()->prefix),
|
2464 |
+
'name' => 'CBPRight',
|
2465 |
+
'type' => 'text',
|
2466 |
+
'class' => '',
|
2467 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' 100px or 10%',
|
2468 |
+
'value' => isset($param_values->CBPRight) ? $param_values->CBPRight : '',
|
2469 |
+
'after' => '',
|
2470 |
+
),
|
2471 |
+
array(
|
2472 |
+
'label' => __('Bottom', WDCFM()->prefix),
|
2473 |
+
'name' => 'CBPBottom',
|
2474 |
+
'type' => 'text',
|
2475 |
+
'class' => '',
|
2476 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' 100px or 10%',
|
2477 |
+
'value' => isset($param_values->CBPBottom) ? $param_values->CBPBottom : '',
|
2478 |
+
'after' => '',
|
2479 |
+
),
|
2480 |
+
array(
|
2481 |
+
'label' => __('Left', WDCFM()->prefix),
|
2482 |
+
'name' => 'CBPLeft',
|
2483 |
+
'type' => 'text',
|
2484 |
+
'class' => '',
|
2485 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' 100px or 10%',
|
2486 |
+
'value' => isset($param_values->CBPLeft) ? $param_values->CBPLeft : '',
|
2487 |
+
'after' => '',
|
2488 |
+
),
|
2489 |
+
array(
|
2490 |
+
'label' => __('Background Color', WDCFM()->prefix),
|
2491 |
+
'name' => 'CBPBGColor',
|
2492 |
+
'type' => 'text',
|
2493 |
+
'class' => 'color',
|
2494 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
2495 |
+
'value' => isset($param_values->CBPBGColor) ? $param_values->CBPBGColor : '',
|
2496 |
+
'after' => '',
|
2497 |
+
),
|
2498 |
+
array(
|
2499 |
+
'label' => __('Font Size', WDCFM()->prefix),
|
2500 |
+
'name' => 'CBPFontSize',
|
2501 |
+
'type' => 'text',
|
2502 |
+
'class' => '13',
|
2503 |
+
'value' => isset($param_values->CBPFontSize) ? $param_values->CBPFontSize : '',
|
2504 |
+
'after' => 'px',
|
2505 |
+
),
|
2506 |
+
array(
|
2507 |
+
'label' => __('Font Weight', WDCFM()->prefix),
|
2508 |
+
'name' => 'CBPFontWeight',
|
2509 |
+
'type' => 'select',
|
2510 |
+
'options' => $font_weights,
|
2511 |
+
'class' => '',
|
2512 |
+
'value' => isset($param_values->CBPFontWeight) ? $param_values->CBPFontWeight : '',
|
2513 |
+
'after' => '',
|
2514 |
+
),
|
2515 |
+
array(
|
2516 |
+
'label' => __('Color', WDCFM()->prefix),
|
2517 |
+
'name' => 'CBPColor',
|
2518 |
+
'type' => 'text',
|
2519 |
+
'class' => 'color',
|
2520 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
2521 |
+
'value' => isset($param_values->CBPColor) ? $param_values->CBPColor : '',
|
2522 |
+
'after' => '',
|
2523 |
+
),
|
2524 |
+
array(
|
2525 |
+
'label' => __('Padding', WDCFM()->prefix),
|
2526 |
+
'name' => 'CBPPadding',
|
2527 |
+
'type' => 'text',
|
2528 |
+
'class' => '',
|
2529 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' 3px 5px or 3% 5%',
|
2530 |
+
'value' => isset($param_values->CBPPadding) ? $param_values->CBPPadding : '',
|
2531 |
+
'after' => '',
|
2532 |
+
),
|
2533 |
+
array(
|
2534 |
+
'label' => __('Margin', WDCFM()->prefix),
|
2535 |
+
'name' => 'CBPMargin',
|
2536 |
+
'type' => 'text',
|
2537 |
+
'class' => '',
|
2538 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' 5px 10px or 5% 10%',
|
2539 |
+
'value' => isset($param_values->CBPMargin) ? $param_values->CBPMargin : '',
|
2540 |
+
'after' => '',
|
2541 |
+
),
|
2542 |
+
array(
|
2543 |
+
'label' => __('Border', WDCFM()->prefix),
|
2544 |
+
'name' => 'CBPBorder',
|
2545 |
+
'type' => 'checkbox',
|
2546 |
+
'options' => $borders,
|
2547 |
+
'class' => '',
|
2548 |
+
'after' => '',
|
2549 |
+
),
|
2550 |
+
array(
|
2551 |
+
'label' => __('Border Color', WDCFM()->prefix),
|
2552 |
+
'name' => 'CBPBorderColor',
|
2553 |
+
'type' => 'text',
|
2554 |
+
'class' => 'color',
|
2555 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
2556 |
+
'value' => isset($param_values->CBPBorderColor) ? $param_values->CBPBorderColor : '',
|
2557 |
+
'after' => '',
|
2558 |
+
),
|
2559 |
+
array(
|
2560 |
+
'label' => __('Border Type', WDCFM()->prefix),
|
2561 |
+
'name' => 'CBPBorderType',
|
2562 |
+
'type' => 'select',
|
2563 |
+
'options' => $border_types,
|
2564 |
+
'class' => '',
|
2565 |
+
'value' => isset($param_values->CBPBorderType) ? $param_values->CBPBorderType : '',
|
2566 |
+
'after' => '',
|
2567 |
+
),
|
2568 |
+
array(
|
2569 |
+
'label' => __('Border Width', WDCFM()->prefix),
|
2570 |
+
'name' => 'CBPBorderWidth',
|
2571 |
+
'type' => 'text',
|
2572 |
+
'class' => '',
|
2573 |
+
'value' => isset($param_values->CBPBorderWidth) ? $param_values->CBPBorderWidth : '',
|
2574 |
+
'after' => 'px',
|
2575 |
+
),
|
2576 |
+
array(
|
2577 |
+
'label' => __('Border Radius', WDCFM()->prefix),
|
2578 |
+
'name' => 'CBPBorderRadius',
|
2579 |
+
'type' => 'text',
|
2580 |
+
'class' => '',
|
2581 |
+
'value' => isset($param_values->CBPBorderRadius) ? $param_values->CBPBorderRadius : '',
|
2582 |
+
'after' => 'px',
|
2583 |
+
),
|
2584 |
+
array(
|
2585 |
+
'label' => __('Hover Parameters', WDCFM()->prefix),
|
2586 |
+
'type' => 'label',
|
2587 |
+
'class' => 'fm-mini-title',
|
2588 |
+
'after' => '<br/>',
|
2589 |
+
),
|
2590 |
+
array(
|
2591 |
+
'label' => __('Background Color', WDCFM()->prefix),
|
2592 |
+
'name' => 'CBHPBGColor',
|
2593 |
+
'type' => 'text',
|
2594 |
+
'class' => 'color',
|
2595 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
2596 |
+
'value' => isset($param_values->CBHPBGColor) ? $param_values->CBHPBGColor : '',
|
2597 |
+
'after' => '',
|
2598 |
+
),
|
2599 |
+
array(
|
2600 |
+
'label' => __('Color', WDCFM()->prefix),
|
2601 |
+
'name' => 'CBHPColor',
|
2602 |
+
'type' => 'text',
|
2603 |
+
'class' => 'color',
|
2604 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
2605 |
+
'value' => isset($param_values->CBHPColor) ? $param_values->CBHPColor : '',
|
2606 |
+
'after' => '',
|
2607 |
+
),
|
2608 |
+
array(
|
2609 |
+
'label' => __('Border', WDCFM()->prefix),
|
2610 |
+
'name' => 'CBHPBorder',
|
2611 |
+
'type' => 'checkbox',
|
2612 |
+
'options' => $borders,
|
2613 |
+
'class' => '',
|
2614 |
+
'after' => '',
|
2615 |
+
),
|
2616 |
+
array(
|
2617 |
+
'label' => __('Border Color', WDCFM()->prefix),
|
2618 |
+
'name' => 'CBHPBorderColor',
|
2619 |
+
'type' => 'text',
|
2620 |
+
'class' => 'color',
|
2621 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
2622 |
+
'value' => isset($param_values->CBHPBorderColor) ? $param_values->CBHPBorderColor : '',
|
2623 |
+
'after' => '',
|
2624 |
+
),
|
2625 |
+
array(
|
2626 |
+
'label' => __('Border Type', WDCFM()->prefix),
|
2627 |
+
'name' => 'CBHPBorderType',
|
2628 |
+
'type' => 'select',
|
2629 |
+
'options' => $border_types,
|
2630 |
+
'class' => '',
|
2631 |
+
'value' => isset($param_values->CBHPBorderType) ? $param_values->CBHPBorderType : '',
|
2632 |
+
'after' => '',
|
2633 |
+
),
|
2634 |
+
array(
|
2635 |
+
'label' => __('Border Width', WDCFM()->prefix),
|
2636 |
+
'name' => 'CBHPBorderWidth',
|
2637 |
+
'type' => 'text',
|
2638 |
+
'class' => '',
|
2639 |
+
'value' => isset($param_values->CBHPBorderWidth) ? $param_values->CBHPBorderWidth : '',
|
2640 |
+
'after' => 'px</div>',
|
2641 |
+
),
|
2642 |
+
),
|
2643 |
+
'minimize' => array(
|
2644 |
+
array(
|
2645 |
+
'label' => '',
|
2646 |
+
'type' => 'panel',
|
2647 |
+
'class' => 'col-md-12',
|
2648 |
+
'label_class' => '',
|
2649 |
+
'after' => '',
|
2650 |
+
),
|
2651 |
+
array(
|
2652 |
+
'label' => __('Background Color', WDCFM()->prefix),
|
2653 |
+
'name' => 'MBPBGColor',
|
2654 |
+
'type' => 'text',
|
2655 |
+
'class' => 'color',
|
2656 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
2657 |
+
'value' => isset($param_values->MBPBGColor) ? $param_values->MBPBGColor : '',
|
2658 |
+
'after' => '',
|
2659 |
+
),
|
2660 |
+
array(
|
2661 |
+
'label' => __('Font Size', WDCFM()->prefix),
|
2662 |
+
'name' => 'MBPFontSize',
|
2663 |
+
'type' => 'text',
|
2664 |
+
'class' => '13',
|
2665 |
+
'value' => isset($param_values->MBPFontSize) ? $param_values->MBPFontSize : '',
|
2666 |
+
'after' => 'px',
|
2667 |
+
),
|
2668 |
+
array(
|
2669 |
+
'label' => __('Font Weight', WDCFM()->prefix),
|
2670 |
+
'name' => 'MBPFontWeight',
|
2671 |
+
'type' => 'select',
|
2672 |
+
'options' => $font_weights,
|
2673 |
+
'class' => '',
|
2674 |
+
'value' => isset($param_values->MBPFontWeight) ? $param_values->MBPFontWeight : '',
|
2675 |
+
'after' => '',
|
2676 |
+
),
|
2677 |
+
array(
|
2678 |
+
'label' => __('Color', WDCFM()->prefix),
|
2679 |
+
'name' => 'MBPColor',
|
2680 |
+
'type' => 'text',
|
2681 |
+
'class' => 'color',
|
2682 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
2683 |
+
'value' => isset($param_values->MBPColor) ? $param_values->MBPColor : '',
|
2684 |
+
'after' => '',
|
2685 |
+
),
|
2686 |
+
array(
|
2687 |
+
'label' => __('Text Align', WDCFM()->prefix),
|
2688 |
+
'name' => 'MBPTextAlign',
|
2689 |
+
'type' => 'select',
|
2690 |
+
'options' => $aligns,
|
2691 |
+
'class' => '',
|
2692 |
+
'value' => isset($param_values->MBPTextAlign) ? $param_values->MBPTextAlign : '',
|
2693 |
+
'after' => '',
|
2694 |
+
),
|
2695 |
+
array(
|
2696 |
+
'label' => __('Padding', WDCFM()->prefix),
|
2697 |
+
'name' => 'MBPPadding',
|
2698 |
+
'type' => 'text',
|
2699 |
+
'class' => '',
|
2700 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' 3px 5px or 3% 5%',
|
2701 |
+
'value' => isset($param_values->MBPPadding) ? $param_values->MBPPadding : '',
|
2702 |
+
'after' => 'px|%',
|
2703 |
+
),
|
2704 |
+
array(
|
2705 |
+
'label' => __('Margin', WDCFM()->prefix),
|
2706 |
+
'name' => 'MBPMargin',
|
2707 |
+
'type' => 'text',
|
2708 |
+
'class' => '',
|
2709 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' 5px 10px or 5% 10%',
|
2710 |
+
'value' => isset($param_values->MBPMargin) ? $param_values->MBPMargin : '',
|
2711 |
+
'after' => 'px|%',
|
2712 |
+
),
|
2713 |
+
array(
|
2714 |
+
'label' => __('Border', WDCFM()->prefix),
|
2715 |
+
'name' => 'MBPBorder',
|
2716 |
+
'type' => 'checkbox',
|
2717 |
+
'options' => $borders,
|
2718 |
+
'class' => '',
|
2719 |
+
'after' => '',
|
2720 |
+
),
|
2721 |
+
array(
|
2722 |
+
'label' => __('Border Color', WDCFM()->prefix),
|
2723 |
+
'name' => 'MBPBorderColor',
|
2724 |
+
'type' => 'text',
|
2725 |
+
'class' => 'color',
|
2726 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
2727 |
+
'value' => isset($param_values->MBPBorderColor) ? $param_values->MBPBorderColor : '',
|
2728 |
+
'after' => '',
|
2729 |
+
),
|
2730 |
+
array(
|
2731 |
+
'label' => __('Border Type', WDCFM()->prefix),
|
2732 |
+
'name' => 'MBPBorderType',
|
2733 |
+
'type' => 'select',
|
2734 |
+
'options' => $border_types,
|
2735 |
+
'class' => '',
|
2736 |
+
'value' => isset($param_values->MBPBorderType) ? $param_values->MBPBorderType : '',
|
2737 |
+
'after' => '',
|
2738 |
+
),
|
2739 |
+
array(
|
2740 |
+
'label' => __('Border Width', WDCFM()->prefix),
|
2741 |
+
'name' => 'MBPBorderWidth',
|
2742 |
+
'type' => 'text',
|
2743 |
+
'class' => '',
|
2744 |
+
'value' => isset($param_values->MBPBorderWidth) ? $param_values->MBPBorderWidth : '',
|
2745 |
+
'after' => 'px',
|
2746 |
+
),
|
2747 |
+
array(
|
2748 |
+
'label' => __('Border Radius', WDCFM()->prefix),
|
2749 |
+
'name' => 'MBPBorderRadius',
|
2750 |
+
'type' => 'text',
|
2751 |
+
'class' => '',
|
2752 |
+
'value' => isset($param_values->MBPBorderRadius) ? $param_values->MBPBorderRadius : '',
|
2753 |
+
'after' => 'px',
|
2754 |
+
),
|
2755 |
+
array(
|
2756 |
+
'label' => __('Hover Parameters', WDCFM()->prefix),
|
2757 |
+
'type' => 'label',
|
2758 |
+
'class' => 'fm-mini-title',
|
2759 |
+
'after' => '<br/>',
|
2760 |
+
),
|
2761 |
+
array(
|
2762 |
+
'label' => __('Background Color', WDCFM()->prefix),
|
2763 |
+
'name' => 'MBHPBGColor',
|
2764 |
+
'type' => 'text',
|
2765 |
+
'class' => 'color',
|
2766 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
2767 |
+
'value' => isset($param_values->MBHPBGColor) ? $param_values->MBHPBGColor : '',
|
2768 |
+
'after' => '',
|
2769 |
+
),
|
2770 |
+
array(
|
2771 |
+
'label' => __('Color', WDCFM()->prefix),
|
2772 |
+
'name' => 'MBHPColor',
|
2773 |
+
'type' => 'text',
|
2774 |
+
'class' => 'color',
|
2775 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
2776 |
+
'value' => isset($param_values->MBHPColor) ? $param_values->MBHPColor : '',
|
2777 |
+
'after' => '',
|
2778 |
+
),
|
2779 |
+
array(
|
2780 |
+
'label' => __('Border', WDCFM()->prefix),
|
2781 |
+
'name' => 'MBHPBorder',
|
2782 |
+
'type' => 'checkbox',
|
2783 |
+
'options' => $borders,
|
2784 |
+
'class' => '',
|
2785 |
+
'after' => '',
|
2786 |
+
),
|
2787 |
+
array(
|
2788 |
+
'label' => __('Border Color', WDCFM()->prefix),
|
2789 |
+
'name' => 'MBHPBorderColor',
|
2790 |
+
'type' => 'text',
|
2791 |
+
'class' => 'color',
|
2792 |
+
'value' => isset($param_values->MBHPBorderColor) ? $param_values->MBHPBorderColor : '',
|
2793 |
+
'after' => '',
|
2794 |
+
),
|
2795 |
+
array(
|
2796 |
+
'label' => __('Border Type', WDCFM()->prefix),
|
2797 |
+
'name' => 'MBHPBorderType',
|
2798 |
+
'type' => 'select',
|
2799 |
+
'options' => $border_types,
|
2800 |
+
'class' => '',
|
2801 |
+
'value' => isset($param_values->MBHPBorderType) ? $param_values->MBHPBorderType : '',
|
2802 |
+
'after' => '',
|
2803 |
+
),
|
2804 |
+
array(
|
2805 |
+
'label' => __('Border Width', WDCFM()->prefix),
|
2806 |
+
'name' => 'MBHPBorderWidth',
|
2807 |
+
'type' => 'text',
|
2808 |
+
'class' => '',
|
2809 |
+
'value' => isset($param_values->MBHPBorderWidth) ? $param_values->MBHPBorderWidth : '',
|
2810 |
+
'after' => 'px</div>',
|
2811 |
+
),
|
2812 |
+
),
|
2813 |
+
'other' => array(
|
2814 |
+
array(
|
2815 |
+
'label' => __('Inactive Text', WDCFM()->prefix),
|
2816 |
+
'type' => 'panel',
|
2817 |
+
'class' => 'col-md-12',
|
2818 |
+
'label_class' => 'fm-mini-title',
|
2819 |
+
'after' => '<br/>',
|
2820 |
+
),
|
2821 |
+
array(
|
2822 |
+
'label' => __('Color', WDCFM()->prefix),
|
2823 |
+
'name' => 'OPDeInputColor',
|
2824 |
+
'type' => 'text',
|
2825 |
+
'class' => 'color',
|
2826 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' #efefef',
|
2827 |
+
'value' => isset($param_values->OPDeInputColor) ? $param_values->OPDeInputColor : '',
|
2828 |
+
'after' => '',
|
2829 |
+
),
|
2830 |
+
array(
|
2831 |
+
'label' => __('Font Style', WDCFM()->prefix),
|
2832 |
+
'name' => 'OPFontStyle',
|
2833 |
+
'type' => 'text',
|
2834 |
+
'class' => '',
|
2835 |
+
'value' => isset($param_values->OPFontStyle) ? $param_values->OPFontStyle : '',
|
2836 |
+
'after' => '',
|
2837 |
+
),
|
2838 |
+
array(
|
2839 |
+
'label' => __('Required', WDCFM()->prefix),
|
2840 |
+
'type' => 'label',
|
2841 |
+
'class' => 'fm-mini-title',
|
2842 |
+
'after' => '<br/>',
|
2843 |
+
),
|
2844 |
+
array(
|
2845 |
+
'label' => __('Color', WDCFM()->prefix),
|
2846 |
+
'name' => 'OPRColor',
|
2847 |
+
'type' => 'text',
|
2848 |
+
'class' => 'color',
|
2849 |
+
'value' => isset($param_values->OPRColor) ? $param_values->OPRColor : '',
|
2850 |
+
'after' => '',
|
2851 |
+
),
|
2852 |
+
array(
|
2853 |
+
'label' => __('File Upload', WDCFM()->prefix),
|
2854 |
+
'type' => 'label',
|
2855 |
+
'class' => 'fm-mini-title',
|
2856 |
+
'after' => '<br/>',
|
2857 |
+
),
|
2858 |
+
array(
|
2859 |
+
'label' => __('Background URL', WDCFM()->prefix),
|
2860 |
+
'name' => 'OPFBgUrl',
|
2861 |
+
'type' => 'text',
|
2862 |
+
'class' => '',
|
2863 |
+
// 'placeholder' => __('e.g. http:// or https://', WDCFM()->prefix),
|
2864 |
+
'value' => isset($param_values->OPFBgUrl) ? $param_values->OPFBgUrl : '',
|
2865 |
+
'after' => '',
|
2866 |
+
),
|
2867 |
+
array(
|
2868 |
+
'label' => __('Background Repeat', WDCFM()->prefix),
|
2869 |
+
'name' => 'OPFBGRepeat',
|
2870 |
+
'type' => 'select',
|
2871 |
+
'options' => $bg_repeats,
|
2872 |
+
'class' => '',
|
2873 |
+
'value' => isset($param_values->OPFBGRepeat) ? $param_values->OPFBGRepeat : '',
|
2874 |
+
'after' => '',
|
2875 |
+
),
|
2876 |
+
array(
|
2877 |
+
'label' => __('Background Position', WDCFM()->prefix),
|
2878 |
+
'name1' => 'OPFPos1',
|
2879 |
+
'name2' => 'OPFPos2',
|
2880 |
+
'type' => '2text',
|
2881 |
+
'class' => 'fm-2text',
|
2882 |
+
'placeholder' => __('e.g.', WDCFM()->prefix) . ' px|%, top|bottom|left|right|center',
|
2883 |
+
'value1' => isset($param_values->OPFPos1) ? $param_values->OPFPos1 : '',
|
2884 |
+
'value2' => isset($param_values->OPFPos2) ? $param_values->OPFPos2 : '',
|
2885 |
+
'before1' => '',
|
2886 |
+
'before2' => '',
|
2887 |
+
'after' => '',
|
2888 |
+
),
|
2889 |
+
array(
|
2890 |
+
'label' => __('Grading', WDCFM()->prefix),
|
2891 |
+
'type' => 'label',
|
2892 |
+
'class' => 'fm-mini-title',
|
2893 |
+
'after' => '<br/>',
|
2894 |
+
),
|
2895 |
+
array(
|
2896 |
+
'label' => __('Text Width', WDCFM()->prefix),
|
2897 |
+
'name' => 'OPGWidth',
|
2898 |
+
'type' => 'text',
|
2899 |
+
'class' => '',
|
2900 |
+
'value' => isset($param_values->OPGWidth) ? $param_values->OPGWidth : '',
|
2901 |
+
'after' => 'px</div>',
|
2902 |
+
),
|
2903 |
+
),
|
2904 |
+
'custom_css' => array(
|
2905 |
+
array(
|
2906 |
+
'label' => '',
|
2907 |
+
'type' => 'panel',
|
2908 |
+
'class' => 'col-md-12',
|
2909 |
+
'label_class' => '',
|
2910 |
+
'after' => '',
|
2911 |
+
),
|
2912 |
+
array(
|
2913 |
+
'label' => __('Custom CSS', WDCFM()->prefix),
|
2914 |
+
'name' => 'CUPCSS',
|
2915 |
+
'type' => 'textarea',
|
2916 |
+
'class' => '',
|
2917 |
+
'value' => isset($param_values->CUPCSS) ? $param_values->CUPCSS : '',
|
2918 |
+
'after' => '</div>',
|
2919 |
+
),
|
2920 |
+
),
|
2921 |
+
);
|
2922 |
+
|
2923 |
+
return $all_params;
|
2924 |
+
}
|
2925 |
+
|
2926 |
+
// TODO remove this function.
|
2927 |
+
public function save() {
|
2928 |
+
$message = $this->save_db();
|
2929 |
+
$page = WDW_FMC_Library::get('page');
|
2930 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array(
|
2931 |
+
'page' => $page,
|
2932 |
+
'task' => 'display',
|
2933 |
+
'message' => $message,
|
2934 |
+
), admin_url('admin.php')));
|
2935 |
+
}
|
2936 |
+
|
2937 |
+
public function apply() {
|
2938 |
+
$message = $this->save_db();
|
2939 |
+
$id = (int) $this->model->get_max_id();
|
2940 |
+
$current_id = (int) WDW_FMC_Library::get('current_id', $id);
|
2941 |
+
$page = WDW_FMC_Library::get('page');
|
2942 |
+
$active_tab = WDW_FMC_Library::get('active_tab');
|
2943 |
+
$pagination = WDW_FMC_Library::get('pagination-type');
|
2944 |
+
$form_type = WDW_FMC_Library::get('form_type');
|
2945 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array(
|
2946 |
+
'page' => $page,
|
2947 |
+
'task' => 'edit',
|
2948 |
+
'current_id' => $current_id,
|
2949 |
+
'message' => $message,
|
2950 |
+
'active_tab' => $active_tab,
|
2951 |
+
'pagination' => $pagination,
|
2952 |
+
'form_type' => $form_type,
|
2953 |
+
), admin_url('admin.php')));
|
2954 |
+
}
|
2955 |
+
|
2956 |
+
public function copy_themes() {
|
2957 |
+
global $wpdb;
|
2958 |
+
$theme_ids_col = $this->model->get_all_ids();
|
2959 |
+
foreach ( $theme_ids_col as $theme_id ) {
|
2960 |
+
if ( isset($_POST['check_' . $theme_id]) ) {
|
2961 |
+
$theme = $this->model->get_row_data($theme_id, 0);
|
2962 |
+
$title = $theme->title;
|
2963 |
+
$params = $theme->css;
|
2964 |
+
$version = $theme->version;
|
2965 |
+
$save = $this->model->insert_theme(array(
|
2966 |
+
'title' => $title,
|
2967 |
+
'css' => $params,
|
2968 |
+
'version' => $version,
|
2969 |
+
'default' => 0,
|
2970 |
+
));
|
2971 |
+
}
|
2972 |
+
}
|
2973 |
+
if ( $save !== FALSE ) {
|
2974 |
+
$message = 1;
|
2975 |
+
}
|
2976 |
+
else {
|
2977 |
+
$message = 2;
|
2978 |
+
}
|
2979 |
+
$page = WDW_FMC_Library::get('page');
|
2980 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array(
|
2981 |
+
'page' => $page,
|
2982 |
+
'task' => 'display',
|
2983 |
+
'message' => $message,
|
2984 |
+
), admin_url('admin.php')));
|
2985 |
+
}
|
2986 |
+
|
2987 |
+
public function save_as_copy() {
|
2988 |
+
$message = $this->save_db_as_copy();
|
2989 |
+
$page = WDW_FMC_Library::get('page');
|
2990 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array(
|
2991 |
+
'page' => $page,
|
2992 |
+
'task' => 'display',
|
2993 |
+
'message' => $message,
|
2994 |
+
), admin_url('admin.php')));
|
2995 |
+
}
|
2996 |
+
|
2997 |
+
public function save_db() {
|
2998 |
+
global $wpdb;
|
2999 |
+
$id = (int) WDW_FMC_Library::get('current_id', 0);
|
3000 |
+
$title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
|
3001 |
+
$version = 2;
|
3002 |
+
$params = (isset($_POST['params']) ? stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST['params'])) : '');
|
3003 |
+
$default = (isset($_POST['default']) ? esc_html(stripslashes($_POST['default'])) : 0);
|
3004 |
+
if ( $id != 0 ) {
|
3005 |
+
$save = $this->model->update_formmaker_themes(array(
|
3006 |
+
'title' => $title,
|
3007 |
+
'css' => $params,
|
3008 |
+
'default' => $default,
|
3009 |
+
), array( 'id' => $id ));
|
3010 |
+
$version = $this->model->get_theme_version($id);
|
3011 |
+
}
|
3012 |
+
else {
|
3013 |
+
$save = $this->model->insert_theme(array(
|
3014 |
+
'title' => $title,
|
3015 |
+
'css' => $params,
|
3016 |
+
'default' => $default,
|
3017 |
+
'version' => $version,
|
3018 |
+
));
|
3019 |
+
$id = $wpdb->insert_id;
|
3020 |
+
}
|
3021 |
+
if ( $save !== FALSE ) {
|
3022 |
+
require_once WDCFM()->plugin_dir . "/frontend/models/form_maker.php";
|
3023 |
+
$model_frontend = new FMModelForm_maker();
|
3024 |
+
$form_theme = json_decode(html_entity_decode($params), TRUE);
|
3025 |
+
$model_frontend->create_css($id, $form_theme, $version == 1, TRUE);
|
3026 |
+
|
3027 |
+
return 1;
|
3028 |
+
}
|
3029 |
+
else {
|
3030 |
+
return 2;
|
3031 |
+
}
|
3032 |
+
}
|
3033 |
+
|
3034 |
+
public function save_db_as_copy() {
|
3035 |
+
$id = (int) WDW_FMC_Library::get('current_id', 0);
|
3036 |
+
$title = isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '';
|
3037 |
+
$params = isset($_POST['params']) ? stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST['params'])) : '';
|
3038 |
+
$version = $this->model->get_theme_version($id);
|
3039 |
+
$save = $this->model->insert_theme(array(
|
3040 |
+
'title' => $title,
|
3041 |
+
'css' => $params,
|
3042 |
+
'version' => $version,
|
3043 |
+
'default' => 0,
|
3044 |
+
));
|
3045 |
+
if ( $save !== FALSE ) {
|
3046 |
+
return 1;
|
3047 |
+
}
|
3048 |
+
else {
|
3049 |
+
return 2;
|
3050 |
+
}
|
3051 |
+
}
|
3052 |
+
/*
|
3053 |
+
* Set default.
|
3054 |
+
*
|
3055 |
+
* @param int $id
|
3056 |
+
*/
|
3057 |
+
public function setdefault( $id ) {
|
3058 |
+
global $wpdb;
|
3059 |
+
$this->model->update_formmaker_themes( array( 'default' => 0 ), array( 'default' => 1 ) );
|
3060 |
+
$save = $this->model->update_formmaker_themes( array( 'default' => 1 ), array( 'id' => $id ) );
|
3061 |
+
if ( $save !== FALSE ) {
|
3062 |
+
$message = 7;
|
3063 |
+
}
|
3064 |
+
else {
|
3065 |
+
$message = 2;
|
3066 |
+
}
|
3067 |
+
$page = WDW_FMC_Library::get('page');
|
3068 |
+
WDW_FMC_Library::fm_redirect(add_query_arg(array(
|
3069 |
+
'page' => $page,
|
3070 |
+
'task' => 'display',
|
3071 |
+
'message' => $message,
|
3072 |
+
), admin_url('admin.php')));
|
3073 |
+
}
|
3074 |
+
}
|
admin/controllers/Uninstall_fm.php
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class FMControllerUninstall_fmc {
|
4 |
+
private $model;
|
5 |
+
private $view;
|
6 |
+
private $addons = array(
|
7 |
+
'WD_FM_MAILCHIMP' => 'mailchimp',
|
8 |
+
'WD_FM_REG' => 'reg',
|
9 |
+
'WD_FM_POST_GEN' => 'post_gen_options',
|
10 |
+
'WD_FM_EMAIL_COND' => 'email_conditions',
|
11 |
+
'WD_FM_DBOX_INT' => 'dbox_int',
|
12 |
+
'WD_FM_GDRIVE_INT' => 'formmaker_gdrive_int',
|
13 |
+
'WD_FM_PDF' => array( 'pdf_options', 'pdf' ),
|
14 |
+
'WD_FM_PUSHOVER' => 'pushover',
|
15 |
+
'WD_FM_SAVE_PROG' => array( 'save_options', 'saved_entries', 'saved_attributes' ),
|
16 |
+
'WD_FM_STRIPE' => 'stripe',
|
17 |
+
'WD_FM_CALCULATOR' => 'calculator',
|
18 |
+
);
|
19 |
+
|
20 |
+
public function __construct() {
|
21 |
+
require_once WDCFM()->plugin_dir . "/admin/models/Uninstall_fm.php";
|
22 |
+
$this->model = new FMModelUninstall_fmc();
|
23 |
+
require_once WDCFM()->plugin_dir . "/admin/views/Uninstall_fm.php";
|
24 |
+
$this->view = new FMViewUninstall_fmc();
|
25 |
+
|
26 |
+
if ( WDCFM()->is_free ) {
|
27 |
+
global $fm_options;
|
28 |
+
global $cfm_options;
|
29 |
+
if (!class_exists("DoradoWebConfig")) {
|
30 |
+
include_once(WDCFM()->plugin_dir . "/wd/config.php");
|
31 |
+
}
|
32 |
+
$config = new DoradoWebConfig();
|
33 |
+
$config->set_options(WDCFM()->is_free == 1 ? $fm_options : $cfm_options);
|
34 |
+
$deactivate_reasons = new DoradoWebDeactivate($config);
|
35 |
+
$deactivate_reasons->submit_and_deactivate();
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
+
public function execute() {
|
40 |
+
$task = ((isset($_POST['task'])) ? esc_html(stripslashes($_POST['task'])) : '');
|
41 |
+
if ( method_exists($this, $task) ) {
|
42 |
+
check_admin_referer(WDCFM()->nonce, WDCFM()->nonce);
|
43 |
+
$this->$task();
|
44 |
+
}
|
45 |
+
else {
|
46 |
+
$this->display();
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
public function display() {
|
51 |
+
$params = array();
|
52 |
+
$params['addons'] = $this->addons;
|
53 |
+
$this->view->display($params);
|
54 |
+
}
|
55 |
+
|
56 |
+
public function uninstall() {
|
57 |
+
$this->model->delete_db_tables();
|
58 |
+
global $wpdb;
|
59 |
+
$params = array();
|
60 |
+
$params['prefix'] = $wpdb->prefix;
|
61 |
+
$params['addons'] = $this->addons;
|
62 |
+
// Deactivate all addons
|
63 |
+
WDW_FMC_Library::deactivate_all_addons();
|
64 |
+
$this->view->uninstall($params);
|
65 |
+
}
|
66 |
+
}
|
admin/controllers/Widget.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class FMControllerWidget_fmc
|
5 |
+
*/
|
6 |
+
class FMControllerWidget_fmc extends WP_Widget {
|
7 |
+
private $view;
|
8 |
+
private $model;
|
9 |
+
|
10 |
+
public function __construct() {
|
11 |
+
$widget_ops = array(
|
12 |
+
'classname' => 'form_maker_widget',
|
13 |
+
'description' => 'Add Form Maker widget.',
|
14 |
+
);
|
15 |
+
// Widget Control Settings.
|
16 |
+
$control_ops = array( 'id_base' => 'form_maker_widget' );
|
17 |
+
// Create the widget.
|
18 |
+
parent::__construct('form_maker_widget', 'Form Maker', $widget_ops, $control_ops);
|
19 |
+
require_once WDCFM()->plugin_dir . "/admin/models/Widget.php";
|
20 |
+
$this->model = new FMModelWidget_fmc();
|
21 |
+
require_once WDCFM()->plugin_dir . "/admin/views/Widget.php";
|
22 |
+
$this->view = new FMViewWidget_fmc($this->model);
|
23 |
+
}
|
24 |
+
|
25 |
+
public function widget( $args, $instance ) {
|
26 |
+
require_once(WDCFM()->plugin_dir . '/frontend/controllers/form_maker.php');
|
27 |
+
$controller_class = 'FMControllerForm_maker';
|
28 |
+
$controller = new $controller_class();
|
29 |
+
$execute = $controller->execute($instance['form_id']);
|
30 |
+
$this->view->widget($args, $instance, $execute);
|
31 |
+
}
|
32 |
+
|
33 |
+
public function form( $instance ) {
|
34 |
+
$ids_FM = $this->model->get_gallery_rows_data(); // ids_Form_Maker
|
35 |
+
$this->view->form($instance, $ids_FM, parent::get_field_id('title'), parent::get_field_name('title'), parent::get_field_id('form_id'), parent::get_field_name('form_id'));
|
36 |
+
}
|
37 |
+
|
38 |
+
// Update Settings.
|
39 |
+
public function update( $new_instance, $old_instance ) {
|
40 |
+
$instance['title'] = $new_instance['title'];
|
41 |
+
$instance['form_id'] = $new_instance['form_id'];
|
42 |
+
|
43 |
+
return $instance;
|
44 |
+
}
|
45 |
+
}
|
admin/models/Blocked_ips_fm.php
ADDED
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class FMModelBlocked_ips_fmc
|
5 |
+
*/
|
6 |
+
class FMModelBlocked_ips_fmc {
|
7 |
+
/**
|
8 |
+
* Get blocked Ips.
|
9 |
+
*
|
10 |
+
* @param $params
|
11 |
+
*
|
12 |
+
* @return array|null|object
|
13 |
+
*/
|
14 |
+
public function get_rows_data($params) {
|
15 |
+
$order = $params['order'];
|
16 |
+
$orderby = $params['orderby'];
|
17 |
+
$items_per_page = $params['items_per_page'];
|
18 |
+
$search = WDW_FMC_Library::get('s', '');
|
19 |
+
$page = (int) WDW_FMC_Library::get('paged', 1);
|
20 |
+
$limit = $page ? ($page - 1) * $items_per_page : 0;
|
21 |
+
|
22 |
+
global $wpdb;
|
23 |
+
$query = "SELECT * FROM `" . $wpdb->prefix . "formmaker_blocked` ";
|
24 |
+
if ( $search ) {
|
25 |
+
$query .= 'WHERE `ip` LIKE "%' . $search . '%"';
|
26 |
+
}
|
27 |
+
$query .= ' ORDER BY `' . $orderby . '` ' . $order;
|
28 |
+
$query .= " LIMIT " . $limit . "," . $items_per_page;
|
29 |
+
$rows = $wpdb->get_results($query);
|
30 |
+
|
31 |
+
return $rows;
|
32 |
+
}
|
33 |
+
|
34 |
+
public function get_row_data( $id ) {
|
35 |
+
global $wpdb;
|
36 |
+
if ( $id != 0 ) {
|
37 |
+
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $id));
|
38 |
+
}
|
39 |
+
else {
|
40 |
+
$row = new stdClass();
|
41 |
+
$row->id = 0;
|
42 |
+
$row->ip = '';
|
43 |
+
}
|
44 |
+
|
45 |
+
return $row;
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Return total count of blocked IPs.
|
50 |
+
*
|
51 |
+
* @return null|string
|
52 |
+
*/
|
53 |
+
public function total() {
|
54 |
+
global $wpdb;
|
55 |
+
$query = "SELECT COUNT(*) FROM `" . $wpdb->prefix . "formmaker_blocked`";
|
56 |
+
|
57 |
+
$search = WDW_FMC_Library::get('s', '');
|
58 |
+
if ( $search ) {
|
59 |
+
$query .= ' WHERE `ip` LIKE "%' . $search . '%"';
|
60 |
+
}
|
61 |
+
|
62 |
+
$total = $wpdb->get_var($query);
|
63 |
+
return $total;
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Update formmaker_blocked table.
|
68 |
+
*
|
69 |
+
* @param array $params
|
70 |
+
* @param array $where
|
71 |
+
*
|
72 |
+
* @return bool
|
73 |
+
*/
|
74 |
+
public function update_fm_blocked( $params, $where ) {
|
75 |
+
global $wpdb;
|
76 |
+
return $wpdb->update($wpdb->prefix . 'formmaker_blocked', $params, $where);
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Insert to formmaker_blocked table.
|
81 |
+
*
|
82 |
+
* @param array $param_ins
|
83 |
+
* @param array $param_type
|
84 |
+
*
|
85 |
+
* @return bool
|
86 |
+
*/
|
87 |
+
public function insert_fm_blocked( $param_ins, $param_type ) {
|
88 |
+
global $wpdb;
|
89 |
+
return $wpdb->insert($wpdb->prefix . 'formmaker_blocked', $param_ins, $param_type);
|
90 |
+
}
|
91 |
+
|
92 |
+
/**
|
93 |
+
* Get col id from formmaker_blocked table.
|
94 |
+
*
|
95 |
+
* @return array
|
96 |
+
*/
|
97 |
+
public function get_col_data() {
|
98 |
+
global $wpdb;
|
99 |
+
return $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker_blocked');
|
100 |
+
}
|
101 |
+
|
102 |
+
/**
|
103 |
+
* Delete blocked IP.
|
104 |
+
*
|
105 |
+
* @param int $id
|
106 |
+
*
|
107 |
+
* @return array
|
108 |
+
*/
|
109 |
+
public function delete_data( $id ) {
|
110 |
+
global $wpdb;
|
111 |
+
return $wpdb->query($wpdb->prepare('DELETE FROM `' . $wpdb->prefix . 'formmaker_blocked` WHERE id="%d"', $id));
|
112 |
+
}
|
113 |
+
}
|
admin/models/Checkpaypal.php
ADDED
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class FMModelCheckpaypal
|
5 |
+
*/
|
6 |
+
class FMModelCheckpaypal {
|
7 |
+
/**
|
8 |
+
* Get form by id.
|
9 |
+
*
|
10 |
+
* @param int $id
|
11 |
+
*
|
12 |
+
* @return object $row
|
13 |
+
*/
|
14 |
+
public function get_form_by_id( $id ) {
|
15 |
+
global $wpdb;
|
16 |
+
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
|
17 |
+
|
18 |
+
return $row;
|
19 |
+
}
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Get form session by group id.
|
23 |
+
*
|
24 |
+
* @param int $id
|
25 |
+
*
|
26 |
+
* @return object $row
|
27 |
+
*/
|
28 |
+
public function get_form_session_by_group_id( $id ) {
|
29 |
+
global $wpdb;
|
30 |
+
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_sessions WHERE group_id="%d"', $id));
|
31 |
+
|
32 |
+
return $row;
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Update submission status.
|
37 |
+
*
|
38 |
+
* @param int $payment_status
|
39 |
+
* @param int $group_id
|
40 |
+
*/
|
41 |
+
public function update_submission_status( $payment_status, $group_id ) {
|
42 |
+
global $wpdb;
|
43 |
+
$wpdb->update($wpdb->prefix . "formmaker_submits", array(
|
44 |
+
'element_value' => $payment_status,
|
45 |
+
), array(
|
46 |
+
'group_id' => $group_id,
|
47 |
+
'element_label' => 0,
|
48 |
+
));
|
49 |
+
|
50 |
+
return;
|
51 |
+
}
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Connect PayPal.
|
55 |
+
*
|
56 |
+
* @param array $params
|
57 |
+
*
|
58 |
+
* @return array $response
|
59 |
+
*/
|
60 |
+
public function connect_to_paypal( $params ) {
|
61 |
+
// Set paypal action, default connect to sandbox.
|
62 |
+
if ( $params['checkout_mode'] == 1 || $params['checkout_mode'] == 'production' ) {
|
63 |
+
$action = "https://www.paypal.com/cgi-bin/webscr";
|
64 |
+
}
|
65 |
+
else {
|
66 |
+
$action = "https://www.sandbox.paypal.com/cgi-bin/webscr";
|
67 |
+
}
|
68 |
+
$post_fields = $params['post_fields'];
|
69 |
+
$curlConfig = array(
|
70 |
+
CURLOPT_URL => $action,
|
71 |
+
CURLOPT_POST => TRUE,
|
72 |
+
CURLOPT_RETURNTRANSFER => TRUE,
|
73 |
+
CURLOPT_SSL_VERIFYPEER => FALSE,
|
74 |
+
CURLOPT_POSTFIELDS => $post_fields,
|
75 |
+
);
|
76 |
+
$curl = curl_init();
|
77 |
+
curl_setopt_array($curl, $curlConfig);
|
78 |
+
$response = curl_exec($curl);
|
79 |
+
curl_close($curl);
|
80 |
+
|
81 |
+
return $response;
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Add form maker sessions.
|
86 |
+
*
|
87 |
+
* @param array $data
|
88 |
+
*/
|
89 |
+
public function add_formmaker_sessions( $data ) {
|
90 |
+
global $wpdb;
|
91 |
+
$wpdb->insert($wpdb->prefix . "formmaker_sessions", $data);
|
92 |
+
|
93 |
+
return;
|
94 |
+
}
|
95 |
+
|
96 |
+
/**
|
97 |
+
* Update form maker sessions by group_id.
|
98 |
+
*
|
99 |
+
* @param int $group_id
|
100 |
+
* @param array $data
|
101 |
+
*/
|
102 |
+
public function update_formmaker_sessions_by_group_id( $group_id, $data ) {
|
103 |
+
global $wpdb;
|
104 |
+
$wpdb->update($wpdb->prefix . "formmaker_sessions", $data, array( 'group_id' => $group_id ));
|
105 |
+
|
106 |
+
return;
|
107 |
+
}
|
108 |
+
}
|
admin/models/FMModelBlocked_ips_fm.php
DELETED
@@ -1,75 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMModelBlocked_ips_fmc {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function get_rows_data() {
|
22 |
-
global $wpdb;
|
23 |
-
$where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE `ip` LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
|
24 |
-
$asc_or_desc = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'desc') ? 'desc' : 'asc');
|
25 |
-
$order_by_array = array('id', 'ip');
|
26 |
-
$order_by = isset($_POST['order_by']) && in_array(esc_html(stripslashes($_POST['order_by'])), $order_by_array) ? esc_html(stripslashes($_POST['order_by'])) : 'id';
|
27 |
-
$order_by = ' ORDER BY `' . $order_by . '` ' . $asc_or_desc;
|
28 |
-
if (isset($_POST['page_number']) && $_POST['page_number']) {
|
29 |
-
$limit = ((int) $_POST['page_number'] - 1) * 20;
|
30 |
-
}
|
31 |
-
else {
|
32 |
-
$limit = 0;
|
33 |
-
}
|
34 |
-
$query = "SELECT * FROM " . $wpdb->prefix . "formmaker_blocked " . $where . $order_by . " LIMIT " . $limit . ",20";
|
35 |
-
$rows = $wpdb->get_results($query);
|
36 |
-
return $rows;
|
37 |
-
}
|
38 |
-
|
39 |
-
public function get_row_data($id) {
|
40 |
-
global $wpdb;
|
41 |
-
if ($id != 0) {
|
42 |
-
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $id));
|
43 |
-
}
|
44 |
-
else {
|
45 |
-
$row->id = 0;
|
46 |
-
$row->ip = '';
|
47 |
-
}
|
48 |
-
return $row;
|
49 |
-
}
|
50 |
-
|
51 |
-
public function page_nav() {
|
52 |
-
global $wpdb;
|
53 |
-
$where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE `ip` LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
|
54 |
-
$query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker_blocked " . $where;
|
55 |
-
$total = $wpdb->get_var($query);
|
56 |
-
$page_nav['total'] = $total;
|
57 |
-
if (isset($_POST['page_number']) && $_POST['page_number']) {
|
58 |
-
$limit = ((int) $_POST['page_number'] - 1) * 20;
|
59 |
-
}
|
60 |
-
else {
|
61 |
-
$limit = 0;
|
62 |
-
}
|
63 |
-
$page_nav['limit'] = (int) ($limit / 20 + 1);
|
64 |
-
return $page_nav;
|
65 |
-
}
|
66 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
67 |
-
// Getters & Setters //
|
68 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
69 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
70 |
-
// Private Methods //
|
71 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
72 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
73 |
-
// Listeners //
|
74 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
75 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/models/FMModelFormMakerPreview.php
DELETED
@@ -1,36 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMModelFormMakerPreview_fmc {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
|
22 |
-
public function get_form($form_id) {
|
23 |
-
global $wpdb;
|
24 |
-
$form = $wpdb->get_var($wpdb->prepare('SELECT form_front FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $form_id));
|
25 |
-
return $form;
|
26 |
-
}
|
27 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
28 |
-
// Getters & Setters //
|
29 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
30 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
31 |
-
// Private Methods //
|
32 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
33 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
34 |
-
// Listeners //
|
35 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
36 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/models/FMModelFormMakerSQLMapping.php
DELETED
@@ -1,121 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMModelFormMakerSQLMapping_fmc {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
|
22 |
-
function get_query($id) {
|
23 |
-
global $wpdb;
|
24 |
-
$rows = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker_query where id=" . $id);
|
25 |
-
return $rows;
|
26 |
-
}
|
27 |
-
|
28 |
-
function get_labels($form_id) {
|
29 |
-
global $wpdb;
|
30 |
-
// $wpdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
31 |
-
// wp_set_wpdb_vars();
|
32 |
-
$rows = $wpdb->get_var("SELECT label_order_current FROM " . $wpdb->prefix . "formmaker where id=" . $form_id);
|
33 |
-
return $rows;
|
34 |
-
}
|
35 |
-
|
36 |
-
function get_tables() {
|
37 |
-
global $wpdb;
|
38 |
-
$con_type = $_POST['con_type'];
|
39 |
-
|
40 |
-
if($con_type == 'local') {
|
41 |
-
$query = "SHOW TABLES";
|
42 |
-
$tables = $wpdb->get_col($query);
|
43 |
-
}
|
44 |
-
else if($con_type == 'remote') {
|
45 |
-
$username = isset($_POST['username']) ? $_POST['username'] : '';
|
46 |
-
$password = isset($_POST['password']) ? $_POST['password'] : '';
|
47 |
-
$database = isset($_POST['database']) ? $_POST['database'] : '';
|
48 |
-
$host = isset($_POST['host']) ? $_POST['host'] : '';
|
49 |
-
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
50 |
-
$query = "SHOW TABLES";
|
51 |
-
$tables = $wpdb_temp->get_col($query);
|
52 |
-
}
|
53 |
-
//$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
54 |
-
return $tables;
|
55 |
-
}
|
56 |
-
|
57 |
-
function get_tables_saved($con_type, $username, $password, $database, $host) {
|
58 |
-
global $wpdb;
|
59 |
-
|
60 |
-
if($con_type == 'local') {
|
61 |
-
$query = "SHOW TABLES";
|
62 |
-
$tables = $wpdb->get_col($query);
|
63 |
-
}
|
64 |
-
else if($con_type == 'remote') {
|
65 |
-
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
66 |
-
$query = "SHOW TABLES";
|
67 |
-
$tables = $wpdb_temp->get_col($query);
|
68 |
-
}
|
69 |
-
//$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
70 |
-
return $tables;
|
71 |
-
}
|
72 |
-
|
73 |
-
function get_table_struct() {
|
74 |
-
global $wpdb;
|
75 |
-
$name = isset($_POST['name']) ? $_POST['name'] : NULL;
|
76 |
-
if(!$name)
|
77 |
-
return array();
|
78 |
-
$con_method = $_POST['con_method'];
|
79 |
-
$con_type = $_POST['con_type'];
|
80 |
-
$query = "SHOW COLUMNS FROM " . $name;
|
81 |
-
if($con_type == 'remote') {
|
82 |
-
$username = isset($_POST['username']) ? $_POST['username'] : '';
|
83 |
-
$password = isset($_POST['password']) ? $_POST['password'] : '';
|
84 |
-
$database = isset($_POST['database']) ? $_POST['database'] : '';
|
85 |
-
$host = isset($_POST['host']) ? $_POST['host'] : '';
|
86 |
-
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
87 |
-
$table_struct = $wpdb_temp->get_results($query);
|
88 |
-
}
|
89 |
-
else {
|
90 |
-
$table_struct = $wpdb->get_results($query);
|
91 |
-
}
|
92 |
-
//$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
93 |
-
return $table_struct;
|
94 |
-
}
|
95 |
-
|
96 |
-
function get_table_struct_saved($con_type, $username, $password, $database, $host, $name, $con_method) {
|
97 |
-
global $wpdb;
|
98 |
-
if(!$name)
|
99 |
-
return array();
|
100 |
-
$query = "SHOW COLUMNS FROM " . $name;
|
101 |
-
if($con_type == 'remote') {
|
102 |
-
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
103 |
-
$table_struct = $wpdb_temp->get_results($query);
|
104 |
-
}
|
105 |
-
else {
|
106 |
-
$table_struct = $wpdb->get_results($query);
|
107 |
-
}
|
108 |
-
//$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
109 |
-
return $table_struct;
|
110 |
-
}
|
111 |
-
|
112 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
113 |
-
// Getters & Setters //
|
114 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
115 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
116 |
-
// Private Methods //
|
117 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
118 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
119 |
-
// Listeners //
|
120 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
121 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/models/FMModelFormMakerSubmits.php
DELETED
@@ -1,43 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMModelFormMakerSubmits_fmc {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
|
22 |
-
public function get_from_label_order($form_id) {
|
23 |
-
global $wpdb;
|
24 |
-
$label_order = $wpdb->get_var($wpdb->prepare('SELECT `label_order` FROM `' . $wpdb->prefix . 'formmaker` WHERE id="%d"', $form_id));
|
25 |
-
return $label_order;
|
26 |
-
}
|
27 |
-
|
28 |
-
public function get_submissions($group_id) {
|
29 |
-
global $wpdb;
|
30 |
-
$row = $wpdb->get_results($wpdb->prepare('SELECT * FROM `' . $wpdb->prefix . 'formmaker_submits` WHERE group_id="%d"', $group_id));
|
31 |
-
return $row;
|
32 |
-
}
|
33 |
-
|
34 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
35 |
-
// Getters & Setters //
|
36 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
37 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
38 |
-
// Private Methods //
|
39 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
40 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
41 |
-
// Listeners //
|
42 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
43 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/models/FMModelFormmakerwdcaptcha.php
DELETED
@@ -1,31 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMModelFormmakerwdcaptcha_fmc {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
|
22 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
23 |
-
// Getters & Setters //
|
24 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
25 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
26 |
-
// Private Methods //
|
27 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
28 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
29 |
-
// Listeners //
|
30 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
31 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/models/FMModelFormmakerwdmathcaptcha.php
DELETED
@@ -1,31 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMModelFormmakerwdmathcaptcha_fmc {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
|
22 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
23 |
-
// Getters & Setters //
|
24 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
25 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
26 |
-
// Private Methods //
|
27 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
28 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
29 |
-
// Listeners //
|
30 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
31 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/models/FMModelFormmakerwindow.php
DELETED
@@ -1,36 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMModelFormmakerwindow_fmc {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
|
22 |
-
public function get_form_data() {
|
23 |
-
global $wpdb;
|
24 |
-
$row = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE `id` IN(" . get_option('contact_form_forms', 0) . ") order by `title`");
|
25 |
-
return $row;
|
26 |
-
}
|
27 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
28 |
-
// Getters & Setters //
|
29 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
30 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
31 |
-
// Private Methods //
|
32 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
33 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
34 |
-
// Listeners //
|
35 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
36 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/models/FMModelFromeditcountryinpopup.php
DELETED
@@ -1,31 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMModelFromeditcountryinpopup_fmc {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
|
22 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
23 |
-
// Getters & Setters //
|
24 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
25 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
26 |
-
// Private Methods //
|
27 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
28 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
29 |
-
// Listeners //
|
30 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
31 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/models/FMModelFromipinfoinpopup.php
DELETED
@@ -1,31 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMModelFromipinfoinpopup_fmc {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
|
22 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
23 |
-
// Getters & Setters //
|
24 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
25 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
26 |
-
// Private Methods //
|
27 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
28 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
29 |
-
// Listeners //
|
30 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
31 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/models/FMModelFrommapeditinpopup.php
DELETED
@@ -1,31 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMModelFrommapeditinpopup_fmc {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
|
22 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
23 |
-
// Getters & Setters //
|
24 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
25 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
26 |
-
// Private Methods //
|
27 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
28 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
29 |
-
// Listeners //
|
30 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
31 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/models/FMModelGenerete_csv.php
DELETED
@@ -1,300 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMModelGenerete_csv_fmc {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function get_data() {
|
22 |
-
global $wpdb;
|
23 |
-
$is_paypal_info = FALSE;
|
24 |
-
$params = array();
|
25 |
-
$group_id_s = array();
|
26 |
-
$form_id = (int)$_REQUEST['form_id'];
|
27 |
-
$limitstart = (int)$_REQUEST['limitstart'];
|
28 |
-
$search_labels = isset($_REQUEST['search_labels']) ? $_REQUEST['search_labels'] : '';
|
29 |
-
$verified_emails = isset($_REQUEST['verified_emails']) ? json_decode(stripslashes($_REQUEST['verified_emails']), true) : array();
|
30 |
-
|
31 |
-
$paypal_info_fields = array('currency', 'ord_last_modified', 'status', 'full_name', 'fax', 'mobile_phone', 'email', 'phone', 'address', 'paypal_info', 'ipn', 'tax', 'shipping');
|
32 |
-
$paypal_info_labels = array( 'Currency', 'Last modified', 'Status', 'Full Name', 'Fax', 'Mobile phone', 'Email', 'Phone', 'Address', 'Paypal info', 'IPN', 'Tax', 'Shipping');
|
33 |
-
|
34 |
-
|
35 |
-
if($search_labels){
|
36 |
-
$query = $wpdb->prepare("SELECT distinct group_id FROM " . $wpdb->prefix . "formmaker_submits where form_id=%d and group_id IN(".$search_labels.")", $form_id);
|
37 |
-
$group_id_s = $wpdb->get_col($query);
|
38 |
-
}
|
39 |
-
|
40 |
-
|
41 |
-
$query = $wpdb->prepare("SELECT distinct element_label FROM " . $wpdb->prefix . "formmaker_submits where form_id=%d",$form_id);
|
42 |
-
$labels = $wpdb->get_col($query);
|
43 |
-
|
44 |
-
$query_lable = $wpdb->prepare("SELECT label_order,title FROM " . $wpdb->prefix . "formmaker where id=%d", $form_id);
|
45 |
-
$rows_lable = $wpdb->get_results($query_lable);
|
46 |
-
$ptn = "/[^a-zA-Z0-9_]/";
|
47 |
-
$rpltxt = "";
|
48 |
-
$title = isset($rows_lable[0]) ? preg_replace($ptn, $rpltxt, $rows_lable[0]->title) : '';
|
49 |
-
|
50 |
-
$sorted_labels_id = array();
|
51 |
-
$sorted_labels = array();
|
52 |
-
$sorted_types = array();
|
53 |
-
$label_titles = array();
|
54 |
-
$label_id = array();
|
55 |
-
$label_order = array();
|
56 |
-
$label_order_original = array();
|
57 |
-
$label_type = array();
|
58 |
-
if ($labels) {
|
59 |
-
$label_all = explode('#****#', $rows_lable[0]->label_order);
|
60 |
-
$label_all = array_slice($label_all, 0, count($label_all) - 1);
|
61 |
-
foreach ($label_all as $key => $label_each) {
|
62 |
-
$label_id_each = explode('#**id**#', $label_each);
|
63 |
-
array_push($label_id, $label_id_each[0]);
|
64 |
-
$label_oder_each = explode('#**label**#', $label_id_each[1]);
|
65 |
-
array_push($label_order_original, $label_oder_each[0]);
|
66 |
-
$label_temp = preg_replace($ptn, $rpltxt, $label_oder_each[0]);
|
67 |
-
array_push($label_order, $label_temp);
|
68 |
-
array_push($label_type, $label_oder_each[1]);
|
69 |
-
}
|
70 |
-
foreach ($label_id as $key => $label) {
|
71 |
-
if (in_array($label, $labels) && $label_type[$key] !='type_arithmetic_captcha') {
|
72 |
-
array_push($sorted_labels, $label_order[$key]);
|
73 |
-
array_push($sorted_labels_id, $label);
|
74 |
-
array_push($label_titles, stripslashes($label_order_original[$key]));
|
75 |
-
array_push($sorted_types, $label_type[$key]);
|
76 |
-
}
|
77 |
-
}
|
78 |
-
}
|
79 |
-
|
80 |
-
$m = count($sorted_labels);
|
81 |
-
$wpdb->query("SET SESSION group_concat_max_len = 1000000");
|
82 |
-
|
83 |
-
$rows = array();
|
84 |
-
|
85 |
-
if($search_labels){
|
86 |
-
$query = $wpdb->prepare("SELECT group_id, ip, date, user_id_wd, GROUP_CONCAT( element_label SEPARATOR ',') as element_label, GROUP_CONCAT( element_value SEPARATOR '*:*el_value*:*') as element_value FROM " . $wpdb->prefix . "formmaker_submits where form_id= %d and group_id IN (".$search_labels.") GROUP BY group_id ORDER BY date ASC limit %d, %d", $form_id, $limitstart, 1000);
|
87 |
-
$rows = $wpdb->get_results($query, OBJECT_K);
|
88 |
-
}
|
89 |
-
|
90 |
-
|
91 |
-
$data = array();
|
92 |
-
$group_id_s_count = $limitstart + 1000 < count($group_id_s) ? $limitstart + 1000 : count($group_id_s);
|
93 |
-
|
94 |
-
sort($group_id_s,SORT_NUMERIC);
|
95 |
-
for ($www = $limitstart; $www < $group_id_s_count; $www++) {
|
96 |
-
$i = $group_id_s[$www];
|
97 |
-
$field_key = array_search($i, $label_id);
|
98 |
-
if($label_type[$field_key] != 'type_arithmetic_captcha') {
|
99 |
-
$data_temp = array();
|
100 |
-
$tt = $rows[$i];
|
101 |
-
|
102 |
-
$date = $tt->date;
|
103 |
-
$ip = $tt->ip;
|
104 |
-
$user_id = get_userdata($tt->user_id_wd);
|
105 |
-
$username = $user_id ? $user_id->display_name : "";
|
106 |
-
$useremail = $user_id ? $user_id->user_email : "";
|
107 |
-
$data_temp['Submission ID'] = $i;
|
108 |
-
$data_temp['Submit date'] = $date;
|
109 |
-
$data_temp['Ip']=$ip;
|
110 |
-
$data_temp['Submitter\'s Username']=$username;
|
111 |
-
$data_temp['Submitter\'s Email Address']=$useremail;
|
112 |
-
|
113 |
-
$element_labels = explode(',', $tt->element_label);
|
114 |
-
$element_values = explode('*:*el_value*:*', $tt->element_value);
|
115 |
-
|
116 |
-
|
117 |
-
for ($h = 0; $h < $m; $h++) {
|
118 |
-
if(isset($data_temp[$label_titles[$h]]))
|
119 |
-
$label_titles[$h] .= '(1)';
|
120 |
-
|
121 |
-
if(in_array($sorted_labels_id[$h], $element_labels)) {
|
122 |
-
$element_value = $element_values[array_search($sorted_labels_id[$h], $element_labels)];
|
123 |
-
|
124 |
-
if (strpos($element_value, "*@@url@@*")) {
|
125 |
-
$file_names = '';
|
126 |
-
$new_files = explode("*@@url@@*", $element_value);
|
127 |
-
foreach ($new_files as $new_file) {
|
128 |
-
if ($new_file) {
|
129 |
-
$file_names .= $new_file . ", ";
|
130 |
-
}
|
131 |
-
}
|
132 |
-
$data_temp[stripslashes($label_titles[$h])] = $file_names;
|
133 |
-
}
|
134 |
-
elseif (strpos($element_value, "***br***")) {
|
135 |
-
$element_value = str_replace("***br***", ', ', $element_value);
|
136 |
-
if (strpos($element_value, "***quantity***")) {
|
137 |
-
$element_value = str_replace("***quantity***", '', $element_value);
|
138 |
-
}
|
139 |
-
if (strpos($element_value, "***property***")) {
|
140 |
-
$element_value = str_replace("***property***", '', $element_value);
|
141 |
-
}
|
142 |
-
if(substr($element_value, -2) == ', ') {
|
143 |
-
$data_temp[stripslashes($label_titles[$h])]= substr($element_value, 0, -2);
|
144 |
-
}
|
145 |
-
else {
|
146 |
-
$data_temp[stripslashes($label_titles[$h])]= $element_value;
|
147 |
-
}
|
148 |
-
}
|
149 |
-
elseif (strpos($element_value, "***map***")) {
|
150 |
-
$data_temp[stripslashes($label_titles[$h])] = 'Longitude:' . str_replace("***map***", ', Latitude:', $element_value);
|
151 |
-
}
|
152 |
-
elseif (strpos($element_value, "***star_rating***")) {
|
153 |
-
$element = str_replace("***star_rating***", '', $element_value);
|
154 |
-
$element = explode("***", $element);
|
155 |
-
$data_temp[stripslashes($label_titles[$h])] = ' ' . $element[1] . '/' . $element[0];
|
156 |
-
}
|
157 |
-
elseif (strpos($element_value, "@@@") !== FALSE) {
|
158 |
-
$data_temp[stripslashes($label_titles[$h])] = str_replace("@@@", ' ', $element_value);
|
159 |
-
}
|
160 |
-
elseif (strpos($element_value, "***grading***")) {
|
161 |
-
$element = str_replace("***grading***", '', $element_value);
|
162 |
-
$grading = explode(":", $element);
|
163 |
-
$items_count = sizeof($grading) - 1;
|
164 |
-
$items = "";
|
165 |
-
$total = "";
|
166 |
-
for ($k = 0; $k < $items_count / 2; $k++) {
|
167 |
-
$items .= $grading[$items_count / 2 + $k] . ": " . $grading[$k] . ", ";
|
168 |
-
$total += $grading[$k];
|
169 |
-
}
|
170 |
-
$items .= "Total: " . $total;
|
171 |
-
$data_temp[stripslashes($label_titles[$h])] = $items;
|
172 |
-
}
|
173 |
-
elseif (strpos($element_value, "***matrix***")) {
|
174 |
-
$element = str_replace("***matrix***", '', $element_value);
|
175 |
-
$matrix_value = explode('***', $element);
|
176 |
-
$matrix_value = array_slice($matrix_value, 0, count($matrix_value) - 1);
|
177 |
-
$mat_rows = $matrix_value[0];
|
178 |
-
$mat_columns = $matrix_value[$mat_rows + 1];
|
179 |
-
$matrix = "";
|
180 |
-
$aaa = array();
|
181 |
-
$var_checkbox = 1;
|
182 |
-
$selected_value = "";
|
183 |
-
$selected_value_yes = "";
|
184 |
-
$selected_value_no = "";
|
185 |
-
for ($k = 1; $k <= $mat_rows; $k++) {
|
186 |
-
if ($matrix_value[$mat_rows + $mat_columns + 2] == "radio") {
|
187 |
-
if ($matrix_value[$mat_rows + $mat_columns + 2 + $k] == 0) {
|
188 |
-
$checked = "0";
|
189 |
-
$aaa[1] = "";
|
190 |
-
}
|
191 |
-
else {
|
192 |
-
$aaa = explode("_", $matrix_value[$mat_rows + $mat_columns + 2 + $k]);
|
193 |
-
}
|
194 |
-
for ($l = 1; $l <= $mat_columns; $l++) {
|
195 |
-
$checked = $aaa[1] == $l ? '1' : '0';
|
196 |
-
$matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$checked."; ";
|
197 |
-
}
|
198 |
-
}
|
199 |
-
else {
|
200 |
-
if ($matrix_value[$mat_rows+$mat_columns + 2] == "checkbox") {
|
201 |
-
for ($l = 1; $l <= $mat_columns; $l++) {
|
202 |
-
$checked = $matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox] == 1 ? '1' : '0';
|
203 |
-
$matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$checked."; ";
|
204 |
-
$var_checkbox++;
|
205 |
-
}
|
206 |
-
}
|
207 |
-
else {
|
208 |
-
if ($matrix_value[$mat_rows+$mat_columns + 2] == "text") {
|
209 |
-
for ($l = 1; $l <= $mat_columns; $l++) {
|
210 |
-
$text_value = $matrix_value[$mat_rows+$mat_columns+2+$var_checkbox];
|
211 |
-
$matrix .='['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$text_value."; ";
|
212 |
-
$var_checkbox++;
|
213 |
-
}
|
214 |
-
}
|
215 |
-
else {
|
216 |
-
for ($l = 1; $l <= $mat_columns; $l++) {
|
217 |
-
$selected_text = $matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox];
|
218 |
-
$matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows + 1 + $l].']='.$selected_text."; ";
|
219 |
-
$var_checkbox++;
|
220 |
-
}
|
221 |
-
}
|
222 |
-
}
|
223 |
-
}
|
224 |
-
}
|
225 |
-
$data_temp[stripslashes($label_titles[$h])] = $matrix;
|
226 |
-
}
|
227 |
-
else {
|
228 |
-
$val = strip_tags(htmlspecialchars_decode($element_value));
|
229 |
-
$val = stripslashes(str_replace(''', "'", $val));
|
230 |
-
$data_temp[stripslashes($label_titles[$h])] = ($element_value ? $val : '');
|
231 |
-
}
|
232 |
-
}
|
233 |
-
else {
|
234 |
-
$data_temp[stripslashes($label_titles[$h])] = '';
|
235 |
-
}
|
236 |
-
|
237 |
-
if(isset($verified_emails[$sorted_labels_id[$h]]) && $sorted_types[$h] == "type_submitter_mail") {
|
238 |
-
if($data_temp[stripslashes($label_titles[$h])] == '') {
|
239 |
-
$data_temp[stripslashes($label_titles[$h]).'(verified)'] = '';
|
240 |
-
} else {
|
241 |
-
if(in_array($i, $verified_emails[$sorted_labels_id[$h]])){
|
242 |
-
$data_temp[stripslashes($label_titles[$h]).'(verified)']= 'yes';
|
243 |
-
} else{
|
244 |
-
$data_temp[stripslashes($label_titles[$h]).'(verified)']= 'no';
|
245 |
-
}
|
246 |
-
}
|
247 |
-
}
|
248 |
-
}
|
249 |
-
|
250 |
-
$query = $wpdb->prepare("SELECT id FROM " . $wpdb->prefix . "formmaker_submits where element_label=%s AND form_id = %d AND group_id=%d",'item_total', $form_id, $i);
|
251 |
-
$is_paypal = $wpdb->get_results($query);
|
252 |
-
|
253 |
-
if($is_paypal) {
|
254 |
-
$item_total = $wpdb->get_var($wpdb->prepare("SELECT `element_value` FROM " . $wpdb->prefix . "formmaker_submits where group_id=%d AND element_label=%s", $i, 'item_total'));
|
255 |
-
$total = $wpdb->get_var($wpdb->prepare("SELECT `element_value` FROM " . $wpdb->prefix . "formmaker_submits where group_id=%d AND element_label=%s", $i, 'total'));
|
256 |
-
$payment_status = $wpdb->get_var($wpdb->prepare("SELECT `element_value` FROM " . $wpdb->prefix . "formmaker_submits where group_id=%d AND element_label=%s", $i, '0'));
|
257 |
-
$data_temp['Item Total'] = $item_total;
|
258 |
-
$data_temp['Total'] = $total;
|
259 |
-
$data_temp['Payment Status'] = $payment_status;
|
260 |
-
}
|
261 |
-
$query = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker_sessions where group_id=%d",$i);
|
262 |
-
$paypal_info = $wpdb->get_results($query);
|
263 |
-
if ($paypal_info) {
|
264 |
-
$is_paypal_info = TRUE;
|
265 |
-
}
|
266 |
-
if ($is_paypal) {
|
267 |
-
foreach ($paypal_info_fields as $key=>$paypal_info_field) {
|
268 |
-
if ($paypal_info) {
|
269 |
-
$data_temp['PAYPAL_'.$paypal_info_labels[$key]]=$paypal_info[0]->$paypal_info_field;
|
270 |
-
}
|
271 |
-
else {
|
272 |
-
$data_temp['PAYPAL_'.$paypal_info_labels[$key]]='';
|
273 |
-
}
|
274 |
-
}
|
275 |
-
}
|
276 |
-
|
277 |
-
$data[$i] = $data_temp;
|
278 |
-
}
|
279 |
-
|
280 |
-
}
|
281 |
-
|
282 |
-
|
283 |
-
array_push($params, $data);
|
284 |
-
array_push($params, $title);
|
285 |
-
array_push($params, $is_paypal_info);
|
286 |
-
return $params;
|
287 |
-
|
288 |
-
}
|
289 |
-
|
290 |
-
|
291 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
292 |
-
// Getters & Setters //
|
293 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
294 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
295 |
-
// Private Methods //
|
296 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
297 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
298 |
-
// Listeners //
|
299 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
300 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/models/FMModelGenerete_xml.php
DELETED
@@ -1,301 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMModelGenerete_xml_fmc {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
|
22 |
-
public function get_data() {
|
23 |
-
global $wpdb;
|
24 |
-
$is_paypal_info = FALSE;
|
25 |
-
$params = array();
|
26 |
-
$group_id_s = array();
|
27 |
-
$form_id = (int)$_REQUEST['form_id'];
|
28 |
-
$limitstart = (int)$_REQUEST['limitstart'];
|
29 |
-
$search_labels = isset($_REQUEST['search_labels']) ? $_REQUEST['search_labels'] : '';
|
30 |
-
$verified_emails = isset($_REQUEST['verified_emails']) ? json_decode(stripslashes($_REQUEST['verified_emails']), true) : array();
|
31 |
-
|
32 |
-
$paypal_info_fields = array('currency', 'ord_last_modified', 'status', 'full_name', 'fax', 'mobile_phone', 'email', 'phone', 'address', 'paypal_info', 'ipn', 'tax', 'shipping');
|
33 |
-
$paypal_info_labels = array( 'Currency', 'Last modified', 'Status', 'Full Name', 'Fax', 'Mobile phone', 'Email', 'Phone', 'Address', 'Paypal info', 'IPN', 'Tax', 'Shipping');
|
34 |
-
|
35 |
-
if($search_labels){
|
36 |
-
$query = $wpdb->prepare("SELECT distinct group_id FROM " . $wpdb->prefix . "formmaker_submits where form_id=%d and group_id IN(".$search_labels.")", $form_id);
|
37 |
-
$group_id_s = $wpdb->get_col($query);
|
38 |
-
}
|
39 |
-
|
40 |
-
$query = $wpdb->prepare("SELECT distinct element_label FROM " . $wpdb->prefix . "formmaker_submits where form_id=%d",$form_id);
|
41 |
-
$labels = $wpdb->get_col($query);
|
42 |
-
|
43 |
-
$query_lable = $wpdb->prepare("SELECT label_order,title FROM " . $wpdb->prefix . "formmaker where id=%d", $form_id);
|
44 |
-
$rows_lable = $wpdb->get_results($query_lable);
|
45 |
-
$ptn = "/[^a-zA-Z0-9_]/";
|
46 |
-
$rpltxt = "";
|
47 |
-
$title = isset($rows_lable[0]) ? preg_replace($ptn, $rpltxt, $rows_lable[0]->title) : '';
|
48 |
-
|
49 |
-
$sorted_labels_id = array();
|
50 |
-
$sorted_labels = array();
|
51 |
-
$label_titles = array();
|
52 |
-
$sorted_types = array();
|
53 |
-
$label_id = array();
|
54 |
-
$label_order = array();
|
55 |
-
$label_order_original = array();
|
56 |
-
$label_type = array();
|
57 |
-
if ($labels) {
|
58 |
-
$label_all = explode('#****#', $rows_lable[0]->label_order);
|
59 |
-
$label_all = array_slice($label_all, 0, count($label_all) - 1);
|
60 |
-
foreach ($label_all as $key => $label_each) {
|
61 |
-
$label_id_each = explode('#**id**#', $label_each);
|
62 |
-
array_push($label_id, $label_id_each[0]);
|
63 |
-
$label_oder_each = explode('#**label**#', $label_id_each[1]);
|
64 |
-
array_push($label_order_original, $label_oder_each[0]);
|
65 |
-
$label_temp = preg_replace($ptn, $rpltxt, $label_oder_each[0]);
|
66 |
-
array_push($label_order, $label_temp);
|
67 |
-
array_push($label_type, $label_oder_each[1]);
|
68 |
-
}
|
69 |
-
foreach ($label_id as $key => $label) {
|
70 |
-
if (in_array($label, $labels) && $label_type[$key] !='type_arithmetic_captcha') {
|
71 |
-
array_push($sorted_labels, $label_order[$key]);
|
72 |
-
array_push($sorted_labels_id, $label);
|
73 |
-
array_push($label_titles, stripslashes($label_order_original[$key]));
|
74 |
-
array_push($sorted_types, $label_type[$key]);
|
75 |
-
}
|
76 |
-
}
|
77 |
-
}
|
78 |
-
|
79 |
-
$m = count($sorted_labels);
|
80 |
-
|
81 |
-
$rows = array();
|
82 |
-
|
83 |
-
if($search_labels){
|
84 |
-
$query = $wpdb->prepare("SELECT group_id, ip, date, user_id_wd, GROUP_CONCAT( element_label SEPARATOR ',') as element_label, GROUP_CONCAT( element_value SEPARATOR '*:*el_value*:*') as element_value FROM " . $wpdb->prefix . "formmaker_submits where form_id= %d and group_id IN(".$search_labels.") GROUP BY group_id ORDER BY date ASC limit %d, %d", $form_id, $limitstart, 1000);
|
85 |
-
$rows = $wpdb->get_results($query, OBJECT_K);
|
86 |
-
}
|
87 |
-
|
88 |
-
$data = array();
|
89 |
-
$group_id_s_count = $limitstart + 1000 < count($group_id_s) ? $limitstart + 1000 : count($group_id_s);
|
90 |
-
|
91 |
-
sort($group_id_s,SORT_NUMERIC);
|
92 |
-
for ($www = $limitstart; $www < $group_id_s_count; $www++) {
|
93 |
-
|
94 |
-
$i = $group_id_s[$www];
|
95 |
-
|
96 |
-
$field_key = array_search($i, $label_id);
|
97 |
-
if($label_type[$field_key] != 'type_arithmetic_captcha') {
|
98 |
-
$data_temp = array();
|
99 |
-
$tt = $rows[$i];
|
100 |
-
|
101 |
-
$date = $tt->date;
|
102 |
-
$ip = $tt->ip;
|
103 |
-
$user_id = get_userdata($tt->user_id_wd);
|
104 |
-
$username = $user_id ? $user_id->display_name : "";
|
105 |
-
$useremail = $user_id ? $user_id->user_email : "";
|
106 |
-
$data_temp['Submit date'] = $date;
|
107 |
-
$data_temp['Ip']=$ip;
|
108 |
-
$data_temp['Submitter\'s Username']=$username;
|
109 |
-
$data_temp['Submitter\'s Email Address']=$useremail;
|
110 |
-
|
111 |
-
$element_labels = explode(',', $tt->element_label);
|
112 |
-
$element_values = explode('*:*el_value*:*', $tt->element_value);
|
113 |
-
for ($h = 0; $h < $m; $h++) {
|
114 |
-
if(isset($data_temp[$label_titles[$h]]))
|
115 |
-
$label_titles[$h] .= '(1)';
|
116 |
-
|
117 |
-
if(in_array($sorted_labels_id[$h], $element_labels)) {
|
118 |
-
$element_value = $element_values[array_search($sorted_labels_id[$h], $element_labels)];
|
119 |
-
|
120 |
-
if (strpos($element_value, "*@@url@@*")) {
|
121 |
-
$file_names = '';
|
122 |
-
$new_files = explode("*@@url@@*", $element_value);
|
123 |
-
foreach ($new_files as $new_file) {
|
124 |
-
if ($new_file) {
|
125 |
-
$file_names .= $new_file . ", ";
|
126 |
-
}
|
127 |
-
}
|
128 |
-
$data_temp[stripslashes($label_titles[$h])] = $file_names;
|
129 |
-
}
|
130 |
-
elseif (strpos($element_value, "***br***")) {
|
131 |
-
$element_value = str_replace("***br***", ', ', $element_value);
|
132 |
-
if (strpos($element_value, "***quantity***")) {
|
133 |
-
$element_value = str_replace("***quantity***", '', $element_value);
|
134 |
-
}
|
135 |
-
if (strpos($element_value, "***property***")) {
|
136 |
-
$element_value = str_replace("***property***", '', $element_value);
|
137 |
-
}
|
138 |
-
if(substr($element_value, -2) == ', ') {
|
139 |
-
$data_temp[stripslashes($label_titles[$h])]= substr($element_value, 0, -2);
|
140 |
-
}
|
141 |
-
else {
|
142 |
-
$data_temp[stripslashes($label_titles[$h])]= $element_value;
|
143 |
-
}
|
144 |
-
}
|
145 |
-
elseif (strpos($element_value, "***map***")) {
|
146 |
-
$data_temp[stripslashes($label_titles[$h])] = 'Longitude:' . str_replace("***map***", ', Latitude:', $element_value);
|
147 |
-
}
|
148 |
-
elseif (strpos($element_value, "***star_rating***")) {
|
149 |
-
$element = str_replace("***star_rating***", '', $element_value);
|
150 |
-
$element = explode("***", $element);
|
151 |
-
$data_temp[stripslashes($label_titles[$h])] = ' ' . $element[1] . '/' . $element[0];
|
152 |
-
}
|
153 |
-
elseif (strpos($element_value, "@@@") !== FALSE) {
|
154 |
-
$data_temp[stripslashes($label_titles[$h])] = str_replace("@@@", ' ', $element_value);
|
155 |
-
}
|
156 |
-
elseif (strpos($element_value, "***grading***")) {
|
157 |
-
$element = str_replace("***grading***", '', $element_value);
|
158 |
-
$grading = explode(":", $element);
|
159 |
-
$items_count = sizeof($grading) - 1;
|
160 |
-
$items = "";
|
161 |
-
$total = "";
|
162 |
-
for ($k = 0; $k < $items_count / 2; $k++) {
|
163 |
-
$items .= $grading[$items_count / 2 + $k] . ": " . $grading[$k] . ", ";
|
164 |
-
$total += $grading[$k];
|
165 |
-
}
|
166 |
-
$items .= "Total: " . $total;
|
167 |
-
$data_temp[stripslashes($label_titles[$h])] = $items;
|
168 |
-
}
|
169 |
-
elseif (strpos($element_value, "***matrix***")) {
|
170 |
-
$element = str_replace("***matrix***", '', $element_value);
|
171 |
-
$matrix_value = explode('***', $element);
|
172 |
-
$matrix_value = array_slice($matrix_value, 0, count($matrix_value) - 1);
|
173 |
-
$mat_rows = $matrix_value[0];
|
174 |
-
$mat_columns = $matrix_value[$mat_rows + 1];
|
175 |
-
$matrix = "";
|
176 |
-
$aaa = array();
|
177 |
-
$var_checkbox = 1;
|
178 |
-
$selected_value = "";
|
179 |
-
$selected_value_yes = "";
|
180 |
-
$selected_value_no = "";
|
181 |
-
for ($k = 1; $k <= $mat_rows; $k++) {
|
182 |
-
if ($matrix_value[$mat_rows + $mat_columns + 2] == "radio") {
|
183 |
-
if ($matrix_value[$mat_rows + $mat_columns + 2 + $k] == 0) {
|
184 |
-
$checked = "0";
|
185 |
-
$aaa[1] = "";
|
186 |
-
}
|
187 |
-
else {
|
188 |
-
$aaa = explode("_", $matrix_value[$mat_rows + $mat_columns + 2 + $k]);
|
189 |
-
}
|
190 |
-
for ($l = 1; $l <= $mat_columns; $l++) {
|
191 |
-
$checked = $aaa[1] == $l ? '1' : '0';
|
192 |
-
$matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$checked."; ";
|
193 |
-
}
|
194 |
-
}
|
195 |
-
else {
|
196 |
-
if ($matrix_value[$mat_rows+$mat_columns + 2] == "checkbox") {
|
197 |
-
for ($l = 1; $l <= $mat_columns; $l++) {
|
198 |
-
$checked = $matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox] == 1 ? '1' : '0';
|
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 = strip_tags(htmlspecialchars_decode($element_value));
|
225 |
-
$val = stripslashes(str_replace(''', "'", $val));
|
226 |
-
$data_temp[stripslashes($label_titles[$h])] = ($element_value ? $val : '');
|
227 |
-
}
|
228 |
-
}
|
229 |
-
else
|
230 |
-
$data_temp[stripslashes($label_titles[$h])] = '';
|
231 |
-
|
232 |
-
if(isset($verified_emails[$sorted_labels_id[$h]]) && $sorted_types[$h] == "type_submitter_mail") {
|
233 |
-
if($data_temp[stripslashes($label_titles[$h])] == '') {
|
234 |
-
$data_temp[stripslashes($label_titles[$h]).'(verified)'] = '';
|
235 |
-
} else {
|
236 |
-
if(in_array($i, $verified_emails[$sorted_labels_id[$h]])){
|
237 |
-
$data_temp[stripslashes($label_titles[$h]).'(verified)']= 'yes';
|
238 |
-
} else{
|
239 |
-
$data_temp[stripslashes($label_titles[$h]).'(verified)']= 'no';
|
240 |
-
}
|
241 |
-
}
|
242 |
-
}
|
243 |
-
}
|
244 |
-
|
245 |
-
$item_total = $wpdb->get_var($wpdb->prepare("SELECT `element_value` FROM " . $wpdb->prefix . "formmaker_submits where group_id=%d AND element_label=%s",$i,'item_total'));
|
246 |
-
|
247 |
-
$total = $wpdb->get_var($wpdb->prepare("SELECT `element_value` FROM " . $wpdb->prefix . "formmaker_submits where group_id=%d AND element_label=%s",$i,'total'));
|
248 |
-
|
249 |
-
$payment_status = $wpdb->get_var($wpdb->prepare("SELECT `element_value` FROM " . $wpdb->prefix . "formmaker_submits where group_id=%d AND element_label=%s",$i,'0'));
|
250 |
-
|
251 |
-
|
252 |
-
if($item_total)
|
253 |
-
$data_temp['Item Total'] = $item_total;
|
254 |
-
|
255 |
-
if($total)
|
256 |
-
$data_temp['Total'] = $total;
|
257 |
-
|
258 |
-
if($payment_status)
|
259 |
-
$data_temp['Payment Status'] = $payment_status;
|
260 |
-
|
261 |
-
$query = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker_sessions where group_id= %d", $i);
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
$paypal_info = $wpdb->get_results($query);
|
266 |
-
if ($paypal_info) {
|
267 |
-
$is_paypal_info = TRUE;
|
268 |
-
}
|
269 |
-
if ($is_paypal_info) {
|
270 |
-
foreach ($paypal_info_fields as $key=>$paypal_info_field) {
|
271 |
-
if ($paypal_info) {
|
272 |
-
$data_temp['PAYPAL_' . $paypal_info_labels[$key]] = $paypal_info[0]->$paypal_info_field;
|
273 |
-
}
|
274 |
-
else {
|
275 |
-
$data_temp['PAYPAL_' . $paypal_info_labels[$key]] = '';
|
276 |
-
}
|
277 |
-
}
|
278 |
-
}
|
279 |
-
|
280 |
-
$data[$i] = $data_temp;
|
281 |
-
}
|
282 |
-
}
|
283 |
-
|
284 |
-
array_push($params, $data);
|
285 |
-
array_push($params, $title);
|
286 |
-
array_push($params, $is_paypal_info);
|
287 |
-
|
288 |
-
return $params;
|
289 |
-
|
290 |
-
}
|
291 |
-
|
292 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
293 |
-
// Getters & Setters //
|
294 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
295 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
296 |
-
// Private Methods //
|
297 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
298 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
299 |
-
// Listeners //
|
300 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
301 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/models/FMModelGoptions_fm.php
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMModelGoptions_fmc {
|
4 |
-
}
|
|
|
|
|
|
|
|
admin/models/FMModelLicensing_fm.php
DELETED
@@ -1,30 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMModelLicensing_fmc {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
22 |
-
// Getters & Setters //
|
23 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
24 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
25 |
-
// Private Methods //
|
26 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
27 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
28 |
-
// Listeners //
|
29 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
30 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/models/FMModelManage_fm.php
DELETED
@@ -1,2887 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMModelManage_fmc {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
public function get_rows_data() {
|
22 |
-
global $wpdb;
|
23 |
-
$where = 'WHERE `id` IN (' . get_option('contact_form_forms', 0) . ')';
|
24 |
-
$where .= ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? ' AND title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
|
25 |
-
$asc_or_desc = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'desc') ? 'desc' : 'asc');
|
26 |
-
$order_by_array = array('id', 'title', 'mail');
|
27 |
-
$order_by = isset($_POST['order_by']) && in_array(esc_html(stripslashes($_POST['order_by'])), $order_by_array) ? esc_html(stripslashes($_POST['order_by'])) : 'id';
|
28 |
-
$order_by = ' ORDER BY `' . $order_by . '` ' . $asc_or_desc;
|
29 |
-
if (isset($_POST['page_number']) && $_POST['page_number']) {
|
30 |
-
$limit = ((int)$_POST['page_number'] - 1) * 20;
|
31 |
-
}
|
32 |
-
else {
|
33 |
-
$limit = 0;
|
34 |
-
}
|
35 |
-
$query = "SELECT * FROM " . $wpdb->prefix . "formmaker " . $where . $order_by . " LIMIT " . $limit . ",20";
|
36 |
-
$rows = $wpdb->get_results($query);
|
37 |
-
return $rows;
|
38 |
-
}
|
39 |
-
|
40 |
-
public function get_row_data($id) {
|
41 |
-
global $wpdb;
|
42 |
-
if ($id != 0) {
|
43 |
-
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
|
44 |
-
}
|
45 |
-
else {
|
46 |
-
$row = new stdClass();
|
47 |
-
$row->id = 0;
|
48 |
-
$row->title = '';
|
49 |
-
$row->mail = '';
|
50 |
-
$row->form = '';
|
51 |
-
$row->form_front = '';
|
52 |
-
$row->theme = 0;
|
53 |
-
$row->javascript = '';
|
54 |
-
$row->submit_text = '';
|
55 |
-
$row->url = '';
|
56 |
-
$row->submit_text_type = 0;
|
57 |
-
$row->script1 = '';
|
58 |
-
$row->script2 = '';
|
59 |
-
$row->script_user1 = '';
|
60 |
-
$row->script_user2 = '';
|
61 |
-
$row->counter = 0;
|
62 |
-
$row->label_order = '';
|
63 |
-
$row->article_id = '';
|
64 |
-
$row->pagination = '';
|
65 |
-
$row->show_title = '';
|
66 |
-
$row->show_numbers = '';
|
67 |
-
$row->public_key = '';
|
68 |
-
$row->private_key = '';
|
69 |
-
$row->recaptcha_theme = '';
|
70 |
-
$row->from_name = '';
|
71 |
-
$row->from_mail = '';
|
72 |
-
$row->label_order_current = '';
|
73 |
-
$row->script_mail_user = '';
|
74 |
-
$row->script_mail = '';
|
75 |
-
$row->tax = 0;
|
76 |
-
$row->payment_currency = '$';
|
77 |
-
$row->paypal_email = '';
|
78 |
-
$row->checkout_mode = 'testmode';
|
79 |
-
$row->paypal_mode = 0;
|
80 |
-
|
81 |
-
$row->published = 1;
|
82 |
-
$row->form_fields = '';
|
83 |
-
$row->savedb = 1;
|
84 |
-
$row->sendemail = 1;
|
85 |
-
$row->requiredmark = '*';
|
86 |
-
$row->reply_to = 0;
|
87 |
-
$row->send_to = 0;
|
88 |
-
$row->autogen_layout = 1;
|
89 |
-
$row->custom_front = '';
|
90 |
-
$row->mail_from_user = '';
|
91 |
-
$row->mail_from_name_user = '';
|
92 |
-
$row->reply_to_user = '';
|
93 |
-
$row->save_uploads = 1;
|
94 |
-
$row->header_title = '';
|
95 |
-
$row->header_description = '';
|
96 |
-
$row->header_image_url = '';
|
97 |
-
$row->header_image_animation = '';
|
98 |
-
$row->header_hide_image = '';
|
99 |
-
}
|
100 |
-
return $row;
|
101 |
-
}
|
102 |
-
|
103 |
-
public function get_row_data_new($id) {
|
104 |
-
global $wpdb;
|
105 |
-
if ($id != 0) {
|
106 |
-
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_backup WHERE backup_id="%d"', $id));
|
107 |
-
$labels2 = array();
|
108 |
-
$label_id = array();
|
109 |
-
$label_order_original = array();
|
110 |
-
$label_type = array();
|
111 |
-
$label_all = explode('#****#', $row->label_order);
|
112 |
-
$label_all = array_slice($label_all, 0, count($label_all) - 1);
|
113 |
-
foreach($label_all as $key => $label_each) {
|
114 |
-
$label_id_each=explode('#**id**#',$label_each);
|
115 |
-
array_push($label_id, $label_id_each[0]);
|
116 |
-
$label_oder_each=explode('#**label**#', $label_id_each[1]);
|
117 |
-
array_push($label_order_original, addslashes($label_oder_each[0]));
|
118 |
-
array_push($label_type, $label_oder_each[1]);
|
119 |
-
}
|
120 |
-
$labels2['id'] = '"' . implode('","', $label_id) . '"';
|
121 |
-
$labels2['label'] = '"' . implode('","', $label_order_original) . '"';
|
122 |
-
$labels2['type'] = '"' . implode('","', $label_type) . '"';
|
123 |
-
$ids = array();
|
124 |
-
$types = array();
|
125 |
-
$labels = array();
|
126 |
-
$paramss = array();
|
127 |
-
$fields = explode('*:*new_field*:*', $row->form_fields);
|
128 |
-
$fields = array_slice($fields, 0, count($fields) - 1);
|
129 |
-
foreach ($fields as $field) {
|
130 |
-
$temp=explode('*:*id*:*',$field);
|
131 |
-
array_push($ids, $temp[0]);
|
132 |
-
$temp=explode('*:*type*:*',$temp[1]);
|
133 |
-
array_push($types, $temp[0]);
|
134 |
-
$temp=explode('*:*w_field_label*:*',$temp[1]);
|
135 |
-
array_push($labels, $temp[0]);
|
136 |
-
array_push($paramss, $temp[1]);
|
137 |
-
}
|
138 |
-
$form = $row->form_front;
|
139 |
-
foreach ($ids as $ids_key => $id) {
|
140 |
-
$label = $labels[$ids_key];
|
141 |
-
$type = $types[$ids_key];
|
142 |
-
$params = $paramss[$ids_key];
|
143 |
-
if (strpos($form, '%'.$id.' - '.$label.'%') || strpos($form, '%'.$id.' -'.$label.'%')) {
|
144 |
-
$rep = '';
|
145 |
-
$arrows='';
|
146 |
-
$param = array();
|
147 |
-
$param['attributes'] = '';
|
148 |
-
switch($type)
|
149 |
-
{
|
150 |
-
case 'type_section_break':
|
151 |
-
{
|
152 |
-
$arrows =$arrows.'<div id="wdform_arrows'.$id.'" class="wdform_arrows" ><div id="X_'.$id.'" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/delete_el.png?ver='. WD_FMC_VERSION.'" title="Remove the field" onclick="remove_section_break("'.$id.'")" onmouseover="chnage_icons_src(this,"delete_el")" onmouseout="chnage_icons_src(this,"delete_el")"></div><div id="edit_'.$id.'" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/edit.png?ver='. WD_FMC_VERSION.'" title="Edit the field" onclick="edit("'.$id.'")" onmouseover="chnage_icons_src(this,"edit")" onmouseout="chnage_icons_src(this,"edit")"><span id="'.$id.'_element_labelform_id_temp" style="display: none;">custom_'.$id.'</span></div><div id="duplicate_'.$id.'" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/duplicate.png?ver='. WD_FMC_VERSION.'" title="Duplicate the field" onclick="duplicate("'.$id.'")" onmouseover="chnage_icons_src(this,"duplicate")" onmouseout="chnage_icons_src(this,"duplicate")"></div></div>';
|
153 |
-
break;
|
154 |
-
}
|
155 |
-
case 'type_editor':
|
156 |
-
{
|
157 |
-
$arrows =$arrows.'<div id="wdform_arrows'.$id.'" class="wdform_arrows" type="type_editor" style="margin-top:0px;"><div id="X_'.$id.'" valign="middle" align="right" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/delete_el.png?ver='. WD_FMC_VERSION.'" 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_FMC_URL . '/images/left.png?ver='. WD_FMC_VERSION.'" 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_FMC_URL . '/images/up.png?ver='. WD_FMC_VERSION.'" 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_FMC_URL . '/images/down.png?ver='. WD_FMC_VERSION.'" 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_FMC_URL . '/images/right.png?ver='. WD_FMC_VERSION.'" 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_FMC_URL . '/images/edit.png?ver='. WD_FMC_VERSION.'" title="Edit the field" onclick="edit("'.$id.'")" onmouseover="chnage_icons_src(this,"edit")" onmouseout="chnage_icons_src(this,"edit")"></div><div id="duplicate_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/duplicate.png?ver='. WD_FMC_VERSION.'" title="Duplicate the field" onclick="duplicate("'.$id.'")" onmouseover="chnage_icons_src(this,"duplicate")" onmouseout="chnage_icons_src(this,"duplicate")"></div><div id="page_up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/page_up.png?ver='. WD_FMC_VERSION.'" 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_FMC_URL . '/images/page_down.png?ver='. WD_FMC_VERSION.'" 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>';
|
158 |
-
break;
|
159 |
-
}
|
160 |
-
|
161 |
-
case 'type_send_copy':
|
162 |
-
case 'type_stripe':
|
163 |
-
case 'type_captcha':
|
164 |
-
case 'type_arithmetic_captcha':
|
165 |
-
case 'type_recaptcha':
|
166 |
-
{
|
167 |
-
$arrows =$arrows.'<div id="wdform_arrows'.$id.'" class="wdform_arrows"><div id="X_'.$id.'" valign="middle" align="right" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/delete_el.png?ver='. WD_FMC_VERSION.'" 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_FMC_URL . '/images/left.png?ver='. WD_FMC_VERSION.'" 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_FMC_URL . '/images/up.png?ver='. WD_FMC_VERSION.'" 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_FMC_URL . '/images/down.png?ver='. WD_FMC_VERSION.'" 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_FMC_URL . '/images/right.png?ver='. WD_FMC_VERSION.'" 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_FMC_URL . '/images/edit.png?ver='. WD_FMC_VERSION.'" title="Edit the field" onclick="edit("'.$id.'")" onmouseover="chnage_icons_src(this,"edit")" onmouseout="chnage_icons_src(this,"edit")"></div><div id="duplicate_'.$id.'" valign="middle" class="element_toolbar"></div><div id="page_up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/page_up.png?ver='. WD_FMC_VERSION.'" 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_FMC_URL . '/images/page_down.png?ver='. WD_FMC_VERSION.'" 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>';
|
168 |
-
break;
|
169 |
-
}
|
170 |
-
|
171 |
-
default :
|
172 |
-
{
|
173 |
-
$arrows =$arrows.'<div id="wdform_arrows'.$id.'" class="wdform_arrows" ><div id="X_'.$id.'" valign="middle" align="right" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/delete_el.png?ver='. WD_FMC_VERSION.'" 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_FMC_URL . '/images/left.png?ver='. WD_FMC_VERSION.'" 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_FMC_URL . '/images/up.png?ver='. WD_FMC_VERSION.'" 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_FMC_URL . '/images/down.png?ver='. WD_FMC_VERSION.'" 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_FMC_URL . '/images/right.png?ver='. WD_FMC_VERSION.'" 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_FMC_URL . '/images/edit.png?ver='. WD_FMC_VERSION.'" title="Edit the field" onclick="edit("'.$id.'")" onmouseover="chnage_icons_src(this,"edit")" onmouseout="chnage_icons_src(this,"edit")"></div><div id="duplicate_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/duplicate.png?ver='. WD_FMC_VERSION.'" title="Duplicate the field" onclick="duplicate("'.$id.'")" onmouseover="chnage_icons_src(this,"duplicate")" onmouseout="chnage_icons_src(this,"duplicate")"></div><div id="page_up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FMC_URL . '/images/page_up.png?ver='. WD_FMC_VERSION.'" 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_FMC_URL . '/images/page_down.png?ver='. WD_FMC_VERSION.'" 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>';
|
174 |
-
break;
|
175 |
-
}
|
176 |
-
|
177 |
-
}
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
switch ($type) {
|
183 |
-
case 'type_section_break': {
|
184 |
-
$params_names = array('w_editor');
|
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 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_section_break" class="wdform_field_section_break">'.$arrows.'<span id="'.$id.'_element_labelform_id_temp" style="display: none;">custom_'.$id.'</span><div id="'.$id.'_element_sectionform_id_temp" align="left" class="wdform_section_break">'.$param['w_editor'].'</div></div><div id="'.$id.'_element_labelform_id_temp" style="color:red;">custom_'.$id.'</div>';
|
192 |
-
break;
|
193 |
-
}
|
194 |
-
case 'type_editor': {
|
195 |
-
$params_names = array('w_editor');
|
196 |
-
$temp = $params;
|
197 |
-
foreach ($params_names as $params_name ) {
|
198 |
-
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
199 |
-
$param[$params_name] = $temp[0];
|
200 |
-
$temp = $temp[1];
|
201 |
-
}
|
202 |
-
$rep =$arrows.'<div id="wdform_field'.$id.'" type="type_editor" class="wdform_field" >'.$param['w_editor'].'</div><div id="'.$id.'_element_labelform_id_temp" style="color: red;">custom_'.$id.'</div>';
|
203 |
-
break;
|
204 |
-
}
|
205 |
-
case 'type_send_copy': {
|
206 |
-
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_required');
|
207 |
-
$temp = $params;
|
208 |
-
|
209 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
210 |
-
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_hide_label', 'w_first_val', 'w_required');
|
211 |
-
|
212 |
-
foreach ($params_names as $params_name ) {
|
213 |
-
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
214 |
-
$param[$params_name] = $temp[0];
|
215 |
-
$temp = $temp[1];
|
216 |
-
}
|
217 |
-
if ($temp) {
|
218 |
-
$temp = explode('*:*w_attr_name*:*', $temp);
|
219 |
-
$attrs = array_slice($temp, 0, count($temp) - 1);
|
220 |
-
foreach ($attrs as $attr) {
|
221 |
-
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
222 |
-
}
|
223 |
-
}
|
224 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
225 |
-
|
226 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
227 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
228 |
-
|
229 |
-
$input_active = ($param['w_first_val'] == 'true' ? "checked='checked'" : "");
|
230 |
-
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
231 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_send_copy" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" style="display: '.$param['w_field_label_pos'].'"><input type="hidden" value="type_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="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_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'].' disabled /></div></div>';
|
232 |
-
break;
|
233 |
-
}
|
234 |
-
case 'type_text': {
|
235 |
-
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_first_val', 'w_title', 'w_required', 'w_unique');
|
236 |
-
$temp = $params;
|
237 |
-
if(strpos($temp, 'w_regExp_status') > -1)
|
238 |
-
$params_names = array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_required', 'w_regExp_status', 'w_regExp_value', 'w_regExp_common', 'w_regExp_arg', 'w_regExp_alert', 'w_unique');
|
239 |
-
|
240 |
-
if(strpos($temp, 'w_readonly') > -1)
|
241 |
-
$params_names = array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_required', 'w_regExp_status', 'w_regExp_value', 'w_regExp_common', 'w_regExp_arg', 'w_regExp_alert', 'w_unique', 'w_readonly');
|
242 |
-
|
243 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
244 |
-
$params_names = array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_size','w_first_val','w_title','w_required', 'w_regExp_status', 'w_regExp_value', 'w_regExp_common', 'w_regExp_arg', 'w_regExp_alert', 'w_unique', 'w_readonly');
|
245 |
-
|
246 |
-
foreach ($params_names as $params_name) {
|
247 |
-
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
248 |
-
$param[$params_name] = $temp[0];
|
249 |
-
$temp = $temp[1];
|
250 |
-
}
|
251 |
-
if ($temp) {
|
252 |
-
$temp = explode('*:*w_attr_name*:*', $temp);
|
253 |
-
$attrs = array_slice($temp, 0, count($temp) - 1);
|
254 |
-
foreach ($attrs as $attr) {
|
255 |
-
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
256 |
-
}
|
257 |
-
}
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
263 |
-
$input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
|
264 |
-
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
265 |
-
|
266 |
-
$param['w_regExp_status'] = (isset($param['w_regExp_status']) ? $param['w_regExp_status'] : "no");
|
267 |
-
$param['w_regExp_value'] = (isset($param['w_regExp_value']) ? $param['w_regExp_value'] : "");
|
268 |
-
$param['w_regExp_common'] = (isset($param['w_regExp_common']) ? $param['w_regExp_common'] : "");
|
269 |
-
$param['w_regExp_arg'] = (isset($param['w_regExp_arg']) ? $param['w_regExp_arg'] : "");
|
270 |
-
$param['w_regExp_alert'] = (isset($param['w_regExp_alert']) ? $param['w_regExp_alert'] : "Incorrect Value");
|
271 |
-
|
272 |
-
$param['w_readonly'] = (isset($param['w_readonly']) ? $param['w_readonly'] : "no");
|
273 |
-
|
274 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
275 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
276 |
-
|
277 |
-
|
278 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_text" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" style="display: '.$param['w_field_label_pos'].'"><input type="hidden" value="type_text" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp" /><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp" /><input type="hidden" value="'.$param['w_readonly'].'" name="'.$id.'_readonlyform_id_temp" id="'.$id.'_readonlyform_id_temp"/><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_regExp_status'].'" name="'.$id.'_regExpStatusform_id_temp" id="'.$id.'_regExpStatusform_id_temp"><input type="hidden" value="'.$param['w_regExp_value'].'" name="'.$id.'_regExp_valueform_id_temp" id="'.$id.'_regExp_valueform_id_temp"><input type="hidden" value="'.$param['w_regExp_common'].'" name="'.$id.'_regExp_commonform_id_temp" id="'.$id.'_regExp_commonform_id_temp"><input type="hidden" value="'.$param['w_regExp_alert'].'" name="'.$id.'_regExp_alertform_id_temp" id="'.$id.'_regExp_alertform_id_temp"><input type="hidden" value="'.$param['w_regExp_arg'].'" name="'.$id.'_regArgumentform_id_temp" id="'.$id.'_regArgumentform_id_temp"><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp" /><input type="text" 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'].' disabled /></div></div>';
|
279 |
-
|
280 |
-
break;
|
281 |
-
}
|
282 |
-
case 'type_number': {
|
283 |
-
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_first_val', 'w_title', 'w_required', 'w_unique', 'w_class');
|
284 |
-
$temp = $params;
|
285 |
-
foreach ($params_names as $params_name) {
|
286 |
-
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
287 |
-
$param[$params_name] = $temp[0];
|
288 |
-
$temp = $temp[1];
|
289 |
-
}
|
290 |
-
if ($temp) {
|
291 |
-
$temp = explode('*:*w_attr_name*:*', $temp);
|
292 |
-
$attrs = array_slice($temp, 0, count($temp) - 1);
|
293 |
-
foreach ($attrs as $attr) {
|
294 |
-
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
295 |
-
}
|
296 |
-
}
|
297 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
298 |
-
$input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
|
299 |
-
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
300 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_number" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'"><input type="hidden" value="type_number" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><input type="text" class="'.$input_active.'" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" value="'.$param['w_first_val'].'" title="'.$param['w_title'].'" onkeypress="return check_isnum(event)" onfocus="delete_value("'.$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'].' disabled /></div></div>';
|
301 |
-
break;
|
302 |
-
}
|
303 |
-
case 'type_password': {
|
304 |
-
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_required', 'w_unique', 'w_class');
|
305 |
-
$temp = $params;
|
306 |
-
|
307 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
308 |
-
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_hide_label', 'w_size', 'w_required', 'w_unique', 'w_class');
|
309 |
-
|
310 |
-
if(strpos($temp, 'w_verification') > -1)
|
311 |
-
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_hide_label', 'w_size', 'w_required', 'w_unique', 'w_class', 'w_verification', 'w_verification_label');
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
foreach ($params_names as $params_name) {
|
316 |
-
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
317 |
-
$param[$params_name] = $temp[0];
|
318 |
-
$temp = $temp[1];
|
319 |
-
}
|
320 |
-
if ($temp) {
|
321 |
-
$temp = explode('*:*w_attr_name*:*', $temp);
|
322 |
-
$attrs = array_slice($temp, 0, count($temp) - 1);
|
323 |
-
foreach ($attrs as $attr) {
|
324 |
-
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
325 |
-
}
|
326 |
-
}
|
327 |
-
|
328 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
329 |
-
|
330 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
331 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
332 |
-
|
333 |
-
|
334 |
-
if(isset($param['w_verification']) && $param['w_verification'] == "yes"){
|
335 |
-
$display_label_confirm = $display_label;
|
336 |
-
$display_element_confirm = $param['w_field_label_pos'];
|
337 |
-
}
|
338 |
-
else{
|
339 |
-
$display_label_confirm = "none";
|
340 |
-
$display_element_confirm = "none";
|
341 |
-
}
|
342 |
-
|
343 |
-
$param['w_verification'] = isset($param['w_verification']) ? $param['w_verification'] : "no";
|
344 |
-
$param['w_verification_label'] = isset($param['w_verification_label']) ? $param['w_verification_label'] : "Password confirmation:";
|
345 |
-
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
346 |
-
|
347 |
-
|
348 |
-
$confirm_password ='<br><div align="left" id="'.$id.'_1_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label_confirm.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_1_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$param['w_verification_label'].'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_1_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_element_confirm.';"><input type="hidden" value="'.$param['w_verification'].'" name="'.$id.'_verification_id_temp" id="'.$id.'_verification_id_temp"><input type="text" class="input_deactive" id="'.$id.'_1_elementform_id_temp" name="'.$id.'_1_elementform_id_temp" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled /></div>';
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_password" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'"><input type="hidden" value="type_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_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><input type="password" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled /></div>'.$confirm_password.'</div>';
|
353 |
-
break;
|
354 |
-
|
355 |
-
}
|
356 |
-
case 'type_textarea': {
|
357 |
-
$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');
|
358 |
-
$temp = $params;
|
359 |
-
|
360 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
361 |
-
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_hide_label', 'w_size_w', 'w_size_h', 'w_first_val', 'w_title', 'w_required', 'w_unique', 'w_class');
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
foreach ($params_names as $params_name) {
|
366 |
-
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
367 |
-
$param[$params_name] = $temp[0];
|
368 |
-
$temp = $temp[1];
|
369 |
-
}
|
370 |
-
if ($temp) {
|
371 |
-
$temp = explode('*:*w_attr_name*:*', $temp);
|
372 |
-
$attrs = array_slice($temp, 0, count($temp) - 1);
|
373 |
-
foreach ($attrs as $attr) {
|
374 |
-
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
375 |
-
}
|
376 |
-
}
|
377 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
378 |
-
$input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
|
379 |
-
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
380 |
-
|
381 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
382 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
383 |
-
|
384 |
-
|
385 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_textarea" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display:'.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: 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_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><textarea 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'].' disabled>'.$param['w_first_val'].'</textarea></div></div>';
|
386 |
-
break;
|
387 |
-
}
|
388 |
-
case 'type_phone': {
|
389 |
-
$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');
|
390 |
-
$temp = $params;
|
391 |
-
|
392 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
393 |
-
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_hide_label', 'w_size', 'w_first_val', 'w_title', 'w_mini_labels', 'w_required', 'w_unique', 'w_class');
|
394 |
-
|
395 |
-
|
396 |
-
foreach ($params_names as $params_name) {
|
397 |
-
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
398 |
-
$param[$params_name] = $temp[0];
|
399 |
-
$temp = $temp[1];
|
400 |
-
}
|
401 |
-
if ($temp) {
|
402 |
-
$temp = explode('*:*w_attr_name*:*', $temp);
|
403 |
-
$attrs = array_slice($temp, 0, count($temp) - 1);
|
404 |
-
foreach ($attrs as $attr) {
|
405 |
-
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
406 |
-
}
|
407 |
-
}
|
408 |
-
$w_first_val = explode('***', $param['w_first_val']);
|
409 |
-
$w_title = explode('***', $param['w_title']);
|
410 |
-
$w_mini_labels = explode('***', $param['w_mini_labels']);
|
411 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
412 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
413 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
414 |
-
|
415 |
-
$input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
|
416 |
-
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
417 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_phone" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_phone" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><div id="'.$id.'_table_name" style="display: table;"><div id="'.$id.'_tr_name1" style="display: table-row;"><div id="'.$id.'_td_name_input_first" style="display: table-cell;"><input type="text" 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'].' disabled /><span class="wdform_line" style="margin: 0px 4px; padding: 0px;">-</span></div><div id="'.$id.'_td_name_input_last" style="display: table-cell;"><input type="text" class="'.$input_active.'" id="'.$id.'_element_lastform_id_temp" name="'.$id.'_element_lastform_id_temp" value="'.$w_first_val[1].'" title="'.$w_title[1].'" onfocus="delete_value("'.$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'].' disabled /></div></div><div id="'.$id.'_tr_name2" style="display: table-row;"><div id="'.$id.'_td_name_label_first" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_area_code">'.$w_mini_labels[0].'</label></div><div id="'.$id.'_td_name_label_last" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_phone_number">'.$w_mini_labels[1].'</label></div></div></div></div></div>';
|
418 |
-
break;
|
419 |
-
}
|
420 |
-
|
421 |
-
case 'type_phone_new': {
|
422 |
-
$temp = $params;
|
423 |
-
$params_names = array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_size','w_first_val', 'w_top_country','w_required','w_unique', 'w_class');
|
424 |
-
|
425 |
-
foreach ($params_names as $params_name) {
|
426 |
-
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
427 |
-
$param[$params_name] = $temp[0];
|
428 |
-
$temp = $temp[1];
|
429 |
-
}
|
430 |
-
if ($temp) {
|
431 |
-
$temp = explode('*:*w_attr_name*:*', $temp);
|
432 |
-
$attrs = array_slice($temp, 0, count($temp) - 1);
|
433 |
-
foreach ($attrs as $attr) {
|
434 |
-
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
435 |
-
}
|
436 |
-
}
|
437 |
-
|
438 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
439 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
440 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
441 |
-
|
442 |
-
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
443 |
-
|
444 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_phone_new" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_phone_new" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><div id="'.$id.'_table_name" style="display: table;"><div id="'.$id.'_tr_name1" style="display: table-row;"><div id="'.$id.'_td_name_input_first" style="display: table-cell;"><input type="text" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" value="'.$param['w_first_val'].'" top-country = "'.$param['w_top_country'].'" onfocus="delete_value("'.$id.'_elementform_id_temp")" onblur="return_value("'.$id.'_elementform_id_temp")" onchange="change_value("'.$id.'_elementform_id_temp")" onkeypress="return check_isnum("'.$id.'_elementform_id_temp")" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled></div></div></div></div></div>';
|
445 |
-
break;
|
446 |
-
}
|
447 |
-
|
448 |
-
|
449 |
-
case 'type_name': {
|
450 |
-
$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');
|
451 |
-
$temp = $params;
|
452 |
-
if(strpos($temp, 'w_name_fields') > -1)
|
453 |
-
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_title', 'w_mini_labels', 'w_size', 'w_name_format', 'w_required', 'w_unique', 'w_class', 'w_name_fields');
|
454 |
-
|
455 |
-
if(strpos($temp, 'w_autofill') > -1)
|
456 |
-
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_title', 'w_mini_labels', 'w_size', 'w_name_format', 'w_required', 'w_unique', 'w_class', 'w_name_fields', 'w_autofill');
|
457 |
-
|
458 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
459 |
-
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_hide_label', 'w_first_val', 'w_title', 'w_mini_labels', 'w_size', 'w_name_format', 'w_required', 'w_unique', 'w_class', 'w_name_fields');
|
460 |
-
|
461 |
-
foreach ($params_names as $params_name) {
|
462 |
-
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
463 |
-
$param[$params_name] = $temp[0];
|
464 |
-
$temp = $temp[1];
|
465 |
-
}
|
466 |
-
if ($temp) {
|
467 |
-
$temp = explode('*:*w_attr_name*:*', $temp);
|
468 |
-
$attrs = array_slice($temp, 0, count($temp) - 1);
|
469 |
-
foreach ($attrs as $attr) {
|
470 |
-
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
471 |
-
}
|
472 |
-
}
|
473 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
474 |
-
|
475 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
476 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
477 |
-
|
478 |
-
|
479 |
-
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
480 |
-
$w_first_val = explode('***', $param['w_first_val']);
|
481 |
-
$w_title = explode('***', $param['w_title']);
|
482 |
-
$w_mini_labels = explode('***', $param['w_mini_labels']);
|
483 |
-
|
484 |
-
$param['w_name_fields'] = isset($param['w_name_fields']) ? $param['w_name_fields'] : ($param['w_name_format'] == 'normal' ? 'no***no' : 'yes***yes');
|
485 |
-
$w_name_fields = explode('***', $param['w_name_fields']);
|
486 |
-
$param['w_autofill'] = isset($param['w_autofill']) ? $param['w_autofill'] : 'no';
|
487 |
-
|
488 |
-
$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'].' disabled /></div><div id="'.$id.'_td_name_input_last" style="display: table-cell;"><input type="text" class="'.($w_first_val[1]==$w_title[1] ? "input_deactive" : "input_active").'" id="'.$id.'_element_lastform_id_temp" name="'.$id.'_element_lastform_id_temp" value="'.$w_first_val[1].'" title="'.$w_title[1].'" onfocus="delete_value("'.$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'].' disabled /></div>';
|
489 |
-
$w_name_format_mini_labels = '<div id="'.$id.'_td_name_label_first" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_first">'.$w_mini_labels[1].'</label></div><div id="'.$id.'_td_name_label_last" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_last">'.$w_mini_labels[2].'</label></div>';
|
490 |
-
|
491 |
-
if($w_name_fields[0] == 'yes') {
|
492 |
-
$w_name_format = '<div id="'.$id.'_td_name_input_title" style="display: table-cell;"><input type="text" class="'.($w_first_val[2]==$w_title[2] ? "input_deactive" : "input_active").'" id="'.$id.'_element_titleform_id_temp" name="'.$id.'_element_titleform_id_temp" value="'.$w_first_val[2].'" title="'.$w_title[2].'" onfocus="delete_value("'.$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;" disabled /></div>'.$w_name_format;
|
493 |
-
$w_name_format_mini_labels ='<div id="'.$id.'_td_name_label_title" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_title">'.$w_mini_labels[0].'</label></div>'.$w_name_format_mini_labels;
|
494 |
-
}
|
495 |
-
|
496 |
-
if($w_name_fields[1] == 'yes') {
|
497 |
-
$w_name_format = $w_name_format.'<div id="'.$id.'_td_name_input_middle" style="display: table-cell;"><input type="text" class="'.($w_first_val[3]==$w_title[3] ? "input_deactive" : "input_active").'" id="'.$id.'_element_middleform_id_temp" name="'.$id.'_element_middleform_id_temp" value="'.$w_first_val[3].'" title="'.$w_title[3].'" onfocus="delete_value("'.$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;" disabled /></div>';
|
498 |
-
$w_name_format_mini_labels = $w_name_format_mini_labels.'<div id="'.$id.'_td_name_label_middle" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_middle">'.$w_mini_labels[3].'</label></div>';
|
499 |
-
}
|
500 |
-
|
501 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_name" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_name" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><input type="hidden" value="'.$param['w_autofill'].'" name="'.$id.'_autofillform_id_temp" id="'.$id.'_autofillform_id_temp"><input type="hidden" name="'.$id.'_enable_fieldsform_id_temp" id="'.$id.'_enable_fieldsform_id_temp" title="'.$w_name_fields[0].'" first="yes" last="yes" middle="'.$w_name_fields[1].'"><div id="'.$id.'_table_name" cellpadding="0" cellspacing="0" style="display: table;"><div id="'.$id.'_tr_name1" style="display: table-row;">'.$w_name_format.'</div><div id="'.$id.'_tr_name2" style="display: table-row;">'.$w_name_format_mini_labels.'</div></div></div></div>';
|
502 |
-
break;
|
503 |
-
}
|
504 |
-
case 'type_address': {
|
505 |
-
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_mini_labels', 'w_disabled_fields', 'w_required', 'w_class');
|
506 |
-
$temp = $params;
|
507 |
-
|
508 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
509 |
-
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_hide_label', 'w_size', 'w_mini_labels', 'w_disabled_fields', 'w_required', 'w_class');
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
foreach ($params_names as $params_name) {
|
514 |
-
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
515 |
-
$param[$params_name] = $temp[0];
|
516 |
-
$temp = $temp[1];
|
517 |
-
}
|
518 |
-
if ($temp) {
|
519 |
-
$temp = explode('*:*w_attr_name*:*', $temp);
|
520 |
-
$attrs = array_slice($temp, 0, count($temp) - 1);
|
521 |
-
foreach ($attrs as $attr) {
|
522 |
-
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
523 |
-
}
|
524 |
-
}
|
525 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
526 |
-
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
527 |
-
|
528 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
529 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
530 |
-
|
531 |
-
|
532 |
-
$w_mini_labels = explode('***', $param['w_mini_labels']);
|
533 |
-
$w_disabled_fields = explode('***', $param['w_disabled_fields']);
|
534 |
-
$hidden_inputs = '';
|
535 |
-
$labels_for_id = array('street1', 'street2', 'city', 'state', 'postal', 'country');
|
536 |
-
foreach ($w_disabled_fields as $key => $w_disabled_field) {
|
537 |
-
if ($key != 6) {
|
538 |
-
if ($w_disabled_field == 'yes') {
|
539 |
-
$hidden_inputs .= '<input type="hidden" id="'.$id.'_'.$labels_for_id[$key].'form_id_temp" value="'.$w_mini_labels[$key].'" id_for_label="'.($id+$key).'">';
|
540 |
-
}
|
541 |
-
}
|
542 |
-
}
|
543 |
-
$address_fields ='';
|
544 |
-
$g=0;
|
545 |
-
if($w_disabled_fields[0]=='no')
|
546 |
-
{
|
547 |
-
$g+=2;
|
548 |
-
$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'].' disabled /><label class="mini_label" id="'.$id.'_mini_label_street1" style="display: block;">'.$w_mini_labels[0].'</label></span>';
|
549 |
-
}
|
550 |
-
|
551 |
-
if($w_disabled_fields[1]=='no')
|
552 |
-
{
|
553 |
-
$g+=2;
|
554 |
-
$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'].' disabled /><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_street2">'.$w_mini_labels[1].'</label></span>';
|
555 |
-
}
|
556 |
-
|
557 |
-
if($w_disabled_fields[2]=='no')
|
558 |
-
{
|
559 |
-
$g++;
|
560 |
-
$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'].' disabled /><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_city">'.$w_mini_labels[2].'</label></span>';
|
561 |
-
}
|
562 |
-
|
563 |
-
if($w_disabled_fields[3]=='no')
|
564 |
-
{
|
565 |
-
$g++;
|
566 |
-
if($w_disabled_fields[5]=='yes' && $w_disabled_fields[6]=='yes')
|
567 |
-
$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'].' disabled ><option value=""></option><option value="Alabama">Alabama</option><option value="Alaska">Alaska</option><option value="Arizona">Arizona</option><option value="Arkansas">Arkansas</option><option value="California">California</option><option value="Colorado">Colorado</option><option value="Connecticut">Connecticut</option><option value="Delaware">Delaware</option><option value="Florida">Florida</option><option value="Georgia">Georgia</option><option value="Hawaii">Hawaii</option><option value="Idaho">Idaho</option><option value="Illinois">Illinois</option><option value="Indiana">Indiana</option><option value="Iowa">Iowa</option><option value="Kansas">Kansas</option><option value="Kentucky">Kentucky</option><option value="Louisiana">Louisiana</option><option value="Maine">Maine</option><option value="Maryland">Maryland</option><option value="Massachusetts">Massachusetts</option><option value="Michigan">Michigan</option><option value="Minnesota">Minnesota</option><option value="Mississippi">Mississippi</option><option value="Missouri">Missouri</option><option value="Montana">Montana</option><option value="Nebraska">Nebraska</option><option value="Nevada">Nevada</option><option value="New Hampshire">New Hampshire</option><option value="New Jersey">New Jersey</option><option value="New Mexico">New Mexico</option><option value="New York">New York</option><option value="North Carolina">North Carolina</option><option value="North Dakota">North Dakota</option><option value="Ohio">Ohio</option><option value="Oklahoma">Oklahoma</option><option value="Oregon">Oregon</option><option value="Pennsylvania">Pennsylvania</option><option value="Rhode Island">Rhode Island</option><option value="South Carolina">South Carolina</option><option value="South Dakota">South Dakota</option><option value="Tennessee">Tennessee</option><option value="Texas">Texas</option><option value="Utah">Utah</option><option value="Vermont">Vermont</option><option value="Virginia">Virginia</option><option value="Washington">Washington</option><option value="West Virginia">West Virginia</option><option value="Wisconsin">Wisconsin</option><option value="Wyoming">Wyoming</option></select><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_state">'.$w_mini_labels[3].'</label></span>';
|
568 |
-
else
|
569 |
-
$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'].' disabled><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_state">'.$w_mini_labels[3].'</label></span>';
|
570 |
-
}
|
571 |
-
|
572 |
-
if($w_disabled_fields[4]=='no')
|
573 |
-
{
|
574 |
-
$g++;
|
575 |
-
$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'].' disabled><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_postal">'.$w_mini_labels[4].'</label></span>';
|
576 |
-
}
|
577 |
-
|
578 |
-
if($w_disabled_fields[5]=='no')
|
579 |
-
{
|
580 |
-
$g++;
|
581 |
-
$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'].' disabled><option value=""></option><option value="Afghanistan">Afghanistan</option><option value="Albania">Albania</option><option value="Algeria">Algeria</option><option value="Andorra">Andorra</option><option value="Angola">Angola</option><option value="Antigua and Barbuda">Antigua and Barbuda</option><option value="Argentina">Argentina</option><option value="Armenia">Armenia</option><option value="Australia">Australia</option><option value="Austria">Austria</option><option value="Azerbaijan">Azerbaijan</option><option value="Bahamas">Bahamas</option><option value="Bahrain">Bahrain</option><option value="Bangladesh">Bangladesh</option><option value="Barbados">Barbados</option><option value="Belarus">Belarus</option><option value="Belgium">Belgium</option><option value="Belize">Belize</option><option value="Benin">Benin</option><option value="Bhutan">Bhutan</option><option value="Bolivia">Bolivia</option><option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option><option value="Botswana">Botswana</option><option value="Brazil">Brazil</option><option value="Brunei">Brunei</option><option value="Bulgaria">Bulgaria</option><option value="Burkina Faso">Burkina Faso</option><option value="Burundi">Burundi</option><option value="Cambodia">Cambodia</option><option value="Cameroon">Cameroon</option><option value="Canada">Canada</option><option value="Cape Verde">Cape Verde</option><option value="Central African Republic">Central African Republic</option><option value="Chad">Chad</option><option value="Chile">Chile</option><option value="China">China</option><option value="Colombia">Colombia</option><option value="Comoros">Comoros</option><option value="Congo (Brazzaville)">Congo (Brazzaville)</option><option value="Congo">Congo</option><option value="Costa Rica">Costa Rica</option><option value="Cote d\'Ivoire">Cote d\'Ivoire</option><option value="Croatia">Croatia</option><option value="Cuba">Cuba</option><option value="Cyprus">Cyprus</option><option value="Czech Republic">Czech Republic</option><option value="Denmark">Denmark</option><option value="Djibouti">Djibouti</option><option value="Dominica">Dominica</option><option value="Dominican Republic">Dominican Republic</option><option value="East Timor (Timor Timur)">East Timor (Timor Timur)</option><option value="Ecuador">Ecuador</option><option value="Egypt">Egypt</option><option value="El Salvador">El Salvador</option><option value="Equatorial Guinea">Equatorial Guinea</option><option value="Eritrea">Eritrea</option><option value="Estonia">Estonia</option><option value="Ethiopia">Ethiopia</option><option value="Fiji">Fiji</option><option value="Finland">Finland</option><option value="France">France</option><option value="Gabon">Gabon</option><option value="Gambia, The">Gambia, The</option><option value="Georgia">Georgia</option><option value="Germany">Germany</option><option value="Ghana">Ghana</option><option value="Greece">Greece</option><option value="Grenada">Grenada</option><option value="Guatemala">Guatemala</option><option value="Guinea">Guinea</option><option value="Guinea-Bissau">Guinea-Bissau</option><option value="Guyana">Guyana</option><option value="Haiti">Haiti</option><option value="Honduras">Honduras</option><option value="Hungary">Hungary</option><option value="Iceland">Iceland</option><option value="India">India</option><option value="Indonesia">Indonesia</option><option value="Iran">Iran</option><option value="Iraq">Iraq</option><option value="Ireland">Ireland</option><option value="Israel">Israel</option><option value="Italy">Italy</option><option value="Jamaica">Jamaica</option><option value="Japan">Japan</option><option value="Jordan">Jordan</option><option value="Kazakhstan">Kazakhstan</option><option value="Kenya">Kenya</option><option value="Kiribati">Kiribati</option><option value="Korea, North">Korea, North</option><option value="Korea, South">Korea, South</option><option value="Kuwait">Kuwait</option><option value="Kyrgyzstan">Kyrgyzstan</option><option value="Laos">Laos</option><option value="Latvia">Latvia</option><option value="Lebanon">Lebanon</option><option value="Lesotho">Lesotho</option><option value="Liberia">Liberia</option><option value="Libya">Libya</option><option value="Liechtenstein">Liechtenstein</option><option value="Lithuania">Lithuania</option><option value="Luxembourg">Luxembourg</option><option value="Macedonia">Macedonia</option><option value="Madagascar">Madagascar</option><option value="Malawi">Malawi</option><option value="Malaysia">Malaysia</option><option value="Maldives">Maldives</option><option value="Mali">Mali</option><option value="Malta">Malta</option><option value="Marshall Islands">Marshall Islands</option><option value="Mauritania">Mauritania</option><option value="Mauritius">Mauritius</option><option value="Mexico">Mexico</option><option value="Micronesia">Micronesia</option><option value="Moldova">Moldova</option><option value="Monaco">Monaco</option><option value="Mongolia">Mongolia</option><option value="Morocco">Morocco</option><option value="Mozambique">Mozambique</option><option value="Myanmar">Myanmar</option><option value="Namibia">Namibia</option><option value="Nauru">Nauru</option><option value="Nepal">Nepal</option><option value="Netherlands">Netherlands</option><option value="New Zealand">New Zealand</option><option value="Nicaragua">Nicaragua</option><option value="Niger">Niger</option><option value="Nigeria">Nigeria</option><option value="Norway">Norway</option><option value="Oman">Oman</option><option value="Pakistan">Pakistan</option><option value="Palau">Palau</option><option value="Panama">Panama</option><option value="Papua New Guinea">Papua New Guinea</option><option value="Paraguay">Paraguay</option><option value="Peru">Peru</option><option value="Philippines">Philippines</option><option value="Poland">Poland</option><option value="Portugal">Portugal</option><option value="Qatar">Qatar</option><option value="Romania">Romania</option><option value="Russia">Russia</option><option value="Rwanda">Rwanda</option><option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option><option value="Saint Lucia">Saint Lucia</option><option value="Saint Vincent">Saint Vincent</option><option value="Samoa">Samoa</option><option value="San Marino">San Marino</option><option value="Sao Tome and Principe">Sao Tome and Principe</option><option value="Saudi Arabia">Saudi Arabia</option><option value="Senegal">Senegal</option><option value="Serbia and Montenegro">Serbia and Montenegro</option><option value="Seychelles">Seychelles</option><option value="Sierra Leone">Sierra Leone</option><option value="Singapore">Singapore</option><option value="Slovakia">Slovakia</option><option value="Slovenia">Slovenia</option><option value="Solomon Islands">Solomon Islands</option><option value="Somalia">Somalia</option><option value="South Africa">South Africa</option><option value="Spain">Spain</option><option value="Sri Lanka">Sri Lanka</option><option value="Sudan">Sudan</option><option value="Suriname">Suriname</option><option value="Swaziland">Swaziland</option><option value="Sweden">Sweden</option><option value="Switzerland">Switzerland</option><option value="Syria">Syria</option><option value="Taiwan">Taiwan</option><option value="Tajikistan">Tajikistan</option><option value="Tanzania">Tanzania</option><option value="Thailand">Thailand</option><option value="Togo">Togo</option><option value="Tonga">Tonga</option><option value="Trinidad and Tobago">Trinidad and Tobago</option><option value="Tunisia">Tunisia</option><option value="Turkey">Turkey</option><option value="Turkmenistan">Turkmenistan</option><option value="Tuvalu">Tuvalu</option><option value="Uganda">Uganda</option><option value="Ukraine">Ukraine</option><option value="United Arab Emirates">United Arab Emirates</option><option value="United Kingdom">United Kingdom</option><option value="United States">United States</option><option value="Uruguay">Uruguay</option><option value="Uzbekistan">Uzbekistan</option><option value="Vanuatu">Vanuatu</option><option value="Vatican City">Vatican City</option><option value="Venezuela">Venezuela</option><option value="Vietnam">Vietnam</option><option value="Yemen">Yemen</option><option value="Zambia">Zambia</option><option value="Zimbabwe">Zimbabwe</option></select><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_country">'.$w_mini_labels[5].'</span>';
|
582 |
-
}
|
583 |
-
|
584 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_address" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px; vertical-align:top;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_address" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" name="'.$id.'_disable_fieldsform_id_temp" id="'.$id.'_disable_fieldsform_id_temp" street1="'.$w_disabled_fields[0].'" street2="'.$w_disabled_fields[1].'" city="'.$w_disabled_fields[2].'" state="'.$w_disabled_fields[3].'" postal="'.$w_disabled_fields[4].'" country="'.$w_disabled_fields[5].'" us_states="'.$w_disabled_fields[6].'"><div id="'.$id.'_div_address" style="width: '.$param['w_size'].'px;">'.$address_fields.$hidden_inputs.'</div></div></div>';
|
585 |
-
break;
|
586 |
-
}
|
587 |
-
case 'type_submitter_mail': {
|
588 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_required','w_unique', 'w_class');
|
589 |
-
$temp=$params;
|
590 |
-
if(strpos($temp, 'w_autofill') > -1)
|
591 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_required','w_unique', 'w_class', 'w_autofill');
|
592 |
-
|
593 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
594 |
-
$params_names = array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_size','w_first_val','w_title','w_required','w_unique', 'w_class', 'w_autofill');
|
595 |
-
|
596 |
-
if(strpos($temp, 'w_verification') > -1)
|
597 |
-
$params_names = array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_size','w_first_val','w_title','w_required','w_unique', 'w_class', 'w_verification', 'w_verification_label', 'w_verification_placeholder', 'w_autofill');
|
598 |
-
|
599 |
-
|
600 |
-
foreach($params_names as $params_name )
|
601 |
-
{
|
602 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
603 |
-
$param[$params_name] = $temp[0];
|
604 |
-
$temp=$temp[1];
|
605 |
-
}
|
606 |
-
|
607 |
-
if($temp)
|
608 |
-
{
|
609 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
610 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
611 |
-
foreach($attrs as $attr)
|
612 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
613 |
-
}
|
614 |
-
|
615 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
616 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
617 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
618 |
-
|
619 |
-
$input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active");
|
620 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
621 |
-
$param['w_autofill'] = isset($param['w_autofill']) ? $param['w_autofill'] : 'no';
|
622 |
-
|
623 |
-
if(isset($param['w_verification']) && $param['w_verification'] == "yes"){
|
624 |
-
$display_label_confirm = $display_label;
|
625 |
-
$display_element_confirm = $param['w_field_label_pos'];
|
626 |
-
}
|
627 |
-
else{
|
628 |
-
$display_label_confirm = "none";
|
629 |
-
$display_element_confirm = "none";
|
630 |
-
}
|
631 |
-
|
632 |
-
|
633 |
-
$param['w_verification'] = isset($param['w_verification']) ? $param['w_verification'] : "no";
|
634 |
-
$param['w_verification_label'] = isset($param['w_verification_label']) ? $param['w_verification_label'] : "E-mail confirmation:";
|
635 |
-
$param['w_verification_placeholder'] = isset($param['w_verification_placeholder']) ? $param['w_verification_placeholder'] : "";
|
636 |
-
|
637 |
-
$confirm_emeil = '<br><div align="left" id="'.$id.'_1_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label_confirm.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_1_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$param['w_verification_label'].'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_1_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_element_confirm.';"><input type="hidden" value="'.$param['w_verification'].'" name="'.$id.'_verification_id_temp" id="'.$id.'_verification_id_temp"><input type="text" class="input_deactive" id="'.$id.'_1_elementform_id_temp" name="'.$id.'_1_elementform_id_temp" value="'.$param['w_verification_placeholder'].'" title="'.$param['w_verification_placeholder'].'" 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'].' disabled /></div>';
|
638 |
-
|
639 |
-
|
640 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_submitter_mail" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_submitter_mail" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><input type="hidden" value="'.$param['w_autofill'].'" name="'.$id.'_autofillform_id_temp" id="'.$id.'_autofillform_id_temp"><input type="hidden" value="'.$param['w_verification'].'" name="'.$id.'_verification_id_temp" id="'.$id.'_verification_id_temp"><input type="text" 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'].' disabled /></div>'.$confirm_emeil.'</div>';
|
641 |
-
break;
|
642 |
-
}
|
643 |
-
case 'type_checkbox':
|
644 |
-
{
|
645 |
-
$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');
|
646 |
-
$temp=$params;
|
647 |
-
if(strpos($temp, 'w_field_option_pos') > -1)
|
648 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_field_option_pos','w_flow','w_choices','w_choices_checked','w_rowcol', 'w_required','w_randomize','w_allow_other','w_allow_other_num', 'w_value_disabled','w_choices_value', 'w_choices_params', 'w_class');
|
649 |
-
|
650 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
651 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_field_option_pos', 'w_hide_label', 'w_flow','w_choices','w_choices_checked','w_rowcol', 'w_required','w_randomize','w_allow_other','w_allow_other_num', 'w_value_disabled','w_choices_value', 'w_choices_params', 'w_class');
|
652 |
-
|
653 |
-
foreach($params_names as $params_name )
|
654 |
-
{
|
655 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
656 |
-
$param[$params_name] = $temp[0];
|
657 |
-
$temp=$temp[1];
|
658 |
-
}
|
659 |
-
|
660 |
-
if($temp)
|
661 |
-
{
|
662 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
663 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
664 |
-
foreach($attrs as $attr)
|
665 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
666 |
-
}
|
667 |
-
if(!isset($param['w_value_disabled']))
|
668 |
-
$param['w_value_disabled'] = 'no';
|
669 |
-
|
670 |
-
if(!isset($param['w_field_option_pos']))
|
671 |
-
$param['w_field_option_pos'] = 'left';
|
672 |
-
|
673 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
674 |
-
|
675 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
676 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
677 |
-
|
678 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
679 |
-
$param['w_choices'] = explode('***',$param['w_choices']);
|
680 |
-
$param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
|
681 |
-
|
682 |
-
if(isset($param['w_choices_value']))
|
683 |
-
{
|
684 |
-
$param['w_choices_value'] = explode('***',$param['w_choices_value']);
|
685 |
-
$param['w_choices_params'] = explode('***',$param['w_choices_params']);
|
686 |
-
}
|
687 |
-
|
688 |
-
foreach($param['w_choices_checked'] as $key => $choices_checked )
|
689 |
-
{
|
690 |
-
if($choices_checked=='true')
|
691 |
-
$param['w_choices_checked'][$key]='checked="checked"';
|
692 |
-
else
|
693 |
-
$param['w_choices_checked'][$key]='';
|
694 |
-
}
|
695 |
-
|
696 |
-
$rep='<div id="wdform_field'.$id.'" type="type_checkbox" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_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_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_randomize'].'" name="'.$id.'_randomizeform_id_temp" id="'.$id.'_randomizeform_id_temp"><input type="hidden" value="'.$param['w_allow_other'].'" name="'.$id.'_allow_otherform_id_temp" id="'.$id.'_allow_otherform_id_temp"><input type="hidden" value="'.$param['w_allow_other_num'].'" name="'.$id.'_allow_other_numform_id_temp" id="'.$id.'_allow_other_numform_id_temp"><input type="hidden" value="'.$param['w_rowcol'].'" name="'.$id.'_rowcol_numform_id_temp" id="'.$id.'_rowcol_numform_id_temp"><input type="hidden" value="'.$param['w_field_option_pos'].'" id="'.$id.'_option_left_right"><input type="hidden" value="'.$param['w_value_disabled'].'" name="'.$id.'_value_disabledform_id_temp" id="'.$id.'_value_disabledform_id_temp"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;" '.($param['w_flow']=='hor' ? 'for_hor="'.$id.'_hor"' : '').'>';
|
697 |
-
|
698 |
-
if($param['w_flow']=='hor')
|
699 |
-
{
|
700 |
-
$j = 0;
|
701 |
-
for($i=0; $i<(int)$param['w_rowcol']; $i++)
|
702 |
-
{
|
703 |
-
$rep.='<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;">';
|
704 |
-
|
705 |
-
for($l=0; $l<=(int)(count($param['w_choices'])/$param['w_rowcol']); $l++)
|
706 |
-
{
|
707 |
-
if($j >= count($param['w_choices'])%$param['w_rowcol'] && $l==(int)(count($param['w_choices'])/$param['w_rowcol']))
|
708 |
-
continue;
|
709 |
-
|
710 |
-
if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
|
711 |
-
$rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$l+$i).'" idi="'.((int)$param['w_rowcol']*$l+$i).'" style="display: table-cell;"><input type="checkbox" value="" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" other="1" onclick="if(set_checked("'.$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'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled /><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$l+$i).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'">'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'</label></div>';
|
712 |
-
else
|
713 |
-
{
|
714 |
-
$where = '';
|
715 |
-
$order_by = '';
|
716 |
-
$db_info = '';
|
717 |
-
if(isset($param['w_choices_value']))
|
718 |
-
$choise_value = $param['w_choices_value'][(int)$param['w_rowcol']*$l+$i];
|
719 |
-
else
|
720 |
-
$choise_value = $param['w_choices'][(int)$param['w_rowcol']*$l+$i];
|
721 |
-
|
722 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][(int)$param['w_rowcol']*$l+$i])
|
723 |
-
{
|
724 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][(int)$param['w_rowcol']*$l+$i]);
|
725 |
-
$where = "where='".$w_choices_params[0]."'";
|
726 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
727 |
-
$order_by = "order_by='".$w_choices_params[0]."'";
|
728 |
-
$db_info = "db_info='".$w_choices_params[1]."'";
|
729 |
-
}
|
730 |
-
|
731 |
-
$rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$l+$i).'" idi="'.((int)$param['w_rowcol']*$l+$i).'" style="display: table-cell;"><input type="checkbox" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" onclick="set_checked("'.$id.'","'.((int)$param['w_rowcol']*$l+$i).'","form_id_temp")" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$l+$i].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$l+$i).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" '.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'</label></div>';
|
732 |
-
}
|
733 |
-
}
|
734 |
-
|
735 |
-
$j++;
|
736 |
-
$rep.='</div>';
|
737 |
-
|
738 |
-
}
|
739 |
-
|
740 |
-
}
|
741 |
-
else
|
742 |
-
{
|
743 |
-
for($i=0; $i<(int)(count($param['w_choices'])/$param['w_rowcol']); $i++)
|
744 |
-
{
|
745 |
-
$rep.='<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;">';
|
746 |
-
|
747 |
-
if(count($param['w_choices']) > (int)$param['w_rowcol'])
|
748 |
-
for($l=0; $l<$param['w_rowcol']; $l++)
|
749 |
-
{
|
750 |
-
if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
|
751 |
-
$rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="checkbox" value="" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" other="1" onclick="if(set_checked("'.$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'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled /><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'">'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
|
752 |
-
else
|
753 |
-
{
|
754 |
-
$where = '' ;
|
755 |
-
$order_by = '' ;
|
756 |
-
$db_info = '' ;
|
757 |
-
if(isset($param['w_choices_value']))
|
758 |
-
$choise_value = $param['w_choices_value'][(int)$param['w_rowcol']*$i+$l];
|
759 |
-
else
|
760 |
-
$choise_value = $param['w_choices'][(int)$param['w_rowcol']*$i+$l];
|
761 |
-
|
762 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][(int)$param['w_rowcol']*$i+$l])
|
763 |
-
{
|
764 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][(int)$param['w_rowcol']*$i+$l]);
|
765 |
-
$where = "where='".$w_choices_params[0]."'";
|
766 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
767 |
-
$order_by = "order_by='".$w_choices_params[0]."'";
|
768 |
-
$db_info = "db_info='".$w_choices_params[1]."'";
|
769 |
-
}
|
770 |
-
|
771 |
-
$rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="checkbox" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" onclick="set_checked("'.$id.'","'.((int)$param['w_rowcol']*$i+$l).'","form_id_temp")" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'"
|
772 |
-
'.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
|
773 |
-
}
|
774 |
-
}
|
775 |
-
else
|
776 |
-
for($l=0; $l<count($param['w_choices']); $l++)
|
777 |
-
{
|
778 |
-
if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
|
779 |
-
$rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="checkbox" value="" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" other="1" onclick="if(set_checked("'.$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'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'">'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
|
780 |
-
else
|
781 |
-
{
|
782 |
-
$where = '' ;
|
783 |
-
$order_by = '' ;
|
784 |
-
$db_info = '' ;
|
785 |
-
if(isset($param['w_choices_value']))
|
786 |
-
$choise_value = $param['w_choices_value'][(int)$param['w_rowcol']*$i+$l];
|
787 |
-
else
|
788 |
-
$choise_value = $param['w_choices'][(int)$param['w_rowcol']*$i+$l];
|
789 |
-
|
790 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][(int)$param['w_rowcol']*$i+$l])
|
791 |
-
{
|
792 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][(int)$param['w_rowcol']*$i+$l]);
|
793 |
-
$where = "where='".$w_choices_params[0]."'";
|
794 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
795 |
-
$order_by = "order_by='".$w_choices_params[0]."'";
|
796 |
-
$db_info = "db_info='".$w_choices_params[1]."'";
|
797 |
-
}
|
798 |
-
|
799 |
-
$rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="checkbox" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" onclick="set_checked("'.$id.'","'.((int)$param['w_rowcol']*$i+$l).'","form_id_temp")" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" '.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
|
800 |
-
}
|
801 |
-
}
|
802 |
-
|
803 |
-
$rep.='</div>';
|
804 |
-
}
|
805 |
-
|
806 |
-
if(count($param['w_choices'])%$param['w_rowcol']!=0)
|
807 |
-
{
|
808 |
-
$rep.='<div id="'.$id.'_element_tr'.((int)(count($param['w_choices'])/(int)$param['w_rowcol'])).'" style="display: table-row;">';
|
809 |
-
|
810 |
-
for($k=0; $k<count($param['w_choices'])%$param['w_rowcol']; $k++)
|
811 |
-
{
|
812 |
-
$l = count($param['w_choices']) - count($param['w_choices'])%$param['w_rowcol'] + $k;
|
813 |
-
if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$l)
|
814 |
-
$rep.='<div valign="top" id="'.$id.'_td_little'.$l.'" idi="'.$l.'" style="display: table-cell;"><input type="checkbox" value="" id="'.$id.'_elementform_id_temp'.$l.'" name="'.$id.'_elementform_id_temp'.$l.'" other="1" onclick="if(set_checked("'.$id.'","'.$l.'","form_id_temp")) show_other_input("'.$id.'","form_id_temp");" '.$param['w_choices_checked'][$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$l.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$l.'">'.$param['w_choices'][$l].'</label></div>';
|
815 |
-
else
|
816 |
-
{
|
817 |
-
$where = '' ;
|
818 |
-
$order_by = '' ;
|
819 |
-
$db_info = '' ;
|
820 |
-
if(isset($param['w_choices_value']))
|
821 |
-
$choise_value = $param['w_choices_value'][$l];
|
822 |
-
else
|
823 |
-
$choise_value = $param['w_choices'][$l];
|
824 |
-
|
825 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][$l])
|
826 |
-
{
|
827 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$l]);
|
828 |
-
$where = "where='".$w_choices_params[0]."'";
|
829 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
830 |
-
$order_by = "order_by='".$w_choices_params[0]."'";
|
831 |
-
$db_info = "db_info='".$w_choices_params[1]."'";
|
832 |
-
}
|
833 |
-
$rep.='<div valign="top" id="'.$id.'_td_little'.$l.'" idi="'.$l.'" style="display: table-cell;"><input type="checkbox" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.$l.'" name="'.$id.'_elementform_id_temp'.$l.'" onclick="set_checked("'.$id.'","'.$l.'","form_id_temp")" '.$param['w_choices_checked'][$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$l.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$l.'" '.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][$l].'</label></div>';
|
834 |
-
}
|
835 |
-
}
|
836 |
-
|
837 |
-
$rep.='</div>';
|
838 |
-
}
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
}
|
843 |
-
$rep.='</div></div></div></div>';
|
844 |
-
break;
|
845 |
-
}
|
846 |
-
case 'type_radio':
|
847 |
-
{
|
848 |
-
|
849 |
-
$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');
|
850 |
-
$temp=$params;
|
851 |
-
if(strpos($temp, 'w_field_option_pos') > -1)
|
852 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_field_option_pos','w_flow','w_choices','w_choices_checked','w_rowcol', 'w_required','w_randomize','w_allow_other','w_allow_other_num', 'w_value_disabled', 'w_choices_value', 'w_choices_params','w_class');
|
853 |
-
|
854 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
855 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_field_option_pos', 'w_hide_label', 'w_flow','w_choices','w_choices_checked','w_rowcol', 'w_required','w_randomize','w_allow_other','w_allow_other_num', 'w_value_disabled', 'w_choices_value', 'w_choices_params','w_class');
|
856 |
-
foreach($params_names as $params_name )
|
857 |
-
{
|
858 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
859 |
-
$param[$params_name] = $temp[0];
|
860 |
-
$temp=$temp[1];
|
861 |
-
}
|
862 |
-
|
863 |
-
if($temp)
|
864 |
-
{
|
865 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
866 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
867 |
-
foreach($attrs as $attr)
|
868 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
869 |
-
}
|
870 |
-
if(!isset($param['w_value_disabled']))
|
871 |
-
$param['w_value_disabled'] = 'no';
|
872 |
-
|
873 |
-
if(!isset($param['w_field_option_pos']))
|
874 |
-
$param['w_field_option_pos'] = 'left';
|
875 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
876 |
-
|
877 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
878 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
879 |
-
|
880 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
881 |
-
$param['w_choices'] = explode('***',$param['w_choices']);
|
882 |
-
$param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
|
883 |
-
|
884 |
-
if(isset($param['w_choices_value']))
|
885 |
-
{
|
886 |
-
$param['w_choices_value'] = explode('***',$param['w_choices_value']);
|
887 |
-
$param['w_choices_params'] = explode('***',$param['w_choices_params']);
|
888 |
-
}
|
889 |
-
|
890 |
-
foreach($param['w_choices_checked'] as $key => $choices_checked )
|
891 |
-
{
|
892 |
-
if($choices_checked=='true')
|
893 |
-
$param['w_choices_checked'][$key]='checked="checked"';
|
894 |
-
else
|
895 |
-
$param['w_choices_checked'][$key]='';
|
896 |
-
}
|
897 |
-
|
898 |
-
$rep='<div id="wdform_field'.$id.'" type="type_radio" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_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_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_randomize'].'" name="'.$id.'_randomizeform_id_temp" id="'.$id.'_randomizeform_id_temp"><input type="hidden" value="'.$param['w_allow_other'].'" name="'.$id.'_allow_otherform_id_temp" id="'.$id.'_allow_otherform_id_temp"><input type="hidden" value="'.$param['w_allow_other_num'].'" name="'.$id.'_allow_other_numform_id_temp" id="'.$id.'_allow_other_numform_id_temp"><input type="hidden" value="'.$param['w_rowcol'].'" name="'.$id.'_rowcol_numform_id_temp" id="'.$id.'_rowcol_numform_id_temp"><input type="hidden" value="'.$param['w_field_option_pos'].'" id="'.$id.'_option_left_right"><input type="hidden" value="'.$param['w_value_disabled'].'" name="'.$id.'_value_disabledform_id_temp" id="'.$id.'_value_disabledform_id_temp"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;" '.($param['w_flow']=='hor' ? 'for_hor="'.$id.'_hor"' : '').'>';
|
899 |
-
|
900 |
-
|
901 |
-
if($param['w_flow']=='hor')
|
902 |
-
{
|
903 |
-
$j = 0;
|
904 |
-
for($i=0; $i<(int)$param['w_rowcol']; $i++)
|
905 |
-
{
|
906 |
-
$rep.='<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;">';
|
907 |
-
|
908 |
-
for($l=0; $l<=(int)(count($param['w_choices'])/$param['w_rowcol']); $l++)
|
909 |
-
{
|
910 |
-
if($j >= count($param['w_choices'])%$param['w_rowcol'] && $l==(int)(count($param['w_choices'])/$param['w_rowcol']))
|
911 |
-
continue;
|
912 |
-
|
913 |
-
if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$l+$i)
|
914 |
-
$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'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$l+$i).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'">'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'</label></div>';
|
915 |
-
else
|
916 |
-
{
|
917 |
-
$where = '' ;
|
918 |
-
$order_by = '' ;
|
919 |
-
$db_info = '' ;
|
920 |
-
if(isset($param['w_choices_value']))
|
921 |
-
$choise_value = $param['w_choices_value'][(int)$param['w_rowcol']*$l+$i];
|
922 |
-
else
|
923 |
-
$choise_value = $param['w_choices'][(int)$param['w_rowcol']*$l+$i];
|
924 |
-
|
925 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][(int)$param['w_rowcol']*$l+$i])
|
926 |
-
{
|
927 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][(int)$param['w_rowcol']*$l+$i]);
|
928 |
-
$where = "where='".$w_choices_params[0]."'";
|
929 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
930 |
-
$order_by = "order_by='".$w_choices_params[0]."'";
|
931 |
-
$db_info = "db_info='".$w_choices_params[1]."'";
|
932 |
-
}
|
933 |
-
|
934 |
-
$rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$l+$i).'" idi="'.((int)$param['w_rowcol']*$l+$i).'" style="display: table-cell;"><input type="radio" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" name="'.$id.'_elementform_id_temp" onclick="set_default("'.$id.'","'.((int)$param['w_rowcol']*$l+$i).'","form_id_temp")" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$l+$i].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$l+$i).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" '.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'</label></div>';
|
935 |
-
}
|
936 |
-
}
|
937 |
-
|
938 |
-
$j++;
|
939 |
-
$rep.='</div>';
|
940 |
-
|
941 |
-
}
|
942 |
-
|
943 |
-
}
|
944 |
-
else
|
945 |
-
{
|
946 |
-
for($i=0; $i<(int)(count($param['w_choices'])/$param['w_rowcol']); $i++)
|
947 |
-
{
|
948 |
-
$rep.='<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;">';
|
949 |
-
|
950 |
-
if(count($param['w_choices']) > (int)$param['w_rowcol'])
|
951 |
-
for($l=0; $l<$param['w_rowcol']; $l++)
|
952 |
-
{
|
953 |
-
if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
|
954 |
-
$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'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'">'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
|
955 |
-
else
|
956 |
-
{
|
957 |
-
$where = '' ;
|
958 |
-
$order_by = '' ;
|
959 |
-
$db_info = '' ;
|
960 |
-
if(isset($param['w_choices_value']))
|
961 |
-
$choise_value = $param['w_choices_value'][(int)$param['w_rowcol']*$i+$l];
|
962 |
-
else
|
963 |
-
$choise_value = $param['w_choices'][(int)$param['w_rowcol']*$i+$l];
|
964 |
-
|
965 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][(int)$param['w_rowcol']*$i+$l])
|
966 |
-
{
|
967 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][(int)$param['w_rowcol']*$i+$l]);
|
968 |
-
$where = "where='".$w_choices_params[0]."'";
|
969 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
970 |
-
$order_by = "order_by='".$w_choices_params[0]."'";
|
971 |
-
$db_info = "db_info='".$w_choices_params[1]."'";
|
972 |
-
}
|
973 |
-
|
974 |
-
$rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="radio" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp" onclick="set_default("'.$id.'","'.((int)$param['w_rowcol']*$i+$l).'","form_id_temp")" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" '.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
|
975 |
-
}
|
976 |
-
}
|
977 |
-
else
|
978 |
-
for($l=0; $l<count($param['w_choices']); $l++)
|
979 |
-
{
|
980 |
-
if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
|
981 |
-
$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'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'">'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
|
982 |
-
else
|
983 |
-
{
|
984 |
-
$where = '' ;
|
985 |
-
$order_by = '' ;
|
986 |
-
$db_info = '' ;
|
987 |
-
if(isset($param['w_choices_value']))
|
988 |
-
$choise_value = $param['w_choices_value'][(int)$param['w_rowcol']*$i+$l];
|
989 |
-
else
|
990 |
-
$choise_value = $param['w_choices'][(int)$param['w_rowcol']*$i+$l];
|
991 |
-
|
992 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][(int)$param['w_rowcol']*$i+$l])
|
993 |
-
{
|
994 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][(int)$param['w_rowcol']*$i+$l]);
|
995 |
-
$where = "where='".$w_choices_params[0]."'";
|
996 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
997 |
-
$order_by = "order_by='".$w_choices_params[0]."'";
|
998 |
-
$db_info = "db_info='".$w_choices_params[1]."'";
|
999 |
-
}
|
1000 |
-
|
1001 |
-
$rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="radio" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp" onclick="set_default("'.$id.'","'.((int)$param['w_rowcol']*$i+$l).'","form_id_temp")" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" '.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
|
1002 |
-
}
|
1003 |
-
}
|
1004 |
-
|
1005 |
-
$rep.='</div>';
|
1006 |
-
}
|
1007 |
-
|
1008 |
-
if(count($param['w_choices'])%$param['w_rowcol']!=0)
|
1009 |
-
{
|
1010 |
-
$rep.='<div id="'.$id.'_element_tr'.((int)(count($param['w_choices'])/(int)$param['w_rowcol'])).'" style="display: table-row;">';
|
1011 |
-
|
1012 |
-
for($k=0; $k<count($param['w_choices'])%$param['w_rowcol']; $k++)
|
1013 |
-
{
|
1014 |
-
$l = count($param['w_choices']) - count($param['w_choices'])%$param['w_rowcol'] + $k;
|
1015 |
-
if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$l)
|
1016 |
-
$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'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$l.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$l.'">'.$param['w_choices'][$l].'</label></div>';
|
1017 |
-
else
|
1018 |
-
{
|
1019 |
-
$where = '' ;
|
1020 |
-
$order_by = '' ;
|
1021 |
-
$db_info = '' ;
|
1022 |
-
if(isset($param['w_choices_value']))
|
1023 |
-
$choise_value = $param['w_choices_value'][$l];
|
1024 |
-
else
|
1025 |
-
$choise_value = $param['w_choices'][$l];
|
1026 |
-
|
1027 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][$l])
|
1028 |
-
{
|
1029 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$l]);
|
1030 |
-
$where = "where='".$w_choices_params[0]."'";
|
1031 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
1032 |
-
$order_by = "order_by='".$w_choices_params[0]."'";
|
1033 |
-
$db_info = "db_info='".$w_choices_params[1]."'";
|
1034 |
-
}
|
1035 |
-
|
1036 |
-
$rep.='<div valign="top" id="'.$id.'_td_little'.$l.'" idi="'.$l.'" style="display: table-cell;"><input type="radio" value="'.$choise_value.'" id="'.$id.'_elementform_id_temp'.$l.'" name="'.$id.'_elementform_id_temp" onclick="set_default("'.$id.'","'.$l.'","form_id_temp")" '.$param['w_choices_checked'][$l].' '.$param['attributes'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$l.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$l.'"
|
1037 |
-
'.$where.' '.$order_by.' '.$db_info.'>'.$param['w_choices'][$l].'</label></div>';
|
1038 |
-
}
|
1039 |
-
}
|
1040 |
-
|
1041 |
-
$rep.='</div>';
|
1042 |
-
}
|
1043 |
-
|
1044 |
-
}
|
1045 |
-
|
1046 |
-
|
1047 |
-
|
1048 |
-
$rep.='</div></div></div></div>';
|
1049 |
-
|
1050 |
-
break;
|
1051 |
-
}
|
1052 |
-
case 'type_own_select':
|
1053 |
-
{
|
1054 |
-
$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');
|
1055 |
-
$temp=$params;
|
1056 |
-
if(strpos($temp, 'w_choices_value') > -1)
|
1057 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_choices','w_choices_checked', 'w_choices_disabled', 'w_required', 'w_value_disabled', 'w_choices_value', 'w_choices_params', 'w_class');
|
1058 |
-
|
1059 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
1060 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_size','w_choices','w_choices_checked', 'w_choices_disabled', 'w_required', 'w_value_disabled', 'w_choices_value', 'w_choices_params', 'w_class');
|
1061 |
-
|
1062 |
-
foreach($params_names as $params_name )
|
1063 |
-
{
|
1064 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
1065 |
-
$param[$params_name] = $temp[0];
|
1066 |
-
$temp=$temp[1];
|
1067 |
-
}
|
1068 |
-
|
1069 |
-
if($temp)
|
1070 |
-
{
|
1071 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
1072 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
1073 |
-
foreach($attrs as $attr)
|
1074 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
1075 |
-
}
|
1076 |
-
|
1077 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
1078 |
-
|
1079 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
1080 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
1081 |
-
|
1082 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
1083 |
-
$param['w_choices'] = explode('***',$param['w_choices']);
|
1084 |
-
$param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
|
1085 |
-
$param['w_choices_disabled'] = explode('***',$param['w_choices_disabled']);
|
1086 |
-
|
1087 |
-
if(isset($param['w_choices_value']))
|
1088 |
-
{
|
1089 |
-
$param['w_choices_value'] = explode('***',$param['w_choices_value']);
|
1090 |
-
$param['w_choices_params'] = explode('***',$param['w_choices_params']);
|
1091 |
-
}
|
1092 |
-
|
1093 |
-
if(!isset($param['w_value_disabled']))
|
1094 |
-
$param['w_value_disabled'] = 'no';
|
1095 |
-
|
1096 |
-
foreach($param['w_choices_checked'] as $key => $choices_checked )
|
1097 |
-
{
|
1098 |
-
if($choices_checked=='true')
|
1099 |
-
$param['w_choices_checked'][$key]='selected="selected"';
|
1100 |
-
else
|
1101 |
-
$param['w_choices_checked'][$key]='';
|
1102 |
-
}
|
1103 |
-
|
1104 |
-
$rep='<div id="wdform_field'.$id.'" type="type_own_select" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; "><input type="hidden" value="type_own_select" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_value_disabled'].'" name="'.$id.'_value_disabledform_id_temp" id="'.$id.'_value_disabledform_id_temp"><select id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" onchange="set_select(this)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled>';
|
1105 |
-
foreach($param['w_choices'] as $key => $choice)
|
1106 |
-
{
|
1107 |
-
$where = '';
|
1108 |
-
$order_by = '';
|
1109 |
-
$db_info = '';
|
1110 |
-
$choice_value = $param['w_choices_disabled'][$key]=='true' ? '' : (isset($param['w_choices_value']) ? $param['w_choices_value'][$key] : $choice);
|
1111 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
|
1112 |
-
{
|
1113 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
|
1114 |
-
$where = "where='".$w_choices_params[0]."'";
|
1115 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
1116 |
-
$order_by = "order_by='".$w_choices_params[0]."'";
|
1117 |
-
$db_info = "db_info='".$w_choices_params[1]."'";
|
1118 |
-
}
|
1119 |
-
|
1120 |
-
$rep.='<option id="'.$id.'_option'.$key.'" value="'.$choice_value.'" onselect="set_select("'.$id.'_option'.$key.'")" '.$param['w_choices_checked'][$key].' '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</option>';
|
1121 |
-
}
|
1122 |
-
$rep.='</select></div></div>';
|
1123 |
-
break;
|
1124 |
-
}
|
1125 |
-
|
1126 |
-
case 'type_country':
|
1127 |
-
{
|
1128 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_countries','w_required','w_class');
|
1129 |
-
$temp=$params;
|
1130 |
-
|
1131 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
1132 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_size','w_countries','w_required','w_class');
|
1133 |
-
|
1134 |
-
foreach($params_names as $params_name )
|
1135 |
-
{
|
1136 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
1137 |
-
$param[$params_name] = $temp[0];
|
1138 |
-
$temp=$temp[1];
|
1139 |
-
}
|
1140 |
-
|
1141 |
-
if($temp)
|
1142 |
-
{
|
1143 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
1144 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
1145 |
-
foreach($attrs as $attr)
|
1146 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
1147 |
-
}
|
1148 |
-
|
1149 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
1150 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
1151 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
1152 |
-
|
1153 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
1154 |
-
$param['w_countries'] = explode('***',$param['w_countries']);
|
1155 |
-
|
1156 |
-
$rep='<div id="wdform_field'.$id.'" type="type_country" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; "><input type="hidden" value="type_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"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><select id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled>';
|
1157 |
-
foreach($param['w_countries'] as $key => $choice)
|
1158 |
-
{
|
1159 |
-
$choice_value=$choice;
|
1160 |
-
$rep.='<option value="'.$choice_value.'">'.$choice.'</option>';
|
1161 |
-
}
|
1162 |
-
$rep.='</select></div></div>';
|
1163 |
-
break;
|
1164 |
-
}
|
1165 |
-
|
1166 |
-
case 'type_time':
|
1167 |
-
{
|
1168 |
-
$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');
|
1169 |
-
$temp=$params;
|
1170 |
-
|
1171 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
1172 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_time_type', 'w_am_pm','w_sec','w_hh','w_mm','w_ss','w_mini_labels','w_required','w_class');
|
1173 |
-
|
1174 |
-
foreach($params_names as $params_name )
|
1175 |
-
{
|
1176 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
1177 |
-
$param[$params_name] = $temp[0];
|
1178 |
-
$temp=$temp[1];
|
1179 |
-
}
|
1180 |
-
|
1181 |
-
if($temp)
|
1182 |
-
{
|
1183 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
1184 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
1185 |
-
foreach($attrs as $attr)
|
1186 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
1187 |
-
}
|
1188 |
-
|
1189 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
1190 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
1191 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
1192 |
-
|
1193 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
1194 |
-
|
1195 |
-
$w_mini_labels = explode('***',$param['w_mini_labels']);
|
1196 |
-
|
1197 |
-
|
1198 |
-
if($param['w_sec']=='1')
|
1199 |
-
{
|
1200 |
-
$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'].' disabled /></div>';
|
1201 |
-
$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>';
|
1202 |
-
}
|
1203 |
-
else
|
1204 |
-
{
|
1205 |
-
$w_sec = '';
|
1206 |
-
$w_sec_label='';
|
1207 |
-
}
|
1208 |
-
|
1209 |
-
if($param['w_time_type']=='12')
|
1210 |
-
{
|
1211 |
-
if($param['w_am_pm']=='am')
|
1212 |
-
{
|
1213 |
-
$am_ = "selected=\"selected\"";
|
1214 |
-
$pm_ = "";
|
1215 |
-
}
|
1216 |
-
else
|
1217 |
-
{
|
1218 |
-
$am_ = "";
|
1219 |
-
$pm_ = "selected=\"selected\"";
|
1220 |
-
|
1221 |
-
}
|
1222 |
-
|
1223 |
-
$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>';
|
1224 |
-
|
1225 |
-
$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>';
|
1226 |
-
|
1227 |
-
}
|
1228 |
-
else
|
1229 |
-
{
|
1230 |
-
$w_time_type='';
|
1231 |
-
$w_time_type_label = '';
|
1232 |
-
}
|
1233 |
-
|
1234 |
-
|
1235 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_time" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_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"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_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'].' disabled/></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'].' disabled/></div>'.$w_sec.$w_time_type.'</div><div id="'.$id.'_tr_time2" style="display: table-row;"><div id="'.$id.'_td_time_label1" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_hh">'.$w_mini_labels[0].'</label></div><div style="display: table-cell;"></div><div id="'.$id.'_td_time_label2" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_mm">'.$w_mini_labels[1].'</label></div>'.$w_sec_label.$w_time_type_label.'</div></div></div></div>';
|
1236 |
-
|
1237 |
-
break;
|
1238 |
-
}
|
1239 |
-
case 'type_date':
|
1240 |
-
{
|
1241 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_date','w_required','w_class','w_format','w_but_val');
|
1242 |
-
$temp = $params;
|
1243 |
-
if(strpos($temp, 'w_disable_past_days') > -1)
|
1244 |
-
$params_names = array('w_field_label_size','w_field_label_pos','w_date','w_required','w_class','w_format','w_but_val', 'w_disable_past_days');
|
1245 |
-
foreach($params_names as $params_name )
|
1246 |
-
{
|
1247 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
1248 |
-
$param[$params_name] = $temp[0];
|
1249 |
-
$temp=$temp[1];
|
1250 |
-
}
|
1251 |
-
|
1252 |
-
if($temp)
|
1253 |
-
{
|
1254 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
1255 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
1256 |
-
foreach($attrs as $attr)
|
1257 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
1258 |
-
}
|
1259 |
-
|
1260 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
1261 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
1262 |
-
$param['w_disable_past_days'] = isset($param['w_disable_past_days']) ? $param['w_disable_past_days'] : 'no';
|
1263 |
-
$disable_past_days = $param['w_disable_past_days'] == 'yes' ? 'true' : 'false';
|
1264 |
-
|
1265 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_date" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_date" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_disable_past_days'].'" name="'.$id.'_dis_past_daysform_id_temp" id="'.$id.'_dis_past_daysform_id_temp"><input type="text" value="'.$param['w_date'].'" class="wdform-date" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" maxlength="10" size="10" onchange="change_value("'.$id.'_elementform_id_temp")" '.$param['attributes'].' disabled/><input id="'.$id.'_buttonform_id_temp" class="button" type="reset" value="'.$param['w_but_val'].'" format="'.$param['w_format'].'" src="templates/bluestork/images/system/calendar.png?ver='. WD_FMC_VERSION.'" alt="calendario" '.$param['attributes'].' onclick="return showCalendar("'.$id.'_elementform_id_temp" , "'.$param['w_format'].'", '.$disable_past_days.')"></div></div>';
|
1266 |
-
|
1267 |
-
break;
|
1268 |
-
}
|
1269 |
-
|
1270 |
-
///////////////////////// type_date_new ////////////////////////////
|
1271 |
-
|
1272 |
-
case 'type_date_new':
|
1273 |
-
{
|
1274 |
-
|
1275 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_size', 'w_date','w_required', 'w_show_image', 'w_class','w_format', 'w_start_day', 'w_default_date', 'w_min_date', 'w_max_date', 'w_invalid_dates', 'w_show_days', 'w_hide_time', 'w_but_val', 'w_disable_past_days');
|
1276 |
-
$temp = $params;
|
1277 |
-
|
1278 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
1279 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_size', 'w_date','w_required', 'w_show_image', 'w_class','w_format', 'w_start_day', 'w_default_date', 'w_min_date', 'w_max_date', 'w_invalid_dates', 'w_show_days', 'w_hide_time', 'w_but_val', 'w_disable_past_days');
|
1280 |
-
|
1281 |
-
|
1282 |
-
foreach($params_names as $params_name )
|
1283 |
-
{
|
1284 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
1285 |
-
$param[$params_name] = $temp[0];
|
1286 |
-
$temp=$temp[1];
|
1287 |
-
}
|
1288 |
-
|
1289 |
-
if($temp)
|
1290 |
-
{
|
1291 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
1292 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
1293 |
-
foreach($attrs as $attr)
|
1294 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
1295 |
-
}
|
1296 |
-
|
1297 |
-
|
1298 |
-
$w_show_week_days = explode('***', $param['w_show_days']);
|
1299 |
-
|
1300 |
-
|
1301 |
-
|
1302 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
1303 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
1304 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
1305 |
-
|
1306 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
1307 |
-
$param['w_disable_past_days'] = isset($param['w_disable_past_days']) ? $param['w_disable_past_days'] : 'no';
|
1308 |
-
$disable_past_days = $param['w_disable_past_days'] == 'yes' ? 'true' : 'false';
|
1309 |
-
$display_image_date = $param['w_show_image'] == 'yes' ? 'inline' : 'none';
|
1310 |
-
|
1311 |
-
|
1312 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_date_new" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_date_new" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp">
|
1313 |
-
<input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp">
|
1314 |
-
|
1315 |
-
<input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/>
|
1316 |
-
|
1317 |
-
<input type="hidden" value="'.$param['w_show_image'].'" name="'.$id.'_show_imageform_id_temp" id="'.$id.'_show_imageform_id_temp">
|
1318 |
-
|
1319 |
-
<input type="hidden" value="'.$param['w_disable_past_days'].'" name="'.$id.'_dis_past_daysform_id_temp" id="'.$id.'_dis_past_daysform_id_temp">
|
1320 |
-
|
1321 |
-
<input type="hidden" value="'.$param['w_default_date'].'" name="'.$id.'_default_date_id_temp" id="'.$id.'_default_date_id_temp">
|
1322 |
-
<input type="hidden" value="'.$param['w_min_date'].'" name="'.$id.'_min_date_id_temp" id="'.$id.'_min_date_id_temp">
|
1323 |
-
<input type="hidden" value="'.$param['w_max_date'].'" name="'.$id.'_max_date_id_temp" id="'.$id.'_max_date_id_temp">
|
1324 |
-
<input type="hidden" value="'.$param['w_invalid_dates'].'" name="'.$id.'_invalid_dates_id_temp" id="'.$id.'_invalid_dates_id_temp">
|
1325 |
-
|
1326 |
-
<input type="hidden" value="'.$param['w_start_day'].'" name="'.$id.'_start_dayform_id_temp" id="'.$id.'_start_dayform_id_temp">
|
1327 |
-
|
1328 |
-
<input type="hidden" value="'.$param['w_hide_time'].'" name="'.$id.'_hide_timeform_id_temp" id="'.$id.'_hide_timeform_id_temp">
|
1329 |
-
|
1330 |
-
<input type="hidden" name="'.$id.'_show_week_days" id="'.$id.'_show_week_days" sunday="'.$w_show_week_days[0].'" monday="'.$w_show_week_days[1].'" tuesday="'.$w_show_week_days[2].'" wednesday="'.$w_show_week_days[3].'" thursday="'.$w_show_week_days[4].'" friday="'.$w_show_week_days[5].'" saturday="'.$w_show_week_days[6].'">
|
1331 |
-
|
1332 |
-
|
1333 |
-
|
1334 |
-
<input type="text" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled/>
|
1335 |
-
<img src="' . WD_FMC_URL . '/images/date.png" id="'.$id.'_show_imagedateform_id_temp" name="'.$id.'_show_imagedateform_id_temp" style="vertical-align : text-top; margin-left : 1px; display:'.$display_image_date.'">
|
1336 |
-
|
1337 |
-
<input id="'.$id.'_buttonform_id_temp" type="hidden" value="'.$param['w_but_val'].'" format="'.$param['w_format'].'" ></div></div>';
|
1338 |
-
|
1339 |
-
break;
|
1340 |
-
}
|
1341 |
-
|
1342 |
-
|
1343 |
-
|
1344 |
-
case 'type_date_range':
|
1345 |
-
{
|
1346 |
-
|
1347 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_size', 'w_date','w_required', 'w_show_image', 'w_class','w_format', 'w_start_day', 'w_default_date_start', 'w_default_date_end', 'w_min_date', 'w_max_date', 'w_invalid_dates', 'w_show_days', 'w_hide_time', 'w_but_val', 'w_disable_past_days');
|
1348 |
-
$temp = $params;
|
1349 |
-
|
1350 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
1351 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_size', 'w_date','w_required', 'w_show_image', 'w_class','w_format', 'w_start_day', 'w_default_date_start', 'w_default_date_end', 'w_min_date', 'w_max_date', 'w_invalid_dates', 'w_show_days', 'w_hide_time', 'w_but_val', 'w_disable_past_days');
|
1352 |
-
|
1353 |
-
|
1354 |
-
foreach($params_names as $params_name )
|
1355 |
-
{
|
1356 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
1357 |
-
$param[$params_name] = $temp[0];
|
1358 |
-
$temp=$temp[1];
|
1359 |
-
}
|
1360 |
-
|
1361 |
-
if($temp)
|
1362 |
-
{
|
1363 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
1364 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
1365 |
-
foreach($attrs as $attr)
|
1366 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
1367 |
-
}
|
1368 |
-
|
1369 |
-
|
1370 |
-
$w_show_week_days = explode('***', $param['w_show_days']);
|
1371 |
-
$defaul_day_array = explode(',', $param['w_date']);
|
1372 |
-
$defaul_day_start = $defaul_day_array[0];
|
1373 |
-
$defaul_day_end = $defaul_day_array[1];
|
1374 |
-
|
1375 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
1376 |
-
|
1377 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
1378 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
1379 |
-
|
1380 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
1381 |
-
$param['w_disable_past_days'] = isset($param['w_disable_past_days']) ? $param['w_disable_past_days'] : 'no';
|
1382 |
-
$disable_past_days = $param['w_disable_past_days'] == 'yes' ? 'true' : 'false';
|
1383 |
-
$display_image_date = $param['w_show_image'] == 'yes' ? 'inline' : 'none';
|
1384 |
-
|
1385 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_date_range" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';">
|
1386 |
-
|
1387 |
-
<input type="hidden" value="type_date_range" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp">
|
1388 |
-
|
1389 |
-
<input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp">
|
1390 |
-
|
1391 |
-
<input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/>
|
1392 |
-
|
1393 |
-
<input type="hidden" value="'.$param['w_show_image'].'" name="'.$id.'_show_imageform_id_temp" id="'.$id.'_show_imageform_id_temp">
|
1394 |
-
|
1395 |
-
<input type="hidden" value="'.$param['w_disable_past_days'].'" name="'.$id.'_dis_past_daysform_id_temp" id="'.$id.'_dis_past_daysform_id_temp">
|
1396 |
-
|
1397 |
-
<input type="hidden" value="'.$param['w_default_date_start'].'" name="'.$id.'_default_date_id_temp_start" id="'.$id.'_default_date_id_temp_start">
|
1398 |
-
|
1399 |
-
<input type="hidden" value="'.$param['w_default_date_end'].'" name="'.$id.'_default_date_id_temp_end" id="'.$id.'_default_date_id_temp_end">
|
1400 |
-
|
1401 |
-
<input type="hidden" value="'.$param['w_min_date'].'" name="'.$id.'_min_date_id_temp" id="'.$id.'_min_date_id_temp">
|
1402 |
-
|
1403 |
-
<input type="hidden" value="'.$param['w_max_date'].'" name="'.$id.'_max_date_id_temp" id="'.$id.'_max_date_id_temp">
|
1404 |
-
|
1405 |
-
<input type="hidden" value="'.$param['w_invalid_dates'].'" name="'.$id.'_invalid_dates_id_temp" id="'.$id.'_invalid_dates_id_temp">
|
1406 |
-
|
1407 |
-
<input type="hidden" value="'.$param['w_start_day'].'" name="'.$id.'_start_dayform_id_temp" id="'.$id.'_start_dayform_id_temp">
|
1408 |
-
|
1409 |
-
<input type="hidden" value="'.$param['w_hide_time'].'" name="'.$id.'_hide_timeform_id_temp" id="'.$id.'_hide_timeform_id_temp">
|
1410 |
-
|
1411 |
-
<input type="hidden" name="'.$id.'_show_week_days" id="'.$id.'_show_week_days" sunday="'.$w_show_week_days[0].'" monday="'.$w_show_week_days[1].'" tuesday="'.$w_show_week_days[2].'" wednesday="'.$w_show_week_days[3].'" thursday="'.$w_show_week_days[4].'" friday="'.$w_show_week_days[5].'" saturday="'.$w_show_week_days[6].'">
|
1412 |
-
|
1413 |
-
|
1414 |
-
|
1415 |
-
|
1416 |
-
|
1417 |
-
<input type="text" id="'.$id.'_elementform_id_temp0" name="'.$id.'_elementform_id_temp0" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled/>
|
1418 |
-
<img src="' . WD_FMC_URL . '/images/date.png" id="'.$id.'_show_imagedateform_id_temp0" name="'.$id.'_show_imagedateform_id_temp0" style="vertical-align : text-top; margin-left : 1px; display:'.$display_image_date.'">
|
1419 |
-
|
1420 |
-
<span>-</span>
|
1421 |
-
|
1422 |
-
<input type="text" id="'.$id.'_elementform_id_temp1" name="'.$id.'_elementform_id_temp1" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled/>
|
1423 |
-
<img src="' . WD_FMC_URL . '/images/date.png" id="'.$id.'_show_imagedateform_id_temp1" name="'.$id.'_show_imagedateform_id_temp1" style="vertical-align : text-top; margin-left : 1px; display:'.$display_image_date.'">
|
1424 |
-
|
1425 |
-
<input id="'.$id.'_buttonform_id_temp" type="hidden" value="'.$param['w_but_val'].'" format="'.$param['w_format'].'" >
|
1426 |
-
|
1427 |
-
</div></div>';
|
1428 |
-
|
1429 |
-
|
1430 |
-
|
1431 |
-
break;
|
1432 |
-
}
|
1433 |
-
|
1434 |
-
|
1435 |
-
|
1436 |
-
|
1437 |
-
|
1438 |
-
case 'type_date_fields':
|
1439 |
-
{
|
1440 |
-
$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');
|
1441 |
-
|
1442 |
-
$temp=$params;
|
1443 |
-
|
1444 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
1445 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', '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');
|
1446 |
-
|
1447 |
-
|
1448 |
-
foreach($params_names as $params_name )
|
1449 |
-
{
|
1450 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
1451 |
-
$param[$params_name] = $temp[0];
|
1452 |
-
$temp=$temp[1];
|
1453 |
-
}
|
1454 |
-
|
1455 |
-
if($temp)
|
1456 |
-
{
|
1457 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
1458 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
1459 |
-
foreach($attrs as $attr)
|
1460 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
1461 |
-
}
|
1462 |
-
|
1463 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
1464 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
1465 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
1466 |
-
|
1467 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
1468 |
-
|
1469 |
-
|
1470 |
-
if($param['w_day_type']=="SELECT")
|
1471 |
-
{
|
1472 |
-
|
1473 |
-
|
1474 |
-
$w_day_type = '<select id="'.$id.'_dayform_id_temp" name="'.$id.'_dayform_id_temp" onchange="set_select(this)" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].' disabled><option value=""></option>';
|
1475 |
-
for($k=0; $k<=31; $k++)
|
1476 |
-
{
|
1477 |
-
if($k<10)
|
1478 |
-
{
|
1479 |
-
if($param['w_day']=='0'.$k)
|
1480 |
-
$selected = "selected=\"selected\"";
|
1481 |
-
else
|
1482 |
-
$selected = "";
|
1483 |
-
|
1484 |
-
$w_day_type .= '<option value="0'.$k.'" '.$selected.'>0'.$k.'</option>';
|
1485 |
-
}
|
1486 |
-
else
|
1487 |
-
{
|
1488 |
-
if($param['w_day']==''.$k)
|
1489 |
-
$selected = "selected=\"selected\"";
|
1490 |
-
else
|
1491 |
-
$selected = "";
|
1492 |
-
|
1493 |
-
$w_day_type .= '<option value="'.$k.'" '.$selected.'>'.$k.'</option>';
|
1494 |
-
}
|
1495 |
-
|
1496 |
-
|
1497 |
-
|
1498 |
-
}
|
1499 |
-
$w_day_type .= '</select>';
|
1500 |
-
}
|
1501 |
-
else
|
1502 |
-
{
|
1503 |
-
$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'].' disabled/>';
|
1504 |
-
}
|
1505 |
-
|
1506 |
-
if($param['w_month_type']=="SELECT")
|
1507 |
-
{
|
1508 |
-
|
1509 |
-
$w_month_type = '<select id="'.$id.'_monthform_id_temp" name="'.$id.'_monthform_id_temp" onchange="set_select(this)" style="width: '.$param['w_month_size'].'px;" '.$param['attributes'].' disabled><option value=""></option><option value="01" '.($param['w_month']=="01" ? "selected=\"selected\"": "").' ><!--repstart-->January<!--repend--></option><option value="02" '.($param['w_month']=="02" ? "selected=\"selected\"": "").'><!--repstart-->February<!--repend--></option><option value="03" '.($param['w_month']=="03"? "selected=\"selected\"": "").'><!--repstart-->March<!--repend--></option><option value="04" '.($param['w_month']=="04" ? "selected=\"selected\"": "").' ><!--repstart-->April<!--repend--></option><option value="05" '.($param['w_month']=="05" ? "selected=\"selected\"": "").' ><!--repstart-->May<!--repend--></option><option value="06" '.($param['w_month']=="06" ? "selected=\"selected\"": "").' ><!--repstart-->June<!--repend--></option><option value="07" '.($param['w_month']=="07" ? "selected=\"selected\"": "").' ><!--repstart-->July<!--repend--></option><option value="08" '.($param['w_month']=="08" ? "selected=\"selected\"": "").' ><!--repstart-->August<!--repend--></option><option value="09" '.($param['w_month']=="09" ? "selected=\"selected\"": "").' ><!--repstart-->September<!--repend--></option><option value="10" '.($param['w_month']=="10" ? "selected=\"selected\"": "").' ><!--repstart-->October<!--repend--></option><option value="11" '.($param['w_month']=="11" ? "selected=\"selected\"": "").'><!--repstart-->November<!--repend--></option><option value="12" '.($param['w_month']=="12" ? "selected=\"selected\"": "").' ><!--repstart-->December<!--repend--></option></select>';
|
1510 |
-
|
1511 |
-
}
|
1512 |
-
else
|
1513 |
-
{
|
1514 |
-
$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'].' disabled/>';
|
1515 |
-
|
1516 |
-
}
|
1517 |
-
$param['w_to'] = isset($param['w_to']) && $param['w_to']!="NaN" ? $param['w_to'] : date("Y");
|
1518 |
-
if($param['w_year_type']=="SELECT")
|
1519 |
-
{
|
1520 |
-
$w_year_type = '<select id="'.$id.'_yearform_id_temp" name="'.$id.'_yearform_id_temp" onchange="set_select(this)" from="'.$param['w_from'].'" to="'.$param['w_to'].'" style="width: '.$param['w_year_size'].'px;" '.$param['attributes'].' disabled><option value=""></option>';
|
1521 |
-
for($k=$param['w_to']; $k>=$param['w_from']; $k--)
|
1522 |
-
{
|
1523 |
-
if($param['w_year']==$k)
|
1524 |
-
$selected = "selected=\"selected\"";
|
1525 |
-
else
|
1526 |
-
$selected = "";
|
1527 |
-
|
1528 |
-
$w_year_type .= '<option value="'.$k.'" '.$selected.'>'.$k.'</option>';
|
1529 |
-
}
|
1530 |
-
$w_year_type .= '</select>';
|
1531 |
-
|
1532 |
-
}
|
1533 |
-
else
|
1534 |
-
{
|
1535 |
-
$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'].' disabled/>';
|
1536 |
-
}
|
1537 |
-
|
1538 |
-
|
1539 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_date_fields" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_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"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_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;">
|
1540 |
-
'.$w_day_type.'
|
1541 |
-
|
1542 |
-
</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>';
|
1543 |
-
|
1544 |
-
break;
|
1545 |
-
}
|
1546 |
-
case 'type_file_upload':
|
1547 |
-
{
|
1548 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_destination','w_extension','w_max_size','w_required','w_multiple','w_class');
|
1549 |
-
$temp=$params;
|
1550 |
-
|
1551 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
1552 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_destination','w_extension','w_max_size','w_required','w_multiple','w_class');
|
1553 |
-
|
1554 |
-
|
1555 |
-
foreach($params_names as $params_name )
|
1556 |
-
{
|
1557 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
1558 |
-
$param[$params_name] = $temp[0];
|
1559 |
-
if (isset($temp[1])) {
|
1560 |
-
$temp = $temp[1];
|
1561 |
-
}
|
1562 |
-
else {
|
1563 |
-
$temp = '';
|
1564 |
-
}
|
1565 |
-
}
|
1566 |
-
|
1567 |
-
if($temp)
|
1568 |
-
{
|
1569 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
1570 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
1571 |
-
foreach($attrs as $attr)
|
1572 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
1573 |
-
}
|
1574 |
-
|
1575 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
1576 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
1577 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
1578 |
-
|
1579 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
1580 |
-
$multiple = ($param['w_multiple']=="yes" ? "multiple='multiple'" : "");
|
1581 |
-
|
1582 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_file_upload" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_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="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="***max_sizeskizb'.$id.'***'.$param['w_max_size'].'***max_sizeverj'.$id.'***" id="'.$id.'_max_size" name="'.$id.'_max_size"><input type="hidden" value="***destinationskizb'.$id.'***'.$param['w_destination'].'***destinationverj'.$id.'***" id="'.$id.'_destination" name="'.$id.'_destination"><input type="hidden" value="***extensionskizb'.$id.'***'.$param['w_extension'].'***extensionverj'.$id.'***" id="'.$id.'_extension" name="'.$id.'_extension"><input type="file" class="file_upload" id="'.$id.'_elementform_id_temp" name="'.$id.'_fileform_id_temp" '.$multiple.' '.$param['attributes'].' disabled/></div></div>';
|
1583 |
-
|
1584 |
-
break;
|
1585 |
-
}
|
1586 |
-
case 'type_captcha':
|
1587 |
-
{
|
1588 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_digit','w_class');
|
1589 |
-
$temp=$params;
|
1590 |
-
|
1591 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
1592 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_digit','w_class');
|
1593 |
-
|
1594 |
-
foreach($params_names as $params_name )
|
1595 |
-
{
|
1596 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
1597 |
-
$param[$params_name] = $temp[0];
|
1598 |
-
$temp=$temp[1];
|
1599 |
-
}
|
1600 |
-
|
1601 |
-
if($temp)
|
1602 |
-
{
|
1603 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
1604 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
1605 |
-
foreach($attrs as $attr)
|
1606 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
1607 |
-
}
|
1608 |
-
|
1609 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
1610 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
1611 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
1612 |
-
|
1613 |
-
|
1614 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_captcha" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display:'.$display_label.'; 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_fmc', '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'].' disabled/><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/></div></div></div></div></div>';
|
1615 |
-
|
1616 |
-
break;
|
1617 |
-
}
|
1618 |
-
case 'type_arithmetic_captcha':
|
1619 |
-
{
|
1620 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_count', 'w_operations','w_class', 'w_input_size');
|
1621 |
-
$temp=$params;
|
1622 |
-
|
1623 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
1624 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_count', 'w_operations','w_class', 'w_input_size');
|
1625 |
-
|
1626 |
-
|
1627 |
-
foreach($params_names as $params_name )
|
1628 |
-
{
|
1629 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
1630 |
-
$param[$params_name] = $temp[0];
|
1631 |
-
$temp=$temp[1];
|
1632 |
-
}
|
1633 |
-
|
1634 |
-
if($temp)
|
1635 |
-
{
|
1636 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
1637 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
1638 |
-
foreach($attrs as $attr)
|
1639 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
1640 |
-
}
|
1641 |
-
|
1642 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
1643 |
-
|
1644 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
1645 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
1646 |
-
$param['w_count'] = $param['w_count'] ? $param['w_count'] : 1;
|
1647 |
-
$param['w_operations'] = $param['w_operations'] ? $param['w_operations'] : '+, -, *, /';
|
1648 |
-
$param['w_input_size'] = $param['w_input_size'] ? $param['w_input_size'] : 60;
|
1649 |
-
|
1650 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_arithmetic_captcha" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display:'.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_captcha" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><div style="display: table;"><div style="display: table-row;"><div style="display: table-cell;"><img type="captcha" operations_count="'.$param['w_count'].'" operations="'.$param['w_operations'].'" input_size="'.$param['w_input_size'].'" src="' . add_query_arg(array('action' => 'formmakerwdmathcaptcha_fmc', 'operations_count' => $param['w_count'], 'operations' => urlencode($param['w_operations']), 'i' => 'form_id_temp'), admin_url('admin-ajax.php')) . '" id="_wd_arithmetic_captchaform_id_temp" class="arithmetic_captcha_img" onclick="captcha_refresh("_wd_arithmetic_captcha","form_id_temp")" '.$param['attributes'].'></div><div style="display: table-cell;"><input type="text" class="arithmetic_captcha_input" id="_wd_arithmetic_captcha_inputform_id_temp" name="arithmetic_captcha_input" onkeypress="return check_isnum(event)" style="width: '.$param['w_input_size'].'px;" '.$param['attributes'].' disabled/><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/></div><div style="display: table-cell; vertical-align: middle;"><div class="captcha_refresh" id="_element_refreshform_id_temp" onclick="captcha_refresh("_wd_arithmetic_captcha","form_id_temp")" '.$param['attributes'].'></div></div></div></div></div></div>';
|
1651 |
-
|
1652 |
-
break;
|
1653 |
-
}
|
1654 |
-
|
1655 |
-
|
1656 |
-
case 'type_recaptcha':
|
1657 |
-
{
|
1658 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_public','w_private','w_theme','w_class');
|
1659 |
-
$temp=$params;
|
1660 |
-
|
1661 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
1662 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_public','w_private','w_theme','w_class');
|
1663 |
-
|
1664 |
-
foreach($params_names as $params_name )
|
1665 |
-
{
|
1666 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
1667 |
-
$param[$params_name] = $temp[0];
|
1668 |
-
$temp=$temp[1];
|
1669 |
-
}
|
1670 |
-
|
1671 |
-
if($temp)
|
1672 |
-
{
|
1673 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
1674 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
1675 |
-
foreach($attrs as $attr)
|
1676 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
1677 |
-
}
|
1678 |
-
|
1679 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
1680 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
1681 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
1682 |
-
|
1683 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_recaptcha" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; 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"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_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>';
|
1684 |
-
|
1685 |
-
break;
|
1686 |
-
}
|
1687 |
-
|
1688 |
-
case 'type_hidden':
|
1689 |
-
{
|
1690 |
-
$params_names=array('w_name','w_value');
|
1691 |
-
$temp=$params;
|
1692 |
-
foreach($params_names as $params_name )
|
1693 |
-
{
|
1694 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
1695 |
-
$param[$params_name] = $temp[0];
|
1696 |
-
$temp=$temp[1];
|
1697 |
-
}
|
1698 |
-
|
1699 |
-
if($temp)
|
1700 |
-
{
|
1701 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
1702 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
1703 |
-
foreach($attrs as $attr)
|
1704 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
1705 |
-
}
|
1706 |
-
$param['w_name'] = str_replace(' ','',$param['w_name']);
|
1707 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_hidden" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" style="display: table-cell;"><span id="'.$id.'_element_labelform_id_temp" style="display: none;">'.$param['w_name'].'</span><span style="color: red; font-size: 13px;">Hidden field</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" style="display: table-cell; padding-left:7px;"><input type="hidden" value="'.$param['w_value'].'" id="'.$id.'_elementform_id_temp" name="'.$param['w_name'].'" '.$param['attributes'].'><input type="hidden" value="type_hidden" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><div><span align="left">Name: </span><span align="left" id="'.$id.'_hidden_nameform_id_temp">'.$param['w_name'].'</span></div><div><span align="left">Value: </span><span align="left" id="'.$id.'_hidden_valueform_id_temp">'.$param['w_value'].'</span></div></div></div>';
|
1708 |
-
|
1709 |
-
break;
|
1710 |
-
}
|
1711 |
-
case 'type_mark_map':
|
1712 |
-
{
|
1713 |
-
$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');
|
1714 |
-
$temp=$params;
|
1715 |
-
|
1716 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
1717 |
-
$params_names = array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_center_x','w_center_y','w_long','w_lat','w_zoom','w_width','w_height','w_info','w_class');
|
1718 |
-
|
1719 |
-
|
1720 |
-
foreach($params_names as $params_name )
|
1721 |
-
{
|
1722 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
1723 |
-
$param[$params_name] = $temp[0];
|
1724 |
-
$temp=$temp[1];
|
1725 |
-
}
|
1726 |
-
|
1727 |
-
if($temp)
|
1728 |
-
{
|
1729 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
1730 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
1731 |
-
foreach($attrs as $attr)
|
1732 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
1733 |
-
}
|
1734 |
-
|
1735 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
1736 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
1737 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
1738 |
-
|
1739 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_mark_map" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; 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="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><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> ';
|
1740 |
-
|
1741 |
-
break;
|
1742 |
-
}
|
1743 |
-
|
1744 |
-
case 'type_map':
|
1745 |
-
{
|
1746 |
-
$params_names=array('w_center_x','w_center_y','w_long','w_lat','w_zoom','w_width','w_height','w_info','w_class');
|
1747 |
-
$temp=$params;
|
1748 |
-
foreach($params_names as $params_name )
|
1749 |
-
{
|
1750 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
1751 |
-
$param[$params_name] = $temp[0];
|
1752 |
-
$temp=$temp[1];
|
1753 |
-
}
|
1754 |
-
|
1755 |
-
if($temp)
|
1756 |
-
{
|
1757 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
1758 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
1759 |
-
foreach($attrs as $attr)
|
1760 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
1761 |
-
}
|
1762 |
-
|
1763 |
-
$marker='';
|
1764 |
-
|
1765 |
-
$param['w_long'] = explode('***',$param['w_long']);
|
1766 |
-
$param['w_lat'] = explode('***',$param['w_lat']);
|
1767 |
-
$param['w_info'] = explode('***',$param['w_info']);
|
1768 |
-
foreach($param['w_long'] as $key => $w_long )
|
1769 |
-
{
|
1770 |
-
$marker.='long'.$key.'="'.$w_long.'" lat'.$key.'="'.$param['w_lat'][$key].'" info'.$key.'="'.$param['w_info'][$key].'"';
|
1771 |
-
}
|
1772 |
-
|
1773 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_map" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: table-cell;"><span id="'.$id.'_element_labelform_id_temp" style="display: none;">'.$label.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: table-cell;"><input type="hidden" value="type_map" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><div id="'.$id.'_elementform_id_temp" zoom="'.$param['w_zoom'].'" center_x="'.$param['w_center_x'].'" center_y="'.$param['w_center_y'].'" style="width: '.$param['w_width'].'px; height: '.$param['w_height'].'px;" '.$marker.' '.$param['attributes'].'></div></div></div>';
|
1774 |
-
|
1775 |
-
break;
|
1776 |
-
}
|
1777 |
-
case 'type_paypal_price':
|
1778 |
-
{
|
1779 |
-
|
1780 |
-
$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');
|
1781 |
-
$temp=$params;
|
1782 |
-
foreach($params_names as $params_name )
|
1783 |
-
{
|
1784 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
1785 |
-
$param[$params_name] = $temp[0];
|
1786 |
-
$temp=$temp[1];
|
1787 |
-
}
|
1788 |
-
|
1789 |
-
if($temp)
|
1790 |
-
{
|
1791 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
1792 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
1793 |
-
foreach($attrs as $attr)
|
1794 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
1795 |
-
}
|
1796 |
-
|
1797 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
1798 |
-
$input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active");
|
1799 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
1800 |
-
$hide_cents = ($param['w_hide_cents']=="yes" ? "none;" : "table-cell;");
|
1801 |
-
|
1802 |
-
|
1803 |
-
$w_first_val = explode('***',$param['w_first_val']);
|
1804 |
-
$w_title = explode('***',$param['w_title']);
|
1805 |
-
$w_mini_labels = explode('***',$param['w_mini_labels']);
|
1806 |
-
|
1807 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_paypal_price" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required"style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_paypal_price" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_range_min'].'" name="'.$id.'_range_minform_id_temp" id="'.$id.'_range_minform_id_temp"><input type="hidden" value="'.$param['w_range_max'].'" name="'.$id.'_range_maxform_id_temp" id="'.$id.'_range_maxform_id_temp"><div id="'.$id.'_table_price" style="display: table;"><div id="'.$id.'_tr_price1" style="display: table-row;"><div id="'.$id.'_td_name_currency" style="display: table-cell;"><span class="wdform_colon" style="vertical-align: middle;"><!--repstart--> $ <!--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'].' disabled/></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'].' disabled/></div></div><div id="'.$id.'_tr_price2" style="display: table-row;"><div style="display: table-cell;"><label class="mini_label"></label></div><div align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_dollars">'.$w_mini_labels[0].'</label></div><div id="'.$id.'_td_name_label_divider" style="display: '.$hide_cents.'"><label class="mini_label"></label></div><div align="left" id="'.$id.'_td_name_label_cents" style="display: '.$hide_cents.'"><label class="mini_label" id="'.$id.'_mini_label_cents">'.$w_mini_labels[1].'</label></div></div></div></div></div>';
|
1808 |
-
break;
|
1809 |
-
}
|
1810 |
-
|
1811 |
-
case 'type_paypal_price_new':
|
1812 |
-
{
|
1813 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_first_val','w_title', 'w_size','w_required', 'w_class','w_range_min','w_range_max', 'w_readonly', 'w_currency');
|
1814 |
-
|
1815 |
-
$temp=$params;
|
1816 |
-
|
1817 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
1818 |
-
$params_names = array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_first_val','w_title', 'w_size','w_required', 'w_class','w_range_min','w_range_max', 'w_readonly', 'w_currency');
|
1819 |
-
|
1820 |
-
|
1821 |
-
foreach($params_names as $params_name )
|
1822 |
-
{
|
1823 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
1824 |
-
$param[$params_name] = $temp[0];
|
1825 |
-
$temp=$temp[1];
|
1826 |
-
}
|
1827 |
-
|
1828 |
-
if($temp)
|
1829 |
-
{
|
1830 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
1831 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
1832 |
-
foreach($attrs as $attr)
|
1833 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
1834 |
-
}
|
1835 |
-
|
1836 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
1837 |
-
|
1838 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
1839 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
1840 |
-
|
1841 |
-
$input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active");
|
1842 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
1843 |
-
$currency_sumbol = ($param['w_currency']=="yes" ? "display:none;" : "display: table-cell;");
|
1844 |
-
$param['w_readonly'] = (isset($param['w_readonly']) ? $param['w_readonly'] : "no");
|
1845 |
-
|
1846 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_paypal_price_new" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required"style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_paypal_price_new" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_readonly'].'" name="'.$id.'_readonlyform_id_temp" id="'.$id.'_readonlyform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_range_min'].'" name="'.$id.'_range_minform_id_temp" id="'.$id.'_range_minform_id_temp"><input type="hidden" value="'.$param['w_range_max'].'" name="'.$id.'_range_maxform_id_temp" id="'.$id.'_range_maxform_id_temp"><div id="'.$id.'_table_price" style="display: table;"><div id="'.$id.'_tr_price1" style="display: table-row;"><div id="'.$id.'_td_name_currency" style="'.$currency_sumbol.'"><span class="wdform_colon" style="vertical-align: middle;"><!--repstart--> $ <!--repend--></span></div><div id="'.$id.'_td_name_dollars" style="display: table-cell;"><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")" onkeypress="return check_isnum(event)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled/></div></div></div></div></div>';
|
1847 |
-
break;
|
1848 |
-
}
|
1849 |
-
|
1850 |
-
|
1851 |
-
|
1852 |
-
|
1853 |
-
|
1854 |
-
case 'type_paypal_select':
|
1855 |
-
{
|
1856 |
-
$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');
|
1857 |
-
$temp=$params;
|
1858 |
-
if(strpos($temp, 'w_choices_params') > -1)
|
1859 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_size','w_choices','w_choices_price','w_choices_checked', 'w_choices_disabled','w_required','w_quantity', 'w_quantity_value', 'w_choices_params', 'w_class', 'w_property', 'w_property_values');
|
1860 |
-
|
1861 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
1862 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_size','w_choices','w_choices_price','w_choices_checked', 'w_choices_disabled','w_required','w_quantity', 'w_quantity_value', 'w_choices_params', 'w_class', 'w_property', 'w_property_values');
|
1863 |
-
|
1864 |
-
foreach($params_names as $params_name )
|
1865 |
-
{
|
1866 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
1867 |
-
$param[$params_name] = $temp[0];
|
1868 |
-
$temp=$temp[1];
|
1869 |
-
}
|
1870 |
-
|
1871 |
-
if($temp)
|
1872 |
-
{
|
1873 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
1874 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
1875 |
-
foreach($attrs as $attr)
|
1876 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
1877 |
-
}
|
1878 |
-
|
1879 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
1880 |
-
|
1881 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
1882 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
1883 |
-
|
1884 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
1885 |
-
$param['w_choices'] = explode('***',$param['w_choices']);
|
1886 |
-
|
1887 |
-
$param['w_choices_price'] = explode('***',$param['w_choices_price']);
|
1888 |
-
|
1889 |
-
$param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
|
1890 |
-
|
1891 |
-
$param['w_choices_disabled'] = explode('***',$param['w_choices_disabled']);
|
1892 |
-
$param['w_property'] = explode('***',$param['w_property']);
|
1893 |
-
$param['w_property_values'] = explode('***',$param['w_property_values']);
|
1894 |
-
if(isset($param['w_choices_params']))
|
1895 |
-
$param['w_choices_params'] = explode('***',$param['w_choices_params']);
|
1896 |
-
foreach($param['w_choices_checked'] as $key => $choices_checked )
|
1897 |
-
{
|
1898 |
-
if($choices_checked=='true')
|
1899 |
-
$param['w_choices_checked'][$key]='selected="selected"';
|
1900 |
-
else
|
1901 |
-
$param['w_choices_checked'][$key]='';
|
1902 |
-
}
|
1903 |
-
|
1904 |
-
|
1905 |
-
$rep='<div id="wdform_field'.$id.'" type="type_paypal_select" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; "><input type="hidden" value="type_paypal_select" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><select id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" onchange="set_select(this)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].' disabled>';
|
1906 |
-
foreach($param['w_choices'] as $key => $choice)
|
1907 |
-
{
|
1908 |
-
$where = '';
|
1909 |
-
$order_by = '';
|
1910 |
-
$db_info = '';
|
1911 |
-
$choice_value = $param['w_choices_disabled'][$key]=="true" ? '' : $param['w_choices_price'][$key];
|
1912 |
-
|
1913 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
|
1914 |
-
{
|
1915 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
|
1916 |
-
$where = "where='".$w_choices_params[0]."'";
|
1917 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
1918 |
-
$order_by = "order_by='".$w_choices_params[0]."'";
|
1919 |
-
$db_info = "db_info='".$w_choices_params[1]."'";
|
1920 |
-
}
|
1921 |
-
$rep.='<option id="'.$id.'_option'.$key.'" value="'.$choice_value.'" onselect="set_select("'.$id.'_option'.$key.'")" '.$param['w_choices_checked'][$key].' '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</option>';
|
1922 |
-
}
|
1923 |
-
$rep.='</select><div id="'.$id.'_divform_id_temp">';
|
1924 |
-
if($param['w_quantity']=="yes")
|
1925 |
-
$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;" disabled /></span>';
|
1926 |
-
if($param['w_property'][0])
|
1927 |
-
foreach($param['w_property'] as $key => $property)
|
1928 |
-
{
|
1929 |
-
|
1930 |
-
$rep.='
|
1931 |
-
<span id="'.$id.'_property_'.$key.'" style="margin-right: 15px;">
|
1932 |
-
|
1933 |
-
<label class="mini_label" id="'.$id.'_property_label_form_id_temp'.$key.'" style="margin-right: 5px;">'.$property.'</label>
|
1934 |
-
<select id="'.$id.'_propertyform_id_temp'.$key.'" name="'.$id.'_propertyform_id_temp'.$key.'" style="width: auto; margin: 2px 0px;" disabled>';
|
1935 |
-
$param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
|
1936 |
-
$param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
|
1937 |
-
foreach($param['w_property_values'][$key] as $subkey => $property_value)
|
1938 |
-
{
|
1939 |
-
$rep.='<option id="'.$id.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'">'.$property_value.'</option>';
|
1940 |
-
}
|
1941 |
-
$rep.='</select></span>';
|
1942 |
-
}
|
1943 |
-
|
1944 |
-
$rep.='</div></div></div>';
|
1945 |
-
break;
|
1946 |
-
}
|
1947 |
-
|
1948 |
-
case 'type_paypal_checkbox':
|
1949 |
-
{
|
1950 |
-
|
1951 |
-
$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');
|
1952 |
-
$temp=$params;
|
1953 |
-
if(strpos($temp, 'w_field_option_pos') > -1)
|
1954 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_field_option_pos', 'w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num', 'w_choices_params', 'w_class','w_property','w_property_values','w_quantity','w_quantity_value');
|
1955 |
-
|
1956 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
1957 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_field_option_pos', 'w_hide_label', 'w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num', 'w_choices_params', 'w_class','w_property','w_property_values','w_quantity','w_quantity_value');
|
1958 |
-
foreach($params_names as $params_name )
|
1959 |
-
{
|
1960 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
1961 |
-
$param[$params_name] = $temp[0];
|
1962 |
-
$temp=$temp[1];
|
1963 |
-
}
|
1964 |
-
|
1965 |
-
if($temp)
|
1966 |
-
{
|
1967 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
1968 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
1969 |
-
foreach($attrs as $attr)
|
1970 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
1971 |
-
}
|
1972 |
-
if(!isset($param['w_field_option_pos']))
|
1973 |
-
$param['w_field_option_pos'] = 'left';
|
1974 |
-
|
1975 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
1976 |
-
|
1977 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
1978 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
1979 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
1980 |
-
$param['w_choices'] = explode('***',$param['w_choices']);
|
1981 |
-
$param['w_choices_price'] = explode('***',$param['w_choices_price']);
|
1982 |
-
$param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
|
1983 |
-
$param['w_property'] = explode('***',$param['w_property']);
|
1984 |
-
$param['w_property_values'] = explode('***',$param['w_property_values']);
|
1985 |
-
|
1986 |
-
if(isset($param['w_choices_params']))
|
1987 |
-
$param['w_choices_params'] = explode('***',$param['w_choices_params']);
|
1988 |
-
|
1989 |
-
foreach($param['w_choices_checked'] as $key => $choices_checked )
|
1990 |
-
{
|
1991 |
-
if($choices_checked=='true')
|
1992 |
-
$param['w_choices_checked'][$key]='checked="checked"';
|
1993 |
-
else
|
1994 |
-
$param['w_choices_checked'][$key]='';
|
1995 |
-
}
|
1996 |
-
|
1997 |
-
$rep='<div id="wdform_field'.$id.'" type="type_paypal_checkbox" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="wd_form_label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_paypal_checkbox" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_randomize'].'" name="'.$id.'_randomizeform_id_temp" id="'.$id.'_randomizeform_id_temp"><input type="hidden" value="'.$param['w_allow_other'].'" name="'.$id.'_allow_otherform_id_temp" id="'.$id.'_allow_otherform_id_temp"><input type="hidden" value="'.$param['w_allow_other_num'].'" name="'.$id.'_allow_other_numform_id_temp" id="'.$id.'_allow_other_numform_id_temp"><input type="hidden" value="'.$param['w_field_option_pos'].'" id="'.$id.'_option_left_right"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;">';
|
1998 |
-
|
1999 |
-
if($param['w_flow']=='hor')
|
2000 |
-
{
|
2001 |
-
$rep.= '<div id="'.$id.'_hor" style="display: table-row;">';
|
2002 |
-
foreach($param['w_choices'] as $key => $choice)
|
2003 |
-
{
|
2004 |
-
$where ='';
|
2005 |
-
$order_by ='';
|
2006 |
-
$db_info = '';
|
2007 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
|
2008 |
-
{
|
2009 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
|
2010 |
-
$where = "where='".$w_choices_params[0]."'";
|
2011 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
2012 |
-
$order_by = "order_by='".$w_choices_params[0]."'";
|
2013 |
-
$db_info = "db_info='".$w_choices_params[1]."'";
|
2014 |
-
}
|
2015 |
-
|
2016 |
-
$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'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'" '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</label></div>';
|
2017 |
-
}
|
2018 |
-
$rep.= '</div>';
|
2019 |
-
}
|
2020 |
-
else
|
2021 |
-
{
|
2022 |
-
|
2023 |
-
foreach($param['w_choices'] as $key => $choice)
|
2024 |
-
{
|
2025 |
-
$where ='';
|
2026 |
-
$order_by ='';
|
2027 |
-
$db_info ='';
|
2028 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
|
2029 |
-
{
|
2030 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
|
2031 |
-
$where = "where='".$w_choices_params[0]."'";
|
2032 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
2033 |
-
$order_by = "order_by='".$w_choices_params[0]."'";
|
2034 |
-
$db_info = "db_info='".$w_choices_params[1]."'";
|
2035 |
-
}
|
2036 |
-
|
2037 |
-
$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'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'" '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</label></div></div>';
|
2038 |
-
}
|
2039 |
-
|
2040 |
-
}
|
2041 |
-
$rep.='</div></div>';
|
2042 |
-
|
2043 |
-
$rep.='<div id="'.$id.'_divform_id_temp">';
|
2044 |
-
if($param['w_quantity']=="yes")
|
2045 |
-
$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;" disabled/></span>';
|
2046 |
-
if($param['w_property'][0])
|
2047 |
-
foreach($param['w_property'] as $key => $property)
|
2048 |
-
{
|
2049 |
-
$rep.='
|
2050 |
-
<span id="'.$id.'_property_'.$key.'" style="margin-right: 15px;">
|
2051 |
-
|
2052 |
-
<label class="mini_label" id="'.$id.'_property_label_form_id_temp'.$key.'" style="margin-right: 5px;">'.$property.'</label>
|
2053 |
-
<select id="'.$id.'_propertyform_id_temp'.$key.'" name="'.$id.'_propertyform_id_temp'.$key.'" style="width: auto; margin: 2px 0px;" disabled>';
|
2054 |
-
$param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
|
2055 |
-
$param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
|
2056 |
-
foreach($param['w_property_values'][$key] as $subkey => $property_value)
|
2057 |
-
{
|
2058 |
-
$rep.='<option id="'.$id.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'">'.$property_value.'</option>';
|
2059 |
-
}
|
2060 |
-
$rep.='</select></span>';
|
2061 |
-
}
|
2062 |
-
|
2063 |
-
$rep.='</div></div></div>';
|
2064 |
-
break;
|
2065 |
-
}
|
2066 |
-
case 'type_paypal_radio':
|
2067 |
-
{
|
2068 |
-
|
2069 |
-
$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');
|
2070 |
-
$temp=$params;
|
2071 |
-
if(strpos($temp, 'w_field_option_pos') > -1)
|
2072 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_field_option_pos', 'w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num', 'w_choices_params', 'w_class','w_property','w_property_values','w_quantity','w_quantity_value');
|
2073 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
2074 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_field_option_pos', 'w_hide_label', 'w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num', 'w_choices_params', 'w_class','w_property','w_property_values','w_quantity','w_quantity_value');
|
2075 |
-
foreach($params_names as $params_name )
|
2076 |
-
{
|
2077 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
2078 |
-
$param[$params_name] = $temp[0];
|
2079 |
-
$temp=$temp[1];
|
2080 |
-
}
|
2081 |
-
|
2082 |
-
if($temp)
|
2083 |
-
{
|
2084 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
2085 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
2086 |
-
foreach($attrs as $attr)
|
2087 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
2088 |
-
}
|
2089 |
-
if(!isset($param['w_field_option_pos']))
|
2090 |
-
$param['w_field_option_pos'] = 'left';
|
2091 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
2092 |
-
|
2093 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
2094 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
2095 |
-
|
2096 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
2097 |
-
$param['w_choices'] = explode('***',$param['w_choices']);
|
2098 |
-
|
2099 |
-
$param['w_choices_price'] = explode('***',$param['w_choices_price']);
|
2100 |
-
|
2101 |
-
$param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
|
2102 |
-
|
2103 |
-
$param['w_property'] = explode('***',$param['w_property']);
|
2104 |
-
$param['w_property_values'] = explode('***',$param['w_property_values']);
|
2105 |
-
|
2106 |
-
if(isset($param['w_choices_params']))
|
2107 |
-
$param['w_choices_params'] = explode('***',$param['w_choices_params']);
|
2108 |
-
|
2109 |
-
foreach($param['w_choices_checked'] as $key => $choices_checked )
|
2110 |
-
{
|
2111 |
-
if($choices_checked=='true')
|
2112 |
-
$param['w_choices_checked'][$key]='checked="checked"';
|
2113 |
-
else
|
2114 |
-
$param['w_choices_checked'][$key]='';
|
2115 |
-
}
|
2116 |
-
|
2117 |
-
$rep='<div id="wdform_field'.$id.'" type="type_paypal_radio" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="wd_form_label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_paypal_radio" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_randomize'].'" name="'.$id.'_randomizeform_id_temp" id="'.$id.'_randomizeform_id_temp"><input type="hidden" value="'.$param['w_allow_other'].'" name="'.$id.'_allow_otherform_id_temp" id="'.$id.'_allow_otherform_id_temp"><input type="hidden" value="'.$param['w_allow_other_num'].'" name="'.$id.'_allow_other_numform_id_temp" id="'.$id.'_allow_other_numform_id_temp"><input type="hidden" value="'.$param['w_field_option_pos'].'" id="'.$id.'_option_left_right"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;">';
|
2118 |
-
|
2119 |
-
if($param['w_flow']=='hor')
|
2120 |
-
{
|
2121 |
-
$rep.= '<div id="'.$id.'_hor" style="display: table-row;">';
|
2122 |
-
foreach($param['w_choices'] as $key => $choice)
|
2123 |
-
{
|
2124 |
-
$where ='';
|
2125 |
-
$order_by ='';
|
2126 |
-
$db_info ='';
|
2127 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
|
2128 |
-
{
|
2129 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
|
2130 |
-
$where = "where='".$w_choices_params[0]."'";
|
2131 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
2132 |
-
$order_by = "order_by='".$w_choices_params[0]."'";
|
2133 |
-
$db_info = "db_info='".$w_choices_params[1]."'";
|
2134 |
-
}
|
2135 |
-
|
2136 |
-
$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'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'" '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</label></div>';
|
2137 |
-
}
|
2138 |
-
$rep.= '</div>';
|
2139 |
-
}
|
2140 |
-
else
|
2141 |
-
{
|
2142 |
-
|
2143 |
-
foreach($param['w_choices'] as $key => $choice)
|
2144 |
-
{
|
2145 |
-
|
2146 |
-
$where ='';
|
2147 |
-
$order_by ='';
|
2148 |
-
$db_info ='';
|
2149 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
|
2150 |
-
{
|
2151 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
|
2152 |
-
$where = "where='".$w_choices_params[0]."'";
|
2153 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
2154 |
-
$order_by = "order_by='".$w_choices_params[0]."'";
|
2155 |
-
$db_info = "db_info='".$w_choices_params[1]."'";
|
2156 |
-
}
|
2157 |
-
|
2158 |
-
$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'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'" '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</label></div></div>';
|
2159 |
-
}
|
2160 |
-
|
2161 |
-
}
|
2162 |
-
$rep.='</div></div>';
|
2163 |
-
|
2164 |
-
$rep.='<div id="'.$id.'_divform_id_temp">';
|
2165 |
-
if($param['w_quantity']=="yes")
|
2166 |
-
$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;" disabled/></span>';
|
2167 |
-
if($param['w_property'][0])
|
2168 |
-
foreach($param['w_property'] as $key => $property)
|
2169 |
-
{
|
2170 |
-
$rep.='
|
2171 |
-
<span id="'.$id.'_property_'.$key.'" style="margin-right: 15px;">
|
2172 |
-
|
2173 |
-
<label class="mini_label" id="'.$id.'_property_label_form_id_temp'.$key.'" style="margin-right: 5px;">'.$property.'</label>
|
2174 |
-
<select id="'.$id.'_propertyform_id_temp'.$key.'" name="'.$id.'_propertyform_id_temp'.$key.'" style="width: auto; margin: 2px 0px;" disabled>';
|
2175 |
-
$param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
|
2176 |
-
$param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
|
2177 |
-
foreach($param['w_property_values'][$key] as $subkey => $property_value)
|
2178 |
-
{
|
2179 |
-
$rep.='<option id="'.$id.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'">'.$property_value.'</option>';
|
2180 |
-
}
|
2181 |
-
$rep.='</select></span>';
|
2182 |
-
}
|
2183 |
-
|
2184 |
-
$rep.='</div></div></div>';
|
2185 |
-
|
2186 |
-
break;
|
2187 |
-
}
|
2188 |
-
case 'type_paypal_shipping':
|
2189 |
-
{
|
2190 |
-
|
2191 |
-
$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');
|
2192 |
-
$temp=$params;
|
2193 |
-
|
2194 |
-
if(strpos($temp, 'w_field_option_pos') > -1)
|
2195 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_field_option_pos', 'w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num','w_choices_params','w_class');
|
2196 |
-
|
2197 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
2198 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_field_option_pos', 'w_hide_label', 'w_flow','w_choices','w_choices_price','w_choices_checked','w_required','w_randomize','w_allow_other','w_allow_other_num','w_choices_params','w_class');
|
2199 |
-
|
2200 |
-
foreach($params_names as $params_name )
|
2201 |
-
{
|
2202 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
2203 |
-
$param[$params_name] = $temp[0];
|
2204 |
-
$temp=$temp[1];
|
2205 |
-
}
|
2206 |
-
|
2207 |
-
if($temp)
|
2208 |
-
{
|
2209 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
2210 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
2211 |
-
foreach($attrs as $attr)
|
2212 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
2213 |
-
}
|
2214 |
-
if(!isset($param['w_field_option_pos']))
|
2215 |
-
$param['w_field_option_pos'] = 'left';
|
2216 |
-
|
2217 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
2218 |
-
|
2219 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
2220 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
2221 |
-
|
2222 |
-
|
2223 |
-
|
2224 |
-
|
2225 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
2226 |
-
$param['w_choices'] = explode('***',$param['w_choices']);
|
2227 |
-
|
2228 |
-
$param['w_choices_price'] = explode('***',$param['w_choices_price']);
|
2229 |
-
|
2230 |
-
$param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
|
2231 |
-
|
2232 |
-
if(isset($param['w_choices_params']))
|
2233 |
-
$param['w_choices_params'] = explode('***',$param['w_choices_params']);
|
2234 |
-
|
2235 |
-
foreach($param['w_choices_checked'] as $key => $choices_checked )
|
2236 |
-
{
|
2237 |
-
if($choices_checked=='true')
|
2238 |
-
$param['w_choices_checked'][$key]='checked="checked"';
|
2239 |
-
else
|
2240 |
-
$param['w_choices_checked'][$key]='';
|
2241 |
-
}
|
2242 |
-
|
2243 |
-
$rep='<div id="wdform_field'.$id.'" type="type_paypal_shipping" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="wd_form_label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; vertical-align:top;"><input type="hidden" value="type_paypal_shipping" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_randomize'].'" name="'.$id.'_randomizeform_id_temp" id="'.$id.'_randomizeform_id_temp"><input type="hidden" value="'.$param['w_allow_other'].'" name="'.$id.'_allow_otherform_id_temp" id="'.$id.'_allow_otherform_id_temp"><input type="hidden" value="'.$param['w_allow_other_num'].'" name="'.$id.'_allow_other_numform_id_temp" id="'.$id.'_allow_other_numform_id_temp"><input type="hidden" value="'.$param['w_field_option_pos'].'" id="'.$id.'_option_left_right"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;">';
|
2244 |
-
|
2245 |
-
if($param['w_flow']=='hor')
|
2246 |
-
{
|
2247 |
-
$rep.= '<div id="'.$id.'_hor" style="display: table-row;">';
|
2248 |
-
foreach($param['w_choices'] as $key => $choice)
|
2249 |
-
{
|
2250 |
-
$where ='';
|
2251 |
-
$order_by ='';
|
2252 |
-
$db_info ='';
|
2253 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
|
2254 |
-
{
|
2255 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
|
2256 |
-
$where = "where='".$w_choices_params[0]."'";
|
2257 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
2258 |
-
$order_by = "order_by='".$w_choices_params[0]."'";
|
2259 |
-
$db_info = "db_info='".$w_choices_params[1]."'";
|
2260 |
-
}
|
2261 |
-
|
2262 |
-
$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'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'" '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</label></div>';
|
2263 |
-
}
|
2264 |
-
$rep.= '</div>';
|
2265 |
-
}
|
2266 |
-
else
|
2267 |
-
{
|
2268 |
-
|
2269 |
-
foreach($param['w_choices'] as $key => $choice)
|
2270 |
-
{
|
2271 |
-
$where ='';
|
2272 |
-
$order_by ='';
|
2273 |
-
$db_info ='';
|
2274 |
-
if(isset($param['w_choices_params']) && $param['w_choices_params'][$key])
|
2275 |
-
{
|
2276 |
-
$w_choices_params = explode('[where_order_by]',$param['w_choices_params'][$key]);
|
2277 |
-
$where = "where='".$w_choices_params[0]."'";
|
2278 |
-
$w_choices_params = explode('[db_info]',$w_choices_params[1]);
|
2279 |
-
$order_by = "order_by='".$w_choices_params[0]."'";
|
2280 |
-
$db_info = "db_info='".$w_choices_params[1]."'";
|
2281 |
-
}
|
2282 |
-
|
2283 |
-
$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'].' '.($param['w_field_option_pos']=='right' ? 'style="float:left !important;"' : "").' disabled/><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'" '.$where.' '.$order_by.' '.$db_info.'>'.$choice.'</label></div></div>';
|
2284 |
-
}
|
2285 |
-
|
2286 |
-
}
|
2287 |
-
$rep.='</div></div>';
|
2288 |
-
|
2289 |
-
$rep.='</div></div>';
|
2290 |
-
|
2291 |
-
break;
|
2292 |
-
}
|
2293 |
-
case 'type_paypal_total':
|
2294 |
-
{
|
2295 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_class');
|
2296 |
-
$temp=$params;
|
2297 |
-
if(strpos($temp, 'w_size') > -1)
|
2298 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_class', 'w_size');
|
2299 |
-
|
2300 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
2301 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_class', 'w_size');
|
2302 |
-
|
2303 |
-
foreach($params_names as $params_name )
|
2304 |
-
{
|
2305 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
2306 |
-
$param[$params_name] = $temp[0];
|
2307 |
-
$temp=$temp[1];
|
2308 |
-
}
|
2309 |
-
|
2310 |
-
if($temp)
|
2311 |
-
{
|
2312 |
-
$temp = explode('*:*w_attr_name*:*',$temp);
|
2313 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
2314 |
-
foreach($attrs as $attr)
|
2315 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
2316 |
-
}
|
2317 |
-
|
2318 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
2319 |
-
|
2320 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
2321 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
2322 |
-
$param['w_size'] = isset($param['w_size']) ? $param['w_size'] : '300';
|
2323 |
-
|
2324 |
-
$rep='<div id="wdform_field'.$id.'" type="type_paypal_total" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; 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"><input type="hidden" value="'.$param['w_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><div id="'.$id.'paypal_totalform_id_temp" class="wdform_paypal_total paypal_totalform_id_temp" style="width:'.$param['w_size'].'px;"><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>';
|
2325 |
-
|
2326 |
-
break;
|
2327 |
-
}
|
2328 |
-
|
2329 |
-
|
2330 |
-
|
2331 |
-
case 'type_stripe': {
|
2332 |
-
$params_names=array('w_field_size', 'w_field_label_size','w_field_label_pos','w_class');
|
2333 |
-
$temp=$params;
|
2334 |
-
foreach($params_names as $params_name )
|
2335 |
-
{
|
2336 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
2337 |
-
$param[$params_name] = $temp[0];
|
2338 |
-
$temp=$temp[1];
|
2339 |
-
}
|
2340 |
-
|
2341 |
-
if($temp)
|
2342 |
-
{
|
2343 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
2344 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
2345 |
-
foreach($attrs as $attr)
|
2346 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
2347 |
-
}
|
2348 |
-
|
2349 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
2350 |
-
$rep='<div id="wdform_field'.$id.'" type="type_stripe" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="display: none;">stripe</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><div id="'.$id.'_elementform_id_temp" style="width:'.$param['w_field_size'].'px; margin:10px; border: 1px solid #000; min-width:80px;text-align:center;"> Stripe Section</div><input type="hidden" id="is_stripe" /><input type="hidden" value="type_stripe" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"></div></div>';
|
2351 |
-
|
2352 |
-
break;
|
2353 |
-
}
|
2354 |
-
|
2355 |
-
case 'type_star_rating':
|
2356 |
-
{
|
2357 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_field_label_col','w_star_amount','w_required','w_class');
|
2358 |
-
$temp=$params;
|
2359 |
-
|
2360 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
2361 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_field_label_col','w_star_amount','w_required','w_class');
|
2362 |
-
|
2363 |
-
foreach($params_names as $params_name )
|
2364 |
-
{
|
2365 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
2366 |
-
$param[$params_name] = $temp[0];
|
2367 |
-
$temp=$temp[1];
|
2368 |
-
}
|
2369 |
-
|
2370 |
-
if($temp)
|
2371 |
-
{
|
2372 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
2373 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
2374 |
-
foreach($attrs as $attr)
|
2375 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
2376 |
-
}
|
2377 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
2378 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
2379 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
2380 |
-
|
2381 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
2382 |
-
|
2383 |
-
|
2384 |
-
$images = '';
|
2385 |
-
for($i=0; $i<$param['w_star_amount']; $i++)
|
2386 |
-
{
|
2387 |
-
$images .= '<img id="'.$id.'_star_'.$i.'" src="' . WD_FMC_URL . '/images/star.png?ver='. WD_FMC_VERSION.'" onmouseover="change_src('.$i.','.$id.',"form_id_temp")" onmouseout="reset_src('.$i.','.$id.')" onclick="select_star_rating('.$i.','.$id.', "form_id_temp")">';
|
2388 |
-
}
|
2389 |
-
|
2390 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_star_rating" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; 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_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_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>';
|
2391 |
-
|
2392 |
-
|
2393 |
-
break;
|
2394 |
-
}
|
2395 |
-
case 'type_scale_rating':
|
2396 |
-
{
|
2397 |
-
$params_names=array('w_field_label_size','w_field_label_pos','w_mini_labels','w_scale_amount','w_required','w_class');
|
2398 |
-
$temp=$params;
|
2399 |
-
|
2400 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
2401 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_mini_labels','w_scale_amount','w_required','w_class');
|
2402 |
-
|
2403 |
-
foreach($params_names as $params_name )
|
2404 |
-
{
|
2405 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
2406 |
-
$param[$params_name] = $temp[0];
|
2407 |
-
$temp=$temp[1];
|
2408 |
-
}
|
2409 |
-
|
2410 |
-
if($temp)
|
2411 |
-
{
|
2412 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
2413 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
2414 |
-
foreach($attrs as $attr)
|
2415 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
2416 |
-
}
|
2417 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
2418 |
-
|
2419 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
2420 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
2421 |
-
|
2422 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
2423 |
-
|
2424 |
-
$w_mini_labels = explode('***',$param['w_mini_labels']);
|
2425 |
-
|
2426 |
-
$numbers = '';
|
2427 |
-
for($i=1; $i<=$param['w_scale_amount']; $i++)
|
2428 |
-
{
|
2429 |
-
$numbers .= '<div id="'.$id.'_scale_td1_'.$i.'form_id_temp" style="text-align: center; display: table-cell;"><span>'.$i.'</span></div>';
|
2430 |
-
}
|
2431 |
-
|
2432 |
-
|
2433 |
-
$radio_buttons = '';
|
2434 |
-
for($k=1; $k<=$param['w_scale_amount']; $k++)
|
2435 |
-
{
|
2436 |
-
$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>';
|
2437 |
-
}
|
2438 |
-
|
2439 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_scale_rating" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; 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_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_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>';
|
2440 |
-
|
2441 |
-
break;
|
2442 |
-
}
|
2443 |
-
case 'type_spinner':
|
2444 |
-
{
|
2445 |
-
$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');
|
2446 |
-
$temp=$params;
|
2447 |
-
|
2448 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
2449 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_field_width','w_field_min_value','w_field_max_value', 'w_field_step', 'w_field_value', 'w_required','w_class');
|
2450 |
-
|
2451 |
-
|
2452 |
-
foreach($params_names as $params_name ) {
|
2453 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
2454 |
-
$param[$params_name] = $temp[0];
|
2455 |
-
$temp=$temp[1];
|
2456 |
-
}
|
2457 |
-
if($temp) {
|
2458 |
-
$temp =explode('*:*w_attr_name*:*',$temp);
|
2459 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
2460 |
-
foreach($attrs as $attr)
|
2461 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
2462 |
-
}
|
2463 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
2464 |
-
|
2465 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
2466 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
2467 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
2468 |
-
|
2469 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_spinner" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; 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_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_field_width'].'" name="'.$id.'_spinner_widthform_id_temp" id="'.$id.'_spinner_widthform_id_temp"><input type="hidden" value="'.$param['w_field_min_value'].'" id="'.$id.'_min_valueform_id_temp" name="'.$id.'_min_valueform_id_temp"><input type="hidden" value="'.$param['w_field_max_value'].'" name="'.$id.'_max_valueform_id_temp" id="'.$id.'_max_valueform_id_temp"><input type="hidden" value="'.$param['w_field_step'].'" name="'.$id.'_stepform_id_temp" id="'.$id.'_stepform_id_temp"><input type="" value="'.($param['w_field_value']!= 'null' ? $param['w_field_value'] : '').'" name="'.$id.'_elementform_id_temp" id="'.$id.'_elementform_id_temp" onkeypress="return check_isnum_or_minus(event)" style="width: '.$param['w_field_width'].'px;" '.$param['attributes'].' disabled/></div></div>';
|
2470 |
-
break;
|
2471 |
-
}
|
2472 |
-
case 'type_slider': {
|
2473 |
-
$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');
|
2474 |
-
$temp=$params;
|
2475 |
-
|
2476 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
2477 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_field_width','w_field_min_value','w_field_max_value', 'w_field_value', 'w_required','w_class');
|
2478 |
-
|
2479 |
-
foreach($params_names as $params_name ) {
|
2480 |
-
$temp = explode('*:*'.$params_name.'*:*',$temp);
|
2481 |
-
$param[$params_name] = $temp[0];
|
2482 |
-
$temp=$temp[1];
|
2483 |
-
}
|
2484 |
-
if ($temp) {
|
2485 |
-
$temp = explode('*:*w_attr_name*:*', $temp);
|
2486 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
2487 |
-
foreach($attrs as $attr) {
|
2488 |
-
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
2489 |
-
}
|
2490 |
-
}
|
2491 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
2492 |
-
|
2493 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
2494 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
2495 |
-
|
2496 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
2497 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_slider" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; 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_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_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>';
|
2498 |
-
break;
|
2499 |
-
}
|
2500 |
-
case 'type_range': {
|
2501 |
-
$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');
|
2502 |
-
$temp = $params;
|
2503 |
-
|
2504 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
2505 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_field_range_width','w_field_range_step','w_field_value1', 'w_field_value2', 'w_mini_labels', 'w_required','w_class');
|
2506 |
-
|
2507 |
-
foreach ($params_names as $params_name ) {
|
2508 |
-
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
2509 |
-
$param[$params_name] = $temp[0];
|
2510 |
-
$temp = $temp[1];
|
2511 |
-
}
|
2512 |
-
if ($temp) {
|
2513 |
-
$temp = explode('*:*w_attr_name*:*', $temp);
|
2514 |
-
$attrs = array_slice($temp, 0, count($temp) - 1);
|
2515 |
-
foreach($attrs as $attr) {
|
2516 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
2517 |
-
}
|
2518 |
-
}
|
2519 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
2520 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
2521 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
2522 |
-
|
2523 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
2524 |
-
$w_mini_labels = explode('***',$param['w_mini_labels']);
|
2525 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_range" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; 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_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_field_range_width'].'" name="'.$id.'_range_widthform_id_temp" id="'.$id.'_range_widthform_id_temp"><input type="hidden" value="'.$param['w_field_range_step'].'" name="'.$id.'_range_stepform_id_temp" id="'.$id.'_range_stepform_id_temp"><div id="'.$id.'_elemet_table_littleform_id_temp" style="display: table;"><div style="display: table-row;"><div valign="middle" align="left" style="display: table-cell;"><input type="" value="'.($param['w_field_value1']!= 'null' ? $param['w_field_value1'] : '').'" name="'.$id.'_elementform_id_temp0" id="'.$id.'_elementform_id_temp0" onkeypress="return check_isnum_or_minus(event)" style="width: '.$param['w_field_range_width'].'px;" '.$param['attributes'].' disabled/></div><div valign="middle" align="left" style="display: table-cell; padding-left: 4px;"><input type="" value="'.($param['w_field_value2']!= 'null' ? $param['w_field_value2'] : '').'" name="'.$id.'_elementform_id_temp1" id="'.$id.'_elementform_id_temp1" onkeypress="return check_isnum_or_minus(event)" style="width: '.$param['w_field_range_width'].'px;" '.$param['attributes'].' disabled/></div></div><div style="display: table-row;"><div valign="top" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_from">'.$w_mini_labels[0].'</label></div><div valign="top" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_to">'.$w_mini_labels[1].'</label></div></div></div></div></div>';
|
2526 |
-
break;
|
2527 |
-
}
|
2528 |
-
case 'type_grading': {
|
2529 |
-
$params_names = array('w_field_label_size', 'w_field_label_pos', 'w_items', 'w_total', 'w_required', 'w_class');
|
2530 |
-
$temp = $params;
|
2531 |
-
|
2532 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
2533 |
-
$params_names=array('w_field_label_size', 'w_field_label_pos', 'w_hide_label', 'w_items', 'w_total', 'w_required', 'w_class');
|
2534 |
-
|
2535 |
-
|
2536 |
-
foreach($params_names as $params_name) {
|
2537 |
-
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
2538 |
-
$param[$params_name] = $temp[0];
|
2539 |
-
$temp = $temp[1];
|
2540 |
-
}
|
2541 |
-
if ($temp) {
|
2542 |
-
$temp = explode('*:*w_attr_name*:*', $temp);
|
2543 |
-
$attrs = array_slice($temp, 0, count($temp) - 1);
|
2544 |
-
foreach ($attrs as $attr) {
|
2545 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
2546 |
-
}
|
2547 |
-
}
|
2548 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
2549 |
-
|
2550 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
2551 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
2552 |
-
|
2553 |
-
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
2554 |
-
$w_items = explode('***', $param['w_items']);
|
2555 |
-
$grading_items = '';
|
2556 |
-
for($i=0; $i<count($w_items); $i++)
|
2557 |
-
{
|
2558 |
-
$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'].' disabled/><label id="'.$id.'_label_elementform_id_temp'.$i.'" class="ch-rad-label">'.$w_items[$i].'</label></div>';
|
2559 |
-
}
|
2560 |
-
|
2561 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_grading" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; 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_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_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>';
|
2562 |
-
|
2563 |
-
break;
|
2564 |
-
}
|
2565 |
-
case 'type_matrix': {
|
2566 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_field_input_type', 'w_rows', 'w_columns', 'w_required','w_class','w_textbox_size');
|
2567 |
-
$temp = $params;
|
2568 |
-
|
2569 |
-
if(strpos($temp, 'w_hide_label') > -1)
|
2570 |
-
$params_names=array('w_field_label_size','w_field_label_pos', 'w_hide_label', 'w_field_input_type', 'w_rows', 'w_columns', 'w_required','w_class','w_textbox_size');
|
2571 |
-
|
2572 |
-
|
2573 |
-
foreach ($params_names as $params_name) {
|
2574 |
-
$temp = explode('*:*'.$params_name.'*:*',$temp);
|
2575 |
-
$param[$params_name] = $temp[0];
|
2576 |
-
$temp = $temp[1];
|
2577 |
-
}
|
2578 |
-
if ($temp) {
|
2579 |
-
$temp = explode('*:*w_attr_name*:*', $temp);
|
2580 |
-
$attrs = array_slice($temp, 0, count($temp) - 1);
|
2581 |
-
foreach ($attrs as $attr) {
|
2582 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
2583 |
-
}
|
2584 |
-
}
|
2585 |
-
$param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
|
2586 |
-
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
2587 |
-
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
2588 |
-
|
2589 |
-
$required_sym = ($param['w_required']=="yes" ? " *" : "");
|
2590 |
-
$param['w_textbox_size'] = isset($param['w_textbox_size']) ? $param['w_textbox_size'] : '100';
|
2591 |
-
$w_rows = explode('***',$param['w_rows']);
|
2592 |
-
$w_columns = explode('***',$param['w_columns']);
|
2593 |
-
$column_labels = '';
|
2594 |
-
for ($i = 1; $i < count($w_columns); $i++) {
|
2595 |
-
$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>';
|
2596 |
-
}
|
2597 |
-
$rows_columns = '';
|
2598 |
-
for($i=1; $i<count($w_rows); $i++)
|
2599 |
-
{
|
2600 |
-
|
2601 |
-
$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>';
|
2602 |
-
|
2603 |
-
|
2604 |
-
for($k=1; $k<count($w_columns); $k++)
|
2605 |
-
{
|
2606 |
-
if($param['w_field_input_type']=='radio')
|
2607 |
-
$rows_columns .= '<div id="'.$id.'_element_td'.$i.'_'.$k.'" style="text-align: center; display: table-cell; padding: 5px 0 0 5px;"><input id="'.$id.'_input_elementform_id_temp'.$i.'_'.$k.'" align="center" size="14" type="radio" name="'.$id.'_input_elementform_id_temp'.$i.'" value="'.$i.'_'.$k.'" disabled/></div>';
|
2608 |
-
else
|
2609 |
-
if($param['w_field_input_type']=='checkbox')
|
2610 |
-
$rows_columns .= '<div id="'.$id.'_element_td'.$i.'_'.$k.'" style="text-align: center; display: table-cell; padding: 5px 0 0 5px;"><input id="'.$id.'_input_elementform_id_temp'.$i.'_'.$k.'" align="center" size="14" type="checkbox" name="'.$id.'_input_elementform_id_temp'.$i.'_'.$k.'" value="1" disabled/></div>';
|
2611 |
-
else
|
2612 |
-
if($param['w_field_input_type']=='text')
|
2613 |
-
$rows_columns .= '<div id="'.$id.'_element_td'.$i.'_'.$k.'" style="text-align: center; display: table-cell; padding: 5px 0 0 5px;"><input id="'.$id.'_input_elementform_id_temp'.$i.'_'.$k.'" align="center" type="text" name="'.$id.'_input_elementform_id_temp'.$i.'_'.$k.'" value="" style="width:'.$param['w_textbox_size'].'px" disabled/></div>';
|
2614 |
-
else
|
2615 |
-
if($param['w_field_input_type']=='select')
|
2616 |
-
$rows_columns .= '<div id="'.$id.'_element_td'.$i.'_'.$k.'" style="text-align: center; display: table-cell; padding: 5px 0 0 5px;"><select id="'.$id.'_select_yes_noform_id_temp'.$i.'_'.$k.'" name="'.$id.'_select_yes_noform_id_temp'.$i.'_'.$k.'" disabled><option value=""> </option><option value="yes">Yes</option><option value="no">No</option></select></div>';
|
2617 |
-
|
2618 |
-
}
|
2619 |
-
|
2620 |
-
$rows_columns .= '</div>';
|
2621 |
-
}
|
2622 |
-
|
2623 |
-
|
2624 |
-
|
2625 |
-
$rep ='<div id="wdform_field'.$id.'" type="type_matrix" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$display_label.'; 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_hide_label'].'" name="'.$id.'_hide_labelform_id_temp" id="'.$id.'_hide_labelform_id_temp"/><input type="hidden" value="'.$param['w_field_input_type'].'" name="'.$id.'_input_typeform_id_temp" id="'.$id.'_input_typeform_id_temp"><input type="hidden" value="'.$param['w_textbox_size'].'" name="'.$id.'_textbox_sizeform_id_temp" id="'.$id.'_textbox_sizeform_id_temp"><div id="'.$id.'_elementform_id_temp" style="display: table;" '.$param['attributes'].'><div id="'.$id.'_table_little" style="display: table-row-group;"><div id="'.$id.'_element_tr0" style="display: table-row;"><div id="'.$id.'_element_td0_0" style="display: table-cell;"></div>'.$column_labels.'</div>'.$rows_columns.'</div></div></div></div>';
|
2626 |
-
|
2627 |
-
break;
|
2628 |
-
}
|
2629 |
-
case 'type_submit_reset': {
|
2630 |
-
$params_names=array('w_submit_title','w_reset_title','w_class','w_act');
|
2631 |
-
$temp=$params;
|
2632 |
-
foreach ($params_names as $params_name) {
|
2633 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
2634 |
-
$param[$params_name] = $temp[0];
|
2635 |
-
$temp=$temp[1];
|
2636 |
-
}
|
2637 |
-
if ($temp) {
|
2638 |
-
$temp = explode('*:*w_attr_name*:*',$temp);
|
2639 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
2640 |
-
foreach ($attrs as $attr) {
|
2641 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
2642 |
-
}
|
2643 |
-
}
|
2644 |
-
$param['w_act'] = ($param['w_act']=="false" ? 'style="display: none;"' : "");
|
2645 |
-
$rep='<div id="wdform_field'.$id.'" type="type_submit_reset" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: table-cell;"><span id="'.$id.'_element_labelform_id_temp" style="display: none;">type_submit_reset_'.$id.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: table-cell;"><input type="hidden" value="type_submit_reset" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><button type="button" class="button-submit" id="'.$id.'_element_submitform_id_temp" value="'.$param['w_submit_title'].'" disabled '.$param['attributes'].'>'.$param['w_submit_title'].'</button><button type="button" class="button-reset" id="'.$id.'_element_resetform_id_temp" value="'.$param['w_reset_title'].'" disabled '.$param['w_act'].' '.$param['attributes'].'>'.$param['w_reset_title'].'</button></div></div>';
|
2646 |
-
break;
|
2647 |
-
}
|
2648 |
-
case 'type_button': {
|
2649 |
-
$params_names=array('w_title','w_func','w_class');
|
2650 |
-
$temp=$params;
|
2651 |
-
foreach($params_names as $params_name) {
|
2652 |
-
$temp=explode('*:*'.$params_name.'*:*',$temp);
|
2653 |
-
$param[$params_name] = $temp[0];
|
2654 |
-
$temp=$temp[1];
|
2655 |
-
}
|
2656 |
-
if ($temp) {
|
2657 |
-
$temp = explode('*:*w_attr_name*:*',$temp);
|
2658 |
-
$attrs = array_slice($temp,0, count($temp)-1);
|
2659 |
-
foreach($attrs as $attr) {
|
2660 |
-
$param['attributes'] = $param['attributes'].' add_'.$attr;
|
2661 |
-
}
|
2662 |
-
}
|
2663 |
-
$param['w_title'] = explode('***',$param['w_title']);
|
2664 |
-
$param['w_func'] = explode('***',$param['w_func']);
|
2665 |
-
$rep.='<div id="wdform_field'.$id.'" type="type_button" class="wdform_field" style="display: table-cell;">'.$arrows.'<div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: table-cell;"><span id="'.$id.'_element_labelform_id_temp" style="display: none;">button_'.$id.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: table-cell;"><input type="hidden" value="type_button" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp">';
|
2666 |
-
foreach ($param['w_title'] as $key => $title) {
|
2667 |
-
$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>';
|
2668 |
-
}
|
2669 |
-
$rep .= '</div></div>';
|
2670 |
-
break;
|
2671 |
-
}
|
2672 |
-
}
|
2673 |
-
|
2674 |
-
$form = str_replace('%' . $id . ' - ' . $labels[$ids_key] . '%', $rep, $form);
|
2675 |
-
$form = str_replace('%' . $id . ' -' . $labels[$ids_key] . '%', $rep, $form);
|
2676 |
-
$row->form_front = $form;
|
2677 |
-
}
|
2678 |
-
}
|
2679 |
-
}
|
2680 |
-
else {
|
2681 |
-
$row = new stdClass();
|
2682 |
-
$row->id = 0;
|
2683 |
-
$row->backup_id ='';
|
2684 |
-
$row->title = '';
|
2685 |
-
$row->mail = '';
|
2686 |
-
$row->form = '';
|
2687 |
-
$row->form_front = '';
|
2688 |
-
$row->theme = $wpdb->get_var("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE `default`='1'");
|
2689 |
-
$row->javascript = '';
|
2690 |
-
$row->submit_text = '';
|
2691 |
-
$row->url = '';
|
2692 |
-
$row->submit_text_type = 0;
|
2693 |
-
$row->script1 = '';
|
2694 |
-
$row->script2 = '';
|
2695 |
-
$row->script_user1 = '';
|
2696 |
-
$row->script_user2 = '';
|
2697 |
-
$row->counter = 0;
|
2698 |
-
$row->label_order = '';
|
2699 |
-
$row->article_id = '';
|
2700 |
-
$row->pagination = '';
|
2701 |
-
$row->show_title = '';
|
2702 |
-
$row->show_numbers = '';
|
2703 |
-
$row->public_key = '';
|
2704 |
-
$row->private_key = '';
|
2705 |
-
$row->recaptcha_theme = '';
|
2706 |
-
$row->from_name = '';
|
2707 |
-
$row->from_mail = '';
|
2708 |
-
$row->label_order_current = '';
|
2709 |
-
$row->script_mail_user = '';
|
2710 |
-
$row->script_mail = '';
|
2711 |
-
$row->tax = 0;
|
2712 |
-
$row->payment_currency = '$';
|
2713 |
-
$row->paypal_email = '';
|
2714 |
-
$row->checkout_mode = 'testmode';
|
2715 |
-
$row->paypal_mode = 0;
|
2716 |
-
|
2717 |
-
$row->published = 1;
|
2718 |
-
$row->form_fields = '';
|
2719 |
-
$row->savedb = 1;
|
2720 |
-
$row->sendemail = 1;
|
2721 |
-
$row->requiredmark = '*';
|
2722 |
-
$row->reply_to = 0;
|
2723 |
-
$row->send_to = 0;
|
2724 |
-
$row->autogen_layout = 1;
|
2725 |
-
$row->custom_front = '';
|
2726 |
-
$row->mail_from_user = '';
|
2727 |
-
$row->mail_from_name_user = '';
|
2728 |
-
$row->reply_to_user = '';
|
2729 |
-
$row->save_uploads = 1;
|
2730 |
-
|
2731 |
-
$row->header_title = '';
|
2732 |
-
$row->header_description = '';
|
2733 |
-
$row->header_image_url = '';
|
2734 |
-
$row->header_image_animation = '';
|
2735 |
-
$row->header_hide_image = '';
|
2736 |
-
|
2737 |
-
$row->condition = '';
|
2738 |
-
$row->mail_cc = '';
|
2739 |
-
$row->mail_cc_user = '';
|
2740 |
-
$row->mail_bcc = '';
|
2741 |
-
$row->mail_bcc_user = '';
|
2742 |
-
$row->mail_subject = '';
|
2743 |
-
$row->mail_subject_user = '';
|
2744 |
-
$row->mail_mode = 1;
|
2745 |
-
$row->mail_mode_user = 1;
|
2746 |
-
$row->mail_attachment = 1;
|
2747 |
-
$row->mail_attachment_user = 1;
|
2748 |
-
|
2749 |
-
$row->user_id_wd = '';
|
2750 |
-
$row->sortable = 1;
|
2751 |
-
$row->frontend_submit_fields = '';
|
2752 |
-
$row->frontend_submit_stat_fields = '';
|
2753 |
-
}
|
2754 |
-
return $row;
|
2755 |
-
}
|
2756 |
-
|
2757 |
-
public function get_theme_rows_data($old = '') {
|
2758 |
-
global $wpdb;
|
2759 |
-
$rows = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker_themes ORDER BY `version` DESC, `id` ASC");
|
2760 |
-
return $rows;
|
2761 |
-
}
|
2762 |
-
|
2763 |
-
public function get_queries_rows_data($id) {
|
2764 |
-
global $wpdb;
|
2765 |
-
$rows = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker_query WHERE form_id=" . $id . " ORDER BY id ASC");
|
2766 |
-
return $rows;
|
2767 |
-
}
|
2768 |
-
|
2769 |
-
public function get_labels($id) {
|
2770 |
-
global $wpdb;
|
2771 |
-
$rows = $wpdb->get_col("SELECT DISTINCT `element_label` FROM " . $wpdb->prefix . "formmaker_submits WHERE form_id=" . $id);
|
2772 |
-
return $rows;
|
2773 |
-
}
|
2774 |
-
|
2775 |
-
public function is_paypal($id) {
|
2776 |
-
global $wpdb;
|
2777 |
-
$rows = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker_sessions WHERE form_id=" . $id);
|
2778 |
-
return $rows;
|
2779 |
-
}
|
2780 |
-
|
2781 |
-
public function page_nav() {
|
2782 |
-
global $wpdb;
|
2783 |
-
$where = 'WHERE `id` IN (' . get_option('contact_form_forms', 0) . ')';
|
2784 |
-
$where .= ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? ' AND title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
|
2785 |
-
$query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker " . $where;
|
2786 |
-
$total = $wpdb->get_var($query);
|
2787 |
-
$page_nav['total'] = $total;
|
2788 |
-
if (isset($_POST['page_number']) && $_POST['page_number']) {
|
2789 |
-
$limit = ((int) $_POST['page_number'] - 1) * 20;
|
2790 |
-
}
|
2791 |
-
else {
|
2792 |
-
$limit = 0;
|
2793 |
-
}
|
2794 |
-
$page_nav['limit'] = (int) ($limit / 20 + 1);
|
2795 |
-
return $page_nav;
|
2796 |
-
}
|
2797 |
-
|
2798 |
-
public function get_display_options($id) {
|
2799 |
-
global $wpdb;
|
2800 |
-
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_display_options WHERE form_id="%d"', $id));
|
2801 |
-
if (!$row) {
|
2802 |
-
$row = new stdClass();
|
2803 |
-
$row->form_id = $id;
|
2804 |
-
$row->type = 'embedded';
|
2805 |
-
$row->scrollbox_loading_delay = 0;
|
2806 |
-
$row->popover_animate_effect = '';
|
2807 |
-
$row->popover_loading_delay = 0;
|
2808 |
-
$row->popover_frequency = 0;
|
2809 |
-
$row->topbar_position = 1;
|
2810 |
-
$row->topbar_remain_top = 1;
|
2811 |
-
$row->topbar_closing = 1;
|
2812 |
-
$row->topbar_hide_duration = 0;
|
2813 |
-
$row->scrollbox_position = 1;
|
2814 |
-
$row->scrollbox_trigger_point = 20;
|
2815 |
-
$row->scrollbox_hide_duration = 0;
|
2816 |
-
$row->scrollbox_auto_hide = 1;
|
2817 |
-
$row->hide_mobile = 0;
|
2818 |
-
$row->scrollbox_closing = 1;
|
2819 |
-
$row->scrollbox_minimize = 1;
|
2820 |
-
$row->scrollbox_minimize_text = '';
|
2821 |
-
$row->display_on = 'everything';
|
2822 |
-
$row->posts_include = '';
|
2823 |
-
$row->pages_include = '';
|
2824 |
-
$row->display_on_categories = '';
|
2825 |
-
$row->current_categories = '';
|
2826 |
-
$row->show_for_admin = 0;
|
2827 |
-
}
|
2828 |
-
return $row;
|
2829 |
-
}
|
2830 |
-
|
2831 |
-
public function fm_posts_query() {
|
2832 |
-
$default_post_types = array( 'post', 'page' );
|
2833 |
-
$custom_post_types = get_post_types( array(
|
2834 |
-
'public' => true,
|
2835 |
-
'_builtin' => false,
|
2836 |
-
) );
|
2837 |
-
|
2838 |
-
$post_types = array_merge($default_post_types, $custom_post_types);
|
2839 |
-
$pt_names = array_values($post_types);
|
2840 |
-
|
2841 |
-
$query = array(
|
2842 |
-
'post_type' => $pt_names,
|
2843 |
-
'suppress_filters' => true,
|
2844 |
-
'update_post_term_cache' => false,
|
2845 |
-
'update_post_meta_cache' => false,
|
2846 |
-
'post_status' => 'publish',
|
2847 |
-
'posts_per_page' => -1,
|
2848 |
-
);
|
2849 |
-
|
2850 |
-
$get_posts = new WP_Query;
|
2851 |
-
$posts = $get_posts->query( $query );
|
2852 |
-
if ( ! $get_posts->post_count ) {
|
2853 |
-
return false;
|
2854 |
-
}
|
2855 |
-
|
2856 |
-
$results = array();
|
2857 |
-
foreach ($posts as $post) {
|
2858 |
-
$results[(int)$post->ID] = array(
|
2859 |
-
'title' => trim( esc_html( strip_tags( get_the_title( $post ) ) ) ),
|
2860 |
-
'post_type' => $post->post_type,
|
2861 |
-
);
|
2862 |
-
}
|
2863 |
-
|
2864 |
-
wp_reset_postdata();
|
2865 |
-
return $results;
|
2866 |
-
}
|
2867 |
-
|
2868 |
-
public function fm_categories_query() {
|
2869 |
-
$categories = get_categories( array(
|
2870 |
-
'hide_empty' => 0,
|
2871 |
-
) );
|
2872 |
-
$final_categories = array();
|
2873 |
-
foreach ( $categories as $key => $value ) {
|
2874 |
-
$final_categories[$value->term_id] = $value->name;
|
2875 |
-
}
|
2876 |
-
return $final_categories;
|
2877 |
-
}
|
2878 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
2879 |
-
// Getters & Setters //
|
2880 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
2881 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
2882 |
-
// Private Methods //
|
2883 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
2884 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
2885 |
-
// Listeners //
|
2886 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
2887 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/models/FMModelSelect_data_from_db.php
DELETED
@@ -1,111 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMModelSelect_data_from_db_fmc {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
|
22 |
-
function get_labels($form_id) {
|
23 |
-
global $wpdb;
|
24 |
-
$rows = $wpdb->get_var("SELECT label_order_current FROM " . $wpdb->prefix . "formmaker where id=" . $form_id);
|
25 |
-
return $rows;
|
26 |
-
}
|
27 |
-
function get_tables() {
|
28 |
-
global $wpdb;
|
29 |
-
$con_type = $_POST['con_type'];
|
30 |
-
|
31 |
-
if($con_type == 'local') {
|
32 |
-
$query = "SHOW TABLES";
|
33 |
-
$tables = $wpdb->get_col($query);
|
34 |
-
}
|
35 |
-
else if($con_type == 'remote') {
|
36 |
-
$username = isset($_POST['username']) ? $_POST['username'] : '';
|
37 |
-
$password = isset($_POST['password']) ? $_POST['password'] : '';
|
38 |
-
$database = isset($_POST['database']) ? $_POST['database'] : '';
|
39 |
-
$host = isset($_POST['host']) ? $_POST['host'] : '';
|
40 |
-
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
41 |
-
$query = "SHOW TABLES";
|
42 |
-
$tables = $wpdb_temp->get_col($query);
|
43 |
-
}
|
44 |
-
//$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
45 |
-
return $tables;
|
46 |
-
}
|
47 |
-
|
48 |
-
function get_tables_saved($con_type, $username, $password, $database, $host) {
|
49 |
-
global $wpdb;
|
50 |
-
|
51 |
-
if($con_type == 'local') {
|
52 |
-
$query = "SHOW TABLES";
|
53 |
-
$tables = $wpdb->get_col($query);
|
54 |
-
}
|
55 |
-
else if($con_type == 'remote') {
|
56 |
-
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
57 |
-
$query = "SHOW TABLES";
|
58 |
-
$tables = $wpdb_temp->get_col($query);
|
59 |
-
}
|
60 |
-
//$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
61 |
-
return $tables;
|
62 |
-
}
|
63 |
-
|
64 |
-
function get_table_struct() {
|
65 |
-
global $wpdb;
|
66 |
-
$name = isset($_POST['name']) ? $_POST['name'] : NULL;
|
67 |
-
if(!$name)
|
68 |
-
return array();
|
69 |
-
$con_method = $_POST['con_method'];
|
70 |
-
$con_type = $_POST['con_type'];
|
71 |
-
$query = "SHOW COLUMNS FROM " . $name;
|
72 |
-
if($con_type == 'remote') {
|
73 |
-
$username = isset($_POST['username']) ? $_POST['username'] : '';
|
74 |
-
$password = isset($_POST['password']) ? $_POST['password'] : '';
|
75 |
-
$database = isset($_POST['database']) ? $_POST['database'] : '';
|
76 |
-
$host = isset($_POST['host']) ? $_POST['host'] : '';
|
77 |
-
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
78 |
-
$table_struct = $wpdb_temp->get_results($query);
|
79 |
-
}
|
80 |
-
else {
|
81 |
-
$table_struct = $wpdb->get_results($query);
|
82 |
-
}
|
83 |
-
//$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
84 |
-
return $table_struct;
|
85 |
-
}
|
86 |
-
|
87 |
-
function get_table_struct_saved($con_type, $username, $password, $database, $host, $name, $con_method) {
|
88 |
-
global $wpdb;
|
89 |
-
if(!$name)
|
90 |
-
return array();
|
91 |
-
$query = "SHOW COLUMNS FROM " . $name;
|
92 |
-
if($con_type == 'remote') {
|
93 |
-
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
94 |
-
$table_struct = $wpdb_temp->get_results($query);
|
95 |
-
}
|
96 |
-
else {
|
97 |
-
$table_struct = $wpdb->get_results($query);
|
98 |
-
}
|
99 |
-
//$wpdb= new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
|
100 |
-
return $table_struct;
|
101 |
-
}
|
102 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
103 |
-
// Getters & Setters //
|
104 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
105 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
106 |
-
// Private Methods //
|
107 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
108 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
109 |
-
// Listeners //
|
110 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
111 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/models/FMModelShow_matrix.php
DELETED
@@ -1,31 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMModelShow_matrix_fmc {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
|
22 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
23 |
-
// Getters & Setters //
|
24 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
25 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
26 |
-
// Private Methods //
|
27 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
28 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
29 |
-
// Listeners //
|
30 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
31 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/models/FMModelSubmissions_fm.php
DELETED
@@ -1,744 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class FMModelSubmissions_fmc {
|
3 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
4 |
-
// Events //
|
5 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
// Constants //
|
8 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
// Variables //
|
11 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
// Constructor & Destructor //
|
14 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
15 |
-
public function __construct() {
|
16 |
-
}
|
17 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
18 |
-
// Public Methods //
|
19 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
20 |
-
public function blocked_ips() {
|
21 |
-
global $wpdb;
|
22 |
-
$ips = $wpdb->get_col('SELECT ip FROM ' . $wpdb->prefix . 'formmaker_blocked');
|
23 |
-
return $ips;
|
24 |
-
}
|
25 |
-
|
26 |
-
public function get_form_titles() {
|
27 |
-
global $wpdb;
|
28 |
-
$query = "SELECT id, title FROM " . $wpdb->prefix . "formmaker WHERE `id` IN(" . get_option('contact_form_forms', 0) . ") order by title";
|
29 |
-
$forms = $wpdb->get_results($query);
|
30 |
-
return $forms;
|
31 |
-
}
|
32 |
-
|
33 |
-
public function get_statistics($form_id) {
|
34 |
-
global $wpdb;
|
35 |
-
$statistics = array();
|
36 |
-
$query = $wpdb->prepare('SELECT count(distinct group_id) FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id ="%d"', $form_id);
|
37 |
-
$statistics["total_entries"] = $wpdb->get_var($query);
|
38 |
-
$query = $wpdb->prepare('SELECT `views` FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="%d"', $form_id);
|
39 |
-
$statistics["total_views"] = $wpdb->get_var($query);
|
40 |
-
if ($statistics["total_views"]) {
|
41 |
-
$statistics["conversion_rate"] = round((($statistics["total_entries"] / $statistics["total_views"]) * 100), 2) . '%';
|
42 |
-
}
|
43 |
-
else {
|
44 |
-
$statistics["conversion_rate"] = '0%';
|
45 |
-
}
|
46 |
-
return $statistics;
|
47 |
-
}
|
48 |
-
|
49 |
-
public function get_labels_parameters($form_id) {
|
50 |
-
global $wpdb;
|
51 |
-
$labels = array();
|
52 |
-
$labels_id = array();
|
53 |
-
$sorted_labels_id = array();
|
54 |
-
$label_names = array();
|
55 |
-
$label_types = array();
|
56 |
-
$sorted_label_types = array();
|
57 |
-
$label_names_original = array();
|
58 |
-
$labels_parameters = array();
|
59 |
-
$join_query = array();
|
60 |
-
$join_where = array();
|
61 |
-
$join_verified = array();
|
62 |
-
$rows_ord = array();
|
63 |
-
$join = '';
|
64 |
-
|
65 |
-
$query = $wpdb->prepare("SELECT `group_id`,`element_value` FROM " . $wpdb->prefix . "formmaker_submits WHERE `form_id`='%d' and `element_label` = 'verifyinfo' ", $form_id);
|
66 |
-
$ver_emails_data = $wpdb->get_results($query);
|
67 |
-
|
68 |
-
$ver_emails_array = array();
|
69 |
-
if($ver_emails_data) {
|
70 |
-
foreach($ver_emails_data as $ver_email) {
|
71 |
-
$elem_label = str_replace('verified**', '', $ver_email->element_value);
|
72 |
-
$query = $wpdb->prepare("SELECT `element_value` FROM " . $wpdb->prefix . "formmaker_submits WHERE `form_id`='%d' AND `group_id` = '%d' AND `element_label` = '%s' ", $form_id, (int)$ver_email->group_id, $elem_label);
|
73 |
-
if(!isset($ver_emails_array[$elem_label]))
|
74 |
-
$ver_emails_array[$elem_label] = array();
|
75 |
-
|
76 |
-
if(!in_array( $wpdb->get_var($query), $ver_emails_array[$elem_label]))
|
77 |
-
$ver_emails_array[$elem_label][] = $wpdb->get_var($query);
|
78 |
-
}
|
79 |
-
}
|
80 |
-
for ($i = 0; $i < 9; $i++) {
|
81 |
-
array_push($labels_parameters, NULL);
|
82 |
-
}
|
83 |
-
$sorted_label_names = array();
|
84 |
-
$sorted_label_names_original = array();
|
85 |
-
$where_labels = array();
|
86 |
-
$where2 = array();
|
87 |
-
$pagination_clicked = (isset($_POST['pagination_clicked']) && $_POST['pagination_clicked'] == '1' ? '1' : '0');
|
88 |
-
$order_by = ((isset($_POST['order_by']) && esc_html(stripslashes($_POST['order_by'])) != '') ? esc_html(stripslashes($_POST['order_by'])) : 'group_id');
|
89 |
-
$asc_or_desc = ((isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 'asc') ? 'asc' : 'desc');
|
90 |
-
$limit = ((isset($_POST['page_number'])) ? ((int) $_POST['page_number'] - 1) * 20 : 0);
|
91 |
-
$lists['hide_label_list'] = ((isset($_POST['hide_label_list'])) ? esc_html(stripslashes($_POST['hide_label_list'])) : '');
|
92 |
-
$lists['startdate'] = ((isset($_POST['startdate'])) ? esc_html(stripslashes($_POST['startdate'])) : '');
|
93 |
-
$lists['enddate'] = ((isset($_POST['enddate'])) ? esc_html(stripslashes($_POST['enddate'])) : '');
|
94 |
-
$lists['ip_search'] = ((isset($_POST['ip_search'])) ? esc_html(stripslashes($_POST['ip_search'])) : '');
|
95 |
-
|
96 |
-
$lists['username_search'] = ((isset($_POST['username_search'])) ? esc_html(stripslashes($_POST['username_search'])) : '');
|
97 |
-
$lists['useremail_search'] = ((isset($_POST['useremail_search'])) ? esc_html(stripslashes($_POST['useremail_search'])) : '');
|
98 |
-
$lists['id_search'] = ((isset($_POST['id_search'])) ? esc_html(stripslashes($_POST['id_search'])) : '');
|
99 |
-
|
100 |
-
if ($lists['ip_search']) {
|
101 |
-
$where[] = 'ip LIKE "%' . $lists['ip_search'] . '%"';
|
102 |
-
}
|
103 |
-
if ($lists['startdate'] != '') {
|
104 |
-
$where[] = " `date`>='" . $lists['startdate'] . " 00:00:00' ";
|
105 |
-
}
|
106 |
-
if ($lists['enddate'] != '') {
|
107 |
-
$where[] = " `date`<='" . $lists['enddate'] . " 23:59:59' ";
|
108 |
-
}
|
109 |
-
|
110 |
-
|
111 |
-
if ($lists['username_search']) {
|
112 |
-
$where[] = 'user_id_wd IN (SELECT ID FROM ' . $wpdb->prefix . 'users WHERE display_name LIKE "%'.$lists['username_search'].'%")';
|
113 |
-
}
|
114 |
-
if ($lists['useremail_search']) {
|
115 |
-
$where[] = 'user_id_wd IN (SELECT ID FROM ' . $wpdb->prefix . 'users WHERE user_email LIKE "%'.$lists['useremail_search'].'%")';
|
116 |
-
}
|
117 |
-
|
118 |
-
if ($lists['id_search']) {
|
119 |
-
$where[] = 'group_id ='.(int)$lists['id_search'];
|
120 |
-
}
|
121 |
-
|
122 |
-
$where[] = 'form_id=' . $form_id . '';
|
123 |
-
$where = (count($where) ? ' ' . implode(' AND ', $where) : '');
|
124 |
-
if ($order_by == 'group_id' or $order_by == 'date' or $order_by == 'ip') {
|
125 |
-
$orderby = ' ORDER BY ' . $order_by . ' ' . $asc_or_desc . '';
|
126 |
-
}elseif($order_by == 'display_name' or $order_by == 'user_email'){
|
127 |
-
$orderby = ' ORDER BY (SELECT '.$order_by.' FROM ' . $wpdb->prefix . 'users WHERE ID=user_id_wd) '. $asc_or_desc .'';
|
128 |
-
}
|
129 |
-
else {
|
130 |
-
$orderby = "";
|
131 |
-
}
|
132 |
-
if ($form_id) {
|
133 |
-
for($i = 0; $i < 9; $i++) {
|
134 |
-
array_pop($labels_parameters);
|
135 |
-
}
|
136 |
-
$query = "SELECT distinct element_label FROM " . $wpdb->prefix . "formmaker_submits WHERE ". $where;
|
137 |
-
$results = $wpdb->get_results($query);
|
138 |
-
for ($i = 0; $i < count($results); $i++) {
|
139 |
-
array_push($labels, $results[$i]->element_label);
|
140 |
-
}
|
141 |
-
$form = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id='%d'", $form_id));
|
142 |
-
if (strpos($form->label_order, 'type_paypal_')) {
|
143 |
-
$form->label_order = $form->label_order . "item_total#**id**#Item Total#**label**#type_paypal_payment_total#****#total#**id**#Total#**label**#type_paypal_payment_total#****#0#**id**#Payment Status#**label**#type_paypal_payment_status#****#";
|
144 |
-
}
|
145 |
-
|
146 |
-
$form_labels = explode('#****#', $form->label_order);
|
147 |
-
$form_labels = array_slice($form_labels, 0, count($form_labels) - 1);
|
148 |
-
|
149 |
-
foreach ($form_labels as $key => $form_label) {
|
150 |
-
$label_id = explode('#**id**#', $form_label);
|
151 |
-
array_push($labels_id, $label_id[0]);
|
152 |
-
$label_name_type = explode('#**label**#', $label_id[1]);
|
153 |
-
array_push($label_names_original, $label_name_type[0]);
|
154 |
-
$ptn = "/[^a-zA-Z0-9_]/";
|
155 |
-
$rpltxt = "";
|
156 |
-
$label_name = preg_replace($ptn, $rpltxt, $label_name_type[0]);
|
157 |
-
array_push($label_names, $label_name);
|
158 |
-
array_push($label_types, $label_name_type[1]);
|
159 |
-
}
|
160 |
-
|
161 |
-
foreach ($labels_id as $key => $label_id) {
|
162 |
-
if (in_array($label_id, $labels)) {
|
163 |
-
if (!in_array($label_id, $sorted_labels_id)) {
|
164 |
-
array_push($sorted_labels_id, $label_id);
|
165 |
-
}
|
166 |
-
array_push($sorted_label_names, $label_names[$key]);
|
167 |
-
array_push($sorted_label_types, $label_types[$key]);
|
168 |
-
array_push($sorted_label_names_original, $label_names_original[$key]);
|
169 |
-
if (isset($_POST[$form_id . '_' . $label_id . '_search'])) {
|
170 |
-
$search_temp = esc_html($_POST[$form_id . '_' . $label_id . '_search']);
|
171 |
-
}
|
172 |
-
else {
|
173 |
-
$search_temp = '';
|
174 |
-
}
|
175 |
-
$search_temp = strtolower($search_temp);
|
176 |
-
|
177 |
-
$lists[$form_id . '_' . $label_id . '_search'] = $search_temp;
|
178 |
-
if ($search_temp) {
|
179 |
-
$join_query[] = 'search';
|
180 |
-
$join_where[] = array('label' => $label_id, 'search' => $search_temp);
|
181 |
-
}
|
182 |
-
|
183 |
-
if (isset($_POST[$form_id . '_' . $label_id . '_search_verified'])) {
|
184 |
-
$search_verified = $_POST[$form_id . '_' . $label_id . '_search_verified'];
|
185 |
-
$lists[$form_id . '_' . $label_id . '_search_verified'] = $search_verified;
|
186 |
-
} else {
|
187 |
-
$search_verified = '';
|
188 |
-
}
|
189 |
-
|
190 |
-
if ($search_verified && isset($ver_emails_array[$label_id])) {
|
191 |
-
$join_query[] = 'search';
|
192 |
-
$join_where[] = null;
|
193 |
-
$join_verified[] = array('label' => $label_id, 'ver_search' => implode('|', $ver_emails_array[$label_id]));
|
194 |
-
}
|
195 |
-
}
|
196 |
-
}
|
197 |
-
|
198 |
-
if (strpos($order_by, "_field")) {
|
199 |
-
if (in_array(str_replace("_field", "", $order_by), $labels)) {
|
200 |
-
$join_query[] = 'sort';
|
201 |
-
$join_where[] = array('label'=>str_replace("_field", "", $order_by));
|
202 |
-
}
|
203 |
-
}
|
204 |
-
$cols = 'group_id';
|
205 |
-
if ($order_by == 'date' or $order_by == 'ip') {
|
206 |
-
$cols = 'group_id, date, ip';
|
207 |
-
}
|
208 |
-
|
209 |
-
$ver_where = '';
|
210 |
-
if( !empty($join_verified) ) {
|
211 |
-
foreach( $join_verified as $key_ver => $join_ver) {
|
212 |
-
$ver_where .= '(element_label="' . $join_ver['label'] . '" AND element_value REGEXP "'.$join_ver['ver_search'].'" ) AND' ;
|
213 |
-
}
|
214 |
-
}
|
215 |
-
|
216 |
-
switch (count($join_query)) {
|
217 |
-
case 0:
|
218 |
-
$join = 'SELECT distinct group_id FROM ' . $wpdb->prefix . 'formmaker_submits WHERE '. $where;
|
219 |
-
|
220 |
-
break;
|
221 |
-
case 1:
|
222 |
-
if ($join_query[0] == 'sort') {
|
223 |
-
$join = 'SELECT group_id FROM ' . $wpdb->prefix . 'formmaker_submits WHERE ' . $where . ' AND element_label="' . $join_where[0]['label'] . '" ';
|
224 |
-
$join_count = 'SELECT count(group_id) FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id="' . $form_id . '" AND element_label="' . $join_where[0]['label'] . '" ';
|
225 |
-
|
226 |
-
$orderby = ' ORDER BY `element_value` ' . $asc_or_desc;
|
227 |
-
}
|
228 |
-
else {
|
229 |
-
if(isset($join_where[0]['search'])) {
|
230 |
-
$join = 'SELECT group_id FROM ' . $wpdb->prefix . 'formmaker_submits WHERE element_label="' . $join_where[0]['label'] . '" AND (element_value LIKE "%' . $join_where[0]['search'] . '%" OR element_value LIKE "%' . str_replace(' ', '@@@', $join_where[0]['search']) . '%") AND ' . $where;
|
231 |
-
} else {
|
232 |
-
$join = 'SELECT group_id FROM ' . $wpdb->prefix . 'formmaker_submits WHERE '.$ver_where . $where;
|
233 |
-
}
|
234 |
-
}
|
235 |
-
break;
|
236 |
-
default:
|
237 |
-
if( !empty($join_verified) ) {
|
238 |
-
if( isset( $join_where[0]['search'] ) ) {
|
239 |
-
$join = 'SELECT t.group_id from (SELECT t1.group_id from (SELECT ' . $cols . ' FROM ' . $wpdb->prefix . 'formmaker_submits WHERE (element_label="' . $join_where[0]['label'] . '" AND (element_value LIKE "%' . $join_where[0]['search'] . '%" OR element_value LIKE "%' . str_replace(' ', '@@@', $join_where[0]['search']) . '%")) AND '. $where.' ) as t1 JOIN (SELECT group_id FROM ' . $wpdb->prefix . 'formmaker_submits WHERE '.$ver_where.$where.') as t2 ON t1.group_id = t2.group_id) as t ';
|
240 |
-
|
241 |
-
} else{
|
242 |
-
$join = 'SELECT t.group_id FROM (SELECT ' . $cols . ' FROM ' . $wpdb->prefix . 'formmaker_submits WHERE ' . $ver_where.$where . ') as t ';
|
243 |
-
}
|
244 |
-
} else{
|
245 |
-
$join = 'SELECT t.group_id FROM (SELECT ' . $cols . ' FROM ' . $wpdb->prefix . 'formmaker_submits WHERE ' . $where . ' AND element_label="' . $join_where[0]['label'] . '" AND (element_value LIKE "%' . $join_where[0]['search'] . '%" OR element_value LIKE "%' . str_replace(' ', '@@@', $join_where[0]['search']) . '%" )) as t ';
|
246 |
-
}
|
247 |
-
|
248 |
-
for ($key = 1; $key < count($join_query); $key++) {
|
249 |
-
if ($join_query[$key] == 'sort') {
|
250 |
-
if(isset($join_where[$key])){
|
251 |
-
$join .= 'LEFT JOIN (SELECT group_id as group_id' . $key . ', element_value FROM ' . $wpdb->prefix . 'formmaker_submits WHERE ' . $where . ' AND element_label="' . $join_where[$key]['label'] . '") as t' . $key . ' ON t' . $key . '.group_id' . $key . '=t.group_id ';
|
252 |
-
$orderby = ' ORDER BY t' . $key . '.`element_value` ' . $asc_or_desc . '';
|
253 |
-
}
|
254 |
-
}
|
255 |
-
else {
|
256 |
-
if(isset( $join_where[$key])) {
|
257 |
-
$join .= 'INNER JOIN (SELECT group_id as group_id' . $key . ' FROM ' . $wpdb->prefix . 'formmaker_submits WHERE '.$where.' AND element_label="' . $join_where[$key]['label'] . '" AND (element_value LIKE "%' . $join_where[$key]['search'] . '%" OR element_value LIKE "%' . str_replace(' ', '@@@', $join_where[$key]['search']) . '%")) as t' . $key . ' ON t' . $key . '.group_id' . $key . '=t.group_id ';
|
258 |
-
}
|
259 |
-
}
|
260 |
-
}
|
261 |
-
break;
|
262 |
-
}
|
263 |
-
$pos = strpos($join, 'SELECT t.group_id');
|
264 |
-
if ($pos === FALSE) {
|
265 |
-
$query = str_replace(array('SELECT group_id','SELECT distinct group_id'), array('SELECT count(distinct group_id)','SELECT count(distinct group_id)'), $join);
|
266 |
-
}
|
267 |
-
else {
|
268 |
-
$query = str_replace('SELECT t.group_id', 'SELECT count(t.group_id)', $join);
|
269 |
-
}
|
270 |
-
$total = $wpdb->get_var($query);
|
271 |
-
|
272 |
-
$query_sub_count = "SELECT count(distinct group_id) from ".$wpdb->prefix."formmaker_submits";
|
273 |
-
$sub_count = (int)$wpdb->get_var($query_sub_count);
|
274 |
-
|
275 |
-
$limit1 = (int)$total < $sub_count && !$pagination_clicked ? 0 : $limit;
|
276 |
-
$query = $join . ' ' . $orderby . ' limit ' . $limit1 . ', 20 ';
|
277 |
-
$results = $wpdb->get_results($query);
|
278 |
-
for ($i = 0; $i < count($results); $i++) {
|
279 |
-
array_push($rows_ord, $results[$i]->group_id);
|
280 |
-
}
|
281 |
-
|
282 |
-
$query1 = $join . ' ' . $orderby ;
|
283 |
-
$searched_group_ids = $wpdb->get_results($query1);
|
284 |
-
$searched_ids = array();
|
285 |
-
for ($i = 0; $i < count($searched_group_ids); $i++) {
|
286 |
-
array_push($searched_ids, $searched_group_ids[$i]->group_id);
|
287 |
-
}
|
288 |
-
|
289 |
-
|
290 |
-
$where2 = array();
|
291 |
-
$where2[] = "group_id='0'";
|
292 |
-
foreach ($rows_ord as $rows_ordd) {
|
293 |
-
$where2[] = "group_id='" . $rows_ordd . "'";
|
294 |
-
}
|
295 |
-
$where2 = (count($where2) ? ' WHERE ' . implode( ' OR ', $where2 ) . '' : '' );
|
296 |
-
$query = 'SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits ' . $where2;
|
297 |
-
$rows = $wpdb->get_results($query);
|
298 |
-
$group_ids = $rows_ord;
|
299 |
-
$lists['total'] = $total;
|
300 |
-
$lists['limit'] = (int) ($limit1 / 20 + 1);
|
301 |
-
|
302 |
-
$where_choices = $where;
|
303 |
-
array_push($labels_parameters, $sorted_labels_id);
|
304 |
-
array_push($labels_parameters, $sorted_label_types);
|
305 |
-
array_push($labels_parameters, $lists);
|
306 |
-
array_push($labels_parameters, $sorted_label_names);
|
307 |
-
array_push($labels_parameters, $sorted_label_names_original);
|
308 |
-
array_push($labels_parameters, $rows);
|
309 |
-
array_push($labels_parameters, $group_ids);
|
310 |
-
array_push($labels_parameters, $where_choices);
|
311 |
-
array_push($labels_parameters, $searched_ids);
|
312 |
-
}
|
313 |
-
return $labels_parameters;
|
314 |
-
}
|
315 |
-
|
316 |
-
public function get_type_address($sorted_label_type, $sorted_label_name_original) {
|
317 |
-
if ($sorted_label_type == 'type_address') {
|
318 |
-
switch ($sorted_label_name_original) {
|
319 |
-
case 'Street Line':
|
320 |
-
$field_title = __('Street Address', 'form_maker');
|
321 |
-
break;
|
322 |
-
case 'Street Line2':
|
323 |
-
$field_title = __('Street Address Line 2', 'form_maker');
|
324 |
-
break;
|
325 |
-
case 'City':
|
326 |
-
$field_title = __('City', 'form_maker');
|
327 |
-
break;
|
328 |
-
case 'State':
|
329 |
-
$field_title = __('State / Province / Region', 'form_maker');
|
330 |
-
break;
|
331 |
-
case 'Postal':
|
332 |
-
$field_title = __('Postal / Zip Code', 'form_maker');
|
333 |
-
break;
|
334 |
-
case 'Country':
|
335 |
-
$field_title = __('Country', 'form_maker');
|
336 |
-
break;
|
337 |
-
default :
|
338 |
-
$field_title = stripslashes($sorted_label_name_original);
|
339 |
-
break;
|
340 |
-
}
|
341 |
-
}
|
342 |
-
else {
|
343 |
-
$field_title = stripslashes($sorted_label_name_original);
|
344 |
-
}
|
345 |
-
return $field_title;
|
346 |
-
}
|
347 |
-
|
348 |
-
public function hide_or_not($hide_strings,$hide_string) {
|
349 |
-
if (strpos($hide_string,'@') === FALSE) {
|
350 |
-
if (strpos($hide_strings, '@' . $hide_string . '@') === FALSE) {
|
351 |
-
$style = '';
|
352 |
-
}
|
353 |
-
else {
|
354 |
-
$style = 'style="display:none"';
|
355 |
-
}
|
356 |
-
}
|
357 |
-
else {
|
358 |
-
if (strpos($hide_strings, $hide_string) === FALSE) {
|
359 |
-
$style = '';
|
360 |
-
}
|
361 |
-
else {
|
362 |
-
$style = 'style="display:none"';
|
363 |
-
}
|
364 |
-
}
|
365 |
-
return $style;
|
366 |
-
}
|
367 |
-
|
368 |
-
public function sort_group_ids($sorted_label_names_count, $group_ids) {
|
369 |
-
$count_labe = $sorted_label_names_count;
|
370 |
-
$group_id_s = array();
|
371 |
-
$l = 0;
|
372 |
-
if (count($group_ids) > 0 and $count_labe) {
|
373 |
-
for ($i = 0; $i < count($group_ids); $i++) {
|
374 |
-
if (!in_array($group_ids[$i], $group_id_s)) {
|
375 |
-
array_push($group_id_s, $group_ids[$i]);
|
376 |
-
}
|
377 |
-
}
|
378 |
-
}
|
379 |
-
return $group_id_s;
|
380 |
-
}
|
381 |
-
|
382 |
-
public function array_for_group_id($group, $rows) {
|
383 |
-
$i = $group;
|
384 |
-
$count_rows = count($rows);
|
385 |
-
$temp = array();
|
386 |
-
for ($j = 0; $j < $count_rows; $j++) {
|
387 |
-
$row = $rows[$j];
|
388 |
-
if ($row->group_id == $i) {
|
389 |
-
array_push($temp, $row);
|
390 |
-
}
|
391 |
-
}
|
392 |
-
return $temp;
|
393 |
-
}
|
394 |
-
|
395 |
-
public function check_radio_type($sorted_label_type) {
|
396 |
-
if ($sorted_label_type == "type_checkbox" || $sorted_label_type == "type_radio" || $sorted_label_type == "type_own_select" || $sorted_label_type == "type_country" || $sorted_label_type == "type_paypal_select" || $sorted_label_type == "type_paypal_radio" || $sorted_label_type == "type_paypal_checkbox" || $sorted_label_type == "type_paypal_shipping") {
|
397 |
-
return TRUE;
|
398 |
-
}
|
399 |
-
else {
|
400 |
-
return FALSE;
|
401 |
-
}
|
402 |
-
}
|
403 |
-
|
404 |
-
public function statistic_for_radio($where_choices, $sorted_label_id) {
|
405 |
-
global $wpdb;
|
406 |
-
$choices_params = array();
|
407 |
-
$query = "SELECT element_value FROM " . $wpdb->prefix . "formmaker_submits WHERE " . $where_choices . " AND element_label='" . $sorted_label_id . "'";
|
408 |
-
$choices = $wpdb->get_results($query);
|
409 |
-
$colors=array('#5FE2FF','#F9E89C');
|
410 |
-
$choices_colors=array('#4EC0D9','#DDCC7F');
|
411 |
-
$choices_labels = array();
|
412 |
-
$choices_count = array();
|
413 |
-
$all = count($choices);
|
414 |
-
$unanswered = 0;
|
415 |
-
foreach ($choices as $key => $choice) {
|
416 |
-
if ($choice->element_value == '') {
|
417 |
-
$unanswered++;
|
418 |
-
}
|
419 |
-
else {
|
420 |
-
if (!in_array($choice->element_value, $choices_labels)) {
|
421 |
-
array_push($choices_labels, $choice->element_value);
|
422 |
-
array_push($choices_count, 0);
|
423 |
-
}
|
424 |
-
$choices_count[array_search($choice->element_value, $choices_labels)]++;
|
425 |
-
}
|
426 |
-
}
|
427 |
-
array_multisort($choices_count, SORT_DESC, $choices_labels);
|
428 |
-
array_push($choices_params, $choices_count);
|
429 |
-
array_push($choices_params, $choices_labels);
|
430 |
-
array_push($choices_params, $unanswered);
|
431 |
-
array_push($choices_params, $all);
|
432 |
-
array_push($choices_params, $colors);
|
433 |
-
array_push($choices_params, $choices_colors);
|
434 |
-
return $choices_params;
|
435 |
-
}
|
436 |
-
|
437 |
-
public function get_data_of_group_id($id) {
|
438 |
-
global $wpdb;
|
439 |
-
$query = "SELECT * FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id=" . $id;
|
440 |
-
$rows = $wpdb->get_results($query);
|
441 |
-
$form = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id=" . $rows[0]->form_id);
|
442 |
-
$params = array();
|
443 |
-
$label_id = array();
|
444 |
-
$label_order_original = array();
|
445 |
-
$label_type = array();
|
446 |
-
$ispaypal = strpos($form->label_order, 'type_paypal_');
|
447 |
-
if ($form->paypal_mode == 1) {
|
448 |
-
if ($ispaypal) {
|
449 |
-
$form->label_order = $form->label_order."0#**id**#Payment Status#**label**#type_paypal_payment_status#****#";
|
450 |
-
}
|
451 |
-
}
|
452 |
-
$label_all = explode('#****#', $form->label_order);
|
453 |
-
$label_all = array_slice($label_all, 0, count($label_all) - 1);
|
454 |
-
foreach ($label_all as $key => $label_each) {
|
455 |
-
$label_id_each = explode('#**id**#', $label_each);
|
456 |
-
array_push($label_id, $label_id_each[0]);
|
457 |
-
$label_oder_each = explode('#**label**#', $label_id_each[1]);
|
458 |
-
array_push($label_order_original, $label_oder_each[0]);
|
459 |
-
array_push($label_type, $label_oder_each[1]);
|
460 |
-
}
|
461 |
-
/*$theme_id = $wpdb->get_var("SELECT theme FROM " . $wpdb->prefix . "formmaker WHERE id='" . $form->id . "'");*/
|
462 |
-
$css = $wpdb->get_var("SELECT css FROM " . $wpdb->prefix . "formmaker_themes");
|
463 |
-
array_push($params, $rows);
|
464 |
-
array_push($params, $label_id);
|
465 |
-
array_push($params, $label_order_original);
|
466 |
-
array_push($params, $label_type);
|
467 |
-
array_push($params, $ispaypal);
|
468 |
-
array_push($params, $form);
|
469 |
-
array_push($params, $css);
|
470 |
-
return $params;
|
471 |
-
}
|
472 |
-
|
473 |
-
public function check_type_for_edit_function($label_type) {
|
474 |
-
if ($label_type != 'type_editor' and $label_type != 'type_submit_reset' and $label_type != 'type_map' and $label_type != 'type_mark_map' and $label_type != 'type_captcha' and $label_type != 'type_recaptcha' and $label_type != 'type_button') {
|
475 |
-
return TRUE;
|
476 |
-
}
|
477 |
-
else {
|
478 |
-
return FALSE;
|
479 |
-
}
|
480 |
-
}
|
481 |
-
|
482 |
-
public function check_for_submited_label($rows, $label_id) {
|
483 |
-
foreach ($rows as $row) {
|
484 |
-
if ($row->element_label == $label_id) {
|
485 |
-
$element_value = $row->element_value;
|
486 |
-
break;
|
487 |
-
}
|
488 |
-
else {
|
489 |
-
$element_value = 'continue';
|
490 |
-
}
|
491 |
-
}
|
492 |
-
return $element_value;
|
493 |
-
}
|
494 |
-
|
495 |
-
public function view_for_star_rating($element_value, $element_label) {
|
496 |
-
$view_star_rating_array = array();
|
497 |
-
$new_filename = str_replace("***star_rating***", '', $element_value);
|
498 |
-
$stars = "";
|
499 |
-
$new_filename=explode('***', $new_filename);
|
500 |
-
for ($j = 0; $j < $new_filename[1]; $j++) {
|
501 |
-
$stars .= '<img id="' . $element_label . '_star_' . $j . '" src="' . WD_FMC_URL . '/images/star_' . $new_filename[2] . '.png?ver='. WD_FMC_VERSION.'" /> ';
|
502 |
-
}
|
503 |
-
for ($k = $new_filename[1]; $k < $new_filename[0]; $k++) {
|
504 |
-
$stars .= '<img id="' . $element_label . '_star_' . $k . '" src="' . WD_FMC_URL . '/images/star.png?ver='. WD_FMC_VERSION.'" /> ';
|
505 |
-
}
|
506 |
-
array_push($view_star_rating_array, $stars);
|
507 |
-
return $view_star_rating_array;
|
508 |
-
}
|
509 |
-
|
510 |
-
public function view_for_grading($element_value) {
|
511 |
-
$view_grading_array = array();
|
512 |
-
$new_filename = str_replace("***grading***", '', $element_value);
|
513 |
-
$grading = explode(":", $new_filename);
|
514 |
-
$items_count = sizeof($grading) - 1;
|
515 |
-
$items = "";
|
516 |
-
$total = "";
|
517 |
-
for ($k = 0; $k < $items_count / 2; $k++) {
|
518 |
-
$items .= $grading[$items_count / 2 + $k] . ": " . $grading[$k] . "</br>";
|
519 |
-
$total += $grading[$k];
|
520 |
-
}
|
521 |
-
$items .= "Total: " . $total;
|
522 |
-
array_push($view_grading_array, $items);
|
523 |
-
return $view_grading_array;
|
524 |
-
}
|
525 |
-
|
526 |
-
public function images_for_star_rating($element_value, $label_id) {
|
527 |
-
$edit_stars = "";
|
528 |
-
$star_rating_array = array();
|
529 |
-
$element_value1 = str_replace("***star_rating***", '', $element_value);
|
530 |
-
$stars_value = explode('/', $element_value1);
|
531 |
-
for ($j = 0; $j < $stars_value[0]; $j++) {
|
532 |
-
$edit_stars .= '<img id="' . $label_id . '_star_' . $j . '" onclick="edit_star_rating(' . $j . ',' . $label_id . ')" src="' . WD_FMC_URL . '/images/star_yellow.png?ver=' . WD_FMC_VERSION . '" /> ';
|
533 |
-
}
|
534 |
-
for ($k = $stars_value[0]; $k < $stars_value[1]; $k++) {
|
535 |
-
$edit_stars .= '<img id="' . $label_id . '_star_' . $k . '" onclick="edit_star_rating(' . $k . ',' . $label_id . ')" src="' . WD_FMC_URL . '/images/star.png?ver=' . WD_FMC_VERSION . '" /> ';
|
536 |
-
}
|
537 |
-
array_push($star_rating_array, $edit_stars);
|
538 |
-
array_push($star_rating_array, $stars_value);
|
539 |
-
return $star_rating_array;
|
540 |
-
}
|
541 |
-
|
542 |
-
public function params_for_scale_rating($element_value, $label_id) {
|
543 |
-
$scale_rating_array = array();
|
544 |
-
$scale_radio = explode('/', $element_value);
|
545 |
-
$scale_value = $scale_radio[0];
|
546 |
-
$scale = '<table><tr>';
|
547 |
-
for ($k = 1; $k <= $scale_radio[1]; $k++) {
|
548 |
-
$scale .= '<td style="text-align:center"><span>' . $k . '</span></td>';
|
549 |
-
}
|
550 |
-
$scale .= '<tr></tr>';
|
551 |
-
for ($l = 1; $l <= $scale_radio[1]; $l++) {
|
552 |
-
if ($l == $scale_radio[0]) {
|
553 |
-
$checked = "checked";
|
554 |
-
}
|
555 |
-
else {
|
556 |
-
$checked = "";
|
557 |
-
}
|
558 |
-
$scale .= '<td><input type="radio" name = "'.$label_id.'_scale_rating_radio" id = "'.$label_id.'_scale_rating_radio_'.$l.'" value="'.$l.'" '.$checked.' onClick="edit_scale_rating(this.value,'.$label_id.')" /></td>';
|
559 |
-
}
|
560 |
-
$scale .= '</tr></table>';
|
561 |
-
array_push($scale_rating_array, $scale);
|
562 |
-
array_push($scale_rating_array, $scale_radio);
|
563 |
-
array_push($scale_rating_array, $checked);
|
564 |
-
return $scale_rating_array;
|
565 |
-
}
|
566 |
-
|
567 |
-
public function params_for_type_range($element_value, $label_id) {
|
568 |
-
$range_value = explode('-', $element_value);
|
569 |
-
$range = '<input name="'.$label_id.'_element0" id="'.$label_id.'_element0" type="text" value="'.$range_value[0].'" onChange="edit_range(this.value,'.$label_id.',0)" size="8"/> - <input name="'.$label_id.'_element1" id="'.$label_id.'_element1" type="text" value="'.$range_value[1].'" onChange="edit_range(this.value,'.$label_id.',1)" size="8"/>';
|
570 |
-
return $range;
|
571 |
-
}
|
572 |
-
|
573 |
-
public function params_for_type_grading($element_value, $label_id) {
|
574 |
-
$type_grading_array = array();
|
575 |
-
$element_value1 = str_replace("***grading***", '', $element_value);
|
576 |
-
$garding_value = explode(':', $element_value1);
|
577 |
-
$items_count = sizeof($garding_value) - 1;
|
578 |
-
$garding = "";
|
579 |
-
$sum = "";
|
580 |
-
for ($k = 0; $k < $items_count/2; $k++) {
|
581 |
-
$garding .= '<input name="'.$label_id.'_element'.$k.'" id="'.$label_id.'_element'.$k.'" type="text" value="'.$garding_value[$k].'" onKeyUp="edit_grading('.$label_id.','.$items_count.')" size="5"/> '.$garding_value[$items_count/2+$k].'</br>';
|
582 |
-
$sum += $garding_value[$k];
|
583 |
-
}
|
584 |
-
array_push($type_grading_array, $garding);
|
585 |
-
array_push($type_grading_array, $garding_value);
|
586 |
-
array_push($type_grading_array, $sum);
|
587 |
-
array_push($type_grading_array, $items_count);
|
588 |
-
array_push($type_grading_array, $element_value1);
|
589 |
-
return $type_grading_array;
|
590 |
-
}
|
591 |
-
|
592 |
-
public function params_for_type_matrix($element_value, $label_id) {
|
593 |
-
$type_matrix_array = array();
|
594 |
-
$new_filename = str_replace("***matrix***", '', $element_value);
|
595 |
-
$matrix_value = explode('***', $new_filename);
|
596 |
-
$matrix_value = array_slice($matrix_value, 0, count($matrix_value) - 1);
|
597 |
-
$mat_rows = $matrix_value[0];
|
598 |
-
$mat_columns = $matrix_value[$mat_rows + 1];
|
599 |
-
$matrix = "<table>";
|
600 |
-
$matrix .= '<tr><td></td>';
|
601 |
-
for ($k = 1; $k <= $mat_columns; $k++) {
|
602 |
-
$matrix .= '<td style="background-color:#BBBBBB; padding:5px; border:1px; ">'.$matrix_value[$mat_rows+1+$k].'</td>';
|
603 |
-
}
|
604 |
-
$matrix .= '</tr>';
|
605 |
-
$aaa = Array();
|
606 |
-
$var_checkbox = 1;
|
607 |
-
$selected_value = "";
|
608 |
-
$selected_value_yes = "";
|
609 |
-
$selected_value_no = "";
|
610 |
-
for ($k = 1; $k <= $mat_rows; $k++) {
|
611 |
-
$matrix .= '<tr><td style="background-color:#BBBBBB; padding:5px; border:1px;">'.$matrix_value[$k].'</td>';
|
612 |
-
if ($matrix_value[$mat_rows + $mat_columns + 2] == "radio") {
|
613 |
-
if ($matrix_value[$mat_rows + $mat_columns + 2 + $k] == 0) {
|
614 |
-
$checked = "";
|
615 |
-
$aaa[1] = "";
|
616 |
-
}
|
617 |
-
else {
|
618 |
-
$aaa = explode("_", $matrix_value[$mat_rows + $mat_columns + 2 + $k]);
|
619 |
-
}
|
620 |
-
for ($l = 1; $l <= $mat_columns; $l++) {
|
621 |
-
if ($aaa[1] == $l) {
|
622 |
-
$checked = 'checked';
|
623 |
-
}
|
624 |
-
else {
|
625 |
-
$checked = "";
|
626 |
-
}
|
627 |
-
$index = "'" . $k . '_' . $l . "'";
|
628 |
-
$matrix .= '<td style="text-align:center;"><input name="'.$label_id.'_input_elementform_id_temp'.$k.'" id="'.$label_id.'_input_elementform_id_temp'.$k.'_'.$l.'" type="'.$matrix_value[$mat_rows+$mat_columns+2].'" '.$checked.' onClick="change_radio_values('.$index.','.$label_id.','.$mat_rows.','.$mat_columns.')"/></td>';
|
629 |
-
}
|
630 |
-
}
|
631 |
-
else {
|
632 |
-
if ($matrix_value[$mat_rows+$mat_columns+2] == "checkbox") {
|
633 |
-
for ($l = 1; $l <= $mat_columns; $l++) {
|
634 |
-
if ($matrix_value[$mat_rows + $mat_columns + 2 + $var_checkbox] == 1) {
|
635 |
-
$checked = 'checked';
|
636 |
-
}
|
637 |
-
else {
|
638 |
-
$checked = '';
|
639 |
-
}
|
640 |
-
$index = "'".$k.'_'.$l."'";
|
641 |
-
$matrix .='<td style="text-align:center;"><input name="'.$label_id.'_input_elementform_id_temp'.$k.'_'.$l.'" id="'.$label_id.'_input_elementform_id_temp'.$k.'_'.$l.'" type="'.$matrix_value[$mat_rows+$mat_columns+2].'" '.$checked.' onClick="change_checkbox_values('.$index.','.$label_id.','.$mat_rows.','.$mat_columns.')"/></td>';
|
642 |
-
$var_checkbox++;
|
643 |
-
}
|
644 |
-
}
|
645 |
-
else {
|
646 |
-
if ($matrix_value[$mat_rows + $mat_columns + 2] == "text") {
|
647 |
-
for ($l = 1; $l <= $mat_columns; $l++) {
|
648 |
-
$text_value = $matrix_value[$mat_rows+$mat_columns+2+$var_checkbox];
|
649 |
-
$index = "'".$k.'_'.$l."'";
|
650 |
-
$matrix .= '<td style="text-align:center;"><input name="'.$label_id.'_input_elementform_id_temp'.$k.'_'.$l.'" id="'.$label_id.'_input_elementform_id_temp'.$k.'_'.$l.'" type="'.$matrix_value[$mat_rows+$mat_columns+2].'" value="'.$text_value.'" onKeyUp="change_text_values('.$index.','.$label_id.','.$mat_rows.','.$mat_columns.')"/></td>';
|
651 |
-
$var_checkbox++;
|
652 |
-
}
|
653 |
-
}
|
654 |
-
else {
|
655 |
-
for ($l = 1; $l <= $mat_columns; $l++) {
|
656 |
-
$selected_text = $matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox];
|
657 |
-
if ($selected_text == 'yes') {
|
658 |
-
$selected_value_yes = 'selected';
|
659 |
-
$selected_value_no = '';
|
660 |
-
$selected_value = '';
|
661 |
-
}
|
662 |
-
else {
|
663 |
-
if ($selected_text=='no') {
|
664 |
-
$selected_value_yes ='';
|
665 |
-
$selected_value_no ='selected';
|
666 |
-
$selected_value ='';
|
667 |
-
}
|
668 |
-
else {
|
669 |
-
$selected_value_yes = '';
|
670 |
-
$selected_value_no ='';
|
671 |
-
$selected_value ='selected';
|
672 |
-
}
|
673 |
-
}
|
674 |
-
$index = "'".$k.'_'.$l."'";
|
675 |
-
$matrix .= '<td style="text-align:center;"><select name="'.$label_id.'_select_yes_noform_id_temp'.$k.'_'.$l.'" id="'.$label_id.'_select_yes_noform_id_temp'.$k.'_'.$l.'" onChange="change_option_values('.$index.','.$label_id.','.$mat_rows.','.$mat_columns.')"><option value="" '.$selected_value.'></option><option value="yes" '.$selected_value_yes.' >Yes</option><option value="no" '.$selected_value_no.'>No</option></select></td>';
|
676 |
-
$var_checkbox++;
|
677 |
-
}
|
678 |
-
}
|
679 |
-
}
|
680 |
-
}
|
681 |
-
$matrix .= '</tr>';
|
682 |
-
}
|
683 |
-
$matrix .= '</table>';
|
684 |
-
array_push($type_matrix_array, $matrix);
|
685 |
-
array_push($type_matrix_array, $new_filename);
|
686 |
-
return $type_matrix_array;
|
687 |
-
}
|
688 |
-
|
689 |
-
public function select_data_from_db_for_labels($db_info,$label_column, $table, $where, $order_by) {
|
690 |
-
global $wpdb;
|
691 |
-
|
692 |
-
$query = "SELECT `" . $label_column . "` FROM " . $table . $where . " ORDER BY " . $order_by;
|
693 |
-
if($db_info) {
|
694 |
-
$temp = explode('@@@wdfhostwdf@@@',$db_info);
|
695 |
-
$host = $temp[0];
|
696 |
-
$temp = explode('@@@wdfportwdf@@@',$temp[1]);
|
697 |
-
$port = $temp[0];
|
698 |
-
$temp = explode('@@@wdfusernamewdf@@@',$temp[1]);
|
699 |
-
$username = $temp[0];
|
700 |
-
$temp = explode('@@@wdfpasswordwdf@@@',$temp[1]);
|
701 |
-
$password = $temp[0];
|
702 |
-
$temp = explode('@@@wdfdatabasewdf@@@',$temp[1]);
|
703 |
-
$database = $temp[0];
|
704 |
-
|
705 |
-
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
706 |
-
$choices_labels = $wpdb_temp->get_col($query);
|
707 |
-
}
|
708 |
-
else {
|
709 |
-
$choices_labels = $wpdb->get_col($query);
|
710 |
-
}
|
711 |
-
return $choices_labels;
|
712 |
-
}
|
713 |
-
public function select_data_from_db_for_values($db_info,$value_column, $table, $where, $order_by) {
|
714 |
-
global $wpdb;
|
715 |
-
$query = "SELECT `" . $value_column . "` FROM " . $table . $where . " ORDER BY " . $order_by;
|
716 |
-
if($db_info) {
|
717 |
-
$temp = explode('@@@wdfhostwdf@@@',$db_info);
|
718 |
-
$host = $temp[0];
|
719 |
-
$temp = explode('@@@wdfportwdf@@@',$temp[1]);
|
720 |
-
$port = $temp[0];
|
721 |
-
$temp = explode('@@@wdfusernamewdf@@@',$temp[1]);
|
722 |
-
$username = $temp[0];
|
723 |
-
$temp = explode('@@@wdfpasswordwdf@@@',$temp[1]);
|
724 |
-
$password = $temp[0];
|
725 |
-
$temp = explode('@@@wdfdatabasewdf@@@',$temp[1]);
|
726 |
-
$database = $temp[0];
|
727 |
-
|
728 |
-
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
729 |
-
$choices_values = $wpdb_temp->get_col($query);
|
730 |
-
}
|
731 |
-
else {
|
732 |
-
$choices_values = $wpdb->get_col($query);
|
733 |
-
}
|
734 |
-
return $choices_values;
|
735 |
-
}
|
736 |
-
public function get_subs_count($form_id) {
|
737 |
-
global $wpdb;
|
738 |
-
$query = $wpdb->prepare("SELECT distinct group_id FROM " . $wpdb->prefix . "formmaker_submits where form_id=%d", $form_id);
|
739 |
-
$group_id_s = $wpdb->get_col($query);
|
740 |
-
return count($group_id_s);
|
741 |
-
}
|
742 |
-
}
|
743 |
-
|
744 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/models/FMModelUninstall_fm.php
DELETED
@@ -1,55 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMModelUninstall_fmc {
|
4 |
-
|
5 |
-
public function delete_db_tables() {
|
6 |
-
global $wpdb;
|
7 |
-
$contact_form_ids = get_option('contact_form_forms', 0);
|
8 |
-
$true_or_false_forms = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker WHERE `id` NOT IN (" . $contact_form_ids . ")");
|
9 |
-
if ($true_or_false_forms) {
|
10 |
-
$wpdb->query("DELETE FROM " . $wpdb->prefix . "formmaker WHERE `id` IN (" . $contact_form_ids . ")");
|
11 |
-
$wpdb->query("DELETE FROM " . $wpdb->prefix . "formmaker_submits WHERE `form_id` IN (" . $contact_form_ids . ")");
|
12 |
-
$wpdb->query("DELETE FROM " . $wpdb->prefix . "formmaker_views WHERE `form_id` IN (" . $contact_form_ids . ")");
|
13 |
-
}
|
14 |
-
else {
|
15 |
-
$email_verification_post_id = $wpdb->get_var("SELECT mail_verification_post_id FROM " . $wpdb->prefix . "formmaker WHERE mail_verification_post_id != 0");
|
16 |
-
delete_option("wd_form_maker_version");
|
17 |
-
delete_option('formmaker_cureent_version');
|
18 |
-
delete_option('form_maker_pro_active');
|
19 |
-
delete_option('fm_emailverification');
|
20 |
-
delete_option('fm_admin_notice');
|
21 |
-
delete_option('fm_settings');
|
22 |
-
delete_option('fm_subscribe_done');
|
23 |
-
wp_delete_post($email_verification_post_id);
|
24 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker");
|
25 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_submits");
|
26 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_views");
|
27 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_themes");
|
28 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_sessions");
|
29 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_blocked");
|
30 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_query");
|
31 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_backup");
|
32 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_mailchimp");
|
33 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_reg");
|
34 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_post_gen_options");
|
35 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_email_conditions");
|
36 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_dbox_int");
|
37 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_pdf_options");
|
38 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_pdf");
|
39 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_pushover");
|
40 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_stripe");
|
41 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_save_options");
|
42 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_saved_entries");
|
43 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_saved_attributes");
|
44 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_calculator");
|
45 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_gdrive_int");
|
46 |
-
$wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_display_options");
|
47 |
-
}
|
48 |
-
delete_option('fmc_settings');
|
49 |
-
delete_option('contact_form_themes');
|
50 |
-
delete_option('contact_form_forms');
|
51 |
-
delete_option('cfm_admin_notice');
|
52 |
-
delete_option('cfm_subscribe_done');
|
53 |
-
}
|
54 |
-
|
55 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/models/FMModelWidget.php
DELETED
@@ -1,38 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class FMModelWidget_fmc {
|
4 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
5 |
-
// Events //
|
6 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
7 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
8 |
-
// Constants //
|
9 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
10 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
11 |
-
// Variables //
|
12 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
13 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
14 |
-
// Constructor & Destructor //
|
15 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
16 |
-
public function __construct() {
|
17 |
-
}
|
18 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
19 |
-
// Public Methods //
|
20 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
21 |
-
|
22 |
-
public function get_gallery_rows_data() {
|
23 |
-
global $wpdb;
|
24 |
-
$query = "SELECT * FROM " . $wpdb->prefix . "formmaker order by `title`";
|
25 |
-
$rows = $wpdb->get_results($query);
|
26 |
-
return $rows;
|
27 |
-
}
|
28 |
-
|
29 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
30 |
-
// Getters & Setters //
|
31 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
32 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
33 |
-
// Private Methods //
|
34 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
35 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
36 |
-
// Listeners //
|
37 |
-
////////////////////////////////////////////////////////////////////////////////////////
|
38 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/models/FMPaypalInfo.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class FMModelPaypal_info
|
5 |
+
*/
|
6 |
+
class FMModelPaypal_info {
|
7 |
+
/**
|
8 |
+
* Get form session.
|
9 |
+
*
|
10 |
+
* @param int $id
|
11 |
+
*
|
12 |
+
* @return object $row
|
13 |
+
*/
|
14 |
+
public function get_form_session( $id ) {
|
15 |
+
global $wpdb;
|
16 |
+
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_sessions WHERE group_id="%d"', $id));
|
17 |
+
|
18 |
+
return $row;
|
19 |
+
}
|
20 |
+
}
|
admin/models/FMSelectDataFromDb.php
ADDED
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class FMModelSelect_data_from_db_fmc
|
5 |
+
*/
|
6 |
+
class FMModelSelect_data_from_db_fmc {
|
7 |
+
/**
|
8 |
+
* Get labels by form id.
|
9 |
+
*
|
10 |
+
* @param int $id
|
11 |
+
*
|
12 |
+
* @return (string|null) $rows
|
13 |
+
*/
|
14 |
+
function get_labels( $id ) {
|
15 |
+
global $wpdb;
|
16 |
+
$rows = $wpdb->get_var("SELECT label_order_current FROM " . $wpdb->prefix . "formmaker where id=" . $id);
|
17 |
+
|
18 |
+
return $rows;
|
19 |
+
}
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Get tables.
|
23 |
+
*
|
24 |
+
* @return object $tables
|
25 |
+
*/
|
26 |
+
function get_tables() {
|
27 |
+
global $wpdb;
|
28 |
+
$con_type = $_POST['con_type'];
|
29 |
+
if ( $con_type == 'local' ) {
|
30 |
+
$query = "SHOW TABLES";
|
31 |
+
$tables = $wpdb->get_col($query);
|
32 |
+
}
|
33 |
+
else {
|
34 |
+
if ( $con_type == 'remote' ) {
|
35 |
+
$username = isset($_POST['username']) ? $_POST['username'] : '';
|
36 |
+
$password = isset($_POST['password']) ? $_POST['password'] : '';
|
37 |
+
$database = isset($_POST['database']) ? $_POST['database'] : '';
|
38 |
+
$host = isset($_POST['host']) ? $_POST['host'] : '';
|
39 |
+
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
40 |
+
$query = "SHOW TABLES";
|
41 |
+
$tables = $wpdb_temp->get_col($query);
|
42 |
+
}
|
43 |
+
}
|
44 |
+
|
45 |
+
return $tables;
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Get tables saved.
|
50 |
+
*
|
51 |
+
* @param string $con_type
|
52 |
+
* @param string $username
|
53 |
+
* @param string $password
|
54 |
+
* @param string $database
|
55 |
+
* @param string $host
|
56 |
+
*
|
57 |
+
* @return object $tables
|
58 |
+
*/
|
59 |
+
function get_tables_saved( $con_type, $username, $password, $database, $host ) {
|
60 |
+
global $wpdb;
|
61 |
+
if ( $con_type == 'local' ) {
|
62 |
+
$query = "SHOW TABLES";
|
63 |
+
$tables = $wpdb->get_col($query);
|
64 |
+
}
|
65 |
+
else {
|
66 |
+
if ( $con_type == 'remote' ) {
|
67 |
+
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
68 |
+
$query = "SHOW TABLES";
|
69 |
+
$tables = $wpdb_temp->get_col($query);
|
70 |
+
}
|
71 |
+
}
|
72 |
+
|
73 |
+
return $tables;
|
74 |
+
}
|
75 |
+
|
76 |
+
/**
|
77 |
+
* Get table struct.
|
78 |
+
*
|
79 |
+
* @return object $table_struct
|
80 |
+
*/
|
81 |
+
function get_table_struct() {
|
82 |
+
global $wpdb;
|
83 |
+
$name = isset($_POST['name']) ? $_POST['name'] : NULL;
|
84 |
+
if ( !$name ) {
|
85 |
+
return array();
|
86 |
+
}
|
87 |
+
$con_method = $_POST['con_method'];
|
88 |
+
$con_type = $_POST['con_type'];
|
89 |
+
$query = "SHOW COLUMNS FROM " . $name;
|
90 |
+
if ( $con_type == 'remote' ) {
|
91 |
+
$username = isset($_POST['username']) ? $_POST['username'] : '';
|
92 |
+
$password = isset($_POST['password']) ? $_POST['password'] : '';
|
93 |
+
$database = isset($_POST['database']) ? $_POST['database'] : '';
|
94 |
+
$host = isset($_POST['host']) ? $_POST['host'] : '';
|
95 |
+
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
96 |
+
$table_struct = $wpdb_temp->get_results($query);
|
97 |
+
}
|
98 |
+
else {
|
99 |
+
$table_struct = $wpdb->get_results($query);
|
100 |
+
}
|
101 |
+
|
102 |
+
return $table_struct;
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* Get table struct.
|
107 |
+
*
|
108 |
+
* @param string $con_type
|
109 |
+
* @param string $username
|
110 |
+
* @param string $password
|
111 |
+
* @param string $database
|
112 |
+
* @param string $host
|
113 |
+
* @param string $name
|
114 |
+
* @param string $con_method
|
115 |
+
*
|
116 |
+
* @return object $table_struct
|
117 |
+
*/
|
118 |
+
function get_table_struct_saved( $con_type, $username, $password, $database, $host, $name, $con_method ) {
|
119 |
+
global $wpdb;
|
120 |
+
if ( !$name ) {
|
121 |
+
return array();
|
122 |
+
}
|
123 |
+
$query = "SHOW COLUMNS FROM " . $name;
|
124 |
+
if ( $con_type == 'remote' ) {
|
125 |
+
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
126 |
+
$table_struct = $wpdb_temp->get_results($query);
|
127 |
+
}
|
128 |
+
else {
|
129 |
+
$table_struct = $wpdb->get_results($query);
|
130 |
+
}
|
131 |
+
|
132 |
+
return $table_struct;
|
133 |
+
}
|
134 |
+
}
|
admin/models/FMShortocde.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class FMModelFMShortocde_fmc
|
5 |
+
*/
|
6 |
+
class FMModelFMShortocde_fmc {
|
7 |
+
/**
|
8 |
+
* Get forms.
|
9 |
+
*
|
10 |
+
* @return array $rows
|
11 |
+
*/
|
12 |
+
public function get_form_data() {
|
13 |
+
global $wpdb;
|
14 |
+
$rows = $wpdb->get_results("SELECT * FROM `" . $wpdb->prefix . "formmaker`" . (!WDCFM()->is_free ? '' : ' WHERE id' . (WDCFM()->is_free == 1 ? ' NOT ' : ' ') . 'IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ') ORDER BY `title`'));
|
15 |
+
return $rows;
|
16 |
+
}
|
17 |
+
}
|
admin/models/FMSqlMapping.php
ADDED
@@ -0,0 +1,119 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class FMModelFormMakerSQLMapping_fmc
|
5 |
+
*/
|
6 |
+
class FMModelFormMakerSQLMapping_fmc {
|
7 |
+
/**
|
8 |
+
* Get query by id.
|
9 |
+
*
|
10 |
+
* @param $id
|
11 |
+
*
|
12 |
+
* @return array|null|object|void
|
13 |
+
*/
|
14 |
+
function get_query( $id ) {
|
15 |
+
global $wpdb;
|
16 |
+
$rows = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker_query where id=" . $id);
|
17 |
+
|
18 |
+
return $rows;
|
19 |
+
}
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Get labels by id.
|
23 |
+
*
|
24 |
+
* @param int $id
|
25 |
+
*
|
26 |
+
* @return (string|null) $rows
|
27 |
+
*/
|
28 |
+
function get_labels( $id ) {
|
29 |
+
global $wpdb;
|
30 |
+
$rows = $wpdb->get_var("SELECT label_order_current FROM " . $wpdb->prefix . "formmaker where id=" . $id);
|
31 |
+
|
32 |
+
return $rows;
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Get tables.
|
37 |
+
*
|
38 |
+
* @return object $tables
|
39 |
+
*/
|
40 |
+
function get_tables() {
|
41 |
+
global $wpdb;
|
42 |
+
$con_type = $_POST['con_type'];
|
43 |
+
if ( $con_type == 'local' ) {
|
44 |
+
$query = "SHOW TABLES";
|
45 |
+
$tables = $wpdb->get_col($query);
|
46 |
+
}
|
47 |
+
else {
|
48 |
+
if ( $con_type == 'remote' ) {
|
49 |
+
$username = isset($_POST['username']) ? $_POST['username'] : '';
|
50 |
+
$password = isset($_POST['password']) ? $_POST['password'] : '';
|
51 |
+
$database = isset($_POST['database']) ? $_POST['database'] : '';
|
52 |
+
$host = isset($_POST['host']) ? $_POST['host'] : '';
|
53 |
+
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
54 |
+
$query = "SHOW TABLES";
|
55 |
+
$tables = $wpdb_temp->get_col($query);
|
56 |
+
}
|
57 |
+
}
|
58 |
+
|
59 |
+
return $tables;
|
60 |
+
}
|
61 |
+
|
62 |
+
function get_tables_saved( $con_type, $username, $password, $database, $host ) {
|
63 |
+
global $wpdb;
|
64 |
+
if ( $con_type == 'local' ) {
|
65 |
+
$query = "SHOW TABLES";
|
66 |
+
$tables = $wpdb->get_col($query);
|
67 |
+
}
|
68 |
+
else {
|
69 |
+
if ( $con_type == 'remote' ) {
|
70 |
+
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
71 |
+
$query = "SHOW TABLES";
|
72 |
+
$tables = $wpdb_temp->get_col($query);
|
73 |
+
}
|
74 |
+
}
|
75 |
+
|
76 |
+
return $tables;
|
77 |
+
}
|
78 |
+
|
79 |
+
function get_table_struct() {
|
80 |
+
global $wpdb;
|
81 |
+
$name = isset($_POST['name']) ? $_POST['name'] : NULL;
|
82 |
+
if ( !$name ) {
|
83 |
+
return array();
|
84 |
+
}
|
85 |
+
$con_method = $_POST['con_method'];
|
86 |
+
$con_type = $_POST['con_type'];
|
87 |
+
$query = "SHOW COLUMNS FROM " . $name;
|
88 |
+
if ( $con_type == 'remote' ) {
|
89 |
+
$username = isset($_POST['username']) ? $_POST['username'] : '';
|
90 |
+
$password = isset($_POST['password']) ? $_POST['password'] : '';
|
91 |
+
$database = isset($_POST['database']) ? $_POST['database'] : '';
|
92 |
+
$host = isset($_POST['host']) ? $_POST['host'] : '';
|
93 |
+
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
94 |
+
$table_struct = $wpdb_temp->get_results($query);
|
95 |
+
}
|
96 |
+
else {
|
97 |
+
$table_struct = $wpdb->get_results($query);
|
98 |
+
}
|
99 |
+
|
100 |
+
return $table_struct;
|
101 |
+
}
|
102 |
+
|
103 |
+
function get_table_struct_saved( $con_type, $username, $password, $database, $host, $name, $con_method ) {
|
104 |
+
global $wpdb;
|
105 |
+
if ( !$name ) {
|
106 |
+
return array();
|
107 |
+
}
|
108 |
+
$query = "SHOW COLUMNS FROM " . $name;
|
109 |
+
if ( $con_type == 'remote' ) {
|
110 |
+
$wpdb_temp = new wpdb($username, $password, $database, $host);
|
111 |
+
$table_struct = $wpdb_temp->get_results($query);
|
112 |
+
}
|
113 |
+
else {
|
114 |
+
$table_struct = $wpdb->get_results($query);
|
115 |
+
}
|
116 |
+
|
117 |
+
return $table_struct;
|
118 |
+
}
|
119 |
+
}
|
admin/models/FormMakerSubmits.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class FMModelFormMakerSubmits_fmc
|
5 |
+
*/
|
6 |
+
class FMModelFormMakerSubmits_fmc {
|
7 |
+
public function get_from_label_order( $form_id ) {
|
8 |
+
global $wpdb;
|
9 |
+
$label_order = $wpdb->get_var($wpdb->prepare('SELECT `label_order` FROM `' . $wpdb->prefix . 'formmaker` WHERE id="%d"', $form_id));
|
10 |
+
|
11 |
+
return $label_order;
|
12 |
+
}
|
13 |
+
|
14 |
+
public function get_submissions( $group_id ) {
|
15 |
+
global $wpdb;
|
16 |
+
$row = $wpdb->get_results($wpdb->prepare('SELECT * FROM `' . $wpdb->prefix . 'formmaker_submits` WHERE group_id="%d"', $group_id));
|
17 |
+
|
18 |
+
return $row;
|
19 |
+
}
|
20 |
+
}
|
admin/models/Manage_fm.php
ADDED
@@ -0,0 +1,3846 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class FMModelManage_fmc
|
5 |
+
*/
|
6 |
+
class FMModelManage_fmc {
|
7 |
+
/**
|
8 |
+
* Get forms.
|
9 |
+
*
|
10 |
+
* @param $params
|
11 |
+
*
|
12 |
+
* @return array|null|object
|
13 |
+
*/
|
14 |
+
public function get_rows_data($params) {
|
15 |
+
$order = $params['order'];
|
16 |
+
$orderby = $params['orderby'];
|
17 |
+
$items_per_page = $params['items_per_page'];
|
18 |
+
$search = WDW_FMC_Library::get('s', '');
|
19 |
+
$page = (int) WDW_FMC_Library::get('paged', 1);
|
20 |
+
$limit = $page ? ($page - 1) * $items_per_page : 0;
|
21 |
+
|
22 |
+
global $wpdb;
|
23 |
+
$query = "SELECT t1.*, count(DISTINCT t2.group_id) as submission_count, GROUP_CONCAT(t2.id SEPARATOR ',') FROM " . $wpdb->prefix . "formmaker as t1 ";
|
24 |
+
$query .= "LEFT JOIN " . $wpdb->prefix . "formmaker_submits as t2 ";
|
25 |
+
$query .= "on t1.id = t2.form_id ";
|
26 |
+
$query .= (!WDCFM()->is_free ? '' : 'WHERE t1.id' . (WDCFM()->is_free == 1 ? ' NOT ' : ' ') . 'IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ')');
|
27 |
+
if ( $search ) {
|
28 |
+
$query .= (!WDCFM()->is_free ? 'WHERE' : ' AND') . ' t1.title LIKE "%' . $search . '%"';
|
29 |
+
}
|
30 |
+
$query .= " GROUP BY t1.id";
|
31 |
+
$query .= ' ORDER BY t1.`' . $orderby . '` ' . $order;
|
32 |
+
$query .= " LIMIT " . $limit . "," . $items_per_page;
|
33 |
+
$rows = $wpdb->get_results($query);
|
34 |
+
|
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 |
+
// Add "Submit" button to new forms.
|
45 |
+
$row = new stdClass();
|
46 |
+
$row->id = 0;
|
47 |
+
$row->title = '';
|
48 |
+
$row->mail = '';
|
49 |
+
$row->form = '';
|
50 |
+
$row->form_front = '<div class="wdform-page-and-images wd-table"><div id="form_id_tempform_view1" class="wdform_page" page_title="Untitled page" next_title="Next" next_type="text" next_class="wdform-page-button" next_checkable="false" previous_title="Previous" previous_type="text" previous_class="wdform-page-button" previous_checkable="false"><div class="wdform_section"><div class="wdform_column"><div wdid="1" class="wdform_row ui-sortable-handle">%1 - type_submit_reset_1%</div></div></div><div valign="top" class="wdform_footer wd-width-100"><div class="wd-width-100"><div class="wd-width-100 wd-table" style="padding-top:10px;"><div class="wd-table-group"><div id="form_id_temppage_nav1" class="wd-table-row"></div></div></div></div></div></div></div>';
|
51 |
+
$row->theme = 0;
|
52 |
+
$row->javascript = '';
|
53 |
+
$row->submit_text = '';
|
54 |
+
$row->url = '';
|
55 |
+
$row->submit_text_type = 0;
|
56 |
+
$row->script1 = '';
|
57 |
+
$row->script2 = '';
|
58 |
+
$row->script_user1 = '';
|
59 |
+
$row->script_user2 = '';
|
60 |
+
$row->counter = 2;
|
61 |
+
$row->label_order = '1#**id**#type_submit_reset_1#**label**#type_submit_reset#****##**id**##**label**##****#';
|
62 |
+
$row->article_id = '';
|
63 |
+
$row->pagination = '';
|
64 |
+
$row->show_title = '';
|
65 |
+
$row->show_numbers = '';
|
66 |
+
$row->public_key = '';
|
67 |
+
$row->private_key = '';
|
68 |
+
$row->recaptcha_theme = '';
|
69 |
+
$row->from_name = '';
|
70 |
+
$row->from_mail = '';
|
71 |
+
$row->label_order_current = '1#**id**#type_submit_reset_1#**label**#type_submit_reset#****#';
|
72 |
+
$row->script_mail_user = '';
|
73 |
+
$row->script_mail = '';
|
74 |
+
$row->tax = 0;
|
75 |
+
$row->payment_currency = '$';
|
76 |
+
$row->paypal_email = '';
|
77 |
+
$row->checkout_mode = 'testmode';
|
78 |
+
$row->paypal_mode = 0;
|
79 |
+
$row->published = 1;
|
80 |
+
$row->form_fields = '1*:*id*:*type_submit_reset*:*type*:*type_submit_reset_1*:*w_field_label*:*Submit*:*w_submit_title*:*Reset*:*w_reset_title*:**:*w_class*:*false*:*w_act*:**:*new_field*:*';
|
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 |
+
$row->save_uploads = 1;
|
92 |
+
$row->header_title = '';
|
93 |
+
$row->header_description = '';
|
94 |
+
$row->header_image_url = '';
|
95 |
+
$row->header_image_animation = '';
|
96 |
+
$row->header_hide_image = '';
|
97 |
+
}
|
98 |
+
|
99 |
+
return $row;
|
100 |
+
}
|
101 |
+
|
102 |
+
public function get_row_data_new( $id ) {
|
103 |
+
global $wpdb;
|
104 |
+
if ( $id != 0 ) {
|
105 |
+
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_backup WHERE backup_id="%d"', $id));
|
106 |
+
}
|
107 |
+
else {
|
108 |
+
// Add "Submit" button to new forms.
|
109 |
+
$row = new stdClass();
|
110 |
+
$row->id = 0;
|
111 |
+
$row->backup_id = '';
|
112 |
+
$row->title = '';
|
113 |
+
$row->mail = '';
|
114 |
+
$row->form = '';
|
115 |
+
$row->form_front = '<div class="wdform-page-and-images" class="wd-table"><div id="form_id_tempform_view1" class="wdform_page" page_title="Untitled page" next_title="Next" next_type="text" next_class="wdform-page-button" next_checkable="false" previous_title="Previous" previous_type="text" previous_class="wdform-page-button" previous_checkable="false"><div class="wdform_section"><div class="wdform_column"><div wdid="1" class="wdform_row ui-sortable-handle">%1 - type_submit_reset_1%</div></div></div><div valign="top" class="wdform_footer wd-width-100"><div class="wd-width-100"><div class="wd-width-100 wd-table" style="padding-top:10px;"><div class="wd-table-group"><div id="form_id_temppage_nav1" class="wd-table-row"></div></div></div></div></div></div></div>';
|
116 |
+
$row->theme = $wpdb->get_var("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE `default`='1'");
|
117 |
+
$row->javascript = '';
|
118 |
+
$row->submit_text = '';
|
119 |
+
$row->url = '';
|
120 |
+
$row->submit_text_type = 1;
|
121 |
+
$row->script1 = '%all%';
|
122 |
+
$row->script2 = '%all%';
|
123 |
+
$row->script_user1 = '';
|
124 |
+
$row->script_user2 = '';
|
125 |
+
$row->counter = 2;
|
126 |
+
$row->label_order = '1#**id**#type_submit_reset_1#**label**#type_submit_reset#****##**id**##**label**##****#';
|
127 |
+
$row->article_id = 0;
|
128 |
+
$row->pagination = 'none';
|
129 |
+
$row->show_title = false;
|
130 |
+
$row->show_numbers = true;
|
131 |
+
$row->public_key = '';
|
132 |
+
$row->private_key = '';
|
133 |
+
$row->recaptcha_theme = '';
|
134 |
+
$row->from_name = '';
|
135 |
+
$row->from_mail = '';
|
136 |
+
$row->label_order_current = '1#**id**#type_submit_reset_1#**label**#type_submit_reset#****#';
|
137 |
+
$row->script_mail_user = '';
|
138 |
+
$row->script_mail = '';
|
139 |
+
$row->tax = 0;
|
140 |
+
$row->payment_currency = '$';
|
141 |
+
$row->paypal_email = '';
|
142 |
+
$row->checkout_mode = 'testmode';
|
143 |
+
$row->paypal_mode = 0;
|
144 |
+
$row->published = 1;
|
145 |
+
$row->form_fields = '1*:*id*:*type_submit_reset*:*type*:*type_submit_reset_1*:*w_field_label*:*Submit*:*w_submit_title*:*Reset*:*w_reset_title*:**:*w_class*:*false*:*w_act*:**:*new_field*:*';
|
146 |
+
$row->savedb = 1;
|
147 |
+
$row->sendemail = 1;
|
148 |
+
$row->requiredmark = '*';
|
149 |
+
$row->reply_to = 0;
|
150 |
+
$row->send_to = 0;
|
151 |
+
$row->autogen_layout = 1;
|
152 |
+
$row->custom_front = '';
|
153 |
+
$row->mail_from_user = '';
|
154 |
+
$row->mail_from_name_user = '';
|
155 |
+
$row->reply_to_user = '';
|
156 |
+
$row->save_uploads = 1;
|
157 |
+
$row->header_title = '';
|
158 |
+
$row->header_description = '';
|
159 |
+
$row->header_image_url = '';
|
160 |
+
$row->header_image_animation = 'none';
|
161 |
+
$row->header_hide_image = 0;
|
162 |
+
$row->condition = '';
|
163 |
+
$row->mail_cc = '';
|
164 |
+
$row->mail_cc_user = '';
|
165 |
+
$row->mail_bcc = '';
|
166 |
+
$row->mail_bcc_user = '';
|
167 |
+
$row->mail_subject = '';
|
168 |
+
$row->mail_subject_user = '';
|
169 |
+
$row->mail_mode = 1;
|
170 |
+
$row->mail_mode_user = 1;
|
171 |
+
$row->mail_attachment = 1;
|
172 |
+
$row->mail_attachment_user = 1;
|
173 |
+
$row->user_id_wd = '';
|
174 |
+
$row->sortable = 1;
|
175 |
+
$row->frontend_submit_fields = '';
|
176 |
+
$row->frontend_submit_stat_fields = '';
|
177 |
+
$row->mail_emptyfields = 0;
|
178 |
+
$row->mail_verify = 0;
|
179 |
+
$row->mail_verify_expiretime = 0;
|
180 |
+
$row->mail_verification_post_id = 0;
|
181 |
+
}
|
182 |
+
|
183 |
+
$labels2 = array();
|
184 |
+
$label_id = array();
|
185 |
+
$label_order_original = array();
|
186 |
+
$label_type = array();
|
187 |
+
$label_all = explode('#****#', $row->label_order);
|
188 |
+
$label_all = array_slice($label_all, 0, count($label_all) - 1);
|
189 |
+
foreach ( $label_all as $key => $label_each ) {
|
190 |
+
$label_id_each = explode('#**id**#', $label_each);
|
191 |
+
array_push($label_id, $label_id_each[0]);
|
192 |
+
$label_oder_each = explode('#**label**#', $label_id_each[1]);
|
193 |
+
array_push($label_order_original, addslashes($label_oder_each[0]));
|
194 |
+
array_push($label_type, $label_oder_each[1]);
|
195 |
+
}
|
196 |
+
$labels2['id'] = '"' . implode('","', $label_id) . '"';
|
197 |
+
$labels2['label'] = '"' . implode('","', $label_order_original) . '"';
|
198 |
+
$labels2['type'] = '"' . implode('","', $label_type) . '"';
|
199 |
+
$ids = array();
|
200 |
+
$types = array();
|
201 |
+
$labels = array();
|
202 |
+
$paramss = array();
|
203 |
+
$fields = explode('*:*new_field*:*', $row->form_fields);
|
204 |
+
$fields = array_slice($fields, 0, count($fields) - 1);
|
205 |
+
foreach ( $fields as $field ) {
|
206 |
+
$temp = explode('*:*id*:*', $field);
|
207 |
+
array_push($ids, $temp[0]);
|
208 |
+
$temp = explode('*:*type*:*', $temp[1]);
|
209 |
+
array_push($types, $temp[0]);
|
210 |
+
$temp = explode('*:*w_field_label*:*', $temp[1]);
|
211 |
+
array_push($labels, $temp[0]);
|
212 |
+
array_push($paramss, $temp[1]);
|
213 |
+
}
|
214 |
+
$form = $row->form_front;
|
215 |
+
foreach ( $ids as $ids_key => $id ) {
|
216 |
+
$label = $labels[$ids_key];
|
217 |
+
$type = $types[$ids_key];
|
218 |
+
$params = $paramss[$ids_key];
|
219 |
+
if ( strpos($form, '%' . $id . ' - ' . $label . '%') || strpos($form, '%' . $id . ' -' . $label . '%') ) {
|
220 |
+
$rep = '';
|
221 |
+
$arrows = '';
|
222 |
+
$param = array();
|
223 |
+
$param['attributes'] = '';
|
224 |
+
switch ( $type ) {
|
225 |
+
case 'type_section_break': {
|
226 |
+
$arrows = '<div id="wdform_arrows' . $id . '" class="wdform_arrows" style="display: none;">
|
227 |
+
<span class="wdform_arrows_basic wdform_arrows_container">
|
228 |
+
<span id="edit_' . $id . '" valign="middle" class="element_toolbar">
|
229 |
+
<span title="Edit the field" class="page_toolbar dashicons dashicons-edit" onclick="edit("' . $id . '")"></span>
|
230 |
+
</span>
|
231 |
+
<span id="duplicate_' . $id . '" valign="middle" class="element_toolbar">
|
232 |
+
<span title="Duplicate the field" class="page_toolbar dashicons dashicons-admin-page" onclick="duplicate("' . $id . '")"></span>
|
233 |
+
</span>
|
234 |
+
<span id="X_' . $id . '" valign="middle" align="right" class="element_toolbar">
|
235 |
+
<span title="Remove the field" class="page_toolbar dashicons dashicons-no-alt" onclick="remove_section_break("' . $id . '")"></span>
|
236 |
+
</span>
|
237 |
+
</span>
|
238 |
+
</div>';
|
239 |
+
break;
|
240 |
+
}
|
241 |
+
case 'type_send_copy':
|
242 |
+
case 'type_stripe':
|
243 |
+
case 'type_captcha':
|
244 |
+
case 'type_arithmetic_captcha':
|
245 |
+
case 'type_recaptcha': {
|
246 |
+
$arrows = '<div id="wdform_arrows' . $id . '" class="wdform_arrows" style="display: none;">
|
247 |
+
<span class="wdform_arrows_advanced wdform_arrows_container" style="display: none;">
|
248 |
+
<span id="left_' . $id . '" valign="middle" class="element_toolbar">
|
249 |
+
<span title="Move the field to the left" class="page_toolbar dashicons dashicons-arrow-left-alt" onclick="left_row("' . $id . '")"></span>
|
250 |
+
</span>
|
251 |
+
<span id="up_' . $id . '" valign="middle" class="element_toolbar">
|
252 |
+
<span title="Move the field up" class="page_toolbar dashicons dashicons-arrow-up-alt" onclick="up_row("' . $id . '")"></span>
|
253 |
+
</span>
|
254 |
+
<span id="down_' . $id . '" valign="middle" class="element_toolbar">
|
255 |
+
<span title="Move the field down" class="page_toolbar dashicons dashicons-arrow-down-alt" onclick="down_row("' . $id . '")"></span>
|
256 |
+
</span>
|
257 |
+
<span id="right_' . $id . '" valign="middle" class="element_toolbar">
|
258 |
+
<span title="Move the field to the right" class="page_toolbar dashicons dashicons-arrow-right-alt" onclick="right_row("' . $id . '")"></span>
|
259 |
+
</span>
|
260 |
+
<span id="page_up_' . $id . '" valign="middle" class="element_toolbar">
|
261 |
+
<span title="Move the field to the upper page" class="page_toolbar dashicons dashicons-upload" onclick="page_up("' . $id . '")"></span>
|
262 |
+
</span>
|
263 |
+
<span id="page_down_' . $id . '" valign="middle" class="element_toolbar">
|
264 |
+
<span title="Move the field to the lower page" class="page_toolbar dashicons dashicons-download" onclick="page_down("' . $id . '")"></span>
|
265 |
+
</span>
|
266 |
+
</span>
|
267 |
+
<span class="wdform_arrows_basic wdform_arrows_container"> <span id="edit_' . $id . '" valign="middle" class="element_toolbar">
|
268 |
+
<span title="Edit the field" class="page_toolbar dashicons dashicons-edit" onclick="edit("' . $id . '")"></span>
|
269 |
+
</span>
|
270 |
+
<span id="duplicate_' . $id . '" valign="middle" class="element_toolbar"></span>
|
271 |
+
<span id="X_' . $id . '" valign="middle" align="right" class="element_toolbar">
|
272 |
+
<span title="Remove the field" class="page_toolbar dashicons dashicons-no-alt" onclick="remove_row("' . $id . '")"></span>
|
273 |
+
</span>
|
274 |
+
</span>
|
275 |
+
</div>';
|
276 |
+
break;
|
277 |
+
}
|
278 |
+
default : {
|
279 |
+
$arrows = '<div id="wdform_arrows' . $id . '" class="wdform_arrows" style="display: none;">
|
280 |
+
<span class="wdform_arrows_advanced wdform_arrows_container" style="display: none;">
|
281 |
+
<span id="left_' . $id . '" valign="middle" class="element_toolbar">
|
282 |
+
<span title="Move the field to the left" class="page_toolbar dashicons dashicons-arrow-left-alt" onclick="left_row("' . $id . '")"></span>
|
283 |
+
</span>
|
284 |
+
<span id="up_' . $id . '" valign="middle" class="element_toolbar">
|
285 |
+
<span title="Move the field up" class="page_toolbar dashicons dashicons-arrow-up-alt" onclick="up_row("' . $id . '")"></span>
|
286 |
+
</span>
|
287 |
+
<span id="down_' . $id . '" valign="middle" class="element_toolbar">
|
288 |
+
<span title="Move the field down" class="page_toolbar dashicons dashicons-arrow-down-alt" onclick="down_row("' . $id . '")"></span>
|
289 |
+
</span>
|
290 |
+
<span id="right_' . $id . '" valign="middle" class="element_toolbar">
|
291 |
+
<span title="Move the field to the right" class="page_toolbar dashicons dashicons-arrow-right-alt" onclick="right_row("' . $id . '")"></span>
|
292 |
+
</span>
|
293 |
+
<span id="page_up_' . $id . '" valign="middle" class="element_toolbar">
|
294 |
+
<span title="Move the field to the upper page" class="page_toolbar dashicons dashicons-upload" onclick="page_up("' . $id . '")"></span>
|
295 |
+
</span>
|
296 |
+
<span id="page_down_' . $id . '" valign="middle" class="element_toolbar">
|
297 |
+
<span title="Move the field to the lower page" class="page_toolbar dashicons dashicons-download" onclick="page_down("' . $id . '")"></span>
|
298 |
+
</span>
|
299 |
+
</span>
|
300 |
+
<span class="wdform_arrows_basic wdform_arrows_container"> <span id="edit_' . $id . '" valign="middle" class="element_toolbar">
|
301 |
+
<span title="Edit the field" class="page_toolbar dashicons dashicons-edit" onclick="edit("' . $id . '")"></span>
|
302 |
+
</span>
|
303 |
+
<span id="duplicate_' . $id . '" valign="middle" class="element_toolbar">
|
304 |
+
<span title="Duplicate the field" class="page_toolbar dashicons dashicons-admin-page" onclick="duplicate("' . $id . '")"></span>
|
305 |
+
</span>
|
306 |
+
<span id="X_' . $id . '" valign="middle" align="right" class="element_toolbar">
|
307 |
+
<span title="Remove the field" class="page_toolbar dashicons dashicons-no-alt" onclick="remove_row("' . $id . '")"></span>
|
308 |
+
</span>
|
309 |
+
</span>
|
310 |
+
</div>';
|
311 |
+
break;
|
312 |
+
}
|
313 |
+
}
|
314 |
+
switch ( $type ) {
|
315 |
+
case 'type_section_break': {
|
316 |
+
$params_names = array( 'w_editor' );
|
317 |
+
$temp = $params;
|
318 |
+
foreach ( $params_names as $params_name ) {
|
319 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
320 |
+
$param[$params_name] = $temp[0];
|
321 |
+
$temp = $temp[1];
|
322 |
+
}
|
323 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_section_break" class="wdform_field_section_break">' . $arrows . '<span id="' . $id . '_element_labelform_id_temp" style="display: none;">' . __('Section Break', WDCFM()->prefix) . '</span><div id="' . $id . '_element_sectionform_id_temp" align="left" class="wdform_section_break">' . $param['w_editor'] . '</div></div><div id="' . $id . '_element_labelform_id_temp" style="color:red;">' . __('Section Break', WDCFM()->prefix) . '</div>';
|
324 |
+
break;
|
325 |
+
}
|
326 |
+
case 'type_editor': {
|
327 |
+
$params_names = array( 'w_editor' );
|
328 |
+
$temp = $params;
|
329 |
+
foreach ( $params_names as $params_name ) {
|
330 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
331 |
+
$param[$params_name] = $temp[0];
|
332 |
+
$temp = $temp[1];
|
333 |
+
}
|
334 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_editor" class="wdform_field" >' . $param['w_editor'] . '</div>' . $arrows . '<div id="' . $id . '_element_labelform_id_temp" style="color: red;"></div>';
|
335 |
+
break;
|
336 |
+
}
|
337 |
+
case 'type_send_copy': {
|
338 |
+
$params_names = array( 'w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_required' );
|
339 |
+
$temp = $params;
|
340 |
+
if ( strpos($temp, 'w_hide_label') > -1 ) {
|
341 |
+
$params_names = array(
|
342 |
+
'w_field_label_size',
|
343 |
+
'w_field_label_pos',
|
344 |
+
'w_hide_label',
|
345 |
+
'w_first_val',
|
346 |
+
'w_required',
|
347 |
+
);
|
348 |
+
}
|
349 |
+
foreach ( $params_names as $params_name ) {
|
350 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
351 |
+
$param[$params_name] = $temp[0];
|
352 |
+
$temp = $temp[1];
|
353 |
+
}
|
354 |
+
if ( $temp ) {
|
355 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
356 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
357 |
+
foreach ( $attrs as $attr ) {
|
358 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
359 |
+
}
|
360 |
+
}
|
361 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
362 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
363 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
364 |
+
$input_active = ($param['w_first_val'] == 'true' ? "checked='checked'" : "");
|
365 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
366 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_send_copy" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" style="display: ' . $param['w_field_label_pos'] . '"><input type="hidden" value="type_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="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_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'] . ' disabled /></div></div>';
|
367 |
+
break;
|
368 |
+
}
|
369 |
+
case 'type_text': {
|
370 |
+
$params_names = array(
|
371 |
+
'w_field_label_size',
|
372 |
+
'w_field_label_pos',
|
373 |
+
'w_size',
|
374 |
+
'w_first_val',
|
375 |
+
'w_title',
|
376 |
+
'w_required',
|
377 |
+
'w_unique',
|
378 |
+
);
|
379 |
+
$temp = $params;
|
380 |
+
if ( strpos($temp, 'w_regExp_status') > -1 ) {
|
381 |
+
$params_names = array(
|
382 |
+
'w_field_label_size',
|
383 |
+
'w_field_label_pos',
|
384 |
+
'w_size',
|
385 |
+
'w_first_val',
|
386 |
+
'w_title',
|
387 |
+
'w_required',
|
388 |
+
'w_regExp_status',
|
389 |
+
'w_regExp_value',
|
390 |
+
'w_regExp_common',
|
391 |
+
'w_regExp_arg',
|
392 |
+
'w_regExp_alert',
|
393 |
+
'w_unique',
|
394 |
+
);
|
395 |
+
}
|
396 |
+
if ( strpos($temp, 'w_readonly') > -1 ) {
|
397 |
+
$params_names = array(
|
398 |
+
'w_field_label_size',
|
399 |
+
'w_field_label_pos',
|
400 |
+
'w_size',
|
401 |
+
'w_first_val',
|
402 |
+
'w_title',
|
403 |
+
'w_required',
|
404 |
+
'w_regExp_status',
|
405 |
+
'w_regExp_value',
|
406 |
+
'w_regExp_common',
|
407 |
+
'w_regExp_arg',
|
408 |
+
'w_regExp_alert',
|
409 |
+
'w_unique',
|
410 |
+
'w_readonly',
|
411 |
+
);
|
412 |
+
}
|
413 |
+
if ( strpos($temp, 'w_hide_label') > -1 ) {
|
414 |
+
$params_names = array(
|
415 |
+
'w_field_label_size',
|
416 |
+
'w_field_label_pos',
|
417 |
+
'w_hide_label',
|
418 |
+
'w_size',
|
419 |
+
'w_first_val',
|
420 |
+
'w_title',
|
421 |
+
'w_required',
|
422 |
+
'w_regExp_status',
|
423 |
+
'w_regExp_value',
|
424 |
+
'w_regExp_common',
|
425 |
+
'w_regExp_arg',
|
426 |
+
'w_regExp_alert',
|
427 |
+
'w_unique',
|
428 |
+
'w_readonly',
|
429 |
+
);
|
430 |
+
}
|
431 |
+
foreach ( $params_names as $params_name ) {
|
432 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
433 |
+
$param[$params_name] = $temp[0];
|
434 |
+
$temp = $temp[1];
|
435 |
+
}
|
436 |
+
if ( $temp ) {
|
437 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
438 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
439 |
+
foreach ( $attrs as $attr ) {
|
440 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
441 |
+
}
|
442 |
+
}
|
443 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
444 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
445 |
+
$param['w_regExp_status'] = (isset($param['w_regExp_status']) ? $param['w_regExp_status'] : "no");
|
446 |
+
$param['w_regExp_value'] = (isset($param['w_regExp_value']) ? $param['w_regExp_value'] : "");
|
447 |
+
$param['w_regExp_common'] = (isset($param['w_regExp_common']) ? $param['w_regExp_common'] : "");
|
448 |
+
$param['w_regExp_arg'] = (isset($param['w_regExp_arg']) ? $param['w_regExp_arg'] : "");
|
449 |
+
$param['w_regExp_alert'] = (isset($param['w_regExp_alert']) ? $param['w_regExp_alert'] : "Incorrect Value");
|
450 |
+
$param['w_readonly'] = (isset($param['w_readonly']) ? $param['w_readonly'] : "no");
|
451 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
452 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
453 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_text" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" style="display: ' . $param['w_field_label_pos'] . '"><input type="hidden" value="type_text" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp" /><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp" /><input type="hidden" value="' . $param['w_readonly'] . '" name="' . $id . '_readonlyform_id_temp" id="' . $id . '_readonlyform_id_temp"/><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_regExp_status'] . '" name="' . $id . '_regExpStatusform_id_temp" id="' . $id . '_regExpStatusform_id_temp"><input type="hidden" value="' . $param['w_regExp_value'] . '" name="' . $id . '_regExp_valueform_id_temp" id="' . $id . '_regExp_valueform_id_temp"><input type="hidden" value="' . $param['w_regExp_common'] . '" name="' . $id . '_regExp_commonform_id_temp" id="' . $id . '_regExp_commonform_id_temp"><input type="hidden" value="' . $param['w_regExp_alert'] . '" name="' . $id . '_regExp_alertform_id_temp" id="' . $id . '_regExp_alertform_id_temp"><input type="hidden" value="' . $param['w_regExp_arg'] . '" name="' . $id . '_regArgumentform_id_temp" id="' . $id . '_regArgumentform_id_temp"><input type="hidden" value="' . $param['w_unique'] . '" name="' . $id . '_uniqueform_id_temp" id="' . $id . '_uniqueform_id_temp" /><input type="text" id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" value="' . $param['w_first_val'] . '" title="' . $param['w_title'] . '" placeholder="' . $param['w_title'] . '" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled /></div></div>';
|
454 |
+
break;
|
455 |
+
}
|
456 |
+
case 'type_number': {
|
457 |
+
$params_names = array(
|
458 |
+
'w_field_label_size',
|
459 |
+
'w_field_label_pos',
|
460 |
+
'w_size',
|
461 |
+
'w_first_val',
|
462 |
+
'w_title',
|
463 |
+
'w_required',
|
464 |
+
'w_unique',
|
465 |
+
'w_class',
|
466 |
+
);
|
467 |
+
$temp = $params;
|
468 |
+
foreach ( $params_names as $params_name ) {
|
469 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
470 |
+
$param[$params_name] = $temp[0];
|
471 |
+
$temp = $temp[1];
|
472 |
+
}
|
473 |
+
if ( $temp ) {
|
474 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
475 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
476 |
+
foreach ( $attrs as $attr ) {
|
477 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
478 |
+
}
|
479 |
+
}
|
480 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
481 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
482 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_number" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '"><input type="hidden" value="type_number" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_unique'] . '" name="' . $id . '_uniqueform_id_temp" id="' . $id . '_uniqueform_id_temp"><input type="text" id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" value="' . $param['w_first_val'] . '" title="' . $param['w_title'] . '" onkeypress="return check_isnum(event)" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled /></div></div>';
|
483 |
+
break;
|
484 |
+
}
|
485 |
+
case 'type_password': {
|
486 |
+
$params_names = array(
|
487 |
+
'w_field_label_size',
|
488 |
+
'w_field_label_pos',
|
489 |
+
'w_size',
|
490 |
+
'w_required',
|
491 |
+
'w_unique',
|
492 |
+
'w_class',
|
493 |
+
);
|
494 |
+
$temp = $params;
|
495 |
+
if ( strpos($temp, 'w_hide_label') > -1 ) {
|
496 |
+
$params_names = array(
|
497 |
+
'w_field_label_size',
|
498 |
+
'w_field_label_pos',
|
499 |
+
'w_hide_label',
|
500 |
+
'w_size',
|
501 |
+
'w_required',
|
502 |
+
'w_unique',
|
503 |
+
'w_class',
|
504 |
+
);
|
505 |
+
}
|
506 |
+
if ( strpos($temp, 'w_verification') > -1 ) {
|
507 |
+
$params_names = array(
|
508 |
+
'w_field_label_size',
|
509 |
+
'w_field_label_pos',
|
510 |
+
'w_hide_label',
|
511 |
+
'w_size',
|
512 |
+
'w_required',
|
513 |
+
'w_unique',
|
514 |
+
'w_class',
|
515 |
+
'w_verification',
|
516 |
+
'w_verification_label',
|
517 |
+
);
|
518 |
+
}
|
519 |
+
if ( strpos($temp, 'w_placeholder') > -1 ) {
|
520 |
+
$params_names = array(
|
521 |
+
'w_field_label_size',
|
522 |
+
'w_field_label_pos',
|
523 |
+
'w_hide_label',
|
524 |
+
'w_size',
|
525 |
+
'w_required',
|
526 |
+
'w_unique',
|
527 |
+
'w_class',
|
528 |
+
'w_verification',
|
529 |
+
'w_verification_label',
|
530 |
+
'w_placeholder',
|
531 |
+
);
|
532 |
+
}
|
533 |
+
foreach ( $params_names as $params_name ) {
|
534 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
535 |
+
$param[$params_name] = $temp[0];
|
536 |
+
$temp = $temp[1];
|
537 |
+
}
|
538 |
+
if ( $temp ) {
|
539 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
540 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
541 |
+
foreach ( $attrs as $attr ) {
|
542 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
543 |
+
}
|
544 |
+
}
|
545 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
546 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
547 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
548 |
+
if ( isset($param['w_verification']) && $param['w_verification'] == "yes" ) {
|
549 |
+
$display_label_confirm = $display_label;
|
550 |
+
$display_element_confirm = $param['w_field_label_pos'];
|
551 |
+
}
|
552 |
+
else {
|
553 |
+
$display_label_confirm = "none";
|
554 |
+
$display_element_confirm = "none";
|
555 |
+
}
|
556 |
+
$param['w_verification'] = isset($param['w_verification']) ? $param['w_verification'] : "no";
|
557 |
+
$param['w_verification_label'] = isset($param['w_verification_label']) ? $param['w_verification_label'] : "Password confirmation:";
|
558 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
559 |
+
$confirm_password = '<br><div align="left" id="' . $id . '_1_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label_confirm . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_1_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $param['w_verification_label'] . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_1_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_element_confirm . ';"><input type="hidden" value="' . $param['w_verification'] . '" name="' . $id . '_verification_id_temp" id="' . $id . '_verification_id_temp"><input type="text" id="' . $id . '_1_elementform_id_temp" name="' . $id . '_1_elementform_id_temp" placeholder="' . $param['w_placeholder'] . '" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled /></div>';
|
560 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_password" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '"><input type="hidden" value="type_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_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_unique'] . '" name="' . $id . '_uniqueform_id_temp" id="' . $id . '_uniqueform_id_temp"><input type="password" id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" placeholder="' . $param['w_placeholder'] . '" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled /></div>' . $confirm_password . '</div>';
|
561 |
+
break;
|
562 |
+
}
|
563 |
+
case 'type_textarea': {
|
564 |
+
$params_names = array(
|
565 |
+
'w_field_label_size',
|
566 |
+
'w_field_label_pos',
|
567 |
+
'w_size_w',
|
568 |
+
'w_size_h',
|
569 |
+
'w_first_val',
|
570 |
+
'w_title',
|
571 |
+
'w_required',
|
572 |
+
'w_unique',
|
573 |
+
'w_class',
|
574 |
+
);
|
575 |
+
$temp = $params;
|
576 |
+
if ( strpos($temp, 'w_hide_label') > -1 ) {
|
577 |
+
$params_names = array(
|
578 |
+
'w_field_label_size',
|
579 |
+
'w_field_label_pos',
|
580 |
+
'w_hide_label',
|
581 |
+
'w_size_w',
|
582 |
+
'w_size_h',
|
583 |
+
'w_first_val',
|
584 |
+
'w_title',
|
585 |
+
'w_required',
|
586 |
+
'w_unique',
|
587 |
+
'w_class',
|
588 |
+
);
|
589 |
+
}
|
590 |
+
foreach ( $params_names as $params_name ) {
|
591 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
592 |
+
$param[$params_name] = $temp[0];
|
593 |
+
$temp = $temp[1];
|
594 |
+
}
|
595 |
+
if ( $temp ) {
|
596 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
597 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
598 |
+
foreach ( $attrs as $attr ) {
|
599 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
600 |
+
}
|
601 |
+
}
|
602 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
603 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
604 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
605 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
606 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_textarea" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '"><input type="hidden" value="type_textarea" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_unique'] . '" name="' . $id . '_uniqueform_id_temp" id="' . $id . '_uniqueform_id_temp"><textarea id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" title="' . $param['w_title'] . '" placeholder="' . $param['w_title'] . '" style="width: ' . $param['w_size_w'] . 'px; height: ' . $param['w_size_h'] . 'px;" ' . $param['attributes'] . ' disabled>' . $param['w_first_val'] . '</textarea></div></div>';
|
607 |
+
break;
|
608 |
+
}
|
609 |
+
case 'type_phone': {
|
610 |
+
$params_names = array(
|
611 |
+
'w_field_label_size',
|
612 |
+
'w_field_label_pos',
|
613 |
+
'w_size',
|
614 |
+
'w_first_val',
|
615 |
+
'w_title',
|
616 |
+
'w_mini_labels',
|
617 |
+
'w_required',
|
618 |
+
'w_unique',
|
619 |
+
'w_class',
|
620 |
+
);
|
621 |
+
$temp = $params;
|
622 |
+
if ( strpos($temp, 'w_hide_label') > -1 ) {
|
623 |
+
$params_names = array(
|
624 |
+
'w_field_label_size',
|
625 |
+
'w_field_label_pos',
|
626 |
+
'w_hide_label',
|
627 |
+
'w_size',
|
628 |
+
'w_first_val',
|
629 |
+
'w_title',
|
630 |
+
'w_mini_labels',
|
631 |
+
'w_required',
|
632 |
+
'w_unique',
|
633 |
+
'w_class',
|
634 |
+
);
|
635 |
+
}
|
636 |
+
foreach ( $params_names as $params_name ) {
|
637 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
638 |
+
$param[$params_name] = $temp[0];
|
639 |
+
$temp = $temp[1];
|
640 |
+
}
|
641 |
+
if ( $temp ) {
|
642 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
643 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
644 |
+
foreach ( $attrs as $attr ) {
|
645 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
646 |
+
}
|
647 |
+
}
|
648 |
+
$w_first_val = explode('***', $param['w_first_val']);
|
649 |
+
$w_title = explode('***', $param['w_title']);
|
650 |
+
$w_mini_labels = explode('***', $param['w_mini_labels']);
|
651 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
652 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
653 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
654 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
655 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_phone" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_phone" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_unique'] . '" name="' . $id . '_uniqueform_id_temp" id="' . $id . '_uniqueform_id_temp"><div id="' . $id . '_table_name" style="display: table;"><div id="' . $id . '_tr_name1" style="display: table-row;"><div id="' . $id . '_td_name_input_first" style="display: table-cell;"><input type="text" id="' . $id . '_element_firstform_id_temp" name="' . $id . '_element_firstform_id_temp" value="' . $w_first_val[0] . '" title="' . $w_title[0] . '" placeholder="' . $w_title[0] . '" onkeypress="return check_isnum(event)"style="width: 50px;" ' . $param['attributes'] . ' disabled /><span class="wdform_line" style="margin: 0px 4px; padding: 0px;">-</span></div><div id="' . $id . '_td_name_input_last" style="display: table-cell;"><input type="text" id="' . $id . '_element_lastform_id_temp" name="' . $id . '_element_lastform_id_temp" value="' . $w_first_val[1] . '" title="' . $w_title[1] . '" placeholder="' . $w_title[1] . '" onkeypress="return check_isnum(event)"style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled /></div></div><div id="' . $id . '_tr_name2" style="display: table-row;"><div id="' . $id . '_td_name_label_first" align="left" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_area_code">' . $w_mini_labels[0] . '</label></div><div id="' . $id . '_td_name_label_last" align="left" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_phone_number">' . $w_mini_labels[1] . '</label></div></div></div></div></div>';
|
656 |
+
break;
|
657 |
+
}
|
658 |
+
case 'type_phone_new': {
|
659 |
+
$temp = $params;
|
660 |
+
$params_names = array(
|
661 |
+
'w_field_label_size',
|
662 |
+
'w_field_label_pos',
|
663 |
+
'w_hide_label',
|
664 |
+
'w_size',
|
665 |
+
'w_first_val',
|
666 |
+
'w_top_country',
|
667 |
+
'w_required',
|
668 |
+
'w_unique',
|
669 |
+
'w_class',
|
670 |
+
);
|
671 |
+
foreach ( $params_names as $params_name ) {
|
672 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
673 |
+
$param[$params_name] = $temp[0];
|
674 |
+
$temp = $temp[1];
|
675 |
+
}
|
676 |
+
if ( $temp ) {
|
677 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
678 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
679 |
+
foreach ( $attrs as $attr ) {
|
680 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
681 |
+
}
|
682 |
+
}
|
683 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
684 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
685 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
686 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
687 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_phone_new" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_phone_new" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"><input type="hidden" value="' . $param['w_unique'] . '" name="' . $id . '_uniqueform_id_temp" id="' . $id . '_uniqueform_id_temp"><div id="' . $id . '_table_name" style="display: table;"><div id="' . $id . '_tr_name1" style="display: table-row;"><div id="' . $id . '_td_name_input_first" style="display: table-cell;"><input type="text" id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" value="' . $param['w_first_val'] . '" top-country = "' . $param['w_top_country'] . '" onkeypress="return check_isnum("' . $id . '_elementform_id_temp")" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled></div></div></div></div></div>';
|
688 |
+
break;
|
689 |
+
}
|
690 |
+
case 'type_name': {
|
691 |
+
$params_names = array(
|
692 |
+
'w_field_label_size',
|
693 |
+
'w_field_label_pos',
|
694 |
+
'w_first_val',
|
695 |
+
'w_title',
|
696 |
+
'w_mini_labels',
|
697 |
+
'w_size',
|
698 |
+
'w_name_format',
|
699 |
+
'w_required',
|
700 |
+
'w_unique',
|
701 |
+
'w_class',
|
702 |
+
);
|
703 |
+
$temp = $params;
|
704 |
+
if ( strpos($temp, 'w_name_fields') > -1 ) {
|
705 |
+
$params_names = array(
|
706 |
+
'w_field_label_size',
|
707 |
+
'w_field_label_pos',
|
708 |
+
'w_first_val',
|
709 |
+
'w_title',
|
710 |
+
'w_mini_labels',
|
711 |
+
'w_size',
|
712 |
+
'w_name_format',
|
713 |
+
'w_required',
|
714 |
+
'w_unique',
|
715 |
+
'w_class',
|
716 |
+
'w_name_fields',
|
717 |
+
);
|
718 |
+
}
|
719 |
+
if ( strpos($temp, 'w_autofill') > -1 ) {
|
720 |
+
$params_names = array(
|
721 |
+
'w_field_label_size',
|
722 |
+
'w_field_label_pos',
|
723 |
+
'w_first_val',
|
724 |
+
'w_title',
|
725 |
+
'w_mini_labels',
|
726 |
+
'w_size',
|
727 |
+
'w_name_format',
|
728 |
+
'w_required',
|
729 |
+
'w_unique',
|
730 |
+
'w_class',
|
731 |
+
'w_name_fields',
|
732 |
+
'w_autofill',
|
733 |
+
);
|
734 |
+
}
|
735 |
+
if ( strpos($temp, 'w_hide_label') > -1 ) {
|
736 |
+
$params_names = array(
|
737 |
+
'w_field_label_size',
|
738 |
+
'w_field_label_pos',
|
739 |
+
'w_hide_label',
|
740 |
+
'w_first_val',
|
741 |
+
'w_title',
|
742 |
+
'w_mini_labels',
|
743 |
+
'w_size',
|
744 |
+
'w_name_format',
|
745 |
+
'w_required',
|
746 |
+
'w_unique',
|
747 |
+
'w_class',
|
748 |
+
'w_name_fields',
|
749 |
+
'w_autofill',
|
750 |
+
);
|
751 |
+
}
|
752 |
+
foreach ( $params_names as $params_name ) {
|
753 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
754 |
+
$param[$params_name] = $temp[0];
|
755 |
+
$temp = $temp[1];
|
756 |
+
}
|
757 |
+
if ( $temp ) {
|
758 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
759 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
760 |
+
foreach ( $attrs as $attr ) {
|
761 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
762 |
+
}
|
763 |
+
}
|
764 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
765 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
766 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
767 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
768 |
+
$w_first_val = explode('***', $param['w_first_val']);
|
769 |
+
$w_title = explode('***', $param['w_title']);
|
770 |
+
$w_mini_labels = explode('***', $param['w_mini_labels']);
|
771 |
+
$param['w_name_fields'] = isset($param['w_name_fields']) ? $param['w_name_fields'] : ($param['w_name_format'] == 'normal' ? 'no***no' : 'yes***yes');
|
772 |
+
$w_name_fields = explode('***', $param['w_name_fields']);
|
773 |
+
$param['w_autofill'] = isset($param['w_autofill']) ? $param['w_autofill'] : 'no';
|
774 |
+
$w_name_format = '<div id="' . $id . '_td_name_input_first" style="display: table-cell;"><input type="text" id="' . $id . '_element_firstform_id_temp" name="' . $id . '_element_firstform_id_temp" value="' . $w_first_val[0] . '" title="' . $w_title[0] . '" placeholder="' . $w_title[0] . '" style="margin-right: 10px; width: ' . $param['w_size'] . 'px;"' . $param['attributes'] . ' disabled /></div><div id="' . $id . '_td_name_input_last" style="display: table-cell;"><input type="text" id="' . $id . '_element_lastform_id_temp" name="' . $id . '_element_lastform_id_temp" value="' . $w_first_val[1] . '" title="' . $w_title[1] . '" placeholder="' . $w_title[1] . '" style="margin-right: 10px; width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled /></div>';
|
775 |
+
$w_name_format_mini_labels = '<div id="' . $id . '_td_name_label_first" align="left" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_first">' . $w_mini_labels[1] . '</label></div><div id="' . $id . '_td_name_label_last" align="left" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_last">' . $w_mini_labels[2] . '</label></div>';
|
776 |
+
if ( $w_name_fields[0] == 'yes' ) {
|
777 |
+
$w_name_format = '<div id="' . $id . '_td_name_input_title" style="display: table-cell;"><input type="text" id="' . $id . '_element_titleform_id_temp" name="' . $id . '_element_titleform_id_temp" value="' . $w_first_val[2] . '" title="' . $w_title[2] . '" style="margin: 0px 10px 0px 0px; width: 40px;" disabled /></div>' . $w_name_format;
|
778 |
+
$w_name_format_mini_labels = '<div id="' . $id . '_td_name_label_title" align="left" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_title">' . $w_mini_labels[0] . '</label></div>' . $w_name_format_mini_labels;
|
779 |
+
}
|
780 |
+
if ( $w_name_fields[1] == 'yes' ) {
|
781 |
+
$w_name_format = $w_name_format . '<div id="' . $id . '_td_name_input_middle" style="display: table-cell;"><input type="text" id="' . $id . '_element_middleform_id_temp" name="' . $id . '_element_middleform_id_temp" value="' . $w_first_val[3] . '" title="' . $w_title[3] . '" style="width: ' . $param['w_size'] . 'px;" disabled /></div>';
|
782 |
+
$w_name_format_mini_labels = $w_name_format_mini_labels . '<div id="' . $id . '_td_name_label_middle" align="left" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_middle">' . $w_mini_labels[3] . '</label></div>';
|
783 |
+
}
|
784 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_name" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_name" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_unique'] . '" name="' . $id . '_uniqueform_id_temp" id="' . $id . '_uniqueform_id_temp"><input type="hidden" value="' . $param['w_autofill'] . '" name="' . $id . '_autofillform_id_temp" id="' . $id . '_autofillform_id_temp"><input type="hidden" name="' . $id . '_enable_fieldsform_id_temp" id="' . $id . '_enable_fieldsform_id_temp" title="' . $w_name_fields[0] . '" first="yes" last="yes" middle="' . $w_name_fields[1] . '"><div id="' . $id . '_table_name" cellpadding="0" cellspacing="0" style="display: table;"><div id="' . $id . '_tr_name1" style="display: table-row;">' . $w_name_format . '</div><div id="' . $id . '_tr_name2" style="display: table-row;">' . $w_name_format_mini_labels . '</div></div></div></div>';
|
785 |
+
break;
|
786 |
+
}
|
787 |
+
case 'type_address': {
|
788 |
+
$params_names = array(
|
789 |
+
'w_field_label_size',
|
790 |
+
'w_field_label_pos',
|
791 |
+
'w_size',
|
792 |
+
'w_mini_labels',
|
793 |
+
'w_disabled_fields',
|
794 |
+
'w_required',
|
795 |
+
'w_class',
|
796 |
+
);
|
797 |
+
$temp = $params;
|
798 |
+
if ( strpos($temp, 'w_hide_label') > -1 ) {
|
799 |
+
$params_names = array(
|
800 |
+
'w_field_label_size',
|
801 |
+
'w_field_label_pos',
|
802 |
+
'w_hide_label',
|
803 |
+
'w_size',
|
804 |
+
'w_mini_labels',
|
805 |
+
'w_disabled_fields',
|
806 |
+
'w_required',
|
807 |
+
'w_class',
|
808 |
+
);
|
809 |
+
}
|
810 |
+
foreach ( $params_names as $params_name ) {
|
811 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
812 |
+
$param[$params_name] = $temp[0];
|
813 |
+
$temp = $temp[1];
|
814 |
+
}
|
815 |
+
if ( $temp ) {
|
816 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
817 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
818 |
+
foreach ( $attrs as $attr ) {
|
819 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
820 |
+
}
|
821 |
+
}
|
822 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
823 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
824 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
825 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
826 |
+
$w_mini_labels = explode('***', $param['w_mini_labels']);
|
827 |
+
$w_disabled_fields = explode('***', $param['w_disabled_fields']);
|
828 |
+
$hidden_inputs = '';
|
829 |
+
$labels_for_id = array( 'street1', 'street2', 'city', 'state', 'postal', 'country' );
|
830 |
+
foreach ( $w_disabled_fields as $key => $w_disabled_field ) {
|
831 |
+
if ( $key != 6 ) {
|
832 |
+
if ( $w_disabled_field == 'yes' ) {
|
833 |
+
$hidden_inputs .= '<input type="hidden" id="' . $id . '_' . $labels_for_id[$key] . 'form_id_temp" value="' . $w_mini_labels[$key] . '" id_for_label="' . ($id + $key) . '">';
|
834 |
+
}
|
835 |
+
}
|
836 |
+
}
|
837 |
+
$address_fields = '';
|
838 |
+
$g = 0;
|
839 |
+
if ( $w_disabled_fields[0] == 'no' ) {
|
840 |
+
$g += 2;
|
841 |
+
$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" style="width: 100%;" ' . $param['attributes'] . ' disabled /><label class="mini_label" id="' . $id . '_mini_label_street1" style="display: block;">' . $w_mini_labels[0] . '</label></span>';
|
842 |
+
}
|
843 |
+
if ( $w_disabled_fields[1] == 'no' ) {
|
844 |
+
$g += 2;
|
845 |
+
$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" style="width: 100%;" ' . $param['attributes'] . ' disabled /><label class="mini_label" style="display: block;" id="' . $id . '_mini_label_street2">' . $w_mini_labels[1] . '</label></span>';
|
846 |
+
}
|
847 |
+
if ( $w_disabled_fields[2] == 'no' ) {
|
848 |
+
$g++;
|
849 |
+
$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" style="width: 100%;" ' . $param['attributes'] . ' disabled /><label class="mini_label" style="display: block;" id="' . $id . '_mini_label_city">' . $w_mini_labels[2] . '</label></span>';
|
850 |
+
}
|
851 |
+
if ( $w_disabled_fields[3] == 'no' ) {
|
852 |
+
$g++;
|
853 |
+
if ( $w_disabled_fields[5] == 'yes' && $w_disabled_fields[6] == 'yes' ) {
|
854 |
+
$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" style="width: 100%;" ' . $param['attributes'] . ' disabled >';
|
855 |
+
$states = WDW_FM_Library::get_states();
|
856 |
+
foreach ($states as $st => $state) {
|
857 |
+
$address_fields .= '<option value="' . $st . '">' . $state . '</option>';
|
858 |
+
}
|
859 |
+
$address_fields .= '</select><label class="mini_label" style="display: block;" id="' . $id . '_mini_label_state">' . $w_mini_labels[3] . '</label></span>';
|
860 |
+
}
|
861 |
+
else {
|
862 |
+
$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" style="width: 100%;" ' . $param['attributes'] . ' disabled><label class="mini_label" style="display: block;" id="' . $id . '_mini_label_state">' . $w_mini_labels[3] . '</label></span>';
|
863 |
+
}
|
864 |
+
}
|
865 |
+
if ( $w_disabled_fields[4] == 'no' ) {
|
866 |
+
$g++;
|
867 |
+
$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" style="width: 100%;" ' . $param['attributes'] . ' disabled><label class="mini_label" style="display: block;" id="' . $id . '_mini_label_postal">' . $w_mini_labels[4] . '</label></span>';
|
868 |
+
}
|
869 |
+
if ( $w_disabled_fields[5] == 'no' ) {
|
870 |
+
$g++;
|
871 |
+
$countries_list = WDW_FMC_Library::get_countries();
|
872 |
+
$address_fields .= '<span style="float: ' . (($g % 2 == 0) ? 'right' : 'left') . '; width: 48%; padding-bottom: 8px;">
|
873 |
+
<select type="text" id="' . $id . '_countryform_id_temp" name="' . ($id + 5) . '_countryform_id_temp" style="width: 100%;" ' . $param['attributes'] . ' disabled>';
|
874 |
+
foreach ($countries_list as $value => $item) {
|
875 |
+
$address_fields .= '<option value="' . $value . '">' . $item . '</option>';
|
876 |
+
}
|
877 |
+
$address_fields .= '</select><label class="mini_label" style="display: block;" id="' . $id . '_mini_label_country">' . $w_mini_labels[5] . '</span>';
|
878 |
+
}
|
879 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_address" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px; vertical-align:top;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_address" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" name="' . $id . '_disable_fieldsform_id_temp" id="' . $id . '_disable_fieldsform_id_temp" street1="' . $w_disabled_fields[0] . '" street2="' . $w_disabled_fields[1] . '" city="' . $w_disabled_fields[2] . '" state="' . $w_disabled_fields[3] . '" postal="' . $w_disabled_fields[4] . '" country="' . $w_disabled_fields[5] . '" us_states="' . $w_disabled_fields[6] . '"><div id="' . $id . '_div_address" style="width: ' . $param['w_size'] . 'px;">' . $address_fields . $hidden_inputs . '</div></div></div>';
|
880 |
+
break;
|
881 |
+
}
|
882 |
+
case 'type_submitter_mail': {
|
883 |
+
$params_names = array(
|
884 |
+
'w_field_label_size',
|
885 |
+
'w_field_label_pos',
|
886 |
+
'w_size',
|
887 |
+
'w_first_val',
|
888 |
+
'w_title',
|
889 |
+
'w_required',
|
890 |
+
'w_unique',
|
891 |
+
'w_class',
|
892 |
+
);
|
893 |
+
$temp = $params;
|
894 |
+
if ( strpos($temp, 'w_autofill') > -1 ) {
|
895 |
+
$params_names = array(
|
896 |
+
'w_field_label_size',
|
897 |
+
'w_field_label_pos',
|
898 |
+
'w_size',
|
899 |
+
'w_first_val',
|
900 |
+
'w_title',
|
901 |
+
'w_required',
|
902 |
+
'w_unique',
|
903 |
+
'w_class',
|
904 |
+
'w_autofill',
|
905 |
+
);
|
906 |
+
}
|
907 |
+
if ( strpos($temp, 'w_hide_label') > -1 ) {
|
908 |
+
$params_names = array(
|
909 |
+
'w_field_label_size',
|
910 |
+
'w_field_label_pos',
|
911 |
+
'w_hide_label',
|
912 |
+
'w_size',
|
913 |
+
'w_first_val',
|
914 |
+
'w_title',
|
915 |
+
'w_required',
|
916 |
+
'w_unique',
|
917 |
+
'w_class',
|
918 |
+
'w_autofill',
|
919 |
+
);
|
920 |
+
}
|
921 |
+
if ( strpos($temp, 'w_verification') > -1 ) {
|
922 |
+
$params_names = array(
|
923 |
+
'w_field_label_size',
|
924 |
+
'w_field_label_pos',
|
925 |
+
'w_hide_label',
|
926 |
+
'w_size',
|
927 |
+
'w_first_val',
|
928 |
+
'w_title',
|
929 |
+
'w_required',
|
930 |
+
'w_unique',
|
931 |
+
'w_class',
|
932 |
+
'w_verification',
|
933 |
+
'w_verification_label',
|
934 |
+
'w_verification_placeholder',
|
935 |
+
'w_autofill',
|
936 |
+
);
|
937 |
+
}
|
938 |
+
foreach ( $params_names as $params_name ) {
|
939 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
940 |
+
$param[$params_name] = $temp[0];
|
941 |
+
$temp = $temp[1];
|
942 |
+
}
|
943 |
+
if ( $temp ) {
|
944 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
945 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
946 |
+
foreach ( $attrs as $attr ) {
|
947 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
948 |
+
}
|
949 |
+
}
|
950 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
951 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
952 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
953 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
954 |
+
$param['w_autofill'] = isset($param['w_autofill']) ? $param['w_autofill'] : 'no';
|
955 |
+
if ( isset($param['w_verification']) && $param['w_verification'] == "yes" ) {
|
956 |
+
$display_label_confirm = $display_label;
|
957 |
+
$display_element_confirm = $param['w_field_label_pos'];
|
958 |
+
}
|
959 |
+
else {
|
960 |
+
$display_label_confirm = "none";
|
961 |
+
$display_element_confirm = "none";
|
962 |
+
}
|
963 |
+
$param['w_verification'] = isset($param['w_verification']) ? $param['w_verification'] : "no";
|
964 |
+
$param['w_verification_label'] = isset($param['w_verification_label']) ? $param['w_verification_label'] : "E-mail confirmation:";
|
965 |
+
$param['w_verification_placeholder'] = isset($param['w_verification_placeholder']) ? $param['w_verification_placeholder'] : "";
|
966 |
+
$confirm_emeil = '<br><div align="left" id="' . $id . '_1_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label_confirm . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_1_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $param['w_verification_label'] . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_1_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_element_confirm . ';"><input type="hidden" value="' . $param['w_verification'] . '" name="' . $id . '_verification_id_temp" id="' . $id . '_verification_id_temp"><input type="text" id="' . $id . '_1_elementform_id_temp" name="' . $id . '_1_elementform_id_temp" value="' . $param['w_verification_placeholder'] . '" title="' . $param['w_verification_placeholder'] . '" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled /></div>';
|
967 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_submitter_mail" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_submitter_mail" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_unique'] . '" name="' . $id . '_uniqueform_id_temp" id="' . $id . '_uniqueform_id_temp"><input type="hidden" value="' . $param['w_autofill'] . '" name="' . $id . '_autofillform_id_temp" id="' . $id . '_autofillform_id_temp"><input type="hidden" value="' . $param['w_verification'] . '" name="' . $id . '_verification_id_temp" id="' . $id . '_verification_id_temp"><input type="text" id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" value="' . $param['w_first_val'] . '" title="' . $param['w_title'] . '" placeholder="' . $param['w_title'] . '" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled /></div>' . $confirm_emeil . '</div>';
|
968 |
+
break;
|
969 |
+
}
|
970 |
+
case 'type_checkbox': {
|
971 |
+
$params_names = array(
|
972 |
+
'w_field_label_size',
|
973 |
+
'w_field_label_pos',
|
974 |
+
'w_flow',
|
975 |
+
'w_choices',
|
976 |
+
'w_choices_checked',
|
977 |
+
'w_rowcol',
|
978 |
+
'w_required',
|
979 |
+
'w_randomize',
|
980 |
+
'w_allow_other',
|
981 |
+
'w_allow_other_num',
|
982 |
+
'w_class',
|
983 |
+
);
|
984 |
+
$temp = $params;
|
985 |
+
if ( strpos($temp, 'w_field_option_pos') > -1 ) {
|
986 |
+
$params_names = array(
|
987 |
+
'w_field_label_size',
|
988 |
+
'w_field_label_pos',
|
989 |
+
'w_field_option_pos',
|
990 |
+
'w_flow',
|
991 |
+
'w_choices',
|
992 |
+
'w_choices_checked',
|
993 |
+
'w_rowcol',
|
994 |
+
'w_required',
|
995 |
+
'w_randomize',
|
996 |
+
'w_allow_other',
|
997 |
+
'w_allow_other_num',
|
998 |
+
'w_value_disabled',
|
999 |
+
'w_choices_value',
|
1000 |
+
'w_choices_params',
|
1001 |
+
'w_class',
|
1002 |
+
);
|
1003 |
+
}
|
1004 |
+
if ( strpos($temp, 'w_hide_label') > -1 ) {
|
1005 |
+
$params_names = array(
|
1006 |
+
'w_field_label_size',
|
1007 |
+
'w_field_label_pos',
|
1008 |
+
'w_field_option_pos',
|
1009 |
+
'w_hide_label',
|
1010 |
+
'w_flow',
|
1011 |
+
'w_choices',
|
1012 |
+
'w_choices_checked',
|
1013 |
+
'w_rowcol',
|
1014 |
+
'w_required',
|
1015 |
+
'w_randomize',
|
1016 |
+
'w_allow_other',
|
1017 |
+
'w_allow_other_num',
|
1018 |
+
'w_value_disabled',
|
1019 |
+
'w_choices_value',
|
1020 |
+
'w_choices_params',
|
1021 |
+
'w_class',
|
1022 |
+
);
|
1023 |
+
}
|
1024 |
+
foreach ( $params_names as $params_name ) {
|
1025 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
1026 |
+
$param[$params_name] = $temp[0];
|
1027 |
+
$temp = $temp[1];
|
1028 |
+
}
|
1029 |
+
if ( $temp ) {
|
1030 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
1031 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
1032 |
+
foreach ( $attrs as $attr ) {
|
1033 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
1034 |
+
}
|
1035 |
+
}
|
1036 |
+
if ( !isset($param['w_value_disabled']) ) {
|
1037 |
+
$param['w_value_disabled'] = 'no';
|
1038 |
+
}
|
1039 |
+
if ( !isset($param['w_field_option_pos']) ) {
|
1040 |
+
$param['w_field_option_pos'] = 'left';
|
1041 |
+
}
|
1042 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
1043 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
1044 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
1045 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
1046 |
+
$param['w_choices'] = explode('***', $param['w_choices']);
|
1047 |
+
$param['w_choices_checked'] = explode('***', $param['w_choices_checked']);
|
1048 |
+
if ( isset($param['w_choices_value']) ) {
|
1049 |
+
$param['w_choices_value'] = explode('***', $param['w_choices_value']);
|
1050 |
+
$param['w_choices_params'] = explode('***', $param['w_choices_params']);
|
1051 |
+
}
|
1052 |
+
foreach ( $param['w_choices_checked'] as $key => $choices_checked ) {
|
1053 |
+
if ( $choices_checked == 'true' ) {
|
1054 |
+
$param['w_choices_checked'][$key] = 'checked="checked"';
|
1055 |
+
}
|
1056 |
+
else {
|
1057 |
+
$param['w_choices_checked'][$key] = '';
|
1058 |
+
}
|
1059 |
+
}
|
1060 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_checkbox" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_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_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_randomize'] . '" name="' . $id . '_randomizeform_id_temp" id="' . $id . '_randomizeform_id_temp"><input type="hidden" value="' . $param['w_allow_other'] . '" name="' . $id . '_allow_otherform_id_temp" id="' . $id . '_allow_otherform_id_temp"><input type="hidden" value="' . $param['w_allow_other_num'] . '" name="' . $id . '_allow_other_numform_id_temp" id="' . $id . '_allow_other_numform_id_temp"><input type="hidden" value="' . $param['w_rowcol'] . '" name="' . $id . '_rowcol_numform_id_temp" id="' . $id . '_rowcol_numform_id_temp"><input type="hidden" value="' . $param['w_field_option_pos'] . '" id="' . $id . '_option_left_right"><input type="hidden" value="' . $param['w_value_disabled'] . '" name="' . $id . '_value_disabledform_id_temp" id="' . $id . '_value_disabledform_id_temp"><div style="display: table;"><div id="' . $id . '_table_little" style="display: table-row-group;" ' . ($param['w_flow'] == 'hor' ? 'for_hor="' . $id . '_hor"' : '') . '>';
|
1061 |
+
if ( $param['w_flow'] == 'hor' ) {
|
1062 |
+
$j = 0;
|
1063 |
+
for ( $i = 0; $i < (int) $param['w_rowcol']; $i++ ) {
|
1064 |
+
$rep .= '<div id="' . $id . '_element_tr' . $i . '" style="display: table-row;">';
|
1065 |
+
for ( $l = 0; $l <= (int) (count($param['w_choices']) / $param['w_rowcol']); $l++ ) {
|
1066 |
+
if ( $j >= count($param['w_choices']) % $param['w_rowcol'] && $l == (int) (count($param['w_choices']) / $param['w_rowcol']) ) {
|
1067 |
+
continue;
|
1068 |
+
}
|
1069 |
+
if ( $param['w_allow_other'] == "yes" && $param['w_allow_other_num'] == (int) $param['w_rowcol'] * $i + $l ) {
|
1070 |
+
$rep .= '<div valign="top" id="' . $id . '_td_little' . ((int) $param['w_rowcol'] * $l + $i) . '" idi="' . ((int) $param['w_rowcol'] * $l + $i) . '" style="display: table-cell;"><input type="checkbox" value="" id="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $l + $i) . '" name="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $l + $i) . '" other="1" onclick="if(set_checked("' . $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'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled /><label id="' . $id . '_label_element' . ((int) $param['w_rowcol'] * $l + $i) . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $l + $i) . '">' . $param['w_choices'][(int) $param['w_rowcol'] * $l + $i] . '</label></div>';
|
1071 |
+
}
|
1072 |
+
else {
|
1073 |
+
$where = '';
|
1074 |
+
$order_by = '';
|
1075 |
+
$db_info = '';
|
1076 |
+
if ( isset($param['w_choices_value']) ) {
|
1077 |
+
$choise_value = $param['w_choices_value'][(int) $param['w_rowcol'] * $l + $i];
|
1078 |
+
}
|
1079 |
+
else {
|
1080 |
+
$choise_value = $param['w_choices'][(int) $param['w_rowcol'] * $l + $i];
|
1081 |
+
}
|
1082 |
+
if ( isset($param['w_choices_params']) && $param['w_choices_params'][(int) $param['w_rowcol'] * $l + $i] ) {
|
1083 |
+
$w_choices_params = explode('[where_order_by]', $param['w_choices_params'][(int) $param['w_rowcol'] * $l + $i]);
|
1084 |
+
$where = 'where="' . $w_choices_params[0] . '"';
|
1085 |
+
$w_choices_params = explode('[db_info]', $w_choices_params[1]);
|
1086 |
+
$order_by = "order_by='" . $w_choices_params[0] . "'";
|
1087 |
+
$db_info = "db_info='" . $w_choices_params[1] . "'";
|
1088 |
+
}
|
1089 |
+
$rep .= '<div valign="top" id="' . $id . '_td_little' . ((int) $param['w_rowcol'] * $l + $i) . '" idi="' . ((int) $param['w_rowcol'] * $l + $i) . '" style="display: table-cell;"><input type="checkbox" value="' . $choise_value . '" id="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $l + $i) . '" name="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $l + $i) . '" onclick="set_checked("' . $id . '","' . ((int) $param['w_rowcol'] * $l + $i) . '","form_id_temp")" ' . $param['w_choices_checked'][(int) $param['w_rowcol'] * $l + $i] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . ((int) $param['w_rowcol'] * $l + $i) . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $l + $i) . '" ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $param['w_choices'][(int) $param['w_rowcol'] * $l + $i] . '</label></div>';
|
1090 |
+
}
|
1091 |
+
}
|
1092 |
+
$j++;
|
1093 |
+
$rep .= '</div>';
|
1094 |
+
}
|
1095 |
+
}
|
1096 |
+
else {
|
1097 |
+
for ( $i = 0; $i < (int) (count($param['w_choices']) / $param['w_rowcol']); $i++ ) {
|
1098 |
+
$rep .= '<div id="' . $id . '_element_tr' . $i . '" style="display: table-row;">';
|
1099 |
+
if ( count($param['w_choices']) > (int) $param['w_rowcol'] ) {
|
1100 |
+
for ( $l = 0; $l < $param['w_rowcol']; $l++ ) {
|
1101 |
+
if ( $param['w_allow_other'] == "yes" && $param['w_allow_other_num'] == (int) $param['w_rowcol'] * $i + $l ) {
|
1102 |
+
$rep .= '<div valign="top" id="' . $id . '_td_little' . ((int) $param['w_rowcol'] * $i + $l) . '" idi="' . ((int) $param['w_rowcol'] * $i + $l) . '" style="display: table-cell;"><input type="checkbox" value="" id="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" name="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" other="1" onclick="if(set_checked("' . $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'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled /><label id="' . $id . '_label_element' . ((int) $param['w_rowcol'] * $i + $l) . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '">' . $param['w_choices'][(int) $param['w_rowcol'] * $i + $l] . '</label></div>';
|
1103 |
+
}
|
1104 |
+
else {
|
1105 |
+
$where = '';
|
1106 |
+
$order_by = '';
|
1107 |
+
$db_info = '';
|
1108 |
+
if ( isset($param['w_choices_value']) ) {
|
1109 |
+
$choise_value = $param['w_choices_value'][(int) $param['w_rowcol'] * $i + $l];
|
1110 |
+
}
|
1111 |
+
else {
|
1112 |
+
$choise_value = $param['w_choices'][(int) $param['w_rowcol'] * $i + $l];
|
1113 |
+
}
|
1114 |
+
if ( isset($param['w_choices_params']) && $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l] ) {
|
1115 |
+
$w_choices_params = explode('[where_order_by]', $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l]);
|
1116 |
+
$where = 'where="' . $w_choices_params[0] . '"';
|
1117 |
+
$w_choices_params = explode('[db_info]', $w_choices_params[1]);
|
1118 |
+
$order_by = "order_by='" . $w_choices_params[0] . "'";
|
1119 |
+
$db_info = "db_info='" . $w_choices_params[1] . "'";
|
1120 |
+
}
|
1121 |
+
$rep .= '<div valign="top" id="' . $id . '_td_little' . ((int) $param['w_rowcol'] * $i + $l) . '" idi="' . ((int) $param['w_rowcol'] * $i + $l) . '" style="display: table-cell;"><input type="checkbox" value="' . $choise_value . '" id="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" name="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" onclick="set_checked("' . $id . '","' . ((int) $param['w_rowcol'] * $i + $l) . '","form_id_temp")" ' . $param['w_choices_checked'][(int) $param['w_rowcol'] * $i + $l] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . ((int) $param['w_rowcol'] * $i + $l) . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '"
|
1122 |
+
' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $param['w_choices'][(int) $param['w_rowcol'] * $i + $l] . '</label></div>';
|
1123 |
+
}
|
1124 |
+
}
|
1125 |
+
}
|
1126 |
+
else {
|
1127 |
+
for ( $l = 0; $l < count($param['w_choices']); $l++ ) {
|
1128 |
+
if ( $param['w_allow_other'] == "yes" && $param['w_allow_other_num'] == (int) $param['w_rowcol'] * $i + $l ) {
|
1129 |
+
$rep .= '<div valign="top" id="' . $id . '_td_little' . ((int) $param['w_rowcol'] * $i + $l) . '" idi="' . ((int) $param['w_rowcol'] * $i + $l) . '" style="display: table-cell;"><input type="checkbox" value="" id="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" name="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" other="1" onclick="if(set_checked("' . $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'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . ((int) $param['w_rowcol'] * $i + $l) . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '">' . $param['w_choices'][(int) $param['w_rowcol'] * $i + $l] . '</label></div>';
|
1130 |
+
}
|
1131 |
+
else {
|
1132 |
+
$where = '';
|
1133 |
+
$order_by = '';
|
1134 |
+
$db_info = '';
|
1135 |
+
if ( isset($param['w_choices_value']) ) {
|
1136 |
+
$choise_value = $param['w_choices_value'][(int) $param['w_rowcol'] * $i + $l];
|
1137 |
+
}
|
1138 |
+
else {
|
1139 |
+
$choise_value = $param['w_choices'][(int) $param['w_rowcol'] * $i + $l];
|
1140 |
+
}
|
1141 |
+
if ( isset($param['w_choices_params']) && $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l] ) {
|
1142 |
+
$w_choices_params = explode('[where_order_by]', $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l]);
|
1143 |
+
$where = 'where="' . $w_choices_params[0] . '"';
|
1144 |
+
$w_choices_params = explode('[db_info]', $w_choices_params[1]);
|
1145 |
+
$order_by = "order_by='" . $w_choices_params[0] . "'";
|
1146 |
+
$db_info = "db_info='" . $w_choices_params[1] . "'";
|
1147 |
+
}
|
1148 |
+
$rep .= '<div valign="top" id="' . $id . '_td_little' . ((int) $param['w_rowcol'] * $i + $l) . '" idi="' . ((int) $param['w_rowcol'] * $i + $l) . '" style="display: table-cell;"><input type="checkbox" value="' . $choise_value . '" id="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" name="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" onclick="set_checked("' . $id . '","' . ((int) $param['w_rowcol'] * $i + $l) . '","form_id_temp")" ' . $param['w_choices_checked'][(int) $param['w_rowcol'] * $i + $l] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . ((int) $param['w_rowcol'] * $i + $l) . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $param['w_choices'][(int) $param['w_rowcol'] * $i + $l] . '</label></div>';
|
1149 |
+
}
|
1150 |
+
}
|
1151 |
+
}
|
1152 |
+
$rep .= '</div>';
|
1153 |
+
}
|
1154 |
+
if ( count($param['w_choices']) % $param['w_rowcol'] != 0 ) {
|
1155 |
+
$rep .= '<div id="' . $id . '_element_tr' . ((int) (count($param['w_choices']) / (int) $param['w_rowcol'])) . '" style="display: table-row;">';
|
1156 |
+
for ( $k = 0; $k < count($param['w_choices']) % $param['w_rowcol']; $k++ ) {
|
1157 |
+
$l = count($param['w_choices']) - count($param['w_choices']) % $param['w_rowcol'] + $k;
|
1158 |
+
if ( $param['w_allow_other'] == "yes" && $param['w_allow_other_num'] == $l ) {
|
1159 |
+
$rep .= '<div valign="top" id="' . $id . '_td_little' . $l . '" idi="' . $l . '" style="display: table-cell;"><input type="checkbox" value="" id="' . $id . '_elementform_id_temp' . $l . '" name="' . $id . '_elementform_id_temp' . $l . '" other="1" onclick="if(set_checked("' . $id . '","' . $l . '","form_id_temp")) show_other_input("' . $id . '","form_id_temp");" ' . $param['w_choices_checked'][$l] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . $l . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . $l . '">' . $param['w_choices'][$l] . '</label></div>';
|
1160 |
+
}
|
1161 |
+
else {
|
1162 |
+
$where = '';
|
1163 |
+
$order_by = '';
|
1164 |
+
$db_info = '';
|
1165 |
+
if ( isset($param['w_choices_value']) ) {
|
1166 |
+
$choise_value = $param['w_choices_value'][$l];
|
1167 |
+
}
|
1168 |
+
else {
|
1169 |
+
$choise_value = $param['w_choices'][$l];
|
1170 |
+
}
|
1171 |
+
if ( isset($param['w_choices_params']) && $param['w_choices_params'][$l] ) {
|
1172 |
+
$w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$l]);
|
1173 |
+
$where = 'where="' . $w_choices_params[0] . '"';
|
1174 |
+
$w_choices_params = explode('[db_info]', $w_choices_params[1]);
|
1175 |
+
$order_by = "order_by='" . $w_choices_params[0] . "'";
|
1176 |
+
$db_info = "db_info='" . $w_choices_params[1] . "'";
|
1177 |
+
}
|
1178 |
+
$rep .= '<div valign="top" id="' . $id . '_td_little' . $l . '" idi="' . $l . '" style="display: table-cell;"><input type="checkbox" value="' . $choise_value . '" id="' . $id . '_elementform_id_temp' . $l . '" name="' . $id . '_elementform_id_temp' . $l . '" onclick="set_checked("' . $id . '","' . $l . '","form_id_temp")" ' . $param['w_choices_checked'][$l] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . $l . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . $l . '" ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $param['w_choices'][$l] . '</label></div>';
|
1179 |
+
}
|
1180 |
+
}
|
1181 |
+
$rep .= '</div>';
|
1182 |
+
}
|
1183 |
+
}
|
1184 |
+
$rep .= '</div></div></div></div>';
|
1185 |
+
break;
|
1186 |
+
}
|
1187 |
+
case 'type_radio': {
|
1188 |
+
$params_names = array(
|
1189 |
+
'w_field_label_size',
|
1190 |
+
'w_field_label_pos',
|
1191 |
+
'w_flow',
|
1192 |
+
'w_choices',
|
1193 |
+
'w_choices_checked',
|
1194 |
+
'w_rowcol',
|
1195 |
+
'w_required',
|
1196 |
+
'w_randomize',
|
1197 |
+
'w_allow_other',
|
1198 |
+
'w_allow_other_num',
|
1199 |
+
'w_class',
|
1200 |
+
);
|
1201 |
+
$temp = $params;
|
1202 |
+
if ( strpos($temp, 'w_field_option_pos') > -1 ) {
|
1203 |
+
$params_names = array(
|
1204 |
+
'w_field_label_size',
|
1205 |
+
'w_field_label_pos',
|
1206 |
+
'w_field_option_pos',
|
1207 |
+
'w_flow',
|
1208 |
+
'w_choices',
|
1209 |
+
'w_choices_checked',
|
1210 |
+
'w_rowcol',
|
1211 |
+
'w_required',
|
1212 |
+
'w_randomize',
|
1213 |
+
'w_allow_other',
|
1214 |
+
'w_allow_other_num',
|
1215 |
+
'w_value_disabled',
|
1216 |
+
'w_choices_value',
|
1217 |
+
'w_choices_params',
|
1218 |
+
'w_class',
|
1219 |
+
);
|
1220 |
+
}
|
1221 |
+
if ( strpos($temp, 'w_hide_label') > -1 ) {
|
1222 |
+
$params_names = array(
|
1223 |
+
'w_field_label_size',
|
1224 |
+
'w_field_label_pos',
|
1225 |
+
'w_field_option_pos',
|
1226 |
+
'w_hide_label',
|
1227 |
+
'w_flow',
|
1228 |
+
'w_choices',
|
1229 |
+
'w_choices_checked',
|
1230 |
+
'w_rowcol',
|
1231 |
+
'w_required',
|
1232 |
+
'w_randomize',
|
1233 |
+
'w_allow_other',
|
1234 |
+
'w_allow_other_num',
|
1235 |
+
'w_value_disabled',
|
1236 |
+
'w_choices_value',
|
1237 |
+
'w_choices_params',
|
1238 |
+
'w_class',
|
1239 |
+
);
|
1240 |
+
}
|
1241 |
+
foreach ( $params_names as $params_name ) {
|
1242 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
1243 |
+
$param[$params_name] = $temp[0];
|
1244 |
+
$temp = $temp[1];
|
1245 |
+
}
|
1246 |
+
if ( $temp ) {
|
1247 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
1248 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
1249 |
+
foreach ( $attrs as $attr ) {
|
1250 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
1251 |
+
}
|
1252 |
+
}
|
1253 |
+
if ( !isset($param['w_value_disabled']) ) {
|
1254 |
+
$param['w_value_disabled'] = 'no';
|
1255 |
+
}
|
1256 |
+
if ( !isset($param['w_field_option_pos']) ) {
|
1257 |
+
$param['w_field_option_pos'] = 'left';
|
1258 |
+
}
|
1259 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
1260 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
1261 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
1262 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
1263 |
+
$param['w_choices'] = explode('***', $param['w_choices']);
|
1264 |
+
$param['w_choices_checked'] = explode('***', $param['w_choices_checked']);
|
1265 |
+
if ( isset($param['w_choices_value']) ) {
|
1266 |
+
$param['w_choices_value'] = explode('***', $param['w_choices_value']);
|
1267 |
+
$param['w_choices_params'] = explode('***', $param['w_choices_params']);
|
1268 |
+
}
|
1269 |
+
foreach ( $param['w_choices_checked'] as $key => $choices_checked ) {
|
1270 |
+
if ( $choices_checked == 'true' ) {
|
1271 |
+
$param['w_choices_checked'][$key] = 'checked="checked"';
|
1272 |
+
}
|
1273 |
+
else {
|
1274 |
+
$param['w_choices_checked'][$key] = '';
|
1275 |
+
}
|
1276 |
+
}
|
1277 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_radio" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_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_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_randomize'] . '" name="' . $id . '_randomizeform_id_temp" id="' . $id . '_randomizeform_id_temp"><input type="hidden" value="' . $param['w_allow_other'] . '" name="' . $id . '_allow_otherform_id_temp" id="' . $id . '_allow_otherform_id_temp"><input type="hidden" value="' . $param['w_allow_other_num'] . '" name="' . $id . '_allow_other_numform_id_temp" id="' . $id . '_allow_other_numform_id_temp"><input type="hidden" value="' . $param['w_rowcol'] . '" name="' . $id . '_rowcol_numform_id_temp" id="' . $id . '_rowcol_numform_id_temp"><input type="hidden" value="' . $param['w_field_option_pos'] . '" id="' . $id . '_option_left_right"><input type="hidden" value="' . $param['w_value_disabled'] . '" name="' . $id . '_value_disabledform_id_temp" id="' . $id . '_value_disabledform_id_temp"><div style="display: table;"><div id="' . $id . '_table_little" style="display: table-row-group;" ' . ($param['w_flow'] == 'hor' ? 'for_hor="' . $id . '_hor"' : '') . '>';
|
1278 |
+
if ( $param['w_flow'] == 'hor' ) {
|
1279 |
+
$j = 0;
|
1280 |
+
for ( $i = 0; $i < (int) $param['w_rowcol']; $i++ ) {
|
1281 |
+
$rep .= '<div id="' . $id . '_element_tr' . $i . '" style="display: table-row;">';
|
1282 |
+
for ( $l = 0; $l <= (int) (count($param['w_choices']) / $param['w_rowcol']); $l++ ) {
|
1283 |
+
if ( $j >= count($param['w_choices']) % $param['w_rowcol'] && $l == (int) (count($param['w_choices']) / $param['w_rowcol']) ) {
|
1284 |
+
continue;
|
1285 |
+
}
|
1286 |
+
if ( $param['w_allow_other'] == "yes" && $param['w_allow_other_num'] == (int) $param['w_rowcol'] * $l + $i ) {
|
1287 |
+
$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'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . ((int) $param['w_rowcol'] * $l + $i) . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $l + $i) . '">' . $param['w_choices'][(int) $param['w_rowcol'] * $l + $i] . '</label></div>';
|
1288 |
+
}
|
1289 |
+
else {
|
1290 |
+
$where = '';
|
1291 |
+
$order_by = '';
|
1292 |
+
$db_info = '';
|
1293 |
+
if ( isset($param['w_choices_value']) ) {
|
1294 |
+
$choise_value = $param['w_choices_value'][(int) $param['w_rowcol'] * $l + $i];
|
1295 |
+
}
|
1296 |
+
else {
|
1297 |
+
$choise_value = $param['w_choices'][(int) $param['w_rowcol'] * $l + $i];
|
1298 |
+
}
|
1299 |
+
if ( isset($param['w_choices_params']) && $param['w_choices_params'][(int) $param['w_rowcol'] * $l + $i] ) {
|
1300 |
+
$w_choices_params = explode('[where_order_by]', $param['w_choices_params'][(int) $param['w_rowcol'] * $l + $i]);
|
1301 |
+
$where = 'where="' . $w_choices_params[0] . '"';
|
1302 |
+
$w_choices_params = explode('[db_info]', $w_choices_params[1]);
|
1303 |
+
$order_by = "order_by='" . $w_choices_params[0] . "'";
|
1304 |
+
$db_info = "db_info='" . $w_choices_params[1] . "'";
|
1305 |
+
}
|
1306 |
+
$rep .= '<div valign="top" id="' . $id . '_td_little' . ((int) $param['w_rowcol'] * $l + $i) . '" idi="' . ((int) $param['w_rowcol'] * $l + $i) . '" style="display: table-cell;"><input type="radio" value="' . $choise_value . '" id="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $l + $i) . '" name="' . $id . '_elementform_id_temp" onclick="set_default("' . $id . '","' . ((int) $param['w_rowcol'] * $l + $i) . '","form_id_temp")" ' . $param['w_choices_checked'][(int) $param['w_rowcol'] * $l + $i] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . ((int) $param['w_rowcol'] * $l + $i) . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $l + $i) . '" ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $param['w_choices'][(int) $param['w_rowcol'] * $l + $i] . '</label></div>';
|
1307 |
+
}
|
1308 |
+
}
|
1309 |
+
$j++;
|
1310 |
+
$rep .= '</div>';
|
1311 |
+
}
|
1312 |
+
}
|
1313 |
+
else {
|
1314 |
+
for ( $i = 0; $i < (int) (count($param['w_choices']) / $param['w_rowcol']); $i++ ) {
|
1315 |
+
$rep .= '<div id="' . $id . '_element_tr' . $i . '" style="display: table-row;">';
|
1316 |
+
if ( count($param['w_choices']) > (int) $param['w_rowcol'] ) {
|
1317 |
+
for ( $l = 0; $l < $param['w_rowcol']; $l++ ) {
|
1318 |
+
if ( $param['w_allow_other'] == "yes" && $param['w_allow_other_num'] == (int) $param['w_rowcol'] * $i + $l ) {
|
1319 |
+
$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'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . ((int) $param['w_rowcol'] * $i + $l) . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '">' . $param['w_choices'][(int) $param['w_rowcol'] * $i + $l] . '</label></div>';
|
1320 |
+
}
|
1321 |
+
else {
|
1322 |
+
$where = '';
|
1323 |
+
$order_by = '';
|
1324 |
+
$db_info = '';
|
1325 |
+
if ( isset($param['w_choices_value']) ) {
|
1326 |
+
$choise_value = $param['w_choices_value'][(int) $param['w_rowcol'] * $i + $l];
|
1327 |
+
}
|
1328 |
+
else {
|
1329 |
+
$choise_value = $param['w_choices'][(int) $param['w_rowcol'] * $i + $l];
|
1330 |
+
}
|
1331 |
+
if ( isset($param['w_choices_params']) && $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l] ) {
|
1332 |
+
$w_choices_params = explode('[where_order_by]', $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l]);
|
1333 |
+
$where = 'where="' . $w_choices_params[0] . '"';
|
1334 |
+
$w_choices_params = explode('[db_info]', $w_choices_params[1]);
|
1335 |
+
$order_by = "order_by='" . $w_choices_params[0] . "'";
|
1336 |
+
$db_info = "db_info='" . $w_choices_params[1] . "'";
|
1337 |
+
}
|
1338 |
+
$rep .= '<div valign="top" id="' . $id . '_td_little' . ((int) $param['w_rowcol'] * $i + $l) . '" idi="' . ((int) $param['w_rowcol'] * $i + $l) . '" style="display: table-cell;"><input type="radio" value="' . $choise_value . '" id="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" name="' . $id . '_elementform_id_temp" onclick="set_default("' . $id . '","' . ((int) $param['w_rowcol'] * $i + $l) . '","form_id_temp")" ' . $param['w_choices_checked'][(int) $param['w_rowcol'] * $i + $l] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . ((int) $param['w_rowcol'] * $i + $l) . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $param['w_choices'][(int) $param['w_rowcol'] * $i + $l] . '</label></div>';
|
1339 |
+
}
|
1340 |
+
}
|
1341 |
+
}
|
1342 |
+
else {
|
1343 |
+
for ( $l = 0; $l < count($param['w_choices']); $l++ ) {
|
1344 |
+
if ( $param['w_allow_other'] == "yes" && $param['w_allow_other_num'] == (int) $param['w_rowcol'] * $i + $l ) {
|
1345 |
+
$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'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . ((int) $param['w_rowcol'] * $i + $l) . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '">' . $param['w_choices'][(int) $param['w_rowcol'] * $i + $l] . '</label></div>';
|
1346 |
+
}
|
1347 |
+
else {
|
1348 |
+
$where = '';
|
1349 |
+
$order_by = '';
|
1350 |
+
$db_info = '';
|
1351 |
+
if ( isset($param['w_choices_value']) ) {
|
1352 |
+
$choise_value = $param['w_choices_value'][(int) $param['w_rowcol'] * $i + $l];
|
1353 |
+
}
|
1354 |
+
else {
|
1355 |
+
$choise_value = $param['w_choices'][(int) $param['w_rowcol'] * $i + $l];
|
1356 |
+
}
|
1357 |
+
if ( isset($param['w_choices_params']) && $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l] ) {
|
1358 |
+
$w_choices_params = explode('[where_order_by]', $param['w_choices_params'][(int) $param['w_rowcol'] * $i + $l]);
|
1359 |
+
$where = 'where="' . $w_choices_params[0] . '"';
|
1360 |
+
$w_choices_params = explode('[db_info]', $w_choices_params[1]);
|
1361 |
+
$order_by = "order_by='" . $w_choices_params[0] . "'";
|
1362 |
+
$db_info = "db_info='" . $w_choices_params[1] . "'";
|
1363 |
+
}
|
1364 |
+
$rep .= '<div valign="top" id="' . $id . '_td_little' . ((int) $param['w_rowcol'] * $i + $l) . '" idi="' . ((int) $param['w_rowcol'] * $i + $l) . '" style="display: table-cell;"><input type="radio" value="' . $choise_value . '" id="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" name="' . $id . '_elementform_id_temp" onclick="set_default("' . $id . '","' . ((int) $param['w_rowcol'] * $i + $l) . '","form_id_temp")" ' . $param['w_choices_checked'][(int) $param['w_rowcol'] * $i + $l] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . ((int) $param['w_rowcol'] * $i + $l) . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . ((int) $param['w_rowcol'] * $i + $l) . '" ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $param['w_choices'][(int) $param['w_rowcol'] * $i + $l] . '</label></div>';
|
1365 |
+
}
|
1366 |
+
}
|
1367 |
+
}
|
1368 |
+
$rep .= '</div>';
|
1369 |
+
}
|
1370 |
+
if ( count($param['w_choices']) % $param['w_rowcol'] != 0 ) {
|
1371 |
+
$rep .= '<div id="' . $id . '_element_tr' . ((int) (count($param['w_choices']) / (int) $param['w_rowcol'])) . '" style="display: table-row;">';
|
1372 |
+
for ( $k = 0; $k < count($param['w_choices']) % $param['w_rowcol']; $k++ ) {
|
1373 |
+
$l = count($param['w_choices']) - count($param['w_choices']) % $param['w_rowcol'] + $k;
|
1374 |
+
if ( $param['w_allow_other'] == "yes" && $param['w_allow_other_num'] == $l ) {
|
1375 |
+
$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'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . $l . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . $l . '">' . $param['w_choices'][$l] . '</label></div>';
|
1376 |
+
}
|
1377 |
+
else {
|
1378 |
+
$where = '';
|
1379 |
+
$order_by = '';
|
1380 |
+
$db_info = '';
|
1381 |
+
if ( isset($param['w_choices_value']) ) {
|
1382 |
+
$choise_value = $param['w_choices_value'][$l];
|
1383 |
+
}
|
1384 |
+
else {
|
1385 |
+
$choise_value = $param['w_choices'][$l];
|
1386 |
+
}
|
1387 |
+
if ( isset($param['w_choices_params']) && $param['w_choices_params'][$l] ) {
|
1388 |
+
$w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$l]);
|
1389 |
+
$where = 'where="' . $w_choices_params[0] . '"';
|
1390 |
+
$w_choices_params = explode('[db_info]', $w_choices_params[1]);
|
1391 |
+
$order_by = "order_by='" . $w_choices_params[0] . "'";
|
1392 |
+
$db_info = "db_info='" . $w_choices_params[1] . "'";
|
1393 |
+
}
|
1394 |
+
$rep .= '<div valign="top" id="' . $id . '_td_little' . $l . '" idi="' . $l . '" style="display: table-cell;"><input type="radio" value="' . $choise_value . '" id="' . $id . '_elementform_id_temp' . $l . '" name="' . $id . '_elementform_id_temp" onclick="set_default("' . $id . '","' . $l . '","form_id_temp")" ' . $param['w_choices_checked'][$l] . ' ' . $param['attributes'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . $l . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . $l . '"
|
1395 |
+
' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $param['w_choices'][$l] . '</label></div>';
|
1396 |
+
}
|
1397 |
+
}
|
1398 |
+
$rep .= '</div>';
|
1399 |
+
}
|
1400 |
+
}
|
1401 |
+
$rep .= '</div></div></div></div>';
|
1402 |
+
break;
|
1403 |
+
}
|
1404 |
+
case 'type_own_select': {
|
1405 |
+
$params_names = array(
|
1406 |
+
'w_field_label_size',
|
1407 |
+
'w_field_label_pos',
|
1408 |
+
'w_size',
|
1409 |
+
'w_choices',
|
1410 |
+
'w_choices_checked',
|
1411 |
+
'w_choices_disabled',
|
1412 |
+
'w_required',
|
1413 |
+
'w_class',
|
1414 |
+
);
|
1415 |
+
$temp = $params;
|
1416 |
+
if ( strpos($temp, 'w_choices_value') > -1 ) {
|
1417 |
+
$params_names = array(
|
1418 |
+
'w_field_label_size',
|
1419 |
+
'w_field_label_pos',
|
1420 |
+
'w_size',
|
1421 |
+
'w_choices',
|
1422 |
+
'w_choices_checked',
|
1423 |
+
'w_choices_disabled',
|
1424 |
+
'w_required',
|
1425 |
+
'w_value_disabled',
|
1426 |
+
'w_choices_value',
|
1427 |
+
'w_choices_params',
|
1428 |
+
'w_class',
|
1429 |
+
);
|
1430 |
+
}
|
1431 |
+
if ( strpos($temp, 'w_hide_label') > -1 ) {
|
1432 |
+
$params_names = array(
|
1433 |
+
'w_field_label_size',
|
1434 |
+
'w_field_label_pos',
|
1435 |
+
'w_hide_label',
|
1436 |
+
'w_size',
|
1437 |
+
'w_choices',
|
1438 |
+
'w_choices_checked',
|
1439 |
+
'w_choices_disabled',
|
1440 |
+
'w_required',
|
1441 |
+
'w_value_disabled',
|
1442 |
+
'w_choices_value',
|
1443 |
+
'w_choices_params',
|
1444 |
+
'w_class',
|
1445 |
+
);
|
1446 |
+
}
|
1447 |
+
foreach ( $params_names as $params_name ) {
|
1448 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
1449 |
+
$param[$params_name] = $temp[0];
|
1450 |
+
$temp = $temp[1];
|
1451 |
+
}
|
1452 |
+
if ( $temp ) {
|
1453 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
1454 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
1455 |
+
foreach ( $attrs as $attr ) {
|
1456 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
1457 |
+
}
|
1458 |
+
}
|
1459 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
1460 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
1461 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
1462 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
1463 |
+
$param['w_choices'] = explode('***', $param['w_choices']);
|
1464 |
+
$param['w_choices_checked'] = explode('***', $param['w_choices_checked']);
|
1465 |
+
$param['w_choices_disabled'] = explode('***', $param['w_choices_disabled']);
|
1466 |
+
if ( isset($param['w_choices_value']) ) {
|
1467 |
+
$param['w_choices_value'] = explode('***', $param['w_choices_value']);
|
1468 |
+
$param['w_choices_params'] = explode('***', $param['w_choices_params']);
|
1469 |
+
}
|
1470 |
+
if ( !isset($param['w_value_disabled']) ) {
|
1471 |
+
$param['w_value_disabled'] = 'no';
|
1472 |
+
}
|
1473 |
+
foreach ( $param['w_choices_checked'] as $key => $choices_checked ) {
|
1474 |
+
if ( $choices_checked == 'true' ) {
|
1475 |
+
$param['w_choices_checked'][$key] = 'selected="selected"';
|
1476 |
+
}
|
1477 |
+
else {
|
1478 |
+
$param['w_choices_checked'][$key] = '';
|
1479 |
+
}
|
1480 |
+
}
|
1481 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_own_select" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '; "><input type="hidden" value="type_own_select" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_value_disabled'] . '" name="' . $id . '_value_disabledform_id_temp" id="' . $id . '_value_disabledform_id_temp"><select id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" onchange="set_select(this)" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled>';
|
1482 |
+
foreach ( $param['w_choices'] as $key => $choice ) {
|
1483 |
+
$where = '';
|
1484 |
+
$order_by = '';
|
1485 |
+
$db_info = '';
|
1486 |
+
$choice_value = $param['w_choices_disabled'][$key] == 'true' ? '' : (isset($param['w_choices_value']) ? $param['w_choices_value'][$key] : $choice);
|
1487 |
+
if ( isset($param['w_choices_params']) && $param['w_choices_params'][$key] ) {
|
1488 |
+
$w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$key]);
|
1489 |
+
$where = 'where="' . $w_choices_params[0] . '"';
|
1490 |
+
$w_choices_params = explode('[db_info]', $w_choices_params[1]);
|
1491 |
+
$order_by = "order_by='" . $w_choices_params[0] . "'";
|
1492 |
+
$db_info = "db_info='" . $w_choices_params[1] . "'";
|
1493 |
+
}
|
1494 |
+
$rep .= '<option id="' . $id . '_option' . $key . '" value="' . $choice_value . '" onselect="set_select("' . $id . '_option' . $key . '")" ' . $param['w_choices_checked'][$key] . ' ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $choice . '</option>';
|
1495 |
+
}
|
1496 |
+
$rep .= '</select></div></div>';
|
1497 |
+
break;
|
1498 |
+
}
|
1499 |
+
case 'type_country': {
|
1500 |
+
$params_names = array(
|
1501 |
+
'w_field_label_size',
|
1502 |
+
'w_field_label_pos',
|
1503 |
+
'w_size',
|
1504 |
+
'w_countries',
|
1505 |
+
'w_required',
|
1506 |
+
'w_class',
|
1507 |
+
);
|
1508 |
+
$temp = $params;
|
1509 |
+
if ( strpos($temp, 'w_hide_label') > -1 ) {
|
1510 |
+
$params_names = array(
|
1511 |
+
'w_field_label_size',
|
1512 |
+
'w_field_label_pos',
|
1513 |
+
'w_hide_label',
|
1514 |
+
'w_size',
|
1515 |
+
'w_countries',
|
1516 |
+
'w_required',
|
1517 |
+
'w_class',
|
1518 |
+
);
|
1519 |
+
}
|
1520 |
+
foreach ( $params_names as $params_name ) {
|
1521 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
1522 |
+
$param[$params_name] = $temp[0];
|
1523 |
+
$temp = $temp[1];
|
1524 |
+
}
|
1525 |
+
if ( $temp ) {
|
1526 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
1527 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
1528 |
+
foreach ( $attrs as $attr ) {
|
1529 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
1530 |
+
}
|
1531 |
+
}
|
1532 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
1533 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
1534 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
1535 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
1536 |
+
$param['w_countries'] = explode('***', $param['w_countries']);
|
1537 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_country" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '; "><input type="hidden" value="type_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"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><select id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled>';
|
1538 |
+
foreach ( $param['w_countries'] as $key => $choice ) {
|
1539 |
+
$choice_value = $choice;
|
1540 |
+
$rep .= '<option value="' . $choice_value . '">' . $choice . '</option>';
|
1541 |
+
}
|
1542 |
+
$rep .= '</select></div></div>';
|
1543 |
+
break;
|
1544 |
+
}
|
1545 |
+
case 'type_time': {
|
1546 |
+
$params_names = array(
|
1547 |
+
'w_field_label_size',
|
1548 |
+
'w_field_label_pos',
|
1549 |
+
'w_time_type',
|
1550 |
+
'w_am_pm',
|
1551 |
+
'w_sec',
|
1552 |
+
'w_hh',
|
1553 |
+
'w_mm',
|
1554 |
+
'w_ss',
|
1555 |
+
'w_mini_labels',
|
1556 |
+
'w_required',
|
1557 |
+
'w_class',
|
1558 |
+
);
|
1559 |
+
$temp = $params;
|
1560 |
+
if ( strpos($temp, 'w_hide_label') > -1 ) {
|
1561 |
+
$params_names = array(
|
1562 |
+
'w_field_label_size',
|
1563 |
+
'w_field_label_pos',
|
1564 |
+
'w_hide_label',
|
1565 |
+
'w_time_type',
|
1566 |
+
'w_am_pm',
|
1567 |
+
'w_sec',
|
1568 |
+
'w_hh',
|
1569 |
+
'w_mm',
|
1570 |
+
'w_ss',
|
1571 |
+
'w_mini_labels',
|
1572 |
+
'w_required',
|
1573 |
+
'w_class',
|
1574 |
+
);
|
1575 |
+
}
|
1576 |
+
foreach ( $params_names as $params_name ) {
|
1577 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
1578 |
+
$param[$params_name] = $temp[0];
|
1579 |
+
$temp = $temp[1];
|
1580 |
+
}
|
1581 |
+
if ( $temp ) {
|
1582 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
1583 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
1584 |
+
foreach ( $attrs as $attr ) {
|
1585 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
1586 |
+
}
|
1587 |
+
}
|
1588 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
1589 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
1590 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
1591 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
1592 |
+
$w_mini_labels = explode('***', $param['w_mini_labels']);
|
1593 |
+
if ( $param['w_sec'] == '1' ) {
|
1594 |
+
$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" onblur="add_0("' . $id . '_ssform_id_temp")" ' . $param['attributes'] . ' disabled /></div>';
|
1595 |
+
$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>';
|
1596 |
+
}
|
1597 |
+
else {
|
1598 |
+
$w_sec = '';
|
1599 |
+
$w_sec_label = '';
|
1600 |
+
}
|
1601 |
+
if ( $param['w_time_type'] == '12' ) {
|
1602 |
+
if ( $param['w_am_pm'] == 'am' ) {
|
1603 |
+
$am_ = "selected=\"selected\"";
|
1604 |
+
$pm_ = "";
|
1605 |
+
}
|
1606 |
+
else {
|
1607 |
+
$am_ = "";
|
1608 |
+
$pm_ = "selected=\"selected\"";
|
1609 |
+
}
|
1610 |
+
$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>';
|
1611 |
+
$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>';
|
1612 |
+
}
|
1613 |
+
else {
|
1614 |
+
$w_time_type = '';
|
1615 |
+
$w_time_type_label = '';
|
1616 |
+
}
|
1617 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_time" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_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"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_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" onblur="add_0("' . $id . '_hhform_id_temp")" ' . $param['attributes'] . ' disabled/></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" onblur="add_0("' . $id . '_mmform_id_temp")" ' . $param['attributes'] . ' disabled/></div>' . $w_sec . $w_time_type . '</div><div id="' . $id . '_tr_time2" style="display: table-row;"><div id="' . $id . '_td_time_label1" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_hh">' . $w_mini_labels[0] . '</label></div><div style="display: table-cell;"></div><div id="' . $id . '_td_time_label2" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_mm">' . $w_mini_labels[1] . '</label></div>' . $w_sec_label . $w_time_type_label . '</div></div></div></div>';
|
1618 |
+
break;
|
1619 |
+
}
|
1620 |
+
case 'type_date': {
|
1621 |
+
$params_names = array(
|
1622 |
+
'w_field_label_size',
|
1623 |
+
'w_field_label_pos',
|
1624 |
+
'w_date',
|
1625 |
+
'w_required',
|
1626 |
+
'w_class',
|
1627 |
+
'w_format',
|
1628 |
+
'w_but_val',
|
1629 |
+
);
|
1630 |
+
$temp = $params;
|
1631 |
+
if ( strpos($temp, 'w_disable_past_days') > -1 ) {
|
1632 |
+
$params_names = array(
|
1633 |
+
'w_field_label_size',
|
1634 |
+
'w_field_label_pos',
|
1635 |
+
'w_date',
|
1636 |
+
'w_required',
|
1637 |
+
'w_class',
|
1638 |
+
'w_format',
|
1639 |
+
'w_but_val',
|
1640 |
+
'w_disable_past_days',
|
1641 |
+
);
|
1642 |
+
}
|
1643 |
+
foreach ( $params_names as $params_name ) {
|
1644 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
1645 |
+
$param[$params_name] = $temp[0];
|
1646 |
+
$temp = $temp[1];
|
1647 |
+
}
|
1648 |
+
if ( $temp ) {
|
1649 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
1650 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
1651 |
+
foreach ( $attrs as $attr ) {
|
1652 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
1653 |
+
}
|
1654 |
+
}
|
1655 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
1656 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
1657 |
+
$param['w_disable_past_days'] = isset($param['w_disable_past_days']) ? $param['w_disable_past_days'] : 'no';
|
1658 |
+
$disable_past_days = $param['w_disable_past_days'] == 'yes' ? 'true' : 'false';
|
1659 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_date" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_date" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_disable_past_days'] . '" name="' . $id . '_dis_past_daysform_id_temp" id="' . $id . '_dis_past_daysform_id_temp"><input type="text" value="' . $param['w_date'] . '" class="wdform-date wd-datepicker" data-format="' . $param['w_format'] . '" id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" maxlength="10" size="10" ' . $param['attributes'] . ' disabled/></div></div>';
|
1660 |
+
break;
|
1661 |
+
}
|
1662 |
+
///////////////////////// type_date_new ////////////////////////////
|
1663 |
+
case 'type_date_new': {
|
1664 |
+
$params_names = array(
|
1665 |
+
'w_field_label_size',
|
1666 |
+
'w_field_label_pos',
|
1667 |
+
'w_size',
|
1668 |
+
'w_date',
|
1669 |
+
'w_required',
|
1670 |
+
'w_show_image',
|
1671 |
+
'w_class',
|
1672 |
+
'w_format',
|
1673 |
+
'w_start_day',
|
1674 |
+
'w_default_date',
|
1675 |
+
'w_min_date',
|
1676 |
+
'w_max_date',
|
1677 |
+
'w_invalid_dates',
|
1678 |
+
'w_show_days',
|
1679 |
+
'w_hide_time',
|
1680 |
+
'w_but_val',
|
1681 |
+
'w_disable_past_days',
|
1682 |
+
);
|
1683 |
+
$temp = $params;
|
1684 |
+
if ( strpos($temp, 'w_hide_label') > -1 ) {
|
1685 |
+
$params_names = array(
|
1686 |
+
'w_field_label_size',
|
1687 |
+
'w_field_label_pos',
|
1688 |
+
'w_hide_label',
|
1689 |
+
'w_size',
|
1690 |
+
'w_date',
|
1691 |
+
'w_required',
|
1692 |
+
'w_show_image',
|
1693 |
+
'w_class',
|
1694 |
+
'w_format',
|
1695 |
+
'w_start_day',
|
1696 |
+
'w_default_date',
|
1697 |
+
'w_min_date',
|
1698 |
+
'w_max_date',
|
1699 |
+
'w_invalid_dates',
|
1700 |
+
'w_show_days',
|
1701 |
+
'w_hide_time',
|
1702 |
+
'w_but_val',
|
1703 |
+
'w_disable_past_days',
|
1704 |
+
);
|
1705 |
+
}
|
1706 |
+
foreach ( $params_names as $params_name ) {
|
1707 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
1708 |
+
$param[$params_name] = $temp[0];
|
1709 |
+
$temp = $temp[1];
|
1710 |
+
}
|
1711 |
+
if ( $temp ) {
|
1712 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
1713 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
1714 |
+
foreach ( $attrs as $attr ) {
|
1715 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
1716 |
+
}
|
1717 |
+
}
|
1718 |
+
$w_show_week_days = explode('***', $param['w_show_days']);
|
1719 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
1720 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
1721 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
1722 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
1723 |
+
$param['w_disable_past_days'] = isset($param['w_disable_past_days']) ? $param['w_disable_past_days'] : 'no';
|
1724 |
+
$disable_past_days = $param['w_disable_past_days'] == 'yes' ? 'true' : 'false';
|
1725 |
+
$display_image_date = $param['w_show_image'] == 'yes' ? 'inline' : 'none';
|
1726 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_date_new" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_date_new" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp">
|
1727 |
+
<input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp">
|
1728 |
+
|
1729 |
+
<input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/>
|
1730 |
+
|
1731 |
+
<input type="hidden" value="' . $param['w_show_image'] . '" name="' . $id . '_show_imageform_id_temp" id="' . $id . '_show_imageform_id_temp">
|
1732 |
+
|
1733 |
+
<input type="hidden" value="' . $param['w_disable_past_days'] . '" name="' . $id . '_dis_past_daysform_id_temp" id="' . $id . '_dis_past_daysform_id_temp">
|
1734 |
+
|
1735 |
+
<input type="hidden" value="' . $param['w_default_date'] . '" name="' . $id . '_default_date_id_temp" id="' . $id . '_default_date_id_temp">
|
1736 |
+
<input type="hidden" value="' . $param['w_min_date'] . '" name="' . $id . '_min_date_id_temp" id="' . $id . '_min_date_id_temp">
|
1737 |
+
<input type="hidden" value="' . $param['w_max_date'] . '" name="' . $id . '_max_date_id_temp" id="' . $id . '_max_date_id_temp">
|
1738 |
+
<input type="hidden" value="' . $param['w_invalid_dates'] . '" name="' . $id . '_invalid_dates_id_temp" id="' . $id . '_invalid_dates_id_temp">
|
1739 |
+
|
1740 |
+
<input type="hidden" value="' . $param['w_start_day'] . '" name="' . $id . '_start_dayform_id_temp" id="' . $id . '_start_dayform_id_temp">
|
1741 |
+
|
1742 |
+
<input type="hidden" value="' . $param['w_hide_time'] . '" name="' . $id . '_hide_timeform_id_temp" id="' . $id . '_hide_timeform_id_temp">
|
1743 |
+
|
1744 |
+
<input type="hidden" name="' . $id . '_show_week_days" id="' . $id . '_show_week_days" sunday="' . $w_show_week_days[0] . '" monday="' . $w_show_week_days[1] . '" tuesday="' . $w_show_week_days[2] . '" wednesday="' . $w_show_week_days[3] . '" thursday="' . $w_show_week_days[4] . '" friday="' . $w_show_week_days[5] . '" saturday="' . $w_show_week_days[6] . '" />
|
1745 |
+
<input type="text" id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled />
|
1746 |
+
<span id="' . $id . '_show_imagedateform_id_temp" class="dashicons dashicons-calendar-alt wd-calendar-button ' . ($param['w_show_image'] == "yes" ? "wd-inline-block" : "wd-hidden") . '"></span>
|
1747 |
+
<input id="' . $id . '_buttonform_id_temp" type="hidden" value="' . $param['w_but_val'] . '" format="' . $param['w_format'] . '" ></div></div>';
|
1748 |
+
break;
|
1749 |
+
}
|
1750 |
+
case 'type_date_range': {
|
1751 |
+
$params_names = array(
|
1752 |
+
'w_field_label_size',
|
1753 |
+
'w_field_label_pos',
|
1754 |
+
'w_size',
|
1755 |
+
'w_date',
|
1756 |
+
'w_required',
|
1757 |
+
'w_show_image',
|
1758 |
+
'w_class',
|
1759 |
+
'w_format',
|
1760 |
+
'w_start_day',
|
1761 |
+
'w_default_date_start',
|
1762 |
+
'w_default_date_end',
|
1763 |
+
'w_min_date',
|
1764 |
+
'w_max_date',
|
1765 |
+
'w_invalid_dates',
|
1766 |
+
'w_show_days',
|
1767 |
+
'w_hide_time',
|
1768 |
+
'w_but_val',
|
1769 |
+
'w_disable_past_days',
|
1770 |
+
);
|
1771 |
+
$temp = $params;
|
1772 |
+
if ( strpos($temp, 'w_hide_label') > -1 ) {
|
1773 |
+
$params_names = array(
|
1774 |
+
'w_field_label_size',
|
1775 |
+
'w_field_label_pos',
|
1776 |
+
'w_hide_label',
|
1777 |
+
'w_size',
|
1778 |
+
'w_date',
|
1779 |
+
'w_required',
|
1780 |
+
'w_show_image',
|
1781 |
+
'w_class',
|
1782 |
+
'w_format',
|
1783 |
+
'w_start_day',
|
1784 |
+
'w_default_date_start',
|
1785 |
+
'w_default_date_end',
|
1786 |
+
'w_min_date',
|
1787 |
+
'w_max_date',
|
1788 |
+
'w_invalid_dates',
|
1789 |
+
'w_show_days',
|
1790 |
+
'w_hide_time',
|
1791 |
+
'w_but_val',
|
1792 |
+
'w_disable_past_days',
|
1793 |
+
);
|
1794 |
+
}
|
1795 |
+
foreach ( $params_names as $params_name ) {
|
1796 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
1797 |
+
$param[$params_name] = $temp[0];
|
1798 |
+
$temp = $temp[1];
|
1799 |
+
}
|
1800 |
+
if ( $temp ) {
|
1801 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
1802 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
1803 |
+
foreach ( $attrs as $attr ) {
|
1804 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
1805 |
+
}
|
1806 |
+
}
|
1807 |
+
$w_show_week_days = explode('***', $param['w_show_days']);
|
1808 |
+
$defaul_day_array = explode(',', $param['w_date']);
|
1809 |
+
$defaul_day_start = $defaul_day_array[0];
|
1810 |
+
$defaul_day_end = $defaul_day_array[1];
|
1811 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
1812 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
1813 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
1814 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
1815 |
+
$param['w_disable_past_days'] = isset($param['w_disable_past_days']) ? $param['w_disable_past_days'] : 'no';
|
1816 |
+
$disable_past_days = $param['w_disable_past_days'] == 'yes' ? 'true' : 'false';
|
1817 |
+
$display_image_date = $param['w_show_image'] == 'yes' ? 'inline' : 'none';
|
1818 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_date_range" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';">
|
1819 |
+
|
1820 |
+
<input type="hidden" value="type_date_range" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp">
|
1821 |
+
|
1822 |
+
<input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp">
|
1823 |
+
|
1824 |
+
<input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/>
|
1825 |
+
|
1826 |
+
<input type="hidden" value="' . $param['w_show_image'] . '" name="' . $id . '_show_imageform_id_temp" id="' . $id . '_show_imageform_id_temp">
|
1827 |
+
|
1828 |
+
<input type="hidden" value="' . $param['w_disable_past_days'] . '" name="' . $id . '_dis_past_daysform_id_temp" id="' . $id . '_dis_past_daysform_id_temp">
|
1829 |
+
|
1830 |
+
<input type="hidden" value="' . $param['w_default_date_start'] . '" name="' . $id . '_default_date_id_temp_start" id="' . $id . '_default_date_id_temp_start">
|
1831 |
+
|
1832 |
+
<input type="hidden" value="' . $param['w_default_date_end'] . '" name="' . $id . '_default_date_id_temp_end" id="' . $id . '_default_date_id_temp_end">
|
1833 |
+
|
1834 |
+
<input type="hidden" value="' . $param['w_min_date'] . '" name="' . $id . '_min_date_id_temp" id="' . $id . '_min_date_id_temp">
|
1835 |
+
|
1836 |
+
<input type="hidden" value="' . $param['w_max_date'] . '" name="' . $id . '_max_date_id_temp" id="' . $id . '_max_date_id_temp">
|
1837 |
+
|
1838 |
+
<input type="hidden" value="' . $param['w_invalid_dates'] . '" name="' . $id . '_invalid_dates_id_temp" id="' . $id . '_invalid_dates_id_temp">
|
1839 |
+
|
1840 |
+
<input type="hidden" value="' . $param['w_start_day'] . '" name="' . $id . '_start_dayform_id_temp" id="' . $id . '_start_dayform_id_temp">
|
1841 |
+
|
1842 |
+
<input type="hidden" value="' . $param['w_hide_time'] . '" name="' . $id . '_hide_timeform_id_temp" id="' . $id . '_hide_timeform_id_temp">
|
1843 |
+
|
1844 |
+
<input type="hidden" name="' . $id . '_show_week_days" id="' . $id . '_show_week_days" sunday="' . $w_show_week_days[0] . '" monday="' . $w_show_week_days[1] . '" tuesday="' . $w_show_week_days[2] . '" wednesday="' . $w_show_week_days[3] . '" thursday="' . $w_show_week_days[4] . '" friday="' . $w_show_week_days[5] . '" saturday="' . $w_show_week_days[6] . '">
|
1845 |
+
|
1846 |
+
|
1847 |
+
|
1848 |
+
|
1849 |
+
|
1850 |
+
<input type="text" id="' . $id . '_elementform_id_temp0" name="' . $id . '_elementform_id_temp0" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled />
|
1851 |
+
<span id="' . $id . '_show_imagedateform_id_temp0" class="dashicons dashicons-calendar-alt wd-calendar-button ' . ($param['w_show_image'] == "yes" ? "wd-inline-block" : "wd-hidden") . '"></span>
|
1852 |
+
<span>-</span>
|
1853 |
+
<input type="text" id="' . $id . '_elementform_id_temp1" name="' . $id . '_elementform_id_temp1" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled />
|
1854 |
+
<span id="' . $id . '_show_imagedateform_id_temp1" class="dashicons dashicons-calendar-alt wd-calendar-button ' . ($param['w_show_image'] == "yes" ? "wd-inline-block" : "wd-hidden") . '"></span>
|
1855 |
+
<input id="' . $id . '_buttonform_id_temp" type="hidden" value="' . $param['w_but_val'] . '" format="' . $param['w_format'] . '" />
|
1856 |
+
</div></div>';
|
1857 |
+
break;
|
1858 |
+
}
|
1859 |
+
case 'type_date_fields': {
|
1860 |
+
$params_names = array(
|
1861 |
+
'w_field_label_size',
|
1862 |
+
'w_field_label_pos',
|
1863 |
+
'w_day',
|
1864 |
+
'w_month',
|
1865 |
+
'w_year',
|
1866 |
+
'w_day_type',
|
1867 |
+
'w_month_type',
|
1868 |
+
'w_year_type',
|
1869 |
+
'w_day_label',
|
1870 |
+
'w_month_label',
|
1871 |
+
'w_year_label',
|
1872 |
+
'w_day_size',
|
1873 |
+
'w_month_size',
|
1874 |
+
'w_year_size',
|
1875 |
+
'w_required',
|
1876 |
+
'w_class',
|
1877 |
+
'w_from',
|
1878 |
+
'w_to',
|
1879 |
+
'w_divider',
|
1880 |
+
);
|
1881 |
+
$temp = $params;
|
1882 |
+
if ( strpos($temp, 'w_hide_label') > -1 ) {
|
1883 |
+
$params_names = array(
|
1884 |
+
'w_field_label_size',
|
1885 |
+
'w_field_label_pos',
|
1886 |
+
'w_hide_label',
|
1887 |
+
'w_day',
|
1888 |
+
'w_month',
|
1889 |
+
'w_year',
|
1890 |
+
'w_day_type',
|
1891 |
+
'w_month_type',
|
1892 |
+
'w_year_type',
|
1893 |
+
'w_day_label',
|
1894 |
+
'w_month_label',
|
1895 |
+
'w_year_label',
|
1896 |
+
'w_day_size',
|
1897 |
+
'w_month_size',
|
1898 |
+
'w_year_size',
|
1899 |
+
'w_required',
|
1900 |
+
'w_class',
|
1901 |
+
'w_from',
|
1902 |
+
'w_to',
|
1903 |
+
'w_divider',
|
1904 |
+
);
|
1905 |
+
}
|
1906 |
+
foreach ( $params_names as $params_name ) {
|
1907 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
1908 |
+
$param[$params_name] = $temp[0];
|
1909 |
+
$temp = $temp[1];
|
1910 |
+
}
|
1911 |
+
if ( $temp ) {
|
1912 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
1913 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
1914 |
+
foreach ( $attrs as $attr ) {
|
1915 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
1916 |
+
}
|
1917 |
+
}
|
1918 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
1919 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
1920 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
1921 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
1922 |
+
if ( $param['w_day_type'] == "SELECT" ) {
|
1923 |
+
$w_day_type = '<select id="' . $id . '_dayform_id_temp" name="' . $id . '_dayform_id_temp" onchange="set_select(this)" style="width: ' . $param['w_day_size'] . 'px;" ' . $param['attributes'] . ' disabled><option value=""></option>';
|
1924 |
+
for ( $k = 0; $k <= 31; $k++ ) {
|
1925 |
+
if ( $k < 10 ) {
|
1926 |
+
if ( $param['w_day'] == '0' . $k ) {
|
1927 |
+
$selected = "selected=\"selected\"";
|
1928 |
+
}
|
1929 |
+
else {
|
1930 |
+
$selected = "";
|
1931 |
+
}
|
1932 |
+
$w_day_type .= '<option value="0' . $k . '" ' . $selected . '>0' . $k . '</option>';
|
1933 |
+
}
|
1934 |
+
else {
|
1935 |
+
if ( $param['w_day'] == '' . $k ) {
|
1936 |
+
$selected = "selected=\"selected\"";
|
1937 |
+
}
|
1938 |
+
else {
|
1939 |
+
$selected = "";
|
1940 |
+
}
|
1941 |
+
$w_day_type .= '<option value="' . $k . '" ' . $selected . '>' . $k . '</option>';
|
1942 |
+
}
|
1943 |
+
}
|
1944 |
+
$w_day_type .= '</select>';
|
1945 |
+
}
|
1946 |
+
else {
|
1947 |
+
$w_day_type = '<input type="text" value="' . $param['w_day'] . '" id="' . $id . '_dayform_id_temp" name="' . $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'] . ' disabled/>';
|
1948 |
+
}
|
1949 |
+
if ( $param['w_month_type'] == "SELECT" ) {
|
1950 |
+
$w_month_type = '<select id="' . $id . '_monthform_id_temp" name="' . $id . '_monthform_id_temp" onchange="set_select(this)" style="width: ' . $param['w_month_size'] . 'px;" ' . $param['attributes'] . ' disabled><option value=""></option><option value="01" ' . ($param['w_month'] == "01" ? "selected=\"selected\"" : "") . ' ><!--repstart-->January<!--repend--></option><option value="02" ' . ($param['w_month'] == "02" ? "selected=\"selected\"" : "") . '><!--repstart-->February<!--repend--></option><option value="03" ' . ($param['w_month'] == "03" ? "selected=\"selected\"" : "") . '><!--repstart-->March<!--repend--></option><option value="04" ' . ($param['w_month'] == "04" ? "selected=\"selected\"" : "") . ' ><!--repstart-->April<!--repend--></option><option value="05" ' . ($param['w_month'] == "05" ? "selected=\"selected\"" : "") . ' ><!--repstart-->May<!--repend--></option><option value="06" ' . ($param['w_month'] == "06" ? "selected=\"selected\"" : "") . ' ><!--repstart-->June<!--repend--></option><option value="07" ' . ($param['w_month'] == "07" ? "selected=\"selected\"" : "") . ' ><!--repstart-->July<!--repend--></option><option value="08" ' . ($param['w_month'] == "08" ? "selected=\"selected\"" : "") . ' ><!--repstart-->August<!--repend--></option><option value="09" ' . ($param['w_month'] == "09" ? "selected=\"selected\"" : "") . ' ><!--repstart-->September<!--repend--></option><option value="10" ' . ($param['w_month'] == "10" ? "selected=\"selected\"" : "") . ' ><!--repstart-->October<!--repend--></option><option value="11" ' . ($param['w_month'] == "11" ? "selected=\"selected\"" : "") . '><!--repstart-->November<!--repend--></option><option value="12" ' . ($param['w_month'] == "12" ? "selected=\"selected\"" : "") . ' ><!--repstart-->December<!--repend--></option></select>';
|
1951 |
+
}
|
1952 |
+
else {
|
1953 |
+
$w_month_type = '<input type="text" value="' . $param['w_month'] . '" id="' . $id . '_monthform_id_temp" name="' . $id . '_monthform_id_temp" onblur="if (this.value=="0") this.value=""; else add_0("' . $id . '_monthform_id_temp")" style="width: ' . $param['w_month_size'] . 'px;" ' . $param['attributes'] . ' disabled/>';
|
1954 |
+
}
|
1955 |
+
$param['w_to'] = isset($param['w_to']) && $param['w_to'] != "NaN" ? $param['w_to'] : date("Y");
|
1956 |
+
if ( $param['w_year_type'] == "SELECT" ) {
|
1957 |
+
$w_year_type = '<select id="' . $id . '_yearform_id_temp" name="' . $id . '_yearform_id_temp" onchange="set_select(this)" from="' . $param['w_from'] . '" to="' . $param['w_to'] . '" style="width: ' . $param['w_year_size'] . 'px;" ' . $param['attributes'] . ' disabled><option value=""></option>';
|
1958 |
+
for ( $k = $param['w_to']; $k >= $param['w_from']; $k-- ) {
|
1959 |
+
if ( $param['w_year'] == $k ) {
|
1960 |
+
$selected = "selected=\"selected\"";
|
1961 |
+
}
|
1962 |
+
else {
|
1963 |
+
$selected = "";
|
1964 |
+
}
|
1965 |
+
$w_year_type .= '<option value="' . $k . '" ' . $selected . '>' . $k . '</option>';
|
1966 |
+
}
|
1967 |
+
$w_year_type .= '</select>';
|
1968 |
+
}
|
1969 |
+
else {
|
1970 |
+
$w_year_type = '<input type="text" value="' . $param['w_year'] . '" id="' . $id . '_yearform_id_temp" name="' . $id . '_yearform_id_temp" from="' . $param['w_from'] . '" to="' . $param['w_to'] . '" style="width: ' . $param['w_year_size'] . 'px;" ' . $param['attributes'] . ' disabled/>';
|
1971 |
+
}
|
1972 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_date_fields" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_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"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_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;">
|
1973 |
+
' . $w_day_type . '
|
1974 |
+
|
1975 |
+
</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>';
|
1976 |
+
break;
|
1977 |
+
}
|
1978 |
+
case 'type_file_upload': {
|
1979 |
+
$params_names = array(
|
1980 |
+
'w_field_label_size',
|
1981 |
+
'w_field_label_pos',
|
1982 |
+
'w_destination',
|
1983 |
+
'w_extension',
|
1984 |
+
'w_max_size',
|
1985 |
+
'w_required',
|
1986 |
+
'w_multiple',
|
1987 |
+
'w_class',
|
1988 |
+
);
|
1989 |
+
$temp = $params;
|
1990 |
+
if ( strpos($temp, 'w_hide_label') > -1 ) {
|
1991 |
+
$params_names = array(
|
1992 |
+
'w_field_label_size',
|
1993 |
+
'w_field_label_pos',
|
1994 |
+
'w_hide_label',
|
1995 |
+
'w_destination',
|
1996 |
+
'w_extension',
|
1997 |
+
'w_max_size',
|
1998 |
+
'w_required',
|
1999 |
+
'w_multiple',
|
2000 |
+
'w_class',
|
2001 |
+
);
|
2002 |
+
}
|
2003 |
+
foreach ( $params_names as $params_name ) {
|
2004 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
2005 |
+
$param[$params_name] = $temp[0];
|
2006 |
+
if ( isset($temp[1]) ) {
|
2007 |
+
$temp = $temp[1];
|
2008 |
+
}
|
2009 |
+
else {
|
2010 |
+
$temp = '';
|
2011 |
+
}
|
2012 |
+
}
|
2013 |
+
if ( $temp ) {
|
2014 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
2015 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
2016 |
+
foreach ( $attrs as $attr ) {
|
2017 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
2018 |
+
}
|
2019 |
+
}
|
2020 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
2021 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
2022 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
2023 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
2024 |
+
$multiple = ($param['w_multiple'] == "yes" ? "multiple='multiple'" : "");
|
2025 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_file_upload" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_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="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="***max_sizeskizb' . $id . '***' . $param['w_max_size'] . '***max_sizeverj' . $id . '***" id="' . $id . '_max_size" name="' . $id . '_max_size"><input type="hidden" value="***destinationskizb' . $id . '***' . $param['w_destination'] . '***destinationverj' . $id . '***" id="' . $id . '_destination" name="' . $id . '_destination"><input type="hidden" value="***extensionskizb' . $id . '***' . $param['w_extension'] . '***extensionverj' . $id . '***" id="' . $id . '_extension" name="' . $id . '_extension"><input type="file" class="file_upload" id="' . $id . '_elementform_id_temp" name="' . $id . '_fileform_id_temp" ' . $multiple . ' ' . $param['attributes'] . ' disabled/></div></div>';
|
2026 |
+
break;
|
2027 |
+
}
|
2028 |
+
case 'type_captcha': {
|
2029 |
+
$params_names = array( 'w_field_label_size', 'w_field_label_pos', 'w_digit', 'w_class' );
|
2030 |
+
$temp = $params;
|
2031 |
+
if ( strpos($temp, 'w_hide_label') > -1 ) {
|
2032 |
+
$params_names = array(
|
2033 |
+
'w_field_label_size',
|
2034 |
+
'w_field_label_pos',
|
2035 |
+
'w_hide_label',
|
2036 |
+
'w_digit',
|
2037 |
+
'w_class',
|
2038 |
+
);
|
2039 |
+
}
|
2040 |
+
foreach ( $params_names as $params_name ) {
|
2041 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
2042 |
+
$param[$params_name] = $temp[0];
|
2043 |
+
$temp = $temp[1];
|
2044 |
+
}
|
2045 |
+
if ( $temp ) {
|
2046 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
2047 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
2048 |
+
foreach ( $attrs as $attr ) {
|
2049 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
2050 |
+
}
|
2051 |
+
}
|
2052 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
2053 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
2054 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
2055 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_captcha" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display:' . $display_label . '; 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(
|
2056 |
+
'action' => 'formmakerwdcaptcha' . WDCFM()->plugin_postfix,
|
2057 |
+
'digit' => $param['w_digit'],
|
2058 |
+
'i' => 'form_id_temp',
|
2059 |
+
), 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'] . ' disabled/><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/></div></div></div></div></div>';
|
2060 |
+
break;
|
2061 |
+
}
|
2062 |
+
case 'type_arithmetic_captcha': {
|
2063 |
+
$params_names = array(
|
2064 |
+
'w_field_label_size',
|
2065 |
+
'w_field_label_pos',
|
2066 |
+
'w_count',
|
2067 |
+
'w_operations',
|
2068 |
+
'w_class',
|
2069 |
+
'w_input_size',
|
2070 |
+
);
|
2071 |
+
$temp = $params;
|
2072 |
+
if ( strpos($temp, 'w_hide_label') > -1 ) {
|
2073 |
+
$params_names = array(
|
2074 |
+
'w_field_label_size',
|
2075 |
+
'w_field_label_pos',
|
2076 |
+
'w_hide_label',
|
2077 |
+
'w_count',
|
2078 |
+
'w_operations',
|
2079 |
+
'w_class',
|
2080 |
+
'w_input_size',
|
2081 |
+
);
|
2082 |
+
}
|
2083 |
+
foreach ( $params_names as $params_name ) {
|
2084 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
2085 |
+
$param[$params_name] = $temp[0];
|
2086 |
+
$temp = $temp[1];
|
2087 |
+
}
|
2088 |
+
if ( $temp ) {
|
2089 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
2090 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
2091 |
+
foreach ( $attrs as $attr ) {
|
2092 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
2093 |
+
}
|
2094 |
+
}
|
2095 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
2096 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
2097 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
2098 |
+
$param['w_count'] = $param['w_count'] ? $param['w_count'] : 1;
|
2099 |
+
$param['w_operations'] = $param['w_operations'] ? $param['w_operations'] : '+, -, *, /';
|
2100 |
+
$param['w_input_size'] = $param['w_input_size'] ? $param['w_input_size'] : 60;
|
2101 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_arithmetic_captcha" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display:' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_captcha" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><div style="display: table;"><div style="display: table-row;"><div style="display: table-cell;"><img type="captcha" operations_count="' . $param['w_count'] . '" operations="' . $param['w_operations'] . '" input_size="' . $param['w_input_size'] . '" src="' . add_query_arg(array(
|
2102 |
+
'action' => 'formmakerwdmathcaptcha' . WDCFM()->plugin_postfix,
|
2103 |
+
'operations_count' => $param['w_count'],
|
2104 |
+
'operations' => urlencode($param['w_operations']),
|
2105 |
+
'i' => 'form_id_temp',
|
2106 |
+
), admin_url('admin-ajax.php')) . '" id="_wd_arithmetic_captchaform_id_temp" class="arithmetic_captcha_img" onclick="captcha_refresh("_wd_arithmetic_captcha","form_id_temp")" ' . $param['attributes'] . '></div><div style="display: table-cell;"><input type="text" class="arithmetic_captcha_input" id="_wd_arithmetic_captcha_inputform_id_temp" name="arithmetic_captcha_input" onkeypress="return check_isnum(event)" style="width: ' . $param['w_input_size'] . 'px;" ' . $param['attributes'] . ' disabled/><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/></div><div style="display: table-cell; vertical-align: middle;"><div class="captcha_refresh" id="_element_refreshform_id_temp" onclick="captcha_refresh("_wd_arithmetic_captcha","form_id_temp")" ' . $param['attributes'] . '></div></div></div></div></div></div>';
|
2107 |
+
break;
|
2108 |
+
}
|
2109 |
+
case 'type_recaptcha': {
|
2110 |
+
$params_names = array(
|
2111 |
+
'w_field_label_size',
|
2112 |
+
'w_field_label_pos',
|
2113 |
+
'w_public',
|
2114 |
+
'w_private',
|
2115 |
+
'w_theme',
|
2116 |
+
'w_class',
|
2117 |
+
);
|
2118 |
+
$temp = $params;
|
2119 |
+
if ( strpos($temp, 'w_hide_label') > -1 ) {
|
2120 |
+
$params_names = array(
|
2121 |
+
'w_field_label_size',
|
2122 |
+
'w_field_label_pos',
|
2123 |
+
'w_hide_label',
|
2124 |
+
'w_public',
|
2125 |
+
'w_private',
|
2126 |
+
'w_theme',
|
2127 |
+
'w_class',
|
2128 |
+
);
|
2129 |
+
}
|
2130 |
+
if ( strpos($temp, 'w_type') > -1 ) {
|
2131 |
+
$params_names = array(
|
2132 |
+
'w_field_label_size',
|
2133 |
+
'w_field_label_pos',
|
2134 |
+
'w_hide_label',
|
2135 |
+
'w_type',
|
2136 |
+
'w_position',
|
2137 |
+
);
|
2138 |
+
}
|
2139 |
+
$param['w_type'] = 'v2';
|
2140 |
+
$param['w_position'] = 'hidden';
|
2141 |
+
foreach ( $params_names as $params_name ) {
|
2142 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
2143 |
+
$param[$params_name] = $temp[0];
|
2144 |
+
$temp = $temp[1];
|
2145 |
+
}
|
2146 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
2147 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
2148 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
2149 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_recaptcha" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_recaptcha" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><div id="wd_recaptchaform_id_temp" w_type="' . $param['w_type'] . '" position="' . $param['w_position'] . '"><span style="color: red; font-style: italic;">' . __('No preview available for reCAPTCHA.', WDCFM()->prefix) . '</span></div></div></div>';
|
2150 |
+
break;
|
2151 |
+
}
|
2152 |
+
case 'type_hidden': {
|
2153 |
+
$params_names = array( 'w_name', 'w_value' );
|
2154 |
+
$temp = $params;
|
2155 |
+
foreach ( $params_names as $params_name ) {
|
2156 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
2157 |
+
$param[$params_name] = $temp[0];
|
2158 |
+
$temp = $temp[1];
|
2159 |
+
}
|
2160 |
+
if ( $temp ) {
|
2161 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
2162 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
2163 |
+
foreach ( $attrs as $attr ) {
|
2164 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
2165 |
+
}
|
2166 |
+
}
|
2167 |
+
$param['w_name'] = str_replace(' ', '', $param['w_name']);
|
2168 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_hidden" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" style="display: table-cell;"><span id="' . $id . '_element_labelform_id_temp" style="display: none;">' . $param['w_name'] . '</span><span style="color: red; font-size: 13px;">Hidden field</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" style="display: table-cell; padding-left:7px;"><input type="hidden" value="' . $param['w_value'] . '" id="' . $id . '_elementform_id_temp" name="' . $param['w_name'] . '" ' . $param['attributes'] . '><input type="hidden" value="type_hidden" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><div><span align="left">Name: </span><span align="left" id="' . $id . '_hidden_nameform_id_temp">' . $param['w_name'] . '</span></div><div><span align="left">Value: </span><span align="left" id="' . $id . '_hidden_valueform_id_temp">' . $param['w_value'] . '</span></div></div></div>';
|
2169 |
+
break;
|
2170 |
+
}
|
2171 |
+
case 'type_mark_map': {
|
2172 |
+
$params_names = array(
|
2173 |
+
'w_field_label_size',
|
2174 |
+
'w_field_label_pos',
|
2175 |
+
'w_center_x',
|
2176 |
+
'w_center_y',
|
2177 |
+
'w_long',
|
2178 |
+
'w_lat',
|
2179 |
+
'w_zoom',
|
2180 |
+
'w_width',
|
2181 |
+
'w_height',
|
2182 |
+
'w_info',
|
2183 |
+
'w_class',
|
2184 |
+
);
|
2185 |
+
$temp = $params;
|
2186 |
+
if ( strpos($temp, 'w_hide_label') > -1 ) {
|
2187 |
+
$params_names = array(
|
2188 |
+
'w_field_label_size',
|
2189 |
+
'w_field_label_pos',
|
2190 |
+
'w_hide_label',
|
2191 |
+
'w_center_x',
|
2192 |
+
'w_center_y',
|
2193 |
+
'w_long',
|
2194 |
+
'w_lat',
|
2195 |
+
'w_zoom',
|
2196 |
+
'w_width',
|
2197 |
+
'w_height',
|
2198 |
+
'w_info',
|
2199 |
+
'w_class',
|
2200 |
+
);
|
2201 |
+
}
|
2202 |
+
foreach ( $params_names as $params_name ) {
|
2203 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
2204 |
+
$param[$params_name] = $temp[0];
|
2205 |
+
$temp = $temp[1];
|
2206 |
+
}
|
2207 |
+
if ( $temp ) {
|
2208 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
2209 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
2210 |
+
foreach ( $attrs as $attr ) {
|
2211 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
2212 |
+
}
|
2213 |
+
}
|
2214 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
2215 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
2216 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
2217 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_mark_map" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; 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="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><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> ';
|
2218 |
+
break;
|
2219 |
+
}
|
2220 |
+
case 'type_map': {
|
2221 |
+
$params_names = array(
|
2222 |
+
'w_center_x',
|
2223 |
+
'w_center_y',
|
2224 |
+
'w_long',
|
2225 |
+
'w_lat',
|
2226 |
+
'w_zoom',
|
2227 |
+
'w_width',
|
2228 |
+
'w_height',
|
2229 |
+
'w_info',
|
2230 |
+
'w_class',
|
2231 |
+
);
|
2232 |
+
$temp = $params;
|
2233 |
+
foreach ( $params_names as $params_name ) {
|
2234 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
2235 |
+
$param[$params_name] = $temp[0];
|
2236 |
+
$temp = $temp[1];
|
2237 |
+
}
|
2238 |
+
if ( $temp ) {
|
2239 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
2240 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
2241 |
+
foreach ( $attrs as $attr ) {
|
2242 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
2243 |
+
}
|
2244 |
+
}
|
2245 |
+
$marker = '';
|
2246 |
+
$param['w_long'] = explode('***', $param['w_long']);
|
2247 |
+
$param['w_lat'] = explode('***', $param['w_lat']);
|
2248 |
+
$param['w_info'] = explode('***', $param['w_info']);
|
2249 |
+
foreach ( $param['w_long'] as $key => $w_long ) {
|
2250 |
+
$marker .= 'long' . $key . '="' . $w_long . '" lat' . $key . '="' . $param['w_lat'][$key] . '" info' . $key . '="' . $param['w_info'][$key] . '"';
|
2251 |
+
}
|
2252 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_map" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: table-cell;"><span id="' . $id . '_element_labelform_id_temp" style="display: none;">' . $label . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: table-cell;"><input type="hidden" value="type_map" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><div id="' . $id . '_elementform_id_temp" zoom="' . $param['w_zoom'] . '" center_x="' . $param['w_center_x'] . '" center_y="' . $param['w_center_y'] . '" style="width: ' . $param['w_width'] . 'px; height: ' . $param['w_height'] . 'px;" ' . $marker . ' ' . $param['attributes'] . '></div></div></div>';
|
2253 |
+
break;
|
2254 |
+
}
|
2255 |
+
case 'type_paypal_price': {
|
2256 |
+
$params_names = array(
|
2257 |
+
'w_field_label_size',
|
2258 |
+
'w_field_label_pos',
|
2259 |
+
'w_first_val',
|
2260 |
+
'w_title',
|
2261 |
+
'w_mini_labels',
|
2262 |
+
'w_size',
|
2263 |
+
'w_required',
|
2264 |
+
'w_hide_cents',
|
2265 |
+
'w_class',
|
2266 |
+
'w_range_min',
|
2267 |
+
'w_range_max',
|
2268 |
+
);
|
2269 |
+
$temp = $params;
|
2270 |
+
foreach ( $params_names as $params_name ) {
|
2271 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
2272 |
+
$param[$params_name] = $temp[0];
|
2273 |
+
$temp = $temp[1];
|
2274 |
+
}
|
2275 |
+
if ( $temp ) {
|
2276 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
2277 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
2278 |
+
foreach ( $attrs as $attr ) {
|
2279 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
2280 |
+
}
|
2281 |
+
}
|
2282 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
2283 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
2284 |
+
$hide_cents = ($param['w_hide_cents'] == "yes" ? "none;" : "table-cell;");
|
2285 |
+
$w_first_val = explode('***', $param['w_first_val']);
|
2286 |
+
$w_title = explode('***', $param['w_title']);
|
2287 |
+
$w_mini_labels = explode('***', $param['w_mini_labels']);
|
2288 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_paypal_price" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required"style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_paypal_price" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_range_min'] . '" name="' . $id . '_range_minform_id_temp" id="' . $id . '_range_minform_id_temp"><input type="hidden" value="' . $param['w_range_max'] . '" name="' . $id . '_range_maxform_id_temp" id="' . $id . '_range_maxform_id_temp"><div id="' . $id . '_table_price" style="display: table;"><div id="' . $id . '_tr_price1" style="display: table-row;"><div id="' . $id . '_td_name_currency" style="display: table-cell;"><span class="wdform_colon" style="vertical-align: middle;"><!--repstart--> $ <!--repend--></span></div><div id="' . $id . '_td_name_dollars" style="display: table-cell;"><input type="text" id="' . $id . '_element_dollarsform_id_temp" name="' . $id . '_element_dollarsform_id_temp" value="' . $w_first_val[0] . '" title="' . $w_title[0] . '" onkeypress="return check_isnum(event)" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled/></div><div id="' . $id . '_td_name_divider" style="display: ' . $hide_cents . ';"><span class="wdform_colon" style="vertical-align: middle;"> . </span></div><div id="' . $id . '_td_name_cents" style="display: ' . $hide_cents . '"><input type="text" id="' . $id . '_element_centsform_id_temp" name="' . $id . '_element_centsform_id_temp" value="' . $w_first_val[1] . '" title="' . $w_title[1] . '" onblur="add_0("' . $id . '_element_centsform_id_temp")" onkeypress="return check_isnum_interval(event,"' . $id . '_element_centsform_id_temp",0,99)"style="width: 30px;" ' . $param['attributes'] . ' disabled/></div></div><div id="' . $id . '_tr_price2" style="display: table-row;"><div style="display: table-cell;"><label class="mini_label"></label></div><div align="left" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_dollars">' . $w_mini_labels[0] . '</label></div><div id="' . $id . '_td_name_label_divider" style="display: ' . $hide_cents . '"><label class="mini_label"></label></div><div align="left" id="' . $id . '_td_name_label_cents" style="display: ' . $hide_cents . '"><label class="mini_label" id="' . $id . '_mini_label_cents">' . $w_mini_labels[1] . '</label></div></div></div></div></div>';
|
2289 |
+
break;
|
2290 |
+
}
|
2291 |
+
case 'type_paypal_price_new': {
|
2292 |
+
$params_names = array(
|
2293 |
+
'w_field_label_size',
|
2294 |
+
'w_field_label_pos',
|
2295 |
+
'w_first_val',
|
2296 |
+
'w_title',
|
2297 |
+
'w_size',
|
2298 |
+
'w_required',
|
2299 |
+
'w_class',
|
2300 |
+
'w_range_min',
|
2301 |
+
'w_range_max',
|
2302 |
+
'w_readonly',
|
2303 |
+
'w_currency',
|
2304 |
+
);
|
2305 |
+
$temp = $params;
|
2306 |
+
if ( strpos($temp, 'w_hide_label') > -1 ) {
|
2307 |
+
$params_names = array(
|
2308 |
+
'w_field_label_size',
|
2309 |
+
'w_field_label_pos',
|
2310 |
+
'w_hide_label',
|
2311 |
+
'w_first_val',
|
2312 |
+
'w_title',
|
2313 |
+
'w_size',
|
2314 |
+
'w_required',
|
2315 |
+
'w_class',
|
2316 |
+
'w_range_min',
|
2317 |
+
'w_range_max',
|
2318 |
+
'w_readonly',
|
2319 |
+
'w_currency',
|
2320 |
+
);
|
2321 |
+
}
|
2322 |
+
foreach ( $params_names as $params_name ) {
|
2323 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
2324 |
+
$param[$params_name] = $temp[0];
|
2325 |
+
$temp = $temp[1];
|
2326 |
+
}
|
2327 |
+
if ( $temp ) {
|
2328 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
2329 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
2330 |
+
foreach ( $attrs as $attr ) {
|
2331 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
2332 |
+
}
|
2333 |
+
}
|
2334 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
2335 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
2336 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
2337 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
2338 |
+
$currency_sumbol = ($param['w_currency'] == "yes" ? "display:none;" : "display: table-cell;");
|
2339 |
+
$param['w_readonly'] = (isset($param['w_readonly']) ? $param['w_readonly'] : "no");
|
2340 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_paypal_price_new" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required"style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_paypal_price_new" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_readonly'] . '" name="' . $id . '_readonlyform_id_temp" id="' . $id . '_readonlyform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_range_min'] . '" name="' . $id . '_range_minform_id_temp" id="' . $id . '_range_minform_id_temp"><input type="hidden" value="' . $param['w_range_max'] . '" name="' . $id . '_range_maxform_id_temp" id="' . $id . '_range_maxform_id_temp"><div id="' . $id . '_table_price" style="display: table;"><div id="' . $id . '_tr_price1" style="display: table-row;"><div id="' . $id . '_td_name_currency" style="' . $currency_sumbol . '"><span class="wdform_colon" style="vertical-align: middle;"><!--repstart--> $ <!--repend--></span></div><div id="' . $id . '_td_name_dollars" style="display: table-cell;"><input type="text" id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" value="' . $param['w_first_val'] . '" title="' . $param['w_title'] . '" placeholder="' . $param['w_title'] . '" onkeypress="return check_isnum(event)" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled/></div></div></div></div></div>';
|
2341 |
+
break;
|
2342 |
+
}
|
2343 |
+
case 'type_paypal_select': {
|
2344 |
+
$params_names = array(
|
2345 |
+
'w_field_label_size',
|
2346 |
+
'w_field_label_pos',
|
2347 |
+
'w_size',
|
2348 |
+
'w_choices',
|
2349 |
+
'w_choices_price',
|
2350 |
+
'w_choices_checked',
|
2351 |
+
'w_choices_disabled',
|
2352 |
+
'w_required',
|
2353 |
+
'w_quantity',
|
2354 |
+
'w_quantity_value',
|
2355 |
+
'w_class',
|
2356 |
+
'w_property',
|
2357 |
+
'w_property_values',
|
2358 |
+
);
|
2359 |
+
$temp = $params;
|
2360 |
+
if ( strpos($temp, 'w_choices_params') > -1 ) {
|
2361 |
+
$params_names = array(
|
2362 |
+
'w_field_label_size',
|
2363 |
+
'w_field_label_pos',
|
2364 |
+
'w_size',
|
2365 |
+
'w_choices',
|
2366 |
+
'w_choices_price',
|
2367 |
+
'w_choices_checked',
|
2368 |
+
'w_choices_disabled',
|
2369 |
+
'w_required',
|
2370 |
+
'w_quantity',
|
2371 |
+
'w_quantity_value',
|
2372 |
+
'w_choices_params',
|
2373 |
+
'w_class',
|
2374 |
+
'w_property',
|
2375 |
+
'w_property_values',
|
2376 |
+
);
|
2377 |
+
}
|
2378 |
+
if ( strpos($temp, 'w_hide_label') > -1 ) {
|
2379 |
+
$params_names = array(
|
2380 |
+
'w_field_label_size',
|
2381 |
+
'w_field_label_pos',
|
2382 |
+
'w_hide_label',
|
2383 |
+
'w_size',
|
2384 |
+
'w_choices',
|
2385 |
+
'w_choices_price',
|
2386 |
+
'w_choices_checked',
|
2387 |
+
'w_choices_disabled',
|
2388 |
+
'w_required',
|
2389 |
+
'w_quantity',
|
2390 |
+
'w_quantity_value',
|
2391 |
+
'w_choices_params',
|
2392 |
+
'w_class',
|
2393 |
+
'w_property',
|
2394 |
+
'w_property_values',
|
2395 |
+
);
|
2396 |
+
}
|
2397 |
+
foreach ( $params_names as $params_name ) {
|
2398 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
2399 |
+
$param[$params_name] = $temp[0];
|
2400 |
+
$temp = $temp[1];
|
2401 |
+
}
|
2402 |
+
if ( $temp ) {
|
2403 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
2404 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
2405 |
+
foreach ( $attrs as $attr ) {
|
2406 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
2407 |
+
}
|
2408 |
+
}
|
2409 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
2410 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
2411 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
2412 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
2413 |
+
$param['w_choices'] = explode('***', $param['w_choices']);
|
2414 |
+
$param['w_choices_price'] = explode('***', $param['w_choices_price']);
|
2415 |
+
$param['w_choices_checked'] = explode('***', $param['w_choices_checked']);
|
2416 |
+
$param['w_choices_disabled'] = explode('***', $param['w_choices_disabled']);
|
2417 |
+
$param['w_property'] = explode('***', $param['w_property']);
|
2418 |
+
$param['w_property_values'] = explode('***', $param['w_property_values']);
|
2419 |
+
if ( isset($param['w_choices_params']) ) {
|
2420 |
+
$param['w_choices_params'] = explode('***', $param['w_choices_params']);
|
2421 |
+
}
|
2422 |
+
foreach ( $param['w_choices_checked'] as $key => $choices_checked ) {
|
2423 |
+
if ( $choices_checked == 'true' ) {
|
2424 |
+
$param['w_choices_checked'][$key] = 'selected="selected"';
|
2425 |
+
}
|
2426 |
+
else {
|
2427 |
+
$param['w_choices_checked'][$key] = '';
|
2428 |
+
}
|
2429 |
+
}
|
2430 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_paypal_select" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '; "><input type="hidden" value="type_paypal_select" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><select id="' . $id . '_elementform_id_temp" name="' . $id . '_elementform_id_temp" onchange="set_select(this)" style="width: ' . $param['w_size'] . 'px;" ' . $param['attributes'] . ' disabled>';
|
2431 |
+
foreach ( $param['w_choices'] as $key => $choice ) {
|
2432 |
+
$where = '';
|
2433 |
+
$order_by = '';
|
2434 |
+
$db_info = '';
|
2435 |
+
$choice_value = $param['w_choices_disabled'][$key] == "true" ? '' : $param['w_choices_price'][$key];
|
2436 |
+
if ( isset($param['w_choices_params']) && $param['w_choices_params'][$key] ) {
|
2437 |
+
$w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$key]);
|
2438 |
+
$where = 'where="' . $w_choices_params[0] . '"';
|
2439 |
+
$w_choices_params = explode('[db_info]', $w_choices_params[1]);
|
2440 |
+
$order_by = "order_by='" . $w_choices_params[0] . "'";
|
2441 |
+
$db_info = "db_info='" . $w_choices_params[1] . "'";
|
2442 |
+
}
|
2443 |
+
$rep .= '<option id="' . $id . '_option' . $key . '" value="' . $choice_value . '" onselect="set_select("' . $id . '_option' . $key . '")" ' . $param['w_choices_checked'][$key] . ' ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $choice . '</option>';
|
2444 |
+
}
|
2445 |
+
$rep .= '</select><div id="' . $id . '_divform_id_temp">';
|
2446 |
+
if ( $param['w_quantity'] == "yes" ) {
|
2447 |
+
$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)" style="width: 30px; margin: 2px 0px;" disabled /></span>';
|
2448 |
+
}
|
2449 |
+
if ( $param['w_property'][0] ) {
|
2450 |
+
foreach ( $param['w_property'] as $key => $property ) {
|
2451 |
+
$rep .= '
|
2452 |
+
<span id="' . $id . '_property_' . $key . '" style="margin-right: 15px;">
|
2453 |
+
|
2454 |
+
<label class="mini_label" id="' . $id . '_property_label_form_id_temp' . $key . '" style="margin-right: 5px;">' . $property . '</label>
|
2455 |
+
<select id="' . $id . '_propertyform_id_temp' . $key . '" name="' . $id . '_propertyform_id_temp' . $key . '" style="width: auto; margin: 2px 0px;" disabled>';
|
2456 |
+
$param['w_property_values'][$key] = explode('###', $param['w_property_values'][$key]);
|
2457 |
+
$param['w_property_values'][$key] = array_slice($param['w_property_values'][$key], 1, count($param['w_property_values'][$key]));
|
2458 |
+
foreach ( $param['w_property_values'][$key] as $subkey => $property_value ) {
|
2459 |
+
$rep .= '<option id="' . $id . '_' . $key . '_option' . $subkey . '" value="' . $property_value . '">' . $property_value . '</option>';
|
2460 |
+
}
|
2461 |
+
$rep .= '</select></span>';
|
2462 |
+
}
|
2463 |
+
}
|
2464 |
+
$rep .= '</div></div></div>';
|
2465 |
+
break;
|
2466 |
+
}
|
2467 |
+
case 'type_paypal_checkbox': {
|
2468 |
+
$params_names = array(
|
2469 |
+
'w_field_label_size',
|
2470 |
+
'w_field_label_pos',
|
2471 |
+
'w_flow',
|
2472 |
+
'w_choices',
|
2473 |
+
'w_choices_price',
|
2474 |
+
'w_choices_checked',
|
2475 |
+
'w_required',
|
2476 |
+
'w_randomize',
|
2477 |
+
'w_allow_other',
|
2478 |
+
'w_allow_other_num',
|
2479 |
+
'w_class',
|
2480 |
+
'w_property',
|
2481 |
+
'w_property_values',
|
2482 |
+
'w_quantity',
|
2483 |
+
'w_quantity_value',
|
2484 |
+
);
|
2485 |
+
$temp = $params;
|
2486 |
+
if ( strpos($temp, 'w_field_option_pos') > -1 ) {
|
2487 |
+
$params_names = array(
|
2488 |
+
'w_field_label_size',
|
2489 |
+
'w_field_label_pos',
|
2490 |
+
'w_field_option_pos',
|
2491 |
+
'w_flow',
|
2492 |
+
'w_choices',
|
2493 |
+
'w_choices_price',
|
2494 |
+
'w_choices_checked',
|
2495 |
+
'w_required',
|
2496 |
+
'w_randomize',
|
2497 |
+
'w_allow_other',
|
2498 |
+
'w_allow_other_num',
|
2499 |
+
'w_choices_params',
|
2500 |
+
'w_class',
|
2501 |
+
'w_property',
|
2502 |
+
'w_property_values',
|
2503 |
+
'w_quantity',
|
2504 |
+
'w_quantity_value',
|
2505 |
+
);
|
2506 |
+
}
|
2507 |
+
if ( strpos($temp, 'w_hide_label') > -1 ) {
|
2508 |
+
$params_names = array(
|
2509 |
+
'w_field_label_size',
|
2510 |
+
'w_field_label_pos',
|
2511 |
+
'w_field_option_pos',
|
2512 |
+
'w_hide_label',
|
2513 |
+
'w_flow',
|
2514 |
+
'w_choices',
|
2515 |
+
'w_choices_price',
|
2516 |
+
'w_choices_checked',
|
2517 |
+
'w_required',
|
2518 |
+
'w_randomize',
|
2519 |
+
'w_allow_other',
|
2520 |
+
'w_allow_other_num',
|
2521 |
+
'w_choices_params',
|
2522 |
+
'w_class',
|
2523 |
+
'w_property',
|
2524 |
+
'w_property_values',
|
2525 |
+
'w_quantity',
|
2526 |
+
'w_quantity_value',
|
2527 |
+
);
|
2528 |
+
}
|
2529 |
+
foreach ( $params_names as $params_name ) {
|
2530 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
2531 |
+
$param[$params_name] = $temp[0];
|
2532 |
+
$temp = $temp[1];
|
2533 |
+
}
|
2534 |
+
if ( $temp ) {
|
2535 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
2536 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
2537 |
+
foreach ( $attrs as $attr ) {
|
2538 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
2539 |
+
}
|
2540 |
+
}
|
2541 |
+
if ( !isset($param['w_field_option_pos']) ) {
|
2542 |
+
$param['w_field_option_pos'] = 'left';
|
2543 |
+
}
|
2544 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
2545 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
2546 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
2547 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
2548 |
+
$param['w_choices'] = explode('***', $param['w_choices']);
|
2549 |
+
$param['w_choices_price'] = explode('***', $param['w_choices_price']);
|
2550 |
+
$param['w_choices_checked'] = explode('***', $param['w_choices_checked']);
|
2551 |
+
$param['w_property'] = explode('***', $param['w_property']);
|
2552 |
+
$param['w_property_values'] = explode('***', $param['w_property_values']);
|
2553 |
+
if ( isset($param['w_choices_params']) ) {
|
2554 |
+
$param['w_choices_params'] = explode('***', $param['w_choices_params']);
|
2555 |
+
}
|
2556 |
+
foreach ( $param['w_choices_checked'] as $key => $choices_checked ) {
|
2557 |
+
if ( $choices_checked == 'true' ) {
|
2558 |
+
$param['w_choices_checked'][$key] = 'checked="checked"';
|
2559 |
+
}
|
2560 |
+
else {
|
2561 |
+
$param['w_choices_checked'][$key] = '';
|
2562 |
+
}
|
2563 |
+
}
|
2564 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_paypal_checkbox" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="wd_form_label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_paypal_checkbox" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_randomize'] . '" name="' . $id . '_randomizeform_id_temp" id="' . $id . '_randomizeform_id_temp"><input type="hidden" value="' . $param['w_allow_other'] . '" name="' . $id . '_allow_otherform_id_temp" id="' . $id . '_allow_otherform_id_temp"><input type="hidden" value="' . $param['w_allow_other_num'] . '" name="' . $id . '_allow_other_numform_id_temp" id="' . $id . '_allow_other_numform_id_temp"><input type="hidden" value="' . $param['w_field_option_pos'] . '" id="' . $id . '_option_left_right"><div style="display: table;"><div id="' . $id . '_table_little" style="display: table-row-group;">';
|
2565 |
+
if ( $param['w_flow'] == 'hor' ) {
|
2566 |
+
$rep .= '<div id="' . $id . '_hor" style="display: table-row;">';
|
2567 |
+
foreach ( $param['w_choices'] as $key => $choice ) {
|
2568 |
+
$where = '';
|
2569 |
+
$order_by = '';
|
2570 |
+
$db_info = '';
|
2571 |
+
if ( isset($param['w_choices_params']) && $param['w_choices_params'][$key] ) {
|
2572 |
+
$w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$key]);
|
2573 |
+
$where = 'where="' . $w_choices_params[0] . '"';
|
2574 |
+
$w_choices_params = explode('[db_info]', $w_choices_params[1]);
|
2575 |
+
$order_by = "order_by='" . $w_choices_params[0] . "'";
|
2576 |
+
$db_info = "db_info='" . $w_choices_params[1] . "'";
|
2577 |
+
}
|
2578 |
+
$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'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . $key . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . $key . '" ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $choice . '</label></div>';
|
2579 |
+
}
|
2580 |
+
$rep .= '</div>';
|
2581 |
+
}
|
2582 |
+
else {
|
2583 |
+
foreach ( $param['w_choices'] as $key => $choice ) {
|
2584 |
+
$where = '';
|
2585 |
+
$order_by = '';
|
2586 |
+
$db_info = '';
|
2587 |
+
if ( isset($param['w_choices_params']) && $param['w_choices_params'][$key] ) {
|
2588 |
+
$w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$key]);
|
2589 |
+
$where = 'where="' . $w_choices_params[0] . '"';
|
2590 |
+
$w_choices_params = explode('[db_info]', $w_choices_params[1]);
|
2591 |
+
$order_by = "order_by='" . $w_choices_params[0] . "'";
|
2592 |
+
$db_info = "db_info='" . $w_choices_params[1] . "'";
|
2593 |
+
}
|
2594 |
+
$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'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . $key . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . $key . '" ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $choice . '</label></div></div>';
|
2595 |
+
}
|
2596 |
+
}
|
2597 |
+
$rep .= '</div></div>';
|
2598 |
+
$rep .= '<div id="' . $id . '_divform_id_temp">';
|
2599 |
+
if ( $param['w_quantity'] == "yes" ) {
|
2600 |
+
$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)" style="width: 30px; margin: 2px 0px;" disabled/></span>';
|
2601 |
+
}
|
2602 |
+
if ( $param['w_property'][0] ) {
|
2603 |
+
foreach ( $param['w_property'] as $key => $property ) {
|
2604 |
+
$rep .= '
|
2605 |
+
<span id="' . $id . '_property_' . $key . '" style="margin-right: 15px;">
|
2606 |
+
|
2607 |
+
<label class="mini_label" id="' . $id . '_property_label_form_id_temp' . $key . '" style="margin-right: 5px;">' . $property . '</label>
|
2608 |
+
<select id="' . $id . '_propertyform_id_temp' . $key . '" name="' . $id . '_propertyform_id_temp' . $key . '" style="width: auto; margin: 2px 0px;" disabled>';
|
2609 |
+
$param['w_property_values'][$key] = explode('###', $param['w_property_values'][$key]);
|
2610 |
+
$param['w_property_values'][$key] = array_slice($param['w_property_values'][$key], 1, count($param['w_property_values'][$key]));
|
2611 |
+
foreach ( $param['w_property_values'][$key] as $subkey => $property_value ) {
|
2612 |
+
$rep .= '<option id="' . $id . '_' . $key . '_option' . $subkey . '" value="' . $property_value . '">' . $property_value . '</option>';
|
2613 |
+
}
|
2614 |
+
$rep .= '</select></span>';
|
2615 |
+
}
|
2616 |
+
}
|
2617 |
+
$rep .= '</div></div></div>';
|
2618 |
+
break;
|
2619 |
+
}
|
2620 |
+
case 'type_paypal_radio': {
|
2621 |
+
$params_names = array(
|
2622 |
+
'w_field_label_size',
|
2623 |
+
'w_field_label_pos',
|
2624 |
+
'w_flow',
|
2625 |
+
'w_choices',
|
2626 |
+
'w_choices_price',
|
2627 |
+
'w_choices_checked',
|
2628 |
+
'w_required',
|
2629 |
+
'w_randomize',
|
2630 |
+
'w_allow_other',
|
2631 |
+
'w_allow_other_num',
|
2632 |
+
'w_class',
|
2633 |
+
'w_property',
|
2634 |
+
'w_property_values',
|
2635 |
+
'w_quantity',
|
2636 |
+
'w_quantity_value',
|
2637 |
+
);
|
2638 |
+
$temp = $params;
|
2639 |
+
if ( strpos($temp, 'w_field_option_pos') > -1 ) {
|
2640 |
+
$params_names = array(
|
2641 |
+
'w_field_label_size',
|
2642 |
+
'w_field_label_pos',
|
2643 |
+
'w_field_option_pos',
|
2644 |
+
'w_flow',
|
2645 |
+
'w_choices',
|
2646 |
+
'w_choices_price',
|
2647 |
+
'w_choices_checked',
|
2648 |
+
'w_required',
|
2649 |
+
'w_randomize',
|
2650 |
+
'w_allow_other',
|
2651 |
+
'w_allow_other_num',
|
2652 |
+
'w_choices_params',
|
2653 |
+
'w_class',
|
2654 |
+
'w_property',
|
2655 |
+
'w_property_values',
|
2656 |
+
'w_quantity',
|
2657 |
+
'w_quantity_value',
|
2658 |
+
);
|
2659 |
+
}
|
2660 |
+
if ( strpos($temp, 'w_hide_label') > -1 ) {
|
2661 |
+
$params_names = array(
|
2662 |
+
'w_field_label_size',
|
2663 |
+
'w_field_label_pos',
|
2664 |
+
'w_field_option_pos',
|
2665 |
+
'w_hide_label',
|
2666 |
+
'w_flow',
|
2667 |
+
'w_choices',
|
2668 |
+
'w_choices_price',
|
2669 |
+
'w_choices_checked',
|
2670 |
+
'w_required',
|
2671 |
+
'w_randomize',
|
2672 |
+
'w_allow_other',
|
2673 |
+
'w_allow_other_num',
|
2674 |
+
'w_choices_params',
|
2675 |
+
'w_class',
|
2676 |
+
'w_property',
|
2677 |
+
'w_property_values',
|
2678 |
+
'w_quantity',
|
2679 |
+
'w_quantity_value',
|
2680 |
+
);
|
2681 |
+
}
|
2682 |
+
foreach ( $params_names as $params_name ) {
|
2683 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
2684 |
+
$param[$params_name] = $temp[0];
|
2685 |
+
$temp = $temp[1];
|
2686 |
+
}
|
2687 |
+
if ( $temp ) {
|
2688 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
2689 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
2690 |
+
foreach ( $attrs as $attr ) {
|
2691 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
2692 |
+
}
|
2693 |
+
}
|
2694 |
+
if ( !isset($param['w_field_option_pos']) ) {
|
2695 |
+
$param['w_field_option_pos'] = 'left';
|
2696 |
+
}
|
2697 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
2698 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
2699 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
2700 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
2701 |
+
$param['w_choices'] = explode('***', $param['w_choices']);
|
2702 |
+
$param['w_choices_price'] = explode('***', $param['w_choices_price']);
|
2703 |
+
$param['w_choices_checked'] = explode('***', $param['w_choices_checked']);
|
2704 |
+
$param['w_property'] = explode('***', $param['w_property']);
|
2705 |
+
$param['w_property_values'] = explode('***', $param['w_property_values']);
|
2706 |
+
if ( isset($param['w_choices_params']) ) {
|
2707 |
+
$param['w_choices_params'] = explode('***', $param['w_choices_params']);
|
2708 |
+
}
|
2709 |
+
foreach ( $param['w_choices_checked'] as $key => $choices_checked ) {
|
2710 |
+
if ( $choices_checked == 'true' ) {
|
2711 |
+
$param['w_choices_checked'][$key] = 'checked="checked"';
|
2712 |
+
}
|
2713 |
+
else {
|
2714 |
+
$param['w_choices_checked'][$key] = '';
|
2715 |
+
}
|
2716 |
+
}
|
2717 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_paypal_radio" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="wd_form_label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><input type="hidden" value="type_paypal_radio" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_randomize'] . '" name="' . $id . '_randomizeform_id_temp" id="' . $id . '_randomizeform_id_temp"><input type="hidden" value="' . $param['w_allow_other'] . '" name="' . $id . '_allow_otherform_id_temp" id="' . $id . '_allow_otherform_id_temp"><input type="hidden" value="' . $param['w_allow_other_num'] . '" name="' . $id . '_allow_other_numform_id_temp" id="' . $id . '_allow_other_numform_id_temp"><input type="hidden" value="' . $param['w_field_option_pos'] . '" id="' . $id . '_option_left_right"><div style="display: table;"><div id="' . $id . '_table_little" style="display: table-row-group;">';
|
2718 |
+
if ( $param['w_flow'] == 'hor' ) {
|
2719 |
+
$rep .= '<div id="' . $id . '_hor" style="display: table-row;">';
|
2720 |
+
foreach ( $param['w_choices'] as $key => $choice ) {
|
2721 |
+
$where = '';
|
2722 |
+
$order_by = '';
|
2723 |
+
$db_info = '';
|
2724 |
+
if ( isset($param['w_choices_params']) && $param['w_choices_params'][$key] ) {
|
2725 |
+
$w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$key]);
|
2726 |
+
$where = 'where="' . $w_choices_params[0] . '"';
|
2727 |
+
$w_choices_params = explode('[db_info]', $w_choices_params[1]);
|
2728 |
+
$order_by = "order_by='" . $w_choices_params[0] . "'";
|
2729 |
+
$db_info = "db_info='" . $w_choices_params[1] . "'";
|
2730 |
+
}
|
2731 |
+
$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'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . $key . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . $key . '" ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $choice . '</label></div>';
|
2732 |
+
}
|
2733 |
+
$rep .= '</div>';
|
2734 |
+
}
|
2735 |
+
else {
|
2736 |
+
foreach ( $param['w_choices'] as $key => $choice ) {
|
2737 |
+
$where = '';
|
2738 |
+
$order_by = '';
|
2739 |
+
$db_info = '';
|
2740 |
+
if ( isset($param['w_choices_params']) && $param['w_choices_params'][$key] ) {
|
2741 |
+
$w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$key]);
|
2742 |
+
$where = 'where="' . $w_choices_params[0] . '"';
|
2743 |
+
$w_choices_params = explode('[db_info]', $w_choices_params[1]);
|
2744 |
+
$order_by = "order_by='" . $w_choices_params[0] . "'";
|
2745 |
+
$db_info = "db_info='" . $w_choices_params[1] . "'";
|
2746 |
+
}
|
2747 |
+
$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'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . $key . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . $key . '" ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $choice . '</label></div></div>';
|
2748 |
+
}
|
2749 |
+
}
|
2750 |
+
$rep .= '</div></div>';
|
2751 |
+
$rep .= '<div id="' . $id . '_divform_id_temp">';
|
2752 |
+
if ( $param['w_quantity'] == "yes" ) {
|
2753 |
+
$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)" style="width: 30px; margin: 2px 0px;" disabled/></span>';
|
2754 |
+
}
|
2755 |
+
if ( $param['w_property'][0] ) {
|
2756 |
+
foreach ( $param['w_property'] as $key => $property ) {
|
2757 |
+
$rep .= '
|
2758 |
+
<span id="' . $id . '_property_' . $key . '" style="margin-right: 15px;">
|
2759 |
+
|
2760 |
+
<label class="mini_label" id="' . $id . '_property_label_form_id_temp' . $key . '" style="margin-right: 5px;">' . $property . '</label>
|
2761 |
+
<select id="' . $id . '_propertyform_id_temp' . $key . '" name="' . $id . '_propertyform_id_temp' . $key . '" style="width: auto; margin: 2px 0px;" disabled>';
|
2762 |
+
$param['w_property_values'][$key] = explode('###', $param['w_property_values'][$key]);
|
2763 |
+
$param['w_property_values'][$key] = array_slice($param['w_property_values'][$key], 1, count($param['w_property_values'][$key]));
|
2764 |
+
foreach ( $param['w_property_values'][$key] as $subkey => $property_value ) {
|
2765 |
+
$rep .= '<option id="' . $id . '_' . $key . '_option' . $subkey . '" value="' . $property_value . '">' . $property_value . '</option>';
|
2766 |
+
}
|
2767 |
+
$rep .= '</select></span>';
|
2768 |
+
}
|
2769 |
+
}
|
2770 |
+
$rep .= '</div></div></div>';
|
2771 |
+
break;
|
2772 |
+
}
|
2773 |
+
case 'type_paypal_shipping': {
|
2774 |
+
$params_names = array(
|
2775 |
+
'w_field_label_size',
|
2776 |
+
'w_field_label_pos',
|
2777 |
+
'w_flow',
|
2778 |
+
'w_choices',
|
2779 |
+
'w_choices_price',
|
2780 |
+
'w_choices_checked',
|
2781 |
+
'w_required',
|
2782 |
+
'w_randomize',
|
2783 |
+
'w_allow_other',
|
2784 |
+
'w_allow_other_num',
|
2785 |
+
'w_class',
|
2786 |
+
);
|
2787 |
+
$temp = $params;
|
2788 |
+
if ( strpos($temp, 'w_field_option_pos') > -1 ) {
|
2789 |
+
$params_names = array(
|
2790 |
+
'w_field_label_size',
|
2791 |
+
'w_field_label_pos',
|
2792 |
+
'w_field_option_pos',
|
2793 |
+
'w_flow',
|
2794 |
+
'w_choices',
|
2795 |
+
'w_choices_price',
|
2796 |
+
'w_choices_checked',
|
2797 |
+
'w_required',
|
2798 |
+
'w_randomize',
|
2799 |
+
'w_allow_other',
|
2800 |
+
'w_allow_other_num',
|
2801 |
+
'w_choices_params',
|
2802 |
+
'w_class',
|
2803 |
+
);
|
2804 |
+
}
|
2805 |
+
if ( strpos($temp, 'w_hide_label') > -1 ) {
|
2806 |
+
$params_names = array(
|
2807 |
+
'w_field_label_size',
|
2808 |
+
'w_field_label_pos',
|
2809 |
+
'w_field_option_pos',
|
2810 |
+
'w_hide_label',
|
2811 |
+
'w_flow',
|
2812 |
+
'w_choices',
|
2813 |
+
'w_choices_price',
|
2814 |
+
'w_choices_checked',
|
2815 |
+
'w_required',
|
2816 |
+
'w_randomize',
|
2817 |
+
'w_allow_other',
|
2818 |
+
'w_allow_other_num',
|
2819 |
+
'w_choices_params',
|
2820 |
+
'w_class',
|
2821 |
+
);
|
2822 |
+
}
|
2823 |
+
foreach ( $params_names as $params_name ) {
|
2824 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
2825 |
+
$param[$params_name] = $temp[0];
|
2826 |
+
$temp = $temp[1];
|
2827 |
+
}
|
2828 |
+
if ( $temp ) {
|
2829 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
2830 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
2831 |
+
foreach ( $attrs as $attr ) {
|
2832 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
2833 |
+
}
|
2834 |
+
}
|
2835 |
+
if ( !isset($param['w_field_option_pos']) ) {
|
2836 |
+
$param['w_field_option_pos'] = 'left';
|
2837 |
+
}
|
2838 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
2839 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
2840 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
2841 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
2842 |
+
$param['w_choices'] = explode('***', $param['w_choices']);
|
2843 |
+
$param['w_choices_price'] = explode('***', $param['w_choices_price']);
|
2844 |
+
$param['w_choices_checked'] = explode('***', $param['w_choices_checked']);
|
2845 |
+
if ( isset($param['w_choices_params']) ) {
|
2846 |
+
$param['w_choices_params'] = explode('***', $param['w_choices_params']);
|
2847 |
+
}
|
2848 |
+
foreach ( $param['w_choices_checked'] as $key => $choices_checked ) {
|
2849 |
+
if ( $choices_checked == 'true' ) {
|
2850 |
+
$param['w_choices_checked'][$key] = 'checked="checked"';
|
2851 |
+
}
|
2852 |
+
else {
|
2853 |
+
$param['w_choices_checked'][$key] = '';
|
2854 |
+
}
|
2855 |
+
}
|
2856 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_paypal_shipping" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="wd_form_label" style="vertical-align: top;">' . $label . '</span><span id="' . $id . '_required_elementform_id_temp" class="required" style="vertical-align: top;">' . $required_sym . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '; vertical-align:top;"><input type="hidden" value="type_paypal_shipping" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_randomize'] . '" name="' . $id . '_randomizeform_id_temp" id="' . $id . '_randomizeform_id_temp"><input type="hidden" value="' . $param['w_allow_other'] . '" name="' . $id . '_allow_otherform_id_temp" id="' . $id . '_allow_otherform_id_temp"><input type="hidden" value="' . $param['w_allow_other_num'] . '" name="' . $id . '_allow_other_numform_id_temp" id="' . $id . '_allow_other_numform_id_temp"><input type="hidden" value="' . $param['w_field_option_pos'] . '" id="' . $id . '_option_left_right"><div style="display: table;"><div id="' . $id . '_table_little" style="display: table-row-group;">';
|
2857 |
+
if ( $param['w_flow'] == 'hor' ) {
|
2858 |
+
$rep .= '<div id="' . $id . '_hor" style="display: table-row;">';
|
2859 |
+
foreach ( $param['w_choices'] as $key => $choice ) {
|
2860 |
+
$where = '';
|
2861 |
+
$order_by = '';
|
2862 |
+
$db_info = '';
|
2863 |
+
if ( isset($param['w_choices_params']) && $param['w_choices_params'][$key] ) {
|
2864 |
+
$w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$key]);
|
2865 |
+
$where = 'where="' . $w_choices_params[0] . '"';
|
2866 |
+
$w_choices_params = explode('[db_info]', $w_choices_params[1]);
|
2867 |
+
$order_by = "order_by='" . $w_choices_params[0] . "'";
|
2868 |
+
$db_info = "db_info='" . $w_choices_params[1] . "'";
|
2869 |
+
}
|
2870 |
+
$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'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . $key . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . $key . '" ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $choice . '</label></div>';
|
2871 |
+
}
|
2872 |
+
$rep .= '</div>';
|
2873 |
+
}
|
2874 |
+
else {
|
2875 |
+
foreach ( $param['w_choices'] as $key => $choice ) {
|
2876 |
+
$where = '';
|
2877 |
+
$order_by = '';
|
2878 |
+
$db_info = '';
|
2879 |
+
if ( isset($param['w_choices_params']) && $param['w_choices_params'][$key] ) {
|
2880 |
+
$w_choices_params = explode('[where_order_by]', $param['w_choices_params'][$key]);
|
2881 |
+
$where = 'where="' . $w_choices_params[0] . '"';
|
2882 |
+
$w_choices_params = explode('[db_info]', $w_choices_params[1]);
|
2883 |
+
$order_by = "order_by='" . $w_choices_params[0] . "'";
|
2884 |
+
$db_info = "db_info='" . $w_choices_params[1] . "'";
|
2885 |
+
}
|
2886 |
+
$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'] . ' ' . ($param['w_field_option_pos'] == 'right' ? 'style="float:left !important;"' : "") . ' disabled/><label id="' . $id . '_label_element' . $key . '" class="ch-rad-label" for="' . $id . '_elementform_id_temp' . $key . '" ' . $where . ' ' . $order_by . ' ' . $db_info . '>' . $choice . '</label></div></div>';
|
2887 |
+
}
|
2888 |
+
}
|
2889 |
+
$rep .= '</div></div>';
|
2890 |
+
$rep .= '</div></div>';
|
2891 |
+
break;
|
2892 |
+
}
|
2893 |
+
case 'type_paypal_total': {
|
2894 |
+
$params_names = array( 'w_field_label_size', 'w_field_label_pos', 'w_class' );
|
2895 |
+
$temp = $params;
|
2896 |
+
if ( strpos($temp, 'w_size') > -1 ) {
|
2897 |
+
$params_names = array( 'w_field_label_size', 'w_field_label_pos', 'w_class', 'w_size' );
|
2898 |
+
}
|
2899 |
+
if ( strpos($temp, 'w_hide_label') > -1 ) {
|
2900 |
+
$params_names = array( 'w_field_label_size', 'w_field_label_pos', 'w_hide_label', 'w_class', 'w_size' );
|
2901 |
+
}
|
2902 |
+
foreach ( $params_names as $params_name ) {
|
2903 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
2904 |
+
$param[$params_name] = $temp[0];
|
2905 |
+
$temp = $temp[1];
|
2906 |
+
}
|
2907 |
+
if ( $temp ) {
|
2908 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
2909 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
2910 |
+
foreach ( $attrs as $attr ) {
|
2911 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
2912 |
+
}
|
2913 |
+
}
|
2914 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
2915 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
2916 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
2917 |
+
$param['w_size'] = isset($param['w_size']) ? $param['w_size'] : '300';
|
2918 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_paypal_total" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; 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"><input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><div id="' . $id . 'paypal_totalform_id_temp" class="wdform_paypal_total paypal_totalform_id_temp" style="width:' . $param['w_size'] . 'px;"><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>';
|
2919 |
+
break;
|
2920 |
+
}
|
2921 |
+
case 'type_stripe': {
|
2922 |
+
$params_names = array( 'w_field_size', 'w_field_label_size', 'w_field_label_pos', 'w_class' );
|
2923 |
+
$temp = $params;
|
2924 |
+
foreach ( $params_names as $params_name ) {
|
2925 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
2926 |
+
$param[$params_name] = $temp[0];
|
2927 |
+
$temp = $temp[1];
|
2928 |
+
}
|
2929 |
+
if ( $temp ) {
|
2930 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
2931 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
2932 |
+
foreach ( $attrs as $attr ) {
|
2933 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
2934 |
+
}
|
2935 |
+
}
|
2936 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
2937 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_stripe" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . '; width: ' . $param['w_field_label_size'] . 'px;"><span id="' . $id . '_element_labelform_id_temp" class="label" style="display: none;">stripe</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';"><div id="' . $id . '_elementform_id_temp" style="width:' . $param['w_field_size'] . 'px; margin:10px; border: 1px solid #000; min-width:80px;text-align:center;"> Stripe Section</div><input type="hidden" id="is_stripe" /><input type="hidden" value="type_stripe" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"></div></div>';
|
2938 |
+
break;
|
2939 |
+
}
|
2940 |
+
case 'type_star_rating': {
|
2941 |
+
$params_names = array(
|
2942 |
+
'w_field_label_size',
|
2943 |
+
'w_field_label_pos',
|
2944 |
+
'w_field_label_col',
|
2945 |
+
'w_star_amount',
|
2946 |
+
'w_required',
|
2947 |
+
'w_class',
|
2948 |
+
);
|
2949 |
+
$temp = $params;
|
2950 |
+
if ( strpos($temp, 'w_hide_label') > -1 ) {
|
2951 |
+
$params_names = array(
|
2952 |
+
'w_field_label_size',
|
2953 |
+
'w_field_label_pos',
|
2954 |
+
'w_hide_label',
|
2955 |
+
'w_field_label_col',
|
2956 |
+
'w_star_amount',
|
2957 |
+
'w_required',
|
2958 |
+
'w_class',
|
2959 |
+
);
|
2960 |
+
}
|
2961 |
+
foreach ( $params_names as $params_name ) {
|
2962 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
2963 |
+
$param[$params_name] = $temp[0];
|
2964 |
+
$temp = $temp[1];
|
2965 |
+
}
|
2966 |
+
if ( $temp ) {
|
2967 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
2968 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
2969 |
+
foreach ( $attrs as $attr ) {
|
2970 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
2971 |
+
}
|
2972 |
+
}
|
2973 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
2974 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
2975 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
2976 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
2977 |
+
$images = '';
|
2978 |
+
for ( $i = 0; $i < $param['w_star_amount']; $i++ ) {
|
2979 |
+
$images .= '<img id="' . $id . '_star_' . $i . '" src="' . WDCFM()->plugin_url . '/images/star.png?ver=' . WDCFM()->plugin_version . '" onmouseover="change_src(' . $i . ',' . $id . ',"form_id_temp")" onmouseout="reset_src(' . $i . ',' . $id . ')" onclick="select_star_rating(' . $i . ',' . $id . ', "form_id_temp")">';
|
2980 |
+
}
|
2981 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_star_rating" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; 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_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_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>';
|
2982 |
+
break;
|
2983 |
+
}
|
2984 |
+
case 'type_scale_rating': {
|
2985 |
+
$params_names = array(
|
2986 |
+
'w_field_label_size',
|
2987 |
+
'w_field_label_pos',
|
2988 |
+
'w_mini_labels',
|
2989 |
+
'w_scale_amount',
|
2990 |
+
'w_required',
|
2991 |
+
'w_class',
|
2992 |
+
);
|
2993 |
+
$temp = $params;
|
2994 |
+
if ( strpos($temp, 'w_hide_label') > -1 ) {
|
2995 |
+
$params_names = array(
|
2996 |
+
'w_field_label_size',
|
2997 |
+
'w_field_label_pos',
|
2998 |
+
'w_hide_label',
|
2999 |
+
'w_mini_labels',
|
3000 |
+
'w_scale_amount',
|
3001 |
+
'w_required',
|
3002 |
+
'w_class',
|
3003 |
+
);
|
3004 |
+
}
|
3005 |
+
foreach ( $params_names as $params_name ) {
|
3006 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
3007 |
+
$param[$params_name] = $temp[0];
|
3008 |
+
$temp = $temp[1];
|
3009 |
+
}
|
3010 |
+
if ( $temp ) {
|
3011 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
3012 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
3013 |
+
foreach ( $attrs as $attr ) {
|
3014 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
3015 |
+
}
|
3016 |
+
}
|
3017 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
3018 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
3019 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
3020 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
3021 |
+
$w_mini_labels = explode('***', $param['w_mini_labels']);
|
3022 |
+
$numbers = '';
|
3023 |
+
for ( $i = 1; $i <= $param['w_scale_amount']; $i++ ) {
|
3024 |
+
$numbers .= '<div id="' . $id . '_scale_td1_' . $i . 'form_id_temp" style="text-align: center; display: table-cell;"><span>' . $i . '</span></div>';
|
3025 |
+
}
|
3026 |
+
$radio_buttons = '';
|
3027 |
+
for ( $k = 1; $k <= $param['w_scale_amount']; $k++ ) {
|
3028 |
+
$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>';
|
3029 |
+
}
|
3030 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_scale_rating" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; 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_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_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>';
|
3031 |
+
break;
|
3032 |
+
}
|
3033 |
+
case 'type_spinner': {
|
3034 |
+
$params_names = array(
|
3035 |
+
'w_field_label_size',
|
3036 |
+
'w_field_label_pos',
|
3037 |
+
'w_field_width',
|
3038 |
+
'w_field_min_value',
|
3039 |
+
'w_field_max_value',
|
3040 |
+
'w_field_step',
|
3041 |
+
'w_field_value',
|
3042 |
+
'w_required',
|
3043 |
+
'w_class',
|
3044 |
+
);
|
3045 |
+
$temp = $params;
|
3046 |
+
if ( strpos($temp, 'w_hide_label') > -1 ) {
|
3047 |
+
$params_names = array(
|
3048 |
+
'w_field_label_size',
|
3049 |
+
'w_field_label_pos',
|
3050 |
+
'w_hide_label',
|
3051 |
+
'w_field_width',
|
3052 |
+
'w_field_min_value',
|
3053 |
+
'w_field_max_value',
|
3054 |
+
'w_field_step',
|
3055 |
+
'w_field_value',
|
3056 |
+
'w_required',
|
3057 |
+
'w_class',
|
3058 |
+
);
|
3059 |
+
}
|
3060 |
+
foreach ( $params_names as $params_name ) {
|
3061 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
3062 |
+
$param[$params_name] = $temp[0];
|
3063 |
+
$temp = $temp[1];
|
3064 |
+
}
|
3065 |
+
if ( $temp ) {
|
3066 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
3067 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
3068 |
+
foreach ( $attrs as $attr ) {
|
3069 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
3070 |
+
}
|
3071 |
+
}
|
3072 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
3073 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
3074 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
3075 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
3076 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_spinner" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; 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_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_field_width'] . '" name="' . $id . '_spinner_widthform_id_temp" id="' . $id . '_spinner_widthform_id_temp"><input type="hidden" value="' . $param['w_field_min_value'] . '" id="' . $id . '_min_valueform_id_temp" name="' . $id . '_min_valueform_id_temp"><input type="hidden" value="' . $param['w_field_max_value'] . '" name="' . $id . '_max_valueform_id_temp" id="' . $id . '_max_valueform_id_temp"><input type="hidden" value="' . $param['w_field_step'] . '" name="' . $id . '_stepform_id_temp" id="' . $id . '_stepform_id_temp"><input type="" value="' . ($param['w_field_value'] != 'null' ? $param['w_field_value'] : '') . '" name="' . $id . '_elementform_id_temp" id="' . $id . '_elementform_id_temp" onkeypress="return check_isnum_or_minus(event)" style="width: ' . $param['w_field_width'] . 'px;" ' . $param['attributes'] . ' disabled/></div></div>';
|
3077 |
+
break;
|
3078 |
+
}
|
3079 |
+
case 'type_slider': {
|
3080 |
+
$params_names = array(
|
3081 |
+
'w_field_label_size',
|
3082 |
+
'w_field_label_pos',
|
3083 |
+
'w_field_width',
|
3084 |
+
'w_field_min_value',
|
3085 |
+
'w_field_max_value',
|
3086 |
+
'w_field_value',
|
3087 |
+
'w_required',
|
3088 |
+
'w_class',
|
3089 |
+
);
|
3090 |
+
$temp = $params;
|
3091 |
+
if ( strpos($temp, 'w_hide_label') > -1 ) {
|
3092 |
+
$params_names = array(
|
3093 |
+
'w_field_label_size',
|
3094 |
+
'w_field_label_pos',
|
3095 |
+
'w_hide_label',
|
3096 |
+
'w_field_width',
|
3097 |
+
'w_field_min_value',
|
3098 |
+
'w_field_max_value',
|
3099 |
+
'w_field_value',
|
3100 |
+
'w_required',
|
3101 |
+
'w_class',
|
3102 |
+
);
|
3103 |
+
}
|
3104 |
+
foreach ( $params_names as $params_name ) {
|
3105 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
3106 |
+
$param[$params_name] = $temp[0];
|
3107 |
+
$temp = $temp[1];
|
3108 |
+
}
|
3109 |
+
if ( $temp ) {
|
3110 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
3111 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
3112 |
+
foreach ( $attrs as $attr ) {
|
3113 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
3114 |
+
}
|
3115 |
+
}
|
3116 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
3117 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
3118 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
3119 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
3120 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_slider" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; 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_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_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>';
|
3121 |
+
break;
|
3122 |
+
}
|
3123 |
+
case 'type_range': {
|
3124 |
+
$params_names = array(
|
3125 |
+
'w_field_label_size',
|
3126 |
+
'w_field_label_pos',
|
3127 |
+
'w_field_range_width',
|
3128 |
+
'w_field_range_step',
|
3129 |
+
'w_field_value1',
|
3130 |
+
'w_field_value2',
|
3131 |
+
'w_mini_labels',
|
3132 |
+
'w_required',
|
3133 |
+
'w_class',
|
3134 |
+
);
|
3135 |
+
$temp = $params;
|
3136 |
+
if ( strpos($temp, 'w_hide_label') > -1 ) {
|
3137 |
+
$params_names = array(
|
3138 |
+
'w_field_label_size',
|
3139 |
+
'w_field_label_pos',
|
3140 |
+
'w_hide_label',
|
3141 |
+
'w_field_range_width',
|
3142 |
+
'w_field_range_step',
|
3143 |
+
'w_field_value1',
|
3144 |
+
'w_field_value2',
|
3145 |
+
'w_mini_labels',
|
3146 |
+
'w_required',
|
3147 |
+
'w_class',
|
3148 |
+
);
|
3149 |
+
}
|
3150 |
+
foreach ( $params_names as $params_name ) {
|
3151 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
3152 |
+
$param[$params_name] = $temp[0];
|
3153 |
+
$temp = $temp[1];
|
3154 |
+
}
|
3155 |
+
if ( $temp ) {
|
3156 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
3157 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
3158 |
+
foreach ( $attrs as $attr ) {
|
3159 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
3160 |
+
}
|
3161 |
+
}
|
3162 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
3163 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
3164 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
3165 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
3166 |
+
$w_mini_labels = explode('***', $param['w_mini_labels']);
|
3167 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_range" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; 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_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_field_range_width'] . '" name="' . $id . '_range_widthform_id_temp" id="' . $id . '_range_widthform_id_temp"><input type="hidden" value="' . $param['w_field_range_step'] . '" name="' . $id . '_range_stepform_id_temp" id="' . $id . '_range_stepform_id_temp"><div id="' . $id . '_elemet_table_littleform_id_temp" style="display: table;"><div style="display: table-row;"><div valign="middle" align="left" style="display: table-cell;"><input type="" value="' . ($param['w_field_value1'] != 'null' ? $param['w_field_value1'] : '') . '" name="' . $id . '_elementform_id_temp0" id="' . $id . '_elementform_id_temp0" onkeypress="return check_isnum_or_minus(event)" style="width: ' . $param['w_field_range_width'] . 'px;" ' . $param['attributes'] . ' disabled/></div><div valign="middle" align="left" style="display: table-cell; padding-left: 4px;"><input type="" value="' . ($param['w_field_value2'] != 'null' ? $param['w_field_value2'] : '') . '" name="' . $id . '_elementform_id_temp1" id="' . $id . '_elementform_id_temp1" onkeypress="return check_isnum_or_minus(event)" style="width: ' . $param['w_field_range_width'] . 'px;" ' . $param['attributes'] . ' disabled/></div></div><div style="display: table-row;"><div valign="top" align="left" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_from">' . $w_mini_labels[0] . '</label></div><div valign="top" align="left" style="display: table-cell;"><label class="mini_label" id="' . $id . '_mini_label_to">' . $w_mini_labels[1] . '</label></div></div></div></div></div>';
|
3168 |
+
break;
|
3169 |
+
}
|
3170 |
+
case 'type_grading': {
|
3171 |
+
$params_names = array(
|
3172 |
+
'w_field_label_size',
|
3173 |
+
'w_field_label_pos',
|
3174 |
+
'w_items',
|
3175 |
+
'w_total',
|
3176 |
+
'w_required',
|
3177 |
+
'w_class',
|
3178 |
+
);
|
3179 |
+
$temp = $params;
|
3180 |
+
if ( strpos($temp, 'w_hide_label') > -1 ) {
|
3181 |
+
$params_names = array(
|
3182 |
+
'w_field_label_size',
|
3183 |
+
'w_field_label_pos',
|
3184 |
+
'w_hide_label',
|
3185 |
+
'w_items',
|
3186 |
+
'w_total',
|
3187 |
+
'w_required',
|
3188 |
+
'w_class',
|
3189 |
+
);
|
3190 |
+
}
|
3191 |
+
foreach ( $params_names as $params_name ) {
|
3192 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
3193 |
+
$param[$params_name] = $temp[0];
|
3194 |
+
$temp = $temp[1];
|
3195 |
+
}
|
3196 |
+
if ( $temp ) {
|
3197 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
3198 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
3199 |
+
foreach ( $attrs as $attr ) {
|
3200 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
3201 |
+
}
|
3202 |
+
}
|
3203 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
3204 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
3205 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
3206 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
3207 |
+
$w_items = explode('***', $param['w_items']);
|
3208 |
+
$grading_items = '';
|
3209 |
+
for ( $i = 0; $i < count($w_items); $i++ ) {
|
3210 |
+
$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="" type="text" size="5" onkeyup="sum_grading_values(' . $id . ',"form_id_temp")" onchange="sum_grading_values(' . $id . ',"form_id_temp")" ' . $param['attributes'] . ' disabled/><label id="' . $id . '_label_elementform_id_temp' . $i . '" class="ch-rad-label">' . $w_items[$i] . '</label></div>';
|
3211 |
+
}
|
3212 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_grading" class="wdform_field" style="display: table-cell;">'
|
3213 |
+
. $arrows . '
|
3214 |
+
<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; vertical-align: top; width: ' . $param['w_field_label_size'] . 'px;">
|
3215 |
+
<span id="' . $id . '_element_labelform_id_temp" class="label">' . $label . '</span>
|
3216 |
+
<span id="' . $id . '_required_elementform_id_temp" class="required">' . $required_sym . '</span>
|
3217 |
+
</div>
|
3218 |
+
<div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $param['w_field_label_pos'] . ';">
|
3219 |
+
<input type="hidden" value="type_grading" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp">
|
3220 |
+
<input type="hidden" value="' . $param['w_required'] . '" name="' . $id . '_requiredform_id_temp" id="' . $id . '_requiredform_id_temp">
|
3221 |
+
<input type="hidden" value="' . $param['w_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/>
|
3222 |
+
<input type="hidden" value="' . $param['w_total'] . '" name="' . $id . '_grading_totalform_id_temp" id="' . $id . '_grading_totalform_id_temp">
|
3223 |
+
<div id="' . $id . '_elementform_id_temp">' . $grading_items . '
|
3224 |
+
<div id="' . $id . '_element_total_divform_id_temp" class="grading_div" style="display: ' . (!$param['w_total'] ? 'none' : 'block') . ';">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>
|
3225 |
+
<span id="' . $id . '_text_elementform_id_temp" name="' . $id . '_text_elementform_id_temp"></span>
|
3226 |
+
</div>
|
3227 |
+
</div>
|
3228 |
+
</div>
|
3229 |
+
</div>';
|
3230 |
+
break;
|
3231 |
+
}
|
3232 |
+
case 'type_matrix': {
|
3233 |
+
$params_names = array(
|
3234 |
+
'w_field_label_size',
|
3235 |
+
'w_field_label_pos',
|
3236 |
+
'w_field_input_type',
|
3237 |
+
'w_rows',
|
3238 |
+
'w_columns',
|
3239 |
+
'w_required',
|
3240 |
+
'w_class',
|
3241 |
+
'w_textbox_size',
|
3242 |
+
);
|
3243 |
+
$temp = $params;
|
3244 |
+
if ( strpos($temp, 'w_hide_label') > -1 ) {
|
3245 |
+
$params_names = array(
|
3246 |
+
'w_field_label_size',
|
3247 |
+
'w_field_label_pos',
|
3248 |
+
'w_hide_label',
|
3249 |
+
'w_field_input_type',
|
3250 |
+
'w_rows',
|
3251 |
+
'w_columns',
|
3252 |
+
'w_required',
|
3253 |
+
'w_class',
|
3254 |
+
'w_textbox_size',
|
3255 |
+
);
|
3256 |
+
}
|
3257 |
+
foreach ( $params_names as $params_name ) {
|
3258 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
3259 |
+
$param[$params_name] = $temp[0];
|
3260 |
+
$temp = $temp[1];
|
3261 |
+
}
|
3262 |
+
if ( $temp ) {
|
3263 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
3264 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
3265 |
+
foreach ( $attrs as $attr ) {
|
3266 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
3267 |
+
}
|
3268 |
+
}
|
3269 |
+
$param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
|
3270 |
+
$param['w_hide_label'] = (isset($param['w_hide_label']) ? $param['w_hide_label'] : "no");
|
3271 |
+
$display_label = $param['w_hide_label'] == "no" ? $param['w_field_label_pos'] : "none";
|
3272 |
+
$required_sym = ($param['w_required'] == "yes" ? " *" : "");
|
3273 |
+
$param['w_textbox_size'] = isset($param['w_textbox_size']) ? $param['w_textbox_size'] : '100';
|
3274 |
+
$w_rows = explode('***', $param['w_rows']);
|
3275 |
+
$w_columns = explode('***', $param['w_columns']);
|
3276 |
+
$column_labels = '';
|
3277 |
+
for ( $i = 1; $i < count($w_columns); $i++ ) {
|
3278 |
+
$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>';
|
3279 |
+
}
|
3280 |
+
$rows_columns = '';
|
3281 |
+
for ( $i = 1; $i < count($w_rows); $i++ ) {
|
3282 |
+
$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>';
|
3283 |
+
for ( $k = 1; $k < count($w_columns); $k++ ) {
|
3284 |
+
if ( $param['w_field_input_type'] == 'radio' ) {
|
3285 |
+
$rows_columns .= '<div id="' . $id . '_element_td' . $i . '_' . $k . '" style="text-align: center; display: table-cell; padding: 5px 0 0 5px;"><input id="' . $id . '_input_elementform_id_temp' . $i . '_' . $k . '" align="center" size="14" type="radio" name="' . $id . '_input_elementform_id_temp' . $i . '" value="' . $i . '_' . $k . '" disabled/></div>';
|
3286 |
+
}
|
3287 |
+
else {
|
3288 |
+
if ( $param['w_field_input_type'] == 'checkbox' ) {
|
3289 |
+
$rows_columns .= '<div id="' . $id . '_element_td' . $i . '_' . $k . '" style="text-align: center; display: table-cell; padding: 5px 0 0 5px;"><input id="' . $id . '_input_elementform_id_temp' . $i . '_' . $k . '" align="center" size="14" type="checkbox" name="' . $id . '_input_elementform_id_temp' . $i . '_' . $k . '" value="1" disabled/></div>';
|
3290 |
+
}
|
3291 |
+
else {
|
3292 |
+
if ( $param['w_field_input_type'] == 'text' ) {
|
3293 |
+
$rows_columns .= '<div id="' . $id . '_element_td' . $i . '_' . $k . '" style="text-align: center; display: table-cell; padding: 5px 0 0 5px;"><input id="' . $id . '_input_elementform_id_temp' . $i . '_' . $k . '" align="center" type="text" name="' . $id . '_input_elementform_id_temp' . $i . '_' . $k . '" value="" style="width:' . $param['w_textbox_size'] . 'px" disabled/></div>';
|
3294 |
+
}
|
3295 |
+
else {
|
3296 |
+
if ( $param['w_field_input_type'] == 'select' ) {
|
3297 |
+
$rows_columns .= '<div id="' . $id . '_element_td' . $i . '_' . $k . '" style="text-align: center; display: table-cell; padding: 5px 0 0 5px;"><select id="' . $id . '_select_yes_noform_id_temp' . $i . '_' . $k . '" name="' . $id . '_select_yes_noform_id_temp' . $i . '_' . $k . '" disabled><option value=""> </option><option value="yes">Yes</option><option value="no">No</option></select></div>';
|
3298 |
+
}
|
3299 |
+
}
|
3300 |
+
}
|
3301 |
+
}
|
3302 |
+
}
|
3303 |
+
$rows_columns .= '</div>';
|
3304 |
+
}
|
3305 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_matrix" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: ' . $display_label . '; 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_hide_label'] . '" name="' . $id . '_hide_labelform_id_temp" id="' . $id . '_hide_labelform_id_temp"/><input type="hidden" value="' . $param['w_field_input_type'] . '" name="' . $id . '_input_typeform_id_temp" id="' . $id . '_input_typeform_id_temp"><input type="hidden" value="' . $param['w_textbox_size'] . '" name="' . $id . '_textbox_sizeform_id_temp" id="' . $id . '_textbox_sizeform_id_temp"><div id="' . $id . '_elementform_id_temp" style="display: table;" ' . $param['attributes'] . '><div id="' . $id . '_table_little" style="display: table-row-group;"><div id="' . $id . '_element_tr0" style="display: table-row;"><div id="' . $id . '_element_td0_0" style="display: table-cell;"></div>' . $column_labels . '</div>' . $rows_columns . '</div></div></div></div>';
|
3306 |
+
break;
|
3307 |
+
}
|
3308 |
+
case 'type_submit_reset': {
|
3309 |
+
$params_names = array( 'w_submit_title', 'w_reset_title', 'w_class', 'w_act' );
|
3310 |
+
$temp = $params;
|
3311 |
+
foreach ( $params_names as $params_name ) {
|
3312 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
3313 |
+
$param[$params_name] = $temp[0];
|
3314 |
+
$temp = $temp[1];
|
3315 |
+
}
|
3316 |
+
if ( $temp ) {
|
3317 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
3318 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
3319 |
+
foreach ( $attrs as $attr ) {
|
3320 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
3321 |
+
}
|
3322 |
+
}
|
3323 |
+
$param['w_act'] = ($param['w_act'] == "false" ? 'style="display: none;"' : "");
|
3324 |
+
$rep = '<div id="wdform_field' . $id . '" type="type_submit_reset" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: table-cell;"><span id="' . $id . '_element_labelform_id_temp" style="display: none;">type_submit_reset_' . $id . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: table-cell;"><input type="hidden" value="type_submit_reset" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp"><button type="button" class="button button-hero button-submit" id="' . $id . '_element_submitform_id_temp" value="' . $param['w_submit_title'] . '" disabled ' . $param['attributes'] . '>' . $param['w_submit_title'] . '</button><button type="button" class="button button-secondary button-hero button-reset" id="' . $id . '_element_resetform_id_temp" value="' . $param['w_reset_title'] . '" disabled ' . $param['w_act'] . ' ' . $param['attributes'] . '>' . $param['w_reset_title'] . '</button></div></div>';
|
3325 |
+
break;
|
3326 |
+
}
|
3327 |
+
case 'type_button': {
|
3328 |
+
$params_names = array( 'w_title', 'w_func', 'w_class' );
|
3329 |
+
$temp = $params;
|
3330 |
+
foreach ( $params_names as $params_name ) {
|
3331 |
+
$temp = explode('*:*' . $params_name . '*:*', $temp);
|
3332 |
+
$param[$params_name] = $temp[0];
|
3333 |
+
$temp = $temp[1];
|
3334 |
+
}
|
3335 |
+
if ( $temp ) {
|
3336 |
+
$temp = explode('*:*w_attr_name*:*', $temp);
|
3337 |
+
$attrs = array_slice($temp, 0, count($temp) - 1);
|
3338 |
+
foreach ( $attrs as $attr ) {
|
3339 |
+
$param['attributes'] = $param['attributes'] . ' add_' . $attr;
|
3340 |
+
}
|
3341 |
+
}
|
3342 |
+
$param['w_title'] = explode('***', $param['w_title']);
|
3343 |
+
$param['w_func'] = explode('***', $param['w_func']);
|
3344 |
+
$rep .= '<div id="wdform_field' . $id . '" type="type_button" class="wdform_field" style="display: table-cell;">' . $arrows . '<div align="left" id="' . $id . '_label_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: table-cell;"><span id="' . $id . '_element_labelform_id_temp" style="display: none;">button_' . $id . '</span></div><div align="left" id="' . $id . '_element_sectionform_id_temp" class="' . $param['w_class'] . '" style="display: table-cell;"><input type="hidden" value="type_button" name="' . $id . '_typeform_id_temp" id="' . $id . '_typeform_id_temp">';
|
3345 |
+
foreach ( $param['w_title'] as $key => $title ) {
|
3346 |
+
$rep .= '<button type="button" class="button button-secondary button-large" id="' . $id . '_elementform_id_temp' . $key . '" name="' . $id . '_elementform_id_temp' . $key . '" value="' . $title . '" onclick="' . $param['w_func'][$key] . '" ' . $param['attributes'] . '>' . $title . '</button>';
|
3347 |
+
}
|
3348 |
+
$rep .= '</div></div>';
|
3349 |
+
break;
|
3350 |
+
}
|
3351 |
+
}
|
3352 |
+
$form = str_replace('%' . $id . ' - ' . $labels[$ids_key] . '%', $rep, $form);
|
3353 |
+
$form = str_replace('%' . $id . ' -' . $labels[$ids_key] . '%', $rep, $form);
|
3354 |
+
$row->form_front = $form;
|
3355 |
+
}
|
3356 |
+
}
|
3357 |
+
|
3358 |
+
return $row;
|
3359 |
+
}
|
3360 |
+
|
3361 |
+
public function get_theme_rows_data( $old = '' ) {
|
3362 |
+
global $wpdb;
|
3363 |
+
$rows = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker_themes ORDER BY `default` DESC, `version` DESC, `id` ASC");
|
3364 |
+
|
3365 |
+
return $rows;
|
3366 |
+
}
|
3367 |
+
|
3368 |
+
public function get_queries_rows_data( $id ) {
|
3369 |
+
global $wpdb;
|
3370 |
+
$rows = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker_query WHERE form_id=" . $id . " ORDER BY id ASC");
|
3371 |
+
|
3372 |
+
return $rows;
|
3373 |
+
}
|
3374 |
+
|
3375 |
+
public function get_labels( $id ) {
|
3376 |
+
global $wpdb;
|
3377 |
+
$rows = $wpdb->get_col("SELECT DISTINCT `element_label` FROM " . $wpdb->prefix . "formmaker_submits WHERE form_id=" . $id);
|
3378 |
+
|
3379 |
+
return $rows;
|
3380 |
+
}
|
3381 |
+
|
3382 |
+
public function is_paypal( $id ) {
|
3383 |
+
global $wpdb;
|
3384 |
+
$rows = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker_sessions WHERE form_id=" . $id);
|
3385 |
+
|
3386 |
+
return $rows;
|
3387 |
+
}
|
3388 |
+
|
3389 |
+
/**
|
3390 |
+
* Return total count of forms.
|
3391 |
+
*
|
3392 |
+
* @return null|string
|
3393 |
+
*/
|
3394 |
+
public function total() {
|
3395 |
+
global $wpdb;
|
3396 |
+
$query = "SELECT COUNT(*) FROM `" . $wpdb->prefix . "formmaker`";
|
3397 |
+
|
3398 |
+
$search = WDW_FMC_Library::get('s', '');
|
3399 |
+
|
3400 |
+
$query .= (!WDCFM()->is_free ? '' : 'WHERE id' . (WDCFM()->is_free == 1 ? ' NOT ' : ' ') . 'IN (' . (get_option('contact_form_forms', '') != '' ? get_option('contact_form_forms') : 0) . ')');
|
3401 |
+
if ( $search ) {
|
3402 |
+
$query .= (!WDCFM()->is_free ? 'WHERE' : ' AND') . ' `title` LIKE "%' . $search . '%"';
|
3403 |
+
}
|
3404 |
+
|
3405 |
+
$total = $wpdb->get_var($query);
|
3406 |
+
|
3407 |
+
return $total;
|
3408 |
+
}
|
3409 |
+
|
3410 |
+
/**
|
3411 |
+
* Get display options.
|
3412 |
+
*
|
3413 |
+
* @param int $id
|
3414 |
+
*
|
3415 |
+
* @return string
|
3416 |
+
*/
|
3417 |
+
public function get_display_options( $id ) {
|
3418 |
+
global $wpdb;
|
3419 |
+
$row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_display_options WHERE form_id="%d"', $id));
|
3420 |
+
if ( !$row ) {
|
3421 |
+
$row = new stdClass();
|
3422 |
+
$row->form_id = $id;
|
3423 |
+
$row->type = 'embedded';
|
3424 |
+
$row->scrollbox_loading_delay = 0;
|
3425 |
+
$row->popover_animate_effect = '';
|
3426 |
+
$row->popover_loading_delay = 0;
|
3427 |
+
$row->popover_frequency = 0;
|
3428 |
+
$row->topbar_position = 1;
|
3429 |
+
$row->topbar_remain_top = 1;
|
3430 |
+
$row->topbar_closing = 1;
|
3431 |
+
$row->topbar_hide_duration = 0;
|
3432 |
+
$row->scrollbox_position = 1;
|
3433 |
+
$row->scrollbox_trigger_point = 20;
|
3434 |
+
$row->scrollbox_hide_duration = 0;
|
3435 |
+
$row->scrollbox_auto_hide = 1;
|
3436 |
+
$row->hide_mobile = 0;
|
3437 |
+
$row->scrollbox_closing = 1;
|
3438 |
+
$row->scrollbox_minimize = 1;
|
3439 |
+
$row->scrollbox_minimize_text = '';
|
3440 |
+
$row->display_on = 'everything';
|
3441 |
+
$row->posts_include = '';
|
3442 |
+
$row->pages_include = '';
|
3443 |
+
$row->display_on_categories = '';
|
3444 |
+
$row->current_categories = '';
|
3445 |
+
$row->show_for_admin = 0;
|
3446 |
+
}
|
3447 |
+
|
3448 |
+
return $row;
|
3449 |
+
}
|
3450 |
+
|
3451 |
+
public function fm_posts_query() {
|
3452 |
+
$default_post_types = array( 'post', 'page' );
|
3453 |
+
$custom_post_types = get_post_types(array(
|
3454 |
+
'public' => TRUE,
|
3455 |
+
'_builtin' => FALSE,
|
3456 |
+
));
|
3457 |
+
$post_types = array_merge($default_post_types, $custom_post_types);
|
3458 |
+
$pt_names = array_values($post_types);
|
3459 |
+
$query = array(
|
3460 |
+
'post_type' => $pt_names,
|
3461 |
+
'suppress_filters' => TRUE,
|
3462 |
+
'update_post_term_cache' => FALSE,
|
3463 |
+
'update_post_meta_cache' => FALSE,
|
3464 |
+
'post_status' => 'publish',
|
3465 |
+
'posts_per_page' => -1,
|
3466 |
+
);
|
3467 |
+
$get_posts = new WP_Query;
|
3468 |
+
$posts = $get_posts->query($query);
|
3469 |
+
if ( !$get_posts->post_count ) {
|
3470 |
+
return FALSE;
|
3471 |
+
}
|
3472 |
+
$results = array();
|
3473 |
+
foreach ( $posts as $post ) {
|
3474 |
+
$results[(int) $post->ID] = array(
|
3475 |
+
'title' => trim(esc_html(strip_tags(get_the_title($post)))),
|
3476 |
+
'post_type' => $post->post_type,
|
3477 |
+
);
|
3478 |
+
}
|
3479 |
+
wp_reset_postdata();
|
3480 |
+
|
3481 |
+
return $results;
|
3482 |
+
}
|
3483 |
+
|
3484 |
+
public function fm_categories_query() {
|
3485 |
+
$categories = get_categories(array(
|
3486 |
+
'hide_empty' => 0,
|
3487 |
+
));
|
3488 |
+
$final_categories = array();
|
3489 |
+
foreach ( $categories as $key => $value ) {
|
3490 |
+
$final_categories[$value->term_id] = $value->name;
|
3491 |
+
}
|
3492 |
+
|
3493 |
+
return $final_categories;
|
3494 |
+
}
|
3495 |
+
|
3496 |
+
/**
|
3497 |
+
* Get previous or next id.
|
3498 |
+
*
|
3499 |
+
* @param int $backup_id
|
3500 |
+
* @param int $id
|
3501 |
+
* @param string $type (undo,redo)
|
3502 |
+
* type 0 = undo, 1 = redo
|
3503 |
+
*
|
3504 |
+
* @return int
|
3505 |
+
*/
|
3506 |
+
public function get_undo_redo_id( $backup_id, $id, $type ) {
|
3507 |
+
global $wpdb;
|
3508 |
+
if ( $type == 1 ) {
|
3509 |
+
$query = "SELECT backup_id FROM " . $wpdb->prefix . "formmaker_backup WHERE backup_id > $backup_id AND id = $id ORDER BY backup_id ASC LIMIT 0 , 1 ";
|
3510 |
+
}
|
3511 |
+
elseif ( $type == 0 ) {
|
3512 |
+
$query = "SELECT backup_id FROM " . $wpdb->prefix . "formmaker_backup WHERE backup_id < $backup_id AND id = $id ORDER BY backup_id DESC LIMIT 0 , 1 ";
|
3513 |
+
}
|
3514 |
+
|
3515 |
+
return $wpdb->get_var($query);
|
3516 |
+
}
|
3517 |
+
|
3518 |
+
/**
|
3519 |
+
* Get max row.
|
3520 |
+
*
|
3521 |
+
* @param string $table
|
3522 |
+
* @param string $column
|
3523 |
+
*
|
3524 |
+
* @return int
|
3525 |
+
*/
|
3526 |
+
public function get_max_row( $table, $column ) {
|
3527 |
+
global $wpdb;
|
3528 |
+
$query = "SELECT max(" . $column . ") FROM " . $wpdb->prefix . $table;
|
3529 |
+
|
3530 |
+
return $wpdb->get_var($query);
|
3531 |
+
}
|
3532 |
+
|
3533 |
+
/**
|
3534 |
+
* Delete row.
|
3535 |
+
*
|
3536 |
+
* @param int $id
|
3537 |
+
*
|
3538 |
+
* @return bool
|
3539 |
+
*/
|
3540 |
+
public function delete_formmaker_query( $id ) {
|
3541 |
+
global $wpdb;
|
3542 |
+
$query = 'DELETE FROM ' . $wpdb->prefix . 'formmaker_query WHERE id =' . $id;
|
3543 |
+
return $wpdb->query($query);
|
3544 |
+
}
|
3545 |
+
|
3546 |
+
public function get_mail_verification_post_id() {
|
3547 |
+
global $wpdb;
|
3548 |
+
$query = 'SELECT mail_verification_post_id FROM ' . $wpdb->prefix . 'formmaker WHERE mail_verification_post_id!=0';
|
3549 |
+
|
3550 |
+
return $wpdb->get_var($query);
|
3551 |
+
}
|
3552 |
+
|
3553 |
+
/**
|
3554 |
+
* Update row(s) in db.
|
3555 |
+
*
|
3556 |
+
* @param string $table
|
3557 |
+
* @param array $data_params
|
3558 |
+
* @param array $where_data_params
|
3559 |
+
* params = [where]
|
3560 |
+
*
|
3561 |
+
* @return bool
|
3562 |
+
*/
|
3563 |
+
public function update_data( $table, $data_params = array(), $where_data_params = array() ) {
|
3564 |
+
global $wpdb;
|
3565 |
+
return $wpdb->update($wpdb->prefix . $table, $data_params, $where_data_params);
|
3566 |
+
}
|
3567 |
+
|
3568 |
+
/**
|
3569 |
+
* Get request value.
|
3570 |
+
*
|
3571 |
+
* @param string $table
|
3572 |
+
* @param array $data
|
3573 |
+
*
|
3574 |
+
* @return array
|
3575 |
+
*/
|
3576 |
+
public function insert_data_to_db( $table, $data ) {
|
3577 |
+
global $wpdb;
|
3578 |
+
$query = $wpdb->insert($wpdb->prefix . $table, $data);
|
3579 |
+
$wpdb->show_errors();
|
3580 |
+
|
3581 |
+
return $query;
|
3582 |
+
}
|
3583 |
+
|
3584 |
+
/**
|
3585 |
+
* Get id of default theme.
|
3586 |
+
*
|
3587 |
+
* @return int (id)
|
3588 |
+
*/
|
3589 |
+
public function get_default_theme_id() {
|
3590 |
+
global $wpdb;
|
3591 |
+
|
3592 |
+
return $wpdb->get_var("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE `default`='1'");
|
3593 |
+
}
|
3594 |
+
|
3595 |
+
/**
|
3596 |
+
* Replace data.
|
3597 |
+
*
|
3598 |
+
* @param array $data
|
3599 |
+
*
|
3600 |
+
* @return bool
|
3601 |
+
*/
|
3602 |
+
public function replace_display_options( $data ) {
|
3603 |
+
global $wpdb;
|
3604 |
+
|
3605 |
+
return $wpdb->replace($wpdb->prefix . 'formmaker_display_options', $data);
|
3606 |
+
}
|
3607 |
+
|
3608 |
+
/**
|
3609 |
+
* Get previous backup_id.
|
3610 |
+
*
|
3611 |
+
* @param int $backup_id
|
3612 |
+
* @param int $id
|
3613 |
+
*
|
3614 |
+
* @return int
|
3615 |
+
*/
|
3616 |
+
public function get_prev_backup_id( $backup_id, $id ) {
|
3617 |
+
global $wpdb;
|
3618 |
+
$query = "SELECT backup_id FROM " . $wpdb->prefix . "formmaker_backup WHERE backup_id < " . $backup_id . " AND id = " . $id . " ORDER BY backup_id DESC LIMIT 0 , 1 ";
|
3619 |
+
|
3620 |
+
return $wpdb->get_var($query);
|
3621 |
+
}
|
3622 |
+
|
3623 |
+
/**
|
3624 |
+
* Get next backup_id.
|
3625 |
+
*
|
3626 |
+
* @param int $backup_id
|
3627 |
+
* @param int $id
|
3628 |
+
*
|
3629 |
+
* @return int
|
3630 |
+
*/
|
3631 |
+
public function get_backup_id( $backup_id, $id ) {
|
3632 |
+
global $wpdb;
|
3633 |
+
$query = "SELECT backup_id FROM " . $wpdb->prefix . "formmaker_backup WHERE backup_id > " . $backup_id . " AND id = " . $id . " ORDER BY backup_id ASC LIMIT 0 , 1 ";
|
3634 |
+
|
3635 |
+
return $wpdb->get_var($query);
|
3636 |
+
}
|
3637 |
+
|
3638 |
+
public function get_autogen_layout( $id ) {
|
3639 |
+
global $wpdb;
|
3640 |
+
$autogen_layout = $wpdb->get_var($wpdb->prepare('SELECT autogen_layout FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
|
3641 |
+
return $autogen_layout == '1';
|
3642 |
+
}
|
3643 |
+
|
3644 |
+
/**
|
3645 |
+
* Get count of rows from table.
|
3646 |
+
*
|
3647 |
+
* @param array $params
|
3648 |
+
* params = [selection, table, where]
|
3649 |
+
*
|
3650 |
+
* @return int
|
3651 |
+
*/
|
3652 |
+
public function get_count( $params ) {
|
3653 |
+
global $wpdb;
|
3654 |
+
$query = "SELECT count(" . $params['selection'] . ") FROM " . $wpdb->prefix . $params['table'];
|
3655 |
+
if ( isset($params['where']) ) {
|
3656 |
+
$query .= " WHERE " . $params['where'];
|
3657 |
+
}
|
3658 |
+
|
3659 |
+
return $wpdb->get_var($query);
|
3660 |
+
}
|
3661 |
+
|
3662 |
+
/**
|
3663 |
+
* Delete row(s) from db.
|
3664 |
+
*
|
3665 |
+
* @param array $params
|
3666 |
+
* params = [selection, table, where, order_by, limit]
|
3667 |
+
*
|
3668 |
+
* @return array
|
3669 |
+
*/
|
3670 |
+
public function delete_rows( $params ) {
|
3671 |
+
global $wpdb;
|
3672 |
+
$query = "DELETE FROM " . $wpdb->prefix . $params['table'];
|
3673 |
+
if ( isset($params['where']) ) {
|
3674 |
+
$query .= " WHERE " . $params['where'];
|
3675 |
+
}
|
3676 |
+
if ( isset($params['order_by']) ) {
|
3677 |
+
$query .= " " . $params['order_by'];
|
3678 |
+
}
|
3679 |
+
if ( isset($params['limit']) ) {
|
3680 |
+
$query .= " " . $params['limit'];
|
3681 |
+
}
|
3682 |
+
|
3683 |
+
return $wpdb->query($query);
|
3684 |
+
}
|
3685 |
+
|
3686 |
+
/**
|
3687 |
+
* Get row(s) from db.
|
3688 |
+
*
|
3689 |
+
* @param string $get_type
|
3690 |
+
* @param array $params
|
3691 |
+
* params = [selection, table, where, order_by, limit]
|
3692 |
+
*
|
3693 |
+
* @return array
|
3694 |
+
*/
|
3695 |
+
public function select_rows( $get_type, $params ) {
|
3696 |
+
global $wpdb;
|
3697 |
+
$query = "SELECT " . $params['selection'] . " FROM " . $wpdb->prefix . $params['table'];
|
3698 |
+
if ( isset($params['where']) ) {
|
3699 |
+
$query .= " WHERE " . $params['where'];
|
3700 |
+
}
|
3701 |
+
if ( isset($params['order_by']) ) {
|
3702 |
+
$query .= " " . $params['order_by'];
|
3703 |
+
}
|
3704 |
+
if ( isset($params['limit']) ) {
|
3705 |
+
$query .= " " . $params['limit'];
|
3706 |
+
}
|
3707 |
+
if ( $get_type == "get_col" ) {
|
3708 |
+
return $wpdb->get_col($query);
|
3709 |
+
}
|
3710 |
+
elseif ( $get_type == "get_var" ) {
|
3711 |
+
return $wpdb->get_var($query);
|
3712 |
+
}
|
3713 |
+
|
3714 |
+
return $wpdb->get_row($query);
|
3715 |
+
}
|
3716 |
+
|
3717 |
+
public function create_js( $form_id ) {
|
3718 |
+
WDW_FMC_Library::create_js($form_id, true);
|
3719 |
+
$jsversion = rand();
|
3720 |
+
global $wpdb;
|
3721 |
+
$wpdb->update($wpdb->prefix . 'formmaker', array(
|
3722 |
+
'jsversion' => $jsversion,
|
3723 |
+
), array( 'id' => $form_id ));
|
3724 |
+
}
|
3725 |
+
|
3726 |
+
/**
|
3727 |
+
* Insert to DB.
|
3728 |
+
*
|
3729 |
+
* @param int $backup_id
|
3730 |
+
* @param int $id
|
3731 |
+
*
|
3732 |
+
* @return bool
|
3733 |
+
*/
|
3734 |
+
public function insert_formmaker_backup( $backup_id, $id ) {
|
3735 |
+
global $wpdb;
|
3736 |
+
$query = "INSERT INTO " . $wpdb->prefix . "formmaker_backup SELECT " . $backup_id . " AS backup_id, 1 AS cur, formmakerbkup.id, formmakerbkup.title, formmakerbkup.type, formmakerbkup.mail, formmakerbkup.form_front, formmakerbkup.theme, formmakerbkup.javascript, formmakerbkup.submit_text, formmakerbkup.url, formmakerbkup.submit_text_type, formmakerbkup.script_mail, formmakerbkup.script_mail_user, formmakerbkup.counter, formmakerbkup.published, formmakerbkup.label_order, formmakerbkup.label_order_current, formmakerbkup.article_id, formmakerbkup.pagination, formmakerbkup.show_title, formmakerbkup.show_numbers, formmakerbkup.public_key, formmakerbkup.private_key, formmakerbkup.recaptcha_theme, formmakerbkup.paypal_mode, formmakerbkup.checkout_mode, formmakerbkup.paypal_email, formmakerbkup.payment_currency, formmakerbkup.tax, formmakerbkup.form_fields, formmakerbkup.savedb, formmakerbkup.sendemail, formmakerbkup.requiredmark, formmakerbkup.from_mail, formmakerbkup.from_name, formmakerbkup.reply_to, formmakerbkup.send_to, formmakerbkup.autogen_layout, formmakerbkup.custom_front, formmakerbkup.mail_from_user, formmakerbkup.mail_from_name_user, formmakerbkup.reply_to_user, formmakerbkup.condition, formmakerbkup.mail_cc, formmakerbkup.mail_cc_user, formmakerbkup.mail_bcc, formmakerbkup.mail_bcc_user, formmakerbkup.mail_subject, formmakerbkup.mail_subject_user, formmakerbkup.mail_mode, formmakerbkup.mail_mode_user, formmakerbkup.mail_attachment, formmakerbkup.mail_attachment_user, formmakerbkup.user_id_wd, formmakerbkup.sortable, formmakerbkup.frontend_submit_fields, formmakerbkup.frontend_submit_stat_fields, formmakerbkup.mail_emptyfields, formmakerbkup.mail_verify, formmakerbkup.mail_verify_expiretime, formmakerbkup.mail_verification_post_id, formmakerbkup.save_uploads, formmakerbkup.header_title, formmakerbkup.header_description, formmakerbkup.header_image_url, formmakerbkup.header_image_animation, formmakerbkup.header_hide_image FROM " . $wpdb->prefix . "formmaker as formmakerbkup WHERE id=" . $id;
|
3737 |
+
|
3738 |
+
return $wpdb->query($query);
|
3739 |
+
}
|
3740 |
+
|
3741 |
+
/**
|
3742 |
+
* Update mail_verification_post_id in formmaker table
|
3743 |
+
*
|
3744 |
+
* @param int $id
|
3745 |
+
*
|
3746 |
+
* @return bool
|
3747 |
+
*/
|
3748 |
+
public function update_emailverification_id( $id ) {
|
3749 |
+
global $wpdb;
|
3750 |
+
$sql = "UPDATE " . $wpdb->prefix . "formmaker SET mail_verification_post_id = " . $id . " WHERE mail_verification_post_id != 0";
|
3751 |
+
|
3752 |
+
return $wpdb->query($sql);
|
3753 |
+
}
|
3754 |
+
|
3755 |
+
/**
|
3756 |
+
* Check if mail_verification_post_id the same in table posts and formmaker
|
3757 |
+
*
|
3758 |
+
* @param int $id
|
3759 |
+
*
|
3760 |
+
* @return bool
|
3761 |
+
*/
|
3762 |
+
public function check_mailverification_id_posts_vs_fm( $id ) {
|
3763 |
+
global $wpdb;
|
3764 |
+
$rows = $wpdb->get_results('SELECT mail_verification_post_id FROM ' . $wpdb->prefix . 'formmaker WHERE mail_verification_post_id = ' . $id);
|
3765 |
+
if ( $rows ) {
|
3766 |
+
return TRUE;
|
3767 |
+
}
|
3768 |
+
|
3769 |
+
return FALSE;
|
3770 |
+
}
|
3771 |
+
|
3772 |
+
/**
|
3773 |
+
* Get email verification post id
|
3774 |
+
*
|
3775 |
+
* @return int
|
3776 |
+
*/
|
3777 |
+
public function get_emailverification_post_id() {
|
3778 |
+
global $wpdb;
|
3779 |
+
$post_type = 'fmemailverification';
|
3780 |
+
$row = get_posts(array('post_type' => $post_type));
|
3781 |
+
if ( !empty($row[0]) ) {
|
3782 |
+
$id = $row[0]->ID;
|
3783 |
+
if ( !$this->check_mailverification_id_posts_vs_fm($id) ) {
|
3784 |
+
$this->update_emailverification_id($id);
|
3785 |
+
}
|
3786 |
+
return $id;
|
3787 |
+
}
|
3788 |
+
else {
|
3789 |
+
$post_params = array(
|
3790 |
+
'post_author' => 1,
|
3791 |
+
'post_content' => '[email_verification]',
|
3792 |
+
'post_title' => 'Email Verification',
|
3793 |
+
'post_status' => 'publish',
|
3794 |
+
'post_type' => $post_type,
|
3795 |
+
'comment_status' => 'closed',
|
3796 |
+
'ping_status' => 'closed',
|
3797 |
+
'post_parent' => 0,
|
3798 |
+
'menu_order' => 0,
|
3799 |
+
'import_id' => 0,
|
3800 |
+
);
|
3801 |
+
if ( wp_insert_post($post_params) ) { // create new post by fmemailverification type
|
3802 |
+
$inserted_id = $wpdb->insert_id;
|
3803 |
+
$this->update_emailverification_id($inserted_id);
|
3804 |
+
|
3805 |
+
return $wpdb->insert_id;
|
3806 |
+
}
|
3807 |
+
}
|
3808 |
+
}
|
3809 |
+
|
3810 |
+
/**
|
3811 |
+
* Create Preview Form post.
|
3812 |
+
*
|
3813 |
+
* @return string $guid
|
3814 |
+
*/
|
3815 |
+
public function get_form_preview_post() {
|
3816 |
+
$post_type = 'form-maker' . WDCFM()->plugin_postfix;
|
3817 |
+
$row = get_posts(array( 'post_type' => $post_type ));
|
3818 |
+
if ( !empty($row[0]) ) {
|
3819 |
+
return get_post_permalink($row[0]->ID);
|
3820 |
+
}
|
3821 |
+
else {
|
3822 |
+
$post_params = array(
|
3823 |
+
'post_author' => 1,
|
3824 |
+
'post_status' => 'publish',
|
3825 |
+
'post_content' => '[FormPreview' . WDCFM()->plugin_postfix . ']',
|
3826 |
+
'post_title' => 'Preview',
|
3827 |
+
'post_type' => 'form-maker' . WDCFM()->plugin_postfix,
|
3828 |
+
'comment_status' => 'closed',
|
3829 |
+
'ping_status' => 'closed',
|
3830 |
+
'post_parent' => 0,
|
3831 |
+
'menu_order' => 0,
|
3832 |
+
'import_id' => 0,
|
3833 |
+
);
|
3834 |
+
// Create new post by fmformpreview type.
|
3835 |
+
if ( wp_insert_post($post_params) ) {
|
3836 |
+
flush_rewrite_rules();
|
3837 |
+
global $wpdb;
|
3838 |
+
|
3839 |
+
return get_post_permalink($wpdb->insert_id);
|
3840 |
+
}
|
3841 |
+
else {
|
3842 |
+
return "";
|
3843 |
+
}
|
3844 |
+
}
|
3845 |
+
}
|
3846 |
+
}
|
admin/models/Options_fm.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class FMModelOptions_fmc
|
5 |
+
*/
|
6 |
+
class FMModelOptions_fmc {
|
7 |
+
/**
|
8 |
+
* Save data to DB.
|
9 |
+
*/
|
10 |
+
public function save_db() {
|
11 |
+
$public_key = WDW_FMC_Library::get('public_key', '');
|
12 |
+
$private_key = WDW_FMC_Library::get('private_key', '');
|
13 |
+
$csv_delimiter = (isset($_POST['csv_delimiter']) && $_POST['csv_delimiter'] != '' ? esc_html(stripslashes($_POST['csv_delimiter'])) : ',');
|
14 |
+
$fm_shortcode = (isset($_POST['fm_shortcode']) ? "old" : '');
|
15 |
+
$fm_advanced_layout = WDW_FMC_Library::get('fm_advanced_layout', '0');
|
16 |
+
$map_key = WDW_FMC_Library::get('map_key', '');
|
17 |
+
update_option('fmc_settings', array(
|
18 |
+
'public_key' => $public_key,
|
19 |
+
'private_key' => $private_key,
|
20 |
+
'csv_delimiter' => $csv_delimiter,
|
21 |
+
'map_key' => $map_key,
|
22 |
+
'fm_shortcode' => $fm_shortcode,
|
23 |
+
'fm_advanced_layout' => $fm_advanced_layout,
|
24 |
+
));
|
25 |
+
return 8;
|
26 |
+
}
|
27 |
+
}
|
admin/models/Submissions_fm.php
ADDED
@@ -0,0 +1,934 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class FMModelSubmissions_fmc
|
5 |
+
*/
|
6 |
+
class FMModelSubmissions_fmc {
|
7 |
+
public function blocked_ips() {
|
8 |
+
global $wpdb;
|
9 |
+
$ips = $wpdb->get_col('SELECT ip FROM ' . $wpdb->prefix . 'formmaker_blocked');
|
10 |
+
|
11 |
+
return $ips;
|
12 |
+
}
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Get all forms.
|
16 |
+
*
|
17 |
+
* @return object $forms
|
18 |
+
*/
|
19 |
+
public function get_forms() {
|
20 |
+
global $wpdb;
|
21 |
+
$query = "SELECT `id`, `title`, `published` FROM " . $wpdb->prefix . "formmaker " . (!WDCFM()->is_free ? '' : ' WHERE id' . (WDCFM()->is_free == 1 ? ' NOT
|