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

Version Description

Download this release

Release Info

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

Code changes from version 1.6.8 to 1.7.0

Files changed (58) hide show
  1. Form_Maker.php +0 -1819
  2. Submissions.html.php +0 -1101
  3. Submissions.php +0 -405
  4. Theme_functions.php +0 -151
  5. Themes_function.html.php +0 -313
  6. admin/controllers/FMControllerBlocked_ips_fm.php +146 -0
  7. admin/controllers/FMControllerFeatured_plugins_fm.php +49 -0
  8. admin/controllers/FMControllerFormMakerEditCSS.php +98 -0
  9. admin/controllers/FMControllerFormMakerPreview.php +43 -0
  10. admin/controllers/FMControllerFormmakerwdcaptcha.php +43 -0
  11. admin/controllers/FMControllerFormmakerwindow.php +43 -0
  12. admin/controllers/FMControllerFromeditcountryinpopup.php +43 -0
  13. admin/controllers/FMControllerFrommapeditinpopup.php +43 -0
  14. admin/controllers/FMControllerGenerete_csv.php +43 -0
  15. admin/controllers/FMControllerGenerete_xml.php +43 -0
  16. admin/controllers/FMControllerLicensing_fm.php +49 -0
  17. admin/controllers/FMControllerManage_fm.php +905 -0
  18. admin/controllers/FMControllerShow_matrix.php +43 -0
  19. admin/controllers/FMControllerSubmissions_fm.php +761 -0
  20. admin/controllers/FMControllerThemes_fm.php +190 -0
  21. admin/controllers/FMControllerUninstall_fm.php +57 -0
  22. admin/controllers/FMControllerWidget.php +61 -0
  23. admin/models/FMModelBlocked_ips_fm.php +73 -0
  24. admin/models/FMModelFeatured_plugins_fm.php +30 -0
  25. admin/models/FMModelFormMakerEditCSS.php +42 -0
  26. admin/models/FMModelFormMakerPreview.php +42 -0
  27. admin/models/FMModelFormmakerwdcaptcha.php +31 -0
  28. admin/models/FMModelFormmakerwindow.php +36 -0
  29. admin/models/FMModelFromeditcountryinpopup.php +31 -0
  30. admin/models/FMModelFrommapeditinpopup.php +31 -0
  31. admin/models/FMModelGenerete_csv.php +262 -0
  32. admin/models/FMModelGenerete_xml.php +260 -0
  33. admin/models/FMModelLicensing_fm.php +30 -0
  34. admin/models/FMModelManage_fm.php +1816 -0
  35. admin/models/FMModelShow_matrix.php +31 -0
  36. admin/models/FMModelSubmissions_fm.php +592 -0
  37. admin/models/FMModelThemes_fm.php +88 -0
  38. admin/models/FMModelUninstall_fm.php +44 -0
  39. admin/models/FMModelWidget.php +38 -0
  40. admin/views/FMViewBlocked_ips_fm.php +148 -0
  41. admin/views/FMViewFeatured_plugins_fm.php +171 -0
  42. admin/views/FMViewFormMakerEditCSS.php +83 -0
  43. admin/views/FMViewFormMakerPreview.php +479 -0
  44. admin/views/FMViewFormmakerwdcaptcha.php +91 -0
  45. admin/views/FMViewFormmakerwindow.php +113 -0
  46. admin/views/FMViewFromeditcountryinpopup.php +141 -0
  47. admin/views/FMViewFrommapeditinpopup.php +64 -0
  48. admin/views/FMViewGenerete_csv.php +69 -0
  49. admin/views/FMViewGenerete_xml.php +67 -0
  50. admin/views/FMViewLicensing_fm.php +54 -0
  51. admin/views/FMViewManage_fm.php +3290 -0
  52. admin/views/FMViewShow_matrix.php +127 -0
  53. admin/views/FMViewSubmissions_fm.php +2765 -0
  54. admin/views/FMViewThemes_fm.php +208 -0
  55. admin/views/FMViewUninstall_fm.php +119 -0
  56. admin/views/FMViewWidget.php +83 -0
  57. {js → css}/calendar-jos.css +22 -12
  58. css/codemirror.css +37 -0
Form_Maker.php DELETED
@@ -1,1819 +0,0 @@
1
- <?php
2
- /*
3
- Plugin Name: Form Maker
4
- Plugin URI: http://web-dorado.com/products/form-maker-wordpress.html
5
- Description: This plugin is a modern and advanced tool for easy and fast creating of a WordPress Form. The backend interface is intuitive and user friendly which allows users far from scripting and programming to create WordPress Forms.
6
- Version: 1.6.8
7
- Author: http://web-dorado.com/
8
- License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
9
- */
10
-
11
-
12
- function form_maker_sesseion_path() {
13
- @session_start();
14
- session_save_path(ABSPATH . 'wp-content/plugins/form-maker/session');
15
- }
16
- add_action('init', 'form_maker_sesseion_path');
17
-
18
- // Css.
19
- $first_css = ".wdform_table1
20
- {
21
- font-size:14px;
22
- font-weight:normal;
23
- color:#000000;
24
- width:100% ;
25
- }
26
-
27
- .wdform_tbody1
28
- {
29
- float:left;
30
- }
31
- .wdform_table2
32
- {
33
- padding-right:50px !important;
34
- float:left;
35
- border-spacing: 0px;
36
- border-collapse:separate !important;
37
- }
38
- #edit_main_table label
39
- {
40
- line-height: 19px;
41
- }
42
- #edit_main_table td
43
- {
44
- padding-right: 5px;
45
- }
46
- .time_box
47
- {
48
- border-width:1px;
49
- margin: 0px;
50
- padding: 0px;
51
- text-align:right;
52
- width:30px;
53
- vertical-align:middle
54
- }
55
-
56
- .mini_label
57
- {
58
- font-size:10px;
59
- font-family: 'Lucida Grande', Tahoma, Arial, Verdana, sans-serif;
60
- }
61
-
62
- .ch_rad_label
63
- {
64
- display:inline;
65
- margin-left:5px;
66
- margin-right:15px;
67
- float:none;
68
- }
69
-
70
- .label
71
- {
72
- border:none;
73
- }
74
-
75
-
76
- .td_am_pm_select
77
- {
78
- padding-left:5;
79
- }
80
-
81
- .am_pm_select
82
- {
83
- height: 16px;
84
- margin:0;
85
- padding:0
86
- }
87
-
88
- .input_deactive
89
- {
90
- color:#999999;
91
- font-style:italic;
92
- border-width:1px;
93
- margin: 0px;
94
- padding: 0px
95
- }
96
-
97
- .input_active
98
- {
99
- color:#000000;
100
- font-style:normal;
101
- border-width:1px;
102
- margin: 0px;
103
- padding: 0px
104
- }
105
-
106
- .required
107
- {
108
- border:none;
109
- color:red
110
- }
111
-
112
- .captcha_img
113
- {
114
- border-width:0px;
115
- margin: 0px;
116
- padding: 0px;
117
- cursor:pointer;
118
-
119
-
120
- }
121
-
122
- .captcha_refresh
123
- {
124
- width:30px;
125
- height:30px;
126
- border-width:0px;
127
- margin: 0px;
128
- padding: 0px;
129
- vertical-align:middle;
130
- cursor:pointer;
131
- background-image: url(" . plugins_url('images/refresh_black.png', __FILE__) . ");
132
- }
133
-
134
- .captcha_input
135
- {
136
- height:20px;
137
- border-width:1px;
138
- margin: 0px;
139
- padding: 0px;
140
- vertical-align:middle;
141
- }
142
-
143
- .file_upload
144
- {
145
- border-width:1px;
146
- margin: 0px;
147
- padding: 0px
148
- }
149
-
150
- .page_deactive
151
- {
152
- border:1px solid black;
153
- padding:4px 7px 4px 7px;
154
- margin:4px;
155
- cursor:pointer;
156
- background-color:#DBDBDB;
157
- }
158
-
159
- .page_active
160
- {
161
- border:1px solid black;
162
- padding:4px 7px 4px 7px;
163
- margin:4px;
164
- cursor:pointer;
165
- background-color:#878787;
166
- }
167
-
168
- .page_percentage_active
169
- {
170
- padding:0px;
171
- margin:0px;
172
- border-spacing: 0px;
173
- height:30px;
174
- line-height:30px;
175
- background-color:yellow;
176
- border-radius:30px;
177
- font-size:15px;
178
- float:left;
179
- text-align: right !important;
180
- }
181
-
182
-
183
- .page_percentage_deactive
184
- {
185
- height:30px;
186
- line-height:30px;
187
- padding:5px;
188
- border:1px solid black;
189
- width:100%;
190
- background-color:white;
191
- border-radius:30px;
192
- text-align: left !important;
193
- }
194
-
195
- .page_numbers
196
- {
197
- font-size:11px;
198
- }
199
-
200
- .phone_area_code
201
- {
202
- width:50px;
203
- }
204
-
205
- .phone_number
206
- {
207
- width:100px;
208
- }";
209
- //////////////////////////////////////////////////////////////////
210
- require_once("front_end_form_maker.php");
211
- require_once("form_maker_widget.php");
212
- require_once('recaptchalib.php');
213
-
214
- function form_maker_language_load() {
215
- load_plugin_textdomain('form_maker', FALSE, basename(dirname(__FILE__)) . '/languages');
216
- }
217
- add_action('init', 'form_maker_language_load');
218
-
219
- function do_output_buffer() {
220
- ob_start();
221
- }
222
- add_action('init', 'do_output_buffer');
223
-
224
- for ($ii = 0; $ii < 100; $ii++) {
225
- remove_filter('the_content', 'do_shortcode', $ii);
226
- remove_filter('the_content', 'wpautop', $ii);
227
- }
228
- add_filter('the_content', 'wpautop', 10);
229
- add_filter('the_content', 'do_shortcode', 11);
230
-
231
- function Form_maker_fornt_end_main($content) {
232
- $pattern = '[\[Form id="([0-9]*)"\]]';
233
- $count_forms_in_post = preg_match_all($pattern, $content, $matches_form);
234
- for ($jj = 0; $jj < $count_forms_in_post; $jj++) {
235
- $padron = $matches_form[0][$jj];
236
- $replacment = form_maker_front_end($matches_form[1][$jj]);
237
- $content = str_replace($padron, $replacment, $content);
238
- }
239
- return $content;
240
- }
241
- add_filter('the_content', 'Form_maker_fornt_end_main', 5000);
242
-
243
- function form_maker_scripts_method() {
244
- wp_enqueue_style("gmap_styles_", plugins_url("css/style_for_map.css", __FILE__), FALSE);
245
- wp_enqueue_script("main_g_js", plugins_url("js/main_front_end.js", __FILE__), array(), '', FALSE);
246
- wp_enqueue_script("Calendar", plugins_url("js/calendar.js", __FILE__), FALSE);
247
- wp_enqueue_script("calendar-setup", plugins_url("js/calendar-setup.js", __FILE__), FALSE);
248
- wp_enqueue_script("calendar_function", plugins_url("js/calendar_function.js", __FILE__), FALSE);
249
- wp_enqueue_style("Css", plugins_url("js/calendar-jos.css", __FILE__), FALSE);
250
- wp_enqueue_script("jquery", plugins_url("js/jquery-1.9.1.js", __FILE__), array(), '1.9.1');
251
- wp_deregister_script('jquery-ui');
252
- wp_enqueue_script("jquery-ui", plugins_url("js/jquery-ui.js", __FILE__));
253
- wp_enqueue_script("jquery.ui.slider", plugins_url("js/jquery.ui.slider.js", __FILE__));
254
- wp_enqueue_style("jquery-ui-spinner", plugins_url("css/jquery-ui-spinner.css", __FILE__), FALSE);
255
- }
256
- add_action('wp_enqueue_scripts', 'form_maker_scripts_method');
257
-
258
- // Add form maker plugin ur to head.
259
- function form_maker_plugin_url() {
260
- echo "<input type='hidden' value='" . plugins_url("", __FILE__) . "' id='form_plugins_url' />";
261
- echo '<script type="text/javascript">
262
- if (document.getElementById("form_plugins_url")) {
263
- var plugin_url = document.getElementById("form_plugins_url").value;
264
- }
265
- else {
266
- var plugin_url = "";
267
- }
268
- </script>';
269
- }
270
- add_action('wp_head', 'form_maker_plugin_url');
271
-
272
- // Frontend messages.
273
- $check_seo = 0;
274
- function print_massage($content) {
275
- include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
276
- if (is_plugin_active('wordpress-seo/wp-seo.php') && $_SESSION['form_submit_type']) {
277
- global $check_seo;
278
- if ($check_seo++ != 1) {
279
- // return;
280
- }
281
- }
282
- $mh_after_head = did_action('wp_enqueue_scripts');
283
- if ($mh_after_head == 1) {
284
- global $wpdb;
285
- @session_start();
286
- if (isset($_SESSION['form_submit_type']) && $_SESSION['form_submit_type']) {
287
- $type_and_id = $_SESSION['form_submit_type'];
288
- $type_and_id = explode(',', $type_and_id);
289
- $form_get_type = $type_and_id[0];
290
- $form_get_id = $type_and_id[1];
291
- $_SESSION['form_submit_type'] = 0;
292
- if ($form_get_type == 3) {
293
- $_SESSION['massage_after_submit'] = "";
294
- $row = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id='" . $form_get_id . "'");
295
- return wpautop($row->submit_text);
296
- }
297
- }
298
- if (isset($_SESSION['massage_after_submit'])) {
299
- if ($_SESSION['massage_after_submit'] != "") {
300
- $message = $_SESSION['massage_after_submit'];
301
- $_SESSION['massage_after_submit'] = "";
302
- $returned_content = "<style>
303
- .updated,.error{
304
- border-width:1px !important;
305
- border-style:solid !important;
306
- padding:0 .6em !important;
307
- margin:5px 15px 2px !important;
308
- -moz-border-radius:3px !important;
309
- -khtml-border-radius:3px !important;
310
- -webkit-border-radius:3px !important;
311
- border-radius:3px !important;
312
- }
313
- .updated p, .error p
314
- {
315
- font-size: 12px !important;
316
- margin:.5em 0 !important;
317
- line-height:1 !important;
318
- padding:2px !important;
319
- }
320
- .updated, .error
321
- {
322
- margin:5px 0 15px !important;
323
- }
324
- .updated{
325
- background-color:#ffffe0 !important;
326
- border-color:#e6db55 !important;
327
- }
328
- .error
329
- {
330
- background-color:#ffebe8 !important;
331
- border-color:#c00 !important;
332
- }
333
- error a
334
- {
335
- color:#c00 !important;
336
- }
337
- .error
338
- {
339
- line-height:22px !important;
340
- margin:0 15px !important;
341
- padding:3px 5px !important;
342
- }
343
- .error-div
344
- {
345
- display:block !important;
346
- line-height:36px !important;
347
- float:right !important;
348
- margin-right:20px !important;
349
- }
350
- </style>";
351
- if ($_SESSION['error_or_no']) {
352
- $error = 'error';
353
- }
354
- else {
355
- $error = 'updated';
356
- }
357
- $returned_content .= "<div class=\"" . $error . "\" ><p><strong>" . $message . "</strong></p></div>" . $content; // modified content
358
- return $returned_content;
359
- }
360
- else {
361
- return $content;
362
- }
363
- }
364
- else {
365
- return $content;
366
- }
367
- }
368
- else {
369
- return $content;
370
- }
371
- }
372
-
373
- add_filter('the_content', 'print_massage');
374
- ///////////////////////////// FORNT END FUNCTION
375
- //// add front end
376
- //// add editor new mce button
377
- add_filter('mce_external_plugins', "Form_Maker_register");
378
- add_filter('mce_buttons', 'Form_Maker_add_button', 0);
379
-
380
- /// function for add new button
381
- function Form_Maker_add_button($buttons) {
382
- array_push($buttons, "Form_Maker_mce");
383
- return $buttons;
384
- }
385
-
386
- /// function for registr new button
387
- function Form_Maker_register($plugin_array) {
388
- $url = plugins_url('js/editor_plugin.js', __FILE__);
389
- $plugin_array["Form_Maker_mce"] = $url;
390
- return $plugin_array;
391
- }
392
-
393
- // Add ajax for form maker.
394
- require_once("form_ajax_functions.php");
395
- add_action('wp_ajax_formmakergeneretexml', 'form_maker_generete_xml'); // Export xml.
396
- add_action('wp_ajax_nopriv_formmakergeneretexml', 'form_maker_generete_xml'); // Export xml for all users.
397
- add_action('wp_ajax_formmakergeneretecsv', 'form_maker_generete_csv'); // Export csv.
398
- add_action('wp_ajax_nopriv_formmakergeneretecsv', 'form_maker_generete_csv'); // Export csv for all users.
399
- add_action('wp_ajax_formmakerwdcaptcha', 'form_maker_wd_captcha'); // Generete captcha image and save it code in session.
400
- add_action('wp_ajax_nopriv_formmakerwdcaptcha', 'form_maker_wd_captcha'); // Generete captcha image and save it code in session for all users.
401
- add_action('wp_ajax_formmakerwindow', 'form_maker_window_php'); // Open window in post or page for editor.
402
- add_action('wp_ajax_nopriv_formmakerwindow', 'form_maker_window_php'); // Open window in post or page for editor for all users.
403
- add_action('wp_ajax_fromeditcountryinpopup', 'spider_form_country_edit'); // Open country list.
404
- add_action('wp_ajax_form_preview_product_option', 'form_maker_form_preview_product_option');
405
-
406
- function spider_form_country_edit() {
407
- if (function_exists('current_user_can')) {
408
- if (!current_user_can('manage_options')) {
409
- die('Access Denied');
410
- }
411
- }
412
- else {
413
- die('Access Denied');
414
- }
415
- if (isset($_GET['field_id'])) {
416
- $id = (int)$_GET['field_id'];
417
- }
418
- else {
419
- echo "<h2>error cannot get fild id</h2>";
420
- return;
421
- }
422
- html_spider_form_country_edit($id);
423
- }
424
-
425
- function html_spider_form_country_edit($id) {
426
- wp_print_scripts('jquery');
427
- wp_print_scripts('jquery-ui-core');
428
- wp_print_scripts('jquery-ui-widget');
429
- wp_print_scripts('jquery-ui-mouse');
430
- wp_print_scripts('jquery-ui-slider');
431
- wp_print_scripts('jquery-ui-sortable');
432
-
433
-
434
- ?>
435
-
436
- <span style=" position: absolute;right: 29px;">
437
- <img alt="ADD" title="add" style="cursor:pointer; vertical-align:middle; margin:5px; "
438
- src="<?php echo plugins_url('images/save.png', __FILE__); ?>" onclick="save_list()">
439
- <img alt="CANCEL" title="cancel" style=" cursor:pointer; vertical-align:middle; margin:5px; "
440
- src="<?php echo plugins_url('images/cancel_but.png', __FILE__); ?>" onclick="window.parent.tb_remove();">
441
- </span>
442
- <button onclick="select_all()">Select all</button>
443
- <button onclick="remove_all()">Remove all</button>
444
- <ul id="countries_list" style="list-style:none; padding:0px">
445
- </ul>
446
-
447
- <script>
448
-
449
-
450
- selec_coutries = [];
451
-
452
- coutries = ["", "Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Antigua and Barbuda", "Argentina", "Armenia", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Central African Republic", "Chad", "Chile", "China", "Colombi", "Comoros", "Congo (Brazzaville)", "Congo", "Costa Rica", "Cote d'Ivoire", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor (Timor Timur)", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Fiji", "Finland", "France", "Gabon", "Gambia, The", "Georgia", "Germany", "Ghana", "Greece", "Grenada", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Honduras", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, North", "Korea, South", "Kuwait", "Kyrgyzstan", "Laos", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Mauritania", "Mauritius", "Mexico", "Micronesia", "Moldova", "Monaco", "Mongolia", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepa", "Netherlands", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland", "Portugal", "Qatar", "Romania", "Russia", "Rwanda", "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Serbia and Montenegro", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "Spain", "Sri Lanka", "Sudan", "Suriname", "Swaziland", "Sweden", "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "Togo", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "Uruguay", "Uzbekistan", "Vanuatu", "Vatican City", "Venezuela", "Vietnam", "Yemen", "Zambia", "Zimbabwe"];
453
-
454
- select_ = window.parent.document.getElementById('<?php echo $id ?>_elementform_id_temp');
455
- n = select_.childNodes.length;
456
- for (i = 0; i < n; i++) {
457
-
458
- selec_coutries.push(select_.childNodes[i].value);
459
- var ch = document.createElement('input');
460
- ch.setAttribute("type", "checkbox");
461
- ch.setAttribute("checked", "checked");
462
- ch.value = select_.childNodes[i].value;
463
- ch.id = i + "ch";
464
- //ch.setAttribute("id",i);
465
-
466
-
467
- var p = document.createElement('span');
468
- p.style.cssText = "color:#000000; font-size: 13px; cursor:move";
469
- p.innerHTML = select_.childNodes[i].value;
470
-
471
- var li = document.createElement('li');
472
- li.style.cssText = "margin:3px; vertical-align:middle";
473
- li.id = i;
474
-
475
- li.appendChild(ch);
476
- li.appendChild(p);
477
-
478
- document.getElementById('countries_list').appendChild(li);
479
- }
480
- cur = i;
481
- m = coutries.length;
482
- for (i = 0; i < m; i++) {
483
- isin = isValueInArray(selec_coutries, coutries[i]);
484
-
485
- if (!isin) {
486
- var ch = document.createElement('input');
487
- ch.setAttribute("type", "checkbox");
488
- ch.value = coutries[i];
489
- ch.id = cur + "ch";
490
-
491
-
492
- var p = document.createElement('span');
493
- p.style.cssText = "color:#000000; font-size: 13px; cursor:move";
494
- p.innerHTML = coutries[i];
495
-
496
- var li = document.createElement('li');
497
- li.style.cssText = "margin:3px; vertical-align:middle";
498
- li.id = cur;
499
-
500
- li.appendChild(ch);
501
- li.appendChild(p);
502
-
503
- document.getElementById('countries_list').appendChild(li);
504
- cur++;
505
- }
506
- }
507
- jQuery(function () {
508
- jQuery("#countries_list").sortable();
509
- jQuery("#countries_list").disableSelection();
510
- });
511
-
512
- function isValueInArray(arr, val) {
513
- inArray = false;
514
- for (x = 0; x < arr.length; x++)
515
- if (val == arr[x])
516
- inArray = true;
517
- return inArray;
518
- }
519
- function save_list() {
520
- select_.innerHTML = ""
521
- ul = document.getElementById('countries_list');
522
- n = ul.childNodes.length;
523
- for (i = 0; i < n; i++) {
524
- if (ul.childNodes[i].tagName == "LI") {
525
- id = ul.childNodes[i].id;
526
- if (document.getElementById(id + 'ch').checked) {
527
- var option_ = document.createElement('option');
528
- option_.setAttribute("value", document.getElementById(id + 'ch').value);
529
- option_.innerHTML = document.getElementById(id + 'ch').value;
530
-
531
- select_.appendChild(option_);
532
- }
533
-
534
- }
535
-
536
-
537
- }
538
- window.parent.tb_remove();
539
-
540
-
541
- }
542
-
543
- function select_all() {
544
- for (i = 0; i < 194; i++) {
545
- document.getElementById(i + 'ch').checked = true;
546
- ;
547
- }
548
- }
549
-
550
- function remove_all() {
551
- for (i = 0; i < 194; i++) {
552
- document.getElementById(i + 'ch').checked = false;
553
- ;
554
- }
555
- }
556
- </script>
557
-
558
-
559
-
560
-
561
- <?php
562
- }
563
-
564
- function add_button_style1() {
565
- // echo '<style type="text/css">
566
- // .wp_themeSkin span.mce_Form_Maker_mce {background:url(' . plugins_url('images/formmakerLogo.png', __FILE__) . ') no-repeat !important;}
567
- // .wp_themeSkin .mceButtonEnabled:hover span.mce_Form_Maker_mce,.wp_themeSkin .mceButtonActive span.mce_Form_Maker_mce
568
- // {background:url(' . plugins_url('images/formmakerLogoHover.png', __FILE__) . ') no-repeat !important;}
569
- // </style>';
570
- echo '<script>
571
- var plugin_url = "' . plugins_url('', __FILE__) . '";
572
- </script>';
573
- }
574
-
575
- add_action('admin_head', 'add_button_style1');
576
- add_action('admin_menu', 'Form_maker_options_panel');
577
- function Form_maker_options_panel() {
578
- $icon_url = plugins_url('images/FormMakerLogo-16.png', __FILE__);
579
- add_menu_page('Theme page title', 'Form Maker', 'manage_options', 'Form_maker', 'Manage_Form_maker', $icon_url);
580
- $page_form = add_submenu_page('Form_maker', 'Form Maker Manager', 'Manager', 'manage_options', 'Form_maker', 'Manage_Form_maker');
581
- $page_submits = add_submenu_page('Form_maker', 'Form Maker submissions', 'Submissions', 'manage_options', 'Form_maker_Submits', 'Form_maker_Submits');
582
- add_submenu_page('Form_maker', 'Form Maker Themes', 'Themes', 'manage_options', 'Form_maker_Themes', 'Form_maker_Themes');
583
- add_submenu_page('Form_maker', 'Licensing/Donation', 'Licensing/Donation', 'manage_options', 'form_maker_Licensing', 'form_maker_Licensing');
584
- $Featured_Plugins = add_submenu_page('Form_maker', 'Featured Plugins', 'Featured Plugins', 'manage_options', 'form_maker_Featured_Plugins', 'form_maker_Featured_Plugins');
585
- add_submenu_page('Form_maker', 'Uninstall Form Maker ', 'Uninstall Form Maker', 'manage_options', 'Uninstall_Form_Maker', 'Uninstall_Form_Maker');
586
- add_action('admin_print_styles-' . $Featured_Plugins, 'form_maker_Featured_Plugins_styles');
587
- add_action('admin_print_styles-' . $page_form, 'form_maker_admin_styles_scripts');
588
- add_action('admin_print_styles-' . $page_submits, 'form_maker_submits_styles_scripts');
589
- }
590
-
591
- function form_maker_Featured_Plugins_styles() {
592
- wp_enqueue_style("Featured_Plugins", plugins_url("css/featured_plugins.css", __FILE__));
593
- }
594
- function form_maker_Featured_Plugins() {
595
- ?>
596
- <div id="main_featured_plugins_page">
597
- <table align="center" width="90%" style="margin-top: 0px;border-bottom: rgb(111, 111, 111) solid 2px;">
598
- <tr>
599
- <td colspan="2" style="height: 70px;"><h3 style="margin: 0px;font-family:Segoe UI;padding-bottom: 15px;color: rgb(111, 111, 111); font-size:18pt;">Featured Plugins</h3></td>
600
- <td align="right" style="font-size:16px;">
601
- <a href="http://web-dorado.com/files/fromFormMaker.php" target="_blank" style="color:red; text-decoration:none;">
602
- <img src="<?php echo plugins_url('images/header.png', __FILE__); ?>" border="0" alt="www.web-dorado.com" width="215"><br>
603
- Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
604
- </a>
605
- </td>
606
- </tr>
607
- </table>
608
- <form method="post">
609
- <ul id="featured-plugins-list">
610
- <li class="spider-calendar">
611
- <div class="product">
612
- <div class="title">
613
- <strong class="heading">Spider Calendar</strong>
614
- <p>WordPress event calendar plugin</p>
615
- </div>
616
- </div>
617
- <div class="description">
618
- <p>Spider Event Calendar is a highly configurable product which allows you to have multiple organized events.</p>
619
- <a target="_blank" href="http://web-dorado.com/products/wordpress-calendar.html" class="download">Download</a>
620
- </div>
621
- </li>
622
- <li class="catalog">
623
- <div class="product">
624
- <div class="title">
625
- <strong class="heading">Spider Catalog</strong>
626
- <p>WordPress product catalog plugin</p>
627
- </div>
628
- </div>
629
- <div class="description">
630
- <p>Spider Catalog for WordPress is a convenient tool for organizing the products represented on your website into catalogs.</p>
631
- <a target="_blank" href="http://web-dorado.com/products/wordpress-catalog.html" class="download">Download</a>
632
- </div>
633
- </li>
634
- <li class="player">
635
- <div class="product">
636
- <div class="title">
637
- <strong class="heading">Video Player</strong>
638
- <p>WordPress Video player plugin</p>
639
- </div>
640
- </div>
641
- <div class="description">
642
- <p>Spider Video Player for WordPress is a Flash & HTML5 video player plugin that allows you to easily add videos to your website with the possibility</p>
643
- <a target="_blank" href="http://web-dorado.com/products/wordpress-player.html" class="download">Download</a>
644
- </div>
645
- </li>
646
- <li class="contacts">
647
- <div class="product">
648
- <div class="title">
649
- <strong class="heading">Spider Contacts</strong>
650
- <p>Wordpress staff list plugin</p>
651
- </div>
652
- </div>
653
- <div class="description">
654
- <p>Spider Contacts helps you to display information about the group of people more intelligible, effective and convenient.</p>
655
- <a target="_blank" href="http://web-dorado.com/products/wordpress-contacts-plugin.html" class="download">Download</a>
656
- </div>
657
- </li>
658
- <li class="facebook">
659
- <div class="product">
660
- <div class="title">
661
- <strong class="heading">Spider Facebook</strong>
662
- <p>WordPress Facebook plugin</p>
663
- </div>
664
- </div>
665
- <div class="description">
666
- <p>Spider Facebook is a WordPress integration tool for Facebook.It includes all the available Facebook social plugins and widgets to be added to your web</p>
667
- <a target="_blank" href="http://web-dorado.com/products/wordpress-facebook.html" class="download">Download</a>
668
- </div>
669
- </li>
670
- <li class="faq">
671
- <div class="product">
672
- <div class="title">
673
- <strong class="heading">Spider FAQ</strong>
674
- <p>WordPress FAQ Plugin</p>
675
- </div>
676
- </div>
677
- <div class="description">
678
- <p>The Spider FAQ WordPress plugin is for creating an FAQ (Frequently Asked Questions) section for your website.</p>
679
- <a target="_blank" href="http://web-dorado.com/products/wordpress-faq-plugin.html" class="download">Download</a>
680
- </div>
681
- </li>
682
- <li class="zoom">
683
- <div class="product">
684
- <div class="title">
685
- <strong class="heading">Zoom</strong>
686
- <p>WordPress text zoom plugin</p>
687
- </div>
688
- </div>
689
- <div class="description">
690
- <p>Zoom enables site users to resize the predefined areas of the web site.</p>
691
- <a target="_blank" href="http://web-dorado.com/products/wordpress-zoom.html" class="download">Download</a>
692
- </div>
693
- </li>
694
- <li class="flash-calendar">
695
- <div class="product">
696
- <div class="title">
697
- <strong class="heading">Flash Calendar</strong>
698
- <p>WordPress flash calendar plugin</p>
699
- </div>
700
- </div>
701
- <div class="description">
702
- <p>Spider Flash Calendar is a highly configurable Flash calendar plugin which allows you to have multiple organized events.</p>
703
- <a target="_blank" href="http://web-dorado.com/products/wordpress-events-calendar.html" class="download">Download</a>
704
- </div>
705
- </li>
706
- <li class="contact-maker">
707
- <div class="product">
708
- <div class="title">
709
- <strong class="heading">Contact Form Maker</strong>
710
- <p>WordPress contact form builder plugin</p>
711
- </div>
712
- </div>
713
- <div class="description">
714
- <p>WordPress Contact Form Maker is an advanced and easy-to-use tool for creating forms.</p>
715
- <a target="_blank" href="http://web-dorado.com/products/wordpress-contact-form-maker-plugin.html" class="download">Download</a>
716
- </div>
717
- </li>
718
- </ul>
719
- </form>
720
- </div >
721
- <?php
722
- }
723
-
724
- function form_maker_Licensing() {
725
- ?>
726
- <div style="width:95%">
727
- <p>This plugin is the non-commercial version of the Form Maker. Use of this plugin is free. You can add not more than 7 fields. The limitation is on the some types of the fields (File Upload, Map and Paypal). If you want to use those fields, you are required to purchase a license. </p>
728
- <br/>
729
- <a href="http://web-dorado.com/files/fromFormMaker.php" class="button-primary" target="_blank">Purchase a License</a>
730
- <br/><br/>
731
- <p>After the purchasing the commercial version follow this steps:</p>
732
- <ol>
733
- <li>Deactivate Form Maker Plugin</li>
734
- <li>Delete Form Maker Plugin</li>
735
- <li>Install the downloaded commercial version of the plugin</li>
736
- </ol>
737
- <br/>
738
- <p>If you enjoy using Form Maker and find it useful, please consider making a donation. Your donation will help encourage and support the plugin's continued development and better user support.</p>
739
- <br/>
740
- <a href="http://web-dorado.com/files/donate_redirect.php" target="_blank"><img src="<?php echo plugins_url('images/btn_donateCC_LG.gif', __FILE__); ?>" /></a>
741
- </div>
742
- <?php
743
- }
744
-
745
- function form_maker_submits_styles_scripts() {
746
- wp_enqueue_script('word-count');
747
- wp_enqueue_script('post');
748
- wp_enqueue_script('editor');
749
- wp_enqueue_script('media-upload');
750
- wp_admin_css('thickbox');
751
- wp_print_scripts('media-upload');
752
- do_action('admin_print_styles');
753
- wp_enqueue_script('common');
754
- wp_enqueue_script('jquery-color');
755
- wp_enqueue_script('utils');
756
- wp_enqueue_script("main", plugins_url("js/main.js", __FILE__));
757
- wp_enqueue_script("mootools", plugins_url("js/mootools.js", __FILE__));
758
- wp_enqueue_script("f_calendar", plugins_url("js/calendar.js", __FILE__));
759
- wp_enqueue_script("f_calendar_functions", plugins_url("js/calendar_function.js", __FILE__));
760
- wp_enqueue_script("f_calendar_setup", plugins_url("js/calendar-setup.js", __FILE__));
761
- wp_enqueue_style("calendar-jos", plugins_url("js/calendar-jos.css", __FILE__));
762
- wp_enqueue_script("jquery", plugins_url("js/jquery-1.9.1.js", __FILE__), array(), '1.9.1');
763
- wp_deregister_script('jquery-ui');
764
- wp_enqueue_script("jquery-ui", plugins_url("js/jquery-ui.js", __FILE__));
765
- wp_enqueue_style("jquery-ui-spinner", plugins_url("css/jquery-ui-spinner.css", __FILE__), FALSE);
766
- wp_enqueue_script("jquery.ui.slider", plugins_url("js/jquery.ui.slider.js", __FILE__));
767
-
768
- }
769
-
770
- function form_maker_admin_styles_scripts() {
771
- if (isset($_GET['task'])) {
772
- if (esc_html($_GET['task']) == "update" || esc_html($_GET['task']) == "save_update" || esc_html($_GET['task']) == "gotoedit" || esc_html($_GET['task']) == "add_form" || esc_html($_GET['task']) == "edit_form" || esc_html($_GET['task']) == "form_options") {
773
- wp_enqueue_script('word-count');
774
- wp_enqueue_script('post');
775
- wp_enqueue_script('editor');
776
- wp_enqueue_script('media-upload');
777
- wp_admin_css('thickbox');
778
- wp_print_scripts('media-upload');
779
- do_action('admin_print_styles');
780
- wp_enqueue_script('common');
781
- wp_enqueue_script('jquery-color');
782
- if (get_bloginfo('version') < '3.3') {
783
- if (function_exists('add_thickbox'))
784
- add_thickbox();
785
- if (function_exists('wp_tiny_mce'))
786
- wp_tiny_mce();
787
- }
788
- wp_enqueue_script('utils');
789
- wp_enqueue_script("main", plugins_url("js/main.js", __FILE__));
790
- wp_enqueue_script("form_main_js", plugins_url("js/formmaker_free.js", __FILE__));
791
- wp_enqueue_script("gmap_form_api", 'http://maps.google.com/maps/api/js?sensor=false');
792
- wp_enqueue_style("styles_form", plugins_url("css/style.css", __FILE__));
793
- wp_enqueue_script("mootools", plugins_url("js/mootools.js", __FILE__));
794
- wp_enqueue_script("f_calendar", plugins_url("js/calendar.js", __FILE__));
795
- wp_enqueue_script("f_calendar_functions", plugins_url("js/calendar_function.js", __FILE__));
796
- wp_enqueue_script("f_calendar_setup", plugins_url("js/calendar-setup.js", __FILE__));
797
- wp_enqueue_style("calendar-jos", plugins_url("js/calendar-jos.css", __FILE__));
798
- wp_enqueue_script("jquery", plugins_url("js/jquery-1.9.1.js", __FILE__), array(), '1.9.1');
799
- wp_deregister_script('jquery-ui');
800
- wp_enqueue_script("jquery-ui", plugins_url("js/jquery-ui.js", __FILE__));
801
- wp_enqueue_script("jquery.ui.slider", plugins_url("js/jquery.ui.slider.js", __FILE__));
802
- wp_enqueue_style("jquery-ui-spinner", plugins_url("css/jquery-ui-spinner.css", __FILE__), FALSE);
803
- }
804
- }
805
- }
806
-
807
- function Manage_Form_maker() {
808
- require_once("form_maker_functions.php");
809
- require_once("form_maker_functions.html.php");
810
- if (!function_exists('print_html_nav')) {
811
- require_once("nav_function/nav_html_func.php");
812
- }
813
- global $wpdb;
814
- if (isset($_GET["task"])) {
815
- $task = esc_html($_GET["task"]);
816
- }
817
- else {
818
- $task = "show";
819
- }
820
- if (isset($_GET["id"])) {
821
- $id = (int) $_GET["id"];
822
- }
823
- else {
824
- $id = 0;
825
- }
826
- switch ($task) {
827
- case 'update':
828
- update_form_maker();
829
- break;
830
- case 'save_update':
831
- save_update_form_maker();
832
- break;
833
- case 'update_complite':
834
- update_complete();
835
- display_form_lists();
836
- break;
837
- case "add_form" :
838
- add_form();
839
- break;
840
- case "edit_form" :
841
- edit_form_maker($id);
842
- break;
843
- case "Save" :
844
- if ($id) {
845
- apply_form($id);
846
- }
847
- else {
848
- save_form();
849
- }
850
- display_form_lists();
851
- break;
852
- case "Apply" :
853
- if ($id) {
854
- apply_form($id);
855
- }
856
- else {
857
- save_form();
858
- $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
859
- }
860
- forchrome($id);
861
- break;
862
- case "gotoedit" :
863
- gotoedit();
864
- edit_form_maker($id);
865
- break;
866
- case "remove_form" :
867
- remove_form($id);
868
- display_form_lists();
869
- break;
870
- // Form options.
871
- case "form_options" :
872
- if ($id) {
873
- apply_form($id);
874
- }
875
- else {
876
- save_form();
877
- $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
878
- }
879
- wd_form_options($id);
880
- break;
881
- case "Save_form_options" :
882
- Apply_form_options($id);
883
- forchrome($id);
884
- break;
885
- case "Apply_form_options" :
886
- Apply_form_options($id);
887
- wd_form_options($id);
888
- break;
889
- case "save_as_copy":
890
- save_as_copy();
891
- display_form_lists();
892
- break;
893
- default:
894
- display_form_lists();
895
- }
896
- }
897
-
898
- // Open map in submissions.
899
- add_action('wp_ajax_frommapeditinpopup', 'spider_form_map_edit');
900
- function spider_form_map_edit() {
901
- if (function_exists('current_user_can')) {
902
- if (!current_user_can('manage_options')) {
903
- die('Access Denied');
904
- }
905
- }
906
- else {
907
- die('Access Denied');
908
- }
909
- if (isset($_GET['long']) && isset($_GET['lat'])) {
910
- $long = esc_html($_GET['long']);
911
- $lat = esc_html($_GET['lat']);
912
- ?>
913
- <script src="<?php echo plugins_url("js/if_gmap_back_end.js", __FILE__); ?>"></script>
914
- <script src="http://maps.google.com/maps/api/js?sensor=false"></script>
915
- <table style="margin:0px; padding:0px">
916
- <tr>
917
- <td><b>Address:</b></td>
918
- <td><input type="text" id="addrval0" style="border:0px; background:none" size="80" readonly/></td>
919
- </tr>
920
- <tr>
921
- <td><b>Longitude:</b></td>
922
- <td><input type="text" id="longval0" style="border:0px; background:none" size="80" readonly/></td>
923
- </tr>
924
- <tr>
925
- <td><b>Latitude:</b></td>
926
- <td><input type="text" id="latval0" style="border:0px; background:none" size="80" readonly/></td>
927
- </tr>
928
- </table>
929
-
930
- <div id="0_elementform_id_temp" long="<?php echo $long ?>" center_x="<?php echo $long ?>" center_y="<?php echo $lat ?>" lat="<?php echo $lat ?>" zoom="8" info="" style="width:600px; height:500px; "></div>
931
- <script>
932
- if_gmap_init("0");
933
- add_marker_on_map(0, 0, "<?php echo $long ?>", "<?php echo $lat ?>", '');
934
- </script>
935
- <?php
936
- die();
937
- }
938
- else {
939
- return 0;
940
- }
941
- }
942
-
943
- // Open map in submissions.
944
- add_action('wp_ajax_show_matrix', 'spider_form_show_matrix');
945
- function spider_form_show_matrix() {
946
- if (function_exists('current_user_can')) {
947
- if (!current_user_can('manage_options')) {
948
- die('Access Denied');
949
- }
950
- }
951
- else {
952
- die('Access Denied');
953
- }
954
- if (isset($_GET['matrix_params'])) {
955
- $matrix_params = esc_html($_GET['matrix_params']);
956
- $new_filename = str_replace("***matrix***", '', $matrix_params);
957
- $new_filename = explode('***', $matrix_params);
958
- $mat_params = array_slice($new_filename, 0, count($new_filename) - 1);
959
- $mat_rows = $mat_params[0];
960
- $mat_columns = $mat_params[$mat_rows + 1];
961
- $matrix = '<table>';
962
- $matrix .= '<tr><td></td>';
963
- for ($k = 1; $k <= $mat_columns; $k++) {
964
- $matrix .= '<td style="background-color:#BBBBBB; padding:5px;">' . $mat_params[$mat_rows + 1 + $k] . '</td>';
965
- }
966
- $matrix .= '</tr>';
967
- $aaa = Array();
968
- $var_checkbox = 1;
969
- for ($k = 1; $k <= $mat_rows; $k++) {
970
- $matrix .='<tr><td style="background-color:#BBBBBB; padding:5px; ">'.$mat_params[$k].'</td>';
971
- if ($mat_params[$mat_rows + $mat_columns + 2] == "radio") {
972
- if ($mat_params[$mat_rows + $mat_columns + 2 + $k] == 0) {
973
- $checked = 0;
974
- $aaa[1] = "";
975
- }
976
- else {
977
- $aaa = explode("_", $mat_params[$mat_rows + $mat_columns + 2 + $k]);
978
- }
979
- for ($l = 1; $l <= $mat_columns; $l++) {
980
- if ($aaa[1] == $l) {
981
- $checked = "checked";
982
- }
983
- else {
984
- $checked = "";
985
- }
986
- $matrix .= '<td style="text-align:center"><input type="radio" ' . $checked . ' disabled /></td>';
987
- }
988
- }
989
- else {
990
- if ($mat_params[$mat_rows + $mat_columns + 2] == "checkbox") {
991
- for ($l = 1; $l <= $mat_columns; $l++) {
992
- if ($mat_params[$mat_rows+$mat_columns + 2 + $var_checkbox] == "1") {
993
- $checked = "checked";
994
- }
995
- else {
996
- $checked = "";
997
- }
998
- $matrix .= '<td style="text-align:center"><input type="checkbox" ' . $checked . ' disabled /></td>';
999
- $var_checkbox++;
1000
- }
1001
- }
1002
- else {
1003
- if ($mat_params[$mat_rows + $mat_columns + 2] == "text") {
1004
- for ($l = 1; $l <= $mat_columns; $l++) {
1005
- $checked = $mat_params[$mat_rows + $mat_columns + 2 + $var_checkbox];
1006
- $matrix .= '<td style="text-align:center"><input type="text" value="' . $checked . '" disabled /></td>';
1007
- $var_checkbox++;
1008
- }
1009
- }
1010
- else {
1011
- for ($l = 1; $l <= $mat_columns; $l++) {
1012
- $checked = $mat_params[$mat_rows + $mat_columns + 2 + $var_checkbox];
1013
- $matrix .= '<td style="text-align:center">' . $checked . '</td>';
1014
- $var_checkbox++;
1015
- }
1016
- }
1017
- }
1018
- }
1019
- $matrix .= '</tr>';
1020
- }
1021
- $matrix .= '</table>';
1022
- echo $matrix;
1023
- die();
1024
- }
1025
- else {
1026
- return 0;
1027
- }
1028
- }
1029
-
1030
- // Form preview.
1031
- add_action('wp_ajax_frommakerpreview', 'preview_formmaker');
1032
- function html_preview_formmaker($css) {
1033
- echo "<input type='hidden' value='" . plugins_url("", __FILE__) . "' id='form_plugins_url' />";
1034
- echo '<script type="text/javascript">
1035
- if (document.getElementById("form_plugins_url")) {
1036
- var plugin_url = document.getElementById("form_plugins_url").value;
1037
- }
1038
- else {
1039
- var plugin_url = "";
1040
- }
1041
- </script>';
1042
- $cmpnt_js_path = plugins_url('js', __FILE__);
1043
- $id = 'form_id_temp';
1044
- ?>
1045
- <script src="<?php echo $cmpnt_js_path . "/if_gmap_back_end.js"; ?>"></script>
1046
- <script src="<?php echo $cmpnt_js_path . "/main.js"; ?>"></script>
1047
- <script src="http://maps.google.com/maps/api/js?sensor=false"></script>
1048
- <script src="<?php echo $cmpnt_js_path . "/jquery-1.9.1.js"; ?>"></script>
1049
- <script src="<?php echo $cmpnt_js_path . "/jquery-ui.js"; ?>"></script>
1050
- <script src="<?php echo $cmpnt_js_path . "/jquery.ui.slider.js"; ?>"></script>
1051
- <script src="<?php echo $cmpnt_js_path . "/main_front_end.js"; ?>"></script>
1052
- <link media="all" type="text/css" href="<?php echo plugins_url('', __FILE__) . "/css/jquery-ui-spinner.css"; ?>" rel="stylesheet">
1053
- <style>
1054
- <?php
1055
- $cmpnt_js_path = plugins_url('', __FILE__);
1056
- echo str_replace('[SITE_ROOT]', $cmpnt_js_path, $css);
1057
- ?>
1058
- </style>
1059
- <div id="form_id_temppages" class="wdform_page_navigation" show_title="" show_numbers="" type=""></div>
1060
-
1061
- <form id="form_preview"></form>
1062
- <input type="hidden" id="counter<?php echo $id ?>" value="" name="counter<?php echo $id ?>"/>
1063
-
1064
- <script>
1065
- JURI_ROOT = '<?php echo $cmpnt_js_path ?>';
1066
-
1067
- document.getElementById('form_preview').innerHTML = window.parent.document.getElementById('take').innerHTML;
1068
- document.getElementById('form_id_temppages').setAttribute('show_title', window.parent.document.getElementById('pages').getAttribute('show_title'));
1069
- document.getElementById('form_id_temppages').setAttribute('show_numbers', window.parent.document.getElementById('pages').getAttribute('show_numbers'));
1070
- document.getElementById('form_id_temppages').setAttribute('type', window.parent.document.getElementById('pages').getAttribute('type'));
1071
- document.getElementById('counterform_id_temp').value = window.parent.gen;
1072
- form_view_count<?php echo $id ?>= 0;
1073
- for (i = 1; i <= 30; i++) {
1074
- if (document.getElementById('<?php echo $id ?>form_view' + i)) {
1075
- form_view_count<?php echo $id ?>++;
1076
- form_view_max<?php echo $id ?>= i;
1077
- document.getElementById('<?php echo $id ?>form_view' + i).parentNode.removeAttribute('style');
1078
- }
1079
- }
1080
-
1081
- refresh_first();
1082
-
1083
-
1084
- if (form_view_count<?php echo $id ?>> 1) {
1085
- for (i = 1; i <= form_view_max<?php echo $id ?>; i++) {
1086
- if (document.getElementById('<?php echo $id ?>form_view' + i)) {
1087
- first_form_view<?php echo $id ?>= i;
1088
- break;
1089
- }
1090
- }
1091
-
1092
- generate_page_nav(first_form_view<?php echo $id ?>, '<?php echo $id ?>', form_view_count<?php echo $id ?>, form_view_max<?php echo $id ?>);
1093
- }
1094
-
1095
-
1096
- function remove_add_(id) {
1097
- attr_name = new Array();
1098
- attr_value = new Array();
1099
- var input = document.getElementById(id);
1100
- atr = input.attributes;
1101
- for (v = 0; v < 30; v++)
1102
- if (atr[v]) {
1103
- if (atr[v].name.indexOf("add_") == 0) {
1104
- attr_name.push(atr[v].name.replace('add_', ''));
1105
- attr_value.push(atr[v].value);
1106
- input.removeAttribute(atr[v].name);
1107
- v--;
1108
- }
1109
- }
1110
- for (v = 0; v < attr_name.length; v++) {
1111
- input.setAttribute(attr_name[v], attr_value[v])
1112
- }
1113
- }
1114
-
1115
- function refresh_first() {
1116
- n = window.parent.gen;
1117
- for (i = 0; i < n; i++) {
1118
- if (document.getElementById(i)) {
1119
- for (z = 0; z < document.getElementById(i).childNodes.length; z++)
1120
- if (document.getElementById(i).childNodes[z].nodeType == 3)
1121
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[z]);
1122
-
1123
- if (document.getElementById(i).getAttribute('type') == "type_map") {
1124
- if_gmap_init(i);
1125
- for (q = 0; q < 20; q++)
1126
- if (document.getElementById(i + "_elementform_id_temp").getAttribute("long" + q)) {
1127
-
1128
- w_long = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("long" + q));
1129
- w_lat = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("lat" + q));
1130
- w_info = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("info" + q));
1131
- add_marker_on_map(i, q, w_long, w_lat, w_info, false);
1132
- }
1133
- }
1134
-
1135
- if (document.getElementById(i).getAttribute('type') == "type_mark_map") {
1136
- if_gmap_init(i);
1137
- w_long = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("long" + 0));
1138
- w_lat = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("lat" + 0));
1139
- w_info = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("info" + 0));
1140
- add_marker_on_map(i, 0, w_long, w_lat, w_info, true);
1141
- }
1142
-
1143
-
1144
- if (document.getElementById(i).getAttribute('type') == "type_captcha" || document.getElementById(i).getAttribute('type') == "type_recaptcha") {
1145
- if (document.getElementById(i).childNodes[10]) {
1146
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1147
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1148
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1149
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1150
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1151
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1152
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1153
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1154
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1155
- }
1156
- else {
1157
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1158
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1159
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1160
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1161
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1162
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1163
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1164
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1165
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1166
- }
1167
- continue;
1168
- }
1169
-
1170
- if (document.getElementById(i).getAttribute('type') == "type_section_break") {
1171
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1172
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1173
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1174
- continue;
1175
- }
1176
-
1177
-
1178
- if (document.getElementById(i).childNodes[10]) {
1179
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1180
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1181
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1182
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1183
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1184
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1185
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1186
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1187
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
1188
- }
1189
- else {
1190
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1191
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1192
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1193
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1194
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1195
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1196
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1197
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1198
- document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
1199
- }
1200
- }
1201
- }
1202
-
1203
- for (i = 0; i <= n; i++) {
1204
- if (document.getElementById(i)) {
1205
- type = document.getElementById(i).getAttribute("type");
1206
- switch (type) {
1207
- case "type_text":
1208
- case "type_number":
1209
- case "type_password":
1210
- case "type_submitter_mail":
1211
- case "type_own_select":
1212
- case "type_country":
1213
- case "type_hidden":
1214
- case "type_map":
1215
- {
1216
- remove_add_(i + "_elementform_id_temp");
1217
- break;
1218
- }
1219
-
1220
- case "type_submit_reset":
1221
- {
1222
- remove_add_(i + "_element_submitform_id_temp");
1223
- if (document.getElementById(i + "_element_resetform_id_temp"))
1224
- remove_add_(i + "_element_resetform_id_temp");
1225
- break;
1226
- }
1227
-
1228
- case "type_captcha":
1229
- {
1230
- remove_add_("_wd_captchaform_id_temp");
1231
- remove_add_("_element_refreshform_id_temp");
1232
- remove_add_("_wd_captcha_inputform_id_temp");
1233
- break;
1234
- }
1235
-
1236
- case "type_recaptcha":
1237
- {
1238
- remove_add_("wd_recaptchaform_id_temp");
1239
- break;
1240
- }
1241
-
1242
- case "type_file_upload":
1243
- {
1244
- remove_add_(i + "_elementform_id_temp");
1245
- break;
1246
- }
1247
-
1248
- case "type_textarea":
1249
- {
1250
- remove_add_(i + "_elementform_id_temp");
1251
-
1252
- break;
1253
- }
1254
-
1255
- case "type_name":
1256
- {
1257
-
1258
- if (document.getElementById(i + "_element_titleform_id_temp")) {
1259
- remove_add_(i + "_element_titleform_id_temp");
1260
- remove_add_(i + "_element_firstform_id_temp");
1261
- remove_add_(i + "_element_lastform_id_temp");
1262
- remove_add_(i + "_element_middleform_id_temp");
1263
- }
1264
- else {
1265
- remove_add_(i + "_element_firstform_id_temp");
1266
- remove_add_(i + "_element_lastform_id_temp");
1267
-
1268
- }
1269
- break;
1270
-
1271
- }
1272
-
1273
- case "type_phone":
1274
- {
1275
-
1276
- remove_add_(i + "_element_firstform_id_temp");
1277
- remove_add_(i + "_element_lastform_id_temp");
1278
-
1279
- break;
1280
-
1281
- }
1282
- case "type_address":
1283
- {
1284
- if(document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute('street1')=='no')
1285
- remove_add_(i+"_street1form_id_temp");
1286
- if(document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute('street2')=='no')
1287
- remove_add_(i+"_street2form_id_temp");
1288
- if(document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute('city')=='no')
1289
- remove_add_(i+"_cityform_id_temp");
1290
- if(document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute('state')=='no')
1291
- remove_add_(i+"_stateform_id_temp");
1292
- if(document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute('postal')=='no')
1293
- remove_add_(i+"_postalform_id_temp");
1294
- if(document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute('country')=='no')
1295
- remove_add_(i+"_countryform_id_temp");
1296
-
1297
- break;
1298
-
1299
- }
1300
-
1301
-
1302
- case "type_checkbox":
1303
- case "type_radio":
1304
- {
1305
- is = true;
1306
- for (j = 0; j < 100; j++)
1307
- if (document.getElementById(i + "_elementform_id_temp" + j)) {
1308
- remove_add_(i + "_elementform_id_temp" + j);
1309
- }
1310
- break;
1311
- }
1312
-
1313
- case "type_button":
1314
- {
1315
- for (j = 0; j < 100; j++)
1316
- if (document.getElementById(i + "_elementform_id_temp" + j)) {
1317
- remove_add_(i + "_elementform_id_temp" + j);
1318
- }
1319
- break;
1320
- }
1321
-
1322
- case "type_time":
1323
- {
1324
- if (document.getElementById(i + "_ssform_id_temp")) {
1325
- remove_add_(i + "_ssform_id_temp");
1326
- remove_add_(i + "_mmform_id_temp");
1327
- remove_add_(i + "_hhform_id_temp");
1328
- }
1329
- else {
1330
- remove_add_(i + "_mmform_id_temp");
1331
- remove_add_(i + "_hhform_id_temp");
1332
- }
1333
- break;
1334
-
1335
- }
1336
-
1337
- case "type_date":
1338
- {
1339
- remove_add_(i + "_elementform_id_temp");
1340
- remove_add_(i + "_buttonform_id_temp");
1341
- break;
1342
- }
1343
- case "type_date_fields":
1344
- {
1345
- remove_add_(i + "_dayform_id_temp");
1346
- remove_add_(i + "_monthform_id_temp");
1347
- remove_add_(i + "_yearform_id_temp");
1348
- break;
1349
- }
1350
- case "type_star_rating":
1351
- {
1352
- remove_add_(i+"_elementform_id_temp");
1353
-
1354
- break;
1355
- }
1356
- case "type_scale_rating":
1357
- {
1358
- remove_add_(i+"_elementform_id_temp");
1359
-
1360
- break;
1361
- }
1362
- case "type_spinner":
1363
- {
1364
- remove_add_(i+"_elementform_id_temp");
1365
-
1366
- var spinner_value = document.getElementById(i+"_elementform_id_temp").getAttribute( "aria-valuenow" );
1367
- var spinner_min_value = document.getElementById(i+"_min_valueform_id_temp").value;
1368
- var spinner_max_value = document.getElementById(i+"_max_valueform_id_temp").value;
1369
- var spinner_step = document.getElementById(i+"_stepform_id_temp").value;
1370
-
1371
- jQuery( "#"+i+"_elementform_id_temp" ).removeClass( "ui-spinner-input" )
1372
- .prop( "disabled", false )
1373
- .removeAttr( "autocomplete" )
1374
- .removeAttr( "role" )
1375
- .removeAttr( "aria-valuemin" )
1376
- .removeAttr( "aria-valuemax" )
1377
- .removeAttr( "aria-valuenow" );
1378
-
1379
- span_ui= document.getElementById(i+"_elementform_id_temp").parentNode;
1380
- span_ui.parentNode.appendChild(document.getElementById(i+"_elementform_id_temp"));
1381
- span_ui.parentNode.removeChild(span_ui);
1382
-
1383
- jQuery("#"+i+"_elementform_id_temp")[0].spin = null;
1384
-
1385
- spinner = jQuery( "#"+i+"_elementform_id_temp" ).spinner();
1386
- spinner.spinner( "value", spinner_value );
1387
- jQuery( "#"+i+"_elementform_id_temp" ).spinner({ min: spinner_min_value});
1388
- jQuery( "#"+i+"_elementform_id_temp" ).spinner({ max: spinner_max_value});
1389
- jQuery( "#"+i+"_elementform_id_temp" ).spinner({ step: spinner_step});
1390
- break;
1391
- }
1392
-
1393
- case "type_slider":
1394
- {
1395
- remove_add_(i+"_elementform_id_temp");
1396
-
1397
- var slider_value = document.getElementById(i+"_slider_valueform_id_temp").value;
1398
- var slider_min_value = document.getElementById(i+"_slider_min_valueform_id_temp").value;
1399
- var slider_max_value = document.getElementById(i+"_slider_max_valueform_id_temp").value;
1400
-
1401
- var slider_element_value = document.getElementById( i+"_element_valueform_id_temp" );
1402
- var slider_value_save = document.getElementById( i+"_slider_valueform_id_temp" );
1403
-
1404
- document.getElementById(i+"_elementform_id_temp").innerHTML = "";
1405
- document.getElementById(i+"_elementform_id_temp").removeAttribute( "class" );
1406
- document.getElementById(i+"_elementform_id_temp").removeAttribute( "aria-disabled" );
1407
- jQuery("#"+i+"_elementform_id_temp")[0].slide = null;
1408
-
1409
-
1410
- jQuery( "#"+i+"_elementform_id_temp").slider({
1411
- range: "min",
1412
- value: eval(slider_value),
1413
- min: eval(slider_min_value),
1414
- max: eval(slider_max_value),
1415
- slide: function( event, ui ) {
1416
- slider_element_value.innerHTML = "" + ui.value ;
1417
- slider_value_save.value = "" + ui.value;
1418
-
1419
- }
1420
- });
1421
- break;
1422
- }
1423
- case "type_range":
1424
- {
1425
- remove_add_(i+"_elementform_id_temp0");
1426
- remove_add_(i+"_elementform_id_temp1");
1427
-
1428
- var spinner_value0 = document.getElementById(i+"_elementform_id_temp0").getAttribute( "aria-valuenow" );
1429
- var spinner_step = document.getElementById(i+"_range_stepform_id_temp").value;
1430
-
1431
- jQuery( "#"+i+"_elementform_id_temp0" ).removeClass( "ui-spinner-input" )
1432
- .prop( "disabled", false )
1433
- .removeAttr( "autocomplete" )
1434
- .removeAttr( "role" )
1435
- .removeAttr( "aria-valuenow" );
1436
-
1437
- span_ui= document.getElementById(i+"_elementform_id_temp0").parentNode;
1438
- span_ui.parentNode.appendChild(document.getElementById(i+"_elementform_id_temp0"));
1439
- span_ui.parentNode.removeChild(span_ui);
1440
-
1441
- jQuery("#"+i+"_elementform_id_temp0")[0].spin = null;
1442
- jQuery("#"+i+"_elementform_id_temp1")[0].spin = null;
1443
-
1444
-
1445
- spinner0 = jQuery( "#"+i+"_elementform_id_temp0" ).spinner();
1446
- spinner0.spinner( "value", spinner_value0 );
1447
- jQuery( "#"+i+"_elementform_id_temp0" ).spinner({ step: spinner_step});
1448
- var spinner_value1 = document.getElementById(i+"_elementform_id_temp1").getAttribute( "aria-valuenow" );
1449
- jQuery( "#"+i+"_elementform_id_temp1" ).removeClass( "ui-spinner-input" )
1450
- .prop( "disabled", false )
1451
- .removeAttr( "autocomplete" )
1452
- .removeAttr( "role" )
1453
- .removeAttr( "aria-valuenow" );
1454
-
1455
- span_ui1= document.getElementById(i+"_elementform_id_temp1").parentNode;
1456
- span_ui1.parentNode.appendChild(document.getElementById(i+"_elementform_id_temp1"));
1457
- span_ui1.parentNode.removeChild(span_ui1);
1458
-
1459
- spinner1 = jQuery( "#"+i+"_elementform_id_temp1" ).spinner();
1460
- spinner1.spinner( "value", spinner_value1 );
1461
- jQuery( "#"+i+"_elementform_id_temp1" ).spinner({ step: spinner_step});
1462
-
1463
- break;
1464
- }
1465
- case "type_grading":
1466
- {
1467
-
1468
- for(k=0; k<100; k++)
1469
- if(document.getElementById(i+"_elementform_id_temp"+k))
1470
- {
1471
- remove_add_(i+"_elementform_id_temp"+k);
1472
- }
1473
-
1474
-
1475
- break;
1476
- }
1477
-
1478
- case "type_matrix":
1479
- {
1480
- remove_add_(i+"_elementform_id_temp");
1481
-
1482
- break;
1483
- }
1484
- }
1485
- }
1486
- }
1487
-
1488
-
1489
- for (t = 1; t <= form_view_max<?php echo $id ?>; t++) {
1490
- if (document.getElementById('form_id_tempform_view' + t)) {
1491
- form_view_element = document.getElementById('form_id_tempform_view' + t);
1492
- xy = form_view_element.childNodes.length - 2;
1493
- for (z = 0; z <= xy; z++) {
1494
- if (form_view_element.childNodes[z])
1495
- if (form_view_element.childNodes[z].nodeType != 3)
1496
- if (!form_view_element.childNodes[z].id) {
1497
- del = true;
1498
- GLOBAL_tr = form_view_element.childNodes[z];
1499
- //////////////////////////////////////////////////////////////////////////////////////////
1500
- for (x = 0; x < GLOBAL_tr.firstChild.childNodes.length; x++) {
1501
- table = GLOBAL_tr.firstChild.childNodes[x];
1502
- tbody = table.firstChild;
1503
- if (tbody.childNodes.length)
1504
- del = false;
1505
- }
1506
-
1507
- if (del) {
1508
- form_view_element.removeChild(form_view_element.childNodes[z]);
1509
- }
1510
-
1511
- }
1512
- }
1513
- }
1514
- }
1515
-
1516
-
1517
- for (i = 1; i <= window.parent.form_view_max; i++)
1518
- if (document.getElementById('form_id_tempform_view' + i)) {
1519
- document.getElementById('form_id_tempform_view' + i).parentNode.removeChild(document.getElementById('form_id_tempform_view_img' + i));
1520
- document.getElementById('form_id_tempform_view' + i).removeAttribute('style');
1521
- }
1522
-
1523
- }
1524
-
1525
-
1526
- </script>
1527
- <?php
1528
- die();
1529
- }
1530
-
1531
- function preview_formmaker() {
1532
- if (function_exists('current_user_can')) {
1533
- if (!current_user_can('manage_options')) {
1534
- die('Access Denied');
1535
- }
1536
- }
1537
- else {
1538
- die('Access Denied');
1539
- }
1540
- global $wpdb;
1541
- if (isset($_GET['id']))
1542
- $getparams = (int) $_GET['id'];
1543
- $query = "SELECT css FROM " . $wpdb->prefix . "formmaker_themes WHERE id=" . $getparams;
1544
- $css = $wpdb->get_var($query);
1545
- html_preview_formmaker($css);
1546
- }
1547
-
1548
- //////////////////////////////////////////////////////////////////////////////////////
1549
- //////////////////////////////////////////////////////////////////////////////////
1550
- ///////////////////////////////////////////////////////////////////////////////
1551
- ///////////////////////////////////////////////////////////////////////////////
1552
- /////////////////////////////////////////////////////////////////////////////////
1553
- function Form_maker_Submits() {
1554
- require_once("Submissions.html.php");
1555
- require_once("Submissions.php");
1556
- if (!function_exists('print_html_nav'))
1557
- require_once("nav_function/nav_html_func.php");
1558
- global $wpdb;
1559
- if (isset($_GET["task"])) {
1560
- $task = esc_html($_GET["task"]);
1561
- }
1562
- else {
1563
- $task = "show";
1564
- }
1565
- if (isset($_GET["id"])) {
1566
- $id = (int) $_GET["id"];
1567
- }
1568
- else {
1569
- $id = 0;
1570
- }
1571
- switch ($task) {
1572
- case "submits" :
1573
- show_submits();
1574
- break;
1575
- case "edit_submit" :
1576
- editSubmit($id);
1577
- break;
1578
- case "remove_submit" :
1579
- remov_submit($id);
1580
- show_submits();
1581
- break;
1582
- case "remov_cheched" :
1583
- remov_cheched_submission();
1584
- show_submits();
1585
- break;
1586
- case "appply_submit" :
1587
- save_submit($id);
1588
- editSubmit($id);
1589
- break;
1590
- case "save_submit" :
1591
- save_submit($id);
1592
- show_submits();
1593
- break;
1594
- case "cancel" :
1595
- show_submits();
1596
- break;
1597
- default:
1598
- show_submits();
1599
- }
1600
- }
1601
-
1602
- function Form_maker_Themes() {
1603
- require_once("Theme_functions.php");
1604
- require_once("Themes_function.html.php");
1605
- if (!function_exists('print_html_nav')) {
1606
- require_once("nav_function/nav_html_func.php");
1607
- }
1608
- global $wpdb;
1609
- if (isset($_GET["task"])) {
1610
- $task = esc_html($_GET["task"]);
1611
- }
1612
- else {
1613
- $task = "";
1614
- }
1615
- if (isset($_GET["id"])) {
1616
- $id = (int) $_GET["id"];
1617
- }
1618
- else {
1619
- $id = 0;
1620
- }
1621
- switch ($task) {
1622
- case 'theme':
1623
- show_theme();
1624
- break;
1625
- case 'default':
1626
- default_theme($id);
1627
- show_theme();
1628
- break;
1629
- case 'add_theme':
1630
- add_theme();
1631
- break;
1632
- case 'Save':
1633
- if ($id) {
1634
- apply_theme($id);
1635
- }
1636
- else {
1637
- save_theme();
1638
- }
1639
- show_theme();
1640
- break;
1641
- case 'Apply':
1642
- if ($id) {
1643
- apply_theme($id);
1644
- }
1645
- else {
1646
- save_theme();
1647
- $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker_themes");
1648
- }
1649
- edit_theme($id);
1650
- break;
1651
- case 'edit_theme':
1652
- edit_theme($id);
1653
- break;
1654
- case 'remove_theme':
1655
- remove_theme($id);
1656
- show_theme();
1657
- break;
1658
- default:
1659
- show_theme();
1660
- }
1661
- }
1662
-
1663
- function Uninstall_Form_Maker() {
1664
- global $wpdb;
1665
- $base_name = plugin_basename('Form_maker');
1666
- $base_page = 'admin.php?page=' . $base_name;
1667
- if (isset($_GET['mode'])) {
1668
- $mode = trim(esc_html($_GET['mode']));
1669
- }
1670
- if (!empty($_POST['do'])) {
1671
- if (esc_html($_POST['do']) == "UNINSTALL Form Maker") {
1672
- check_admin_referer('Form Maker_uninstall');
1673
- if (trim(esc_html($_POST['uninstall_Form_yes'])) == 'yes') {
1674
- if ((get_option('contact_form_forms', FALSE) || get_option('contact_form_forms', FALSE) != '') && get_option('contact_form_themes', FALSE) || get_option('contact_form_themes', FALSE) != '') {
1675
- echo '<div id="message" class="updated fade">';
1676
- echo '<p>';
1677
- echo "Table 'formmaker' has been deleted.";
1678
- $wpdb->query("DELETE FROM " . $wpdb->prefix . "formmaker WHERE `id` NOT IN (" . get_option('contact_form_forms') . ")");
1679
- echo '<font style="color:#000;">';
1680
- echo '</font><br />';
1681
- echo '</p>';
1682
- echo '<p>';
1683
- echo "Table 'formmaker_submits' has been deleted.";
1684
- $wpdb->query("DELETE FROM " . $wpdb->prefix . "formmaker_submits WHERE `form_id` NOT IN (" . get_option('contact_form_forms') . ")");
1685
- echo '<font style="color:#000;">';
1686
- echo '</font><br />';
1687
- echo '</p>';
1688
- echo '<p>';
1689
- echo "Table 'formmaker_views' has been deleted.";
1690
- $wpdb->query("DELETE FROM " . $wpdb->prefix . "formmaker_views WHERE `form_id` NOT IN (" . get_option('contact_form_forms') . ")");
1691
- echo '<font style="color:#000;">';
1692
- echo '</font><br />';
1693
- echo '</p>';
1694
- echo '<p>';
1695
- echo "Table 'formmaker_themes' has been deleted.";
1696
- $wpdb->query("DELETE FROM " . $wpdb->prefix . "formmaker_themes WHERE `id` NOT IN (" . get_option('contact_form_themes') . ")");
1697
- echo '<font style="color:#000;">';
1698
- echo '</font><br />';
1699
- echo '</p>';
1700
- echo '</div>';
1701
- }
1702
- else {
1703
- echo '<div id="message" class="updated fade">';
1704
- echo '<p>';
1705
- echo "Table 'formmaker' has been deleted.";
1706
- $wpdb->query("DROP TABLE " . $wpdb->prefix . "formmaker");
1707
- echo '<font style="color:#000;">';
1708
- echo '</font><br />';
1709
- echo '</p>';
1710
- echo '<p>';
1711
- echo "Table 'formmaker_submits' has been deleted.";
1712
- $wpdb->query("DROP TABLE " . $wpdb->prefix . "formmaker_submits");
1713
- echo '<font style="color:#000;">';
1714
- echo '</font><br />';
1715
- echo '</p>';
1716
- echo '<p>';
1717
- echo "Table 'formmaker_views' has been deleted.";
1718
- $wpdb->query("DROP TABLE " . $wpdb->prefix . "formmaker_views");
1719
- echo '<font style="color:#000;">';
1720
- echo '</font><br />';
1721
- echo '</p>';
1722
- echo '<p>';
1723
- echo "Table 'formmaker_themes' has been deleted.";
1724
- $wpdb->query("DROP TABLE " . $wpdb->prefix . "formmaker_themes");
1725
- echo '<font style="color:#000;">';
1726
- echo '</font><br />';
1727
- echo '</p>';
1728
- echo '<p>';
1729
- echo "Table 'formmaker_sessions' has been deleted.";
1730
- $wpdb->query("DROP TABLE " . $wpdb->prefix . "formmaker_sessions");
1731
- echo '<font style="color:#000;">';
1732
- echo '</font><br />';
1733
- echo '</p>';
1734
- echo '</div>';
1735
- }
1736
- $mode = 'end-UNINSTALL';
1737
- }
1738
- }
1739
- }
1740
- if (!isset($mode))
1741
- $mode = '';
1742
- switch ($mode) {
1743
- case 'end-UNINSTALL':
1744
- $deactivate_url = wp_nonce_url('plugins.php?action=deactivate&amp;plugin=' . plugin_basename(__FILE__), 'deactivate-plugin_' . plugin_basename(__FILE__)) . '&form_maker_uninstall=1';
1745
- echo '<div class="wrap">';
1746
- echo '<div id="icon-Form_maker" class="icon32"><br /></div>';
1747
- echo '<h2>Uninstall Form Maker</h2>';
1748
- echo '<p><strong>' . sprintf('<a href="%s">Click Here</a> To Finish The Uninstallation And Form Maker Will Be Deactivated Automatically.', $deactivate_url) . '</strong></p>';
1749
- echo '</div>';
1750
- break;
1751
- // Main Page
1752
- default:
1753
- ?>
1754
- <form method="post" action="<?php echo admin_url('admin.php?page=Uninstall_Form_Maker'); ?>">
1755
- <?php wp_nonce_field('Form Maker_uninstall'); ?>
1756
- <div class="wrap">
1757
- <div id="icon-Form_maker" class="icon32"><br/></div>
1758
- <h2><?php echo 'Uninstall Form Maker'; ?></h2>
1759
- <p>
1760
- <?php echo 'Deactivating Form Maker plugin does not remove any data that may have been created, such as the Forms and the Submissions. To completely remove this plugin, you can uninstall it here.'; ?>
1761
- </p>
1762
- <p style="color: red">
1763
- <strong><?php echo'WARNING:'; ?></strong><br/>
1764
- <?php echo 'Once uninstalled, this cannot be undone. You should use a Database Backup plugin of WordPress to back up all the data first.'; ?>
1765
- </p>
1766
- <p style="color: red">
1767
- <strong><?php echo 'The following WordPress Options/Tables will be DELETED:'; ?></strong><br/>
1768
- </p>
1769
- <table class="widefat">
1770
- <thead>
1771
- <tr>
1772
- <th><?php echo 'WordPress Tables'; ?></th>
1773
- </tr>
1774
- </thead>
1775
- <tr>
1776
- <td valign="top">
1777
- <ol>
1778
- <?php
1779
- echo '<li>formmaker</li>' . "\n";
1780
- echo '<li>formmaker_submits</li>' . "\n";
1781
- echo '<li>formmaker_views</li>' . "\n";
1782
- echo '<li>formmaker_themes</li>' . "\n";
1783
- echo '<li>formmaker_sessions</li>' . "\n";
1784
- ?>
1785
- </ol>
1786
- </td>
1787
- </tr>
1788
- </table>
1789
- <p style="text-align: center;">
1790
- <?php echo 'Do you really want to uninstall Form Maker?'; ?><br/><br/>
1791
- <input type="checkbox" name="uninstall_Form_yes" value="yes"/>&nbsp;<?php echo 'Yes'; ?><br/><br/>
1792
- <input type="submit" name="do" value="<?php echo 'UNINSTALL Form Maker'; ?>" class="button-primary"
1793
- onclick="return confirm('<?php echo 'You Are About To Uninstall Form Maker From WordPress.\nThis Action Is Not Reversible.\n\n Choose [Cancel] To Stop, [OK] To Uninstall.'; ?>')"/>
1794
- </p>
1795
- </div>
1796
- </form>
1797
- <?php
1798
- }
1799
- }
1800
-
1801
-
1802
- function formmaker_activate() {
1803
- include 'setup_sql.php';
1804
- set_form_maker_sql();
1805
- require_once("update_sql.php");
1806
- formmaker_chech_update();
1807
- }
1808
- register_activation_hook(__FILE__, 'formmaker_activate');
1809
-
1810
- function sp_form_deactiv() {
1811
- echo esc_html($_GET['form_maker_uninstall']);
1812
- if (isset($_GET['form_maker_uninstall'])) {
1813
- if ($_GET['form_maker_uninstall'] == 1) {
1814
- delete_option('formmaker_cureent_version');
1815
- }
1816
- }
1817
- }
1818
-
1819
- register_deactivation_hook(__FILE__, 'sp_form_deactiv');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Submissions.html.php DELETED
@@ -1,1101 +0,0 @@
1
- <?php
2
- if (!current_user_can('manage_options')) {
3
- die('Access Denied');
4
- }
5
- function html_show_submits($rows, $forms, $lists, $pageNav, $labels, $label_titles, $rows_ord, $filter_order_Dir, $form_id, $labels_id, $sorted_labels_type, $total_entries, $total_views, $where, $where_choices, $sort) {
6
- $label_titles_copy = $label_titles;
7
- global $wpdb;
8
- $n = count($rows);
9
- $m = count($labels);
10
- $group_id_s = array();
11
- $rows_ord_none = array();
12
- if (count($rows_ord) > 0 and $m)
13
- for ($i = 0; $i < count($rows_ord); $i++) {
14
- $row = $rows_ord[$i];
15
- if (!in_array($row->group_id, $group_id_s)) {
16
- array_push($group_id_s, $row->group_id);
17
- }
18
- }
19
- ?>
20
- <style>
21
- .calendar .button {
22
- display: table-cell !important;
23
- }
24
- </style>
25
- <script type="text/javascript">
26
- function tableOrdering(order, dir, task) {
27
- var form = document.admin_form;
28
- form.filter_order2.value = order;
29
- form.filter_order_Dir2.value = dir;
30
- submitform(task);
31
- }
32
- function ordering(name, as_or_desc) {
33
- document.getElementById('asc_or_desc').value = as_or_desc;
34
- document.getElementById('order_by').value = name;
35
- document.getElementById('admin_form').submit();
36
- }
37
- function renderColumns() {
38
- allTags = document.getElementsByTagName('*');
39
- for (curTag in allTags) {
40
- if (typeof(allTags[curTag].className) != "undefined")
41
- if (allTags[curTag].className.indexOf('_fc') > 0) {
42
- curLabel = allTags[curTag].className.replace('_fc', '');
43
- if (document.forms.admin_form.hide_label_list.value.indexOf('@' + curLabel + '@') >= 0)
44
- allTags[curTag].style.display = 'none';
45
- else
46
- allTags[curTag].style.display = '';
47
- }
48
- if (typeof(allTags[curTag].id) != "undefined") {
49
- if (allTags[curTag].id.indexOf('_fc') > 0) {
50
- curLabel = allTags[curTag].id.replace('_fc','');
51
- if (document.forms.admin_form.hide_label_list.value.indexOf('@' + curLabel + '@') >= 0) {
52
- allTags[curTag].style.display = 'none';
53
- }
54
- else {
55
- allTags[curTag].style.display = '';
56
- }
57
- }
58
- }
59
- }
60
- }
61
-
62
- function clickLabChB(label, ChB) {
63
- document.forms.admin_form.hide_label_list.value = document.forms.admin_form.hide_label_list.value.replace('@' + label + '@', '');
64
- if (document.forms.admin_form.hide_label_list.value == '') {
65
- document.getElementById('ChBAll').checked = true;
66
- }
67
- if (!(ChB.checked)) {
68
- document.forms.admin_form.hide_label_list.value += '@' + label + '@';
69
- document.getElementById('ChBAll').checked = false;
70
- }
71
- renderColumns();
72
- }
73
-
74
- function toggleChBDiv(b) {
75
- if (b) {
76
- sizes = window.getSize().size;
77
- document.getElementById("sbox-overlay").style.width = sizes.x + "px";
78
- document.getElementById("sbox-overlay").style.height = sizes.y + "px";
79
- document.getElementById("ChBDiv").style.left = Math.floor((sizes.x - 350) / 2) + "px";
80
-
81
- document.getElementById("ChBDiv").style.display = "block";
82
- document.getElementById("sbox-overlay").style.display = "block";
83
- }
84
- else {
85
- document.getElementById("ChBDiv").style.display = "none";
86
- document.getElementById("sbox-overlay").style.display = "none";
87
- }
88
- }
89
-
90
- function clickLabChBAll(ChBAll) {
91
- <?php
92
- if (isset($labels)) {
93
- $templabels = array_merge(array(
94
- 'submitid',
95
- 'submitdate',
96
- 'submitterip'
97
- ), $labels_id);
98
- $label_titles = array_merge(array(
99
- 'ID',
100
- 'Submit date',
101
- "Submitter's IP Address"
102
- ), $label_titles);
103
- }
104
- ?>
105
-
106
- if (ChBAll.checked) {
107
- document.forms.admin_form.hide_label_list.value = '';
108
-
109
- for (i = 0; i <= ChBAll.form.length; i++)
110
- if (typeof(ChBAll.form[i]) != "undefined")
111
- if (ChBAll.form[i].type == "checkbox")
112
- ChBAll.form[i].checked = true;
113
- }
114
- else {
115
- document.forms.admin_form.hide_label_list.value = '@<?php echo implode($templabels, '@@') ?>@';
116
-
117
- for (i = 0; i <= ChBAll.form.length; i++)
118
- if (typeof(ChBAll.form[i]) != "undefined")
119
- if (ChBAll.form[i].type == "checkbox")
120
- ChBAll.form[i].checked = false;
121
- }
122
-
123
- renderColumns();
124
- }
125
-
126
- function remove_all() {
127
- document.getElementById('startdate').value = '';
128
- document.getElementById('enddate').value = '';
129
- document.getElementById('ip_search').value = '';
130
- <?php
131
- $n = count($rows);
132
-
133
- for ($i = 0; $i < count($labels); $i++) {
134
- echo "document.getElementById('" . $form_id . '_' . $labels_id[$i] . "_search').value='';
135
- ";
136
- }
137
- ?>
138
- }
139
-
140
- function show_hide_filter() {
141
- if (document.getElementById('fields_filter').style.display == "none") {
142
- document.getElementById('fields_filter').style.display = '';
143
- document.getElementById('filter_img').src = '<?php echo plugins_url('images/filter_hide.png', __FILE__) ?>';
144
- }
145
- else {
146
- document.getElementById('fields_filter').style.display = "none";
147
- document.getElementById('filter_img').src = '<?php echo plugins_url('images/filter_show.png', __FILE__) ?>';
148
- }
149
- }
150
- function submit_del(href_in) {
151
- document.getElementById('admin_form').action = href_in;
152
- document.getElementById('admin_form').submit();
153
- }
154
- <!--
155
- function submitbutton(pressbutton) {
156
- var form = document.adminForm;
157
- if (pressbutton == 'cancel_theme') {
158
- submitform(pressbutton);
159
- return;
160
- }
161
-
162
- if (document.getElementById('title').value == '') {
163
- alert('The theme must have a title')
164
- return;
165
- }
166
- submitform(pressbutton);
167
- }
168
-
169
-
170
- function submitform(pressbutton) {
171
- document.getElementById('adminForm').action = document.getElementById('adminForm').action + "&task=" + pressbutton;
172
- document.getElementById('adminForm').submit();
173
- }
174
- //-->
175
-
176
- function change_width() {
177
- width = parseInt(document.getElementById('width').value) + 45 + parseInt(document.getElementById('border_width').value);
178
- height = 550;
179
-
180
- document.getElementById('spider_calendar_preview').href = "http://localhost/wordpress/wp-content/plugins/spider-calendar/preview.php?TB_iframe=1&tbWidth=" + width + "&tbHeight=" + height;
181
- }
182
-
183
-
184
- var thickDims, tbWidth, tbHeight;
185
- jQuery(document).ready(function ($) {
186
-
187
- thickDims = function () {
188
- var tbWindow = $('#TB_window'), H = $(window).height(), W = $(window).width(), w, h;
189
-
190
- w = (tbWidth && tbWidth < W - 90) ? tbWidth : W - 200;
191
- h = (tbHeight && tbHeight < H - 60) ? tbHeight : H - 200;
192
-
193
- if (tbWindow.size()) {
194
- tbWindow.width(w).height(h);
195
- $('#TB_iframeContent').width(w).height(h - 27);
196
- tbWindow.css({'margin-left':'-' + parseInt((w / 2), 10) + 'px'});
197
- if (typeof document.body.style.maxWidth != 'undefined')
198
- tbWindow.css({'top':(H - h) / 2, 'margin-top':'0'});
199
- }
200
- };
201
-
202
- thickDims();
203
- $(window).resize(function () {
204
- thickDims()
205
- });
206
-
207
- $('a.thickbox-preview').click(function () {
208
- tb_click.call(this);
209
-
210
- var alink = $(this).parents('.available-theme').find('.activatelink'), link = '', href = $(this).attr('href'), url, text;
211
-
212
- if (tbWidth = href.match(/&tbWidth=[0-9]+/))
213
- tbWidth = parseInt(tbWidth[0].replace(/[^0-9]+/g, ''), 10);
214
- else
215
- tbWidth = $(window).width() - 90;
216
-
217
- if (tbHeight = href.match(/&tbHeight=[0-9]+/))
218
- tbHeight = parseInt(tbHeight[0].replace(/[^0-9]+/g, ''), 10);
219
- else
220
- tbHeight = $(window).height() - 60;
221
-
222
- if (alink.length) {
223
- url = alink.attr('href') || '';
224
- text = alink.attr('title') || '';
225
- link = '&nbsp; <a href="' + url + '" target="_top" class="tb-theme-preview-link">' + text + '</a>';
226
- } else {
227
- text = $(this).attr('title') || '';
228
- link = '&nbsp; <span class="tb-theme-preview-link">' + text + '</span>';
229
- }
230
-
231
- $('#TB_title').css({'background-color':'#222', 'color':'#dfdfdf'});
232
- $('#TB_closeAjaxWindow').css({'float':'left'});
233
- $('#TB_ajaxWindowTitle').css({'float':'right'}).html(link);
234
-
235
- $('#TB_iframeContent').width('100%');
236
- thickDims();
237
-
238
- return false;
239
- });
240
-
241
- // Theme details
242
- $('.theme-detail').click(function () {
243
- $(this).siblings('.themedetaildiv').toggle();
244
- return false;
245
- });
246
-
247
- });
248
-
249
-
250
- </script>
251
-
252
- <style>
253
- .reports {
254
- border: 1px solid #DEDEDE;
255
- border-radius: 11px;
256
- background-color: #F0F0F0;
257
- text-align: center;
258
- width: 100px;
259
- }
260
- .bordered {
261
- border-radius: 8px
262
- }
263
- .simple_table {
264
- background-color: transparent;
265
- !important
266
- }
267
- </style>
268
- <?php
269
- if (isset($labels)) {
270
- ?>
271
- <div id="sbox-overlay"
272
- style="z-index: 65555; position: fixed; top: 0px; left: 0px; visibility: visible; zoom: 1; background-color:#000000; opacity: 0.7; filter: alpha(opacity=70); display:none;"
273
- onclick="toggleChBDiv(false)"></div>
274
- <div
275
- style="background-color:#FFFFFF; width: 350px; height: 350px; overflow-y: scroll; padding: 20px; position: fixed; top: 100px;display:none; border:2px solid #AAAAAA; z-index:65556"
276
- id="ChBDiv">
277
-
278
- <form action="#">
279
- <p style="font-weight:bold; font-size:18px;margin-top: 0px;">
280
- Select Columns
281
- </p>
282
-
283
- <input type="checkbox" <?php if ($lists['hide_label_list'] === '')
284
- echo 'checked="checked"' ?> onclick="clickLabChBAll(this)" id="ChBAll"/>All</br>
285
-
286
- <?php
287
-
288
- foreach ($templabels as $key => $curlabel) {
289
- if (strpos($lists['hide_label_list'], '@' . $curlabel . '@') === FALSE)
290
- echo '<input type="checkbox" checked="checked" onclick="clickLabChB(\'' . $curlabel . '\', this)" />' . stripslashes($label_titles[$key]) . '<br />';
291
- else
292
- echo '<input type="checkbox" onclick="clickLabChB(\'' . $curlabel . '\', this)" />' . stripslashes($label_titles[$key]) . '<br />';
293
- }
294
- $ispaypal = FALSE;
295
- for ($i = 0; $i < count($labels); $i++) {
296
- if ($sorted_labels_type[$i] == 'type_paypal_payment_status') {
297
- $ispaypal = TRUE;
298
- }
299
- }
300
- ?>
301
- <br/>
302
- <div style="text-align:center;">
303
- <input type="button" onclick="toggleChBDiv(false);" value="Done"/>
304
- </div>
305
- </form>
306
- </div>
307
-
308
- <?php } ?>
309
- <div style="font-size:14px; font-weight:bold">
310
- <a href="http://web-dorado.com/wordpress-form-maker-guide-2.html" target="_blank" style="color:blue; text-decoration:none;">User Manual</a>
311
- <br />
312
- This section allows you to view and manage form submissions.
313
- <a href="http://web-dorado.com/wordpress-form-maker-guide-6.html" target="_blank" style="color:blue; text-decoration:none;">More...</a>
314
- </div>
315
- <form action="admin.php?page=Form_maker_Submits" method="post" style="" id="admin_form"
316
- name="admin_form">
317
- <input type="hidden" name="option" value="com_formmaker">
318
- <input type="hidden" name="task" value="submits">
319
- <input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php if (isset($_POST['asc_or_desc']))
320
- echo esc_html($_POST['asc_or_desc']); ?>">
321
- <input type="hidden" name="order_by" id="order_by" value="<?php if (isset($_POST['order_by']))
322
- echo esc_html($_POST['order_by']) ?>">
323
- <br/>
324
- <table width="95%">
325
- <tr>
326
- <td colspan="11">
327
- <div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
328
- <a href="http://web-dorado.com/files/fromFormMaker.php" target="_blank"
329
- style="color:red; text-decoration:none;">
330
- <img src="<?php echo plugins_url('images/header.png', __FILE__); ?>" border="0" alt="www.web-dorado.com"
331
- width="215"><br>
332
- Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
333
- </a>
334
- </div>
335
- </td>
336
- </tr>
337
- <tr style="line-height:inherit !important;">
338
- <td align="left" width="300"> Select a form:
339
- <select name="form_id" id="form_id"
340
- onchange="if(document.getElementById('startdate'))remove_all();document.admin_form.submit();">
341
- <option value="0" selected="selected"> Select a Form</option>
342
- <?php
343
- $option = 'com_formmaker';
344
- if ($forms)
345
- for ($i = 0, $n = count($forms); $i < $n; $i++) {
346
- $form = $forms[$i];
347
- if ($form_id == $form->id) {
348
- echo "<option value='" . $form->id . "' selected='selected'>" . $form->title . "</option>";
349
- $form_title = $form->title;
350
- }
351
- else
352
- echo "<option value='" . $form->id . "' >" . $form->title . "</option>";
353
- }
354
- ?>
355
- </select>
356
- </td>
357
- <?php if (isset($form_id) and $form_id > 0): ?>
358
- <td class="reports"><strong>Entries</strong><br/><?php echo $total_entries; ?></td>
359
- <td class="reports"><strong>Views</strong><br/><?php echo $total_views ?></td>
360
- <td class="reports"><strong>Conversion Rate</strong><br/><?php if ($total_views)
361
- echo round((($total_entries / $total_views) * 100), 2) . '%';
362
- else echo '0%' ?></td>
363
- <td style="font-size:36px;text-align:center;line-height: initial;">
364
- <?php echo $form_title ?>
365
- </td>
366
- <td style="text-align:right;" width="300">
367
- Export to
368
- <input type="button" value="CSV"
369
- onclick="window.location='<?php echo admin_url('admin-ajax.php?action=formmakergeneretecsv'); ?>&form_id=<?php echo $form_id; ?>'"/>&nbsp;
370
- <input type="button" value="XML"
371
- onclick="window.location='<?php echo admin_url('admin-ajax.php?action=formmakergeneretexml'); ?>&form_id=<?php echo $form_id; ?>'"/>
372
- </td>
373
-
374
- </tr>
375
-
376
- <tr>
377
-
378
- <td colspan=5>
379
- <br/>
380
- <input type="hidden" name="hide_label_list" value="<?php echo $lists['hide_label_list']; ?>"/>
381
- <img src="<?php echo plugins_url("images/filter_show.png", __FILE__) ?>" width="40"
382
- style="vertical-align:bottom; cursor:pointer" onclick="show_hide_filter()" title="Search by fields"
383
- id="filter_img"/>
384
- <input type="button" onclick="this.form.submit();" value="Go"/>
385
- <input type="button" onclick="remove_all();this.form.submit();" value="Reset"/>
386
- </td>
387
- <td align="right">
388
- <br/><br/>
389
- <?php if (isset($labels))
390
- echo '<input type="button" onclick="toggleChBDiv(true)" value="Add/Remove Columns" />'; ?>
391
- </td>
392
- </tr>
393
-
394
- <?php else: echo '<td><br /><br /><br /></td></tr>'; endif; ?>
395
- </table>
396
- <?php print_html_nav($pageNav['total'], $pageNav['limit']);
397
- ?>
398
- <div style="border-radius: 3px 3px 3px 3px;border: 1px solid #F0F0F0; overflow-x:auto; width:95%; ">
399
- <table class="wp-list-table widefat fixed posts" style="width:95%; table-layout: inherit !important;">
400
- <thead>
401
- <tr>
402
- <th width="3%"><?php echo '#'; ?></th>
403
- <th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input type="checkbox"></th>
404
- <th width="4%" scope="col" id="submitid_fc" class="submitid_fc <?php if ($sort["sortid_by"] == "group_id")
405
- echo $sort["custom_style"];
406
- else echo $sort["default_style"]; ?>" <?php if (!(strpos($lists['hide_label_list'], '@submitid@') === FALSE))
407
- echo 'style="display:none;"';?>><a href="javascript:ordering('group_id',<?php if ($sort["sortid_by"] == "group_id")
408
- echo $sort["1_or_2"];
409
- else echo "1"; ?>)"><span>ID</span><span class="sorting-indicator"></span></a></th><?php
410
- ?>
411
- <th width="210px" scope="col" id="submitdate_fc" class="submitdate_fc <?php if ($sort["sortid_by"] == "date")
412
- echo $sort["custom_style"];
413
- else echo $sort["default_style"]; ?>" <?php if (!(strpos($lists['hide_label_list'], '@submitdate@') === FALSE))
414
- echo 'style="display:none;"';?>><a href="javascript:ordering('date',<?php if ($sort["sortid_by"] == "date")
415
- echo $sort["1_or_2"];
416
- else echo "1"; ?>)"><span>Submit date</span><span class="sorting-indicator"></span></a></th><?php
417
- ?>
418
- <th scope="col" id="submitterip_fc" class="submitterip_fc <?php if ($sort["sortid_by"] == "ip")
419
- echo $sort["custom_style"];
420
- else echo $sort["default_style"]; ?>" <?php if (!(strpos($lists['hide_label_list'], '@submitterip@') === FALSE))
421
- echo 'style="display:none;"';?>><a href="javascript:ordering('ip',<?php if ($sort["sortid_by"] == "ip")
422
- echo $sort["1_or_2"];
423
- else echo "1"; ?>)"><span>Submitter's IP Address</span><span class="sorting-indicator"></span></a></th><?php
424
- $n = count($rows);
425
- for ($i = 0; $i < count($labels); $i++) {
426
- if (strpos($lists['hide_label_list'], '@' . $labels_id[$i] . '@') === FALSE) {
427
- $styleStr = '';
428
- }
429
- else {
430
- $styleStr = 'display:none;';
431
- }
432
- if ($sorted_labels_type[$i] == 'type_address')
433
- switch ($label_titles_copy[$i]) {
434
- case 'Street Line':
435
- $field_title = __('Street Address', 'form_maker');
436
- break;
437
- case 'Street Line2':
438
- $field_title = __('Street Address Line 2', 'form_maker');
439
- break;
440
- case 'City':
441
- $field_title = __('City', 'form_maker');
442
- break;
443
- case 'State':
444
- $field_title = __('State / Province / Region', 'form_maker');
445
- break;
446
- case 'Postal':
447
- $field_title = __('Postal / Zip Code', 'form_maker');
448
- break;
449
- case 'Country':
450
- $field_title = __('Country', 'form_maker');
451
- break;
452
- default :
453
- $field_title = stripslashes($label_titles_copy[$i]);
454
- break;
455
- }
456
- else {
457
- $field_title = stripslashes($label_titles_copy[$i]);
458
- }
459
- ?>
460
- <th style="<?php echo $styleStr; ?>" id="<?php echo $labels_id[$i] . '_fc';?>"
461
- class="<?php echo $labels_id[$i] . '_fc'; if ($sort["sortid_by"] == $labels_id[$i] . "_field")
462
- echo $sort["custom_style"] . '"';
463
- else echo $sort["default_style"] . '"'; ?> "><a
464
- href="javascript:ordering('<?php echo $labels_id[$i] . "_field"; ?>',<?php if ($sort["sortid_by"] == $labels_id[$i] . "_field")
465
- echo $sort["1_or_2"];
466
- else echo "1"; ?>)"><span><?php echo $field_title ?></span><span class="sorting-indicator"></span></a></th>
467
- <?php
468
- }
469
- ?>
470
- <th style="width:80px">Edit</th>
471
- <th style="width:80px"><a
472
- href="javascript:submit_del('admin.php?page=Form_maker_Submits&task=remov_cheched')">Delete</a></th>
473
- </tr>
474
- <tr id="fields_filter" style="display:none">
475
- <th width="3%"></th>
476
- <th width="3%"></th>
477
- <th width="4%" class="submitid_fc" <?php if (!(strpos($lists['hide_label_list'], '@submitid@') === FALSE))
478
- echo 'style="display:none;"';?> ></th>
479
- <th width="150" class="submitdate_fc"
480
- style="margin:inherit; <?php if (!(strpos($lists['hide_label_list'], '@submitdate@') === FALSE))
481
- echo 'display:none;';?>">
482
- <table align="center" style="margin:auto" class="simple_table">
483
- <tr class="simple_table">
484
- <td class="simple_table" style="text-align:left">From:</td>
485
- <td style="text-align:center" class="simple_table"><input class="inputbox" type="text" name="startdate"
486
- id="startdate" size="15" maxlength="15"
487
- value="<?php echo $lists['startdate'];?>"/></td>
488
- <td style="text-align:center" class="simple_table"><input type="reset" style="width:22px" class="button"
489
- value="..."
490
- onclick="return showCalendar('startdate','%Y-%m-%d');"/>
491
- </td>
492
- </tr>
493
- <tr class="simple_table">
494
- <td style="text-align:left" class="simple_table">To:</td>
495
- <td style="text-align:center" class="simple_table"><input class="inputbox" type="text" name="enddate"
496
- id="enddate" size="15" maxlength="15"
497
- value="<?php echo $lists['enddate'];?>"/></td>
498
- <td style="text-align:center" class="simple_table"><input type="reset" style="width:22px" class="button"
499
- value="..."
500
- onclick="return showCalendar('enddate','%Y-%m-%d');"/>
501
- </td>
502
- </tr>
503
- </table>
504
- </th>
505
- <th width="100" class="submitterip_fc" <?php if (!(strpos($lists['hide_label_list'], '@submitterip@') === FALSE))
506
- echo 'style="display:none;"';?>>
507
- <input type="text" name="ip_search" id="ip_search" value="<?php echo $lists['ip_search'] ?>"
508
- onChange="this.form.submit();"/>
509
- </th>
510
- <?php
511
- $n = count($rows);
512
- $ka_fielderov_search = FALSE;
513
-
514
- if ($lists['ip_search'] || $lists['startdate'] || $lists['enddate']) {
515
- $ka_fielderov_search = TRUE;
516
- }
517
-
518
- for ($i = 0; $i < count($labels); $i++) {
519
- if (strpos($lists['hide_label_list'], '@' . $labels_id[$i] . '@') === FALSE) {
520
- $styleStr = '';
521
- }
522
- else {
523
- $styleStr = 'style="display:none;"';
524
- }
525
- if (!$ka_fielderov_search) {
526
- if ($lists[$form_id . '_' . $labels_id[$i] . '_search']) {
527
- $ka_fielderov_search = TRUE;
528
- }
529
- }
530
- if ($sorted_labels_type[$i] != 'type_mark_map')
531
- echo '<th class="' . $labels_id[$i] . '_fc" ' . $styleStr . '>' . '<input name="' . $form_id . '_' . $labels_id[$i] . '_search" id="' . $form_id . '_' . $labels_id[$i] . '_search" type="text" value="' . $lists[$form_id . '_' . $labels_id[$i] . '_search'] . '" onChange="this.form.submit();" >' . '</th>';
532
- else
533
- echo '<th class="' . $labels_id[$i] . '_fc" ' . $styleStr . '>' . '</th>';
534
- }
535
- ?>
536
- <th></th>
537
- <th></th>
538
- </tr>
539
- </thead>
540
- <?php
541
- $k = 0;
542
- $m = count($labels);
543
- $group_id_s = array();
544
- $l = 0;
545
- if (count($rows_ord) > 0 and $m)
546
- for ($i = 0; $i < count($rows_ord); $i++) {
547
- $row = $rows_ord[$i];
548
- if (!in_array($row->group_id, $group_id_s)) {
549
- array_push($group_id_s, $row->group_id);
550
- }
551
- }
552
- for ($www = 0, $qqq = count($group_id_s); $www < $qqq; $www++) {
553
- $i = $group_id_s[$www];
554
- $temp = array();
555
- for ($j = 0; $j < $n; $j++) {
556
- $row = $rows[$j];
557
- if ($row->group_id == $i) {
558
- array_push($temp, $row);
559
- }
560
- }
561
- $f = $temp[0];
562
- $date = $f->date;
563
- $ip = $f->ip;
564
- $link = "admin.php?page=Form_maker_Submits&task=edit_submit&id=" . $f->group_id;
565
- ?>
566
-
567
- <tr class="<?php echo "row$k"; ?>">
568
-
569
- <td><?php echo $www + 1;?></td>
570
-
571
- <th style="text-align:center" class="check-column"><input type="checkbox" name="post[]"
572
- value="<?php echo $f->group_id; ?>"></th>
573
-
574
- <?php
575
-
576
- if (strpos($lists['hide_label_list'], '@submitid@') === FALSE)
577
- echo '<td class="submitid_fc"><a href="' . $link . '" >' . $f->group_id . '</a></td>';
578
- else
579
- echo '<td class="submitid_fc" style="display:none;"><a href="' . $link . '" >' . $f->group_id . '</a></td>';
580
-
581
- if (strpos($lists['hide_label_list'], '@submitdate@') === FALSE)
582
- echo '<td class="submitdate_fc"><a href="' . $link . '" >' . $date . '</a></td>';
583
- else
584
- echo '<td class="submitdate_fc" style="display:none;"><a href="' . $link . '" >' . $date . '</a></td>';
585
-
586
- if (strpos($lists['hide_label_list'], '@submitterip@') === FALSE)
587
- echo '<td class="submitterip_fc"><a href="' . $link . '" >' . $ip . '</a></td>';
588
- else
589
- echo '<td class="submitterip_fc" style="display:none;"><a href="' . $link . '" >' . $ip . '</a></td>';
590
-
591
-
592
-
593
- //print_r($temp);
594
- $ttt = count($temp);
595
- for ($h = 0; $h < $m; $h++) {
596
- $not_label = TRUE;
597
- for ($g = 0; $g < $ttt; $g++) {
598
- $t = $temp[$g];
599
- if (strpos($lists['hide_label_list'], '@' . $labels_id[$h] . '@') === FALSE)
600
- $styleStr = '';
601
- else $styleStr = 'style="display:none;"';
602
- if ($t->element_label == $labels_id[$h]) {
603
- if (strpos($t->element_value, "***map***")) {
604
- $map_params = explode('***map***', $t->element_value);
605
- $longit = $map_params[0];
606
- $latit = $map_params[1];
607
- echo '<td align="center" class="' . $labels_id[$h] . '_fc" ' . $styleStr . '>
608
- <a class="thickbox-preview" href="' . admin_url('admin-ajax.php?action=frommapeditinpopup&long=' . $longit . '&lat=' . $latit) . '&TB_iframe=1&tbWidth=630&tbHeight=650" >' . 'Show on Map' . '</a>
609
- </td>';
610
- }
611
- else if (strpos($t->element_value, "*@@url@@*")) {
612
- $new_file = str_replace("*@@url@@*", '', str_replace("***br***", '<br>', $t->element_value));
613
- $new_filename = explode('/', $new_file);
614
- echo '<td class="' . $labels_id[$h] . '_fc" ' . $styleStr . '><a target="_blank" href="' . $new_file . '">' . $new_filename[count($new_filename) - 1] . "</td>";
615
- }
616
- elseif (strpos($t->element_value, "***star_rating***")) {
617
- $new_filename = str_replace("***star_rating***", '', $t->element_value);
618
- $stars = "";
619
- $new_filename=explode('***', $new_filename);
620
- for ($j = 0; $j < $new_filename[1]; $j++) {
621
- $stars .= '<img id="' . $t->element_label . '_star_' . $j . '" src="' . plugins_url('images/star_' . $new_filename[2] . '.png', __FILE__) . '" /> ';
622
- }
623
- for ($k = $new_filename[1]; $k < $new_filename[0]; $k++) {
624
- $stars .= '<img id="' . $t->element_label . '_star_' . $k . '" src="' . plugins_url('images/star.png', __FILE__) . '" /> ';
625
- }
626
- echo '<td align="center" class="' . $labels_id[$h] . '_fc" ' . $styleStr . '>' . $stars . "</td>";
627
- }
628
- elseif (strpos($t->element_value, "***matrix***")) {
629
- echo '<td align="center" class="' . $labels_id[$h] . '_fc" ' . $styleStr . '>
630
- <a class="thickbox-preview" href="' . admin_url('admin-ajax.php?action=show_matrix&matrix_params=' . $t->element_value) . '&TB_iframe=1&tbWidth=630&tbHeight=650">Show Matrix</a>
631
- </td>';
632
- }
633
- elseif (strpos($t->element_value, "***grading***")) {
634
- $new_filename = str_replace("***grading***", '', $t->element_value);
635
- $grading = explode(":", $new_filename);
636
- $items_count = sizeof($grading) - 1;
637
- $items = "";
638
- $total = "";
639
- for ($k = 0; $k < $items_count / 2; $k++) {
640
- $items .= $grading[$items_count / 2 + $k] . ": " . $grading[$k] . "</br>";
641
- $total += $grading[$k];
642
- }
643
- $items .= "Total: " . $total;
644
- echo '<td align="center" class="' . $labels_id[$h] . '_fc" ' . $styleStr . '><pre style="font-family:inherit">' . $items . '</pre></td>';
645
- }
646
- else {
647
- echo '<td class="' . $labels_id[$h] . '_fc" ' . $styleStr . '><pre style="font-family:inherit">' . str_replace("***br***", '<br>', stripslashes($t->element_value)) . '</pre></td>';
648
- }
649
- $not_label = FALSE;
650
- }
651
- }
652
- if ($not_label) {
653
- echo '<td class="' . $labels_id[$h] . '_fc" ' . $styleStr . '></td>';
654
- }
655
- }
656
- ?>
657
- <td>
658
- <a href="javascript:submit_del('admin.php?page=Form_maker_Submits&task=edit_submit&id=<?php echo $f->group_id; ?>')">Edit</a>
659
- </td>
660
- <td>
661
- <a href="javascript:submit_del('admin.php?page=Form_maker_Submits&task=remove_submit&id=<?php echo $f->group_id; ?>')">Delete</a>
662
- </td>
663
- </tr>
664
- <?php
665
- $k = 1 - $k;
666
- }
667
- ?>
668
- </table>
669
- </div>
670
- <?php
671
- foreach ($sorted_labels_type as $key => $label_type) {
672
- if ($label_type == "type_checkbox" || $label_type == "type_radio" || $label_type == "type_own_select" || $label_type == "type_country") {
673
- ?>
674
- <br/>
675
- <br/>
676
- <strong><?php echo stripslashes($label_titles_copy[$key]); ?></strong>
677
- <br/>
678
- <br/>
679
- <?php
680
- $query = "SELECT element_value FROM " . $wpdb->prefix . "formmaker_submits " . $where_choices . " AND element_label='" . $labels_id[$key] . "'";
681
- $choices = $wpdb->get_results($query);
682
- $colors = array(
683
- '#2CBADE',
684
- '#FE6400'
685
- );
686
- $choices_labels = array();
687
- $choices_count = array();
688
- $all = count($choices);
689
- $unanswered = 0;
690
- foreach ($choices as $key => $choice) {
691
- if ($choice->element_value == '') {
692
- $unanswered++;
693
- }
694
- else {
695
- if (!in_array($choice->element_value, $choices_labels)) {
696
- array_push($choices_labels, $choice->element_value);
697
- array_push($choices_count, 0);
698
- }
699
- $choices_count[array_search($choice->element_value, $choices_labels)]++;
700
- }
701
- }
702
- array_multisort($choices_count, SORT_DESC, $choices_labels);
703
- ?>
704
- <table width="95%" style="width:95%" class="wp-list-table widefat fixed posts">
705
- <thead>
706
- <tr>
707
- <th width="20%">Choices</th>
708
- <th>Percentage</th>
709
- <th width="10%">Count</th>
710
- </tr>
711
- </thead>
712
- <?php
713
- foreach ($choices_labels as $key => $choices_label) {
714
- ?>
715
- <tr>
716
- <td><?php echo str_replace("***br***", '<br>', $choices_label)?></td>
717
- <td>
718
- <div class="bordered"
719
- style="width:<?php echo ($choices_count[$key] / ($all - $unanswered)) * 100; ?>%; height:18px; background-color:<?php echo $colors[$key % 2]; ?>"></div>
720
- </td>
721
- <td><?php echo $choices_count[$key]?></td>
722
- </tr>
723
- <?php
724
- }
725
-
726
- if ($unanswered) {
727
- ?>
728
- <tr>
729
- <td colspan="2" align="right">Unanswered</th>
730
- <td><strong><?php echo $unanswered;?></strong></th>
731
- </tr>
732
-
733
- <?php
734
- }
735
- ?>
736
- <tr>
737
- <td colspan="2" align="right"><strong>Total</strong></th>
738
- <td><strong><?php echo $all;?></strong></th>
739
- </tr>
740
-
741
- </table>
742
- <?php
743
- }
744
- }
745
- ?>
746
-
747
-
748
-
749
- <input type="hidden" name="boxchecked" value="0">
750
-
751
- <input type="hidden" name="filter_order2" value="<?php echo $lists['order']; ?>"/>
752
-
753
- <input type="hidden" name="filter_order_Dir2" value="<?php echo $lists['order_Dir']; ?>"/>
754
-
755
- </form>
756
- <script>
757
- <?php if ($ka_fielderov_search) { ?>
758
- document.getElementById('fields_filter').style.display = '';
759
- <?php
760
- }?>
761
- </script>
762
-
763
- <?php
764
- }
765
-
766
- function html_editSubmit($rows, $labels_id, $labels_name, $labels_type) {
767
- ?>
768
-
769
- <script language="javascript" type="text/javascript">
770
-
771
- function submitbutton(pressbutton) {
772
- var form = document.adminForm;
773
-
774
- if (pressbutton == 'cancel_submit') {
775
- submitform(pressbutton);
776
- return;
777
- }
778
-
779
- submitform(pressbutton);
780
- }
781
- function submitform(pressbutton) {
782
-
783
- document.getElementById('adminForm').action = document.getElementById('adminForm').action + '&task=' + pressbutton;
784
- document.getElementById('adminForm').submit();
785
- }
786
- </script>
787
- <table width="90%">
788
- <tbody>
789
- <tr>
790
- <td width="100%"><h2>Edit Submission</h2></td>
791
- <td align="right"><input type="button" onclick="submitbutton('save_submit')" value="Save"
792
- class="button-secondary action"></td>
793
- <td align="right"><input type="button" onclick="submitbutton('appply_submit')" value="Apply"
794
- class="button-secondary action"></td>
795
- <td align="right"><input type="button" onclick="submitbutton('cancel')" value="Cancel"
796
- class="button-secondary action"></td>
797
- </tr>
798
- </tbody>
799
- </table>
800
- <form action="admin.php?page=Form_maker_Submits&id=<?php echo (int) $_GET['id']; ?>" method="post" id="adminForm"
801
- name="adminForm">
802
- <table class="admintable">
803
- <tr>
804
- <td class="key">
805
- <label for="ID">ID: </label>
806
- </td>
807
- <td>
808
- <?php echo $rows[0]->group_id;?>
809
- </td>
810
- </tr>
811
-
812
- <tr>
813
- <td class="key">
814
- <label for="Date">Date:
815
- </label>
816
- </td>
817
- <td>
818
- <?php echo $rows[0]->date;?>
819
- </td>
820
- </tr>
821
- <tr>
822
- <td class="key">
823
- <label for="IP">IP:</label>
824
- </td>
825
- <td>
826
- <?php echo $rows[0]->ip;?>
827
- </td>
828
- </tr>
829
-
830
- <?php
831
- foreach ($labels_id as $key => $label_id) {
832
- if ($labels_type[$key] != 'type_editor' and $labels_type[$key] != 'type_submit_reset' and $labels_type[$key] != 'type_map' and $labels_type[$key] != 'type_mark_map' and $labels_type[$key] != 'type_captcha' and $labels_type[$key] != 'type_recaptcha' and $labels_type[$key] != 'type_button') {
833
- $element_value = '';
834
- foreach ($rows as $row) {
835
- if ($row->element_label == $label_id) {
836
- $element_value = $row->element_value;
837
- break;
838
- }
839
- else {
840
- $element_value = 'element_valueelement_valueelement_value';
841
- }
842
- }
843
- if ($element_value == "element_valueelement_valueelement_value") {
844
- continue;
845
- }
846
- switch ($labels_type[$key]) {
847
- case 'type_checkbox':
848
- {
849
- $choices = explode('***br***', $element_value);
850
- $choices = array_slice($choices, 0, count($choices) - 1);
851
- echo '<tr>
852
- <td class="key" rowspan="' . count($choices) . '">
853
- <label for="title">' . $labels_name[$key] . '</label>
854
- </td>';
855
- foreach ($choices as $choice_key => $choice) {
856
- echo '<td>
857
- <input type="text" name="submission_'.$label_id.'_'.$choice_key.'" id="submission_'.$label_id.'_'.$choice_key.'" value="'.$choice.'" size="80" />
858
- </td>
859
- </tr>';
860
- }
861
- break;
862
- }
863
- case 'type_star_rating': {
864
- $edit_stars = "";
865
- $element_value1 = str_replace("***star_rating***", '', $element_value);
866
- $stars_value = explode('***', $element_value1);
867
- for ($j = 0; $j < $stars_value[1]; $j++)
868
- $edit_stars.='<img id="'.$label_id.'_star_'.$j.'" onclick="edit_star_rating('.$j.','.$label_id.')" src="' . plugins_url('/images/star_'.$stars_value[2].'.png', __FILE__) . '" /> ';
869
- for( $k=$stars_value[1];$k<$stars_value[0];$k++)
870
- $edit_stars.='<img id="'.$label_id.'_star_'.$k.'" onclick="edit_star_rating('.$k.','.$label_id.')" src="' . plugins_url('/images/star.png', __FILE__) . '" /> ';
871
- echo '<tr>
872
- <td class="key">
873
- <label for="title">
874
- '.$labels_name[$key].'
875
- </label>
876
- </td>
877
- <td>
878
- <input type="hidden" id="'.$label_id.'_star_amountform_id_temp" name="'.$label_id.'_star_amountform_id_temp" value="'.$stars_value[0].'">
879
- <input type="hidden" name="'.$label_id.'_star_colorform_id_temp" id="'.$label_id.'_star_colorform_id_temp" value="'.$stars_value[2].'">
880
- <input type="hidden" id="'.$label_id.'_selected_star_amountform_id_temp" name="'.$label_id.'_selected_star_amountform_id_temp" value="'.$stars_value[1].'">
881
- '.$edit_stars.'
882
- <input type="hidden" name="submission_'.$label_id.'" id="submission_'.$label_id.'" value="'.$element_value.'" size="80" />
883
- </td>
884
- </tr>';
885
- break;
886
- }
887
- case "type_scale_rating": {
888
- $scale_radio = explode('/', $element_value);
889
- $scale_value = $scale_radio[0];
890
- $scale ='<table><tr>';
891
- for ($k = 1; $k <= $scale_radio[1]; $k++)
892
- $scale .= '<td style="text-align:center"><span>'.$k.'</span></td>';
893
- $scale .='<tr></tr>';
894
- for ($l = 1; $l <= $scale_radio[1]; $l++) {
895
- if ($l == $scale_radio[0])
896
- $checked="checked";
897
- else
898
- $checked="";
899
- $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>';
900
- }
901
- $scale .= '</tr></table>';
902
- echo '<tr>
903
- <td class="key">
904
- <label for="title">
905
- '.$labels_name[$key].'
906
- </label>
907
- </td>
908
- <td>
909
- <input type="hidden" id="'.$label_id.'_scale_checkedform_id_temp" name="'.$label_id.'_scale_checkedform_id_temp" value="'.$scale_radio[1].'">
910
- '.$scale.'
911
- <input type="hidden" name="submission_'.$label_id.'" id="submission_'.$label_id.'" value="'.$element_value.'" size="80" />
912
- </td>
913
- </tr>';
914
- break;
915
- }
916
- case 'type_range': {
917
- $range_value = explode('-', $element_value);
918
- $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"/>';
919
- echo '<tr>
920
- <td class="key">
921
- <label for="title">
922
- '.$labels_name[$key].'
923
- </label>
924
- </td>
925
- <td>
926
- '.$range.'
927
- <input type="hidden" name="submission_'.$label_id.'" id="submission_'.$label_id.'" value="'.$element_value.'" size="80" />
928
- </td>
929
- </tr>';
930
- break;
931
- }
932
- case 'type_spinner': {
933
- echo '<tr>
934
- <td class="key">
935
- <label for="title">
936
- '.$labels_name[$key].'
937
- </label>
938
- </td>
939
- <td>
940
- <input type="text" name="submission_'.$label_id.'" id="submission_'.$label_id.'" value="'.str_replace("*@@url@@*",'',$element_value).'" size="20" />
941
- </td>
942
- </tr>';
943
- break;
944
- }
945
- case 'type_grading': {
946
- $element_value1 = str_replace("***grading***", '', $element_value);
947
- $garding_value = explode(':', $element_value1);
948
- $items_count = sizeof($garding_value) - 1;
949
- $garding = "";
950
- $sum = "";
951
- for ($k = 0; $k < $items_count/2; $k++) {
952
- $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>';
953
- $sum += $garding_value[$k];
954
- }
955
- echo '<tr>
956
- <td class="key">
957
- <label for="title">
958
- '.$labels_name[$key].'
959
- </label>
960
- </td>
961
- <td>
962
- '.$garding.'<div><span id="'.$label_id.'_grading_sumform_id_temp">'.$sum.'</span>/<span id="'.$label_id.'_grading_totalform_id_temp">'.$garding_value[$items_count].'</span><span id="'.$label_id.'_text_elementform_id_temp"></span>
963
- <input type="hidden" id="'.$label_id.'_element_valueform_id_temp" name="'.$label_id.'_element_valueform_id_temp" value="'.$element_value1.'">
964
- <input type="hidden" id="'.$label_id.'_grading_totalform_id_temp" name="'.$label_id.'_grading_totalform_id_temp" value="'.$garding_value[$items_count].'">
965
- <input type="hidden" name="submission_'.$label_id.'" id="submission_'.$label_id.'" value="'.$element_value.'" size="80" />
966
- </td>
967
- </tr>';
968
- break;
969
- }
970
- case 'type_matrix': {
971
- $new_filename = str_replace("***matrix***", '', $element_value);
972
- $matrix_value = explode('***', $new_filename);
973
- $matrix_value = array_slice($matrix_value, 0, count($matrix_value) - 1);
974
- $mat_rows = $matrix_value[0];
975
- $mat_columns = $matrix_value[$mat_rows + 1];
976
- $matrix = "<table>";
977
- $matrix .= '<tr><td></td>';
978
- for ($k = 1; $k <= $mat_columns; $k++)
979
- $matrix .= '<td style="background-color:#BBBBBB; padding:5px; border:1px; ">'.$matrix_value[$mat_rows+1+$k].'</td>';
980
- $matrix .= '</tr>';
981
- $aaa = Array();
982
- $var_checkbox = 1;
983
- $selected_value = "";
984
- $selected_value_yes = "";
985
- $selected_value_no = "";
986
- for ($k = 1; $k <= $mat_rows; $k++) {
987
- $matrix .='<tr><td style="background-color:#BBBBBB; padding:5px; border:1px;">'.$matrix_value[$k].'</td>';
988
- if ($matrix_value[$mat_rows + $mat_columns + 2] == "radio") {
989
- if ($matrix_value[$mat_rows + $mat_columns + 2 + $k] == 0) {
990
- $checked = "";
991
- $aaa[1] = "";
992
- }
993
- else
994
- $aaa = explode("_", $matrix_value[$mat_rows + $mat_columns + 2 + $k]);
995
- for ($l = 1; $l <= $mat_columns; $l++) {
996
- if ($aaa[1] == $l) {
997
- $checked = 'checked';
998
- }
999
- else
1000
- $checked = "";
1001
- $index = "'" . $k . '_' . $l . "'";
1002
- $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>';
1003
- }
1004
- }
1005
- else {
1006
- if ($matrix_value[$mat_rows+$mat_columns+2] == "checkbox") {
1007
- for ($l = 1; $l <= $mat_columns; $l++) {
1008
- if ($matrix_value[$mat_rows+$mat_columns+2+$var_checkbox]==1)
1009
- $checked = 'checked';
1010
- else
1011
- $checked = '';
1012
- $index = "'".$k.'_'.$l."'";
1013
- $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>';
1014
- $var_checkbox++;
1015
- }
1016
- }
1017
- else {
1018
- if ($matrix_value[$mat_rows+$mat_columns+2]=="text") {
1019
- for ($l = 1; $l <= $mat_columns; $l++) {
1020
- $text_value = $matrix_value[$mat_rows+$mat_columns+2+$var_checkbox];
1021
- $index = "'".$k.'_'.$l."'";
1022
- $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].'"
1023
- value="'.$text_value.'" onKeyUp="change_text_values('.$index.','.$label_id.','.$mat_rows.','.$mat_columns.')"/></td>';
1024
- $var_checkbox++;
1025
- }
1026
- }
1027
- else {
1028
- for ($l = 1; $l <= $mat_columns; $l++) {
1029
- $selected_text = $matrix_value[$mat_rows+$mat_columns+2+$var_checkbox];
1030
- if ($selected_text=='yes') {
1031
- $selected_value_yes ='selected';
1032
- $selected_value_no ='';
1033
- $selected_value ='';
1034
- }
1035
- else {
1036
- if ($selected_text=='no') {
1037
- $selected_value_yes ='';
1038
- $selected_value_no ='selected';
1039
- $selected_value ='';
1040
- }
1041
- else {
1042
- $selected_value_yes = '';
1043
- $selected_value_no ='';
1044
- $selected_value ='selected';
1045
- }
1046
- }
1047
- $index = "'".$k.'_'.$l."'";
1048
- $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>';
1049
- $var_checkbox++;
1050
- }
1051
- }
1052
- }
1053
- }
1054
- $matrix .= '</tr>';
1055
- }
1056
- $matrix .= '</table>';
1057
- echo '<tr>
1058
- <td class="key">
1059
- <label for="title">
1060
- '.$labels_name[$key].'
1061
- </label>
1062
- </td>
1063
- <td>
1064
- <input type="hidden" id="'.$label_id.'_matrixform_id_temp" name="'.$label_id.'_matrixform_id_temp" value="'.$new_filename.'">
1065
- '.$matrix.'
1066
- <input type="hidden" name="submission_'.$label_id.'" id="submission_'.$label_id.'" value="'.$element_value.'" size="80" />
1067
- </td>
1068
- </tr>';
1069
- break;
1070
- }
1071
- default: {
1072
- echo '<tr>
1073
- <td class="key">
1074
- <label for="title">' . $labels_name[$key] . '</label>
1075
- </td>
1076
- <td>
1077
- <input type="text" name="submission_'.$label_id.'" id="submission_'.$label_id.'" value="'.str_replace("*@@url@@*", '', $element_value).'" size="80" />
1078
- </td>
1079
- </tr>';
1080
- }
1081
- break;
1082
- }
1083
- }
1084
- }
1085
- ?>
1086
- </table>
1087
- <input type="hidden" name="option" value="com_formmaker"/>
1088
- <input type="hidden" name="id" value="<?php echo $rows[0]->group_id?>"/>
1089
- <input type="hidden" name="form_id" value="<?php echo $rows[0]->form_id?>"/>
1090
- <input type="hidden" name="date" value="<?php echo $rows[0]->date?>"/>
1091
- <input type="hidden" name="ip" value="<?php echo $rows[0]->ip?>"/>
1092
- <input type="hidden" name="task" value="save_submit"/>
1093
- <input type="hidden" value="<?php echo plugins_url("", __FILE__); ?>" id="form_plugins_url" />
1094
- <script>
1095
- plugin_url = document.getElementById('form_plugins_url').value;
1096
- </script>
1097
- </form>
1098
- <?php
1099
- }
1100
-
1101
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Submissions.php DELETED
@@ -1,405 +0,0 @@
1
- <?php
2
- if (!current_user_can('manage_options')) {
3
- die('Access Denied');
4
- }
5
- function show_submits() {
6
- global $wpdb;
7
- $sort["sortid_by"] = '';
8
- $sort["custom_style"] = '';
9
- $sort["1_or_2"] = '';
10
- $order = '';
11
- // Page navigation.
12
- $exists = 0;
13
- $sort["default_style"] = "manage-column column-autor sortable desc";
14
- if (isset($_POST['page_number'])) {
15
- if ($_POST['asc_or_desc']) {
16
- $sort["sortid_by"] = $wpdb->escape($_POST['order_by']);
17
- if ($_POST['asc_or_desc'] == 1) {
18
- $sort["custom_style"] = "manage-column column-title sorted asc";
19
- $sort["1_or_2"] = "2";
20
- $order = "ORDER BY " . $sort["sortid_by"] . " ASC";
21
- }
22
- else {
23
- $sort["custom_style"] = "manage-column column-title sorted desc";
24
- $sort["1_or_2"] = "1";
25
- $order = "ORDER BY " . $sort["sortid_by"] . " DESC";
26
- }
27
- }
28
- if ($_POST['page_number']) {
29
- $limit = ((int) $_POST['page_number'] - 1) * 20;
30
- }
31
- else {
32
- $limit = 0;
33
- }
34
- }
35
- else {
36
- $limit = 0;
37
- }
38
- //End page navigation.
39
- $query = "SELECT id, title FROM " . $wpdb->prefix . "formmaker order by title";
40
- $forms = $wpdb->get_results($query);
41
- if (isset($_POST['form_id'])) {
42
- $form_id = (int) $_POST['form_id'];
43
- }
44
- else {
45
- $form_id = 0;
46
- }
47
- if ($form_id) {
48
- $query = "SELECT id FROM " . $wpdb->prefix . "formmaker where id=" . $form_id;
49
- $exists = $wpdb->get_var($query);
50
- }
51
- if (!$exists) {
52
- $form_id = 0;
53
- }
54
- if (isset($_POST['order_by']) && $_POST['order_by'] != "") {
55
- $filter_order = esc_html($_POST['order_by']);
56
- }
57
- else {
58
- $filter_order = 'id';
59
- }
60
- if (isset($_POST['asc_or_desc']) && $_POST['asc_or_desc'] == 1) {
61
- $filter_order_Dir = " ASC";
62
- }
63
- else {
64
- $filter_order_Dir = " DESC";
65
- }
66
- if (isset($_POST['search_submits'])) {
67
- $search_submits = esc_html($_POST['search_submits']);
68
- }
69
- else {
70
- $search_submits = '';
71
- }
72
- $search_submits = strtolower($search_submits);
73
- if (isset($_POST['ip_search'])) {
74
- $ip_search = esc_html($_POST['ip_search']);
75
- }
76
- else {
77
- $ip_search = '';
78
- }
79
- $ip_search = strtolower($ip_search);
80
- $where = array();
81
- $where_choices = array();
82
- if (isset($_POST['startdate'])) {
83
- $lists['startdate'] = $_POST['startdate'];
84
- }
85
- else {
86
- $lists['startdate'] = "";
87
- }
88
- if (isset($_POST['enddate'])) {
89
- $lists['enddate'] = $_POST['enddate'];
90
- }
91
- else {
92
- $lists['enddate'] = "";
93
- }
94
- if (isset($_POST['hide_label_list'])) {
95
- $lists['hide_label_list'] = $_POST['hide_label_list'];
96
- }
97
- else {
98
- $lists['hide_label_list'] = "";
99
- }
100
- if ($search_submits) {
101
- $where[] = 'element_label LIKE "%' . $search_submits . '%"';
102
- }
103
- if ($ip_search) {
104
- $where[] = 'ip LIKE "%' . $ip_search . '%"';
105
- }
106
- if ($lists['startdate'] != '') {
107
- $where[] = " `date`>='" . $lists['startdate'] . " 00:00:00' ";
108
- }
109
- if ($lists['enddate'] != '') {
110
- $where[] = " `date`<='" . $lists['enddate'] . " 23:59:59' ";
111
- }
112
- /*if ($form_id=="")
113
- if($forms)
114
- $form_id=$forms[0]->id;*/
115
- $where[] = 'form_id="' . $form_id . '"';
116
- $where = (count($where) ? ' WHERE ' . implode(' AND ', $where) : '');
117
- $orderby = ' ';
118
- if ($filter_order == 'id' or $filter_order == 'title' or $filter_order == 'mail') {
119
- $orderby = ' ORDER BY `date` desc';
120
- }
121
- elseif (!strpos($filter_order, "_field")) {
122
- $orderby = ' ORDER BY ' . $filter_order . ' ' . $filter_order_Dir . '';
123
- }
124
- $query = "SELECT * FROM " . $wpdb->prefix . "formmaker_submits" . $where;
125
- $rows = $wpdb->get_results($query);
126
- $query = "SELECT * FROM " . $wpdb->prefix . "formmaker_submits WHERE form_id='" . $form_id . "'";
127
- $rowsc = $wpdb->get_results($query);
128
- //$orderby=$order;
129
- $where_labels = array();
130
- $n = count($rowsc);
131
- $labels = array();
132
- for ($i = 0; $i < $n; $i++) {
133
- $row = $rowsc[$i];
134
- if (!in_array($row->element_label, $labels)) {
135
- array_push($labels, $row->element_label);
136
- }
137
- }
138
- // $query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE form_id='".$form_id."' and element_label=0";
139
- // $ispaypal = $wpdb->get_row($query);
140
- // if (!$ispaypal) {
141
- // return false;
142
- // }
143
- $sorted_labels_type = array();
144
- $sorted_labels_id = array();
145
- $sorted_labels = array();
146
- $label_titles = array();
147
- if ($labels) {
148
- $label_id = array();
149
- $label_order = array();
150
- $label_order_original = array();
151
- $label_type = array();
152
- $this_form = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id='" . $form_id . "'");
153
- $label_all = explode('#****#', $this_form->label_order);
154
- $label_all = array_slice($label_all, 0, count($label_all) - 1);
155
- foreach ($label_all as $key => $label_each) {
156
- $label_id_each = explode('#**id**#', $label_each);
157
- array_push($label_id, $label_id_each[0]);
158
- $label_order_each = explode('#**label**#', $label_id_each[1]);
159
- array_push($label_order_original, $label_order_each[0]);
160
- $ptn = "/[^a-zA-Z0-9_]/";
161
- $rpltxt = "";
162
- $label_temp = preg_replace($ptn, $rpltxt, $label_order_each[0]);
163
- array_push($label_order, $label_temp);
164
- array_push($label_type, $label_order_each[1]);
165
- }
166
- foreach ($label_id as $key => $label) {
167
- if (in_array($label, $labels)) {
168
- array_push($sorted_labels_type, $label_type[$key]);
169
- array_push($sorted_labels, $label_order[$key]);
170
- array_push($sorted_labels_id, $label);
171
- array_push($label_titles, $label_order_original[$key]);
172
- if (isset($_POST[$form_id . '_' . $label . '_search'])) {
173
- $search_temp = $_POST[$form_id . '_' . $label . '_search'];
174
- }
175
- else {
176
- $search_temp = '';
177
- }
178
- $search_temp = strtolower($search_temp);
179
- $lists[$form_id . '_' . $label . '_search'] = $search_temp;
180
- if ($search_temp) {
181
- $where_labels[] = '(group_id in (SELECT group_id FROM ' . $wpdb->prefix . 'formmaker_submits WHERE element_label="' . $label . '" AND element_value LIKE "%' . $search_temp . '%"))';
182
- }
183
- }
184
- }
185
- }
186
- $where_labels = (count($where_labels) ? ' ' . implode(' AND ', $where_labels) : '');
187
- if ($where_labels) {
188
- $where = $where . ' AND ' . $where_labels;
189
- }
190
- $rows_ord = array();
191
- if (strpos($filter_order, "_field")) {
192
- $query = "insert into " . $wpdb->prefix . "formmaker_submits (form_id, element_label, element_value, group_id,`date`,ip) select $form_id,'" . str_replace("_field", "", $filter_order) . "', '', group_id,`date`,ip from " . $wpdb->prefix . "formmaker_submits where `form_id`=$form_id and group_id not in (select group_id from " . $wpdb->prefix . "formmaker_submits where `form_id`=$form_id and element_label='" . str_replace("_field", "", $filter_order) . "' group by group_id) group by group_id";
193
- if ($wpdb->query($query)) {
194
- echo "database error";
195
- }
196
- $query = "SELECT group_id, date, ip FROM " . $wpdb->prefix . "formmaker_submits " . $where . " and element_label='" . str_replace("_field", "", $filter_order) . "' order by element_value " . $filter_order_Dir;
197
- $rows_ord = $wpdb->get_results($query);
198
- }
199
- $query = 'SELECT group_id, date, ip FROM ' . $wpdb->prefix . 'formmaker_submits' . $where . ' group by group_id ' . $orderby;
200
- $group_ids = $wpdb->get_results($query);
201
- $total = count($group_ids);
202
- $query = 'SELECT count(distinct group_id) FROM ' . $wpdb->prefix . 'formmaker_submits where form_id ="' . $form_id . '"';
203
- $total_entries = $wpdb->get_var($query);
204
- if (count($rows_ord) != 0) {
205
- $group_ids = $rows_ord;
206
- $total = count($rows_ord);
207
- $query = "SELECT group_id, date, ip FROM " . $wpdb->prefix . "formmaker_submits " . $where . " and element_label='" . str_replace("_field", "", $filter_order) . "' order by element_value " . $filter_order_Dir . " limit " . $limit . ", 20 ";
208
- $rows_ord = $wpdb->get_results($query);
209
- }
210
- $where2 = array();
211
- $where_choices = $where;
212
- for ($i = $limit; $i < $limit + 20; $i++) {
213
- if ($i < $total) {
214
- $where2 [] = "group_id='" . $group_ids[$i]->group_id . "'";
215
- }
216
- }
217
- $where2 = (count($where2) ? ' AND ( ' . implode(' OR ', $where2) . ' )' : '');
218
- $where = $where . $where2;
219
- $query = "SELECT * FROM " . $wpdb->prefix . "formmaker_submits " . $where . " " . $orderby . '';
220
- $rows = $wpdb->get_results($query);
221
- $pageNav['total'] = $total;
222
- $pageNav['limit'] = $limit / 20 + 1;
223
- $query = 'SELECT `views` FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="' . $form_id . '"';
224
- $total_views = $wpdb->get_var($query);
225
- $lists['order_Dir'] = $filter_order_Dir;
226
- $lists['order'] = $filter_order;
227
- // Search filter.
228
- $lists['search_submits'] = $search_submits;
229
- $lists['ip_search'] = $ip_search;
230
- if (count($rows_ord) == 0) {
231
- $rows_ord = $rows;
232
- }
233
- // Display function.
234
- html_show_submits($rows, $forms, $lists, $pageNav, $sorted_labels, $label_titles, $rows_ord, $filter_order_Dir, $form_id, $sorted_labels_id, $sorted_labels_type, $total_entries, $total_views, $where, $where_choices, $sort);
235
- }
236
-
237
- function remov_submit($id) {
238
- global $wpdb;
239
- $query = "DELETE FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "'";
240
- if ($wpdb->query($query)) {
241
- ?>
242
- <div class="updated"><p><strong>Item Deleted.</strong></p></div>
243
- <?php
244
- }
245
- else {
246
- ?>
247
- <div id="message" class="error"><p>Form Maker Submission Not Deleted</p></div>
248
- <?php
249
- }
250
- }
251
-
252
- function remov_cheched_submission() {
253
- global $wpdb;
254
- $cid = $_POST['post'];
255
- if (count($cid)) {
256
- $cids = implode(',', $cid);
257
- // Create sql statement.
258
- $query = 'DELETE FROM ' . $wpdb->prefix . 'formmaker_submits' . ' WHERE group_id IN ( ' . $cids . ' )';
259
- if ($wpdb->query($query)) {
260
- ?>
261
- <div class="updated"><p><strong>Items Deleted.</strong></p></div>
262
- <?php
263
- }
264
- else {
265
- ?>
266
- <div id="message" class="error"><p>Form Maker Submissions Not Deleted</p></div>
267
- <?php
268
- }
269
- }
270
- else {
271
- ?>
272
- <div id="message" class="error"><p>Submissions Not Selected</p></div>
273
- <?php
274
- }
275
- }
276
-
277
- function editSubmit($id) {
278
- global $wpdb;
279
- $query = "SELECT * FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id=" . $id;
280
- $rows = $wpdb->get_results($query);
281
- $form = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id=" . $rows[0]->form_id);
282
- $label_id = array();
283
- $label_order_original = array();
284
- $label_type = array();
285
- $label_all = explode('#****#', $form->label_order);
286
- $label_all = array_slice($label_all, 0, count($label_all) - 1);
287
- foreach ($label_all as $key => $label_each) {
288
- $label_id_each = explode('#**id**#', $label_each);
289
- array_push($label_id, $label_id_each[0]);
290
- $label_oder_each = explode('#**label**#', $label_id_each[1]);
291
- array_push($label_order_original, $label_oder_each[0]);
292
- array_push($label_type, $label_oder_each[1]);
293
- }
294
- // Display function.
295
- html_editSubmit($rows, $label_id, $label_order_original, $label_type);
296
- }
297
-
298
- function save_submit($id) {
299
- global $wpdb;
300
- $id = (int) $_POST['id'];
301
- $date = esc_html($_POST['date']);
302
- $ip = esc_html($_POST['ip']);
303
- $form_id = $wpdb->get_var("SELECT form_id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "'");
304
- $form = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id='" . $form_id . "'");
305
- $label_id = array();
306
- $label_order_original = array();
307
- $label_type = array();
308
- $label_all = explode('#****#', $form->label_order);
309
- $label_all = array_slice($label_all, 0, count($label_all) - 1);
310
- foreach ($label_all as $key => $label_each) {
311
- $label_id_each = explode('#**id**#', $label_each);
312
- array_push($label_id, $label_id_each[0]);
313
- $label_oder_each = explode('#**label**#', $label_id_each[1]);
314
- array_push($label_order_original, $label_oder_each[0]);
315
- array_push($label_type, $label_oder_each[1]);
316
- }
317
- foreach ($label_id as $key => $label_id_1) {
318
- $element_value = $_POST["submission_" . $label_id_1];
319
- if (isset($_POST["submission_" . $label_id_1])) {
320
- $query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
321
- $result = $wpdb->get_var($query);
322
- if ($label_type[$key] == 'type_file_upload')
323
- if ($element_value)
324
- $element_value = $element_value . "*@@url@@*";
325
- if ($result) {
326
- $wpdb->update($wpdb->prefix . "formmaker_submits", array(
327
- 'element_value' => stripslashes($element_value),
328
- ), array(
329
- 'group_id' => $id,
330
- 'element_label' => $label_id_1
331
- ), array(
332
- '%s',
333
- ), array(
334
- '%d',
335
- '%s'
336
- ));
337
- }
338
- else {
339
- $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
340
- 'form_id' => $form_id,
341
- 'element_label' => $label_id_1,
342
- 'element_value' => stripslashes($element_value),
343
- 'group_id' => $id,
344
- 'date' => $date,
345
- 'ip' => $ip
346
- ), array(
347
- '%d',
348
- '%s',
349
- '%s',
350
- '%d',
351
- '%s',
352
- '%s'
353
- ));
354
- }
355
- }
356
- else {
357
- $element_value_ch = $_POST["submission_" . $label_id_1 . '_0'];
358
- if (isset($_POST["submission_" . $label_id_1 . '_0'])) {
359
- for ($z = 0; $z < 21; $z++) {
360
- $element_value_ch = $_POST["submission_" . $label_id_1 . '_' . $z];
361
- if (isset($element_value_ch))
362
- $element_value = $element_value . $element_value_ch . '***br***';
363
- else
364
- break;
365
- }
366
- $query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
367
- $result = $wpdb->get_var($query);
368
- if ($result) {
369
- $query = "UPDATE " . $wpdb->prefix . "formmaker_submits SET `element_value`='" . stripslashes($element_value) . "' WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
370
- $wpdb->update($wpdb->prefix . "formmaker_submits", array(
371
- 'element_value' => stripslashes($element_value),
372
- ), array(
373
- 'group_id' => $id,
374
- 'element_label' => $label_id_1
375
- ), array(
376
- '%s',
377
- ), array(
378
- '%d',
379
- '%s'
380
- ));
381
- }
382
- else {
383
- $query = "INSERT INTO " . $wpdb->prefix . "formmaker_submits (form_id, element_label, element_value, group_id, date, ip) VALUES('" . $form_id . "', '" . $label_id_1 . "', '" . stripslashes($element_value) . "','" . $id . "', '" . $date . "', '" . $ip . "')";
384
- $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
385
- 'form_id' => $form_id,
386
- 'element_label' => $label_id_1,
387
- 'element_value' => stripslashes($element_value),
388
- 'group_id' => $id,
389
- 'date' => $date,
390
- 'ip' => $ip
391
- ), array(
392
- '%d',
393
- '%s',
394
- '%s',
395
- '%d',
396
- '%s',
397
- '%s'
398
- ));
399
- }
400
- }
401
- }
402
- }
403
- }
404
-
405
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Theme_functions.php DELETED
@@ -1,151 +0,0 @@
1
- <?php
2
- if (!current_user_can('manage_options')) {
3
- die('Access Denied');
4
- }
5
- function add_theme() {
6
- global $wpdb;
7
- $query = "SELECT * FROM " . $wpdb->prefix . "formmaker_themes where `default`=1 AND `id` NOT IN(" . get_option('contact_form_themes', 0) . ") ";
8
- $def_theme = $wpdb->get_row($query);
9
- html_add_theme($def_theme);
10
- }
11
-
12
- function show_theme() {
13
- global $wpdb;
14
- $order = "";
15
- $where = '';
16
- $sort["sortid_by"] = '';
17
- $order = '';
18
- $sort["custom_style"] = '';
19
- $sort["1_or_2"] = '';
20
- $search_tag = '';
21
- $sort["default_style"] = "manage-column column-autor sortable desc";
22
- if (isset($_POST['page_number'])) {
23
- if ($_POST['asc_or_desc']) {
24
- $sort["sortid_by"] = $wpdb->escape($_POST['order_by']);
25
- if ($_POST['asc_or_desc'] == 1) {
26
- $sort["custom_style"] = "manage-column column-title sorted asc";
27
- $sort["1_or_2"] = "2";
28
- $order = "ORDER BY " . $sort["sortid_by"] . " ASC";
29
- }
30
- else {
31
- $sort["custom_style"] = "manage-column column-title sorted desc";
32
- $sort["1_or_2"] = "1";
33
- $order = "ORDER BY " . $sort["sortid_by"] . " DESC";
34
- }
35
- }
36
- if ($_POST['page_number']) {
37
- $limit = ((int) $_POST['page_number'] - 1) * 20;
38
- }
39
- else {
40
- $limit = 0;
41
- }
42
- }
43
- else {
44
- $limit = 0;
45
- }
46
- if (isset($_POST['search_events_by_title'])) {
47
- $search_tag = esc_html($_POST['search_events_by_title']);
48
- }
49
- else {
50
- $search_tag = "";
51
- }
52
- if ($search_tag) {
53
- $where = ' WHERE title LIKE "%' . $search_tag . '%"';
54
- $where .= " AND `id` NOT IN (" . get_option('contact_form_themes', 0) . ")";
55
- }
56
- else {
57
- $where = " WHERE `id` NOT IN (" . get_option('contact_form_themes', 0) . ")";
58
- }
59
- if ($order == "")
60
- $order = "ORDER BY `title` ASC";
61
- // get the total number of records
62
- $query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker_themes" . $where;
63
- $total = $wpdb->get_var($query);
64
- $pageNav['total'] = $total;
65
- $pageNav['limit'] = $limit / 20 + 1;
66
- $query = "SELECT * FROM " . $wpdb->prefix . "formmaker_themes" . $where . " " . $order . " " . " LIMIT " . $limit . ",20";
67
- $rows = $wpdb->get_results($query);
68
- html_show_theme($rows, $pageNav, $sort);
69
- }
70
-
71
- function save_theme() {
72
- global $wpdb;
73
- $save_or_no = $wpdb->insert($wpdb->prefix . 'formmaker_themes', array(
74
- 'id' => NULL,
75
- 'title' => $_POST["title"],
76
- 'css' => stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST["css"])),
77
- ), array(
78
- '%d',
79
- '%s',
80
- '%s'
81
- ));
82
- if (!$save_or_no) {
83
- ?>
84
- <div class="updated"><p><strong><?php _e('Error. Please install plugin again'); ?></strong></p></div>
85
- <?php
86
- return FALSE;
87
- }
88
- ?>
89
- <div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
90
- <?php
91
-
92
- return TRUE;
93
- }
94
-
95
- function apply_theme($id) {
96
- global $wpdb;
97
- $save_or_no = $wpdb->update($wpdb->prefix . 'formmaker_themes', array(
98
- 'title' => $_POST["title"],
99
- 'css' => stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST["css"])),
100
- ), array('id' => $id), array(
101
- '%s',
102
- '%s'
103
- ));
104
- ?>
105
- <div class="updated"><p><strong><?php _e('Item Saved'); ?></strong></p></div>
106
- <?php
107
-
108
- return TRUE;
109
- }
110
-
111
- function edit_theme($id) {
112
- global $wpdb;
113
- $row = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker_themes WHERE id='" . $id . "'");
114
- html_edit_theme($row, $id);
115
- }
116
-
117
- function remove_theme($id) {
118
- global $wpdb;
119
- if ($wpdb->get_var("SELECT `default` FROM " . $wpdb->prefix . "formmaker_themes WHERE id='" . $id . "'")) {
120
- ?>
121
- <div class="updated"><p><strong><?php _e("You can't delete default theme"); ?></strong></p></div>
122
- <?php
123
- return;
124
- }
125
- $sql_remov_tag = "DELETE FROM " . $wpdb->prefix . "formmaker_themes WHERE id='" . $id . "'";
126
- if (!$wpdb->query($sql_remov_tag)) {
127
- ?>
128
- <div id="message" class="error"><p>Spider Video Player Theme Not Deleted</p></div>
129
- <?php
130
- }
131
- else {
132
- ?>
133
- <div class="updated"><p><strong><?php _e('Item Deleted.'); ?></strong></p></div>
134
- <?php
135
- }
136
- }
137
-
138
- function default_theme($id) {
139
- global $wpdb;
140
- $ids_for = $wpdb->get_col("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE `default`=1 AND `id` NOT IN(" . get_option('contact_form_themes', 0) . ")");
141
- for ($i = 0; $i < count($ids_for); $i++) {
142
- $savedd = $wpdb->update($wpdb->prefix . 'formmaker_themes', array(
143
- 'default' => 0,
144
- ), array('id' => $ids_for[$i]), array('%d'));
145
- }
146
- $savedd = $wpdb->update($wpdb->prefix . 'formmaker_themes', array(
147
- 'default' => 1,
148
- ), array('id' => $id), array('%d'));
149
- }
150
-
151
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Themes_function.html.php DELETED
@@ -1,313 +0,0 @@
1
- <?php
2
- if (!current_user_can('manage_options')) {
3
- die('Access Denied');
4
- }
5
- function html_add_theme($def_theme) {
6
- ?>
7
- <script>
8
-
9
- function submitbutton(pressbutton) {
10
-
11
- var form = document.adminForm;
12
- if (form.title.value == "") {
13
- alert('Set Theme title');
14
- return;
15
- }
16
-
17
- submitform(pressbutton);
18
- }
19
- function submitform(pressbutton) {
20
- document.getElementById("adminForm").action = document.getElementById("adminForm").action + "&task=" + pressbutton;
21
- document.getElementById("adminForm").submit();
22
- }
23
-
24
- </script>
25
- <div style="font-size:14px; font-weight:bold">
26
- <a href="http://web-dorado.com/wordpress-form-maker-guide-2.html" target="_blank" style="color:blue; text-decoration:none;">User Manual</a>
27
- <br />
28
- This section allows you to edit form themes.
29
- <a href="http://web-dorado.com/wordpress-form-maker-guide-2.html" target="_blank" style="color:blue; text-decoration:none;">More...</a>
30
- </div>
31
- <table width="90%">
32
- <thead>
33
- <tr>
34
- <td colspan="11">
35
- <div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
36
- <a href="http://web-dorado.com/files/fromFormMaker.php" target="_blank"
37
- style="color:red; text-decoration:none;">
38
- <img src="<?php echo plugins_url('images/header.png', __FILE__); ?>" border="0" alt="www.web-dorado.com"
39
- width="215"><br>
40
- Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
41
- </a>
42
- </div>
43
- </td>
44
- </tr>
45
- </thead>
46
- <tr>
47
- <td width="100%"><h2>Adding New Theme</h2></td>
48
- <td align="right"><input type="button" onclick="submitbutton('Save')" value="Save" class="button-secondary action">
49
- </td>
50
- <td align="right"><input type="button" onclick="submitbutton('Apply')" value="Apply"
51
- class="button-secondary action"></td>
52
- <td align="right"><input type="button" onclick="window.location.href='admin.php?page=Form_maker_Themes'"
53
- value="Cancel" class="button-secondary action"></td>
54
- </tr>
55
- </table>
56
- <form action="admin.php?page=Form_maker_Themes" method="post" id="adminForm" name="adminForm">
57
- <table class="admintable">
58
-
59
-
60
- <tr>
61
- <td class="key">
62
- <label for="title">
63
- Title of theme:
64
- </label>
65
- </td>
66
- <td>
67
- <input type="text" name="title" id="title" size="80"/>
68
- </td>
69
- </tr>
70
- <tr>
71
- <td class="key">
72
- <label for="title">
73
- Css:
74
- </label>
75
- </td>
76
- <td>
77
- <textarea name="css" id="css" rows=30 cols=100><?php echo $def_theme->css ?></textarea>
78
- </td>
79
- </tr>
80
- </table>
81
- <input type="hidden" name="option" value="com_formmaker"/>
82
- <input type="hidden" name="task" value=""/>
83
- </form>
84
-
85
-
86
-
87
-
88
-
89
- <?php
90
- }
91
-
92
- function html_show_theme($rows, $pageNav, $sort) {
93
- global $wpdb;
94
- ?>
95
- <script language="javascript">
96
- function ordering(name, as_or_desc) {
97
- document.getElementById('asc_or_desc').value = as_or_desc;
98
- document.getElementById('order_by').value = name;
99
- document.getElementById('admin_form').submit();
100
- }
101
- function doNothing() {
102
- var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
103
- if (keyCode == 13) {
104
-
105
-
106
- if (!e) var e = window.event;
107
-
108
- e.cancelBubble = true;
109
- e.returnValue = false;
110
-
111
- if (e.stopPropagation) {
112
- e.stopPropagation();
113
- e.preventDefault();
114
- }
115
- }
116
- }
117
- </script>
118
- <div style="font-size:14px; font-weight:bold">
119
- <a href="http://web-dorado.com/wordpress-form-maker-guide-2.html" target="_blank" style="color:blue; text-decoration:none;">User Manual</a>
120
- <br />
121
- This section allows you to edit form themes.
122
- <a href="http://web-dorado.com/wordpress-form-maker-guide-2.html" target="_blank" style="color:blue; text-decoration:none;">More...</a>
123
- </div>
124
- <form method="post" onkeypress="doNothing()" action="admin.php?page=Form_maker_Themes" id="admin_form"
125
- name="admin_form">
126
- <table cellspacing="10" width="100%">
127
- <tr>
128
- <td style="width:80px">
129
- <?php echo "<h2>" . 'Themes' . "</h2>"; ?>
130
- </td>
131
- <td style="width:90px; text-align:right;"><p class="submit" style="padding:0px; text-align:left"><input
132
- type="button" value="Add a Theme" name="custom_parametrs"
133
- onclick="window.location.href='admin.php?page=Form_maker_Themes&task=add_theme'"/></p></td>
134
- <td style="text-align:right;font-size:16px;padding:20px; padding-right:50px"></td>
135
- <td colspan="11">
136
- <div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:90%">
137
- <a href="http://web-dorado.com/files/fromFormMaker.php" target="_blank"
138
- style="color:red; text-decoration:none;">
139
- <img src="<?php echo plugins_url('images/header.png', __FILE__); ?>" border="0" alt="www.web-dorado.com"
140
- width="215"><br>
141
- Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
142
- </a>
143
- </div>
144
- </td>
145
- </tr>
146
- </table>
147
- <?php
148
- $serch_value = '';
149
- if (isset($_POST['serch_or_not'])) {
150
- if (esc_html($_POST['serch_or_not']) == "search") {
151
- $serch_value = esc_html($_POST['search_events_by_title']);
152
- }
153
- else {
154
- $serch_value = "";
155
- }
156
- }
157
- $serch_fields = '<div class="alignleft actions" style="width:180px;">
158
- <label for="search_events_by_title" style="font-size:14px">Title: </label>
159
- <input type="text" name="search_events_by_title" value="' . $serch_value . '" id="search_events_by_title" onchange="clear_serch_texts()">
160
- </div>
161
- <div class="alignleft actions">
162
- <input type="button" value="Search" onclick="document.getElementById(\'page_number\').value=\'1\'; document.getElementById(\'serch_or_not\').value=\'search\';
163
- document.getElementById(\'admin_form\').submit();" class="button-secondary action">
164
- <input type="button" value="Reset" onclick="window.location.href=\'admin.php?page=Form_maker_Themes\'" class="button-secondary action">
165
- </div>';
166
- print_html_nav($pageNav['total'], $pageNav['limit'], $serch_fields);
167
-
168
- ?>
169
- <table class="wp-list-table widefat fixed pages" style="width:95%">
170
- <thead>
171
- <TR>
172
- <th scope="col" id="id" class="<?php if ($sort["sortid_by"] == "id")
173
- echo $sort["custom_style"];
174
- else echo $sort["default_style"]; ?>" style=" width:120px"><a
175
- href="javascript:ordering('id',<?php if ($sort["sortid_by"] == "id")
176
- echo $sort["1_or_2"];
177
- else echo "1"; ?>)"><span>ID</span><span class="sorting-indicator"></span></a></th>
178
- <th scope="col" id="title" class="<?php if ($sort["sortid_by"] == "title")
179
- echo $sort["custom_style"];
180
- else echo $sort["default_style"]; ?>" style=""><a
181
- href="javascript:ordering('title',<?php if ($sort["sortid_by"] == "title")
182
- echo $sort["1_or_2"];
183
- else echo "1"; ?>)"><span>Title</span><span class="sorting-indicator"></span></a></th>
184
- <th>Default</th>
185
- <th style="width:80px">Edit</th>
186
- <th style="width:80px">Delete</th>
187
- </TR>
188
- </thead>
189
- <tbody>
190
- <?php for ($i = 0; $i < count($rows); $i++) { ?>
191
- <tr>
192
- <td><?php echo $rows[$i]->id; ?></td>
193
- <td><a
194
- href="admin.php?page=Form_maker_Themes&task=edit_theme&id=<?php echo $rows[$i]->id?>"><?php echo $rows[$i]->title; ?></a>
195
- </td>
196
- <td><a <?php if (!$rows[$i]->default)
197
- echo 'style="color:#C00"'; ?>
198
- href="admin.php?page=Form_maker_Themes&task=default&id=<?php echo $rows[$i]->id?>"><?php if ($rows[$i]->default)
199
- echo "Default";
200
- else echo "Not Default"; ?></a></td>
201
- <td><a href="admin.php?page=Form_maker_Themes&task=edit_theme&id=<?php echo $rows[$i]->id?>">Edit</a></td>
202
- <td><a href="admin.php?page=Form_maker_Themes&task=remove_theme&id=<?php echo $rows[$i]->id?>">Delete</a></td>
203
- </tr>
204
- <?php } ?>
205
- </tbody>
206
- </table>
207
- <input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php if (isset($_POST['asc_or_desc']))
208
- echo esc_html($_POST['asc_or_desc']);?>"/>
209
- <input type="hidden" name="order_by" id="order_by" value="<?php if (isset($_POST['order_by']))
210
- echo esc_html($_POST['order_by']);?>"/>
211
-
212
- <?php
213
- ?>
214
-
215
-
216
- </form>
217
- <?php
218
- }
219
-
220
- function html_edit_theme($row, $id) {
221
- ?>
222
-
223
-
224
- <script>
225
-
226
- function submitbutton(pressbutton) {
227
-
228
- var form = document.adminForm;
229
-
230
- if (pressbutton == 'cancel_themes') {
231
- submitform(pressbutton);
232
- return;
233
- }
234
- if (form.title.value == "") {
235
- alert('Set Theme title');
236
- return;
237
- }
238
-
239
- submitform(pressbutton);
240
- }
241
- function submitform(pressbutton) {
242
- document.getElementById("adminForm").action = document.getElementById("adminForm").action + "&task=" + pressbutton;
243
- document.getElementById("adminForm").submit();
244
- }
245
-
246
- </script>
247
- <table width="90%">
248
- <thead>
249
- <tr>
250
- <td colspan="11">
251
- <div style="text-align:right;font-size:16px;padding:20px; padding-right:50px; width:100%">
252
- <a href="http://web-dorado.com/files/fromFormMaker.php" target="_blank"
253
- style="color:red; text-decoration:none;">
254
- <img src="<?php echo plugins_url('images/header.png', __FILE__); ?>" border="0" alt="www.web-dorado.com"
255
- width="215"><br>
256
- Get the full version&nbsp;&nbsp;&nbsp;&nbsp;
257
- </a>
258
- </div>
259
- </td>
260
- </tr>
261
- </thead>
262
- <tr>
263
- <td width="100%"><h2>Theme <?php echo htmlspecialchars($row->title)?></h2></td>
264
- <td align="right"><input type="button" onclick="submitbutton('Save')" value="Save" class="button-secondary action">
265
- </td>
266
- <td align="right"><input type="button" onclick="submitbutton('Apply')" value="Apply"
267
- class="button-secondary action"></td>
268
- <td align="right"><input type="button" onclick="window.location.href='admin.php?page=Form_maker_Themes'"
269
- value="Cancel" class="button-secondary action"></td>
270
- </tr>
271
- </table>
272
- <form action="admin.php?page=Form_maker_Themes&id=<?php echo $id; ?>" method="post" id="adminForm" name="adminForm">
273
- <table class="admintable">
274
-
275
-
276
- <tr>
277
- <td class="key">
278
- <label for="title">
279
- Title of theme:
280
- </label>
281
- </td>
282
- <td>
283
- <input type="text" name="title" id="title" value="<?php echo htmlspecialchars($row->title) ?>" size="80"/>
284
- </td>
285
- </tr>
286
- <tr>
287
- <td class="key">
288
- <label for="title">
289
- Css:
290
- </label>
291
- </td>
292
- <td>
293
- <textarea name="css" id="css" rows=30 cols=100><?php echo htmlspecialchars($row->css) ?></textarea>
294
- </td>
295
- </tr>
296
- </table>
297
- <input type="hidden" name="option" value="com_formmaker"/>
298
- <input type="hidden" name="id" value="<?php echo $row->id?>"/>
299
- <input type="hidden" name="cid[]" value="<?php echo $row->id; ?>"/>
300
- <input type="hidden" name="task" value=""/>
301
- </form>
302
-
303
-
304
- <?php
305
- }
306
-
307
- function cheched($row, $y) {
308
- if ($row == $y) {
309
- echo'checked="checked"';
310
- }
311
- }
312
-
313
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/controllers/FMControllerBlocked_ips_fm.php ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMControllerBlocked_ips_fm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $task = WDW_FM_Library::get('task');
23
+ $id = WDW_FM_Library::get('current_id', 0);
24
+ $message = WDW_FM_Library::get('message');
25
+ echo WDW_FM_Library::message_id($message);
26
+ // $task = ((isset($_POST['task'])) ? esc_html($_POST['task']) : '');
27
+ // $id = ((isset($_POST['current_id'])) ? esc_html($_POST['current_id']) : 0);
28
+ if (method_exists($this, $task)) {
29
+ $this->$task($id);
30
+ }
31
+ else {
32
+ $this->display();
33
+ }
34
+ }
35
+
36
+ public function display() {
37
+ require_once WD_FM_DIR . "/admin/models/FMModelBlocked_ips_fm.php";
38
+ $model = new FMModelBlocked_ips_fm();
39
+
40
+ require_once WD_FM_DIR . "/admin/views/FMViewBlocked_ips_fm.php";
41
+ $view = new FMViewBlocked_ips_fm($model);
42
+ $view->display();
43
+ }
44
+
45
+ public function save() {
46
+ $message = $this->save_db();
47
+ // $this->display();
48
+ $page = WDW_FM_Library::get('page');
49
+ WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
50
+ }
51
+
52
+ public function save_db() {
53
+ global $wpdb;
54
+ $id = (isset($_POST['current_id']) ? (int) $_POST['current_id'] : 0);
55
+ $ip = (isset($_POST['ip']) ? esc_html(stripslashes($_POST['ip'])) : '');
56
+ if ($id != 0) {
57
+ $save = $wpdb->update($wpdb->prefix . 'formmaker_blocked', array(
58
+ 'ip' => $ip,
59
+ ), array('id' => $id));
60
+ }
61
+ else {
62
+ $save = $wpdb->insert($wpdb->prefix . 'formmaker_blocked', array(
63
+ 'ip' => $ip,
64
+ ), array(
65
+ '%s',
66
+ ));
67
+ }
68
+ if ($save !== FALSE) {
69
+ $message = 1;
70
+ }
71
+ else {
72
+ $message = 2;
73
+ }
74
+ }
75
+
76
+ public function save_all() {
77
+ global $wpdb;
78
+ $flag = FALSE;
79
+ $ips_id_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker_blocked');
80
+ foreach ($ips_id_col as $ip_id) {
81
+ if (isset($_POST['ip' . $ip_id])) {
82
+ $ip = esc_html(stripslashes($_POST['ip' . $ip_id]));
83
+ if ($ip == '') {
84
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $ip_id));
85
+ }
86
+ else {
87
+ $flag = TRUE;
88
+ $wpdb->update($wpdb->prefix . 'formmaker_blocked', array(
89
+ 'ip' => $ip,
90
+ ), array('id' => $ip_id));
91
+ }
92
+ }
93
+ }
94
+ if ($flag) {
95
+ $message = 1;
96
+ }
97
+ // $this->display();
98
+ $page = WDW_FM_Library::get('page');
99
+ WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
100
+ }
101
+
102
+ public function delete($id) {
103
+ global $wpdb;
104
+ $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $id);
105
+ if ($wpdb->query($query)) {
106
+ $message = 3;
107
+ }
108
+ else {
109
+ $message = 2;
110
+ }
111
+ // $this->display();
112
+ $page = WDW_FM_Library::get('page');
113
+ WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
114
+ }
115
+
116
+ public function delete_all() {
117
+ global $wpdb;
118
+ $flag = FALSE;
119
+ $ips_id_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker_blocked');
120
+ foreach ($ips_id_col as $ip_id) {
121
+ if (isset($_POST['check_' . $ip_id])) {
122
+ $flag = TRUE;
123
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $ip_id));
124
+ }
125
+ }
126
+ if ($flag) {
127
+ $message = 5;
128
+ }
129
+ else {
130
+ $message = 2;
131
+ }
132
+ // $this->display();
133
+ $page = WDW_FM_Library::get('page');
134
+ WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
135
+ }
136
+
137
+ ////////////////////////////////////////////////////////////////////////////////////////
138
+ // Getters & Setters //
139
+ ////////////////////////////////////////////////////////////////////////////////////////
140
+ ////////////////////////////////////////////////////////////////////////////////////////
141
+ // Private Methods //
142
+ ////////////////////////////////////////////////////////////////////////////////////////
143
+ ////////////////////////////////////////////////////////////////////////////////////////
144
+ // Listeners //
145
+ ////////////////////////////////////////////////////////////////////////////////////////
146
+ }
admin/controllers/FMControllerFeatured_plugins_fm.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMControllerFeatured_plugins_fm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $task = ((isset($_POST['task'])) ? esc_html(stripslashes($_POST['task'])) : '');
23
+ if (method_exists($this, $task)) {
24
+ $this->$task($id);
25
+ }
26
+ else {
27
+ $this->display();
28
+ }
29
+ }
30
+
31
+ public function display() {
32
+ require_once WD_FM_DIR . "/admin/models/FMModelFeatured_plugins_fm.php";
33
+ $model = new FMModelFeatured_plugins_fm();
34
+
35
+ require_once WD_FM_DIR . "/admin/views/FMViewFeatured_plugins_fm.php";
36
+ $view = new FMViewFeatured_plugins_fm($model);
37
+ $view->display();
38
+ }
39
+
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Getters & Setters //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
+ ////////////////////////////////////////////////////////////////////////////////////////
44
+ // Private Methods //
45
+ ////////////////////////////////////////////////////////////////////////////////////////
46
+ ////////////////////////////////////////////////////////////////////////////////////////
47
+ // Listeners //
48
+ ////////////////////////////////////////////////////////////////////////////////////////
49
+ }
admin/controllers/FMControllerFormMakerEditCSS.php ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMControllerFormMakerEditCSS {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $task = ((isset($_POST['task'])) ? esc_html($_POST['task']) : '');
23
+ $id = ((isset($_POST['current_id'])) ? esc_html($_POST['current_id']) : 0);
24
+ if (method_exists($this, $task)) {
25
+ $this->$task($id);
26
+ }
27
+ else {
28
+ $this->display();
29
+ }
30
+ }
31
+
32
+ public function display() {
33
+ require_once WD_FM_DIR . "/admin/models/FMModelFormMakerEditCSS.php";
34
+ $model = new FMModelFormMakerEditCSS();
35
+
36
+ require_once WD_FM_DIR . "/admin/views/FMViewFormMakerEditCSS.php";
37
+ $view = new FMViewFormMakerEditCSS($model);
38
+ $view->display();
39
+ }
40
+
41
+ public function save() {
42
+ $this->update_db();
43
+ }
44
+
45
+ public function apply() {
46
+ $this->update_db();
47
+ $this->display();
48
+ }
49
+
50
+ public function save_as_new() {
51
+ $this->insert_db();
52
+ }
53
+
54
+ public function insert_db() {
55
+ global $wpdb;
56
+ $title = (isset($_POST['title']) ? esc_html(stripslashes( $_POST['title'])) : '');
57
+ $css = (isset($_POST['css']) ? stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST['css'])) : '');
58
+ $default = (isset($_POST['default']) ? esc_html(stripslashes( $_POST['default'])) : 0);
59
+ $save = $wpdb->insert($wpdb->prefix . 'formmaker_themes', array(
60
+ 'title' => $title,
61
+ 'css' => $css,
62
+ 'default' => $default,
63
+ ), array(
64
+ '%s',
65
+ '%s',
66
+ '%d',
67
+ ));
68
+ }
69
+
70
+ public function update_db() {
71
+ global $wpdb;
72
+ $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes( $_POST['current_id'])) : 0);
73
+ $title = (isset($_POST['title']) ? esc_html(stripslashes( $_POST['title'])) : '');
74
+ $css = (isset($_POST['css']) ? stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST['css'])) : '');
75
+ $default = (isset($_POST['default']) ? esc_html(stripslashes( $_POST['default'])) : 0);
76
+ $save = $wpdb->update($wpdb->prefix . 'formmaker_themes', array(
77
+ 'title' => $title,
78
+ 'css' => $css,
79
+ 'default' => $default,
80
+ ), array('id' => $id));
81
+ if ($save !== FALSE) {
82
+ echo WDW_FM_Library::message('Item Succesfully Saved.', 'updated');
83
+ }
84
+ else {
85
+ echo WDW_FM_Library::message('Error. Please install plugin again.', 'error');
86
+ }
87
+ }
88
+
89
+ ////////////////////////////////////////////////////////////////////////////////////////
90
+ // Getters & Setters //
91
+ ////////////////////////////////////////////////////////////////////////////////////////
92
+ ////////////////////////////////////////////////////////////////////////////////////////
93
+ // Private Methods //
94
+ ////////////////////////////////////////////////////////////////////////////////////////
95
+ ////////////////////////////////////////////////////////////////////////////////////////
96
+ // Listeners //
97
+ ////////////////////////////////////////////////////////////////////////////////////////
98
+ }
admin/controllers/FMControllerFormMakerPreview.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMControllerFormMakerPreview {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $this->display();
23
+ }
24
+
25
+ public function display() {
26
+ require_once WD_FM_DIR . "/admin/models/FMModelFormMakerPreview.php";
27
+ $model = new FMModelFormMakerPreview();
28
+
29
+ require_once WD_FM_DIR . "/admin/views/FMViewFormMakerPreview.php";
30
+ $view = new FMViewFormMakerPreview($model);
31
+ $view->display();
32
+ }
33
+
34
+ ////////////////////////////////////////////////////////////////////////////////////////
35
+ // Getters & Setters //
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
+ ////////////////////////////////////////////////////////////////////////////////////////
38
+ // Private Methods //
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Listeners //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
+ }
admin/controllers/FMControllerFormmakerwdcaptcha.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMControllerFormmakerwdcaptcha {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $this->display();
23
+ }
24
+
25
+ public function display() {
26
+ require_once WD_FM_DIR . "/admin/models/FMModelFormmakerwdcaptcha.php";
27
+ $model = new FMModelFormmakerwdcaptcha();
28
+
29
+ require_once WD_FM_DIR . "/admin/views/FMViewFormmakerwdcaptcha.php";
30
+ $view = new FMViewFormmakerwdcaptcha($model);
31
+ $view->display();
32
+ }
33
+
34
+ ////////////////////////////////////////////////////////////////////////////////////////
35
+ // Getters & Setters //
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
+ ////////////////////////////////////////////////////////////////////////////////////////
38
+ // Private Methods //
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Listeners //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
+ }
admin/controllers/FMControllerFormmakerwindow.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMControllerFormmakerwindow {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $this->display();
23
+ }
24
+
25
+ public function display() {
26
+ require_once WD_FM_DIR . "/admin/models/FMModelFormmakerwindow.php";
27
+ $model = new FMModelFormmakerwindow();
28
+
29
+ require_once WD_FM_DIR . "/admin/views/FMViewFormmakerwindow.php";
30
+ $view = new FMViewFormmakerwindow($model);
31
+ $view->display();
32
+ }
33
+
34
+ ////////////////////////////////////////////////////////////////////////////////////////
35
+ // Getters & Setters //
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
+ ////////////////////////////////////////////////////////////////////////////////////////
38
+ // Private Methods //
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Listeners //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
+ }
admin/controllers/FMControllerFromeditcountryinpopup.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMControllerFromeditcountryinpopup {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $this->display();
23
+ }
24
+
25
+ public function display() {
26
+ require_once WD_FM_DIR . "/admin/models/FMModelFromeditcountryinpopup.php";
27
+ $model = new FMModelFromeditcountryinpopup();
28
+
29
+ require_once WD_FM_DIR . "/admin/views/FMViewFromeditcountryinpopup.php";
30
+ $view = new FMViewFromeditcountryinpopup($model);
31
+ $view->display();
32
+ }
33
+
34
+ ////////////////////////////////////////////////////////////////////////////////////////
35
+ // Getters & Setters //
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
+ ////////////////////////////////////////////////////////////////////////////////////////
38
+ // Private Methods //
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Listeners //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
+ }
admin/controllers/FMControllerFrommapeditinpopup.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMControllerFrommapeditinpopup {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $this->display();
23
+ }
24
+
25
+ public function display() {
26
+ require_once WD_FM_DIR . "/admin/models/FMModelFrommapeditinpopup.php";
27
+ $model = new FMModelFrommapeditinpopup();
28
+
29
+ require_once WD_FM_DIR . "/admin/views/FMViewFrommapeditinpopup.php";
30
+ $view = new FMViewFrommapeditinpopup($model);
31
+ $view->display();
32
+ }
33
+
34
+ ////////////////////////////////////////////////////////////////////////////////////////
35
+ // Getters & Setters //
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
+ ////////////////////////////////////////////////////////////////////////////////////////
38
+ // Private Methods //
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Listeners //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
+ }
admin/controllers/FMControllerGenerete_csv.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMControllerGenerete_csv {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $this->display();
23
+ }
24
+
25
+ public function display() {
26
+ require_once WD_FM_DIR . "/admin/models/FMModelGenerete_csv.php";
27
+ $model = new FMModelGenerete_csv();
28
+
29
+ require_once WD_FM_DIR . "/admin/views/FMViewGenerete_csv.php";
30
+ $view = new FMViewGenerete_csv($model);
31
+ $view->display();
32
+ }
33
+
34
+ ////////////////////////////////////////////////////////////////////////////////////////
35
+ // Getters & Setters //
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
+ ////////////////////////////////////////////////////////////////////////////////////////
38
+ // Private Methods //
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Listeners //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
+ }
admin/controllers/FMControllerGenerete_xml.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMControllerGenerete_xml {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $this->display();
23
+ }
24
+
25
+ public function display() {
26
+ require_once WD_FM_DIR . "/admin/models/FMModelGenerete_xml.php";
27
+ $model = new FMModelGenerete_xml();
28
+
29
+ require_once WD_FM_DIR . "/admin/views/FMViewGenerete_xml.php";
30
+ $view = new FMViewGenerete_xml($model);
31
+ $view->display();
32
+ }
33
+
34
+ ////////////////////////////////////////////////////////////////////////////////////////
35
+ // Getters & Setters //
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
+ ////////////////////////////////////////////////////////////////////////////////////////
38
+ // Private Methods //
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Listeners //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
+ }
admin/controllers/FMControllerLicensing_fm.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMControllerLicensing_fm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $task = ((isset($_POST['task'])) ? esc_html(stripslashes($_POST['task'])) : '');
23
+ if (method_exists($this, $task)) {
24
+ $this->$task($id);
25
+ }
26
+ else {
27
+ $this->display();
28
+ }
29
+ }
30
+
31
+ public function display() {
32
+ require_once WD_FM_DIR . "/admin/models/FMModelLicensing_fm.php";
33
+ $model = new FMModelLicensing_fm();
34
+
35
+ require_once WD_FM_DIR . "/admin/views/FMViewLicensing_fm.php";
36
+ $view = new FMViewLicensing_fm($model);
37
+ $view->display();
38
+ }
39
+
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Getters & Setters //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
+ ////////////////////////////////////////////////////////////////////////////////////////
44
+ // Private Methods //
45
+ ////////////////////////////////////////////////////////////////////////////////////////
46
+ ////////////////////////////////////////////////////////////////////////////////////////
47
+ // Listeners //
48
+ ////////////////////////////////////////////////////////////////////////////////////////
49
+ }
admin/controllers/FMControllerManage_fm.php ADDED
@@ -0,0 +1,905 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMControllerManage_fm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ // $task = ((isset($_POST['task'])) ? esc_html($_POST['task']) : '');
23
+ // $id = ((isset($_POST['current_id'])) ? esc_html($_POST['current_id']) : 0);
24
+ $task = WDW_FM_Library::get('task');
25
+ $id = WDW_FM_Library::get('current_id', 0);
26
+ $message = WDW_FM_Library::get('message');
27
+ echo WDW_FM_Library::message_id($message);
28
+ if (method_exists($this, $task)) {
29
+ $this->$task($id);
30
+ }
31
+ else {
32
+ $this->display();
33
+ }
34
+ }
35
+
36
+ public function display() {
37
+ require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
38
+ $model = new FMModelManage_fm();
39
+
40
+ require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
41
+ $view = new FMViewManage_fm($model);
42
+ $view->display();
43
+ }
44
+
45
+ public function add() {
46
+ require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
47
+ $model = new FMModelManage_fm();
48
+
49
+ require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
50
+ $view = new FMViewManage_fm($model);
51
+ $view->edit(0);
52
+ }
53
+
54
+ public function edit() {
55
+ require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
56
+ $model = new FMModelManage_fm();
57
+
58
+ require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
59
+ $view = new FMViewManage_fm($model);
60
+ // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
61
+ $id = WDW_FM_Library::get('current_id', 0);
62
+ $view->edit($id);
63
+ }
64
+
65
+ public function edit_old() {
66
+ require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
67
+ $model = new FMModelManage_fm();
68
+
69
+ require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
70
+ $view = new FMViewManage_fm($model);
71
+ // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
72
+ $id = WDW_FM_Library::get('current_id', 0);
73
+ // var_dump('s');
74
+ $view->edit_old($id);
75
+ }
76
+
77
+ public function form_options_old() {
78
+ if (!isset($_GET['task'])) {
79
+ $this->save_db();
80
+ }
81
+ require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
82
+ $model = new FMModelManage_fm();
83
+
84
+ require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
85
+ $view = new FMViewManage_fm($model);
86
+ // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
87
+ global $wpdb;
88
+ $id = WDW_FM_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
89
+ $view->form_options_old($id);
90
+ }
91
+
92
+ public function save_options_old() {
93
+ $message = $this->save_db_options_old();
94
+ // $this->edit_old();
95
+ $page = WDW_FM_Library::get('page');
96
+ $current_id = WDW_FM_Library::get('current_id', 0);
97
+ WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'edit_old', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
98
+ }
99
+
100
+ public function apply_options_old() {
101
+ $message = $this->save_db_options_old();
102
+ require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
103
+ $model = new FMModelManage_fm();
104
+
105
+ require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
106
+ $view = new FMViewManage_fm($model);
107
+ // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
108
+ // $view->form_options_old($id);
109
+ $page = WDW_FM_Library::get('page');
110
+ $current_id = WDW_FM_Library::get('current_id', 0);
111
+ $fieldset_id = WDW_FM_Library::get('fieldset_id', 'general');
112
+ WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'form_options_old', 'current_id' => $current_id, 'message' => $message, 'fieldset_id' => $fieldset_id), admin_url('admin.php')));
113
+ }
114
+
115
+ public function save_db_options_old() {
116
+ $javascript = "// Before the form is loaded.
117
+ function before_load() {
118
+
119
+ }
120
+ // Before form submit.
121
+ function before_submit() {
122
+
123
+ }
124
+ // Before form reset.
125
+ function before_reset() {
126
+
127
+ }";
128
+ global $wpdb;
129
+ // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
130
+ $id = WDW_FM_Library::get('current_id', 0);
131
+ $mail = (isset($_POST['mail']) ? esc_html(stripslashes($_POST['mail'])) : '');
132
+ $theme = (isset($_POST['theme']) ? esc_html(stripslashes($_POST['theme'])) : 1);
133
+ $javascript = (isset($_POST['javascript']) ? stripslashes($_POST['javascript']) : $javascript);
134
+ $script1 = (isset($_POST['script1']) ? esc_html(stripslashes($_POST['script1'])) : '');
135
+ $script2 = (isset($_POST['script2']) ? esc_html(stripslashes($_POST['script2'])) : '');
136
+ $script_user1 = (isset($_POST['script_user1']) ? esc_html(stripslashes($_POST['script_user1'])) : '');
137
+ $script_user2 = (isset($_POST['script_user2']) ? esc_html(stripslashes($_POST['script_user2'])) : '');
138
+ $submit_text = (isset($_POST['submit_text']) ? esc_html(stripslashes($_POST['submit_text'])) : '');
139
+ $url = (isset($_POST['url']) ? esc_html(stripslashes($_POST['url'])) : '');
140
+ $script_mail = (isset($_POST['script_mail']) ? esc_html(stripslashes($_POST['script_mail'])) : '%all%');
141
+ $script_mail_user = (isset($_POST['script_mail_user']) ? esc_html(stripslashes($_POST['script_mail_user'])) : '%all%');
142
+ $label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
143
+ $tax = (isset($_POST['tax']) ? esc_html(stripslashes($_POST['tax'])) : 0);
144
+ $payment_currency = (isset($_POST['payment_currency']) ? esc_html(stripslashes($_POST['payment_currency'])) : '');
145
+ $paypal_email = (isset($_POST['paypal_email']) ? esc_html(stripslashes($_POST['paypal_email'])) : '');
146
+ $checkout_mode = (isset($_POST['checkout_mode']) ? esc_html(stripslashes($_POST['checkout_mode'])) : 'testmode');
147
+ $paypal_mode = (isset($_POST['paypal_mode']) ? esc_html(stripslashes($_POST['paypal_mode'])) : 0);
148
+ $from_mail = (isset($_POST['from_mail']) ? esc_html(stripslashes($_POST['from_mail'])) : '');
149
+ $from_name = (isset($_POST['from_name']) ? esc_html(stripslashes($_POST['from_name'])) : '');
150
+ if (isset($_POST['submit_text_type'])) {
151
+ $submit_text_type = esc_html(stripslashes($_POST['submit_text_type']));
152
+ if ($submit_text_type == 5) {
153
+ $article_id = (isset($_POST['page_name']) ? esc_html(stripslashes($_POST['page_name'])) : 0);
154
+ }
155
+ else {
156
+ $article_id = (isset($_POST['post_name']) ? esc_html(stripslashes($_POST['post_name'])) : 0);
157
+ }
158
+ }
159
+ else {
160
+ $submit_text_type = 0;
161
+ $article_id = 0;
162
+ }
163
+ $save = $wpdb->update($wpdb->prefix . 'formmaker', array(
164
+ 'mail' => $mail,
165
+ 'theme' => $theme,
166
+ 'javascript' => $javascript,
167
+ 'submit_text' => $submit_text,
168
+ 'url' => $url,
169
+ 'submit_text_type' => $submit_text_type,
170
+ 'script_mail' => $script_mail,
171
+ 'script_mail_user' => $script_mail_user,
172
+ 'article_id' => $article_id,
173
+ 'paypal_mode' => $paypal_mode,
174
+ 'checkout_mode' => $checkout_mode,
175
+ 'paypal_email' => $paypal_email,
176
+ 'payment_currency' => $payment_currency,
177
+ 'tax' => $tax,
178
+ 'from_mail' => $from_mail,
179
+ 'from_name' => $from_name,
180
+ ), array('id' => $id));
181
+ if ($save !== FALSE) {
182
+ return 8;
183
+ }
184
+ else {
185
+ return 2;
186
+ }
187
+ }
188
+
189
+ public function cancel_options_old() {
190
+ $this->edit_old();
191
+ }
192
+
193
+ public function form_layout() {
194
+ if (!isset($_GET['task'])) {
195
+ $this->save_db();
196
+ }
197
+ require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
198
+ $model = new FMModelManage_fm();
199
+
200
+ require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
201
+ $view = new FMViewManage_fm($model);
202
+ // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
203
+ global $wpdb;
204
+ $id = WDW_FM_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
205
+ $view->form_layout($id);
206
+ }
207
+
208
+ public function save_layout() {
209
+ $message = $this->save_db_layout();
210
+ // $this->edit();
211
+ $page = WDW_FM_Library::get('page');
212
+ $current_id = WDW_FM_Library::get('current_id', 0);
213
+ WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
214
+ }
215
+
216
+ public function apply_layout() {
217
+ $message = $this->save_db_layout();
218
+ require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
219
+ $model = new FMModelManage_fm();
220
+
221
+ require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
222
+ $view = new FMViewManage_fm($model);
223
+ // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
224
+ $page = WDW_FM_Library::get('page');
225
+ $current_id = WDW_FM_Library::get('current_id', 0);
226
+ WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'form_layout', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
227
+ // $view->form_layout($id);
228
+ }
229
+
230
+ public function save_db_layout() {
231
+ global $wpdb;
232
+ // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
233
+ $id = WDW_FM_Library::get('current_id', 0);
234
+ $custom_front = (isset($_POST['custom_front']) ? stripslashes($_POST['custom_front']) : '');
235
+ $autogen_layout = (isset($_POST['autogen_layout']) ? 1 : 0);
236
+ $save = $wpdb->update($wpdb->prefix . 'formmaker', array(
237
+ 'custom_front' => $custom_front,
238
+ 'autogen_layout' => $autogen_layout
239
+ ), array('id' => $id));
240
+ if ($save !== FALSE) {
241
+ return 1;
242
+ }
243
+ else {
244
+ return 2;
245
+ }
246
+ }
247
+
248
+ public function form_options() {
249
+ if (!isset($_GET['task'])) {
250
+ $this->save_db();
251
+ }
252
+ require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
253
+ $model = new FMModelManage_fm();
254
+
255
+ require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
256
+ $view = new FMViewManage_fm($model);
257
+ // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
258
+ global $wpdb;
259
+ $id = WDW_FM_Library::get('current_id', $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker"));
260
+ $view->form_options($id);
261
+ }
262
+
263
+ public function save_options() {
264
+ $message = $this->save_db_options();
265
+ // $this->edit();
266
+ $page = WDW_FM_Library::get('page');
267
+ $current_id = WDW_FM_Library::get('current_id', 0);
268
+ WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
269
+ }
270
+
271
+ public function apply_options() {
272
+ $message = $this->save_db_options();
273
+ require_once WD_FM_DIR . "/admin/models/FMModelManage_fm.php";
274
+ $model = new FMModelManage_fm();
275
+
276
+ require_once WD_FM_DIR . "/admin/views/FMViewManage_fm.php";
277
+ $view = new FMViewManage_fm($model);
278
+ // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
279
+ // $view->form_options($id);
280
+ $page = WDW_FM_Library::get('page');
281
+ $current_id = WDW_FM_Library::get('current_id', 0);
282
+ $fieldset_id = WDW_FM_Library::get('fieldset_id', 'general');
283
+ WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'form_options', 'current_id' => $current_id, 'message' => $message, 'fieldset_id' => $fieldset_id), admin_url('admin.php')));
284
+ }
285
+
286
+ public function cancel_options() {
287
+ $this->edit();
288
+ }
289
+
290
+ public function save_db_options() {
291
+ $javascript = "// Before the form is loaded.
292
+ function before_load() {
293
+
294
+ }
295
+ // Before form submit.
296
+ function before_submit() {
297
+
298
+ }
299
+ // Before form reset.
300
+ function before_reset() {
301
+
302
+ }";
303
+ global $wpdb;
304
+ // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
305
+ $id = WDW_FM_Library::get('current_id', 0);
306
+ $published = (isset($_POST['published']) ? esc_html(stripslashes($_POST['published'])) : 1);
307
+ $savedb = (isset($_POST['savedb']) ? esc_html(stripslashes($_POST['savedb'])) : 1);
308
+ $theme = ((isset($_POST['theme']) && (esc_html($_POST['theme']) != 0)) ? esc_html(stripslashes($_POST['theme'])) : $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker_themes"));
309
+ $requiredmark = (isset($_POST['requiredmark']) ? esc_html(stripslashes($_POST['requiredmark'])) : '*');
310
+ $sendemail = (isset($_POST['sendemail']) ? esc_html(stripslashes($_POST['sendemail'])) : 1);
311
+ $mail = (isset($_POST['mail']) ? esc_html(stripslashes($_POST['mail'])) : '');
312
+ $from_mail = (isset($_POST['from_mail']) ? esc_html(stripslashes($_POST['from_mail'])) : '');
313
+ $from_name = (isset($_POST['from_name']) ? esc_html(stripslashes($_POST['from_name'])) : '');
314
+ $reply_to = (isset($_POST['reply_to']) ? esc_html(stripslashes($_POST['reply_to'])) : '');
315
+ if ($from_mail == "other") {
316
+ $from_mail = (isset($_POST['mail_from_other']) ? esc_html(stripslashes($_POST['mail_from_other'])) : '');
317
+ }
318
+ if ($reply_to == "other") {
319
+ $reply_to = (isset($_POST['reply_to_other']) ? esc_html(stripslashes($_POST['reply_to_other'])) : '');
320
+ }
321
+ $script_mail = (isset($_POST['script_mail']) ? esc_html(stripslashes($_POST['script_mail'])) : '%all%');
322
+ $mail_from_user = (isset($_POST['mail_from_user']) ? esc_html(stripslashes($_POST['mail_from_user'])) : '');
323
+ $mail_from_name_user = (isset($_POST['mail_from_name_user']) ? esc_html(stripslashes($_POST['mail_from_name_user'])) : '');
324
+ $reply_to_user = (isset($_POST['reply_to_user']) ? esc_html(stripslashes($_POST['reply_to_user'])) : '');
325
+ $script_mail_user = (isset($_POST['script_mail_user']) ? esc_html(stripslashes($_POST['script_mail_user'])) : '%all%');
326
+ $submit_text = (isset($_POST['submit_text']) ? esc_html(stripslashes($_POST['submit_text'])) : '');
327
+ $url = (isset($_POST['url']) ? esc_html(stripslashes($_POST['url'])) : '');
328
+ $tax = (isset($_POST['tax']) ? esc_html(stripslashes($_POST['tax'])) : 0);
329
+ $payment_currency = (isset($_POST['payment_currency']) ? esc_html(stripslashes($_POST['payment_currency'])) : '');
330
+ $paypal_email = (isset($_POST['paypal_email']) ? esc_html(stripslashes($_POST['paypal_email'])) : '');
331
+ $checkout_mode = (isset($_POST['checkout_mode']) ? esc_html(stripslashes($_POST['checkout_mode'])) : 'testmode');
332
+ $paypal_mode = (isset($_POST['paypal_mode']) ? esc_html(stripslashes($_POST['paypal_mode'])) : 0);
333
+ $javascript = (isset($_POST['javascript']) ? stripslashes($_POST['javascript']) : $javascript);
334
+ $send_to = '';
335
+ for ($i = 0; $i < 20; $i++) {
336
+ if (isset($_POST['send_to' . $i])) {
337
+ $send_to .= '*' . esc_html(stripslashes($_POST['send_to' . $i])) . '*';
338
+ }
339
+ }
340
+ if (isset($_POST['submit_text_type'])) {
341
+ $submit_text_type = esc_html(stripslashes($_POST['submit_text_type']));
342
+ if ($submit_text_type == 5) {
343
+ $article_id = (isset($_POST['page_name']) ? esc_html(stripslashes($_POST['page_name'])) : 0);
344
+ }
345
+ else {
346
+ $article_id = (isset($_POST['post_name']) ? esc_html(stripslashes($_POST['post_name'])) : 0);
347
+ }
348
+ }
349
+ else {
350
+ $submit_text_type = 0;
351
+ $article_id = 0;
352
+ }
353
+ $save = $wpdb->update($wpdb->prefix . 'formmaker', array(
354
+ 'published' => $published,
355
+ 'savedb' => $savedb,
356
+ 'theme' => $theme,
357
+ 'requiredmark' => $requiredmark,
358
+ 'sendemail' => $sendemail,
359
+ 'mail' => $mail,
360
+ 'from_mail' => $from_mail,
361
+ 'from_name' => $from_name,
362
+ 'reply_to' => $reply_to,
363
+ 'script_mail' => $script_mail,
364
+ 'mail_from_user' => $mail_from_user,
365
+ 'mail_from_name_user' => $mail_from_name_user,
366
+ 'reply_to_user' => $reply_to_user,
367
+ 'script_mail_user' => $script_mail_user,
368
+ 'submit_text' => $submit_text,
369
+ 'url' => $url,
370
+ 'submit_text_type' => $submit_text_type,
371
+ 'article_id' => $article_id,
372
+ 'tax' => $tax,
373
+ 'payment_currency' => $payment_currency,
374
+ 'paypal_email' => $paypal_email,
375
+ 'checkout_mode' => $checkout_mode,
376
+ 'paypal_mode' => $paypal_mode,
377
+ 'javascript' => $javascript,
378
+ 'send_to' => $send_to,
379
+ ), array('id' => $id));
380
+ if ($save !== FALSE) {
381
+ return 8;
382
+ }
383
+ else {
384
+ return 2;
385
+ }
386
+ }
387
+
388
+ public function save_as_copy_old() {
389
+ $message = $this->save_db_as_copy_old();
390
+ // $this->display();
391
+ $page = WDW_FM_Library::get('page');
392
+ WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
393
+ }
394
+
395
+ public function save_old() {
396
+ $message = $this->save_db_old();
397
+ // $this->display();
398
+ $page = WDW_FM_Library::get('page');
399
+ WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
400
+ }
401
+
402
+ public function apply_old() {
403
+ global $wpdb;
404
+ $message = $this->save_db_old();
405
+ // $this->edit_old();
406
+ $id = (int) $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
407
+ $current_id = WDW_FM_Library::get('current_id', $id);
408
+ $page = WDW_FM_Library::get('page');
409
+ WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'edit_old', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
410
+ }
411
+
412
+ public function save_db_old() {
413
+ global $wpdb;
414
+ // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
415
+ $id = WDW_FM_Library::get('current_id', 0);
416
+ $title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
417
+ $form = (isset($_POST['form']) ? stripslashes($_POST['form']) : '');
418
+ $form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
419
+ $counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
420
+ $label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
421
+ $label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
422
+ $pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
423
+ $show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
424
+ $show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
425
+ $public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
426
+ $private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
427
+ $recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
428
+
429
+ $save = $wpdb->update($wpdb->prefix . 'formmaker', array(
430
+ 'title' => $title,
431
+ 'form' => $form,
432
+ 'form_front' => $form_front,
433
+ 'counter' => $counter,
434
+ 'label_order' => $label_order,
435
+ 'label_order_current' => $label_order_current,
436
+ 'pagination' => $pagination,
437
+ 'show_title' => $show_title,
438
+ 'show_numbers' => $show_numbers,
439
+ 'public_key' => $public_key,
440
+ 'private_key' => $private_key,
441
+ 'recaptcha_theme' => $recaptcha_theme,
442
+ ), array('id' => $id));
443
+ if ($save !== FALSE) {
444
+ return 1;
445
+ }
446
+ else {
447
+ return 2;
448
+ }
449
+ }
450
+
451
+ public function save_db_as_copy_old() {
452
+ global $wpdb;
453
+ // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
454
+ $id = WDW_FM_Library::get('current_id', 0);
455
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
456
+ $title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
457
+ $form = (isset($_POST['form']) ? stripslashes($_POST['form']) : '');
458
+ $form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
459
+ $counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
460
+ $label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
461
+ $pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
462
+ $show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
463
+ $show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
464
+ $public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
465
+ $private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
466
+ $recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
467
+
468
+ $save = $wpdb->insert($wpdb->prefix . 'formmaker', array(
469
+ 'title' => $title,
470
+ 'mail' => $row->mail,
471
+ 'form' => $form,
472
+ 'form_front' => $form_front,
473
+ 'theme' => $row->theme,
474
+ 'counter' => $counter,
475
+ 'label_order' => $label_order,
476
+ 'pagination' => $pagination,
477
+ 'show_title' => $show_title,
478
+ 'show_numbers' => $show_numbers,
479
+ 'public_key' => $public_key,
480
+ 'private_key' => $private_key,
481
+ 'recaptcha_theme' => $recaptcha_theme,
482
+ 'javascript' => $row->javascript,
483
+ 'script1' => $row->script1,
484
+ 'script2' => $row->script2,
485
+ 'script_user1' => $row->script_user1,
486
+ 'script_user2' => $row->script_user2,
487
+ 'submit_text' => $row->submit_text,
488
+ 'url' => $row->url,
489
+ 'article_id' => $row->article_id,
490
+ 'submit_text_type' => $row->submit_text_type,
491
+ 'script_mail' => $row->script_mail,
492
+ 'script_mail_user' => $row->script_mail_user,
493
+ 'paypal_mode' => $row->paypal_mode,
494
+ 'checkout_mode' => $row->checkout_mode,
495
+ 'paypal_email' => $row->paypal_email,
496
+ 'payment_currency' => $row->payment_currency,
497
+ 'tax' => $row->tax,
498
+ 'label_order_current' => $row->label_order_current,
499
+ 'from_mail' => $row->from_mail,
500
+ 'from_name' => $row->from_name,
501
+ 'reply_to_user' => $row->reply_to_user,
502
+ 'mail_from_name_user' => $row->mail_from_name_user,
503
+ 'mail_from_user' => $row->mail_from_user,
504
+ 'custom_front' => $row->custom_front,
505
+ 'autogen_layout' => $row->autogen_layout,
506
+ 'send_to' => $row->send_to,
507
+ 'reply_to' => $row->reply_to,
508
+ 'requiredmark' => $row->requiredmark,
509
+ 'sendemail' => $row->sendemail,
510
+ 'savedb' => $row->savedb,
511
+ 'form_fields' => $row->form_fields,
512
+ 'published' => $row->published
513
+ ), array(
514
+ '%s',
515
+ '%s',
516
+ '%s',
517
+ '%s',
518
+ '%d',
519
+ '%d',
520
+ '%s',
521
+ '%s',
522
+ '%s',
523
+ '%s',
524
+ '%s',
525
+ '%s',
526
+ '%s',
527
+ '%s',
528
+ '%s',
529
+ '%s',
530
+ '%s',
531
+ '%s',
532
+ '%s',
533
+ '%s',
534
+ '%s',
535
+ '%d',
536
+ '%s',
537
+ '%s',
538
+ '%d',
539
+ '%s',
540
+ '%s',
541
+ '%s',
542
+ '%d',
543
+ '%s',
544
+ '%s',
545
+ '%s',
546
+ '%s',
547
+ '%s',
548
+ '%s',
549
+ '%s',
550
+ '%d',
551
+ '%s',
552
+ '%s',
553
+ '%s',
554
+ '%d',
555
+ '%d',
556
+ '%s',
557
+ '%d'
558
+ ));
559
+ $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
560
+ $wpdb->insert($wpdb->prefix . 'formmaker_views', array(
561
+ 'form_id' => $id,
562
+ 'views' => 0
563
+ ), array(
564
+ '%d',
565
+ '%d'
566
+ ));
567
+ if ($save !== FALSE) {
568
+ return 1;
569
+ }
570
+ else {
571
+ return 2;
572
+ }
573
+ }
574
+
575
+ public function save_as_copy() {
576
+ $message = $this->save_db_as_copy();
577
+ // $this->display();
578
+ $page = WDW_FM_Library::get('page');
579
+ WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
580
+ }
581
+
582
+ public function save() {
583
+ $message = $this->save_db();
584
+ // $this->display();
585
+ $page = WDW_FM_Library::get('page');
586
+ WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
587
+ }
588
+
589
+ public function apply() {
590
+ $message = $this->save_db();
591
+ // $this->edit();
592
+ global $wpdb;
593
+ $id = (int) $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
594
+ $current_id = WDW_FM_Library::get('current_id', $id);
595
+ $page = WDW_FM_Library::get('page');
596
+ WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
597
+ }
598
+
599
+ public function save_db() {
600
+ global $wpdb;
601
+ $javascript = "// before form is load
602
+ function before_load() {
603
+ }
604
+ // before form submit
605
+ function before_submit() {
606
+ }
607
+ // before form reset
608
+ function before_reset() {
609
+ }";
610
+ // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
611
+ $id = WDW_FM_Library::get('current_id', 0);
612
+ $title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
613
+ $form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
614
+ $counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
615
+ $label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
616
+ $pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
617
+ $show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
618
+ $show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
619
+ $public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
620
+ $private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
621
+ $recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
622
+ $label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
623
+ $form_fields = (isset($_POST['form_fields']) ? stripslashes($_POST['form_fields']) : '');
624
+
625
+ if ($id != 0) {
626
+ $save = $wpdb->update($wpdb->prefix . 'formmaker', array(
627
+ 'title' => $title,
628
+ 'form_front' => $form_front,
629
+ 'counter' => $counter,
630
+ 'label_order' => $label_order,
631
+ 'label_order_current' => $label_order_current,
632
+ 'pagination' => $pagination,
633
+ 'show_title' => $show_title,
634
+ 'show_numbers' => $show_numbers,
635
+ 'public_key' => $public_key,
636
+ 'private_key' => $private_key,
637
+ 'recaptcha_theme' => $recaptcha_theme,
638
+ 'form_fields' => $form_fields,
639
+ ), array('id' => $id));
640
+ }
641
+ else {
642
+ $save = $wpdb->insert($wpdb->prefix . 'formmaker', array(
643
+ 'title' => $title,
644
+ 'mail' => '',
645
+ 'form_front' => $form_front,
646
+ 'theme' => $wpdb->get_var("SELECT id FROM " . $wpdb->prefix . "formmaker_themes WHERE css LIKE '%.wdform_section%'"),
647
+ 'counter' => $counter,
648
+ 'label_order' => $label_order,
649
+ 'pagination' => $pagination,
650
+ 'show_title' => $show_title,
651
+ 'show_numbers' => $show_numbers,
652
+ 'public_key' => $public_key,
653
+ 'private_key' => $private_key,
654
+ 'recaptcha_theme' => $recaptcha_theme,
655
+ 'javascript' => $javascript,
656
+ 'submit_text' => '',
657
+ 'url' => '',
658
+ 'article_id' => 0,
659
+ 'submit_text_type' => 0,
660
+ 'script_mail' => '%all%',
661
+ 'script_mail_user' => '%all%',
662
+ 'label_order_current' => $label_order_current,
663
+ 'tax' => 0,
664
+ 'payment_currency' => '',
665
+ 'paypal_email' => '',
666
+ 'checkout_mode' => 'testmode',
667
+ 'paypal_mode' => 0,
668
+ 'published' => 1,
669
+ 'form_fields' => $form_fields,
670
+ 'savedb' => 1,
671
+ 'sendemail' => 1,
672
+ 'requiredmark' => '*',
673
+ 'from_mail' => '',
674
+ 'from_name' => '',
675
+ 'reply_to' => '',
676
+ 'send_to' => '',
677
+ 'autogen_layout' => 1,
678
+ 'custom_front' => '',
679
+ 'mail_from_user' => '',
680
+ 'mail_from_name_user' => '',
681
+ 'reply_to_user' => '',
682
+ ), array(
683
+ '%s',
684
+ '%s',
685
+ '%s',
686
+ '%d',
687
+ '%d',
688
+ '%s',
689
+ '%s',
690
+ '%s',
691
+ '%s',
692
+ '%s',
693
+ '%s',
694
+ '%s',
695
+ '%s',
696
+ '%s',
697
+ '%s',
698
+ '%d',
699
+ '%d',
700
+ '%s',
701
+ '%s',
702
+ '%s',
703
+ '%d',
704
+ '%s',
705
+ '%s',
706
+ '%s',
707
+ '%d',
708
+ '%d',
709
+ '%s',
710
+ '%d',
711
+ '%d',
712
+ '%s',
713
+ '%s',
714
+ '%s',
715
+ '%s',
716
+ '%s',
717
+ '%d',
718
+ '%s',
719
+ '%s',
720
+ '%s',
721
+ '%s',
722
+ ));
723
+ $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
724
+ // $_POST['current_id'] = $id;
725
+ $wpdb->insert($wpdb->prefix . 'formmaker_views', array(
726
+ 'form_id' => $id,
727
+ 'views' => 0
728
+ ), array(
729
+ '%d',
730
+ '%d'
731
+ ));
732
+ }
733
+ if ($save !== FALSE) {
734
+ return 1;
735
+ }
736
+ else {
737
+ return 2;
738
+ }
739
+ }
740
+
741
+ public function save_db_as_copy() {
742
+ global $wpdb;
743
+ // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes($_POST['current_id'])) : 0);
744
+ $id = WDW_FM_Library::get('current_id', 0);
745
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
746
+ $title = (isset($_POST['title']) ? esc_html(stripslashes($_POST['title'])) : '');
747
+ $form_front = (isset($_POST['form_front']) ? stripslashes($_POST['form_front']) : '');
748
+ $counter = (isset($_POST['counter']) ? esc_html(stripslashes($_POST['counter'])) : 0);
749
+ $label_order = (isset($_POST['label_order']) ? esc_html(stripslashes($_POST['label_order'])) : '');
750
+ $label_order_current = (isset($_POST['label_order_current']) ? esc_html(stripslashes($_POST['label_order_current'])) : '');
751
+ $pagination = (isset($_POST['pagination']) ? esc_html(stripslashes($_POST['pagination'])) : '');
752
+ $show_title = (isset($_POST['show_title']) ? esc_html(stripslashes($_POST['show_title'])) : '');
753
+ $show_numbers = (isset($_POST['show_numbers']) ? esc_html(stripslashes($_POST['show_numbers'])) : '');
754
+ $public_key = (isset($_POST['public_key']) ? esc_html(stripslashes($_POST['public_key'])) : '');
755
+ $private_key = (isset($_POST['private_key']) ? esc_html(stripslashes($_POST['private_key'])) : '');
756
+ $recaptcha_theme = (isset($_POST['recaptcha_theme']) ? esc_html(stripslashes($_POST['recaptcha_theme'])) : '');
757
+ $form_fields = (isset($_POST['form_fields']) ? stripslashes($_POST['form_fields']) : '');
758
+
759
+ $save = $wpdb->insert($wpdb->prefix . 'formmaker', array(
760
+ 'title' => $title,
761
+ 'mail' => $row->mail,
762
+ 'form_front' => $form_front,
763
+ 'theme' => $row->theme,
764
+ 'counter' => $counter,
765
+ 'label_order' => $label_order,
766
+ 'pagination' => $pagination,
767
+ 'show_title' => $show_title,
768
+ 'show_numbers' => $show_numbers,
769
+ 'public_key' => $public_key,
770
+ 'private_key' => $private_key,
771
+ 'recaptcha_theme' => $recaptcha_theme,
772
+ 'javascript' => $row->javascript,
773
+ 'submit_text' => $row->submit_text,
774
+ 'url' => $row->url,
775
+ 'article_id' => $row->article_id,
776
+ 'submit_text_type' => $row->submit_text_type,
777
+ 'script_mail' => $row->script_mail,
778
+ 'script_mail_user' => $row->script_mail_user,
779
+ 'label_order_current' => $label_order_current,
780
+ 'tax' => $row->tax,
781
+ 'payment_currency' => $row->payment_currency,
782
+ 'paypal_email' => $row->paypal_email,
783
+ 'checkout_mode' => $row->checkout_mode,
784
+ 'paypal_mode' => $row->paypal_mode,
785
+ 'published' => $row->published,
786
+ 'form_fields' => $form_fields,
787
+ 'savedb' => $row->savedb,
788
+ 'sendemail' => $row->sendemail,
789
+ 'requiredmark' => $row->requiredmark,
790
+ 'from_mail' => $row->from_mail,
791
+ 'from_name' => $row->from_name,
792
+ 'reply_to' => $row->reply_to,
793
+ 'send_to' => $row->send_to,
794
+ 'autogen_layout' => $row->autogen_layout,
795
+ 'custom_front' => $row->custom_front,
796
+ 'mail_from_user' => $row->mail_from_user,
797
+ 'mail_from_name_user' => $row->mail_from_name_user,
798
+ 'reply_to_user' => $row->reply_to_user,
799
+ ), array(
800
+ '%s',
801
+ '%s',
802
+ '%s',
803
+ '%d',
804
+ '%d',
805
+ '%s',
806
+ '%s',
807
+ '%s',
808
+ '%s',
809
+ '%s',
810
+ '%s',
811
+ '%s',
812
+ '%s',
813
+ '%s',
814
+ '%s',
815
+ '%d',
816
+ '%d',
817
+ '%s',
818
+ '%s',
819
+ '%s',
820
+ '%d',
821
+ '%s',
822
+ '%s',
823
+ '%s',
824
+ '%d',
825
+ '%d',
826
+ '%s',
827
+ '%d',
828
+ '%d',
829
+ '%s',
830
+ '%s',
831
+ '%s',
832
+ '%s',
833
+ '%s',
834
+ '%d',
835
+ '%s',
836
+ '%s',
837
+ '%s',
838
+ '%s',
839
+ ));
840
+ $id = $wpdb->get_var("SELECT MAX(id) FROM " . $wpdb->prefix . "formmaker");
841
+ $wpdb->insert($wpdb->prefix . 'formmaker_views', array(
842
+ 'form_id' => $id,
843
+ 'views' => 0
844
+ ), array(
845
+ '%d',
846
+ '%d'
847
+ ));
848
+ if ($save !== FALSE) {
849
+ return 1;
850
+ }
851
+ else {
852
+ return 2;
853
+ }
854
+ }
855
+
856
+ public function delete($id) {
857
+ global $wpdb;
858
+ $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id);
859
+ if ($wpdb->query($query)) {
860
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="%d"', $id));
861
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id="%d"', $id));
862
+ $message = 3;
863
+ }
864
+ else {
865
+ $message = 2;
866
+ }
867
+ // $this->display();
868
+ $page = WDW_FM_Library::get('page');
869
+ WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
870
+ }
871
+
872
+ public function delete_all() {
873
+ global $wpdb;
874
+ $flag = FALSE;
875
+ $isDefault = FALSE;
876
+ $form_ids_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker');
877
+ foreach ($form_ids_col as $form_id) {
878
+ if (isset($_POST['check_' . $form_id])) {
879
+ $flag = TRUE;
880
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $form_id));
881
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="%d"', $form_id));
882
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id="%d"', $form_id));
883
+ }
884
+ }
885
+ if ($flag) {
886
+ $message = 5;
887
+ }
888
+ else {
889
+ $message = 6;
890
+ }
891
+ // $this->display();
892
+ $page = WDW_FM_Library::get('page');
893
+ WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
894
+ }
895
+
896
+ ////////////////////////////////////////////////////////////////////////////////////////
897
+ // Getters & Setters //
898
+ ////////////////////////////////////////////////////////////////////////////////////////
899
+ ////////////////////////////////////////////////////////////////////////////////////////
900
+ // Private Methods //
901
+ ////////////////////////////////////////////////////////////////////////////////////////
902
+ ////////////////////////////////////////////////////////////////////////////////////////
903
+ // Listeners //
904
+ ////////////////////////////////////////////////////////////////////////////////////////
905
+ }
admin/controllers/FMControllerShow_matrix.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMControllerShow_matrix {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $this->display();
23
+ }
24
+
25
+ public function display() {
26
+ require_once WD_FM_DIR . "/admin/models/FMModelShow_matrix.php";
27
+ $model = new FMModelShow_matrix();
28
+
29
+ require_once WD_FM_DIR . "/admin/views/FMViewShow_matrix.php";
30
+ $view = new FMViewShow_matrix($model);
31
+ $view->display();
32
+ }
33
+
34
+ ////////////////////////////////////////////////////////////////////////////////////////
35
+ // Getters & Setters //
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
+ ////////////////////////////////////////////////////////////////////////////////////////
38
+ // Private Methods //
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ // Listeners //
42
+ ////////////////////////////////////////////////////////////////////////////////////////
43
+ }
admin/controllers/FMControllerSubmissions_fm.php ADDED
@@ -0,0 +1,761 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMControllerSubmissions_fm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $task = ((isset($_POST['task'])) ? esc_html($_POST['task']) : '');
23
+ $id = ((isset($_POST['current_id'])) ? esc_html($_POST['current_id']) : 0);
24
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
25
+ if (method_exists($this, $task)) {
26
+ $this->$task($id);
27
+ }
28
+ else {
29
+ $this->display($form_id);
30
+ }
31
+ }
32
+
33
+ public function display($form_id) {
34
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
35
+ require_once WD_FM_DIR . "/admin/models/FMModelSubmissions_fm.php";
36
+ $model = new FMModelSubmissions_fm();
37
+
38
+ require_once WD_FM_DIR . "/admin/views/FMViewSubmissions_fm.php";
39
+ $view = new FMViewSubmissions_fm($model);
40
+ $view->display($form_id);
41
+ }
42
+
43
+ public function show_stats() {
44
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
45
+ require_once WD_FM_DIR . "/admin/models/FMModelSubmissions_fm.php";
46
+ $model = new FMModelSubmissions_fm();
47
+
48
+ require_once WD_FM_DIR . "/admin/views/FMViewSubmissions_fm.php";
49
+ $view = new FMViewSubmissions_fm($model);
50
+ $view->show_stats($form_id);
51
+ }
52
+
53
+ public function edit() {
54
+ global $wpdb;
55
+ $new_form = false;
56
+ require_once WD_FM_DIR . "/admin/models/FMModelSubmissions_fm.php";
57
+ $model = new FMModelSubmissions_fm();
58
+
59
+ require_once WD_FM_DIR . "/admin/views/FMViewSubmissions_fm.php";
60
+ $view = new FMViewSubmissions_fm($model);
61
+ $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
62
+
63
+ $form_id = $wpdb->get_var("SELECT form_id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "'");
64
+ $theme_id = $wpdb->get_var("SELECT theme FROM " . $wpdb->prefix . "formmaker WHERE id='" . $form_id . "'");
65
+ $css = $wpdb->get_var("SELECT css FROM " . $wpdb->prefix . "formmaker_themes WHERE id='" . $theme_id . "'");
66
+
67
+ if (strpos($css,'.wdform_section') > -1) {
68
+ $new_form = true;
69
+ }
70
+ if ($new_form == false) {
71
+ $view->edit($id);
72
+ }
73
+ else {
74
+ $view->new_edit($id);
75
+ }
76
+ }
77
+
78
+ public function save() {
79
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
80
+ $this->save_db();
81
+ $this->display($form_id);
82
+ }
83
+
84
+ public function apply() {
85
+ $this->save_db();
86
+ $this->edit();
87
+ }
88
+
89
+ public function save_db() {
90
+ global $wpdb;
91
+ $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes( $_POST['current_id'])) : 0);
92
+ $group_id = $id;
93
+ $date = esc_html($_POST['date']);
94
+ $ip = esc_html($_POST['ip']);
95
+ $form_id = $wpdb->get_var("SELECT form_id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "'");
96
+ $form = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id='" . $form_id . "'");
97
+ $label_id = array();
98
+ $label_order_original = array();
99
+ $label_type = array();
100
+ $old = false;
101
+ $form_currency = '$';
102
+
103
+ if (strpos($form->label_order, 'type_paypal_')) {
104
+ $form->label_order = $form->label_order."0#**id**#Payment Status#**label**#type_paypal_payment_status#****#";
105
+ }
106
+ $label_all = explode('#****#', $form->label_order);
107
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
108
+ foreach ($label_all as $key => $label_each) {
109
+ $label_id_each = explode('#**id**#', $label_each);
110
+ array_push($label_id, $label_id_each[0]);
111
+ $label_oder_each = explode('#**label**#', $label_id_each[1]);
112
+ array_push($label_order_original, $label_oder_each[0]);
113
+ array_push($label_type, $label_oder_each[1]);
114
+ }
115
+
116
+ if(isset($form->form))
117
+ $old = true;
118
+
119
+ if($old == false || ($old == true && $form->form=='')) {
120
+
121
+ foreach($label_type as $key => $type) {
122
+
123
+ $value='';
124
+ if($type=="type_submit_reset" or $type=="type_map" or $type=="type_editor" or $type=="type_captcha" or $type=="type_recaptcha" or $type=="type_button" or $type=="type_paypal_total")
125
+ continue;
126
+
127
+ $i=$label_id[$key];
128
+ $id = 'form_id_temp';
129
+ switch ($type) {
130
+
131
+ case 'type_text':
132
+ case 'type_password':
133
+ case 'type_textarea':
134
+ case "type_submitter_mail":
135
+ case "type_date":
136
+ case "type_own_select":
137
+ case "type_country":
138
+ case "type_number": {
139
+ $value = (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL);
140
+ break;
141
+ }
142
+ case "type_wdeditor": {
143
+ $value = (isset($_POST['wdform_'.$i.'_wd_editor'.$id]) ? $_POST['wdform_'.$i.'_wd_editor'.$id] : NULL);
144
+ break;
145
+ }
146
+ case "type_mark_map": {
147
+ $long = (isset($_POST['wdform_'.$i."_long".$id]) ? $_POST['wdform_'.$i."_long".$id] : NULL);
148
+ $lat = (isset($_POST['wdform_'.$i."_lat".$id]) ? $_POST['wdform_'.$i."_lat".$id] : NULL);
149
+ if($long and $lat)
150
+ $value = $long . '***map***' . $lat;
151
+
152
+ break;
153
+ }
154
+
155
+ case "type_date_fields": {
156
+ $day = (isset($_POST['wdform_'.$i."_day".$id]) ? $_POST['wdform_'.$i."_day".$id] : NULL);
157
+ $month = (isset($_POST['wdform_'.$i."_month".$id]) ? $_POST['wdform_'.$i."_month".$id] : NULL);
158
+ $year = (isset($_POST['wdform_'.$i."_year".$id]) ? $_POST['wdform_'.$i."_year".$id] : NULL);
159
+ if($day or $month or $year)
160
+ $value = $day . '-' . $month . '-' . $year;
161
+ break;
162
+ }
163
+
164
+ case "type_time": {
165
+ $ss = (isset($_POST['wdform_'.$i."_ss".$id]) ? $_POST['wdform_'.$i."_ss".$id] : NULL);
166
+ $hh = (isset($_POST['wdform_'.$i."_hh".$id]) ? $_POST['wdform_'.$i."_hh".$id] : NULL);
167
+ $mm = (isset($_POST['wdform_'.$i."_mm".$id]) ? $_POST['wdform_'.$i."_mm".$id] : NULL);
168
+
169
+ if(isset($ss))
170
+ $value = $hh .':'. $mm .':' . $ss;
171
+ else
172
+ $value = $hh .':' . $mm;
173
+
174
+ $am_pm = (isset($_POST['wdform_'.$i."_am_pm".$id]) ? $_POST['wdform_'.$i."_am_pm".$id] : NULL);
175
+ if(isset($am_pm))
176
+ $value = $value . ' ' . $am_pm;
177
+
178
+ break;
179
+ }
180
+
181
+ case "type_phone": {
182
+ $first = (isset($_POST['wdform_'.$i."_element_first".$id]) ? $_POST['wdform_'.$i."_element_first".$id] : NULL);
183
+ $last = (isset($_POST['wdform_'.$i."_element_last".$id]) ? $_POST['wdform_'.$i."_element_last".$id] : NULL);
184
+ if($first or $last)
185
+ $value = $first . ' ' . $last;
186
+
187
+ break;
188
+ }
189
+
190
+ case "type_name": {
191
+
192
+ $element_title = (isset($_POST['wdform_'.$i."_element_title".$id]) ? $_POST['wdform_'.$i."_element_title".$id] : NULL);
193
+ $element_first = (isset($_POST['wdform_'.$i."_element_first".$id]) ? $_POST['wdform_'.$i."_element_first".$id] : NULL);
194
+ $element_last = (isset($_POST['wdform_'.$i."_element_last".$id]) ? $_POST['wdform_'.$i."_element_last".$id] : NULL);
195
+ $element_middle = (isset($_POST['wdform_'.$i."_element_middle".$id]) ? $_POST['wdform_'.$i."_element_middle".$id] : NULL);
196
+
197
+ if(isset($element_title))
198
+ $value = $element_title . '@@@' . $element_first . '@@@' . $element_last . '@@@' . $element_middle;
199
+ else
200
+ $value = $element_first . '@@@' . $element_last;
201
+
202
+ break;
203
+ }
204
+
205
+ case "type_file_upload": {
206
+ break;
207
+ }
208
+
209
+ case 'type_address': {
210
+ $value='*#*#*#';
211
+ $element = (isset($_POST['wdform_'.$i."_street1".$id]) ? $_POST['wdform_'.$i."_street1".$id] : NULL);
212
+ if($element) {
213
+ $value = $element;
214
+ break;
215
+ }
216
+
217
+ $element = (isset($_POST['wdform_'.$i."_street2".$id]) ? $_POST['wdform_'.$i."_street2".$id] : NULL);
218
+ if($element) {
219
+ $value = $element;
220
+ break;
221
+ }
222
+
223
+ $element = (isset($_POST['wdform_'.$i."_city".$id]) ? $_POST['wdform_'.$i."_city".$id] : NULL);
224
+ if(isset($element)) {
225
+ $value = $element;
226
+ break;
227
+ }
228
+
229
+ $element = (isset($_POST['wdform_'.$i."_state".$id]) ? $_POST['wdform_'.$i."_state".$id] : NULL);
230
+ if(isset($element)) {
231
+ $value = $element;
232
+ break;
233
+ }
234
+
235
+ $element = (isset($_POST['wdform_'.$i."_postal".$id]) ? $_POST['wdform_'.$i."_postal".$id] : NULL);
236
+ if(isset($element)) {
237
+ $value = $element;
238
+ break;
239
+ }
240
+
241
+ $element = (isset($_POST['wdform_'.$i."_country".$id]) ? $_POST['wdform_'.$i."_country".$id] : NULL);
242
+ if(isset($element)) {
243
+ $value = $element;
244
+ break;
245
+ }
246
+
247
+ break;
248
+ }
249
+
250
+ case "type_hidden": {
251
+ $value = (isset($_POST[$label_label[$key]]) ? $_POST[$label_label[$key]] : NULL);
252
+ break;
253
+ }
254
+
255
+ case "type_radio": {
256
+ $element = (isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : NULL);
257
+ if(isset($element)) {
258
+ $value = $element;
259
+ break;
260
+ }
261
+
262
+ $value = (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL);
263
+ break;
264
+ }
265
+
266
+ case "type_checkbox": {
267
+ $start=-1;
268
+ $value='';
269
+ for($j=0; $j<100; $j++) {
270
+
271
+ $element = (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL);
272
+
273
+ if(isset($element)) {
274
+ $start = $j;
275
+ break;
276
+ }
277
+ }
278
+
279
+ $other_element_id=-1;
280
+ $is_other = (isset($_POST['wdform_'.$i."_allow_other".$id]) ? $_POST['wdform_'.$i."_allow_other".$id] : NULL);
281
+ if($is_other == "yes") {
282
+ $other_element_id = (isset($_POST['wdform_'.$i."_allow_other_num".$id]) ? $_POST['wdform_'.$i."_allow_other_num".$id] : NULL);
283
+ }
284
+
285
+ if($start!=-1) {
286
+ for($j=$start; $j<100; $j++) {
287
+ $element = (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL);
288
+ if(isset($element))
289
+ if($j == $other_element_id) {
290
+ $value = $value . (isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : NULL) . '***br***';
291
+ }
292
+ else
293
+ $value = $value . (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL) . '***br***';
294
+ }
295
+ }
296
+
297
+ break;
298
+ }
299
+
300
+ case "type_paypal_price": {
301
+ $value=0;
302
+ if((isset($_POST['wdform_'.$i."_element_dollars".$id]) ? $_POST['wdform_'.$i."_element_dollars".$id] : NULL))
303
+ $value = (isset($_POST['wdform_'.$i."_element_dollars".$id]) ? $_POST['wdform_'.$i."_element_dollars".$id] : NULL);
304
+
305
+ $value = (int) preg_replace('/\D/', '', $value);
306
+
307
+ if((isset($_POST['wdform_'.$i."_element_cents".$id]) ? $_POST['wdform_'.$i."_element_cents".$id] : NULL))
308
+ $value = $value . '.' . ( preg_replace('/\D/', '', (isset($_POST['wdform_'.$i."_element_cents".$id]) ? $_POST['wdform_'.$i."_element_cents".$id] : NULL)));
309
+
310
+
311
+ $value = $value;
312
+ break;
313
+ }
314
+
315
+ case "type_paypal_select": {
316
+
317
+ if((isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL))
318
+ $value = (isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL) . ' : ' . (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL) . $form_currency;
319
+ else
320
+ $value = '';
321
+
322
+ $element_quantity = (isset($_POST['wdform_'.$i."element_quantity".$id]) ? $_POST['wdform_'.$i."element_quantity".$id] : NULL);
323
+ if(isset($element_quantity) && $value!='')
324
+ $value .= '***br***' . (isset($_POST['wdform_'.$i."_element_quantity_label".$id]) ? $_POST['wdform_'.$i."_element_quantity_label".$id] : NULL) . ': ' . (isset($_POST['wdform_'.$i."_element_quantity".$id]) ? $_POST['wdform_'.$i."_element_quantity".$id] : NULL);
325
+
326
+
327
+ for($k=0; $k<50; $k++) {
328
+ $temp_val = (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL);
329
+ if(isset($temp_val) && $value!='') {
330
+ $value .= '***br***' . (isset($_POST['wdform_'.$i."_element_property_label".$id]) ? $_POST['wdform_'.$i."_element_property_label".$id] : NULL) . ': ' . (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL) . '***property***';
331
+ }
332
+ }
333
+
334
+ break;
335
+ }
336
+
337
+ case "type_paypal_radio": {
338
+
339
+ if((isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL))
340
+ $value = (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL) . ' : ' . (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL) . $form_currency;
341
+ else
342
+ $value='';
343
+
344
+
345
+ $element_quantity = (isset($_POST['wdform_'.$i."element_quantity".$id]) ? $_POST['wdform_'.$i."element_quantity".$id] : NULL);
346
+ if(isset($element_quantity) && $value!='')
347
+ $value .= '***br***' . (isset($_POST['wdform_'.$i."_element_quantity_label".$id]) ? $_POST['wdform_'.$i."_element_quantity_label".$id] : NULL) . ': ' . (isset($_POST['wdform_'.$i."_element_quantity".$id]) ? $_POST['wdform_'.$i."_element_quantity".$id] : NULL) . '***quantity***';
348
+
349
+
350
+ for($k=0; $k<50; $k++) {
351
+ $temp_val = (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL);
352
+ if(isset($temp_val) && $value!='') {
353
+
354
+ $value .= '***br***' . (isset($_POST['wdform_'.$i."_element_property_label".$id]) ? $_POST['wdform_'.$i."_element_property_label".$id] : NULL) . ': ' . (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL) . '***property***';
355
+ }
356
+ }
357
+
358
+ break;
359
+ }
360
+
361
+ case "type_paypal_shipping": {
362
+
363
+ if((isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL))
364
+ $value = (isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL) . ' : ' . (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL) . $form_currency;
365
+ else
366
+ $value='';
367
+ $value = (isset($_POST['wdform_'.$i."_element_label".$id]) ? $_POST['wdform_'.$i."_element_label".$id] : NULL) . ' - ' . (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL);
368
+
369
+ $paypal['shipping'] = (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL);
370
+
371
+ break;
372
+ }
373
+
374
+ case "type_paypal_checkbox": {
375
+ $start=-1;
376
+ $value='';
377
+ for($j=0; $j<100; $j++) {
378
+
379
+ $element = (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL);
380
+
381
+ if(isset($element)) {
382
+ $start=$j;
383
+ break;
384
+ }
385
+ }
386
+
387
+ $other_element_id = -1;
388
+ $is_other = (isset($_POST['wdform_'.$i."_allow_other".$id]) ? $_POST['wdform_'.$i."_allow_other".$id] : NULL);
389
+ if($is_other=="yes") {
390
+ $other_element_id = (isset($_POST['wdform_'.$i."_allow_other_num".$id]) ? $_POST['wdform_'.$i."_allow_other_num".$id] : NULL);
391
+ }
392
+
393
+ if($start!=-1) {
394
+ for($j=$start; $j<100; $j++) {
395
+ $element = (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL);
396
+ if(isset($element))
397
+ if($j==$other_element_id) {
398
+ $value = $value . (isset($_POST['wdform_'.$i."_other_input".$id]) ? $_POST['wdform_'.$i."_other_input".$id] : NULL) . '***br***';
399
+
400
+ }
401
+ else {
402
+
403
+ $value = $value . (isset($_POST['wdform_'.$i."_element".$id.$j."_label"]) ? $_POST['wdform_'.$i."_element".$id.$j."_label"] : NULL) . ' - ' . ((isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL) == '' ? '0' : (isset($_POST['wdform_'.$i."_element".$id.$j]) ? $_POST['wdform_'.$i."_element".$id.$j] : NULL)) . $form_currency . '***br***';
404
+
405
+ }
406
+ }
407
+
408
+ $element_quantity = (isset($_POST['wdform_'.$i."element_quantity".$id]) ? $_POST['wdform_'.$i."element_quantity".$id] : NULL);
409
+ if(isset($element_quantity))
410
+ $value .= (isset($_POST['wdform_'.$i."_element_quantity_label".$id]) ? $_POST['wdform_'.$i."_element_quantity_label".$id] : NULL) . ': '. (isset($_POST['wdform_'.$i."_element_quantity".$id]) ? $_POST['wdform_'.$i."_element_quantity".$id] : NULL) . '***quantity***';
411
+
412
+ for($k=0; $k<50; $k++) {
413
+ $temp_val = (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL);
414
+ if(isset($temp_val)) {
415
+
416
+ $value .= '***br***' . (isset($_POST['wdform_'.$i."_element_property_label".$id]) ? $_POST['wdform_'.$i."_element_property_label".$id] : NULL) . ': ' . (isset($_POST['wdform_'.$i."_property".$id.$k]) ? $_POST['wdform_'.$i."_property".$id.$k] : NULL) . '***property***';
417
+ }
418
+ }
419
+
420
+ }
421
+
422
+
423
+ break;
424
+ }
425
+
426
+ case "type_star_rating": {
427
+
428
+ if((isset($_POST['wdform_'.$i."_selected_star_amount".$id]) ? $_POST['wdform_'.$i."_selected_star_amount".$id] : NULL) == "")
429
+ $selected_star_amount = 0;
430
+ else {
431
+ $selected_star_amount = (isset($_POST['wdform_'.$i."_selected_star_amount".$id]) ? $_POST['wdform_'.$i."_selected_star_amount".$id] : NULL);
432
+ }
433
+ $value = $selected_star_amount . '/' . (isset($_POST['wdform_'.$i."_star_amount".$id]) ? $_POST['wdform_'.$i."_star_amount".$id] : NULL);
434
+ break;
435
+ }
436
+
437
+ case "type_scale_rating": {
438
+
439
+ $value = (isset($_POST['wdform_'.$i."_scale_radio".$id]) ? $_POST['wdform_'.$i."_scale_radio".$id] : 0) . '/' . (isset($_POST['wdform_'.$i."_scale_amount".$id]) ? $_POST['wdform_'.$i."_scale_amount".$id] : NULL);
440
+ break;
441
+ }
442
+
443
+ case "type_spinner": {
444
+ $value = (isset($_POST['wdform_'.$i."_element".$id]) ? $_POST['wdform_'.$i."_element".$id] : NULL);
445
+
446
+ break;
447
+ }
448
+
449
+ case "type_slider": {
450
+ $value = (isset($_POST['wdform_'.$i."_slider_value".$id]) ? $_POST['wdform_'.$i."_slider_value".$id] : NULL);
451
+
452
+ break;
453
+ }
454
+ case "type_range": {
455
+ $value = (isset($_POST['wdform_'.$i."_element".$id.'0']) ? $_POST['wdform_'.$i."_element".$id.'0'] : NULL) . '-' . (isset($_POST['wdform_'.$i."_element".$id.'1']) ? $_POST['wdform_'.$i."_element".$id.'1'] : NULL);
456
+
457
+ break;
458
+ }
459
+ case "type_grading": {
460
+ $value ="";
461
+ $items = explode(":",(isset($_POST['wdform_'.$i."_hidden_item".$id]) ? $_POST['wdform_'.$i."_hidden_item".$id] : NULL));
462
+ for($k=0; $k<sizeof($items)-1; $k++)
463
+ $value .= (isset($_POST['wdform_'.$i."_element".$id.'_'.$k]) ? $_POST['wdform_'.$i."_element".$id.'_'.$k] : NULL) . ':';
464
+
465
+ $value .= (isset($_POST['wdform_'.$i."_hidden_item".$id]) ? $_POST['wdform_'.$i."_hidden_item".$id] : NULL) . '***grading***';
466
+
467
+ break;
468
+ }
469
+
470
+ case "type_matrix": {
471
+
472
+ $rows_of_matrix = explode("***",(isset($_POST['wdform_'.$i."_hidden_row".$id]) ? $_POST['wdform_'.$i."_hidden_row".$id] : NULL));
473
+ $rows_count = sizeof($rows_of_matrix)-1;
474
+ $column_of_matrix = explode("***",(isset($_POST['wdform_'.$i."_hidden_column".$id]) ? $_POST['wdform_'.$i."_hidden_column".$id] : NULL));
475
+ $columns_count = sizeof($column_of_matrix)-1;
476
+
477
+
478
+ if((isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) == "radio") {
479
+ $input_value="";
480
+
481
+ for($k=1; $k<=$rows_count; $k++)
482
+ $input_value .= (isset($_POST['wdform_'.$i."_input_element".$id.$k]) ? $_POST['wdform_'.$i."_input_element".$id.$k] : 0) ."***";
483
+
484
+ }
485
+ if((isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) == "checkbox") {
486
+ $input_value="";
487
+
488
+ for($k=1; $k<=$rows_count; $k++)
489
+ for($j=1; $j<=$columns_count; $j++)
490
+ $input_value .= (isset($_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j]) ? $_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j] : 0) . "***";
491
+ }
492
+
493
+ if((isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) == "text") {
494
+ $input_value="";
495
+ for($k=1; $k<=$rows_count; $k++)
496
+ for($j=1; $j<=$columns_count; $j++)
497
+ $input_value .= (isset($_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j]) ? $_POST['wdform_'.$i."_input_element".$id.$k.'_'.$j] : NULL) . "***";
498
+ }
499
+
500
+ if((isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) == "select") {
501
+ $input_value="";
502
+ for($k=1; $k<=$rows_count; $k++)
503
+ for($j=1; $j<=$columns_count; $j++)
504
+ $input_value .= (isset($_POST['wdform_'.$i."_select_yes_no".$id.$k.'_'.$j]) ? $_POST['wdform_'.$i."_select_yes_no".$id.$k.'_'.$j] : NULL) . "***";
505
+ }
506
+
507
+ $value = $rows_count . (isset($_POST['wdform_'.$i."_hidden_row".$id]) ? $_POST['wdform_'.$i."_hidden_row".$id] : NULL) . '***' . $columns_count . (isset($_POST['wdform_'.$i."_hidden_column".$id]) ? $_POST['wdform_'.$i."_hidden_column".$id] : NULL) . '***' . (isset($_POST['wdform_'.$i."_input_type".$id]) ? $_POST['wdform_'.$i."_input_type".$id] : NULL) . '***' . $input_value . '***matrix***';
508
+
509
+ break;
510
+ }
511
+
512
+ }
513
+
514
+ if($type == "type_address")
515
+ if($value == '*#*#*#')
516
+ continue;
517
+
518
+
519
+ if($value) {
520
+ $query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $group_id . "' AND element_label='" . $i . "'";
521
+ $result = $wpdb->get_var($query);
522
+
523
+ if($result) {
524
+ $save = $wpdb->update($wpdb->prefix . "formmaker_submits", array(
525
+ 'element_value' => stripslashes($value),
526
+ ), array(
527
+ 'group_id' => $group_id,
528
+ 'element_label' => $i
529
+ ), array(
530
+ '%s',
531
+ ), array(
532
+ '%d',
533
+ '%s'
534
+ ));
535
+ }
536
+ else {
537
+
538
+ $save = $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
539
+ 'form_id' => $form_id,
540
+ 'element_label' => $i,
541
+ 'element_value' => stripslashes($value),
542
+ 'group_id' => $group_id,
543
+ 'date' => $date,
544
+ 'ip' => $ip
545
+ ), array(
546
+ '%d',
547
+ '%s',
548
+ '%s',
549
+ '%d',
550
+ '%s',
551
+ '%s'
552
+ )
553
+ );
554
+
555
+
556
+ }
557
+ }
558
+
559
+
560
+
561
+ }
562
+ }
563
+
564
+ else {
565
+
566
+ foreach ($label_id as $key => $label_id_1) {
567
+ $element_value = (isset($_POST["submission_" . $label_id_1]) ? esc_html(stripslashes($_POST["submission_" . $label_id_1])) : " ");
568
+ if (isset($_POST["submission_" . $label_id_1])) {
569
+ $query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
570
+ $result = $wpdb->get_var($query);
571
+ if ($label_type[$key] == 'type_file_upload')
572
+ if ($element_value)
573
+ $element_value = $element_value . "*@@url@@*";
574
+ if ($result) {
575
+ $save = $wpdb->update($wpdb->prefix . "formmaker_submits", array(
576
+ 'element_value' => stripslashes($element_value),
577
+ ), array(
578
+ 'group_id' => $id,
579
+ 'element_label' => $label_id_1
580
+ ), array(
581
+ '%s',
582
+ ), array(
583
+ '%d',
584
+ '%s'
585
+ ));
586
+ }
587
+ else {
588
+ $save = $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
589
+ 'form_id' => $form_id,
590
+ 'element_label' => $label_id_1,
591
+ 'element_value' => stripslashes($element_value),
592
+ 'group_id' => $id,
593
+ 'date' => $date,
594
+ 'ip' => $ip
595
+ ), array(
596
+ '%d',
597
+ '%s',
598
+ '%s',
599
+ '%d',
600
+ '%s',
601
+ '%s'
602
+ )
603
+ );
604
+ }
605
+ }
606
+ else {
607
+ $element_value_ch = (isset($_POST["submission_" . $label_id_1 . '_0']) ? esc_html(stripslashes($_POST["submission_" . $label_id_1 . '_0'])) : " ");
608
+ if (isset($_POST["submission_" . $label_id_1 . '_0'])) {
609
+ for ($z = 0; $z < 21; $z++) {
610
+ $element_value_ch = $_POST["submission_" . $label_id_1 . '_' . $z];
611
+ if (isset($element_value_ch))
612
+ $element_value = $element_value . $element_value_ch . '***br***';
613
+ else
614
+ break;
615
+ }
616
+ $query = "SELECT id FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
617
+ $result = $wpdb->get_var($query);
618
+ if ($result) {
619
+ $query = "UPDATE " . $wpdb->prefix . "formmaker_submits SET `element_value`='" . stripslashes($element_value) . "' WHERE group_id='" . $id . "' AND element_label='" . $label_id_1 . "'";
620
+ $save = $wpdb->update($wpdb->prefix . "formmaker_submits", array(
621
+ 'element_value' => stripslashes($element_value),
622
+ ), array(
623
+ 'group_id' => $id,
624
+ 'element_label' => $label_id_1
625
+ ), array(
626
+ '%s',
627
+ ), array(
628
+ '%d',
629
+ '%s'
630
+ ));
631
+ }
632
+ else {
633
+ $query = "INSERT INTO " . $wpdb->prefix . "formmaker_submits (form_id, element_label, element_value, group_id, date, ip) VALUES('" . $form_id . "', '" . $label_id_1 . "', '" . stripslashes($element_value) . "','" . $id . "', '" . $date . "', '" . $ip . "')";
634
+ $save = $wpdb->insert($wpdb->prefix . "formmaker_submits", array(
635
+ 'form_id' => $form_id,
636
+ 'element_label' => $label_id_1,
637
+ 'element_value' => stripslashes($element_value),
638
+ 'group_id' => $id,
639
+ 'date' => $date,
640
+ 'ip' => $ip
641
+ ), array(
642
+ '%d',
643
+ '%s',
644
+ '%s',
645
+ '%d',
646
+ '%s',
647
+ '%s'
648
+ )
649
+ );
650
+ }
651
+ }
652
+ }
653
+ }
654
+ }
655
+ if ($save !== FALSE) {
656
+ echo WDW_FM_Library::message('Submission Succesfully Saved.', 'updated');
657
+ }
658
+ else {
659
+ echo WDW_FM_Library::message('Error. Please install plugin again.', 'error');
660
+ }
661
+ }
662
+
663
+ public function delete($id) {
664
+ global $wpdb;
665
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
666
+ $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id="%d"', $id);
667
+ if ($wpdb->query($query)) {
668
+ echo WDW_FM_Library::message('Item Succesfully Deleted.', 'updated');
669
+ }
670
+ else {
671
+ echo WDW_FM_Library::message('Error. Please install plugin again.', 'error');
672
+ }
673
+ $this->display($form_id);
674
+ }
675
+
676
+ public function delete_all() {
677
+ global $wpdb;
678
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
679
+ $cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
680
+ if (count($cid)) {
681
+ $cids = implode(',', $cid);
682
+ $query = 'DELETE FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( ' . $cids . ' )';
683
+ if ($wpdb->query($query)) {
684
+ echo WDW_FM_Library::message('Items Succesfully Deleted.', 'updated');
685
+ }
686
+ else {
687
+ echo WDW_FM_Library::message('Error. Please install plugin again.', 'error');
688
+ }
689
+ }
690
+ else {
691
+ echo WDW_FM_Library::message('You must select at least one item.', 'error');
692
+ }
693
+ $this->display($form_id);
694
+ }
695
+
696
+ public function block_ip() {
697
+ global $wpdb;
698
+ $flag = FALSE;
699
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
700
+ $cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
701
+ if (count($cid)) {
702
+ $cids = implode(',', $cid);
703
+ $query = 'SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( '. $cids .' )';
704
+ $rows = $wpdb->get_results($query);
705
+ foreach ($rows as $row) {
706
+ $ips = $wpdb->get_var($wpdb->prepare('SELECT ip FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $row->ip));
707
+ $flag = TRUE;
708
+ if (!$ips) {
709
+ $save = $wpdb->insert($wpdb->prefix . 'formmaker_blocked', array(
710
+ 'ip' => $row->ip,
711
+ ), array(
712
+ '%s',
713
+ ));
714
+ }
715
+ }
716
+ }
717
+ if ($flag) {
718
+ echo WDW_FM_Library::message('IPs Succesfully Blocked.', 'updated');
719
+ }
720
+ else {
721
+ echo WDW_FM_Library::message('You must select at least one item.', 'error');
722
+ }
723
+ $this->display($form_id);
724
+ }
725
+
726
+ public function unblock_ip() {
727
+ global $wpdb;
728
+ $flag = FALSE;
729
+ $form_id = ((isset($_POST['form_id']) && esc_html($_POST['form_id']) != '') ? esc_html($_POST['form_id']) : 0);
730
+ $cid = ((isset($_POST['post']) && $_POST['post'] != '') ? $_POST['post'] : NULL);
731
+ if (count($cid)) {
732
+ $cids = implode(',', $cid);
733
+ $query = 'SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits WHERE group_id IN ( '. $cids .' )';
734
+ $rows = $wpdb->get_results($query);
735
+ foreach ($rows as $row) {
736
+ $flag = TRUE;
737
+ $ips = $wpdb->get_var($wpdb->prepare('SELECT ip FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $row->ip));
738
+ if ($ips) {
739
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $ips));
740
+ }
741
+ }
742
+ }
743
+ if ($flag) {
744
+ echo WDW_FM_Library::message('IPs Succesfully Unblocked.', 'updated');
745
+ }
746
+ else {
747
+ echo WDW_FM_Library::message('You must select at least one item.', 'error');
748
+ }
749
+ $this->display($form_id);
750
+ }
751
+
752
+ ////////////////////////////////////////////////////////////////////////////////////////
753
+ // Getters & Setters //
754
+ ////////////////////////////////////////////////////////////////////////////////////////
755
+ ////////////////////////////////////////////////////////////////////////////////////////
756
+ // Private Methods //
757
+ ////////////////////////////////////////////////////////////////////////////////////////
758
+ ////////////////////////////////////////////////////////////////////////////////////////
759
+ // Listeners //
760
+ ////////////////////////////////////////////////////////////////////////////////////////
761
+ }
admin/controllers/FMControllerThemes_fm.php ADDED
@@ -0,0 +1,190 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMControllerThemes_fm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $task = WDW_FM_Library::get('task');
23
+ $id = WDW_FM_Library::get('current_id', 0);
24
+ $message = WDW_FM_Library::get('message');
25
+ echo WDW_FM_Library::message_id($message);
26
+ // $task = ((isset($_POST['task'])) ? esc_html($_POST['task']) : '');
27
+ // $id = ((isset($_POST['current_id'])) ? esc_html($_POST['current_id']) : 0);
28
+ if (method_exists($this, $task)) {
29
+ $this->$task($id);
30
+ }
31
+ else {
32
+ $this->display();
33
+ }
34
+ }
35
+
36
+ public function display() {
37
+ require_once WD_FM_DIR . "/admin/models/FMModelThemes_fm.php";
38
+ $model = new FMModelThemes_fm();
39
+
40
+ require_once WD_FM_DIR . "/admin/views/FMViewThemes_fm.php";
41
+ $view = new FMViewThemes_fm($model);
42
+ $view->display();
43
+ }
44
+
45
+ public function add() {
46
+ require_once WD_FM_DIR . "/admin/models/FMModelThemes_fm.php";
47
+ $model = new FMModelThemes_fm();
48
+
49
+ require_once WD_FM_DIR . "/admin/views/FMViewThemes_fm.php";
50
+ $view = new FMViewThemes_fm($model);
51
+ $view->edit(0, FALSE);
52
+ }
53
+
54
+ public function edit() {
55
+ require_once WD_FM_DIR . "/admin/models/FMModelThemes_fm.php";
56
+ $model = new FMModelThemes_fm();
57
+
58
+ require_once WD_FM_DIR . "/admin/views/FMViewThemes_fm.php";
59
+ $view = new FMViewThemes_fm($model);
60
+ // $id = ((isset($_POST['current_id']) && esc_html($_POST['current_id']) != '') ? esc_html($_POST['current_id']) : 0);
61
+ $id = WDW_FM_Library::get('current_id', 0);
62
+ $view->edit($id, FALSE);
63
+ }
64
+
65
+ public function save() {
66
+ $message = $this->save_db();
67
+ // $this->display();
68
+ $page = WDW_FM_Library::get('page');
69
+ WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
70
+ }
71
+
72
+ public function apply() {
73
+ $message = $this->save_db();
74
+ global $wpdb;
75
+ // if (!isset($_POST['current_id']) || (esc_html($_POST['current_id']) == 0) || (esc_html($_POST['current_id']) == '')) {
76
+
77
+ // }
78
+ $id = (int) $wpdb->get_var('SELECT MAX(`id`) FROM ' . $wpdb->prefix . 'formmaker_themes');
79
+ $current_id = WDW_FM_Library::get('current_id', $id);
80
+ $page = WDW_FM_Library::get('page');
81
+ WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'edit', 'current_id' => $current_id, 'message' => $message), admin_url('admin.php')));
82
+ // $this->edit();
83
+ }
84
+
85
+ public function save_db() {
86
+ global $wpdb;
87
+ // $id = (isset($_POST['current_id']) ? (int) esc_html(stripslashes( $_POST['current_id'])) : 0);
88
+ $id = (int) WDW_FM_Library::get('current_id', 0);
89
+ $title = (isset($_POST['title']) ? esc_html(stripslashes( $_POST['title'])) : '');
90
+ $css = (isset($_POST['css']) ? stripslashes(preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $_POST['css'])) : '');
91
+ $default = (isset($_POST['default']) ? esc_html(stripslashes( $_POST['default'])) : 0);
92
+ if ($id != 0) {
93
+ $save = $wpdb->update($wpdb->prefix . 'formmaker_themes', array(
94
+ 'title' => $title,
95
+ 'css' => $css,
96
+ 'default' => $default,
97
+ ), array('id' => $id));
98
+ }
99
+ else {
100
+ $save = $wpdb->insert($wpdb->prefix . 'formmaker_themes', array(
101
+ 'title' => $title,
102
+ 'css' => $css,
103
+ 'default' => $default,
104
+ ), array(
105
+ '%s',
106
+ '%s',
107
+ '%d',
108
+ ));
109
+ }
110
+ if ($save !== FALSE) {
111
+ return 1;
112
+ }
113
+ else {
114
+ return 2;
115
+ }
116
+ }
117
+
118
+ public function delete($id) {
119
+ global $wpdb;
120
+ $isDefault = $wpdb->get_var($wpdb->prepare('SELECT default FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id));
121
+ if ($isDefault) {
122
+ $message = 4;
123
+ }
124
+ else {
125
+ $query = $wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id);
126
+ if ($wpdb->query($query)) {
127
+ $message = 3;
128
+ }
129
+ else {
130
+ $message = 2;
131
+ }
132
+ }
133
+ // $this->display();
134
+ $page = WDW_FM_Library::get('page');
135
+ WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
136
+ }
137
+
138
+ public function delete_all() {
139
+ global $wpdb;
140
+ $flag = FALSE;
141
+ $isDefault = FALSE;
142
+ $theme_ids_col = $wpdb->get_col('SELECT id FROM ' . $wpdb->prefix . 'formmaker_themes');
143
+ foreach ($theme_ids_col as $theme_id) {
144
+ if (isset($_POST['check_' . $theme_id])) {
145
+ $isDefault = $wpdb->get_var($wpdb->prepare('SELECT default FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $theme_id));
146
+ if ($isDefault) {
147
+ $message = 4;
148
+ }
149
+ else {
150
+ $flag = TRUE;
151
+ $wpdb->query($wpdb->prepare('DELETE FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $theme_id));
152
+ }
153
+ }
154
+ }
155
+ if ($flag) {
156
+ $message = 5;
157
+ }
158
+ else {
159
+ $message = 6;
160
+ }
161
+ // $this->display();
162
+ $page = WDW_FM_Library::get('page');
163
+ WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
164
+ }
165
+
166
+ public function setdefault($id) {
167
+ global $wpdb;
168
+ $wpdb->update($wpdb->prefix . 'formmaker_themes', array('default' => 0), array('default' => 1));
169
+ $save = $wpdb->update($wpdb->prefix . 'formmaker_themes', array('default' => 1), array('id' => $id));
170
+ if ($save !== FALSE) {
171
+ $message = 7;
172
+ }
173
+ else {
174
+ $message = 2;
175
+ }
176
+ // $this->display();
177
+ $page = WDW_FM_Library::get('page');
178
+ WDW_FM_Library::spider_redirect(add_query_arg(array('page' => $page, 'task' => 'display', 'message' => $message), admin_url('admin.php')));
179
+ }
180
+
181
+ ////////////////////////////////////////////////////////////////////////////////////////
182
+ // Getters & Setters //
183
+ ////////////////////////////////////////////////////////////////////////////////////////
184
+ ////////////////////////////////////////////////////////////////////////////////////////
185
+ // Private Methods //
186
+ ////////////////////////////////////////////////////////////////////////////////////////
187
+ ////////////////////////////////////////////////////////////////////////////////////////
188
+ // Listeners //
189
+ ////////////////////////////////////////////////////////////////////////////////////////
190
+ }
admin/controllers/FMControllerUninstall_fm.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMControllerUninstall_fm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function execute() {
22
+ $task = ((isset($_POST['task'])) ? esc_html(stripslashes($_POST['task'])) : '');
23
+ if (method_exists($this, $task)) {
24
+ $this->$task();
25
+ }
26
+ else {
27
+ $this->display();
28
+ }
29
+ }
30
+
31
+ public function display() {
32
+ require_once WD_FM_DIR . "/admin/models/FMModelUninstall_fm.php";
33
+ $model = new FMModelUninstall_fm();
34
+
35
+ require_once WD_FM_DIR . "/admin/views/FMViewUninstall_fm.php";
36
+ $view = new FMViewUninstall_fm($model);
37
+ $view->display();
38
+ }
39
+
40
+ public function uninstall() {
41
+ require_once WD_FM_DIR . "/admin/models/FMModelUninstall_fm.php";
42
+ $model = new FMModelUninstall_fm();
43
+
44
+ require_once WD_FM_DIR . "/admin/views/FMViewUninstall_fm.php";
45
+ $view = new FMViewUninstall_fm($model);
46
+ $view->uninstall();
47
+ }
48
+ ////////////////////////////////////////////////////////////////////////////////////////
49
+ // Getters & Setters //
50
+ ////////////////////////////////////////////////////////////////////////////////////////
51
+ ////////////////////////////////////////////////////////////////////////////////////////
52
+ // Private Methods //
53
+ ////////////////////////////////////////////////////////////////////////////////////////
54
+ ////////////////////////////////////////////////////////////////////////////////////////
55
+ // Listeners //
56
+ ////////////////////////////////////////////////////////////////////////////////////////
57
+ }
admin/controllers/FMControllerWidget.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMControllerWidget extends WP_Widget {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $view;
14
+ private $model;
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ // Constructor & Destructor //
17
+ ////////////////////////////////////////////////////////////////////////////////////////
18
+ public function __construct() {
19
+ $widget_ops = array(
20
+ 'classname' => 'form_maker_widget',
21
+ 'description' => 'Add Form Maker widget.'
22
+ );
23
+ // Widget Control Settings.
24
+ $control_ops = array('id_base' => 'form_maker_widget');
25
+ // Create the widget.
26
+ $this->WP_Widget('form_maker_widget', 'Form Maker', $widget_ops, $control_ops);
27
+ require_once WD_FM_DIR . "/admin/models/FMModelWidget.php";
28
+ $this->model = new FMModelWidget();
29
+
30
+ require_once WD_FM_DIR . "/admin/views/FMViewWidget.php";
31
+ $this->view = new FMViewWidget($this->model);
32
+ }
33
+ ////////////////////////////////////////////////////////////////////////////////////////
34
+ // Public Methods //
35
+ ////////////////////////////////////////////////////////////////////////////////////////
36
+
37
+ public function widget($args, $instance) {
38
+ $this->view->widget($args, $instance);
39
+ }
40
+
41
+ public function form( $instance ) {
42
+ $this->view->form($instance, parent::get_field_id('title'), parent::get_field_name('title'), parent::get_field_id('form_id'), parent::get_field_name('form_id'));
43
+ }
44
+
45
+ // Update Settings.
46
+ public function update($new_instance, $old_instance) {
47
+ $instance['title'] = $new_instance['title'];
48
+ $instance['form_id'] = $new_instance['form_id'];
49
+ return $instance;
50
+ }
51
+
52
+ ////////////////////////////////////////////////////////////////////////////////////////
53
+ // Getters & Setters //
54
+ ////////////////////////////////////////////////////////////////////////////////////////
55
+ ////////////////////////////////////////////////////////////////////////////////////////
56
+ // Private Methods //
57
+ ////////////////////////////////////////////////////////////////////////////////////////
58
+ ////////////////////////////////////////////////////////////////////////////////////////
59
+ // Listeners //
60
+ ////////////////////////////////////////////////////////////////////////////////////////
61
+ }
admin/models/FMModelBlocked_ips_fm.php ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMModelBlocked_ips_fm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function get_rows_data() {
22
+ global $wpdb;
23
+ $where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE `ip` LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
24
+ $asc_or_desc = ((isset($_POST['asc_or_desc'])) ? esc_html($_POST['asc_or_desc']) : 'desc');
25
+ $order_by = ' ORDER BY ' . ((isset($_POST['order_by']) && esc_html($_POST['order_by']) != '') ? esc_html($_POST['order_by']) : 'id') . ' ' . $asc_or_desc;
26
+ if (isset($_POST['page_number']) && $_POST['page_number']) {
27
+ $limit = ((int) $_POST['page_number'] - 1) * 20;
28
+ }
29
+ else {
30
+ $limit = 0;
31
+ }
32
+ $query = "SELECT * FROM " . $wpdb->prefix . "formmaker_blocked " . $where . $order_by . " LIMIT " . $limit . ",20";
33
+ $rows = $wpdb->get_results($query);
34
+ return $rows;
35
+ }
36
+
37
+ public function get_row_data($id) {
38
+ global $wpdb;
39
+ if ($id != 0) {
40
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE id="%d"', $id));
41
+ }
42
+ else {
43
+ $row->id = 0;
44
+ $row->ip = '';
45
+ }
46
+ return $row;
47
+ }
48
+
49
+ public function page_nav() {
50
+ global $wpdb;
51
+ $where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE `ip` LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
52
+ $query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker_blocked " . $where;
53
+ $total = $wpdb->get_var($query);
54
+ $page_nav['total'] = $total;
55
+ if (isset($_POST['page_number']) && $_POST['page_number']) {
56
+ $limit = ((int) $_POST['page_number'] - 1) * 20;
57
+ }
58
+ else {
59
+ $limit = 0;
60
+ }
61
+ $page_nav['limit'] = (int) ($limit / 20 + 1);
62
+ return $page_nav;
63
+ }
64
+ ////////////////////////////////////////////////////////////////////////////////////////
65
+ // Getters & Setters //
66
+ ////////////////////////////////////////////////////////////////////////////////////////
67
+ ////////////////////////////////////////////////////////////////////////////////////////
68
+ // Private Methods //
69
+ ////////////////////////////////////////////////////////////////////////////////////////
70
+ ////////////////////////////////////////////////////////////////////////////////////////
71
+ // Listeners //
72
+ ////////////////////////////////////////////////////////////////////////////////////////
73
+ }
admin/models/FMModelFeatured_plugins_fm.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMModelFeatured_plugins_fm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ ////////////////////////////////////////////////////////////////////////////////////////
22
+ // Getters & Setters //
23
+ ////////////////////////////////////////////////////////////////////////////////////////
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ // Private Methods //
26
+ ////////////////////////////////////////////////////////////////////////////////////////
27
+ ////////////////////////////////////////////////////////////////////////////////////////
28
+ // Listeners //
29
+ ////////////////////////////////////////////////////////////////////////////////////////
30
+ }
admin/models/FMModelFormMakerEditCSS.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMModelFormMakerEditCSS {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
22
+ public function get_theme_row($id) {
23
+ global $wpdb;
24
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id));
25
+ return $row;
26
+ }
27
+
28
+ /*public function get_form($form_id) {
29
+ global $wpdb;
30
+ $form = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $form_id));
31
+ return $form;
32
+ }*/
33
+ ////////////////////////////////////////////////////////////////////////////////////////
34
+ // Getters & Setters //
35
+ ////////////////////////////////////////////////////////////////////////////////////////
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
+ // Private Methods //
38
+ ////////////////////////////////////////////////////////////////////////////////////////
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ // Listeners //
41
+ ////////////////////////////////////////////////////////////////////////////////////////
42
+ }
admin/models/FMModelFormMakerPreview.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMModelFormMakerPreview {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
22
+ public function get_theme_css($id) {
23
+ global $wpdb;
24
+ $css = $wpdb->get_var($wpdb->prepare('SELECT css FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id));
25
+ return $css;
26
+ }
27
+
28
+ public function get_form($form_id) {
29
+ global $wpdb;
30
+ $form = $wpdb->get_var($wpdb->prepare('SELECT form_front FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $form_id));
31
+ return $form;
32
+ }
33
+ ////////////////////////////////////////////////////////////////////////////////////////
34
+ // Getters & Setters //
35
+ ////////////////////////////////////////////////////////////////////////////////////////
36
+ ////////////////////////////////////////////////////////////////////////////////////////
37
+ // Private Methods //
38
+ ////////////////////////////////////////////////////////////////////////////////////////
39
+ ////////////////////////////////////////////////////////////////////////////////////////
40
+ // Listeners //
41
+ ////////////////////////////////////////////////////////////////////////////////////////
42
+ }
admin/models/FMModelFormmakerwdcaptcha.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMModelFormmakerwdcaptcha {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Getters & Setters //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ ////////////////////////////////////////////////////////////////////////////////////////
26
+ // Private Methods //
27
+ ////////////////////////////////////////////////////////////////////////////////////////
28
+ ////////////////////////////////////////////////////////////////////////////////////////
29
+ // Listeners //
30
+ ////////////////////////////////////////////////////////////////////////////////////////
31
+ }
admin/models/FMModelFormmakerwindow.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMModelFormmakerwindow {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
22
+ public function get_form_data() {
23
+ global $wpdb;
24
+ $row = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker order by `id` DESC");
25
+ return $row;
26
+ }
27
+ ////////////////////////////////////////////////////////////////////////////////////////
28
+ // Getters & Setters //
29
+ ////////////////////////////////////////////////////////////////////////////////////////
30
+ ////////////////////////////////////////////////////////////////////////////////////////
31
+ // Private Methods //
32
+ ////////////////////////////////////////////////////////////////////////////////////////
33
+ ////////////////////////////////////////////////////////////////////////////////////////
34
+ // Listeners //
35
+ ////////////////////////////////////////////////////////////////////////////////////////
36
+ }
admin/models/FMModelFromeditcountryinpopup.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMModelFromeditcountryinpopup {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Getters & Setters //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ ////////////////////////////////////////////////////////////////////////////////////////
26
+ // Private Methods //
27
+ ////////////////////////////////////////////////////////////////////////////////////////
28
+ ////////////////////////////////////////////////////////////////////////////////////////
29
+ // Listeners //
30
+ ////////////////////////////////////////////////////////////////////////////////////////
31
+ }
admin/models/FMModelFrommapeditinpopup.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMModelFrommapeditinpopup {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Getters & Setters //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ ////////////////////////////////////////////////////////////////////////////////////////
26
+ // Private Methods //
27
+ ////////////////////////////////////////////////////////////////////////////////////////
28
+ ////////////////////////////////////////////////////////////////////////////////////////
29
+ // Listeners //
30
+ ////////////////////////////////////////////////////////////////////////////////////////
31
+ }
admin/models/FMModelGenerete_csv.php ADDED
@@ -0,0 +1,262 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMModelGenerete_csv {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
22
+ public function get_data() {
23
+ $is_paypal_info = FALSE;
24
+ global $wpdb;
25
+ $params = array();
26
+ $form_id = $_REQUEST['form_id'];
27
+ $paypal_info_fields = array('currency', 'ord_last_modified', 'status', 'full_name', 'fax', 'mobile_phone', 'email', 'phone', 'address', 'paypal_info', 'ipn', 'tax', 'shipping');
28
+ $query = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker_submits where form_id= %d ORDER BY date ASC", $form_id);
29
+ $rows = $wpdb->get_results($query);
30
+ $n = count($rows);
31
+ $labels = array();
32
+ for ($i = 0; $i < $n; $i++) {
33
+ $row = &$rows[$i];
34
+ if (!in_array($row->element_label, $labels)) {
35
+ array_push($labels, $row->element_label);
36
+ }
37
+ }
38
+ $label_titles = array();
39
+ $sorted_labels = array();
40
+ $query_lable = $wpdb->prepare("SELECT label_order,title FROM " . $wpdb->prefix . "formmaker where id= %d", $form_id);
41
+ $rows_lable = $wpdb->get_results($query_lable);
42
+ $ptn = "/[^a-zA-Z0-9_]/";
43
+ $rpltxt = "";
44
+ $title = preg_replace($ptn, $rpltxt, $rows_lable[0]->title);
45
+ $sorted_labels_id = array();
46
+ $sorted_labels = array();
47
+ $label_titles = array();
48
+ if ($labels) {
49
+ $label_id = array();
50
+ $label_order = array();
51
+ $label_order_original = array();
52
+ $label_type = array();
53
+ ///stexic
54
+ $label_all = explode('#****#', $rows_lable[0]->label_order);
55
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
56
+ foreach ($label_all as $key => $label_each) {
57
+ $label_id_each = explode('#**id**#', $label_each);
58
+ array_push($label_id, $label_id_each[0]);
59
+ $label_oder_each = explode('#**label**#', $label_id_each[1]);
60
+ array_push($label_order_original, $label_oder_each[0]);
61
+ $ptn = "/[^a-zA-Z0-9_]/";
62
+ $rpltxt = "";
63
+ $label_temp = preg_replace($ptn, $rpltxt, $label_oder_each[0]);
64
+ array_push($label_order, $label_temp);
65
+ array_push($label_type, $label_oder_each[1]);
66
+ }
67
+ foreach ($label_id as $key => $label) {
68
+ if (in_array($label, $labels)) {
69
+ array_push($sorted_labels, $label_order[$key]);
70
+ array_push($sorted_labels_id, $label);
71
+ array_push($label_titles, stripslashes($label_order_original[$key]));
72
+ }
73
+ }
74
+ }
75
+ $m = count($sorted_labels);
76
+ $group_id_s = array();
77
+ $l = 0;
78
+ if (count($rows) > 0 and $m)
79
+ for ($i = 0; $i < count($rows); $i++) {
80
+ $row = &$rows[$i];
81
+ if (!in_array($row->group_id, $group_id_s)) {
82
+ array_push($group_id_s, $row->group_id);
83
+ }
84
+ }
85
+ $data = array();
86
+ $temp_all = array();
87
+ for ($j = 0; $j < $n; $j++) {
88
+ $row = &$rows[$j];
89
+ $key = $row->group_id;
90
+ if (!isset($temp_all[$key])) {
91
+ $temp_all[$key] = array();
92
+ }
93
+ array_push($temp_all[$key], $row);
94
+ }
95
+ for ($www = 0; $www < count($group_id_s); $www++) {
96
+ $i = $group_id_s[$www];
97
+ $temp = array();
98
+ $temp = $temp_all[$i];
99
+ $f = $temp[0];
100
+ $date = $f->date;
101
+ $ip = $f->ip;
102
+ $data_temp['Submit date'] = $date;
103
+ $data_temp['Ip'] = $ip;
104
+ $ttt = count($temp);
105
+ for ($h = 0; $h < $m; $h++) {
106
+ $data_temp[stripslashes($label_titles[$h])] = '';
107
+ for ($g = 0; $g < $ttt; $g++) {
108
+ $t = $temp[$g];
109
+ if ($t->element_label == $sorted_labels_id[$h]) {
110
+ if (strpos($t->element_value, "*@@url@@*")) {
111
+ $file_names = '';
112
+ $new_files = explode("*@@url@@*", $t->element_value);
113
+ foreach ($new_files as $new_file) {
114
+ if ($new_file) {
115
+ $file_names .= $new_file . ", ";
116
+ }
117
+ }
118
+ $data_temp[stripslashes($label_titles[$h])] = $file_names;
119
+ }
120
+ elseif (strpos($t->element_value, "***br***")) {
121
+ $element_value = str_replace("***br***", ', ', $t->element_value);
122
+ if (strpos($element_value, "***quantity***")) {
123
+ $element_value = str_replace("***quantity***", '', $element_value);
124
+ }
125
+ if (strpos($element_value, "***property***")) {
126
+ $element_value = str_replace("***property***", '', $element_value);
127
+ }
128
+ if(substr($element_value, -2) == ', ') {
129
+ $data_temp[stripslashes($label_titles[$h])]= substr($element_value, 0, -2);
130
+ }
131
+ else {
132
+ $data_temp[stripslashes($label_titles[$h])]= $element_value;
133
+ }
134
+ }
135
+ elseif (strpos($t->element_value, "***map***")) {
136
+ $data_temp[stripslashes($label_titles[$h])] = 'Longitude:' . substr(str_replace("***map***", ', Latitude:', $t->element_value), 0, -2);
137
+ }
138
+ elseif (strpos($t->element_value, "***star_rating***")) {
139
+ $element = str_replace("***star_rating***", '', $t->element_value);
140
+ $element = explode("***", $element);
141
+ $data_temp[stripslashes($label_titles[$h])] = ' ' . $element[1] . '/' . $element[0];
142
+ }
143
+ elseif (strpos($t->element_value, "@@@") || $t->element_value == "@@@" || $t->element_value == "@@@@@@@@@") {
144
+ $data_temp[stripslashes($label_titles[$h])] = str_replace("@@@", ' ', $t->element_value);
145
+ }
146
+ elseif (strpos($t->element_value, "***grading***")) {
147
+ $element = str_replace("***grading***", '', $t->element_value);
148
+ $grading = explode(":", $element);
149
+ $items_count = sizeof($grading) - 1;
150
+ $items = "";
151
+ $total = "";
152
+ for ($k = 0; $k < $items_count / 2; $k++) {
153
+ $items .= $grading[$items_count / 2 + $k] . ": " . $grading[$k] . ", ";
154
+ $total += $grading[$k];
155
+ }
156
+ $items .= "Total: " . $total;
157
+ $data_temp[stripslashes($label_titles[$h])] = $items;
158
+ }
159
+ elseif (strpos($t->element_value, "***matrix***")) {
160
+ $element = str_replace("***matrix***", '', $t->element_value);
161
+ $matrix_value = explode('***', $element);
162
+ $matrix_value = array_slice($matrix_value, 0, count($matrix_value) - 1);
163
+ $mat_rows = $matrix_value[0];
164
+ $mat_columns = $matrix_value[$mat_rows + 1];
165
+ $matrix = "";
166
+ $aaa = Array();
167
+ $var_checkbox = 1;
168
+ $selected_value = "";
169
+ $selected_value_yes = "";
170
+ $selected_value_no = "";
171
+ for ($k = 1; $k <= $mat_rows; $k++) {
172
+ if ($matrix_value[$mat_rows + $mat_columns + 2] == "radio") {
173
+ if ($matrix_value[$mat_rows + $mat_columns + 2 + $k] == 0) {
174
+ $checked = "0";
175
+ $aaa[1] = "";
176
+ }
177
+ else {
178
+ $aaa = explode("_", $matrix_value[$mat_rows + $mat_columns + 2 + $k]);
179
+ }
180
+ for ($l = 1; $l <= $mat_columns; $l++) {
181
+ if ($aaa[1] == $l) {
182
+ $checked = '1';
183
+ }
184
+ else {
185
+ $checked = '0';
186
+ }
187
+ $matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$checked."; ";
188
+ }
189
+ }
190
+ else {
191
+ if ($matrix_value[$mat_rows+$mat_columns + 2] == "checkbox") {
192
+ for ($l = 1; $l <= $mat_columns; $l++) {
193
+ if ($matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox] == 1) {
194
+ $checked = '1';
195
+ }
196
+ else {
197
+ $checked = '0';
198
+ }
199
+ $matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$checked."; ";
200
+ $var_checkbox++;
201
+ }
202
+ }
203
+ else {
204
+ if ($matrix_value[$mat_rows+$mat_columns + 2] == "text") {
205
+ for ($l = 1; $l <= $mat_columns; $l++) {
206
+ $text_value = $matrix_value[$mat_rows+$mat_columns+2+$var_checkbox];
207
+ $matrix .='['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$text_value."; ";
208
+ $var_checkbox++;
209
+ }
210
+ }
211
+ else {
212
+ for ($l = 1; $l <= $mat_columns; $l++) {
213
+ $selected_text = $matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox];
214
+ $matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows + 1 + $l].']='.$selected_text."; ";
215
+ $var_checkbox++;
216
+ }
217
+ }
218
+ }
219
+ }
220
+ }
221
+ $data_temp[stripslashes($label_titles[$h])] = $matrix;
222
+ }
223
+ else {
224
+ $val = htmlspecialchars_decode($t->element_value);
225
+ $val = stripslashes(str_replace('&#039;', "'", $val));
226
+ $data_temp[stripslashes($label_titles[$h])] = ($t->element_value ? $val : '');
227
+ }
228
+ }
229
+ }
230
+ }
231
+ $query = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker_sessions where group_id= %d", $f->group_id);
232
+ $paypal_info = $wpdb->get_results($query);
233
+ if ($paypal_info) {
234
+ $is_paypal_info = TRUE;
235
+ }
236
+ if ($is_paypal_info) {
237
+ foreach ($paypal_info_fields as $paypal_info_field) {
238
+ if ($paypal_info) {
239
+ $data_temp['PAYPAL_' . $paypal_info_field] = $paypal_info[0]->$paypal_info_field;
240
+ }
241
+ else {
242
+ $data_temp['PAYPAL_' . $paypal_info_field] = '';
243
+ }
244
+ }
245
+ }
246
+ $data[] = $data_temp;
247
+ }
248
+ array_push($params, $data);
249
+ array_push($params, $title);
250
+ array_push($params, $is_paypal_info);
251
+ return $params;
252
+ }
253
+ ////////////////////////////////////////////////////////////////////////////////////////
254
+ // Getters & Setters //
255
+ ////////////////////////////////////////////////////////////////////////////////////////
256
+ ////////////////////////////////////////////////////////////////////////////////////////
257
+ // Private Methods //
258
+ ////////////////////////////////////////////////////////////////////////////////////////
259
+ ////////////////////////////////////////////////////////////////////////////////////////
260
+ // Listeners //
261
+ ////////////////////////////////////////////////////////////////////////////////////////
262
+ }
admin/models/FMModelGenerete_xml.php ADDED
@@ -0,0 +1,260 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMModelGenerete_xml {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
22
+ public function get_data() {
23
+ $is_paypal_info = FALSE;
24
+ global $wpdb;
25
+ $params = array();
26
+ $form_id = $_REQUEST['form_id'];
27
+ $paypal_info_fields = array('ip', 'ord_date', 'ord_last_modified', 'status', 'full_name', 'fax', 'mobile_phone', 'email', 'phone', 'address', 'paypal_info', 'without_paypal_info', 'ipn', 'checkout_method', 'tax', 'shipping', 'shipping_type', 'read');
28
+ $query = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker_submits where form_id= %d ORDER BY date ASC", $form_id);
29
+ $rows = $wpdb->get_results($query);
30
+ $n = count($rows);
31
+ $labels = array();
32
+ for ($i = 0; $i < $n; $i++) {
33
+ $row = &$rows[$i];
34
+ if (!in_array($row->element_label, $labels)) {
35
+ array_push($labels, $row->element_label);
36
+ }
37
+ }
38
+ $label_titles = array();
39
+ $sorted_labels = array();
40
+ $query_lable = "SELECT label_order,title FROM " . $wpdb->prefix . "formmaker where id=$form_id ";
41
+ $rows_lable = $wpdb->get_results($query_lable);
42
+ $ptn = "/[^a-zA-Z0-9_]/";
43
+ $rpltxt = "";
44
+ $title = preg_replace($ptn, $rpltxt, $rows_lable[0]->title);
45
+ $sorted_labels_id = array();
46
+ $sorted_labels = array();
47
+ $label_titles = array();
48
+ if ($labels) {
49
+ $label_id = array();
50
+ $label_order = array();
51
+ $label_order_original = array();
52
+ $label_type = array();
53
+ $label_all = explode('#****#', $rows_lable[0]->label_order);
54
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
55
+ foreach ($label_all as $key => $label_each) {
56
+ $label_id_each = explode('#**id**#', $label_each);
57
+ array_push($label_id, $label_id_each[0]);
58
+ $label_oder_each = explode('#**label**#', $label_id_each[1]);
59
+ array_push($label_order_original, $label_oder_each[0]);
60
+ $ptn = "/[^a-zA-Z0-9_]/";
61
+ $rpltxt = "";
62
+ $label_temp = preg_replace($ptn, $rpltxt, $label_oder_each[0]);
63
+ array_push($label_order, $label_temp);
64
+ array_push($label_type, $label_oder_each[1]);
65
+ }
66
+ foreach ($label_id as $key => $label) {
67
+ if (in_array($label, $labels)) {
68
+ array_push($sorted_labels, $label_order[$key]);
69
+ array_push($sorted_labels_id, $label);
70
+ array_push($label_titles, stripslashes($label_order_original[$key]));
71
+ }
72
+ }
73
+ }
74
+ $m = count($sorted_labels);
75
+ $group_id_s = array();
76
+ $l = 0;
77
+ if (count($rows) > 0 and $m) {
78
+ for ($i = 0; $i < count($rows); $i++) {
79
+ $row = &$rows[$i];
80
+ if (!in_array($row->group_id, $group_id_s)) {
81
+ array_push($group_id_s, $row->group_id);
82
+ }
83
+ }
84
+ }
85
+ $data = array();
86
+ $temp_all = array();
87
+ for ($j = 0; $j < $n; $j++) {
88
+ $row = &$rows[$j];
89
+ $key = $row->group_id;
90
+ if (!isset($temp_all[$key])) {
91
+ $temp_all[$key] = array();
92
+ }
93
+ array_push($temp_all[$key], $row);
94
+ }
95
+ for ($www = 0; $www < count($group_id_s); $www++) {
96
+ $i = $group_id_s[$www];
97
+ $temp = array();
98
+ $temp = $temp_all[$i];
99
+ $f = $temp[0];
100
+ $date = $f->date;
101
+ $ip = $f->ip;
102
+ $data_temp['Submit date'] = $date;
103
+ $data_temp['Ip'] = $ip;
104
+ $ttt = count($temp);
105
+ for ($h = 0; $h < $m; $h++) {
106
+ for ($g = 0; $g < $ttt; $g++) {
107
+ $t = $temp[$g];
108
+ if ($t->element_label == $sorted_labels_id[$h]) {
109
+ if (strpos($t->element_value, "*@@url@@*")) {
110
+ $file_names = '';
111
+ $new_files = explode("*@@url@@*", $t->element_value);
112
+ foreach ($new_files as $new_file) {
113
+ if ($new_file) {
114
+ $file_names .= $new_file . ", ";
115
+ }
116
+ }
117
+ $data_temp[stripslashes($label_titles[$h])] = $file_names;
118
+ }
119
+ elseif (strpos($t->element_value, "***br***")) {
120
+ $element_value = str_replace("***br***", ', ', $t->element_value);
121
+ if (strpos($element_value, "***quantity***")) {
122
+ $element_value = str_replace("***quantity***", '', $element_value);
123
+ }
124
+ if (strpos($element_value, "***property***")) {
125
+ $element_value = str_replace("***property***", '', $element_value);
126
+ }
127
+ if(substr($element_value, -2) == ', ') {
128
+ $data_temp[stripslashes($label_titles[$h])]= substr($element_value, 0, -2);
129
+ }
130
+ else {
131
+ $data_temp[stripslashes($label_titles[$h])]= $element_value;
132
+ }
133
+ }
134
+ elseif (strpos($t->element_value, "***map***")) {
135
+ $data_temp[stripslashes($label_titles[$h])] = 'Longitude:' . substr(str_replace("***map***", ', Latitude:', $t->element_value), 0, -2);
136
+ }
137
+ elseif (strpos($t->element_value,"***star_rating***")) {
138
+ $element = str_replace("***star_rating***", '', $t->element_value);
139
+ $element = explode("***", $element);
140
+ $data_temp[stripslashes($label_titles[$h])] = ' ' . $element[1] . '/' . $element[0];
141
+ }
142
+ elseif (strpos($t->element_value, "@@@") || $t->element_value == "@@@" || $t->element_value == "@@@@@@@@@") {
143
+ $data_temp[stripslashes($label_titles[$h])] = str_replace("@@@", ' ', $t->element_value);
144
+ }
145
+ elseif (strpos($t->element_value, "***grading***")) {
146
+ $element = str_replace("***grading***", '', $t->element_value);
147
+ $grading = explode(":", $element);
148
+ $items_count = sizeof($grading) - 1;
149
+ $items = "";
150
+ $total = "";
151
+ for ($k = 0; $k < $items_count / 2; $k++) {
152
+ $items .= $grading[$items_count / 2 + $k] . ": " . $grading[$k] . ", ";
153
+ $total += $grading[$k];
154
+ }
155
+ $items .= "Total: " . $total;
156
+ $data_temp[stripslashes($label_titles[$h])] = $items;
157
+ }
158
+ elseif (strpos($t->element_value, "***matrix***")) {
159
+ $element = str_replace("***matrix***", '', $t->element_value);
160
+ $matrix_value = explode('***', $element);
161
+ $matrix_value = array_slice($matrix_value, 0, count($matrix_value) - 1);
162
+ $mat_rows = $matrix_value[0];
163
+ $mat_columns = $matrix_value[$mat_rows + 1];
164
+ $matrix = "";
165
+ $aaa = Array();
166
+ $var_checkbox = 1;
167
+ $selected_value = "";
168
+ $selected_value_yes = "";
169
+ $selected_value_no = "";
170
+ for ($k = 1; $k <= $mat_rows; $k++) {
171
+ if ($matrix_value[$mat_rows + $mat_columns + 2] == "radio") {
172
+ if ($matrix_value[$mat_rows + $mat_columns + 2 + $k] == 0) {
173
+ $checked = "0";
174
+ $aaa[1] = "";
175
+ }
176
+ else {
177
+ $aaa = explode("_", $matrix_value[$mat_rows + $mat_columns + 2 + $k]);
178
+ }
179
+ for ($l = 1; $l <= $mat_columns; $l++) {
180
+ if ($aaa[1] == $l) {
181
+ $checked = '1';
182
+ }
183
+ else {
184
+ $checked = '0';
185
+ }
186
+ $matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$checked."; ";
187
+ }
188
+ }
189
+ else {
190
+ if ($matrix_value[$mat_rows+$mat_columns + 2] == "checkbox") {
191
+ for ($l = 1; $l <= $mat_columns; $l++) {
192
+ if ($matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox] == 1) {
193
+ $checked = '1';
194
+ }
195
+ else {
196
+ $checked = '0';
197
+ }
198
+ $matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$checked."; ";
199
+ $var_checkbox++;
200
+ }
201
+ }
202
+ else {
203
+ if ($matrix_value[$mat_rows+$mat_columns + 2] == "text") {
204
+ for ($l = 1; $l <= $mat_columns; $l++) {
205
+ $text_value = $matrix_value[$mat_rows+$mat_columns+2+$var_checkbox];
206
+ $matrix .='['.$matrix_value[$k].','.$matrix_value[$mat_rows+1+$l].']='.$text_value."; ";
207
+ $var_checkbox++;
208
+ }
209
+ }
210
+ else {
211
+ for ($l = 1; $l <= $mat_columns; $l++) {
212
+ $selected_text = $matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox];
213
+ $matrix .= '['.$matrix_value[$k].','.$matrix_value[$mat_rows + 1 + $l].']='.$selected_text."; ";
214
+ $var_checkbox++;
215
+ }
216
+ }
217
+ }
218
+ }
219
+ }
220
+ $data_temp[stripslashes($label_titles[$h])] = $matrix;
221
+ }
222
+ else {
223
+ $val = str_replace('&amp;', "&", $t->element_value);
224
+ $val = stripslashes(str_replace('&#039;', "'", $t->element_value));
225
+ $data_temp[stripslashes($label_titles[$h])] = ($t->element_value ? $val : '');
226
+ }
227
+ }
228
+ }
229
+ }
230
+ $query = $wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker_sessions where group_id= %d", $f->group_id);
231
+ $paypal_info = $wpdb->get_results($query);
232
+ if ($paypal_info) {
233
+ $is_paypal_info = TRUE;
234
+ }
235
+ if ($is_paypal_info) {
236
+ foreach ($paypal_info_fields as $paypal_info_field) {
237
+ if ($paypal_info) {
238
+ $data_temp['PAYPAL_' . $paypal_info_field] = $paypal_info[0]->$paypal_info_field;
239
+ }
240
+ else {
241
+ $data_temp['PAYPAL_' . $paypal_info_field] = '';
242
+ }
243
+ }
244
+ }
245
+ $data[] = $data_temp;
246
+ }
247
+ array_push($params, $data);
248
+ array_push($params, $title);
249
+ return $params;
250
+ }
251
+ ////////////////////////////////////////////////////////////////////////////////////////
252
+ // Getters & Setters //
253
+ ////////////////////////////////////////////////////////////////////////////////////////
254
+ ////////////////////////////////////////////////////////////////////////////////////////
255
+ // Private Methods //
256
+ ////////////////////////////////////////////////////////////////////////////////////////
257
+ ////////////////////////////////////////////////////////////////////////////////////////
258
+ // Listeners //
259
+ ////////////////////////////////////////////////////////////////////////////////////////
260
+ }
admin/models/FMModelLicensing_fm.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMModelLicensing_fm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ ////////////////////////////////////////////////////////////////////////////////////////
22
+ // Getters & Setters //
23
+ ////////////////////////////////////////////////////////////////////////////////////////
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ // Private Methods //
26
+ ////////////////////////////////////////////////////////////////////////////////////////
27
+ ////////////////////////////////////////////////////////////////////////////////////////
28
+ // Listeners //
29
+ ////////////////////////////////////////////////////////////////////////////////////////
30
+ }
admin/models/FMModelManage_fm.php ADDED
@@ -0,0 +1,1816 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMModelManage_fm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function get_rows_data() {
22
+ global $wpdb;
23
+ $where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
24
+ $asc_or_desc = ((isset($_POST['asc_or_desc'])) ? esc_html($_POST['asc_or_desc']) : 'asc');
25
+ $order_by = ' ORDER BY ' . ((isset($_POST['order_by']) && esc_html($_POST['order_by']) != '') ? esc_html($_POST['order_by']) : 'id') . ' ' . $asc_or_desc;
26
+ if (isset($_POST['page_number']) && $_POST['page_number']) {
27
+ $limit = ((int) $_POST['page_number'] - 1) * 20;
28
+ }
29
+ else {
30
+ $limit = 0;
31
+ }
32
+ $query = "SELECT * FROM " . $wpdb->prefix . "formmaker " . $where . $order_by . " LIMIT " . $limit . ",20";
33
+ $rows = $wpdb->get_results($query);
34
+ return $rows;
35
+ }
36
+
37
+ public function get_row_data($id) {
38
+ global $wpdb;
39
+ if ($id != 0) {
40
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
41
+ }
42
+ else {
43
+ $row = new stdClass();
44
+ $row->id = 0;
45
+ $row->title = '';
46
+ $row->mail = '';
47
+ $row->form = '';
48
+ $row->form_front = '';
49
+ $row->theme = 0;
50
+ $row->javascript = '';
51
+ $row->submit_text = '';
52
+ $row->url = '';
53
+ $row->submit_text_type = 0;
54
+ $row->script1 = '';
55
+ $row->script2 = '';
56
+ $row->script_user1 = '';
57
+ $row->script_user2 = '';
58
+ $row->counter = 0;
59
+ $row->label_order = '';
60
+ $row->article_id = '';
61
+ $row->pagination = '';
62
+ $row->show_title = '';
63
+ $row->show_numbers = '';
64
+ $row->public_key = '';
65
+ $row->private_key = '';
66
+ $row->recaptcha_theme = '';
67
+ $row->from_name = '';
68
+ $row->from_mail = '';
69
+ $row->label_order_current = '';
70
+ $row->script_mail_user = '';
71
+ $row->script_mail = '';
72
+ $row->tax = 0;
73
+ $row->payment_currency = '$';
74
+ $row->paypal_email = '';
75
+ $row->checkout_mode = 'testmode';
76
+ $row->paypal_mode = 0;
77
+
78
+ $row->published = 1;
79
+ $row->form_fields = '';
80
+ $row->savedb = 1;
81
+ $row->sendemail = 1;
82
+ $row->requiredmark = '*';
83
+ $row->reply_to = 0;
84
+ $row->send_to = 0;
85
+ $row->autogen_layout = 1;
86
+ $row->custom_front = '';
87
+ $row->mail_from_user = '';
88
+ $row->mail_from_name_user = '';
89
+ $row->reply_to_user = '';
90
+ }
91
+ return $row;
92
+ }
93
+
94
+ public function get_row_data_new($id) {
95
+ global $wpdb;
96
+ if ($id != 0) {
97
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker WHERE id="%d"', $id));
98
+ $labels2 = array();
99
+ $label_id = array();
100
+ $label_order_original = array();
101
+ $label_type = array();
102
+ $label_all = explode('#****#', $row->label_order);
103
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
104
+ foreach($label_all as $key => $label_each) {
105
+ $label_id_each=explode('#**id**#',$label_each);
106
+ array_push($label_id, $label_id_each[0]);
107
+ $label_oder_each=explode('#**label**#', $label_id_each[1]);
108
+ array_push($label_order_original, addslashes($label_oder_each[0]));
109
+ array_push($label_type, $label_oder_each[1]);
110
+ }
111
+ $labels2['id'] = '"' . implode('","', $label_id) . '"';
112
+ $labels2['label'] = '"' . implode('","', $label_order_original) . '"';
113
+ $labels2['type'] = '"' . implode('","', $label_type) . '"';
114
+ $ids = array();
115
+ $types = array();
116
+ $labels = array();
117
+ $paramss = array();
118
+ $fields = explode('*:*new_field*:*', $row->form_fields);
119
+ $fields = array_slice($fields, 0, count($fields) - 1);
120
+ foreach ($fields as $field) {
121
+ $temp=explode('*:*id*:*',$field);
122
+ array_push($ids, $temp[0]);
123
+ $temp=explode('*:*type*:*',$temp[1]);
124
+ array_push($types, $temp[0]);
125
+ $temp=explode('*:*w_field_label*:*',$temp[1]);
126
+ array_push($labels, $temp[0]);
127
+ array_push($paramss, $temp[1]);
128
+ }
129
+ $form = $row->form_front;
130
+ foreach ($ids as $ids_key => $id) {
131
+ $label = $labels[$ids_key];
132
+ $type = $types[$ids_key];
133
+ $params = $paramss[$ids_key];
134
+ if (strpos($form, '%'.$id.' - '.$label.'%')) {
135
+ $rep = '';
136
+ $param = array();
137
+ $param['attributes'] = '';
138
+ switch ($type) {
139
+ case 'type_section_break': {
140
+ $params_names = array('w_editor');
141
+ $temp = $params;
142
+ foreach ($params_names as $params_name) {
143
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
144
+ $param[$params_name] = $temp[0];
145
+ $temp = $temp[1];
146
+ }
147
+ $rep ='<div id="wdform_field'.$id.'" type="type_section_break" class="wdform_field_section_break"><span id="'.$id.'_element_labelform_id_temp" style="display: none;">custom_'.$id.'</span><div id="'.$id.'_element_sectionform_id_temp" align="left" class="wdform_section_break">'.html_entity_decode($param['w_editor']).'</div></div>';
148
+ break;
149
+ }
150
+ case 'type_editor': {
151
+ $params_names = array('w_editor');
152
+ $temp = $params;
153
+ foreach ($params_names as $params_name ) {
154
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
155
+ $param[$params_name] = $temp[0];
156
+ $temp = $temp[1];
157
+ }
158
+ $rep ='<div id="wdform_field'.$id.'" type="type_editor" class="wdform_field" style="display: table-cell;">'.html_entity_decode($param['w_editor']).'</div><span id="'.$id.'_element_labelform_id_temp" style="display: none;">custom_'.$id.'</span>';
159
+ break;
160
+ }
161
+ case 'type_send_copy': {
162
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_first_val', 'w_required');
163
+ $temp = $params;
164
+ foreach ($params_names as $params_name ) {
165
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
166
+ $param[$params_name] = $temp[0];
167
+ $temp = $temp[1];
168
+ }
169
+ if ($temp) {
170
+ $temp = explode('*:*w_attr_name*:*', $temp);
171
+ $attrs = array_slice($temp, 0, count($temp) - 1);
172
+ foreach ($attrs as $attr) {
173
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
174
+ }
175
+ }
176
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
177
+ $input_active = ($param['w_first_val'] == 'true' ? "checked='checked'" : "");
178
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
179
+ $rep = '<div id="wdform_field'.$id.'" type="type_send_copy" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" style="display: '.$param['w_field_label_pos'].'"><input type="hidden" value="type_send_copy" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="checkbox" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" onclick="set_checked(&quot;'.$id.'&quot;,&quot;&quot;,&quot;form_id_temp&quot;)" '.$input_active.' '.$param['attributes'].'></div></div>';
180
+ break;
181
+ }
182
+ case 'type_text': {
183
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_first_val', 'w_title', 'w_required', 'w_unique');
184
+ $temp = $params;
185
+ foreach ($params_names as $params_name) {
186
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
187
+ $param[$params_name] = $temp[0];
188
+ $temp = $temp[1];
189
+ }
190
+ if ($temp) {
191
+ $temp = explode('*:*w_attr_name*:*', $temp);
192
+ $attrs = array_slice($temp, 0, count($temp) - 1);
193
+ foreach ($attrs as $attr) {
194
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
195
+ }
196
+ }
197
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
198
+ $input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
199
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
200
+ $rep = '<div id="wdform_field'.$id.'" type="type_text" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" style="display: '.$param['w_field_label_pos'].'"><input type="hidden" value="type_text" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><input type="text" class="'.$input_active.'" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" value="'.$param['w_first_val'].'" title="'.$param['w_title'].'" onfocus="delete_value(&quot;'.$id.'_elementform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_elementform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_elementform_id_temp&quot;)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].'></div></div>';
201
+ break;
202
+ }
203
+ case 'type_number': {
204
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_first_val', 'w_title', 'w_required', 'w_unique', 'w_class');
205
+ $temp = $params;
206
+ foreach ($params_names as $params_name) {
207
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
208
+ $param[$params_name] = $temp[0];
209
+ $temp = $temp[1];
210
+ }
211
+ if ($temp) {
212
+ $temp = explode('*:*w_attr_name*:*', $temp);
213
+ $attrs = array_slice($temp, 0, count($temp) - 1);
214
+ foreach ($attrs as $attr) {
215
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
216
+ }
217
+ }
218
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
219
+ $input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
220
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
221
+ $rep = '<div id="wdform_field'.$id.'" type="type_number" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'"><input type="hidden" value="type_number" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><input type="text" class="'.$input_active.'" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" value="'.$param['w_first_val'].'" title="'.$param['w_title'].'" onkeypress="return check_isnum(event)" onfocus="delete_value(&quot;'.$id.'_elementform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_elementform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_elementform_id_temp&quot;)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].'></div></div>';
222
+ break;
223
+ }
224
+ case 'type_password': {
225
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_required', 'w_unique', 'w_class');
226
+ $temp = $params;
227
+ foreach ($params_names as $params_name) {
228
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
229
+ $param[$params_name] = $temp[0];
230
+ $temp = $temp[1];
231
+ }
232
+ if ($temp) {
233
+ $temp = explode('*:*w_attr_name*:*', $temp);
234
+ $attrs = array_slice($temp, 0, count($temp) - 1);
235
+ foreach ($attrs as $attr) {
236
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
237
+ }
238
+ }
239
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
240
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
241
+ $rep = '<div id="wdform_field'.$id.'" type="type_password" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'"><input type="hidden" value="type_password" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><input type="password" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" style="width: '.$param['w_size'].'px;" '.$param['attributes'].'></div></div>';
242
+ break;
243
+ }
244
+ case 'type_textarea': {
245
+ $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');
246
+ $temp = $params;
247
+ foreach ($params_names as $params_name) {
248
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
249
+ $param[$params_name] = $temp[0];
250
+ $temp = $temp[1];
251
+ }
252
+ if ($temp) {
253
+ $temp = explode('*:*w_attr_name*:*', $temp);
254
+ $attrs = array_slice($temp, 0, count($temp) - 1);
255
+ foreach ($attrs as $attr) {
256
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
257
+ }
258
+ }
259
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
260
+ $input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
261
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
262
+ $rep = '<div id="wdform_field'.$id.'" type="type_textarea" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display:'.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;vertical-align:top;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: table-cell;"><input type="hidden" value="type_textarea" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><textarea class="'.$input_active.'" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" title="'.$param['w_title'].'" onfocus="delete_value(&quot;'.$id.'_elementform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_elementform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_elementform_id_temp&quot;)" style="width: '.$param['w_size_w'].'px; height: '.$param['w_size_h'].'px;" '.$param['attributes'].'>'.$param['w_first_val'].'</textarea></div></div>';
263
+ break;
264
+ }
265
+ case 'type_wdeditor': {
266
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size_w', 'w_size_h', 'w_title', 'w_required', 'w_class');
267
+ $temp = $params;
268
+ foreach ($params_names as $params_name) {
269
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
270
+ $param[$params_name] = $temp[0];
271
+ $temp = $temp[1];
272
+ }
273
+ if ($temp) {
274
+ $temp = explode('*:*w_attr_name*:*', $temp);
275
+ $attrs = array_slice($temp, 0, count($temp) - 1);
276
+ foreach ($attrs as $attr) {
277
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
278
+ }
279
+ }
280
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
281
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
282
+ $rep = '<div id="wdform_field'.$id.'" type="type_wdeditor" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display:'.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: table-cell;"><input type="hidden" value="type_wdeditor" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp">
283
+ <input class="" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" type="hidden" value="" title="'.$param['w_title'].'" style="width: '.$param['w_size_w'].'px; height: '.$param['w_size_h'].'px;" '.$param['attributes'].'><span style="color: red; font-style: italic;">Editor doesn\'t display in back end</span></div></div>';
284
+ break;
285
+ }
286
+ case 'type_phone': {
287
+ $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');
288
+ $temp = $params;
289
+ foreach ($params_names as $params_name) {
290
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
291
+ $param[$params_name] = $temp[0];
292
+ $temp = $temp[1];
293
+ }
294
+ if ($temp) {
295
+ $temp = explode('*:*w_attr_name*:*', $temp);
296
+ $attrs = array_slice($temp, 0, count($temp) - 1);
297
+ foreach ($attrs as $attr) {
298
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
299
+ }
300
+ }
301
+ $w_first_val = explode('***', $param['w_first_val']);
302
+ $w_title = explode('***', $param['w_title']);
303
+ $w_mini_labels = explode('***', $param['w_mini_labels']);
304
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
305
+ $input_active = ($param['w_first_val'] == $param['w_title'] ? "input_deactive" : "input_active");
306
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
307
+ $rep = '<div id="wdform_field'.$id.'" type="type_phone" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_phone" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><div id="'.$id.'_table_name" style="display: table;"><div id="'.$id.'_tr_name1" style="display: table-row;"><div id="'.$id.'_td_name_input_first" style="display: table-cell;"><input type="text" class="'.$input_active.'" id="'.$id.'_element_firstform_id_temp" name="'.$id.'_element_firstform_id_temp" value="'.$w_first_val[0].'" title="'.$w_title[0].'" onfocus="delete_value(&quot;'.$id.'_element_firstform_id_temp&quot;)"onblur="return_value(&quot;'.$id.'_element_firstform_id_temp&quot;)"onchange="change_value(&quot;'.$id.'_element_firstform_id_temp&quot;)" onkeypress="return check_isnum(event)"style="width: 50px;" '.$param['attributes'].'><span class="wdform_line" style="margin: 0px 4px; padding: 0px;">-</span></div><div id="'.$id.'_td_name_input_last" style="display: table-cell;"><input type="text" class="'.$input_active.'" id="'.$id.'_element_lastform_id_temp" name="'.$id.'_element_lastform_id_temp" value="'.$w_first_val[1].'" title="'.$w_title[1].'" onfocus="delete_value(&quot;'.$id.'_element_lastform_id_temp&quot;)"onblur="return_value(&quot;'.$id.'_element_lastform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_element_lastform_id_temp&quot;)" onkeypress="return check_isnum(event)"style="width: '.$param['w_size'].'px;" '.$param['attributes'].'></div></div><div id="'.$id.'_tr_name2" style="display: table-row;"><div id="'.$id.'_td_name_label_first" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_area_code">'.$w_mini_labels[0].'</label></div><div id="'.$id.'_td_name_label_last" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_phone_number">'.$w_mini_labels[1].'</label></div></div></div></div></div>';
308
+ break;
309
+ }
310
+ case 'type_name': {
311
+ $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');
312
+ $temp = $params;
313
+ foreach ($params_names as $params_name) {
314
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
315
+ $param[$params_name] = $temp[0];
316
+ $temp = $temp[1];
317
+ }
318
+ if ($temp) {
319
+ $temp = explode('*:*w_attr_name*:*', $temp);
320
+ $attrs = array_slice($temp, 0, count($temp) - 1);
321
+ foreach ($attrs as $attr) {
322
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
323
+ }
324
+ }
325
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
326
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
327
+ $w_first_val = explode('***', $param['w_first_val']);
328
+ $w_title = explode('***', $param['w_title']);
329
+ $w_mini_labels = explode('***', $param['w_mini_labels']);
330
+ if ($param['w_name_format'] == 'normal') {
331
+ $w_name_format = '<div id="'.$id.'_td_name_input_first" style="display: table-cell;"><input type="text" class="'.($w_first_val[0]==$w_title[0] ? "input_deactive" : "input_active").'" id="'.$id.'_element_firstform_id_temp" name="'.$id.'_element_firstform_id_temp" value="'.$w_first_val[0].'" title="'.$w_title[0].'" onfocus="delete_value(&quot;'.$id.'_element_firstform_id_temp&quot;)"onblur="return_value(&quot;'.$id.'_element_firstform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_element_firstform_id_temp&quot;)" style="margin-right: 10px; width: '.$param['w_size'].'px;"'.$param['attributes'].'></div><div id="'.$id.'_td_name_input_last" style="display: table-cell;"><input type="text" class="'.($w_first_val[1]==$w_title[1] ? "input_deactive" : "input_active").'" id="'.$id.'_element_lastform_id_temp" name="'.$id.'_element_lastform_id_temp" value="'.$w_first_val[1].'" title="'.$w_title[1].'" onfocus="delete_value(&quot;'.$id.'_element_lastform_id_temp&quot;)"onblur="return_value(&quot;'.$id.'_element_lastform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_element_lastform_id_temp&quot;)" style="margin-right: 10px; width: '.$param['w_size'].'px;" '.$param['attributes'].'></div>';
332
+ $w_name_format_mini_labels = '<div id="'.$id.'_tr_name2" style="display: table-row;"><div id="'.$id.'_td_name_label_first" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_first">'.$w_mini_labels[1].'</label></div><div id="'.$id.'_td_name_label_last" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_last">'.$w_mini_labels[2].'</label></div></div>';
333
+ }
334
+ else {
335
+ $w_name_format = '<div id="'.$id.'_td_name_input_title" style="display: table-cell;"><input type="text" class="'.($w_first_val[0]==$w_title[0] ? "input_deactive" : "input_active").'" id="'.$id.'_element_titleform_id_temp" name="'.$id.'_element_titleform_id_temp" value="'.$w_first_val[0].'" title="'.$w_title[0].'" onfocus="delete_value(&quot;'.$id.'_element_titleform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_element_titleform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_element_titleform_id_temp&quot;)" style="margin: 0px 10px 0px 0px; width: 40px;"></div><div id="'.$id.'_td_name_input_first" style="display: table-cell;"><input type="text" class="'.($w_first_val[1]==$w_title[1] ? "input_deactive" : "input_active").'" id="'.$id.'_element_firstform_id_temp" name="'.$id.'_element_firstform_id_temp" value="'.$w_first_val[1].'" title="'.$w_title[1].'" onfocus="delete_value(&quot;'.$id.'_element_firstform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_element_firstform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_element_firstform_id_temp&quot;)" style="margin-right: 10px; width: '.$param['w_size'].'px;"></div><div id="'.$id.'_td_name_input_last" style="display: table-cell;"><input type="text" class="'.($w_first_val[2]==$w_title[2] ? "input_deactive" : "input_active").'" id="'.$id.'_element_lastform_id_temp" name="'.$id.'_element_lastform_id_temp" value="'.$w_first_val[2].'" title="'.$w_title[2].'" onfocus="delete_value(&quot;'.$id.'_element_lastform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_element_lastform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_element_lastform_id_temp&quot;)" style="margin-right: 10px; width: '.$param['w_size'].'px;"></div><div id="'.$id.'_td_name_input_middle" style="display: table-cell;"><input type="text" class="'.($w_first_val[3]==$w_title[3] ? "input_deactive" : "input_active").'" id="'.$id.'_element_middleform_id_temp" name="'.$id.'_element_middleform_id_temp" value="'.$w_first_val[3].'" title="'.$w_title[3].'" onfocus="delete_value(&quot;'.$id.'_element_middleform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_element_middleform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_element_middleform_id_temp&quot;)" style="width: '.$param['w_size'].'px;"></div>';
336
+ $w_name_format_mini_labels ='<div id="'.$id.'_tr_name2" style="display: table-row;"><div id="'.$id.'_td_name_label_title" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_title">'.$w_mini_labels[0].'</label></div><div id="'.$id.'_td_name_label_first" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_first">'.$w_mini_labels[1].'</label></div><div id="'.$id.'_td_name_label_last" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_last">'.$w_mini_labels[2].'</label></div><div id="'.$id.'_td_name_label_middle" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_middle">'.$w_mini_labels[3].'</label></div></div>';
337
+ }
338
+ $rep = '<div id="wdform_field'.$id.'" type="type_name" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_name" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><div id="'.$id.'_table_name" cellpadding="0" cellspacing="0" style="display: table;"><div id="'.$id.'_tr_name1" style="display: table-row;">'.$w_name_format.' </div>'.$w_name_format_mini_labels.' </div></div></div>';
339
+ break;
340
+ }
341
+ case 'type_address': {
342
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_size', 'w_mini_labels', 'w_disabled_fields', 'w_required', 'w_class');
343
+ $temp = $params;
344
+ foreach ($params_names as $params_name) {
345
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
346
+ $param[$params_name] = $temp[0];
347
+ $temp = $temp[1];
348
+ }
349
+ if ($temp) {
350
+ $temp = explode('*:*w_attr_name*:*', $temp);
351
+ $attrs = array_slice($temp, 0, count($temp) - 1);
352
+ foreach ($attrs as $attr) {
353
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
354
+ }
355
+ }
356
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
357
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
358
+ $w_mini_labels = explode('***', $param['w_mini_labels']);
359
+ $w_disabled_fields = explode('***', $param['w_disabled_fields']);
360
+ $hidden_inputs = '';
361
+ $labels_for_id = array('street1', 'street2', 'city', 'state', 'postal', 'country');
362
+ foreach ($w_disabled_fields as $key => $w_disabled_field) {
363
+ if ($key != 6) {
364
+ if ($w_disabled_field == 'yes') {
365
+ $hidden_inputs .= '<input type="hidden" id="'.$id.'_'.$labels_for_id[$key].'form_id_temp" value="'.$w_mini_labels[$key].'" id_for_label="'.($id+$key).'">';
366
+ }
367
+ }
368
+ }
369
+ $address_fields = '';
370
+ $g = 0;
371
+ if (isset($w_disabled_fields[0]) && $w_disabled_fields[0] == 'no') {
372
+ $g += 2;
373
+ $address_fields .= '<span style="float: left; width: 100%; padding-bottom: 8px; display: block;"><input type="text" id="'.$id.'_street1form_id_temp" name="'.$id.'_street1form_id_temp" onchange="change_value(&quot;'.$id.'_street1form_id_temp&quot;)" style="width: 100%;" '.$param['attributes'].'><label class="mini_label" id="'.$id.'_mini_label_street1" style="display: block;">'.$w_mini_labels[0].'</label></span>';
374
+ }
375
+ if (isset($w_disabled_fields[1]) && $w_disabled_fields[1] == 'no') {
376
+ $g += 2;
377
+ $address_fields .= '<span style="float: left; width: 100%; padding-bottom: 8px; display: block;"><input type="text" id="'.$id.'_street2form_id_temp" name="'.($id+1).'_street2form_id_temp" onchange="change_value(&quot;'.$id.'_street2form_id_temp&quot;)" style="width: 100%;" '.$param['attributes'].'><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_street2">'.$w_mini_labels[1].'</label></span>';
378
+ }
379
+ if (isset($w_disabled_fields[2]) && $w_disabled_fields[2] == 'no') {
380
+ $g++;
381
+ $address_fields .= '<span style="float: left; width: 48%; padding-bottom: 8px;"><input type="text" id="'.$id.'_cityform_id_temp" name="'.($id+2).'_cityform_id_temp" onchange="change_value(&quot;'.$id.'_cityform_id_temp&quot;)" style="width: 100%;" '.$param['attributes'].'><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_city">'.$w_mini_labels[2].'</label></span>';
382
+ }
383
+ if (isset($w_disabled_fields[3]) && $w_disabled_fields[3] == 'no') {
384
+ $g++;
385
+ if (isset($w_disabled_fields[5]) && isset($w_disabled_fields[6]) && $w_disabled_fields[5] == 'yes' && $w_disabled_fields[6] == 'yes') {
386
+ $address_fields .= '<span style="float: '.(($g%2==0) ? 'right' : 'left').'; width: 48%; padding-bottom: 8px;"><select type="text" id="'.$id.'_stateform_id_temp" name="'.($id+3).'_stateform_id_temp" onchange="change_value(&quot;'.$id.'_stateform_id_temp&quot;)" style="width: 100%;" '.$param['attributes'].'><option value=""></option><option value="Alabama">Alabama</option><option value="Alaska">Alaska</option><option value="Arizona">Arizona</option><option value="Arkansas">Arkansas</option><option value="California">California</option><option value="Colorado">Colorado</option><option value="Connecticut">Connecticut</option><option value="Delaware">Delaware</option><option value="Florida">Florida</option><option value="Georgia">Georgia</option><option value="Hawaii">Hawaii</option><option value="Idaho">Idaho</option><option value="Illinois">Illinois</option><option value="Indiana">Indiana</option><option value="Iowa">Iowa</option><option value="Kansas">Kansas</option><option value="Kentucky">Kentucky</option><option value="Louisiana">Louisiana</option><option value="Maine">Maine</option><option value="Maryland">Maryland</option><option value="Massachusetts">Massachusetts</option><option value="Michigan">Michigan</option><option value="Minnesota">Minnesota</option><option value="Mississippi">Mississippi</option><option value="Missouri">Missouri</option><option value="Montana">Montana</option><option value="Nebraska">Nebraska</option><option value="Nevada">Nevada</option><option value="New Hampshire">New Hampshire</option><option value="New Jersey">New Jersey</option><option value="New Mexico">New Mexico</option><option value="New York">New York</option><option value="North Carolina">North Carolina</option><option value="North Dakota">North Dakota</option><option value="Ohio">Ohio</option><option value="Oklahoma">Oklahoma</option><option value="Oregon">Oregon</option><option value="Pennsylvania">Pennsylvania</option><option value="Rhode Island">Rhode Island</option><option value="South Carolina">South Carolina</option><option value="South Dakota">South Dakota</option><option value="Tennessee">Tennessee</option><option value="Texas">Texas</option><option value="Utah">Utah</option><option value="Vermont">Vermont</option><option value="Virginia">Virginia</option><option value="Washington">Washington</option><option value="West Virginia">West Virginia</option><option value="Wisconsin">Wisconsin</option><option value="Wyoming">Wyoming</option></select><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_state">'.$w_mini_labels[3].'</label></span>';
387
+ }
388
+ else {
389
+ $address_fields .= '<span style="float: '.(($g%2==0) ? 'right' : 'left').'; width: 48%; padding-bottom: 8px;"><input type="text" id="'.$id.'_stateform_id_temp" name="'.($id+3).'_stateform_id_temp" onchange="change_value(&quot;'.$id.'_stateform_id_temp&quot;)" style="width: 100%;" '.$param['attributes'].'><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_state">'.$w_mini_labels[3].'</label></span>';
390
+ }
391
+ }
392
+ if (isset($w_disabled_fields[4]) && $w_disabled_fields[4] == 'no') {
393
+ $g++;
394
+ $address_fields .= '<span style="float: '.(($g%2==0) ? 'right' : 'left').'; width: 48%; padding-bottom: 8px;"><input type="text" id="'.$id.'_postalform_id_temp" name="'.($id+4).'_postalform_id_temp" onchange="change_value(&quot;'.$id.'_postalform_id_temp&quot;)" style="width: 100%;" '.$param['attributes'].'><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_postal">'.$w_mini_labels[4].'</label></span>';
395
+ }
396
+ if (isset($w_disabled_fields[5]) && $w_disabled_fields[5] == 'no') {
397
+ $g++;
398
+ $address_fields .= '<span style="float: '.(($g%2==0) ? 'right' : 'left').'; width: 48%; padding-bottom: 8px;"><select type="text" id="'.$id.'_countryform_id_temp" name="'.($id+5).'_countryform_id_temp" onchange="change_value(&quot;'.$id.'_countryform_id_temp&quot;)" style="width: 100%;" '.$param['attributes'].'><option value=""></option><option value="Afghanistan">Afghanistan</option><option value="Albania">Albania</option><option value="Algeria">Algeria</option><option value="Andorra">Andorra</option><option value="Angola">Angola</option><option value="Antigua and Barbuda">Antigua and Barbuda</option><option value="Argentina">Argentina</option><option value="Armenia">Armenia</option><option value="Australia">Australia</option><option value="Austria">Austria</option><option value="Azerbaijan">Azerbaijan</option><option value="Bahamas">Bahamas</option><option value="Bahrain">Bahrain</option><option value="Bangladesh">Bangladesh</option><option value="Barbados">Barbados</option><option value="Belarus">Belarus</option><option value="Belgium">Belgium</option><option value="Belize">Belize</option><option value="Benin">Benin</option><option value="Bhutan">Bhutan</option><option value="Bolivia">Bolivia</option><option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option><option value="Botswana">Botswana</option><option value="Brazil">Brazil</option><option value="Brunei">Brunei</option><option value="Bulgaria">Bulgaria</option><option value="Burkina Faso">Burkina Faso</option><option value="Burundi">Burundi</option><option value="Cambodia">Cambodia</option><option value="Cameroon">Cameroon</option><option value="Canada">Canada</option><option value="Cape Verde">Cape Verde</option><option value="Central African Republic">Central African Republic</option><option value="Chad">Chad</option><option value="Chile">Chile</option><option value="China">China</option><option value="Colombi">Colombi</option><option value="Comoros">Comoros</option><option value="Congo (Brazzaville)">Congo (Brazzaville)</option><option value="Congo">Congo</option><option value="Costa Rica">Costa Rica</option><option value="Cote d\'Ivoire">Cote d\'Ivoire</option><option value="Croatia">Croatia</option><option value="Cuba">Cuba</option><option value="Cyprus">Cyprus</option><option value="Czech Republic">Czech Republic</option><option value="Denmark">Denmark</option><option value="Djibouti">Djibouti</option><option value="Dominica">Dominica</option><option value="Dominican Republic">Dominican Republic</option><option value="East Timor (Timor Timur)">East Timor (Timor Timur)</option><option value="Ecuador">Ecuador</option><option value="Egypt">Egypt</option><option value="El Salvador">El Salvador</option><option value="Equatorial Guinea">Equatorial Guinea</option><option value="Eritrea">Eritrea</option><option value="Estonia">Estonia</option><option value="Ethiopia">Ethiopia</option><option value="Fiji">Fiji</option><option value="Finland">Finland</option><option value="France">France</option><option value="Gabon">Gabon</option><option value="Gambia, The">Gambia, The</option><option value="Georgia">Georgia</option><option value="Germany">Germany</option><option value="Ghana">Ghana</option><option value="Greece">Greece</option><option value="Grenada">Grenada</option><option value="Guatemala">Guatemala</option><option value="Guinea">Guinea</option><option value="Guinea-Bissau">Guinea-Bissau</option><option value="Guyana">Guyana</option><option value="Haiti">Haiti</option><option value="Honduras">Honduras</option><option value="Hungary">Hungary</option><option value="Iceland">Iceland</option><option value="India">India</option><option value="Indonesia">Indonesia</option><option value="Iran">Iran</option><option value="Iraq">Iraq</option><option value="Ireland">Ireland</option><option value="Israel">Israel</option><option value="Italy">Italy</option><option value="Jamaica">Jamaica</option><option value="Japan">Japan</option><option value="Jordan">Jordan</option><option value="Kazakhstan">Kazakhstan</option><option value="Kenya">Kenya</option><option value="Kiribati">Kiribati</option><option value="Korea, North">Korea, North</option><option value="Korea, South">Korea, South</option><option value="Kuwait">Kuwait</option><option value="Kyrgyzstan">Kyrgyzstan</option><option value="Laos">Laos</option><option value="Latvia">Latvia</option><option value="Lebanon">Lebanon</option><option value="Lesotho">Lesotho</option><option value="Liberia">Liberia</option><option value="Libya">Libya</option><option value="Liechtenstein">Liechtenstein</option><option value="Lithuania">Lithuania</option><option value="Luxembourg">Luxembourg</option><option value="Macedonia">Macedonia</option><option value="Madagascar">Madagascar</option><option value="Malawi">Malawi</option><option value="Malaysia">Malaysia</option><option value="Maldives">Maldives</option><option value="Mali">Mali</option><option value="Malta">Malta</option><option value="Marshall Islands">Marshall Islands</option><option value="Mauritania">Mauritania</option><option value="Mauritius">Mauritius</option><option value="Mexico">Mexico</option><option value="Micronesia">Micronesia</option><option value="Moldova">Moldova</option><option value="Monaco">Monaco</option><option value="Mongolia">Mongolia</option><option value="Morocco">Morocco</option><option value="Mozambique">Mozambique</option><option value="Myanmar">Myanmar</option><option value="Namibia">Namibia</option><option value="Nauru">Nauru</option><option value="Nepa">Nepa</option><option value="Netherlands">Netherlands</option><option value="New Zealand">New Zealand</option><option value="Nicaragua">Nicaragua</option><option value="Niger">Niger</option><option value="Nigeria">Nigeria</option><option value="Norway">Norway</option><option value="Oman">Oman</option><option value="Pakistan">Pakistan</option><option value="Palau">Palau</option><option value="Panama">Panama</option><option value="Papua New Guinea">Papua New Guinea</option><option value="Paraguay">Paraguay</option><option value="Peru">Peru</option><option value="Philippines">Philippines</option><option value="Poland">Poland</option><option value="Portugal">Portugal</option><option value="Qatar">Qatar</option><option value="Romania">Romania</option><option value="Russia">Russia</option><option value="Rwanda">Rwanda</option><option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option><option value="Saint Lucia">Saint Lucia</option><option value="Saint Vincent">Saint Vincent</option><option value="Samoa">Samoa</option><option value="San Marino">San Marino</option><option value="Sao Tome and Principe">Sao Tome and Principe</option><option value="Saudi Arabia">Saudi Arabia</option><option value="Senegal">Senegal</option><option value="Serbia and Montenegro">Serbia and Montenegro</option><option value="Seychelles">Seychelles</option><option value="Sierra Leone">Sierra Leone</option><option value="Singapore">Singapore</option><option value="Slovakia">Slovakia</option><option value="Slovenia">Slovenia</option><option value="Solomon Islands">Solomon Islands</option><option value="Somalia">Somalia</option><option value="South Africa">South Africa</option><option value="Spain">Spain</option><option value="Sri Lanka">Sri Lanka</option><option value="Sudan">Sudan</option><option value="Suriname">Suriname</option><option value="Swaziland">Swaziland</option><option value="Sweden">Sweden</option><option value="Switzerland">Switzerland</option><option value="Syria">Syria</option><option value="Taiwan">Taiwan</option><option value="Tajikistan">Tajikistan</option><option value="Tanzania">Tanzania</option><option value="Thailand">Thailand</option><option value="Togo">Togo</option><option value="Tonga">Tonga</option><option value="Trinidad and Tobago">Trinidad and Tobago</option><option value="Tunisia">Tunisia</option><option value="Turkey">Turkey</option><option value="Turkmenistan">Turkmenistan</option><option value="Tuvalu">Tuvalu</option><option value="Uganda">Uganda</option><option value="Ukraine">Ukraine</option><option value="United Arab Emirates">United Arab Emirates</option><option value="United Kingdom">United Kingdom</option><option value="United States">United States</option><option value="Uruguay">Uruguay</option><option value="Uzbekistan">Uzbekistan</option><option value="Vanuatu">Vanuatu</option><option value="Vatican City">Vatican City</option><option value="Venezuela">Venezuela</option><option value="Vietnam">Vietnam</option><option value="Yemen">Yemen</option><option value="Zambia">Zambia</option><option value="Zimbabwe">Zimbabwe</option></select><label class="mini_label" style="display: block;" id="'.$id.'_mini_label_country">'.$w_mini_labels[5].'</span>';
399
+ }
400
+ $rep = '<div id="wdform_field'.$id.'" type="type_address" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="vertical-align: top; display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_address" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" name="'.$id.'_disable_fieldsform_id_temp" id="'.$id.'_disable_fieldsform_id_temp" street1="'.(isset($w_disabled_fields[0]) ? $w_disabled_fields[0] : '').'" street2="'.(isset($w_disabled_fields[1]) ? $w_disabled_fields[1] : '').'" city="'.(isset($w_disabled_fields[2]) ? $w_disabled_fields[2] : '').'" state="'.(isset($w_disabled_fields[3]) ? $w_disabled_fields[3] : '').'" postal="'.(isset($w_disabled_fields[4]) ? $w_disabled_fields[4] : '').'" country="'.(isset($w_disabled_fields[5]) ? $w_disabled_fields[5] : '').'" us_states="'.(isset($w_disabled_fields[6]) ? $w_disabled_fields[6] : '').'"><div id="'.$id.'_div_address" style="width: '.$param['w_size'].'px;">'.$address_fields.$hidden_inputs.'</div></div></div>';
401
+ break;
402
+ }
403
+ case 'type_submitter_mail': {
404
+ $params_names=array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_required','w_unique', 'w_class');
405
+ $temp=$params;
406
+ foreach($params_names as $params_name )
407
+ {
408
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
409
+ $param[$params_name] = $temp[0];
410
+ $temp=$temp[1];
411
+ }
412
+
413
+ if($temp)
414
+ {
415
+ $temp =explode('*:*w_attr_name*:*',$temp);
416
+ $attrs = array_slice($temp,0, count($temp)-1);
417
+ foreach($attrs as $attr)
418
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
419
+ }
420
+
421
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
422
+ $input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active");
423
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
424
+
425
+ $rep ='<div id="wdform_field'.$id.'" type="type_submitter_mail" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_submitter_mail" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_unique'].'" name="'.$id.'_uniqueform_id_temp" id="'.$id.'_uniqueform_id_temp"><input type="text" class="'.$input_active.'" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" value="'.$param['w_first_val'].'" title="'.$param['w_title'].'" onfocus="delete_value(&quot;'.$id.'_elementform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_elementform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_elementform_id_temp&quot;)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].'></div></div>';
426
+ break;
427
+ }
428
+ case 'type_checkbox':
429
+ {
430
+ $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');
431
+ $temp=$params;
432
+ foreach($params_names as $params_name )
433
+ {
434
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
435
+ $param[$params_name] = $temp[0];
436
+ $temp=$temp[1];
437
+ }
438
+
439
+ if($temp)
440
+ {
441
+ $temp =explode('*:*w_attr_name*:*',$temp);
442
+ $attrs = array_slice($temp,0, count($temp)-1);
443
+ foreach($attrs as $attr)
444
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
445
+ }
446
+
447
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
448
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
449
+ $param['w_choices'] = explode('***',$param['w_choices']);
450
+ $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
451
+
452
+ foreach($param['w_choices_checked'] as $key => $choices_checked )
453
+ {
454
+ if($choices_checked=='true')
455
+ $param['w_choices_checked'][$key]='checked="checked"';
456
+ else
457
+ $param['w_choices_checked'][$key]='';
458
+ }
459
+
460
+ $rep='<div id="wdform_field'.$id.'" type="type_checkbox" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_checkbox" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_randomize'].'" name="'.$id.'_randomizeform_id_temp" id="'.$id.'_randomizeform_id_temp"><input type="hidden" value="'.$param['w_allow_other'].'" name="'.$id.'_allow_otherform_id_temp" id="'.$id.'_allow_otherform_id_temp"><input type="hidden" value="'.$param['w_allow_other_num'].'" name="'.$id.'_allow_other_numform_id_temp" id="'.$id.'_allow_other_numform_id_temp"><input type="hidden" value="'.$param['w_rowcol'].'" name="'.$id.'_rowcol_numform_id_temp" id="'.$id.'_rowcol_numform_id_temp"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;" '.($param['w_flow']=='hor' ? 'for_hor="'.$id.'_hor"' : '').'>';
461
+
462
+ if($param['w_flow']=='hor')
463
+ {
464
+ $j = 0;
465
+ for($i=0; $i<(int)$param['w_rowcol']; $i++)
466
+ {
467
+ $rep.='<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;">';
468
+
469
+ for($l=0; $l<=(int)(count($param['w_choices'])/$param['w_rowcol']); $l++)
470
+ {
471
+ if($j >= count($param['w_choices'])%$param['w_rowcol'] && $l==(int)(count($param['w_choices'])/$param['w_rowcol']))
472
+ continue;
473
+
474
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
475
+ $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$l+$i).'" idi="'.((int)$param['w_rowcol']*$l+$i).'" style="display: table-cell;"><input type="checkbox" value="'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" other="1" onclick="if(set_checked(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$l+$i).'&quot;,&quot;form_id_temp&quot;)) show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$l+$i].' '.$param['attributes'].'><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$l+$i).'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'">'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'</label></div>';
476
+ else
477
+ $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$l+$i).'" idi="'.((int)$param['w_rowcol']*$l+$i).'" style="display: table-cell;"><input type="checkbox" value="'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" onclick="set_checked(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$l+$i).'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$l+$i].' '.$param['attributes'].'><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$l+$i).'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'">'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'</label></div>';
478
+ }
479
+
480
+ $j++;
481
+ $rep.='</div>';
482
+
483
+ }
484
+
485
+ }
486
+ else
487
+ {
488
+ for($i=0; $i<(int)(count($param['w_choices'])/$param['w_rowcol']); $i++)
489
+ {
490
+ $rep.='<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;">';
491
+
492
+ if(count($param['w_choices']) > (int)$param['w_rowcol'])
493
+ for($l=0; $l<$param['w_rowcol']; $l++)
494
+ {
495
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
496
+ $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="checkbox" value="'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" other="1" onclick="if(set_checked(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$i+$l).'&quot;,&quot;form_id_temp&quot;)) show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].'><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'">'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
497
+ else
498
+ $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="checkbox" value="'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" onclick="set_checked(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$i+$l).'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].'><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'">'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
499
+ }
500
+ else
501
+ for($l=0; $l<count($param['w_choices']); $l++)
502
+ {
503
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
504
+ $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="checkbox" value="'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" other="1" onclick="if(set_checked(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$i+$l).'&quot;,&quot;form_id_temp&quot;)) show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].'><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'">'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
505
+ else
506
+ $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="checkbox" value="'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" onclick="set_checked(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$i+$l).'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].'><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'">'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
507
+ }
508
+
509
+ $rep.='</div>';
510
+ }
511
+
512
+ if(count($param['w_choices'])%$param['w_rowcol']!=0)
513
+ {
514
+ $rep.='<div id="'.$id.'_element_tr'.((int)(count($param['w_choices'])/(int)$param['w_rowcol'])).'" style="display: table-row;">';
515
+
516
+ for($k=0; $k<count($param['w_choices'])%$param['w_rowcol']; $k++)
517
+ {
518
+ $l = count($param['w_choices']) - count($param['w_choices'])%$param['w_rowcol'] + $k;
519
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$l)
520
+ $rep.='<div valign="top" id="'.$id.'_td_little'.$l.'" idi="'.$l.'" style="display: table-cell;"><input type="checkbox" value="'.$param['w_choices'][$l].'" id="'.$id.'_elementform_id_temp'.$l.'" name="'.$id.'_elementform_id_temp'.$l.'" other="1" onclick="if(set_checked(&quot;'.$id.'&quot;,&quot;'.$l.'&quot;,&quot;form_id_temp&quot;)) show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][$l].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$l.'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.$l.'">'.$param['w_choices'][$l].'</label></div>';
521
+ else
522
+ $rep.='<div valign="top" id="'.$id.'_td_little'.$l.'" idi="'.$l.'" style="display: table-cell;"><input type="checkbox" value="'.$param['w_choices'][$l].'" id="'.$id.'_elementform_id_temp'.$l.'" name="'.$id.'_elementform_id_temp'.$l.'" onclick="set_checked(&quot;'.$id.'&quot;,&quot;'.$l.'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][$l].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$l.'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.$l.'">'.$param['w_choices'][$l].'</label></div>';
523
+ }
524
+
525
+ $rep.='</div>';
526
+ }
527
+
528
+
529
+
530
+ }
531
+ $rep.='</div></div></div></div>';
532
+ break;
533
+ }
534
+ case 'type_radio':
535
+ {
536
+
537
+ $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');
538
+ $temp=$params;
539
+ foreach($params_names as $params_name )
540
+ {
541
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
542
+ $param[$params_name] = $temp[0];
543
+ $temp=$temp[1];
544
+ }
545
+
546
+ if($temp)
547
+ {
548
+ $temp =explode('*:*w_attr_name*:*',$temp);
549
+ $attrs = array_slice($temp,0, count($temp)-1);
550
+ foreach($attrs as $attr)
551
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
552
+ }
553
+
554
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
555
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
556
+ $param['w_choices'] = explode('***',$param['w_choices']);
557
+ $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
558
+
559
+
560
+ foreach($param['w_choices_checked'] as $key => $choices_checked )
561
+ {
562
+ if($choices_checked=='true')
563
+ $param['w_choices_checked'][$key]='checked="checked"';
564
+ else
565
+ $param['w_choices_checked'][$key]='';
566
+ }
567
+
568
+ $rep='<div id="wdform_field'.$id.'" type="type_radio" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_radio" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_randomize'].'" name="'.$id.'_randomizeform_id_temp" id="'.$id.'_randomizeform_id_temp"><input type="hidden" value="'.$param['w_allow_other'].'" name="'.$id.'_allow_otherform_id_temp" id="'.$id.'_allow_otherform_id_temp"><input type="hidden" value="'.$param['w_allow_other_num'].'" name="'.$id.'_allow_other_numform_id_temp" id="'.$id.'_allow_other_numform_id_temp"><input type="hidden" value="'.$param['w_rowcol'].'" name="'.$id.'_rowcol_numform_id_temp" id="'.$id.'_rowcol_numform_id_temp"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;" '.($param['w_flow']=='hor' ? 'for_hor="'.$id.'_hor"' : '').'>';
569
+
570
+
571
+ if($param['w_flow']=='hor')
572
+ {
573
+ $j = 0;
574
+ for($i=0; $i<(int)$param['w_rowcol']; $i++)
575
+ {
576
+ $rep.='<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;">';
577
+
578
+ for($l=0; $l<=(int)(count($param['w_choices'])/$param['w_rowcol']); $l++)
579
+ {
580
+ if($j >= count($param['w_choices'])%$param['w_rowcol'] && $l==(int)(count($param['w_choices'])/$param['w_rowcol']))
581
+ continue;
582
+
583
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
584
+ $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$l+$i).'" idi="'.((int)$param['w_rowcol']*$l+$i).'" style="display: table-cell;"><input type="radio" value="'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" name="'.$id.'_elementform_id_temp" other="1" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$l+$i).'&quot;,&quot;form_id_temp&quot;); show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$l+$i].' '.$param['attributes'].'><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$l+$i).'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'">'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'</label></div>';
585
+ else
586
+ $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$l+$i).'" idi="'.((int)$param['w_rowcol']*$l+$i).'" style="display: table-cell;"><input type="radio" value="'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'" name="'.$id.'_elementform_id_temp" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$l+$i).'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$l+$i].' '.$param['attributes'].'><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$l+$i).'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$l+$i).'">'.$param['w_choices'][(int)$param['w_rowcol']*$l+$i].'</label></div>';
587
+ }
588
+
589
+ $j++;
590
+ $rep.='</div>';
591
+
592
+ }
593
+
594
+ }
595
+ else
596
+ {
597
+ for($i=0; $i<(int)(count($param['w_choices'])/$param['w_rowcol']); $i++)
598
+ {
599
+ $rep.='<div id="'.$id.'_element_tr'.$i.'" style="display: table-row;">';
600
+
601
+ if(count($param['w_choices']) > (int)$param['w_rowcol'])
602
+ for($l=0; $l<$param['w_rowcol']; $l++)
603
+ {
604
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
605
+ $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="radio" value="'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp" other="1" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$i+$l).'&quot;,&quot;form_id_temp&quot;); show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].'><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'">'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
606
+ else
607
+ $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="radio" value="'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$i+$l).'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].'><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'">'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
608
+ }
609
+ else
610
+ for($l=0; $l<count($param['w_choices']); $l++)
611
+ {
612
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==(int)$param['w_rowcol']*$i+$l)
613
+ $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="radio" value="'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp" other="1" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$i+$l).'&quot;,&quot;form_id_temp&quot;); show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].'><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'">'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
614
+ else
615
+ $rep.='<div valign="top" id="'.$id.'_td_little'.((int)$param['w_rowcol']*$i+$l).'" idi="'.((int)$param['w_rowcol']*$i+$l).'" style="display: table-cell;"><input type="radio" value="'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'" id="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'" name="'.$id.'_elementform_id_temp" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.((int)$param['w_rowcol']*$i+$l).'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][(int)$param['w_rowcol']*$i+$l].' '.$param['attributes'].'><label id="'.$id.'_label_element'.((int)$param['w_rowcol']*$i+$l).'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.((int)$param['w_rowcol']*$i+$l).'">'.$param['w_choices'][(int)$param['w_rowcol']*$i+$l].'</label></div>';
616
+ }
617
+
618
+ $rep.='</div>';
619
+ }
620
+
621
+ if(count($param['w_choices'])%$param['w_rowcol']!=0)
622
+ {
623
+ $rep.='<div id="'.$id.'_element_tr'.((int)(count($param['w_choices'])/(int)$param['w_rowcol'])).'" style="display: table-row;">';
624
+
625
+ for($k=0; $k<count($param['w_choices'])%$param['w_rowcol']; $k++)
626
+ {
627
+ $l = count($param['w_choices']) - count($param['w_choices'])%$param['w_rowcol'] + $k;
628
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$l)
629
+ $rep.='<div valign="top" id="'.$id.'_td_little'.$l.'" idi="'.$l.'" style="display: table-cell;"><input type="radio" value="'.$param['w_choices'][$l].'" id="'.$id.'_elementform_id_temp'.$l.'" name="'.$id.'_elementform_id_temp" other="1" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.$l.'&quot;,&quot;form_id_temp&quot;); show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][$l].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$l.'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.$l.'">'.$param['w_choices'][$l].'</label></div>';
630
+ else
631
+ $rep.='<div valign="top" id="'.$id.'_td_little'.$l.'" idi="'.$l.'" style="display: table-cell;"><input type="radio" value="'.$param['w_choices'][$l].'" id="'.$id.'_elementform_id_temp'.$l.'" name="'.$id.'_elementform_id_temp" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.$l.'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][$l].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$l.'" class="ch_rad_label" for="'.$id.'_elementform_id_temp'.$l.'">'.$param['w_choices'][$l].'</label></div>';
632
+ }
633
+
634
+ $rep.='</div>';
635
+ }
636
+
637
+ }
638
+
639
+
640
+
641
+ $rep.='</div></div></div></div>';
642
+
643
+ break;
644
+ }
645
+ case 'type_own_select':
646
+ {
647
+ $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');
648
+ $temp=$params;
649
+ foreach($params_names as $params_name )
650
+ {
651
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
652
+ $param[$params_name] = $temp[0];
653
+ $temp=$temp[1];
654
+ }
655
+
656
+ if($temp)
657
+ {
658
+ $temp =explode('*:*w_attr_name*:*',$temp);
659
+ $attrs = array_slice($temp,0, count($temp)-1);
660
+ foreach($attrs as $attr)
661
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
662
+ }
663
+
664
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
665
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
666
+ $param['w_choices'] = explode('***',$param['w_choices']);
667
+ $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
668
+ $param['w_choices_disabled'] = explode('***',$param['w_choices_disabled']);
669
+
670
+ foreach($param['w_choices_checked'] as $key => $choices_checked )
671
+ {
672
+ if($choices_checked=='true')
673
+ $param['w_choices_checked'][$key]='selected="selected"';
674
+ else
675
+ $param['w_choices_checked'][$key]='';
676
+ }
677
+
678
+ $rep='<div id="wdform_field'.$id.'" type="type_own_select" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; "><input type="hidden" value="type_own_select" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><select id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" onchange="set_select(this)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].'>';
679
+ foreach($param['w_choices'] as $key => $choice)
680
+ {
681
+ if($param['w_choices_disabled'][$key]=="true")
682
+ $choice_value='';
683
+ else
684
+ $choice_value=$choice;
685
+ $rep.='<option id="'.$id.'_option'.$key.'" value="'.$choice_value.'" onselect="set_select(&quot;'.$id.'_option'.$key.'&quot;)" '.$param['w_choices_checked'][$key].'>'.$choice.'</option>';
686
+ }
687
+ $rep.='</select></div></div>';
688
+ break;
689
+ }
690
+
691
+ case 'type_country':
692
+ {
693
+ $params_names=array('w_field_label_size','w_field_label_pos','w_size','w_countries','w_required','w_class');
694
+ $temp=$params;
695
+ foreach($params_names as $params_name )
696
+ {
697
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
698
+ $param[$params_name] = $temp[0];
699
+ $temp=$temp[1];
700
+ }
701
+
702
+ if($temp)
703
+ {
704
+ $temp =explode('*:*w_attr_name*:*',$temp);
705
+ $attrs = array_slice($temp,0, count($temp)-1);
706
+ foreach($attrs as $attr)
707
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
708
+ }
709
+
710
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
711
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
712
+ $param['w_countries'] = explode('***',$param['w_countries']);
713
+
714
+ $rep='<div id="wdform_field'.$id.'" type="type_country" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; "><input type="hidden" value="type_country" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><select id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" style="width: '.$param['w_size'].'px;" '.$param['attributes'].'>';
715
+ foreach($param['w_countries'] as $key => $choice)
716
+ {
717
+ $choice_value=$choice;
718
+ $rep.='<option value="'.$choice_value.'">'.$choice.'</option>';
719
+ }
720
+ $rep.='</select></div></div>';
721
+ break;
722
+ }
723
+
724
+ case 'type_time':
725
+ {
726
+ $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');
727
+ $temp=$params;
728
+ foreach($params_names as $params_name )
729
+ {
730
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
731
+ $param[$params_name] = $temp[0];
732
+ $temp=$temp[1];
733
+ }
734
+
735
+ if($temp)
736
+ {
737
+ $temp =explode('*:*w_attr_name*:*',$temp);
738
+ $attrs = array_slice($temp,0, count($temp)-1);
739
+ foreach($attrs as $attr)
740
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
741
+ }
742
+
743
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
744
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
745
+
746
+ $w_mini_labels = explode('***',$param['w_mini_labels']);
747
+
748
+
749
+ if($param['w_sec']=='1')
750
+ {
751
+ $w_sec = '<div align="center" style="display: table-cell;"><span class="wdform_colon" style="vertical-align: middle;">&nbsp;:&nbsp;</span></div><div id="'.$id.'_td_time_input3" style="width: 32px; display: table-cell;"><input type="text" value="'.$param['w_ss'].'" class="time_box" id="'.$id.'_ssform_id_temp" name="'.$id.'_ssform_id_temp" onkeypress="return check_second(event, &quot;'.$id.'_ssform_id_temp&quot;)" onkeyup="change_second(&quot;'.$id.'_ssform_id_temp&quot;)" onblur="add_0(&quot;'.$id.'_ssform_id_temp&quot;)" '.$param['attributes'].'></div>';
752
+ $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>';
753
+ }
754
+ else
755
+ {
756
+ $w_sec = '';
757
+ $w_sec_label='';
758
+ }
759
+
760
+ if($param['w_time_type']=='12')
761
+ {
762
+ if($param['w_am_pm']=='am')
763
+ {
764
+ $am_ = "selected=\"selected\"";
765
+ $pm_ = "";
766
+ }
767
+ else
768
+ {
769
+ $am_ = "";
770
+ $pm_ = "selected=\"selected\"";
771
+
772
+ }
773
+
774
+ $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>';
775
+
776
+ $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>';
777
+
778
+ }
779
+ else
780
+ {
781
+ $w_time_type='';
782
+ $w_time_type_label = '';
783
+ }
784
+
785
+
786
+ $rep ='<div id="wdform_field'.$id.'" type="type_time" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_time" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><div id="'.$id.'_table_time" style="display: table;"><div id="'.$id.'_tr_time1" style="display: table-row;"><div id="'.$id.'_td_time_input1" style="width: 32px; display: table-cell;"><input type="text" value="'.$param['w_hh'].'" class="time_box" id="'.$id.'_hhform_id_temp" name="'.$id.'_hhform_id_temp" onkeypress="return check_hour(event, &quot;'.$id.'_hhform_id_temp&quot;, &quot;23&quot;)" onkeyup="change_hour(event, &quot;'.$id.'_hhform_id_temp&quot;,&quot;23&quot;)" onblur="add_0(&quot;'.$id.'_hhform_id_temp&quot;)" '.$param['attributes'].'></div><div align="center" style="display: table-cell;"><span class="wdform_colon" style="vertical-align: middle;">&nbsp;:&nbsp;</span></div><div id="'.$id.'_td_time_input2" style="width: 32px; display: table-cell;"><input type="text" value="'.$param['w_mm'].'" class="time_box" id="'.$id.'_mmform_id_temp" name="'.$id.'_mmform_id_temp" onkeypress="return check_minute(event, &quot;'.$id.'_mmform_id_temp&quot;)" onkeyup="change_minute(event, &quot;'.$id.'_mmform_id_temp&quot;)" onblur="add_0(&quot;'.$id.'_mmform_id_temp&quot;)" '.$param['attributes'].'></div>'.$w_sec.$w_time_type.'</div><div id="'.$id.'_tr_time2" style="display: table-row;"><div id="'.$id.'_td_time_label1" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_hh">'.$w_mini_labels[0].'</label></div><div style="display: table-cell;"></div><div id="'.$id.'_td_time_label2" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_mm">'.$w_mini_labels[1].'</label></div>'.$w_sec_label.$w_time_type_label.'</div></div></div></div>';
787
+
788
+ break;
789
+ }
790
+ case 'type_date':
791
+ {
792
+ $params_names=array('w_field_label_size','w_field_label_pos','w_date','w_required','w_class','w_format','w_but_val');
793
+ $temp=$params;
794
+ foreach($params_names as $params_name )
795
+ {
796
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
797
+ $param[$params_name] = $temp[0];
798
+ $temp=$temp[1];
799
+ }
800
+
801
+ if($temp)
802
+ {
803
+ $temp =explode('*:*w_attr_name*:*',$temp);
804
+ $attrs = array_slice($temp,0, count($temp)-1);
805
+ foreach($attrs as $attr)
806
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
807
+ }
808
+
809
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
810
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
811
+
812
+
813
+
814
+ $rep ='<div id="wdform_field'.$id.'" type="type_date" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_date" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="text" value="'.$param['w_date'].'" class="wdform-date" id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" maxlength="10" size="10" onchange="change_value(&quot;'.$id.'_elementform_id_temp&quot;)" '.$param['attributes'].'><input id="'.$id.'_buttonform_id_temp" class="button" type="reset" value="'.$param['w_but_val'].'" format="'.$param['w_format'].'" src="templates/bluestork/images/system/calendar.png" alt="calendario" '.$param['attributes'].' onclick="return showCalendar(&quot;'.$id.'_elementform_id_temp&quot; , &quot;'.$param['w_format'].'&quot;)"></div></div>';
815
+
816
+ break;
817
+ }
818
+ case 'type_date_fields':
819
+ {
820
+ $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');
821
+
822
+ $temp=$params;
823
+ foreach($params_names as $params_name )
824
+ {
825
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
826
+ $param[$params_name] = $temp[0];
827
+ $temp=$temp[1];
828
+ }
829
+
830
+ if($temp)
831
+ {
832
+ $temp =explode('*:*w_attr_name*:*',$temp);
833
+ $attrs = array_slice($temp,0, count($temp)-1);
834
+ foreach($attrs as $attr)
835
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
836
+ }
837
+
838
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
839
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
840
+
841
+
842
+ if($param['w_day_type']=="SELECT")
843
+ {
844
+
845
+
846
+ $w_day_type = '<select id="'.$id.'_dayform_id_temp" name="'.$id.'_dayform_id_temp" onchange="set_select(this)" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].'><option value=""></option>';
847
+ for($k=0; $k<=31; $k++)
848
+ {
849
+ if($k<10)
850
+ {
851
+ if($param['w_day']=='0'.$k)
852
+ $selected = "selected=\"selected\"";
853
+ else
854
+ $selected = "";
855
+
856
+ $w_day_type .= '<option value="0'.$k.'" '.$selected.'>0'.$k.'</option>';
857
+ }
858
+ else
859
+ {
860
+ if($param['w_day']==''.$k)
861
+ $selected = "selected=\"selected\"";
862
+ else
863
+ $selected = "";
864
+
865
+ $w_day_type .= '<option value="'.$k.'" '.$selected.'>'.$k.'</option>';
866
+ }
867
+
868
+
869
+
870
+ }
871
+ $w_day_type .= '</select>';
872
+ }
873
+ else
874
+ {
875
+ $w_day_type = '<input type="text" value="'.$param['w_day'].'" id="'.$id.'_dayform_id_temp" name="'.$id.'_dayform_id_temp" onchange="change_value(&quot;'.$id.'_dayform_id_temp&quot;)" onkeypress="return check_day(event, &quot;'.$id.'_dayform_id_temp&quot;)" onblur="if (this.value==&quot;0&quot;) this.value=""; else add_0(&quot;'.$id.'_dayform_id_temp&quot;)" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].'>';
876
+ }
877
+
878
+ if($param['w_month_type']=="SELECT")
879
+ {
880
+
881
+ $w_month_type = '<select id="'.$id.'_monthform_id_temp" name="'.$id.'_monthform_id_temp" onchange="set_select(this)" style="width: '.$param['w_month_size'].'px;" '.$param['attributes'].'><option value=""></option><option value="01" '.($param['w_month']=="01" ? "selected=\"selected\"": "").' ><!--repstart-->January<!--repend--></option><option value="02" '.($param['w_month']=="02" ? "selected=\"selected\"": "").'><!--repstart-->February<!--repend--></option><option value="03" '.($param['w_month']=="03"? "selected=\"selected\"": "").'><!--repstart-->March<!--repend--></option><option value="04" '.($param['w_month']=="04" ? "selected=\"selected\"": "").' ><!--repstart-->April<!--repend--></option><option value="05" '.($param['w_month']=="05" ? "selected=\"selected\"": "").' ><!--repstart-->May<!--repend--></option><option value="06" '.($param['w_month']=="06" ? "selected=\"selected\"": "").' ><!--repstart-->June<!--repend--></option><option value="07" '.($param['w_month']=="07" ? "selected=\"selected\"": "").' ><!--repstart-->July<!--repend--></option><option value="08" '.($param['w_month']=="08" ? "selected=\"selected\"": "").' ><!--repstart-->August<!--repend--></option><option value="09" '.($param['w_month']=="09" ? "selected=\"selected\"": "").' ><!--repstart-->September<!--repend--></option><option value="10" '.($param['w_month']=="10" ? "selected=\"selected\"": "").' ><!--repstart-->October<!--repend--></option><option value="11" '.($param['w_month']=="11" ? "selected=\"selected\"": "").'><!--repstart-->November<!--repend--></option><option value="12" '.($param['w_month']=="12" ? "selected=\"selected\"": "").' ><!--repstart-->December<!--repend--></option></select>';
882
+
883
+ }
884
+ else
885
+ {
886
+ $w_month_type = '<input type="text" value="'.$param['w_month'].'" id="'.$id.'_monthform_id_temp" name="'.$id.'_monthform_id_temp" onkeypress="return check_month(event, &quot;'.$id.'_monthform_id_temp&quot;)" onchange="change_value(&quot;'.$id.'_monthform_id_temp&quot;)" onblur="if (this.value==&quot;0&quot;) this.value=""; else add_0(&quot;'.$id.'_monthform_id_temp&quot;)" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].'>';
887
+
888
+ }
889
+
890
+ if($param['w_year_type']=="SELECT")
891
+ {
892
+ $w_year_type = '<select id="'.$id.'_yearform_id_temp" name="'.$id.'_yearform_id_temp" onchange="set_select(this)" from="'.$param['w_from'].'" to="'.$param['w_to'].'" style="width: '.$param['w_year_size'].'px;" '.$param['attributes'].'><option value=""></option>';
893
+ for($k=$param['w_to']; $k>=$param['w_from']; $k--)
894
+ {
895
+ if($param['w_year']==$k)
896
+ $selected = "selected=\"selected\"";
897
+ else
898
+ $selected = "";
899
+
900
+ $w_year_type .= '<option value="'.$k.'" '.$selected.'>'.$k.'</option>';
901
+ }
902
+ $w_year_type .= '</select>';
903
+
904
+ }
905
+ else
906
+ {
907
+ $w_year_type = '<input type="text" value="'.$param['w_year'].'" id="'.$id.'_yearform_id_temp" name="'.$id.'_yearform_id_temp" onchange="change_year(&quot;'.$id.'_yearform_id_temp&quot;)" onkeypress="return check_year1(event, &quot;'.$id.'_yearform_id_temp&quot;)" onblur="check_year2(&quot;'.$id.'_yearform_id_temp&quot;)" from="'.$param['w_from'].'" to="'.$param['w_to'].'" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].'>';
908
+ }
909
+
910
+
911
+ $rep ='<div id="wdform_field'.$id.'" type="type_date_fields" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_date_fields" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><div id="'.$id.'_table_date" style="display: table;"><div id="'.$id.'_tr_date1" style="display: table-row;"><div id="'.$id.'_td_date_input1" style="display: table-cell;">
912
+ '.$w_day_type.'
913
+
914
+ </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>';
915
+
916
+ break;
917
+ }
918
+ case 'type_file_upload':
919
+ {
920
+ $params_names=array('w_field_label_size','w_field_label_pos','w_destination','w_extension','w_max_size','w_required','w_multiple','w_class');
921
+ $temp=$params;
922
+ foreach($params_names as $params_name )
923
+ {
924
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
925
+ $param[$params_name] = $temp[0];
926
+ if (isset($temp[1])) {
927
+ $temp = $temp[1];
928
+ }
929
+ else {
930
+ $temp = '';
931
+ }
932
+ }
933
+
934
+ if($temp)
935
+ {
936
+ $temp =explode('*:*w_attr_name*:*',$temp);
937
+ $attrs = array_slice($temp,0, count($temp)-1);
938
+ foreach($attrs as $attr)
939
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
940
+ }
941
+
942
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
943
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
944
+ $multiple = ($param['w_multiple']=="yes" ? "multiple='multiple'" : "");
945
+
946
+ $rep ='<div id="wdform_field'.$id.'" type="type_file_upload" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_file_upload" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="***max_sizeskizb'.$id.'***'.$param['w_max_size'].'***max_sizeverj'.$id.'***" id="'.$id.'_max_size" name="'.$id.'_max_size"><input type="hidden" value="***destinationskizb'.$id.'***'.$param['w_destination'].'***destinationverj'.$id.'***" id="'.$id.'_destination" name="'.$id.'_destination"><input type="hidden" value="***extensionskizb'.$id.'***'.$param['w_extension'].'***extensionverj'.$id.'***" id="'.$id.'_extension" name="'.$id.'_extension"><input type="file" class="file_upload" id="'.$id.'_elementform_id_temp" name="'.$id.'_fileform_id_temp" '.$multiple.' '.$param['attributes'].'/></div></div>';
947
+
948
+ break;
949
+ }
950
+ case 'type_captcha':
951
+ {
952
+ $params_names=array('w_field_label_size','w_field_label_pos','w_digit','w_class');
953
+ $temp=$params;
954
+ foreach($params_names as $params_name )
955
+ {
956
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
957
+ $param[$params_name] = $temp[0];
958
+ $temp=$temp[1];
959
+ }
960
+
961
+ if($temp)
962
+ {
963
+ $temp =explode('*:*w_attr_name*:*',$temp);
964
+ $attrs = array_slice($temp,0, count($temp)-1);
965
+ foreach($attrs as $attr)
966
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
967
+ }
968
+
969
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
970
+
971
+ $rep ='<div id="wdform_field'.$id.'" type="type_captcha" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display:'.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_captcha" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><div style="display: table;"><div style="display: table-row;"><div valign="middle" style="display: table-cell;"><img type="captcha" digit="'.$param['w_digit'].'" src="' . add_query_arg(array('action' => 'formmakerwdcaptcha', 'digit' => $param['w_digit'], 'i' => 'form_id_temp'), admin_url('admin-ajax.php')) . '" id="_wd_captchaform_id_temp" class="captcha_img" onclick="captcha_refresh(&quot;_wd_captcha&quot;,&quot;form_id_temp&quot;)" '.$param['attributes'].'></div><div valign="middle" style="display: table-cell;"><div class="captcha_refresh" id="_element_refreshform_id_temp" onclick="captcha_refresh(&quot;_wd_captcha&quot;,&quot;form_id_temp&quot;)" '.$param['attributes'].'></div></div></div><div style="display: table-row;"><div style="display: table-cell;"><input type="text" class="captcha_input" id="_wd_captcha_inputform_id_temp" name="captcha_input" style="width: '.($param['w_digit']*10+15).'px;" '.$param['attributes'].'></div></div></div></div></div>';
972
+
973
+ break;
974
+ }
975
+ case 'type_recaptcha':
976
+ {
977
+ $params_names=array('w_field_label_size','w_field_label_pos','w_public','w_private','w_theme','w_class');
978
+ $temp=$params;
979
+ foreach($params_names as $params_name )
980
+ {
981
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
982
+ $param[$params_name] = $temp[0];
983
+ $temp=$temp[1];
984
+ }
985
+
986
+ if($temp)
987
+ {
988
+ $temp =explode('*:*w_attr_name*:*',$temp);
989
+ $attrs = array_slice($temp,0, count($temp)-1);
990
+ foreach($attrs as $attr)
991
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
992
+ }
993
+
994
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
995
+
996
+ $rep ='<div id="wdform_field'.$id.'" type="type_recaptcha" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_recaptcha" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><div id="wd_recaptchaform_id_temp" public_key="'.$param['w_public'].'" private_key="'.$param['w_private'].'" theme="'.$param['w_theme'].'" '.$param['attributes'].'><span style="color: red; font-style: italic;">Recaptcha doesn\'t display in back end</span></div></div></div>';
997
+
998
+ break;
999
+ }
1000
+
1001
+ case 'type_hidden':
1002
+ {
1003
+ $params_names=array('w_name','w_value');
1004
+ $temp=$params;
1005
+ foreach($params_names as $params_name )
1006
+ {
1007
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1008
+ $param[$params_name] = $temp[0];
1009
+ $temp=$temp[1];
1010
+ }
1011
+
1012
+ if($temp)
1013
+ {
1014
+ $temp =explode('*:*w_attr_name*:*',$temp);
1015
+ $attrs = array_slice($temp,0, count($temp)-1);
1016
+ foreach($attrs as $attr)
1017
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1018
+ }
1019
+ $param['w_name'] = str_replace('&nbsp;','',$param['w_name']);
1020
+ $rep ='<div id="wdform_field'.$id.'" type="type_hidden" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" style="display: table-cell;"><span id="'.$id.'_element_labelform_id_temp" style="display: none;">'.$param['w_name'].'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" style="display: table-cell;"><input type="hidden" value="'.$param['w_value'].'" id="'.$id.'_elementform_id_temp" name="'.$param['w_name'].'" '.$param['attributes'].'><input type="hidden" value="type_hidden" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"></div></div>';
1021
+
1022
+ break;
1023
+ }
1024
+ case 'type_mark_map':
1025
+ {
1026
+ $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');
1027
+ $temp=$params;
1028
+ foreach($params_names as $params_name )
1029
+ {
1030
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1031
+ $param[$params_name] = $temp[0];
1032
+ $temp=$temp[1];
1033
+ }
1034
+
1035
+ if($temp)
1036
+ {
1037
+ $temp =explode('*:*w_attr_name*:*',$temp);
1038
+ $attrs = array_slice($temp,0, count($temp)-1);
1039
+ foreach($attrs as $attr)
1040
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1041
+ }
1042
+
1043
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1044
+
1045
+ $rep ='<div id="wdform_field'.$id.'" type="type_mark_map" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="vertical-align: top; display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_mark_map" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><div id="'.$id.'_elementform_id_temp" long0="'.$param['w_long'].'" lat0="'.$param['w_lat'].'" zoom="'.$param['w_zoom'].'" info0="'.$param['w_info'].'" center_x="'.$param['w_center_x'].'" center_y="'.$param['w_center_y'].'" style="width: '.$param['w_width'].'px; height: '.$param['w_height'].'px;" '.$param['attributes'].'></div></div></div> ';
1046
+
1047
+ break;
1048
+ }
1049
+
1050
+ case 'type_map':
1051
+ {
1052
+ $params_names=array('w_center_x','w_center_y','w_long','w_lat','w_zoom','w_width','w_height','w_info','w_class');
1053
+ $temp=$params;
1054
+ foreach($params_names as $params_name )
1055
+ {
1056
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1057
+ $param[$params_name] = $temp[0];
1058
+ $temp=$temp[1];
1059
+ }
1060
+
1061
+ if($temp)
1062
+ {
1063
+ $temp =explode('*:*w_attr_name*:*',$temp);
1064
+ $attrs = array_slice($temp,0, count($temp)-1);
1065
+ foreach($attrs as $attr)
1066
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1067
+ }
1068
+
1069
+ $marker='';
1070
+
1071
+ $param['w_long'] = explode('***',$param['w_long']);
1072
+ $param['w_lat'] = explode('***',$param['w_lat']);
1073
+ $param['w_info'] = explode('***',$param['w_info']);
1074
+ foreach($param['w_long'] as $key => $w_long )
1075
+ {
1076
+ $marker.='long'.$key.'="'.$w_long.'" lat'.$key.'="'.$param['w_lat'][$key].'" info'.$key.'="'.$param['w_info'][$key].'"';
1077
+ }
1078
+
1079
+ $rep ='<div id="wdform_field'.$id.'" type="type_map" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: table-cell;"><span id="'.$id.'_element_labelform_id_temp" style="display: none;">'.$label.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: table-cell;"><input type="hidden" value="type_map" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><div id="'.$id.'_elementform_id_temp" zoom="'.$param['w_zoom'].'" center_x="'.$param['w_center_x'].'" center_y="'.$param['w_center_y'].'" style="width: '.$param['w_width'].'px; height: '.$param['w_height'].'px;" '.$marker.' '.$param['attributes'].'></div></div></div>';
1080
+
1081
+ break;
1082
+ }
1083
+ case 'type_paypal_price':
1084
+ {
1085
+
1086
+ $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');
1087
+ $temp=$params;
1088
+ foreach($params_names as $params_name )
1089
+ {
1090
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1091
+ $param[$params_name] = $temp[0];
1092
+ $temp=$temp[1];
1093
+ }
1094
+
1095
+ if($temp)
1096
+ {
1097
+ $temp =explode('*:*w_attr_name*:*',$temp);
1098
+ $attrs = array_slice($temp,0, count($temp)-1);
1099
+ foreach($attrs as $attr)
1100
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1101
+ }
1102
+
1103
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1104
+ $input_active = ($param['w_first_val']==$param['w_title'] ? "input_deactive" : "input_active");
1105
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1106
+ $hide_cents = ($param['w_hide_cents']=="yes" ? "none;" : "table-cell;");
1107
+
1108
+
1109
+ $w_first_val = explode('***',$param['w_first_val']);
1110
+ $w_title = explode('***',$param['w_title']);
1111
+ $w_mini_labels = explode('***',$param['w_mini_labels']);
1112
+
1113
+ $rep ='<div id="wdform_field'.$id.'" type="type_paypal_price" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required"style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_paypal_price" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_range_min'].'" name="'.$id.'_range_minform_id_temp" id="'.$id.'_range_minform_id_temp"><input type="hidden" value="'.$param['w_range_max'].'" name="'.$id.'_range_maxform_id_temp" id="'.$id.'_range_maxform_id_temp"><div id="'.$id.'_table_price" style="display: table;"><div id="'.$id.'_tr_price1" style="display: table-row;"><div id="'.$id.'_td_name_currency" style="display: table-cell;"><span class="wdform_colon" style="vertical-align: middle;"><!--repstart-->&nbsp;$&nbsp;<!--repend--></span></div><div id="'.$id.'_td_name_dollars" style="display: table-cell;"><input type="text" class="'.$input_active.'" id="'.$id.'_element_dollarsform_id_temp" name="'.$id.'_element_dollarsform_id_temp" value="'.$w_first_val[0].'" title="'.$w_title[0].'"onfocus="delete_value(&quot;'.$id.'_element_dollarsform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_element_dollarsform_id_temp&quot;)"onchange="change_value(&quot;'.$id.'_element_dollarsform_id_temp&quot;)" onkeypress="return check_isnum(event)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].'></div><div id="'.$id.'_td_name_divider" style="display: '.$hide_cents.';"><span class="wdform_colon" style="vertical-align: middle;">&nbsp;.&nbsp;</span></div><div id="'.$id.'_td_name_cents" style="display: '.$hide_cents.'"><input type="text" class="'.$input_active.'" id="'.$id.'_element_centsform_id_temp" name="'.$id.'_element_centsform_id_temp" value="'.$w_first_val[1].'" title="'.$w_title[1].'"onfocus="delete_value(&quot;'.$id.'_element_centsform_id_temp&quot;)" onblur="return_value(&quot;'.$id.'_element_centsform_id_temp&quot;); add_0(&quot;'.$id.'_element_centsform_id_temp&quot;)"onchange="change_value(&quot;'.$id.'_element_centsform_id_temp&quot;)" onkeypress="return check_isnum_interval(event,&quot;'.$id.'_element_centsform_id_temp&quot;,0,99)"style="width: 30px;" '.$param['attributes'].'></div></div><div id="'.$id.'_tr_price2" style="display: table-row;"><div style="display: table-cell;"><label class="mini_label"></label></div><div align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_dollars">'.$w_mini_labels[0].'</label></div><div id="'.$id.'_td_name_label_divider" style="display: '.$hide_cents.'"><label class="mini_label"></label></div><div align="left" id="'.$id.'_td_name_label_cents" style="display: '.$hide_cents.'"><label class="mini_label" id="'.$id.'_mini_label_cents">'.$w_mini_labels[1].'</label></div></div></div></div></div>';
1114
+ break;
1115
+ }
1116
+
1117
+ case 'type_paypal_select':
1118
+ {
1119
+ $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');
1120
+ $temp=$params;
1121
+ foreach($params_names as $params_name )
1122
+ {
1123
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1124
+ $param[$params_name] = $temp[0];
1125
+ $temp=$temp[1];
1126
+ }
1127
+
1128
+ if($temp)
1129
+ {
1130
+ $temp =explode('*:*w_attr_name*:*',$temp);
1131
+ $attrs = array_slice($temp,0, count($temp)-1);
1132
+ foreach($attrs as $attr)
1133
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1134
+ }
1135
+
1136
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1137
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1138
+ $param['w_choices'] = explode('***',$param['w_choices']);
1139
+
1140
+ $param['w_choices_price'] = explode('***',$param['w_choices_price']);
1141
+
1142
+ $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
1143
+
1144
+ $param['w_choices_disabled'] = explode('***',$param['w_choices_disabled']);
1145
+ $param['w_property'] = explode('***',$param['w_property']);
1146
+ $param['w_property_values'] = explode('***',$param['w_property_values']);
1147
+
1148
+ foreach($param['w_choices_checked'] as $key => $choices_checked )
1149
+ {
1150
+ if($choices_checked=='true')
1151
+ $param['w_choices_checked'][$key]='selected="selected"';
1152
+ else
1153
+ $param['w_choices_checked'][$key]='';
1154
+ }
1155
+
1156
+
1157
+ $rep='<div id="wdform_field'.$id.'" type="type_paypal_select" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; "><input type="hidden" value="type_paypal_select" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><select id="'.$id.'_elementform_id_temp" name="'.$id.'_elementform_id_temp" onchange="set_select(this)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].'>';
1158
+ foreach($param['w_choices'] as $key => $choice)
1159
+ {
1160
+ if($param['w_choices_disabled'][$key]=="true")
1161
+ $choice_value='';
1162
+ else
1163
+ $choice_value=$param['w_choices_price'][$key];
1164
+ $rep.='<option id="'.$id.'_option'.$key.'" value="'.$choice_value.'" onselect="set_select(&quot;'.$id.'_option'.$key.'&quot;)" '.$param['w_choices_checked'][$key].'>'.$choice.'</option>';
1165
+ }
1166
+ $rep.='</select><div id="'.$id.'_divform_id_temp">';
1167
+ if($param['w_quantity']=="yes")
1168
+ $rep.='<span id="'.$id.'_element_quantity_spanform_id_temp" style="margin-right: 15px;"><label class="mini_label" id="'.$id.'_element_quantity_label_form_id_temp" style="margin-right: 5px;"><!--repstart-->Quantity<!--repend--></label><input type="text" value="'.$param['w_quantity_value'].'" id="'.$id.'_element_quantityform_id_temp" name="'.$id.'_element_quantityform_id_temp" onkeypress="return check_isnum(event)" onchange="change_value(&quot;'.$id.'_element_quantityform_id_temp&quot;, this.value)" style="width: 30px; margin: 2px 0px;"></span>';
1169
+ if($param['w_property'][0])
1170
+ foreach($param['w_property'] as $key => $property)
1171
+ {
1172
+
1173
+ $rep.='
1174
+ <span id="'.$id.'_property_'.$key.'" style="margin-right: 15px;">
1175
+
1176
+ <label class="mini_label" id="'.$id.'_property_label_form_id_temp'.$key.'" style="margin-right: 5px;">'.$property.'</label>
1177
+ <select id="'.$id.'_propertyform_id_temp'.$key.'" name="'.$id.'_propertyform_id_temp'.$key.'" style="width: auto; margin: 2px 0px;">';
1178
+ $param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
1179
+ $param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
1180
+ foreach($param['w_property_values'][$key] as $subkey => $property_value)
1181
+ {
1182
+ $rep.='<option id="'.$id.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'">'.$property_value.'</option>';
1183
+ }
1184
+ $rep.='</select></span>';
1185
+ }
1186
+
1187
+ $rep.='</div></div></div>';
1188
+ break;
1189
+ }
1190
+
1191
+ case 'type_paypal_checkbox':
1192
+ {
1193
+
1194
+ $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');
1195
+ $temp=$params;
1196
+ foreach($params_names as $params_name )
1197
+ {
1198
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1199
+ $param[$params_name] = $temp[0];
1200
+ $temp=$temp[1];
1201
+ }
1202
+
1203
+ if($temp)
1204
+ {
1205
+ $temp =explode('*:*w_attr_name*:*',$temp);
1206
+ $attrs = array_slice($temp,0, count($temp)-1);
1207
+ foreach($attrs as $attr)
1208
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1209
+ }
1210
+
1211
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1212
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1213
+ $param['w_choices'] = explode('***',$param['w_choices']);
1214
+ $param['w_choices_price'] = explode('***',$param['w_choices_price']);
1215
+ $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
1216
+ $param['w_property'] = explode('***',$param['w_property']);
1217
+ $param['w_property_values'] = explode('***',$param['w_property_values']);
1218
+
1219
+ foreach($param['w_choices_checked'] as $key => $choices_checked )
1220
+ {
1221
+ if($choices_checked=='true')
1222
+ $param['w_choices_checked'][$key]='checked="checked"';
1223
+ else
1224
+ $param['w_choices_checked'][$key]='';
1225
+ }
1226
+
1227
+ $rep='<div id="wdform_field'.$id.'" type="type_paypal_checkbox" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_paypal_checkbox" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_randomize'].'" name="'.$id.'_randomizeform_id_temp" id="'.$id.'_randomizeform_id_temp"><input type="hidden" value="'.$param['w_allow_other'].'" name="'.$id.'_allow_otherform_id_temp" id="'.$id.'_allow_otherform_id_temp"><input type="hidden" value="'.$param['w_allow_other_num'].'" name="'.$id.'_allow_other_numform_id_temp" id="'.$id.'_allow_other_numform_id_temp"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;">';
1228
+
1229
+ if($param['w_flow']=='hor')
1230
+ {
1231
+ $rep.= '<div id="'.$id.'_hor" style="display: table-row;">';
1232
+ foreach($param['w_choices'] as $key => $choice)
1233
+ {
1234
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key)
1235
+ $rep.='<div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="checkbox" other="1" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp'.$key.'" value="'.$param['w_choices_price'][$key].'" onclick="if(set_checked(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;)) show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div>';
1236
+ else
1237
+ $rep.='<div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="checkbox" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp'.$key.'" value="'.$param['w_choices_price'][$key].'" onclick="set_checked(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div>';
1238
+ }
1239
+ $rep.= '</div>';
1240
+ }
1241
+ else
1242
+ {
1243
+ $rep.= '<div id="'.$id.'_table_little" style="display: table-row-group;">';
1244
+ foreach($param['w_choices'] as $key => $choice)
1245
+ {
1246
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key)
1247
+ $rep.='<div id="'.$id.'_element_tr'.$key.'" style="display: table-row;"><div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="checkbox" value="'.$param['w_choices_price'][$key].'" other="1" id="'.$id.'_elementform_id_temp'.$key.'" onclick="if(set_checked(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;)) show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" name="'.$id.'_elementform_id_temp'.$key.'" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div></div>';
1248
+ else
1249
+ $rep.='<div id="'.$id.'_element_tr'.$key.'" style="display: table-row;"><div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="checkbox" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp'.$key.'" value="'.$param['w_choices_price'][$key].'" onclick="set_checked(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div></div>'; }
1250
+ $rep.= '</div>';
1251
+ }
1252
+ $rep.='</div></div>';
1253
+
1254
+ $rep.='<div id="'.$id.'_divform_id_temp">';
1255
+ if($param['w_quantity']=="yes")
1256
+ $rep.='<span id="'.$id.'_element_quantity_spanform_id_temp" style="margin-right: 15px;"><label class="mini_label" id="'.$id.'_element_quantity_label_form_id_temp" style="margin-right: 5px;"><!--repstart-->Quantity<!--repend--></label><input type="text" value="'.$param['w_quantity_value'].'" id="'.$id.'_element_quantityform_id_temp" name="'.$id.'_element_quantityform_id_temp" onkeypress="return check_isnum(event)" onchange="change_value(&quot;'.$id.'_element_quantityform_id_temp&quot;, this.value)" style="width: 30px; margin: 2px 0px;"></span>';
1257
+ if($param['w_property'][0])
1258
+ foreach($param['w_property'] as $key => $property)
1259
+ {
1260
+ $rep.='
1261
+ <span id="'.$id.'_property_'.$key.'" style="margin-right: 15px;">
1262
+
1263
+ <label class="mini_label" id="'.$id.'_property_label_form_id_temp'.$key.'" style="margin-right: 5px;">'.$property.'</label>
1264
+ <select id="'.$id.'_propertyform_id_temp'.$key.'" name="'.$id.'_propertyform_id_temp'.$key.'" style="width: auto; margin: 2px 0px;">';
1265
+ $param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
1266
+ $param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
1267
+ foreach($param['w_property_values'][$key] as $subkey => $property_value)
1268
+ {
1269
+ $rep.='<option id="'.$id.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'">'.$property_value.'</option>';
1270
+ }
1271
+ $rep.='</select></span>';
1272
+ }
1273
+
1274
+ $rep.='</div></div></div>';
1275
+ break;
1276
+ }
1277
+ case 'type_paypal_radio':
1278
+ {
1279
+
1280
+ $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');
1281
+ $temp=$params;
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
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1298
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1299
+ $param['w_choices'] = explode('***',$param['w_choices']);
1300
+
1301
+ $param['w_choices_price'] = explode('***',$param['w_choices_price']);
1302
+
1303
+ $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
1304
+
1305
+ $param['w_property'] = explode('***',$param['w_property']);
1306
+ $param['w_property_values'] = explode('***',$param['w_property_values']);
1307
+
1308
+ foreach($param['w_choices_checked'] as $key => $choices_checked )
1309
+ {
1310
+ if($choices_checked=='true')
1311
+ $param['w_choices_checked'][$key]='checked="checked"';
1312
+ else
1313
+ $param['w_choices_checked'][$key]='';
1314
+ }
1315
+
1316
+ $rep='<div id="wdform_field'.$id.'" type="type_paypal_radio" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_paypal_radio" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_randomize'].'" name="'.$id.'_randomizeform_id_temp" id="'.$id.'_randomizeform_id_temp"><input type="hidden" value="'.$param['w_allow_other'].'" name="'.$id.'_allow_otherform_id_temp" id="'.$id.'_allow_otherform_id_temp"><input type="hidden" value="'.$param['w_allow_other_num'].'" name="'.$id.'_allow_other_numform_id_temp" id="'.$id.'_allow_other_numform_id_temp"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;">';
1317
+
1318
+ if($param['w_flow']=='hor')
1319
+ {
1320
+ $rep.= '<div id="'.$id.'_hor" style="display: table-row;">';
1321
+ foreach($param['w_choices'] as $key => $choice)
1322
+ {
1323
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key)
1324
+ $rep.='<div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="radio" other="1" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp" value="'.$param['w_choices_price'][$key].'" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;); show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div>';
1325
+ else
1326
+ $rep.='<div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="radio" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp" value="'.$param['w_choices_price'][$key].'" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div>';
1327
+ }
1328
+ $rep.= '</div>';
1329
+ }
1330
+ else
1331
+ {
1332
+ $rep.= '<div id="'.$id.'_table_little" style="display: table-row-group;">';
1333
+ foreach($param['w_choices'] as $key => $choice)
1334
+ {
1335
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key)
1336
+ $rep.='<div id="'.$id.'_element_tr'.$key.'" style="display: table-row;"><div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="radio" value="'.$param['w_choices_price'][$key].'" other="1" id="'.$id.'_elementform_id_temp'.$key.'" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;); show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" name="'.$id.'_elementform_id_temp" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div></div>';
1337
+ else
1338
+ $rep.='<div id="'.$id.'_element_tr'.$key.'" style="display: table-row;"><div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="radio" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp" value="'.$param['w_choices_price'][$key].'" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div></div>'; }
1339
+ $rep.= '</div>';
1340
+ }
1341
+ $rep.='</div></div>';
1342
+
1343
+ $rep.='<div id="'.$id.'_divform_id_temp">';
1344
+ if($param['w_quantity']=="yes")
1345
+ $rep.='<span id="'.$id.'_element_quantity_spanform_id_temp" style="margin-right: 15px;"><label class="mini_label" id="'.$id.'_element_quantity_label_form_id_temp" style="margin-right: 5px;"><!--repstart-->Quantity<!--repend--></label><input type="text" value="'.$param['w_quantity_value'].'" id="'.$id.'_element_quantityform_id_temp" name="'.$id.'_element_quantityform_id_temp" onkeypress="return check_isnum(event)" onchange="change_value(&quot;'.$id.'_element_quantityform_id_temp&quot;, this.value)" style="width: 30px; margin: 2px 0px;"></span>';
1346
+ if($param['w_property'][0])
1347
+ foreach($param['w_property'] as $key => $property)
1348
+ {
1349
+ $rep.='
1350
+ <span id="'.$id.'_property_'.$key.'" style="margin-right: 15px;">
1351
+
1352
+ <label class="mini_label" id="'.$id.'_property_label_form_id_temp'.$key.'" style="margin-right: 5px;">'.$property.'</label>
1353
+ <select id="'.$id.'_propertyform_id_temp'.$key.'" name="'.$id.'_propertyform_id_temp'.$key.'" style="width: auto; margin: 2px 0px;">';
1354
+ $param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
1355
+ $param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
1356
+ foreach($param['w_property_values'][$key] as $subkey => $property_value)
1357
+ {
1358
+ $rep.='<option id="'.$id.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'">'.$property_value.'</option>';
1359
+ }
1360
+ $rep.='</select></span>';
1361
+ }
1362
+
1363
+ $rep.='</div></div></div>';
1364
+
1365
+ break;
1366
+ }
1367
+ case 'type_paypal_shipping':
1368
+ {
1369
+
1370
+ $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');
1371
+ $temp=$params;
1372
+ foreach($params_names as $params_name )
1373
+ {
1374
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1375
+ $param[$params_name] = $temp[0];
1376
+ $temp=$temp[1];
1377
+ }
1378
+
1379
+ if($temp)
1380
+ {
1381
+ $temp =explode('*:*w_attr_name*:*',$temp);
1382
+ $attrs = array_slice($temp,0, count($temp)-1);
1383
+ foreach($attrs as $attr)
1384
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1385
+ }
1386
+
1387
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1388
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1389
+ $param['w_choices'] = explode('***',$param['w_choices']);
1390
+
1391
+ $param['w_choices_price'] = explode('***',$param['w_choices_price']);
1392
+
1393
+ $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
1394
+
1395
+
1396
+ foreach($param['w_choices_checked'] as $key => $choices_checked )
1397
+ {
1398
+ if($choices_checked=='true')
1399
+ $param['w_choices_checked'][$key]='checked="checked"';
1400
+ else
1401
+ $param['w_choices_checked'][$key]='';
1402
+ }
1403
+
1404
+ $rep='<div id="wdform_field'.$id.'" type="type_paypal_shipping" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label" style="vertical-align: top;">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required" style="vertical-align: top;">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_paypal_shipping" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_randomize'].'" name="'.$id.'_randomizeform_id_temp" id="'.$id.'_randomizeform_id_temp"><input type="hidden" value="'.$param['w_allow_other'].'" name="'.$id.'_allow_otherform_id_temp" id="'.$id.'_allow_otherform_id_temp"><input type="hidden" value="'.$param['w_allow_other_num'].'" name="'.$id.'_allow_other_numform_id_temp" id="'.$id.'_allow_other_numform_id_temp"><div style="display: table;"><div id="'.$id.'_table_little" style="display: table-row-group;">';
1405
+
1406
+ if($param['w_flow']=='hor')
1407
+ {
1408
+ $rep.= '<div id="'.$id.'_hor" style="display: table-row;">';
1409
+ foreach($param['w_choices'] as $key => $choice)
1410
+ {
1411
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key)
1412
+ $rep.='<div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="radio" other="1" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp" value="'.$param['w_choices_price'][$key].'" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;); show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div>';
1413
+ else
1414
+ $rep.='<div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="radio" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp" value="'.$param['w_choices_price'][$key].'" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div>';
1415
+ }
1416
+ $rep.= '</div>';
1417
+ }
1418
+ else
1419
+ {
1420
+ $rep.= '<div id="'.$id.'_table_little" style="display: table-row-group;">';
1421
+ foreach($param['w_choices'] as $key => $choice)
1422
+ {
1423
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key)
1424
+ $rep.='<div id="'.$id.'_element_tr'.$key.'" style="display: table-row;"><div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="radio" value="'.$param['w_choices_price'][$key].'" other="1" id="'.$id.'_elementform_id_temp'.$key.'" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;); show_other_input(&quot;'.$id.'&quot;,&quot;form_id_temp&quot;);" name="'.$id.'_elementform_id_temp" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div></div>';
1425
+ else
1426
+ $rep.='<div id="'.$id.'_element_tr'.$key.'" style="display: table-row;"><div valign="top" id="'.$id.'_td_little'.$key.'" idi="'.$key.'" style="display: table-cell;"><input type="radio" id="'.$id.'_elementform_id_temp'.$key.'" name="'.$id.'_elementform_id_temp" value="'.$param['w_choices_price'][$key].'" onclick="set_default(&quot;'.$id.'&quot;,&quot;'.$key.'&quot;,&quot;form_id_temp&quot;)" '.$param['w_choices_checked'][$key].' '.$param['attributes'].'><label id="'.$id.'_label_element'.$key.'" class="ch-rad-label" for="'.$id.'_elementform_id_temp'.$key.'">'.$choice.'</label></div></div>'; }
1427
+ $rep.= '</div>';
1428
+ }
1429
+ $rep.='</div></div>';
1430
+
1431
+ $rep.='</div></div>';
1432
+
1433
+ break;
1434
+ }
1435
+ case 'type_paypal_total':
1436
+ {
1437
+ $params_names=array('w_field_label_size','w_field_label_pos','w_class');
1438
+ $temp=$params;
1439
+ foreach($params_names as $params_name )
1440
+ {
1441
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1442
+ $param[$params_name] = $temp[0];
1443
+ $temp=$temp[1];
1444
+ }
1445
+
1446
+ if($temp)
1447
+ {
1448
+ $temp =explode('*:*w_attr_name*:*',$temp);
1449
+ $attrs = array_slice($temp,0, count($temp)-1);
1450
+ foreach($attrs as $attr)
1451
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1452
+ }
1453
+
1454
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1455
+
1456
+
1457
+
1458
+ $rep='<div id="wdform_field'.$id.'" type="type_paypal_total" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label">'.$label.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_paypal_total" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><div id="'.$id.'paypal_totalform_id_temp" class="wdform_paypal_total paypal_totalform_id_temp"><input type="hidden" value="" name="'.$id.'_paypal_totalform_id_temp" class="input_paypal_totalform_id_temp"><div id="'.$id.'div_totalform_id_temp" class="div_totalform_id_temp" style="margin-bottom: 10px;"><!--repstart-->$300<!--repend--></div><div id="'.$id.'paypal_productsform_id_temp" class="paypal_productsform_id_temp" style="border-spacing: 2px;"><div style="border-spacing: 2px;"><!--repstart-->product 1 $100<!--repend--></div><div style="border-spacing: 2px;"><!--repstart-->product 2 $200<!--repend--></div></div><div id="'.$id.'paypal_taxform_id_temp" class="paypal_taxform_id_temp" style="border-spacing: 2px; margin-top: 7px;"></div></div></div></div>';
1459
+
1460
+
1461
+ break;
1462
+ }
1463
+
1464
+ case 'type_star_rating':
1465
+ {
1466
+ $params_names=array('w_field_label_size','w_field_label_pos','w_field_label_col','w_star_amount','w_required','w_class');
1467
+ $temp=$params;
1468
+ foreach($params_names as $params_name )
1469
+ {
1470
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1471
+ $param[$params_name] = $temp[0];
1472
+ $temp=$temp[1];
1473
+ }
1474
+
1475
+ if($temp)
1476
+ {
1477
+ $temp =explode('*:*w_attr_name*:*',$temp);
1478
+ $attrs = array_slice($temp,0, count($temp)-1);
1479
+ foreach($attrs as $attr)
1480
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1481
+ }
1482
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1483
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1484
+
1485
+
1486
+ $images = '';
1487
+ for($i=0; $i<$param['w_star_amount']; $i++)
1488
+ {
1489
+ $images .= '<img id="'.$id.'_star_'.$i.'" src="' . WD_FM_URL . '/images/star.png" onmouseover="change_src('.$i.','.$id.',&quot;form_id_temp&quot;)" onmouseout="reset_src('.$i.','.$id.')" onclick="select_star_rating('.$i.','.$id.', &quot;form_id_temp&quot;)">';
1490
+ }
1491
+
1492
+ $rep ='<div id="wdform_field'.$id.'" type="type_star_rating" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_star_rating" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_star_amount'].'" id="'.$id.'_star_amountform_id_temp" name="'.$id.'_star_amountform_id_temp"><input type="hidden" value="'.$param['w_field_label_col'].'" name="'.$id.'_star_colorform_id_temp" id="'.$id.'_star_colorform_id_temp"><div id="'.$id.'_elementform_id_temp" class="wdform_stars" '.$param['attributes'].'>'.$images.'</div></div></div>';
1493
+
1494
+
1495
+ break;
1496
+ }
1497
+ case 'type_scale_rating':
1498
+ {
1499
+ $params_names=array('w_field_label_size','w_field_label_pos','w_mini_labels','w_scale_amount','w_required','w_class');
1500
+ $temp=$params;
1501
+ foreach($params_names as $params_name )
1502
+ {
1503
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1504
+ $param[$params_name] = $temp[0];
1505
+ $temp=$temp[1];
1506
+ }
1507
+
1508
+ if($temp)
1509
+ {
1510
+ $temp =explode('*:*w_attr_name*:*',$temp);
1511
+ $attrs = array_slice($temp,0, count($temp)-1);
1512
+ foreach($attrs as $attr)
1513
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1514
+ }
1515
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1516
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1517
+
1518
+ $w_mini_labels = explode('***',$param['w_mini_labels']);
1519
+
1520
+ $numbers = '';
1521
+ for($i=1; $i<=$param['w_scale_amount']; $i++)
1522
+ {
1523
+ $numbers .= '<div id="'.$id.'_scale_td1_'.$i.'form_id_temp" style="text-align: center; display: table-cell;"><span>'.$i.'</span></div>';
1524
+ }
1525
+
1526
+
1527
+ $radio_buttons = '';
1528
+ for($k=1; $k<=$param['w_scale_amount']; $k++)
1529
+ {
1530
+ $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>';
1531
+ }
1532
+
1533
+ $rep ='<div id="wdform_field'.$id.'" type="type_scale_rating" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; vertical-align: top; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_scale_rating" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_scale_amount'].'" id="'.$id.'_scale_amountform_id_temp" name="'.$id.'_scale_amountform_id_temp"><div id="'.$id.'_elementform_id_temp" style="float: left;" '.$param['attributes'].'><label class="mini_label" id="'.$id.'_mini_label_worst" style="position: relative; top: 6px; font-size: 11px; display: inline-table;">'.$w_mini_labels[0].'</label><div id="'.$id.'_scale_tableform_id_temp" style="display: inline-table;"><div id="'.$id.'_scale_tr1form_id_temp" style="display: table-row;">'.$numbers.'</div><div id="'.$id.'_scale_tr2form_id_temp" style="display: table-row;">'.$radio_buttons.'</div></div><label class="mini_label" id="'.$id.'_mini_label_best" style="position: relative; top: 6px; font-size: 11px; display: inline-table;">'.$w_mini_labels[1].'</label></div></div></div>';
1534
+
1535
+ break;
1536
+ }
1537
+ case 'type_spinner':
1538
+ {
1539
+ $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');
1540
+ $temp=$params;
1541
+ foreach($params_names as $params_name ) {
1542
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1543
+ $param[$params_name] = $temp[0];
1544
+ $temp=$temp[1];
1545
+ }
1546
+ if($temp) {
1547
+ $temp =explode('*:*w_attr_name*:*',$temp);
1548
+ $attrs = array_slice($temp,0, count($temp)-1);
1549
+ foreach($attrs as $attr)
1550
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1551
+ }
1552
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1553
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1554
+ $rep ='<div id="wdform_field'.$id.'" type="type_spinner" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_spinner" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_field_width'].'" name="'.$id.'_spinner_widthform_id_temp" id="'.$id.'_spinner_widthform_id_temp"><input type="hidden" value="'.$param['w_field_min_value'].'" id="'.$id.'_min_valueform_id_temp" name="'.$id.'_min_valueform_id_temp"><input type="hidden" value="'.$param['w_field_max_value'].'" name="'.$id.'_max_valueform_id_temp" id="'.$id.'_max_valueform_id_temp"><input type="hidden" value="'.$param['w_field_step'].'" name="'.$id.'_stepform_id_temp" id="'.$id.'_stepform_id_temp"><input type="" value="'.($param['w_field_value']!= 'null' ? $param['w_field_value'] : '').'" name="'.$id.'_elementform_id_temp" id="'.$id.'_elementform_id_temp" onkeypress="return check_isnum_or_minus(event)" style="width: '.$param['w_field_width'].'px;" '.$param['attributes'].'></div></div>';
1555
+ break;
1556
+ }
1557
+ case 'type_slider': {
1558
+ $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');
1559
+ $temp=$params;
1560
+ foreach($params_names as $params_name ) {
1561
+ $temp = explode('*:*'.$params_name.'*:*',$temp);
1562
+ $param[$params_name] = $temp[0];
1563
+ $temp=$temp[1];
1564
+ }
1565
+ if ($temp) {
1566
+ $temp = explode('*:*w_attr_name*:*', $temp);
1567
+ $attrs = array_slice($temp,0, count($temp)-1);
1568
+ foreach($attrs as $attr) {
1569
+ $param['attributes'] = $param['attributes'] . ' add_' . $attr;
1570
+ }
1571
+ }
1572
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1573
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1574
+ $rep ='<div id="wdform_field'.$id.'" type="type_slider" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; vertical-align: top; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_slider" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_field_width'].'" name="'.$id.'_slider_widthform_id_temp" id="'.$id.'_slider_widthform_id_temp"><input type="hidden" value="'.$param['w_field_min_value'].'" id="'.$id.'_slider_min_valueform_id_temp" name="'.$id.'_slider_min_valueform_id_temp"><input type="hidden" value="'.$param['w_field_max_value'].'" id="'.$id.'_slider_max_valueform_id_temp" name="'.$id.'_slider_max_valueform_id_temp"><input type="hidden" value="'.$param['w_field_value'].'" id="'.$id.'_slider_valueform_id_temp" name="'.$id.'_slider_valueform_id_temp"><div id="'.$id.'_slider_tableform_id_temp"><div><div id="'.$id.'_slider_td1form_id_temp"><div name="'.$id.'_elementform_id_temp" id="'.$id.'_elementform_id_temp" style="width: '.$param['w_field_width'].'px;" '.$param['attributes'].'"></div></div></div><div><div align="left" id="'.$id.'_slider_td2form_id_temp" style="display: inline-table; width: 33.3%; text-align: left;"><span id="'.$id.'_element_minform_id_temp" class="label">'.$param['w_field_min_value'].'</span></div><div align="right" id="'.$id.'_slider_td3form_id_temp" style="display: inline-table; width: 33.3%; text-align: center;"><span id="'.$id.'_element_valueform_id_temp" class="label">'.$param['w_field_value'].'</span></div><div align="right" id="'.$id.'_slider_td4form_id_temp" style="display: inline-table; width: 33.3%; text-align: right;"><span id="'.$id.'_element_maxform_id_temp" class="label">'.$param['w_field_max_value'].'</span></div></div></div></div></div>';
1575
+ break;
1576
+ }
1577
+ case 'type_range': {
1578
+ $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');
1579
+ $temp = $params;
1580
+ foreach ($params_names as $params_name ) {
1581
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
1582
+ $param[$params_name] = $temp[0];
1583
+ $temp = $temp[1];
1584
+ }
1585
+ if ($temp) {
1586
+ $temp = explode('*:*w_attr_name*:*', $temp);
1587
+ $attrs = array_slice($temp, 0, count($temp) - 1);
1588
+ foreach($attrs as $attr) {
1589
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1590
+ }
1591
+ }
1592
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1593
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1594
+ $w_mini_labels = explode('***',$param['w_mini_labels']);
1595
+ $rep ='<div id="wdform_field'.$id.'" type="type_range" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_range" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_field_range_width'].'" name="'.$id.'_range_widthform_id_temp" id="'.$id.'_range_widthform_id_temp"><input type="hidden" value="'.$param['w_field_range_step'].'" name="'.$id.'_range_stepform_id_temp" id="'.$id.'_range_stepform_id_temp"><div id="'.$id.'_elemet_table_littleform_id_temp" style="display: table;"><div style="display: table-row;"><div valign="middle" align="left" style="display: table-cell;"><input type="" value="'.($param['w_field_value1']!= 'null' ? $param['w_field_value1'] : '').'" name="'.$id.'_elementform_id_temp0" id="'.$id.'_elementform_id_temp0" onkeypress="return check_isnum_or_minus(event)" style="width: '.$param['w_field_range_width'].'px;" '.$param['attributes'].'></div><div valign="middle" align="left" style="display: table-cell; padding-left: 4px;"><input type="" value="'.($param['w_field_value2']!= 'null' ? $param['w_field_value2'] : '').'" name="'.$id.'_elementform_id_temp1" id="'.$id.'_elementform_id_temp1" onkeypress="return check_isnum_or_minus(event)" style="width: '.$param['w_field_range_width'].'px;" '.$param['attributes'].'></div></div><div style="display: table-row;"><div valign="top" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_from">'.$w_mini_labels[0].'</label></div><div valign="top" align="left" style="display: table-cell;"><label class="mini_label" id="'.$id.'_mini_label_to">'.$w_mini_labels[1].'</label></div></div></div></div></div>';
1596
+ break;
1597
+ }
1598
+ case 'type_grading': {
1599
+ $params_names = array('w_field_label_size', 'w_field_label_pos', 'w_items', 'w_total', 'w_required', 'w_class');
1600
+ $temp = $params;
1601
+ foreach($params_names as $params_name) {
1602
+ $temp = explode('*:*' . $params_name . '*:*', $temp);
1603
+ $param[$params_name] = $temp[0];
1604
+ $temp = $temp[1];
1605
+ }
1606
+ if ($temp) {
1607
+ $temp = explode('*:*w_attr_name*:*', $temp);
1608
+ $attrs = array_slice($temp, 0, count($temp) - 1);
1609
+ foreach ($attrs as $attr) {
1610
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1611
+ }
1612
+ }
1613
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "table-cell" : "block");
1614
+ $required_sym = ($param['w_required'] == "yes" ? " *" : "");
1615
+ $w_items = explode('***', $param['w_items']);
1616
+ $grading_items = '';
1617
+ for ($i = 0; $i < count($w_items); $i++) {
1618
+ $grading_items .= '<div id="'.$id.'_element_div'.$i.'" class="grading"><input id="'.$id.'_elementform_id_temp_'.$i.'" name="'.$id.'_elementform_id_temp_'.$i.'" onkeypress="return check_isnum_or_minus(event)" value="" size="5" onkeyup="sum_grading_values('.$id.',&quot;form_id_temp&quot;)" onchange="sum_grading_values('.$id.',&quot;form_id_temp&quot;)" '.$param['attributes'].'><label id="'.$id.'_label_elementform_id_temp'.$i.'" class="ch-rad-label">'.$w_items[$i].'</label></div>';
1619
+ }
1620
+ $rep ='<div id="wdform_field'.$id.'" type="type_grading" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; vertical-align: top; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_grading" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_total'].'" name="'.$id.'_grading_totalform_id_temp" id="'.$id.'_grading_totalform_id_temp"><div id="'.$id.'_elementform_id_temp">'.$grading_items.'<div id="'.$id.'_element_total_divform_id_temp" class="grading_div">Total:<span id="'.$id.'_sum_elementform_id_temp" name="'.$id.'_sum_elementform_id_temp">0</span>/<span id="'.$id.'_total_elementform_id_temp" name="'.$id.'_total_elementform_id_temp">'.$param['w_total'].'</span><span id="'.$id.'_text_elementform_id_temp" name="'.$id.'_text_elementform_id_temp"></span></div></div></div></div>';
1621
+ break;
1622
+ }
1623
+ case 'type_matrix': {
1624
+ $params_names=array('w_field_label_size','w_field_label_pos', 'w_field_input_type', 'w_rows', 'w_columns', 'w_required','w_class');
1625
+ $temp = $params;
1626
+ foreach ($params_names as $params_name) {
1627
+ $temp = explode('*:*'.$params_name.'*:*',$temp);
1628
+ $param[$params_name] = $temp[0];
1629
+ $temp = $temp[1];
1630
+ }
1631
+ if ($temp) {
1632
+ $temp = explode('*:*w_attr_name*:*', $temp);
1633
+ $attrs = array_slice($temp, 0, count($temp) - 1);
1634
+ foreach ($attrs as $attr) {
1635
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1636
+ }
1637
+ }
1638
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "table-cell" : "block");
1639
+ $required_sym = ($param['w_required']=="yes" ? " *" : "");
1640
+ $w_rows = explode('***',$param['w_rows']);
1641
+ $w_columns = explode('***',$param['w_columns']);
1642
+ $column_labels = '';
1643
+ for ($i = 1; $i < count($w_columns); $i++) {
1644
+ $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>';
1645
+ }
1646
+ $rows_columns = '';
1647
+ for ($i = 1; $i < count($w_rows); $i++) {
1648
+ $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>';
1649
+ for ($k = 1; $k < count($w_columns); $k++) {
1650
+ if($param['w_field_input_type']=='radio') {
1651
+ $rows_columns .= '<div id="'.$id.'_element_td'.$i.'_'.$k.'" style="text-align: center; display: table-cell; padding: 5px 0 0 5px;"><input id="'.$id.'_input_elementform_id_temp'.$i.'_'.$k.'" align="center" size="14" type="radio" name="'.$id.'_input_elementform_id_temp'.$i.'" value="'.$i.'_'.$k.'"></div>';
1652
+ }
1653
+ elseif ($param['w_field_input_type']=='checkbox') {
1654
+ $rows_columns .= '<div id="'.$id.'_element_td'.$i.'_'.$k.'" style="text-align: center; display: table-cell; padding: 5px 0 0 5px;"><input id="'.$id.'_input_elementform_id_temp'.$i.'_'.$k.'" align="center" size="14" type="checkbox" name="'.$id.'_input_elementform_id_temp'.$i.'_'.$k.'" value="1"></div>';
1655
+ }
1656
+ elseif ($param['w_field_input_type']=='text') {
1657
+ $rows_columns .= '<div id="'.$id.'_element_td'.$i.'_'.$k.'" style="text-align: center; display: table-cell; padding: 5px 0 0 5px;"><input id="'.$id.'_input_elementform_id_temp'.$i.'_'.$k.'" align="center" size="14" type="text" name="'.$id.'_input_elementform_id_temp'.$i.'_'.$k.'" value=""></div>';
1658
+ }
1659
+ elseif ($param['w_field_input_type']=='select') {
1660
+ $rows_columns .= '<div id="'.$id.'_element_td'.$i.'_'.$k.'" style="text-align: center; display: table-cell; padding: 5px 0 0 5px;"><select id="'.$id.'_select_yes_noform_id_temp'.$i.'_'.$k.'" name="'.$id.'_select_yes_noform_id_temp'.$i.'_'.$k.'"><option value=""> </option><option value="yes">Yes</option><option value="no">No</option></select></div>';
1661
+ }
1662
+ }
1663
+ $rows_columns .= '</div>';
1664
+ }
1665
+ $rep ='<div id="wdform_field'.$id.'" type="type_matrix" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span id="'.$id.'_element_labelform_id_temp" class="label">'.$label.'</span><span id="'.$id.'_required_elementform_id_temp" class="required">'.$required_sym.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: '.$param['w_field_label_pos'].';"><input type="hidden" value="type_matrix" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><input type="hidden" value="'.$param['w_required'].'" name="'.$id.'_requiredform_id_temp" id="'.$id.'_requiredform_id_temp"><input type="hidden" value="'.$param['w_field_input_type'].'" name="'.$id.'_input_typeform_id_temp" id="'.$id.'_input_typeform_id_temp"><div id="'.$id.'_elementform_id_temp" style="display: table;" '.$param['attributes'].'><div id="'.$id.'_table_little" style="display: table-row-group;"><div id="'.$id.'_element_tr0" style="display: table-row;"><div id="'.$id.'_element_td0_0" style="display: table-cell;"></div>'.$column_labels.'</div>'.$rows_columns.'</div></div></div></div>';
1666
+ break;
1667
+ }
1668
+ case 'type_submit_reset': {
1669
+ $params_names=array('w_submit_title','w_reset_title','w_class','w_act');
1670
+ $temp=$params;
1671
+ foreach ($params_names as $params_name) {
1672
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1673
+ $param[$params_name] = $temp[0];
1674
+ $temp=$temp[1];
1675
+ }
1676
+ if ($temp) {
1677
+ $temp = explode('*:*w_attr_name*:*',$temp);
1678
+ $attrs = array_slice($temp,0, count($temp)-1);
1679
+ foreach ($attrs as $attr) {
1680
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1681
+ }
1682
+ }
1683
+ $param['w_act'] = ($param['w_act']=="false" ? 'style="display: none;"' : "");
1684
+ $rep='<div id="wdform_field'.$id.'" type="type_submit_reset" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: table-cell;"><span id="'.$id.'_element_labelform_id_temp" style="display: none;">type_submit_reset_'.$id.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: table-cell;"><input type="hidden" value="type_submit_reset" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp"><button type="button" class="button-submit" id="'.$id.'_element_submitform_id_temp" value="'.$param['w_submit_title'].'" onclick="check_required(&quot;submit&quot;, &quot;form_id_temp&quot;);" '.$param['attributes'].'>'.$param['w_submit_title'].'</button><button type="button" class="button-reset" id="'.$id.'_element_resetform_id_temp" value="'.$param['w_reset_title'].'" onclick="check_required(&quot;reset&quot;);" '.$param['w_act'].' '.$param['attributes'].'>'.$param['w_reset_title'].'</button></div></div>';
1685
+ break;
1686
+ }
1687
+ case 'type_button': {
1688
+ $params_names=array('w_title','w_func','w_class');
1689
+ $temp=$params;
1690
+ foreach($params_names as $params_name) {
1691
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1692
+ $param[$params_name] = $temp[0];
1693
+ $temp=$temp[1];
1694
+ }
1695
+ if ($temp) {
1696
+ $temp = explode('*:*w_attr_name*:*',$temp);
1697
+ $attrs = array_slice($temp,0, count($temp)-1);
1698
+ foreach($attrs as $attr) {
1699
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1700
+ }
1701
+ }
1702
+ $param['w_title'] = explode('***',$param['w_title']);
1703
+ $param['w_func'] = explode('***',$param['w_func']);
1704
+ $rep.='<div id="wdform_field'.$id.'" type="type_button" class="wdform_field" style="display: table-cell;"><div align="left" id="'.$id.'_label_sectionform_id_temp" class="'.$param['w_class'].'" style="display: table-cell;"><span id="'.$id.'_element_labelform_id_temp" style="display: none;">button_'.$id.'</span></div><div align="left" id="'.$id.'_element_sectionform_id_temp" class="'.$param['w_class'].'" style="display: table-cell;"><input type="hidden" value="type_button" name="'.$id.'_typeform_id_temp" id="'.$id.'_typeform_id_temp">';
1705
+ foreach ($param['w_title'] as $key => $title) {
1706
+ $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>';
1707
+ }
1708
+ $rep .= '</div></div>';
1709
+ break;
1710
+ }
1711
+ }
1712
+ // Arrows.
1713
+ switch ($type) {
1714
+ case 'type_section_break': {
1715
+ $rep =$rep.'<div id="wdform_arrows'.$id.'" class="wdform_arrows_section"><div id="X_'.$id.'" class="element_toolbar"><img src="' . WD_FM_URL . '/images/delete_el.png" title="Remove the field" onclick="remove_section_break(&quot;'.$id.'&quot;)"></div><div id="edit_'.$id.'" class="element_toolbar"><img src="' . WD_FM_URL . '/images/edit.png" title="Edit the field" onclick="edit(&quot;'.$id.'&quot;)"><span id="'.$id.'_element_labelform_id_temp" style="display: none;">custom_'.$id.'</span></div><div id="dublicate_'.$id.'" class="element_toolbar"><img src="' . WD_FM_URL . '/images/dublicate.png" title="Dublicate the field" onclick="dublicate(&quot;'.$id.'&quot;)"></div></div>';
1716
+ break;
1717
+ }
1718
+ case 'type_send_copy':
1719
+ case 'type_captcha':
1720
+ case 'type_recaptcha': {
1721
+ $rep =$rep.'<div id="wdform_arrows'.$id.'" class="wdform_arrows" style="display: table-cell;"><div id="X_'.$id.'" valign="middle" align="right" class="element_toolbar"><img src="' . WD_FM_URL . '/images/delete_el.png" title="Remove the field" onclick="remove_row(&quot;'.$id.'&quot;)"></div><div id="left_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/left.png" title="Move the field to the left" onclick="left_row(&quot;'.$id.'&quot;)"></div><div id="up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/up.png" title="Move the field up" onclick="up_row(&quot;'.$id.'&quot;)"></div><div id="down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/down.png" title="Move the field down" onclick="down_row(&quot;'.$id.'&quot;)"></div><div id="right_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/right.png" title="Move the field to the right" onclick="right_row(&quot;'.$id.'&quot;)"></div><div id="edit_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/edit.png" title="Edit the field" onclick="edit(&quot;'.$id.'&quot;)"></div><div id="dublicate_'.$id.'" valign="middle" class="element_toolbar"></div><div id="page_up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_up.png" title="Move the field to the upper page" onclick="page_up(&quot;'.$id.'&quot;)"></div><div id="page_down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_down.png" title="Move the field to the lower page" onclick="page_down(&quot;'.$id.'&quot;)"></div></div>';
1722
+ break;
1723
+ }
1724
+ default: {
1725
+ $rep =$rep.'<div id="wdform_arrows'.$id.'" class="wdform_arrows" style="display: table-cell;"><div id="X_'.$id.'" valign="middle" align="right" class="element_toolbar"><img src="' . WD_FM_URL . '/images/delete_el.png" title="Remove the field" onclick="remove_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;delete_el&quot;)" onmouseout="chnage_icons_src(this,&quot;delete_el&quot;)"></div><div id="left_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/left.png" title="Move the field to the left" onclick="left_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;left&quot;)" onmouseout="chnage_icons_src(this,&quot;left&quot;)"></div><div id="up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/up.png" title="Move the field up" onclick="up_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;up&quot;)" onmouseout="chnage_icons_src(this,&quot;up&quot;)"></div><div id="down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/down.png" title="Move the field down" onclick="down_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;down&quot;)" onmouseout="chnage_icons_src(this,&quot;down&quot;)"></div><div id="right_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/right.png" title="Move the field to the right" onclick="right_row(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;right&quot;)" onmouseout="chnage_icons_src(this,&quot;right&quot;)"></div><div id="edit_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/edit.png" title="Edit the field" onclick="edit(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;edit&quot;)" onmouseout="chnage_icons_src(this,&quot;edit&quot;)"></div><div id="dublicate_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/dublicate.png" title="Dublicate the field" onclick="dublicate(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;dublicate&quot;)" onmouseout="chnage_icons_src(this,&quot;dublicate&quot;)"></div><div id="page_up_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_up.png" title="Move the field to the upper page" onclick="page_up(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;page_up&quot;)" onmouseout="chnage_icons_src(this,&quot;page_up&quot;)"></div><div id="page_down_'.$id.'" valign="middle" class="element_toolbar"><img src="' . WD_FM_URL . '/images/page_down.png" title="Move the field to the lower page" onclick="page_down(&quot;'.$id.'&quot;)" onmouseover="chnage_icons_src(this,&quot;page_down&quot;)" onmouseout="chnage_icons_src(this,&quot;page_down&quot;)"></div></div>';
1726
+ break;
1727
+ }
1728
+ }
1729
+ $form = str_replace('%' . $id . ' - ' . $labels[$ids_key] . '%', $rep, $form);
1730
+ $row->form_front = $form;
1731
+ }
1732
+ }
1733
+ }
1734
+ else {
1735
+ $row = new stdClass();
1736
+ $row->id = 0;
1737
+ $row->title = '';
1738
+ $row->mail = '';
1739
+ $row->form = '';
1740
+ $row->form_front = '';
1741
+ $row->theme = 0;
1742
+ $row->javascript = '';
1743
+ $row->submit_text = '';
1744
+ $row->url = '';
1745
+ $row->submit_text_type = 0;
1746
+ $row->script1 = '';
1747
+ $row->script2 = '';
1748
+ $row->script_user1 = '';
1749
+ $row->script_user2 = '';
1750
+ $row->counter = 0;
1751
+ $row->label_order = '';
1752
+ $row->article_id = '';
1753
+ $row->pagination = '';
1754
+ $row->show_title = '';
1755
+ $row->show_numbers = '';
1756
+ $row->public_key = '';
1757
+ $row->private_key = '';
1758
+ $row->recaptcha_theme = '';
1759
+ $row->from_name = '';
1760
+ $row->from_mail = '';
1761
+ $row->label_order_current = '';
1762
+ $row->script_mail_user = '';
1763
+ $row->script_mail = '';
1764
+ $row->tax = 0;
1765
+ $row->payment_currency = '$';
1766
+ $row->paypal_email = '';
1767
+ $row->checkout_mode = 'testmode';
1768
+ $row->paypal_mode = 0;
1769
+
1770
+ $row->published = 1;
1771
+ $row->form_fields = '';
1772
+ $row->savedb = 1;
1773
+ $row->sendemail = 1;
1774
+ $row->requiredmark = '*';
1775
+ $row->reply_to = 0;
1776
+ $row->send_to = 0;
1777
+ $row->autogen_layout = 1;
1778
+ $row->custom_front = '';
1779
+ $row->mail_from_user = '';
1780
+ $row->mail_from_name_user = '';
1781
+ $row->reply_to_user = '';
1782
+ }
1783
+ return $row;
1784
+ }
1785
+
1786
+ public function get_theme_rows_data($old = '') {
1787
+ global $wpdb;
1788
+ $rows = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "formmaker_themes WHERE css " . ($old ? 'NOT' : '') . " LIKE '%.wdform_section%' ORDER BY title");
1789
+ return $rows;
1790
+ }
1791
+
1792
+ public function page_nav() {
1793
+ global $wpdb;
1794
+ $where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
1795
+ $query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker " . $where;
1796
+ $total = $wpdb->get_var($query);
1797
+ $page_nav['total'] = $total;
1798
+ if (isset($_POST['page_number']) && $_POST['page_number']) {
1799
+ $limit = ((int) $_POST['page_number'] - 1) * 20;
1800
+ }
1801
+ else {
1802
+ $limit = 0;
1803
+ }
1804
+ $page_nav['limit'] = (int) ($limit / 20 + 1);
1805
+ return $page_nav;
1806
+ }
1807
+ ////////////////////////////////////////////////////////////////////////////////////////
1808
+ // Getters & Setters //
1809
+ ////////////////////////////////////////////////////////////////////////////////////////
1810
+ ////////////////////////////////////////////////////////////////////////////////////////
1811
+ // Private Methods //
1812
+ ////////////////////////////////////////////////////////////////////////////////////////
1813
+ ////////////////////////////////////////////////////////////////////////////////////////
1814
+ // Listeners //
1815
+ ////////////////////////////////////////////////////////////////////////////////////////
1816
+ }
admin/models/FMModelShow_matrix.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMModelShow_matrix {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Getters & Setters //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ ////////////////////////////////////////////////////////////////////////////////////////
26
+ // Private Methods //
27
+ ////////////////////////////////////////////////////////////////////////////////////////
28
+ ////////////////////////////////////////////////////////////////////////////////////////
29
+ // Listeners //
30
+ ////////////////////////////////////////////////////////////////////////////////////////
31
+ }
admin/models/FMModelSubmissions_fm.php ADDED
@@ -0,0 +1,592 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class FMModelSubmissions_fm {
3
+ ////////////////////////////////////////////////////////////////////////////////////////
4
+ // Events //
5
+ ////////////////////////////////////////////////////////////////////////////////////////
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ // Constants //
8
+ ////////////////////////////////////////////////////////////////////////////////////////
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ // Variables //
11
+ ////////////////////////////////////////////////////////////////////////////////////////
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ // Constructor & Destructor //
14
+ ////////////////////////////////////////////////////////////////////////////////////////
15
+ public function __construct() {
16
+ }
17
+ ////////////////////////////////////////////////////////////////////////////////////////
18
+ // Public Methods //
19
+ ////////////////////////////////////////////////////////////////////////////////////////
20
+ public function check_ip($ip) {
21
+ global $wpdb;
22
+ $query = "SELECT id, title FROM " . $wpdb->prefix . "formmaker order by title";
23
+ $ip = $wpdb->get_var($wpdb->prepare('SELECT ip FROM ' . $wpdb->prefix . 'formmaker_blocked WHERE ip="%s"', $ip));
24
+ return $ip;
25
+ }
26
+
27
+ public function get_form_titles() {
28
+ global $wpdb;
29
+ $query = "SELECT id, title FROM " . $wpdb->prefix . "formmaker order by title";
30
+ $forms = $wpdb->get_results($query);
31
+ return $forms;
32
+ }
33
+
34
+ public function get_statistics($form_id) {
35
+ global $wpdb;
36
+ $statistics = array();
37
+ $query = $wpdb->prepare('SELECT count(distinct group_id) FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id ="%d"', $form_id);
38
+ $statistics["total_entries"] = $wpdb->get_var($query);
39
+ $query = $wpdb->prepare('SELECT `views` FROM ' . $wpdb->prefix . 'formmaker_views WHERE form_id="%d"', $form_id);
40
+ $statistics["total_views"] = $wpdb->get_var($query);
41
+ if ($statistics["total_views"]) {
42
+ $statistics["conversion_rate"] = round((($statistics["total_entries"] / $statistics["total_views"]) * 100), 2) . '%';
43
+ }
44
+ else {
45
+ $statistics["conversion_rate"] = '0%';
46
+ }
47
+ return $statistics;
48
+ }
49
+
50
+ public function get_labels_parameters($form_id) {
51
+ global $wpdb;
52
+ $labels = array();
53
+ $labels_id = array();
54
+ $sorted_labels_id = array();
55
+ $label_names = array();
56
+ $label_types = array();
57
+ $sorted_label_types = array();
58
+ $label_names_original = array();
59
+ $labels_parameters = array();
60
+ $join_query = array();
61
+ $join_where = array();
62
+ $rows_ord = array();
63
+ $join = '';
64
+ for ($i = 0; $i < 8; $i++) {
65
+ array_push($labels_parameters, NULL);
66
+ }
67
+ $sorted_label_names = array();
68
+ $sorted_label_names_original = array();
69
+ $where_labels = array();
70
+ $where2 = array();
71
+ $order_by = (isset($_POST['order_by']) ? esc_html(stripslashes($_POST['order_by'])) : 'group_id');
72
+ $asc_or_desc = ((isset($_POST['asc_or_desc'])) ? esc_html(stripslashes($_POST['asc_or_desc'])) : 'desc');
73
+ $limit = ((isset($_POST['page_number'])) ? ((int) $_POST['page_number'] - 1) * 20 : 0);
74
+ $lists['hide_label_list'] = ((isset($_POST['hide_label_list'])) ? esc_html(stripslashes($_POST['hide_label_list'])) : '');
75
+ $lists['startdate'] = ((isset($_POST['startdate'])) ? esc_html(stripslashes($_POST['startdate'])) : '');
76
+ $lists['enddate'] = ((isset($_POST['enddate'])) ? esc_html(stripslashes($_POST['enddate'])) : '');
77
+ $lists['ip_search'] = ((isset($_POST['ip_search'])) ? esc_html(stripslashes($_POST['ip_search'])) : '');
78
+ if ($lists['ip_search']) {
79
+ $where[] = 'ip LIKE "%' . $lists['ip_search'] . '%"';
80
+ }
81
+ if ($lists['startdate'] != '') {
82
+ $where[] = " `date`>='" . $lists['startdate'] . " 00:00:00' ";
83
+ }
84
+ if ($lists['enddate'] != '') {
85
+ $where[] = " `date`<='" . $lists['enddate'] . " 23:59:59' ";
86
+ }
87
+ $where[] = 'form_id=' . $form_id . '';
88
+ $where = (count($where) ? ' ' . implode(' AND ', $where) : '');
89
+ if ($order_by == 'group_id' or $order_by == 'date' or $order_by == 'ip') {
90
+ $orderby = ' ORDER BY ' . $order_by . ' ' . $asc_or_desc . '';
91
+ }
92
+ else {
93
+ $orderby = "";
94
+ }
95
+ if ($form_id) {
96
+ for($i = 0; $i < 8; $i++) {
97
+ array_pop($labels_parameters);
98
+ }
99
+ $query = "SELECT distinct element_label FROM " . $wpdb->prefix . "formmaker_submits WHERE ". $where;
100
+ $results = $wpdb->get_results($query);
101
+ for ($i = 0; $i < count($results); $i++) {
102
+ array_push($labels, $results[$i]->element_label);
103
+ }
104
+ $form = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id='%d'", $form_id));
105
+ if (strpos($form->label_order, 'type_paypal_')) {
106
+ $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#****#";
107
+ }
108
+ $form_labels = explode('#****#', $form->label_order);
109
+ $form_labels = array_slice($form_labels, 0, count($form_labels) - 1);
110
+ foreach ($form_labels as $key => $form_label) {
111
+ $label_id = explode('#**id**#', $form_label);
112
+ array_push($labels_id, $label_id[0]);
113
+ $label_name_type = explode('#**label**#', $label_id[1]);
114
+ array_push($label_names_original, $label_name_type[0]);
115
+ $ptn = "/[^a-zA-Z0-9_]/";
116
+ $rpltxt = "";
117
+ $label_name = preg_replace($ptn, $rpltxt, $label_name_type[0]);
118
+ array_push($label_names, $label_name);
119
+ array_push($label_types, $label_name_type[1]);
120
+ }
121
+ foreach ($labels_id as $key => $label_id) {
122
+ if (in_array($label_id, $labels)) {
123
+ if (!in_array($label_id, $sorted_labels_id)) {
124
+ array_push($sorted_labels_id, $label_id);
125
+ }
126
+ array_push($sorted_label_names, $label_names[$key]);
127
+ array_push($sorted_label_types, $label_types[$key]);
128
+ array_push($sorted_label_names_original, $label_names_original[$key]);
129
+ if (isset($_POST[$form_id . '_' . $label_id . '_search'])) {
130
+ $search_temp = esc_html($_POST[$form_id . '_' . $label_id . '_search']);
131
+ }
132
+ else {
133
+ $search_temp = '';
134
+ }
135
+ $search_temp = strtolower($search_temp);
136
+ $lists[$form_id . '_' . $label_id . '_search'] = $search_temp;
137
+ if ($search_temp) {
138
+ $join_query[] = 'search';
139
+ $join_where[] = array('label' => $label_id, 'search' => $search_temp);
140
+ }
141
+ }
142
+ }
143
+ if (strpos($order_by, "_field")) {
144
+ if (in_array(str_replace("_field", "", $order_by), $labels)) {
145
+ $join_query[] = 'sort';
146
+ $join_where[] = array('label'=>str_replace("_field", "", $order_by));
147
+ }
148
+ }
149
+ $cols = 'group_id';
150
+ if ($order_by == 'date' or $order_by == 'ip') {
151
+ $cols = 'group_id, date, ip';
152
+ }
153
+ switch (count($join_query)) {
154
+ case 0:
155
+ $join = 'SELECT distinct group_id FROM ' . $wpdb->prefix . 'formmaker_submits WHERE '. $where;
156
+ break;
157
+ case 1:
158
+ if ($join_query[0] == 'sort') {
159
+ $join = 'SELECT group_id FROM ' . $wpdb->prefix . 'formmaker_submits WHERE ' . $where . ' AND element_label="' . $join_where[0]['label'] . '" ';
160
+ $join_count = 'SELECT count(group_id) FROM ' . $wpdb->prefix . 'formmaker_submits WHERE form_id="' . $form_id . '" AND element_label="' . $join_where[0]['label'] . '" ';
161
+ $orderby = ' ORDER BY `element_value` ' . $asc_or_desc;
162
+ }
163
+ else {
164
+ $join = 'SELECT group_id FROM ' . $wpdb->prefix . 'formmaker_submits WHERE element_label="' . $join_where[0]['label'] . '" AND element_value LIKE "%' . $join_where[0]['search'] . '%" AND ' . $where;
165
+ }
166
+ break;
167
+ default:
168
+ $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'] . '%" ) as t ';
169
+ for ($key = 1; $key < count($join_query); $key++) {
170
+ if ($join_query[$key] == 'sort') {
171
+ $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 ';
172
+ $orderby = ' ORDER BY t' . $key . '.`element_value` ' . $asc_or_desc . '';
173
+ }
174
+ else {
175
+ $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'] . '%" ) as t' . $key . ' ON t' . $key . '.group_id' . $key . '=t.group_id ';
176
+ }
177
+ }
178
+ break;
179
+ }
180
+ $pos = strpos($join, 'SELECT t.group_id');
181
+ if ($pos === FALSE) {
182
+ $query = str_replace(array('SELECT group_id','SELECT distinct group_id'), array('SELECT count(distinct group_id)','SELECT count(distinct group_id)'), $join);
183
+ }
184
+ else {
185
+ $query = str_replace('SELECT t.group_id', 'SELECT count(t.group_id)', $join);
186
+ }
187
+ $total = $wpdb->get_var($query);
188
+ $query = $join . ' ' . $orderby . ' limit ' . $limit . ', 20 ';
189
+ $results = $wpdb->get_results($query);
190
+ for ($i = 0; $i < count($results); $i++) {
191
+ array_push($rows_ord, $results[$i]->group_id);
192
+ }
193
+ $where2 = array();
194
+ $where2[] = "group_id='0'";
195
+ foreach ($rows_ord as $rows_ordd) {
196
+ $where2[] = "group_id='" . $rows_ordd . "'";
197
+ }
198
+ $where2 = (count($where2) ? ' WHERE ' . implode( ' OR ', $where2 ) . '' : '' );
199
+ $query = 'SELECT * FROM ' . $wpdb->prefix . 'formmaker_submits ' . $where2;
200
+ $rows = $wpdb->get_results($query);
201
+ $group_ids = $rows_ord;
202
+ $lists['total'] = $total;
203
+ $lists['limit'] = (int) ($limit / 20 + 1);
204
+ $where_choices = $where;
205
+ array_push($labels_parameters, $sorted_labels_id);
206
+ array_push($labels_parameters, $sorted_label_types);
207
+ array_push($labels_parameters, $lists);
208
+ array_push($labels_parameters, $sorted_label_names);
209
+ array_push($labels_parameters, $sorted_label_names_original);
210
+ array_push($labels_parameters, $rows);
211
+ array_push($labels_parameters, $group_ids);
212
+ array_push($labels_parameters, $where_choices);
213
+ }
214
+ return $labels_parameters;
215
+ }
216
+
217
+ public function get_type_address($sorted_label_type, $sorted_label_name_original) {
218
+ if ($sorted_label_type == 'type_address') {
219
+ switch ($sorted_label_name_original) {
220
+ case 'Street Line':
221
+ $field_title = __('Street Address', 'form_maker');
222
+ break;
223
+ case 'Street Line2':
224
+ $field_title = __('Street Address Line 2', 'form_maker');
225
+ break;
226
+ case 'City':
227
+ $field_title = __('City', 'form_maker');
228
+ break;
229
+ case 'State':
230
+ $field_title = __('State / Province / Region', 'form_maker');
231
+ break;
232
+ case 'Postal':
233
+ $field_title = __('Postal / Zip Code', 'form_maker');
234
+ break;
235
+ case 'Country':
236
+ $field_title = __('Country', 'form_maker');
237
+ break;
238
+ default :
239
+ $field_title = stripslashes($sorted_label_name_original);
240
+ break;
241
+ }
242
+ }
243
+ else {
244
+ $field_title = stripslashes($sorted_label_name_original);
245
+ }
246
+ return $field_title;
247
+ }
248
+
249
+ public function hide_or_not($hide_strings,$hide_string) {
250
+ if (strpos($hide_string,'@') === FALSE) {
251
+ if (strpos($hide_strings, '@' . $hide_string . '@') === FALSE) {
252
+ $style = '';
253
+ }
254
+ else {
255
+ $style = 'style="display:none"';
256
+ }
257
+ }
258
+ else {
259
+ if (strpos($hide_strings, $hide_string) === FALSE) {
260
+ $style = '';
261
+ }
262
+ else {
263
+ $style = 'style="display:none"';
264
+ }
265
+ }
266
+ return $style;
267
+ }
268
+
269
+ public function sort_group_ids($sorted_label_names_count, $group_ids) {
270
+ $count_labe = $sorted_label_names_count;
271
+ $group_id_s = array();
272
+ $l = 0;
273
+ if (count($group_ids) > 0 and $count_labe) {
274
+ for ($i = 0; $i < count($group_ids); $i++) {
275
+ if (!in_array($group_ids[$i], $group_id_s)) {
276
+ array_push($group_id_s, $group_ids[$i]);
277
+ }
278
+ }
279
+ }
280
+ return $group_id_s;
281
+ }
282
+
283
+ public function array_for_group_id($group, $rows) {
284
+ $i = $group;
285
+ $count_rows = count($rows);
286
+ $temp = array();
287
+ for ($j = 0; $j < $count_rows; $j++) {
288
+ $row = $rows[$j];
289
+ if ($row->group_id == $i) {
290
+ array_push($temp, $row);
291
+ }
292
+ }
293
+ return $temp;
294
+ }
295
+
296
+ public function check_radio_type($sorted_label_type) {
297
+ 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") {
298
+ return TRUE;
299
+ }
300
+ else {
301
+ return FALSE;
302
+ }
303
+ }
304
+
305
+ public function statistic_for_radio($where_choices, $sorted_label_id) {
306
+ global $wpdb;
307
+ $choices_params = array();
308
+ $query = "SELECT element_value FROM " . $wpdb->prefix . "formmaker_submits WHERE " . $where_choices . " AND element_label='" . $sorted_label_id . "'";
309
+ $choices = $wpdb->get_results($query);
310
+ $colors = array(
311
+ '#2CBADE',
312
+ '#FE6400'
313
+ );
314
+ $choices_labels = array();
315
+ $choices_count = array();
316
+ $all = count($choices);
317
+ $unanswered = 0;
318
+ foreach ($choices as $key => $choice) {
319
+ if ($choice->element_value == '') {
320
+ $unanswered++;
321
+ }
322
+ else {
323
+ if (!in_array($choice->element_value, $choices_labels)) {
324
+ array_push($choices_labels, $choice->element_value);
325
+ array_push($choices_count, 0);
326
+ }
327
+ $choices_count[array_search($choice->element_value, $choices_labels)]++;
328
+ }
329
+ }
330
+ array_multisort($choices_count, SORT_DESC, $choices_labels);
331
+ array_push($choices_params, $choices_count);
332
+ array_push($choices_params, $choices_labels);
333
+ array_push($choices_params, $unanswered);
334
+ array_push($choices_params, $all);
335
+ array_push($choices_params, $colors);
336
+ return $choices_params;
337
+ }
338
+
339
+ public function get_data_of_group_id($id) {
340
+ global $wpdb;
341
+ $query = "SELECT * FROM " . $wpdb->prefix . "formmaker_submits WHERE group_id=" . $id;
342
+ $rows = $wpdb->get_results($query);
343
+ $form = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "formmaker WHERE id=" . $rows[0]->form_id);
344
+ $params = array();
345
+ $label_id = array();
346
+ $label_order_original = array();
347
+ $label_type = array();
348
+ $ispaypal = strpos($form->label_order, 'type_paypal_');
349
+ if ($form->paypal_mode == 1) {
350
+ if ($ispaypal) {
351
+ $form->label_order = $form->label_order."0#**id**#Payment Status#**label**#type_paypal_payment_status#****#";
352
+ }
353
+ }
354
+ $label_all = explode('#****#', $form->label_order);
355
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
356
+ foreach ($label_all as $key => $label_each) {
357
+ $label_id_each = explode('#**id**#', $label_each);
358
+ array_push($label_id, $label_id_each[0]);
359
+ $label_oder_each = explode('#**label**#', $label_id_each[1]);
360
+ array_push($label_order_original, $label_oder_each[0]);
361
+ array_push($label_type, $label_oder_each[1]);
362
+ }
363
+ /*$theme_id = $wpdb->get_var("SELECT theme FROM " . $wpdb->prefix . "formmaker WHERE id='" . $form->id . "'");*/
364
+ $css = $wpdb->get_var("SELECT css FROM " . $wpdb->prefix . "formmaker_themes");
365
+ array_push($params, $rows);
366
+ array_push($params, $label_id);
367
+ array_push($params, $label_order_original);
368
+ array_push($params, $label_type);
369
+ array_push($params, $ispaypal);
370
+ array_push($params, $form);
371
+ array_push($params, $css);
372
+ return $params;
373
+ }
374
+
375
+ public function check_type_for_edit_function($label_type) {
376
+ 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') {
377
+ return TRUE;
378
+ }
379
+ else {
380
+ return FALSE;
381
+ }
382
+ }
383
+
384
+ public function check_for_submited_label($rows, $label_id) {
385
+ foreach ($rows as $row) {
386
+ if ($row->element_label == $label_id) {
387
+ $element_value = $row->element_value;
388
+ break;
389
+ }
390
+ else {
391
+ $element_value = 'continue';
392
+ }
393
+ }
394
+ return $element_value;
395
+ }
396
+
397
+ public function view_for_star_rating($element_value, $element_label) {
398
+ $view_star_rating_array = array();
399
+ $new_filename = str_replace("***star_rating***", '', $element_value);
400
+ $stars = "";
401
+ $new_filename=explode('***', $new_filename);
402
+ for ($j = 0; $j < $new_filename[1]; $j++) {
403
+ $stars .= '<img id="' . $element_label . '_star_' . $j . '" src="' . WD_FM_URL . '/images/star_' . $new_filename[2] . '.png" /> ';
404
+ }
405
+ for ($k = $new_filename[1]; $k < $new_filename[0]; $k++) {
406
+ $stars .= '<img id="' . $element_label . '_star_' . $k . '" src="' . WD_FM_URL . '/images/star.png" /> ';
407
+ }
408
+ array_push($view_star_rating_array, $stars);
409
+ return $view_star_rating_array;
410
+ }
411
+
412
+ public function view_for_grading($element_value) {
413
+ $view_grading_array = array();
414
+ $new_filename = str_replace("***grading***", '', $element_value);
415
+ $grading = explode(":", $new_filename);
416
+ $items_count = sizeof($grading) - 1;
417
+ $items = "";
418
+ $total = "";
419
+ for ($k = 0; $k < $items_count / 2; $k++) {
420
+ $items .= $grading[$items_count / 2 + $k] . ": " . $grading[$k] . "</br>";
421
+ $total += $grading[$k];
422
+ }
423
+ $items .= "Total: " . $total;
424
+ array_push($view_grading_array, $items);
425
+ return $view_grading_array;
426
+ }
427
+
428
+ public function images_for_star_rating($element_value, $label_id) {
429
+ $edit_stars = "";
430
+ $star_rating_array = array();
431
+ $element_value1 = str_replace("***star_rating***", '', $element_value);
432
+ $stars_value = explode('***', $element_value1);
433
+ for ($j = 0; $j < $stars_value[1]; $j++) {
434
+ $edit_stars .= '<img id="'.$label_id.'_star_'.$j.'" onclick="edit_star_rating('.$j.','.$label_id.')" src="' . WD_FM_URL . '/images/star_'.$stars_value[2].'.png" /> ';
435
+ }
436
+ for( $k=$stars_value[1];$k<$stars_value[0];$k++) {
437
+ $edit_stars .= '<img id="'.$label_id.'_star_'.$k.'" onclick="edit_star_rating('.$k.','.$label_id.')" src="' . WD_FM_URL . '/images/star.png" /> ';
438
+ }
439
+ array_push($star_rating_array, $edit_stars);
440
+ array_push($star_rating_array, $stars_value);
441
+ return $star_rating_array;
442
+ }
443
+
444
+ public function params_for_scale_rating($element_value, $label_id) {
445
+ $scale_rating_array = array();
446
+ $scale_radio = explode('/', $element_value);
447
+ $scale_value = $scale_radio[0];
448
+ $scale = '<table><tr>';
449
+ for ($k = 1; $k <= $scale_radio[1]; $k++) {
450
+ $scale .= '<td style="text-align:center"><span>' . $k . '</span></td>';
451
+ }
452
+ $scale .= '<tr></tr>';
453
+ for ($l = 1; $l <= $scale_radio[1]; $l++) {
454
+ if ($l == $scale_radio[0]) {
455
+ $checked = "checked";
456
+ }
457
+ else {
458
+ $checked = "";
459
+ }
460
+ $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>';
461
+ }
462
+ $scale .= '</tr></table>';
463
+ array_push($scale_rating_array, $scale);
464
+ array_push($scale_rating_array, $scale_radio);
465
+ array_push($scale_rating_array, $checked);
466
+ return $scale_rating_array;
467
+ }
468
+
469
+ public function params_for_type_range($element_value, $label_id) {
470
+ $range_value = explode('-', $element_value);
471
+ $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"/>';
472
+ return $range;
473
+ }
474
+
475
+ public function params_for_type_grading($element_value, $label_id) {
476
+ $type_grading_array = array();
477
+ $element_value1 = str_replace("***grading***", '', $element_value);
478
+ $garding_value = explode(':', $element_value1);
479
+ $items_count = sizeof($garding_value) - 1;
480
+ $garding = "";
481
+ $sum = "";
482
+ for ($k = 0; $k < $items_count/2; $k++) {
483
+ $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>';
484
+ $sum += $garding_value[$k];
485
+ }
486
+ array_push($type_grading_array, $garding);
487
+ array_push($type_grading_array, $garding_value);
488
+ array_push($type_grading_array, $sum);
489
+ array_push($type_grading_array, $items_count);
490
+ array_push($type_grading_array, $element_value1);
491
+ return $type_grading_array;
492
+ }
493
+
494
+ public function params_for_type_matrix($element_value, $label_id) {
495
+ $type_matrix_array = array();
496
+ $new_filename = str_replace("***matrix***", '', $element_value);
497
+ $matrix_value = explode('***', $new_filename);
498
+ $matrix_value = array_slice($matrix_value, 0, count($matrix_value) - 1);
499
+ $mat_rows = $matrix_value[0];
500
+ $mat_columns = $matrix_value[$mat_rows + 1];
501
+ $matrix = "<table>";
502
+ $matrix .= '<tr><td></td>';
503
+ for ($k = 1; $k <= $mat_columns; $k++) {
504
+ $matrix .= '<td style="background-color:#BBBBBB; padding:5px; border:1px; ">'.$matrix_value[$mat_rows+1+$k].'</td>';
505
+ }
506
+ $matrix .= '</tr>';
507
+ $aaa = Array();
508
+ $var_checkbox = 1;
509
+ $selected_value = "";
510
+ $selected_value_yes = "";
511
+ $selected_value_no = "";
512
+ for ($k = 1; $k <= $mat_rows; $k++) {
513
+ $matrix .= '<tr><td style="background-color:#BBBBBB; padding:5px; border:1px;">'.$matrix_value[$k].'</td>';
514
+ if ($matrix_value[$mat_rows + $mat_columns + 2] == "radio") {
515
+ if ($matrix_value[$mat_rows + $mat_columns + 2 + $k] == 0) {
516
+ $checked = "";
517
+ $aaa[1] = "";
518
+ }
519
+ else {
520
+ $aaa = explode("_", $matrix_value[$mat_rows + $mat_columns + 2 + $k]);
521
+ }
522
+ for ($l = 1; $l <= $mat_columns; $l++) {
523
+ if ($aaa[1] == $l) {
524
+ $checked = 'checked';
525
+ }
526
+ else {
527
+ $checked = "";
528
+ }
529
+ $index = "'" . $k . '_' . $l . "'";
530
+ $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>';
531
+ }
532
+ }
533
+ else {
534
+ if ($matrix_value[$mat_rows+$mat_columns+2] == "checkbox") {
535
+ for ($l = 1; $l <= $mat_columns; $l++) {
536
+ if ($matrix_value[$mat_rows + $mat_columns + 2 + $var_checkbox] == 1) {
537
+ $checked = 'checked';
538
+ }
539
+ else {
540
+ $checked = '';
541
+ }
542
+ $index = "'".$k.'_'.$l."'";
543
+ $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>';
544
+ $var_checkbox++;
545
+ }
546
+ }
547
+ else {
548
+ if ($matrix_value[$mat_rows + $mat_columns + 2] == "text") {
549
+ for ($l = 1; $l <= $mat_columns; $l++) {
550
+ $text_value = $matrix_value[$mat_rows+$mat_columns+2+$var_checkbox];
551
+ $index = "'".$k.'_'.$l."'";
552
+ $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>';
553
+ $var_checkbox++;
554
+ }
555
+ }
556
+ else {
557
+ for ($l = 1; $l <= $mat_columns; $l++) {
558
+ $selected_text = $matrix_value[$mat_rows+$mat_columns + 2 + $var_checkbox];
559
+ if ($selected_text == 'yes') {
560
+ $selected_value_yes = 'selected';
561
+ $selected_value_no = '';
562
+ $selected_value = '';
563
+ }
564
+ else {
565
+ if ($selected_text=='no') {
566
+ $selected_value_yes ='';
567
+ $selected_value_no ='selected';
568
+ $selected_value ='';
569
+ }
570
+ else {
571
+ $selected_value_yes = '';
572
+ $selected_value_no ='';
573
+ $selected_value ='selected';
574
+ }
575
+ }
576
+ $index = "'".$k.'_'.$l."'";
577
+ $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>';
578
+ $var_checkbox++;
579
+ }
580
+ }
581
+ }
582
+ }
583
+ $matrix .= '</tr>';
584
+ }
585
+ $matrix .= '</table>';
586
+ array_push($type_matrix_array, $matrix);
587
+ array_push($type_matrix_array, $new_filename);
588
+ return $type_matrix_array;
589
+ }
590
+ }
591
+
592
+ ?>
admin/models/FMModelThemes_fm.php ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMModelThemes_fm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function get_rows_data() {
22
+ global $wpdb;
23
+ $where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
24
+ $asc_or_desc = ((isset($_POST['asc_or_desc'])) ? esc_html($_POST['asc_or_desc']) : 'asc');
25
+ $order_by = ' ORDER BY ' . ((isset($_POST['order_by']) && esc_html($_POST['order_by']) != '') ? esc_html($_POST['order_by']) : 'id') . ' ' . $asc_or_desc;
26
+ if (isset($_POST['page_number']) && $_POST['page_number']) {
27
+ $limit = ((int) $_POST['page_number'] - 1) * 20;
28
+ }
29
+ else {
30
+ $limit = 0;
31
+ }
32
+ $query = "SELECT * FROM " . $wpdb->prefix . "formmaker_themes " . $where . $order_by . " LIMIT " . $limit . ",20";
33
+ $rows = $wpdb->get_results($query);
34
+ return $rows;
35
+ }
36
+
37
+ public function get_row_data($id, $reset) {
38
+ global $wpdb;
39
+ if ($id != 0) {
40
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_themes WHERE id="%d"', $id));
41
+ if ($reset) {
42
+ if (!$row->default) {
43
+ $row_id = $row->id;
44
+ $row_title = $row->title;
45
+ $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_themes WHERE default="%d"', 1));
46
+ $row->id = $row_id;
47
+ $row->title = $row_title;
48
+ $row->default = FALSE;
49
+ }
50
+ else {
51
+ $row->css = '';
52
+ }
53
+ }
54
+ }
55
+ else {
56
+ $row->id = 0;
57
+ $row->title = '';
58
+ $row->css = '';
59
+ $row->default = 0;
60
+ }
61
+ return $row;
62
+ }
63
+
64
+ public function page_nav() {
65
+ global $wpdb;
66
+ $where = ((isset($_POST['search_value']) && (esc_html($_POST['search_value']) != '')) ? 'WHERE title LIKE "%' . esc_html($_POST['search_value']) . '%"' : '');
67
+ $query = "SELECT COUNT(*) FROM " . $wpdb->prefix . "formmaker_themes " . $where;
68
+ $total = $wpdb->get_var($query);
69
+ $page_nav['total'] = $total;
70
+ if (isset($_POST['page_number']) && $_POST['page_number']) {
71
+ $limit = ((int) $_POST['page_number'] - 1) * 20;
72
+ }
73
+ else {
74
+ $limit = 0;
75
+ }
76
+ $page_nav['limit'] = (int) ($limit / 20 + 1);
77
+ return $page_nav;
78
+ }
79
+ ////////////////////////////////////////////////////////////////////////////////////////
80
+ // Getters & Setters //
81
+ ////////////////////////////////////////////////////////////////////////////////////////
82
+ ////////////////////////////////////////////////////////////////////////////////////////
83
+ // Private Methods //
84
+ ////////////////////////////////////////////////////////////////////////////////////////
85
+ ////////////////////////////////////////////////////////////////////////////////////////
86
+ // Listeners //
87
+ ////////////////////////////////////////////////////////////////////////////////////////
88
+ }
admin/models/FMModelUninstall_fm.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMModelUninstall_fm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+ public function delete_db_tables() {
22
+ global $wpdb;
23
+ $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker");
24
+ $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_submits");
25
+ $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_views");
26
+ $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_themes");
27
+ $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_sessions");
28
+ $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "formmaker_blocked");
29
+ delete_option("wd_form_maker_version");
30
+ delete_option('formmaker_cureent_version');
31
+ delete_option('contact_form_themes');
32
+ delete_option('contact_form_forms');
33
+ delete_option('form_maker_pro_active');
34
+ }
35
+ ////////////////////////////////////////////////////////////////////////////////////////
36
+ // Getters & Setters //
37
+ ////////////////////////////////////////////////////////////////////////////////////////
38
+ ////////////////////////////////////////////////////////////////////////////////////////
39
+ // Private Methods //
40
+ ////////////////////////////////////////////////////////////////////////////////////////
41
+ ////////////////////////////////////////////////////////////////////////////////////////
42
+ // Listeners //
43
+ ////////////////////////////////////////////////////////////////////////////////////////
44
+ }
admin/models/FMModelWidget.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMModelWidget {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ ////////////////////////////////////////////////////////////////////////////////////////
14
+ // Constructor & Destructor //
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ public function __construct() {
17
+ }
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ // Public Methods //
20
+ ////////////////////////////////////////////////////////////////////////////////////////
21
+
22
+ public function get_gallery_rows_data() {
23
+ global $wpdb;
24
+ $query = "SELECT * FROM " . $wpdb->prefix . "formmaker order by `title`";
25
+ $rows = $wpdb->get_results($query);
26
+ return $rows;
27
+ }
28
+
29
+ ////////////////////////////////////////////////////////////////////////////////////////
30
+ // Getters & Setters //
31
+ ////////////////////////////////////////////////////////////////////////////////////////
32
+ ////////////////////////////////////////////////////////////////////////////////////////
33
+ // Private Methods //
34
+ ////////////////////////////////////////////////////////////////////////////////////////
35
+ ////////////////////////////////////////////////////////////////////////////////////////
36
+ // Listeners //
37
+ ////////////////////////////////////////////////////////////////////////////////////////
38
+ }
admin/views/FMViewBlocked_ips_fm.php ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMViewBlocked_ips_fm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ // Constructor & Destructor //
17
+ ////////////////////////////////////////////////////////////////////////////////////////
18
+ public function __construct($model) {
19
+ $this->model = $model;
20
+ }
21
+
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
26
+ $rows_data = $this->model->get_rows_data();
27
+ $page_nav = $this->model->page_nav();
28
+ $search_value = ((isset($_POST['search_value'])) ? esc_html(stripslashes($_POST['search_value'])) : '');
29
+ $asc_or_desc = ((isset($_POST['asc_or_desc'])) ? esc_html(stripslashes($_POST['asc_or_desc'])) : 'desc');
30
+ $order_by = (isset($_POST['order_by']) ? esc_html(stripslashes($_POST['order_by'])) : 'id');
31
+ $order_class = 'manage-column column-title sorted ' . $asc_or_desc;
32
+ $ids_string = '';
33
+ ?>
34
+ <div id="fm_blocked_ips_message" style="width: 99%; display: none;"></div>
35
+ <div style="clear: both; float: left; width: 99%;">
36
+ <div style="float:left; font-size: 14px; font-weight: bold;">
37
+ This section allows you to block IPs.
38
+ <a style="color: blue; text-decoration: none;" target="_blank" href="http://web-dorado.com/wordpress-form-maker-guide-2.html">Read More in User Manual</a>
39
+ </div>
40
+ <div style="float: right; text-align: right;">
41
+ <a style="text-decoration: none;" target="_blank" href="http://web-dorado.com/products/wordpress-form.html">
42
+ <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FM_URL . '/images/wd_logo.png'; ?>" />
43
+ </a>
44
+ </div>
45
+ </div>
46
+ <form onkeypress="spider_doNothing(event)" class="wrap" id="blocked_ips" method="post" action="admin.php?page=blocked_ips_fm" style="float: left; width: 99%;">
47
+ <span class="block_icon"></span>
48
+ <h2>Blocked IPs</h2>
49
+ <div class="buttons_div">
50
+ <input class="button-primary" type="submit" value="Save" onclick="spider_set_input_value('task', 'save_all');" />
51
+ <input class="button-secondary" type="submit" value="Delete" onclick="if (confirm('Do you want to unblock selected IPs?')) {
52
+ spider_set_input_value('task', 'delete_all');
53
+ } else {
54
+ return false;
55
+ }" />
56
+ </div>
57
+ <div class="tablenav top">
58
+ <?php
59
+ WDW_FM_Library::search('IP', $search_value, 'blocked_ips');
60
+ WDW_FM_Library::html_page_nav($page_nav['total'], $page_nav['limit'], 'blocked_ips');
61
+ ?>
62
+ </div>
63
+ <table class="wp-list-table widefat fixed pages">
64
+ <thead>
65
+ <tr>
66
+ <th class="manage-column column-cb check-column table_small_col"><input id="check_all" type="checkbox" style="margin: 0;" /></th>
67
+ <th class="table_small_col <?php if ($order_by == 'id') {echo $order_class;} ?>">
68
+ <a onclick="spider_set_input_value('task', '');
69
+ spider_set_input_value('order_by', 'id');
70
+ spider_set_input_value('asc_or_desc', '<?php echo ((isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && (esc_html(stripslashes($_POST['order_by'])) == 'id') && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc') ? 'desc' : 'asc'); ?>');
71
+ spider_form_submit(event, 'blocked_ips')" href="">
72
+ <span>ID</span><span class="sorting-indicator"></span></th>
73
+ </a>
74
+ <th class="<?php if ($order_by == 'ip') {echo $order_class;} ?>">
75
+ <a onclick="spider_set_input_value('task', '');
76
+ spider_set_input_value('order_by', 'ip');
77
+ spider_set_input_value('asc_or_desc', '<?php echo ((isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && (esc_html(stripslashes($_POST['order_by'])) == 'ip') && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc') ? 'desc' : 'asc'); ?>');
78
+ spider_form_submit(event, 'blocked_ips')" href="">
79
+ <span>IP</span><span class="sorting-indicator"></span>
80
+ </a>
81
+ </th>
82
+ <th class="table_big_col">Edit</th>
83
+ <th class="table_big_col">Delete</th>
84
+ </tr>
85
+ <tr id="tr">
86
+ <th></th>
87
+ <th></th>
88
+ <th class="edit_input"><input type="text" class="input_th" id="ip" name="ip" onkeypress="return spider_check_isnum(event)"></th>
89
+ <th class="table_big_col">
90
+ <a class="add_tag_th button-primary button button-small" onclick="if (spider_check_required('ip', 'IP')) {return false;}
91
+ spider_set_input_value('task', 'save');
92
+ spider_set_input_value('current_id', '');
93
+ spider_form_submit(event, 'blocked_ips')" href="">Add IP</a>
94
+ </th>
95
+ <th></th>
96
+ </tr>
97
+ </thead>
98
+ <tbody id="tbody_arr">
99
+ <?php
100
+ if ($rows_data) {
101
+ foreach ($rows_data as $row_data) {
102
+ $alternate = (!isset($alternate) || $alternate == 'class="alternate"') ? '' : 'class="alternate"';
103
+ ?>
104
+ <tr id="tr_<?php echo $row_data->id; ?>" <?php echo $alternate; ?>>
105
+ <td class="table_small_col check-column" id="td_check_<?php echo $row_data->id; ?>" >
106
+ <input id="check_<?php echo $row_data->id; ?>" name="check_<?php echo $row_data->id; ?>" type="checkbox" />
107
+ </td>
108
+ <td class="table_small_col" id="td_id_<?php echo $row_data->id; ?>" ><?php echo $row_data->id; ?></td>
109
+ <td id="td_ip_<?php echo $row_data->id; ?>" >
110
+ <a class="pointer" id="ip<?php echo $row_data->id; ?>"
111
+ onclick="spider_edit_ip(<?php echo $row_data->id; ?>)"
112
+ title="Edit"><?php echo $row_data->ip; ?></a>
113
+ </td>
114
+ <td class="table_big_col" id="td_edit_<?php echo $row_data->id; ?>">
115
+ <a onclick="spider_edit_ip(<?php echo $row_data->id; ?>)">Edit</a>
116
+ </td>
117
+ <td class="table_big_col" id="td_delete_<?php echo $row_data->id; ?>">
118
+ <a onclick="spider_set_input_value('task', 'delete');
119
+ spider_set_input_value('current_id', <?php echo $row_data->id; ?>);
120
+ spider_form_submit(event, 'blocked_ips')" href="">Delete</a>
121
+ </td>
122
+ </tr>
123
+ <?php
124
+ $ids_string .= $row_data->id . ',';
125
+ }
126
+ }
127
+ ?>
128
+ </tbody>
129
+ </table>
130
+ <input id="task" name="task" type="hidden" value="" />
131
+ <input id="current_id" name="current_id" type="hidden" value="" />
132
+ <input id="ids_string" name="ids_string" type="hidden" value="<?php echo $ids_string; ?>" />
133
+ <input id="asc_or_desc" name="asc_or_desc" type="hidden" value="<?php echo $asc_or_desc; ?>" />
134
+ <input id="order_by" name="order_by" type="hidden" value="<?php echo $order_by; ?>" />
135
+ </form>
136
+ <?php
137
+ }
138
+
139
+ ////////////////////////////////////////////////////////////////////////////////////////
140
+ // Getters & Setters //
141
+ ////////////////////////////////////////////////////////////////////////////////////////
142
+ ////////////////////////////////////////////////////////////////////////////////////////
143
+ // Private Methods //
144
+ ////////////////////////////////////////////////////////////////////////////////////////
145
+ ////////////////////////////////////////////////////////////////////////////////////////
146
+ // Listeners //
147
+ ////////////////////////////////////////////////////////////////////////////////////////
148
+ }
admin/views/FMViewFeatured_plugins_fm.php ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMViewFeatured_plugins_fm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+
16
+ ////////////////////////////////////////////////////////////////////////////////////////
17
+ // Constructor & Destructor //
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ public function __construct($model) {
20
+ $this->model = $model;
21
+ }
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
26
+ ?>
27
+ <div id="main_featured_plugins_page">
28
+ <table align="center" width="90%" style="margin-top: 0px;border-bottom: rgb(111, 111, 111) solid 2px;">
29
+ <tr>
30
+ <td colspan="2" style="height: 70px;"><h3 style="margin: 0px;font-family:Segoe UI;padding-bottom: 15px;color: rgb(111, 111, 111); font-size:18pt;">Featured Plugins</h3></td>
31
+ <td></td>
32
+ </tr>
33
+ </table>
34
+ <form method="post">
35
+ <ul id="featured-plugins-list">
36
+ <li class="photo-gallery">
37
+ <div class="product">
38
+ <div class="title">
39
+ <strong class="heading">Photo Gallery</strong>
40
+ <p>WordPress Photo Gallery plugin</p>
41
+ </div>
42
+ </div>
43
+ <div class="description">
44
+ <p>Photo Gallery is a fully responsive WordPress Gallery plugin with advanced functionality.
45
+ It allows having different image galleries for your posts and pages, as well as different widgets.</p>
46
+ <a target="_blank" href="http://web-dorado.com/products/wordpress-photo-gallery-plugin.html" class="download">Download</a>
47
+ </div>
48
+ </li>
49
+ <li class="spider-calendar">
50
+ <div class="product">
51
+ <div class="title">
52
+ <strong class="heading">Spider Calendar</strong>
53
+ <p>WordPress event calendar plugin</p>
54
+ </div>
55
+ </div>
56
+ <div class="description">
57
+ <p>Spider Event Calendar is a highly configurable product which allows you to have multiple organized events.</p>
58
+ <a target="_blank" href="http://web-dorado.com/products/wordpress-calendar.html" class="download">Download</a>
59
+ </div>
60
+ </li>
61
+ <li class="catalog">
62
+ <div class="product">
63
+ <div class="title">
64
+ <strong class="heading">Spider Catalog</strong>
65
+ <p>WordPress product catalog plugin</p>
66
+ </div>
67
+ </div>
68
+ <div class="description">
69
+ <p>Spider Catalog for WordPress is a convenient tool for organizing the products represented on your website into catalogs.</p>
70
+ <a target="_blank" href="http://web-dorado.com/products/wordpress-catalog.html" class="download">Download</a>
71
+ </div>
72
+ </li>
73
+ <li class="player">
74
+ <div class="product">
75
+ <div class="title">
76
+ <strong class="heading">Video Player</strong>
77
+ <p>WordPress Video player plugin</p>
78
+ </div>
79
+ </div>
80
+ <div class="description">
81
+ <p>Spider Video Player for WordPress is a Flash & HTML5 video player plugin that allows you to easily add videos to your website with the possibility</p>
82
+ <a target="_blank" href="http://web-dorado.com/products/wordpress-player.html" class="download">Download</a>
83
+ </div>
84
+ </li>
85
+ <li class="contacts">
86
+ <div class="product">
87
+ <div class="title">
88
+ <strong class="heading">Spider Contacts</strong>
89
+ <p>Wordpress staff list plugin</p>
90
+ </div>
91
+ </div>
92
+ <div class="description">
93
+ <p>Spider Contacts helps you to display information about the group of people more intelligible, effective and convenient.</p>
94
+ <a target="_blank" href="http://web-dorado.com/products/wordpress-contacts-plugin.html" class="download">Download</a>
95
+ </div>
96
+ </li>
97
+ <li class="facebook">
98
+ <div class="product">
99
+ <div class="title">
100
+ <strong class="heading">Spider Facebook</strong>
101
+ <p>WordPress Facebook plugin</p>
102
+ </div>
103
+ </div>
104
+ <div class="description">
105
+ <p>Spider Facebook is a WordPress integration tool for Facebook.It includes all the available Facebook social plugins and widgets to be added to your web</p>
106
+ <a target="_blank" href="http://web-dorado.com/products/wordpress-facebook.html" class="download">Download</a>
107
+ </div>
108
+ </li>
109
+ <li class="twitter-widget">
110
+ <div class="product">
111
+ <div class="title">
112
+ <strong class="heading">Widget Twitter</strong>
113
+ <p>WordPress Widget Twitter plugin</p>
114
+ </div>
115
+ </div>
116
+ <div class="description">
117
+ <p>The Widget Twitter plugin lets you to fully integrate your WordPress site with your Twitter account.</p>
118
+ <a target="_blank" href="http://web-dorado.com/products/wordpress-twitter-integration-plugin.html" class="download">Download</a>
119
+ </div>
120
+ </li>
121
+ <li class="faq">
122
+ <div class="product">
123
+ <div class="title">
124
+ <strong class="heading">Spider FAQ</strong>
125
+ <p>WordPress FAQ Plugin</p>
126
+ </div>
127
+ </div>
128
+ <div class="description">
129
+ <p>The Spider FAQ WordPress plugin is for creating an FAQ (Frequently Asked Questions) section for your website.</p>
130
+ <a target="_blank" href="http://web-dorado.com/products/wordpress-faq-plugin.html" class="download">Download</a>
131
+ </div>
132
+ </li>
133
+ <li class="zoom">
134
+ <div class="product">
135
+ <div class="title">
136
+ <strong class="heading">Zoom</strong>
137
+ <p>WordPress text zoom plugin</p>
138
+ </div>
139
+ </div>
140
+ <div class="description">
141
+ <p>Zoom enables site users to resize the predefined areas of the web site.</p>
142
+ <a target="_blank" href="http://web-dorado.com/products/wordpress-zoom.html" class="download">Download</a>
143
+ </div>
144
+ </li>
145
+ <li class="flash-calendar">
146
+ <div class="product">
147
+ <div class="title">
148
+ <strong class="heading">Flash Calendar</strong>
149
+ <p>WordPress flash calendar plugin</p>
150
+ </div>
151
+ </div>
152
+ <div class="description">
153
+ <p>Spider Flash Calendar is a highly configurable Flash calendar plugin which allows you to have multiple organized events.</p>
154
+ <a target="_blank" href="http://web-dorado.com/products/wordpress-events-calendar.html" class="download">Download</a>
155
+ </div>
156
+ </li>
157
+ </ul>
158
+ </form>
159
+ </div >
160
+ <?php
161
+ }
162
+ ////////////////////////////////////////////////////////////////////////////////////////
163
+ // Getters & Setters //
164
+ ////////////////////////////////////////////////////////////////////////////////////////
165
+ ////////////////////////////////////////////////////////////////////////////////////////
166
+ // Private Methods //
167
+ ////////////////////////////////////////////////////////////////////////////////////////
168
+ ////////////////////////////////////////////////////////////////////////////////////////
169
+ // Listeners //
170
+ ////////////////////////////////////////////////////////////////////////////////////////
171
+ }
admin/views/FMViewFormMakerEditCSS.php ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMViewFormMakerEditCSS {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+
16
+ ////////////////////////////////////////////////////////////////////////////////////////
17
+ // Constructor & Destructor //
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ public function __construct($model) {
20
+ $this->model = $model;
21
+ }
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
26
+ $theme_id = ((isset($_GET['id'])) ? esc_html(stripslashes($_GET['id'])) : '');
27
+ $form_id = ((isset($_GET['form_id'])) ? esc_html(stripslashes($_GET['form_id'])) : 0);
28
+ $row = $this->model->get_theme_row($theme_id);
29
+ wp_print_scripts('jquery');
30
+ ?>
31
+ <link media="all" type="text/css" href="<?php echo get_admin_url(); ?>load-styles.php?c=1&amp;dir=ltr&amp;load=admin-bar,dashicons,wp-admin,buttons,wp-auth-check" rel="stylesheet">
32
+ <link media="all" type="text/css" href="<?php echo get_admin_url(); ?>css/colors<?php echo ((get_bloginfo('version') < '3.8') ? '-fresh' : ''); ?>.min.css" id="colors-css" rel="stylesheet">
33
+ <link media="all" type="text/css" href="<?php echo WD_FM_URL . '/css/form_maker_tables.css'; ?>" rel="stylesheet">
34
+ <script src="<?php echo WD_FM_URL . '/js/form_maker_admin.js'; ?>" type="text/javascript"></script>
35
+
36
+ <form id="fm_theme" class="wrap wp-core-ui" method="post" action="#" style="width: 99%; margin: 5px 0 0 5px;">
37
+ <div style="float: right; margin: 0 5px 0 0;">
38
+ <input class="button-secondary" type="submit" onclick="if (spider_check_required('title', 'Theme title')) {return false;};
39
+ spider_set_input_value('task', 'save');
40
+ window.parent.jQuery('#theme option[value=<?php echo $theme_id; ?>]').html(jQuery('#title').val());
41
+ window.parent.tb_remove();" value="Save"/>
42
+ <input class="button-secondary" type="submit" onclick="if (spider_check_required('title', 'Theme title')) {return false;};
43
+ spider_set_input_value('task', 'apply');
44
+ window.parent.jQuery('#theme option[value=<?php echo $theme_id; ?>]').html(jQuery('#title').val());" value="Apply"/>
45
+ <input class="button-secondary" type="submit" onclick="if (spider_check_required('title', 'Theme title')) {return false;};
46
+ spider_set_input_value('task', 'save_as_new');
47
+ window.parent.jQuery('#theme').append('<option value=0>' + jQuery('#title').val() + '</option>');
48
+ window.parent.tb_remove();" value="Save as New"/>
49
+ <input class="button-primary" type="button" onclick="jQuery('#css').val(jQuery('#main_theme').html());" value="Reset"/>
50
+ <input class="button-secondary" type="button" onclick="window.parent.tb_remove();" value="Cancel"/>
51
+ </div>
52
+ <table style="clear: both;">
53
+ <tbody>
54
+ <tr>
55
+ <td class="spider_label"><label for="title">Theme title: <span style="color:#FF0000;"> * </span> </label></td>
56
+ <td><input type="text" id="title" name="title" value="<?php echo $row->title; ?>" class="spider_text_input" /></td>
57
+ </tr>
58
+ <tr>
59
+ <td class="spider_label"><label for="css">Css: </label></td>
60
+ <td style="width: 90%;"><textarea id="css" name="css" rows="25" style="width: 100%;"><?php echo htmlspecialchars($row->css); ?></textarea></td>
61
+ </tr>
62
+ </tbody>
63
+ </table>
64
+ <div style="display: none;" id="main_theme"><?php echo str_replace('"', '\"', $row->css); ?></div>
65
+ <input type="hidden" id="task" name="task" value="" />
66
+ <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
67
+ <input type="hidden" id="default" name="default" value="<?php echo $row->default; ?>" />
68
+ <input type="hidden" name="form_id" id="form_id" value="<?php echo $form_id; ?>" />
69
+ </form>
70
+ <?php
71
+ die();
72
+ }
73
+
74
+ ////////////////////////////////////////////////////////////////////////////////////////
75
+ // Getters & Setters //
76
+ ////////////////////////////////////////////////////////////////////////////////////////
77
+ ////////////////////////////////////////////////////////////////////////////////////////
78
+ // Private Methods //
79
+ ////////////////////////////////////////////////////////////////////////////////////////
80
+ ////////////////////////////////////////////////////////////////////////////////////////
81
+ // Listeners //
82
+ ////////////////////////////////////////////////////////////////////////////////////////
83
+ }
admin/views/FMViewFormMakerPreview.php ADDED
@@ -0,0 +1,479 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMViewFormMakerPreview {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+
16
+ ////////////////////////////////////////////////////////////////////////////////////////
17
+ // Constructor & Destructor //
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ public function __construct($model) {
20
+ $this->model = $model;
21
+ }
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
26
+ $form_id = ((isset($_GET['form_id'])) ? esc_html(stripslashes($_GET['form_id'])) : 0);
27
+ $form = (($form_id) ? $this->model->get_form($form_id) : '');
28
+ wp_print_scripts('jquery');
29
+ wp_print_scripts('jquery-ui-widget');
30
+ wp_print_scripts('jquery-ui-slider');
31
+ wp_print_scripts('jquery-ui-spinner');
32
+ ?>
33
+ <script src="https://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
34
+ <script src="<?php echo WD_FM_URL . '/js/if_gmap_front_end.js'; ?>" type="text/javascript"></script>
35
+ <script src="<?php echo WD_FM_URL . '/js/calendar/calendar.js'; ?>" type="text/javascript"></script>
36
+ <script src="<?php echo WD_FM_URL . '/js/calendar/calendar_function.js'; ?>" type="text/javascript"></script>
37
+ <link media="all" type="text/css" href="<?php echo WD_FM_URL . '/css/calendar-jos.css'; ?>" rel="stylesheet">
38
+ <link media="all" type="text/css" href="<?php echo WD_FM_URL . '/css/jquery-ui-1.10.3.custom.css'; ?>" rel="stylesheet">
39
+ <link media="all" type="text/css" href="<?php echo WD_FM_URL . '/css/jquery-ui-spinner.css'; ?>" rel="stylesheet">
40
+ <?php
41
+ if (isset($_GET['test_theme'])) {
42
+ wp_print_scripts('jquery-effects-shake');
43
+ ?>
44
+ <!--<script src="<?php echo WD_FM_URL . '/js/mootools.js'; ?>" type="text/javascript"></script>-->
45
+ <?php
46
+ $theme_id = esc_html(stripslashes($_GET['test_theme']));
47
+ require_once (WD_FM_DIR . '/frontend/controllers/FMControllerForm_maker.php');
48
+ $controller = new FMControllerForm_maker();
49
+ echo $controller->execute($form_id, $theme_id);
50
+ die();
51
+ }
52
+ $theme_id = ((isset($_GET['id'])) ? esc_html(stripslashes($_GET['id'])) : '');
53
+ $css = $this->model->get_theme_css($theme_id);
54
+ $id = 'form_id_temp';
55
+ ?>
56
+ <script src="<?php echo WD_FM_URL . '/js/main_front_end.js'; ?>"></script>
57
+ <style>
58
+ <?php
59
+ echo str_replace('[SITE_ROOT]', WD_FM_URL, $css);
60
+ ?>
61
+ </style>
62
+ <div id="form_id_temppages" class="wdform_page_navigation" show_title="" show_numbers="" type=""></div>
63
+ <form id="form_preview"><?php echo $form; ?></form>
64
+ <?php
65
+ if ($form) { // Preview from options page.
66
+ die();
67
+ }
68
+ ?>
69
+ <input type="hidden" id="counter<?php echo $id; ?>" value="" name="counter<?php echo $id; ?>" />
70
+ <script>
71
+ var plugin_url = "<?php echo WD_FM_URL; ?>";
72
+ /*JURI_ROOT = '<?php echo WD_FM_URL . '/js' ?>';*/
73
+ document.getElementById('form_preview').innerHTML = window.parent.document.getElementById('take').innerHTML;
74
+ document.getElementById('form_id_temppages').setAttribute('show_title', window.parent.document.getElementById('pages').getAttribute('show_title'));
75
+ document.getElementById('form_id_temppages').setAttribute('show_numbers', window.parent.document.getElementById('pages').getAttribute('show_numbers'));
76
+ document.getElementById('form_id_temppages').setAttribute('type', window.parent.document.getElementById('pages').getAttribute('type'));
77
+ document.getElementById('counterform_id_temp').value = window.parent.gen;
78
+ form_view_count<?php echo $id ?>= 0;
79
+ for (i = 1; i <= 30; i++) {
80
+ if (document.getElementById('<?php echo $id ?>form_view' + i)) {
81
+ form_view_count<?php echo $id ?>++;
82
+ form_view_max<?php echo $id ?>= i;
83
+ document.getElementById('<?php echo $id ?>form_view' + i).parentNode.removeAttribute('style');
84
+ }
85
+ }
86
+ refresh_first();
87
+ if (form_view_count<?php echo $id ?>> 1) {
88
+ for (i = 1; i <= form_view_max<?php echo $id ?>; i++) {
89
+ if (document.getElementById('<?php echo $id ?>form_view' + i)) {
90
+ first_form_view<?php echo $id ?>= i;
91
+ break;
92
+ }
93
+ }
94
+ generate_page_nav(first_form_view<?php echo $id ?>, '<?php echo $id ?>', form_view_count<?php echo $id ?>, form_view_max<?php echo $id ?>);
95
+ }
96
+ function remove_add_(id) {
97
+ attr_name = new Array();
98
+ attr_value = new Array();
99
+ var input = document.getElementById(id);
100
+ atr = input.attributes;
101
+ for (v = 0; v < 30; v++)
102
+ if (atr[v]) {
103
+ if (atr[v].name.indexOf("add_") == 0) {
104
+ attr_name.push(atr[v].name.replace('add_', ''));
105
+ attr_value.push(atr[v].value);
106
+ input.removeAttribute(atr[v].name);
107
+ v--;
108
+ }
109
+ }
110
+ for (v = 0; v < attr_name.length; v++) {
111
+ input.setAttribute(attr_name[v], attr_value[v])
112
+ }
113
+ }
114
+ function refresh_first() {
115
+ n = window.parent.gen;
116
+ for (i = 0; i < n; i++) {
117
+ if (document.getElementById(i)) {
118
+ for (z = 0; z < document.getElementById(i).childNodes.length; z++) {
119
+ if (document.getElementById(i).childNodes[z].nodeType == 3) {
120
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[z]);
121
+ }
122
+ }
123
+ if (document.getElementById(i).getAttribute('type') == "type_map") {
124
+ if_gmap_init(i);
125
+ for (q = 0; q < 20; q++) {
126
+ if (document.getElementById(i + "_elementform_id_temp").getAttribute("long" + q)) {
127
+ w_long = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("long" + q));
128
+ w_lat = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("lat" + q));
129
+ w_info = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("info" + q));
130
+ add_marker_on_map(i, q, w_long, w_lat, w_info, false);
131
+ }
132
+ }
133
+ }
134
+ if (document.getElementById(i).getAttribute('type') == "type_mark_map") {
135
+ if_gmap_init(i);
136
+ w_long = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("long" + 0));
137
+ w_lat = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("lat" + 0));
138
+ w_info = parseFloat(document.getElementById(i + "_elementform_id_temp").getAttribute("info" + 0));
139
+ add_marker_on_map(i, 0, w_long, w_lat, w_info, true);
140
+ }
141
+ if (document.getElementById(i).getAttribute('type') == "type_captcha" || document.getElementById(i).getAttribute('type') == "type_recaptcha") {
142
+ if (document.getElementById(i).childNodes[10]) {
143
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
144
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
145
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
146
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
147
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
148
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
149
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
150
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
151
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
152
+ }
153
+ else {
154
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
155
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
156
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
157
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
158
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
159
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
160
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
161
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
162
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
163
+ }
164
+ continue;
165
+ }
166
+ if (document.getElementById(i).getAttribute('type') == "type_section_break") {
167
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
168
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
169
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
170
+ continue;
171
+ }
172
+ if (document.getElementById(i).childNodes[10]) {
173
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
174
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
175
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
176
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
177
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
178
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
179
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
180
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
181
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[2]);
182
+ }
183
+ else {
184
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
185
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
186
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
187
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
188
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
189
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
190
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
191
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
192
+ document.getElementById(i).removeChild(document.getElementById(i).childNodes[1]);
193
+ }
194
+ }
195
+ }
196
+ for (i = 0; i <= n; i++) {
197
+ if (document.getElementById(i)) {
198
+ type = document.getElementById(i).getAttribute("type");
199
+ switch (type) {
200
+ case "type_text":
201
+ case "type_number":
202
+ case "type_password":
203
+ case "type_submitter_mail":
204
+ case "type_own_select":
205
+ case "type_country":
206
+ case "type_hidden":
207
+ case "type_map": {
208
+ remove_add_(i + "_elementform_id_temp");
209
+ break;
210
+ }
211
+ case "type_submit_reset": {
212
+ remove_add_(i + "_element_submitform_id_temp");
213
+ if (document.getElementById(i + "_element_resetform_id_temp")) {
214
+ remove_add_(i + "_element_resetform_id_temp");
215
+ }
216
+ break;
217
+ }
218
+
219
+ case "type_captcha": {
220
+ remove_add_("_wd_captchaform_id_temp");
221
+ remove_add_("_element_refreshform_id_temp");
222
+ remove_add_("_wd_captcha_inputform_id_temp");
223
+ break;
224
+ }
225
+ case "type_recaptcha": {
226
+ remove_add_("wd_recaptchaform_id_temp");
227
+ break;
228
+ }
229
+ case "type_file_upload": {
230
+ remove_add_(i + "_elementform_id_temp");
231
+ break;
232
+ }
233
+ case "type_textarea": {
234
+ remove_add_(i + "_elementform_id_temp");
235
+ break;
236
+ }
237
+ case "type_name": {
238
+ if (document.getElementById(i + "_element_titleform_id_temp")) {
239
+ remove_add_(i + "_element_titleform_id_temp");
240
+ remove_add_(i + "_element_firstform_id_temp");
241
+ remove_add_(i + "_element_lastform_id_temp");
242
+ remove_add_(i + "_element_middleform_id_temp");
243
+ }
244
+ else {
245
+ remove_add_(i + "_element_firstform_id_temp");
246
+ remove_add_(i + "_element_lastform_id_temp");
247
+
248
+ }
249
+ break;
250
+ }
251
+ case "type_phone": {
252
+ remove_add_(i + "_element_firstform_id_temp");
253
+ remove_add_(i + "_element_lastform_id_temp");
254
+ break;
255
+ }
256
+ case "type_address": {
257
+ if(document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute('street1')=='no')
258
+ remove_add_(i+"_street1form_id_temp");
259
+ if(document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute('street2')=='no')
260
+ remove_add_(i+"_street2form_id_temp");
261
+ if(document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute('city')=='no')
262
+ remove_add_(i+"_cityform_id_temp");
263
+ if(document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute('state')=='no')
264
+ remove_add_(i+"_stateform_id_temp");
265
+ if(document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute('postal')=='no')
266
+ remove_add_(i+"_postalform_id_temp");
267
+ if(document.getElementById(i+"_disable_fieldsform_id_temp").getAttribute('country')=='no')
268
+ remove_add_(i+"_countryform_id_temp");
269
+ break;
270
+ }
271
+ case "type_checkbox":
272
+ case "type_radio": {
273
+ is = true;
274
+ for (j = 0; j < 100; j++) {
275
+ if (document.getElementById(i + "_elementform_id_temp" + j)) {
276
+ remove_add_(i + "_elementform_id_temp" + j);
277
+ }
278
+ }
279
+ break;
280
+ }
281
+ case "type_button": {
282
+ for (j = 0; j < 100; j++) {
283
+ if (document.getElementById(i + "_elementform_id_temp" + j)) {
284
+ remove_add_(i + "_elementform_id_temp" + j);
285
+ }
286
+ }
287
+ break;
288
+ }
289
+ case "type_time": {
290
+ if (document.getElementById(i + "_ssform_id_temp")) {
291
+ remove_add_(i + "_ssform_id_temp");
292
+ remove_add_(i + "_mmform_id_temp");
293
+ remove_add_(i + "_hhform_id_temp");
294
+ }
295
+ else {
296
+ remove_add_(i + "_mmform_id_temp");
297
+ remove_add_(i + "_hhform_id_temp");
298
+ }
299
+ break;
300
+ }
301
+ case "type_date": {
302
+ remove_add_(i + "_elementform_id_temp");
303
+ remove_add_(i + "_buttonform_id_temp");
304
+ break;
305
+ }
306
+ case "type_date_fields": {
307
+ remove_add_(i + "_dayform_id_temp");
308
+ remove_add_(i + "_monthform_id_temp");
309
+ remove_add_(i + "_yearform_id_temp");
310
+ break;
311
+ }
312
+ case "type_star_rating": {
313
+ remove_add_(i+"_elementform_id_temp");
314
+ break;
315
+ }
316
+ case "type_scale_rating": {
317
+ remove_add_(i+"_elementform_id_temp");
318
+ break;
319
+ }
320
+ case "type_spinner": {
321
+ remove_add_(i+"_elementform_id_temp");
322
+ var spinner_value = document.getElementById(i+"_elementform_id_temp").getAttribute( "aria-valuenow" );
323
+ var spinner_min_value = document.getElementById(i+"_min_valueform_id_temp").value;
324
+ var spinner_max_value = document.getElementById(i+"_max_valueform_id_temp").value;
325
+ var spinner_step = document.getElementById(i+"_stepform_id_temp").value;
326
+ jQuery( "#"+i+"_elementform_id_temp" ).removeClass( "ui-spinner-input" )
327
+ .prop( "disabled", false )
328
+ .removeAttr( "autocomplete" )
329
+ .removeAttr( "role" )
330
+ .removeAttr( "aria-valuemin" )
331
+ .removeAttr( "aria-valuemax" )
332
+ .removeAttr( "aria-valuenow" );
333
+ span_ui= document.getElementById(i+"_elementform_id_temp").parentNode;
334
+ span_ui.parentNode.appendChild(document.getElementById(i+"_elementform_id_temp"));
335
+ span_ui.parentNode.removeChild(span_ui);
336
+ jQuery("#"+i+"_elementform_id_temp")[0].spin = null;
337
+ spinner = jQuery( "#"+i+"_elementform_id_temp" ).spinner();
338
+ spinner.spinner( "value", spinner_value );
339
+ jQuery( "#"+i+"_elementform_id_temp" ).spinner({ min: spinner_min_value});
340
+ jQuery( "#"+i+"_elementform_id_temp" ).spinner({ max: spinner_max_value});
341
+ jQuery( "#"+i+"_elementform_id_temp" ).spinner({ step: spinner_step});
342
+ break;
343
+ }
344
+ case "type_slider": {
345
+ remove_add_(i+"_elementform_id_temp");
346
+ var slider_value = document.getElementById(i+"_slider_valueform_id_temp").value;
347
+ var slider_min_value = document.getElementById(i+"_slider_min_valueform_id_temp").value;
348
+ var slider_max_value = document.getElementById(i+"_slider_max_valueform_id_temp").value;
349
+ var slider_element_value = document.getElementById( i+"_element_valueform_id_temp" );
350
+ var slider_value_save = document.getElementById( i+"_slider_valueform_id_temp" );
351
+ document.getElementById(i+"_elementform_id_temp").innerHTML = "";
352
+ document.getElementById(i+"_elementform_id_temp").removeAttribute( "class" );
353
+ document.getElementById(i+"_elementform_id_temp").removeAttribute( "aria-disabled" );
354
+ jQuery("#"+i+"_elementform_id_temp")[0].slide = null;
355
+ jQuery( "#"+i+"_elementform_id_temp").slider({
356
+ range: "min",
357
+ value: eval(slider_value),
358
+ min: eval(slider_min_value),
359
+ max: eval(slider_max_value),
360
+ slide: function( event, ui ) {
361
+ slider_element_value.innerHTML = "" + ui.value ;
362
+ slider_value_save.value = "" + ui.value;
363
+
364
+ }
365
+ });
366
+ break;
367
+ }
368
+ case "type_range": {
369
+ remove_add_(i+"_elementform_id_temp0");
370
+ remove_add_(i+"_elementform_id_temp1");
371
+ var spinner_value0 = document.getElementById(i+"_elementform_id_temp0").getAttribute( "aria-valuenow" );
372
+ var spinner_step = document.getElementById(i+"_range_stepform_id_temp").value;
373
+ jQuery( "#"+i+"_elementform_id_temp0" ).removeClass( "ui-spinner-input" )
374
+ .prop( "disabled", false )
375
+ .removeAttr( "autocomplete" )
376
+ .removeAttr( "role" )
377
+ .removeAttr( "aria-valuenow" );
378
+ span_ui= document.getElementById(i+"_elementform_id_temp0").parentNode;
379
+ span_ui.parentNode.appendChild(document.getElementById(i+"_elementform_id_temp0"));
380
+ span_ui.parentNode.removeChild(span_ui);
381
+ jQuery("#"+i+"_elementform_id_temp0")[0].spin = null;
382
+ jQuery("#"+i+"_elementform_id_temp1")[0].spin = null;
383
+ spinner0 = jQuery( "#"+i+"_elementform_id_temp0" ).spinner();
384
+ spinner0.spinner( "value", spinner_value0 );
385
+ jQuery( "#"+i+"_elementform_id_temp0" ).spinner({ step: spinner_step});
386
+ var spinner_value1 = document.getElementById(i+"_elementform_id_temp1").getAttribute( "aria-valuenow" );
387
+ jQuery( "#"+i+"_elementform_id_temp1" ).removeClass( "ui-spinner-input" )
388
+ .prop( "disabled", false )
389
+ .removeAttr( "autocomplete" )
390
+ .removeAttr( "role" )
391
+ .removeAttr( "aria-valuenow" );
392
+ span_ui1= document.getElementById(i+"_elementform_id_temp1").parentNode;
393
+ span_ui1.parentNode.appendChild(document.getElementById(i+"_elementform_id_temp1"));
394
+ span_ui1.parentNode.removeChild(span_ui1);
395
+ spinner1 = jQuery( "#"+i+"_elementform_id_temp1" ).spinner();
396
+ spinner1.spinner( "value", spinner_value1 );
397
+ jQuery( "#"+i+"_elementform_id_temp1" ).spinner({ step: spinner_step});
398
+ break;
399
+ }
400
+ case "type_grading": {
401
+ for (k=0; k<100; k++) {
402
+ if (document.getElementById(i+"_elementform_id_temp"+k)) {
403
+ remove_add_(i+"_elementform_id_temp"+k);
404
+ }
405
+ }
406
+ break;
407
+ }
408
+ case "type_matrix": {
409
+ remove_add_(i+"_elementform_id_temp");
410
+ break;
411
+ }
412
+ }
413
+ }
414
+ }
415
+ for (t = 1; t <= form_view_max<?php echo $id ?>; t++) {
416
+ if (document.getElementById('form_id_tempform_view' + t)) {
417
+ form_view_element = document.getElementById('form_id_tempform_view' + t);
418
+ remove_whitespace(form_view_element);
419
+ xy = form_view_element.childNodes.length - 2;
420
+ for (z = 0; z <= xy; z++) {
421
+ if (form_view_element.childNodes[z]) {
422
+ if (form_view_element.childNodes[z].nodeType != 3) {
423
+ if (!form_view_element.childNodes[z].id) {
424
+ del = true;
425
+ GLOBAL_tr = form_view_element.childNodes[z];
426
+ //////////////////////////////////////////////////////////////////////////////////////////
427
+ for (x = 0; x < GLOBAL_tr.firstChild.childNodes.length; x++) {
428
+ table = GLOBAL_tr.firstChild.childNodes[x];
429
+ tbody = table.firstChild;
430
+ if (tbody.childNodes.length) {
431
+ del = false;
432
+ }
433
+ }
434
+ if (del) {
435
+ form_view_element.removeChild(form_view_element.childNodes[z]);
436
+ }
437
+ }
438
+ }
439
+ }
440
+ }
441
+ }
442
+ }
443
+ for (i = 1; i <= window.parent.form_view_max; i++) {
444
+ if (document.getElementById('form_id_tempform_view' + i)) {
445
+ document.getElementById('form_id_tempform_view' + i).parentNode.removeChild(document.getElementById('form_id_tempform_view_img' + i));
446
+ document.getElementById('form_id_tempform_view' + i).removeAttribute('style');
447
+ }
448
+ }
449
+ }
450
+ function remove_whitespace(node) {
451
+ var ttt;
452
+ for (ttt = 0; ttt < node.childNodes.length; ttt++) {
453
+ if (node.childNodes[ttt] && node.childNodes[ttt].nodeType == '3' && !/\S/.test(node.childNodes[ttt].nodeValue)) {
454
+ node.removeChild(node.childNodes[ttt]);
455
+ ttt--;
456
+ }
457
+ else {
458
+ if (node.childNodes[ttt].childNodes.length) {
459
+ remove_whitespace(node.childNodes[ttt]);
460
+ }
461
+ }
462
+ }
463
+ return;
464
+ }
465
+ </script>
466
+ <?php
467
+ die();
468
+ }
469
+
470
+ ////////////////////////////////////////////////////////////////////////////////////////
471
+ // Getters & Setters //
472
+ ////////////////////////////////////////////////////////////////////////////////////////
473
+ ////////////////////////////////////////////////////////////////////////////////////////
474
+ // Private Methods //
475
+ ////////////////////////////////////////////////////////////////////////////////////////
476
+ ////////////////////////////////////////////////////////////////////////////////////////
477
+ // Listeners //
478
+ ////////////////////////////////////////////////////////////////////////////////////////
479
+ }
admin/views/FMViewFormmakerwdcaptcha.php ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMViewFormmakerwdcaptcha {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+
16
+ ////////////////////////////////////////////////////////////////////////////////////////
17
+ // Constructor & Destructor //
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ public function __construct($model) {
20
+ $this->model = $model;
21
+ }
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
26
+ if (isset($_GET['action']) && esc_html($_GET['action']) == 'formmakerwdcaptcha') {
27
+ $i = (isset($_GET["i"]) ? esc_html($_GET["i"]) : '');
28
+ $r2 = (isset($_GET["r2"]) ? (int) $_GET["r2"] : 0);
29
+ $rrr = (isset($_GET["rrr"]) ? (int) $_GET["rrr"] : 0);
30
+ $randNum = 0 + $r2 + $rrr;
31
+ $digit = (isset($_GET["digit"]) ? (int) $_GET["digit"] : 6);
32
+ $cap_width = $digit * 10 + 15;
33
+ $cap_height = 26;
34
+ $cap_quality = 100;
35
+ $cap_length_min = $digit;
36
+ $cap_length_max = $digit;
37
+ $cap_digital = 1;
38
+ $cap_latin_char = 1;
39
+ function code_generic($_length, $_digital = 1, $_latin_char = 1) {
40
+ $dig = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
41
+ $lat = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z');
42
+ $main = array();
43
+ if ($_digital) {
44
+ $main = array_merge($main, $dig);
45
+ }
46
+ if ($_latin_char) {
47
+ $main = array_merge($main, $lat);
48
+ }
49
+ shuffle($main);
50
+ $pass = substr(implode('', $main), 0, $_length);
51
+ return $pass;
52
+ }
53
+ $l = rand($cap_length_min, $cap_length_max);
54
+ $code = code_generic($l, $cap_digital, $cap_latin_char);
55
+ @session_start();
56
+ $_SESSION[$i . '_wd_captcha_code'] = $code;
57
+ $canvas = imagecreatetruecolor($cap_width, $cap_height);
58
+ $c = imagecolorallocate($canvas, rand(150, 255), rand(150, 255), rand(150, 255));
59
+ imagefilledrectangle($canvas, 0, 0, $cap_width, $cap_height, $c);
60
+ $count = strlen($code);
61
+ $color_text = imagecolorallocate($canvas, 0, 0, 0);
62
+ for ($it = 0; $it < $count; $it++) {
63
+ $letter = $code[$it];
64
+ imagestring($canvas, 6, (10 * $it + 10), $cap_height / 4, $letter, $color_text);
65
+ }
66
+ for ($c = 0; $c < 150; $c++) {
67
+ $x = rand(0, $cap_width - 1);
68
+ $y = rand(0, 29);
69
+ $col = '0x' . rand(0, 9) . '0' . rand(0, 9) . '0' . rand(0, 9) . '0';
70
+ imagesetpixel($canvas, $x, $y, $col);
71
+ }
72
+ header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
73
+ header('Cache-Control: no-store, no-cache, must-revalidate');
74
+ header('Cache-Control: post-check=0, pre-check=0', FALSE);
75
+ header('Pragma: no-cache');
76
+ header('Content-Type: image/jpeg');
77
+ imagejpeg($canvas, NULL, $cap_quality);
78
+ }
79
+ die('');
80
+ }
81
+
82
+ ////////////////////////////////////////////////////////////////////////////////////////
83
+ // Getters & Setters //
84
+ ////////////////////////////////////////////////////////////////////////////////////////
85
+ ////////////////////////////////////////////////////////////////////////////////////////
86
+ // Private Methods //
87
+ ////////////////////////////////////////////////////////////////////////////////////////
88
+ ////////////////////////////////////////////////////////////////////////////////////////
89
+ // Listeners //
90
+ ////////////////////////////////////////////////////////////////////////////////////////
91
+ }
admin/views/FMViewFormmakerwindow.php ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMViewFormmakerwindow {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+
16
+ ////////////////////////////////////////////////////////////////////////////////////////
17
+ // Constructor & Destructor //
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ public function __construct($model) {
20
+ $this->model = $model;
21
+ }
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
26
+ $rows = $this->model->get_form_data();
27
+ ?>
28
+ <html xmlns="http://www.w3.org/1999/xhtml">
29
+ <head>
30
+ <title>Form Maker</title>
31
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
32
+ <script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script>
33
+ <script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/utils/mctabs.js"></script>
34
+ <script language="javascript" type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/utils/form_utils.js"></script>
35
+
36
+ <?php
37
+ wp_print_scripts('jquery');
38
+ ?>
39
+ <base target="_self">
40
+ </head>
41
+ <body id="link" onLoad="tinyMCEPopup.executeOnLoad('init();');document.body.style.display='';" dir="ltr" class="forceColors">
42
+ <div class="tabs" role="tablist" tabindex="-1">
43
+ <ul>
44
+ <li id="display_tab" class="current" role="tab" tabindex="0">
45
+ <span>
46
+ <a href="javascript:mcTabs.displayTab('display_tab','display_panel');" onMouseDown="return false;" tabindex="-1">Form Maker</a>
47
+ </span>
48
+ </li>
49
+ </ul>
50
+ </div>
51
+ <style>
52
+ .panel_wrapper {
53
+ height: 170px !important;
54
+ }
55
+ </style>
56
+ <div class="panel_wrapper">
57
+ <div id="display_panel" class="panel current">
58
+ <table>
59
+ <tr>
60
+ <td style="vertical-align: middle; text-align: left;">Select a Form</td>
61
+ <td style="vertical-align: middle; text-align: left;">
62
+ <select name="form_maker_id" id="form_maker_id" style="width: 230px; text-align: left;">
63
+ <option value="- Select Form -" selected="selected">- Select a Form -</option>
64
+ <?php
65
+ foreach ($rows as $row) {
66
+ ?>
67
+ <option value="<?php echo $row->id; ?>"><?php echo $row->title; ?></option>
68
+ <?php
69
+ }
70
+ ?>
71
+ </select>
72
+ </td>
73
+ </tr>
74
+ </table>
75
+ </div>
76
+ </div>
77
+ <div class="mceActionPanel">
78
+ <div style="float: left;">
79
+ <input type="button" id="cancel" name="cancel" value="Cancel" onClick="tinyMCEPopup.close();"/>
80
+ </div>
81
+ <div style="float: right;">
82
+ <input type="submit" id="insert" name="insert" value="Insert" onClick="form_maker_insert_shortcode();"/>
83
+ </div>
84
+ </div>
85
+ <script type="text/javascript">
86
+ function form_maker_insert_shortcode() {
87
+ if (document.getElementById('form_maker_id').value == '- Select Form -') {
88
+ tinyMCEPopup.close();
89
+ }
90
+ else {
91
+ var tagtext;
92
+ tagtext = '[Form id="' + document.getElementById('form_maker_id').value + '"]';
93
+ window.tinyMCE.execCommand('mceInsertContent', false, tagtext);
94
+ tinyMCEPopup.close();
95
+ }
96
+ }
97
+ </script>
98
+ </body>
99
+ </html>
100
+ <?php
101
+ die();
102
+ }
103
+
104
+ ////////////////////////////////////////////////////////////////////////////////////////
105
+ // Getters & Setters //
106
+ ////////////////////////////////////////////////////////////////////////////////////////
107
+ ////////////////////////////////////////////////////////////////////////////////////////
108
+ // Private Methods //
109
+ ////////////////////////////////////////////////////////////////////////////////////////
110
+ ////////////////////////////////////////////////////////////////////////////////////////
111
+ // Listeners //
112
+ ////////////////////////////////////////////////////////////////////////////////////////
113
+ }
admin/views/FMViewFromeditcountryinpopup.php ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMViewFromeditcountryinpopup {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+
16
+ ////////////////////////////////////////////////////////////////////////////////////////
17
+ // Constructor & Destructor //
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ public function __construct($model) {
20
+ $this->model = $model;
21
+ }
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
26
+ $id = ((isset($_GET['field_id'])) ? esc_html(stripslashes($_GET['field_id'])) : 0);
27
+ wp_print_scripts('jquery');
28
+ wp_print_scripts('jquery-ui-core');
29
+ wp_print_scripts('jquery-ui-widget');
30
+ wp_print_scripts('jquery-ui-mouse');
31
+ wp_print_scripts('jquery-ui-slider');
32
+ wp_print_scripts('jquery-ui-sortable');
33
+ ?>
34
+ <span style="position: absolute; right: 8px;">
35
+ <img title="Add" style="cursor: pointer; vertical-align: middle;" src="<?php echo WD_FM_URL . '/images/save.png'; ?>" onClick="save_list()" />
36
+ <img title="Cancel" style=" cursor: pointer; vertical-align: middle;" src="<?php echo WD_FM_URL . '/images/cancel_but.png'; ?>" onClick="window.parent.tb_remove();" />
37
+ </span>
38
+ <button class="button-secondary" onClick="select_all()">Select all</button>
39
+ <button class="button-secondary" onClick="remove_all()">Remove all</button>
40
+ <ul id="countries_list" style="list-style: none; padding: 0px;"></ul>
41
+ <script>
42
+ selec_coutries = [];
43
+ coutries = ["", "Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Antigua and Barbuda", "Argentina", "Armenia", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Central African Republic", "Chad", "Chile", "China", "Colombi", "Comoros", "Congo (Brazzaville)", "Congo", "Costa Rica", "Cote d'Ivoire", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor (Timor Timur)", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Fiji", "Finland", "France", "Gabon", "Gambia, The", "Georgia", "Germany", "Ghana", "Greece", "Grenada", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Honduras", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, North", "Korea, South", "Kuwait", "Kyrgyzstan", "Laos", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Mauritania", "Mauritius", "Mexico", "Micronesia", "Moldova", "Monaco", "Mongolia", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepa", "Netherlands", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland", "Portugal", "Qatar", "Romania", "Russia", "Rwanda", "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Serbia and Montenegro", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "Spain", "Sri Lanka", "Sudan", "Suriname", "Swaziland", "Sweden", "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "Togo", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "Uruguay", "Uzbekistan", "Vanuatu", "Vatican City", "Venezuela", "Vietnam", "Yemen", "Zambia", "Zimbabwe"];
44
+ select_ = window.parent.document.getElementById('<?php echo $id ?>_elementform_id_temp');
45
+ n = select_.childNodes.length;
46
+ for (i = 0; i < n; i++) {
47
+ selec_coutries.push(select_.childNodes[i].value);
48
+ var ch = document.createElement('input');
49
+ ch.setAttribute("type", "checkbox");
50
+ ch.setAttribute("checked", "checked");
51
+ ch.value = select_.childNodes[i].value;
52
+ ch.id = i + "ch";
53
+ //ch.setAttribute("id",i);
54
+ var p = document.createElement('span');
55
+ p.style.cssText = "color:#000000; font-size: 13px; cursor:move";
56
+ p.innerHTML = select_.childNodes[i].value;
57
+ var li = document.createElement('li');
58
+ li.style.cssText = "margin:3px; vertical-align:middle";
59
+ li.id = i;
60
+ li.appendChild(ch);
61
+ li.appendChild(p);
62
+ document.getElementById('countries_list').appendChild(li);
63
+ }
64
+ cur = i;
65
+ m = coutries.length;
66
+ for (i = 0; i < m; i++) {
67
+ isin = isValueInArray(selec_coutries, coutries[i]);
68
+ if (!isin) {
69
+ var ch = document.createElement('input');
70
+ ch.setAttribute("type", "checkbox");
71
+ ch.value = coutries[i];
72
+ ch.id = cur + "ch";
73
+
74
+ var p = document.createElement('span');
75
+ p.style.cssText = "color:#000000; font-size: 13px; cursor:move";
76
+ p.innerHTML = coutries[i];
77
+ var li = document.createElement('li');
78
+ li.style.cssText = "margin:3px; vertical-align:middle";
79
+ li.id = cur;
80
+ li.appendChild(ch);
81
+ li.appendChild(p);
82
+ document.getElementById('countries_list').appendChild(li);
83
+ cur++;
84
+ }
85
+ }
86
+ jQuery(function () {
87
+ jQuery("#countries_list").sortable();
88
+ jQuery("#countries_list").disableSelection();
89
+ });
90
+
91
+ function isValueInArray(arr, val) {
92
+ inArray = false;
93
+ for (x = 0; x < arr.length; x++) {
94
+ if (val == arr[x]) {
95
+ inArray = true;
96
+ }
97
+ }
98
+ return inArray;
99
+ }
100
+ function save_list() {
101
+ select_.innerHTML = ""
102
+ ul = document.getElementById('countries_list');
103
+ n = ul.childNodes.length;
104
+ for (i = 0; i < n; i++) {
105
+ if (ul.childNodes[i].tagName == "LI") {
106
+ id = ul.childNodes[i].id;
107
+ if (document.getElementById(id + 'ch').checked) {
108
+ var option_ = document.createElement('option');
109
+ option_.setAttribute("value", document.getElementById(id + 'ch').value);
110
+ option_.innerHTML = document.getElementById(id + 'ch').value;
111
+ select_.appendChild(option_);
112
+ }
113
+ }
114
+ }
115
+ window.parent.tb_remove();
116
+ }
117
+ function select_all() {
118
+ for (i = 0; i < 194; i++) {
119
+ document.getElementById(i + 'ch').checked = true;
120
+ }
121
+ }
122
+ function remove_all() {
123
+ for (i = 0; i < 194; i++) {
124
+ document.getElementById(i + 'ch').checked = false;
125
+ }
126
+ }
127
+ </script>
128
+ <?php
129
+ die();
130
+ }
131
+
132
+ ////////////////////////////////////////////////////////////////////////////////////////
133
+ // Getters & Setters //
134
+ ////////////////////////////////////////////////////////////////////////////////////////
135
+ ////////////////////////////////////////////////////////////////////////////////////////
136
+ // Private Methods //
137
+ ////////////////////////////////////////////////////////////////////////////////////////
138
+ ////////////////////////////////////////////////////////////////////////////////////////
139
+ // Listeners //
140
+ ////////////////////////////////////////////////////////////////////////////////////////
141
+ }
admin/views/FMViewFrommapeditinpopup.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMViewFrommapeditinpopup {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+
16
+ ////////////////////////////////////////////////////////////////////////////////////////
17
+ // Constructor & Destructor //
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ public function __construct($model) {
20
+ $this->model = $model;
21
+ }
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
26
+ $long = ((isset($_GET['long'])) ? esc_html(stripslashes($_GET['long'])) : 0);
27
+ $lat = ((isset($_GET['lat'])) ? esc_html(stripslashes($_GET['lat'])) : 0);
28
+ ?>
29
+ <script src="<?php echo WD_FM_URL . '/js/main_front_end.js'; ?>"></script>
30
+ <script src="<?php echo WD_FM_URL . '/js/if_gmap_back_end.js'; ?>"></script>
31
+ <script src="http://maps.google.com/maps/api/js?sensor=false"></script>
32
+ <table style="margin:0px; padding:0px">
33
+ <tr>
34
+ <td><b>Address:</b></td>
35
+ <td><input type="text" id="addrval0" style="border:0px; background:none" size="80" readonly/></td>
36
+ </tr>
37
+ <tr>
38
+ <td><b>Longitude:</b></td>
39
+ <td><input type="text" id="longval0" style="border:0px; background:none" size="80" readonly/></td>
40
+ </tr>
41
+ <tr>
42
+ <td><b>Latitude:</b></td>
43
+ <td><input type="text" id="latval0" style="border:0px; background:none" size="80" readonly/></td>
44
+ </tr>
45
+ </table>
46
+ <div id="0_elementform_id_temp" long="<?php echo $long ?>" center_x="<?php echo $long ?>" center_y="<?php echo $lat ?>" lat="<?php echo $lat ?>" zoom="8" info="" style="width:600px; height:400px; "></div>
47
+ <script>
48
+ if_gmap_init("0");
49
+ add_marker_on_map(0, 0, "<?php echo $long; ?>", "<?php echo $lat; ?>", "");
50
+ </script>
51
+ <?php
52
+ die();
53
+ }
54
+
55
+ ////////////////////////////////////////////////////////////////////////////////////////
56
+ // Getters & Setters //
57
+ ////////////////////////////////////////////////////////////////////////////////////////
58
+ ////////////////////////////////////////////////////////////////////////////////////////
59
+ // Private Methods //
60
+ ////////////////////////////////////////////////////////////////////////////////////////
61
+ ////////////////////////////////////////////////////////////////////////////////////////
62
+ // Listeners //
63
+ ////////////////////////////////////////////////////////////////////////////////////////
64
+ }
admin/views/FMViewGenerete_csv.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMViewGenerete_csv {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ // Constructor & Destructor //
17
+ ////////////////////////////////////////////////////////////////////////////////////////
18
+ public function __construct($model) {
19
+ $this->model = $model;
20
+ }
21
+
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
26
+ $params = $this->model->get_data();
27
+ $data = $params[0];
28
+ $title = $params[1];
29
+ $is_paypal_info = $params[2];
30
+
31
+ function cleanData(&$str) {
32
+ $str = preg_replace("/\t/", "\\t", $str);
33
+ $str = preg_replace("/\r?\n/", "\\n", $str);
34
+ if (strstr($str, '"'))
35
+ $str = '"' . str_replace('"', '""', $str) . '"';
36
+ }
37
+ // File name for download.
38
+ $filename = $title . "_" . date('Ymd') . ".csv";
39
+ header('Content-Encoding: Windows-1252');
40
+ header('Content-type: text/csv; charset=Windows-1252');
41
+ header("Content-Disposition: attachment; filename=\"$filename\"");
42
+ $flag = FALSE;
43
+ foreach ($data as $row) {
44
+ if (!$flag) {
45
+ # display field/column names as first row
46
+ echo "sep=,\r\n";
47
+ echo '"' . implode('","', array_keys($row));
48
+ if ($is_paypal_info) {
49
+ echo '","Currency","Last modified","Status","Full Name","Fax","Mobile phone","Email","Phone","Address","Paypal info","IPN","Tax","Shipping';
50
+ }
51
+ echo "\"\r\n";
52
+ $flag = TRUE;
53
+ }
54
+ array_walk($row, 'cleanData');
55
+ echo '"' . implode('","', array_values($row)) . "\"\r\n";
56
+ }
57
+ die('');
58
+ }
59
+
60
+ ////////////////////////////////////////////////////////////////////////////////////////
61
+ // Getters & Setters //
62
+ ////////////////////////////////////////////////////////////////////////////////////////
63
+ ////////////////////////////////////////////////////////////////////////////////////////
64
+ // Private Methods //
65
+ ////////////////////////////////////////////////////////////////////////////////////////
66
+ ////////////////////////////////////////////////////////////////////////////////////////
67
+ // Listeners //
68
+ ////////////////////////////////////////////////////////////////////////////////////////
69
+ }
admin/views/FMViewGenerete_xml.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMViewGenerete_xml {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ // Constructor & Destructor //
17
+ ////////////////////////////////////////////////////////////////////////////////////////
18
+ public function __construct($model) {
19
+ $this->model = $model;
20
+ }
21
+
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
26
+ $params = $this->model->get_data();
27
+ $data = $params[0];
28
+ $title = $params[1];
29
+ $filename = $title . "_" . date('Ymd') . ".xml";
30
+ header("Content-Disposition: attachment; filename=\"$filename\"");
31
+ header("Content-Type:text/xml, charset=utf-8");
32
+ $flag = FALSE;
33
+ echo '<?xml version="1.0" encoding="utf-8" ?>';
34
+ ?>
35
+ <form title="<?php echo $title; ?>">
36
+ <?php
37
+ foreach ($data as $key1 => $value1) {
38
+ ?>
39
+ <submission>
40
+ <?php
41
+ foreach ($value1 as $key => $value) {
42
+ ?>
43
+ <field title="<?php echo $key; ?>">
44
+ <![CDATA[<?php echo $value; ?>]]>
45
+ </field>
46
+ <?php
47
+ }
48
+ ?>
49
+ </submission>
50
+ <?php
51
+ }
52
+ ?>
53
+ </form>
54
+ <?php
55
+ die('');
56
+ }
57
+
58
+ ////////////////////////////////////////////////////////////////////////////////////////
59
+ // Getters & Setters //
60
+ ////////////////////////////////////////////////////////////////////////////////////////
61
+ ////////////////////////////////////////////////////////////////////////////////////////
62
+ // Private Methods //
63
+ ////////////////////////////////////////////////////////////////////////////////////////
64
+ ////////////////////////////////////////////////////////////////////////////////////////
65
+ // Listeners //
66
+ ////////////////////////////////////////////////////////////////////////////////////////
67
+ }
admin/views/FMViewLicensing_fm.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMViewLicensing_fm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+
16
+ ////////////////////////////////////////////////////////////////////////////////////////
17
+ // Constructor & Destructor //
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ public function __construct($model) {
20
+ $this->model = $model;
21
+ }
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
26
+ ?>
27
+ <div style="width:99%">
28
+ <p>This plugin is the non-commercial version of the Form Maker. Use of this plugin is free. You can add not more than 7 fields. The limitation is on the some types of the fields (File Upload, Map and Paypal). If you want to use those fields, you are required to purchase a license. </p>
29
+ <br/>
30
+ <a href="http://web-dorado.com/files/fromFormMaker.php" class="button-primary" target="_blank">Purchase a License</a>
31
+ <br/><br/>
32
+ <p>After the purchasing the commercial version follow this steps:</p>
33
+ <ol>
34
+ <li>Deactivate Form Maker Plugin.</li>
35
+ <li>Delete Form Maker Plugin.</li>
36
+ <li>Install the downloaded commercial version of the plugin.</li>
37
+ </ol>
38
+ <br/>
39
+ <p>If you enjoy using Form Maker and find it useful, please consider making a donation. Your donation will help encourage and support the plugin's continued development and better user support.</p>
40
+ <br/>
41
+ <a href="http://web-dorado.com/files/donate_redirect.php" target="_blank"><img src="<?php echo WD_FM_URL . '/images/btn_donateCC_LG.gif'; ?>" /></a>
42
+ </div>
43
+ <?php
44
+ }
45
+ ////////////////////////////////////////////////////////////////////////////////////////
46
+ // Getters & Setters //
47
+ ////////////////////////////////////////////////////////////////////////////////////////
48
+ ////////////////////////////////////////////////////////////////////////////////////////
49
+ // Private Methods //
50
+ ////////////////////////////////////////////////////////////////////////////////////////
51
+ ////////////////////////////////////////////////////////////////////////////////////////
52
+ // Listeners //
53
+ ////////////////////////////////////////////////////////////////////////////////////////
54
+ }
admin/views/FMViewManage_fm.php ADDED
@@ -0,0 +1,3290 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMViewManage_fm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ // Constructor & Destructor //
17
+ ////////////////////////////////////////////////////////////////////////////////////////
18
+ public function __construct($model) {
19
+ $this->model = $model;
20
+ }
21
+
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
26
+ $rows_data = $this->model->get_rows_data();
27
+ $page_nav = $this->model->page_nav();
28
+ $search_value = ((isset($_POST['search_value'])) ? esc_html($_POST['search_value']) : '');
29
+ $search_select_value = ((isset($_POST['search_select_value'])) ? (int) $_POST['search_select_value'] : 0);
30
+ $asc_or_desc = ((isset($_POST['asc_or_desc'])) ? esc_html($_POST['asc_or_desc']) : 'asc');
31
+ $order_by = (isset($_POST['order_by']) ? esc_html($_POST['order_by']) : 'id');
32
+ $order_class = 'manage-column column-title sorted ' . $asc_or_desc;
33
+ $ids_string = '';
34
+ ?>
35
+ <div style="clear: both; float: left; width: 99%;">
36
+ <div style="float:left; font-size: 14px; font-weight: bold;">
37
+ This section allows you to create, edit forms.
38
+ <a style="color: blue; text-decoration: none;" target="_blank" href="http://web-dorado.com/wordpress-form-maker-guide-2.html">Read More in User Manual</a>
39
+ </div>
40
+ <div style="float: right; text-align: right;">
41
+ <a style="text-decoration: none;" target="_blank" href="http://web-dorado.com/products/wordpress-form.html">
42
+ <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FM_URL . '/images/wd_logo.png'; ?>" />
43
+ </a>
44
+ </div>
45
+ </div>
46
+ <form onkeypress="spider_doNothing(event)" class="wrap" id="manage_form" method="post" action="admin.php?page=manage_fm" style="float: left; width: 99%;">
47
+ <span class="form_maker_icon"></span>
48
+ <h2>
49
+ Form Maker
50
+ <a href="" class="add-new-h2" onclick="spider_set_input_value('task', 'add');
51
+ spider_form_submit(event, 'manage_form')">Add new</a>
52
+ </h2>
53
+ <div class="tablenav top">
54
+ <?php
55
+ WDW_FM_Library::search('Title', $search_value, 'manage_form');
56
+ WDW_FM_Library::html_page_nav($page_nav['total'], $page_nav['limit'], 'manage_form');
57
+ ?>
58
+ </div>
59
+ <table class="wp-list-table widefat fixed pages">
60
+ <thead>
61
+ <th class="manage-column column-cb check-column table_small_col"><input id="check_all" type="checkbox" style="margin:0;"/></th>
62
+ <th class="table_small_col <?php if ($order_by == 'id') { echo $order_class; } ?>">
63
+ <a onclick="spider_set_input_value('task', '');
64
+ spider_set_input_value('order_by', 'id');
65
+ spider_set_input_value('asc_or_desc', '<?php echo ((isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && (esc_html($_POST['order_by']) == 'id') && esc_html($_POST['asc_or_desc']) == 'asc') ? 'desc' : 'asc'); ?>');
66
+ spider_form_submit(event, 'manage_form')" href="">
67
+ <span>ID</span><span class="sorting-indicator"></span></a>
68
+ </th>
69
+ <th class="<?php if ($order_by == 'title') { echo $order_class; } ?>">
70
+ <a onclick="spider_set_input_value('task', '');
71
+ spider_set_input_value('order_by', 'title');
72
+ spider_set_input_value('asc_or_desc', '<?php echo ((isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && (esc_html($_POST['order_by']) == 'title') && esc_html($_POST['asc_or_desc']) == 'asc') ? 'desc' : 'asc'); ?>');
73
+ spider_form_submit(event, 'manage_form')" href="">
74
+ <span>Title</span><span class="sorting-indicator"></span></a>
75
+ </th>
76
+ <th class="<?php if ($order_by == 'mail') { echo $order_class; } ?>">
77
+ <a onclick="spider_set_input_value('task', '');
78
+ spider_set_input_value('order_by', 'mail');
79
+ spider_set_input_value('asc_or_desc', '<?php echo ((isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && (esc_html($_POST['order_by']) == 'mail') && esc_html($_POST['asc_or_desc']) == 'asc') ? 'desc' : 'asc'); ?>');
80
+ spider_form_submit(event, 'manage_form')" href="">
81
+ <span>Email to send submissions to</span><span class="sorting-indicator"></span></a>
82
+ </th>
83
+ <th class="table_big_col">Shortcode</th>
84
+ <th class="table_big_col">Edit</th>
85
+ <th class="table_big_col"><a title="Delete selected items" href="" onclick="if (confirm('Do you want to delete selected items?')) {
86
+ spider_set_input_value('task', 'delete_all');
87
+ spider_form_submit(event, 'manage_form');
88
+ } else {
89
+ return false;
90
+ }">Delete</a></th>
91
+ </thead>
92
+ <tbody id="tbody_arr">
93
+ <?php
94
+ if ($rows_data) {
95
+ foreach ($rows_data as $row_data) {
96
+ $alternate = (!isset($alternate) || $alternate == 'class="alternate"') ? '' : 'class="alternate"';
97
+ $old = '';
98
+ if (isset($row_data->form) && ($row_data->form != '')) {
99
+ $old = '_old';
100
+ }
101
+ ?>
102
+ <tr id="tr_<?php echo $row_data->id; ?>" <?php echo $alternate; ?>>
103
+ <td class="table_small_col check-column">
104
+ <input id="check_<?php echo $row_data->id; ?>" name="check_<?php echo $row_data->id; ?>" type="checkbox"/>
105
+ </td>
106
+ <td class="table_small_col"><?php echo $row_data->id; ?></td>
107
+ <td>
108
+ <a onclick="spider_set_input_value('task', 'edit<?php echo $old; ?>');
109
+ spider_set_input_value('current_id', '<?php echo $row_data->id; ?>');
110
+ spider_form_submit(event, 'manage_form')" href="" title="Edit"><?php echo $row_data->title; ?></a>
111
+ </td>
112
+ <td><?php echo $row_data->mail; ?></td>
113
+ <td class="table_big_col" style="padding-left: 0; padding-right: 0;">
114
+ <input type="text" value='[Form id="<?php echo $row_data->id; ?>"]' onclick="spider_select_value(this)" size="12" readonly="readonly" style="padding-left: 1px; padding-right: 1px;"/>
115
+ </td>
116
+ <td class="table_big_col">
117
+ <a onclick="spider_set_input_value('task', 'edit<?php echo $old; ?>');
118
+ spider_set_input_value('current_id', '<?php echo $row_data->id; ?>');
119
+ spider_form_submit(event, 'manage_form')" href="">Edit</a>
120
+ </td>
121
+ <td class="table_big_col">
122
+ <a onclick="spider_set_input_value('task', 'delete');
123
+ spider_set_input_value('current_id', '<?php echo $row_data->id; ?>');
124
+ spider_form_submit(event, 'manage_form')" href="">Delete</a>
125
+ </td>
126
+ </tr>
127
+ <?php
128
+ $ids_string .= $row_data->id . ',';
129
+ }
130
+ }
131
+ ?>
132
+ </tbody>
133
+ </table>
134
+ <input id="task" name="task" type="hidden" value=""/>
135
+ <input id="current_id" name="current_id" type="hidden" value=""/>
136
+ <input id="ids_string" name="ids_string" type="hidden" value="<?php echo $ids_string; ?>"/>
137
+ <input id="asc_or_desc" name="asc_or_desc" type="hidden" value="asc"/>
138
+ <input id="order_by" name="order_by" type="hidden" value="<?php echo $order_by; ?>"/>
139
+ </form>
140
+ <?php
141
+ }
142
+
143
+ public function edit($id) {
144
+ // header("X-XSS-Protection: 0");
145
+ $row = $this->model->get_row_data_new($id);
146
+ $themes = $this->model->get_theme_rows_data();
147
+ $labels = array();
148
+ $label_id = array();
149
+ $label_order_original = array();
150
+ $label_type = array();
151
+ $label_all = explode('#****#', $row->label_order);
152
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
153
+ foreach ($label_all as $key => $label_each) {
154
+ $label_id_each = explode('#**id**#', $label_each);
155
+ array_push($label_id, $label_id_each[0]);
156
+ $label_oder_each = explode('#**label**#', $label_id_each[1]);
157
+ array_push($label_order_original, addslashes($label_oder_each[0]));
158
+ array_push($label_type, $label_oder_each[1]);
159
+ }
160
+ $labels['id'] = '"' . implode('","', $label_id) . '"';
161
+ $labels['label'] = '"' . implode('","', $label_order_original) . '"';
162
+ $labels['type'] = '"' . implode('","', $label_type) . '"';
163
+ $page_title = (($id != 0) ? 'Edit form ' . $row->title : 'Create new form');
164
+ ?>
165
+ <script type="text/javascript">
166
+ var plugin_url = "<?php echo WD_FM_URL; ?>";
167
+ </script>
168
+ <script src="<?php echo WD_FM_URL . '/js/formmaker_div_free.js'; ?>" type="text/javascript"></script>
169
+ <script type="text/javascript">
170
+ form_view = 1;
171
+ form_view_count = 1;
172
+ form_view_max = 1;
173
+ function submitbutton() {
174
+ <?php
175
+ if ($id) {
176
+ ?>
177
+ if (!document.getElementById('araqel') || (document.getElementById('araqel').value == '0')) {
178
+ alert('Please wait while page loading.');
179
+ return false;
180
+ }
181
+ <?php
182
+ }
183
+ ?>
184
+ tox = '';
185
+ form_fields = '';
186
+ document.getElementById('take').style.display = "none";
187
+ document.getElementById('page_bar').style.display = "none";
188
+ document.getElementById('saving').style.display = "block";
189
+ remove_whitespace(document.getElementById('take'));
190
+ l_id_array = [<?php echo $labels['id']?>];
191
+ l_label_array = [<?php echo $labels['label']?>];
192
+ l_type_array = [<?php echo $labels['type']?>];
193
+ l_id_removed = [];
194
+ for (x = 0; x < l_id_array.length; x++) {
195
+ l_id_removed[l_id_array[x]] = true;
196
+ }
197
+ for (t = 1; t <= form_view_max; t++) {
198
+ if (document.getElementById('form_id_tempform_view' + t)) {
199
+ wdform_page = document.getElementById('form_id_tempform_view' + t);
200
+ remove_whitespace(wdform_page);
201
+ n = wdform_page.childNodes.length - 2;
202
+ for (q = 0; q <= n; q++) {
203
+ if (!wdform_page.childNodes[q].getAttribute("wdid")) {
204
+ wdform_section = wdform_page.childNodes[q];
205
+ for (x = 0; x < wdform_section.childNodes.length; x++) {
206
+ wdform_column = wdform_section.childNodes[x];
207
+ if (wdform_column.firstChild) {
208
+ for (y=0; y < wdform_column.childNodes.length; y++) {
209
+ is_in_old = false;
210
+ wdform_row = wdform_column.childNodes[y];
211
+ if (wdform_row.nodeType == 3) {
212
+ continue;
213
+ }
214
+ wdid = wdform_row.getAttribute("wdid");
215
+ if (!wdid) {
216
+ continue;
217
+ }
218
+ l_id = wdid;
219
+ l_label = document.getElementById(wdid + '_element_labelform_id_temp').innerHTML;
220
+ l_label = l_label.replace(/(\r\n|\n|\r)/gm," ");
221
+ wdtype = wdform_row.firstChild.getAttribute('type');
222
+ for (z = 0; z < l_id_array.length; z++) {
223
+ if (l_id_array[z] == wdid) {
224
+ if (l_type_array[z] == "type_address") {
225
+ if (document.getElementById(l_id + "_mini_label_street1")) {
226
+ l_id_removed[l_id_array[z]] = false;
227
+ }
228
+ if (document.getElementById(l_id + "_mini_label_street2")) {
229
+ l_id_removed[parseInt(l_id_array[z]) + 1] = false;
230
+ }
231
+ if (document.getElementById(l_id + "_mini_label_city")) {
232
+ l_id_removed[parseInt(l_id_array[z]) + 2] = false;
233
+ }
234
+ if (document.getElementById(l_id + "_mini_label_state")) {
235
+ l_id_removed[parseInt(l_id_array[z]) + 3] = false;
236
+ }
237
+ if (document.getElementById(l_id+"_mini_label_postal")) {
238
+ l_id_removed[parseInt(l_id_array[z]) + 4] = false;
239
+ }
240
+ if (document.getElementById(l_id+"_mini_label_country")) {
241
+ l_id_removed[parseInt(l_id_array[z]) + 5] = false;
242
+ }
243
+ z = z + 5;
244
+ }
245
+ else {
246
+ l_id_removed[l_id] = false;
247
+ }
248
+ }
249
+ }
250
+ if (wdtype == "type_address") {
251
+ addr_id = parseInt(wdid);
252
+ id_for_country = addr_id;
253
+ if (document.getElementById(id_for_country + "_mini_label_street1")) {
254
+ tox = tox + addr_id + '#**id**#' + document.getElementById(id_for_country + "_mini_label_street1").innerHTML + '#**label**#type_address#****#';
255
+ addr_id++;
256
+ }
257
+ if (document.getElementById(id_for_country + "_mini_label_street2")) {
258
+ tox = tox + addr_id + '#**id**#' + document.getElementById(id_for_country + "_mini_label_street2").innerHTML + '#**label**#type_address#****#';
259
+ addr_id++;
260
+ }
261
+ if (document.getElementById(id_for_country+"_mini_label_city")) {
262
+ tox = tox + addr_id + '#**id**#' + document.getElementById(id_for_country + "_mini_label_city").innerHTML + '#**label**#type_address#****#';
263
+ addr_id++;
264
+ }
265
+ if (document.getElementById(id_for_country + "_mini_label_state")) {
266
+ tox = tox + addr_id + '#**id**#' + document.getElementById(id_for_country + "_mini_label_state").innerHTML + '#**label**#type_address#****#';
267
+ addr_id++;
268
+ }
269
+ if (document.getElementById(id_for_country + "_mini_label_postal")) {
270
+ tox = tox + addr_id + '#**id**#' + document.getElementById(id_for_country + "_mini_label_postal").innerHTML + '#**label**#type_address#****#';
271
+ addr_id++;
272
+ }
273
+ if (document.getElementById(id_for_country+"_mini_label_country")) {
274
+ tox=tox + addr_id + '#**id**#' + document.getElementById(id_for_country + "_mini_label_country").innerHTML + '#**label**#type_address#****#';
275
+ }
276
+ }
277
+ else {
278
+ tox = tox + wdid + '#**id**#' + l_label + '#**label**#' + wdtype + '#****#';
279
+ }
280
+ id = wdid;
281
+ form_fields += wdid + "*:*id*:*";
282
+ form_fields += wdtype + "*:*type*:*";
283
+ w_choices = new Array();
284
+ w_choices_checked = new Array();
285
+ w_choices_disabled = new Array();
286
+ w_allow_other_num = 0;
287
+ w_property = new Array();
288
+ w_property_type = new Array();
289
+ w_property_values = new Array();
290
+ w_choices_price = new Array();
291
+ if (document.getElementById(id+'_element_labelform_id_temp').innerHTML) {
292
+ w_field_label = document.getElementById(id + '_element_labelform_id_temp').innerHTML.replace(/(\r\n|\n|\r)/gm," ");
293
+ }
294
+ if (document.getElementById(id + '_label_sectionform_id_temp')) {
295
+ if (document.getElementById(id + '_label_sectionform_id_temp').style.display == "block") {
296
+ w_field_label_pos = "top";
297
+ }
298
+ else {
299
+ w_field_label_pos = "left";
300
+ }
301
+ }
302
+ if (document.getElementById(id + "_elementform_id_temp")) {
303
+ s = document.getElementById(id + "_elementform_id_temp").style.width;
304
+ w_size=s.substring(0,s.length - 2);
305
+ }
306
+ if (document.getElementById(id + "_label_sectionform_id_temp")) {
307
+ s = document.getElementById(id + "_label_sectionform_id_temp").style.width;
308
+ w_field_label_size = s.substring(0, s.length - 2);
309
+ }
310
+ if (document.getElementById(id + "_requiredform_id_temp")) {
311
+ w_required = document.getElementById(id + "_requiredform_id_temp").value;
312
+ }
313
+ if (document.getElementById(id + "_uniqueform_id_temp")) {
314
+ w_unique = document.getElementById(id + "_uniqueform_id_temp").value;
315
+ }
316
+ if (document.getElementById(id + '_label_sectionform_id_temp')) {
317
+ w_class = document.getElementById(id + '_label_sectionform_id_temp').getAttribute("class");
318
+ if (!w_class) {
319
+ w_class = "";
320
+ }
321
+ }
322
+ gen_form_fields();
323
+ wdform_row.innerHTML = "%" + id + " - " + l_label + "%";
324
+ }
325
+ }
326
+ }
327
+ }
328
+ else {
329
+ id = wdform_page.childNodes[q].getAttribute("wdid");
330
+ w_editor = document.getElementById(id + "_element_sectionform_id_temp").innerHTML;
331
+ form_fields += id + "*:*id*:*";
332
+ form_fields += "type_section_break" + "*:*type*:*";
333
+ form_fields += "custom_" + id + "*:*w_field_label*:*";
334
+ form_fields += w_editor + "*:*w_editor*:*";
335
+ form_fields += "*:*new_field*:*";
336
+ wdform_page.childNodes[q].innerHTML = "%" + id + " - " + "custom_" + id + "%";
337
+ }
338
+ }
339
+ }
340
+ }
341
+ document.getElementById('label_order_current').value = tox;
342
+ for (x = 0; x < l_id_array.length; x++) {
343
+ if (l_id_removed[l_id_array[x]]) {
344
+ tox = tox + l_id_array[x] + '#**id**#' + l_label_array[x] + '#**label**#' + l_type_array[x] + '#****#';
345
+ }
346
+ }
347
+ document.getElementById('label_order').value = tox;
348
+ document.getElementById('form_fields').value = form_fields;
349
+ refresh_();
350
+ document.getElementById('pagination').value=document.getElementById('pages').getAttribute("type");
351
+ document.getElementById('show_title').value=document.getElementById('pages').getAttribute("show_title");
352
+ document.getElementById('show_numbers').value=document.getElementById('pages').getAttribute("show_numbers");
353
+ return true;
354
+ }
355
+
356
+ gen = <?php echo (($id != 0) ? $row->counter : 1); ?>;
357
+
358
+ function enable() {
359
+ for (iiiii = 0; iiiii < 1000; iiiii++) {
360
+ if (document.getElementsByTagName("iframe")[iiiii]) {
361
+ if (document.getElementsByTagName("iframe")[iiiii].id == 'form_maker_editor_ifr') {
362
+ id_ifr_editor = iiiii;
363
+ break;
364
+ }
365
+ }
366
+ }
367
+ alltypes = Array('customHTML', 'text', 'checkbox', 'radio', 'time_and_date', 'select', 'file_upload', 'captcha', 'map', 'button', 'page_break', 'section_break', 'paypal', 'survey');
368
+ for (x = 0; x < 14; x++) {
369
+ document.getElementById('img_' + alltypes[x]).src = "<?php echo WD_FM_URL . '/images/'; ?>" + alltypes[x] + ".png";
370
+ }
371
+ if (document.getElementById('formMakerDiv').style.display == 'block') {
372
+ jQuery('#formMakerDiv').slideToggle(200);
373
+ }
374
+ else {
375
+ jQuery('#formMakerDiv').slideToggle(400);
376
+ }
377
+ if (document.getElementById('formMakerDiv').offsetWidth) {
378
+ document.getElementById('formMakerDiv1').style.width = (document.getElementById('formMakerDiv').offsetWidth - 60) + 'px';
379
+ }
380
+ if (document.getElementById('formMakerDiv1').style.display == 'block') {
381
+ jQuery('#formMakerDiv1').slideToggle(200);
382
+ }
383
+ else {
384
+ jQuery('#formMakerDiv1').slideToggle(400);
385
+ }
386
+ document.getElementById('when_edit').style.display = 'none';
387
+ }
388
+
389
+ function enable2() {
390
+ alltypes = Array('customHTML', 'text', 'checkbox', 'radio', 'time_and_date', 'select', 'file_upload', 'captcha', 'map', 'button', 'page_break', 'section_break', 'paypal', 'survey');
391
+ for (x = 0; x < 14; x++) {
392
+ document.getElementById('img_' + alltypes[x]).src = "<?php echo WD_FM_URL . '/images/'; ?>" + alltypes[x] + ".png";
393
+ }
394
+ if (document.getElementById('formMakerDiv').style.display == 'block') {
395
+ jQuery('#formMakerDiv').slideToggle(200);
396
+ }
397
+ else {
398
+ jQuery('#formMakerDiv').slideToggle(400);
399
+ }
400
+ if (document.getElementById('formMakerDiv').offsetWidth) {
401
+ document.getElementById('formMakerDiv1').style.width = (document.getElementById('formMakerDiv').offsetWidth - 60) + 'px';
402
+ }
403
+ if (document.getElementById('formMakerDiv1').style.display == 'block') {
404
+ jQuery('#formMakerDiv1').slideToggle(200);
405
+ }
406
+ else {
407
+ jQuery('#formMakerDiv1').slideToggle(400);
408
+ }
409
+ document.getElementById('when_edit').style.display = 'block';
410
+ if (document.getElementById('field_types').offsetWidth) {
411
+ document.getElementById('when_edit').style.width = document.getElementById('field_types').offsetWidth + 'px';
412
+ }
413
+ if (document.getElementById('field_types').offsetHeight) {
414
+ document.getElementById('when_edit').style.height = document.getElementById('field_types').offsetHeight + 'px';
415
+ }
416
+ }
417
+ </script>
418
+ <div style="clear: both; float: left; width: 99%;">
419
+ <div style="float:left; font-size: 14px; font-weight: bold;">
420
+ This section allows you to add fields to your form.
421
+ <a style="color: blue; text-decoration: none;" target="_blank" href="http://web-dorado.com/wordpress-form-maker-guide-4.html">Read More in User Manual</a>
422
+ </div>
423
+ <div style="float: right; text-align: right;">
424
+ <a style="text-decoration: none;" target="_blank" href="http://web-dorado.com/products/wordpress-form.html">
425
+ <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FM_URL . '/images/wd_logo.png'; ?>" />
426
+ </a>
427
+ </div>
428
+ </div>
429
+ <form class="wrap" id="manage_form" method="post" action="admin.php?page=manage_fm" style="float: left; width: 99%;">
430
+ <h2><?php echo $page_title; ?></h2>
431
+ <div style="float: right; margin: 0 5px 0 0;">
432
+ <input class="button-primary" type="submit" onclick="if (spider_check_required('title', 'Form title') || !submitbutton()) {return false;}; spider_set_input_value('task', 'form_options');" value="Form Options"/>
433
+ <input class="button-primary" type="submit" onclick="if (spider_check_required('title', 'Form title') || !submitbutton()) {return false;}; spider_set_input_value('task', 'form_layout');" value="Form Layout"/>
434
+ <?php
435
+ if ($id) {
436
+ ?>
437
+ <input class="button-secondary" type="submit" onclick="if (spider_check_required('title', 'Form title') || !submitbutton()) {return false;}; spider_set_input_value('task', 'save_as_copy')" value="Save as Copy"/>
438
+ <?php
439
+ }
440
+ ?>
441
+ <input class="button-secondary" type="submit" onclick="if (spider_check_required('title', 'Form title') || !submitbutton()) {return false;}; spider_set_input_value('task', 'save')" value="Save"/>
442
+ <input class="button-secondary" type="submit" onclick="if (spider_check_required('title', 'Form title') || !submitbutton()) {return false;}; spider_set_input_value('task', 'apply');" value="Apply"/>
443
+ <input class="button-secondary" type="submit" onclick="spider_set_input_value('task', 'cancel')" value="Cancel"/>
444
+ </div>
445
+
446
+ <div class="formmaker_table" width="100%">
447
+ <div style="float: left; text-align: center;"><br />
448
+ <img src="<?php echo WD_FM_URL . '/images/FormMaker.png'; ?>" /><br /><br />
449
+ <img src="<?php echo WD_FM_URL . '/images/logo.png'; ?>" />
450
+ </div>
451
+ <div style="float:right">
452
+ <span style="font-size: 16.76pt; font-family: tahoma; color: #FFFFFF; vertical-align: middle;">Form title:&nbsp;&nbsp;</span>
453
+ <input id="title" name="title" class="form_maker_title" value="<?php echo $row->title; ?>"/>
454
+ <br />
455
+ <img src="<?php echo WD_FM_URL . '/images/formoptions.png'; ?>" onclick="if (spider_check_required('title', 'Form title') || !submitbutton()) {return false;}; spider_set_input_value('task', 'form_options'); spider_form_submit(event, 'manage_form');" style="cursor: pointer; margin: 10px 0 10px 10px; float: right;"/>
456
+ <br /><br /><br />
457
+ <img src="<?php echo WD_FM_URL . '/images/addanewfield.png'; ?>" onclick="enable(); Enable()" style="cursor: pointer; margin:10px 0 10px 10px; float: right;"/>
458
+ </div>
459
+ </div>
460
+
461
+ <div id="formMakerDiv" onclick="close_window()"></div>
462
+ <div id="formMakerDiv1" style="padding-top: 20px;" align="center">
463
+ <table border="0" width="100%" cellpadding="0" cellspacing="0" height="100%" style="border: 6px #00aeef solid; background-color: #FFF;">
464
+ <tr>
465
+ <td style="padding:0px">
466
+ <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
467
+ <tr valign="top">
468
+ <td width="15%" height="100%" style="border-right: dotted black 1px;" id="field_types">
469
+ <div id="when_edit" style="display: none;"></div>
470
+ <table border="0" cellpadding="0" cellspacing="3" width="100%">
471
+ <tr>
472
+ <td align="center" onClick="addRow('customHTML')" style="cursor:pointer" id="table_editor" class="field_buttons">
473
+ <img src="<?php echo WD_FM_URL . '/images/customHTML.png'; ?>" style="margin:5px" id="img_customHTML"/>
474
+ </td>
475
+ <td align="center" onClick="addRow('text')" style="cursor:pointer" id="table_text" class="field_buttons">
476
+ <img src="<?php echo WD_FM_URL . '/images/text.png'; ?>" style="margin:5px" id="img_text"/>
477
+ </td>
478
+ </tr>
479
+ <tr>
480
+ <td align="center" onClick="addRow('checkbox')" style="cursor:pointer" id="table_checkbox" class="field_buttons">
481
+ <img src="<?php echo WD_FM_URL . '/images/checkbox.png'; ?>" style="margin:5px" id="img_checkbox"/>
482
+ </td>
483
+ <td align="center" onClick="addRow('radio')" style="cursor:pointer" id="table_radio" class="field_buttons">
484
+ <img src="<?php echo WD_FM_URL . '/images/radio.png'; ?>" style="margin:5px" id="img_radio"/>
485
+ </td>
486
+ </tr>
487
+ <tr>
488
+ <td align="center" onClick="addRow('survey')" class="field_buttons" id="table_survey">
489
+ <img src="<?php echo WD_FM_URL . '/images/survey.png'; ?>" style="margin:5px" id="img_survey"/>
490
+ </td>
491
+ <td align="center" onClick="addRow('time_and_date')" style="cursor:pointer" id="table_time_and_date" class="field_buttons">
492
+ <img src="<?php echo WD_FM_URL . '/images/time_and_date.png'; ?>" style="margin:5px" id="img_time_and_date"/>
493
+ </td>
494
+ </tr>
495
+ <tr>
496
+ <td align="center" onClick="addRow('select')" style="cursor:pointer" id="table_select" class="field_buttons">
497
+ <img src="<?php echo WD_FM_URL . '/images/select.png'; ?>" style="margin:5px" id="img_select"/>
498
+ </td>
499
+ <td align="center" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" id="table_file_upload" class="field_buttons"
500
+ onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')">
501
+ <img src="<?php echo WD_FM_URL . '/images/file_upload.png'; ?>" style="margin:5px" id="img_file_upload" />
502
+ </td>
503
+ </tr>
504
+ <tr>
505
+ <td align="center" onClick="addRow('section_break')" style="cursor:pointer" id="table_section_break" class="field_buttons">
506
+ <img src="<?php echo WD_FM_URL . '/images/section_break.png'; ?>" style="margin:5px" id="img_section_break"/>
507
+ </td>
508
+ <td align="center" onClick="addRow('page_break')" style="cursor:pointer" id="table_page_break" class="field_buttons">
509
+ <img src="<?php echo WD_FM_URL . '/images/page_break.png'; ?>" style="margin:5px" id="img_page_break"/>
510
+ </td>
511
+ </tr>
512
+ <tr>
513
+ <td align="center" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" id="table_map" class="field_buttons"
514
+ onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')">
515
+ <img src="<?php echo WD_FM_URL . '/images/map.png'; ?>" style="margin:5px" id="img_map" />
516
+ </td>
517
+ <td align="center" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" id="table_paypal" class="field_buttons"
518
+ onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')">
519
+ <img src="<?php echo WD_FM_URL . '/images/paypal.png'; ?>" style="margin:5px" id="img_paypal" />
520
+ </td>
521
+ </tr>
522
+ <tr>
523
+ <td align="center" onClick="addRow('captcha')" style="cursor:pointer" id="table_captcha" class="field_buttons">
524
+ <img src="<?php echo WD_FM_URL . '/images/captcha.png'; ?>" style="margin:5px" id="img_captcha"/>
525
+ </td>
526
+ <td align="center" onClick="addRow('button')" id="table_button" class="field_buttons">
527
+ <img src="<?php echo WD_FM_URL . '/images/button.png'; ?>" style="margin:5px" id="img_button"/>
528
+ </td>
529
+ </tr>
530
+ </table>
531
+ </td>
532
+ <td width="35%" height="100%" align="left">
533
+ <div id="edit_table" style="padding:0px; overflow-y:scroll; height:575px"></div>
534
+ </td>
535
+ <td align="center" valign="top" style="background: url("<?php echo WD_FM_URL . '/images/border2.png'; ?>") repeat-y;">&nbsp;</td>
536
+ <td style="padding:15px">
537
+ <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
538
+ <tr>
539
+ <td align="right">
540
+ <input type="radio" value="end" name="el_pos" checked="checked" id="pos_end" onclick="Disable()"/>
541
+ At The End
542
+ <input type="radio" value="begin" name="el_pos" id="pos_begin" onclick="Disable()"/>
543
+ At The Beginning
544
+ <input type="radio" value="before" name="el_pos" id="pos_before" onclick="Enable()"/>
545
+ Before
546
+ <select style="width: 100px; margin-left: 5px;" id="sel_el_pos" onclick="change_before()" disabled="disabled"></select>
547
+ <img alt="ADD" title="add" style="cursor:pointer; vertical-align:middle; margin:5px" src="<?php echo WD_FM_URL . '/images/save.png'; ?>" onClick="add(0)"/>
548
+ <img alt="CANCEL" title="cancel" style="cursor: pointer; vertical-align:middle; margin:5px" src="<?php echo WD_FM_URL . '/images/cancel_but.png'; ?>" onClick="close_window()"/>
549
+ <hr style=" margin-bottom:10px" />
550
+ </td>
551
+ </tr>
552
+ <tr height="100%" valign="top">
553
+ <td id="show_table"></td>
554
+ </tr>
555
+ </table>
556
+ </td>
557
+ </tr>
558
+ </table>
559
+ </td>
560
+ </tr>
561
+ </table>
562
+ <input type="hidden" id="old" />
563
+ <input type="hidden" id="old_selected" />
564
+ <input type="hidden" id="element_type" />
565
+ <input type="hidden" id="editing_id" />
566
+ <input type="hidden" value="<?php echo WD_FM_URL; ?>" id="form_plugins_url" />
567
+ <div id="main_editor" style="position: absolute; display: none; z-index: 140;">
568
+ <?php
569
+ if (user_can_richedit()) {
570
+ wp_editor('', 'form_maker_editor', array('teeny' => FALSE, 'textarea_name' => 'form_maker_editor', 'media_buttons' => FALSE, 'textarea_rows' => 5));
571
+ }
572
+ else {
573
+ ?>
574
+ <textarea name="form_maker_editor" id="form_maker_editor" cols="40" rows="5" style="width: 440px; height: 350px;" class="mce_editable" aria-hidden="true"></textarea>
575
+ <?php
576
+ }
577
+ ?>
578
+ </div>
579
+ </div>
580
+ <?php
581
+ if (!function_exists('the_editor')) {
582
+ ?>
583
+ <iframe id="tinymce" style="display: none;"></iframe>
584
+ <?php
585
+ }
586
+ ?>
587
+ <br /><br />
588
+ <fieldset>
589
+ <legend><h2 style="color: #00aeef;">Form</h2></legend>
590
+ <div id="saving" style="display:none;">
591
+ <div id="saving_text">Saving</div>
592
+ <div id="fadingBarsG">
593
+ <div id="fadingBarsG_1" class="fadingBarsG"></div>
594
+ <div id="fadingBarsG_2" class="fadingBarsG"></div>
595
+ <div id="fadingBarsG_3" class="fadingBarsG"></div>
596
+ <div id="fadingBarsG_4" class="fadingBarsG"></div>
597
+ <div id="fadingBarsG_5" class="fadingBarsG"></div>
598
+ <div id="fadingBarsG_6" class="fadingBarsG"></div>
599
+ <div id="fadingBarsG_7" class="fadingBarsG"></div>
600
+ <div id="fadingBarsG_8" class="fadingBarsG"></div>
601
+ </div>
602
+ </div>
603
+ <?php
604
+ if ($id) {
605
+ ?>
606
+ <div style="margin: 8px; display: table; width: 100%;" id="page_bar">
607
+ <div id="page_navigation" style="display: table-row;">
608
+ <div align="center" id="pages" show_title="<?php echo $row->show_title; ?>" show_numbers="<?php echo $row->show_numbers; ?>" type="<?php echo $row->pagination; ?>" style="display: table-cell; width:90%;"></div>
609
+ <div align="left" id="edit_page_navigation" style="display: table-cell; vertical-align: middle;"></div>
610
+ </div>
611
+ </div>
612
+ <div id="take" class="main">
613
+ <?php
614
+ echo $row->form_front;
615
+ ?>
616
+ </div>
617
+ <?php
618
+ }
619
+ else {
620
+ ?>
621
+ <div style="margin:8px; display:table; width:100%" id="page_bar">
622
+ <div id="page_navigation" style="display:table-row">
623
+ <div align="center" id="pages" show_title="false" show_numbers="true" type="none" style="display:table-cell; width:90%"></div>
624
+ <div align="left" id="edit_page_navigation" style="display:table-cell; vertical-align: middle;"></div>
625
+ </div>
626
+ </div>
627
+ <div id="take" class="main">
628
+ <div class="wdform-page-and-images" style="display:table; border-top:0px solid black;">
629
+ <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">
630
+ <div class="wdform_section"><div class="wdform_column"></div></div>
631
+ <div valign="top" class="wdform_footer" style="width: 100%;">
632
+ <div style="width: 100%;">
633
+ <div style="width: 100%; display: table;">
634
+ <div style="display: table-row-group;">
635
+ <div id="form_id_temppage_nav1" style="display: table-row;"></div>
636
+ </div>
637
+ </div>
638
+ </div>
639
+ </div>
640
+ </div>
641
+ <div id="form_id_tempform_view_img1" style="float: right;">
642
+ <div>
643
+ <img src="<?php echo WD_FM_URL . '/images/minus.png'; ?>" title="Show or hide the page" class="page_toolbar" onClick="show_or_hide('1')" onMouseOver="chnage_icons_src(this,'minus')" onmouseout="chnage_icons_src(this,'minus')" id="show_page_img_1"/>
644
+ <img src="<?php echo WD_FM_URL . '/images/page_delete.png'; ?>" title="Delete the page" class="page_toolbar" onClick="remove_page('1')" onMouseOver="chnage_icons_src(this,'page_delete')" onmouseout="chnage_icons_src(this,'page_delete')"/>
645
+ <img src="<?php echo WD_FM_URL . '/images/page_delete_all.png'; ?>" title="Delete the page with fields" class="page_toolbar" onClick="remove_page_all('1')" onMouseOver="chnage_icons_src(this,'page_delete_all')" onmouseout="chnage_icons_src(this,'page_delete_all')"/>
646
+ <img src="<?php echo WD_FM_URL . '/images/page_edit.png'; ?>" title="Edit the page" class="page_toolbar" onClick="edit_page_break('1')" onMouseOver="chnage_icons_src(this,'page_edit')" onmouseout="chnage_icons_src(this,'page_edit')"/>
647
+ </div>
648
+ </div>
649
+ </div>
650
+ </div>
651
+ <?php
652
+ }
653
+ ?>
654
+ </fieldset>
655
+ <input type="hidden" name="form_front" id="form_front" />
656
+ <input type="hidden" name="form_fields" id="form_fields" />
657
+ <input type="hidden" name="pagination" id="pagination" />
658
+ <input type="hidden" name="show_title" id="show_title" />
659
+ <input type="hidden" name="show_numbers" id="show_numbers" />
660
+ <input type="hidden" name="public_key" id="public_key" />
661
+ <input type="hidden" name="private_key" id="private_key" />
662
+ <input type="hidden" name="recaptcha_theme" id="recaptcha_theme" />
663
+ <input type="hidden" id="label_order" name="label_order" value="<?php echo $row->label_order; ?>" />
664
+ <input type="hidden" id="label_order_current" name="label_order_current" value="<?php echo $row->label_order_current; ?>" />
665
+ <input type="hidden" name="counter" id="counter" value="<?php echo $row->counter; ?>" />
666
+ <input type="hidden" id="araqel" value="0" />
667
+ <?php
668
+ if ($id) {
669
+ ?>
670
+ <script type="text/javascript">
671
+ function formOnload() {
672
+ // Enable maps.
673
+ for (t = 0; t < <?php echo $row->counter; ?>; t++) {
674
+ if (document.getElementById(t + "_typeform_id_temp")) {
675
+ if (document.getElementById(t + "_typeform_id_temp").value == "type_map" || document.getElementById(t + "_typeform_id_temp").value == "type_mark_map") {
676
+ if_gmap_init(t);
677
+ for (q = 0; q < 20; q++) {
678
+ if (document.getElementById(t + "_elementform_id_temp").getAttribute("long" + q)) {
679
+ w_long = parseFloat(document.getElementById(t + "_elementform_id_temp").getAttribute("long" + q));
680
+ w_lat = parseFloat(document.getElementById(t + "_elementform_id_temp").getAttribute("lat" + q));
681
+ w_info = parseFloat(document.getElementById(t + "_elementform_id_temp").getAttribute("info" + q));
682
+ add_marker_on_map(t, q, w_long, w_lat, w_info, false);
683
+ }
684
+ }
685
+ }
686
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_date") {
687
+ // Calendar.setup({
688
+ // inputField:t + "_elementform_id_temp",
689
+ // ifFormat:document.getElementById(t + "_buttonform_id_temp").getAttribute('format'),
690
+ // button:t + "_buttonform_id_temp",
691
+ // align:"Tl",
692
+ // singleClick:true,
693
+ // firstDay:0
694
+ // });
695
+ }
696
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_name") {
697
+ var myu = t;
698
+ jQuery(document).ready(function () {
699
+ jQuery("#" + myu + "_mini_label_first").click(function () {
700
+ if (jQuery(this).children('input').length == 0) {
701
+ var first = "<input type='text' id='first' class='first' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
702
+ jQuery(this).html(first);
703
+ jQuery("input.first").focus();
704
+ jQuery("input.first").blur(function () {
705
+ var id_for_blur = document.getElementById('first').parentNode.id.split('_');
706
+ var value = jQuery(this).val();
707
+ jQuery("#" + id_for_blur[0] + "_mini_label_first").text(value);
708
+ });
709
+ }
710
+ });
711
+ jQuery("label#" + myu + "_mini_label_last").click(function () {
712
+ if (jQuery(this).children('input').length == 0) {
713
+ var last = "<input type='text' id='last' class='last' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
714
+ jQuery(this).html(last);
715
+ jQuery("input.last").focus();
716
+ jQuery("input.last").blur(function () {
717
+ var id_for_blur = document.getElementById('last').parentNode.id.split('_');
718
+ var value = jQuery(this).val();
719
+ jQuery("#" + id_for_blur[0] + "_mini_label_last").text(value);
720
+ });
721
+ }
722
+ });
723
+ jQuery("label#" + myu + "_mini_label_title").click(function () {
724
+ if (jQuery(this).children('input').length == 0) {
725
+ var title_ = "<input type='text' id='title_' class='title_' style='outline:none; border:none; background:none; width:50px;' value=\"" + jQuery(this).text() + "\">";
726
+ jQuery(this).html(title_);
727
+ jQuery("input.title_").focus();
728
+ jQuery("input.title_").blur(function () {
729
+ var id_for_blur = document.getElementById('title_').parentNode.id.split('_');
730
+ var value = jQuery(this).val();
731
+ jQuery("#" + id_for_blur[0] + "_mini_label_title").text(value);
732
+ });
733
+ }
734
+ });
735
+ jQuery("label#" + myu + "_mini_label_middle").click(function () {
736
+ if (jQuery(this).children('input').length == 0) {
737
+ var middle = "<input type='text' id='middle' class='middle' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
738
+ jQuery(this).html(middle);
739
+ jQuery("input.middle").focus();
740
+ jQuery("input.middle").blur(function () {
741
+ var id_for_blur = document.getElementById('middle').parentNode.id.split('_');
742
+ var value = jQuery(this).val();
743
+ jQuery("#" + id_for_blur[0] + "_mini_label_middle").text(value);
744
+ });
745
+ }
746
+ });
747
+ });
748
+ }
749
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_phone") {
750
+ var myu = t;
751
+ jQuery(document).ready(function () {
752
+ jQuery("label#" + myu + "_mini_label_area_code").click(function () {
753
+ if (jQuery(this).children('input').length == 0) {
754
+ var area_code = "<input type='text' id='area_code' class='area_code' size='10' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
755
+ jQuery(this).html(area_code);
756
+ jQuery("input.area_code").focus();
757
+ jQuery("input.area_code").blur(function () {
758
+ var id_for_blur = document.getElementById('area_code').parentNode.id.split('_');
759
+ var value = jQuery(this).val();
760
+ jQuery("#" + id_for_blur[0] + "_mini_label_area_code").text(value);
761
+ });
762
+ }
763
+ });
764
+ jQuery("label#" + myu + "_mini_label_phone_number").click(function () {
765
+ if (jQuery(this).children('input').length == 0) {
766
+ var phone_number = "<input type='text' id='phone_number' class='phone_number' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
767
+ jQuery(this).html(phone_number);
768
+ jQuery("input.phone_number").focus();
769
+ jQuery("input.phone_number").blur(function () {
770
+ var id_for_blur = document.getElementById('phone_number').parentNode.id.split('_');
771
+ var value = jQuery(this).val();
772
+ jQuery("#" + id_for_blur[0] + "_mini_label_phone_number").text(value);
773
+ });
774
+ }
775
+ });
776
+ });
777
+ }
778
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_date_fields") {
779
+ var myu = t;
780
+ jQuery(document).ready(function () {
781
+ jQuery("label#" + myu + "_day_label").click(function () {
782
+ if (jQuery(this).children('input').length == 0) {
783
+ var day = "<input type='text' id='day' class='day' size='8' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
784
+ jQuery(this).html(day);
785
+ jQuery("input.day").focus();
786
+ jQuery("input.day").blur(function () {
787
+ var id_for_blur = document.getElementById('day').parentNode.id.split('_');
788
+ var value = jQuery(this).val();
789
+ jQuery("#" + id_for_blur[0] + "_day_label").text(value);
790
+ });
791
+ }
792
+ });
793
+ jQuery("label#" + myu + "_month_label").click(function () {
794
+ if (jQuery(this).children('input').length == 0) {
795
+ var month = "<input type='text' id='month' class='month' size='8' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
796
+ jQuery(this).html(month);
797
+ jQuery("input.month").focus();
798
+ jQuery("input.month").blur(function () {
799
+ var id_for_blur = document.getElementById('month').parentNode.id.split('_');
800
+ var value = jQuery(this).val();
801
+ jQuery("#" + id_for_blur[0] + "_month_label").text(value);
802
+ });
803
+ }
804
+ });
805
+ jQuery("label#" + myu + "_year_label").click(function () {
806
+ if (jQuery(this).children('input').length == 0) {
807
+ var year = "<input type='text' id='year' class='year' size='8' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
808
+ jQuery(this).html(year);
809
+ jQuery("input.year").focus();
810
+ jQuery("input.year").blur(function () {
811
+ var id_for_blur = document.getElementById('year').parentNode.id.split('_');
812
+ var value = jQuery(this).val();
813
+ jQuery("#" + id_for_blur[0] + "_year_label").text(value);
814
+ });
815
+ }
816
+ });
817
+ });
818
+ }
819
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_time") {
820
+ var myu = t;
821
+ jQuery(document).ready(function () {
822
+ jQuery("label#" + myu + "_mini_label_hh").click(function () {
823
+ if (jQuery(this).children('input').length == 0) {
824
+ var hh = "<input type='text' id='hh' class='hh' size='4' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
825
+ jQuery(this).html(hh);
826
+ jQuery("input.hh").focus();
827
+ jQuery("input.hh").blur(function () {
828
+ var id_for_blur = document.getElementById('hh').parentNode.id.split('_');
829
+ var value = jQuery(this).val();
830
+ jQuery("#" + id_for_blur[0] + "_mini_label_hh").text(value);
831
+ });
832
+ }
833
+ });
834
+ jQuery("label#" + myu + "_mini_label_mm").click(function () {
835
+ if (jQuery(this).children('input').length == 0) {
836
+ var mm = "<input type='text' id='mm' class='mm' size='4' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
837
+ jQuery(this).html(mm);
838
+ jQuery("input.mm").focus();
839
+ jQuery("input.mm").blur(function () {
840
+ var id_for_blur = document.getElementById('mm').parentNode.id.split('_');
841
+ var value = jQuery(this).val();
842
+ jQuery("#" + id_for_blur[0] + "_mini_label_mm").text(value);
843
+ });
844
+ }
845
+ });
846
+ jQuery("label#" + myu + "_mini_label_ss").click(function () {
847
+ if (jQuery(this).children('input').length == 0) {
848
+ var ss = "<input type='text' id='ss' class='ss' size='4' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
849
+ jQuery(this).html(ss);
850
+ jQuery("input.ss").focus();
851
+ jQuery("input.ss").blur(function () {
852
+ var id_for_blur = document.getElementById('ss').parentNode.id.split('_');
853
+ var value = jQuery(this).val();
854
+ jQuery("#" + id_for_blur[0] + "_mini_label_ss").text(value);
855
+ });
856
+ }
857
+ });
858
+ jQuery("label#" + myu + "_mini_label_am_pm").click(function () {
859
+ if (jQuery(this).children('input').length == 0) {
860
+ var am_pm = "<input type='text' id='am_pm' class='am_pm' size='4' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
861
+ jQuery(this).html(am_pm);
862
+ jQuery("input.am_pm").focus();
863
+ jQuery("input.am_pm").blur(function () {
864
+ var id_for_blur = document.getElementById('am_pm').parentNode.id.split('_');
865
+ var value = jQuery(this).val();
866
+ jQuery("#" + id_for_blur[0] + "_mini_label_am_pm").text(value);
867
+ });
868
+ }
869
+ });
870
+ });
871
+ }
872
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_paypal_price") {
873
+ var myu = t;
874
+ jQuery(document).ready(function () {
875
+ jQuery("#" + myu + "_mini_label_dollars").click(function () {
876
+ if (jQuery(this).children('input').length == 0) {
877
+ var dollars = "<input type='text' id='dollars' class='dollars' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
878
+ jQuery(this).html(dollars);
879
+ jQuery("input.dollars").focus();
880
+ jQuery("input.dollars").blur(function () {
881
+ var id_for_blur = document.getElementById('dollars').parentNode.id.split('_');
882
+ var value = jQuery(this).val();
883
+ jQuery("#" + id_for_blur[0] + "_mini_label_dollars").text(value);
884
+ });
885
+ }
886
+ });
887
+ jQuery("label#" + myu + "_mini_label_cents").click(function () {
888
+ if (jQuery(this).children('input').length == 0) {
889
+ var cents = "<input type='text' id='cents' class='cents' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
890
+ jQuery(this).html(cents);
891
+ jQuery("input.cents").focus();
892
+ jQuery("input.cents").blur(function () {
893
+ var id_for_blur = document.getElementById('cents').parentNode.id.split('_');
894
+ var value = jQuery(this).val();
895
+ jQuery("#" + id_for_blur[0] + "_mini_label_cents").text(value);
896
+ });
897
+ }
898
+ });
899
+ });
900
+ }
901
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_address") {
902
+ var myu = t;
903
+ jQuery(document).ready(function () {
904
+ jQuery("label#" + myu + "_mini_label_street1").click(function () {
905
+ if (jQuery(this).children('input').length == 0) {
906
+ var street1 = "<input type='text' id='street1' class='street1' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
907
+ jQuery(this).html(street1);
908
+ jQuery("input.street1").focus();
909
+ jQuery("input.street1").blur(function () {
910
+ var id_for_blur = document.getElementById('street1').parentNode.id.split('_');
911
+ var value = jQuery(this).val();
912
+ jQuery("#" + id_for_blur[0] + "_mini_label_street1").text(value);
913
+ });
914
+ }
915
+ });
916
+ jQuery("label#" + myu + "_mini_label_street2").click(function () {
917
+ if (jQuery(this).children('input').length == 0) {
918
+ var street2 = "<input type='text' id='street2' class='street2' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
919
+ jQuery(this).html(street2);
920
+ jQuery("input.street2").focus();
921
+ jQuery("input.street2").blur(function () {
922
+ var id_for_blur = document.getElementById('street2').parentNode.id.split('_');
923
+ var value = jQuery(this).val();
924
+ jQuery("#" + id_for_blur[0] + "_mini_label_street2").text(value);
925
+ });
926
+ }
927
+ });
928
+ jQuery("label#" + myu + "_mini_label_city").click(function () {
929
+ if (jQuery(this).children('input').length == 0) {
930
+ var city = "<input type='text' id='city' class='city' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
931
+ jQuery(this).html(city);
932
+ jQuery("input.city").focus();
933
+ jQuery("input.city").blur(function () {
934
+ var id_for_blur = document.getElementById('city').parentNode.id.split('_');
935
+ var value = jQuery(this).val();
936
+ jQuery("#" + id_for_blur[0] + "_mini_label_city").text(value);
937
+ });
938
+ }
939
+ });
940
+ jQuery("label#" + myu + "_mini_label_state").click(function () {
941
+ if (jQuery(this).children('input').length == 0) {
942
+ var state = "<input type='text' id='state' class='state' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
943
+ jQuery(this).html(state);
944
+ jQuery("input.state").focus();
945
+ jQuery("input.state").blur(function () {
946
+ var id_for_blur = document.getElementById('state').parentNode.id.split('_');
947
+ var value = jQuery(this).val();
948
+ jQuery("#" + id_for_blur[0] + "_mini_label_state").text(value);
949
+ });
950
+ }
951
+ });
952
+ jQuery("label#" + myu + "_mini_label_postal").click(function () {
953
+ if (jQuery(this).children('input').length == 0) {
954
+ var postal = "<input type='text' id='postal' class='postal' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
955
+ jQuery(this).html(postal);
956
+ jQuery("input.postal").focus();
957
+ jQuery("input.postal").blur(function () {
958
+ var id_for_blur = document.getElementById('postal').parentNode.id.split('_');
959
+ var value = jQuery(this).val();
960
+ jQuery("#" + id_for_blur[0] + "_mini_label_postal").text(value);
961
+ });
962
+ }
963
+ });
964
+ jQuery("label#" + myu + "_mini_label_country").click(function () {
965
+ if (jQuery(this).children('input').length == 0) {
966
+ var country = "<input type='country' id='country' class='country' style='outline:none; border:none; background:none;' value=\"" + jQuery(this).text() + "\">";
967
+ jQuery(this).html(country);
968
+ jQuery("input.country").focus();
969
+ jQuery("input.country").blur(function () {
970
+ var id_for_blur = document.getElementById('country').parentNode.id.split('_');
971
+ var value = jQuery(this).val();
972
+ jQuery("#" + id_for_blur[0] + "_mini_label_country").text(value);
973
+ });
974
+ }
975
+ });
976
+ });
977
+ }
978
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_scale_rating") {
979
+ var myu = t;
980
+ jQuery(document).ready(function () {
981
+ jQuery("#" + myu + "_mini_label_worst").click(function () {
982
+ if (jQuery(this).children('input').length == 0) {
983
+ var worst = "<input type='text' id='worst' class='worst' size='6' style='outline:none; border:none; background:none; font-size:11px;' value=\"" + jQuery(this).text() + "\">";
984
+ jQuery(this).html(worst);
985
+ jQuery("input.worst").focus();
986
+ jQuery("input.worst").blur(function () {
987
+ var id_for_blur = document.getElementById('worst').parentNode.id.split('_');
988
+ var value = jQuery(this).val();
989
+ jQuery("#" + id_for_blur[0] + "_mini_label_worst").text(value);
990
+ });
991
+ }
992
+ });
993
+ jQuery("label#" + myu + "_mini_label_best").click(function () {
994
+ if (jQuery(this).children('input').length == 0) {
995
+
996
+ var best = "<input type='text' id='best' class='best' size='6' style='outline:none; border:none; background:none; font-size:11px;' value=\"" + jQuery(this).text() + "\">";
997
+ jQuery(this).html(best);
998
+ jQuery("input.best").focus();
999
+ jQuery("input.best").blur(function () {
1000
+ var id_for_blur = document.getElementById('best').parentNode.id.split('_');
1001
+ var value = jQuery(this).val();
1002
+ jQuery("#" + id_for_blur[0] + "_mini_label_best").text(value);
1003
+ });
1004
+ }
1005
+ });
1006
+ });
1007
+ }
1008
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_spinner") {
1009
+ var spinner_value = document.getElementById(t + "_elementform_id_temp").value;
1010
+ var spinner_min_value = document.getElementById(t + "_min_valueform_id_temp").value;
1011
+ var spinner_max_value = document.getElementById(t + "_max_valueform_id_temp").value;
1012
+ var spinner_step = document.getElementById(t + "_stepform_id_temp").value;
1013
+ jQuery("#" + t + "_elementform_id_temp")[0].spin = null;
1014
+ spinner = jQuery("#" + t + "_elementform_id_temp").spinner();
1015
+ spinner.spinner("value", spinner_value);
1016
+ jQuery("#" + t + "_elementform_id_temp").spinner({ min:spinner_min_value});
1017
+ jQuery("#" + t + "_elementform_id_temp").spinner({ max:spinner_max_value});
1018
+ jQuery("#" + t + "_elementform_id_temp").spinner({ step:spinner_step});
1019
+ }
1020
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_slider") {
1021
+ var slider_value = document.getElementById(t + "_slider_valueform_id_temp").value;
1022
+ var slider_min_value = document.getElementById(t + "_slider_min_valueform_id_temp").value;
1023
+ var slider_max_value = document.getElementById(t + "_slider_max_valueform_id_temp").value;
1024
+ var slider_element_value = document.getElementById(t + "_element_valueform_id_temp");
1025
+ var slider_value_save = document.getElementById(t + "_slider_valueform_id_temp");
1026
+ jQuery("#" + t + "_elementform_id_temp")[0].slide = null;
1027
+ jQuery(function () {
1028
+ jQuery("#" + t + "_elementform_id_temp").slider({
1029
+ range:"min",
1030
+ value:eval(slider_value),
1031
+ min:eval(slider_min_value),
1032
+ max:eval(slider_max_value),
1033
+ slide:function (event, ui) {
1034
+ slider_element_value.innerHTML = "" + ui.value;
1035
+ slider_value_save.value = "" + ui.value;
1036
+ }
1037
+ });
1038
+ });
1039
+ }
1040
+ else if (document.getElementById(t + "_typeform_id_temp").value == "type_range") {
1041
+ var spinner_value0 = document.getElementById(t + "_elementform_id_temp0").value;
1042
+ var spinner_step = document.getElementById(t + "_range_stepform_id_temp").value;
1043
+ jQuery("#" + t + "_elementform_id_temp0")[0].spin = null;
1044
+ jQuery("#" + t + "_elementform_id_temp1")[0].spin = null;
1045
+ spinner0 = jQuery("#" + t + "_elementform_id_temp0").spinner();
1046
+ spinner0.spinner("value", spinner_value0);
1047
+ jQuery("#" + t + "_elementform_id_temp0").spinner({ step:spinner_step});
1048
+ var spinner_value1 = document.getElementById(t + "_elementform_id_temp1").value;
1049
+ spinner1 = jQuery("#" + t + "_elementform_id_temp1").spinner();
1050
+ spinner1.spinner("value", spinner_value1);
1051
+ jQuery("#" + t + "_elementform_id_temp1").spinner({ step:spinner_step});
1052
+ var myu = t;
1053
+ jQuery(document).ready(function () {
1054
+ jQuery("#" + myu + "_mini_label_from").click(function () {
1055
+ if (jQuery(this).children('input').length == 0) {
1056
+ var from = "<input type='text' id='from' class='from' size='6' style='outline:none; border:none; background:none; font-size:11px;' value=\"" + jQuery(this).text() + "\">";
1057
+ jQuery(this).html(from);
1058
+ jQuery("input.from").focus();
1059
+ jQuery("input.from").blur(function () {
1060
+ var id_for_blur = document.getElementById('from').parentNode.id.split('_');
1061
+ var value = jQuery(this).val();
1062
+ jQuery("#" + id_for_blur[0] + "_mini_label_from").text(value);
1063
+ });
1064
+ }
1065
+ });
1066
+ jQuery("label#" + myu + "_mini_label_to").click(function () {
1067
+ if (jQuery(this).children('input').length == 0) {
1068
+ var to = "<input type='text' id='to' class='to' size='6' style='outline:none; border:none; background:none; font-size:11px;' value=\"" + jQuery(this).text() + "\">";
1069
+ jQuery(this).html(to);
1070
+ jQuery("input.to").focus();
1071
+ jQuery("input.to").blur(function () {
1072
+ var id_for_blur = document.getElementById('to').parentNode.id.split('_');
1073
+ var value = jQuery(this).val();
1074
+ jQuery("#" + id_for_blur[0] + "_mini_label_to").text(value);
1075
+ });
1076
+ }
1077
+ });
1078
+ });
1079
+ }
1080
+ }
1081
+ }
1082
+ remove_whitespace(document.getElementById('take'));
1083
+ form_view = 1;
1084
+ form_view_count = 0;
1085
+ for (i = 1; i <= 30; i++) {
1086
+ if (document.getElementById('form_id_tempform_view' + i)) {
1087
+ form_view_count++;
1088
+ form_view_max = i;
1089
+ tbody_img = document.createElement('div');
1090
+ tbody_img.setAttribute('id', 'form_id_tempform_view_img' + i);
1091
+ tbody_img.style.cssText = "float:right";
1092
+ tr_img = document.createElement('div');
1093
+ var img = document.createElement('img');
1094
+ img.setAttribute('src', '<?php echo WD_FM_URL; ?>/images/minus.png');
1095
+ img.setAttribute('title', 'Show or hide the page');
1096
+ img.setAttribute("class", "page_toolbar");
1097
+ img.setAttribute('id', 'show_page_img_' + i);
1098
+ img.setAttribute('onClick', 'show_or_hide("' + i + '")');
1099
+ img.setAttribute("onmouseover", 'chnage_icons_src(this,"minus")');
1100
+ img.setAttribute("onmouseout", 'chnage_icons_src(this,"minus")');
1101
+ var img_X = document.createElement("img");
1102
+ img_X.setAttribute("src", "<?php echo WD_FM_URL; ?>/images/page_delete.png");
1103
+ img_X.setAttribute('title', 'Delete the page');
1104
+ img_X.setAttribute("class", "page_toolbar");
1105
+ img_X.setAttribute("onclick", 'remove_page("' + i + '")');
1106
+ img_X.setAttribute("onmouseover", 'chnage_icons_src(this,"page_delete")');
1107
+ img_X.setAttribute("onmouseout", 'chnage_icons_src(this,"page_delete")');
1108
+ var img_X_all = document.createElement("img");
1109
+ img_X_all.setAttribute("src", "<?php echo WD_FM_URL; ?>/images/page_delete_all.png");
1110
+ img_X_all.setAttribute('title', 'Delete the page with fields');
1111
+ img_X_all.setAttribute("class", "page_toolbar");
1112
+ img_X_all.setAttribute("onclick", 'remove_page_all("' + i + '")');
1113
+ img_X_all.setAttribute("onmouseover", 'chnage_icons_src(this,"page_delete_all")');
1114
+ img_X_all.setAttribute("onmouseout", 'chnage_icons_src(this,"page_delete_all")');
1115
+ var img_EDIT = document.createElement("img");
1116
+ img_EDIT.setAttribute("src", "<?php echo WD_FM_URL; ?>/images/page_edit.png");
1117
+ img_EDIT.setAttribute('title', 'Edit the page');
1118
+ img_EDIT.setAttribute("class", "page_toolbar");
1119
+ img_EDIT.setAttribute("onclick", 'edit_page_break("' + i + '")');
1120
+ img_EDIT.setAttribute("onmouseover", 'chnage_icons_src(this,"page_edit")');
1121
+ img_EDIT.setAttribute("onmouseout", 'chnage_icons_src(this,"page_edit")');
1122
+ tr_img.appendChild(img);
1123
+ tr_img.appendChild(img_X);
1124
+ tr_img.appendChild(img_X_all);
1125
+ tr_img.appendChild(img_EDIT);
1126
+ tbody_img.appendChild(tr_img);
1127
+ document.getElementById('form_id_tempform_view' + i).parentNode.appendChild(tbody_img);
1128
+ }
1129
+ }
1130
+ if (form_view_count > 1) {
1131
+ for (i = 1; i <= form_view_max; i++) {
1132
+ if (document.getElementById('form_id_tempform_view' + i)) {
1133
+ first_form_view = i;
1134
+ break;
1135
+ }
1136
+ }
1137
+ form_view = form_view_max;
1138
+ need_enable = false;
1139
+ generate_page_nav(first_form_view);
1140
+ var img_EDIT = document.createElement("img");
1141
+ img_EDIT.setAttribute("src", "<?php echo WD_FM_URL . '/images/edit.png'; ?>");
1142
+ img_EDIT.style.cssText = "margin-left:40px; cursor:pointer";
1143
+ img_EDIT.setAttribute("onclick", 'el_page_navigation()');
1144
+ var td_EDIT = document.getElementById("edit_page_navigation");
1145
+ td_EDIT.appendChild(img_EDIT);
1146
+ document.getElementById('page_navigation').appendChild(td_EDIT);
1147
+ }
1148
+ document.getElementById('araqel').value = 1;
1149
+ }
1150
+ function formAddToOnload() {
1151
+ if (formOldFunctionOnLoad) {
1152
+ formOldFunctionOnLoad();
1153
+ }
1154
+ formOnload();
1155
+ }
1156
+ function formLoadBody() {
1157
+ formOldFunctionOnLoad = window.onload;
1158
+ window.onload = formOnload;
1159
+ }
1160
+ var formOldFunctionOnLoad = null;
1161
+ formLoadBody();
1162
+ </script>
1163
+ <?php
1164
+ }
1165
+ ?>
1166
+
1167
+ <input type="hidden" name="option" value="com_formmaker" />
1168
+ <input type="hidden" name="id" value="<?php echo $row->id; ?>" />
1169
+ <input type="hidden" name="cid[]" value="<?php echo $row->id; ?>" />
1170
+
1171
+ <input type="hidden" id="task" name="task" value=""/>
1172
+ <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
1173
+ </form>
1174
+ <?php
1175
+ }
1176
+
1177
+ public function edit_old($id) {
1178
+ // header("X-XSS-Protection: 0");
1179
+ $row = $this->model->get_row_data($id);
1180
+ $themes = $this->model->get_theme_rows_data('old');
1181
+ $labels = array();
1182
+ $label_id = array();
1183
+ $label_order_original = array();
1184
+ $label_type = array();
1185
+ $label_all = explode('#****#', $row->label_order);
1186
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
1187
+ foreach ($label_all as $key => $label_each) {
1188
+ $label_id_each = explode('#**id**#', $label_each);
1189
+ array_push($label_id, $label_id_each[0]);
1190
+ $label_oder_each = explode('#**label**#', $label_id_each[1]);
1191
+ array_push($label_order_original, addslashes($label_oder_each[0]));
1192
+ array_push($label_type, $label_oder_each[1]);
1193
+ }
1194
+ $labels['id'] = '"' . implode('","', $label_id) . '"';
1195
+ $labels['label'] = '"' . implode('","', $label_order_original) . '"';
1196
+ $labels['type'] = '"' . implode('","', $label_type) . '"';
1197
+
1198
+ $page_title = (($id != 0) ? 'Edit form ' . $row->title : 'Create new form');
1199
+ ?>
1200
+ <script type="text/javascript">
1201
+ var plugin_url = "<?php echo WD_FM_URL; ?>";
1202
+ </script>
1203
+ <script src="<?php echo WD_FM_URL . '/js/formmaker_free.js'; ?>" type="text/javascript"></script>
1204
+ <script type="text/javascript">
1205
+ function submitbutton() {
1206
+ if (!document.getElementById('araqel') || (document.getElementById('araqel').value == '0')) {
1207
+ alert('Please wait while page loading.');
1208
+ return false;
1209
+ }
1210
+ tox = '';
1211
+ l_id_array = [<?php echo $labels['id']?>];
1212
+ l_label_array = [<?php echo $labels['label']?>];
1213
+ l_type_array = [<?php echo $labels['type']?>];
1214
+ l_id_removed = [];
1215
+ for (x=0; x< l_id_array.length; x++) {
1216
+ l_id_removed[l_id_array[x]]=true;
1217
+ }
1218
+ for (t=1;t<=form_view_max;t++) {
1219
+ if (document.getElementById('form_id_tempform_view'+t)) {
1220
+ form_view_element=document.getElementById('form_id_tempform_view'+t);
1221
+ n=form_view_element.childNodes.length-2;
1222
+ for(q=0;q<=n;q++) {
1223
+ if (form_view_element.childNodes[q].nodeType!=3) {
1224
+ if (!form_view_element.childNodes[q].id) {
1225
+ GLOBAL_tr=form_view_element.childNodes[q];
1226
+ for (x=0; x < GLOBAL_tr.firstChild.childNodes.length; x++) {
1227
+ table=GLOBAL_tr.firstChild.childNodes[x];
1228
+ tbody=table.firstChild;
1229
+ for (y=0; y < tbody.childNodes.length; y++) {
1230
+ is_in_old=false;
1231
+ tr=tbody.childNodes[y];
1232
+ l_id=tr.id;
1233
+ l_label=document.getElementById( tr.id+'_element_labelform_id_temp').innerHTML;
1234
+ l_label = l_label.replace(/(\r\n|\n|\r)/gm," ");
1235
+ l_type=tr.getAttribute('type');
1236
+ for (z = 0; z < l_id_array.length; z++) {
1237
+ if (l_id_array[z] == l_id) {
1238
+ if (l_type_array[z] == "type_address") {
1239
+ if (document.getElementById(l_id + "_mini_label_street1")) {
1240
+ l_id_removed[l_id_array[z]] = false;
1241
+ }
1242
+ if (document.getElementById(l_id+"_mini_label_street2")) {
1243
+ l_id_removed[parseInt(l_id_array[z]) + 1] = false;
1244
+ }
1245
+ if (document.getElementById(l_id+"_mini_label_city")) {
1246
+ l_id_removed[parseInt(l_id_array[z]) + 2] = false;
1247
+ }
1248
+ if (document.getElementById(l_id+"_mini_label_state")) {
1249
+ l_id_removed[parseInt(l_id_array[z]) + 3] = false;
1250
+ }
1251
+ if (document.getElementById(l_id+"_mini_label_postal")) {
1252
+ l_id_removed[parseInt(l_id_array[z]) + 4] = false;
1253
+ }
1254
+ if (document.getElementById(l_id+"_mini_label_country")) {
1255
+ l_id_removed[parseInt(l_id_array[z]) + 5] = false;
1256
+ }
1257
+ z = z + 5;
1258
+ }
1259
+ else {
1260
+ l_id_removed[l_id] = false;
1261
+ }
1262
+ }
1263
+ }
1264
+ if (tr.getAttribute('type')=="type_address") {
1265
+ addr_id=parseInt(tr.id);
1266
+ id_for_country= addr_id;
1267
+ if(document.getElementById(id_for_country+"_mini_label_street1"))
1268
+ tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_street1").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#';addr_id++;
1269
+ if(document.getElementById(id_for_country+"_mini_label_street2"))
1270
+ tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_street2").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#';addr_id++;
1271
+ if(document.getElementById(id_for_country+"_mini_label_city"))
1272
+ tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_city").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
1273
+ if(document.getElementById(id_for_country+"_mini_label_state"))
1274
+ tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_state").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
1275
+ if(document.getElementById(id_for_country+"_mini_label_postal"))
1276
+ tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_postal").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#'; addr_id++;
1277
+ if(document.getElementById(id_for_country+"_mini_label_country"))
1278
+ tox=tox+addr_id+'#**id**#'+document.getElementById(id_for_country+"_mini_label_country").innerHTML+'#**label**#'+tr.getAttribute('type')+'#****#';
1279
+ }
1280
+ else {
1281
+ tox = tox+l_id+'#**id**#'+l_label+'#**label**#'+l_type+'#****#';
1282
+ }
1283
+ }
1284
+ }
1285
+ }
1286
+ }
1287
+ }
1288
+ }
1289
+ }
1290
+ document.getElementById('label_order_current').value = tox;
1291
+ for (x = 0; x < l_id_array.length; x++) {
1292
+ if (l_id_removed[l_id_array[x]]) {
1293
+ tox = tox + l_id_array[x] + '#**id**#' + l_label_array[x] + '#**label**#' + l_type_array[x] + '#****#';
1294
+ }
1295
+ }
1296
+ document.getElementById('label_order').value = tox;
1297
+ refresh_old();
1298
+ document.getElementById('pagination').value=document.getElementById('pages').getAttribute("type");
1299
+ document.getElementById('show_title').value=document.getElementById('pages').getAttribute("show_title");
1300
+ document.getElementById('show_numbers').value=document.getElementById('pages').getAttribute("show_numbers");
1301
+ return true;
1302
+ }
1303
+
1304
+ gen = <?php echo (($id != 0) ? $row->counter : 1); ?>;
1305
+
1306
+ function enable() {
1307
+ for (iiiii = 0; iiiii < 1000; iiiii++) {
1308
+ if (document.getElementsByTagName("iframe")[iiiii]) {
1309
+ if (document.getElementsByTagName("iframe")[iiiii].id == 'form_maker_editor_ifr') {
1310
+ id_ifr_editor = iiiii;
1311
+ break;
1312
+ }
1313
+ }
1314
+ }
1315
+ alltypes = Array('customHTML', 'text', 'checkbox', 'radio', 'time_and_date', 'select', 'file_upload', 'captcha', 'map', 'button', 'page_break', 'section_break', 'paypal', 'survey');
1316
+ for (x = 0; x < 14; x++) {
1317
+ document.getElementById('img_' + alltypes[x]).src = "<?php echo WD_FM_URL . '/images/'; ?>" + alltypes[x] + ".png";
1318
+ }
1319
+ if (document.getElementById('formMakerDiv').style.display == 'block') {
1320
+ jQuery('#formMakerDiv').slideToggle(200);
1321
+ }
1322
+ else {
1323
+ jQuery('#formMakerDiv').slideToggle(400);
1324
+ }
1325
+ if (document.getElementById('formMakerDiv').offsetWidth) {
1326
+ document.getElementById('formMakerDiv1').style.width = (document.getElementById('formMakerDiv').offsetWidth - 60) + 'px';
1327
+ }
1328
+ if (document.getElementById('formMakerDiv1').style.display == 'block') {
1329
+ jQuery('#formMakerDiv1').slideToggle(200);
1330
+ }
1331
+ else {
1332
+ jQuery('#formMakerDiv1').slideToggle(400);
1333
+ }
1334
+ document.getElementById('when_edit').style.display = 'none';
1335
+ }
1336
+
1337
+ function enable2() {
1338
+ alltypes = Array('customHTML', 'text', 'checkbox', 'radio', 'time_and_date', 'select', 'file_upload', 'captcha', 'map', 'button', 'page_break', 'section_break', 'paypal', 'survey');
1339
+ for (x = 0; x < 14; x++) {
1340
+ document.getElementById('img_' + alltypes[x]).src = "<?php echo WD_FM_URL . '/images/'; ?>" + alltypes[x] + ".png";
1341
+ }
1342
+ if (document.getElementById('formMakerDiv').style.display == 'block') {
1343
+ jQuery('#formMakerDiv').slideToggle(200);
1344
+ }
1345
+ else {
1346
+ jQuery('#formMakerDiv').slideToggle(400);
1347
+ }
1348
+ if (document.getElementById('formMakerDiv').offsetWidth) {
1349
+ document.getElementById('formMakerDiv1').style.width = (document.getElementById('formMakerDiv').offsetWidth - 60) + 'px';
1350
+ }
1351
+ if (document.getElementById('formMakerDiv1').style.display == 'block') {
1352
+ jQuery('#formMakerDiv1').slideToggle(200);
1353
+ }
1354
+ else {
1355
+ jQuery('#formMakerDiv1').slideToggle(400);
1356
+ }
1357
+ document.getElementById('when_edit').style.display = 'block';
1358
+ if (document.getElementById('field_types').offsetWidth) {
1359
+ document.getElementById('when_edit').style.width = document.getElementById('field_types').offsetWidth + 'px';
1360
+ }
1361
+ if (document.getElementById('field_types').offsetHeight) {
1362
+ document.getElementById('when_edit').style.height = document.getElementById('field_types').offsetHeight + 'px';
1363
+ }
1364
+ }
1365
+ </script>
1366
+ <div style="clear: both; float: left; width: 99%;">
1367
+ <div style="float:left; font-size: 14px; font-weight: bold;">
1368
+ This section allows you to add fields to your form.
1369
+ <a style="color: blue; text-decoration: none;" target="_blank" href="http://web-dorado.com/wordpress-form-maker-guide-4.html">Read More in User Manual</a>
1370
+ </div>
1371
+ <div style="float: right; text-align: right;">
1372
+ <a style="text-decoration: none;" target="_blank" href="http://web-dorado.com/products/wordpress-form.html">
1373
+ <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FM_URL . '/images/wd_logo.png'; ?>" />
1374
+ </a>
1375
+ </div>
1376
+ </div>
1377
+ <form class="wrap" id="manage_form" method="post" action="admin.php?page=manage_fm" style="float: left; width: 99%;">
1378
+ <h2><?php echo $page_title; ?></h2>
1379
+ <div style="float: right; margin: 0 5px 0 0;">
1380
+ <a href="<?php echo add_query_arg(array('action' => 'FormMakerPreview', 'id' => $row->theme, 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>" class="button-primary thickbox thickbox-preview" id="preview_form" title="Form Preview" onclick="return false;">
1381
+ Preview
1382
+ </a>
1383
+ <input class="button-primary" type="submit" onclick="if (spider_check_required('title', 'Form title') || !submitbutton()) {return false;}; spider_set_input_value('task', 'form_options_old');" value="Form options"/>
1384
+ <?php
1385
+ if ($id) {
1386
+ ?>
1387
+ <input class="button-secondary" type="submit" onclick="if (spider_check_required('title', 'Form title') || !submitbutton()) {return false;}; spider_set_input_value('task', 'save_as_copy_old')" value="Save as Copy"/>
1388
+ <?php
1389
+ }
1390
+ ?>
1391
+ <input class="button-secondary" type="submit" onclick="if (spider_check_required('title', 'Form title') || !submitbutton()) {return false;}; spider_set_input_value('task', 'save_old')" value="Save"/>
1392
+ <input class="button-secondary" type="submit" onclick="if (spider_check_required('title', 'Form title') || !submitbutton()) {return false;}; spider_set_input_value('task', 'apply_old')" value="Apply"/>
1393
+ <input class="button-secondary" type="submit" onclick="spider_set_input_value('task', 'cancel')" value="Cancel"/>
1394
+ </div>
1395
+
1396
+ <div class="formmaker_table" width="100%">
1397
+ <div style="float: left; text-align: center;"><br />
1398
+ <img src="<?php echo WD_FM_URL . '/images/FormMaker.png'; ?>" /><br /><br />
1399
+ <img src="<?php echo WD_FM_URL . '/images/logo.png'; ?>" />
1400
+ </div>
1401
+ <div style="float:right">
1402
+ <span style="font-size: 16.76pt; font-family: tahoma; color: #FFFFFF; vertical-align: middle;">Form title:&nbsp;&nbsp;</span>
1403
+ <input id="title" name="title" class="form_maker_title" value="<?php echo $row->title; ?>"/>
1404
+ <br />
1405
+ <img src="<?php echo WD_FM_URL . '/images/formoptions.png'; ?>" onclick="if (spider_check_required('title', 'Form title')) {return false;}; submitbutton(); spider_set_input_value('task', 'form_options_old'); spider_form_submit(event, 'manage_form');" style="cursor: pointer; margin: 10px 0 10px 10px; float: right;"/>
1406
+ <br /><br /><br />
1407
+ <img src="<?php echo WD_FM_URL . '/images/addanewfield.png'; ?>" onclick="enable(); Enable()" style="cursor: pointer; margin:10px 0 10px 10px; float: right;"/>
1408
+ </div>
1409
+ </div>
1410
+
1411
+ <div id="formMakerDiv" onclick="close_window()"></div>
1412
+ <div id="formMakerDiv1" style="padding-top: 20px;" align="center">
1413
+ <table border="0" width="100%" cellpadding="0" cellspacing="0" height="100%" style="border: 6px #00aeef solid; background-color: #FFF;">
1414
+ <tr>
1415
+ <td style="padding:0px">
1416
+ <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
1417
+ <tr valign="top">
1418
+ <td width="15%" height="100%" style="border-right: dotted black 1px;" id="field_types">
1419
+ <div id="when_edit" style="display: none;"></div>
1420
+ <table border="0" cellpadding="0" cellspacing="3" width="100%">
1421
+ <tr>
1422
+ <td align="center" onClick="addRow('customHTML')" style="cursor:pointer" id="table_editor" class="field_buttons">
1423
+ <img src="<?php echo WD_FM_URL . '/images/customHTML.png'; ?>" style="margin:5px" id="img_customHTML"/>
1424
+ </td>
1425
+ <td align="center" onClick="addRow('text')" style="cursor:pointer" id="table_text" class="field_buttons">
1426
+ <img src="<?php echo WD_FM_URL . '/images/text.png'; ?>" style="margin:5px" id="img_text"/>
1427
+ </td>
1428
+ </tr>
1429
+ <tr>
1430
+ <td align="center" onClick="addRow('time_and_date')" style="cursor:pointer" id="table_time_and_date" class="field_buttons">
1431
+ <img src="<?php echo WD_FM_URL . '/images/time_and_date.png'; ?>" style="margin:5px" id="img_time_and_date"/>
1432
+ </td>
1433
+ <td align="center" onClick="addRow('select')" style="cursor:pointer" id="table_select" class="field_buttons">
1434
+ <img src="<?php echo WD_FM_URL . '/images/select.png'; ?>" style="margin:5px" id="img_select"/>
1435
+ </td>
1436
+ </tr>
1437
+ <tr>
1438
+ <td align="center" onClick="addRow('checkbox')" style="cursor:pointer" id="table_checkbox" class="field_buttons">
1439
+ <img src="<?php echo WD_FM_URL . '/images/checkbox.png'; ?>" style="margin:5px" id="img_checkbox"/>
1440
+ </td>
1441
+ <td align="center" onClick="addRow('radio')" style="cursor:pointer" id="table_radio" class="field_buttons">
1442
+ <img src="<?php echo WD_FM_URL . '/images/radio.png'; ?>" style="margin:5px" id="img_radio"/>
1443
+ </td>
1444
+ </tr>
1445
+ <tr>
1446
+ <td align="center" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" id="table_file_upload" class="field_buttons"
1447
+ onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')">
1448
+ <img src="<?php echo WD_FM_URL . '/images/file_upload.png'; ?>" style="margin:5px" id="img_file_upload" />
1449
+ </td>
1450
+ <td align="center" onClick="addRow('captcha')" style="cursor:pointer" id="table_captcha" class="field_buttons">
1451
+ <img src="<?php echo WD_FM_URL . '/images/captcha.png'; ?>" style="margin:5px" id="img_captcha"/>
1452
+ </td>
1453
+ </tr>
1454
+ <tr>
1455
+ <td align="center" onClick="addRow('page_break')" style="cursor:pointer" id="table_page_break" class="field_buttons">
1456
+ <img src="<?php echo WD_FM_URL . '/images/page_break.png'; ?>" style="margin:5px" id="img_page_break"/>
1457
+ </td>
1458
+ <td align="center" onClick="addRow('section_break')" style="cursor:pointer" id="table_section_break" class="field_buttons">
1459
+ <img src="<?php echo WD_FM_URL . '/images/section_break.png'; ?>" style="margin:5px" id="img_section_break"/>
1460
+ </td>
1461
+ </tr>
1462
+ <tr>
1463
+ <td align="center" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" id="table_map" class="field_buttons"
1464
+ onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')">
1465
+ <img src="<?php echo WD_FM_URL . '/images/map.png'; ?>" style="margin:5px" id="img_map" />
1466
+ </td>
1467
+ <td align="center" style="cursor: pointer; background-color: rgb(114, 113, 113) !important;" id="table_paypal" class="field_buttons"
1468
+ onClick="alert('This field type is disabled in free version. If you need this functionality, you need to buy the commercial version.')">
1469
+ <img src="<?php echo WD_FM_URL . '/images/paypal.png'; ?>" style="margin:5px" id="img_paypal" />
1470
+ </td>
1471
+ </tr>
1472
+ <tr>
1473
+ <td align="center" onClick="addRow('survey')" class="field_buttons" id="table_survey">
1474
+ <img src="<?php echo WD_FM_URL . '/images/survey.png'; ?>" style="margin:5px" id="img_survey"/>
1475
+ </td>
1476
+ <td align="center" onClick="addRow('button')" id="table_button" class="field_buttons">
1477
+ <img src="<?php echo WD_FM_URL . '/images/button.png'; ?>" style="margin:5px" id="img_button"/>
1478
+ </td>
1479
+ </tr>
1480
+ </table>
1481
+ </td>
1482
+ <td width="35%" height="100%" align="left">
1483
+ <div id="edit_table" style="padding:0px; overflow-y:scroll; height:575px"></div>
1484
+ </td>
1485
+ <td align="center" valign="top" style="background: url("<?php echo WD_FM_URL . '/images/border2.png'; ?>") repeat-y;">&nbsp;</td>
1486
+ <td style="padding:15px">
1487
+ <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
1488
+ <tr>
1489
+ <td align="right">
1490
+ <input type="radio" value="end" name="el_pos" checked="checked" id="pos_end" onclick="Disable()"/>
1491
+ At The End
1492
+ <input type="radio" value="begin" name="el_pos" id="pos_begin" onclick="Disable()"/>
1493
+ At The Beginning
1494
+ <input type="radio" value="before" name="el_pos" id="pos_before" onclick="Enable()"/>
1495
+ Before
1496
+ <select style="width: 100px; margin-left: 5px;" id="sel_el_pos" disabled="disabled"></select>
1497
+ <img alt="ADD" title="add" style="cursor:pointer; vertical-align:middle; margin:5px" src="<?php echo WD_FM_URL . '/images/save.png'; ?>" onClick="add(0)"/>
1498
+ <img alt="CANCEL" title="cancel" style="cursor: pointer; vertical-align:middle; margin:5px" src="<?php echo WD_FM_URL . '/images/cancel_but.png'; ?>" onClick="close_window()"/>
1499
+ <hr style=" margin-bottom:10px" />
1500
+ </td>
1501
+ </tr>
1502
+ <tr height="100%" valign="top">
1503
+ <td id="show_table"></td>
1504
+ </tr>
1505
+ </table>
1506
+ </td>
1507
+ </tr>
1508
+ </table>
1509
+ </td>
1510
+ </tr>
1511
+ </table>
1512
+ <input type="hidden" id="old" />
1513
+ <input type="hidden" id="old_selected" />
1514
+ <input type="hidden" id="element_type" />
1515
+ <input type="hidden" id="editing_id" />
1516
+ <input type="hidden" value="<?php echo WD_FM_URL; ?>" id="form_plugins_url" />
1517
+ <div id="main_editor" style="position: absolute; display: none; z-index: 140;">
1518
+ <?php
1519
+ if (user_can_richedit()) {
1520
+ wp_editor('', 'form_maker_editor', array('teeny' => FALSE, 'textarea_name' => 'form_maker_editor', 'media_buttons' => FALSE, 'textarea_rows' => 5));
1521
+ }
1522
+ else {
1523
+ ?>
1524
+ <textarea cols="36" rows="5" id="form_maker_editor" name="form_maker_editor" style="width: 440px; height: 350px; resize: vertical;" class="mce_editable" aria-hidden="true"></textarea>
1525
+ <?php
1526
+ }
1527
+ ?>
1528
+ </div>
1529
+ </div>
1530
+ <?php
1531
+ if (!function_exists('the_editor')) {
1532
+ ?>
1533
+ <iframe id="tinymce" style="display: none;"></iframe>
1534
+ <?php
1535
+ }
1536
+ ?>
1537
+ <br /><br />
1538
+ <fieldset>
1539
+ <legend><h2 style="color: #00aeef;">Form</h2></legend>
1540
+ <table width="100%" style="margin:8px">
1541
+ <tr id="page_navigation">
1542
+ <td align="center" width="90%" id="pages" show_title="<?php echo $row->show_title; ?>" show_numbers="<?php echo $row->show_numbers; ?>" type="<?php echo $row->pagination; ?>"></td>
1543
+ <td align="left" id="edit_page_navigation"></td>
1544
+ </tr>
1545
+ </table>
1546
+ <div id="take">
1547
+ <?php
1548
+ if ($row->form) {
1549
+ echo $row->form;
1550
+ }
1551
+ else {
1552
+ ?>
1553
+ <table border="0" cellpadding="4" cellspacing="0" class="wdform_table1" style="width: 100%;">
1554
+ <tbody id="form_id_tempform_view1" class="wdform_tbody1" page_title="Untitled page" next_title="Next" next_type="button" next_class="wdform_page_button" next_checkable="false" previous_title="Previous" previous_type="button" previous_class="wdform_page_button" previous_checkable="false">
1555
+ <tr class="wdform_tr1">
1556
+ <td class="wdform_td1" >
1557
+ <table class="wdform_table2">
1558
+ <tbody class="wdform_tbody2"></tbody>
1559
+ </table>
1560
+ </td>
1561
+ </tr>
1562
+ <tr class="wdform_footer">
1563
+ <td colspan="100" valign="top">
1564
+ <table width="100%" style="padding-right:170px"><tbody><tr id="form_id_temppage_nav1"></tr></tbody></table>
1565
+ </td>
1566
+ </tr>
1567
+ <tbody id="form_id_tempform_view_img1" style="float: right !important;" >
1568
+ <tr>
1569
+ <td width="0%"></td>
1570
+ <td align="right">
1571
+ <img src="<?php echo WD_FM_URL . '/images/minus.png'; ?>" title="Show or hide the page" class="page_toolbar" onclick="show_or_hide('1')" onmouseover="chnage_icons_src(this,'minus')" onmouseout="chnage_icons_src(this,'minus')" id="show_page_img_1" />
1572
+ </td>
1573
+ <td>
1574
+ <img src="<?php echo WD_FM_URL . '/images/page_delete.png'; ?>" title="Delete the page" class="page_toolbar" onclick="remove_page('1')" onmouseover="chnage_icons_src(this,'page_delete')" onmouseout="chnage_icons_src(this,'page_delete')" />
1575
+ </td>
1576
+ <td>
1577
+ <img src="<?php echo WD_FM_URL . '/images/page_delete_all.png'; ?>" title="Delete the page with fields" class="page_toolbar" onclick="remove_page_all('1')" onmouseover="chnage_icons_src(this,'page_delete_all')" onmouseout="chnage_icons_src(this,'page_delete_all')" />
1578
+ </td>
1579
+ <td>
1580
+ <img src="<?php echo WD_FM_URL . '/images/page_edit.png'; ?>" title="Edit the page" class="page_toolbar" onclick="edit_page_break('1')" onmouseover="chnage_icons_src(this,'page_edit')" onmouseout="chnage_icons_src(this,'page_edit')" />
1581
+ </td>
1582
+ </tr>
1583
+ </tbody>
1584
+ </table>
1585
+ <?php
1586
+ }
1587
+ ?>
1588
+ </div>
1589
+ </fieldset>
1590
+ <input type="hidden" name="form" id="form" />
1591
+ <input type="hidden" name="form_front" id="form_front" />
1592
+ <input type="hidden" name="pagination" id="pagination" />
1593
+ <input type="hidden" name="show_title" id="show_title" />
1594
+ <input type="hidden" name="show_numbers" id="show_numbers" />
1595
+ <input type="hidden" name="public_key" id="public_key" />
1596
+ <input type="hidden" name="private_key" id="private_key" />
1597
+ <input type="hidden" name="recaptcha_theme" id="recaptcha_theme" />
1598
+ <input type="hidden" id="label_order" name="label_order" value="<?php echo $row->label_order; ?>" />
1599
+ <input type="hidden" id="label_order_current" name="label_order_current" value="<?php echo $row->label_order_current; ?>" />
1600
+ <input type="hidden" name="counter" id="counter" value="<?php echo $row->counter; ?>" />
1601
+ <input type="hidden" id="araqel" value="0" />
1602
+ <script type="text/javascript">
1603
+ form_view = 1;
1604
+ form_view_count = 1;
1605
+ form_view_max = 1;
1606
+ function formOnload() {
1607
+ // Enable maps.
1608
+ for (t = 0; t < <?php echo $row->counter;?>; t++)
1609
+ if (document.getElementById(t+"_typeform_id_temp")) {
1610
+ if (document.getElementById(t+"_typeform_id_temp").value=="type_map" || document.getElementById(t+"_typeform_id_temp").value=="type_mark_map") {
1611
+ if_gmap_init(t);
1612
+ for (q = 0; q < 20; q++) {
1613
+ if (document.getElementById(t+"_elementform_id_temp").getAttribute("long"+q)) {
1614
+ w_long=parseFloat(document.getElementById(t+"_elementform_id_temp").getAttribute("long"+q));
1615
+ w_lat=parseFloat(document.getElementById(t+"_elementform_id_temp").getAttribute("lat"+q));
1616
+ w_info=parseFloat(document.getElementById(t+"_elementform_id_temp").getAttribute("info"+q));
1617
+ add_marker_on_map(t,q, w_long, w_lat, w_info, false);
1618
+ }
1619
+ }
1620
+ }
1621
+ else
1622
+ if (document.getElementById(t+"_typeform_id_temp").value == "type_date") {
1623
+ // Calendar.setup({
1624
+ // inputField: t+"_elementform_id_temp",
1625
+ // ifFormat: document.getElementById(t+"_buttonform_id_temp").getAttribute('format'),
1626
+ // button: t+"_buttonform_id_temp",
1627
+ // align: "Tl",
1628
+ // singleClick: true,
1629
+ // firstDay: 0
1630
+ // });
1631
+ }
1632
+ else
1633
+ if(document.getElementById(t+"_typeform_id_temp").value=="type_spinner") {
1634
+ var spinner_value = jQuery("#" + t + "_elementform_id_temp").get( "aria-valuenow" );
1635
+ var spinner_min_value = document.getElementById(t+"_min_valueform_id_temp").value;
1636
+ var spinner_max_value = document.getElementById(t+"_max_valueform_id_temp").value;
1637
+ var spinner_step = document.getElementById(t+"_stepform_id_temp").value;
1638
+
1639
+ jQuery( "#"+t+"_elementform_id_temp" ).removeClass( "ui-spinner-input" )
1640
+ .prop( "disabled", false )
1641
+ .removeAttr( "autocomplete" )
1642
+ .removeAttr( "role" )
1643
+ .removeAttr( "aria-valuemin" )
1644
+ .removeAttr( "aria-valuemax" )
1645
+ .removeAttr( "aria-valuenow" );
1646
+
1647
+ span_ui= document.getElementById(t+"_elementform_id_temp").parentNode;
1648
+ span_ui.parentNode.appendChild(document.getElementById(t+"_elementform_id_temp"));
1649
+ span_ui.parentNode.removeChild(span_ui);
1650
+
1651
+ jQuery("#"+t+"_elementform_id_temp")[0].spin = null;
1652
+
1653
+ spinner = jQuery( "#"+t+"_elementform_id_temp" ).spinner();
1654
+ spinner.spinner( "value", spinner_value );
1655
+ jQuery( "#"+t+"_elementform_id_temp" ).spinner({ min: spinner_min_value});
1656
+ jQuery( "#"+t+"_elementform_id_temp" ).spinner({ max: spinner_max_value});
1657
+ jQuery( "#"+t+"_elementform_id_temp" ).spinner({ step: spinner_step});
1658
+
1659
+ }
1660
+ else
1661
+ if(document.getElementById(t+"_typeform_id_temp").value=="type_slider") {
1662
+
1663
+ var slider_value = document.getElementById(t+"_slider_valueform_id_temp").value;
1664
+ var slider_min_value = document.getElementById(t+"_slider_min_valueform_id_temp").value;
1665
+ var slider_max_value = document.getElementById(t+"_slider_max_valueform_id_temp").value;
1666
+
1667
+ var slider_element_value = document.getElementById( t+"_element_valueform_id_temp" );
1668
+ var slider_value_save = document.getElementById( t+"_slider_valueform_id_temp" );
1669
+
1670
+ document.getElementById(t+"_elementform_id_temp").innerHTML = "";
1671
+ document.getElementById(t+"_elementform_id_temp").removeAttribute( "class" );
1672
+ document.getElementById(t+"_elementform_id_temp").removeAttribute( "aria-disabled" );
1673
+
1674
+ jQuery("#"+t+"_elementform_id_temp")[0].slide = null;
1675
+
1676
+ jQuery(function() {
1677
+ jQuery( "#"+t+"_elementform_id_temp").slider({
1678
+ range: "min",
1679
+ value: eval(slider_value),
1680
+ min: eval(slider_min_value),
1681
+ max: eval(slider_max_value),
1682
+ slide: function( event, ui ) {
1683
+ slider_element_value.innerHTML = "" + ui.value ;
1684
+ slider_value_save.value = "" + ui.value;
1685
+
1686
+ }
1687
+ });
1688
+
1689
+
1690
+ });
1691
+
1692
+
1693
+ }
1694
+ else
1695
+ if(document.getElementById(t+"_typeform_id_temp").value=="type_range"){
1696
+ var spinner_value0 = jQuery("#" + t+"_elementform_id_temp0").get( "aria-valuenow" );
1697
+ var spinner_step = document.getElementById(t+"_range_stepform_id_temp").value;
1698
+
1699
+ jQuery( "#"+t+"_elementform_id_temp0" ).removeClass( "ui-spinner-input" )
1700
+ .prop( "disabled", false )
1701
+ .removeAttr( "autocomplete" )
1702
+ .removeAttr( "role" )
1703
+ .removeAttr( "aria-valuenow" );
1704
+
1705
+ span_ui= document.getElementById(t+"_elementform_id_temp0").parentNode;
1706
+ span_ui.parentNode.appendChild(document.getElementById(t+"_elementform_id_temp0"));
1707
+ span_ui.parentNode.removeChild(span_ui);
1708
+
1709
+
1710
+ jQuery("#"+t+"_elementform_id_temp0")[0].spin = null;
1711
+ jQuery("#"+t+"_elementform_id_temp1")[0].spin = null;
1712
+
1713
+ spinner0 = jQuery( "#"+t+"_elementform_id_temp0" ).spinner();
1714
+ spinner0.spinner( "value", spinner_value0 );
1715
+ jQuery( "#"+t+"_elementform_id_temp0" ).spinner({ step: spinner_step});
1716
+
1717
+
1718
+
1719
+ var spinner_value1 = jQuery("#" + t+"_elementform_id_temp1").get( "aria-valuenow" );
1720
+
1721
+ jQuery( "#"+t+"_elementform_id_temp1" ).removeClass( "ui-spinner-input" )
1722
+ .prop( "disabled", false )
1723
+ .removeAttr( "autocomplete" )
1724
+ .removeAttr( "role" )
1725
+ .removeAttr( "aria-valuenow" );
1726
+
1727
+ span_ui1= document.getElementById(t+"_elementform_id_temp1").parentNode;
1728
+ span_ui1.parentNode.appendChild(document.getElementById(t+"_elementform_id_temp1"));
1729
+ span_ui1.parentNode.removeChild(span_ui1);
1730
+
1731
+ spinner1 = jQuery( "#"+t+"_elementform_id_temp1" ).spinner();
1732
+ spinner1.spinner( "value", spinner_value1 );
1733
+ jQuery( "#"+t+"_elementform_id_temp1" ).spinner({ step: spinner_step});
1734
+
1735
+ var myu = t;
1736
+ jQuery(document).ready(function() {
1737
+
1738
+ jQuery("#"+myu+"_mini_label_from").click(function() {
1739
+ if (jQuery(this).children('input').length == 0) {
1740
+ var from = "<input type='text' id='from' class='from' size='6' style='outline:none; border:none; background:none; font-size:11px;' value=\""+jQuery(this).text()+"\">";
1741
+ jQuery(this).html(from);
1742
+ jQuery("input.from").focus();
1743
+ jQuery("input.from").blur(function() {
1744
+ var id_for_blur = document.getElementById('from').parentNode.id.split('_');
1745
+ var value = jQuery(this).val();
1746
+ jQuery("#"+id_for_blur[0]+"_mini_label_from").text(value);
1747
+ });
1748
+ }
1749
+ });
1750
+
1751
+ jQuery("label#"+myu+"_mini_label_to").click(function() {
1752
+ if (jQuery(this).children('input').length == 0) {
1753
+
1754
+ var to = "<input type='text' id='to' class='to' size='6' style='outline:none; border:none; background:none; font-size:11px;' value=\""+jQuery(this).text()+"\">";
1755
+ jQuery(this).html(to);
1756
+ jQuery("input.to").focus();
1757
+ jQuery("input.to").blur(function() {
1758
+ var id_for_blur = document.getElementById('to').parentNode.id.split('_');
1759
+ var value = jQuery(this).val();
1760
+
1761
+ jQuery("#"+id_for_blur[0]+"_mini_label_to").text(value);
1762
+ });
1763
+
1764
+ }
1765
+ });
1766
+
1767
+
1768
+
1769
+ });
1770
+ }
1771
+
1772
+ else
1773
+ if(document.getElementById(t+"_typeform_id_temp").value=="type_name"){
1774
+ var myu = t;
1775
+ jQuery(document).ready(function() {
1776
+
1777
+ jQuery("#"+myu+"_mini_label_first").click(function() {
1778
+
1779
+ if (jQuery(this).children('input').length == 0) {
1780
+
1781
+ var first = "<input type='text' id='first' class='first' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1782
+ jQuery(this).html(first);
1783
+ jQuery("input.first").focus();
1784
+ jQuery("input.first").blur(function() {
1785
+
1786
+ var id_for_blur = document.getElementById('first').parentNode.id.split('_');
1787
+ var value = jQuery(this).val();
1788
+ jQuery("#"+id_for_blur[0]+"_mini_label_first").text(value);
1789
+ });
1790
+ }
1791
+ });
1792
+
1793
+ jQuery("label#"+myu+"_mini_label_last").click(function() {
1794
+ if (jQuery(this).children('input').length == 0) {
1795
+
1796
+ var last = "<input type='text' id='last' class='last' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1797
+ jQuery(this).html(last);
1798
+ jQuery("input.last").focus();
1799
+ jQuery("input.last").blur(function() {
1800
+ var id_for_blur = document.getElementById('last').parentNode.id.split('_');
1801
+ var value = jQuery(this).val();
1802
+
1803
+ jQuery("#"+id_for_blur[0]+"_mini_label_last").text(value);
1804
+ });
1805
+
1806
+ }
1807
+ });
1808
+
1809
+ jQuery("label#"+myu+"_mini_label_title").click(function() {
1810
+ if (jQuery(this).children('input').length == 0) {
1811
+ var title = "<input type='text' id='title' class='title' size='10' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1812
+ jQuery(this).html(title);
1813
+ jQuery("input.title").focus();
1814
+ jQuery("input.title").blur(function() {
1815
+ var id_for_blur = document.getElementById('title').parentNode.id.split('_');
1816
+ var value = jQuery(this).val();
1817
+
1818
+
1819
+ jQuery("#"+id_for_blur[0]+"_mini_label_title").text(value);
1820
+ });
1821
+ }
1822
+
1823
+ });
1824
+
1825
+
1826
+ jQuery("label#"+myu+"_mini_label_middle").click(function() {
1827
+ if (jQuery(this).children('input').length == 0) {
1828
+ var middle = "<input type='text' id='middle' class='middle' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1829
+ jQuery(this).html(middle);
1830
+ jQuery("input.middle").focus();
1831
+ jQuery("input.middle").blur(function() {
1832
+ var id_for_blur = document.getElementById('middle').parentNode.id.split('_');
1833
+ var value = jQuery(this).val();
1834
+
1835
+ jQuery("#"+id_for_blur[0]+"_mini_label_middle").text(value);
1836
+ });
1837
+ }
1838
+ });
1839
+
1840
+ });
1841
+ }
1842
+ else
1843
+ if(document.getElementById(t+"_typeform_id_temp").value=="type_address"){
1844
+ var myu = t;
1845
+
1846
+ jQuery(document).ready(function() {
1847
+ jQuery("label#"+myu+"_mini_label_street1").click(function() {
1848
+
1849
+ if (jQuery(this).children('input').length == 0) {
1850
+ var street1 = "<input type='text' id='street1' class='street1' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1851
+ jQuery(this).html(street1);
1852
+ jQuery("input.street1").focus();
1853
+ jQuery("input.street1").blur(function() {
1854
+ var id_for_blur = document.getElementById('street1').parentNode.id.split('_');
1855
+ var value = jQuery(this).val();
1856
+ jQuery("#"+id_for_blur[0]+"_mini_label_street1").text(value);
1857
+ });
1858
+ }
1859
+ });
1860
+
1861
+ jQuery("label#"+myu+"_mini_label_street2").click(function() {
1862
+ if (jQuery(this).children('input').length == 0) {
1863
+ var street2 = "<input type='text' id='street2' class='street2' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1864
+ jQuery(this).html(street2);
1865
+ jQuery("input.street2").focus();
1866
+ jQuery("input.street2").blur(function() {
1867
+ var id_for_blur = document.getElementById('street2').parentNode.id.split('_');
1868
+ var value = jQuery(this).val();
1869
+ jQuery("#"+id_for_blur[0]+"_mini_label_street2").text(value);
1870
+ });
1871
+ }
1872
+ });
1873
+
1874
+
1875
+ jQuery("label#"+myu+"_mini_label_city").click(function() {
1876
+ if (jQuery(this).children('input').length == 0) {
1877
+ var city = "<input type='text' id='city' class='city' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1878
+ jQuery(this).html(city);
1879
+ jQuery("input.city").focus();
1880
+ jQuery("input.city").blur(function() {
1881
+ var id_for_blur = document.getElementById('city').parentNode.id.split('_');
1882
+ var value = jQuery(this).val();
1883
+ jQuery("#"+id_for_blur[0]+"_mini_label_city").text(value);
1884
+ });
1885
+ }
1886
+ });
1887
+
1888
+ jQuery("label#"+myu+"_mini_label_state").click(function() {
1889
+ if (jQuery(this).children('input').length == 0) {
1890
+ var state = "<input type='text' id='state' class='state' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1891
+ jQuery(this).html(state);
1892
+ jQuery("input.state").focus();
1893
+ jQuery("input.state").blur(function() {
1894
+ var id_for_blur = document.getElementById('state').parentNode.id.split('_');
1895
+ var value = jQuery(this).val();
1896
+ jQuery("#"+id_for_blur[0]+"_mini_label_state").text(value);
1897
+ });
1898
+ }
1899
+ });
1900
+
1901
+ jQuery("label#"+myu+"_mini_label_postal").click(function() {
1902
+ if (jQuery(this).children('input').length == 0) {
1903
+ var postal = "<input type='text' id='postal' class='postal' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1904
+ jQuery(this).html(postal);
1905
+ jQuery("input.postal").focus();
1906
+ jQuery("input.postal").blur(function() {
1907
+ var id_for_blur = document.getElementById('postal').parentNode.id.split('_');
1908
+ var value = jQuery(this).val();
1909
+ jQuery("#"+id_for_blur[0]+"_mini_label_postal").text(value);
1910
+ });
1911
+ }
1912
+ });
1913
+
1914
+
1915
+ jQuery("label#"+myu+"_mini_label_country").click(function() {
1916
+ if (jQuery(this).children('input').length == 0) {
1917
+ var country = "<input type='country' id='country' class='country' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1918
+ jQuery(this).html(country);
1919
+ jQuery("input.country").focus();
1920
+ jQuery("input.country").blur(function() {
1921
+ var id_for_blur = document.getElementById('country').parentNode.id.split('_');
1922
+ var value = jQuery(this).val();
1923
+ jQuery("#"+id_for_blur[0]+"_mini_label_country").text(value);
1924
+ });
1925
+ }
1926
+ });
1927
+ });
1928
+
1929
+ }
1930
+ else
1931
+ if(document.getElementById(t+"_typeform_id_temp").value=="type_phone"){
1932
+ var myu = t;
1933
+
1934
+ jQuery(document).ready(function() {
1935
+ jQuery("label#"+myu+"_mini_label_area_code").click(function() {
1936
+ if (jQuery(this).children('input').length == 0) {
1937
+
1938
+ var area_code = "<input type='text' id='area_code' class='area_code' size='10' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1939
+
1940
+ jQuery(this).html(area_code);
1941
+ jQuery("input.area_code").focus();
1942
+ jQuery("input.area_code").blur(function() {
1943
+ var id_for_blur = document.getElementById('area_code').parentNode.id.split('_');
1944
+ var value = jQuery(this).val();
1945
+ jQuery("#"+id_for_blur[0]+"_mini_label_area_code").text(value);
1946
+ });
1947
+ }
1948
+ });
1949
+
1950
+
1951
+ jQuery("label#"+myu+"_mini_label_phone_number").click(function() {
1952
+
1953
+ if (jQuery(this).children('input').length == 0) {
1954
+ var phone_number = "<input type='text' id='phone_number' class='phone_number' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1955
+
1956
+ jQuery(this).html(phone_number);
1957
+
1958
+ jQuery("input.phone_number").focus();
1959
+ jQuery("input.phone_number").blur(function() {
1960
+ var id_for_blur = document.getElementById('phone_number').parentNode.id.split('_');
1961
+ var value = jQuery(this).val();
1962
+ jQuery("#"+id_for_blur[0]+"_mini_label_phone_number").text(value);
1963
+ });
1964
+ }
1965
+ });
1966
+
1967
+ });
1968
+ }
1969
+ else
1970
+ if(document.getElementById(t+"_typeform_id_temp").value=="type_date_fields"){
1971
+ var myu = t;
1972
+
1973
+ jQuery(document).ready(function() {
1974
+ jQuery("label#"+myu+"_day_label").click(function() {
1975
+ if (jQuery(this).children('input').length == 0) {
1976
+ var day = "<input type='text' id='day' class='day' size='8' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1977
+ jQuery(this).html(day);
1978
+ jQuery("input.day").focus();
1979
+ jQuery("input.day").blur(function() {
1980
+ var id_for_blur = document.getElementById('day').parentNode.id.split('_');
1981
+ var value = jQuery(this).val();
1982
+
1983
+ jQuery("#"+id_for_blur[0]+"_day_label").text(value);
1984
+ });
1985
+ }
1986
+ });
1987
+
1988
+
1989
+ jQuery("label#"+myu+"_month_label").click(function() {
1990
+ if (jQuery(this).children('input').length == 0) {
1991
+ var month = "<input type='text' id='month' class='month' size='8' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
1992
+ jQuery(this).html(month);
1993
+ jQuery("input.month").focus();
1994
+ jQuery("input.month").blur(function() {
1995
+ var id_for_blur = document.getElementById('month').parentNode.id.split('_');
1996
+ var value = jQuery(this).val();
1997
+
1998
+ jQuery("#"+id_for_blur[0]+"_month_label").text(value);
1999
+ });
2000
+ }
2001
+ });
2002
+
2003
+ jQuery("label#"+myu+"_year_label").click(function() {
2004
+ if (jQuery(this).children('input').length == 0) {
2005
+ var year = "<input type='text' id='year' class='year' size='8' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2006
+ jQuery(this).html(year);
2007
+ jQuery("input.year").focus();
2008
+ jQuery("input.year").blur(function() {
2009
+ var id_for_blur = document.getElementById('year').parentNode.id.split('_');
2010
+ var value = jQuery(this).val();
2011
+
2012
+ jQuery("#"+id_for_blur[0]+"_year_label").text(value);
2013
+ });
2014
+ }
2015
+ });
2016
+
2017
+ });
2018
+
2019
+
2020
+ }
2021
+ else
2022
+ if(document.getElementById(t+"_typeform_id_temp").value=="type_time"){
2023
+ var myu = t;
2024
+
2025
+ jQuery(document).ready(function() {
2026
+ jQuery("label#"+myu+"_mini_label_hh").click(function() {
2027
+ if (jQuery(this).children('input').length == 0) {
2028
+ var hh = "<input type='text' id='hh' class='hh' size='4' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2029
+ jQuery(this).html(hh);
2030
+ jQuery("input.hh").focus();
2031
+ jQuery("input.hh").blur(function() {
2032
+ var id_for_blur = document.getElementById('hh').parentNode.id.split('_');
2033
+ var value = jQuery(this).val();
2034
+
2035
+
2036
+ jQuery("#"+id_for_blur[0]+"_mini_label_hh").text(value);
2037
+ });
2038
+ }
2039
+ });
2040
+
2041
+
2042
+ jQuery("label#"+myu+"_mini_label_mm").click(function() {
2043
+ if (jQuery(this).children('input').length == 0) {
2044
+ var mm = "<input type='text' id='mm' class='mm' size='4' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2045
+ jQuery(this).html(mm);
2046
+ jQuery("input.mm").focus();
2047
+ jQuery("input.mm").blur(function() {
2048
+ var id_for_blur = document.getElementById('mm').parentNode.id.split('_');
2049
+ var value = jQuery(this).val();
2050
+
2051
+ jQuery("#"+id_for_blur[0]+"_mini_label_mm").text(value);
2052
+ });
2053
+ }
2054
+ });
2055
+
2056
+ jQuery("label#"+myu+"_mini_label_ss").click(function() {
2057
+ if (jQuery(this).children('input').length == 0) {
2058
+ var ss = "<input type='text' id='ss' class='ss' size='4' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2059
+ jQuery(this).html(ss);
2060
+ jQuery("input.ss").focus();
2061
+ jQuery("input.ss").blur(function() {
2062
+ var id_for_blur = document.getElementById('ss').parentNode.id.split('_');
2063
+ var value = jQuery(this).val();
2064
+
2065
+ jQuery("#"+id_for_blur[0]+"_mini_label_ss").text(value);
2066
+ });
2067
+ }
2068
+ });
2069
+
2070
+ jQuery("label#"+myu+"_mini_label_am_pm").click(function() {
2071
+ if (jQuery(this).children('input').length == 0) {
2072
+ var am_pm = "<input type='text' id='am_pm' class='am_pm' size='4' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2073
+ jQuery(this).html(am_pm);
2074
+ jQuery("input.am_pm").focus();
2075
+ jQuery("input.am_pm").blur(function() {
2076
+ var id_for_blur = document.getElementById('am_pm').parentNode.id.split('_');
2077
+ var value = jQuery(this).val();
2078
+
2079
+ jQuery("#"+id_for_blur[0]+"_mini_label_am_pm").text(value);
2080
+ });
2081
+ }
2082
+ });
2083
+ });
2084
+
2085
+ }
2086
+
2087
+ else
2088
+ if(document.getElementById(t+"_typeform_id_temp").value=="type_paypal_price"){
2089
+ var myu = t;
2090
+ jQuery(document).ready(function() {
2091
+
2092
+ jQuery("#"+myu+"_mini_label_dollars").click(function() {
2093
+
2094
+ if (jQuery(this).children('input').length == 0) {
2095
+
2096
+ var dollars = "<input type='text' id='dollars' class='dollars' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2097
+ jQuery(this).html(dollars);
2098
+ jQuery("input.dollars").focus();
2099
+ jQuery("input.dollars").blur(function() {
2100
+
2101
+ var id_for_blur = document.getElementById('dollars').parentNode.id.split('_');
2102
+ var value = jQuery(this).val();
2103
+ jQuery("#"+id_for_blur[0]+"_mini_label_dollars").text(value);
2104
+ });
2105
+ }
2106
+ });
2107
+
2108
+ jQuery("label#"+myu+"_mini_label_cents").click(function() {
2109
+ if (jQuery(this).children('input').length == 0) {
2110
+
2111
+ var cents = "<input type='text' id='cents' class='cents' style='outline:none; border:none; background:none;' value=\""+jQuery(this).text()+"\">";
2112
+ jQuery(this).html(cents);
2113
+ jQuery("input.cents").focus();
2114
+ jQuery("input.cents").blur(function() {
2115
+ var id_for_blur = document.getElementById('cents').parentNode.id.split('_');
2116
+ var value = jQuery(this).val();
2117
+
2118
+ jQuery("#"+id_for_blur[0]+"_mini_label_cents").text(value);
2119
+ });
2120
+
2121
+ }
2122
+ });
2123
+ });
2124
+ }
2125
+ else
2126
+ if(document.getElementById(t+"_typeform_id_temp").value=="type_scale_rating"){
2127
+ var myu = t;
2128
+ jQuery(document).ready(function() {
2129
+
2130
+ jQuery("#"+myu+"_mini_label_worst").click(function() {
2131
+
2132
+ if (jQuery(this).children('input').length == 0) {
2133
+
2134
+ var worst = "<input type='text' id='worst' class='worst' size='6' style='outline:none; border:none; background:none; font-size:11px;' value=\""+jQuery(this).text()+"\">";
2135
+ jQuery(this).html(worst);
2136
+ jQuery("input.worst").focus();
2137
+ jQuery("input.worst").blur(function() {
2138
+
2139
+ var id_for_blur = document.getElementById('worst').parentNode.id.split('_');
2140
+ var value = jQuery(this).val();
2141
+ jQuery("#"+id_for_blur[0]+"_mini_label_worst").text(value);
2142
+ });
2143
+ }
2144
+ });
2145
+
2146
+ jQuery("label#"+myu+"_mini_label_best").click(function() {
2147
+ if (jQuery(this).children('input').length == 0) {
2148
+
2149
+ var best = "<input type='text' id='best' class='best' size='6' style='outline:none; border:none; background:none; font-size:11px;' value=\""+jQuery(this).text()+"\">";
2150
+ jQuery(this).html(best);
2151
+ jQuery("input.best").focus();
2152
+ jQuery("input.best").blur(function() {
2153
+ var id_for_blur = document.getElementById('best').parentNode.id.split('_');
2154
+ var value = jQuery(this).val();
2155
+
2156
+ jQuery("#"+id_for_blur[0]+"_mini_label_best").text(value);
2157
+ });
2158
+
2159
+ }
2160
+ });
2161
+
2162
+
2163
+
2164
+ });
2165
+ }
2166
+ }
2167
+ form_view = 1;
2168
+ form_view_count = 0;
2169
+ for (i = 1; i <= 30; i++) {
2170
+ if (document.getElementById('form_id_tempform_view'+i)) {
2171
+ form_view_count++;
2172
+ form_view_max=i;
2173
+ }
2174
+ }
2175
+ if (form_view_count > 1) {
2176
+ for (i=1; i<=form_view_max; i++) {
2177
+ if (document.getElementById('form_id_tempform_view'+i)) {
2178
+ first_form_view=i;
2179
+ break;
2180
+ }
2181
+ }
2182
+ form_view=form_view_max;
2183
+ generate_page_nav(first_form_view);
2184
+ var img_EDIT = document.createElement("img");
2185
+ img_EDIT.setAttribute("src", "<?php echo WD_FM_URL . '/images/edit.png'; ?>");
2186
+ img_EDIT.style.cssText = "margin-left:40px; cursor:pointer";
2187
+ img_EDIT.setAttribute("onclick", 'el_page_navigation()');
2188
+ var td_EDIT = document.getElementById("edit_page_navigation");
2189
+ td_EDIT.appendChild(img_EDIT);
2190
+ document.getElementById('page_navigation').appendChild(td_EDIT);
2191
+ }
2192
+ //if(document.getElementById('take').innerHTML.indexOf('up_row(')==-1) location.reload(true);
2193
+ //else
2194
+
2195
+ document.getElementById('form').value=document.getElementById('take').innerHTML;
2196
+ document.getElementById('araqel').value = 1;
2197
+ }
2198
+ function formAddToOnload() {
2199
+ if (formOldFunctionOnLoad) {
2200
+ formOldFunctionOnLoad();
2201
+ }
2202
+ formOnload();
2203
+ }
2204
+ function formLoadBody() {
2205
+ formOldFunctionOnLoad = window.onload;
2206
+ window.onload = formAddToOnload;
2207
+ }
2208
+ var formOldFunctionOnLoad = null;
2209
+ formLoadBody();
2210
+ </script>
2211
+
2212
+ <input type="hidden" name="option" value="com_formmaker" />
2213
+ <input type="hidden" name="id" value="<?php echo $row->id; ?>" />
2214
+ <input type="hidden" name="cid[]" value="<?php echo $row->id; ?>" />
2215
+
2216
+ <input type="hidden" id="task" name="task" value=""/>
2217
+ <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
2218
+ </form>
2219
+ <script>
2220
+ jQuery(window).load(function() {
2221
+ spider_popup();
2222
+ });
2223
+ </script>
2224
+ <?php
2225
+ }
2226
+
2227
+ public function form_options_old($id) {
2228
+ $row = $this->model->get_row_data($id);
2229
+ $themes = $this->model->get_theme_rows_data('_old');
2230
+ $page_title = $row->title . ' form options';
2231
+ $label_id = array();
2232
+ $label_label = array();
2233
+ $label_type = array();
2234
+ $label_all = explode('#****#', $row->label_order_current);
2235
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
2236
+ foreach ($label_all as $key => $label_each) {
2237
+ $label_id_each = explode('#**id**#', $label_each);
2238
+ array_push($label_id, $label_id_each[0]);
2239
+ $label_order_each = explode('#**label**#', $label_id_each[1]);
2240
+ array_push($label_label, $label_order_each[0]);
2241
+ array_push($label_type, $label_order_each[1]);
2242
+ }
2243
+ ?>
2244
+ <script>
2245
+ gen = "<?php echo $row->counter; ?>";
2246
+ form_view_max = 20;
2247
+ function set_preview() {
2248
+ document.getElementById('preview_form').href = '<?php echo add_query_arg(array('action' => 'FormMakerPreview', 'form_id' => $row->id), admin_url('admin-ajax.php')); ?>&id='+document.getElementById('theme').value+'&width=1000&height=500&TB_iframe=1';
2249
+ }
2250
+ </script>
2251
+ <div style="clear: both; float: left; width: 99%;">
2252
+ <div style="float:left; font-size: 14px; font-weight: bold;">
2253
+ This section allows you to edit form options.
2254
+ <a style="color: blue; text-decoration: none;" target="_blank" href="http://web-dorado.com/wordpress-form-maker-guide-3.html">Read More in User Manual</a>
2255
+ </div>
2256
+ <div style="float: right; text-align: right;">
2257
+ <a style="text-decoration: none;" target="_blank" href="http://web-dorado.com/products/wordpress-form.html">
2258
+ <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FM_URL . '/images/wd_logo.png'; ?>" />
2259
+ </a>
2260
+ </div>
2261
+ </div>
2262
+ <form class="wrap" method="post" action="admin.php?page=manage_fm" style="float: left; width: 99%;" name="adminForm" id="adminForm">
2263
+ <h2><?php echo $page_title; ?></h2>
2264
+ <div style="float: right; margin: 0 5px 0 0;">
2265
+ <input class="button-secondary" type="submit" onclick="if (spider_check_email('mail') ||
2266
+ spider_check_email('from_mail') ||
2267
+ spider_check_email('paypal_email')) {return false;}; spider_set_input_value('task', 'save_options_old')" value="Save"/>
2268
+ <input class="button-secondary" type="submit" onclick="if (spider_check_email('mail') ||
2269
+ spider_check_email('from_mail') ||
2270
+ spider_check_email('paypal_email')) {return false;}; spider_set_input_value('task', 'apply_options_old')" value="Apply"/>
2271
+ <input class="button-secondary" type="submit" onclick="spider_set_input_value('task', 'cancel_options_old')" value="Cancel"/>
2272
+ </div>
2273
+ <input type="hidden" name="take" id="take" value="<?php $row->form ?>">
2274
+ <div class="submenu-box" style="width: 99%; float: left; margin: 15px 0 0 0;">
2275
+ <div class="submenu-pad">
2276
+ <ul id="submenu" class="configuration">
2277
+ <li>
2278
+ <a id="general" class="fm_fieldset_tab" onclick="form_maker_options_tabs('general')" href="#">General Options</a>
2279
+ </li>
2280
+ <li>
2281
+ <a id="actions" class="fm_fieldset_tab" onclick="form_maker_options_tabs('actions')" href="#">Actions after Submission</a>
2282
+ </li>
2283
+ <li>
2284
+ <a id="payment" class="fm_fieldset_tab" onclick="form_maker_options_tabs('payment')" href="#">Payment Options</a>
2285
+ </li>
2286
+ <li>
2287
+ <a id="javascript" class="fm_fieldset_tab" onclick="form_maker_options_tabs('javascript')" href="#">JavaScript</a>
2288
+ </li>
2289
+ <li>
2290
+ <a id="custom" class="fm_fieldset_tab" onclick="form_maker_options_tabs('custom')" href="#">Custom Text in Email</a>
2291
+ </li>
2292
+ </ul>
2293
+ </div>
2294
+ </div>
2295
+ <fieldset id="actions_fieldset" class="adminform fm_fieldset_deactive">
2296
+ <legend style="color:#0B55C4;font-weight: bold;">Actions after submission</legend>
2297
+ <table class="admintable">
2298
+ <tr valign="top">
2299
+ <td class="fm_options_label">
2300
+ <label>Action type</label>
2301
+ </td>
2302
+ <td class="fm_options_value">
2303
+ <div><input type="radio" name="submit_text_type" id="text_type_none" onclick="set_type('none')" value="1" <?php echo ($row->submit_text_type != 2 && $row->submit_text_type != 3 && $row->submit_text_type != 4 && $row->submit_text_type != 5) ? "checked" : ""; ?> /><label for="text_type_none">Stay on Form</label></div>
2304
+ <div><input type="radio" name="submit_text_type" id="text_type_post" onclick="set_type('post')" value="2" <?php echo ($row->submit_text_type == 2) ? "checked" : ""; ?> /><label for="text_type_post">Post</label></label></div>
2305
+ <div><input type="radio" name="submit_text_type" id="text_type_page" onclick="set_type('page')" value="5" <?php echo ($row->submit_text_type == 5) ? "checked" : ""; ?> /><label for="text_type_page">Page</label></label></div>
2306
+ <div><input type="radio" name="submit_text_type" id="text_type_custom_text" onclick="set_type('custom_text')" value="3" <?php echo ($row->submit_text_type == 3 ) ? "checked" : ""; ?> /><label for="text_type_custom_text">Custom Text</label></label></div>
2307
+ <div><input type="radio" name="submit_text_type" id="text_type_url" onclick="set_type('url')" value="4" <?php echo ($row->submit_text_type == 4) ? "checked" : ""; ?> /><label for="text_type_url">URL</div>
2308
+ </td>
2309
+ </tr>
2310
+ <tr id="none" <?php echo (($row->submit_text_type == 2 || $row->submit_text_type == 3 || $row->submit_text_type == 4 || $row->submit_text_type == 5) ? 'style="display:none"' : ''); ?>>
2311
+ <td class="fm_options_label">
2312
+ <label>Stay on Form</label>
2313
+ </td>
2314
+ <td class="fm_options_value">
2315
+ <img src="<?php echo WD_FM_URL . '/images/tick.png'; ?>" border="0">
2316
+ </td>
2317
+ </tr>
2318
+ <tr id="post" <?php echo (($row->submit_text_type != 2) ? 'style="display:none"' : ''); ?>>
2319
+ <td class="fm_options_label">
2320
+ <label for="post_name">Post</label>
2321
+ </td>
2322
+ <td class="fm_options_value">
2323
+ <select id="post_name" name="post_name" style="width: 153px; font-size: 11px;">
2324
+ <option value="0">- Select Post -</option>
2325
+ <?php
2326
+ // The Query.
2327
+ $args = array('posts_per_page' => 10000);
2328
+ query_posts($args);
2329
+ // The Loop.
2330
+ while (have_posts()) : the_post(); ?>
2331
+ <option value="<?php $x = get_permalink(get_the_ID()); echo $x; ?>" <?php echo (($row->article_id == $x) ? 'selected="selected"' : ''); ?>><?php the_title(); ?></option>
2332
+ <?php
2333
+ endwhile;
2334
+ // Reset Query.
2335
+ wp_reset_query();
2336
+ ?>
2337
+ </select>
2338
+ </td>
2339
+ </tr>
2340
+ <tr id="page" <?php echo (($row->submit_text_type != 5) ? 'style="display:none"' : ''); ?>>
2341
+ <td class="fm_options_label">
2342
+ <label for="page_name">Page</label>
2343
+ </td>
2344
+ <td class="fm_options_value">
2345
+ <select id="page_name" name="page_name" style="width:153px; font-size:11px;">
2346
+ <option value="0">- Select Page -</option>
2347
+ <?php
2348
+ // The Query.
2349
+ $pages = get_pages();
2350
+ // The Loop.
2351
+ foreach ($pages as $page) {
2352
+ $page_id = get_page_link($page->ID);
2353
+ ?>
2354
+ <option value="<?php echo $page_id; ?>" <?php echo (($row->article_id == $page_id) ? 'selected="selected"' : ''); ?>><?php echo $page->post_title; ?></option>
2355
+ <?php
2356
+ }
2357
+ // Reset Query.
2358
+ wp_reset_query();
2359
+ ?>
2360
+ </select>
2361
+ </td>
2362
+ </tr>
2363
+ <tr id="custom_text" <?php echo (($row->submit_text_type != 3) ? 'style="display: none;"' : ''); ?>>
2364
+ <td class="fm_options_label">
2365
+ <label for="submit_text">Text</label>
2366
+ </td>
2367
+ <td class="fm_options_value">
2368
+ <?php
2369
+ if (user_can_richedit()) {
2370
+ wp_editor($row->submit_text, 'submit_text', array('teeny' => FALSE, 'textarea_name' => 'submit_text', 'media_buttons' => FALSE, 'textarea_rows' => 5));
2371
+ }
2372
+ else {
2373
+ ?>
2374
+ <textarea cols="36" rows="5" id="submit_text" name="submit_text" style="resize: vertical;">
2375
+ <?php echo $row->submit_text; ?>
2376
+ </textarea>
2377
+ <?php
2378
+ }
2379
+ ?>
2380
+ </td>
2381
+ </tr>
2382
+ <tr id="url" <?php echo (($row->submit_text_type != 4 ) ? 'style="display:none"' : ''); ?>>
2383
+ <td class="fm_options_label">
2384
+ <label for="url">URL</label>
2385
+ </td>
2386
+ <td class="fm_options_value">
2387
+ <input type="text" id="url" name="url" style="width:300px" value="<?php echo $row->url; ?>" />
2388
+ </td>
2389
+ </tr>
2390
+ </table>
2391
+ </fieldset>
2392
+ <fieldset id="custom_fieldset" class="adminform fm_fieldset_deactive">
2393
+ <legend style="color:#0B55C4;font-weight: bold;">Custom text in email</legend>
2394
+ <table class="admintable">
2395
+ <tr>
2396
+ <td class="fm_options_label" valign="top">
2397
+ <label>For Administrator</label>
2398
+ </td>
2399
+ <td class="fm_options_value">
2400
+ <div style="margin-bottom:5px">
2401
+ <?php
2402
+ $choise = "document.getElementById('script_mail')";
2403
+ for ($i = 0; $i < count($label_label); $i++) {
2404
+ if ($label_type[$i] == "type_submit_reset" || $label_type[$i] == "type_editor" || $label_type[$i] == "type_map" || $label_type[$i] == "type_mark_map" || $label_type[$i] == "type_captcha" || $label_type[$i] == "type_recaptcha" || $label_type[$i] == "type_button") {
2405
+ continue;
2406
+ }
2407
+ $param = htmlspecialchars(addslashes($label_label[$i]));
2408
+ ?>
2409
+ <input style="border: 1px solid silver; font-size: 10px;" type="button" value="<?php echo htmlspecialchars(addslashes($label_label[$i])); ?>" onClick="insertAtCursor(<?php echo $choise; ?>, '<?php echo $param; ?>')" />
2410
+ <?php
2411
+ }
2412
+ ?>
2413
+ <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="All fields list" onClick="insertAtCursor(<?php echo $choise; ?>, 'all')" />
2414
+ </div>
2415
+ <?php
2416
+ if (user_can_richedit()) {
2417
+ wp_editor($row->script_mail, 'script_mail', array('teeny' => FALSE, 'textarea_name' => 'script_mail', 'media_buttons' => FALSE, 'textarea_rows' => 5));
2418
+ }
2419
+ else {
2420
+ ?>
2421
+ <textarea name="script_mail" id="script_mail" cols="20" rows="10" style="width:300px; height:450px;"><?php echo $row->script_mail; ?></textarea>
2422
+ <?php
2423
+ }
2424
+ ?>
2425
+ </td>
2426
+ </tr>
2427
+ <tr>
2428
+ <td valign="top" height="30"></td>
2429
+ <td valign="top"></td>
2430
+ </tr>
2431
+ <tr>
2432
+ <td class="fm_options_label" valign="top">
2433
+ <label>For User</label>
2434
+ </td>
2435
+ <td class="fm_options_value">
2436
+ <div style="margin-bottom:5px">
2437
+ <?php
2438
+ $choise = "document.getElementById('script_mail_user')";
2439
+ for ($i = 0; $i < count($label_label); $i++) {
2440
+ if ($label_type[$i] == "type_submit_reset" || $label_type[$i] == "type_editor" || $label_type[$i] == "type_map" || $label_type[$i] == "type_mark_map" || $label_type[$i] == "type_captcha" || $label_type[$i] == "type_recaptcha" || $label_type[$i] == "type_button") {
2441
+ continue;
2442
+ }
2443
+ $param = htmlspecialchars(addslashes($label_label[$i]));
2444
+ ?>
2445
+ <input style="border: 1px solid silver; font-size: 10px;" type="button" value="<?php echo htmlspecialchars(addslashes($label_label[$i])); ?>" onClick="insertAtCursor(<?php echo $choise; ?>, '<?php echo $param; ?>')" />
2446
+ <?php
2447
+ }
2448
+ ?>
2449
+ <input style="border: 1px solid silver; font-size: 10px; margin:3px;" type="button" value="All fields list" onClick="insertAtCursor(<?php echo $choise; ?>, 'all')" />
2450
+ </div>
2451
+ <?php
2452
+ if (user_can_richedit()) {
2453
+ wp_editor($row->script_mail_user, 'script_mail_user', array('teeny' => FALSE, 'textarea_name' => 'script_mail_user', 'media_buttons' => FALSE, 'textarea_rows' => 5));
2454
+ }
2455
+ else {
2456
+ ?>
2457
+ <textarea name="script_mail_user" id="script_mail_user" cols="20" rows="10" style="width:300px; height:450px;"><?php echo $row->script_mail_user; ?></textarea>
2458
+ <?php
2459
+ }
2460
+ ?>
2461
+ </td>
2462
+ </tr>
2463
+ </table>
2464
+ </fieldset>
2465
+ <fieldset id="general_fieldset" class="adminform fm_fieldset_deactive">
2466
+ <legend style="color:#0B55C4;font-weight: bold;">General Options</legend>
2467
+ <table class="admintable" style="float:left">
2468
+ <tr valign="top">
2469
+ <td class="fm_options_label">
2470
+ <label for="mail">Email to send submissions to</label>
2471
+ </td>
2472
+ <td class="fm_options_value">
2473
+ <input id="mail" name="mail" value="<?php echo $row->mail; ?>" style="width:250px;" />
2474
+ </td>
2475
+ </tr>
2476
+ <tr valign="top">
2477
+ <td class="fm_options_label">
2478
+ <label for="from_mail">From Email</label>
2479
+ </td>
2480
+ <td class="fm_options_value">
2481
+ <input id="from_mail" name="from_mail" value="<?php echo $row->from_mail; ?>" style="width:250px;" />
2482
+ </td>
2483
+ </tr>
2484
+ <tr valign="top">
2485
+ <td class="fm_options_label">
2486
+ <label for="from_name">From Name</label>
2487
+ </td>
2488
+ <td class="fm_options_value">
2489
+ <input id="from_name" name="from_name" value="<?php echo $row->from_name; ?>" style="width:250px;"/>
2490
+ </td>
2491
+ </tr>
2492
+ <tr valign="top">
2493
+ <td class="fm_options_label">
2494
+ <label for="theme">Theme</label>
2495
+ </td>
2496
+ <td class="fm_options_value">
2497
+ <select id="theme" name="theme" style="width:260px;" onChange="set_preview()">
2498
+ <?php
2499
+ foreach ($themes as $theme) {
2500
+ ?>
2501
+ <option value="<?php echo $theme->id; ?>" <?php echo (($theme->id == $row->theme) ? 'selected' : ''); ?>><?php echo $theme->title; ?></option>
2502
+ <?php
2503
+ }
2504
+ ?>
2505
+ </select>
2506
+ <a href="<?php echo add_query_arg(array('action' => 'FormMakerPreview', 'id' => $row->theme, 'form_id' => $row->id, 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>" class="button-primary thickbox thickbox-preview" id="preview_form" title="Form Preview" onclick="return false;">
2507
+ Preview
2508
+ </a>
2509
+ </td>
2510
+ </tr>
2511
+ </table>
2512
+ </fieldset>
2513
+ <fieldset id="payment_fieldset" class="adminform fm_fieldset_deactive">
2514
+ <legend style="color:#0B55C4;font-weight: bold;">Payment Options</legend>
2515
+ <table class="admintable">
2516
+ <tr>
2517
+ <td colspan="2">
2518
+ <div class="error" style="padding: 5px; font-size: 14px;">Paypal Options are disabled in free version.</div>
2519
+ </td>
2520
+ </tr>
2521
+ <tr valign="top">
2522
+ <td class="fm_options_label">
2523
+ <label>Turn Paypal On</label>
2524
+ </td>
2525
+ <td class="fm_options_value">
2526
+ <div><input disabled="disabled" type="radio" name="paypal_mode" id="paypal_mode1" value="1" <?php echo ($row->paypal_mode == "1") ? "checked" : ""; ?> /><label for="paypal_mode1">On</label></div>
2527
+ <div><input disabled="disabled" type="radio" name="paypal_mode" id="paypal_mode2" value="0" <?php echo ($row->paypal_mode != "1") ? "checked" : ""; ?> /><label for="paypal_mode2">Off</label></div>
2528
+ </td>
2529
+ </tr>
2530
+ <tr valign="top">
2531
+ <td class="fm_options_label">
2532
+ <label>Checkout Mode</label>
2533
+ </td>
2534
+ <td class="fm_options_value">
2535
+ <div><input disabled="disabled" type="radio" name="checkout_mode" id="checkout_mode1" value="production" <?php echo ($row->checkout_mode == "production") ? "checked" : ""; ?> /><label for="checkout_mode1">Production</label></div>
2536
+ <div><input disabled="disabled" type="radio" name="checkout_mode" id="checkout_mode2" value="testmode" <?php echo ($row->checkout_mode != "production") ? "checked" : ""; ?> /><label for="checkout_mode2">Testmode</label></div>
2537
+ </td>
2538
+ </tr>
2539
+ <tr valign="top">
2540
+ <td class="fm_options_label">
2541
+ <label for="paypal_email">Paypal email</label>
2542
+ </td>
2543
+ <td class="fm_options_value">
2544
+ <input disabled="disabled" type="text" name="paypal_email" id="paypal_email" value="<?php echo $row->paypal_email; ?>" class="text_area" style="width:250px">
2545
+ </td>
2546
+ </tr>
2547
+ <tr valign="top">
2548
+ <td class="fm_options_label">
2549
+ <label for="payment_currency">Payment Currency</label>
2550
+ </td>
2551
+ <td class="fm_options_value">
2552
+ <select disabled="disabled" id="payment_currency" name="payment_currency" style="width:253px">
2553
+ <option value="USD" <?php echo (($row->payment_currency == 'USD') ? 'selected' : ''); ?>>$ &#8226; U.S. Dollar</option>
2554
+ <option value="EUR" <?php echo (($row->payment_currency == 'EUR') ? 'selected' : ''); ?>>&#8364; &#8226; Euro</option>
2555
+ <option value="GBP" <?php echo (($row->payment_currency == 'GBP') ? 'selected' : ''); ?>>&#163; &#8226; Pound Sterling</option>
2556
+ <option value="JPY" <?php echo (($row->payment_currency == 'JPY') ? 'selected' : ''); ?>>&#165; &#8226; Japanese Yen</option>
2557
+ <option value="CAD" <?php echo (($row->payment_currency == 'CAD') ? 'selected' : ''); ?>>C$ &#8226; Canadian Dollar</option>
2558
+ <option value="MXN" <?php echo (($row->payment_currency == 'MXN') ? 'selected' : ''); ?>>Mex$ &#8226; Mexican Peso</option>
2559
+ <option value="HKD" <?php echo (($row->payment_currency == 'HKD') ? 'selected' : ''); ?>>HK$ &#8226; Hong Kong Dollar</option>
2560
+ <option value="HUF" <?php echo (($row->payment_currency == 'HUF') ? 'selected' : ''); ?>>Ft &#8226; Hungarian Forint</option>
2561
+ <option value="NOK" <?php echo (($row->payment_currency == 'NOK') ? 'selected' : ''); ?>>kr &#8226; Norwegian Kroner</option>
2562
+ <option value="NZD" <?php echo (($row->payment_currency == 'NZD') ? 'selected' : ''); ?>>NZ$ &#8226; New Zealand Dollar</option>
2563
+ <option value="SGD" <?php echo (($row->payment_currency == 'SGD') ? 'selected' : ''); ?>>S$ &#8226; Singapore Dollar</option>
2564
+ <option value="SEK" <?php echo (($row->payment_currency == 'SEK') ? 'selected' : ''); ?>>kr &#8226; Swedish Kronor</option>
2565
+ <option value="PLN" <?php echo (($row->payment_currency == 'PLN') ? 'selected' : ''); ?>>zl &#8226; Polish Zloty</option>
2566
+ <option value="AUD" <?php echo (($row->payment_currency == 'AUD') ? 'selected' : ''); ?>>A$ &#8226; Australian Dollar</option>
2567
+ <option value="DKK" <?php echo (($row->payment_currency == 'DKK') ? 'selected' : ''); ?>>kr &#8226; Danish Kroner</option>
2568
+ <option value="CHF" <?php echo (($row->payment_currency == 'CHF') ? 'selected' : ''); ?>>CHF &#8226; Swiss Francs</option>
2569
+ <option value="CZK" <?php echo (($row->payment_currency == 'CZK') ? 'selected' : ''); ?>>Kc &#8226; Czech Koruny</option>
2570
+ <option value="ILS" <?php echo (($row->payment_currency == 'ILS') ? 'selected' : ''); ?>>&#8362; &#8226; Israeli Sheqel</option>
2571
+ <option value="BRL" <?php echo (($row->payment_currency == 'BRL') ? 'selected' : ''); ?>>R$ &#8226; Brazilian Real</option>
2572
+ <option value="TWD" <?php echo (($row->payment_currency == 'TWD') ? 'selected' : ''); ?>>NT$ &#8226; Taiwan New Dollars</option>
2573
+ <option value="MYR" <?php echo (($row->payment_currency == 'MYR') ? 'selected' : ''); ?>>RM &#8226; Malaysian Ringgit</option>
2574
+ <option value="PHP" <?php echo (($row->payment_currency == 'PHP') ? 'selected' : ''); ?>>&#8369; &#8226; Philippine Peso</option>
2575
+ <option value="THB" <?php echo (($row->payment_currency == 'THB') ? 'selected' : ''); ?>>&#xe3f; &#8226; Thai Bahtv</option>
2576
+ </select>
2577
+ </td>
2578
+ </tr>
2579
+ <tr valign="top">
2580
+ <td class="fm_options_label">
2581
+ <label for="tax">Tax</label>
2582
+ </td>
2583
+ <td class="fm_options_value">
2584
+ <input disabled="disabled" type="text" name="tax" id="tax" value="<?php echo $row->tax; ?>" class="text_area" style="width:30px" onKeyPress="return check_isnum(event)"> %
2585
+ </td>
2586
+ </tr>
2587
+ </table>
2588
+ </fieldset>
2589
+ <fieldset id="javascript_fieldset" class="adminform fm_fieldset_deactive">
2590
+ <legend style="color:#0B55C4;font-weight: bold;">JavaScript</legend>
2591
+ <table class="admintable">
2592
+ <tr valign="top">
2593
+ <td class="fm_options_label">
2594
+ <label for="javascript">Javascript</label>
2595
+ </td>
2596
+ <td class="fm_options_value">
2597
+ <textarea style="margin: 0px;" cols="60" rows="30" name="javascript" id="javascript"><?php echo $row->javascript; ?></textarea>
2598
+ </td>
2599
+ </tr>
2600
+ </table>
2601
+ </fieldset>
2602
+ <input type="hidden" name="fieldset_id" id="fieldset_id" value="<?php echo WDW_FM_Library::get('fieldset_id', 'general'); ?>" />
2603
+ <input type="hidden" id="task" name="task" value=""/>
2604
+ <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
2605
+ </form>
2606
+ <script>
2607
+ jQuery(window).load(function () {
2608
+ form_maker_options_tabs(jQuery("#fieldset_id").val());
2609
+ spider_popup();
2610
+ });
2611
+ </script>
2612
+ <?php
2613
+ }
2614
+
2615
+ public function form_options($id) {
2616
+ $row = $this->model->get_row_data($id);
2617
+ $themes = $this->model->get_theme_rows_data();
2618
+ $page_title = $row->title . ' form options';
2619
+ $label_id = array();
2620
+ $label_label = array();
2621
+ $label_type = array();
2622
+ $label_all = explode('#****#', $row->label_order_current);
2623
+ $label_all = array_slice($label_all, 0, count($label_all) - 1);
2624
+ foreach ($label_all as $key => $label_each) {
2625
+ $label_id_each = explode('#**id**#', $label_each);
2626
+ array_push($label_id, $label_id_each[0]);
2627
+ $label_order_each = explode('#**label**#', $label_id_each[1]);
2628
+ array_push($label_label, $label_order_each[0]);
2629
+ array_push($label_type, $label_order_each[1]);
2630
+ }
2631
+ $fields = explode('*:*id*:*type_submitter_mail*:*type*:*', $row->form_fields);
2632
+ $fields_count = count($fields);
2633
+ ?>
2634
+ <script>
2635
+ gen = "<?php echo $row->counter; ?>";
2636
+ form_view_max = 20;
2637
+ function set_preview() {
2638
+ jQuery("#preview_form").attr("href", '<?php echo add_query_arg(array('action' => 'FormMakerPreview', 'form_id' => $row->id), admin_url('admin-ajax.php')); ?>&test_theme=' + jQuery("#theme").val() + '&width=1000&height=500&TB_iframe=1');
2639
+ jQuery("#edit_css").attr("href", '<?php echo add_query_arg(array('action' => 'FormMakerEditCSS', 'form_id' => $row->id), admin_url('admin-ajax.php')); ?>&id=' + jQuery("#theme").val() + '&width=800&height=500&TB_iframe=1');
2640
+ }
2641
+ </script>
2642
+ <div style="clear: both; float: left; width: 99%;">
2643
+ <div style="float:left; font-size: 14px; font-weight: bold;">
2644
+ This section allows you to edit form options.
2645
+ <a style="color: blue; text-decoration: none;" target="_blank" href="http://web-dorado.com/wordpress-form-maker-guide-3.html">Read More in User Manual</a>
2646
+ </div>
2647
+ <div style="float: right; text-align: right;">
2648
+ <a style="text-decoration: none;" target="_blank" href="http://web-dorado.com/products/wordpress-form.html">
2649
+ <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FM_URL . '/images/wd_logo.png'; ?>" />
2650
+ </a>
2651
+ </div>
2652
+ </div>
2653
+ <form class="wrap" method="post" action="admin.php?page=manage_fm" style="float: left; width: 99%;" name="adminForm" id="adminForm">
2654
+ <h2><?php echo $page_title; ?></h2>
2655
+ <div style="float: right; margin: 0 5px 0 0;">
2656
+ <input class="button-secondary" type="submit" onclick="if (spider_check_email('mail') ||
2657
+ spider_check_email('from_mail') ||
2658
+ spider_check_email('reply_to') ||
2659
+ spider_check_email('mail_from_user') ||
2660
+ spider_check_email('reply_to_user') ||
2661
+ spider_check_email('mail_from_other') ||
2662
+ spider_check_email('reply_to_other') ||
2663
+ spider_check_email('paypal_email')) {return false;}; spider_set_input_value('task', 'save_options')" value="Save"/>
2664
+ <input class="button-secondary" type="submit" onclick="if (spider_check_email('mail') ||
2665
+ spider_check_email('from_mail') ||
2666
+ spider_check_email('reply_to') ||
2667
+ spider_check_email('mail_from_user') ||
2668
+ spider_check_email('reply_to_user') ||
2669
+ spider_check_email('mail_from_other') ||
2670
+ spider_check_email('reply_to_other') ||
2671
+ spider_check_email('paypal_email')) {return false;}; spider_set_input_value('task', 'apply_options')" value="Apply"/>
2672
+ <input class="button-secondary" type="submit" onclick="spider_set_input_value('task', 'cancel_options')" value="Cancel"/>
2673
+ </div>
2674
+ <div class="submenu-box" style="width: 99%; float: left; margin: 15px 0 0 0;">
2675
+ <div class="submenu-pad">
2676
+ <ul id="submenu" class="configuration">
2677
+ <li>
2678
+ <a id="general" class="fm_fieldset_tab" onclick="form_maker_options_tabs('general')" href="#">General Options</a>
2679
+ </li>
2680
+ <li>
2681
+ <a id="custom" class="fm_fieldset_tab" onclick="form_maker_options_tabs('custom')" href="#">Email Options</a>
2682
+ </li>
2683
+ <li>
2684
+ <a id="actions" class="fm_fieldset_tab" onclick="form_maker_options_tabs('actions')" href="#">Actions after Submission</a>
2685
+ </li>
2686
+ <li>
2687
+ <a id="payment" class="fm_fieldset_tab" onclick="form_maker_options_tabs('payment')" href="#">Payment Options</a>
2688
+ </li>
2689
+ <li>
2690
+ <a id="javascript" class="fm_fieldset_tab" onclick="form_maker_options_tabs('javascript')" href="#">JavaScript</a>
2691
+ </li>
2692
+ </ul>
2693
+ </div>
2694
+ </div>
2695
+ <fieldset id="general_fieldset" class="adminform fm_fieldset_deactive">
2696
+ <legend style="color:#0B55C4;font-weight: bold;">General Options</legend>
2697
+ <table class="admintable" style="float: left;">
2698
+ <tr valign="top">
2699
+ <td class="fm_options_label">
2700
+ <label>Published</label>
2701
+ </td>
2702
+ <td class="fm_options_value">
2703
+ <input type="radio" name="published" id="published_yes" value="1" <?php echo ($row->published) ? "checked" : ""; ?> /><label for="published_yes">Yes</label>
2704
+ <input type="radio" name="published" id="published_no" value="0" <?php echo (!$row->published) ? "checked" : ""; ?> /><label for="published_no">No</label>
2705
+ </td>
2706
+ </tr>
2707
+ <tr valign="top">
2708
+ <td class="fm_options_label">
2709
+ <label>Save data(to database)</label>
2710
+ </td>
2711
+ <td class="fm_options_value">
2712
+ <input type="radio" name="savedb" id="savedb_yes" value="1" <?php echo ($row->savedb) ? "checked" : ""; ?> /><label for="savedb_yes">Yes</label>
2713
+ <input type="radio" name="savedb" id="savedb_no" value="0" <?php echo (!$row->savedb) ? "checked" : ""; ?> /><label for="savedb_no">No</label>
2714
+ </td>
2715
+ </tr>
2716
+ <tr valign="top">
2717
+ <td class="fm_options_label">
2718
+ <label for="theme">Theme</label>
2719
+ </td>
2720
+ <td class="fm_options_value">
2721
+ <select id="theme" name="theme" style="width:260px;" onChange="set_preview()">
2722
+ <?php
2723
+ foreach ($themes as $theme) {
2724
+ ?>
2725
+ <option value="<?php echo $theme->id; ?>" <?php echo (($theme->id == $row->theme) ? 'selected' : ''); ?>><?php echo $theme->title; ?></option>
2726
+ <?php
2727
+ }
2728
+ ?>
2729
+ </select>
2730
+ <a href="<?php echo add_query_arg(array('action' => 'FormMakerPreview', 'form_id' => $row->id, 'test_theme' => $row->theme, 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>" class="button-primary thickbox thickbox-preview" id="preview_form" title="Form Preview" onclick="return false;">
2731
+ Preview
2732
+ </a>
2733
+ <a href="<?php echo add_query_arg(array('action' => 'FormMakerEditCSS', 'id' => $row->theme, 'form_id' => $row->id, 'width' => '1000', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>" class="button-secondary thickbox thickbox-preview" id="edit_css" title="Edit CSS" onclick="return false;">
2734
+ Edit CSS
2735
+ </a>
2736
+ </td>
2737
+ </tr>
2738
+ <tr valign="top">
2739
+ <td class="fm_options_label">
2740
+ <label for="requiredmark">Required fields mark</label>
2741
+ </td>
2742
+ <td class="fm_options_value">
2743
+ <input id="requiredmark" name="requiredmark" value="<?php echo $row->requiredmark; ?>" style="width:250px;" />
2744
+ </td>
2745
+ </tr>
2746
+ </table>
2747
+ </fieldset>
2748
+ <fieldset id="custom_fieldset" class="adminform fm_fieldset_deactive">
2749
+ <legend style="color: #0B55C4; font-weight: bold;">Email Options</legend>
2750
+ <table class="admintable">
2751
+ <tr valign="top">
2752
+ <td style="padding: 15px;">
2753
+ <label>Send E-mail</label>
2754
+ </td>
2755
+ <td style="padding: 15px;">
2756
+ <input type="radio" name="sendemail" id="sendemail_yes" value="1" <?php echo ($row->sendemail) ? "checked" : ""; ?> /><label for="sendemail_yes">Yes</label>
2757
+ <input type="radio" name="sendemail" id="sendemail_no" value="0" <?php echo (!$row->sendemail) ? "checked" : ""; ?> /><label for="sendemail_no">No</label>
2758
+ </td>
2759
+ </tr>
2760
+ </table>
2761
+ <fieldset class="fm_mail_options">
2762
+ <legend style="color:#0B55C4;font-weight: bold;">Email to Administrator</legend>
2763
+ <table class="admintable">
2764
+ <tr valign="top">
2765
+ <td class="fm_options_label">
2766
+ <label for="mail">Email to send submissions to</label>
2767
+ </td>
2768
+ <td class="fm_options_value">
2769
+ <input id="mail" name="mail" value="<?php echo $row->mail; ?>" style="width:250px;" />
2770
+ </td>
2771
+ </tr>
2772
+ <tr valign="top">
2773
+ <td class="fm_options_label">
2774
+ <label for="from_mail">Email From</label>
2775
+ </td>
2776
+ <td class="fm_options_value">
2777
+ <!--<input id="from_mail" name="from_mail" value="<?php echo $row->from_mail; ?>" style="width:250px;" />-->
2778
+ <?php
2779
+ $is_other = TRUE;
2780
+ for ($i = 0; $i < $fields_count - 1; $i++) {
2781
+ ?>
2782
+ <div>
2783
+ <input type="radio" name="from_mail" id="from_mail<?php echo $i; ?>" value="<?php echo substr($fields[$i], strrpos($fields[$i], '*:*new_field*:*')+15, strlen($fields[$i])); ?>" <?php echo (substr($fields[$i], strrpos($fields[$i], '*:*new_field*:*')+15, strlen($fields[$i])) == $row->from_mail ? 'checked="checked"' : '' ); ?> onclick="wdhide('mail_from_other')" />
2784
+ <label for="from_mail<?php echo $i; ?>"><?php echo substr($fields[$i + 1], 0, strpos($fields[$i + 1], '*:*w_field_label*:*')); ?></label>
2785
+ </div>
2786
+ <?php
2787
+ if (substr($fields[$i], strrpos($fields[$i], '*:*new_field*:*') + 15, strlen($fields[$i])) == $row->from_mail) {
2788
+ $is_other = FALSE;
2789
+ }
2790
+ }
2791
+ ?>
2792
+ <div style="<?php echo ($fields_count == 1) ? 'display:none;' : ''; ?>">
2793
+ <input type="radio" id="other" name="from_mail" value="other" <?php echo ($is_other) ? 'checked="checked"' : ''; ?> onclick="wdshow('mail_from_other')" />
2794
+ <label for="other">Other</label>
2795
+ </div>
2796
+ <input style="width: <?php echo ($fields_count == 1) ? '250px' : '235px; margin-left: 15px' ?>; display: <?php echo ($is_other) ? 'block;' : 'none;'; ?>" id="mail_from_other" name="mail_from_other" value="<?php echo ($is_other) ? $row->from_mail : ''; ?>" />
2797
+ </td>
2798
+ </tr>
2799
+ <tr valign="top">
2800
+ <td class="fm_options_label">
2801
+ <label for="from_name">From Name</label>
2802
+ </td>
2803
+ <td class="fm_options_value">
2804
+ <input id="from_name" name="from_name" value="<?php echo $row->from_name; ?>" style="width: 250px;" />
2805
+ </td>
2806
+ </tr>
2807
+ <tr valign="top">
2808
+ <td class="fm_options_label">
2809
+ <label for="reply_to">Reply to<br/>(if different from "Email From") </label>
2810
+ </td>
2811
+ <td class="fm_options_value">
2812
+ <!--<input id="reply_to" name="reply_to" value="<?php echo $row->reply_to; ?>" style="width:250px;"/>-->
2813
+ <?php
2814
+ $is_other = TRUE;
2815
+ for ($i = 0; $i < $fields_count - 1; $i++) {
2816
+ ?>
2817
+ <div>
2818
+ <input type="radio" name="reply_to" id="reply_to<?php echo $i; ?>" value="<?php echo substr($fields[$i], strrpos($fields[$i], '*:*new_field*:*') + 15, strlen($fields[$i])); ?>" <?php echo (substr($fields[$i], strrpos($fields[$i], '*:*new_field*:*') + 15, strlen($fields[$i])) == $row->reply_to ? 'checked="checked"' : ''); ?> onclick="wdhide('reply_to_other')" />
2819
+ <label for="reply_to<?php echo $i; ?>"><?php echo substr($fields[$i + 1], 0, strpos($fields[$i + 1], '*:*w_field_label*:*')); ?></label>
2820
+ </div>
2821
+ <?php
2822
+ if (substr($fields[$i], strrpos($fields[$i], '*:*new_field*:*') + 15, strlen($fields[$i])) == $row->reply_to) {
2823
+ $is_other = FALSE;
2824
+ }
2825
+ }
2826
+ ?>
2827
+ <div style="<?php echo ($fields_count == 1) ? 'display: none;' : ''; ?>">
2828
+ <input type="radio" id="other1" name="reply_to" value="other" <?php echo ($is_other) ? 'checked="checked"' : ''; ?> onclick="wdshow('reply_to_other')" />
2829
+ <label for="other1">Other</label>
2830
+ </div>
2831
+ <input style="width: <?php echo ($fields_count == 1) ? '250px' : '235px; margin-left: 15px'; ?>; display: <?php echo ($is_other) ? 'block;' : 'none;'; ?>" id="reply_to_other" name="reply_to_other" value="<?php echo ($is_other && $row->reply_to) ? $row->reply_to : ''; ?>" />
2832
+ </td>
2833
+ </tr>
2834
+ <tr>
2835
+ <td class="fm_options_label" valign="top">
2836
+ <label>Custom Text in Email For Administrator</label>
2837
+ </td>
2838
+ <td class="fm_options_value">
2839
+ <div style="margin-bottom:5px">
2840
+ <?php
2841
+ $choise = "document.getElementById('script_mail')";
2842
+ for ($i = 0; $i < count($label_label); $i++) {
2843
+ if ($label_type[$i] == "type_submit_reset" || $label_type[$i] == "type_editor" || $label_type[$i] == "type_map" || $label_type[$i] == "type_mark_map" || $label_type[$i] == "type_captcha" || $label_type[$i] == "type_recaptcha" || $label_type[$i] == "type_button" || $label_type[$i] == "type_file_upload" || $label_type[$i] == "type_send_copy") {
2844
+ continue;
2845
+ }
2846
+ $param = htmlspecialchars(addslashes($label_label[$i]));
2847
+ ?>
2848
+ <input style="border: 1px solid silver; font-size: 10px;" type="button" value="<?php echo htmlspecialchars(addslashes($label_label[$i])); ?>" onClick="insertAtCursor(<?php echo $choise; ?>, '<?php echo $param; ?>')" />
2849
+ <?php
2850
+ }
2851
+ ?>
2852
+ <input style="border: 1px solid silver; font-size: 10px; margin: 3px;" type="button" value="All fields list" onClick="insertAtCursor(<?php echo $choise; ?>, 'all')" />
2853
+ </div>
2854
+ <?php
2855
+ if (user_can_richedit()) {
2856
+ wp_editor($row->script_mail, 'script_mail', array('teeny' => FALSE, 'textarea_name' => 'script_mail', 'media_buttons' => FALSE, 'textarea_rows' => 5));
2857
+ }
2858
+ else {
2859
+ ?>
2860
+ <textarea name="script_mail" id="script_mail" cols="20" rows="10" style="width:300px; height:450px;"><?php echo $row->script_mail; ?></textarea>
2861
+ <?php
2862
+ }
2863
+ ?>
2864
+ </td>
2865
+ </tr>
2866
+ </table>
2867
+ </fieldset>
2868
+ <fieldset class="fm_mail_options">
2869
+ <legend style="color: #0B55C4; font-weight: bold;">Email to User</legend>
2870
+ <table class="admintable">
2871
+ <tr valign="top">
2872
+ <td class="fm_options_label">
2873
+ <label for="mail">Send to</label>
2874
+ </td>
2875
+ <td class="fm_options_value">
2876
+ <?php
2877
+ $fields = explode('*:*id*:*type_submitter_mail*:*type*:*', $row->form_fields);
2878
+ $fields_count = count($fields);
2879
+ if ($fields_count == 1) {
2880
+ ?>
2881
+ There is no email field
2882
+ <?php
2883
+ }
2884
+ else {
2885
+ for ($i = 0; $i < $fields_count - 1; $i++) {
2886
+ ?>
2887
+ <div>
2888
+ <input type="checkbox" name="send_to<?php echo $i; ?>" id="send_to<?php echo $i; ?>" value="<?php echo substr($fields[$i], strrpos($fields[$i], '*:*new_field*:*') + 15, strlen($fields[$i])); ?>" <?php echo (is_numeric(strpos($row->send_to, '*' . substr($fields[$i], strrpos($fields[$i], '*:*new_field*:*') + 15, strlen($fields[$i])) . '*')) ? 'checked="checked"' : '' ); ?> />
2889
+ <label for="send_to<?php echo $i; ?>"><?php echo substr($fields[$i + 1], 0, strpos($fields[$i + 1], '*:*w_field_label*:*')); ?></label>
2890
+ </div>
2891
+ <?php
2892
+ }
2893
+ }
2894
+ ?>
2895
+ </td>
2896
+ </tr>
2897
+ <tr valign="top">
2898
+ <td class="fm_options_label">
2899
+ <label for="mail_from_user">Email From</label>
2900
+ </td>
2901
+ <td class="fm_options_value">
2902
+ <input id="mail_from_user" name="mail_from_user" value="<?php echo $row->mail_from_user; ?>" style="width: 250px;" />
2903
+ </td>
2904
+ </tr>
2905
+ <tr valign="top">
2906
+ <td class="fm_options_label">
2907
+ <label for="mail_from_name_user">From Name</label>
2908
+ </td>
2909
+ <td class="fm_options_value">
2910
+ <input id="mail_from_name_user" name="mail_from_name_user" value="<?php echo $row->mail_from_name_user; ?>" style="width: 250px;"/>
2911
+ </td>
2912
+ </tr>
2913
+ <tr valign="top">
2914
+ <td class="fm_options_label">
2915
+ <label for="reply_to_user">Reply to<br />(if different from "Email Form")</label>
2916
+ </td>
2917
+ <td class="fm_options_value">
2918
+ <input id="reply_to_user" name="reply_to_user" value="<?php echo $row->reply_to_user; ?>" style="width:250px;"/>
2919
+ </td>
2920
+ </tr>
2921
+ <tr>
2922
+ <td class="fm_options_label" valign="top">
2923
+ <label>Custom Text in Email For User</label>
2924
+ </td>
2925
+ <td class="fm_options_value">
2926
+ <div style="margin-bottom:5px">
2927
+ <?php
2928
+ $choise = "document.getElementById('script_mail_user')";
2929
+ for ($i = 0; $i < count($label_label); $i++) {
2930
+ if ($label_type[$i] == "type_submit_reset" || $label_type[$i] == "type_editor" || $label_type[$i] == "type_map" || $label_type[$i] == "type_mark_map" || $label_type[$i] == "type_captcha" || $label_type[$i] == "type_recaptcha" || $label_type[$i] == "type_button" || $label_type[$i] == "type_file_upload" || $label_type[$i] == "type_send_copy") {
2931
+ continue;
2932
+ }
2933
+ $param = htmlspecialchars(addslashes($label_label[$i]));
2934
+ ?>
2935
+ <input style="border: 1px solid silver; font-size: 10px;" type="button" value="<?php echo htmlspecialchars(addslashes($label_label[$i])); ?>" onClick="insertAtCursor(<?php echo $choise; ?>, '<?php echo $param; ?>')" />
2936
+ <?php
2937
+ }
2938
+ ?>
2939
+ <input style="border: 1px solid silver; font-size: 10px; margin:3px;" type="button" value="All fields list" onClick="insertAtCursor(<?php echo $choise; ?>, 'all')" />
2940
+ </div>
2941
+ <?php
2942
+ if (user_can_richedit()) {
2943
+ wp_editor($row->script_mail_user, 'script_mail_user', array('teeny' => FALSE, 'textarea_name' => 'script_mail_user', 'media_buttons' => FALSE, 'textarea_rows' => 5));
2944
+ }
2945
+ else {
2946
+ ?>
2947
+ <textarea name="script_mail_user" id="script_mail_user" cols="20" rows="10" style="width:300px; height:450px;"><?php echo $row->script_mail_user; ?></textarea>
2948
+ <?php
2949
+ }
2950
+ ?>
2951
+ </td>
2952
+ </tr>
2953
+ </table>
2954
+ </fieldset>
2955
+ </fieldset>
2956
+ <fieldset id="actions_fieldset" class="adminform fm_fieldset_deactive">
2957
+ <legend style="color:#0B55C4;font-weight: bold;">Actions after submission</legend>
2958
+ <table class="admintable">
2959
+ <tr valign="top">
2960
+ <td class="fm_options_label">
2961
+ <label>Action type</label>
2962
+ </td>
2963
+ <td class="fm_options_value">
2964
+ <div><input type="radio" name="submit_text_type" id="text_type_none" onclick="set_type('none')" value="1" <?php echo ($row->submit_text_type != 2 && $row->submit_text_type != 3 && $row->submit_text_type != 4 && $row->submit_text_type != 5) ? "checked" : ""; ?> /><label for="text_type_none">Stay on Form</label></div>
2965
+ <div><input type="radio" name="submit_text_type" id="text_type_post" onclick="set_type('post')" value="2" <?php echo ($row->submit_text_type == 2) ? "checked" : ""; ?> /><label for="text_type_post">Post</label></label></div>
2966
+ <div><input type="radio" name="submit_text_type" id="text_type_page" onclick="set_type('page')" value="5" <?php echo ($row->submit_text_type == 5) ? "checked" : ""; ?> /><label for="text_type_page">Page</label></label></div>
2967
+ <div><input type="radio" name="submit_text_type" id="text_type_custom_text" onclick="set_type('custom_text')" value="3" <?php echo ($row->submit_text_type == 3 ) ? "checked" : ""; ?> /><label for="text_type_custom_text">Custom Text</label></label></div>
2968
+ <div><input type="radio" name="submit_text_type" id="text_type_url" onclick="set_type('url')" value="4" <?php echo ($row->submit_text_type == 4) ? "checked" : ""; ?> /><label for="text_type_url">URL</div>
2969
+ </td>
2970
+ </tr>
2971
+ <tr id="none" <?php echo (($row->submit_text_type == 2 || $row->submit_text_type == 3 || $row->submit_text_type == 4 || $row->submit_text_type == 5) ? 'style="display:none"' : ''); ?>>
2972
+ <td class="fm_options_label">
2973
+ <label>Stay on Form</label>
2974
+ </td>
2975
+ <td class="fm_options_value">
2976
+ <img src="<?php echo WD_FM_URL . '/images/tick.png'; ?>" border="0">
2977
+ </td>
2978
+ </tr>
2979
+ <tr id="post" <?php echo (($row->submit_text_type != 2) ? 'style="display:none"' : ''); ?>>
2980
+ <td class="fm_options_label">
2981
+ <label for="post_name">Post</label>
2982
+ </td>
2983
+ <td class="fm_options_value">
2984
+ <select id="post_name" name="post_name" style="width: 153px; font-size: 11px;">
2985
+ <option value="0">- Select Post -</option>
2986
+ <?php
2987
+ // The Query.
2988
+ $args = array('posts_per_page' => 10000);
2989
+ query_posts($args);
2990
+ // The Loop.
2991
+ while (have_posts()) : the_post(); ?>
2992
+ <option value="<?php $x = get_permalink(get_the_ID()); echo $x; ?>" <?php echo (($row->article_id == $x) ? 'selected="selected"' : ''); ?>><?php the_title(); ?></option>
2993
+ <?php
2994
+ endwhile;
2995
+ // Reset Query.
2996
+ wp_reset_query();
2997
+ ?>
2998
+ </select>
2999
+ </td>
3000
+ </tr>
3001
+ <tr id="page" <?php echo (($row->submit_text_type != 5) ? 'style="display:none"' : ''); ?>>
3002
+ <td class="fm_options_label">
3003
+ <label for="page_name">Page</label>
3004
+ </td>
3005
+ <td class="fm_options_value">
3006
+ <select id="page_name" name="page_name" style="width: 153px; font-size: 11px;">
3007
+ <option value="0">- Select Page -</option>
3008
+ <?php
3009
+ // The Query.
3010
+ $pages = get_pages();
3011
+ // The Loop.
3012
+ foreach ($pages as $page) {
3013
+ $page_id = get_page_link($page->ID);
3014
+ ?>
3015
+ <option value="<?php echo $page_id; ?>" <?php echo (($row->article_id == $page_id) ? 'selected="selected"' : ''); ?>><?php echo $page->post_title; ?></option>
3016
+ <?php
3017
+ }
3018
+ // Reset Query.
3019
+ wp_reset_query();
3020
+ ?>
3021
+ </select>
3022
+ </td>
3023
+ </tr>
3024
+ <tr id="custom_text" <?php echo (($row->submit_text_type != 3) ? 'style="display: none;"' : ''); ?>>
3025
+ <td class="fm_options_label">
3026
+ <label for="submit_text">Text</label>
3027
+ </td>
3028
+ <td class="fm_options_value">
3029
+ <?php
3030
+ if (user_can_richedit()) {
3031
+ wp_editor($row->submit_text, 'submit_text', array('teeny' => FALSE, 'textarea_name' => 'submit_text', 'media_buttons' => FALSE, 'textarea_rows' => 5));
3032
+ }
3033
+ else {
3034
+ ?>
3035
+ <textarea cols="36" rows="5" id="submit_text" name="submit_text" style="resize: vertical;">
3036
+ <?php echo $row->submit_text; ?>
3037
+ </textarea>
3038
+ <?php
3039
+ }
3040
+ ?>
3041
+ </td>
3042
+ </tr>
3043
+ <tr id="url" <?php echo (($row->submit_text_type != 4 ) ? 'style="display:none"' : ''); ?>>
3044
+ <td class="fm_options_label">
3045
+ <label for="url">URL</label>
3046
+ </td>
3047
+ <td class="fm_options_value">
3048
+ <input type="text" id="url" name="url" style="width:300px" value="<?php echo $row->url; ?>" />
3049
+ </td>
3050
+ </tr>
3051
+ </table>
3052
+ </fieldset>
3053
+ <fieldset id="payment_fieldset" class="adminform fm_fieldset_deactive">
3054
+ <legend style="color:#0B55C4;font-weight: bold;">Payment Options</legend>
3055
+ <table class="admintable">
3056
+ <tr>
3057
+ <td colspan="2">
3058
+ <div class="error" style="padding: 5px; font-size: 14px;">Paypal Options are disabled in free version.</div>
3059
+ </td>
3060
+ </tr>
3061
+ <tr valign="top">
3062
+ <td class="fm_options_label">
3063
+ <label>Turn Paypal On</label>
3064
+ </td>
3065
+ <td class="fm_options_value">
3066
+ <div><input disabled="disabled" type="radio" name="paypal_mode" id="paypal_mode1" value="1" <?php echo ($row->paypal_mode == "1") ? "checked" : ""; ?> /><label for="paypal_mode1">On</label></div>
3067
+ <div><input disabled="disabled" type="radio" name="paypal_mode" id="paypal_mode2" value="0" <?php echo ($row->paypal_mode != "1") ? "checked" : ""; ?> /><label for="paypal_mode2">Off</label></div>
3068
+ </td>
3069
+ </tr>
3070
+ <tr valign="top">
3071
+ <td class="fm_options_label">
3072
+ <label>Checkout Mode</label>
3073
+ </td>
3074
+ <td class="fm_options_value">
3075
+ <div><input disabled="disabled" type="radio" name="checkout_mode" id="checkout_mode1" value="production" <?php echo ($row->checkout_mode == "production") ? "checked" : ""; ?> /><label for="checkout_mode1">Production</label></div>
3076
+ <div><input disabled="disabled" type="radio" name="checkout_mode" id="checkout_mode2" value="testmode" <?php echo ($row->checkout_mode != "production") ? "checked" : ""; ?> /><label for="checkout_mode2">Testmode</label></div>
3077
+ </td>
3078
+ </tr>
3079
+ <tr valign="top">
3080
+ <td class="fm_options_label">
3081
+ <label for="paypal_email">Paypal email</label>
3082
+ </td>
3083
+ <td class="fm_options_value">
3084
+ <input disabled="disabled" type="text" name="paypal_email" id="paypal_email" value="<?php echo $row->paypal_email; ?>" class="text_area" style="width:250px">
3085
+ </td>
3086
+ </tr>
3087
+ <tr valign="top">
3088
+ <td class="fm_options_label">
3089
+ <label for="payment_currency">Payment Currency</label>
3090
+ </td>
3091
+ <td class="fm_options_value">
3092
+ <select disabled="disabled" id="payment_currency" name="payment_currency" style="width:253px">
3093
+ <option value="USD" <?php echo (($row->payment_currency == 'USD') ? 'selected' : ''); ?>>$ &#8226; U.S. Dollar</option>
3094
+ <option value="EUR" <?php echo (($row->payment_currency == 'EUR') ? 'selected' : ''); ?>>&#8364; &#8226; Euro</option>
3095
+ <option value="GBP" <?php echo (($row->payment_currency == 'GBP') ? 'selected' : ''); ?>>&#163; &#8226; Pound Sterling</option>
3096
+ <option value="JPY" <?php echo (($row->payment_currency == 'JPY') ? 'selected' : ''); ?>>&#165; &#8226; Japanese Yen</option>
3097
+ <option value="CAD" <?php echo (($row->payment_currency == 'CAD') ? 'selected' : ''); ?>>C$ &#8226; Canadian Dollar</option>
3098
+ <option value="MXN" <?php echo (($row->payment_currency == 'MXN') ? 'selected' : ''); ?>>Mex$ &#8226; Mexican Peso</option>
3099
+ <option value="HKD" <?php echo (($row->payment_currency == 'HKD') ? 'selected' : ''); ?>>HK$ &#8226; Hong Kong Dollar</option>
3100
+ <option value="HUF" <?php echo (($row->payment_currency == 'HUF') ? 'selected' : ''); ?>>Ft &#8226; Hungarian Forint</option>
3101
+ <option value="NOK" <?php echo (($row->payment_currency == 'NOK') ? 'selected' : ''); ?>>kr &#8226; Norwegian Kroner</option>
3102
+ <option value="NZD" <?php echo (($row->payment_currency == 'NZD') ? 'selected' : ''); ?>>NZ$ &#8226; New Zealand Dollar</option>
3103
+ <option value="SGD" <?php echo (($row->payment_currency == 'SGD') ? 'selected' : ''); ?>>S$ &#8226; Singapore Dollar</option>
3104
+ <option value="SEK" <?php echo (($row->payment_currency == 'SEK') ? 'selected' : ''); ?>>kr &#8226; Swedish Kronor</option>
3105
+ <option value="PLN" <?php echo (($row->payment_currency == 'PLN') ? 'selected' : ''); ?>>zl &#8226; Polish Zloty</option>
3106
+ <option value="AUD" <?php echo (($row->payment_currency == 'AUD') ? 'selected' : ''); ?>>A$ &#8226; Australian Dollar</option>
3107
+ <option value="DKK" <?php echo (($row->payment_currency == 'DKK') ? 'selected' : ''); ?>>kr &#8226; Danish Kroner</option>
3108
+ <option value="CHF" <?php echo (($row->payment_currency == 'CHF') ? 'selected' : ''); ?>>CHF &#8226; Swiss Francs</option>
3109
+ <option value="CZK" <?php echo (($row->payment_currency == 'CZK') ? 'selected' : ''); ?>>Kc &#8226; Czech Koruny</option>
3110
+ <option value="ILS" <?php echo (($row->payment_currency == 'ILS') ? 'selected' : ''); ?>>&#8362; &#8226; Israeli Sheqel</option>
3111
+ <option value="BRL" <?php echo (($row->payment_currency == 'BRL') ? 'selected' : ''); ?>>R$ &#8226; Brazilian Real</option>
3112
+ <option value="TWD" <?php echo (($row->payment_currency == 'TWD') ? 'selected' : ''); ?>>NT$ &#8226; Taiwan New Dollars</option>
3113
+ <option value="MYR" <?php echo (($row->payment_currency == 'MYR') ? 'selected' : ''); ?>>RM &#8226; Malaysian Ringgit</option>
3114
+ <option value="PHP" <?php echo (($row->payment_currency == 'PHP') ? 'selected' : ''); ?>>&#8369; &#8226; Philippine Peso</option>
3115
+ <option value="THB" <?php echo (($row->payment_currency == 'THB') ? 'selected' : ''); ?>>&#xe3f; &#8226; Thai Bahtv</option>
3116
+ </select>
3117
+ </td>
3118
+ </tr>
3119
+ <tr valign="top">
3120
+ <td class="fm_options_label">
3121
+ <label for="tax">Tax</label>
3122
+ </td>
3123
+ <td class="fm_options_value">
3124
+ <input disabled="disabled" type="text" name="tax" id="tax" value="<?php echo $row->tax; ?>" class="text_area" style="width:30px" onKeyPress="return check_isnum(event)"> %
3125
+ </td>
3126
+ </tr>
3127
+ </table>
3128
+ </fieldset>
3129
+ <fieldset id="javascript_fieldset" class="adminform fm_fieldset_deactive">
3130
+ <legend style="color:#0B55C4;font-weight: bold;">JavaScript</legend>
3131
+ <table class="admintable">
3132
+ <tr valign="top">
3133
+ <td class="fm_options_label">
3134
+ <label for="javascript">Javascript</label>
3135
+ </td>
3136
+ <td class="fm_options_value">
3137
+ <textarea style="margin: 0px;" cols="60" rows="30" name="javascript" id="javascript"><?php echo $row->javascript; ?></textarea>
3138
+ </td>
3139
+ </tr>
3140
+ </table>
3141
+ </fieldset>
3142
+ <input type="hidden" name="fieldset_id" id="fieldset_id" value="<?php echo WDW_FM_Library::get('fieldset_id', 'general'); ?>" />
3143
+
3144
+ <input type="hidden" id="task" name="task" value=""/>
3145
+ <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
3146
+ </form>
3147
+ <script>
3148
+ jQuery(window).load(function () {
3149
+ form_maker_options_tabs(jQuery("#fieldset_id").val());
3150
+ spider_popup();
3151
+ });
3152
+ </script>
3153
+ <?php
3154
+ }
3155
+
3156
+ public function form_layout($id) {
3157
+ $row = $this->model->get_row_data($id);
3158
+ $ids = array();
3159
+ $types = array();
3160
+ $labels = array();
3161
+ $fields = explode('*:*new_field*:*', $row->form_fields);
3162
+ $fields = array_slice($fields, 0, count($fields) - 1);
3163
+ foreach ($fields as $field) {
3164
+ $temp = explode('*:*id*:*', $field);
3165
+ array_push($ids, $temp[0]);
3166
+ $temp = explode('*:*type*:*', $temp[1]);
3167
+ array_push($types, $temp[0]);
3168
+ $temp = explode('*:*w_field_label*:*', $temp[1]);
3169
+ array_push($labels, $temp[0]);
3170
+ }
3171
+ ?>
3172
+ <script>
3173
+ var form_front = '<?php echo addslashes($row->form_front);?>';
3174
+ var custom_front = '<?php echo addslashes($row->custom_front);?>';
3175
+ if (custom_front == '') {
3176
+ custom_front = form_front;
3177
+ }
3178
+ function submitbutton() {
3179
+ if (jQuery('#autogen_layout').is(':checked')) {
3180
+ jQuery('#custom_front').val(custom_front.replace(/\s+/g, ' ').replace(/> </g, '><'));
3181
+ }
3182
+ else {
3183
+ jQuery('#custom_front').val(editor.getValue().replace(/\s+/g, ' ').replace(/> </g, '><'));
3184
+ }
3185
+ }
3186
+ function insertAtCursor_form(myId, myLabel) {
3187
+ if (jQuery('#autogen_layout').is(':checked')) {
3188
+ alert("Uncheck the Auto-Generate Layout box.");
3189
+ return;
3190
+ }
3191
+ myValue = '<div wdid="' + myId + '" class="wdform_row">%' + myId + ' - ' + myLabel + '%</div>';
3192
+ line = editor.getCursor().line;
3193
+ ch = editor.getCursor().ch;
3194
+ text = editor.getLine(line);
3195
+ text1 = text.substr(0, ch);
3196
+ text2 = text.substr(ch);
3197
+ text = text1 + myValue + text2;
3198
+ editor.setLine(line, text);
3199
+ editor.focus();
3200
+ }
3201
+ function autogen(status) {
3202
+ if (status) {
3203
+ custom_front = editor.getValue();
3204
+ editor.setValue(form_front);
3205
+ editor.setOption('readOnly', true);
3206
+ autoFormat();
3207
+ }
3208
+ else {
3209
+ editor.setValue(custom_front);
3210
+ editor.setOption('readOnly', false);
3211
+ autoFormat();
3212
+ }
3213
+ }
3214
+ function autoFormat() {
3215
+ CodeMirror.commands["selectAll"](editor);
3216
+ editor.autoFormatRange(editor.getCursor(true), editor.getCursor(false));
3217
+ editor.scrollTo(0,0);
3218
+ }
3219
+ </script>
3220
+
3221
+ <div class="fm_layout" style="width: 99%;">
3222
+ <form action="admin.php?page=manage_fm" method="post" name="adminForm" enctype="multipart/form-data">
3223
+ <div class="buttons_div">
3224
+ <input class="button-secondary" type="submit" onclick="submitbutton(); spider_set_input_value('task', 'save_layout')" value="Save"/>
3225
+ <input class="button-secondary" type="submit" onclick="submitbutton(); spider_set_input_value('task', 'apply_layout')" value="Apply"/>
3226
+ <input class="button-secondary" type="submit" onclick="spider_set_input_value('task', 'cancel_options')" value="Cancel"/>
3227
+ </div>
3228
+ <h2 style="clear: both;">Description</h2>
3229
+ <p>To customize the layout of the form fields uncheck the Auto-Generate Layout box and edit the HTML.</p>
3230
+ <p>You can change positioning, add in-line styles and etc. Click on the provided buttons to add the corresponding field.<br /> This will add the following line:
3231
+ <b><span class="cm-tag">&lt;div</span> <span class="cm-attribute">wdid</span>=<span class="cm-string">"example_id"</span> <span class="cm-attribute">class</span>=<span class="cm-string">"wdform_row"</span><span class="cm-tag">&gt;</span>%example_id - Example%<span class="cm-tag">&lt;/div&gt;</span></b>
3232
+ , where <b><span class="cm-tag">&lt;div&gt;</span></b> is used to set a row.</p>
3233
+ <p>To return to the default settings you should check Auto-Generate Layout box.</p>
3234
+ <h3 style="color:red">Notice</h3>
3235
+ <p>Make sure not to publish the same field twice. This will cause malfunctioning of the form.</p>
3236
+ <hr/>
3237
+ <label for="autogen_layout" style="font-size: 20px; line-height: 45px; margin-left: 10px;">Auto Generate Layout? </label>
3238
+ <input type="checkbox" value="1" name="autogen_layout" id="autogen_layout" <?php echo (($row->autogen_layout) ? 'checked="checked"' : ''); ?> />
3239
+ <input type="hidden" name="custom_front" id="custom_front" value="" />
3240
+
3241
+ <input type="hidden" id="task" name="task" value=""/>
3242
+ <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>" />
3243
+ </form>
3244
+ <br/>
3245
+ <?php
3246
+ foreach($ids as $key => $id) {
3247
+ if ($types[$key] != "type_section_break") {
3248
+ ?>
3249
+ <button onClick="insertAtCursor_form('<?php echo $ids[$key]; ?>','<?php echo $labels[$key]; ?>')" class="fm_label_buttons" title="<?php echo $labels[$key]; ?>"><?php echo $labels[$key]; ?></button>
3250
+ <?php
3251
+ }
3252
+ }
3253
+ ?>
3254
+ <br /><br />
3255
+ <button class="fm_submit_layout button button-secondary button-hero" onclick="autoFormat()"><strong>Apply Source Formatting</strong> <em>(ctrl-enter)</em></button>
3256
+ <textarea id="source" name="source" style="display: none;"></textarea>
3257
+ </div>
3258
+ <script>
3259
+ var editor = CodeMirror.fromTextArea(document.getElementById("source"), {
3260
+ lineNumbers: true,
3261
+ lineWrapping: true,
3262
+ mode: "htmlmixed",
3263
+ value: form_front
3264
+ });
3265
+ if (jQuery('#autogen_layout').is(':checked')) {
3266
+ editor.setOption('readOnly', true);
3267
+ editor.setValue(form_front);
3268
+ }
3269
+ else {
3270
+ editor.setOption('readOnly', false);
3271
+ editor.setValue(custom_front);
3272
+ }
3273
+ jQuery('#autogen_layout').click(function() {
3274
+ autogen(jQuery(this).is(':checked'));
3275
+ });
3276
+ autoFormat();
3277
+ </script>
3278
+ <?php
3279
+ }
3280
+
3281
+ ////////////////////////////////////////////////////////////////////////////////////////
3282
+ // Getters & Setters //
3283
+ ////////////////////////////////////////////////////////////////////////////////////////
3284
+ ////////////////////////////////////////////////////////////////////////////////////////
3285
+ // Private Methods //
3286
+ ////////////////////////////////////////////////////////////////////////////////////////
3287
+ ////////////////////////////////////////////////////////////////////////////////////////
3288
+ // Listeners //
3289
+ ////////////////////////////////////////////////////////////////////////////////////////
3290
+ }
admin/views/FMViewShow_matrix.php ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMViewShow_matrix {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+
16
+ ////////////////////////////////////////////////////////////////////////////////////////
17
+ // Constructor & Destructor //
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ public function __construct($model) {
20
+ $this->model = $model;
21
+ }
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
26
+ $matrix_params = ((isset($_GET['matrix_params'])) ? esc_html(stripslashes($_GET['matrix_params'])) : 0);
27
+ $new_filename = str_replace("***matrix***", '', $matrix_params);
28
+ $new_filename = explode('***', $matrix_params);
29
+ $mat_params = array_slice($new_filename, 0, count($new_filename) - 1);
30
+ $mat_rows = $mat_params[0];
31
+ $mat_columns = $mat_params[$mat_rows + 1];
32
+ ?>
33
+ <table style="margin: 0 auto;">
34
+ <tr>
35
+ <td></td>
36
+ <?php
37
+ for ($k = 1; $k <= $mat_columns; $k++) {
38
+ ?>
39
+ <td style="background-color: #BBBBBB; padding: 5px;"><?php echo $mat_params[$mat_rows + 1 + $k]; ?></td>
40
+ <?php
41
+ }
42
+ ?>
43
+ </tr>
44
+ <?php
45
+ $aaa = Array();
46
+ $var_checkbox = 1;
47
+ for ($k = 1; $k <= $mat_rows; $k++) {
48
+ ?>
49
+ <tr>
50
+ <td style="background-color: #BBBBBB; padding: 5px; "><?php echo $mat_params[$k]; ?></td>
51
+ <?php
52
+ if ($mat_params[$mat_rows + $mat_columns + 2] == "radio") {
53
+ if ($mat_params[$mat_rows + $mat_columns + 2 + $k] == 0) {
54
+ $checked = 0;
55
+ $aaa[1] = "";
56
+ }
57
+ else {
58
+ $aaa = explode("_", $mat_params[$mat_rows + $mat_columns + 2 + $k]);
59
+ }
60
+ for ($l = 1; $l <= $mat_columns; $l++) {
61
+ if ($aaa[1] == $l) {
62
+ $checked = "checked";
63
+ }
64
+ else {
65
+ $checked = "";
66
+ }
67
+ ?>
68
+ <td style="text-align: center;"><input type="radio" <?php echo $checked; ?> disabled /></td>
69
+ <?php
70
+ }
71
+ }
72
+ else {
73
+ if ($mat_params[$mat_rows + $mat_columns + 2] == "checkbox") {
74
+ for ($l = 1; $l <= $mat_columns; $l++) {
75
+ if ($mat_params[$mat_rows+$mat_columns + 2 + $var_checkbox] == "1") {
76
+ $checked = "checked";
77
+ }
78
+ else {
79
+ $checked = "";
80
+ }
81
+ ?>
82
+ <td style="text-align:center"><input type="checkbox" <?php echo $checked; ?> disabled /></td>
83
+ <?php
84
+ $var_checkbox++;
85
+ }
86
+ }
87
+ else {
88
+ if ($mat_params[$mat_rows + $mat_columns + 2] == "text") {
89
+ for ($l = 1; $l <= $mat_columns; $l++) {
90
+ $checked = $mat_params[$mat_rows + $mat_columns + 2 + $var_checkbox];
91
+ ?>
92
+ <td style="text-align:center"><input type="text" value="<?php echo $checked; ?>" disabled /></td>
93
+ <?php
94
+ $var_checkbox++;
95
+ }
96
+ }
97
+ else {
98
+ for ($l = 1; $l <= $mat_columns; $l++) {
99
+ $checked = $mat_params[$mat_rows + $mat_columns + 2 + $var_checkbox];
100
+ ?>
101
+ <td style="text-align: center;"><?php echo $checked; ?></td>
102
+ <?php
103
+ $var_checkbox++;
104
+ }
105
+ }
106
+ }
107
+ }
108
+ ?>
109
+ </tr>
110
+ <?php
111
+ }
112
+ ?>
113
+ </table>
114
+ <?php
115
+ die();
116
+ }
117
+
118
+ ////////////////////////////////////////////////////////////////////////////////////////
119
+ // Getters & Setters //
120
+ ////////////////////////////////////////////////////////////////////////////////////////
121
+ ////////////////////////////////////////////////////////////////////////////////////////
122
+ // Private Methods //
123
+ ////////////////////////////////////////////////////////////////////////////////////////
124
+ ////////////////////////////////////////////////////////////////////////////////////////
125
+ // Listeners //
126
+ ////////////////////////////////////////////////////////////////////////////////////////
127
+ }
admin/views/FMViewSubmissions_fm.php ADDED
@@ -0,0 +1,2765 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMViewSubmissions_fm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ // Constructor & Destructor //
17
+ ////////////////////////////////////////////////////////////////////////////////////////
18
+ public function __construct($model) {
19
+ $this->model = $model;
20
+ }
21
+
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display($form_id) {
26
+ global $wpdb;
27
+ $forms = $this->model->get_form_titles();
28
+ $statistics = $this->model->get_statistics($form_id);
29
+ $labels_parameters = $this->model->get_labels_parameters($form_id);
30
+ $sorted_labels_id = $labels_parameters[0];
31
+ $sorted_label_types = $labels_parameters[1];
32
+ $lists = $labels_parameters[2];
33
+ $sorted_label_names = $labels_parameters[3];
34
+ $sorted_label_names_original = $labels_parameters[4];
35
+ $rows = ((isset($labels_parameters[5])) ? $labels_parameters[5] : NULL);
36
+ $group_ids = ((isset($labels_parameters[6])) ? $labels_parameters[6] : NULL);
37
+ $where_choices = $labels_parameters[7];
38
+ $order_by = (isset($_POST['order_by']) ? esc_html(stripslashes($_POST['order_by'])) : 'group_id');
39
+ $asc_or_desc = ((isset($_POST['asc_or_desc'])) ? esc_html(stripslashes($_POST['asc_or_desc'])) : 'desc');
40
+ $style_id = $this->model->hide_or_not($lists['hide_label_list'], '@submitid@');
41
+ $style_date = $this->model->hide_or_not($lists['hide_label_list'], '@submitdate@');
42
+ $style_ip = $this->model->hide_or_not($lists['hide_label_list'], '@submitterip@');
43
+ $oder_class_default = "manage-column column-autor sortable desc";
44
+ $oder_class = "manage-column column-title sorted " . $asc_or_desc;
45
+ $ispaypal = FALSE;
46
+ $temp = array();
47
+ $m = count($sorted_label_names);
48
+ $n = count($rows);
49
+ $group_id_s = array();
50
+ $group_id_s = $this->model->sort_group_ids(count($sorted_label_names),$group_ids);
51
+ $ka_fielderov_search = (($lists['ip_search'] || $lists['startdate'] || $lists['enddate']) ? TRUE : FALSE);
52
+ $is_stats = false;
53
+
54
+ ?>
55
+ <script type="text/javascript">
56
+ function clickLabChBAll(ChBAll) {
57
+ <?php
58
+ if (isset($sorted_label_names)) {
59
+ $templabels = array_merge(array(
60
+ 'submitid',
61
+ 'submitdate',
62
+ 'submitterip'
63
+ ), $sorted_labels_id);
64
+ $sorted_label_names_for_check = array_merge(array(
65
+ 'ID',
66
+ 'Submit date',
67
+ "Submitter's IP"
68
+ ), $sorted_label_names_original);
69
+ }
70
+ else {
71
+ $templabels = array(
72
+ 'submitid',
73
+ 'submitdate',
74
+ 'submitterip'
75
+ );
76
+ $sorted_label_names_for_check = array(
77
+ 'ID',
78
+ 'Submit date',
79
+ "Submitter's IP"
80
+ );
81
+ }
82
+ ?>
83
+ if (ChBAll.checked) {
84
+ document.forms.admin_form.hide_label_list.value = '';
85
+ for (i = 0; i <= ChBAll.form.length; i++) {
86
+ if (typeof(ChBAll.form[i]) != "undefined") {
87
+ if (ChBAll.form[i].type == "checkbox") {
88
+ ChBAll.form[i].checked = true;
89
+ }
90
+ }
91
+ }
92
+ }
93
+ else {
94
+ document.forms.admin_form.hide_label_list.value = '@<?php echo implode($templabels, '@@') ?>@' + '@payment_info@';
95
+ for (i = 0; i <= ChBAll.form.length; i++) {
96
+ if (typeof(ChBAll.form[i]) != "undefined") {
97
+ if (ChBAll.form[i].type == "checkbox") {
98
+ ChBAll.form[i].checked = false;
99
+ }
100
+ }
101
+ }
102
+ }
103
+ renderColumns();
104
+ }
105
+ function remove_all() {
106
+ document.getElementById('startdate').value = '';
107
+ document.getElementById('enddate').value = '';
108
+ document.getElementById('ip_search').value = '';
109
+ <?php
110
+ $n = count($rows);
111
+ for ($i = 0; $i < count($sorted_label_names); $i++) {
112
+ if ($sorted_label_types[$i] != "type_mark_map") {
113
+ ?>
114
+ document.getElementById('<?php echo $form_id . '_' . $sorted_labels_id[$i] . '_search'; ?>').value='';
115
+ <?php
116
+ }
117
+ }
118
+ ?>
119
+ }
120
+ function show_hide_filter() {
121
+ if (document.getElementById('fields_filter').style.display == "none") {
122
+ document.getElementById('fields_filter').style.display = '';
123
+ document.getElementById('filter_img').src = '<?php echo WD_FM_URL . '/images/filter_hide.png'; ?>';
124
+ }
125
+ else {
126
+ document.getElementById('fields_filter').style.display = "none";
127
+ document.getElementById('filter_img').src = '<?php echo WD_FM_URL . '/images/filter_show.png'; ?>';
128
+ }
129
+ }
130
+ jQuery(document).ready(function () {
131
+ jQuery('.theme-detail').click(function () {
132
+ jQuery(this).siblings('.themedetaildiv').toggle();
133
+ return false;
134
+ });
135
+ });
136
+ </script>
137
+ <div id="sbox-overlay" onclick="toggleChBDiv(false)"
138
+ style="z-index: 65555; position: fixed; top: 0px; left: 0px; visibility: visible; zoom: 1; background-color: #000000; opacity: 0.7; filter: alpha(opacity=70); display: none;">
139
+ </div>
140
+ <div style="background-color: #FFFFFF; width: 350px; max-height: 350px; overflow-y: auto; padding: 20px; position: fixed; top: 100px; display: none; border: 2px solid #AAAAAA; z-index: 65556;" id="ChBDiv">
141
+ <form action="#">
142
+ <p style="font-weight: bold; font-size: 18px; margin-top: 0px;">Select Columns</p>
143
+ <div class="fm_check_labels"><input type="checkbox" <?php echo ($lists['hide_label_list'] === '') ? 'checked="checked"' : ''; ?> onclick="clickLabChBAll(this)" id="ChBAll"/><label for="ChBAll"> All</label></div>
144
+ <?php
145
+ foreach ($templabels as $key => $curlabel) {
146
+ if (strpos($lists['hide_label_list'], '@' . $curlabel . '@') === FALSE) {
147
+ ?>
148
+ <div class="fm_check_labels"><input type="checkbox" checked="checked" onclick="clickLabChB('<?php echo $curlabel; ?>', this)" id="fm_check_id_<?php echo $curlabel; ?>" /><label for="fm_check_id_<?php echo $curlabel; ?>"> <?php echo stripslashes($sorted_label_names_for_check[$key]); ?></label></div>
149
+ <?php
150
+ }
151
+ else {
152
+ ?>
153
+ <div class="fm_check_labels"><input type="checkbox" onclick="clickLabChB('<?php echo $curlabel; ?>', this)" id="fm_check_id_<?php echo $curlabel; ?>"/><label for="fm_check_id_<?php echo $curlabel; ?>"> <?php echo stripslashes($sorted_label_names_for_check[$key]); ?></label></div>
154
+ <?php
155
+ }
156
+ }
157
+ $ispaypal = FALSE;
158
+ for ($i = 0; $i < count($sorted_label_names); $i++) {
159
+ if ($sorted_label_types[$i] == 'type_paypal_payment_status') {
160
+ $ispaypal = TRUE;
161
+ }
162
+ }
163
+ if ($ispaypal) {
164
+ ?>
165
+ <div class="fm_check_labels">
166
+ <input type="checkbox" onclick="clickLabChB('payment_info', this)" id="fm_check_payment_info" <?php echo (strpos($lists['hide_label_list'], '@payment_info@') === FALSE) ? 'checked="checked"' : ''; ?> />
167
+ <label for="fm_check_payment_info"> Payment Info</label>
168
+ </div>
169
+ <?php
170
+ }
171
+ ?>
172
+ <div style="text-align: center; padding: 20px;">
173
+ <input type="button" class="button-secondary" onclick="toggleChBDiv(false);" value="Done" />
174
+ </div>
175
+ </form>
176
+ </div>
177
+ <div style="clear: both; float: left; width: 99%;">
178
+ <div style="float:left; font-size: 14px; font-weight: bold;">
179
+ This section allows you to view and manage form submissions.
180
+ <a style="color: blue; text-decoration: none;" target="_blank" href="http://web-dorado.com/wordpress-form-maker-guide-6.html">Read More in User Manual</a>
181
+ </div>
182
+ <div style="float: right; text-align: right;">
183
+ <a style="text-decoration: none;" target="_blank" href="http://web-dorado.com/products/wordpress-form.html">
184
+ <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FM_URL . '/images/wd_logo.png'; ?>" />
185
+ </a>
186
+ </div>
187
+ </div>
188
+ <form action="admin.php?page=submissions_fm" method="post" id="admin_form" name="admin_form">
189
+ <input type="hidden" name="option" value="com_formmaker" />
190
+ <input type="hidden" id="task" name="task" value="" />
191
+ <input type="hidden" id="current_id" name="current_id" value="" />
192
+ <input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php echo $asc_or_desc; ?>" />
193
+ <input type="hidden" name="order_by" id="order_by" value="<?php echo $order_by; ?>" />
194
+ <br />
195
+ <table width="99%">
196
+ <tr style="line-height: inherit !important;">
197
+ <td align="left" width="300">
198
+ <select name="form_id" id="form_id" style="width:99%" onchange="document.admin_form.submit();">
199
+ <option value="0" selected="selected"> - Select a Form - </option>
200
+ <?php
201
+ if ($forms) {
202
+ foreach($forms as $form) {
203
+ ?>
204
+ <option value="<?php echo $form->id; ?>" <?php if ($form_id == $form->id) { $chosen_form_title = $form->title; echo 'selected="selected"'; }?>> <?php echo $form->title ?> </option>
205
+ <?php
206
+ }
207
+ }
208
+ ?>
209
+ </select>
210
+ </td>
211
+ <?php
212
+ if ($form_id > 0) {
213
+ ?>
214
+ <td class="reports"><strong>Entries</strong><br /><?php echo $statistics["total_entries"]; ?></td>
215
+ <td class="reports"><strong>Views</strong><br /><?php echo $statistics["total_views"]; ?></td>
216
+ <td class="reports"><strong>Conversion Rate</strong><br/><?php echo $statistics["conversion_rate"]; ?></td>
217
+ <td class="form_title">
218
+ <span class="form_title_cont" title="<?php echo $chosen_form_title; ?>"><?php echo $chosen_form_title; ?></span>
219
+ </td>
220
+ <td style="text-align: right;" width="300">
221
+ <span class="exp_but_span">Export to</span>
222
+ <input type="button" class="button-secondary" value="CSV" onclick="window.location='<?php echo add_query_arg(array('action' => 'generete_csv', 'form_id' => $form_id), admin_url('admin-ajax.php')); ?>'" />&nbsp;
223
+ <input type="button" class="button-secondary" value="XML" onclick="window.location='<?php echo add_query_arg(array('action' => 'generete_xml', 'form_id' => $form_id), admin_url('admin-ajax.php')); ?>'" />
224
+ </td>
225
+ </tr>
226
+ <tr>
227
+ <td align="left" colspan="4">
228
+ <input type="hidden" name="hide_label_list" value="<?php echo $lists['hide_label_list']; ?>" />
229
+ <img src="<?php echo WD_FM_URL . '/images/filter_show.png'; ?>" width="40" style="vertical-align: bottom; cursor: pointer;" onclick="show_hide_filter()" title="Search by fields" id="filter_img" />
230
+ <input type="button" class="button-secondary" onclick="spider_form_submit(event, 'admin_form')" value="Go" />
231
+ <input type="button" class="button-secondary" onclick="remove_all(); spider_form_submit(event, 'admin_form')" value="Reset" />
232
+ </td>
233
+ <td align="right" colspan="2">
234
+ <br />
235
+ <?php
236
+ if (isset($sorted_label_names)) {
237
+ ?>
238
+ <input type="button" class="button-secondary" onclick="toggleChBDiv(true)" value="Add/Remove Columns" />
239
+ <?php
240
+ }
241
+ ?>
242
+ <input class="button-secondary" type="button" onclick="spider_set_input_value('task', 'block_ip'); spider_form_submit(event, 'admin_form')" value="Block IP" />
243
+ <input class="button-secondary" type="button" onclick="spider_set_input_value('task', 'unblock_ip'); spider_form_submit(event, 'admin_form')" value="Unblock IP" />
244
+ <input class="button-secondary" type="button" onclick="if (confirm('Do you want to delete selected items?')) {
245
+ spider_set_input_value('task', 'delete_all');
246
+ spider_form_submit(event, 'admin_form')
247
+ } else {
248
+ return false;
249
+ }" value="Delete"/>
250
+ </td>
251
+ </tr>
252
+ <?php
253
+ }
254
+ else {
255
+ ?>
256
+ <td></td>
257
+ </tr>
258
+ <?php
259
+ }
260
+ ?>
261
+ </table>
262
+ <div class="tablenav top" style="width: 99%;">
263
+ <?php WDW_FM_Library::html_page_nav($lists['total'], $lists['limit'], 'admin_form'); ?>
264
+ </div>
265
+ <div class="submit_content" style="width: 99%;">
266
+ <table class="wp-list-table widefat fixed posts table_content">
267
+ <thead>
268
+ <tr>
269
+ <th class="table_small_col count_col sub-align">#</th>
270
+ <th scope="col" id="cb" class="manage-column column-cb check-column table_small_col sub-align form_check"><input id="check_all" type="checkbox"></th>
271
+ <th scope="col" id="submitid_fc" class="table_small_col sub-align submitid_fc <?php if ($order_by == "group_id") echo $oder_class; else echo $oder_class_default; ?>" <?php echo $style_id;?>>
272
+ <a href="" class="sub_id" onclick="spider_set_input_value('order_by', 'group_id');
273
+ spider_set_input_value('asc_or_desc', '<?php echo ((isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && (esc_html(stripslashes($_POST['order_by'])) == 'group_id') && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc') ? 'desc' : 'asc'); ?>');
274
+ spider_form_submit(event, 'admin_form')">
275
+ <span>ID</span>
276
+ <span class="sorting-indicator" style="margin-top: 8px;"></span>
277
+ </a>
278
+ </th>
279
+ <th class="table_small_col sub-align">Edit</th>
280
+ <th class="table_small_col sub-align">Delete</th>
281
+ <th scope="col" id="submitdate_fc" class="table_large_col submitdate_fc <?php if ($order_by == "date") echo $oder_class; else echo $oder_class_default; ?>" <?php echo $style_date;?>>
282
+ <a href="" onclick="spider_set_input_value('order_by', 'date');
283
+ spider_set_input_value('asc_or_desc', '<?php echo ((isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && (esc_html(stripslashes($_POST['order_by'])) == 'date') && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc') ? 'desc' : 'asc'); ?>');
284
+ spider_form_submit(event, 'admin_form')">
285
+ <span>Submit date</span>
286
+ <span class="sorting-indicator"></span>
287
+ </a>
288
+ </th>
289
+ <th scope="col" id="submitterip_fc" class="table_large_col submitterip_fc <?php if ($order_by == "ip")echo $oder_class; else echo $oder_class_default; ?>" <?php echo $style_ip;?>>
290
+ <a href="" onclick="spider_set_input_value('order_by', 'ip');
291
+ spider_set_input_value('asc_or_desc', '<?php echo ((isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && (esc_html(stripslashes($_POST['order_by'])) == 'ip') && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc') ? 'desc' : 'asc'); ?>');
292
+ spider_form_submit(event, 'admin_form')">
293
+ <span>Submitter's IP</span>
294
+ <span class="sorting-indicator"></span>
295
+ </a>
296
+ </th>
297
+ <?php
298
+ for ($i = 0; $i < count($sorted_label_names); $i++) {
299
+ $styleStr = $this->model->hide_or_not($lists['hide_label_list'], $sorted_labels_id[$i]);
300
+ $styleStr2 = $this->model->hide_or_not($lists['hide_label_list'] , '@payment_info@');
301
+ $field_title = $this->model->get_type_address($sorted_label_types[$i], $sorted_label_names_original[$i]);
302
+ if ($sorted_label_types[$i] == 'type_paypal_payment_status') {
303
+ $ispaypal = TRUE;
304
+ ?>
305
+ <th <?php echo $styleStr; ?> id="<?php echo $sorted_labels_id[$i] . '_fc'; ?>" class="table_large_col <?php echo $sorted_labels_id[$i] . '_fc'; if ($order_by == $sorted_labels_id[$i] . "_field") echo $oder_class . '"';else echo $oder_class_default . '"'; ?>">
306
+ <a href="" onclick="spider_set_input_value('order_by', '<?php echo $sorted_labels_id[$i] . '_field'; ?>');
307
+ spider_set_input_value('asc_or_desc', '<?php echo ((isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && (esc_html(stripslashes($_POST['order_by'])) == $sorted_labels_id[$i] . '_field') && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc') ? 'desc' : 'asc'); ?>');
308
+ spider_form_submit(event, 'admin_form')">
309
+ <span><?php echo $field_title; ?></span>
310
+ <span class="sorting-indicator"></span>
311
+ </a>
312
+ </th>
313
+ <th class="table_large_col payment_info_fc" <?php echo $styleStr2; ?>>Payment Info</th>
314
+ <?php
315
+ }
316
+ else {
317
+ ?>
318
+ <th <?php echo $styleStr; ?> id="<?php echo $sorted_labels_id[$i] . '_fc';?>" class="<?php echo ($sorted_label_types[$i] == 'type_mark_map' || $sorted_label_types[$i] == 'type_matrix') ? 'table_large_col ' : ''; echo $sorted_labels_id[$i] . '_fc'; if ($order_by == $sorted_labels_id[$i] . "_field") echo $oder_class . '"';else echo $oder_class_default . '"'; ?>">
319
+ <a href="" onclick="spider_set_input_value('order_by', '<?php echo $sorted_labels_id[$i] . '_field'; ?>');
320
+ spider_set_input_value('asc_or_desc', '<?php echo ((isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && (esc_html(stripslashes($_POST['order_by'])) == $sorted_labels_id[$i] . '_field') && esc_html(stripslashes($_POST['asc_or_desc'])) == 'asc') ? 'desc' : 'asc'); ?>');
321
+ spider_form_submit(event, 'admin_form')">
322
+ <span><?php echo $field_title; ?></span>
323
+ <span class="sorting-indicator"></span>
324
+ </a>
325
+ </th>
326
+ <?php
327
+ }
328
+ }
329
+ ?>
330
+ </tr>
331
+ <tr id="fields_filter" style="display: none;">
332
+ <th></th>
333
+ <th></th>
334
+ <th></th>
335
+ <th></th>
336
+ <th class="submitid_fc" <?php echo $style_id; ?> ></th>
337
+ <th width="150" class="submitdate_fc" <?php echo $style_date; ?>>
338
+ <table align="center" style="margin:auto" class="simple_table">
339
+ <tr class="simple_table">
340
+ <td class="simple_table" style="text-align: left;">From:</td>
341
+ <td style="text-align: center;" class="simple_table">
342
+ <input class="inputbox" type="text" name="startdate" id="startdate" size="10" maxlength="10" value="<?php echo $lists['startdate']; ?>" />
343
+ </td>
344
+ <td style="text-align: center;" class="simple_table">
345
+ <input type="reset" style="width: 22px; border-radius: 3px !important;" class="button" value="..." onclick="return showCalendar('startdate','%Y-%m-%d');" />
346
+ </td>
347
+ </tr>
348
+ <tr class="simple_table">
349
+ <td style="text-align: left;" class="simple_table">To:</td>
350
+ <td style="text-align: center;" class="simple_table">
351
+ <input class="inputbox" type="text" name="enddate" id="enddate" size="10" maxlength="10" value="<?php echo $lists['enddate']; ?>" />
352
+ </td>
353
+ <td style="text-align: center;" class="simple_table">
354
+ <input type="reset" style="width: 22px; border-radius: 3px !important;" class="button" value="..." onclick="return showCalendar('enddate','%Y-%m-%d');" />
355
+ </td>
356
+ </tr>
357
+ </table>
358
+ </th>
359
+ <th class="table_large_col submitterip_fc" <?php echo $style_ip; ?>>
360
+ <input type="text" name="ip_search" id="ip_search" value="<?php echo $lists['ip_search']; ?>" onChange="this.form.submit();" />
361
+ </th>
362
+ <?php
363
+ for ($i = 0; $i < count($sorted_label_names); $i++) {
364
+ $styleStr = $this->model->hide_or_not($lists['hide_label_list'], $sorted_labels_id[$i]);
365
+ if (!$ka_fielderov_search) {
366
+ if ($lists[$form_id . '_' . $sorted_labels_id[$i] . '_search']) {
367
+ $ka_fielderov_search = TRUE;
368
+ }
369
+ }
370
+ switch ($sorted_label_types[$i]) {
371
+ case 'type_mark_map': ?>
372
+ <th class="table_large_col <?php echo $sorted_labels_id[$i]; ?>_fc" <?php echo $styleStr; ?>></th>
373
+ <?php
374
+ break;
375
+ case 'type_paypal_payment_status': ?>
376
+ <th class="table_large_col <?php echo $sorted_labels_id[$i]; ?>_fc" <?php echo $styleStr; ?>>
377
+ <select style="font-size: 11px; margin: 0; padding: 0; height: inherit;" name="<?php echo $form_id . '_' . $sorted_labels_id[$i]; ?>_search" id="<?php echo $form_id.'_'.$sorted_labels_id[$i]; ?>_search" onChange="this.form.submit();" value="<?php echo $lists[$form_id.'_'.$sorted_labels_id[$i].'_search']; ?>" >
378
+ <option value="" ></option>
379
+ <option value="canceled" >Canceled</option>
380
+ <option value="cleared" >Cleared</option>
381
+ <option value="cleared by payment review" >Cleared by payment review</option>
382
+ <option value="completed" >Completed</option>
383
+ <option value="denied" >Denied</option>
384
+ <option value="failed" >Failed</option>
385
+ <option value="held" >Held</option>
386
+ <option value="in progress" >In progress</option>
387
+ <option value="on hold" >On hold</option>
388
+ <option value="paid" >Paid</option>
389
+ <option value="partially refunded" >Partially refunded</option>
390
+ <option value="pending verification" >Pending verification</option>
391
+ <option value="placed" >Placed</option>
392
+ <option value="processing" >Processing</option>
393
+ <option value="refunded" >Refunded</option>
394
+ <option value="refused" >Refused</option>
395
+ <option value="removed" >Removed</option>
396
+ <option value="returned" >Returned</option>
397
+ <option value="reversed" >Reversed</option>
398
+ <option value="temporary hold" >Temporary hold</option>
399
+ <option value="unclaimed" >Unclaimed</option>
400
+ </select>
401
+ <script>
402
+ var element = document.getElementById('<?php echo $form_id.'_'.$sorted_labels_id[$i]; ?>_search');
403
+ element.value = '<?php echo $lists[$form_id.'_'.$sorted_labels_id[$i].'_search']; ?>';
404
+ </script>
405
+ </th>
406
+ <th class="table_large_col payment_info_fc" <?php echo $styleStr2; ?>></th>
407
+ <?php
408
+ break;
409
+ default: ?>
410
+ <th class="<?php echo $sorted_labels_id[$i]; ?>_fc" <?php echo $styleStr; ?>>
411
+ <input name="<?php echo $form_id .'_' . $sorted_labels_id[$i].'_search'; ?>" id="<?php echo $form_id .'_' . $sorted_labels_id[$i].'_search'; ?>" type="text" value="<?php echo $lists[$form_id.'_'.$sorted_labels_id[$i].'_search']; ?>" onChange="this.form.submit();" >
412
+ </th>
413
+ <?php
414
+ break;
415
+ }
416
+ }
417
+ ?>
418
+ </tr>
419
+ </thead>
420
+ <?php
421
+ $k = 0;
422
+ for ($www = 0, $qqq = count($group_id_s); $www < $qqq; $www++) {
423
+ $i = $group_id_s[$www];
424
+ $alternate = (!isset($alternate) || $alternate == 'class="alternate"') ? '' : 'class="alternate"';
425
+ $temp = $this->model->array_for_group_id($group_id_s[$www], $rows);
426
+ $data = $temp[0];
427
+ $query = @unserialize(file_get_contents('http://ip-api.com/php/' . $data->ip));
428
+ if ($query && $query['status'] == 'success' && $query['countryCode']) {
429
+ $country_flag = '<img src="' . WD_FM_URL . '/images/flags/' . strtolower($query['countryCode']) . '.png" class="sub-align" alt="' . $query['country'] . '" title="' . $query['country'] . '" />';
430
+ }
431
+ else {
432
+ $country_flag = '';
433
+ }
434
+ ?>
435
+ <tr <?php echo $alternate; ?>>
436
+ <td class="table_small_col count_col sub-align"><?php echo $www + 1; ?></td>
437
+ <th class="check-column table_small_col sub-align" style="padding: 0;">
438
+ <input type="checkbox" name="post[]" value="<?php echo $data->group_id; ?>">
439
+ </th>
440
+ <td class="table_small_col sub-align submitid_fc" id="submitid_fc" <?php echo $style_id; ?>>
441
+ <a href="" onclick="spider_set_input_value('task', 'edit');
442
+ spider_set_input_value('current_id',<?php echo $data->group_id; ?>);
443
+ spider_form_submit(event, 'admin_form');" ><?php echo $data->group_id; ?>
444
+ </a>
445
+ </td>
446
+ <td class="table_small_col sub-align">
447
+ <a href="" onclick="spider_set_input_value('task', 'edit');
448
+ spider_set_input_value('current_id',<?php echo $data->group_id; ?>);
449
+ spider_form_submit(event, 'admin_form');">Edit
450
+ </a>
451
+ </td>
452
+ <td class="table_small_col sub-align">
453
+ <a href="" onclick="spider_set_input_value('task', 'delete');
454
+ spider_set_input_value('current_id',<?php echo $data->group_id; ?>);
455
+ spider_form_submit(event, 'admin_form');">Delete
456
+ </a>
457
+ </td>
458
+ <td class="table_large_col submitdate_fc sub-align" id="submitdate_fc" <?php echo $style_date; ?>>
459
+ <a href="" onclick="spider_set_input_value('task', 'edit');
460
+ spider_set_input_value('current_id',<?php echo $data->group_id; ?>);
461
+ spider_form_submit(event, 'admin_form');" ><?php echo $data->date ;?>
462
+ </a>
463
+ </td>
464
+ <td class="table_large_col submitterip_fc sub-align" id="submitterip_fc" <?php echo $style_ip; ?>>
465
+ <a href="" onclick="spider_set_input_value('task', 'edit');
466
+ spider_set_input_value('current_id', <?php echo $data->group_id; ?>);
467
+ spider_form_submit(event, 'admin_form');" class="sub-align" <?php echo ($this->model->check_ip($data->ip) == NULL) ? '' : 'style="color: #FF0000;"'; ?>><?php echo $data->ip; ?>
468
+ </a>
469
+ <?php
470
+ echo $country_flag;
471
+ ?>
472
+ </td>
473
+ <?php
474
+ for ($h = 0; $h < $m; $h++) {
475
+ $not_label = TRUE;
476
+ for ($g = 0; $g < count($temp); $g++) {
477
+ $styleStr = $this->model->hide_or_not($lists['hide_label_list'], $sorted_labels_id[$h]);
478
+ if ($temp[$g]->element_label == $sorted_labels_id[$h]) {
479
+ if (strpos($temp[$g]->element_value, "***map***")) {
480
+ $map_params = explode('***map***', $temp[$g]->element_value);
481
+ ?>
482
+ <td class="table_large_col <?php echo $sorted_labels_id[$h]; ?>_fc sub-align" id="<?php echo $sorted_labels_id[$h]; ?>_fc" <?php echo $styleStr; ?>>
483
+ <a class="thickbox-preview" href="<?php echo add_query_arg(array('action' => 'frommapeditinpopup', 'long' => $map_params[0], 'lat' => $map_params[1], 'width' => '620', 'height' => '550', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>" title="Show on Map">Show on Map</a>
484
+ </td>
485
+ <?php
486
+ }
487
+ elseif (strpos($temp[$g]->element_value, "*@@url@@*")) {
488
+ ?>
489
+ <td class="<?php echo $sorted_labels_id[$h]; ?>_fc sub-align" id="<?php echo $sorted_labels_id[$h]; ?>_fc" <?php echo $styleStr; ?>>
490
+ <?php
491
+ $new_files = explode("*@@url@@*", $temp[$g]->element_value);
492
+ foreach ($new_files as $new_file) {
493
+ if ($new_file) {
494
+ $new_filename = explode('/', $new_file);
495
+ $new_filename = $new_filename[count($new_filename) - 1];
496
+ ?>
497
+ <a target="_blank" class="fm_fancybox" rel="group_<?php echo $www; ?>" href="<?php echo $new_file; ?>"><?php echo $new_filename; ?></a><br />
498
+ <?php
499
+ }
500
+ }
501
+ ?>
502
+ </td>
503
+ <?php
504
+ }
505
+ elseif (strpos($temp[$g]->element_value, "***star_rating***")) {
506
+ $view_star_rating_array = $this->model->view_for_star_rating($temp[$g]->element_value, $temp[$g]->element_label);
507
+ $stars = $view_star_rating_array[0];
508
+ ?>
509
+ <td align="center" class="<?php echo $sorted_labels_id[$h];?>_fc sub-align" id="<?php echo $sorted_labels_id[$h]; ?>_fc" <?php echo $styleStr; ?>><?php echo $stars; ?></td>
510
+ <?php
511
+ }
512
+ elseif (strpos($temp[$g]->element_value, "***matrix***")) {
513
+ ?>
514
+ <td class="table_large_col <?php echo $sorted_labels_id[$h];?>_fc sub-align" id="<?php echo $sorted_labels_id[$h]; ?>_fc" <?php echo $styleStr; ?>>
515
+ <a class="thickbox-preview" href="<?php echo add_query_arg(array('action' => 'show_matrix', 'matrix_params' => $temp[$g]->element_value, 'width' => '620', 'height' => '550', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>" title="Show Matrix">Show Matrix</a>
516
+ </td>
517
+ <?php
518
+ }
519
+ elseif (strpos($temp[$g]->element_value, "@@@") || $temp[$g]->element_value == "@@@" || $temp[$g]->element_value == "@@@@@@@@@") {
520
+ ?>
521
+ <td class="<?php echo $sorted_labels_id[$h]; ?>_fc" <?php echo $styleStr; ?>>
522
+ <p><?php echo str_replace("@@@", " ", $temp[$g]->element_value); ?></p>
523
+ </td>
524
+ <?php
525
+ }
526
+ elseif (strpos($temp[$g]->element_value, "***grading***")) {
527
+ $view_grading_array = $this->model->view_for_grading($temp[$g]->element_value);
528
+ $items = $view_grading_array[0];
529
+ ?>
530
+ <td class="<?php echo $sorted_labels_id[$h];?>_fc sub-align" id="<?php echo $sorted_labels_id[$h]; ?>_fc" <?php echo $styleStr; ?>>
531
+ <p><?php echo $items; ?></p>
532
+ </td>
533
+ <?php
534
+ }
535
+ else {
536
+ if (strpos($temp[$g]->element_value, "***quantity***")) {
537
+ $temp[$g]->element_value = str_replace("***quantity***", " ", $temp[$g]->element_value);
538
+ }
539
+ if (strpos($temp[$g]->element_value, "***property***")) {
540
+ $temp[$g]->element_value = str_replace("***property***", " ", $temp[$g]->element_value);
541
+ }
542
+ ?>
543
+ <td class="<?php echo $sorted_labels_id[$h];?>_fc sub-align" id="<?php echo $sorted_labels_id[$h]; ?>_fc" <?php echo $styleStr; ?>>
544
+ <p><?php echo str_replace("***br***", '<br>', stripslashes($temp[$g]->element_value)) ; ?></p>
545
+ </td>
546
+ <?php
547
+ }
548
+ $not_label = FALSE;
549
+ }
550
+ }
551
+ if ($not_label) {
552
+ ?>
553
+ <td class="<?php echo $sorted_labels_id[$h];?>_fc sub-align" id="<?php echo $sorted_labels_id[$h]; ?>_fc" <?php echo $styleStr; ?>><p>&nbsp;</p></td>
554
+ <?php
555
+ }
556
+ }
557
+ if ($ispaypal) {
558
+ $styleStr = $this->model->hide_or_not($lists['hide_label_list'], '@payment_info@');
559
+ ?>
560
+ <td class="table_large_col payment_info_fc sub-align" id="payment_info_fc" <?php echo $styleStr; ?>>
561
+ <a class="thickbox-preview" href="<?php echo add_query_arg(array('action' => 'paypal_info', 'id' => $i, 'width' => '600', 'height' => '500', 'TB_iframe' => '1'), admin_url('admin-ajax.php')); ?>">
562
+ <img src="<?php echo WD_FM_URL . '/images/info.png'; ?>" />
563
+ </a>
564
+ </td>
565
+ <?php
566
+ }
567
+ ?>
568
+ </tr>
569
+ <?php
570
+ $k = 1 - $k;
571
+ }
572
+ ?>
573
+ </table>
574
+ </div>
575
+ <?php
576
+ if ($sorted_label_types) {
577
+ foreach ($sorted_label_types as $key => $sorted_label_type) {
578
+ if ($this->model->check_radio_type($sorted_label_type)) {
579
+ $is_stats = true;
580
+ break;
581
+ }
582
+ }
583
+ if ($is_stats) {
584
+ ?>
585
+ <br /><br />
586
+ <h1 style="border-bottom: 1px solid; padding-bottom:7px; width:99%; color: hsl(197, 100%, 32%);">Statistics</h1>
587
+ <table class="wp-list-table widefat fixed posts table_content" style="width: 99%;">
588
+ <tr>
589
+ <td class="key" style="vertical-align: middle;width: 9%">
590
+ <label for="sorted_label_key">Select a Field:</label>
591
+ </td>
592
+ <td width="330">
593
+ <select id="sorted_label_key">
594
+ <option value="">Select a Field</option>
595
+ <?php
596
+ foreach ($sorted_label_types as $key => $sorted_label_type) {
597
+ 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") {
598
+ ?>
599
+ <option value="<?php echo $key; ?>"><?php echo $sorted_label_names_original[$key]; ?></option>
600
+ <?php
601
+ }
602
+ }
603
+ ?>
604
+ </select>
605
+ </td>
606
+ <td></td>
607
+ </tr>
608
+ <tr>
609
+ <td class="key" style="vertical-align: middle;">
610
+ <label>Select a Date:</label>
611
+ </td>
612
+ <td width="330">
613
+ From: <input class="inputbox" type="text" name="startstats" id="startstats" size="9" maxlength="9" />
614
+ <input type="reset" class="button" style="width: 22px; border-radius: 3px !important;" value="..." name="startstats_but" id="startstats_but" onclick="return showCalendar('startstats','%Y-%m-%d');" />
615
+
616
+ To: <input class="inputbox" type="text" name="endstats" id="endstats" size="9" maxlength="9" />
617
+ <input type="reset" class="button" style="width: 22px; border-radius: 3px !important;" value="..." name="endstats_but" id="endstats_but" onclick="return showCalendar('endstats','%Y-%m-%d');" />
618
+ </td>
619
+ <td class="key" style="vertical-align: middle;">
620
+ <input type="button" onclick="show_stats()" class="button-secondary" value="Show">
621
+ </td>
622
+ </tr>
623
+ </table>
624
+ <div id="div_stats"></div>
625
+ <?php
626
+ }
627
+ }
628
+ ?>
629
+ </form>
630
+ <script>
631
+ jQuery(window).load(function() {
632
+ spider_popup();
633
+ if (typeof jQuery().fancybox !== 'undefined' && jQuery.isFunction(jQuery().fancybox)) {
634
+ jQuery(".fm_fancybox").fancybox({
635
+ 'maxWidth ' : 600,
636
+ 'maxHeight' : 500
637
+ });
638
+ }
639
+ });
640
+ function show_stats() {
641
+ jQuery('#div_stats').html('<div id="saving"><div id="saving_text">Loading</div><div id="fadingBarsG"><div id="fadingBarsG_1" class="fadingBarsG"></div><div id="fadingBarsG_2" class="fadingBarsG"></div><div id="fadingBarsG_3" class="fadingBarsG"></div><div id="fadingBarsG_4" class="fadingBarsG"></div><div id="fadingBarsG_5" class="fadingBarsG"></div><div id="fadingBarsG_6" class="fadingBarsG"></div><div id="fadingBarsG_7" class="fadingBarsG"></div><div id="fadingBarsG_8" class="fadingBarsG"></div></div></div>');
642
+ if(jQuery('#sorted_label_key').val()!="") {
643
+ jQuery('#div_stats').load('<?php echo add_query_arg(array('action' => 'get_stats', 'page' => 'submissions_fm'), admin_url('admin-ajax.php')); ?>', {
644
+ 'task': 'show_stats',
645
+ 'form_id' : '<?php echo $form_id; ?>',
646
+ 'sorted_label_key' : jQuery('#sorted_label_key').val(),
647
+ 'startdate' : jQuery('#startstats').val(),
648
+ 'enddate' : jQuery('#endstats').val()
649
+ });
650
+ }
651
+ else
652
+ jQuery('#div_stats').html("Please select the field!")
653
+ }
654
+ <?php
655
+ if ($ka_fielderov_search) {
656
+ ?>
657
+ document.getElementById('fields_filter').style.display = '';
658
+ <?php
659
+ }
660
+ ?>
661
+ </script>
662
+ <?php
663
+ }
664
+
665
+ public function show_stats($form_id) {
666
+ $key = (isset($_POST['sorted_label_key']) ? esc_html(stripslashes($_POST['sorted_label_key'])) : '');
667
+ $labels_parameters = $this->model->get_labels_parameters($form_id);
668
+ $where_choices = $labels_parameters[7];
669
+ $sorted_label_names_original = $labels_parameters[4];
670
+ $sorted_labels_id = $labels_parameters[0];
671
+ if(count($sorted_labels_id)!=0 && $key < count($sorted_labels_id) ) {
672
+ $choices_params = $this->model->statistic_for_radio($where_choices, $sorted_labels_id[$key]);
673
+ $sorted_label_name_original = $sorted_label_names_original[$key];
674
+ $choices_count = $choices_params[0];
675
+ $choices_labels = $choices_params[1];
676
+ $unanswered = $choices_params[2];
677
+ $all = $choices_params[3];
678
+ $colors = $choices_params[4];
679
+ }
680
+ else {
681
+ $choices_labels = array();
682
+ $sorted_label_name_original = '';
683
+ $unanswered = NULL;
684
+ $all = 0;
685
+ }
686
+ ?>
687
+ <br/>
688
+ <br/>
689
+ <strong><?php echo stripslashes($sorted_label_name_original); ?></strong>
690
+ <br/>
691
+ <br/>
692
+ <table style="width:99%" class="wp-list-table widefat fixed posts">
693
+ <thead>
694
+ <tr>
695
+ <th width="20%">Choices</th>
696
+ <th>Percentage</th>
697
+ <th width="10%">Count</th>
698
+ </tr>
699
+ </thead>
700
+ <?php
701
+ foreach ($choices_labels as $key => $choices_label) {
702
+ if (strpos($choices_label, "***quantity***")) {
703
+ $choices_label = str_replace("***quantity***", " ", $choices_label);
704
+ }
705
+ if (strpos($choices_label, "***property***")) {
706
+ $choices_label = str_replace("***property***", " ", $choices_label);
707
+ }
708
+ ?>
709
+ <tr>
710
+ <td><?php echo str_replace("***br***", '<br>', $choices_label); ?></td>
711
+ <td>
712
+ <div class="bordered" style="width:<?php echo ($choices_count[$key] / ($all - $unanswered)) * 100; ?>%; height:18px; background-color:<?php echo $colors[$key % 2]; ?>"></div>
713
+ </td>
714
+ <td><?php echo $choices_count[$key]; ?></td>
715
+ </tr>
716
+ <?php
717
+ }
718
+ if ($unanswered) {
719
+ ?>
720
+ <tr>
721
+ <td colspan="2" align="right">Unanswered</th>
722
+ <td><strong><?php echo $unanswered; ?></strong></th>
723
+ </tr>
724
+ <?php
725
+ }
726
+ ?>
727
+ <tr>
728
+ <td colspan="2" align="right"><strong>Total</strong></th>
729
+ <td><strong><?php echo $all; ?></strong></th>
730
+ </tr>
731
+ </table>
732
+ <?php
733
+ die();
734
+ }
735
+
736
+ public function edit($id) {
737
+ $current_id = ((isset($id)) ? $id : 0);
738
+ $params = $this->model->get_data_of_group_id($current_id);
739
+ $rows = $params[0];
740
+ $labels_id = $params[1];
741
+ $labels_name = $params[2];
742
+ $labels_type = $params[3];
743
+ $ispaypal = $params[4];
744
+ ?>
745
+ <form action="admin.php?page=submissions_fm" method="post" id="adminForm" name="adminForm">
746
+ <table width="99%">
747
+ <tbody>
748
+ <tr>
749
+ <td width="100%"><h2>Edit Submission</h2></td>
750
+ <td align="right">
751
+ <input type="button" onclick="spider_set_input_value('task', 'save');
752
+ spider_set_input_value('current_id', <?php echo $current_id; ?>);
753
+ spider_form_submit(event, 'adminForm');" value="Save" class="button-secondary action">
754
+ </td>
755
+ <td align="right">
756
+ <input type="button" onclick="spider_set_input_value('task', 'apply');
757
+ spider_set_input_value('current_id', <?php echo $current_id ;?>);
758
+ spider_form_submit(event, 'adminForm');" value="Apply" class="button-secondary action">
759
+ </td>
760
+ <td align="right">
761
+ <input type="button" onclick="spider_set_input_value('task', '');spider_form_submit(event, 'adminForm');" value="Cancel" class="button-secondary action">
762
+ </td>
763
+ </tr>
764
+ </tbody>
765
+ </table>
766
+ <table class="admintable">
767
+ <tr>
768
+ <td class="key"><label for="ID">ID: </label></td>
769
+ <td><?php echo $rows[0]->group_id; ?></td>
770
+ </tr>
771
+ <tr>
772
+ <td class="key"><label for="Date">Date: </label></td>
773
+ <td><?php echo $rows[0]->date; ?></td>
774
+ </tr>
775
+ <tr>
776
+ <td class="key"><label for="IP">IP: </label></td>
777
+ <td><?php echo $rows[0]->ip; ?></td>
778
+ </tr>
779
+ <?php
780
+ foreach ($labels_id as $key => $label_id) {
781
+ if ($this->model->check_type_for_edit_function($labels_type[$key])) {
782
+ $element_value = $this->model->check_for_submited_label($rows, $label_id);
783
+ if ($element_value == "continue") {
784
+ continue;
785
+ }
786
+ switch ($labels_type[$key]) {
787
+ case 'type_checkbox':
788
+ $choices = explode('***br***', $element_value);
789
+ $choices = array_slice($choices, 0, count($choices) - 1);
790
+ ?>
791
+ <tr>
792
+ <td class="key" rowspan="<?php echo count($choices); ?>">
793
+ <label for="title"><?php echo $labels_name[$key]; ?></label>
794
+ </td>
795
+ <?php
796
+ foreach ($choices as $choice_key => $choice) {
797
+ ?>
798
+ <td>
799
+ <input type="text" name="submission_<?php echo $label_id.'_'.$choice_key; ?>" id="submission_<?php echo $label_id.'_'.$choice_key; ?>" value="<?php echo $choice; ?>" size="80" />
800
+ </td>
801
+ </tr>
802
+ <?php
803
+ }
804
+ break;
805
+ case 'type_paypal_payment_status':
806
+ ?>
807
+ <tr>
808
+ <td class="key">
809
+ <label for="title"><?php echo $labels_name[$key]; ?></label>
810
+ </td>
811
+ <td>
812
+ <select name="submission_0" id="submission_0" >
813
+ <option value=""></option>
814
+ <option value="Canceled" >Canceled</option>
815
+ <option value="Cleared" >Cleared</option>
816
+ <option value="Cleared by payment review" >Cleared by payment review</option>
817
+ <option value="Completed" >Completed</option>
818
+ <option value="Denied" >Denied</option>
819
+ <option value="Failed" >Failed</option>
820
+ <option value="Held" >Held</option>
821
+ <option value="In progress" >In progress</option>
822
+ <option value="On hold" >On hold</option>
823
+ <option value="Paid" >Paid</option>
824
+ <option value="Partially refunded" >Partially refunded</option>
825
+ <option value="Pending verification" >Pending verification</option>
826
+ <option value="Placed" >Placed</option>
827
+ <option value="Processing" >Processing</option>
828
+ <option value="Refunded" >Refunded</option>
829
+ <option value="Refused" >Refused</option>
830
+ <option value="Removed" >Removed</option>
831
+ <option value="Returned" >Returned</option>
832
+ <option value="Reversed" >Reversed</option>
833
+ <option value="Temporary hold" >Temporary hold</option>
834
+ <option value="Unclaimed" >Unclaimed</option>
835
+ </select>
836
+ <script>
837
+ var element = document.getElementById("submission_0");
838
+ element.value = "<?php echo $element_value; ?>";
839
+ </script>
840
+ </td>
841
+ </tr>
842
+ <?php
843
+ break;
844
+ case 'type_star_rating':
845
+ $star_rating_array = $this->model->images_for_star_rating($element_value, $label_id);
846
+ $edit_stars = $star_rating_array[0];
847
+ $stars_value = $star_rating_array[1];
848
+ ?>
849
+ <tr>
850
+ <td class="key">
851
+ <label for="title"><?php echo $labels_name[$key]; ?></label>
852
+ </td>
853
+ <td>
854
+ <input type="hidden" id="<?php echo $label_id; ?>_star_amountform_id_temp" name="<?php echo $label_id; ?>_star_amountform_id_temp" value="<?php echo $stars_value[0]; ?>">
855
+ <input type="hidden" name="<?php echo $label_id; ?>_star_colorform_id_temp" id="<?php echo $label_id; ?>_star_colorform_id_temp" value="<?php echo $stars_value[2]; ?>">
856
+ <input type="hidden" id="<?php echo $label_id; ?>_selected_star_amountform_id_temp" name="<?php echo $label_id; ?>_selected_star_amountform_id_temp" value="<?php echo $stars_value[1]; ?>">
857
+ <?php echo $edit_stars; ?>
858
+ <input type="hidden" name="submission_<?php echo $label_id; ?>" id="submission_<?php echo $label_id; ?>" value="<?php echo $element_value; ?>" size="80" />
859
+ </td>
860
+ </tr>
861
+ <?php
862
+ break;
863
+ case "type_scale_rating":
864
+ $scale_rating_array = $this->model->params_for_scale_rating($element_value, $label_id);
865
+ $scale = $scale_rating_array[0];
866
+ $scale_radio = $scale_rating_array[1];
867
+ $checked = $scale_rating_array[2];
868
+ ?>
869
+ <tr>
870
+ <td class="key">
871
+ <label for="title"><?php echo $labels_name[$key]; ?></label>
872
+ </td>
873
+ <td>
874
+ <input type="hidden" id="<?php echo $label_id; ?>_scale_checkedform_id_temp" name="<?php echo $label_id; ?>_scale_checkedform_id_temp" value="<?php echo $scale_radio[1]; ?>">
875
+ <?php echo $scale; ?>
876
+ <input type="hidden" name="submission_<?php echo $label_id; ?>" id="submission_<?php echo $label_id; ?>" value="<?php echo $element_value; ?>" size="80" />
877
+ </td>
878
+ </tr>
879
+ <?php
880
+ break;
881
+ case 'type_range':
882
+ $range = $this->model->params_for_type_range($element_value, $label_id);
883
+ ?>
884
+ <tr>
885
+ <td class="key">
886
+ <label for="title"><?php echo $labels_name[$key]; ?></label>
887
+ </td>
888
+ <td>
889
+ <?php echo $range; ?>
890
+ <input type="hidden" name="submission_<?php echo $label_id; ?>" id="submission_<?php echo $label_id; ?>" value="<?php echo $element_value; ?>" size="80" />
891
+ </td>
892
+ </tr>
893
+ <?php
894
+ break;
895
+ case 'type_spinner':
896
+ ?>
897
+ <tr>
898
+ <td class="key">
899
+ <label for="title"><?php echo $labels_name[$key]; ?></label>
900
+ </td>
901
+ <td>
902
+ <input type="text" name="submission_<?php echo $label_id; ?>" id="submission_<?php echo $label_id; ?>" value="<?php echo str_replace("*@@url@@*", '', $element_value); ?>" size="20" />
903
+ </td>
904
+ </tr>
905
+ <?php
906
+ break;
907
+ case 'type_grading':
908
+ $type_grading_array = $this->model->params_for_type_grading($element_value, $label_id);
909
+ $garding = $type_grading_array[0];
910
+ $garding_value = $type_grading_array[1];
911
+ $sum = $type_grading_array[2];
912
+ $items_count = $type_grading_array[3];
913
+ $element_value1 = $type_grading_array[4];
914
+ ?>
915
+ <tr>
916
+ <td class="key">
917
+ <label for="title"><?php echo $labels_name[$key]; ?></label>
918
+ </td>
919
+ <td>
920
+ <?php echo $garding; ?>
921
+ <span id="<?php echo $label_id; ?>_grading_sumform_id_temp"><?php echo $sum; ?></span>/<span id="<?php echo $label_id; ?>_grading_totalform_id_temp"><?php echo $garding_value[$items_count]; ?></span><span id="<?php echo $label_id; ?>_text_elementform_id_temp"></span>
922
+ <input type="hidden" id="<?php echo $label_id; ?>_element_valueform_id_temp" name="<?php echo $label_id; ?>_element_valueform_id_temp" value="<?php echo $element_value1; ?>" />
923
+ <input type="hidden" id="<?php echo $label_id; ?>_grading_totalform_id_temp" name="<?php echo $label_id; ?>_grading_totalform_id_temp" value="<?php echo $garding_value[$items_count]; ?>" />
924
+ <input type="hidden" name="submission_<?php echo $label_id; ?>" id="submission_<?php echo $label_id; ?>" value="<?php echo $element_value; ?>" size="80" />
925
+ </td>
926
+ </tr>
927
+ <?php
928
+ break;
929
+ case 'type_matrix':
930
+ $type_matrix_array = $this->model->params_for_type_matrix($element_value, $label_id);
931
+ $matrix = $type_matrix_array[0];
932
+ $new_filename = $type_matrix_array[1];
933
+ ?>
934
+ <tr>
935
+ <td class="key">
936
+ <label for="title"><?php echo $labels_name[$key]; ?></label>
937
+ </td>
938
+ <td>
939
+ <input type="hidden" id="<?php echo $label_id; ?>_matrixform_id_temp" name="<?php echo $label_id; ?>_matrixform_id_temp" value="<?php echo $new_filename; ?>">
940
+ <?php echo $matrix; ?>
941
+ <input type="hidden" name="submission_<?php echo $label_id; ?>" id="submission_<?php echo $label_id; ?>" value="<?php echo $element_value; ?>" size="80" />
942
+ </td>
943
+ </tr>
944
+ <?php
945
+ break;
946
+ default:
947
+ ?>
948
+ <tr>
949
+ <td class="key">
950
+ <label for="title"><?php echo $labels_name[$key]; ?></label>
951
+ </td>
952
+ <td>
953
+ <input type="text" name="submission_<?php echo $label_id; ?>" id="submission_<?php echo $label_id; ?>" value="<?php echo str_replace("*@@url@@*", '', $element_value); ?>" size="80" />
954
+ </td>
955
+ </tr>
956
+ <?php
957
+ break;
958
+ }
959
+ }
960
+ }
961
+ ?>
962
+ </table>
963
+ <input type="hidden" name="option" value="com_formmaker"/>
964
+ <input type="hidden" id="current_id" name="current_id" value="<?php echo $rows[0]->group_id; ?>" />
965
+ <input type="hidden" name="form_id" value="<?php echo $rows[0]->form_id; ?>" />
966
+ <input type="hidden" name="date" value="<?php echo $rows[0]->date; ?>" />
967
+ <input type="hidden" name="ip" value="<?php echo $rows[0]->ip; ?>" />
968
+ <input type="hidden" id="task" name="task" value="" />
969
+ <input type="hidden" value="<?php echo WD_FM_URL; ?>" id="form_plugins_url" />
970
+ <script>
971
+ plugin_url = document.getElementById('form_plugins_url').value;
972
+ </script>
973
+ </form>
974
+ <?php
975
+ }
976
+
977
+ public function new_edit($id) {
978
+ $current_id = ((isset($id)) ? $id : 0);
979
+ $params = $this->model->get_data_of_group_id($current_id);
980
+ $rows = $params[0];
981
+ $labels_id = $params[1];
982
+ $labels_name = $params[2];
983
+ $labels_type = $params[3];
984
+ $ispaypal = $params[4];
985
+ $form = $params[5];
986
+ $form_theme = $params[6];
987
+ ?>
988
+ <form action="admin.php?page=submissions_fm" method="post" id="formform_id_temp" name="formform_id_temp">
989
+ <table width="99%">
990
+ <tbody>
991
+ <tr>
992
+ <td width="100%"><h2>Edit Submission</h2></td>
993
+ <td align="right">
994
+ <input type="button" class="button-secondary" onclick="pressbutton();
995
+ spider_set_input_value('task', 'save');
996
+ spider_set_input_value('current_id', <?php echo $current_id ;?>);
997
+ spider_form_submit(event, 'formform_id_temp');" value="Save" class="button-secondary action">
998
+ </td>
999
+ <td align="right">
1000
+ <input type="button" class="button-secondary" onclick="pressbutton();
1001
+ spider_set_input_value('task', 'apply');
1002
+ spider_set_input_value('current_id', <?php echo $current_id ;?>);
1003
+ spider_form_submit(event, 'formform_id_temp');" value="Apply" class="button-secondary action">
1004
+ </td>
1005
+ <td align="right">
1006
+ <input class="button-secondary" type="button" onclick="spider_set_input_value('task', '');spider_form_submit(event, 'formform_id_temp');" value="Cancel" class="button-secondary action">
1007
+ </td>
1008
+ </tr>
1009
+ </tbody>
1010
+ </table>
1011
+ <table class="admintable">
1012
+ <tr>
1013
+ <td class="spider_label"><label for="ID">ID: </label></td>
1014
+ <td><?php echo $rows[0]->group_id; ?></td>
1015
+ </tr>
1016
+ <tr>
1017
+ <td class="spider_label"><label for="Date">Date: </label></td>
1018
+ <td><?php echo $rows[0]->date; ?></td>
1019
+ </tr>
1020
+ <tr>
1021
+ <td class="spider_label"><label for="IP">IP: </label></td>
1022
+ <td><?php echo $rows[0]->ip; ?></td>
1023
+ </tr>
1024
+ </table>
1025
+ <?php
1026
+ $css_rep1 = array("[SITE_ROOT]");
1027
+ $css_rep2 = array(WD_FM_URL);
1028
+ $order = array("\r\n", "\n", "\r");
1029
+ $form_theme = str_replace($order, '', $form_theme);
1030
+ $form_theme = str_replace($css_rep1, $css_rep2, $form_theme);
1031
+ $form_theme = "#form" . $form->id . ' ' . $form_theme;
1032
+ ?>
1033
+ <style>
1034
+ <?php
1035
+ echo $form_theme;
1036
+ ?>
1037
+ .wdform-page-and-images{
1038
+ width: 50%;
1039
+ }
1040
+ .wdform-page-and-images div {
1041
+ background-color: rgba(0, 0, 0, 0);
1042
+ }
1043
+ </style>
1044
+ <?php
1045
+ $form_currency = '$';
1046
+ $check_js = '';
1047
+ $onload_js = '';
1048
+ $onsubmit_js = '';
1049
+ $currency_code = array('USD', 'EUR', 'GBP', 'JPY', 'CAD', 'MXN', 'HKD', 'HUF', 'NOK', 'NZD', 'SGD', 'SEK', 'PLN', 'AUD', 'DKK', 'CHF', 'CZK', 'ILS', 'BRL', 'TWD', 'MYR', 'PHP', 'THB');
1050
+ $currency_sign = array('$' , '€' , '£' , '¥' , 'C$', 'Mex$', 'HK$', 'Ft' , 'kr' , 'NZ$', 'S$' , 'kr' , 'zl' , 'A$' , 'kr' , 'CHF' , 'Kc', '?' , 'R$' , 'NT$', 'RM' , '?' , '?' );
1051
+ $is_type = array();
1052
+ $id1s = array();
1053
+ $types = array();
1054
+ $labels = array();
1055
+ $paramss = array();
1056
+ $fields = explode('*:*new_field*:*', $form->form_fields);
1057
+ $fields = array_slice($fields, 0, count($fields) - 1);
1058
+ foreach ($fields as $field) {
1059
+ $temp = explode('*:*id*:*',$field);
1060
+ array_push($id1s, $temp[0]);
1061
+ $temp = explode('*:*type*:*', $temp[1]);
1062
+ array_push($types, $temp[0]);
1063
+ $temp = explode('*:*w_field_label*:*', $temp[1]);
1064
+ array_push($labels, $temp[0]);
1065
+ array_push($paramss, $temp[1]);
1066
+ }
1067
+ $form = $form->form_front;
1068
+ $form_id = 'form_id_temp';
1069
+ $start = 0;
1070
+ foreach ($id1s as $id1s_key => $id1) {
1071
+ $label = $labels[$id1s_key];
1072
+ $type = $types[$id1s_key];
1073
+ $params = $paramss[$id1s_key];
1074
+ if ($type != 'type_address') {
1075
+ foreach ($rows as $row) {
1076
+ if ($row->element_label == $id1) {
1077
+ $element_value = $row->element_value;
1078
+ break;
1079
+ }
1080
+ else {
1081
+ $element_value = '';
1082
+ }
1083
+ }
1084
+ }
1085
+ else {
1086
+ for ($i = 0; $i < 6; $i++) {
1087
+ $address_value = '';
1088
+ foreach ($rows as $row) {
1089
+ if ($row->element_label == (string)((int) $id1 + $i)) {
1090
+ $address_value = $row->element_value;
1091
+ }
1092
+ }
1093
+ $elements_of_address[$i] = $address_value;
1094
+ }
1095
+ }
1096
+ if (strpos($form, '%' . $id1 . ' - ' . $label . '%')) {
1097
+ $rep = '';
1098
+ $param = array();
1099
+ $param['attributes'] = '';
1100
+ $is_type[$type] = TRUE;
1101
+ switch ($type) {
1102
+ case 'type_section_break':
1103
+ case 'type_editor':
1104
+ case 'type_file_upload':
1105
+ case 'type_captcha':
1106
+ case 'type_recaptcha':
1107
+ case 'type_mark_map':
1108
+ case 'type_map':
1109
+ case 'type_submit_reset':
1110
+ case 'type_button':
1111
+ case 'type_paypal_total':
1112
+ break;
1113
+
1114
+ case 'type_text': {
1115
+ $params_names = array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_required','w_unique');
1116
+ $temp = $params;
1117
+ foreach ($params_names as $params_name ) {
1118
+ $temp = explode('*:*'.$params_name.'*:*', $temp);
1119
+ $param[$params_name] = $temp[0];
1120
+ $temp = $temp[1];
1121
+ }
1122
+ if ($temp) {
1123
+ $temp = explode('*:*w_attr_name*:*', $temp);
1124
+ $attrs = array_slice($temp, 0, count($temp) - 1);
1125
+ foreach ($attrs as $attr) {
1126
+ $param['attributes'] = $param['attributes'].' '.$attr;
1127
+ }
1128
+ }
1129
+ $wdformfieldsize = ($param['w_field_label_pos'] == "left" ? $param['w_field_label_size']+$param['w_size'] : max($param['w_field_label_size'],$param['w_size']));
1130
+ $param['w_field_label_pos'] = ($param['w_field_label_pos'] == "left" ? "float: left;" : "display:block;");
1131
+ $rep ='<div type="type_text" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" style="'.$param['w_field_label_pos'].' width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
1132
+ $rep.='</div><div class="wdform-element-section" style="width: '.$param['w_size'].'px;" ><input type="text" class="" id="wdform_'.$id1.'_element'.$form_id.'" name="wdform_'.$id1.'_element'.$form_id.'" value="'.$element_value.'" style="width: 100%;" '.$param['attributes'].'></div></div>';
1133
+ break;
1134
+ }
1135
+
1136
+ case 'type_number': {
1137
+ $params_names = array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_required','w_unique','w_class');
1138
+ $temp = $params;
1139
+ foreach ($params_names as $params_name ) {
1140
+ $temp = explode('*:*'.$params_name.'*:*', $temp);
1141
+ $param[$params_name] = $temp[0];
1142
+ $temp = $temp[1];
1143
+ }
1144
+ if ($temp) {
1145
+ $temp =explode('*:*w_attr_name*:*',$temp);
1146
+ $attrs = array_slice($temp,0, count($temp)-1);
1147
+ foreach($attrs as $attr)
1148
+ $param['attributes'] = $param['attributes'].' '.$attr;
1149
+ }
1150
+
1151
+ $wdformfieldsize = ($param['w_field_label_pos']=="left" ? $param['w_field_label_size']+$param['w_size'] : max($param['w_field_label_size'],$param['w_size']));
1152
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
1153
+
1154
+ $rep ='<div type="type_number" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" class="'.$param['w_class'].'" style="'.$param['w_field_label_pos'].' width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
1155
+
1156
+ $rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="width: '.$param['w_size'].'px;"><input type="text" class="" id="wdform_'.$id1.'_element'.$form_id.'" name="wdform_'.$id1.'_element'.$form_id.'" value="'.$element_value.'" style="width: 100%;" '.$param['attributes'].'></div></div>';
1157
+
1158
+ break;
1159
+ }
1160
+
1161
+ case 'type_password': {
1162
+ $params_names=array('w_field_label_size','w_field_label_pos','w_size','w_required','w_unique','w_class');
1163
+ $temp=$params;
1164
+
1165
+ foreach($params_names as $params_name ) {
1166
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1167
+ $param[$params_name] = $temp[0];
1168
+ $temp=$temp[1];
1169
+ }
1170
+
1171
+ if($temp) {
1172
+ $temp =explode('*:*w_attr_name*:*',$temp);
1173
+ $attrs = array_slice($temp,0, count($temp)-1);
1174
+ foreach($attrs as $attr)
1175
+ $param['attributes'] = $param['attributes'].' '.$attr;
1176
+ }
1177
+
1178
+ $wdformfieldsize = ($param['w_field_label_pos']=="left" ? $param['w_field_label_size']+$param['w_size'] : max($param['w_field_label_size'],$param['w_size']));
1179
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
1180
+
1181
+
1182
+ $rep ='<div type="type_password" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" class="'.$param['w_class'].'" style="'.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
1183
+
1184
+ $rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="width: '.$param['w_size'].'px;"><input type="password" id="wdform_'.$id1.'_element'.$form_id.'" name="wdform_'.$id1.'_element'.$form_id.'" value="'.$element_value.'" style="width: 100%;" '.$param['attributes'].'></div></div>';
1185
+
1186
+
1187
+ break;
1188
+ }
1189
+
1190
+ case 'type_textarea': {
1191
+ $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');
1192
+ $temp=$params;
1193
+
1194
+ foreach($params_names as $params_name ) {
1195
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1196
+ $param[$params_name] = $temp[0];
1197
+ $temp=$temp[1];
1198
+ }
1199
+
1200
+
1201
+ if($temp) {
1202
+ $temp =explode('*:*w_attr_name*:*',$temp);
1203
+ $attrs = array_slice($temp,0, count($temp)-1);
1204
+ foreach($attrs as $attr)
1205
+ $param['attributes'] = $param['attributes'].' '.$attr;
1206
+ }
1207
+
1208
+
1209
+
1210
+ $wdformfieldsize = ($param['w_field_label_pos']=="left" ? $param['w_field_label_size']+$param['w_size_w'] : max($param['w_field_label_size'],$param['w_size_w']));
1211
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
1212
+
1213
+
1214
+ $rep ='<div type="type_textarea" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" style="'.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
1215
+
1216
+ $rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="width: '.$param['w_size_w'].'px"><textarea class="" id="wdform_'.$id1.'_element'.$form_id.'" name="wdform_'.$id1.'_element'.$form_id.'" title="'.$param['w_title'].'" style="width: 100%; height: '.$param['w_size_h'].'px;" '.$param['attributes'].'>'.$element_value.'</textarea></div></div>';
1217
+
1218
+
1219
+
1220
+ break;
1221
+ }
1222
+
1223
+ case 'type_wdeditor': {
1224
+ $params_names=array('w_field_label_size','w_field_label_pos','w_size_w','w_size_h','w_title','w_required','w_class');
1225
+ $temp=$params;
1226
+
1227
+ foreach($params_names as $params_name ) {
1228
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1229
+ $param[$params_name] = $temp[0];
1230
+ $temp=$temp[1];
1231
+ }
1232
+
1233
+ if($temp) {
1234
+ $temp =explode('*:*w_attr_name*:*',$temp);
1235
+ $attrs = array_slice($temp,0, count($temp)-1);
1236
+ foreach($attrs as $attr)
1237
+ $param['attributes'] = $param['attributes'].' '.$attr;
1238
+ }
1239
+
1240
+ $wdformfieldsize = ($param['w_field_label_pos']=="left" ? $param['w_field_label_size']+$param['w_size_w']+10 : max($param['w_field_label_size'],$param['w_size_w']));
1241
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
1242
+
1243
+ $rep ='<div type="type_wdeditor" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" style="'.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
1244
+
1245
+ $rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="width: '.$param['w_size_w'].'px">';
1246
+
1247
+ if(user_can_richedit()) {
1248
+ ob_start();
1249
+ wp_editor($element_value, 'wdform_'.$id1.'_wd_editor'.$form_id, array('teeny' => FALSE, 'media_buttons' => FALSE, 'textarea_rows' => 5));
1250
+ $wd_editor = ob_get_clean();
1251
+ }
1252
+ else {
1253
+ $wd_editor='
1254
+ <textarea class="'.$param['w_class'].'" name="wdform_'.$id1.'_wd_editor'.$form_id.'" id="wdform_'.$id1.'_wd_editor'.$form_id.'" style="width: '.$param['w_size_w'].'px; height: '.$param['w_size_h'].'px; " class="mce_editable" aria-hidden="true">'.$element_value.'</textarea>';
1255
+ }
1256
+
1257
+ $rep.= $wd_editor.'</div></div>';
1258
+
1259
+ break;
1260
+ }
1261
+
1262
+ case 'type_phone': {
1263
+
1264
+ if($element_value=='')
1265
+ $element_value = ' ';
1266
+
1267
+ $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');
1268
+ $temp=$params;
1269
+
1270
+ foreach($params_names as $params_name ) {
1271
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1272
+ $param[$params_name] = $temp[0];
1273
+ $temp=$temp[1];
1274
+ }
1275
+
1276
+ if($temp) {
1277
+ $temp =explode('*:*w_attr_name*:*',$temp);
1278
+ $attrs = array_slice($temp,0, count($temp)-1);
1279
+ foreach($attrs as $attr)
1280
+ $param['attributes'] = $param['attributes'].' '.$attr;
1281
+ }
1282
+
1283
+ $element_value = explode(' ',$element_value);
1284
+
1285
+ $wdformfieldsize = ($param['w_field_label_pos']=="left" ? ($param['w_field_label_size']+$param['w_size']+65) : max($param['w_field_label_size'],($param['w_size']+65)));
1286
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
1287
+
1288
+ $w_mini_labels = explode('***',$param['w_mini_labels']);
1289
+
1290
+ $rep ='<div type="type_phone" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section '.$param['w_class'].'" style="'.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label" >'.$label.'</span>';
1291
+
1292
+ $rep.='
1293
+ </div>
1294
+ <div class="wdform-element-section '.$param['w_class'].'" style="width: '.($param['w_size']+65).'px;">
1295
+ <div style="display: table-cell;vertical-align: middle;">
1296
+ <div><input type="text" class="" id="wdform_'.$id1.'_element_first'.$form_id.'" name="wdform_'.$id1.'_element_first'.$form_id.'" value="'.$element_value[0].'" style="width: 50px;" '.$param['attributes'].'></div>
1297
+ <div><label class="mini_label">'.$w_mini_labels[0].'</label></div>
1298
+ </div>
1299
+ <div style="display: table-cell;vertical-align: middle;">
1300
+ <div class="wdform_line" style="margin: 0px 4px 10px 4px; padding: 0px;">-</div>
1301
+ </div>
1302
+ <div style="display: table-cell;vertical-align: middle; width:100%;">
1303
+ <div><input type="text" class="" id="wdform_'.$id1.'_element_last'.$form_id.'" name="wdform_'.$id1.'_element_last'.$form_id.'" value="'.$element_value[1].'" style="width: 100%;" '.$param['attributes'].'></div>
1304
+ <div><label class="mini_label">'.$w_mini_labels[1].'</label></div>
1305
+ </div>
1306
+ </div>
1307
+ </div>';
1308
+
1309
+ break;
1310
+ }
1311
+
1312
+ case 'type_name': {
1313
+
1314
+ if($element_value =='')
1315
+ $element_value = '@@@';
1316
+
1317
+ $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');
1318
+ $temp=$params;
1319
+
1320
+ foreach($params_names as $params_name ) {
1321
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1322
+ $param[$params_name] = $temp[0];
1323
+ $temp=$temp[1];
1324
+ }
1325
+
1326
+
1327
+ if($temp) {
1328
+ $temp =explode('*:*w_attr_name*:*',$temp);
1329
+ $attrs = array_slice($temp,0, count($temp)-1);
1330
+ foreach($attrs as $attr)
1331
+ $param['attributes'] = $param['attributes'].' '.$attr;
1332
+ }
1333
+
1334
+ $w_mini_labels = explode('***',$param['w_mini_labels']);
1335
+
1336
+ $element_value = explode('@@@',$element_value);
1337
+
1338
+ if($param['w_name_format']=='normal') {
1339
+ $w_name_format = '
1340
+ <div style="display: table-cell; width:50%">
1341
+ <div><input type="text" class="" id="wdform_'.$id1.'_element_first'.$form_id.'" name="wdform_'.$id1.'_element_first'.$form_id.'" value="'.(count($element_value)==2 ? $element_value[0] : $element_value[1]).'" style="width: 100%;"'.$param['attributes'].'></div>
1342
+ <div><label class="mini_label">'.$w_mini_labels[1].'</label></div>
1343
+ </div>
1344
+ <div style="display:table-cell;"><div style="margin: 0px 8px; padding: 0px;"></div></div>
1345
+ <div style="display: table-cell; width:50%">
1346
+ <div><input type="text" class="" id="wdform_'.$id1.'_element_last'.$form_id.'" name="wdform_'.$id1.'_element_last'.$form_id.'" value="'.(count($element_value)==2 ? $element_value[1] : $element_value[2]).'" style="width: 100%;" '.$param['attributes'].'></div>
1347
+ <div><label class="mini_label">'.$w_mini_labels[2].'</label></div>
1348
+ </div>
1349
+ ';
1350
+ $w_size=2*$param['w_size'];
1351
+
1352
+ }
1353
+ else {
1354
+ $w_name_format = '
1355
+ <div style="display: table-cell;">
1356
+ <div><input type="text" class="" id="wdform_'.$id1.'_element_title'.$form_id.'" name="wdform_'.$id1.'_element_title'.$form_id.'" value="'.(count($element_value)==2 ? "" : $element_value[0]).'" style="width: 40px;"></div>
1357
+ <div><label class="mini_label">'.$w_mini_labels[0].'</label></div>
1358
+ </div>
1359
+ <div style="display:table-cell;"><div style="margin: 0px 1px; padding: 0px;"></div></div>
1360
+ <div style="display: table-cell; width:30%">
1361
+ <div><input type="text" class="" id="wdform_'.$id1.'_element_first'.$form_id.'" name="wdform_'.$id1.'_element_first'.$form_id.'" value="'.(count($element_value)==2 ? $element_value[0] : $element_value[1]).'" style="width:100%;"></div>
1362
+ <div><label class="mini_label">'.$w_mini_labels[1].'</label></div>
1363
+ </div>
1364
+ <div style="display:table-cell;"><div style="margin: 0px 4px; padding: 0px;"></div></div>
1365
+ <div style="display: table-cell; width:30%">
1366
+ <div><input type="text" class="" id="wdform_'.$id1.'_element_last'.$form_id.'" name="wdform_'.$id1.'_element_last'.$form_id.'" value="'.(count($element_value)==2 ? $element_value[1] : $element_value[2]).'" style="width: 100%;"></div>
1367
+ <div><label class="mini_label">'.$w_mini_labels[2].'</label></div>
1368
+ </div>
1369
+ <div style="display:table-cell;"><div style="margin: 0px 4px; padding: 0px;"></div></div>
1370
+ <div style="display: table-cell; width:30%">
1371
+ <div><input type="text" class="" id="wdform_'.$id1.'_element_middle'.$form_id.'" name="wdform_'.$id1.'_element_middle'.$form_id.'" value="'.(count($element_value)==2 ? "" : $element_value[3]).'" style="width: 100%;"></div>
1372
+ <div><label class="mini_label">'.$w_mini_labels[3].'</label></div>
1373
+ </div>
1374
+ ';
1375
+ $w_size=3*$param['w_size']+80;
1376
+ }
1377
+
1378
+ $wdformfieldsize = ($param['w_field_label_pos']=="left" ? ($param['w_field_label_size']+$w_size) : max($param['w_field_label_size'],$w_size));
1379
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
1380
+
1381
+ $rep ='<div type="type_name" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" style="'.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
1382
+
1383
+ $rep.='</div>
1384
+ <div class="wdform-element-section '.$param['w_class'].'" style="width: '.$w_size.'px;">'.$w_name_format.'</div></div>';
1385
+
1386
+ break;
1387
+ }
1388
+
1389
+ case 'type_address': {
1390
+ $params_names = array('w_field_label_size','w_field_label_pos','w_size','w_mini_labels','w_disabled_fields','w_required','w_class');
1391
+ $temp = $params;
1392
+ foreach($params_names as $params_name ) {
1393
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1394
+ $param[$params_name] = $temp[0];
1395
+ $temp=$temp[1];
1396
+ }
1397
+
1398
+ if($temp) {
1399
+ $temp =explode('*:*w_attr_name*:*',$temp);
1400
+ $attrs = array_slice($temp,0, count($temp)-1);
1401
+ foreach($attrs as $attr)
1402
+ $param['attributes'] = $param['attributes'].' '.$attr;
1403
+ }
1404
+
1405
+ $wdformfieldsize = ($param['w_field_label_pos']=="left" ? ($param['w_field_label_size']+$param['w_size']) : max($param['w_field_label_size'], $param['w_size']));
1406
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
1407
+
1408
+ $w_mini_labels = explode('***',$param['w_mini_labels']);
1409
+ $w_disabled_fields = explode('***',$param['w_disabled_fields']);
1410
+
1411
+ $rep ='<div type="type_address" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" style="'.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
1412
+
1413
+ $address_fields ='';
1414
+ $g=0;
1415
+ if (isset($w_disabled_fields[0]) && $w_disabled_fields[0]=='no') {
1416
+ $g+=2;
1417
+ $address_fields .= '<span style="float: left; width: 100%; padding-bottom: 8px; display: block;"><input type="text" id="wdform_'.$id1.'_street1'.$form_id.'" name="wdform_'.$id1.'_street1'.$form_id.'" value="'.$elements_of_address[0].'" style="width: 100%;" '.$param['attributes'].'><label class="mini_label" >'.$w_mini_labels[0].'</label></span>';
1418
+ }
1419
+ if (isset($w_disabled_fields[1]) && $w_disabled_fields[1]=='no') {
1420
+ $g+=2;
1421
+ $address_fields .= '<span style="float: left; width: 100%; padding-bottom: 8px; display: block;"><input type="text" id="wdform_'.$id1.'_street2'.$form_id.'" name="wdform_'.($id1+1).'_street2'.$form_id.'" value="'.$elements_of_address[1].'" style="width: 100%;" '.$param['attributes'].'><label class="mini_label" >'.$w_mini_labels[1].'</label></span>';
1422
+ }
1423
+ if (isset($w_disabled_fields[2]) && $w_disabled_fields[2]=='no') {
1424
+ $g++;
1425
+ $address_fields .= '<span style="float: left; width: 48%; padding-bottom: 8px;"><input type="text" id="wdform_'.$id1.'_city'.$form_id.'" name="wdform_'.($id1+2).'_city'.$form_id.'" value="'.$elements_of_address[2].'" style="width: 100%;" '.$param['attributes'].'><label class="mini_label" >'.$w_mini_labels[2].'</label></span>';
1426
+ }
1427
+ if (isset($w_disabled_fields[3]) && $w_disabled_fields[3]=='no') {
1428
+ $g++;
1429
+ $w_states = array("","Alabama","Alaska", "Arizona","Arkansas","California","Colorado","Connecticut","Delaware","District Of Columbia","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming");
1430
+ $w_state_options = '';
1431
+ foreach($w_states as $w_state) {
1432
+ if($w_state == $elements_of_address[3])
1433
+ $selected = 'selected=\"selected\"';
1434
+ else
1435
+ $selected = '';
1436
+ $w_state_options .= '<option value="'.$w_state.'" '.$selected.'>'.$w_state.'</option>';
1437
+ }
1438
+ if(isset($w_disabled_fields[5]) && $w_disabled_fields[5]=='yes' && isset($w_disabled_fields[6]) && $w_disabled_fields[6]=='yes') {
1439
+ $address_fields .= '<span style="float: '.(($g%2==0) ? 'right' : 'left').'; width: 48%; padding-bottom: 8px;"><select type="text" id="wdform_'.$id1.'_state'.$form_id.'" name="wdform_'.($id1+3).'_state'.$form_id.'" style="width: 100%;" '.$param['attributes'].'>'.$w_state_options.'</select><label class="mini_label" style="display: block;" id="'.$id1.'_mini_label_state">'.$w_mini_labels[3].'</label></span>';
1440
+ }
1441
+ else
1442
+ $address_fields .= '<span style="float: '.(($g%2==0) ? 'right' : 'left').'; width: 48%; padding-bottom: 8px;"><input type="text" id="wdform_'.$id1.'_state'.$form_id.'" name="wdform_'.($id1+3).'_state'.$form_id.'" value="'.$elements_of_address[3].'" style="width: 100%;" '.$param['attributes'].'><label class="mini_label">'.$w_mini_labels[3].'</label></span>';
1443
+ }
1444
+ if (isset($w_disabled_fields[4]) && $w_disabled_fields[4]=='no') {
1445
+ $g++;
1446
+ $address_fields .= '<span style="float: '.(($g%2==0) ? 'right' : 'left').'; width: 48%; padding-bottom: 8px;"><input type="text" id="wdform_'.$id1.'_postal'.$form_id.'" name="wdform_'.($id1+4).'_postal'.$form_id.'" value="'.$elements_of_address[4].'" style="width: 100%;" '.$param['attributes'].'><label class="mini_label">'.$w_mini_labels[4].'</label></span>';
1447
+ }
1448
+ $w_countries = array("","Afghanistan","Albania","Algeria","Andorra","Angola","Antigua and Barbuda","Argentina","Armenia","Australia","Austria","Azerbaijan","Bahamas","Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bhutan","Bolivia","Bosnia and Herzegovina","Botswana","Brazil","Brunei","Bulgaria","Burkina Faso","Burundi","Cambodia","Cameroon","Canada","Cape Verde","Central African Republic","Chad","Chile","China","Colombi","Comoros","Congo (Brazzaville)","Congo","Costa Rica","Cote d'Ivoire","Croatia","Cuba","Cyprus","Czech Republic","Denmark","Djibouti","Dominica","Dominican Republic","East Timor (Timor Timur)","Ecuador","Egypt","El Salvador","Equatorial Guinea","Eritrea","Estonia","Ethiopia","Fiji","Finland","France","Gabon","Gambia, The","Georgia","Germany","Ghana","Greece","Grenada","Guatemala","Guinea","Guinea-Bissau","Guyana","Haiti","Honduras","Hungary","Iceland","India","Indonesia","Iran","Iraq","Ireland","Israel","Italy","Jamaica","Japan","Jordan","Kazakhstan","Kenya","Kiribati","Korea, North","Korea, South","Kuwait","Kyrgyzstan","Laos","Latvia","Lebanon","Lesotho","Liberia","Libya","Liechtenstein","Lithuania","Luxembourg","Macedonia","Madagascar","Malawi","Malaysia","Maldives","Mali","Malta","Marshall Islands","Mauritania","Mauritius","Mexico","Micronesia","Moldova","Monaco","Mongolia","Morocco","Mozambique","Myanmar","Namibia","Nauru","Nepa","Netherlands","New Zealand","Nicaragua","Niger","Nigeria","Norway","Oman","Pakistan","Palau","Panama","Papua New Guinea","Paraguay","Peru","Philippines","Poland","Portugal","Qatar","Romania","Russia","Rwanda","Saint Kitts and Nevis","Saint Lucia","Saint Vincent","Samoa","San Marino","Sao Tome and Principe","Saudi Arabia","Senegal","Serbia and Montenegro","Seychelles","Sierra Leone","Singapore","Slovakia","Slovenia","Solomon Islands","Somalia","South Africa","Spain","Sri Lanka","Sudan","Suriname","Swaziland","Sweden","Switzerland","Syria","Taiwan","Tajikistan","Tanzania","Thailand","Togo","Tonga","Trinidad and Tobago","Tunisia","Turkey","Turkmenistan","Tuvalu","Uganda","Ukraine","United Arab Emirates","United Kingdom","United States","Uruguay","Uzbekistan","Vanuatu","Vatican City","Venezuela","Vietnam","Yemen","Zambia","Zimbabwe");
1449
+ $w_options = '';
1450
+ foreach($w_countries as $w_country) {
1451
+ if($w_country == $elements_of_address[5])
1452
+ $selected = 'selected="selected"';
1453
+ else
1454
+ $selected = '';
1455
+ $w_options .= '<option value="'.$w_country.'" '.$selected.'>'.$w_country.'</option>';
1456
+ }
1457
+
1458
+ if (isset($w_disabled_fields[5]) && $w_disabled_fields[5]=='no') {
1459
+ $g++;
1460
+ $address_fields .= '<span style="float: '.(($g%2==0) ? 'right' : 'left').'; width: 48%; padding-bottom: 8px;display: inline-block;"><select type="text" id="wdform_'.$id1.'_country'.$form_id.'" name="wdform_'.($id1+5).'_country'.$form_id.'" style="width:100%" '.$param['attributes'].'>'.$w_options.'</select><label class="mini_label">'.$w_mini_labels[5].'</span>';
1461
+ }
1462
+
1463
+
1464
+ $rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="width: '.$param['w_size'].'px;"><div>
1465
+ '.$address_fields.'</div></div></div>';
1466
+ break;
1467
+ }
1468
+
1469
+ case 'type_submitter_mail': {
1470
+ $params_names=array('w_field_label_size','w_field_label_pos','w_size','w_first_val','w_title','w_required','w_unique', 'w_class');
1471
+ $temp=$params;
1472
+
1473
+ foreach($params_names as $params_name ) {
1474
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1475
+ $param[$params_name] = $temp[0];
1476
+ $temp=$temp[1];
1477
+ }
1478
+
1479
+
1480
+ if($temp) {
1481
+ $temp =explode('*:*w_attr_name*:*',$temp);
1482
+ $attrs = array_slice($temp,0, count($temp)-1);
1483
+ foreach($attrs as $attr)
1484
+ $param['attributes'] = $param['attributes'].' '.$attr;
1485
+ }
1486
+
1487
+
1488
+ $wdformfieldsize = ($param['w_field_label_pos']=="left" ? ($param['w_field_label_size']+$param['w_size']) : max($param['w_field_label_size'], $param['w_size']));
1489
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
1490
+
1491
+ $rep ='<div type="type_submitter_mail" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" style="'.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
1492
+
1493
+ $rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="width: '.$param['w_size'].'px;"><input type="text" class="" id="wdform_'.$id1.'_element'.$form_id.'" name="wdform_'.$id1.'_element'.$form_id.'" value="'.$element_value.'" title="'.$param['w_title'].'" style="width: 100%;" '.$param['attributes'].'></div></div>';
1494
+
1495
+
1496
+
1497
+ break;
1498
+ }
1499
+
1500
+ case 'type_checkbox': {
1501
+
1502
+ $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');
1503
+ $temp=$params;
1504
+
1505
+ foreach($params_names as $params_name ) {
1506
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1507
+ $param[$params_name] = $temp[0];
1508
+ $temp=$temp[1];
1509
+ }
1510
+
1511
+ if($temp) {
1512
+ $temp =explode('*:*w_attr_name*:*',$temp);
1513
+ $attrs = array_slice($temp,0, count($temp)-1);
1514
+ foreach($attrs as $attr)
1515
+ $param['attributes'] = $param['attributes'].' '.$attr;
1516
+ }
1517
+
1518
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
1519
+
1520
+ $element_value = explode('***br***',$element_value);
1521
+ $element_value = array_slice($element_value,0, count($element_value)-1);
1522
+
1523
+ $param['w_choices'] = explode('***',$param['w_choices']);
1524
+
1525
+ $is_other=false;
1526
+ $other_value = '';
1527
+
1528
+ foreach($element_value as $key => $value) {
1529
+ if(in_array($value, $param['w_choices'])==false) {
1530
+ $other_value = $value;
1531
+ $is_other=true;
1532
+ break;
1533
+ }
1534
+ }
1535
+
1536
+
1537
+ $rep='<div type="type_checkbox" class="wdform-field"><div class="wdform-label-section" style="'.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
1538
+
1539
+ $rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos'].';">';
1540
+
1541
+ $rep.='<div style="display: '.($param['w_flow']=='hor' ? 'inline-block' : 'table-row' ).'; vertical-align:top">';
1542
+
1543
+ foreach($param['w_choices'] as $key => $choice) {
1544
+ if($key%$param['w_rowcol']==0 && $key>0)
1545
+ $rep.='</div><div style="display: '.($param['w_flow']=='hor' ? 'inline-block' : 'table-row' ).'; vertical-align:top">';
1546
+
1547
+ $checked=(in_array($choice, $element_value)=='true' ? 'checked="checked"' : '');
1548
+
1549
+
1550
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key && $is_other)
1551
+ $checked = 'checked="checked"';
1552
+
1553
+
1554
+
1555
+ $rep.='<div style="display: '.($param['w_flow']!='hor' ? 'table-cell' : 'table-row' ).';"><label class="wdform-ch-rad-label" for="wdform_'.$id1.'_element'.$form_id.''.$key.'" ">'.$choice.'</label><div class="checkbox-div forlabs"><input type="checkbox" '.(($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key) ? 'other="1"' : '' ).' id="wdform_'.$id1.'_element'.$form_id.''.$key.'" name="wdform_'.$id1.'_element'.$form_id.''.$key.'" value="'.htmlspecialchars($choice).'" '.(($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key) ? 'onclick="if(set_checked(&quot;wdform_'.$id1.'&quot;,&quot;'.$key.'&quot;,&quot;'.$form_id.'&quot;)) show_other_input(&quot;wdform_'.$id1.'&quot;,&quot;'.$form_id.'&quot;);"' : '').' '.$checked.' '.$param['attributes'].'><label for="wdform_'.$id1.'_element'.$form_id.''.$key.'"></label></div></div>';
1556
+ }
1557
+ $rep.='</div>';
1558
+
1559
+ $rep.='</div></div>';
1560
+
1561
+ if($is_other)
1562
+ $onload_js .='show_other_input("wdform_'.$id1.'","'.$form_id.'"); jQuery("#wdform_'.$id1.'_other_input'.$form_id.'").val("'.$other_value.'");';
1563
+
1564
+ $onsubmit_js.='
1565
+ jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_allow_other'.$form_id.'\" value = \"'.$param['w_allow_other'].'\" />").appendTo("#form'.$form_id.'");
1566
+ jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_allow_other_num'.$form_id.'\" value = \"'.$param['w_allow_other_num'].'\" />").appendTo("#form'.$form_id.'");
1567
+ ';
1568
+
1569
+ break;
1570
+ }
1571
+
1572
+ case 'type_radio': {
1573
+ $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');
1574
+ $temp=$params;
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
+
1582
+ if($temp) {
1583
+ $temp =explode('*:*w_attr_name*:*',$temp);
1584
+ $attrs = array_slice($temp,0, count($temp)-1);
1585
+ foreach($attrs as $attr)
1586
+ $param['attributes'] = $param['attributes'].' '.$attr;
1587
+ }
1588
+
1589
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
1590
+ $param['w_choices'] = explode('***',$param['w_choices']);
1591
+ $is_other=true;
1592
+
1593
+ foreach($param['w_choices'] as $key => $choice) {
1594
+ if($choice==$element_value) {
1595
+ $is_other=false;
1596
+ break;
1597
+ }
1598
+ }
1599
+
1600
+
1601
+ $rep='<div type="type_radio" class="wdform-field"><div class="wdform-label-section" style="'.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
1602
+
1603
+ $rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos'].';">';
1604
+
1605
+ $rep.='<div style="display: '.($param['w_flow']=='hor' ? 'inline-block' : 'table-row' ).'; vertical-align:top">';
1606
+
1607
+ foreach($param['w_choices'] as $key => $choice) {
1608
+ if($key%$param['w_rowcol']==0 && $key>0)
1609
+ $rep.='</div><div style="display: '.($param['w_flow']=='hor' ? 'inline-block' : 'table-row' ).'; vertical-align:top">';
1610
+
1611
+ $checked =($choice==$element_value ? 'checked="checked"' : '');
1612
+
1613
+ if($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key && $is_other==true && $element_value!='')
1614
+ $checked = 'checked="checked"';
1615
+
1616
+
1617
+ $rep.='<div style="display: '.($param['w_flow']!='hor' ? 'table-cell' : 'table-row' ).';"><label class="wdform-ch-rad-label" for="wdform_'.$id1.'_element'.$form_id.''.$key.'">'.$choice.'</label><div class="radio-div forlabs"><input type="radio" '.(($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key) ? 'other="1"' : '').' id="wdform_'.$id1.'_element'.$form_id.''.$key.'" name="wdform_'.$id1.'_element'.$form_id.'" value="'.htmlspecialchars($choice).'" onclick="set_default(&quot;wdform_'.$id1.'&quot;,&quot;'.$key.'&quot;,&quot;'.$form_id.'&quot;); '.(($param['w_allow_other']=="yes" && $param['w_allow_other_num']==$key) ? 'show_other_input(&quot;wdform_'.$id1.'&quot;,&quot;'.$form_id.'&quot;);' : '').'" '.$checked.' '.$param['attributes'].'><label for="wdform_'.$id1.'_element'.$form_id.''.$key.'"></label></div></div>';
1618
+ }
1619
+ $rep.='</div>';
1620
+
1621
+ $rep.='</div></div>';
1622
+
1623
+ if($is_other && $element_value!='')
1624
+ $onload_js .='show_other_input("wdform_'.$id1.'","'.$form_id.'"); jQuery("#wdform_'.$id1.'_other_input'.$form_id.'").val("'.$element_value.'");';
1625
+
1626
+ $onsubmit_js.='
1627
+ jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_allow_other'.$form_id.'\" value = \"'.$param['w_allow_other'].'\" />").appendTo("#form'.$form_id.'");
1628
+ jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_allow_other_num'.$form_id.'\" value = \"'.$param['w_allow_other_num'].'\" />").appendTo("#form'.$form_id.'");
1629
+ ';
1630
+
1631
+ break;
1632
+ }
1633
+
1634
+ case 'type_own_select': {
1635
+ $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');
1636
+ $temp=$params;
1637
+
1638
+ foreach($params_names as $params_name ) {
1639
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1640
+ $param[$params_name] = $temp[0];
1641
+ $temp=$temp[1];
1642
+ }
1643
+
1644
+ if($temp) {
1645
+ $temp =explode('*:*w_attr_name*:*',$temp);
1646
+ $attrs = array_slice($temp,0, count($temp)-1);
1647
+ foreach($attrs as $attr)
1648
+ $param['attributes'] = $param['attributes'].' '.$attr;
1649
+ }
1650
+
1651
+
1652
+ $wdformfieldsize = ($param['w_field_label_pos']=="left" ? ($param['w_field_label_size']+$param['w_size']) : max($param['w_field_label_size'], $param['w_size']));
1653
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
1654
+
1655
+ $param['w_choices'] = explode('***',$param['w_choices']);
1656
+
1657
+ $post_value = (isset($_POST["counter".$form_id]) ? esc_html(stripslashes( $_POST["counter".$form_id])) : ''); //JRequest::getVar("counter".$form_id);
1658
+
1659
+ $rep='<div type="type_own_select" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" style="'.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
1660
+
1661
+ $rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="width: '.($param['w_size']).'px; "><select id="wdform_'.$id1.'_element'.$form_id.'" name="wdform_'.$id1.'_element'.$form_id.'" style="width: 100%" '.$param['attributes'].'>';
1662
+
1663
+ foreach($param['w_choices'] as $key => $choice) {
1664
+ $selected=(htmlspecialchars($choice)==htmlspecialchars($element_value) ? 'selected="selected"' : '');
1665
+
1666
+ $rep.='<option id="wdform_'.$id1.'_option'.$key.'" value="'.htmlspecialchars($choice).'" '.$selected.'>'.$choice.'</option>';
1667
+ }
1668
+ $rep.='</select></div></div>';
1669
+
1670
+
1671
+ break;
1672
+ }
1673
+
1674
+ case 'type_country': {
1675
+ $params_names=array('w_field_label_size','w_field_label_pos','w_size','w_countries','w_required','w_class');
1676
+ $temp=$params;
1677
+ foreach($params_names as $params_name ) {
1678
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1679
+ $param[$params_name] = $temp[0];
1680
+ $temp=$temp[1];
1681
+ }
1682
+
1683
+ if($temp) {
1684
+ $temp =explode('*:*w_attr_name*:*',$temp);
1685
+ $attrs = array_slice($temp,0, count($temp)-1);
1686
+ foreach($attrs as $attr)
1687
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
1688
+ }
1689
+
1690
+ $wdformfieldsize = ($param['w_field_label_pos']=="left" ? ($param['w_field_label_size']+$param['w_size']) : max($param['w_field_label_size'], $param['w_size']));
1691
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
1692
+
1693
+ $param['w_countries'] = explode('***',$param['w_countries']);
1694
+
1695
+ $selected='';
1696
+
1697
+ $rep='<div type="type_country" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" style="'.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
1698
+
1699
+ $rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="width: '.$param['w_size'].'px;"><select id="wdform_'.$id1.'_element'.$form_id.'" name="wdform_'.$id1.'_element'.$form_id.'" style="width: 100%;" '.$param['attributes'].'>';
1700
+ foreach($param['w_countries'] as $key => $choice) {
1701
+
1702
+ $selected=(htmlspecialchars($choice)==htmlspecialchars($element_value) ? 'selected="selected"' : '');
1703
+
1704
+ $choice_value=$choice;
1705
+ $rep.='<option value="'.$choice_value.'" '.$selected.'>'.$choice.'</option>';
1706
+ }
1707
+ $rep.='</select></div></div>';
1708
+
1709
+ break;
1710
+ }
1711
+
1712
+ case 'type_time': {
1713
+ if($element_value =='')
1714
+ $element_value = ':';
1715
+
1716
+ $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');
1717
+ $temp=$params;
1718
+
1719
+ foreach($params_names as $params_name ) {
1720
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1721
+ $param[$params_name] = $temp[0];
1722
+ $temp=$temp[1];
1723
+ }
1724
+
1725
+ if($temp) {
1726
+ $temp =explode('*:*w_attr_name*:*',$temp);
1727
+ $attrs = array_slice($temp,0, count($temp)-1);
1728
+ foreach($attrs as $attr)
1729
+ $param['attributes'] = $param['attributes'].' '.$attr;
1730
+ }
1731
+
1732
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
1733
+
1734
+ $w_mini_labels = explode('***',$param['w_mini_labels']);
1735
+ $element_value = explode(':',$element_value);
1736
+
1737
+
1738
+ $w_sec = '';
1739
+ $w_sec_label='';
1740
+
1741
+ if($param['w_sec']=='1') {
1742
+ $w_sec = '<div align="center" style="display: table-cell;"><span class="wdform_colon" style="vertical-align: middle;">&nbsp;:&nbsp;</span></div><div style="display: table-cell;"><input type="text" value="'.(count($element_value)==2 ? '' : $element_value[2]).'" class="time_box" id="wdform_'.$id1.'_ss'.$form_id.'" name="wdform_'.$id1.'_ss'.$form_id.'" onkeypress="return check_second(event, &quot;wdform_'.$id1.'_ss'.$form_id.'&quot;)" '.$param['attributes'].'></div>';
1743
+
1744
+ $w_sec_label='<div style="display: table-cell;"></div><div style="display: table-cell;"><label class="mini_label">'.$w_mini_labels[2].'</label></div>';
1745
+ }
1746
+
1747
+
1748
+ if($param['w_time_type']=='12') {
1749
+ if(strpos($element_value[2],'pm')!==false) {
1750
+ $am_ = "";
1751
+ $pm_ = "selected=\"selected\"";
1752
+ }
1753
+ else {
1754
+ $am_ = "selected=\"selected\"";
1755
+ $pm_ = "";
1756
+ }
1757
+
1758
+ $w_time_type = '<div style="display: table-cell;"><select class="am_pm_select" name="wdform_'.$id1.'_am_pm'.$form_id.'" id="wdform_'.$id1.'_am_pm'.$form_id.'" '.$param['attributes'].'><option value="am" '.$am_.'>AM</option><option value="pm" '.$pm_.'>PM</option></select></div>';
1759
+
1760
+ $w_time_type_label = '<div ><label class="mini_label">'.$w_mini_labels[3].'</label></div>';
1761
+
1762
+ }
1763
+ else {
1764
+ $w_time_type='';
1765
+ $w_time_type_label = '';
1766
+ }
1767
+
1768
+ $rep ='<div type="type_time" class="wdform-field"><div class="wdform-label-section" style="'.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
1769
+
1770
+ $rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos'].';"><div style="display: table;"><div style="display: table-row;"><div style="display: table-cell;"><input type="text" value="'.$element_value[0].'" class="time_box" id="wdform_'.$id1.'_hh'.$form_id.'" name="wdform_'.$id1.'_hh'.$form_id.'" onkeypress="return check_hour(event, &quot;wdform_'.$id1.'_hh'.$form_id.'&quot;, &quot;23&quot;)" '.$param['attributes'].'></div><div align="center" style="display: table-cell;"><span class="wdform_colon" style="vertical-align: middle;">&nbsp;:&nbsp;</span></div><div style="display: table-cell;"><input type="text" value="'.$element_value[1].'" class="time_box" id="wdform_'.$id1.'_mm'.$form_id.'" name="wdform_'.$id1.'_mm'.$form_id.'" onkeypress="return check_minute(event, &quot;wdform_'.$id1.'_mm'.$form_id.'&quot;)" '.$param['attributes'].'></div>'.$w_sec.$w_time_type.'</div><div style="display: table-row;"><div style="display: table-cell;"><label class="mini_label">'.$w_mini_labels[0].'</label></div><div style="display: table-cell;"></div><div style="display: table-cell;"><label class="mini_label">'.$w_mini_labels[1].'</label></div>'.$w_sec_label.$w_time_type_label.'</div></div></div></div>';
1771
+
1772
+ break;
1773
+ }
1774
+
1775
+ case 'type_date': {
1776
+ $params_names=array('w_field_label_size','w_field_label_pos','w_date','w_required','w_class','w_format','w_but_val');
1777
+ $temp=$params;
1778
+
1779
+ foreach($params_names as $params_name ) {
1780
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1781
+ $param[$params_name] = $temp[0];
1782
+ $temp=$temp[1];
1783
+ }
1784
+
1785
+ if($temp) {
1786
+ $temp =explode('*:*w_attr_name*:*',$temp);
1787
+ $attrs = array_slice($temp,0, count($temp)-1);
1788
+ foreach($attrs as $attr)
1789
+ $param['attributes'] = $param['attributes'].' '.$attr;
1790
+ }
1791
+
1792
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
1793
+
1794
+ $rep ='<div type="type_date" class="wdform-field"><div class="wdform-label-section" style="'.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
1795
+
1796
+ $rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos'].';"><input type="text" value="'.$element_value.'" class="wdform-date" id="wdform_'.$id1.'_element'.$form_id.'" name="wdform_'.$id1.'_element'.$form_id.'" maxlength="10" '.$param['attributes'].'><input id="wdform_'.$id1.'_button'.$form_id.'" class="wdform-calendar-button" type="reset" value="'.$param['w_but_val'].'" format="'.$param['w_format'].'" onclick="return showCalendar(\'wdform_'.$id1.'_element'.$form_id.'\' , \'%Y-%m-%d\')" '.$param['attributes'].' "></div></div>';
1797
+
1798
+
1799
+ // $onload_js.= 'Calendar.setup({inputField: "wdform_'.$id1.'_element'.$form_id.'", ifFormat: "'.$param['w_format'].'",button: "wdform_'.$id1.'_button'.$form_id.'",align: "Tl",singleClick: true,firstDay: 0});';
1800
+
1801
+ break;
1802
+ }
1803
+
1804
+ case 'type_date_fields': {
1805
+ if($element_value=='')
1806
+ $element_value='--';
1807
+
1808
+ $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');
1809
+
1810
+ $temp=$params;
1811
+
1812
+ foreach($params_names as $params_name ) {
1813
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1814
+ $param[$params_name] = $temp[0];
1815
+ $temp=$temp[1];
1816
+ }
1817
+
1818
+
1819
+ if($temp) {
1820
+ $temp =explode('*:*w_attr_name*:*',$temp);
1821
+ $attrs = array_slice($temp,0, count($temp)-1);
1822
+ foreach($attrs as $attr)
1823
+ $param['attributes'] = $param['attributes'].' '.$attr;
1824
+ }
1825
+
1826
+ $element_value = explode('-',$element_value);
1827
+
1828
+ $param['w_day'] = (isset($_POST['wdform_'.$id1."_day".$form_id]) ? esc_html(stripslashes( $_POST['wdform_'.$id1."_day".$form_id])) : $param['w_day']);
1829
+ $param['w_month'] = (isset($_POST['wdform_'.$id1."_month".$form_id]) ? esc_html(stripslashes( $_POST['wdform_'.$id1."_month".$form_id])) : $element_value[1]);//??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
1830
+ $param['w_year'] = (isset($_POST['wdform_'.$id1."w_year".$form_id]) ? esc_html(stripslashes( $_POST['wdform_'.$id1."_year".$form_id])) : $param['w_year']);
1831
+
1832
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
1833
+
1834
+ if($param['w_day_type']=="SELECT") {
1835
+
1836
+ $w_day_type = '<select id="wdform_'.$id1.'_day'.$form_id.'" name="wdform_'.$id1.'_day'.$form_id.'" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].'><option value=""></option>';
1837
+
1838
+ for($k=1; $k<=31; $k++) {
1839
+
1840
+ if($k<10) {
1841
+ if($element_value[0]=='0'.$k)
1842
+ $selected = "selected=\"selected\"";
1843
+ else
1844
+ $selected = "";
1845
+
1846
+ $w_day_type .= '<option value="0'.$k.'" '.$selected.'>0'.$k.'</option>';
1847
+ }
1848
+ else {
1849
+ if($element_value[0]==''.$k)
1850
+ $selected = "selected=\"selected\"";
1851
+ else
1852
+ $selected = "";
1853
+
1854
+ $w_day_type .= '<option value="'.$k.'" '.$selected.'>'.$k.'</option>';
1855
+ }
1856
+
1857
+ }
1858
+ $w_day_type .= '</select>';
1859
+
1860
+ }
1861
+ else {
1862
+ $w_day_type = '<input type="text" value="'.$element_value[0].'" id="wdform_'.$id1.'_day'.$form_id.'" name="wdform_'.$id1.'_day'.$form_id.'" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].'>';
1863
+ $onload_js .='jQuery("#wdform_'.$id1.'_day'.$form_id.'").blur(function() {if (jQuery(this).val()=="0") jQuery(this).val(""); else add_0(this)});';
1864
+ $onload_js .='jQuery("#wdform_'.$id1.'_day'.$form_id.'").keypress(function() {return check_day(event, this)});';
1865
+ }
1866
+
1867
+
1868
+ if($param['w_month_type']=="SELECT") {
1869
+
1870
+ $w_month_type = '<select id="wdform_'.$id1.'_month'.$form_id.'" name="wdform_'.$id1.'_month'.$form_id.'" style="width: '.$param['w_month_size'].'px;" '.$param['attributes'].'><option value=""></option><option value="01" '.($param['w_month']=="01" ? "selected=\"selected\"": "").' >'.(__("January", 'form_maker')).'</option><option value="02" '.($param['w_month']=="02" ? "selected=\"selected\"": "").'>'.(__("February", 'form_maker')).'</option><option value="03" '.($param['w_month']=="03"? "selected=\"selected\"": "").'>'.(__("March", 'form_maker')).'</option><option value="04" '.($param['w_month']=="04" ? "selected=\"selected\"": "").' >'.(__("April", 'form_maker')).'</option><option value="05" '.($param['w_month']=="05" ? "selected=\"selected\"": "").' >'.(__("May", 'form_maker')).'</option><option value="06" '.($param['w_month']=="06" ? "selected=\"selected\"": "").' >'.(__("June", 'form_maker')).'</option><option value="07" '.($param['w_month']=="07" ? "selected=\"selected\"": "").' >'.(__("July", 'form_maker')).'</option><option value="08" '.($param['w_month']=="08" ? "selected=\"selected\"": "").' >'.(__("August", 'form_maker')).'</option><option value="09" '.($param['w_month']=="09" ? "selected=\"selected\"": "").' >'.(__("September", 'form_maker')).'</option><option value="10" '.($param['w_month']=="10" ? "selected=\"selected\"": "").' >'.(__("October", 'form_maker')).'</option><option value="11" '.($param['w_month']=="11" ? "selected=\"selected\"": "").'>'.(__("November", 'form_maker')).'</option><option value="12" '.($param['w_month']=="12" ? "selected=\"selected\"": "").' >'.(__("December", 'form_maker')).'</option></select>';
1871
+ }
1872
+ else {
1873
+ $w_month_type = '<input type="text" value="'.$element_value[1].'" id="wdform_'.$id1.'_month'.$form_id.'" name="wdform_'.$id1.'_month'.$form_id.'" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].'>';
1874
+ $onload_js .='jQuery("#wdform_'.$id1.'_month'.$form_id.'").blur(function() {if (jQuery(this).val()=="0") jQuery(this).val(""); else add_0(this)});';
1875
+ $onload_js .='jQuery("#wdform_'.$id1.'_month'.$form_id.'").keypress(function() {return check_month(event, this)});';
1876
+ }
1877
+
1878
+
1879
+ if($param['w_year_type']=="SELECT" ) {
1880
+ $w_year_type = '<select id="wdform_'.$id1.'_year'.$form_id.'" name="wdform_'.$id1.'_year'.$form_id.'" from="'.$param['w_from'].'" to="'.$param['w_to'].'" style="width: '.$param['w_year_size'].'px;" '.$param['attributes'].'><option value=""></option>';
1881
+
1882
+ for($k=$param['w_to']; $k>=$param['w_from']; $k--) {
1883
+ if($element_value[2]==$k)
1884
+ $selected = "selected=\"selected\"";
1885
+ else
1886
+ $selected = "";
1887
+
1888
+ $w_year_type .= '<option value="'.$k.'" '.$selected.'>'.$k.'</option>';
1889
+ }
1890
+ $w_year_type .= '</select>';
1891
+ }
1892
+ else {
1893
+ $w_year_type = '<input type="text" value="'.$element_value[2].'" id="wdform_'.$id1.'_year'.$form_id.'" name="wdform_'.$id1.'_year'.$form_id.'" from="'.$param['w_from'].'" to="'.$param['w_to'].'" style="width: '.$param['w_day_size'].'px;" '.$param['attributes'].'>';
1894
+ $onload_js .='jQuery("#wdform_'.$id1.'_year'.$form_id.'").blur(function() {check_year2(this)});';
1895
+ $onload_js .='jQuery("#wdform_'.$id1.'_year'.$form_id.'").keypress(function() {return check_year1(event, this)});';
1896
+ $onload_js .='jQuery("#wdform_'.$id1.'_year'.$form_id.'").change(function() {change_year(this)});';
1897
+ }
1898
+
1899
+ $rep ='<div type="type_date_fields" class="wdform-field"><div class="wdform-label-section" style="'.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
1900
+
1901
+ $rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos'].';"><div style="display: table;"><div style="display: table-row;"><div style="display: table-cell;">'.$w_day_type.'</div><div style="display: table-cell;"><span class="wdform_separator">'.$param['w_divider'].'</span></div><div style="display: table-cell;">'.$w_month_type.'</div><div style="display: table-cell;"><span class="wdform_separator">'.$param['w_divider'].'</span></div><div style="display: table-cell;">'.$w_year_type.'</div></div><div style="display: table-row;"><div style="display: table-cell;"><label class="mini_label">'.$param['w_day_label'].'</label></div><div style="display: table-cell;"></div><div style="display: table-cell;"><label class="mini_label" >'.$param['w_month_label'].'</label></div><div style="display: table-cell;"></div><div style="display: table-cell;"><label class="mini_label">'.$param['w_year_label'].'</label></div></div></div></div></div>';
1902
+
1903
+ break;
1904
+ }
1905
+
1906
+
1907
+ case 'type_hidden': {
1908
+ $params_names=array('w_name','w_value');
1909
+ $temp=$params;
1910
+
1911
+ foreach($params_names as $params_name ) {
1912
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1913
+ $param[$params_name] = $temp[0];
1914
+ $temp=$temp[1];
1915
+ }
1916
+
1917
+ if($temp) {
1918
+ $temp =explode('*:*w_attr_name*:*',$temp);
1919
+ $attrs = array_slice($temp,0, count($temp)-1);
1920
+ foreach($attrs as $attr)
1921
+ $param['attributes'] = $param['attributes'].' '.$attr;
1922
+ }
1923
+
1924
+ $rep ='<div type="type_hidden" class="wdform-field"><div class="wdform-label-section" style="display: table-cell;"></div><div class="wdform-element-section" style="display: table-cell;"><input type="text" value="'.$element_value.'" id="wdform_'.$id1.'_element'.$form_id.'" name="'.$param['w_name'].'" '.$param['attributes'].'></div></div>';
1925
+
1926
+ break;
1927
+ }
1928
+
1929
+
1930
+ case 'type_paypal_price': {
1931
+
1932
+ $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');
1933
+ $temp=$params;
1934
+
1935
+ foreach($params_names as $params_name ) {
1936
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1937
+ $param[$params_name] = $temp[0];
1938
+ $temp=$temp[1];
1939
+ }
1940
+
1941
+
1942
+ if($temp) {
1943
+ $temp =explode('*:*w_attr_name*:*',$temp);
1944
+ $attrs = array_slice($temp,0, count($temp)-1);
1945
+ foreach($attrs as $attr)
1946
+ $param['attributes'] = $param['attributes'].' '.$attr;
1947
+ }
1948
+
1949
+ if (strpos($element_value,'.')!== false)
1950
+ $element = explode('.',$element_value);
1951
+ else {
1952
+ $element = Array();
1953
+ $element[0] = preg_replace("/[^0-9]/","",$element_value);
1954
+ $element[1] = '';
1955
+ }
1956
+
1957
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
1958
+
1959
+ $hide_cents = ($param['w_hide_cents']=="yes" ? "none;" : "table-cell;");
1960
+
1961
+ $w_mini_labels = explode('***',$param['w_mini_labels']);
1962
+
1963
+ $rep ='<div type="type_paypal_price" class="wdform-field"><div class="wdform-label-section" style="'.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
1964
+
1965
+ $rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos'].';"><input type="hidden" value="'.$param['w_range_min'].'" name="wdform_'.$id1.'_range_min'.$form_id.'" id="wdform_'.$id1.'_range_min'.$form_id.'"><input type="hidden" value="'.$param['w_range_max'].'" name="wdform_'.$id1.'_range_max'.$form_id.'" id="wdform_'.$id1.'_range_max'.$form_id.'"><div id="wdform_'.$id1.'_table_price" style="display: table;"><div id="wdform_'.$id1.'_tr_price1" style="display: table-row;"><div id="wdform_'.$id1.'_td_name_currency" style="display: table-cell;"><span class="wdform_colon" style="vertical-align: middle;"><!--repstart-->&nbsp;'.$form_currency.'&nbsp;<!--repend--></span></div><div id="wdform_'.$id1.'_td_name_dollars" style="display: table-cell;"><input type="text" class="" id="wdform_'.$id1.'_element_dollars'.$form_id.'" name="wdform_'.$id1.'_element_dollars'.$form_id.'" value="'.(strpos($element_value,'.') !== false ? preg_replace("/[^0-9]/","",$element[0]) : $element[0]).'" onkeypress="return check_isnum(event)" style="width: '.$param['w_size'].'px;" '.$param['attributes'].'></div><div id="wdform_'.$id1.'_td_name_divider" style="display: '.$hide_cents.';"><span class="wdform_colon" style="vertical-align: middle;">&nbsp;.&nbsp;</span></div><div id="wdform_'.$id1.'_td_name_cents" style="display: '.$hide_cents.'"><input type="text" class="" id="wdform_'.$id1.'_element_cents'.$form_id.'" name="wdform_'.$id1.'_element_cents'.$form_id.'" value="'.(strpos($element_value,'.') !== false ? preg_replace("/[^0-9]/","",$element[1]) : " ").'" style="width: 30px;" '.$param['attributes'].'></div></div><div id="wdform_'.$id1.'_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">'.$w_mini_labels[0].'</label></div><div id="wdform_'.$id1.'_td_name_label_divider" style="display: '.$hide_cents.'"><label class="mini_label"></label></div><div align="left" id="wdform_'.$id1.'_td_name_label_cents" style="display: '.$hide_cents.'"><label class="mini_label">'.$w_mini_labels[1].'</label></div></div></div></div></div>';
1966
+
1967
+ $onload_js .='jQuery("#wdform_'.$id1.'_element_cents'.$form_id.'").blur(function() {add_0(this)});';
1968
+ $onload_js .='jQuery("#wdform_'.$id1.'_element_cents'.$form_id.'").keypress(function() {return check_isnum_interval(event,this,0,99)});';
1969
+
1970
+ break;
1971
+ }
1972
+
1973
+ case 'type_paypal_select': {
1974
+
1975
+ if($element_value=='')
1976
+ $element_value = ' :';
1977
+
1978
+ $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_class','w_property','w_property_values');
1979
+ $temp=$params;
1980
+
1981
+ foreach($params_names as $params_name ) {
1982
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
1983
+ $param[$params_name] = $temp[0];
1984
+ $temp=$temp[1];
1985
+ }
1986
+
1987
+ if($temp) {
1988
+ $temp =explode('*:*w_attr_name*:*',$temp);
1989
+ $attrs = array_slice($temp,0, count($temp)-1);
1990
+ foreach($attrs as $attr)
1991
+ $param['attributes'] = $param['attributes'].' '.$attr;
1992
+ }
1993
+
1994
+ $wdformfieldsize = ($param['w_field_label_pos']=="left" ? ($param['w_field_label_size']+$param['w_size']) : max($param['w_field_label_size'], $param['w_size']));
1995
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
1996
+
1997
+ $param['w_choices'] = explode('***',$param['w_choices']);
1998
+ $param['w_choices_price'] = explode('***',$param['w_choices_price']);
1999
+ $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
2000
+ $param['w_choices_disabled'] = explode('***',$param['w_choices_disabled']);
2001
+ $param['w_property'] = explode('***',$param['w_property']);
2002
+ $param['w_property_values'] = explode('***',$param['w_property_values']);
2003
+
2004
+ if(strpos($element_value,'***br***') !== false) {
2005
+ $element_value = explode('***br***',$element_value);
2006
+ if (count($element_value)==2) {
2007
+ if (strpos($element_value[1],'***quantity***') !== false) {
2008
+ $quantity_value = explode(': ',str_replace("***quantity***","",$element_value[1]));
2009
+ $quantity_value = $quantity_value[1];
2010
+ $property_of_select = '';
2011
+ }
2012
+ else {
2013
+ $quantity_value = '' ;
2014
+ $property_of_select = explode(': ',str_replace("***property***","",$element_value[1]));
2015
+ $property_of_select = $property_of_select[1];
2016
+ }
2017
+ $element_value = explode(' :',$element_value[0]);
2018
+ $choise_value = preg_replace("/[^0-9]/","",$element_value[1]);
2019
+ }
2020
+ else {
2021
+ $quantity_value = explode(': ',str_replace("***quantity***","",$element_value[1]));
2022
+ $quantity_value = $quantity_value[1];
2023
+ $property_of_select = explode(': ',str_replace("***property***","",$element_value[2]));
2024
+ $property_of_select = $property_of_select[1];
2025
+ $element_value = explode(' :',$element_value[0]);
2026
+ $choise_value = preg_replace("/[^0-9]/","",$element_value[1]);
2027
+ }
2028
+ }
2029
+ else {
2030
+ $element_value = explode(' :',$element_value);
2031
+ $choise_value = preg_replace("/[^0-9]/","",$element_value[1]);
2032
+ $quantity_value = '';
2033
+ $property_of_select = '';
2034
+ }
2035
+
2036
+
2037
+ $rep='<div type="type_paypal_select" class="wdform-field" style="width:'.$wdformfieldsize.'px"><div class="wdform-label-section" style="'.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
2038
+
2039
+ $rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="width: '.$param['w_size'].'px;"><select id="wdform_'.$id1.'_element'.$form_id.'" name="wdform_'.$id1.'_element'.$form_id.'" style="width: 100%;" '.$param['attributes'].'>';
2040
+ foreach($param['w_choices'] as $key => $choice) {
2041
+ if($param['w_choices_disabled'][$key]=="true")
2042
+ $choice_value='';
2043
+ else
2044
+ $choice_value=$param['w_choices_price'][$key];
2045
+
2046
+
2047
+ if($element_value[0] == $choice && $param['w_choices_price'][$key] == $choise_value)
2048
+ $selected = 'selected="selected"';
2049
+ else
2050
+ $selected = '';
2051
+
2052
+ $rep.='<option id="wdform_'.$id1.'_option'.$key.'" value="'.$choice_value.'" '.$selected.'>'.$choice.'</option>';
2053
+ }
2054
+ $rep.='</select><div id="wdform_'.$id1.'_div'.$form_id.'">';
2055
+ if($param['w_quantity']=="yes") {
2056
+ $rep.='<div class="paypal-property"><label class="mini_label" style="margin: 0px 5px;">Quantity</label><input type="text" value="'.($quantity_value=="" ? 1 : $quantity_value).'" id="wdform_'.$id1.'_element_quantity'.$form_id.'" name="wdform_'.$id1.'_element_quantity'.$form_id.'" class="wdform-quantity"></div>';
2057
+ }
2058
+
2059
+ if($param['w_property'][0])
2060
+ foreach($param['w_property'] as $key => $property) {
2061
+
2062
+ $rep.='
2063
+ <div id="wdform_'.$id1.'_property_'.$key.'" class="paypal-property">
2064
+ <div style="width:100px; display:inline-block;">
2065
+ <label class="mini_label" id="wdform_'.$id1.'_property_label_'.$form_id.''.$key.'" style="margin-right: 5px;">'.$property.'</label>
2066
+ <select id="wdform_'.$id1.'_property'.$form_id.''.$key.'" name="wdform_'.$id1.'_property'.$form_id.''.$key.'" style="width: 100%; margin: 2px 0px;">';
2067
+ $param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
2068
+ $param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
2069
+
2070
+ foreach($param['w_property_values'][$key] as $subkey => $property_value) {
2071
+ $rep.='<option id="wdform_'.$id1.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'" '.($property_of_select==$property_value ? 'selected="selected"' : "").'>'.$property_value.'</option>';
2072
+ }
2073
+ $rep.='</select></div></div>';
2074
+ }
2075
+
2076
+ $rep.='</div></div></div>';
2077
+
2078
+ $onsubmit_js.='
2079
+ jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_element_label'.$form_id.'\" />").val(jQuery("#wdform_'.$id1.'_element'.$form_id.' option:selected").text()).appendTo("#form'.$form_id.'");
2080
+ ';
2081
+ $onsubmit_js.='
2082
+ jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_element_quantity_label'.$form_id.'\" />").val("Quantity").appendTo("#form'.$form_id.'");
2083
+ ';
2084
+ $onsubmit_js.='
2085
+ jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_element_property_label'.$form_id.'\" />").val("'.$param['w_property'][0].'").appendTo("#form'.$form_id.'");
2086
+ ';
2087
+
2088
+ break;
2089
+ }
2090
+
2091
+ case 'type_paypal_checkbox': {
2092
+
2093
+ if($element_value == '')
2094
+ $element_value =' :';
2095
+
2096
+ $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');
2097
+ $temp=$params;
2098
+
2099
+ foreach($params_names as $params_name ) {
2100
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
2101
+ $param[$params_name] = $temp[0];
2102
+ $temp=$temp[1];
2103
+ }
2104
+
2105
+ if($temp) {
2106
+ $temp =explode('*:*w_attr_name*:*',$temp);
2107
+ $attrs = array_slice($temp,0, count($temp)-1);
2108
+ foreach($attrs as $attr)
2109
+ $param['attributes'] = $param['attributes'].' '.$attr;
2110
+ }
2111
+
2112
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
2113
+
2114
+ $param['w_choices'] = explode('***',$param['w_choices']);
2115
+ $param['w_choices_price'] = explode('***',$param['w_choices_price']);
2116
+ $param['w_choices_checked'] = explode('***',$param['w_choices_checked']);
2117
+ $param['w_property'] = explode('***',$param['w_property']);
2118
+ $param['w_property_values'] = explode('***',$param['w_property_values']);
2119
+
2120
+ if(strpos($element_value,'***br***') !== false) {
2121
+ $element_value = explode('***br***',$element_value);
2122
+ foreach($element_value as $key => $element) {
2123
+
2124
+ if(strpos($element,'***quantity***') !== false) {
2125
+ $quantity_value = explode(': ',str_replace("***quantity***","",$element));
2126
+ $quantity_value = $quantity_value[1];
2127
+ unset($element_value[$key]);
2128
+ }
2129
+ else
2130
+ if(strpos($element,'***property***') !== false) {
2131
+ $property_of_check = explode(': ',str_replace("***property***","",$element));
2132
+ $property_of_check = $property_of_check[1];
2133
+ unset($element_value[$key]);
2134
+ }
2135
+ else {
2136
+ for($m=0; $m<strlen($element); $m++) {
2137
+ if(!ctype_digit($element[strlen($element)-1]))
2138
+ $element_value[$key] = substr($element,0,-1);
2139
+ else
2140
+ break;
2141
+ }
2142
+ $quantity_value = '';
2143
+ $property_of_check = '';
2144
+ }
2145
+
2146
+ }
2147
+ }
2148
+ else {
2149
+ $element_value = explode(' :',$element_value);
2150
+ $choise_value = preg_replace("/[^0-9]/","",$element_value[1]);
2151
+ $quantity_value = '';
2152
+ $property_of_check = '';
2153
+ }
2154
+
2155
+
2156
+ $rep='<div type="type_paypal_checkbox" class="wdform-field"><div class="wdform-label-section" style="'.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
2157
+
2158
+ $rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos'].';">';
2159
+
2160
+ foreach($param['w_choices'] as $key => $choice) {
2161
+ $checked=(in_array($choice.' - '.$param['w_choices_price'][$key], $element_value)=='true' ? 'checked="checked"' : '');
2162
+
2163
+ $rep.='<div style="display: '.($param['w_flow']=='hor' ? 'inline-block' : 'table-row' ).';"><label class="wdform-ch-rad-label" for="wdform_'.$id1.'_element'.$form_id.''.$key.'" ">'.$choice.'</label><div class="checkbox-div forlabs"><input type="checkbox" id="wdform_'.$id1.'_element'.$form_id.''.$key.'" name="wdform_'.$id1.'_element'.$form_id.''.$key.'" value="'.$param['w_choices_price'][$key].'" '.$checked.' '.$param['attributes'].'><label for="wdform_'.$id1.'_element'.$form_id.''.$key.'"></label></div><input type="hidden" name="wdform_'.$id1.'_element'.$form_id.$key.'_label" value="'.htmlspecialchars($choice).'" /></div>';
2164
+ }
2165
+
2166
+ $rep.='<div id="wdform_'.$id1.'_div'.$form_id.'">';
2167
+ if($param['w_quantity']=="yes")
2168
+ $rep.='<div class="paypal-property"><label class="mini_label" style="margin: 0px 5px;">Quantity</label><input type="text" value="'.($quantity_value == '' ? 1 : $quantity_value).'" id="wdform_'.$id1.'_element_quantity'.$form_id.'" name="wdform_'.$id1.'_element_quantity'.$form_id.'" class="wdform-quantity"></div>';
2169
+
2170
+ if($param['w_property'][0])
2171
+ foreach($param['w_property'] as $key => $property) {
2172
+ $rep.='
2173
+ <div class="paypal-property">
2174
+ <div style="width:100px; display:inline-block;">
2175
+ <label class="mini_label" id="wdform_'.$id1.'_property_label_'.$form_id.''.$key.'" style="margin-right: 5px;">'.$property.'</label>
2176
+ <select id="wdform_'.$id1.'_property'.$form_id.''.$key.'" name="wdform_'.$id1.'_property'.$form_id.''.$key.'" style="width: 100%; margin: 2px 0px;">';
2177
+ $param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
2178
+ $param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
2179
+ foreach($param['w_property_values'][$key] as $subkey => $property_value) {
2180
+ $rep.='<option id="wdform_'.$id1.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'" '.($property_of_check==$property_value ? 'selected="selected"' : "").'>'.$property_value.'</option>';
2181
+ }
2182
+ $rep.='</select></div></div>';
2183
+ }
2184
+
2185
+ $rep.='</div></div></div>';
2186
+
2187
+ /*$onsubmit_js.='
2188
+ jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_element_label'.$form_id.'\" />").val((x.find(jQuery("div[wdid='.$id1.'] input:checked")).length != 0) ? jQuery("#"+x.find(jQuery("div[wdid='.$id1.'] input:checked")).prop("id").replace("element", "elementlabel_")) : "").appendTo("#form'.$form_id.'");
2189
+ ';*/
2190
+
2191
+ $onsubmit_js.='
2192
+ jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_element_quantity_label'.$form_id.'\" />").val("Quantity").appendTo("#form'.$form_id.'");
2193
+ ';
2194
+ $onsubmit_js.='
2195
+ jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_element_property_label'.$form_id.'\" />").val("'.$param['w_property'][0].'").appendTo("#form'.$form_id.'");
2196
+ ';
2197
+
2198
+ break;
2199
+ }
2200
+
2201
+ case 'type_paypal_radio': {
2202
+ if($element_value=='')
2203
+ $element_value = ' :';
2204
+
2205
+ $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');
2206
+ $temp=$params;
2207
+
2208
+ foreach($params_names as $params_name ) {
2209
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
2210
+ $param[$params_name] = $temp[0];
2211
+ $temp=$temp[1];
2212
+ }
2213
+
2214
+ if($temp) {
2215
+ $temp =explode('*:*w_attr_name*:*',$temp);
2216
+ $attrs = array_slice($temp,0, count($temp)-1);
2217
+ foreach($attrs as $attr)
2218
+ $param['attributes'] = $param['attributes'].' '.$attr;
2219
+ }
2220
+
2221
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
2222
+
2223
+
2224
+ $param['w_choices'] = explode('***',$param['w_choices']);
2225
+ $param['w_choices_price'] = explode('***',$param['w_choices_price']);
2226
+ $param['w_property'] = explode('***',$param['w_property']);
2227
+ $param['w_property_values'] = explode('***',$param['w_property_values']);
2228
+
2229
+
2230
+ $rep='<div type="type_paypal_radio" class="wdform-field"><div class="wdform-label-section" style="'.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
2231
+
2232
+ $rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos'].';">';
2233
+
2234
+ if(strpos($element_value,'***br***') !== false) {
2235
+ $element_value = explode('***br***',$element_value);
2236
+ if (count($element_value)==2) {
2237
+ if (strpos($element_value[1], '***quantity***') !== false) {
2238
+ $quantity_value = explode(': ',str_replace("***quantity***","",$element_value[1]));
2239
+ $quantity_value = $quantity_value[1];
2240
+ $property_of_radio = '';
2241
+ }
2242
+ else {
2243
+ $quantity_value = '' ;
2244
+ $property_of_radio = explode(': ',str_replace("***property***","",$element_value[1]));
2245
+ $property_of_radio = $property_of_radio[1];
2246
+ }
2247
+
2248
+ $element_value = explode(' :',$element_value[0]);
2249
+ $choise_value = preg_replace("/[^0-9]/","",$element_value[1]);
2250
+ }
2251
+ else {
2252
+ $quantity_value = explode(': ',str_replace("***quantity***","",$element_value[1]));
2253
+ $quantity_value = $quantity_value[1];
2254
+ $property_of_radio = explode(': ',str_replace("***property***","",$element_value[2]));
2255
+ $property_of_radio = $property_of_radio[1];
2256
+
2257
+ $element_value = explode(' :',$element_value[0]);
2258
+ $choise_value = preg_replace("/[^0-9]/","",$element_value[1]);
2259
+ }
2260
+ }
2261
+ else {
2262
+ $element_value = explode(' :',$element_value);
2263
+ $choise_value = preg_replace("/[^0-9]/","",$element_value[1]);
2264
+ $quantity_value = '';
2265
+ $property_of_radio = '';
2266
+ }
2267
+
2268
+ foreach($param['w_choices'] as $key => $choice) {
2269
+
2270
+ if($element_value[0] == $choice && $param['w_choices_price'][$key] == $choise_value)
2271
+ $checked = 'checked="checked"';
2272
+ else
2273
+ $checked = '';
2274
+
2275
+ $rep.='<div style="display: '.($param['w_flow']=='hor' ? 'inline-block' : 'table-row' ).';"><label class="wdform-ch-rad-label" for="wdform_'.$id1.'_element'.$form_id.''.$key.'">'.$choice.'</label><div class="radio-div forlabs"><input type="radio" id="wdform_'.$id1.'_element'.$form_id.''.$key.'" name="wdform_'.$id1.'_element'.$form_id.'" value="'.$param['w_choices_price'][$key].'" title="'.htmlspecialchars($choice).'" '.$checked.' '.$param['attributes'].'><label for="wdform_'.$id1.'_element'.$form_id.''.$key.'"></label></div></div>';
2276
+
2277
+ }
2278
+
2279
+ $rep.='<div id="wdform_'.$id1.'_div'.$form_id.'">';
2280
+ if($param['w_quantity']=="yes")
2281
+ $rep.='<div class="paypal-property"><label class="mini_label" style="margin: 0px 5px;">'. _("Quantity") .'</label><input type="text" value="'.($quantity_value=='' ? 1 : $quantity_value).'" id="wdform_'.$id1.'_element_quantity'.$form_id.'" name="wdform_'.$id1.'_element_quantity'.$form_id.'" class="wdform-quantity"></div>';
2282
+
2283
+ if($param['w_property'][0])
2284
+ foreach($param['w_property'] as $key => $property) {
2285
+ $rep.='
2286
+ <div class="paypal-property">
2287
+ <div style="width:100px; display:inline-block;">
2288
+ <label class="mini_label" id="wdform_'.$id1.'_property_label_'.$form_id.''.$key.'" style="margin-right: 5px;">'.$property.'</label>
2289
+ <select id="wdform_'.$id1.'_property'.$form_id.''.$key.'" name="wdform_'.$id1.'_property'.$form_id.''.$key.'" style="width: 100%; margin: 2px 0px;">';
2290
+ $param['w_property_values'][$key] = explode('###',$param['w_property_values'][$key]);
2291
+ $param['w_property_values'][$key] = array_slice($param['w_property_values'][$key],1, count($param['w_property_values'][$key]));
2292
+ foreach($param['w_property_values'][$key] as $subkey => $property_value) {
2293
+ $rep.='<option id="wdform_'.$id1.'_'.$key.'_option'.$subkey.'" value="'.$property_value.'" '.($property_of_radio==$property_value ? 'selected="selected"' : "").'>'.$property_value.'</option>';
2294
+ }
2295
+ $rep.='</select></div></div>';
2296
+ }
2297
+
2298
+ $rep.='</div></div></div>';
2299
+
2300
+ $onsubmit_js.='
2301
+ jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_element_label'.$form_id.'\" />").val(
2302
+ jQuery("label[for=\'"+jQuery("input[name^=\'wdform_'.$id1.'_element'.$form_id.'\']:checked").prop("id")+"\']").eq(0).text()
2303
+ ).appendTo("#form'.$form_id.'");
2304
+
2305
+ ';
2306
+
2307
+ $onsubmit_js.='
2308
+ jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_element_quantity_label'.$form_id.'\" />").val("Quantity").appendTo("#form'.$form_id.'");
2309
+ ';
2310
+ $onsubmit_js.='
2311
+ jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_element_property_label'.$form_id.'\" />").val("'.$param['w_property'][0].'").appendTo("#form'.$form_id.'");
2312
+ ';
2313
+
2314
+ break;
2315
+ }
2316
+
2317
+
2318
+ case 'type_paypal_shipping': {
2319
+ if($element_value=='')
2320
+ $element_value =' - ';
2321
+
2322
+ $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');
2323
+ $temp=$params;
2324
+
2325
+ foreach($params_names as $params_name ) {
2326
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
2327
+ $param[$params_name] = $temp[0];
2328
+ $temp=$temp[1];
2329
+ }
2330
+
2331
+ if($temp)
2332
+ {
2333
+ $temp =explode('*:*w_attr_name*:*',$temp);
2334
+ $attrs = array_slice($temp,0, count($temp)-1);
2335
+ foreach($attrs as $attr)
2336
+ $param['attributes'] = $param['attributes'].' '.$attr;
2337
+ }
2338
+
2339
+
2340
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
2341
+
2342
+ $param['w_choices'] = explode('***',$param['w_choices']);
2343
+ $param['w_choices_price'] = explode('***',$param['w_choices_price']);
2344
+
2345
+ $element_value = explode(' - ',$element_value);
2346
+ $element_value[1] = preg_replace("/[^0-9]/","",$element_value[1]);
2347
+
2348
+ $rep='<div type="type_paypal_shipping" class="wdform-field"><div class="wdform-label-section" style="'.$param['w_field_label_pos'].'; width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
2349
+
2350
+ $rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos'].';">';
2351
+
2352
+ foreach($param['w_choices'] as $key => $choice) {
2353
+
2354
+ $checked =(($choice==$element_value[0] && $param['w_choices_price'][$key]== $element_value[1]) ? 'checked="checked"' : '');
2355
+
2356
+ $rep.='<div style="display: '.($param['w_flow']=='hor' ? 'inline-block' : 'table-row' ).';"><label class="wdform-ch-rad-label" for="wdform_'.$id1.'_element'.$form_id.''.$key.'">'.$choice.'</label><div class="radio-div forlabs"><input type="radio" id="wdform_'.$id1.'_element'.$form_id.''.$key.'" name="wdform_'.$id1.'_element'.$form_id.'" value="'.$param['w_choices_price'][$key].'" '.$checked.' '.$param['attributes'].'><label for="wdform_'.$id1.'_element'.$form_id.''.$key.'"></label></div></div>';
2357
+
2358
+ }
2359
+
2360
+ $rep.='</div></div>';
2361
+
2362
+ $onsubmit_js.='
2363
+ jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_element_label'.$form_id.'\" />").val(
2364
+ jQuery("label[for=\'"+jQuery("input[name^=\'wdform_'.$id1.'_element'.$form_id.'\']:checked").prop("id")+"\']").eq(0).text()
2365
+ ).appendTo("#form'.$form_id.'");
2366
+
2367
+ ';
2368
+
2369
+ break;
2370
+ }
2371
+
2372
+ case 'type_star_rating': {
2373
+ if($element_value=='')
2374
+ $element_value = '/';
2375
+
2376
+ $params_names = array('w_field_label_size','w_field_label_pos','w_field_label_col','w_star_amount','w_required','w_class');
2377
+ $temp = $params;
2378
+ foreach($params_names as $params_name ) {
2379
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
2380
+ $param[$params_name] = $temp[0];
2381
+ $temp=$temp[1];
2382
+ }
2383
+
2384
+ if($temp) {
2385
+ $temp =explode('*:*w_attr_name*:*',$temp);
2386
+ $attrs = array_slice($temp,0, count($temp)-1);
2387
+ foreach($attrs as $attr)
2388
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
2389
+ }
2390
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
2391
+
2392
+ $element_value = explode('/', $element_value);
2393
+
2394
+ $images = '';
2395
+ for($i=0; $i<$element_value[1]; $i++) {
2396
+ $images .= '<img id="wdform_'.$id1.'_star_'.$i.'_'.$form_id.'" src="' . WD_FM_URL . '/images/star.png" >';
2397
+
2398
+ $onload_js .='jQuery("#wdform_'.$id1.'_star_'.$i.'_'.$form_id.'").mouseover(function() {change_src('.$i.',"wdform_'.$id1.'", "'.$form_id.'", "'.$param['w_field_label_col'].'");});';
2399
+ $onload_js .='jQuery("#wdform_'.$id1.'_star_'.$i.'_'.$form_id.'").mouseout(function() {reset_src('.$i.',"wdform_'.$id1.'", "'.$form_id.'");});';
2400
+ $onload_js .='jQuery("#wdform_'.$id1.'_star_'.$i.'_'.$form_id.'").click(function() {select_star_rating('.$i.',"wdform_'.$id1.'", "'.$form_id.'","'.$param['w_field_label_col'].'", "'.$element_value[1].'");});';
2401
+ $onload_js .='select_star_rating('.($element_value[0]-1).',"wdform_'.$id1.'", "'.$form_id.'","'.$param['w_field_label_col'].'", "'.$element_value[1].'");';
2402
+ }
2403
+
2404
+ $rep ='<div type="type_star_rating" class="wdform-field"><div class="wdform-label-section '.$param['w_class'].'" style="'.$param['w_field_label_pos'].' width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
2405
+
2406
+ $rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos'].'"><div id="wdform_'.$id1.'_element'.$form_id.'" '.$param['attributes'].'>'.$images.'</div><input type="hidden" value="" id="wdform_'.$id1.'_selected_star_amount'.$form_id.'" name="wdform_'.$id1.'_selected_star_amount'.$form_id.'"></div></div>';
2407
+
2408
+
2409
+ $onsubmit_js.='
2410
+ jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_star_amount'.$form_id.'\" value = \"'.$param['w_star_amount'].'\" />").appendTo("#form'.$form_id.'");
2411
+ ';
2412
+
2413
+ break;
2414
+ }
2415
+ case 'type_scale_rating': {
2416
+
2417
+ if($element_value=='')
2418
+ $element_value = '/';
2419
+
2420
+ $params_names=array('w_field_label_size','w_field_label_pos','w_mini_labels','w_scale_amount','w_required','w_class');
2421
+ $temp=$params;
2422
+ foreach($params_names as $params_name ) {
2423
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
2424
+ $param[$params_name] = $temp[0];
2425
+ $temp=$temp[1];
2426
+ }
2427
+
2428
+ if($temp) {
2429
+ $temp =explode('*:*w_attr_name*:*',$temp);
2430
+ $attrs = array_slice($temp,0, count($temp)-1);
2431
+ foreach($attrs as $attr)
2432
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
2433
+ }
2434
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
2435
+
2436
+ $element_value = explode('/',$element_value);
2437
+ $w_mini_labels = explode('***',$param['w_mini_labels']);
2438
+
2439
+ $numbers = '';
2440
+ $radio_buttons = '';
2441
+ $to_check=0;
2442
+ $to_check=$element_value[0];
2443
+
2444
+ for($i=1; $i<=$element_value[1]; $i++) {
2445
+ $numbers.= '<div style="text-align: center; display: table-cell;"><span>'.$i.'</span></div>';
2446
+ $radio_buttons.= '<div style="text-align: center; display: table-cell;"><div class="radio-div"><input id="wdform_'.$id1.'_scale_radio'.$form_id.'_'.$i.'" name="wdform_'.$id1.'_scale_radio'.$form_id.'" value="'.$i.'" type="radio" '.( $to_check==$i ? 'checked="checked"' : '' ).'><label for="wdform_'.$id1.'_scale_radio'.$form_id.'_'.$i.'"></label></div></div>';
2447
+ }
2448
+
2449
+ $rep ='<div type="type_scale_rating" class="wdform-field"><div class="wdform-label-section '.$param['w_class'].'" style="'.$param['w_field_label_pos'].' width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
2450
+
2451
+ $rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos'].'"><div id="wdform_'.$id1.'_element'.$form_id.'" style="float: left;" '.$param['attributes'].'><label class="mini_label">'.$w_mini_labels[0].'</label><div style="display: inline-table; vertical-align: middle;border-spacing: 7px;"><div style="display: table-row;">'.$numbers.'</div><div style="display: table-row;">'.$radio_buttons.'</div></div><label class="mini_label" >'.$w_mini_labels[1].'</label></div></div></div>';
2452
+
2453
+ $onsubmit_js.='
2454
+ jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_scale_amount'.$form_id.'\" value = \"'.$param['w_scale_amount'].'\" />").appendTo("#form'.$form_id.'");
2455
+ ';
2456
+
2457
+ break;
2458
+ }
2459
+
2460
+ case 'type_spinner': {
2461
+
2462
+ $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');
2463
+ $temp=$params;
2464
+ foreach($params_names as $params_name ) {
2465
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
2466
+ $param[$params_name] = $temp[0];
2467
+ $temp=$temp[1];
2468
+ }
2469
+
2470
+ if($temp) {
2471
+ $temp =explode('*:*w_attr_name*:*',$temp);
2472
+ $attrs = array_slice($temp,0, count($temp)-1);
2473
+ foreach($attrs as $attr)
2474
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
2475
+ }
2476
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
2477
+
2478
+
2479
+ $rep ='<div type="type_spinner" class="wdform-field"><div class="wdform-label-section '.$param['w_class'].'" style="'.$param['w_field_label_pos'].' width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
2480
+
2481
+ $rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos'].'"><input type="text" value="'.($element_value!= 'null' ? $element_value : '').'" name="wdform_'.$id1.'_element'.$form_id.'" id="wdform_'.$id1.'_element'.$form_id.'" style="width: '.$param['w_field_width'].'px;" '.$param['attributes'].'></div></div>';
2482
+
2483
+ $onload_js .='
2484
+ jQuery("#wdform_'.$id1.'_element'.$form_id.'")[0].spin = null;
2485
+ spinner = jQuery("#wdform_'.$id1.'_element'.$form_id.'").spinner();
2486
+ spinner.spinner( "value", "'.($element_value!= 'null' ? $element_value : '').'");
2487
+ jQuery("#wdform_'.$id1.'_element'.$form_id.'").spinner({ min: "'.$param['w_field_min_value'].'"});
2488
+ jQuery("#wdform_'.$id1.'_element'.$form_id.'").spinner({ max: "'.$param['w_field_max_value'].'"});
2489
+ jQuery("#wdform_'.$id1.'_element'.$form_id.'").spinner({ step: "'.$param['w_field_step'].'"});
2490
+ ';
2491
+
2492
+ break;
2493
+ }
2494
+
2495
+ case 'type_slider': {
2496
+
2497
+ $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');
2498
+ $temp=$params;
2499
+ foreach($params_names as $params_name ) {
2500
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
2501
+ $param[$params_name] = $temp[0];
2502
+ $temp=$temp[1];
2503
+ }
2504
+
2505
+ if($temp) {
2506
+ $temp =explode('*:*w_attr_name*:*',$temp);
2507
+ $attrs = array_slice($temp,0, count($temp)-1);
2508
+ foreach($attrs as $attr)
2509
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
2510
+ }
2511
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
2512
+
2513
+
2514
+ $rep ='<div type="type_slider" class="wdform-field"><div class="wdform-label-section '.$param['w_class'].'" style="'.$param['w_field_label_pos'].' width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
2515
+
2516
+
2517
+ $rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos'].'"><input type="hidden" value="'.$element_value.'" id="wdform_'.$id1.'_slider_value'.$form_id.'" name="wdform_'.$id1.'_slider_value'.$form_id.'"><div name="'.$id1.'_element'.$form_id.'" id="wdform_'.$id1.'_element'.$form_id.'" style="width: '.$param['w_field_width'].'px;" '.$param['attributes'].'"></div><div align="left" style="display: inline-block; width: 33.3%; text-align: left;"><span id="wdform_'.$id1.'_element_min'.$form_id.'" class="label">'.$param['w_field_min_value'].'</span></div><div align="right" style="display: inline-block; width: 33.3%; text-align: center;"><span id="wdform_'.$id1.'_element_value'.$form_id.'" class="label">'.$element_value.'</span></div><div align="right" style="display: inline-block; width: 33.3%; text-align: right;"><span id="wdform_'.$id1.'_element_max'.$form_id.'" class="label">'.$param['w_field_max_value'].'</span></div></div></div>';
2518
+
2519
+
2520
+ $onload_js .='
2521
+ jQuery("#wdform_'.$id1.'_element'.$form_id.'")[0].slide = null;
2522
+ jQuery("#wdform_'.$id1.'_element'.$form_id.'").slider({
2523
+ range: "min",
2524
+ value: eval('.$element_value.'),
2525
+ min: eval('.$param['w_field_min_value'].'),
2526
+ max: eval('.$param['w_field_max_value'].'),
2527
+ slide: function( event, ui ) {
2528
+
2529
+ jQuery("#wdform_'.$id1.'_element_value'.$form_id.'").html("" + ui.value)
2530
+ jQuery("#wdform_'.$id1.'_slider_value'.$form_id.'").val("" + ui.value)
2531
+
2532
+ }
2533
+ });
2534
+ ';
2535
+
2536
+ break;
2537
+ }
2538
+
2539
+
2540
+ case 'type_range': {
2541
+
2542
+ if($element_value=='')
2543
+ $element_value = '-';
2544
+
2545
+ $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');
2546
+ $temp=$params;
2547
+ foreach($params_names as $params_name ) {
2548
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
2549
+ $param[$params_name] = $temp[0];
2550
+ $temp=$temp[1];
2551
+ }
2552
+
2553
+ if($temp) {
2554
+ $temp =explode('*:*w_attr_name*:*',$temp);
2555
+ $attrs = array_slice($temp,0, count($temp)-1);
2556
+ foreach($attrs as $attr)
2557
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
2558
+ }
2559
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
2560
+
2561
+ $element_value = explode('-',$element_value);
2562
+
2563
+ $w_mini_labels = explode('***',$param['w_mini_labels']);
2564
+
2565
+ $rep ='<div type="type_range" class="wdform-field"><div class="wdform-label-section '.$param['w_class'].'" style="'.$param['w_field_label_pos'].' width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
2566
+
2567
+ $rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos'].'"><div style="display: table;"><div style="display: table-row;"><div valign="middle" align="left" style="display: table-cell;"><input type="text" value="'.($element_value[0]!= 'null' ? $element_value[0] : '').'" name="wdform_'.$id1.'_element'.$form_id.'0" id="wdform_'.$id1.'_element'.$form_id.'0" style="width: '.$param['w_field_range_width'].'px;" '.$param['attributes'].'></div><div valign="middle" align="left" style="display: table-cell; padding-left: 4px;"><input type="text" value="'.($element_value[1]!= 'null' ? $element_value[1] : '').'" name="wdform_'.$id1.'_element'.$form_id.'1" id="wdform_'.$id1.'_element'.$form_id.'1" style="width: '.$param['w_field_range_width'].'px;" '.$param['attributes'].'></div></div><div style="display: table-row;"><div valign="top" align="left" style="display: table-cell;"><label class="mini_label" id="wdform_'.$id1.'_mini_label_from">'.$w_mini_labels[0].'</label></div><div valign="top" align="left" style="display: table-cell;"><label class="mini_label" id="wdform_'.$id1.'_mini_label_to">'.$w_mini_labels[1].'</label></div></div></div></div></div>';
2568
+
2569
+ $onload_js .='
2570
+ jQuery("#wdform_'.$id1.'_element'.$form_id.'0")[0].spin = null;
2571
+ jQuery("#wdform_'.$id1.'_element'.$form_id.'1")[0].spin = null;
2572
+
2573
+ spinner0 = jQuery("#wdform_'.$id1.'_element'.$form_id.'0").spinner();
2574
+ spinner0.spinner( "value", "'.($element_value[0]!= 'null' ? $element_value[0] : '').'");
2575
+ jQuery("#wdform_'.$id1.'_element'.$form_id.'").spinner({ step: '.$param['w_field_range_step'].'});
2576
+
2577
+ spinner1 = jQuery("#wdform_'.$id1.'_element'.$form_id.'1").spinner();
2578
+ spinner1.spinner( "value", "'.($element_value[1]!= 'null' ? $element_value[1] : '').'");
2579
+ jQuery("#wdform_'.$id1.'_element'.$form_id.'").spinner({ step: '.$param['w_field_range_step'].'});
2580
+ ';
2581
+
2582
+ break;
2583
+ }
2584
+
2585
+ case 'type_grading': {
2586
+ $params_names=array('w_field_label_size','w_field_label_pos', 'w_items', 'w_total', 'w_required','w_class');
2587
+ $temp=$params;
2588
+ foreach($params_names as $params_name ) {
2589
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
2590
+ $param[$params_name] = $temp[0];
2591
+ $temp=$temp[1];
2592
+ }
2593
+
2594
+ if($temp) {
2595
+ $temp =explode('*:*w_attr_name*:*',$temp);
2596
+ $attrs = array_slice($temp,0, count($temp)-1);
2597
+ foreach($attrs as $attr)
2598
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
2599
+ }
2600
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
2601
+
2602
+
2603
+ $element_value = explode(':', $element_value);
2604
+
2605
+ $w_items = explode('***',$param['w_items']);
2606
+
2607
+ $w_items_labels =implode(':',$w_items);
2608
+
2609
+ $grading_items ='';
2610
+
2611
+
2612
+ for($i=0; $i<(count($element_value))/2-1; $i++) {
2613
+ $value=$element_value[$i];
2614
+
2615
+ $grading_items .= '<div class="wdform_grading"><input type="text" id="wdform_'.$id1.'_element'.$form_id.'_'.$i.'" name="wdform_'.$id1.'_element'.$form_id.'_'.$i.'" value="'.$value.'" '.$param['attributes'].'><label class="wdform-ch-rad-label" for="wdform_'.$id1.'_element'.$form_id.'_'.$i.'">'.$w_items[$i].'</label></div>';
2616
+
2617
+ }
2618
+
2619
+ $rep ='<div type="type_grading" class="wdform-field"><div class="wdform-label-section '.$param['w_class'].'" style="'.$param['w_field_label_pos'].' width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
2620
+
2621
+ $rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos'].'"><input type="hidden" value="'.$param['w_total'].'" name="wdform_'.$id1.'_grading_total'.$form_id.'" id="wdform_'.$id1.'_grading_total'.$form_id.'"><div id="wdform_'.$id1.'_element'.$form_id.'">'.$grading_items.'<div id="wdform_'.$id1.'_element_total_div'.$form_id.'" class="grading_div">Total: <span id="wdform_'.$id1.'_sum_element'.$form_id.'">0</span>/<span id="wdform_'.$id1.'_total_element'.$form_id.'">'.$param['w_total'].'</span><span id="wdform_'.$id1.'_text_element'.$form_id.'"></span></div></div></div></div>';
2622
+
2623
+ $onload_js.='
2624
+ jQuery("#wdform_'.$id1.'_element'.$form_id.' input").change(function() {sum_grading_values("wdform_'.$id1.'","'.$form_id.'");});';
2625
+
2626
+ $onload_js.='
2627
+ jQuery("#wdform_'.$id1.'_element'.$form_id.' input").keyup(function() {sum_grading_values("wdform_'.$id1.'","'.$form_id.'");});';
2628
+
2629
+
2630
+ $onload_js.='
2631
+ sum_grading_values("wdform_'.$id1.'","'.$form_id.'");';
2632
+
2633
+ $onsubmit_js.='
2634
+ jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_hidden_item'.$form_id.'\" value = \"'.$w_items_labels.':'.$param['w_total'].'\" />").appendTo("#form'.$form_id.'");
2635
+ ';
2636
+
2637
+ break;
2638
+ }
2639
+ case 'type_matrix': {
2640
+
2641
+ $params_names=array('w_field_label_size','w_field_label_pos', 'w_field_input_type', 'w_rows', 'w_columns', 'w_required','w_class');
2642
+ $temp=$params;
2643
+ foreach($params_names as $params_name ) {
2644
+ $temp=explode('*:*'.$params_name.'*:*',$temp);
2645
+ $param[$params_name] = $temp[0];
2646
+ $temp=$temp[1];
2647
+ }
2648
+
2649
+ if($temp) {
2650
+ $temp =explode('*:*w_attr_name*:*',$temp);
2651
+ $attrs = array_slice($temp,0, count($temp)-1);
2652
+ foreach($attrs as $attr)
2653
+ $param['attributes'] = $param['attributes'].' add_'.$attr;
2654
+ }
2655
+
2656
+ $param['w_field_label_pos'] = ($param['w_field_label_pos']=="left" ? "float: left;" : "display:block;");
2657
+ $w_rows = explode('***',$param['w_rows']);
2658
+ $w_columns = explode('***',$param['w_columns']);
2659
+ $element_value = str_replace("******matrix***","",$element_value);
2660
+ $element_value = explode($param['w_field_input_type'].'***', $element_value);
2661
+ $element_value = explode('***', $element_value[1]);
2662
+ $column_labels ='';
2663
+
2664
+ for($i=1; $i<count($w_columns); $i++) {
2665
+ $column_labels .= '<div><label class="wdform-ch-rad-label">'.$w_columns[$i].'</label></div>';
2666
+ }
2667
+
2668
+ $rows_columns = '';
2669
+ $for_matrix =0;
2670
+ for($i=1; $i<count($w_rows); $i++) {
2671
+
2672
+ $rows_columns .= '<div class="wdform-matrix-row'.($i%2).'"><div class="wdform-matrix-column"><label class="wdform-ch-rad-label" >'.$w_rows[$i].'</label></div>';
2673
+
2674
+
2675
+ for($k=1; $k<count($w_columns); $k++) {
2676
+ $rows_columns .= '<div class="wdform-matrix-cell">';
2677
+ if($param['w_field_input_type']=='radio') {
2678
+ if (array_key_exists($i-1,$element_value))
2679
+ $to_check=$element_value[$i-1];
2680
+ else
2681
+ $to_check= '' ;
2682
+
2683
+ $rows_columns .= '<div class="radio-div"><input id="wdform_'.$id1.'_input_element'.$form_id.''.$i.'_'.$k.'" type="radio" name="wdform_'.$id1.'_input_element'.$form_id.''.$i.'" value="'.$i.'_'.$k.'" '.($to_check==$i.'_'.$k ? 'checked="checked"' : '').'><label for="wdform_'.$id1.'_input_element'.$form_id.''.$i.'_'.$k.'"></label></div>';
2684
+
2685
+ }
2686
+ else
2687
+ if($param['w_field_input_type']=='checkbox') {
2688
+
2689
+ if (array_key_exists($for_matrix,$element_value))
2690
+ $to_check=$element_value[$for_matrix];
2691
+ else
2692
+ $to_check= '' ;
2693
+
2694
+ $rows_columns .= '<div class="checkbox-div"><input id="wdform_'.$id1.'_input_element'.$form_id.''.$i.'_'.$k.'" type="checkbox" name="wdform_'.$id1.'_input_element'.$form_id.''.$i.'_'.$k.'" value="1" '.($to_check=="1" ? 'checked="checked"' : '').'><label for="wdform_'.$id1.'_input_element'.$form_id.''.$i.'_'.$k.'"></label></div>';
2695
+
2696
+ $for_matrix++;
2697
+ }
2698
+ else
2699
+ if($param['w_field_input_type']=='text') {
2700
+ $rows_columns .= '<input id="wdform_'.$id1.'_input_element'.$form_id.''.$i.'_'.$k.'" type="text" name="wdform_'.$id1.'_input_element'.$form_id.''.$i.'_'.$k.'" value="'.(array_key_exists($for_matrix,$element_value) ? $element_value[$for_matrix] : '').'">';
2701
+
2702
+ $for_matrix++;
2703
+ }
2704
+ else
2705
+ if($param['w_field_input_type']=='select') {
2706
+ $rows_columns .= '<select id="wdform_'.$id1.'_select_yes_no'.$form_id.''.$i.'_'.$k.'" name="wdform_'.$id1.'_select_yes_no'.$form_id.''.$i.'_'.$k.'" ><option value="" '.(array_key_exists($for_matrix,$element_value) ? ($element_value[$for_matrix]=="" ? "selected=\"selected\"": "") : '').'> </option><option value="yes" '.(array_key_exists($for_matrix,$element_value) ? ($element_value[$for_matrix]=="yes" ? "selected=\"selected\"": "") : '').'>Yes</option><option value="no" '.(array_key_exists($for_matrix,$element_value) ? ($element_value[$for_matrix]=="no" ? "selected=\"selected\"": "") : '').'>No</option></select>';
2707
+
2708
+ $for_matrix++;
2709
+ }
2710
+ $rows_columns.='</div>';
2711
+ }
2712
+
2713
+ $rows_columns .= '</div>';
2714
+ }
2715
+
2716
+ $rep ='<div type="type_matrix" class="wdform-field"><div class="wdform-label-section '.$param['w_class'].'" style="'.$param['w_field_label_pos'].' width: '.$param['w_field_label_size'].'px;"><span class="wdform-label">'.$label.'</span>';
2717
+
2718
+ $rep.='</div><div class="wdform-element-section '.$param['w_class'].'" style="'.$param['w_field_label_pos'].'"><div id="wdform_'.$id1.'_element'.$form_id.'" class="wdform-matrix-table" '.$param['attributes'].'><div style="display: table-row-group;"><div class="wdform-matrix-head"><div style="display: table-cell;"></div>'.$column_labels.'</div>'.$rows_columns.'</div></div></div></div>';
2719
+
2720
+ $onsubmit_js.='
2721
+ jQuery("<input type=\"hidden\" name=\"wdform_'.$id1.'_input_type'.$form_id.'\" value = \"'.$param['w_field_input_type'].'\" /><input type=\"hidden\" name=\"wdform_'.$id1.'_hidden_row'.$form_id.'\" value = \"'.$param['w_rows'].'\" /><input type=\"hidden\" name=\"wdform_'.$id1.'_hidden_column'.$form_id.'\" value = \"'.$param['w_columns'].'\" />").appendTo("#form'.$form_id.'");
2722
+ ';
2723
+
2724
+ break;
2725
+ }
2726
+ }
2727
+ $form = str_replace('%'.$id1.' - '.$labels[$id1s_key].'%', $rep, $form);
2728
+ }
2729
+ }
2730
+ echo $form;
2731
+ ?>
2732
+ <input type="hidden" name="option" value="com_formmaker"/>
2733
+ <input type="hidden" id="current_id" name="current_id" value="<?php echo $rows[0]->group_id; ?>" />
2734
+ <input type="hidden" name="form_id" value="<?php echo $rows[0]->form_id; ?>" />
2735
+ <input type="hidden" name="date" value="<?php echo $rows[0]->date; ?>" />
2736
+ <input type="hidden" name="ip" value="<?php echo $rows[0]->ip; ?>" />
2737
+ <input type="hidden" id="task" name="task" value="" />
2738
+ <input type="hidden" value="<?php echo WD_FM_URL; ?>" id="form_plugins_url" />
2739
+ <script type="text/javascript">
2740
+ function pressbutton() {
2741
+ <?php echo $onsubmit_js; ?>;
2742
+ }
2743
+ jQuery("div[type='type_number'] input, div[type='type_phone'] input, div[type='type_spinner'] input, div[type='type_range'] input, .wdform-quantity").keypress(function(evt) {
2744
+ return check_isnum(evt);
2745
+ });
2746
+ jQuery("div[type='type_grading'] input").keypress(function() {
2747
+ return check_isnum_or_minus(event);
2748
+ });
2749
+ plugin_url = '<?php echo WD_FM_URL; ?>';
2750
+ <?php
2751
+ if ($onload_js) {
2752
+ ?>
2753
+ jQuery(window).load(function () {
2754
+ <?php echo $onload_js; ?>;
2755
+ });
2756
+ <?php
2757
+ }
2758
+ ?>
2759
+ </script>
2760
+ </form>
2761
+ <?php
2762
+ }
2763
+ }
2764
+
2765
+ ?>
admin/views/FMViewThemes_fm.php ADDED
@@ -0,0 +1,208 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMViewThemes_fm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ // Constructor & Destructor //
17
+ ////////////////////////////////////////////////////////////////////////////////////////
18
+ public function __construct($model) {
19
+ $this->model = $model;
20
+ }
21
+
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
26
+ $rows_data = $this->model->get_rows_data();
27
+ $page_nav = $this->model->page_nav();
28
+ $search_value = ((isset($_POST['search_value'])) ? esc_html($_POST['search_value']) : '');
29
+ $search_select_value = ((isset($_POST['search_select_value'])) ? (int)$_POST['search_select_value'] : 0);
30
+ $asc_or_desc = ((isset($_POST['asc_or_desc'])) ? esc_html($_POST['asc_or_desc']) : 'asc');
31
+ $order_by = (isset($_POST['order_by']) ? esc_html($_POST['order_by']) : 'id');
32
+ $order_class = 'manage-column column-title sorted ' . $asc_or_desc;
33
+ $ids_string = '';
34
+ ?>
35
+ <div style="clear: both; float: left; width: 99%;">
36
+ <div style="float:left; font-size: 14px; font-weight: bold;">
37
+ This section allows you to edit form themes.
38
+ <a style="color: blue; text-decoration: none;" target="_blank" href="http://web-dorado.com/wordpress-form-maker-guide-2.html">Read More in User Manual</a>
39
+ </div>
40
+ <div style="float: right; text-align: right;">
41
+ <a style="text-decoration: none;" target="_blank" href="http://web-dorado.com/products/wordpress-form.html">
42
+ <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FM_URL . '/images/wd_logo.png'; ?>" />
43
+ </a>
44
+ </div>
45
+ </div>
46
+ <form class="wrap" id="themes_form" method="post" action="admin.php?page=themes_fm" style="float: left; width: 99%;">
47
+ <span class="theme_icon"></span>
48
+ <h2>
49
+ Themes
50
+ <a href="" class="add-new-h2" onclick="spider_set_input_value('task', 'add');
51
+ spider_form_submit(event, 'themes_form')">Add new</a>
52
+ </h2>
53
+ <div class="buttons_div">
54
+ <input class="button-secondary" type="submit" onclick="if (confirm('Do you want to delete selected items?')) {
55
+ spider_set_input_value('task', 'delete_all');
56
+ } else {
57
+ return false;
58
+ }" value="Delete" />
59
+ </div>
60
+ <div class="tablenav top">
61
+ <?php
62
+ WDW_FM_Library::search('Title', $search_value, 'themes_form');
63
+ WDW_FM_Library::html_page_nav($page_nav['total'], $page_nav['limit'], 'themes_form');
64
+ ?>
65
+ </div>
66
+ <table class="wp-list-table widefat fixed pages">
67
+ <thead>
68
+ <th class="manage-column column-cb check-column table_small_col"><input id="check_all" type="checkbox" style="margin:0;"/></th>
69
+ <th class="table_small_col <?php if ($order_by == 'id') { echo $order_class; } ?>">
70
+ <a onclick="spider_set_input_value('task', '');
71
+ spider_set_input_value('order_by', 'id');
72
+ spider_set_input_value('asc_or_desc', '<?php echo ((isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && (esc_html($_POST['order_by']) == 'id') && esc_html($_POST['asc_or_desc']) == 'asc') ? 'desc' : 'asc'); ?>');
73
+ spider_form_submit(event, 'themes_form')" href="">
74
+ <span>ID</span><span class="sorting-indicator"></span></a>
75
+ </th>
76
+ <th class="<?php if ($order_by == 'title') { echo $order_class; } ?>">
77
+ <a onclick="spider_set_input_value('task', '');
78
+ spider_set_input_value('order_by', 'title');
79
+ spider_set_input_value('asc_or_desc', '<?php echo ((isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && (esc_html($_POST['order_by']) == 'title') && esc_html($_POST['asc_or_desc']) == 'asc') ? 'desc' : 'asc'); ?>');
80
+ spider_form_submit(event, 'themes_form')" href="">
81
+ <span>Title</span><span class="sorting-indicator"></span></a>
82
+ </th>
83
+ <th class="table_big_col <?php if ($order_by == 'default') { echo $order_class; } ?>">
84
+ <a onclick="spider_set_input_value('task', '');
85
+ spider_set_input_value('order_by', 'default');
86
+ spider_set_input_value('asc_or_desc', '<?php echo ((isset($_POST['asc_or_desc']) && isset($_POST['order_by']) && (esc_html($_POST['order_by']) == 'default') && esc_html($_POST['asc_or_desc']) == 'asc') ? 'desc' : 'asc'); ?>');
87
+ spider_form_submit(event, 'themes_form')" href="">
88
+ <span>Default</span><span class="sorting-indicator"></span></a>
89
+ </th>
90
+ <th class="table_big_col">Edit</th>
91
+ <th class="table_big_col">Delete</th>
92
+ </thead>
93
+ <tbody id="tbody_arr">
94
+ <?php
95
+ if ($rows_data) {
96
+ foreach ($rows_data as $row_data) {
97
+ $alternate = (!isset($alternate) || $alternate == 'class="alternate"') ? '' : 'class="alternate"';
98
+ $default_image = (($row_data->default) ? 'default' : 'notdefault');
99
+ $default = (($row_data->default) ? '' : 'setdefault');
100
+ ?>
101
+ <tr id="tr_<?php echo $row_data->id; ?>" <?php echo $alternate; ?>>
102
+ <td class="table_small_col check-column">
103
+ <input id="check_<?php echo $row_data->id; ?>" name="check_<?php echo $row_data->id; ?>" type="checkbox"/>
104
+ </td>
105
+ <td class="table_small_col"><?php echo $row_data->id; ?></td>
106
+ <td>
107
+ <a onclick="spider_set_input_value('task', 'edit');
108
+ spider_set_input_value('current_id', '<?php echo $row_data->id; ?>');
109
+ spider_form_submit(event, 'themes_form')" href="" title="Edit"><?php echo $row_data->title; ?></a>
110
+ </td>
111
+ <td class="table_big_col">
112
+ <?php
113
+ if ($default != '') {
114
+ ?>
115
+ <a onclick="spider_set_input_value('task', '<?php echo $default; ?>');
116
+ spider_set_input_value('current_id', '<?php echo $row_data->id; ?>');
117
+ spider_form_submit(event, 'themes_form')" href="">
118
+ <?php
119
+ }
120
+ ?>
121
+ <img src="<?php echo WD_FM_URL . '/images/' . $default_image . '.png'; ?>" />
122
+ <?php
123
+ if ($default != '') {
124
+ ?>
125
+ </a>
126
+ <?php
127
+ }
128
+ ?>
129
+ </td>
130
+ <td class="table_big_col">
131
+ <a onclick="spider_set_input_value('task', 'edit');
132
+ spider_set_input_value('current_id', '<?php echo $row_data->id; ?>');
133
+ spider_form_submit(event, 'themes_form')" href="">Edit</a>
134
+ </td>
135
+ <td class="table_big_col">
136
+ <a onclick="spider_set_input_value('task', 'delete');
137
+ spider_set_input_value('current_id', '<?php echo $row_data->id; ?>');
138
+ spider_form_submit(event, 'themes_form')" href="">Delete</a>
139
+ </td>
140
+ </tr>
141
+ <?php
142
+ $ids_string .= $row_data->id . ',';
143
+ }
144
+ }
145
+ ?>
146
+ </tbody>
147
+ </table>
148
+ <input id="task" name="task" type="hidden" value=""/>
149
+ <input id="current_id" name="current_id" type="hidden" value=""/>
150
+ <input id="ids_string" name="ids_string" type="hidden" value="<?php echo $ids_string; ?>"/>
151
+ <input id="asc_or_desc" name="asc_or_desc" type="hidden" value="asc"/>
152
+ <input id="order_by" name="order_by" type="hidden" value="<?php echo $order_by; ?>"/>
153
+ </form>
154
+ <?php
155
+ }
156
+
157
+ public function edit($id, $reset) {
158
+ $row = $this->model->get_row_data($id, $reset);
159
+ $page_title = (($id != 0) ? 'Edit theme ' . $row->title : 'Create new theme');
160
+ ?>
161
+ <div style="clear: both; float: left; width: 99%;">
162
+ <div style="float:left; font-size: 14px; font-weight: bold;">
163
+ This section allows you to edit form themes.
164
+ <a style="color: blue; text-decoration: none;" target="_blank" href="http://web-dorado.com/wordpress-form-maker-guide-2.html">Read More in User Manual</a>
165
+ </div>
166
+ <div style="float: right; text-align: right;">
167
+ <a style="text-decoration: none;" target="_blank" href="http://web-dorado.com/products/wordpress-form.html">
168
+ <img width="215" border="0" alt="web-dorado.com" src="<?php echo WD_FM_URL . '/images/wd_logo.png'; ?>" />
169
+ </a>
170
+ </div>
171
+ </div>
172
+ <form class="wrap" method="post" action="admin.php?page=themes_fm" style="float: left; width: 99%;">
173
+ <span class="theme_icon"></span>
174
+ <h2><?php echo $page_title; ?></h2>
175
+ <div style="float: right; margin: 0 5px 0 0;">
176
+ <input class="button-secondary" type="submit" onclick="if (spider_check_required('title', 'Title')) {return false;}; spider_set_input_value('task', 'save')" value="Save"/>
177
+ <input class="button-secondary" type="submit" onclick="if (spider_check_required('title', 'Title')) {return false;}; spider_set_input_value('task', 'apply')" value="Apply"/>
178
+ <input class="button-secondary" type="submit" onclick="spider_set_input_value('task', 'cancel')" value="Cancel"/>
179
+ </div>
180
+ <table style="clear:both;">
181
+ <tbody>
182
+ <tr>
183
+ <td class="spider_label"><label for="title">Title: <span style="color:#FF0000;"> * </span> </label></td>
184
+ <td><input type="text" id="title" name="title" value="<?php echo $row->title; ?>" class="spider_text_input" /></td>
185
+ </tr>
186
+ <tr>
187
+ <td class="spider_label"><label for="css">Css: </label></td>
188
+ <td style="width: 90%;"><textarea id="css" name="css" rows="30" style="width: 100%;"><?php echo htmlspecialchars($row->css) ?></textarea></td>
189
+ </tr>
190
+ </tbody>
191
+ </table>
192
+ <input type="hidden" id="task" name="task" value=""/>
193
+ <input type="hidden" id="current_id" name="current_id" value="<?php echo $row->id; ?>"/>
194
+ <input type="hidden" id="default" name="default" value="<?php echo $row->default; ?>"/>
195
+ </form>
196
+ <?php
197
+ }
198
+
199
+ ////////////////////////////////////////////////////////////////////////////////////////
200
+ // Getters & Setters //
201
+ ////////////////////////////////////////////////////////////////////////////////////////
202
+ ////////////////////////////////////////////////////////////////////////////////////////
203
+ // Private Methods //
204
+ ////////////////////////////////////////////////////////////////////////////////////////
205
+ ////////////////////////////////////////////////////////////////////////////////////////
206
+ // Listeners //
207
+ ////////////////////////////////////////////////////////////////////////////////////////
208
+ }
admin/views/FMViewUninstall_fm.php ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMViewUninstall_fm {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+
16
+ ////////////////////////////////////////////////////////////////////////////////////////
17
+ // Constructor & Destructor //
18
+ ////////////////////////////////////////////////////////////////////////////////////////
19
+ public function __construct($model) {
20
+ $this->model = $model;
21
+ }
22
+ ////////////////////////////////////////////////////////////////////////////////////////
23
+ // Public Methods //
24
+ ////////////////////////////////////////////////////////////////////////////////////////
25
+ public function display() {
26
+ global $wpdb;
27
+ $prefix = $wpdb->prefix;
28
+ ?>
29
+ <form method="post" action="admin.php?page=uninstall_fm" style="width:95%;">
30
+ <?php wp_nonce_field('form_maker uninstall');?>
31
+ <div class="wrap">
32
+ <span class="uninstall_icon"></span>
33
+ <h2>Uninstall Form Maker</h2>
34
+ <p>
35
+ Deactivating Form Maker plugin does not remove any data that may have been created, such as the Forms and the Submissions. To completely remove this plugin, you can uninstall it here.
36
+ </p>
37
+ <p style="color: red;">
38
+ <strong>WARNING:</strong>
39
+ Once uninstalled, this cannot be undone. You should use a Database Backup plugin of WordPress to back up all the data first.
40
+ </p>
41
+ <p style="color: red">
42
+ <strong>The following WordPress Options/Tables will be DELETED:</strong>
43
+ </p>
44
+ <table class="widefat">
45
+ <thead>
46
+ <tr>
47
+ <th>Database Tables</th>
48
+ </tr>
49
+ </thead>
50
+ <tr>
51
+ <td valign="top">
52
+ <ol>
53
+ <li><?php echo $prefix; ?>formmaker</li>
54
+ <li><?php echo $prefix; ?>formmaker_blocked</li>
55
+ <li><?php echo $prefix; ?>formmaker_submits</li>
56
+ <li><?php echo $prefix; ?>formmaker_views</li>
57
+ <li><?php echo $prefix; ?>formmaker_themes</li>
58
+ <li><?php echo $prefix; ?>formmaker_sessions</li>
59
+ </ol>
60
+ </td>
61
+ </tr>
62
+ </table>
63
+ <p style="text-align: center;">
64
+ Do you really want to uninstall Form Maker?
65
+ </p>
66
+ <p style="text-align: center;">
67
+ <input type="checkbox" name="Form Maker" id="check_yes" value="yes" />&nbsp;<label for="check_yes">Yes</label>
68
+ </p>
69
+ <p style="text-align: center;">
70
+ <input type="submit" value="UNINSTALL" class="button-primary" onclick="if (check_yes.checked) {
71
+ if (confirm('You are About to Uninstall Form Maker from WordPress.\nThis Action Is Not Reversible.')) {
72
+ spider_set_input_value('task', 'uninstall');
73
+ } else {
74
+ return false;
75
+ }
76
+ }
77
+ else {
78
+ return false;
79
+ }" />
80
+ </p>
81
+ </div>
82
+ <input id="task" name="task" type="hidden" value="" />
83
+ </form>
84
+ <?php
85
+ }
86
+
87
+ public function uninstall() {
88
+ $this->model->delete_db_tables();
89
+ global $wpdb;
90
+ $prefix = $wpdb->prefix;
91
+ $deactivate_url = wp_nonce_url('plugins.php?action=deactivate&amp;plugin=form-maker/form-maker.php', 'deactivate-plugin_form-maker/form-maker.php');
92
+ ?>
93
+ <div id="message" class="updated fade">
94
+ <p>The following Database Tables succesfully deleted:</p>
95
+ <p><?php echo $prefix; ?>formmaker,</p>
96
+ <p><?php echo $prefix; ?>formmaker_blocked,</p>
97
+ <p><?php echo $prefix; ?>formmaker_sessions,</p>
98
+ <p><?php echo $prefix; ?>formmaker_submits,</p>
99
+ <p><?php echo $prefix; ?>formmaker_themes,</p>
100
+ <p><?php echo $prefix; ?>formmaker_views.</p>
101
+ </div>
102
+ <div class="wrap">
103
+ <h2>Uninstall Form Maker</h2>
104
+ <p><strong><a href="<?php echo $deactivate_url; ?>">Click Here</a> To Finish the Uninstallation and Form Maker will be Deactivated Automatically.</strong></p>
105
+ <input id="task" name="task" type="hidden" value="" />
106
+ </div>
107
+ <?php
108
+ }
109
+
110
+ ////////////////////////////////////////////////////////////////////////////////////////
111
+ // Getters & Setters //
112
+ ////////////////////////////////////////////////////////////////////////////////////////
113
+ ////////////////////////////////////////////////////////////////////////////////////////
114
+ // Private Methods //
115
+ ////////////////////////////////////////////////////////////////////////////////////////
116
+ ////////////////////////////////////////////////////////////////////////////////////////
117
+ // Listeners //
118
+ ////////////////////////////////////////////////////////////////////////////////////////
119
+ }
admin/views/FMViewWidget.php ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FMViewWidget {
4
+ ////////////////////////////////////////////////////////////////////////////////////////
5
+ // Events //
6
+ ////////////////////////////////////////////////////////////////////////////////////////
7
+ ////////////////////////////////////////////////////////////////////////////////////////
8
+ // Constants //
9
+ ////////////////////////////////////////////////////////////////////////////////////////
10
+ ////////////////////////////////////////////////////////////////////////////////////////
11
+ // Variables //
12
+ ////////////////////////////////////////////////////////////////////////////////////////
13
+ private $model;
14
+
15
+ ////////////////////////////////////////////////////////////////////////////////////////
16
+ // Constructor & Destructor //
17
+ ////////////////////////////////////////////////////////////////////////////////////////
18
+ public function __construct($model) {
19
+ $this->model = $model;
20
+ }
21
+ ////////////////////////////////////////////////////////////////////////////////////////
22
+ // Public Methods //
23
+ ////////////////////////////////////////////////////////////////////////////////////////
24
+
25
+ public function display() {
26
+ }
27
+
28
+ function widget($args, $instance) {
29
+ extract($args);
30
+ $title = $instance['title'];
31
+ $form_id = (isset($instance['form_id']) ? $instance['form_id'] : 0);
32
+ // Before widget.
33
+ echo $before_widget;
34
+ // Title of widget.
35
+ if ($title) {
36
+ echo $before_title . $title . $after_title;
37
+ }
38
+ // Widget output.
39
+ require_once(WD_FM_DIR . '/frontend/controllers/FMControllerForm_maker.php');
40
+ $controller_class = 'FMControllerForm_maker';
41
+ $controller = new $controller_class();
42
+ echo $controller->execute($instance['form_id']);
43
+ // After widget.
44
+ echo $after_widget;
45
+ }
46
+
47
+ // Widget Control Panel.
48
+ function form($instance, $id_title, $name_title, $id_form_id, $name_form_id) {
49
+ $defaults = array(
50
+ 'title' => '',
51
+ 'form_id' => 0
52
+ );
53
+ $instance = wp_parse_args((array)$instance, $defaults);
54
+ global $wpdb; ?>
55
+ <p>
56
+ <label for="<?php echo $id_title; ?>">Title:</label>
57
+ <input class="widefat" id="<?php echo $id_title; ?>" name="<?php echo $name_title; ?>" type="text" value="<?php echo $instance['title']; ?>"/>
58
+ <label for="<?php echo $id_form_id; ?>">Select a form:</label>
59
+ <select name="<?php echo $name_form_id; ?>" id="<?php echo $id_form_id; ?>" style="width:225px;text-align:center;">
60
+ <option style="text-align:center" value="0">- Select a Form -</option>
61
+ <?php
62
+ $ids_Form_Maker = $this->model->get_gallery_rows_data();
63
+ foreach ($ids_Form_Maker as $arr_Form_Maker) {
64
+ ?>
65
+ <option value="<?php echo $arr_Form_Maker->id; ?>" <?php if ($arr_Form_Maker->id == $instance['form_id']) {
66
+ echo "SELECTED";
67
+ } ?>><?php echo $arr_Form_Maker->title; ?></option>
68
+ <?php }?>
69
+ </select>
70
+ </p>
71
+ <?php
72
+ }
73
+
74
+ ////////////////////////////////////////////////////////////////////////////////////////
75
+ // Getters & Setters //
76
+ ////////////////////////////////////////////////////////////////////////////////////////
77
+ ////////////////////////////////////////////////////////////////////////////////////////
78
+ // Private Methods //
79
+ ////////////////////////////////////////////////////////////////////////////////////////
80
+ ////////////////////////////////////////////////////////////////////////////////////////
81
+ // Listeners //
82
+ ////////////////////////////////////////////////////////////////////////////////////////
83
+ }
{js → css}/calendar-jos.css RENAMED
@@ -1,22 +1,29 @@
1
  /* The main calendar widget. DIV containing a table. */
2
 
 
 
 
 
 
3
  div.calendar {
4
  position: relative;
5
  z-index: 100;
6
  width: 226px;
7
  }
8
 
9
- .calendar, .calendar table {
 
10
  border: 1px solid #cccccc;
11
  font-size: 11px;
12
  color: #000;
13
  cursor: default;
14
  background: #efefef;
15
  font-family: arial,verdana,sans-serif;
 
 
16
  }
17
 
18
  /* Header part -- contains navigation buttons and day names. */
19
-
20
  .calendar .button { /* "<<", "<", ">", ">>" buttons have this class */
21
  text-align: center; /* They are the navigation buttons */
22
  padding: 2px; /* Make the buttons seem like they're pressing */
@@ -24,16 +31,19 @@ div.calendar {
24
  height:inherit;
25
 
26
  }
27
- .button {
28
-
 
 
 
29
  -webkit-border-radius: 11px !important;;
30
- border-radius: 11px !important;;
31
- text-shadow: white 0px 1px 0px;
32
- bbackground-origin: padding-box;
33
- border-bottom-width: 1px;
34
- border-left-width: 1px;
35
- border-right-width: 1px;
36
- border-top-width: 1px;
37
  }
38
 
39
  .calendar thead .title { /* This holds the current "month, year" */
@@ -134,6 +144,7 @@ div.calendar {
134
 
135
  .calendar tbody .emptycell { /* Empty cells (the best is to hide them) */
136
  visibility: hidden;
 
137
  }
138
 
139
  .calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
@@ -166,7 +177,6 @@ div.calendar {
166
  }
167
 
168
  /* Combo boxes (menus that display months/years for direct selection) */
169
-
170
  .combo {
171
  position: absolute;
172
  display: none;
1
  /* The main calendar widget. DIV containing a table. */
2
 
3
+ /* Form Wordpress. */
4
+ .calendar .button {
5
+ display: table-cell !important;
6
+ }
7
+
8
  div.calendar {
9
  position: relative;
10
  z-index: 100;
11
  width: 226px;
12
  }
13
 
14
+ .calendar,
15
+ .calendar table {
16
  border: 1px solid #cccccc;
17
  font-size: 11px;
18
  color: #000;
19
  cursor: default;
20
  background: #efefef;
21
  font-family: arial,verdana,sans-serif;
22
+ margin: 0;
23
+ line-height: 1.7;
24
  }
25
 
26
  /* Header part -- contains navigation buttons and day names. */
 
27
  .calendar .button { /* "<<", "<", ">", ">>" buttons have this class */
28
  text-align: center; /* They are the navigation buttons */
29
  padding: 2px; /* Make the buttons seem like they're pressing */
31
  height:inherit;
32
 
33
  }
34
+
35
+ .wdform_table1 .button,
36
+ #formMakerDiv1 .button,
37
+ .submitdate_fc .button,
38
+ .main .button {
39
  -webkit-border-radius: 11px !important;;
40
+ border-radius: 11px !important;;
41
+ text-shadow: white 0px 1px 0px;
42
+ background-origin: padding-box;
43
+ border-bottom-width: 1px;
44
+ border-left-width: 1px;
45
+ border-right-width: 1px;
46
+ border-top-width: 1px;
47
  }
48
 
49
  .calendar thead .title { /* This holds the current "month, year" */
144
 
145
  .calendar tbody .emptycell { /* Empty cells (the best is to hide them) */
146
  visibility: hidden;
147
+ padding: 0;
148
  }
149
 
150
  .calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
177
  }
178
 
179
  /* Combo boxes (menus that display months/years for direct selection) */
 
180
  .combo {
181
  position: absolute;
182
  display: none;
css/codemirror.css ADDED
@@ -0,0 +1,168 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .CodeMirror {
2
+ line-height: 1em;
3
+ font-family: monospace;
4
+
5
+ /* Necessary so the scrollbar can be absolutely positioned within the wrapper on Lion. */
6
+ position: relative;
7
+ /* This prevents unwanted scrollbars from showing up on the body and wrapper in IE. */
8
+ overflow: hidden;
9
+ }
10
+
11
+ .CodeMirror-scroll {
12
+ overflow-x: auto;
13
+ overflow-y: hidden;
14
+ height: 400px;
15
+ /* This is needed to prevent an IE[67] bug where the scrolled content
16
+ is visible outside of the scrolling box. */
17
+ position: relative;
18
+ outline: none;
19
+ }
20
+
21
+ /* Vertical scrollbar */
22
+ .CodeMirror-scrollbar {
23
+ float: right;
24
+ overflow-x: hidden;
25
+ overflow-y: scroll;
26
+
27
+ /* This corrects for the 1px gap introduced to the left of the scrollbar
28
+ by the rule for .CodeMirror-scrollbar-inner. */
29
+ margin-left: -1px;
30
+ }
31
+ .CodeMirror-scrollbar-inner {
32
+ /* This needs to have a nonzero width in order for the scrollbar to appear
33
+ in Firefox and IE9. */
34
+ width: 1px;
35
+ }
36
+ .CodeMirror-scrollbar.cm-sb-overlap {
37
+ /* Ensure that the scrollbar appears in Lion, and that it overlap